@zeniai/web-app-ui 5.3.26-dev → 5.3.27-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 (150) hide show
  1. package/dist/assets/AccountMappingScreen-DaqZZA1y.js +9 -0
  2. package/dist/assets/AddressRoutes--CFKCkaL.js +1 -0
  3. package/dist/assets/AddressScreen-Dqyvg_DE.js +9 -0
  4. package/dist/assets/AiCfoScreen-Fn3zvhfE.js +22 -0
  5. package/dist/assets/AppDrawer-D0bkqw7G.js +10 -0
  6. package/dist/assets/{BillPayApprovalRoutes-pwHQS3o9.js → BillPayApprovalRoutes-eILGhkg-.js} +1 -1
  7. package/dist/assets/{BillPayRoutes-dMREYFET.js → BillPayRoutes-37ip4fRF.js} +18 -18
  8. package/dist/assets/{BusinessVerificationPageScreen-CIU6ITVX.js → BusinessVerificationPageScreen-BBPD780e.js} +2 -2
  9. package/dist/assets/{CardsAiCfoScreen-BRT-yq43.js → CardsAiCfoScreen-Baf8zOAK.js} +1 -1
  10. package/dist/assets/{ChargeCardRoutes-CVOY1iE_.js → ChargeCardRoutes-DmeZJCQT.js} +8 -8
  11. package/dist/assets/CompanyPassportScreen-C_pRUVln.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-CUo0NJEq.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-Bwf9kXMI.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-1wxFD7hL.js → CustomerOnboardingRoutes-BLu4eEKn.js} +5 -5
  15. package/dist/assets/{DashboardRoutes-Cd1SkWkW.js → DashboardRoutes-ORzWlYnm.js} +4 -4
  16. package/dist/assets/{DefaultTenantHome-BzGArQdn.js → DefaultTenantHome-i-6bhA98.js} +1 -1
  17. package/dist/assets/DomesticWireDetailScreen-CyLkyrfk.js +18 -0
  18. package/dist/assets/DrawerScreen-BUgCVChB.js +1 -0
  19. package/dist/assets/EntityDetailRoutes-D9J_IXUi.js +1 -0
  20. package/dist/assets/{ExpenseAutomationRoutes--LfNg3pH.js → ExpenseAutomationRoutes-CsGdQ1mY.js} +4 -4
  21. package/dist/assets/FeaturePreviewScreen-Crks8H4y.js +1 -0
  22. package/dist/assets/HubSpotOAuthCallbackScreen-BtM4S0nt.js +1 -0
  23. package/dist/assets/{InboxNotificationsProvider-yp4VlF4V.js → InboxNotificationsProvider-CzhxlkVm.js} +1 -1
  24. package/dist/assets/{InvoicingRoutes-D0AtqhHk.js → InvoicingRoutes-BkqhDwSy.js} +2 -2
  25. package/dist/assets/{MagicLinkRoutes-CX5BmZG-.js → MagicLinkRoutes-D5MiWWQ9.js} +10 -10
  26. package/dist/assets/MagicLinkSignInScreen-DW04FMtl.js +12 -0
  27. package/dist/assets/MobileAppDrawer-CmjsL1eQ.js +1 -0
  28. package/dist/assets/NotFoundScreen-BPjOFceW.js +1 -0
  29. package/dist/assets/NotificationRoutes-B9_H_iqh.js +1 -0
  30. package/dist/assets/OAuthConsentScreen-4cOTWmRk.js +1 -0
  31. package/dist/assets/PandLWithForecastRoutes-FasScyWQ.js +1 -0
  32. package/dist/assets/{PaymentLinkScreen-0MDQfoZq.js → PaymentLinkScreen-B7dK2OwX.js} +5 -5
  33. package/dist/assets/PeopleRoutes-CfXWqRXn.js +22 -0
  34. package/dist/assets/PerformanceRoutes-D4ErL_G-.js +1 -0
  35. package/dist/assets/{Preview-BxM5wosg.js → Preview-D-cOupgE.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-BPvZ-19p.js → QBOConnectionScreen-DHJG1ivI.js} +22 -22
  37. package/dist/assets/ReimbursementApprovalRoutes-COQTrupK.js +1 -0
  38. package/dist/assets/ReimbursementApprovalRuleDetailScreen-C7IYySTX.js +1 -0
  39. package/dist/assets/ReimbursementRoutes-DmGebZS2.js +68 -0
  40. package/dist/assets/ReportsRoutes-DhhA3Eh2.js +1 -0
  41. package/dist/assets/RewardsRoutes-CvdxwlDw.js +1 -0
  42. package/dist/assets/ScreenRoutes-CyuHmZKb.js +2 -0
  43. package/dist/assets/{SettingsRoutes-XkD8UAX3.js → SettingsRoutes-C2oGjPkC.js} +7 -7
  44. package/dist/assets/{SetupPagesScreen-m2xCtrNq.js → SetupPagesScreen-CGt-iJzo.js} +5 -5
  45. package/dist/assets/SignInScreen-CSy256fR.js +1 -0
  46. package/dist/assets/SignOutScreen-B_qJIye2.js +9 -0
  47. package/dist/assets/TaskListScreen-CextY5A5.js +9 -0
  48. package/dist/assets/TaskRoutes-CPBzDWI1.js +9 -0
  49. package/dist/assets/TransactionDetailRoutes-BncTDbnc.js +1 -0
  50. package/dist/assets/TransactionDetailScreen-8UnSIXVI.js +5 -0
  51. package/dist/assets/{TransactionListRoutes-BkZzcgx5.js → TransactionListRoutes-DvLfPQCB.js} +1 -1
  52. package/dist/assets/{TreasuryRoutes-DmVJVDE4.js → TreasuryRoutes-G7tiwivZ.js} +5 -5
  53. package/dist/assets/{VendorsRoutes-DgxrxHfH.js → VendorsRoutes-eWQSdeAw.js} +27 -27
  54. package/dist/assets/{WiseConfirmationScreen-ByccBu4X.js → WiseConfirmationScreen-Bjcw2-vK.js} +2 -2
  55. package/dist/assets/{ZeniAccountRoutes-BujMAkE9.js → ZeniAccountRoutes-u7qTUA3M.js} +10 -10
  56. package/dist/assets/ZeniAccountStatementScreen-BvNm7lVB.js +9 -0
  57. package/dist/assets/{accountMappingHelper-C4yUO_tP.js → accountMappingHelper-CabpVb3J.js} +1 -1
  58. package/dist/assets/{analytics-p9dV2gEo.js → analytics-CsVp7bfq.js} +1 -1
  59. package/dist/assets/{analyticsHelper-B9-PsR8g.js → analyticsHelper-DQMoVHAr.js} +1 -1
  60. package/dist/assets/{core-35eDsgGP.js → core-DFhvjgE1.js} +1 -1
  61. package/dist/assets/{decodeURIComponentSafe-DhnAz_92.js → decodeURIComponentSafe-Bq1r0pP9.js} +1 -1
  62. package/dist/assets/{dnd-Dm1d6mZC.js → dnd-CR945ANw.js} +1 -1
  63. package/dist/assets/{empty-BDPRkuRZ.js → empty-BUo7eNC4.js} +1 -1
  64. package/dist/assets/{empty-DpY1OPz6.js → empty-DtCztbrx.js} +1 -1
  65. package/dist/assets/{emptyVideoElement-C6tD2_Is.js → emptyVideoElement-BHUR8Iif.js} +1 -1
  66. package/dist/assets/epic-CXAAQW1t.js +2 -0
  67. package/dist/assets/{expenseAutomationHelper-XBf0IYWB.js → expenseAutomationHelper-BDz030nC.js} +1 -1
  68. package/dist/assets/getLocaleForTenant-7H39EvyO.js +1 -0
  69. package/dist/assets/{index-DqXFykf0.js → index-BBYtI_9U.js} +1 -1
  70. package/dist/assets/{index-B3U6gyEe.js → index-BaZwiGCV.js} +1 -1
  71. package/dist/assets/{index-D-ldiYpS.js → index-BjpjXshH.js} +1 -1
  72. package/dist/assets/{index-DHtuXNZa.js → index-BuEv25D3.js} +1 -1
  73. package/dist/assets/{index-D-oz9cOM.js → index-BvtiyGfj.js} +1 -1
  74. package/dist/assets/{index-CJI7GB_s.js → index-CFhckac5.js} +1 -1
  75. package/dist/assets/{index-Dck-MxQS.js → index-CKPer1bp.js} +28540 -27684
  76. package/dist/assets/{index-g5u7iWai.js → index-DiQe_6d7.js} +2 -2
  77. package/dist/assets/{lexical-DQ4lSvQh.js → lexical-CCIwPSwQ.js} +1 -1
  78. package/dist/assets/{liveblocks-D0hIH2N0.js → liveblocks-BY1qt3Nf.js} +1 -1
  79. package/dist/assets/{lottie-TJOzQ6Cz.js → lottie-DgdF8254.js} +1 -1
  80. package/dist/assets/{mui-CY_LMiAy.js → mui-DesXezzU.js} +1 -1
  81. package/dist/assets/{pathToGoBack-n4Mx0taW.js → pathToGoBack-9ah_vxgB.js} +1 -1
  82. package/dist/assets/{pdf-DElOA9Iz.js → pdf-BVKoD2Fp.js} +4 -4
  83. package/dist/assets/{pdf-lib-D54M6RaZ.js → pdf-lib-B25n7och.js} +1 -1
  84. package/dist/assets/{plaid-CoaHurGj.js → plaid---yWAm21.js} +1 -1
  85. package/dist/assets/{pusher-BBz5Zhu2.js → pusher-D7k49qkv.js} +1 -1
  86. package/dist/assets/{react-psgyYffq.js → react-B5sZlhmO.js} +1 -1
  87. package/dist/assets/{react-DRB89Tf-.js → react-CNwSpjM6.js} +1 -1
  88. package/dist/assets/{react-Cn6RRlX0.js → react-Cwl8BPa_.js} +1 -1
  89. package/dist/assets/{react-CFjwLJT9.js → react-Dmj3hcZb.js} +1 -1
  90. package/dist/assets/{react-CcppuOI-.js → react-DyW_yLGE.js} +1 -1
  91. package/dist/assets/{react-DlGIFhE7.js → react-KT_bO9_E.js} +1 -1
  92. package/dist/assets/{recharts-B8j-bW95.js → recharts-Co89o1ZO.js} +1 -1
  93. package/dist/assets/routePaths-CpftjCME.js +1 -0
  94. package/dist/assets/{sentry-DhqS_W-k.js → sentry-xWYlrqHr.js} +1 -1
  95. package/dist/assets/{url-BniS_9P1.js → url-B6D8gSqv.js} +1 -1
  96. package/dist/assets/{url-BlblTlRS.js → url-BQb6aJ6P.js} +1 -1
  97. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BGnMOAjq.js +1 -0
  98. package/dist/assets/useAskAiCfoHostNavButtonProps-CxYBeccP.js +1 -0
  99. package/dist/assets/useChargeCardPusherEvents-DD6FQHkD.js +1 -0
  100. package/dist/assets/{useDeviceId-Cd5EU_Dl.js → useDeviceId-BklKiHEX.js} +1 -1
  101. package/dist/assets/useEmailConnectResultRefresh-CeYzFDv9.js +1 -0
  102. package/dist/assets/useInitialThreadRequest-CAaLEese.js +1 -0
  103. package/dist/assets/{useTaskManagerAccess-C0Fwbmvt.js → useTaskManagerAccess-BMNTpSgs.js} +1 -1
  104. package/dist/assets/{utils-CgQOqOwX.js → utils-18zApAFM.js} +1 -1
  105. package/dist/assets/{withTransactionSidePanel-CvrgoXlG.js → withTransactionSidePanel-BqPfYxXB.js} +4 -4
  106. package/dist/assets/{zeni-epic-state-BRRtwAQl.js → zeni-epic-state-DxmmAR38.js} +6 -6
  107. package/dist/index.html +1 -1
  108. package/package.json +3 -3
  109. package/dist/assets/AccountMappingScreen-Boic1d0a.js +0 -9
  110. package/dist/assets/AddressRoutes-0fEsC1oH.js +0 -1
  111. package/dist/assets/AddressScreen-Dp2DEY64.js +0 -9
  112. package/dist/assets/AiCfoScreen-CW4OlYtV.js +0 -22
  113. package/dist/assets/AppDrawer-iwPhifut.js +0 -10
  114. package/dist/assets/CompanyPassportScreen-BCA1m9FT.js +0 -1
  115. package/dist/assets/ConnectionAuthScreen-Bsmh8PR1.js +0 -11
  116. package/dist/assets/CustomerOnboardingAuthScreen-C6RjWCsB.js +0 -1
  117. package/dist/assets/DomesticWireDetailScreen-y67hSw0d.js +0 -18
  118. package/dist/assets/DrawerScreen-C1M2YhTn.js +0 -1
  119. package/dist/assets/EntityDetailRoutes-9DkSsNCu.js +0 -1
  120. package/dist/assets/FeaturePreviewScreen-By9QwwHb.js +0 -1
  121. package/dist/assets/HubSpotOAuthCallbackScreen-BSSLi7ax.js +0 -1
  122. package/dist/assets/MagicLinkSignInScreen-DoIxB0zL.js +0 -12
  123. package/dist/assets/MobileAppDrawer-CLK0v4hO.js +0 -1
  124. package/dist/assets/NotFoundScreen-D0cz8CS4.js +0 -1
  125. package/dist/assets/NotificationRoutes-Bnb2vos6.js +0 -1
  126. package/dist/assets/OAuthConsentScreen-tgDNnphJ.js +0 -1
  127. package/dist/assets/PandLWithForecastRoutes-Bf2BqvnJ.js +0 -1
  128. package/dist/assets/PeopleRoutes-DOzmC_X8.js +0 -22
  129. package/dist/assets/PerformanceRoutes-BIixpS1v.js +0 -1
  130. package/dist/assets/ReimbursementApprovalRoutes-Bdy-6-Pg.js +0 -1
  131. package/dist/assets/ReimbursementApprovalRuleDetailScreen--qsUWYUE.js +0 -1
  132. package/dist/assets/ReimbursementRoutes-BDX8OyTK.js +0 -68
  133. package/dist/assets/ReportsRoutes-RjH9WtMn.js +0 -1
  134. package/dist/assets/RewardsRoutes-CPi4zMM5.js +0 -1
  135. package/dist/assets/ScreenRoutes-Cn2WAq7w.js +0 -2
  136. package/dist/assets/SignInScreen-NwjSrcZC.js +0 -1
  137. package/dist/assets/SignOutScreen-BlQps5kZ.js +0 -9
  138. package/dist/assets/TaskListScreen-BW-xU7Sa.js +0 -9
  139. package/dist/assets/TaskRoutes-BsceFhBl.js +0 -9
  140. package/dist/assets/TransactionDetailRoutes-Dn5BVJxH.js +0 -1
  141. package/dist/assets/TransactionDetailScreen-D6CiVTKH.js +0 -5
  142. package/dist/assets/ZeniAccountStatementScreen-DeWMnJNK.js +0 -9
  143. package/dist/assets/epic-BLC2ItWM.js +0 -2
  144. package/dist/assets/getLocaleForTenant-BBg2Cyvv.js +0 -1
  145. package/dist/assets/routePaths-BDHLk4Ve.js +0 -1
  146. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-C3OYtJva.js +0 -1
  147. package/dist/assets/useAskAiCfoHostNavButtonProps-Cs4YJbah.js +0 -1
  148. package/dist/assets/useChargeCardPusherEvents-CgMKq4Ei.js +0 -1
  149. package/dist/assets/useEmailConnectResultRefresh-D8GDRQig.js +0 -1
  150. package/dist/assets/useInitialThreadRequest-Bzg2iBlf.js +0 -1
@@ -1,68 +0,0 @@
1
- import{j as s}from"./liveblocks-D0hIH2N0.js";import{u as ae,j as A,h as K,g as Q,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-35eDsgGP.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 Qt,gd as Jt,Xw as Kt,_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-BRRtwAQl.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,J as F,ac as se,ad as En,G as Qe,cQ as wn,p as q,aq as Je,cR as xn,U as le,cS as Bn,ao as Tn,a9 as Dn,a5 as ye,S as Ke,w as jn,by as Fn,at as Ln,ag as Un,E as et,cT as _n,h as Pn}from"./index-Dck-MxQS.js";import{n as $,S as Mn}from"./mui-CY_LMiAy.js";import pe from"./NotFoundScreen-D0cz8CS4.js";import{S as Fe}from"./SetupPagesScreen-m2xCtrNq.js";import{F as tt}from"./FeaturePreviewScreen-By9QwwHb.js";import{a as h}from"./sentry-DhqS_W-k.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-Cs4YJbah.js";import{u as nt}from"./useInitialThreadRequest-Bzg2iBlf.js";import{D as $n}from"./DrawerScreen-C1M2YhTn.js";import{M as at}from"./MobileAppDrawer-CLK0v4hO.js";import{F as Nn}from"./ScreenRoutes-Cn2WAq7w.js";import{R as Zn}from"./ReimbursementApprovalRoutes-Bdy-6-Pg.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.js";import"./BusinessVerificationPageScreen-CIU6ITVX.js";import"./routePaths-BDHLk4Ve.js";import"./analyticsHelper-B9-PsR8g.js";import"./InboxNotificationsProvider-yp4VlF4V.js";import"./useTaskManagerAccess-C0Fwbmvt.js";import"./getLocaleForTenant-BBg2Cyvv.js";import"./ReimbursementApprovalRuleDetailScreen--qsUWYUE.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]="6a9f31b0-3e40-46a0-b379-3fb8ffc78dac",e._sentryDebugIdIdentifier="sentry-dbid-6a9f31b0-3e40-46a0-b379-3fb8ffc78dac")}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}}}=Qe.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=K(),t=ae(),n=Q(),{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=Q().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((J=>V(J))),Z=N?.tenantId,{isApprovalRulesV3Enabled:O,isLoading:H}=Cn(Z),W=A((J=>J.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 Qn(){const e=K(),t=ae(),n=Q(),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"});Je({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 Jn=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 Kn({tenantEmailDomain:e}){const t=K(),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(Jn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const G=tn(),it="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:ea,common:me}=Qe.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=K(),t=ae(),n=Q(),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(Je({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))),J=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=>Qt(S)));h.useEffect((()=>{te===ke&&d!=null&&(t(Jt({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:Kt(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(Ke.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(Kn,{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:J,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=K(),n=Q(),{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(Ke.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=Q(),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(Qn,{})}),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 p}from"./liveblocks-D0hIH2N0.js";import{g as X,h as De,u as Oe,i as Ae,j as d,l as Pe,n as Ue,o as ee}from"./core-35eDsgGP.js";import{fB as q,Db as I,TJ as Ee,lF as le,tg as ce,u5 as A,lk as Le,lt as P,ll as U,ko as E,kf as L,ke as Me,Cl as ie,ua as Be,bq as Ve,TK as ve,bn as xe,Dy as ze,TL as Ge,TM as Ye,ch as g,Ce as He,TN as ae,TO as Ne,TP as $e,TQ as qe,TR as Ze,TS as Qe,TT as Je,TU as Ke,TV as We,TW as Xe,TX as ea,TY as aa,TZ as sa,T_ as k,T$ as M,U0 as B,U1 as V,U2 as v,U3 as x,U4 as z,U5 as G,U6 as Y,U7 as H,e8 as ta,Dc as oa,C$ as se,D0 as te,Di as na,D4 as oe,Do as ra,U8 as la,U9 as ca,Ua as ia,Ub as da,Uc as pa,Ud as _a,Ue as fa,Uf as ma,Ug as ba,Uh as ua,dV as ha,dU as ya}from"./zeni-epic-state-BRRtwAQl.js";import{al as Ca,am as wa,an as Ta,a as ga,$ as Sa,I as de,d as N,z as pe,ao as Ia,U as Ra,f as ka,ap as ja,aq as Fa,a6 as Da,k as $,S as Oa,y as Aa,p as _e,ar as Pa,as as Ua,at as Ea}from"./index-Dck-MxQS.js";import"./mui-CY_LMiAy.js";import La from"./NotFoundScreen-D0cz8CS4.js";import{F as Ma}from"./FeaturePreviewScreen-By9QwwHb.js";import{a as b}from"./sentry-DhqS_W-k.js";import{u as Ba}from"./useInitialThreadRequest-Bzg2iBlf.js";import{t as ne,a as re,b as Va}from"./routePaths-BDHLk4Ve.js";import{M as va}from"./MobileAppDrawer-CLK0v4hO.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.js";import"./InboxNotificationsProvider-yp4VlF4V.js";import"./useTaskManagerAccess-C0Fwbmvt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="065cd8b9-7e9b-4a2f-b513-5b49327b7da0",e._sentryDebugIdIdentifier="sentry-dbid-065cd8b9-7e9b-4a2f-b513-5b49327b7da0")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],S=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba()),e(ua())},Ga=Pe((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=I(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(S(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(V({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(V({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=S(t),l=g(t);l?(e(Ke({viewMode:a})),e(We({viewMode:a}))):r?(e(Xe({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):S(o.selectedReportID)?e(Qe({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):S(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=S(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?U():a?L():He()),o.isAccountingProjectsEnabled&&e(s?P():a?E():ie())},onUpdateDisplayOrder:a=>{e(Ye(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):P(!0):U(!0):E(!0):L(!0))}}}))(Pa);function Ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Sa(),m=Ua(_),a=De(),s=Oe(),t=X(),{tenantEmailDomain:r}=Ae(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=b.useState(!1),[Z,fe]=b.useState(!1),{isFeatureEnabled:Q}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,be=F.company?.companyInfo.firstMonthOfFY??1,ue=Ba(Q?F?.companyId:void 0),w=d((n=>I(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:u}=Ia(),D=d((n=>n.financeStatementState.selectedReportId)),R=d((n=>le(n))),T=d((n=>ce(n))),ye=d((n=>I(n).isCompareModeOn)),h=d((n=>I(n).filter)),O=d((n=>I(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(C(!0),s(A(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!Z&&w==="Completed"&&u&&(s(A(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,u]),b.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(D){case"profit_and_loss":case"profit_and_loss_by_classes":s(Be(h.timeframe));break;case"profit_and_loss_by_projects":T&&s(ie());break;case"balance_sheet":s(Me(h.timeframe));break;case"balance_sheet_by_classes":R&&s(L());break;case"balance_sheet_by_projects":T&&s(E());break;case"cash_flow_by_classes":R&&s(U());break;case"cash_flow_by_projects":T&&s(P());break;case"cash_flow":s(Le(h.timeframe))}}),[c,D,O,u,R,T]);const J=Ra(),we=J?.loggedInUserRole!=null&&Ve(J?.loggedInUserRole)!==!0,[Te,ge]=b.useState(!1),K=n=>{ge(n)},Se=ka(),Ie=ja();return(function(n){const{isDataReady:Re}=n,{pathname:ke}=X(),W=Ca(ke??"")==="reports",je=wa(Re),Fe=b.useMemo((()=>W?xa:void 0),[W]);Ta({canFetchSuggestedQuestions:je,pageContexts:Fe})})({isDataReady:w==="Completed"}),Fa({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Da,{analytics:$,onLoad:n=>n.trackPageLoaded(Oa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Te,handleDrawerToggle:K}),p.jsx(Ga,{firstMonthOfFY:be,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:D,analytics:$,filter:h,isAccountingClassesEnabled:R,isAccountingProjectsEnabled:T,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:K,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&Se&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Aa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Q,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ma,{}):p.jsxs(Ue,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ya,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-D0hIH2N0.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-Dck-MxQS.js";import"./mui-CY_LMiAy.js";import g from"./NotFoundScreen-D0cz8CS4.js";import{a as c}from"./sentry-DhqS_W-k.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-35eDsgGP.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-BRRtwAQl.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.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-D0cz8CS4.js","assets/sentry-DhqS_W-k.js","assets/core-35eDsgGP.js","assets/zeni-epic-state-BRRtwAQl.js","assets/index-Dck-MxQS.js","assets/mui-CY_LMiAy.js","assets/analytics-p9dV2gEo.js","assets/utils-CgQOqOwX.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-Cd1SkWkW.js","assets/withTransactionSidePanel-CvrgoXlG.js","assets/useAskAiCfoHostNavButtonProps-Cs4YJbah.js","assets/TransactionDetailScreen-D6CiVTKH.js","assets/decodeURIComponentSafe-DhnAz_92.js","assets/useInitialThreadRequest-Bzg2iBlf.js","assets/routePaths-BDHLk4Ve.js","assets/expenseAutomationHelper-XBf0IYWB.js","assets/analyticsHelper-B9-PsR8g.js","assets/CompanyPassportScreen-BCA1m9FT.js","assets/MobileAppDrawer-CLK0v4hO.js","assets/InboxNotificationsProvider-yp4VlF4V.js","assets/useTaskManagerAccess-C0Fwbmvt.js","assets/useAiCfoDashboardSuggestedQuestionsChips-C3OYtJva.js","assets/FeaturePreviewScreen-By9QwwHb.js","assets/BillPayRoutes-dMREYFET.js","assets/AddressScreen-Dp2DEY64.js","assets/DomesticWireDetailScreen-y67hSw0d.js","assets/BusinessVerificationPageScreen-CIU6ITVX.js","assets/DrawerScreen-C1M2YhTn.js","assets/SetupPagesScreen-m2xCtrNq.js","assets/BillPayApprovalRoutes-pwHQS3o9.js","assets/ReimbursementApprovalRuleDetailScreen--qsUWYUE.js","assets/getLocaleForTenant-BBg2Cyvv.js","assets/ReimbursementRoutes-BDX8OyTK.js","assets/ReimbursementApprovalRoutes-Bdy-6-Pg.js","assets/TransactionListRoutes-BkZzcgx5.js","assets/ZeniAccountStatementScreen-DeWMnJNK.js","assets/SettingsRoutes-XkD8UAX3.js","assets/AccountMappingScreen-Boic1d0a.js","assets/QBOConnectionScreen-BPvZ-19p.js","assets/empty-BDPRkuRZ.js","assets/index-D-ldiYpS.js","assets/url-BlblTlRS.js","assets/index-B3U6gyEe.js","assets/accountMappingHelper-C4yUO_tP.js","assets/useEmailConnectResultRefresh-D8GDRQig.js","assets/ReportsRoutes-RjH9WtMn.js","assets/ChargeCardRoutes-CVOY1iE_.js","assets/useChargeCardPusherEvents-CgMKq4Ei.js","assets/PeopleRoutes-DOzmC_X8.js","assets/ExpenseAutomationRoutes--LfNg3pH.js","assets/TreasuryRoutes-DmVJVDE4.js","assets/VendorsRoutes-DgxrxHfH.js","assets/pathToGoBack-n4Mx0taW.js","assets/ZeniAccountRoutes-BujMAkE9.js","assets/AddressRoutes-0fEsC1oH.js","assets/PandLWithForecastRoutes-Bf2BqvnJ.js","assets/CustomerOnboardingRoutes-1wxFD7hL.js","assets/TransactionDetailRoutes-Dn5BVJxH.js","assets/EntityDetailRoutes-9DkSsNCu.js","assets/InvoicingRoutes-D0AtqhHk.js","assets/NotificationRoutes-Bnb2vos6.js","assets/PerformanceRoutes-BIixpS1v.js","assets/RewardsRoutes-CPi4zMM5.js","assets/TaskRoutes-BsceFhBl.js","assets/TaskListScreen-BW-xU7Sa.js","assets/AiCfoScreen-CW4OlYtV.js","assets/CardsAiCfoScreen-BRT-yq43.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as ms,fB as _s,dV as Es,dU as hs,A3 as ps,de as gs,c7 as xs,gG as Rs,g5 as Is,db as pe,cF as js,gj as Ts,cx as As,bE as fs,br as bs,T9 as Ds,v as ys,Tb as Cs,bq as vs,Tc as Os,bK as Us,bJ as Ps,bt as ws,ct as Fs,Td as Ls,Te as Vs,d6 as ks,d9 as Hs,d8 as Bs,cE as Ss,cL as Ns,pw as ge,ge as xe,gV as Ms,gg as Re,gI as Ie,gJ as je,gh as Zs}from"./zeni-epic-state-BRRtwAQl.js";import{j as e}from"./liveblocks-D0hIH2N0.js";import{a as P}from"./sentry-DhqS_W-k.js";import{N as u,u as Gs,h as $s,i as zs,g as qs,j as $,q as Te,n as Ys,o as t}from"./core-35eDsgGP.js";import{M as l,E as Js,u as Ws,z as D,I as Qs,f as Ks,N as Xs,d as M,h as en,O as sn,U as nn,L as F,G as Ae,t as _,P as tn,Q as an,k as ne}from"./index-Dck-MxQS.js";import"./mui-CY_LMiAy.js";import{f as fe}from"./analyticsHelper-B9-PsR8g.js";import{t as on}from"./getLocaleForTenant-BBg2Cyvv.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]="52ecf991-2047-471a-8f87-1dd73c7e89fb",a._sentryDebugIdIdentifier="sentry-dbid-52ecf991-2047-471a-8f87-1dd73c7e89fb")}catch{}})();const rn=l((()=>s((()=>import("./NotFoundScreen-D0cz8CS4.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ln=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),un=({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(un,{tenantEmailDomain:v}):B?e.jsx(ln,{tenantEmailDomain:v}):e.jsx(rn,{})},dn={dashboard:()=>s((()=>import("./DashboardRoutes-Cd1SkWkW.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-dMREYFET.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-BDX8OyTK.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-BkZzcgx5.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-XkD8UAX3.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-RjH9WtMn.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CVOY1iE_.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-DOzmC_X8.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes--LfNg3pH.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-DmVJVDE4.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-DgxrxHfH.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-BujMAkE9.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]))},cn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},mn=l((()=>s((()=>import("./ReportsRoutes-RjH9WtMn.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),_n=l((()=>s((()=>import("./AddressRoutes-0fEsC1oH.js")),__vite__mapDeps([55,1,2,3,25,4,5,6,7,0,8])))),En=l((()=>s((()=>import("./PeopleRoutes-DOzmC_X8.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),hn=l((()=>s((()=>import("./PandLWithForecastRoutes-Bf2BqvnJ.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),pn=l((()=>s((()=>import("./CustomerOnboardingRoutes-1wxFD7hL.js")),__vite__mapDeps([57,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),gn=l((()=>s((()=>import("./VendorsRoutes-DgxrxHfH.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,25,0,23,53,15,11,19,20,21,28,44,8])))),xn=l((()=>s((()=>import("./TransactionDetailRoutes-Dn5BVJxH.js")),__vite__mapDeps([58,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-9DkSsNCu.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),Rn=l((()=>s((()=>import("./DashboardRoutes-Cd1SkWkW.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-dMREYFET.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])))),In=l((()=>s((()=>import("./SettingsRoutes-XkD8UAX3.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])))),jn=l((()=>s((()=>import("./InvoicingRoutes-D0AtqhHk.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-BDX8OyTK.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])))),Tn=l((()=>s((()=>import("./ZeniAccountRoutes-BujMAkE9.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])))),An=l((()=>s((()=>import("./TreasuryRoutes-DmVJVDE4.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),fn=l((()=>s((()=>import("./TransactionListRoutes-BkZzcgx5.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),bn=l((()=>s((()=>import("./ChargeCardRoutes-CVOY1iE_.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),Dn=l((()=>s((()=>import("./NotificationRoutes-Bnb2vos6.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,11,21,8])))),yn=l((()=>s((()=>import("./PerformanceRoutes-BIixpS1v.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,19,20,21,8])))),Cn=l((()=>s((()=>import("./ExpenseAutomationRoutes--LfNg3pH.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,10,44,28,8])))),vn=l((()=>s((()=>import("./RewardsRoutes-CPi4zMM5.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,0,8])))),On=l((()=>s((()=>import("./TaskRoutes-BsceFhBl.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,14,19,20,21,65,11,8])))),Un=l((()=>s((()=>import("./AiCfoScreen-CW4OlYtV.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,22,53,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-BRT-yq43.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-D0cz8CS4.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Pn=l((()=>s((()=>import("./TaskListScreen-BW-xU7Sa.js").then((a=>a.f))),__vite__mapDeps([65,1,2,3,4,5,6,7,11,19,20,21,8])))),wn=({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`}),Mn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Gs(),B=$s(),{tenantEmailDomain:i}=zs(),V=Js().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Ws(),f=D.getSignedInUserTenant(i)?.tenantId,j=D.getSignedInUser(),W=ms(j),z=qs(),[L,we]=P.useState(!1),r=$((o=>_s(o))),{useFeatureGate:S}=Qs(),Z=Ks(),ae=Xs(),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"?Es(oe,r):void 0,Q=p==="Completed"||T==="Completed"?hs(r):void 0,re=p==="Completed"||T==="Completed"?ps(r)&&!gs(r):void 0,ke=en(r,Ve,oe),{isCardsHidden:He}=sn(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=S(M.isSettingsFeatureEnabled),{isFeatureEnabled:K}=S(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=S(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||an==="DEV",Ze=r?.userRole!=null&&xs(r.userRole),q=$((o=>Rs(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=Is(),h=nn(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=js(h?.loggedInUserRoleMap),X=Te("/:tenantEmailDomain/onboarding/*")!==null,ee=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ze=$((o=>G.tenantId!=null?Ts(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=As(Number(b[0])),n=Number(b[1]),c=fs(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=bs();c.isAfter(N,"month")===!1?A(Ds(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((()=>{!ys(ie,G)&&D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,b,d,n){if(xe(b?.userId,b?.zeniSessionId,o.tenantId),d(Ms(!0)),d(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=D.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(on(n)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,j,A,ze))}),[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,us=d==null||d.tenantId!==n,ds=d!=null&&d.excludedResources==null,cs=d!=null&&d.externalConnections==null;if(Y&&us){H(Re(n));const J=D.getSignedInUserTenantWithId(n);J?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(J?.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&&ds&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),Y&&cs&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(je(c.userId,n)));if(Y){ne.identify(c.userId,{tenant_id:n});const J=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(Zs(c.userId,n,c.zeniSessionId))),J&&(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(Cs(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=cn,b=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=dn[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&&vs(r?.userRole),{isFeatureEnabled:qe}=S(M.isReferralFeatureEnabled),Ye=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Je=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=Os(h?.loggedInUserRoleMap),Qe=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&&Us(h?.loggedInUserRoleMap),_e=Fe&&!U,Xe=Le&&!U,es=ue&&Ps(h?.loggedInUserRoleMap),ss=de&&ws(h?.loggedInUserRoleMap),ns=_e&&Fs(h?.loggedInUserRoleMap),ts=Ls(h?.loggedInUserRoleMap),as=Vs(h?.loggedInUserRoleMap),os=ks(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Bs(h?.loggedInUserRoleMap),g=Ss(h?.loggedInUserRoleMap),x=Ns(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&x,R=_e&&os,I=Xe&&rs,m=de&&is,ls=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||$e===!0||We===!0||ts===!0||as===!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||W&&!X)&&Ke&&Qe!==!0&&E===!1&&Q===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||X||W?!L||se!==!1||X||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ys,{children:e.jsxs(t,{element:e.jsx(tn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(wn,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:w?e.jsx(Rn,{}):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(mn,{}):e.jsx(y,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:ls||w?e.jsx(En,{}):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(hn,{}):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(pn,{})}),e.jsx(t,{path:"transaction/*",element:w&&U===!1||Ye||Je?e.jsx(xn,{}):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(fn,{}):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(Pn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(On,{})}),e.jsx(t,{path:"address/*",element:es||me||ns||ss?e.jsx(_n,{}):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(Tn,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:I?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(yn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&U===!1?e.jsx(Cn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(Dn,{})}),e.jsx(t,{path:"vendors/*",element:Ge?e.jsx(gn,{}):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(In,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me&&Ze?e.jsx(jn,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(bn,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:qe?e.jsx(vn,{}):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(Un,{isFileUploadEnabled:K}):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,Mn as S};
@@ -1 +0,0 @@
1
- import{j as u}from"./liveblocks-D0hIH2N0.js";import{a as f,R as x,q as A}from"./sentry-DhqS_W-k.js";import{u as z,h as D,j as l,g as M,N as j,l as O}from"./core-35eDsgGP.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-Dck-MxQS.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-BRRtwAQl.js";import"./mui-CY_LMiAy.js";import{u as ee}from"./useDeviceId-Cd5EU_Dl.js";import{f as te}from"./analyticsHelper-B9-PsR8g.js";import{t as ne}from"./getLocaleForTenant-BBg2Cyvv.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.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-D0hIH2N0.js";import{a as i}from"./sentry-DhqS_W-k.js";import{u as l,g as d,N as u}from"./core-35eDsgGP.js";import{z as n,k as a,S as m,a5 as p}from"./index-Dck-MxQS.js";import{gU as g,Tx as y}from"./zeni-epic-state-BRRtwAQl.js";import{n as b}from"./mui-CY_LMiAy.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.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-D0hIH2N0.js";import{a as T}from"./sentry-DhqS_W-k.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-35eDsgGP.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-Dck-MxQS.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-BRRtwAQl.js";import{n as Wa}from"./mui-CY_LMiAy.js";import{u as qa}from"./useAskAiCfoHostNavButtonProps-Cs4YJbah.js";import{M as Va}from"./MobileAppDrawer-CLK0v4hO.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-D0hIH2N0.js";import de from"./NotFoundScreen-D0cz8CS4.js";import{a as k}from"./sentry-DhqS_W-k.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-35eDsgGP.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-BRRtwAQl.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-Dck-MxQS.js";import{n as Ve}from"./mui-CY_LMiAy.js";import{u as ze}from"./useInitialThreadRequest-Bzg2iBlf.js";import{M as qe}from"./MobileAppDrawer-CLK0v4hO.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-BW-xU7Sa.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.js";import"./InboxNotificationsProvider-yp4VlF4V.js";import"./useTaskManagerAccess-C0Fwbmvt.js";import"./useAskAiCfoHostNavButtonProps-Cs4YJbah.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-D0hIH2N0.js";import i from"./NotFoundScreen-D0cz8CS4.js";import{T as r}from"./TransactionDetailScreen-D6CiVTKH.js";import"./sentry-DhqS_W-k.js";import{n as a,o}from"./core-35eDsgGP.js";import"./zeni-epic-state-BRRtwAQl.js";import"./recharts-B8j-bW95.js";import"./index-Dck-MxQS.js";import"./mui-CY_LMiAy.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.js";import"./useAskAiCfoHostNavButtonProps-Cs4YJbah.js";import"./decodeURIComponentSafe-DhnAz_92.js";import"./useInitialThreadRequest-Bzg2iBlf.js";import"./routePaths-BDHLk4Ve.js";import"./expenseAutomationHelper-XBf0IYWB.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,5 +0,0 @@
1
- import{j as C}from"./liveblocks-D0hIH2N0.js";import{a as i}from"./sentry-DhqS_W-k.js";import{u as M,k as ot,j as g,s as ge,g as De,h as Ce,i as Ae,N as st,l as ct}from"./core-35eDsgGP.js";import{p9 as Ie,fB as J,gS as it,TD as rt,of as lt,nR as dt,CH as se,bn as ut,db as Re,bq as _e,rY as H,UT as Y,VR as we,VS as le,Vh as Pe,lQ as Ue,VT as Ve,Vm as de,Vn as ue,mF as Fe,Rd as me,UN as W,lK as xe,lI as Le,lU as mt,oY as pt,VU as ft,VV as ht,Cy as X,lP as Oe,Qy as Be,cl as St,dh as yt,VW as Tt,UM as bt,VX as gt,VY as It,VZ as kt,V_ as Et,Cu as vt,V$ as Dt,W0 as Ct,W1 as At,W2 as Rt,W3 as _t,lT as wt,W4 as Pt,W5 as Ut,UO as Vt,W6 as Ft,W7 as xt,W8 as Lt,Qs as Ot,Qi as Bt,QH as Nt,lV as zt,Re as ke,p1 as Mt}from"./zeni-epic-state-BRRtwAQl.js";import{I as Q,d as _,k as $,b0 as jt,z as Ne,E as Gt,$ as Wt,b1 as $t,a9 as qt,a2 as ce,U as Ht,b2 as Yt,p as ie,aq as Qt,b3 as Kt,b4 as Xt,b5 as Zt,ac as Jt,at as oe}from"./index-Dck-MxQS.js";import{n as en,S as tn,D as nn}from"./mui-CY_LMiAy.js";import{u as an}from"./useAskAiCfoHostNavButtonProps-Cs4YJbah.js";import{d as ze}from"./decodeURIComponentSafe-DhnAz_92.js";import{u as on}from"./useInitialThreadRequest-Bzg2iBlf.js";import{h as Me,c as je,g as sn,e as cn}from"./routePaths-BDHLk4Ve.js";import{u as rn}from"./expenseAutomationHelper-XBf0IYWB.js";import{w as ln}from"./utils-CgQOqOwX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="68c70865-ff9e-4a87-8935-a2c38831335d",t._sentryDebugIdIdentifier="sentry-dbid-68c70865-ff9e-4a87-8935-a2c38831335d")}catch{}})();function dn(t=!0){const e=M(),o=ot(),{useFeatureGate:n}=Q(),{isFeatureEnabled:a}=n(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function un(t,e){const o=(function(){const u=M(),[h,y]=i.useState(!1),[p,d]=i.useState(null),[r,f]=i.useState(null),{useDynamicConfig:k}=Q(),{configValue:D,isDynamicConfigLoading:T}=k("transaction_categorization_config"),b=!T&&D?.capitalization_enabled===!0,E=g((I=>J(I))),A=E.companyId,j=g((I=>it(I.companyState,E.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:V,capitalizableAccountOverrides:F,dismissedAccounts:w}=g((I=>{const S=I.tenantState.currentTenantId,R=S!=null?I.tenantState.tenantsById[S]:void 0;return{capitalizableAccounts:R?.capitalizableAccounts??null,capitalizableAccountOverrides:R?.capitalizableAccountOverrides??null,dismissedAccounts:R?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(V);x.current=V;const P=i.useRef(F);P.current=F;const L=i.useRef(w);L.current=w;const O=g((I=>rt(I.accountState)),ge),G=i.useMemo((()=>{const I={};for(const S of O)S.accountId!=null&&S.accountName!=null&&(I[S.accountId]=S.accountName);return I}),[O]),q=r!=null?G[r]??null:null,B=i.useCallback((I=>{if(!b)return;const S=x.current;if(S==null)return;const R=S.accounts??[],K=new Set(I),ee=P.current??{},te=L.current;for(const N of R)if(K.has(N.accountId)&&ee[N.accountId]==null&&te?.[N.accountId]==null)return d(N.classificationType),f(N.accountId),void y(!0)}),[b]),v=i.useCallback(((I,S)=>{u(lt(A,I,S,!0)),y(!1),d(null),f(null)}),[u,A]),l=i.useCallback((()=>{r!=null&&(u(dt(A,r)),y(!1),d(null),f(null))}),[u,A,r]);return{showPopup:h&&b,popupType:p,popupAccountId:r,popupAccountName:q,currencySymbol:j,checkAndShowPopup:B,handleSubmit:v,handleDismiss:l}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const z=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,Z=(t,e)=>({recommendationFor:t.dimension,recommendationSetId:null,selectedSource:t.matchedSource,selectedRank:t.matchedRank,topPickSource:t.topPickSource,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}),re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Ge=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(Z(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Fn=(t,e)=>{const o=new Set(e.map(String));z.forEach(((n,a)=>{o.has(n.transactionId)&&(z.delete(a),Ge(t,n.feedback,n.transactionId))}))},xn=t=>{const e=new Set(t.map(String));z.forEach(((o,n)=>{e.has(o.transactionId)&&z.delete(n)}))};function mn(t){const e=M(),[o,n]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=t,c=i.useCallback((p=>p.transactionId??s??""),[s]),u=i.useCallback((p=>{if(!a)return;const d=c(p);if(d==="")return;if(p.outcome!=="accepted")return void n(p);((f,k,D,T)=>{const b=Ee(k,D,T),E=z.get(b);return E!=null&&(z.delete(b),Ge(f,E.feedback,E.transactionId),!0)})(e,d,p.lineId,p.dimension)||(((f,k)=>{$.trackRecommendationAccepted({...Z(f,k),recommendationConfidencePercentage:f.shownRecommendations[0]?.confidencePercentage??null})})(p,d),e(se(re(p,d,{}))))}),[a,c,e]),h=i.useCallback((p=>{if(o==null)return;const d=c(o);((r,f,k)=>{$.trackRecommendationFeedbackSubmitted({...Z(r,f),feedbackOutcome:r.outcome,feedbackReasonLength:k,isNewEntitySelected:!1})})(o,d,p.length),e(se(re(o,d,{reasonText:p,skipped:!1}))),((r,f)=>{z.set(Ee(f,r.lineId,r.dimension),{feedback:r,transactionId:f})})(o,d),n(null)}),[o,c,e]),y=i.useCallback((()=>{var p,d;o!=null&&(p=o,d=c(o),$.trackRecommendationFeedbackSkipped({...Z(p,d),feedbackOutcome:p.outcome,isNewEntitySelected:!1}),n(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(jt,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=Q(),{isFeatureEnabled:o}=e(_.isChainOfThoughtEnabled);return i.useMemo((()=>ut(t)&&o),[t,o])};function We(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ln(t,e){const o=M(),{useFeatureGate:n}=Q(),a=g((l=>J(l))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=n(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=n(_.isExpenseAutomationEnabled),p=pe(),d=i.useMemo((()=>({id:t,type:H(e)})),[t,e]),r=g((l=>Y(l,d))),f=r?.transactionDetailUpdateStatus?.fetchState,k=r?.transactionDetailLocalData?.lineItemById,D=g((l=>{const I=Y(l,d)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":l.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?We(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((l=>{if(T!=null)return we(l.customerIncomeState,l.vendorExpenseState,l.trendState,T,"month")})),E=g((l=>le(l))),A=g((l=>{if(T!=null)return Pe(l.trendWithTransactionsState,T,"TransactionDetail")})),j=a.company?.companyInfo.firstMonthOfFY??1,V=g((l=>Ue(l.accountState,l.accountListState,"accountList"))),[F,w]=i.useState(!1),[x,P]=i.useState(!1),[L,O]=i.useState(!1);i.useEffect((()=>{w(!1),P(!1),O(!1)}),[t,e]);const G=i.useCallback((()=>{w(!1),P(!1)}),[]),[q,B]=i.useState(!1),v=A?.selectedPeriod?.timePeriod;return i.useEffect((()=>{L||r==null||r.transaction==null||(o(Ve({id:r.transaction.id,type:r.transaction.type})),O(!0)),T!=null&&(!s||c&&u===!1)&&(F?x||b==null||(P(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:v??b}))):(o(de()),o(ue()),w(!0),o(Fe(T))))}),[o,L,r?.fetchState,r?.transaction,T,s,c,u,F,x,b,v]),i.useEffect((()=>{E.newVendorState?.vendorDetailLocalData?.vendorName!=null?B(!0):B(!1)}),[E.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(W("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:p,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:f,rawDetailLineItemById:k,vendorSaveStatus:D,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:E,uiState:A,firstMonthOfFY:j,uncategorizedAccounts:V,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:q,setIsCreateVendorDrawerOpen:B}}const pn={overlayWidth:new qt(100,100,58)},fn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=Gt(),c=Wt(),u=M(),h=g((d=>le(d))),y=()=>{n()},p={vendorDetailView:a??h,onSaveSuccess:()=>{u(Le()),u(mt("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(xe({vendorId:void 0,localData:d}))}};return C.jsx(nn,{anchor:"right",open:t,PaperProps:{style:{width:pn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(hn,{onClick:d=>d.stopPropagation(),children:C.jsx($t,{...p})})})},hn=en(tn)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `;function Sn(t,e){t(pt({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:H(e.transactionType),sourceTransactionType:H(e.sourceTransactionType)}))}function yn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||u.current===c)return;const{previousTransactionId:h,newTransactionId:y}=c;t.id===h.id&&t.type===h.type&&(u.current=c,n?.(),a(o(y),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const Tn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=M(),c=pe(),{transactionTypeEncoded:u,transactionId:h}=Ae(),y=e??h,p=o??ze(u??"");let d;Me(y,p)&&(d={id:y,type:H(p)});const r=d!=null?g((k=>Y(k,d))):void 0,f=()=>{const k=ce(n.state?.pathnameStackToGoBack),D=k.poppedPathname??((T=2)=>{let b="../";for(let E=0;E<T;E++)b=`${b}../`;return b})(1);a(D,{state:{pathnameStackToGoBack:k.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Oe(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const k=r?.transactionDetailLocalData.vendorUpdates,D={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:k?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(X({entity:D,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}f()},onCancel:()=>{d!=null&&s(ft({transactionId:d})),s(Le()),s(ht()),t(!0),f()}}},bn=ct((function(t,e){const o=Y(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=Tt(t,e.entity,"TransactionDetail"));const u=t.entityAutoCompleteState.autoCompleteText.common,h=bt(t,"common"),y=J(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${Jt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(W("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Mt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ke(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ke(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Oe(n,s,!0,e.isExpenseAutomationEnabled):zt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(W("common"))},onUploadAttachmentAttachment:n=>{t(Nt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(Bt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Ot({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Lt(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,u,h)=>{t(xt(n,a,s,c,u,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Ft({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=ln(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${sn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${cn(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Be(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Vt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(W("common"))},onCancelAutoComplete:()=>{t(W("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(X({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(Ut(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Pt(n))},onSaveVendorInLocalData:(n,a,s,c,u)=>{if(t(wt({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&t(X({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),t(xe({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(n,a,s,c,u)=>{t(_t({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&t(X({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(Rt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(At(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(Ct(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(Dt({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(vt(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Et(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>Sn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(kt(n,u))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(It(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(gt(a,n))}}}))(Zt);function On(){const t=Ce(),e=M(),o=De(),{useFeatureGate:n}=Q(),a=Ht(),s=g((m=>J(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),h=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=n(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:p}=n(_.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:f}=Ae(),[k,D]=i.useState(!1),T=ze(r??""),b=Me(f,T),E=g((m=>m.transactionVendorViewState)),A=pe(),j=Yt(),{onRecommendationSelection:V,popup:F}=mn({isEnabled:A,fallbackTransactionId:f}),w=i.useMemo((()=>({...j,onRecommendationSelection:V})),[j,V]),{isFeatureEnabled:x}=n(_.isTransactionCommentingEnabled),{isFeatureEnabled:P}=n(_.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:L}=n(_.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(_.isTransactionSplitEnabled),G=a?.currentTenant?.companyId,q=a?.currentTenant?.companyName,B=on(G),v=i.useMemo((()=>{if(b)return{id:f,type:H(T)}}),[b,f,T]),l=v!=null?g((m=>Y(m,v))):void 0,I=l?.transactionDetailLocalData.vendorUpdates?.id!=null?E.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",S=l?.fetchState==="Completed"?We(l?.transaction):void 0,R=g((m=>S!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,S,"month"):void 0)),K=g((m=>le(m))),ee=g((m=>S!=null?Pe(m.trendWithTransactionsState,S,"TransactionDetail"):void 0)),te=s.company?.companyInfo.firstMonthOfFY??1,N=g((m=>Ue(m.accountState,m.accountListState,"accountList"))),[qe,fe]=i.useState(!1),[He,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Qe=i.useCallback((m=>je(m,d??"")+o.search),[d,o.search]),Ke=i.useCallback((()=>{Se(!1)}),[]);yn({currentTransactionId:v,enabled:d!=null&&d!=="",buildPath:Qe,beforeNavigate:Ke,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=rn();dn();const ne=i.useRef(l?.transaction);ne.current=l?.transaction;const Xe=l?.transactionDetailUpdateStatus?.fetchState,U=un(Xe,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{v!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Be(v,!1)),ye())}),[e,v,l?.fetchState]),i.useEffect((()=>{if(v!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[v,l?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ve({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;S==null&&l?.fetchState==="Completed"&&ve(l?.transaction,m),S!=null&&(!c||u&&h===!1)&&(qe?He||R==null||(he(!0),e(me(S,"TransactionDetail",{timeframe:"month",timePeriod:ee?.selectedPeriod?.timePeriod??R}))):(e(de()),e(ue()),ve(l?.transaction,m),fe(!0),e(Fe(S))))}),[l?.fetchState,l?.transaction,R,c]),i.useEffect((()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[K.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(W("common"))}),[]);const Ze=[r,f].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Je,onSaveSuccess:et,onCancel:tt}=Tn({closeDrawerHandler:m=>{D(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:nt,onAskAiCfoClick:at}=an({mobileExploreReferrer:"Transaction Details"});return Qt({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&k&&C.jsx(fn,{isOpen:k,transactionId:be,onSaveVendor:Je,onSaveSuccess:et,onCancel:tt}),C.jsx(Kt,{toolkit:w,children:C.jsx(bn,{hideDeleteAttachment:!0,firstMonthOfFY:te,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:t,selectedTransaction:v,entity:S,isCOTEnabled:A,defaultTrendTransactionTimePeriod:R,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:N,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:P,isExpenseAutomationEnabled:p,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isTransactionCommentingEnabled:x,isProjectsTransactionsEnabled:L,isTransactionSplitEnabled:O,companyId:G,companyName:q,initialOpenThreadRequest:B})}),F,U.showPopup&&U.popupType!=null&&C.jsx(Xt,{popupType:U.popupType,currencySymbol:U.currencySymbol,accountId:U.popupAccountId??"",accountName:U.popupAccountName??"",onSubmit:U.handleSubmit,onDismiss:U.handleDismiss})]}):C.jsx(st,{to:$e(Ze.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ve=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=gn(t),a=In(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},gn=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},In=t=>St(t)===!0?t.customer?.name??"":yt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{fn as C,On as T,mn as a,dn as b,un as c,Tn as d,bn as e,yn as f,pe as g,xn as h,Sn as i,ve as l,Fn as r,Ln as u};
@@ -1,9 +0,0 @@
1
- import{j as i}from"./liveblocks-D0hIH2N0.js";import{a as u}from"./sentry-DhqS_W-k.js";import{h as x,u as $,g as j,i as B,j as p}from"./core-35eDsgGP.js";import{Sg as s,Sf as v,_z as z,fB as C,_A as E}from"./zeni-epic-state-BRRtwAQl.js";import{$ as T,ac as g,E as _,z as D,a5 as L,d2 as P,a2 as N}from"./index-Dck-MxQS.js";import{n as U}from"./mui-CY_LMiAy.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};