@zeniai/web-app-ui 5.0.13-qa → 5.0.15-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 (118) hide show
  1. package/dist/assets/AddressRoutes-x8EoHTgO.js +1 -0
  2. package/dist/assets/AddressScreen-BIexwSUC.js +9 -0
  3. package/dist/assets/{AiCfoScreen-ewYuEkZ3.js → AiCfoScreen-DN022lRy.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-6DCHmj66.js → BillPayApprovalRoutes-D6a6fZAk.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-JttMy0pk.js → BillPayRoutes-CdXbo9_x.js} +11 -11
  6. package/dist/assets/{BusinessVerificationPageScreen-CXOkme37.js → BusinessVerificationPageScreen-CavwhxgK.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-BNVefQP2.js → ChargeCardRoutes-Xfw8idFo.js} +9 -9
  8. package/dist/assets/{CompanyPassportScreen-hbCeNXET.js → CompanyPassportScreen-BFYWdwCR.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CYb2h10Q.js → ConnectionAuthScreen-OGsoNPk1.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-BlUS8xnK.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-D38cBz7L.js → CustomerOnboardingRoutes-CdcqOy3h.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-CXR7RIXZ.js → DashboardRoutes-DBu1dqFJ.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-Bds6JS81.js → DefaultTenantHome-vkfDVx8a.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-BsWJ2Su_.js +18 -0
  15. package/dist/assets/DrawerScreen-Bw1QfkLT.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-DDZlauU7.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-STqj7D8N.js → ExpenseAutomationRoutes-CbzZZ1fQ.js} +5 -5
  18. package/dist/assets/FeaturePreviewScreen-Bnq4uovL.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-BivSSxVd.js → MagicLinkRoutes-CeL7GNJn.js} +8 -8
  20. package/dist/assets/MagicLinkSignInScreen-f8Uc14m0.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-D5mpxBw9.js → MobileAppDrawer-NY5CZpkD.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DNbVpibd.js +1 -0
  23. package/dist/assets/{NotificationRoutes-DCkZ7gQ_.js → NotificationRoutes-BRjGOURk.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-oBHUYnSn.js +1 -0
  25. package/dist/assets/{PeopleRoutes-C7qECXfl.js → PeopleRoutes-0DuSRKi7.js} +1 -1
  26. package/dist/assets/PerformanceRoutes-BPySqreL.js +1 -0
  27. package/dist/assets/{Preview-RtmufjZX.js → Preview-HaN7BDGs.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-B490WYfn.js → QBOConnectionScreen-WktucsBE.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-B5qHdStP.js → ReferralListScreen-CAsh5C9i.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-CK4vrOlS.js → ReimbursementApprovalRoutes-BAvS3MWN.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-ihcMaQoX.js → ReimbursementApprovalRuleDetailScreen-ZZIaexmv.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-DKkIKak7.js → ReimbursementRoutes-yVlm9pPF.js} +4 -4
  33. package/dist/assets/{ReportsRoutes-DZxCy0t1.js → ReportsRoutes-Dlw2t-eT.js} +1 -1
  34. package/dist/assets/RewardsRoutes-BP5Nzhwq.js +1 -0
  35. package/dist/assets/{ScreenRoutes-C19HfyTq.js → ScreenRoutes-B_PRMI91.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-6l5kiZbY.js → SettingsRoutes-BKRiya-R.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-CJpk__M_.js → SetupPagesScreen-BlvsgM9d.js} +5 -5
  38. package/dist/assets/SignInScreen-BYWJfkJz.js +1 -0
  39. package/dist/assets/SignOutScreen-BDOb5I1P.js +9 -0
  40. package/dist/assets/{TaskListScreen-C5V8F8lL.js → TaskListScreen-7rCdkI4n.js} +2 -2
  41. package/dist/assets/TaskRoutes-GSceRjWV.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-BJJ7P6dg.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-CC0P_ZOY.js → TransactionDetailScreen-BRy8OBJd.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-CUiqlXNC.js → TransactionListRoutes-CvETOFD-.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-DYlVz1Pn.js → TreasuryRoutes-Cd4RbTnr.js} +5 -5
  46. package/dist/assets/{VendorsRoutes-Cjp0Gufi.js → VendorsRoutes-BOMpA3qx.js} +12 -12
  47. package/dist/assets/WiseConfirmationScreen-CfxOf9br.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-BmDqzfW9.js → ZeniAccountRoutes-CTYhth7C.js} +7 -7
  49. package/dist/assets/ZeniAccountStatementScreen-B0vovcSx.js +9 -0
  50. package/dist/assets/{accountMappingHelper-VkYriGBP.js → accountMappingHelper-KEN2wBMB.js} +1 -1
  51. package/dist/assets/{analytics-D3BPH6yx.js → analytics-CqLahF_v.js} +1 -1
  52. package/dist/assets/{analyticsHelper-DZz2Dorw.js → analyticsHelper-1lOvj-za.js} +1 -1
  53. package/dist/assets/{core-CZukbx0Q.js → core-BM9YDzPX.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-BMhpBWAI.js → decodeURIComponentSafe-a784xZQy.js} +1 -1
  55. package/dist/assets/{dnd-C982KOaa.js → dnd-DLVMxaGF.js} +1 -1
  56. package/dist/assets/{empty-BWCQ_0J5.js → empty-1FgpzQaJ.js} +1 -1
  57. package/dist/assets/{empty-v0hJlOmn.js → empty-CNAYaS5M.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-BxwhKJBx.js → emptyVideoElement-BRM3Ls5f.js} +1 -1
  59. package/dist/assets/{epic-CGgrgTSz.js → epic-BYLgH3Dp.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-Czitv1AW.js +1 -0
  61. package/dist/assets/{index-BCMOKGoM.js → index-BxZQbqZa.js} +8622 -8635
  62. package/dist/assets/{index-BclNqUUi.js → index-Dib88HEg.js} +1 -1
  63. package/dist/assets/{index-CTCUMK3y.js → index-DpQl7e8K.js} +1 -1
  64. package/dist/assets/{index-B40Qim0p.js → index-DvjNZZRv.js} +1 -1
  65. package/dist/assets/{index-BiQB87nE.js → index-HpYLj_bE.js} +2 -2
  66. package/dist/assets/{index-BCUyk4vZ.js → index-t8Vx9mm2.js} +1 -1
  67. package/dist/assets/{index-BL5F9FcF.js → index-z1OKiepB.js} +1 -1
  68. package/dist/assets/{lexical-BiHBh7jO.js → lexical-CFqhubpO.js} +1 -1
  69. package/dist/assets/{liveblocks-D6KTXvhv.js → liveblocks-585gCzRC.js} +1 -1
  70. package/dist/assets/{lottie-28Wzb4-h.js → lottie-piZcDgIc.js} +1 -1
  71. package/dist/assets/{mui-BsWf3aoF.js → mui-Dh_OiBGq.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DuOzAHpB.js → pathToGoBack-B-VHmIUu.js} +1 -1
  73. package/dist/assets/{pdf-D4etPH5X.js → pdf-C7LOTluM.js} +4 -4
  74. package/dist/assets/{pdf-lib-B-kXlgH7.js → pdf-lib-mwEs-5am.js} +1 -1
  75. package/dist/assets/{plaid-BlZUWQEE.js → plaid-B3TMtaAn.js} +1 -1
  76. package/dist/assets/{pusher-DNeGnq4j.js → pusher-BGUQs6aC.js} +1 -1
  77. package/dist/assets/{react-BjugJboI.js → react-BJCRbKNE.js} +1 -1
  78. package/dist/assets/{react-Bgw1-uo-.js → react-BTYE0_A9.js} +1 -1
  79. package/dist/assets/{react-BKssAPFM.js → react-CDHObaz0.js} +1 -1
  80. package/dist/assets/{react-DIioZG0x.js → react-CtpNxQP9.js} +1 -1
  81. package/dist/assets/{react-ScHkzTjl.js → react-D9pVmjGq.js} +1 -1
  82. package/dist/assets/{react-Cmcopb6P.js → react-yTm2bgF6.js} +1 -1
  83. package/dist/assets/{recharts-Kt4_Z9D4.js → recharts-Bk8sahKA.js} +1 -1
  84. package/dist/assets/{routePaths-tEjN6NOl.js → routePaths-DKtGe48K.js} +1 -1
  85. package/dist/assets/{sentry-DlTle5wx.js → sentry-CznkHhej.js} +1 -1
  86. package/dist/assets/{url-B8abWcfS.js → url-Binr_y8q.js} +1 -1
  87. package/dist/assets/{url-kIFJA3dP.js → url-Bqap2__X.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-DxvBbMZO.js +1 -0
  89. package/dist/assets/{useDeviceId-DgVtbX-U.js → useDeviceId-D_MFUrrA.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-BTiRAkUA.js → useInitialThreadRequest-F8zTMPR1.js} +1 -1
  92. package/dist/assets/{utils-CnNkpT2e.js → utils-Boc0JP6O.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-ZDRkIRTY.js → withTransactionSidePanel-DJ3JMAJu.js} +1 -1
  94. package/dist/assets/zeni-epic-state-1oMHKKZA.js +14 -0
  95. package/dist/index.html +1 -1
  96. package/package.json +3 -3
  97. package/dist/assets/AddressRoutes-BA8UpUoz.js +0 -1
  98. package/dist/assets/AddressScreen-wZpAUSdZ.js +0 -9
  99. package/dist/assets/CustomerOnboardingAuthScreen-moX3_8mB.js +0 -1
  100. package/dist/assets/DomesticWireDetailScreen-KeTNW03I.js +0 -18
  101. package/dist/assets/DrawerScreen-DXNbqsAp.js +0 -1
  102. package/dist/assets/EntityDetailRoutes-BhAzs2j-.js +0 -1
  103. package/dist/assets/FeaturePreviewScreen-D9DJst05.js +0 -1
  104. package/dist/assets/MagicLinkSignInScreen-05q0tCiT.js +0 -12
  105. package/dist/assets/NotFoundScreen-DnEnkkn2.js +0 -1
  106. package/dist/assets/PandLWithForecastRoutes-BHSuvYUw.js +0 -1
  107. package/dist/assets/PerformanceRoutes-OON3zt07.js +0 -1
  108. package/dist/assets/RewardsRoutes-CwxXiTXh.js +0 -1
  109. package/dist/assets/SignInScreen-CuXnl8v3.js +0 -1
  110. package/dist/assets/SignOutScreen-CtWlZGJe.js +0 -9
  111. package/dist/assets/TaskRoutes-Ij3Vyd6Z.js +0 -9
  112. package/dist/assets/TransactionDetailRoutes-CVAtnUsR.js +0 -1
  113. package/dist/assets/WiseConfirmationScreen-Cm2TEEU0.js +0 -12
  114. package/dist/assets/ZeniAccountStatementScreen-C885RBh5.js +0 -9
  115. package/dist/assets/getLocaleForTenant-BRQJ8Vdp.js +0 -1
  116. package/dist/assets/useAskAiCfoHostNavButtonProps-CAHHYp9d.js +0 -1
  117. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CrNlGe8g.js +0 -1
  118. package/dist/assets/zeni-epic-state-1VZHEC1T.js +0 -14
@@ -1,20 +1,20 @@
1
- import{j as u}from"./liveblocks-D6KTXvhv.js";import un from"./NotFoundScreen-DnEnkkn2.js";import{a as l}from"./sentry-DlTle5wx.js";import{n as Te,D as St,S as ze}from"./mui-BsWf3aoF.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Be}from"./core-CZukbx0Q.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as bn,eY as Me,pg as bt,Kq as at,Ks as vn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as vt,ng as ve,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as Bn,bB as On,kV as Fn,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Yn,mY as Jn,OW as Kn,OX as Nn,OY as Zn,nq as Hn,jA as Qn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Oe,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as ba,P6 as va,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Ba,Pb as Oa,Pc as Fa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-1VZHEC1T.js";import{K as Dt,i as Ut,s as ye,c as M,v as H,N as Bt,cq as $a,h as Ot,z as Ae,cr as Ga,ao as be,cs as qa,B as Ft,ct as Ya,cu as Ja,al as Fe,Y as Ka,S as Na,aI as Za,cv as Ha,aZ as Qa,C as Wa,D as Xa,cw as eo,T as to,cx as no}from"./index-BCMOKGoM.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-CAHHYp9d.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-CrNlGe8g.js";import{c as pt,C as ao}from"./TransactionDetailScreen-CC0P_ZOY.js";import{w as oo}from"./withTransactionSidePanel-ZDRkIRTY.js";import{h as so,v as co}from"./routePaths-tEjN6NOl.js";import{g as _e}from"./accountMappingHelper-VkYriGBP.js";import{D as io}from"./DrawerScreen-DXNbqsAp.js";import"./recharts-Kt4_Z9D4.js";import"./analytics-D3BPH6yx.js";import"./plaid-BlZUWQEE.js";import"./dnd-C982KOaa.js";import"./stripe-DMRn4zHo.js";import"./lottie-28Wzb4-h.js";import"./lexical-BiHBh7jO.js";import"./pdf-D4etPH5X.js";import"./utils-CnNkpT2e.js";import"./decodeURIComponentSafe-BMhpBWAI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="26eab456-4be1-4582-b67b-fa7e25750391",t._sentryDebugIdIdentifier="sentry-dbid-26eab456-4be1-4582-b67b-fa7e25750391")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:b}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=H(y.state?.pathnameStackToGoBack,y.pathname),K=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Bt();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:K,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:b})})},ro=Te.div`
1
+ import{j as u}from"./liveblocks-585gCzRC.js";import un from"./NotFoundScreen-DNbVpibd.js";import{a as l}from"./sentry-CznkHhej.js";import{n as Te,D as St,S as ze}from"./mui-Dh_OiBGq.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Be}from"./core-BM9YDzPX.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as vn,eY as Me,pg as vt,Kq as at,Ks as bn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as bt,ng as be,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as Bn,bB as Fn,kV as On,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Jn,mY as Yn,OW as Nn,OX as Kn,OY as Zn,nq as Hn,jA as Qn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Fe,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as va,P6 as ba,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Ba,Pb as Fa,Pc as Oa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-1oMHKKZA.js";import{J as Dt,i as Ut,c as ye,e as M,x as H,N as Bt,cq as $a,h as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Ot,ct as Ja,cu as Ya,al as Oe,Z as Na,S as Ka,aI as Za,cv as Ha,aZ as Qa,F as Wa,D as Xa,cw as eo,T as to,cx as no}from"./index-BxZQbqZa.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{c as pt,C as ao}from"./TransactionDetailScreen-BRy8OBJd.js";import{w as oo}from"./withTransactionSidePanel-DJ3JMAJu.js";import{h as so,v as co}from"./routePaths-DKtGe48K.js";import{g as _e}from"./accountMappingHelper-KEN2wBMB.js";import{D as io}from"./DrawerScreen-Bw1QfkLT.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./decodeURIComponentSafe-a784xZQy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="a7ed2312-011e-4d9e-ad7a-91fb7c6137d4",t._sentryDebugIdIdentifier="sentry-dbid-a7ed2312-011e-4d9e-ad7a-91fb7c6137d4")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=H(y.state?.pathnameStackToGoBack,y.pathname),N=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Bt();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:N,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,uo="512px",mo=({reconciliation:t,selectedDrawerAccountId:c,onFetchLinkTokenClick:w,onEstablishConnectionClick:A})=>{const y=Ot(),r=he(),m=Ae.getSignedInUser(),x=V(s=>$e(s)),g=t.excludedAccountIDs,a={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:x.tenantId??""},{accountReconciliationsByAccountID:j,monthYearPeriod:b,statementUploadChosen:I}=t,$=c!=null?j[c]:void 0,S=$?.accountReconEntity.statementMetaData?.statementUploadId,k=l.useCallback(()=>{c!=null&&r(je({selectedDrawerAccountId:void 0}))},[r,c]),L=(s,C)=>{r(fn(s,C.split(".")[0]))},K=s=>{S!=null&&r(In({accountId:c??"",selectedPeriod:b,fileId:s,statementUploadId:S}))},d=()=>{r(Et({statementUploadChosen:!1}))},p=s=>{c!=null&&r(Sn({accountId:c,selectedPeriod:b,payload:s}))},E=s=>{c!=null&&r(yt({accountId:c,selectedPeriod:b,localData:{accountSource:s}}))},U=l.useCallback(()=>{c!=null&&r(ft({accountId:c}))},[r,c]),e=l.useCallback(()=>{c!=null&&r(kt({accountId:c}))},[r,c]),n=g.includes(c??"")?t.excludedAccountReconciliationByAccountID[c??""]:void 0,o=$!=null?u.jsx(Ga,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:$,monthYearPeriod:b,onDismissClick:k,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:w,onEstablishConnectionClick:A,onEditFileName:L,onDeleteFile:K,onSelectSourceType:E,filesEndPoint:`${be.fileMicroServiceBaseUrl}`,authParams:a,openFilePicker:I,onStatementUploadSuccess:p,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:U}):n!=null?u.jsx(qa,{excludedAccountReconciliation:n,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:e}):null;return o==null?null:u.jsx(St,{anchor:"right",open:c!=null,PaperProps:{style:{width:uo,color:y.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>k(),children:u.jsx(ho,{onClick:s=>s.stopPropagation(),children:o})})},ho=Te(ze)`
8
+ `,uo="512px",mo=({reconciliation:t,selectedDrawerAccountId:c,onFetchLinkTokenClick:w,onEstablishConnectionClick:A})=>{const y=Ft(),r=he(),m=Ae.getSignedInUser(),x=V(s=>$e(s)),g=t.excludedAccountIDs,a={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:x.tenantId??""},{accountReconciliationsByAccountID:j,monthYearPeriod:v,statementUploadChosen:I}=t,$=c!=null?j[c]:void 0,S=$?.accountReconEntity.statementMetaData?.statementUploadId,k=l.useCallback(()=>{c!=null&&r(je({selectedDrawerAccountId:void 0}))},[r,c]),L=(s,C)=>{r(fn(s,C.split(".")[0]))},N=s=>{S!=null&&r(In({accountId:c??"",selectedPeriod:v,fileId:s,statementUploadId:S}))},d=()=>{r(Et({statementUploadChosen:!1}))},p=s=>{c!=null&&r(Sn({accountId:c,selectedPeriod:v,payload:s}))},E=s=>{c!=null&&r(yt({accountId:c,selectedPeriod:v,localData:{accountSource:s}}))},U=l.useCallback(()=>{c!=null&&r(ft({accountId:c}))},[r,c]),e=l.useCallback(()=>{c!=null&&r(kt({accountId:c}))},[r,c]),n=g.includes(c??"")?t.excludedAccountReconciliationByAccountID[c??""]:void 0,o=$!=null?u.jsx(Ga,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:$,monthYearPeriod:v,onDismissClick:k,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:w,onEstablishConnectionClick:A,onEditFileName:L,onDeleteFile:N,onSelectSourceType:E,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`,authParams:a,openFilePicker:I,onStatementUploadSuccess:p,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:U}):n!=null?u.jsx(qa,{excludedAccountReconciliation:n,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:e}):null;return o==null?null:u.jsx(St,{anchor:"right",open:c!=null,PaperProps:{style:{width:uo,color:y.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>k(),children:u.jsx(ho,{onClick:s=>s.stopPropagation(),children:o})})},ho=Te(ze)`
9
9
  display: flex;
10
10
  min-height: 100%;
11
11
  flex-direction: column;
12
- `;function po({companyId:t,closeCustomerRequestDrawer:c,addCustomerRequest:w,resetCustomerRequest:A}){const y=Ae.getSignedInUser();if(y==null)throw Error("Can't access Customer Request page without signing in...");const r=V(m=>kn(m,t,y));return l.useEffect(()=>{A()},[]),u.jsx(u.Fragment,{children:r.fetchState==="In-Progress"||r.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?u.jsx(Ft,{fetchState:"In-Progress"}):u.jsx(Ya,{onCloseClick:c,addCustomerRequest:w,snippets:r.companyMonthEndReportTemplatesData,bulletPoints:r.zeniRequestsData??[]})})}const go=t=>u.jsx(Ja,{...t}),Co="512px",So=({selectedTransactionId:t,onClose:c})=>{const w=Ot(),A=he(),y=V(g=>t==null?void 0:En(g.transactionState,t)),r=y?.qboId,m=V(g=>r==null?void 0:yn(g,r));l.useEffect(()=>{r!=null&&A(bn(r))},[A,t,r]);const x=l.useCallback(()=>{c()},[c]);return t==null||m==null?null:u.jsx(St,{anchor:"right",open:t!=null,PaperProps:{style:{width:Co,color:w.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:x,children:u.jsx(Io,{onClick:g=>g.stopPropagation(),children:u.jsx(go,{transactionActivityLogSelectorView:m,onClose:x})})})},Io=Te(ze)`
12
+ `;function po({companyId:t,closeCustomerRequestDrawer:c,addCustomerRequest:w,resetCustomerRequest:A}){const y=Ae.getSignedInUser();if(y==null)throw Error("Can't access Customer Request page without signing in...");const r=V(m=>kn(m,t,y));return l.useEffect(()=>{A()},[]),u.jsx(u.Fragment,{children:r.fetchState==="In-Progress"||r.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?u.jsx(Ot,{fetchState:"In-Progress"}):u.jsx(Ja,{onCloseClick:c,addCustomerRequest:w,snippets:r.companyMonthEndReportTemplatesData,bulletPoints:r.zeniRequestsData??[]})})}const go=t=>u.jsx(Ya,{...t}),Co="512px",So=({selectedTransactionId:t,onClose:c})=>{const w=Ft(),A=he(),y=V(g=>t==null?void 0:En(g.transactionState,t)),r=y?.qboId,m=V(g=>r==null?void 0:yn(g,r));l.useEffect(()=>{r!=null&&A(vn(r))},[A,t,r]);const x=l.useCallback(()=>{c()},[c]);return t==null||m==null?null:u.jsx(St,{anchor:"right",open:t!=null,PaperProps:{style:{width:Co,color:w.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:x,children:u.jsx(Io,{onClick:g=>g.stopPropagation(),children:u.jsx(go,{transactionActivityLogSelectorView:m,onClose:x})})})},Io=Te(ze)`
13
13
  display: flex;
14
14
  min-height: 100%;
15
15
  flex-direction: column;
16
- `,fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:ko,comma:gt,space:Eo}},dateFormat:jt}=Xa.getLocalizedStrings(),Ct=za,yo=mn(function(t,c){const{uncategorizedAccounts:w,vendorSearchAutoCompleteData:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:x,isTransactionActivityEnabled:g}=c,a=Ae.getSignedInUser(),j=t.tenantState.currentTenantId,b={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:j??""},I=Me(t),{selectedTransactionCategorizationTab:$}=I;return{expenseAutomationViewSelector:I,bulkUploadSelector:I.missingReceipts.bulkUpload,vendorSearchAutoCompleteData:A,authParams:b,receiptUploadEndpoint:`${be.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${to}/transaction_attachments`,bulkUploadEndpoint:x===!0?`${be.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:$,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:a,uncategorizedAccounts:w,companyId:m,isTransactionActivityEnabled:g,isAccountingClassesEnabled:Mn(t)}},function(t,c){const{themeState:w,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:x,expenseAutomationViewSelector:g,currentTenant:a,uncategorizedAccounts:j,navigate:b,onClickCustomerRequest:I,handleEditClick:$,setActivityLogTransactionId:S}=c,{selectedPeriod:k,currentSelectedView:L,reconciliation:{selectedAccountId:K}}=g,{accountSettingsView:d}=g.jeSchedules,p=vt(k),E=ve(p.start),U=ve(p.end);return{onZeniLogoClick:()=>{w.toggle()},onUploadReceiptAttachment:e=>{M.trackMissingReceiptAttached(k.month,k.year),t(xa(e))},onUploadTransactionReceipt:(e,n,o,s,C,h)=>{t(mt(e,n,{fetchState:"In-Progress"}));const f=()=>t(mt(e,n,{fetchState:"Error"}));no(`${be.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,h,n,o,s,C).then(v=>{v!=null?t(wa(e,v)):f()}).catch(f)},onMissingReceiptsRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Pa(e,n)),a!=null&&t(me({tenantId:a.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,o,s)=>{t(Aa(e,{fetchState:n,error:o})),o!=null&&t(dt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:s!=null?Eo+ko+s+gt:gt}]}))},onUpdateJESchedulesUIState:e=>{t(Ta(e))},onUpdateMissingReceiptsUIState:e=>{t(va(e))},onFetchMissingReceiptsList:()=>{U!=null&&E!=null&&t(Pt({start:E,end:U},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(La(e))},onBulkUploadProgress:e=>{t(Ma(e))},onBulkUploadSuccess:e=>{t(ja({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Va(e))},onConfirmBulkUploadMatch:(e,n,o,s,C)=>{t(_a(e,n,o,s,C))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Fa())},onSetBulkUploadResultsTab:e=>{t(Oa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ba(e))},onSetBulkUploadSortConfig:(e,n)=>{t(ht({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ua())},onSearchTransactionsForManualMatch:(e,n)=>{t(Ct(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=g.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Ct(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Da(e,n))},onFetchBulkUploadBatches:e=>{t(Tt(e))},onFetchMoreBatchDetails:()=>{t(Ra())},onResetBulkUploadSort:()=>{t(ht({sortKey:"date",sortOrder:"descending"}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(ba())},onSearchTextChanged:e=>{const n=g.currentSelectedView,o=g.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Oe({selectedTab:o,uiState:{searchString:e}})),U!=null&&E!=null&&t(ue(o,{start:E,end:U},!0,!1,e,void 0,!0)))},onRefresh:()=>{c.trackExpenseAutomationTabAnalytics(!0),t(ya(y))},onClose:()=>{L==="reconciliation"&&K!=null&&t(ut({selectedAccountId:void 0})),b("../")},onBack:()=>{L==="reconciliation"&&K!=null&&t(ut({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ea(e))},onSaveReconciliationReview:e=>{t(ka(e))},onUpdateStep:e=>{const{selectedPeriod:n}=g,o=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:o,referrer:g.currentSelectedView}}),t(At(e))},handleLogOutClick:()=>{const e=H(m.state?.pathnameStackToGoBack,m.pathname);b("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:o,fixedAssetsAccount:s,accruedExpensesAccount:C}=n,h=_e(d.prepaidExpensesAccountList,o.selectedOptions),f=_e(d.fixedAssetsAccountList,s.selectedOptions),v=_e(d.accruedExpensesAccountList,C.selectedOptions),z={selectedPrepaidExpensesAccountIds:h.map(B=>B.accountId),selectedFixedAssetsAccountIds:f.map(B=>B.accountId),selectedAccruedExpensesAccountIds:v.map(B=>B.accountId)};t(fa({data:z}))},onSaveJeAccountSettingsClick:()=>{t(Ia())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:o,accumulatedDepreciationCategory:s,scheduleClass:C,scheduleExpenseCategory:h,vendor:f}=n,{allAccountList:v,allClassList:z,allDepreciationAccountList:B}=g.jeSchedules,N=x.entityAutoCompleteView.vendor.length>0?x.entityAutoCompleteView.vendor.find(G=>G.id===f?.selectedOption):void 0,oe={id:N?.zeniId??f?.selectedOption??"",name:N?.name??f?.defaultOptions.find(G=>G.value===f?.selectedOption)?.label??"",logo:N?.logo},pe=h?.selectedOption!=null?v.find(G=>G.qboId===h.selectedOption):void 0,Pe=C?.selectedOption!=null?z.find(G=>G.classId===C.selectedOption):void 0,te=s?.selectedOption!=null?B.find(G=>G.qboId===s.selectedOption):void 0;t(Sa({scheduledJournalEntryID:e,localData:{jeScheduleID:o,scheduledJournalEntryID:e,updatedCategoryId:pe?.accountId,updatedClassId:Pe?.classId,updatedAccumulatedDepreciationCategoryID:te?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ca(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ct({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onCancelAutoComplete:()=>{t(ke("common"))}},onPostJESchedule(e,n){t(ga({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(pa())},handleJeScheduleClick:(e,n,o)=>{t(ha({selectedJEScheduleKey:n}));const s=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../vendors/schedules/${o}/details/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{a!=null&&t(ma(e,a.companyId,a.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(ua())},onOpenFileAttachmentSnackBar:()=>{t(dt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(da(e))},onUpdateFileAttachment:e=>{t(ra({files:e}))},previewMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!0,o,s,a.tenantId))},saveMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!1,o,s,a.tenantId))},onEditMonthEndInsightsClick:$,sendMonthEndReport:e=>{const n=m.state?.referrer,{selectedPeriod:o,auditSummary:s}=g;a!=null&&s?.auditScorePercentage!=null&&(t(ia(a.companyId,e,a.tenantId)),M.trackInsightsEmailPage(o.month,o.year,!1,"draft",s.auditScorePercentage,la().format(jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,o,s,C,h,f,v,z,B,N)=>{t(ca(e,n,o,s,j,C,h,f,v,z,B,N))},onCancelAutoComplete:()=>{t(ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(it({scrollPosition:e}))},onUpdateTab:e=>{c.closeSidePanel?.(),U!=null&&E!=null&&(t(ue(e,{start:E,end:U},!1,!1)),t(sa(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Oe({selectedTab:e,uiState:n})),U!=null&&E!=null&&t(ue(e,{start:E,end:U},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Oe({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,o,s,C,h,f)=>{U!=null&&E!=null&&t(ue(e,{start:E,end:U},!0,o,n,s,C,h,f))},resetTransactionCategorizationLocalData:(e,n,o,s,C,h,f,v)=>{t(oa(e,n,o,s,v??null,C,h,!1,f))},updateSelectedVendorForTransaction:(e,n,o,s,C)=>{t(lt({selectedTab:e,transactionId:n,lineId:o,selectedTransaction:s,uncategorizedAccounts:j,updatedVendor:C}))},onSaveUpdateTransactionCategorization:(e,n,o)=>{const s=m.state?.referrer;e==="autoCategorized"?M.trackTransactionsAutoCategorisedPage(k.month,k.year,g.transactionView.totalCountByTab.autoCategorized,n.length,!1,s??null):M.trackTransactionsReviewPage(k.month,k.year,g.transactionView.totalCountByTab.review,n.length,!1,s??null),t(aa(e,n,o,y))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(na({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,o,s,C,h,f)=>{const{transactionId:v,transaction:z,lineIds:B}=n;h!=null&&t(ea({transactionId:v,customerUpdates:h})),t(ta({selectedTab:s,transactionId:v.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:j,updatedCustomer:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))},onFetchRecommendationsForEntityCategorization:(e,n,o,s,C,h,f)=>{const{transactionId:v,transaction:z,lineIds:B}=n;h!=null&&(t(Qn({transactionId:v,vendorUpdates:{name:h.name,id:h.id?h.id:void 0}})),t(Wn({vendorId:h.id?h.id:void 0,localData:{vendorName:h.name,vendorId:h.id?h.id:void 0}}))),h?.id?(t(lt({selectedTab:s,transactionId:v.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:j,updatedVendor:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))):t(Xn({selectedTab:s,transactionId:v.id,lineId:B[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ee(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ee(k,!0,!1,null,!1,!1))},markAsReview:(e,n,o,s)=>{M.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Hn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Zn(e))},updateOperatingExpensesIdsForReview:e=>{t(Nn({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(c.tenantEmailDomain!=null){const n=co(e.id,e.qboId,c.tenantEmailDomain),o=H(c.location.state?.pathnameStackToGoBack,c.location.pathname);c.navigate(n,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Kn({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,o)=>{t(Ee(e,!0,!1,n,!0,o))},onReviewClicked:e=>{t(ae(k,e))},setOpenDrawerClicked:e=>{t(je({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Rt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const o=a?.companyId;o!=null&&(t(wt(e,o,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(xt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(je({selectedDrawerAccountId:e})),t(yt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Et({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ae(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Jn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Yn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{c.closeSidePanel?.(),t(Gn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,o)=>{const s=e.vendor?.id;o&&s!=null&&t(zn(s)),t($n({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,bt("bill"));const n=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{b(-1)},onReconListPageScroll:e=>{t(it({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ct({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ln({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(ft({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(kt({accountId:e}))}}},(t,c,w)=>{const{isMissingReceiptsBulkUploadEnabled:A,...y}=w;return function(r,m,x){return{...r,...m,...x,onUploadTransactionReceipt:(g,a,j,b,I)=>{m.onUploadTransactionReceipt(g,a,j,b,I,r.authParams)}}}(t,c,y)})(eo),bo=oo(({closeSidePanel:t,openTransactionPanel:c,panelContent:w,sidePanelIsFullView:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),x=It(),g=Ve(),a=he(),{isAiCfoAccessEnabled:j,onAskAiCfoClick:b}=_t({isAiCfoOpen:r,setIsAiCfoOpen:m,mobileExploreReferrer:"Transaction categorization"}),{areTenantIdsInSync:I}=Bt(),$=(()=>{const i=V(q=>Me(q)),T=Ve(),{currentSelectedViewFetchState:D,currentSelectedView:F,selectedPeriod:R}=i,de=Fe(F),X=Fe(D.fetchState),Se=l.useCallback(q=>{const Z=T.state?.referrer;F==="transaction_categorization"&&(i.selectedTransactionCategorizationTab==="review"?M.trackTransactionsReviewPage(R.month,R.year,i.transactionView.totalCountByTab.review,0,q,Z??null):M.trackTransactionsAutoCategorisedPage(R.month,R.year,i.transactionView.totalCountByTab.autoCategorized,0,q,Z??null)),F==="missing_receipts"&&M.trackMissingReceiptsPage(R.month,R.year,q,i.missingReceipts.transactions.length,Z??null),F==="je_schedules"&&M.trackMonthCloseScheduleListPage(R.month,R.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,Z??null),F==="flux_analysis"&&M.trackFluxAnalysisPage(R.month,R.year,q,fo(i.fluxAnalysis),Z??null),F==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&M.trackInsightsEmailPage(R.month,R.year,q,"draft",i.auditSummary.auditScorePercentage,null,Z??null)},[R,i]);return l.useEffect(()=>{X===D.fetchState&&F===de||D.fetchState!=="Completed"||Se(!1)},[F,D.fetchState,de]),Se})(),S=Ka(),[k,L]=l.useState(!1),K=V(i=>at(i)),d=V(i=>$e(i)),[p,E]=l.useState(!1),[U,e]=l.useState(!1),[n,o]=l.useState([]),[s,C]=l.useState(void 0),[h,f]=l.useState(!1),v=l.useRef(!1),{selectedTab:z}=nt(),{tenantEmailDomain:B}=nt(),[N,oe]=l.useState(g.state?.message==="comingFromTransactionDetail"),pe=g.state?.message==="comingFromOverview",Pe=Na(),te=Ae.getSignedInUser(),{useDynamicConfig:G,useFeatureGate:we}=Ut(),{configValue:Mt}=G(Za.enableUncategorizedExpenseCategory),Q=Mt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ge}=we(ye.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:se}=we(ye.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:qe}=we(ye.isTransactionActivityEnabled),Lt=V(i=>xn(i,"common")),_=V(i=>Me(i)),{monthEndCloseChecksView:J,currentSelectedView:O,selectedPeriod:P,selectedTransactionCategorizationTab:Ye,currentSelectedViewBackgroundRefreshFetchState:zt,currentSelectedViewFetchState:W,jeSchedules:xe,reconciliation:$t}=_,{selectedAccountId:ce}=$t,Je=Fe(xe.accountSettingsView.saveState.fetchState),Gt=V(i=>Rn(i.accountState,i.accountListState,"accountList")),ie=z!=null?Dn(z):O,qt=V(i=>i.entityAutoCompleteState.autoCompleteText.common);if(Vt({isDataReady:W.fetchState==="Completed"}),te==null)throw Error("Can't access expense automation screen without signing in...");const Ke=vt(P),le=ve(Ke.start),re=ve(Ke.end);if(le==null||re==null)throw Error(`Invalid start - ${le} and end - ${re} period from given ${P}`);const Yt=l.useCallback(()=>{E(!1)},[]),Jt=l.useCallback(()=>{e(!0)},[]),Kt=l.useCallback(i=>{o(i),e(!1)},[]),Nt=l.useCallback(()=>{o([])},[]),Re=`private-${te.userId}`,Ne="missing-receipts-batch-completed",ge=Ha();l.useEffect(()=>{if(ge==null||O!=="missing_receipts"||se===!1)return;const i=ge.channel(Re)??ge.subscribe(Re),T=D=>{a(jn({batchId:D.batch_id,progress:D.progress,status:D.status.toLowerCase()}))};return i.bind(Ne,T),()=>{i.unbind(Ne,T)}},[ge,O,Re,a,se]);const Ce=_.missingReceipts.bulkUpload.phase,Ze=_.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{O==="missing_receipts"&&Ce==="matching"&&Ze!=null&&a(Tt({cacheOverride:!0}))},[O,Ce,Ze,a]);const He=te?.userId,Zt=P.month,Ht=P.year,Qe=d?.tenantId;l.useEffect(()=>{O==="missing_receipts"&&se!==!1&&Ce==="idle"&&He!=null&&Qe!=null&&a(Un())},[O,se,Ce,He,Qe,Zt,Ht,a]),l.useEffect(()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[K.newVendorState?.vendorDetailLocalData?.vendorName]),l.useEffect(()=>{ie!=null&&O!==ie&&a(At(ie))},[ie]),l.useEffect(()=>{h!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!I||(f(!0),a(ot(!1,!1,Q)))},[h,W,I,Q]),l.useEffect(()=>{!pe&&I&&(a(ot(!1,!1,Q)),a(ae(P,ce,!1,!1)))},[P.month,P.year,I,Q]);const We=l.useCallback((i=!1,T=!1)=>{const D={start:le,end:re};switch(O){case"transaction_categorization":a(ue(Ye,D,i,!N,void 0,void 0,T,void 0,Q)),oe(!1);break;case"flux_analysis":a(Ee(P,i,T,null));break;case"month_end_insights":if(T===!1){const F=new Date(P.year,P.month,0),R=On(F.toDateString()).format(jt.analytics.YYYYDashMMDashDDFormat);a(Fn(!0,d.companyId,d.tenantId,R)),a(_n(d.companyId,d.tenantId))}break;case"je_schedules":a(Bn(D,T));break;case"missing_receipts":a(Pt(D,{amount:75,currencyCode:"USD",currencySymbol:"$"},i,T));break;default:a(ae(P,ce,i,T))}},[O,le,re,d.companyId,d.tenantId,Ye,P,ce,N,oe,Q]);l.useEffect(()=>{O===ie&&W.fetchState==="Not-Started"&&I&&We(!0)},[W,le,re,d.companyId,d.tenantId,I]),l.useEffect(()=>{pe||N||v.current||zt.fetchState==="In-Progress"||W.fetchState!=="Completed"||(v.current=!0,We(!0,!0))},[]),l.useEffect(()=>{J.fetchState!=="In-Progress"&&J.fetchState!=="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!1}))},[J.fetchState,d.tenantId]),l.useEffect(()=>{_.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?E(!0):E(!1)},[_.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),l.useEffect(()=>{_.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&I&&(a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0})),a(Vn({companyId:d.companyId})),x("../"))},[_.monthEndInsights?.sendMonthEndReportStatus?.fetchState,d.tenantId,P,d.companyId,I]),l.useEffect(()=>{const i=setInterval(()=>{J.fetchState!=="In-Progress"&&J.fetchState==="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(i)},[J.fetchState,d.tenantId,P,a]),l.useEffect(()=>{const i=setInterval(()=>{O==="reconciliation"&&ce==null&&_.reconciliation.fetchStatus.fetchState==="Completed"&&_.reconciliation.refreshStatus.fetchState!=="In-Progress"&&a(ae(P,void 0,!0,!0))},3e5);return()=>clearInterval(i)},[O,a,_.reconciliation.fetchStatus.fetchState,_.reconciliation.refreshStatus.fetchState,ae,ce,P]);const Qt=pt();l.useEffect(()=>{const i=(J.monthEndCloseChecks?.monthEndCloseCheckList.find(T=>T.id==="month_end_insights")?.isDisabled??!1)&&!Ge;O!=="month_end_insights"||!i&&J.monthEndCloseChecks?.reportEmailSentDate==null||x("../")},[O,J.monthEndCloseChecks]);const Wt=_.reconciliation.selectedDrawerAccountId;l.useEffect(()=>{Je==="In-Progress"&&xe.accountSettingsView.saveState.fetchState==="Completed"&&a(st())},[Je,xe.accountSettingsView.saveState.fetchState,st]);const{transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}=(({expenseAutomationViewSelector:i,closeDrawerHandler:T,currentSelectedView:D})=>{const F=he();let R,de,X;const Se=pt(),q=i.transactionView;let Z=()=>{};const{transactions:an,selectedTransactionId:ne,selectedTransactionLineId:Ie,transactionLocalData:on}=q;if(D==="transaction_categorization"){const De=on.find(ee=>ee.transactionId===ne),Y=an.find(ee=>ee.id===ne),et=Ie!=null?De?.transactionReviewLocalData?.lineItemById[Ie]:void 0,tt=et?.account;de=et?.class?.classId,R=["Uncategorized Income","Uncategorized Expense"].includes(tt?.accountName??"")?void 0:tt?.accountId;const cn=so(ne,Y?.typeOfTransaction);Y!=null&&cn&&(X={id:ne,type:bt(Y.typeOfTransaction)}),Z=()=>{if(ne!=null&&Ie!=null&&Y!=null){const ee=q.transactionLocalData.find(fe=>fe.transactionId===ne)?.transactionReviewLocalData;if(ee!=null&&Y.lines!=null&&Y.lines.length>0){const fe=ee.lineItemById[Ie];let Ue=ee.selectedEntity;if(wn(Y)||(Ue=fe.selectedEntityLine),Ue!=null){const ln=Ue,rn={transactionId:{id:Y.id,type:Y.type},transaction:Y,lineIds:Y.lines.map(dn=>dn.id)??[]};F(Le(ln,fe.amount.amount,rn,!1,!0,Se))}}}}}const sn=V(De=>at(De,void 0,R,de));return{transactionId:X,onSaveVendor:()=>{F(Pn(X,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{X!=null&&F(vn({transactionId:X})),F(Tn()),F(An()),T()},vendorViewDetails:sn}})({expenseAutomationViewSelector:_,closeDrawerHandler:()=>{L(!1)},currentSelectedView:O});return Pe?.loggedInUserRoleMap==null?J.fetchState==="Error"?u.jsx(Qa,{onGoHome:()=>x("../",{replace:!0}),onReload:()=>window.location.reload()}):u.jsx(Ft,{fetchState:"In-Progress"}):u.jsxs(u.Fragment,{children:[u.jsx(io,{isOpen:U,drawerLeftMargin:new Wa(0,0,300,650),onClose:()=>{e(!1)},children:u.jsx(vo,{onClick:i=>i.stopPropagation(),children:u.jsx(po,{companyId:d.companyId,closeCustomerRequestDrawer:()=>e(!1),addCustomerRequest:Kt,resetCustomerRequest:Nt})})}),Xe!=null&&k&&u.jsx(ao,{isOpen:k,transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}),u.jsx(mo,{selectedDrawerAccountId:Wt,reconciliation:_.reconciliation,onFetchLinkTokenClick:(i,T)=>{a(Rt("expense_automation_reconcile",i,T))},onEstablishConnectionClick:(i,T)=>{const D=d?.companyId;D!=null&&(a(wt(i,D,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),a(xt({accountId:T,connectionInProgress:!0})))}}),qe&&u.jsx(So,{selectedTransactionId:s,onClose:()=>C(void 0)}),u.jsx(yo,{navigate:x,location:g,themeState:S,vendorSearchAutoCompleteData:{autoCompleteText:qt,entityAutoCompleteView:Lt},expenseAutomationViewSelector:_,isMissingReceiptsBulkUploadEnabled:se,monthEndInsightsPreviewMode:p,monthEndInsightsCustomerRequestData:n,isRealtimeInsightsFeatureEnabled:Ge,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:Qt,currentTenant:d,companyId:d.companyId,signedInUser:te,isTransactionActivityEnabled:qe,uncategorizedAccounts:Gt,onClickCustomerRequest:Jt,handleEditClick:Yt,tenantEmailDomain:B,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:C,closeSidePanel:t,openTransactionPanel:c,sidePanelIsOpen:y,sidePanelIsFullView:A,panelContent:w,isAiCfoAccessEnabled:j,onAskAiCfoClick:b})]})}),vo=Te(ze)`
16
+ `,fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:ko,comma:gt,space:Eo}},dateFormat:jt}=Xa.getLocalizedStrings(),Ct=za,yo=mn(function(t,c){const{uncategorizedAccounts:w,vendorSearchAutoCompleteData:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:x,isTransactionActivityEnabled:g}=c,a=Ae.getSignedInUser(),j=t.tenantState.currentTenantId,v={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:j??""},I=Me(t),{selectedTransactionCategorizationTab:$}=I;return{expenseAutomationViewSelector:I,bulkUploadSelector:I.missingReceipts.bulkUpload,vendorSearchAutoCompleteData:A,authParams:v,receiptUploadEndpoint:`${ve.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${to}/transaction_attachments`,bulkUploadEndpoint:x===!0?`${ve.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:$,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:a,uncategorizedAccounts:w,companyId:m,isTransactionActivityEnabled:g,isAccountingClassesEnabled:Mn(t)}},function(t,c){const{themeState:w,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:x,expenseAutomationViewSelector:g,currentTenant:a,uncategorizedAccounts:j,navigate:v,onClickCustomerRequest:I,handleEditClick:$,setActivityLogTransactionId:S}=c,{selectedPeriod:k,currentSelectedView:L,reconciliation:{selectedAccountId:N}}=g,{accountSettingsView:d}=g.jeSchedules,p=bt(k),E=be(p.start),U=be(p.end);return{onZeniLogoClick:()=>{w.toggle()},onUploadReceiptAttachment:e=>{M.trackMissingReceiptAttached(k.month,k.year),t(xa(e))},onUploadTransactionReceipt:(e,n,o,s,C,h)=>{t(mt(e,n,{fetchState:"In-Progress"}));const f=()=>t(mt(e,n,{fetchState:"Error"}));no(`${ve.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,h,n,o,s,C).then(b=>{b!=null?t(wa(e,b)):f()}).catch(f)},onMissingReceiptsRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Pa(e,n)),a!=null&&t(me({tenantId:a.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,o,s)=>{t(Aa(e,{fetchState:n,error:o})),o!=null&&t(dt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:s!=null?Eo+ko+s+gt:gt}]}))},onUpdateJESchedulesUIState:e=>{t(Ta(e))},onUpdateMissingReceiptsUIState:e=>{t(ba(e))},onFetchMissingReceiptsList:()=>{U!=null&&E!=null&&t(Pt({start:E,end:U},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(La(e))},onBulkUploadProgress:e=>{t(Ma(e))},onBulkUploadSuccess:e=>{t(ja({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Va(e))},onConfirmBulkUploadMatch:(e,n,o,s,C)=>{t(_a(e,n,o,s,C))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Oa())},onSetBulkUploadResultsTab:e=>{t(Fa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ba(e))},onSetBulkUploadSortConfig:(e,n)=>{t(ht({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ua())},onSearchTransactionsForManualMatch:(e,n)=>{t(Ct(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=g.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Ct(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Da(e,n))},onFetchBulkUploadBatches:e=>{t(Tt(e))},onFetchMoreBatchDetails:()=>{t(Ra())},onResetBulkUploadSort:()=>{t(ht({sortKey:"date",sortOrder:"descending"}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(va())},onSearchTextChanged:e=>{const n=g.currentSelectedView,o=g.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Fe({selectedTab:o,uiState:{searchString:e}})),U!=null&&E!=null&&t(ue(o,{start:E,end:U},!0,!1,e,void 0,!0)))},onRefresh:()=>{c.trackExpenseAutomationTabAnalytics(!0),t(ya(y))},onClose:()=>{L==="reconciliation"&&N!=null&&t(ut({selectedAccountId:void 0})),v("../")},onBack:()=>{L==="reconciliation"&&N!=null&&t(ut({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ea(e))},onSaveReconciliationReview:e=>{t(ka(e))},onUpdateStep:e=>{const{selectedPeriod:n}=g,o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:o,referrer:g.currentSelectedView}}),t(At(e))},handleLogOutClick:()=>{const e=H(m.state?.pathnameStackToGoBack,m.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:o,fixedAssetsAccount:s,accruedExpensesAccount:C}=n,h=_e(d.prepaidExpensesAccountList,o.selectedOptions),f=_e(d.fixedAssetsAccountList,s.selectedOptions),b=_e(d.accruedExpensesAccountList,C.selectedOptions),z={selectedPrepaidExpensesAccountIds:h.map(B=>B.accountId),selectedFixedAssetsAccountIds:f.map(B=>B.accountId),selectedAccruedExpensesAccountIds:b.map(B=>B.accountId)};t(fa({data:z}))},onSaveJeAccountSettingsClick:()=>{t(Ia())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:o,accumulatedDepreciationCategory:s,scheduleClass:C,scheduleExpenseCategory:h,vendor:f}=n,{allAccountList:b,allClassList:z,allDepreciationAccountList:B}=g.jeSchedules,K=x.entityAutoCompleteView.vendor.length>0?x.entityAutoCompleteView.vendor.find(G=>G.id===f?.selectedOption):void 0,oe={id:K?.zeniId??f?.selectedOption??"",name:K?.name??f?.defaultOptions.find(G=>G.value===f?.selectedOption)?.label??"",logo:K?.logo},pe=h?.selectedOption!=null?b.find(G=>G.qboId===h.selectedOption):void 0,Pe=C?.selectedOption!=null?z.find(G=>G.classId===C.selectedOption):void 0,te=s?.selectedOption!=null?B.find(G=>G.qboId===s.selectedOption):void 0;t(Sa({scheduledJournalEntryID:e,localData:{jeScheduleID:o,scheduledJournalEntryID:e,updatedCategoryId:pe?.accountId,updatedClassId:Pe?.classId,updatedAccumulatedDepreciationCategoryID:te?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ca(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ct({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onCancelAutoComplete:()=>{t(ke("common"))}},onPostJESchedule(e,n){t(ga({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(pa())},handleJeScheduleClick:(e,n,o)=>{t(ha({selectedJEScheduleKey:n}));const s=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../vendors/schedules/${o}/details/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{a!=null&&t(ma(e,a.companyId,a.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(ua())},onOpenFileAttachmentSnackBar:()=>{t(dt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(da(e))},onUpdateFileAttachment:e=>{t(ra({files:e}))},previewMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!0,o,s,a.tenantId))},saveMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!1,o,s,a.tenantId))},onEditMonthEndInsightsClick:$,sendMonthEndReport:e=>{const n=m.state?.referrer,{selectedPeriod:o,auditSummary:s}=g;a!=null&&s?.auditScorePercentage!=null&&(t(ia(a.companyId,e,a.tenantId)),M.trackInsightsEmailPage(o.month,o.year,!1,"draft",s.auditScorePercentage,la().format(jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,o,s,C,h,f,b,z,B,K)=>{t(ca(e,n,o,s,j,C,h,f,b,z,B,K))},onCancelAutoComplete:()=>{t(ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(it({scrollPosition:e}))},onUpdateTab:e=>{c.closeSidePanel?.(),U!=null&&E!=null&&(t(ue(e,{start:E,end:U},!1,!1)),t(sa(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Fe({selectedTab:e,uiState:n})),U!=null&&E!=null&&t(ue(e,{start:E,end:U},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Fe({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,o,s,C,h,f)=>{U!=null&&E!=null&&t(ue(e,{start:E,end:U},!0,o,n,s,C,h,f))},resetTransactionCategorizationLocalData:(e,n,o,s,C,h,f,b)=>{t(oa(e,n,o,s,b??null,C,h,!1,f))},updateSelectedVendorForTransaction:(e,n,o,s,C)=>{t(lt({selectedTab:e,transactionId:n,lineId:o,selectedTransaction:s,uncategorizedAccounts:j,updatedVendor:C}))},onSaveUpdateTransactionCategorization:(e,n,o)=>{const s=m.state?.referrer;e==="autoCategorized"?M.trackTransactionsAutoCategorisedPage(k.month,k.year,g.transactionView.totalCountByTab.autoCategorized,n.length,!1,s??null):M.trackTransactionsReviewPage(k.month,k.year,g.transactionView.totalCountByTab.review,n.length,!1,s??null),t(aa(e,n,o,y))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(na({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:B}=n;h!=null&&t(ea({transactionId:b,customerUpdates:h})),t(ta({selectedTab:s,transactionId:b.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:j,updatedCustomer:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))},onFetchRecommendationsForEntityCategorization:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:B}=n;h!=null&&(t(Qn({transactionId:b,vendorUpdates:{name:h.name,id:h.id?h.id:void 0}})),t(Wn({vendorId:h.id?h.id:void 0,localData:{vendorName:h.name,vendorId:h.id?h.id:void 0}}))),h?.id?(t(lt({selectedTab:s,transactionId:b.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:j,updatedVendor:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))):t(Xn({selectedTab:s,transactionId:b.id,lineId:B[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ee(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ee(k,!0,!1,null,!1,!1))},markAsReview:(e,n,o,s)=>{M.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Hn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Zn(e))},updateOperatingExpensesIdsForReview:e=>{t(Kn({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(c.tenantEmailDomain!=null){const n=co(e.id,e.qboId,c.tenantEmailDomain),o=H(c.location.state?.pathnameStackToGoBack,c.location.pathname);c.navigate(n,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Nn({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,o)=>{t(Ee(e,!0,!1,n,!0,o))},onReviewClicked:e=>{t(ae(k,e))},setOpenDrawerClicked:e=>{t(je({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Rt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const o=a?.companyId;o!=null&&(t(wt(e,o,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(xt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(je({selectedDrawerAccountId:e})),t(yt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Et({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ae(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Yn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Jn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{c.closeSidePanel?.(),t(Gn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,o)=>{const s=e.vendor?.id;o&&s!=null&&t(zn(s)),t($n({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,vt("bill"));const n=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(it({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ct({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ln({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(ft({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(kt({accountId:e}))}}},(t,c,w)=>{const{isMissingReceiptsBulkUploadEnabled:A,...y}=w;return function(r,m,x){return{...r,...m,...x,onUploadTransactionReceipt:(g,a,j,v,I)=>{m.onUploadTransactionReceipt(g,a,j,v,I,r.authParams)}}}(t,c,y)})(eo),vo=oo(({closeSidePanel:t,openTransactionPanel:c,panelContent:w,sidePanelIsFullView:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),x=It(),g=Ve(),a=he(),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:r,setIsAiCfoOpen:m,mobileExploreReferrer:"Transaction categorization"}),{areTenantIdsInSync:I}=Bt(),$=(()=>{const i=V(q=>Me(q)),T=Ve(),{currentSelectedViewFetchState:D,currentSelectedView:O,selectedPeriod:R}=i,de=Oe(O),X=Oe(D.fetchState),Se=l.useCallback(q=>{const Z=T.state?.referrer;O==="transaction_categorization"&&(i.selectedTransactionCategorizationTab==="review"?M.trackTransactionsReviewPage(R.month,R.year,i.transactionView.totalCountByTab.review,0,q,Z??null):M.trackTransactionsAutoCategorisedPage(R.month,R.year,i.transactionView.totalCountByTab.autoCategorized,0,q,Z??null)),O==="missing_receipts"&&M.trackMissingReceiptsPage(R.month,R.year,q,i.missingReceipts.transactions.length,Z??null),O==="je_schedules"&&M.trackMonthCloseScheduleListPage(R.month,R.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,Z??null),O==="flux_analysis"&&M.trackFluxAnalysisPage(R.month,R.year,q,fo(i.fluxAnalysis),Z??null),O==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&M.trackInsightsEmailPage(R.month,R.year,q,"draft",i.auditSummary.auditScorePercentage,null,Z??null)},[R,i]);return l.useEffect(()=>{X===D.fetchState&&O===de||D.fetchState!=="Completed"||Se(!1)},[O,D.fetchState,de]),Se})(),S=Na(),[k,L]=l.useState(!1),N=V(i=>at(i)),d=V(i=>$e(i)),[p,E]=l.useState(!1),[U,e]=l.useState(!1),[n,o]=l.useState([]),[s,C]=l.useState(void 0),[h,f]=l.useState(!1),b=l.useRef(!1),{selectedTab:z}=nt(),{tenantEmailDomain:B}=nt(),[K,oe]=l.useState(g.state?.message==="comingFromTransactionDetail"),pe=g.state?.message==="comingFromOverview",Pe=Ka(),te=Ae.getSignedInUser(),{useDynamicConfig:G,useFeatureGate:we}=Ut(),{configValue:Mt}=G(Za.enableUncategorizedExpenseCategory),Q=Mt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ge}=we(ye.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:se}=we(ye.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:qe}=we(ye.isTransactionActivityEnabled),Lt=V(i=>xn(i,"common")),_=V(i=>Me(i)),{monthEndCloseChecksView:Y,currentSelectedView:F,selectedPeriod:P,selectedTransactionCategorizationTab:Je,currentSelectedViewBackgroundRefreshFetchState:zt,currentSelectedViewFetchState:W,jeSchedules:xe,reconciliation:$t}=_,{selectedAccountId:ce}=$t,Ye=Oe(xe.accountSettingsView.saveState.fetchState),Gt=V(i=>Rn(i.accountState,i.accountListState,"accountList")),ie=z!=null?Dn(z):F,qt=V(i=>i.entityAutoCompleteState.autoCompleteText.common);if(Vt({isDataReady:W.fetchState==="Completed"}),te==null)throw Error("Can't access expense automation screen without signing in...");const Ne=bt(P),le=be(Ne.start),re=be(Ne.end);if(le==null||re==null)throw Error(`Invalid start - ${le} and end - ${re} period from given ${P}`);const Jt=l.useCallback(()=>{E(!1)},[]),Yt=l.useCallback(()=>{e(!0)},[]),Nt=l.useCallback(i=>{o(i),e(!1)},[]),Kt=l.useCallback(()=>{o([])},[]),Re=`private-${te.userId}`,Ke="missing-receipts-batch-completed",ge=Ha();l.useEffect(()=>{if(ge==null||F!=="missing_receipts"||se===!1)return;const i=ge.channel(Re)??ge.subscribe(Re),T=D=>{a(jn({batchId:D.batch_id,progress:D.progress,status:D.status.toLowerCase()}))};return i.bind(Ke,T),()=>{i.unbind(Ke,T)}},[ge,F,Re,a,se]);const Ce=_.missingReceipts.bulkUpload.phase,Ze=_.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{F==="missing_receipts"&&Ce==="matching"&&Ze!=null&&a(Tt({cacheOverride:!0}))},[F,Ce,Ze,a]);const He=te?.userId,Zt=P.month,Ht=P.year,Qe=d?.tenantId;l.useEffect(()=>{F==="missing_receipts"&&se!==!1&&Ce==="idle"&&He!=null&&Qe!=null&&a(Un())},[F,se,Ce,He,Qe,Zt,Ht,a]),l.useEffect(()=>{N.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[N.newVendorState?.vendorDetailLocalData?.vendorName]),l.useEffect(()=>{ie!=null&&F!==ie&&a(At(ie))},[ie]),l.useEffect(()=>{h!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!I||(f(!0),a(ot(!1,!1,Q)))},[h,W,I,Q]),l.useEffect(()=>{!pe&&I&&(a(ot(!1,!1,Q)),a(ae(P,ce,!1,!1)))},[P.month,P.year,I,Q]);const We=l.useCallback((i=!1,T=!1)=>{const D={start:le,end:re};switch(F){case"transaction_categorization":a(ue(Je,D,i,!K,void 0,void 0,T,void 0,Q)),oe(!1);break;case"flux_analysis":a(Ee(P,i,T,null));break;case"month_end_insights":if(T===!1){const O=new Date(P.year,P.month,0),R=Fn(O.toDateString()).format(jt.analytics.YYYYDashMMDashDDFormat);a(On(!0,d.companyId,d.tenantId,R)),a(_n(d.companyId,d.tenantId))}break;case"je_schedules":a(Bn(D,T));break;case"missing_receipts":a(Pt(D,{amount:75,currencyCode:"USD",currencySymbol:"$"},i,T));break;default:a(ae(P,ce,i,T))}},[F,le,re,d.companyId,d.tenantId,Je,P,ce,K,oe,Q]);l.useEffect(()=>{F===ie&&W.fetchState==="Not-Started"&&I&&We(!0)},[W,le,re,d.companyId,d.tenantId,I]),l.useEffect(()=>{pe||K||b.current||zt.fetchState==="In-Progress"||W.fetchState!=="Completed"||(b.current=!0,We(!0,!0))},[]),l.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!1}))},[Y.fetchState,d.tenantId]),l.useEffect(()=>{_.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?E(!0):E(!1)},[_.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),l.useEffect(()=>{_.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&I&&(a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0})),a(Vn({companyId:d.companyId})),x("../"))},[_.monthEndInsights?.sendMonthEndReportStatus?.fetchState,d.tenantId,P,d.companyId,I]),l.useEffect(()=>{const i=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(i)},[Y.fetchState,d.tenantId,P,a]),l.useEffect(()=>{const i=setInterval(()=>{F==="reconciliation"&&ce==null&&_.reconciliation.fetchStatus.fetchState==="Completed"&&_.reconciliation.refreshStatus.fetchState!=="In-Progress"&&a(ae(P,void 0,!0,!0))},3e5);return()=>clearInterval(i)},[F,a,_.reconciliation.fetchStatus.fetchState,_.reconciliation.refreshStatus.fetchState,ae,ce,P]);const Qt=pt();l.useEffect(()=>{const i=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(T=>T.id==="month_end_insights")?.isDisabled??!1)&&!Ge;F!=="month_end_insights"||!i&&Y.monthEndCloseChecks?.reportEmailSentDate==null||x("../")},[F,Y.monthEndCloseChecks]);const Wt=_.reconciliation.selectedDrawerAccountId;l.useEffect(()=>{Ye==="In-Progress"&&xe.accountSettingsView.saveState.fetchState==="Completed"&&a(st())},[Ye,xe.accountSettingsView.saveState.fetchState,st]);const{transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}=(({expenseAutomationViewSelector:i,closeDrawerHandler:T,currentSelectedView:D})=>{const O=he();let R,de,X;const Se=pt(),q=i.transactionView;let Z=()=>{};const{transactions:an,selectedTransactionId:ne,selectedTransactionLineId:Ie,transactionLocalData:on}=q;if(D==="transaction_categorization"){const De=on.find(ee=>ee.transactionId===ne),J=an.find(ee=>ee.id===ne),et=Ie!=null?De?.transactionReviewLocalData?.lineItemById[Ie]:void 0,tt=et?.account;de=et?.class?.classId,R=["Uncategorized Income","Uncategorized Expense"].includes(tt?.accountName??"")?void 0:tt?.accountId;const cn=so(ne,J?.typeOfTransaction);J!=null&&cn&&(X={id:ne,type:vt(J.typeOfTransaction)}),Z=()=>{if(ne!=null&&Ie!=null&&J!=null){const ee=q.transactionLocalData.find(fe=>fe.transactionId===ne)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const fe=ee.lineItemById[Ie];let Ue=ee.selectedEntity;if(wn(J)||(Ue=fe.selectedEntityLine),Ue!=null){const ln=Ue,rn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(dn=>dn.id)??[]};O(Le(ln,fe.amount.amount,rn,!1,!0,Se))}}}}}const sn=V(De=>at(De,void 0,R,de));return{transactionId:X,onSaveVendor:()=>{O(Pn(X,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{X!=null&&O(bn({transactionId:X})),O(Tn()),O(An()),T()},vendorViewDetails:sn}})({expenseAutomationViewSelector:_,closeDrawerHandler:()=>{L(!1)},currentSelectedView:F});return Pe?.loggedInUserRoleMap==null?Y.fetchState==="Error"?u.jsx(Qa,{onGoHome:()=>x("../",{replace:!0}),onReload:()=>window.location.reload()}):u.jsx(Ot,{fetchState:"In-Progress"}):u.jsxs(u.Fragment,{children:[u.jsx(io,{isOpen:U,drawerLeftMargin:new Wa(0,0,300,650),onClose:()=>{e(!1)},children:u.jsx(bo,{onClick:i=>i.stopPropagation(),children:u.jsx(po,{companyId:d.companyId,closeCustomerRequestDrawer:()=>e(!1),addCustomerRequest:Nt,resetCustomerRequest:Kt})})}),Xe!=null&&k&&u.jsx(ao,{isOpen:k,transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}),u.jsx(mo,{selectedDrawerAccountId:Wt,reconciliation:_.reconciliation,onFetchLinkTokenClick:(i,T)=>{a(Rt("expense_automation_reconcile",i,T))},onEstablishConnectionClick:(i,T)=>{const D=d?.companyId;D!=null&&(a(wt(i,D,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),a(xt({accountId:T,connectionInProgress:!0})))}}),qe&&u.jsx(So,{selectedTransactionId:s,onClose:()=>C(void 0)}),u.jsx(yo,{navigate:x,location:g,themeState:S,vendorSearchAutoCompleteData:{autoCompleteText:qt,entityAutoCompleteView:Lt},expenseAutomationViewSelector:_,isMissingReceiptsBulkUploadEnabled:se,monthEndInsightsPreviewMode:p,monthEndInsightsCustomerRequestData:n,isRealtimeInsightsFeatureEnabled:Ge,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:Qt,currentTenant:d,companyId:d.companyId,signedInUser:te,isTransactionActivityEnabled:qe,uncategorizedAccounts:Gt,onClickCustomerRequest:Yt,handleEditClick:Jt,tenantEmailDomain:B,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:C,closeSidePanel:t,openTransactionPanel:c,sidePanelIsOpen:y,sidePanelIsFullView:A,panelContent:w,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})]})}),bo=Te(ze)`
17
17
  display: flex;
18
18
  min-height: 100%;
19
19
  flex-direction: column;
20
- `;function Zo(){return u.jsxs(hn,{children:[u.jsx(Be,{path:"*",element:u.jsx(lo,{})}),u.jsx(Be,{path:"/:selectedTab/:selectedPeriod/*",element:u.jsx(bo,{})}),u.jsx(Be,{path:"*",element:u.jsx(un,{})})]})}export{Zo as default};
20
+ `;function Zo(){return u.jsxs(hn,{children:[u.jsx(Be,{path:"*",element:u.jsx(lo,{})}),u.jsx(Be,{path:"/:selectedTab/:selectedPeriod/*",element:u.jsx(vo,{})}),u.jsx(Be,{path:"*",element:u.jsx(un,{})})]})}export{Zo as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-585gCzRC.js";import{a as d}from"./sentry-CznkHhej.js";import{X as c,$ as l,Y as p,s as f}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import m from"./NotFoundScreen-DNbVpibd.js";import{j as u,u as b}from"./core-BM9YDzPX.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="dd7c473a-a4d4-49cd-947d-ba847deafae6",a._sentryDebugIdIdentifier="sentry-dbid-dd7c473a-a4d4-49cd-947d-ba847deafae6")}catch{}})();const D=()=>{const a=u(),e=b(),t=d.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),r=d.useCallback(()=>{(()=>{const n=f(e.state?.pathnameStackToGoBack),i=n.poppedPathname??k();a(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(e.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:r}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{D as F};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-D6KTXvhv.js";import{l as b,k as x,j,u as y,h as Z,q as ee,g as A,N as ae,n as te,o as p}from"./core-CZukbx0Q.js";import{Iu as S,Iv as k,Iw as N,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-1VZHEC1T.js";import{J as g,o as r,E as re,c as v,j as E,p as de,q as ce,r as me,v as F,i as pe,s as ue,R as he,Y as xe,h as ge,B as fe,x as we,k as be,y as ye,A as Se,C as ke,M as ve}from"./index-BCMOKGoM.js";import{n as c}from"./mui-BsWf3aoF.js";import f from"./NotFoundScreen-DnEnkkn2.js";import{a as P}from"./sentry-DlTle5wx.js";import"./recharts-Kt4_Z9D4.js";import"./analytics-D3BPH6yx.js";import"./plaid-BlZUWQEE.js";import"./dnd-C982KOaa.js";import"./stripe-DMRn4zHo.js";import"./lottie-28Wzb4-h.js";import"./lexical-BiHBh7jO.js";import"./pdf-D4etPH5X.js";import"./utils-CnNkpT2e.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]="0a570bad-c742-4b8e-9722-1340e1a3f86c",e._sentryDebugIdIdentifier="sentry-dbid-0a570bad-c742-4b8e-9722-1340e1a3f86c")}catch{}})();const Ie=c.div`
1
+ import{j as a}from"./liveblocks-585gCzRC.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-BM9YDzPX.js";import{Iu as S,Iv as k,Iw as N,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-1oMHKKZA.js";import{K as g,o as r,E as re,e as v,m as E,r as de,s as ce,v as me,x as F,i as pe,c as ue,R as he,Z as xe,h as ge,B as fe,y as be,p as we,A as ye,C as Se,F as ke,M as ve}from"./index-BxZQbqZa.js";import{n as c}from"./mui-Dh_OiBGq.js";import f from"./NotFoundScreen-DNbVpibd.js";import{a as P}from"./sentry-CznkHhej.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="0a86ff8a-03ad-4a90-9556-4b7b35e6116b",e._sentryDebugIdIdentifier="sentry-dbid-0a86ff8a-03ad-4a90-9556-4b7b35e6116b")}catch{}})();const Ie=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -7,7 +7,7 @@ import{j as a}from"./liveblocks-D6KTXvhv.js";import{l as b,k as x,j,u as y,h as
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
9
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,je=x(function(e){const t=S(e),n=k(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(L(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(N({data:l}))}}})(re);function z(){const e=g(),{vendorId:t,billId:n}=b();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(je,{vendorId:t,billId:n})})})}const $e=c.div`
10
+ `,je=x(function(e){const t=S(e),n=k(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(L(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(N({data:l}))}}})(re);function z(){const e=g(),{vendorId:t,billId:n}=w();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(je,{vendorId:t,billId:n})})})}const $e=c.div`
11
11
  display: flex;
12
12
  height: 100vh;
13
13
  width: 100%;
@@ -25,7 +25,7 @@ import{j as a}from"./liveblocks-D6KTXvhv.js";import{l as b,k as x,j,u as y,h as
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
27
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,ze=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(L(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(N({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(me);function Ne(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Pe,{windowSize:n,children:a.jsx(ze,{location:t,navigate:e,vendorId:o,billId:i})})})}const Le=c.div`
28
+ `,ze=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(L(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(N({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(me);function Ne(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=w();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Pe,{windowSize:n,children:a.jsx(ze,{location:t,navigate:e,vendorId:o,billId:i})})})}const Le=c.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -34,7 +34,7 @@ import{j as a}from"./liveblocks-D6KTXvhv.js";import{l as b,k as x,j,u as y,h as
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
36
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Ee=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(oe({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(he);function Fe(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Le,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
37
+ `,Ee=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(oe({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(he);function Fe(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=w(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Le,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
38
38
  width: ${r.sp4};
39
39
  height: ${r.sp4};
40
40
  margin-bottom: ${r.sp3};
@@ -43,14 +43,14 @@ import{j as a}from"./liveblocks-D6KTXvhv.js";import{l as b,k as x,j,u as y,h as
43
43
  cursor: pointer;
44
44
  position: absolute;
45
45
  color: ${e=>e.theme.colors.brandColorJade};
46
- `,Me=c.div`
46
+ `,Ke=c.div`
47
47
  display: flex;
48
48
  height: 100vh;
49
49
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
50
  width: 100vw;
51
51
  overflow-y: scroll;
52
52
  background-color: ${e=>e.theme.colors.grey4};
53
- `,He=c.div`
53
+ `,Me=c.div`
54
54
  display: flex;
55
55
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
56
  flex-direction: column;
@@ -58,7 +58,7 @@ import{j as a}from"./liveblocks-D6KTXvhv.js";import{l as b,k as x,j,u as y,h as
58
58
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
59
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
60
  padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,Ke=c.div`
61
+ `,He=c.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
@@ -69,4 +69,4 @@ import{j as a}from"./liveblocks-D6KTXvhv.js";import{l as b,k as x,j,u as y,h as
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,Ve=x(function(e,t){return{file:t.file,type:t.type}})(Se);function h({appContent:e}){const t=Z(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=b(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),w=g(),G=xe(),B=ge(),M=()=>{G.toggle()},H=A(u=>S(u)),K=A(u=>k(u)),{authParams:V,fetchState:m,billAttachment:W,billFetchState:D,companyName:_,currencySymbol:U,amount:q}=H,{tenantId:J,userId:O,sessionId:Q}=V,{fetchState:R,internationalBankAccountCreateStatus:Y}=K;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&t(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(I(O,Q,J),l!=null&&t(le(l)))},[m]),m==="Error"?a.jsx(f,{}):R==="Completed"||Y.fetchState==="Completed"?(I(),a.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?a.jsx(fe,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[m==="Completed"&&D==="Completed"&&a.jsx(we,{analytics:v,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",i??"",_,l??"",We(n.pathname),U,q))(u)}),a.jsxs(Me,{windowSize:w,children:[w!=="small"?a.jsx(Ge,{onClick:M}):null,a.jsx(Ke,{windowSize:w,isAddressPage:T,children:D==="In-Progress"?a.jsx(be,{size:"ExtraLarge",start:!0}):a.jsx(Ve,{file:W,type:"bill"})}),a.jsx(He,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function _e(){return a.jsx(ve,{})}function la(){return a.jsxs(te,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(_e,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ne,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Fe,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{la as default};
72
+ `,Ve=x(function(e,t){return{file:t.file,type:t.type}})(Se);function h({appContent:e}){const t=Y(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=w(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),b=g(),G=xe(),B=ge(),K=()=>{G.toggle()},M=A(u=>S(u)),H=A(u=>k(u)),{authParams:V,fetchState:m,billAttachment:W,billFetchState:D,companyName:_,currencySymbol:U,amount:O}=M,{tenantId:Q,userId:q,sessionId:J}=V,{fetchState:R,internationalBankAccountCreateStatus:Z}=H;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&t(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(I(q,J,Q),l!=null&&t(le(l)))},[m]),m==="Error"?a.jsx(f,{}):R==="Completed"||Z.fetchState==="Completed"?(I(),a.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?a.jsx(fe,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[m==="Completed"&&D==="Completed"&&a.jsx(be,{analytics:v,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",i??"",_,l??"",We(n.pathname),U,O))(u)}),a.jsxs(Ke,{windowSize:b,children:[b!=="small"?a.jsx(Ge,{onClick:K}):null,a.jsx(He,{windowSize:b,isAddressPage:T,children:D==="In-Progress"?a.jsx(we,{size:"ExtraLarge",start:!0}):a.jsx(Ve,{file:W,type:"bill"})}),a.jsx(Me,{windowSize:b,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function _e(){return a.jsx(ve,{})}function la(){return a.jsxs(te,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(_e,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ne,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Fe,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{la as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-585gCzRC.js";import{a as f}from"./sentry-CznkHhej.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-BM9YDzPX.js";import{z as r,h as P,D as V,f as A,e as N,g as q,w as R,p as W,k as $}from"./index-BxZQbqZa.js";import{eM as B,Ie as G,Ip as H,If as J,eN as K,fi as Q,Il as X,fF as Y,cR as Z,Iq as ee,Ir as te}from"./zeni-epic-state-1oMHKKZA.js";import{n as ne}from"./mui-Dh_OiBGq.js";import{u as se}from"./useDeviceId-D_MFUrrA.js";import{f as ae}from"./analyticsHelper-1lOvj-za.js";import{t as ie}from"./getLocaleForTenant-Czitv1AW.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="90f36598-8e52-474b-a89e-9829a8dbf6dd",t._sentryDebugIdIdentifier="sentry-dbid-90f36598-8e52-474b-a89e-9829a8dbf6dd")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=w(),m=_(),[b]=M(),n=b.get("token"),p=b.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,k,v,a.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{De as default};
@@ -1 +1 @@
1
- import{j as U}from"./liveblocks-D6KTXvhv.js";import{a as c}from"./sentry-DlTle5wx.js";import{h as pe,g as t,l as We,u as Xe,j as qe,i as R}from"./core-CZukbx0Q.js";import{eM as he,eU as Je,eV as Se,eO as Ke,bm as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cF as ua,fd as fa,cL as ma,bu as ba,eL as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-1VZHEC1T.js";import{a1 as Ea,a2 as ka,Y as Ca,i as ya,z as k,a3 as Ia,u as Ta,s as r,a4 as wa,a5 as Fa,S as Aa,a as _a,a6 as Da,X as va,a7 as $a,a8 as Ba,a9 as fe,aa as me,L as Ma,ab as Pa,ac as be,c as x,v as F,ad as N,ae as Ra}from"./index-BCMOKGoM.js";import{D as xa}from"./mui-BsWf3aoF.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="8aeef85c-5d6d-40a4-9759-2f5ad03f3c41",f._sentryDebugIdIdentifier="sentry-dbid-8aeef85c-5d6d-40a4-9759-2f5ad03f3c41")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=We(),a=Xe(),C=Ca(),o=qe(),V=Ke(),m=pe(),{useFeatureGate:i}=ya(),G=k.getSignedInUser(),A=Qe(G),s=t(e=>he(e)),L=t(e=>ea(e)),j=L.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,z=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Z),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),H=t(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=t(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=t(e=>e.tenantState),ye=t(e=>$.fetchState==="Completed"?sa(e):[]),E=t(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&A,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=A||!A&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Me=t(e=>g(e).totalUnreadCount),Pe=t(e=>g(e).reducedFetchCountState),J=t(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=t(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=t(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=t(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:xe}=Fa();c.useEffect(()=>{const e=setTimeout(()=>xe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ne={fetchStatus:Pe,count:Me},ne=n!=null?k.getSignedInUserTenant(n):null,se=t(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ue=Aa(),oe=t(e=>da(e,S,h,X,W,w).fetchState),ie=t(e=>la(e).fetchState),Ve=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Ge=c.useMemo(()=>ca(s.userRole),[s.userRole]),Le=ua(Ge),je=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&H.fetchState==="Completed"&&fa(H.notificationSettings,h.userEmail,Z,s),re=_a(),ze=re&&Da(a),de=ma(Ue?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(n??"")&&le===!1&&va(a.pathname)!=="treasury",[w,de,le,a.pathname,n]),[Ye,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Ze=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,He=$a(Ze);return U.jsx(xa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ve,isSettings:me(a),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:Le,isZeniAccountEnabled:Y,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:He,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:Oe,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:je,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";me(a)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=F(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=F(a.state?.pathnameStackToGoBack,a.pathname);return x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),void o(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[s.tenantId]!=null&&x.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${n}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ra(e.type);be(e.type)?(j!=null&&m(ga()),o(`/${n}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${n}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${n}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${n}/rewards`)},handleBackClick:()=>{o(`/${n}/dashboard`)},handleTenantSelect:e=>{ge(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;x.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:L,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${n}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:Ae,newYearAnimationEnabled:_e})})}),za=f=>{const d=pe(),n=t(C=>he(C)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Na,{...f,...a})};export{za as M};
1
+ import{j as U}from"./liveblocks-585gCzRC.js";import{a as c}from"./sentry-CznkHhej.js";import{h as pe,g as t,l as We,u as Xe,j as qe,i as P}from"./core-BM9YDzPX.js";import{eM as he,eU as Je,eV as Se,eO as Ke,bm as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cF as ua,fd as ma,cL as fa,bu as ba,eL as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-1oMHKKZA.js";import{a1 as Ea,a2 as ka,Z as Ca,i as ya,z as k,a3 as Ia,u as Ta,c as r,a4 as wa,a5 as Fa,S as Aa,a as _a,a6 as Da,X as va,a7 as $a,a8 as Ba,a9 as me,aa as fe,L as Ma,ab as xa,ac as be,e as R,x as F,ad as N,ae as Pa}from"./index-BxZQbqZa.js";import{D as Ra}from"./mui-Dh_OiBGq.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="6b95e4ba-a2be-41d0-8f04-e935bd313049",m._sentryDebugIdIdentifier="sentry-dbid-6b95e4ba-a2be-41d0-8f04-e935bd313049")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=We(),a=Xe(),C=Ca(),o=qe(),V=Ke(),f=pe(),{useFeatureGate:i}=ya(),G=k.getSignedInUser(),A=Qe(G),s=t(e=>he(e)),L=t(e=>ea(e)),j=L.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Y),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),H=t(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=t(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&f(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=t(e=>e.tenantState),ye=t(e=>$.fetchState==="Completed"?sa(e):[]),E=t(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&A,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=A||!A&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Me=t(e=>g(e).totalUnreadCount),xe=t(e=>g(e).reducedFetchCountState),J=t(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=t(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Pe=t(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=t(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Re}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Re?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Pe.fetchState==="Not-Started"&&V.tenantId!=null&&f(ia("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||f(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(f(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),f(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ne={fetchStatus:xe,count:Me},ne=n!=null?k.getSignedInUserTenant(n):null,se=t(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),Z===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ue=Aa(),oe=t(e=>da(e,S,h,X,W,w).fetchState),ie=t(e=>la(e).fetchState),Ve=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Ge=c.useMemo(()=>ca(s.userRole),[s.userRole]),Le=ua(Ge),je=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&H.fetchState==="Completed"&&ma(H.notificationSettings,h.userEmail,Y,s),re=_a(),ze=re&&Da(a),de=fa(Ue?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(n??"")&&le===!1&&va(a.pathname)!=="treasury",[w,de,le,a.pathname,n]),[Ze,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Ye=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,He=$a(Ye);return U.jsx(Ra,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ve,isSettings:fe(a),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:Le,isZeniAccountEnabled:Z,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:He,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:Oe,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:me(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:je,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";fe(a)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=F(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=F(a.state?.pathnameStackToGoBack,a.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),void o(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[s.tenantId]!=null&&R.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${n}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Pa(e.type);be(e.type)?(j!=null&&f(ga()),o(`/${n}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${n}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${n}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${n}/rewards`)},handleBackClick:()=>{o(`/${n}/dashboard`)},handleTenantSelect:e=>{ge(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=me(a);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":xa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(f(ha(e.tenantId)),f(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:L,isOnDashboard:D,updateCurrentChatSessionId:e=>{f(pa({sessionId:e,agentId:"controller"})),o(`/${n}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:Ae,newYearAnimationEnabled:_e})})}),za=m=>{const d=pe(),n=t(C=>he(C)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Na,{...m,...a})};export{za as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-585gCzRC.js";import{j as r,k as i}from"./core-BM9YDzPX.js";import{W as n}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import"./sentry-CznkHhej.js";import"./zeni-epic-state-1oMHKKZA.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="fe0dc2e3-d6a3-4690-8e18-122b6c1ede12",o._sentryDebugIdIdentifier="sentry-dbid-fe0dc2e3-d6a3-4690-8e18-122b6c1ede12")}catch{}})();const d=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(d,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-D6KTXvhv.js";import ut from"./NotFoundScreen-DnEnkkn2.js";import{a as k}from"./sentry-DlTle5wx.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as L}from"./core-CZukbx0Q.js";import{cn as It,eW as X,eM as H,fa as Ct,f2 as b,OD as Q,f6 as d,eV as y,qn as $,vB as Tt,OE as yt,eU as At,fd as Et,qs as _t,OF as F,bp as M,gy as x,qw as J,OG as Nt,cy as Bt,cs as wt}from"./zeni-epic-state-1VZHEC1T.js";import{N as xt,z as vt,i as Dt,s as Rt,K as Ut,cn as Gt,v as N,a1 as Pt,co as Ft,a2 as Mt,q as $t}from"./index-BCMOKGoM.js";import"./mui-BsWf3aoF.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-CAHHYp9d.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-CrNlGe8g.js";import"./recharts-Kt4_Z9D4.js";import"./analytics-D3BPH6yx.js";import"./plaid-BlZUWQEE.js";import"./dnd-C982KOaa.js";import"./stripe-DMRn4zHo.js";import"./lottie-28Wzb4-h.js";import"./lexical-BiHBh7jO.js";import"./pdf-D4etPH5X.js";import"./utils-CnNkpT2e.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="a689ce42-a8db-4470-8287-605d980410b8",t._sentryDebugIdIdentifier="sentry-dbid-a689ce42-a8db-4470-8287-605d980410b8")}catch{}})();const Vt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),qt=St(function(t,l){const n=X(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!wt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Vt(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ft)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=vt.getSignedInUser(),[B,v]=k.useState(!1),a=S(e=>X(e)),o=S(e=>H(e)),{useFeatureGate:m}=Dt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=Ut(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),O=S(e=>b(e).currentTab),D=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:w,isLoading:A,hasFetchedAll:C,isFetchingMore:U,fetchMore:nt}=dt(),{threads:V,isLoading:q,fetchMore:W,isFetchingMore:z,hasFetchedAll:K}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(Q(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=A||U===!0||C!==!0||A||U===!0||C!==!0;k.useEffect(()=>{G&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(v(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&q===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=V.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||K===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(yt(ct))}},[A,U,z,C,K,q,w?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Mt(p)){const T=At(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];D==="all"?E.push("read","unread"):D!=="mentions"&&E.push(D),s($("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(L,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(L,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
1
+ import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-585gCzRC.js";import ut from"./NotFoundScreen-DNbVpibd.js";import{a as k}from"./sentry-CznkHhej.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as L}from"./core-BM9YDzPX.js";import{cn as It,eW as X,eM as H,fa as Ct,f2 as b,OD as Q,f6 as d,eV as y,qn as $,vB as Tt,OE as yt,eU as At,fd as Et,qs as _t,OF as F,bp as M,gy as w,qw as K,OG as Nt,cy as Bt,cs as xt}from"./zeni-epic-state-1oMHKKZA.js";import{N as wt,z as Dt,i as Rt,c as Ut,J as vt,cn as Gt,x as N,a1 as Pt,co as Ft,a2 as Mt,s as $t}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="dbc1664a-137c-48c0-85e3-4259eb6a2889",t._sentryDebugIdIdentifier="sentry-dbid-dbc1664a-137c-48c0-85e3-4259eb6a2889")}catch{}})();const Vt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),qt=St(function(t,l){const n=X(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:D}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!xt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else D?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Vt(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ft)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=wt(),i=It(u??""),s=gt(),h=Dt.getSignedInUser(),[B,D]=k.useState(!1),a=S(e=>X(e)),o=S(e=>H(e)),{useFeatureGate:m}=Rt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=vt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),O=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:v,fetchMore:nt}=dt(),{threads:V,isLoading:q,fetchMore:W,isFetchingMore:z,hasFetchedAll:J}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(Q(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=A||v===!0||C!==!0||A||v===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(D(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&q===!1&&x!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=V.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||J===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(yt(ct))}},[A,v,z,C,J,q,x?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Mt(p)){const T=At(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s($("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(L,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(L,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-585gCzRC.js";import{j as H,h as Q,u as Z,l as K,g as d,k as X,n as ee,o as C}from"./core-BM9YDzPX.js";import{eM as M,qb as U,pL as ae,J5 as w,pG as y,bu as te,bm as se,bQ as oe,pH as re,J6 as ne,IS as S,dF as ie,ty as ce,J7 as le,tV as de,eT as me,eR as fe}from"./zeni-epic-state-1oMHKKZA.js";import{J as pe,z as ue,N as be,S as he,i as $,c as N,y as Fe,e as q,aj as ge,x as Ie}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import Ce from"./NotFoundScreen-DNbVpibd.js";import{F as Se}from"./FeaturePreviewScreen-Bnq4uovL.js";import{a as b}from"./sentry-CznkHhej.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as Te}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{u as Ae}from"./useInitialThreadRequest-F8zTMPR1.js";import{t as xe}from"./routePaths-DKtGe48K.js";import{M as ke}from"./MobileAppDrawer-NY5CZpkD.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="c2dcc6a9-b473-40b1-bebb-d81d44ba5f65",s._sentryDebugIdIdentifier="sentry-dbid-c2dcc6a9-b473-40b1-bebb-d81d44ba5f65")}catch{}})();const T=(s,a,e,o)=>{if(s!=a){const r=o??"";s!=null&&s.length>0?e(`../${a}${r}`,{replace:!0}):e(`${a}${r}`,{replace:!0})}},De=X(function(s){const a=ne(s),e={},o=a.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{e[r]=o[r]===!1}),{selectedTimeframe:a.selectedTimeframe,isForecastVsActualOn:a.isForecastVsActualOn,compareMode:a.compareMode,forecastList:a.forecastList,selectedForecast:a.selectedForecast,pandLreport:a.pandLReportWithForecast,scrollPosition:a.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:e,type:"name+balances_forecast",analytics:q}},function(s,a){return{onForecastSelectionChanged:(e,o)=>{s(w(e,o)),a.isPandLReportFetched(e)||s(y(e)),T(a.forecastIdFromUrlPath,e,a.navigate)},onTimeframeChanged:e=>{s(de(e))},onForecastVsActualsCompareToggle:e=>{s(le(e)),s(S({forecastId:a.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:e=>{s(ce(a.firstMonthOfFY,e,0,[]))},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(e,o)=>{let r,i;const h=e.accountName===""?e.accountDescription:e.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=ie(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const f=xe(a.tenantEmailDomain,e.accountId,e.accountType,h,r,i),p=Ie(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(f,{state:{pathnameStackToGoBack:p,referrer:"Forecast"}})}},onNodeCollapseToggled:(e,o)=>{s(S({forecastId:a.forecastIdFromUrlPath,nodeCollapseState:{nodeId:e,isCollapsed:o===!1}}))},onTableScroll:e=>{s(S({forecastId:a.forecastIdFromUrlPath,scrollPosition:e}))},onBackClick:()=>{a.navigate("../../")}}})(ge);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=H(),o=Q(),r=Z(),{forecastId:i,tenantEmailDomain:h}=K(),[f,p]=b.useState(!1),[F,A]=b.useState(!1),u=ue.getSignedInUser(),x=d(t=>M(t)),B=x.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),D=d(t=>t.reportUIOptionsState.selectedForecast),j=t=>k.pandLByForecastID[t]!=null&&re(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=be();Te({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=ye({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!f&&g)p(!0),l||o(ae());else if(l&&!F){A(!0);const t=((m,R,P)=>R!=null?m.forecasts.findIndex(I=>I.id===R):P!=null?m.forecasts.findIndex(I=>I.id===P):m.forecasts.length>0?0:-1)(c,i,D?.id);t===-1&&i!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=D?.index?(o(w(c.forecasts[t].id,t)),T(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&T(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!j(c.forecasts[t].id)&&g&&o(y(c.forecasts[t].id))}},[f,p,o,l,c,F,A,U,y,g]);const L=he(),J=L?.loggedInUserRole!=null&&te(L.loggedInUserRole),{useFeatureGate:V}=$(),{isFeatureEnabled:E}=V(N.isReportsCommentingEnabled),W=Ae(E?x?.companyId:void 0,{clearParams:l&&F}),[Y,z]=b.useState(!1),O=t=>{z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(Fe,{analytics:q,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ke,{isAppContentDrawerOpen:Y,handleDrawerToggle:O}),n.jsx(De,{firstMonthOfFY:B,tenantEmailDomain:h,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:j,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:J,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:E,isZeniUser:se(u),initialOpenThreadRequest:W,onClickMenuIcon:()=>{O(!0)}})]})}function Qe(){const s=d(i=>M(i)),{useFeatureGate:a}=$(),{isFeatureEnabled:e}=a(N.isDebitCardFeatureEnabled),o=me(e,s),r=fe(s);return o===!0||r===!0?n.jsx(Se,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Qe as PandLWithForecastRoutes,Qe as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-D6KTXvhv.js";import{J0 as oe,eM as q,jm as z,eT as Q,eR as ie,GA as Y,IE as re,sG as Ie,J1 as X,su as Pe,sP as je,sJ as le,sy as de,sN as Te,sK as Le,J2 as ce,uk as ve,J3 as Ae,fx as Fe,J4 as J,sD as pe,sB as ue,sS as Oe,b$ as Re}from"./zeni-epic-state-1VZHEC1T.js";import{J as me,i as ee,s as E,z as H,a4 as ge,F as he,af as fe,ag as Ve,C as Ce,o as F,G as be,D as ye,ah as Ue,N as Be,K as Ze,x as $e,c as we,e as Ge,v as Je,ai as Ke,S as _e}from"./index-BCMOKGoM.js";import{D as Se,n as W,S as De}from"./mui-BsWf3aoF.js";import te from"./NotFoundScreen-DnEnkkn2.js";import{a as l}from"./sentry-DlTle5wx.js";import{h as se,l as ze,g,j as He,u as We,k as Me,n as ne,o as G}from"./core-CZukbx0Q.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-CAHHYp9d.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-CrNlGe8g.js";import{M as qe}from"./MobileAppDrawer-D5mpxBw9.js";import"./recharts-Kt4_Z9D4.js";import"./analytics-D3BPH6yx.js";import"./plaid-BlZUWQEE.js";import"./dnd-C982KOaa.js";import"./stripe-DMRn4zHo.js";import"./lottie-28Wzb4-h.js";import"./lexical-BiHBh7jO.js";import"./pdf-D4etPH5X.js";import"./utils-CnNkpT2e.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]="d6da022b-aa99-4bae-82b6-89504db15201",e._sentryDebugIdIdentifier="sentry-dbid-d6da022b-aa99-4bae-82b6-89504db15201")}catch{}})();const Qe={overlayWidth:new Ce(100,100,48)},K=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[I,w]=l.useState(!1),{userId:S}=ze(),c=g(t=>oe(t)),m=g(t=>q(t)),D=g(t=>z(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:k}=C(E.isDebitCardFeatureEnabled),P=Q(k,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(X()),y()},A=()=>{O===!0?w(!0):b()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,k),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:h,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(h==="zeni_only"?Pe(e):je(v))},onCloseClick:A,isLoading:x||c.person==null},r={onOkClick:()=>{w(!1),b()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&S!=null&&u(Ie(S))},[x,S]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[I===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:K.discardTitle}),descriptionComponent:s.jsx(Ee,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=W(De)`
1
+ import{j as s}from"./liveblocks-585gCzRC.js";import{J0 as oe,eM as q,jm as z,eT as Q,eR as ie,GA as Y,IE as re,sG as Ie,J1 as X,su as Pe,sP as je,sJ as le,sy as de,sN as Te,sK as Le,J2 as ce,uk as ve,J3 as Ae,fx as Fe,J4 as J,sD as pe,sB as ue,sS as Oe,b$ as Re}from"./zeni-epic-state-1oMHKKZA.js";import{K as me,i as ee,c as E,z as H,a4 as ge,G as he,af as fe,ag as Ve,F as Ce,o as F,H as be,D as ye,ah as Ue,N as Be,J as Ze,y as $e,e as we,g as Ge,x as Je,ai as Ke,S as _e}from"./index-BxZQbqZa.js";import{D as Se,n as W,S as De}from"./mui-Dh_OiBGq.js";import te from"./NotFoundScreen-DNbVpibd.js";import{a as l}from"./sentry-CznkHhej.js";import{h as se,l as ze,g,j as He,u as We,k as Me,n as ne,o as G}from"./core-BM9YDzPX.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{M as qe}from"./MobileAppDrawer-NY5CZpkD.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="fdec0db2-4943-4983-8d6a-81c3e31415ab",e._sentryDebugIdIdentifier="sentry-dbid-fdec0db2-4943-4983-8d6a-81c3e31415ab")}catch{}})();const Qe={overlayWidth:new Ce(100,100,48)},K=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[I,w]=l.useState(!1),{userId:S}=ze(),c=g(t=>oe(t)),m=g(t=>q(t)),D=g(t=>z(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:k}=C(E.isDebitCardFeatureEnabled),P=Q(k,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(X()),y()},A=()=>{O===!0?w(!0):b()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,k),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:h,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(h==="zeni_only"?Pe(e):je(v))},onCloseClick:A,isLoading:x||c.person==null},r={onOkClick:()=>{w(!1),b()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&S!=null&&u(Ie(S))},[x,S]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[I===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:K.discardTitle}),descriptionComponent:s.jsx(Ee,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=W(De)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-585gCzRC.js";import _ from"./NotFoundScreen-DNbVpibd.js";import{a as r}from"./sentry-CznkHhej.js";import{j as M,u as v,g,l as U,h as P,N as z,k as V,n as B,o as h}from"./core-BM9YDzPX.js";import{eM as F,OH as b,bn as H,bm as J,h2 as N,gy as Z}from"./zeni-epic-state-1oMHKKZA.js";import{Z as $,z as I,J as q,cp as G}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import{u as K}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as L}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{M as Q}from"./MobileAppDrawer-NY5CZpkD.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="4cf70f46-3a40-4123-8709-249b2bf04f8a",e._sentryDebugIdIdentifier="sentry-dbid-4cf70f46-3a40-4123-8709-249b2bf04f8a")}catch{}})();const W=V(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),X=()=>{const e=M(),t=v(),c=$(),o=g(s=>F(s)),{aggregatedReportViewState:n}=g(s=>b(s)),{tenantEmailDomain:m}=U(),p=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const d=r.useRef(!1),[C,S]=r.useState(!1),k=H(o?.userRole??[]),w=o?.userRole?.includes("bookkeeping_admin")??!1,y=J(l),A=k||w||y,f=r.useCallback((s,i,O)=>{p(N({fromMonth:s,toMonth:i,cacheOverride:O}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&d.current&&(p(Z({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),d.current=!1)},[n?.fetchState]);const D=r.useCallback((s,i)=>{n!=null&&n?.fetchState==="In-Progress"||f(s,i,!0),d.current=!0},[n?.fetchState,f]),x=r.useCallback((s,i)=>{f(s,i,!1)},[f]),u=s=>{S(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=q(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=K({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return L({isDataReady:n?.fetchState==="Completed"}),A?a.jsxs(a.Fragment,{children:[a.jsx(Q,{isAppContentDrawerOpen:C,handleDrawerToggle:u}),a.jsx(W,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:x,handleDrawerToggle:u,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):a.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return a.jsxs(B,{children:[a.jsx(h,{path:"*",element:a.jsx(X,{})}),a.jsx(h,{path:"*",element:a.jsx(_,{})})]})}export{Ie as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-DlTle5wx.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-CznkHhej.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-D6KTXvhv.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DlTle5wx.js";import{L as dt,bQ as Tc,eM as Ac,Ie as Rc,IY as kl,b$ as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-1VZHEC1T.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-CnNkpT2e.js";import{r as un}from"./empty-v0hJlOmn.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-B-kXlgH7.js";import{r as Gl}from"./index-CTCUMK3y.js";import{r as zl}from"./index-B40Qim0p.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-CZukbx0Q.js";import{u as Kl,z as Pc,L as Wl,U as Jl,V as Xl,j as Ql,c as tf}from"./index-BCMOKGoM.js";import"./mui-BsWf3aoF.js";import{d as Pe}from"./decodeURIComponentSafe-BMhpBWAI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="622cdc17-0b50-47f7-8194-28e982a744d1",t._sentryDebugIdIdentifier="sentry-dbid-622cdc17-0b50-47f7-8194-28e982a744d1")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-585gCzRC.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CznkHhej.js";import{L as dt,bQ as Tc,eM as Ac,Ie as Rc,IY as kl,b$ as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-1oMHKKZA.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-Boc0JP6O.js";import{r as un}from"./empty-CNAYaS5M.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-mwEs-5am.js";import{r as Gl}from"./index-DpQl7e8K.js";import{r as zl}from"./index-DvjNZZRv.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-BM9YDzPX.js";import{u as Kl,z as Pc,L as Wl,U as Jl,V as Xl,m as Ql,e as tf}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import{d as Pe}from"./decodeURIComponentSafe-a784xZQy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="dc5d695b-19a7-40e7-ae03-9af02bffe0e1",t._sentryDebugIdIdentifier="sentry-dbid-dc5d695b-19a7-40e7-ae03-9af02bffe0e1")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,5 +1,5 @@
1
- import{j as s}from"./liveblocks-D6KTXvhv.js";import{a as o}from"./sentry-DlTle5wx.js";import{g as f,j as N,h as V,u as W,k as M}from"./core-CZukbx0Q.js";import{h as _,J as $,z as R,a$ as U,C as z,N as K,K as X,x as Z,c as l,e as q,a1 as G,b0 as J}from"./index-BCMOKGoM.js";import{eX as Q,eM as Y,Lv as I,Lw as ee,to as ae,te as g,eZ as re,bL as ne,tj as te,Lx as se}from"./zeni-epic-state-1VZHEC1T.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-BsWf3aoF.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-CAHHYp9d.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-CrNlGe8g.js";import{M as ue}from"./MobileAppDrawer-D5mpxBw9.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]="64c24d48-9e30-4552-a0e5-c1efa6bf60a7",e._sentryDebugIdIdentifier="sentry-dbid-64c24d48-9e30-4552-a0e5-c1efa6bf60a7")}catch{}})();const pe={overlayWidth:new z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>Q(c));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
1
+ import{j as s}from"./liveblocks-585gCzRC.js";import{a as o}from"./sentry-CznkHhej.js";import{g as f,j as N,h as V,u as W,k as M}from"./core-BM9YDzPX.js";import{h as _,K as $,z as R,a$ as U,F as z,N as J,J as X,y as Z,e as l,g as q,a1 as G,b0 as K}from"./index-BxZQbqZa.js";import{eX as Q,eM as Y,Lv as I,Lw as ee,to as ae,te as g,eZ as re,bL as ne,tj as te,Lx as se}from"./zeni-epic-state-1oMHKKZA.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-Dh_OiBGq.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{M as ue}from"./MobileAppDrawer-NY5CZpkD.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]="98cdfb2f-2ed4-4dc5-b78a-cfdfc17c4e34",e._sentryDebugIdIdentifier="sentry-dbid-98cdfb2f-2ed4-4dc5-b78a-cfdfc17c4e34")}catch{}})();const pe={overlayWidth:new z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>Q(c));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,P="refer-and-earn-status-update",ke=M(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(G(J));function Pe({isReferralDrawerOpen:e}){const a=N(),r=V(),n=W(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Y(t)),m=f(t=>I(t)),v=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=ee([m,w]),{areTenantIdsInSync:d}=K();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&d&&(u(!0),r(g(!0)))},[v,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(x(!0),r(re(!0)))},[w,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),S=t=>{j(t)},{isAiCfoOpen:L,setIsAiCfoOpen:O}=X(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=de({isAiCfoOpen:L,setIsAiCfoOpen:O,mobileExploreReferrer:"Rewards"});fe({isDataReady:y===!0});const F={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,b,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(Z,{analytics:l,onLoad:t=>(b=>{p!=null&&b.trackPageLoaded(q.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:S}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...F})]})}export{Pe as R};
5
+ `,P="refer-and-earn-status-update",ke=M(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(G(K));function Pe({isReferralDrawerOpen:e}){const a=N(),r=V(),n=W(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Y(t)),m=f(t=>I(t)),b=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=ee([m,w]),{areTenantIdsInSync:d}=J();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&d&&(u(!0),r(g(!0)))},[b,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(x(!0),r(re(!0)))},[w,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),y=t=>{j(t)},{isAiCfoOpen:L,setIsAiCfoOpen:O}=X(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=de({isAiCfoOpen:L,setIsAiCfoOpen:O,mobileExploreReferrer:"Rewards"});fe({isDataReady:v===!0});const H={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,F)=>{F.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(Z,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(q.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:y}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...H})]})}export{Pe as R};