@zeniai/web-app-ui 5.0.18-qa → 5.0.19-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/assets/AddressRoutes-BhCu25lU.js +1 -0
  2. package/dist/assets/AddressScreen-BcESiPXv.js +9 -0
  3. package/dist/assets/AiCfoScreen-D3QnzgQb.js +11 -0
  4. package/dist/assets/{BillPayApprovalRoutes-B1dVKGB7.js → BillPayApprovalRoutes-DLbtPixu.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BlCM6EqR.js → BillPayRoutes-B_V8HtwS.js} +8 -8
  6. package/dist/assets/{BusinessVerificationPageScreen-B0aOlvDy.js → BusinessVerificationPageScreen-C1vhTC_E.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-C0OR0QnW.js → ChargeCardRoutes-s2TM6L_R.js} +8 -8
  8. package/dist/assets/CompanyPassportScreen-BNll4K7f.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-DRyWH_Ub.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BFENT6Ja.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CPe4UazZ.js → CustomerOnboardingRoutes-BsiXlY6F.js} +6 -6
  12. package/dist/assets/{DashboardRoutes-d3sWDoZr.js → DashboardRoutes-BgW7GVgj.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-BKqpHNPL.js → DefaultTenantHome-BBEjYDkH.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-BDh7YaRz.js +18 -0
  15. package/dist/assets/DrawerScreen-Dbqz-pF7.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-Rn_-edBe.js → EntityDetailRoutes-VTa9LNaz.js} +1 -1
  17. package/dist/assets/ExpenseAutomationRoutes-B20xFWDa.js +20 -0
  18. package/dist/assets/FeaturePreviewScreen-ClmSo1U7.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-pzDzeUrG.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-CivONTd4.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-VgfdPmIc.js → MobileAppDrawer-BaHE34Vv.js} +1 -1
  22. package/dist/assets/NotFoundScreen-C3kBFHq1.js +1 -0
  23. package/dist/assets/NotificationRoutes-Den2bd_a.js +1 -0
  24. package/dist/assets/{PandLWithForecastRoutes-Bw9LmosD.js → PandLWithForecastRoutes-CbvULQYZ.js} +1 -1
  25. package/dist/assets/PeopleRoutes-DQQ4nNHt.js +22 -0
  26. package/dist/assets/PerformanceRoutes-HPat2pxO.js +1 -0
  27. package/dist/assets/{Preview-CCtVCHIh.js → Preview-CRwVXjMO.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-O-1IJ7vW.js → QBOConnectionScreen-CZtyFAVo.js} +1 -1
  29. package/dist/assets/ReferralListScreen-Bop7SIEK.js +5 -0
  30. package/dist/assets/{ReimbursementApprovalRoutes-CMG0ah9n.js → ReimbursementApprovalRoutes-BBEmVV5-.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-nWYI_DTZ.js → ReimbursementApprovalRuleDetailScreen-AIE9_S4u.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-BXKMoRKS.js → ReimbursementRoutes-CRwlytHX.js} +6 -6
  33. package/dist/assets/{ReportsRoutes-B1A7hhcf.js → ReportsRoutes-Cb7FRQxE.js} +1 -1
  34. package/dist/assets/RewardsRoutes-DeYf52wl.js +1 -0
  35. package/dist/assets/ScreenRoutes-BODB-3Ia.js +2 -0
  36. package/dist/assets/{SettingsRoutes-C0dX88-a.js → SettingsRoutes-Cuuf_SLe.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-D-1wJv_X.js → SetupPagesScreen-Bx9eIItf.js} +1 -1
  38. package/dist/assets/{SignInScreen-Co-Zsrhj.js → SignInScreen-BXatoAKB.js} +1 -1
  39. package/dist/assets/SignOutScreen-CVElg1r_.js +9 -0
  40. package/dist/assets/TaskListScreen-D9zNnnke.js +9 -0
  41. package/dist/assets/TaskRoutes-BnGbBPHj.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-CyVczvyG.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-CbnXMf-w.js → TransactionDetailScreen-D28IGeb1.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-CZQnxASD.js → TransactionListRoutes-ExZfKQN9.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-B36ovFlE.js → TreasuryRoutes-p14BUmVq.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-Ch385dto.js → VendorsRoutes-B7R2O59J.js} +13 -13
  47. package/dist/assets/WiseConfirmationScreen-BynfQbnM.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-C-A0w1l-.js → ZeniAccountRoutes-CX8VTJtH.js} +10 -10
  49. package/dist/assets/ZeniAccountStatementScreen-Dvjjno6c.js +9 -0
  50. package/dist/assets/{accountMappingHelper-DxgbU7sx.js → accountMappingHelper-DXGp115l.js} +1 -1
  51. package/dist/assets/{analytics-CALyM-hh.js → analytics-BKunqsaf.js} +1 -1
  52. package/dist/assets/{analyticsHelper-yiDXt2Ja.js → analyticsHelper-Bo9aIzGQ.js} +1 -1
  53. package/dist/assets/{core-DGtRv-5L.js → core-C1FHFtWE.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-D45efNq9.js → decodeURIComponentSafe-BjGCfGPp.js} +1 -1
  55. package/dist/assets/{dnd-Bts1hC9q.js → dnd-CKPinqKo.js} +1 -1
  56. package/dist/assets/{empty-B8GlEZnh.js → empty-DCBZxZdT.js} +1 -1
  57. package/dist/assets/{empty-B0MTj6gY.js → empty-QDWy3Sbb.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-DIDd1D81.js → emptyVideoElement-CDVJdqXJ.js} +1 -1
  59. package/dist/assets/{epic-Ddra04XC.js → epic-DW6sm_Xz.js} +2 -2
  60. package/dist/assets/getLocaleForTenant-pBjb9R_D.js +1 -0
  61. package/dist/assets/{index-oJG7aYjB.js → index-BKQLnVw8.js} +1 -1
  62. package/dist/assets/{index-CrJKzVqy.js → index-CHRX9-rv.js} +2 -2
  63. package/dist/assets/{index-NN8WQI8p.js → index-CZc_s42n.js} +11564 -11575
  64. package/dist/assets/{index-CI_EK7HU.js → index-D8T6lc_N.js} +1 -1
  65. package/dist/assets/{index-ktcuBvep.js → index-Dg4Gln7w.js} +1 -1
  66. package/dist/assets/{index-Cq17jLR1.js → index-oonNPnkE.js} +1 -1
  67. package/dist/assets/{index-BzTrf-Pv.js → index-v7N-NvrE.js} +1 -1
  68. package/dist/assets/{lexical-DcQz2ToX.js → lexical-BhAbdael.js} +1 -1
  69. package/dist/assets/{liveblocks-1thjzoaw.js → liveblocks-BZlOk8zk.js} +1 -1
  70. package/dist/assets/{lottie-TdNUPve2.js → lottie-ciaQJ7oN.js} +1 -1
  71. package/dist/assets/{mui-C-9qGevS.js → mui-CZhjlxyT.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BxDzY9Wz.js → pathToGoBack-BQU-ldKZ.js} +1 -1
  73. package/dist/assets/{pdf-DhqCrjXb.js → pdf-9d-sooX0.js} +3 -3
  74. package/dist/assets/{pdf-lib-DmaaVbvY.js → pdf-lib-Bm3ZpH2B.js} +1 -1
  75. package/dist/assets/{plaid-DRyXOtiU.js → plaid-BYUv-poR.js} +1 -1
  76. package/dist/assets/{pusher-BfiexiZ0.js → pusher-DcPGAlRO.js} +1 -1
  77. package/dist/assets/{react-DHT2lmLc.js → react-BNNcFe-e.js} +1 -1
  78. package/dist/assets/{react-B7CiQw1L.js → react-BtwEgXWF.js} +1 -1
  79. package/dist/assets/{react-md9nq4qh.js → react-DERPQWfC.js} +1 -1
  80. package/dist/assets/{react-KFiz_tR6.js → react-Du_nCFym.js} +1 -1
  81. package/dist/assets/{react-D00Xl-Dr.js → react-JYEN_7jf.js} +1 -1
  82. package/dist/assets/{react-B82EMGAf.js → react-rXZAT_kh.js} +1 -1
  83. package/dist/assets/{recharts-a2B9SbBf.js → recharts-BBpjoK43.js} +1 -1
  84. package/dist/assets/{routePaths-8nWXl3lj.js → routePaths-DRiZXKg0.js} +1 -1
  85. package/dist/assets/{sentry-CooVhpit.js → sentry-BfJuQlQx.js} +1 -1
  86. package/dist/assets/{url-BC3SAbOG.js → url-C8S_Lh_c.js} +1 -1
  87. package/dist/assets/{url-D12sxYA1.js → url-CpMpWu4x.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-JjOesvRK.js +1 -0
  89. package/dist/assets/{useDeviceId-Bxt0bF-y.js → useDeviceId-CjFCWE4s.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CabshbJ5.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-CY2eSsaO.js → useInitialThreadRequest-C42RI3oJ.js} +1 -1
  92. package/dist/assets/{utils-DYt83G2V.js → utils-B1VtuHQw.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-Cjv0VgRu.js → withTransactionSidePanel-cMtqDSJ9.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-DNuuo8ZV.js → zeni-epic-state-BEdHTWyp.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +3 -3
  97. package/dist/assets/AddressRoutes-D2FACoGE.js +0 -1
  98. package/dist/assets/AddressScreen-B9u0FHW6.js +0 -9
  99. package/dist/assets/AiCfoScreen-gPU5OBcl.js +0 -11
  100. package/dist/assets/CompanyPassportScreen-BWU7HRXU.js +0 -1
  101. package/dist/assets/ConnectionAuthScreen-CJ9xBQgB.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-BdwPH5Y6.js +0 -1
  103. package/dist/assets/DomesticWireDetailScreen-DpFSc8w7.js +0 -18
  104. package/dist/assets/DrawerScreen-6__pZ2Fq.js +0 -1
  105. package/dist/assets/ExpenseAutomationRoutes-1Vdih9y5.js +0 -20
  106. package/dist/assets/FeaturePreviewScreen-cXgFYw9z.js +0 -1
  107. package/dist/assets/MagicLinkRoutes-Bvbr6tYo.js +0 -72
  108. package/dist/assets/MagicLinkSignInScreen-TEu-0dU4.js +0 -12
  109. package/dist/assets/NotFoundScreen-JcC_UZ1m.js +0 -1
  110. package/dist/assets/NotificationRoutes-DeUR-Lca.js +0 -1
  111. package/dist/assets/PeopleRoutes-BnS2kaun.js +0 -22
  112. package/dist/assets/PerformanceRoutes-DxVX57kA.js +0 -1
  113. package/dist/assets/ReferralListScreen-DT8mXtsb.js +0 -5
  114. package/dist/assets/RewardsRoutes-BAZjS3ll.js +0 -1
  115. package/dist/assets/ScreenRoutes-DOVlELiO.js +0 -2
  116. package/dist/assets/SignOutScreen-CUo_ueK6.js +0 -9
  117. package/dist/assets/TaskListScreen-CI6OZlSQ.js +0 -9
  118. package/dist/assets/TaskRoutes-BijAG0Df.js +0 -9
  119. package/dist/assets/TransactionDetailRoutes-C2b32V9o.js +0 -1
  120. package/dist/assets/WiseConfirmationScreen-CcWFOdDC.js +0 -12
  121. package/dist/assets/ZeniAccountStatementScreen-pUj8-CXb.js +0 -9
  122. package/dist/assets/getLocaleForTenant-DHltWIlc.js +0 -1
  123. package/dist/assets/useAskAiCfoHostNavButtonProps-Cmlh3sFJ.js +0 -1
  124. package/dist/assets/useFetchSuggestedQuestionsWhenReady-D27Rjrx4.js +0 -1
@@ -0,0 +1,20 @@
1
+ import{j as u}from"./liveblocks-BZlOk8zk.js";import dn from"./NotFoundScreen-C3kBFHq1.js";import{a as l}from"./sentry-BfJuQlQx.js";import{n as Ae,D as gt,S as Le}from"./mui-CZhjlxyT.js";import{h as pe,j as Ct,u as Fe,g as F,l as et,k as un,n as mn,o as De}from"./core-C1FHFtWE.js";import{eM as ze,OH as hn,e$ as he,fd as pn,q2 as gn,OI as _e,mI as St,mO as It,OJ as ft,nb as Cn,OK as kt,mB as Sn,pA as In,OL as fn,jy as kn,OM as En,Fw as yn,eX as Ve,pf as Me,Kp as tt,Kr as vn,jp as bn,Ks as An,jw as Tn,cT as wn,t4 as je,Jg as Pn,jx as xn,eZ as Rn,mP as Et,ng as be,ob as yt,oJ as Dn,e_ as vt,nf as nt,mG as ne,ni as bt,nk as Un,bB as On,kV as Bn,kS as Fn,nj as ye,nh as ue,ON as _n,nA as at,Bc as At,OO as Tt,s1 as wt,jm as Vn,OP as Mn,Ji as ot,Jh as Ee,OQ as st,jN as jn,OR as Ln,OS as zn,OT as $n,OU as Gn,mY as qn,OV as Jn,OW as Yn,OX as Nn,nq as Kn,jA as Zn,jr as Hn,OY as Qn,jz as ct,Kz as Wn,OZ as Xn,O_ as ea,pb as ta,oS as na,oR as Ue,O$ as aa,P0 as oa,l4 as sa,bp as ca,k$ as it,kN as ia,P1 as la,gy as lt,fL as ra,kY as da,uZ as ua,P2 as ma,nR as ha,nM as pa,nQ as ga,nB as Ca,P3 as Sa,n4 as Ia,mV as fa,fe as rt,nl as ka,P4 as Ea,P5 as ya,P6 as va,P7 as ba,P8 as Aa,P9 as dt,pn as Ta,oB as wa,ok as ut,ot as Pa,og as xa,oG as Ra,ol as Da,Pa as Ua,Pb as Oa,n_ as Ba,Pc as Fa,nY as _a,nZ as Va,nW as Ma,ov as ja}from"./zeni-epic-state-BEdHTWyp.js";import{N as Pt,c as xt,d as me,e as M,y as H,O as Rt,cq as La,h as Dt,z as Te,cr as za,ao as ve,cs as $a,B as Ut,ct as Ga,cu as qa,al as Oe,X as Ja,C as Ya,aI as Na,aZ as Ka,G as Za,D as Ha,cv as Qa,T as Wa,cw as Xa}from"./index-CZc_s42n.js";import{u as Ot}from"./useAskAiCfoHostNavButtonProps-JjOesvRK.js";import{c as Bt}from"./useFetchSuggestedQuestionsWhenReady-CabshbJ5.js";import{c as mt,C as eo}from"./TransactionDetailScreen-D28IGeb1.js";import{w as to}from"./withTransactionSidePanel-cMtqDSJ9.js";import{h as no,v as ao}from"./routePaths-DRiZXKg0.js";import{g as Be}from"./accountMappingHelper-DXGp115l.js";import{D as oo}from"./DrawerScreen-Dbqz-pF7.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.js";import"./decodeURIComponentSafe-BjGCfGPp.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]="923182f9-a6a9-49f4-abe6-99d127586f36",t._sentryDebugIdIdentifier="sentry-dbid-923182f9-a6a9-49f4-abe6-99d127586f36")}catch{}})();const so=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Pt(),x=pe(),A=Ct(),y=Fe(),r=F(p=>ze(p)),{useFeatureGate:m}=xt(),{isFeatureEnabled:T}=m(me.isRealtimeInsightsFeatureEnabled),g=F(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=F(p=>hn(p,r.tenantId)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:v}=Ot({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,D=!1)=>{x(he({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:D}))},[]),$=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),x(pn(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}=Rt();return Bt({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&&x(gn(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(co,{children:u.jsx(La,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:T,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:_,onAskAiCfoClick:v})})},co=Ae.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ background-color: ${t=>t.theme.colors.grey4};
8
+ `,io="512px",lo=({reconciliation:t,selectedDrawerAccountId:c,onFetchLinkTokenClick:x,onEstablishConnectionClick:A})=>{const y=Dt(),r=pe(),m=Te.getSignedInUser(),T=F(s=>ze(s)),g=t.excludedAccountIDs,a={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:T.tenantId??""},{accountReconciliationsByAccountID:_,monthYearPeriod:v,statementUploadChosen:I}=t,$=c!=null?_[c]:void 0,S=$?.accountReconEntity.statementMetaData?.statementUploadId,k=l.useCallback(()=>{c!=null&&r(_e({selectedDrawerAccountId:void 0}))},[r,c]),L=(s,C)=>{r(In(s,C.split(".")[0]))},N=s=>{S!=null&&r(Sn({accountId:c??"",selectedPeriod:v,fileId:s,statementUploadId:S}))},d=()=>{r(ft({statementUploadChosen:!1}))},p=s=>{c!=null&&r(Cn({accountId:c,selectedPeriod:v,payload:s}))},E=s=>{c!=null&&r(kt({accountId:c,selectedPeriod:v,localData:{accountSource:s}}))},D=l.useCallback(()=>{c!=null&&r(St({accountId:c}))},[r,c]),e=l.useCallback(()=>{c!=null&&r(It({accountId:c}))},[r,c]),n=g.includes(c??"")?t.excludedAccountReconciliationByAccountID[c??""]:void 0,o=$!=null?u.jsx(za,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:$,monthYearPeriod:v,onDismissClick:k,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:x,onEstablishConnectionClick:A,onEditFileName:L,onDeleteFile:N,onSelectSourceType:E,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`,authParams:a,openFilePicker:I,onStatementUploadSuccess:p,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:D}):n!=null?u.jsx($a,{excludedAccountReconciliation:n,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:e}):null;return o==null?null:u.jsx(gt,{anchor:"right",open:c!=null,PaperProps:{style:{width:io,color:y.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>k(),children:u.jsx(ro,{onClick:s=>s.stopPropagation(),children:o})})},ro=Ae(Le)`
9
+ display: flex;
10
+ min-height: 100%;
11
+ flex-direction: column;
12
+ `;function uo({companyId:t,closeCustomerRequestDrawer:c,addCustomerRequest:x,resetCustomerRequest:A}){const y=Te.getSignedInUser();if(y==null)throw Error("Can't access Customer Request page without signing in...");const r=F(m=>fn(m,t,y));return l.useEffect(()=>{A()},[]),u.jsx(u.Fragment,{children:r.fetchState==="In-Progress"||r.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?u.jsx(Ut,{fetchState:"In-Progress"}):u.jsx(Ga,{onCloseClick:c,addCustomerRequest:x,snippets:r.companyMonthEndReportTemplatesData,bulletPoints:r.zeniRequestsData??[]})})}const mo=t=>u.jsx(qa,{...t}),ho="512px",po=({selectedTransactionId:t,onClose:c})=>{const x=Dt(),A=pe(),y=F(g=>t==null?void 0:kn(g.transactionState,t)),r=y?.qboId,m=F(g=>r==null?void 0:En(g,r));l.useEffect(()=>{r!=null&&A(yn(r))},[A,t,r]);const T=l.useCallback(()=>{c()},[c]);return t==null||m==null?null:u.jsx(gt,{anchor:"right",open:t!=null,PaperProps:{style:{width:ho,color:x.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:T,children:u.jsx(go,{onClick:g=>g.stopPropagation(),children:u.jsx(mo,{transactionActivityLogSelectorView:m,onClose:T})})})},go=Ae(Le)`
13
+ display: flex;
14
+ min-height: 100%;
15
+ flex-direction: column;
16
+ `,Co=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:So,comma:ht,space:Io}},dateFormat:Ft}=Ha.getLocalizedStrings(),pt=ja,fo=un(function(t,c){const{uncategorizedAccounts:x,vendorSearchAutoCompleteData:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:T,isTransactionActivityEnabled:g}=c,a=Te.getSignedInUser(),_=t.tenantState.currentTenantId,v={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:_??""},I=Ve(t),{selectedTransactionCategorizationTab:$}=I;return{expenseAutomationViewSelector:I,bulkUploadSelector:T===!0?I.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:A,authParams:v,receiptUploadEndpoint:`${ve.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Wa}/transaction_attachments`,bulkUploadEndpoint:T===!0?`${ve.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:$,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:a,uncategorizedAccounts:x,companyId:m,isTransactionActivityEnabled:g,isAccountingClassesEnabled:Vn(t)}},function(t,c){const{themeState:x,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:T,expenseAutomationViewSelector:g,currentTenant:a,uncategorizedAccounts:_,navigate:v,onClickCustomerRequest:I,handleEditClick:$,setActivityLogTransactionId:S}=c,{selectedPeriod:k,currentSelectedView:L,reconciliation:{selectedAccountId:N}}=g,{accountSettingsView:d}=g.jeSchedules,p=Et(k),E=be(p.start),D=be(p.end);return{onZeniLogoClick:()=>{x.toggle()},onUploadReceiptAttachment:e=>{M.trackMissingReceiptAttached(k.month,k.year),t(wa(e))},onUploadTransactionReceipt:(e,n,o,s,C,h)=>{t(dt(e,n,{fetchState:"In-Progress"}));const f=()=>t(dt(e,n,{fetchState:"Error"}));Xa(`${ve.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,h,n,o,s,C).then(b=>{b!=null?t(Ta(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(Aa(e,n)),a!=null&&t(he({tenantId:a.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,o,s)=>{t(ba(e,{fetchState:n,error:o})),o!=null&&t(lt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:s!=null?Io+So+s+ht:ht}]}))},onUpdateJESchedulesUIState:e=>{t(va(e))},onUpdateMissingReceiptsUIState:e=>{t(ya(e))},onFetchMissingReceiptsList:()=>{D!=null&&E!=null&&t(bt({start:E,end:D},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Ma(e))},onBulkUploadProgress:e=>{t(Va(e))},onBulkUploadSuccess:e=>{t(_a({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Fa(e))},onConfirmBulkUploadMatch:(e,n,o,s,C)=>{t(Ba(e,n,o,s,C))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Oa())},onSetBulkUploadResultsTab:e=>{t(Ua(e))},onSetBulkUploadCompletedSubTab:e=>{t(Da(e))},onSetBulkUploadSortConfig:(e,n)=>{t(ut({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ra())},onSearchTransactionsForManualMatch:(e,n)=>{t(pt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=g.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(pt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(xa(e,n))},onFetchBulkUploadBatches:e=>{t(yt(e))},onFetchMoreBatchDetails:()=>{t(Pa())},onResetBulkUploadSort:()=>{t(ut({sortKey:"date",sortOrder:"descending"}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Ea())},onSearchTextChanged:e=>{const n=g.currentSelectedView,o=g.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ue({selectedTab:o,uiState:{searchString:e}})),D!=null&&E!=null&&t(ue(o,{start:E,end:D},!0,!1,e,void 0,!0)))},onRefresh:()=>{c.trackExpenseAutomationTabAnalytics(!0),t(ka(y))},onClose:()=>{L==="reconciliation"&&N!=null&&t(rt({selectedAccountId:void 0})),v("../")},onBack:()=>{L==="reconciliation"&&N!=null&&t(rt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(fa(e))},onSaveReconciliationReview:e=>{t(Ia(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(vt(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=Be(d.prepaidExpensesAccountList,o.selectedOptions),f=Be(d.fixedAssetsAccountList,s.selectedOptions),b=Be(d.accruedExpensesAccountList,C.selectedOptions),z={selectedPrepaidExpensesAccountIds:h.map(U=>U.accountId),selectedFixedAssetsAccountIds:f.map(U=>U.accountId),selectedAccruedExpensesAccountIds:b.map(U=>U.accountId)};t(Sa({data:z}))},onSaveJeAccountSettingsClick:()=>{t(Ca())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:o,accumulatedDepreciationCategory:s,scheduleClass:C,scheduleExpenseCategory:h,vendor:f}=n,{allAccountList:b,allClassList:z,allDepreciationAccountList:U}=g.jeSchedules,K=T.entityAutoCompleteView.vendor.length>0?T.entityAutoCompleteView.vendor.find(G=>G.id===f?.selectedOption):void 0,ae={id:K?.zeniId??f?.selectedOption??"",name:K?.name??f?.defaultOptions.find(G=>G.value===f?.selectedOption)?.label??"",logo:K?.logo},ge=h?.selectedOption!=null?b.find(G=>G.qboId===h.selectedOption):void 0,we=C?.selectedOption!=null?z.find(G=>G.classId===C.selectedOption):void 0,oe=s?.selectedOption!=null?U.find(G=>G.qboId===s.selectedOption):void 0;t(ga({scheduledJournalEntryID:e,localData:{jeScheduleID:o,scheduledJournalEntryID:e,updatedCategoryId:ge?.accountId,updatedClassId:we?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ae.id,name:ae.name}}}))},ignoreRecommendedJeSchedule(e,n){t(pa(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ot({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Ee("common"))},onCancelAutoComplete:()=>{t(Ee("common"))}},onPostJESchedule(e,n){t(ha({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ma())},handleJeScheduleClick:(e,n,o)=>{t(ua({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(da(e,a.companyId,a.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(ra())},onOpenFileAttachmentSnackBar:()=>{t(lt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(la(e))},onUpdateFileAttachment:e=>{t(ia({files:e}))},previewMonthEndReport:(e,n,o,s)=>{a!=null&&t(it(e,a.companyId,n,!0,o,s,a.tenantId))},saveMonthEndReport:(e,n,o,s)=>{a!=null&&t(it(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(sa(a.companyId,e,a.tenantId)),M.trackInsightsEmailPage(o.month,o.year,!1,"draft",s.auditScorePercentage,ca().format(Ft.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,U,K)=>{t(oa(e,n,o,s,_,C,h,f,b,z,U,K))},onCancelAutoComplete:()=>{t(Ee("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(st({scrollPosition:e}))},onUpdateTab:e=>{c.closeSidePanel?.(),D!=null&&E!=null&&(t(ue(e,{start:E,end:D},!1,!1)),t(aa(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ue({selectedTab:e,uiState:n})),D!=null&&E!=null&&t(ue(e,{start:E,end:D},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ue({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,o,s,C,h,f)=>{D!=null&&E!=null&&t(ue(e,{start:E,end:D},!0,o,n,s,C,h,f))},resetTransactionCategorizationLocalData:(e,n,o,s,C,h,f,b)=>{t(na(e,n,o,s,b??null,C,h,!1,f))},updateSelectedVendorForTransaction:(e,n,o,s,C)=>{t(ct({selectedTab:e,transactionId:n,lineId:o,selectedTransaction:s,uncategorizedAccounts:_,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(ta(e,n,o,y))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ea({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:U}=n;h!=null&&t(Wn({transactionId:b,customerUpdates:h})),t(Xn({selectedTab:s,transactionId:b.id,lineId:U[0],selectedTransaction:z,uncategorizedAccounts:_,updatedCustomer:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(je(C,e,n,o,!0,A,f))},onFetchRecommendationsForEntityCategorization:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:U}=n;h!=null&&(t(Zn({transactionId:b,vendorUpdates:{name:h.name,id:h.id?h.id:void 0}})),t(Hn({vendorId:h.id?h.id:void 0,localData:{vendorName:h.name,vendorId:h.id?h.id:void 0}}))),h?.id?(t(ct({selectedTab:s,transactionId:b.id,lineId:U[0],selectedTransaction:z,uncategorizedAccounts:_,updatedVendor:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(je(C,e,n,o,!0,A,f))):t(Qn({selectedTab:s,transactionId:b.id,lineId:U[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(ye(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(ye(k,!0,!1,null,!1,!1))},markAsReview:(e,n,o,s)=>{M.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Kn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Nn(e))},updateOperatingExpensesIdsForReview:e=>{t(Yn({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(c.tenantEmailDomain!=null){const n=ao(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(Jn({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,o)=>{t(ye(e,!0,!1,n,!0,o))},onReviewClicked:e=>{t(ne(k,e))},setOpenDrawerClicked:e=>{t(_e({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const o=a?.companyId;o!=null&&(t(At(e,o,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(Tt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(_e({selectedDrawerAccountId:e})),t(kt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(ft({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ne(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(qn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Gn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t($n({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{c.closeSidePanel?.(),t(zn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,o)=>{const s=e.vendor?.id;o&&s!=null&&t(jn(s)),t(Ln({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,Me("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(st({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ot({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ee("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Mn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(St({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(It({accountId:e}))}}},(t,c,x)=>{const{isMissingReceiptsBulkUploadEnabled:A,...y}=x;return function(r,m,T){return{...r,...m,...T,onUploadTransactionReceipt:(g,a,_,v,I)=>{m.onUploadTransactionReceipt(g,a,_,v,I,r.authParams)}}}(t,c,y)})(Qa),ko=to(({closeSidePanel:t,openTransactionPanel:c,panelContent:x,sidePanelIsFullView:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Pt(),T=Ct(),g=Fe(),a=pe(),{isAiCfoAccessEnabled:_,onAskAiCfoClick:v}=Ot({isAiCfoOpen:r,setIsAiCfoOpen:m,mobileExploreReferrer:"Transaction categorization"}),{areTenantIdsInSync:I}=Rt(),$=(()=>{const i=F(q=>Ve(q)),P=Fe(),{currentSelectedViewFetchState:j,currentSelectedView:O,selectedPeriod:R}=i,de=Oe(O),X=Oe(j.fetchState),Ie=l.useCallback(q=>{const Z=P.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,Co(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===j.fetchState&&O===de||j.fetchState!=="Completed"||Ie(!1)},[O,j.fetchState,de]),Ie})(),S=Ja(),[k,L]=l.useState(!1),N=F(i=>tt(i)),d=F(i=>ze(i)),[p,E]=l.useState(!1),[D,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}=et(),{tenantEmailDomain:U}=et(),[K,ae]=l.useState(g.state?.message==="comingFromTransactionDetail"),ge=g.state?.message==="comingFromOverview",we=Ya(),oe=Te.getSignedInUser(),{useDynamicConfig:G,useFeatureGate:Ce}=xt(),{configValue:_t}=G(Na.enableUncategorizedExpenseCategory),Q=_t?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:$e}=Ce(me.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:se}=Ce(me.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Ge}=Ce(me.isTransactionActivityEnabled),{isFeatureEnabled:Vt}=Ce(me.isExpenseAutomationCommentingEnabled),Mt=l.useCallback(i=>{const P=Me(i.view==="reconciliation"?"bill":"expense");c?.(i.entityId,P)},[c]),jt=F(i=>Pn(i,"common")),B=F(i=>Ve(i)),{monthEndCloseChecksView:Y,currentSelectedView:V,selectedPeriod:w,selectedTransactionCategorizationTab:qe,currentSelectedViewBackgroundRefreshFetchState:Lt,currentSelectedViewFetchState:W,jeSchedules:Pe,reconciliation:zt}=B,{selectedAccountId:ce}=zt,Je=Oe(Pe.accountSettingsView.saveState.fetchState),$t=F(i=>xn(i.accountState,i.accountListState,"accountList")),ie=z!=null?Rn(z):V,Gt=F(i=>i.entityAutoCompleteState.autoCompleteText.common);if(Bt({isDataReady:W.fetchState==="Completed"}),oe==null)throw Error("Can't access expense automation screen without signing in...");const Ye=Et(w),le=be(Ye.start),re=be(Ye.end);if(le==null||re==null)throw Error(`Invalid start - ${le} and end - ${re} period from given ${w}`);const qt=l.useCallback(()=>{E(!1)},[]),Jt=l.useCallback(()=>{e(!0)},[]),Yt=l.useCallback(i=>{o(i),e(!1)},[]),Nt=l.useCallback(()=>{o([])},[]),Se=B.missingReceipts.bulkUpload.phase,Ne=B.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{se===!0&&V==="missing_receipts"&&Se==="matching"&&Ne!=null&&a(yt({cacheOverride:!0}))},[se,V,Se,Ne,a]);const Ke=oe?.userId,Kt=w.month,Zt=w.year,Ze=d?.tenantId;l.useEffect(()=>{V==="missing_receipts"&&se!==!1&&Se==="idle"&&Ke!=null&&Ze!=null&&a(Dn())},[V,se,Se,Ke,Ze,Kt,Zt,a]),l.useEffect(()=>{N.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[N.newVendorState?.vendorDetailLocalData?.vendorName]),l.useEffect(()=>{ie!=null&&V!==ie&&a(vt(ie))},[ie]),l.useEffect(()=>{h!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!I||(f(!0),a(nt(!1,!1,Q)))},[h,W,I,Q]),l.useEffect(()=>{!ge&&I&&(a(nt(!1,!1,Q)),a(ne(w,ce,!1,!1)))},[w.month,w.year,I,Q]);const He=l.useCallback((i=!1,P=!1)=>{const j={start:le,end:re};switch(V){case"transaction_categorization":a(ue(qe,j,i,!K,void 0,void 0,P,void 0,Q)),ae(!1);break;case"flux_analysis":a(ye(w,i,P,null));break;case"month_end_insights":if(P===!1){const O=new Date(w.year,w.month,0),R=On(O.toDateString()).format(Ft.analytics.YYYYDashMMDashDDFormat);a(Bn(!0,d.companyId,d.tenantId,R)),a(Fn(d.companyId,d.tenantId))}break;case"je_schedules":a(Un(j,P));break;case"missing_receipts":a(bt(j,{amount:75,currencyCode:"USD",currencySymbol:"$"},i,P));break;default:a(ne(w,ce,i,P))}},[V,le,re,d.companyId,d.tenantId,qe,w,ce,K,ae,Q]);l.useEffect(()=>{V===ie&&W.fetchState==="Not-Started"&&I&&He(!0)},[W,le,re,d.companyId,d.tenantId,I]),l.useEffect(()=>{ge||K||b.current||Lt.fetchState==="In-Progress"||W.fetchState!=="Completed"||(b.current=!0,He(!0,!0))},[]),l.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&a(he({tenantId:d.tenantId,period:w,refreshViewInBackground:!1}))},[Y.fetchState,d.tenantId]),l.useEffect(()=>{B.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?E(!0):E(!1)},[B.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),l.useEffect(()=>{B.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&I&&(a(he({tenantId:d.tenantId,period:w,refreshViewInBackground:!0})),a(_n({companyId:d.companyId})),T("../"))},[B.monthEndInsights?.sendMonthEndReportStatus?.fetchState,d.tenantId,w,d.companyId,I]),l.useEffect(()=>{const i=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&a(he({tenantId:d.tenantId,period:w,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(i)},[Y.fetchState,d.tenantId,w,a]),l.useEffect(()=>{const i=setInterval(()=>{V==="reconciliation"&&ce==null&&B.reconciliation.fetchStatus.fetchState==="Completed"&&B.reconciliation.refreshStatus.fetchState!=="In-Progress"&&a(ne(w,void 0,!0,!0))},3e5);return()=>clearInterval(i)},[V,a,B.reconciliation.fetchStatus.fetchState,B.reconciliation.refreshStatus.fetchState,ne,ce,w]);const Ht=mt();l.useEffect(()=>{const i=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(P=>P.id==="month_end_insights")?.isDisabled??!1)&&!$e;V!=="month_end_insights"||!i&&Y.monthEndCloseChecks?.reportEmailSentDate==null||T("../")},[V,Y.monthEndCloseChecks]);const Qt=B.reconciliation.selectedDrawerAccountId;l.useEffect(()=>{Je==="In-Progress"&&Pe.accountSettingsView.saveState.fetchState==="Completed"&&a(at())},[Je,Pe.accountSettingsView.saveState.fetchState,at]);const{transactionId:Qe,onSaveVendor:Wt,onSaveSuccess:Xt,onCancel:en,vendorViewDetails:tn}=(({expenseAutomationViewSelector:i,closeDrawerHandler:P,currentSelectedView:j})=>{const O=pe();let R,de,X;const Ie=mt(),q=i.transactionView;let Z=()=>{};const{transactions:nn,selectedTransactionId:te,selectedTransactionLineId:fe,transactionLocalData:an}=q;if(j==="transaction_categorization"){const xe=an.find(ee=>ee.transactionId===te),J=nn.find(ee=>ee.id===te),We=fe!=null?xe?.transactionReviewLocalData?.lineItemById[fe]:void 0,Xe=We?.account;de=We?.class?.classId,R=["Uncategorized Income","Uncategorized Expense"].includes(Xe?.accountName??"")?void 0:Xe?.accountId;const sn=no(te,J?.typeOfTransaction);J!=null&&sn&&(X={id:te,type:Me(J.typeOfTransaction)}),Z=()=>{if(te!=null&&fe!=null&&J!=null){const ee=q.transactionLocalData.find(ke=>ke.transactionId===te)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const ke=ee.lineItemById[fe];let Re=ee.selectedEntity;if(wn(J)||(Re=ke.selectedEntityLine),Re!=null){const cn=Re,ln={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(rn=>rn.id)??[]};O(je(cn,ke.amount.amount,ln,!1,!0,Ie))}}}}}const on=F(xe=>tt(xe,void 0,R,de));return{transactionId:X,onSaveVendor:()=>{O(Tn(X,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{X!=null&&O(vn({transactionId:X})),O(bn()),O(An()),P()},vendorViewDetails:on}})({expenseAutomationViewSelector:B,closeDrawerHandler:()=>{L(!1)},currentSelectedView:V});return we?.loggedInUserRoleMap==null?Y.fetchState==="Error"?u.jsx(Ka,{onGoHome:()=>T("../",{replace:!0}),onReload:()=>window.location.reload()}):u.jsx(Ut,{fetchState:"In-Progress"}):u.jsxs(u.Fragment,{children:[u.jsx(oo,{isOpen:D,drawerLeftMargin:new Za(0,0,300,650),onClose:()=>{e(!1)},children:u.jsx(Eo,{onClick:i=>i.stopPropagation(),children:u.jsx(uo,{companyId:d.companyId,closeCustomerRequestDrawer:()=>e(!1),addCustomerRequest:Yt,resetCustomerRequest:Nt})})}),Qe!=null&&k&&u.jsx(eo,{isOpen:k,transactionId:Qe,onSaveVendor:Wt,onSaveSuccess:Xt,onCancel:en,vendorViewDetails:tn}),u.jsx(lo,{selectedDrawerAccountId:Qt,reconciliation:B.reconciliation,onFetchLinkTokenClick:(i,P)=>{a(wt("expense_automation_reconcile",i,P))},onEstablishConnectionClick:(i,P)=>{const j=d?.companyId;j!=null&&(a(At(i,j,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",P)),a(Tt({accountId:P,connectionInProgress:!0})))}}),Ge&&u.jsx(po,{selectedTransactionId:s,onClose:()=>C(void 0)}),u.jsx(fo,{navigate:T,location:g,themeState:S,vendorSearchAutoCompleteData:{autoCompleteText:Gt,entityAutoCompleteView:jt},expenseAutomationViewSelector:B,isMissingReceiptsBulkUploadEnabled:se,monthEndInsightsPreviewMode:p,monthEndInsightsCustomerRequestData:n,isRealtimeInsightsFeatureEnabled:$e,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:Ht,currentTenant:d,companyId:d.companyId,signedInUser:oe,isTransactionActivityEnabled:Ge,uncategorizedAccounts:$t,onClickCustomerRequest:Jt,handleEditClick:qt,tenantEmailDomain:U,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:C,closeSidePanel:t,openTransactionPanel:c,sidePanelIsOpen:y,sidePanelIsFullView:A,panelContent:x,isAiCfoAccessEnabled:_,onAskAiCfoClick:v,isExpenseAutomationCommentingEnabled:Vt,onExpenseAutomationCommentingThreadClick:Mt})]})}),Eo=Ae(Le)`
17
+ display: flex;
18
+ min-height: 100%;
19
+ flex-direction: column;
20
+ `;function Yo(){return u.jsxs(mn,{children:[u.jsx(De,{path:"*",element:u.jsx(so,{})}),u.jsx(De,{path:"/:selectedTab/:selectedPeriod/*",element:u.jsx(ko,{})}),u.jsx(De,{path:"*",element:u.jsx(dn,{})})]})}export{Yo as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BZlOk8zk.js";import{a as r}from"./sentry-BfJuQlQx.js";import{Y as l,Z as p,_ as b,w as f}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.js";import m from"./NotFoundScreen-C3kBFHq1.js";import{j as c,u}from"./core-C1FHFtWE.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]="b9a83aa7-b690-4828-8ae7-7b69f878cdb8",a._sentryDebugIdIdentifier="sentry-dbid-b9a83aa7-b690-4828-8ae7-7b69f878cdb8")}catch{}})();const j=()=>{const a=c(),e=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=f(e.state?.pathnameStackToGoBack),d=n.poppedPathname??k();a(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(e.pathname);return o!=null?s.jsx(p,{menuItem:b(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{j as F};
@@ -0,0 +1,72 @@
1
+ import{j as t}from"./liveblocks-BZlOk8zk.js";import{l as b,k as x,j,u as y,h as Z,q as ee,g as A,N as te,n as ae,o as p}from"./core-C1FHFtWE.js";import{It as S,Iu as k,Iv as N,yP as $,yB as L,Iw as C,Ix as ne,Iy as oe,yF as ie,eN as I,yM as se,yJ as le}from"./zeni-epic-state-BEdHTWyp.js";import{q as g,f as d,r as de,e as v,n as E,s as re,w as ce,x as me,y as F,c as pe,d as ue,A as he,X as xe,h as ge,B as fe,E as we,v as be,S as ye,F as Se,G as ke,H as ve}from"./index-CZc_s42n.js";import{n as c}from"./mui-CZhjlxyT.js";import f from"./NotFoundScreen-C3kBFHq1.js";import{a as P}from"./sentry-BfJuQlQx.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.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]="bdcd1346-ed83-4217-abe2-38edaf64762d",e._sentryDebugIdIdentifier="sentry-dbid-bdcd1346-ed83-4217-abe2-38edaf64762d")}catch{}})();const Ie=c.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,je=x(function(e){const a=S(e),n=k(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;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}))}}})(de);function z(){const e=g(),{vendorId:a,billId:n}=b();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(je,{vendorId:a,billId:n})})})}const $e=c.div`
11
+ display: flex;
12
+ height: 100vh;
13
+ width: 100%;
14
+ flex: 1 1 auto;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ background-color: ${e=>e.theme.colors.grey4};
18
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Ce=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:C(e),googleAPIKey:E.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,i=()=>{const l=ce(o.state?.pathnameStackToGoBack),s=l.poppedPathname??De();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ae(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(re);function Be({isSubPage:e}){const a=j(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx($e,{windowSize:o,children:t.jsx(Ce,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:E.googleMapsAPIKey})})})}const De=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Ae=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Pe=c.div`
20
+ display: flex;
21
+ height: 100%;
22
+ width: 100%;
23
+ flex: 1 1 auto;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ background-color: ${e=>e.theme.colors.grey4};
27
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,ze=x(function(e){const a=S(e),n=k(e),o=C(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(L(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(N({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),r=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}})(me);function Ne(){const e=j(),a=y(),n=g(),{vendorId:o,billId:i}=b();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Pe,{windowSize:n,children:t.jsx(ze,{location:a,navigate:e,vendorId:o,billId:i})})})}const Le=c.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Ee=x(function(e){const a=S(e),n=k(e),o=C(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:r}=s;e(oe({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),r=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}})(he);function Fe(){const e=j(),a=y(),n=g(),{vendorId:o,billId:i}=b(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Le,{windowSize:n,children:t.jsx(Ee,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
38
+ width: ${d.sp4};
39
+ height: ${d.sp4};
40
+ margin-bottom: ${d.sp3};
41
+ margin-top: ${d.sp3};
42
+ margin-left: ${d.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,He=c.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,Me=c.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Te.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
61
+ `,Ve=c.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,Ke=x(function(e,a){return{file:a.file,type:a.type}})(Se);function h({appContent:e}){const a=Z(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=b(),[s]=ee(),r=s.get("token"),T=n.pathname.includes("address"),w=g(),G=xe(),B=ge(),H=()=>{G.toggle()},M=A(u=>S(u)),V=A(u=>k(u)),{authParams:K,fetchState:m,billAttachment:W,billFetchState:D,companyName:_,currencySymbol:U,amount:q}=M,{tenantId:J,userId:O,sessionId:X}=K,{fetchState:Q,internationalBankAccountCreateStatus:R}=V;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&r!=null&&a(se(i,o,r))},[]),P.useEffect(()=>{m==="Completed"&&(I(O,X,J),l!=null&&a(le(l)))},[m]),m==="Error"?t.jsx(f,{}):Q==="Completed"||R.fetchState==="Completed"?(I(),t.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?t.jsx(fe,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${B.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[m==="Completed"&&D==="Completed"&&t.jsx(we,{analytics:v,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",i??"",_,l??"",We(n.pathname),U,q))(u)}),t.jsxs(He,{windowSize:w,children:[w!=="small"?t.jsx(Ge,{onClick:H}):null,t.jsx(Ve,{windowSize:w,isAddressPage:T,children:D==="In-Progress"?t.jsx(be,{size:"ExtraLarge",start:!0}):t.jsx(Ke,{file:W,type:"bill"})}),t.jsx(Me,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function _e(){return t.jsx(ve,{})}function lt(){return t.jsxs(ae,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(_e,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(z,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(z,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Be,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ne,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Fe,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{lt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-BZlOk8zk.js";import{a as g}from"./sentry-BfJuQlQx.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-C1FHFtWE.js";import{z as r,h as P,D as V,g as A,e as N,i as q,p as R,v as W,k as $}from"./index-CZc_s42n.js";import{eM as B,Id as G,Io as H,Ie as J,eN as K,fh as Q,Ik as X,fF as Y,cR as Z,Ip as ee,Iq as te}from"./zeni-epic-state-BEdHTWyp.js";import{n as ne}from"./mui-CZhjlxyT.js";import{u as ae}from"./useDeviceId-CjFCWE4s.js";import{f as se}from"./analyticsHelper-Bo9aIzGQ.js";import{t as ie}from"./getLocaleForTenant-pBjb9R_D.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d56c8ad1-0c31-4113-8579-a06a7aaa88d1",t._sentryDebugIdIdentifier="sentry-dbid-d56c8ad1-0c31-4113-8579-a06a7aaa88d1")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=U(),s=_(),f=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),v=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),b=P().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,m)))},[n,p,t,i,m,a?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&v!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),a.zeniSessionId),K(a.userId,a.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,b,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,v,a,o,k,b,s.state,t]);const F=g.useCallback(()=>{f("/signin/auth")},[f]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=g.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"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||m==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.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 N}from"./liveblocks-1thjzoaw.js";import{a as c}from"./sentry-CooVhpit.js";import{h as pe,g as t,l as Ze,u as qe,j as Je,i as R}from"./core-DGtRv-5L.js";import{eM as he,eT as Ke,eU as Se,eO as Qe,bm as Xe,f2 as ea,eV as aa,eW as ta,eY as na,f0 as sa,fa as oa,f1 as g,f4 as ia,f5 as ue,f8 as ra,f6 as da,f7 as la,f9 as ca,cF as ua,fc as fa,cL as ma,bu as ba,eL as pa,fh as ha,fi as Sa,fg as ga}from"./zeni-epic-state-DNuuo8ZV.js";import{a1 as Ea,a2 as Ca,v as ka,l as ya,z as C,a3 as Ia,u as Ta,c as r,a4 as wa,a5 as Fa,C as Aa,a as _a,a6 as Da,V as va,a7 as $a,a8 as Ba,a9 as fe,aa as me,L as Ma,ab as Pa,ac as be,d as x,r as F,ad as V,ae as Ra}from"./index-NN8WQI8p.js";import{D as xa}from"./mui-C-9qGevS.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]="13125608-57ce-4f0c-a5b9-bbceff8a3135",f._sentryDebugIdIdentifier="sentry-dbid-13125608-57ce-4f0c-a5b9-bbceff8a3135")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=Ze(),a=qe(),k=ka(),o=Je(),U=Qe(),m=pe(),{useFeatureGate:i}=ya(),G=C.getSignedInUser(),A=Xe(G),s=t(e=>he(e)),L=t(e=>ea(e)),O=L.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,j]=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:H}=i(r.isDebitCardFeatureEnabled),Ce=wa(s,Ee,H),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),W=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=C.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:Z}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:q}=i(r.isExpenseAutomationEnabledV2),J=q||Z&&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),K=t(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=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:X,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&&X!=null){const e=`dashboard_${s.companyId}`;j(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else j(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,U.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 Ve={fetchStatus:Pe,count:Me},ne=n!=null?C.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"),J===!1&&S.push("expense_automation_card");const Ne=Aa(),oe=t(e=>da(e,S,h,q,Z,w).fetchState),ie=t(e=>la(e).fetchState),Ue=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),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&W.fetchState==="Completed"&&fa(W.notificationSettings,h.userEmail,H,s),re=_a(),ze=re&&Da(a),de=ma(Ne?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!C.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 He=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,We=$a(He);return N.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:N.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:me(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Le,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:We,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:je,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:J&&ba(s.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>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",O??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=V(l)&&l!=="command_center";if(V(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)?(O!=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=V(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:()=>{C.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{k.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(k=>he(k)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,o)=>{Ca(o)&&Ke(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...a})};export{za as M};
1
+ import{j as U}from"./liveblocks-BZlOk8zk.js";import{a as c}from"./sentry-BfJuQlQx.js";import{h as pe,g as t,l as Ze,u as Xe,j as qe,i as R}from"./core-C1FHFtWE.js";import{eM as he,eT as Je,eU as Se,eO as Ke,bm as Qe,f2 as ea,eV as aa,eW as ta,eY as na,f0 as sa,fa as oa,f1 as g,f4 as ia,f5 as ue,f8 as ra,f6 as da,f7 as la,f9 as ca,cF as ua,fc as fa,cL as ma,bu as ba,eL as pa,fh as ha,fi as Sa,fg as ga}from"./zeni-epic-state-BEdHTWyp.js";import{a1 as Ea,a2 as Ca,X as ka,c as ya,z as C,a3 as Ia,u as Ta,d as r,a4 as wa,a5 as Fa,C as Aa,a as _a,a6 as Da,Y as va,a7 as $a,a8 as Ba,a9 as fe,aa as me,L as Ma,ab as Pa,ac as be,e as x,y as F,ad as N,ae as Ra}from"./index-CZc_s42n.js";import{D as xa}from"./mui-CZhjlxyT.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]="2e3cc11b-a271-43db-90fe-2880e9ccf9f9",f._sentryDebugIdIdentifier="sentry-dbid-2e3cc11b-a271-43db-90fe-2880e9ccf9f9")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=Ze(),a=Xe(),k=ka(),o=qe(),V=Ke(),m=pe(),{useFeatureGate:i}=ya(),G=C.getSignedInUser(),A=Qe(G),s=t(e=>he(e)),L=t(e=>ea(e)),O=L.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,j]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,Y=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ce=wa(s,Ee,H),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),W=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=C.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:Z}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||Z&&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}`;j(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else j(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?C.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,Z,w).fetchState),ie=t(e=>la(e).fetchState),Ve=D&&(oe==="Completed"||oe==="Error")||Y&&(ie==="Completed"||ie==="Error")||!D&&!Y?void 0:"disabled",Ge=c.useMemo(()=>ca(s.userRole),[s.userRole]),Le=ua(Ge),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&W.fetchState==="Completed"&&fa(W.notificationSettings,h.userEmail,H,s),re=_a(),Ye=re&&Da(a),de=ma(Ue?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!C.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 He=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,We=$a(He);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:ke,isVendorsTabVisible:Le,isZeniAccountEnabled:z,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:We,isTreasuryPopupVisible:ze,isNotificationsTabVisible:je,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,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",O??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)?(O!=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:()=>{C.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{k.toggle()},isAiCfo:Ye,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})})}),Ya=f=>{const d=pe(),n=t(k=>he(k)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,o)=>{Ca(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Na,{...f,...a})};export{Ya as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BZlOk8zk.js";import{j as r,k as i}from"./core-C1FHFtWE.js";import{W as n}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.js";import"./sentry-BfJuQlQx.js";import"./zeni-epic-state-BEdHTWyp.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.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};
@@ -0,0 +1 @@
1
+ import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-BZlOk8zk.js";import ut from"./NotFoundScreen-C3kBFHq1.js";import{a as k}from"./sentry-BfJuQlQx.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 K}from"./core-C1FHFtWE.js";import{cn as It,eV as X,eM as H,f9 as Ct,f1 as b,OC as J,f5 as d,eU as y,qm as $,vA as Tt,OD as yt,eT as At,fc as Et,qr as _t,OE as F,bp as M,gy as x,qv as Q,OF as Nt,cy as Bt,cs as wt}from"./zeni-epic-state-BEdHTWyp.js";import{O as xt,z as vt,c as Dt,d as Rt,N as Ut,cn as Gt,y as N,a1 as Pt,co as Ft,a2 as Mt,w as $t}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-JjOesvRK.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-CabshbJ5.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.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]="8c89d307-6deb-4e50-95ee-e09f8ba5208d",t._sentryDebugIdIdentifier="sentry-dbid-8c89d307-6deb-4e50-95ee-e09f8ba5208d")}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(Q("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(J(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(Q("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)),zt=()=>{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:z,isFetchingMore:L,hasFetchedAll:W}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(J(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}:(L||W===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(yt(ct))}},[A,U,L,C,W,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(K,{path:"/:selectedTab",element:_.jsx(zt,{})}),_.jsx(K,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-1thjzoaw.js";import{j as z,h as K,u as Z,l as H,g as d,k as X,n as ee,o as C}from"./core-DGtRv-5L.js";import{eM as M,qa as U,pK as ae,J4 as $,pF as T,bu as te,bm as se,bQ as oe,pG as re,J5 as ne,IR as S,dF as ie,tx as ce,J6 as le,tU as de,eS as me,eQ as fe}from"./zeni-epic-state-DNuuo8ZV.js";import{I as pe,z as ue,M as he,C as Fe,l as w,c as G,w as ge,d as q,aj as be,r as Ie}from"./index-NN8WQI8p.js";import"./mui-C-9qGevS.js";import Ce from"./NotFoundScreen-JcC_UZ1m.js";import{F as Se}from"./FeaturePreviewScreen-cXgFYw9z.js";import{a as h}from"./sentry-CooVhpit.js";import{u as Te}from"./useAskAiCfoHostNavButtonProps-Cmlh3sFJ.js";import{c as ye}from"./useFetchSuggestedQuestionsWhenReady-D27Rjrx4.js";import{u as Ae}from"./useInitialThreadRequest-CY2eSsaO.js";import{t as xe}from"./routePaths-8nWXl3lj.js";import{M as ke}from"./MobileAppDrawer-VgfdPmIc.js";import"./recharts-a2B9SbBf.js";import"./analytics-CALyM-hh.js";import"./plaid-DRyXOtiU.js";import"./dnd-Bts1hC9q.js";import"./stripe-DMRn4zHo.js";import"./lottie-TdNUPve2.js";import"./lexical-DcQz2ToX.js";import"./pdf-DhqCrjXb.js";import"./utils-DYt83G2V.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]="13a2b5a2-dfa4-402a-8758-271ab45867ae",s._sentryDebugIdIdentifier="sentry-dbid-13a2b5a2-dfa4-402a-8758-271ab45867ae")}catch{}})();const y=(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($(e,o)),a.isPandLReportFetched(e)||s(T(e)),y(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 F=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,F,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("../../")}}})(be);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=z(),o=K(),r=Z(),{forecastId:i,tenantEmailDomain:F}=H(),[f,p]=h.useState(!1),[g,A]=h.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:b}=he();ye({isDataReady:l});const{isAiCfoAccessEnabled:N,onAskAiCfoClick:_}=Te({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&b)p(!0),l||o(ae());else if(l&&!g){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($(c.forecasts[t].id,t)),y(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&y(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!j(c.forecasts[t].id)&&b&&o(T(c.forecasts[t].id))}},[f,p,o,l,c,g,A,U,T,b]);const E=Fe(),V=E?.loggedInUserRole!=null&&te(E.loggedInUserRole),{useFeatureGate:W}=w(),{isFeatureEnabled:L}=W(G.isReportsCommentingEnabled),Y=Ae(L?x?.companyId:void 0,{clearParams:l&&g}),[J,Q]=h.useState(!1),O=t=>{Q(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:q,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ke,{isAppContentDrawerOpen:J,handleDrawerToggle:O}),n.jsx(De,{firstMonthOfFY:B,tenantEmailDomain:F,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:V,isAiCfoAccessEnabled:N,onAskAiCfoClick:_,isReportsCommentingEnabled:L,isZeniUser:se(u),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{O(!0)}})]})}function Ke(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(G.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{Ke as PandLWithForecastRoutes,Ke as default};
1
+ import{j as n}from"./liveblocks-BZlOk8zk.js";import{j as z,h as K,u as Z,l as H,g as d,k as X,n as ee,o as C}from"./core-C1FHFtWE.js";import{eM as M,qa as U,pK as ae,J4 as w,pF as y,bu as te,bm as se,bQ as oe,pG as re,J5 as ne,IR as S,dF as ie,tx as ce,J6 as le,tU as de,eS as me,eQ as fe}from"./zeni-epic-state-BEdHTWyp.js";import{N as pe,z as ue,O as he,C as Fe,c as $,d as N,E as ge,e as q,aj as be,y as Ie}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.js";import Ce from"./NotFoundScreen-C3kBFHq1.js";import{F as Se}from"./FeaturePreviewScreen-ClmSo1U7.js";import{a as h}from"./sentry-BfJuQlQx.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-JjOesvRK.js";import{c as Te}from"./useFetchSuggestedQuestionsWhenReady-CabshbJ5.js";import{u as Ae}from"./useInitialThreadRequest-C42RI3oJ.js";import{t as xe}from"./routePaths-DRiZXKg0.js";import{M as ke}from"./MobileAppDrawer-BaHE34Vv.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.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]="5b86e5c5-6716-412c-870e-f25befb7c84a",s._sentryDebugIdIdentifier="sentry-dbid-5b86e5c5-6716-412c-870e-f25befb7c84a")}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 F=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,F,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("../../")}}})(be);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=z(),o=K(),r=Z(),{forecastId:i,tenantEmailDomain:F}=H(),[f,p]=h.useState(!1),[g,A]=h.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:b}=he();Te({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=ye({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&b)p(!0),l||o(ae());else if(l&&!g){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)&&b&&o(y(c.forecasts[t].id))}},[f,p,o,l,c,g,A,U,y,b]);const E=Fe(),V=E?.loggedInUserRole!=null&&te(E.loggedInUserRole),{useFeatureGate:W}=$(),{isFeatureEnabled:L}=W(N.isReportsCommentingEnabled),Y=Ae(L?x?.companyId:void 0,{clearParams:l&&g}),[J,Q]=h.useState(!1),O=t=>{Q(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:q,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ke,{isAppContentDrawerOpen:J,handleDrawerToggle:O}),n.jsx(De,{firstMonthOfFY:B,tenantEmailDomain:F,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:V,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:L,isZeniUser:se(u),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{O(!0)}})]})}function Ke(){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{Ke as PandLWithForecastRoutes,Ke as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-BZlOk8zk.js";import{I$ as oe,eM as X,jm as H,eS as q,eQ as ie,Gz as Y,ID as re,sF as ke,J0 as Q,st as Pe,sO as je,sI as le,sx as de,sM as Te,sJ as Le,J1 as ce,uj as ve,J2 as Fe,fw as Oe,J3 as G,sC as pe,sA as ue,sR as Ae,b$ as Re}from"./zeni-epic-state-BEdHTWyp.js";import{q as me,c as ee,d as E,z as K,a4 as ge,I as fe,af as he,ag as Ve,G as Ce,f as O,J as be,D as ye,ah as Ue,O as $e,N as Be,E as Ze,e as Se,i as ze,y as Ge,ai as Je,C as Me}from"./index-CZc_s42n.js";import{D as we,n as _,S as De}from"./mui-CZhjlxyT.js";import te from"./NotFoundScreen-C3kBFHq1.js";import{a as l}from"./sentry-BfJuQlQx.js";import{h as se,l as He,g,j as Ke,u as _e,k as We,n as ne,o as z}from"./core-C1FHFtWE.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-JjOesvRK.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-CabshbJ5.js";import{M as Xe}from"./MobileAppDrawer-BaHE34Vv.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.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]="b2ed66f1-19dd-464f-97db-d6fb4cdb760b",e._sentryDebugIdIdentifier="sentry-dbid-b2ed66f1-19dd-464f-97db-d6fb4cdb760b")}catch{}})();const qe={overlayWidth:new Ce(100,100,48)},J=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=me(),u=se(),[A,R]=l.useState(!1),[k,S]=l.useState(!1),{userId:w}=He(),c=g(t=>oe(t)),m=g(t=>X(t)),D=g(t=>H(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=q(I,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(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(Q()),y()},F=()=>{A===!0?S(!0):b()},$=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:B}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Z}=C(E.isChargeCardFeatureEnabled),p=ge(m,Z,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:B===!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(f==="zeni_only"?Pe(e):je(v))},onCloseClick:F,isLoading:x||c.person==null},r={onOkClick:()=>{S(!1),b()},onCancelClick:()=>{S(!1)}};return l.useEffect(()=>{x===!1&&w!=null&&u(ke(w))},[x,w]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:J.discardTitle}),descriptionComponent:s.jsx(Ee,{children:J.discardDescription}),primaryButtonText:J.discard,secondaryButtonText:J.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=_(De)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,xe=_(be.H6Regular)`
6
+ margin-top: ${O.sp7};
7
+ padding-left: ${O.sp8};
8
+ padding-right: ${O.sp8};
9
+ color: ${e=>e.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Ee=_(be.LargeRegularSp)`
12
+ color: ${e=>e.theme.colors.hero};
13
+ padding-left: ${O.sp8};
14
+ padding-right: ${O.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${O.sp4};
17
+ white-space: pre-line;
18
+ `,ss={overlayWidth:new Ce(100,100,48)},M=ye.getLocalizedStrings().peoplePage.invitePage,as=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=me(),u=se(),[A,R]=l.useState(!1),[k,S]=l.useState(!1),w=g(r=>oe(r)),c=g(r=>X(r)),m=g(r=>H(r)),{useFeatureGate:D}=ee(),{isFeatureEnabled:C}=D(E.isDebitCardFeatureEnabled),I=q(C,c),P=ie(c),L=Y(c),v=re(c),V=!!c.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&m&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),u(Q())},b=()=>{A===!0?S(!0):x()},F={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map(r=>r.user),{isFeatureEnabled:B}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Z}=D(E.isChargeCardFeatureEnabled),p=ge(c,Z,C),{isFeatureEnabled:j}=D(E.isTreasuryEnabled),T={classList:o.classes,managersList:n.users,controllersList:$,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:r=>{u(le({peopleLocalData:r})),R(!0)},onResetClick:x,onSaveClick:()=>{u(f==="zeni_only"?Te(e):Le())},onCloseClick:b,peopleDetails:w,isAccountingClassesEnabled:m,isReimbursementDisabled:V===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:B===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return l.useEffect(()=>{w.invitePersonState.fetchState==="Completed"&&(y(),u(Q()))},[w.invitePersonState.fetchState]),s.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:ss.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:b,children:s.jsxs(ts,{onClick:r=>r.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:M.discardTitle}),descriptionComponent:s.jsx(Ee,{children:M.discardDescription}),primaryButtonText:M.discard,secondaryButtonText:M.no,action:F}):null,s.jsx(Ue,{...T})]})})},ts=_(De)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,ns=We(function(e,n){const d=ce(e),o=K.getSignedInUser();return{data:d,loggedinUserId:o?.userId??"",isZeniTenant:n.isZeniTenant===!0,shouldFetchClasses:n.shouldFetchClasses,isZeniAdminUser:o?.userEmailDomain==="zeni.ai"&&n.isZeni===!0,isAccountingClassesEnabled:H(e),analytics:Se}},function(e,n){const{navigate:d,companyId:o,shouldFetchClasses:f}=n;return{personAction:{onPersonDelete:(i,y)=>{e(de(i,y))},onResendInvite:i=>{e(Ae(i))},onReloadPeople:()=>{e(pe()),e(ue(o,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}})(Je);function N({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:n}){const d=Ke(),o=se(),f=_e(),{areTenantIdsInSync:i}=$e(),y=K.getSignedInUser(),h=g(a=>X(a)),{useFeatureGate:u}=ee(),{isFeatureEnabled:A}=u(E.isDebitCardFeatureEnabled),R=g(a=>H(a)),k=!q(A,h)&&R,S=Y(h),w=h?.tenantId,{tenantEmailDomain:c}=h,[m,D]=l.useState(!1),[C,I]=l.useState(!1),[P,L]=l.useState(!1),[v,V]=l.useState("off"),[U,x]=l.useState(!1),b=a=>{x(a)},{isAiCfoOpen:F,setIsAiCfoOpen:$}=Be(),{isAiCfoAccessEnabled:B,onAskAiCfoClick:Z}=Ne({isAiCfoOpen:F,setIsAiCfoOpen:$,mobileExploreReferrer:"People"}),p=g(a=>ce(a));Qe({isDataReady:p.fetchState==="Completed"});const j=g(a=>ve(a.classState,a.classListState)),T=g(a=>Fe(a.userState,a.userRoleState,a.userListViewState,"manager")),r=g(a=>Oe(a)),t=h?.companyId;l.useEffect(()=>{m&&v===p.uiState.mode||!i||(o(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),V(p.uiState.mode),D(!0),o(pe()))},[m,y,w,o,p.uiState.mode,i]),l.useEffect(()=>{t!=null&&i&&o(ue(t,k))},[t,k,i]),l.useEffect(()=>{I(e!=null&&e===!0),L(n!=null&&n===!0&&n)},[e,n]),l.useEffect(()=>{o(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const ae=()=>{I(!1),L(!1),d("../")};return s.jsxs(s.Fragment,{children:[p.fetchState==="Completed"?s.jsx(Ze,{analytics:Se,onLoad:a=>a.trackPageLoaded(ze.Event.members)}):null,C===!0?s.jsx(as,{closeDrawerHandler:ae,isInvitePeopleDrawerOpen:C,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,P===!0?s.jsx(Ye,{closeDrawerHandler:ae,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,s.jsx(Xe,{isAppContentDrawerOpen:U,handleDrawerToggle:b}),s.jsx(ns,{navigate:d,signedInUser:y,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:p.uiState,companyId:t,shouldFetchClasses:k,classList:j,managersView:T,peopleView:p,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(a,W)=>{o(G({sortKey:a,sortOrder:W}))},onRowClick:a=>{const W=`/${c}/people/${encodeURIComponent(a)}/edit`,Ie=Ge(f.state?.pathnameStackToGoBack,f.pathname);d(W,{state:{pathnameStackToGoBack:Ie}})},onClickMenuIcon:()=>{b(!0)},isAiCfoAccessEnabled:B,onAskAiCfoClick:Z})]})}function Es(){const e=Me();return Re(e?.loggedInUserRole??[])?s.jsxs(ne,{children:[s.jsx(z,{path:"/",element:s.jsx(N,{})}),s.jsx(z,{path:"new",element:s.jsx(N,{isInvitePeopleDrawerOpen:!0})}),s.jsx(z,{path:":userId/edit",element:s.jsx(N,{isEditPeopleDrawerOpen:!0})}),s.jsx(z,{path:"*",element:s.jsx(te,{})})]}):s.jsx(ne,{children:s.jsx(z,{path:"*",element:s.jsx(te,{})})})}export{Es as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-BZlOk8zk.js";import _ from"./NotFoundScreen-C3kBFHq1.js";import{a as r}from"./sentry-BfJuQlQx.js";import{j as M,u as v,g,l as U,h as P,N as z,k as N,n as V,o as h}from"./core-C1FHFtWE.js";import{eM as B,OG as b,bn as F,bm as G,h2 as H,gy as X}from"./zeni-epic-state-BEdHTWyp.js";import{X as $,z as I,N as q,cp as J}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.js";import{u as K}from"./useAskAiCfoHostNavButtonProps-JjOesvRK.js";import{c as L}from"./useFetchSuggestedQuestionsWhenReady-CabshbJ5.js";import{M as Q}from"./MobileAppDrawer-BaHE34Vv.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.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]="6f6b91de-7882-4043-8bd8-9653cb12eec7",e._sentryDebugIdIdentifier="sentry-dbid-6f6b91de-7882-4043-8bd8-9653cb12eec7")}catch{}})();const W=N(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:a}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:a}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(J),Y=()=>{const e=M(),t=v(),c=$(),o=g(s=>B(s)),{aggregatedReportViewState:a}=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 f=r.useRef(!1),[C,S]=r.useState(!1),k=F(o?.userRole??[]),w=o?.userRole?.includes("bookkeeping_admin")??!1,y=G(l),A=k||w||y,d=r.useCallback((s,i,O)=>{p(H({fromMonth:s,toMonth:i,cacheOverride:O}))},[]);r.useEffect(()=>{a?.fetchState==="Completed"&&f.current&&(p(X({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[a?.fetchState]);const D=r.useCallback((s,i)=>{a!=null&&a?.fetchState==="In-Progress"||d(s,i,!0),f.current=!0},[a?.fetchState,d]),x=r.useCallback((s,i)=>{d(s,i,!1)},[d]),u=s=>{S(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=q(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=K({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return L({isDataReady:a?.fetchState==="Completed"}),A?n.jsxs(n.Fragment,{children:[n.jsx(Q,{isAppContentDrawerOpen:C,handleDrawerToggle:u}),n.jsx(W,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:x,handleDrawerToggle:u,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):n.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return n.jsxs(V,{children:[n.jsx(h,{path:"*",element:n.jsx(Y,{})}),n.jsx(h,{path:"*",element:n.jsx(_,{})})]})}export{Ie as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-CooVhpit.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-BfJuQlQx.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-1thjzoaw.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CooVhpit.js";import{L as dt,bQ as Tc,eM as Ac,Id as Rc,IX as kl,b$ as Tl,fh as Al,fi as Rl}from"./zeni-epic-state-DNuuo8ZV.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-DYt83G2V.js";import{r as un}from"./empty-B8GlEZnh.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DmaaVbvY.js";import{r as Gl}from"./index-ktcuBvep.js";import{r as zl}from"./index-BzTrf-Pv.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DGtRv-5L.js";import{u as Kl,z as Pc,L as Wl,R as Jl,T as Xl,k as Ql,d as tf}from"./index-NN8WQI8p.js";import"./mui-C-9qGevS.js";import{d as Pe}from"./decodeURIComponentSafe-D45efNq9.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]="0dcc82af-97ae-4351-98a3-5a5c3ec3d0ec",t._sentryDebugIdIdentifier="sentry-dbid-0dcc82af-97ae-4351-98a3-5a5c3ec3d0ec")}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-BZlOk8zk.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BfJuQlQx.js";import{L as dt,bQ as Tc,eM as Ac,Id as Rc,IX as kl,b$ as Tl,fh as Al,fi as Rl}from"./zeni-epic-state-BEdHTWyp.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-B1VtuHQw.js";import{r as un}from"./empty-DCBZxZdT.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Bm3ZpH2B.js";import{r as Gl}from"./index-Dg4Gln7w.js";import{r as zl}from"./index-v7N-NvrE.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-C1FHFtWE.js";import{u as Kl,z as Pc,L as Wl,U as Jl,V as Xl,n as Ql,e as tf}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.js";import{d as Pe}from"./decodeURIComponentSafe-BjGCfGPp.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]="c65de1f1-2e5b-4c47-a5c3-7ff6f40626ab",t._sentryDebugIdIdentifier="sentry-dbid-c65de1f1-2e5b-4c47-a5c3-7ff6f40626ab")}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
 
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-BZlOk8zk.js";import{a as o}from"./sentry-BfJuQlQx.js";import{g as f,j as H,h as M,u as F,k as N}from"./core-C1FHFtWE.js";import{h as _,q as $,z as R,a$ as U,G as q,O as z,N as G,E as Y,e as l,i as J,a1 as K,b0 as Q}from"./index-CZc_s42n.js";import{eW as X,eM as Z,Lu as I,Lv as ee,tn as ae,td as g,eY as re,bL as ne,ti as te,Lw as se}from"./zeni-epic-state-BEdHTWyp.js";import{D as oe,e as ie,n as le,S as de}from"./mui-CZhjlxyT.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-JjOesvRK.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-CabshbJ5.js";import{M as ue}from"./MobileAppDrawer-BaHE34Vv.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]="f3cb0e62-108a-47d0-bc47-6313254ad22f",e._sentryDebugIdIdentifier="sentry-dbid-f3cb0e62-108a-47d0-bc47-6313254ad22f")}catch{}})();const pe={overlayWidth:new q(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(d=>X(d));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:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(de)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,P="refer-and-earn-status-update",ke=N(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))}}})(K(Q));function Pe({isReferralDrawerOpen:e}){const a=H(),r=M(),n=F(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Z(t)),m=f(t=>I(t)),b=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=ee([m,w]),{areTenantIdsInSync:c}=z();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),E(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&c&&(u(!0),r(g(!0)))},[b,r,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),r(re(!0)))},[w,r,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[A,j]=o.useState(!1),y=t=>{j(t)},{isAiCfoOpen:O,setIsAiCfoOpen:L}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=ce({isAiCfoOpen:O,setIsAiCfoOpen:L,mobileExploreReferrer:"Rewards"});fe({isDataReady:v===!0});const V={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,W)=>{W.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(Y,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(J.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:A,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,...V})]})}export{Pe as R};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-1thjzoaw.js";import x from"./NotFoundScreen-JcC_UZ1m.js";import{a as p}from"./sentry-CooVhpit.js";import{j as C,u as I,h as A,g as u,N as E,k,n as D,o as f}from"./core-DGtRv-5L.js";import{eM as T,Mo as g,ME as S,Ck as V,Bt as M,Cj as c,Ca as U,MT as _}from"./zeni-epic-state-DNuuo8ZV.js";import{h as B,z as $,B as N,a1 as O,bF as W,aa as z}from"./index-NN8WQI8p.js";import"./mui-C-9qGevS.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-nWYI_DTZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="ff424f9b-35b4-4ef4-b095-c25b2ec01fb9",e._sentryDebugIdIdentifier="sentry-dbid-ff424f9b-35b4-4ef4-b095-c25b2ec01fb9")}catch{}})();const m="reimbursement-approval-rule-update",F=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(m)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(U(n))},onEditRuleClick:n=>{n!=null?(e(c(n)),a(`./${n}/edit`)):(e(c()),a("./new"))}}})(O(W)),P=()=>{const e=C(),r=I(),a=A(),[l,n]=p.useState(!1),[d,y]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),w=B(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(M(!0)))},[l,b,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(c())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${m}`]:[],eventCallback:(s,q,R)=>{s.endsWith(m)&&R.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(N,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(F,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(f,{path:"/",element:t.jsx(P,{})}),t.jsx(f,{path:"/new",element:t.jsx(v,{})}),t.jsx(f,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(f,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
1
+ import{j as t}from"./liveblocks-BZlOk8zk.js";import x from"./NotFoundScreen-C3kBFHq1.js";import{a as p}from"./sentry-BfJuQlQx.js";import{j as C,u as I,h as A,g as u,N as E,k,n as D,o as f}from"./core-C1FHFtWE.js";import{eM as T,Mo as g,ME as S,Ck as V,Bt as M,Cj as c,Ca as U,MT as _}from"./zeni-epic-state-BEdHTWyp.js";import{h as B,z as $,B as N,a1 as O,bF as W,aa as z}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-AIE9_S4u.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="ff424f9b-35b4-4ef4-b095-c25b2ec01fb9",e._sentryDebugIdIdentifier="sentry-dbid-ff424f9b-35b4-4ef4-b095-c25b2ec01fb9")}catch{}})();const m="reimbursement-approval-rule-update",F=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(m)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(U(n))},onEditRuleClick:n=>{n!=null?(e(c(n)),a(`./${n}/edit`)):(e(c()),a("./new"))}}})(O(W)),P=()=>{const e=C(),r=I(),a=A(),[l,n]=p.useState(!1),[d,y]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),w=B(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(M(!0)))},[l,b,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(c())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${m}`]:[],eventCallback:(s,q,R)=>{s.endsWith(m)&&R.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(N,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(F,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(f,{path:"/",element:t.jsx(P,{})}),t.jsx(f,{path:"/new",element:t.jsx(v,{})}),t.jsx(f,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(f,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-1thjzoaw.js";import{a as y}from"./sentry-CooVhpit.js";import{j as w,h as A,u as C,l as T,g as b,k as E}from"./core-DGtRv-5L.js";import{ME as R,Mo as U,Cd as x,Cm as _,Ck as S,Cl as h,MF as k}from"./zeni-epic-state-DNuuo8ZV.js";import{z as B,h as V,B as F,bw as j,aa as O}from"./index-NN8WQI8p.js";import"./mui-C-9qGevS.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]="1627c598-cd8e-45e5-b257-c3048ed7a963",e._sentryDebugIdIdentifier="sentry-dbid-1627c598-cd8e-45e5-b257-c3048ed7a963")}catch{}})();function $(e){return k(e)==null}const M=E(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const v=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const g=!!$(d.value);return{type:g?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),m=D.concat(I);v.push({action:u.stepType.selectedOption,actors:m,operator:m.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>U(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?f.jsx(F,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):f.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
1
+ import{j as f}from"./liveblocks-BZlOk8zk.js";import{a as y}from"./sentry-BfJuQlQx.js";import{j as w,h as A,u as C,l as T,g as b,k as E}from"./core-C1FHFtWE.js";import{ME as R,Mo as U,Cd as x,Cm as _,Ck as S,Cl as h,MF as k}from"./zeni-epic-state-BEdHTWyp.js";import{z as B,h as V,B as F,bw as j,aa as O}from"./index-CZc_s42n.js";import"./mui-CZhjlxyT.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]="1627c598-cd8e-45e5-b257-c3048ed7a963",e._sentryDebugIdIdentifier="sentry-dbid-1627c598-cd8e-45e5-b257-c3048ed7a963")}catch{}})();function $(e){return k(e)==null}const M=E(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const v=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const g=!!$(d.value);return{type:g?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),m=D.concat(I);v.push({action:u.stepType.selectedOption,actors:m,operator:m.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>U(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?f.jsx(F,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):f.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};