@zeniai/web-app-ui 5.1.93-prod → 5.1.94-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-pUo9c-tv.js +1 -0
- package/dist/assets/{AddressScreen-Dqns8o7L.js → AddressScreen-DT4aul98.js} +2 -2
- package/dist/assets/{AiCfoScreen-CMCauxgE.js → AiCfoScreen-BhF2jfJu.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DzOMp0L2.js → BillPayApprovalRoutes-DBrTLbUM.js} +1 -1
- package/dist/assets/{BillPayRoutes-yNX-iA8A.js → BillPayRoutes-DXvHcHbk.js} +6 -6
- package/dist/assets/{BusinessVerificationPageScreen-62HLVe0x.js → BusinessVerificationPageScreen-Om0cSThR.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-4QjrMuDm.js → CardsAiCfoScreen-CDZYVA_G.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-JT1ktnG0.js → ChargeCardRoutes-BaEr-4Sf.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-oS2G5pld.js → CompanyPassportScreen-B8wIBTwN.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-Bu06mAoB.js → ConnectionAuthScreen-3rXBpWwe.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-qfvtTE_8.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CI6qRXML.js → CustomerOnboardingRoutes-BSP_x0q_.js} +8 -8
- package/dist/assets/{DashboardRoutes-B-U5mAGm.js → DashboardRoutes-BH2h4M69.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CkLznbI_.js → DefaultTenantHome-533CT5dy.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-Q3vU2bMG.js → DomesticWireDetailScreen-DyCIP-L-.js} +3 -3
- package/dist/assets/DrawerScreen-hmdKhO49.js +1 -0
- package/dist/assets/{EntityDetailRoutes-DgD0rt0Q.js → EntityDetailRoutes-BifybXji.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-CxrDAOUS.js → ExpenseAutomationRoutes-ma2T2i_P.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-BDSQN3lv.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-DTFVUd5Z.js → HubSpotOAuthCallbackScreen-DNmva7H-.js} +1 -1
- package/dist/assets/MagicLinkRoutes-DbkotQYT.js +72 -0
- package/dist/assets/{MagicLinkSignInScreen-CV4klGc6.js → MagicLinkSignInScreen-NQd0hGkj.js} +1 -1
- package/dist/assets/MobileAppDrawer-CpsSMjQ2.js +1 -0
- package/dist/assets/NotFoundScreen-_taUi6Es.js +1 -0
- package/dist/assets/{NotificationRoutes-CkNzEGNi.js → NotificationRoutes-Cu5dkfdj.js} +1 -1
- package/dist/assets/OAuthConsentScreen-D99q8ZiL.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DTEkwhMd.js +1 -0
- package/dist/assets/PeopleRoutes-W5cMaWf6.js +22 -0
- package/dist/assets/PerformanceRoutes-DyHolbpu.js +1 -0
- package/dist/assets/{Preview-DsqB8zvc.js → Preview-DGrNJzmQ.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BscD4kCT.js → QBOConnectionScreen-D8kad0sY.js} +1 -1
- package/dist/assets/ReferralListScreen-BinxYKYV.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-CFc6siNR.js → ReimbursementApprovalRoutes-DUXSVDw2.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C2FMWk-j.js → ReimbursementApprovalRuleDetailScreen-CgGJOA1u.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-D54WJIgE.js → ReimbursementRoutes-BLwsvqh4.js} +1 -1
- package/dist/assets/{ReportsRoutes-BrtJ_-m2.js → ReportsRoutes-kfn77iwu.js} +1 -1
- package/dist/assets/RewardsRoutes-D-idKZz4.js +1 -0
- package/dist/assets/ScreenRoutes-DQbm0Bd3.js +2 -0
- package/dist/assets/{SettingsRoutes-DQ0yh-8g.js → SettingsRoutes-CngnqM2k.js} +7 -7
- package/dist/assets/{SetupPagesScreen-DObnppv9.js → SetupPagesScreen-Bi7ql3Uc.js} +5 -5
- package/dist/assets/SignInScreen-B9F_7T01.js +1 -0
- package/dist/assets/SignOutScreen-5ReTv-2r.js +9 -0
- package/dist/assets/{TaskListScreen-C5nOYLN5.js → TaskListScreen-B92kUrNr.js} +2 -2
- package/dist/assets/{TaskRoutes-BhLal2L_.js → TaskRoutes-CtH7gfhd.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-CiULbGzd.js → TransactionDetailRoutes-CCGKgR5c.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-ByvC4V3o.js → TransactionDetailScreen-DkN9stCC.js} +2 -2
- package/dist/assets/{TransactionListRoutes-DHP_TahM.js → TransactionListRoutes-BPGGfQYb.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CJ_vGeGY.js → TreasuryRoutes-D3yl0U9P.js} +6 -6
- package/dist/assets/{VendorsRoutes-DpGiilRm.js → VendorsRoutes-CSf7xhk-.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-CURrKHsJ.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-Gt73EasM.js → ZeniAccountRoutes-Bvp0Q8q4.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-BrO-jfY4.js → ZeniAccountStatementScreen-BMxfX19s.js} +2 -2
- package/dist/assets/{accountMappingHelper-DpVopnHv.js → accountMappingHelper-Dk_23sfW.js} +1 -1
- package/dist/assets/{analytics-DrcSmo8f.js → analytics-BWMRmW6M.js} +1 -1
- package/dist/assets/{analyticsHelper-JSt5oFi8.js → analyticsHelper-DG9Hj57M.js} +1 -1
- package/dist/assets/{core-C5W8nxR1.js → core-BCzXpSj2.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-B4ofrmT1.js → decodeURIComponentSafe-BaVz5hiZ.js} +1 -1
- package/dist/assets/{dnd-BN-V7BQY.js → dnd-CMRnbWd0.js} +1 -1
- package/dist/assets/{empty-MvieyTY2.js → empty-BKEgBO1f.js} +1 -1
- package/dist/assets/{empty-efGcmHNA.js → empty-Huff3QoR.js} +1 -1
- package/dist/assets/{emptyVideoElement-D22fm1RT.js → emptyVideoElement-C3GRsAmj.js} +1 -1
- package/dist/assets/{epic-C0tR2xX2.js → epic-D2GJzmn7.js} +1 -1
- package/dist/assets/getLocaleForTenant-CJtZ2gVK.js +1 -0
- package/dist/assets/{index-EdDjmZsZ.js → index-BgtDuR7o.js} +2 -2
- package/dist/assets/{index-DCXaVzkG.js → index-D93ptPBX.js} +1 -1
- package/dist/assets/{index-BBxc6qHy.js → index-DD1fRxxW.js} +1 -1
- package/dist/assets/{index-DFbS5Iez.js → index-DnXXSSQr.js} +1 -1
- package/dist/assets/{index-DepVuD4d.js → index-F79NhlWc.js} +1 -1
- package/dist/assets/{index-DhtfwmwQ.js → index-RV1w-9NK.js} +1 -1
- package/dist/assets/{index-zWiSHOLd.js → index-jnJxCrIS.js} +8969 -8899
- package/dist/assets/{index-BKQuSuay.js → index-kgnb8add.js} +1 -1
- package/dist/assets/{lexical-LmEGSncg.js → lexical-CLfce6-g.js} +1 -1
- package/dist/assets/{liveblocks-D7MTBeqB.js → liveblocks-DgQRIsyS.js} +1 -1
- package/dist/assets/{lottie-Bcxhpfzr.js → lottie-D0l9jr5K.js} +1 -1
- package/dist/assets/{mui-CD-lJRrw.js → mui-BU88kzbO.js} +1 -1
- package/dist/assets/{pathToGoBack-C_7fp8nd.js → pathToGoBack-Ct5jhqDD.js} +1 -1
- package/dist/assets/{pdf-BpbLbEAW.js → pdf-DF6S6f8j.js} +3 -3
- package/dist/assets/{pdf-lib-ByihSr1f.js → pdf-lib-f4RyuKvB.js} +1 -1
- package/dist/assets/{plaid-D3pZvM_U.js → plaid-CnRfB1Gp.js} +1 -1
- package/dist/assets/{pusher-AkfuRGDS.js → pusher-CI9cnuX_.js} +1 -1
- package/dist/assets/{react-B6crEeoU.js → react-B17DU2Q8.js} +1 -1
- package/dist/assets/{react-CSTU0nI4.js → react-BkeoZEiD.js} +1 -1
- package/dist/assets/{react-DRz-S9RE.js → react-Df1nu3Jg.js} +1 -1
- package/dist/assets/{react-D8oP0smP.js → react-DjeVbFvw.js} +1 -1
- package/dist/assets/{react-BXOXkMoR.js → react-WN5d6PKR.js} +1 -1
- package/dist/assets/{react-C52QZxfc.js → react-o34Ibe9E.js} +1 -1
- package/dist/assets/{recharts-BnfhYobU.js → recharts-LNNCqKNo.js} +1 -1
- package/dist/assets/{routePaths-DEzJucxI.js → routePaths-BrpCPMmb.js} +1 -1
- package/dist/assets/{sentry-DVVsR48F.js → sentry-BHeH_DOJ.js} +1 -1
- package/dist/assets/{url-BYgELt_H.js → url-BMGD5Vyc.js} +1 -1
- package/dist/assets/{url-DjoTUBiJ.js → url-CvYl_jYF.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CFGGYb9p.js → useAiCfoDashboardSuggestedQuestionsChips-CSP2rs4k.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BjXqzhKq.js +1 -0
- package/dist/assets/useCashManagementBanner-Chf9Io8m.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-D7wpQRE_.js → useChargeCardPusherEvents-a1rzK4fg.js} +1 -1
- package/dist/assets/{useDeviceId-BnrfnzK7.js → useDeviceId-CIiEEeSM.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-lWxckS4M.js → useEmailConnectResultRefresh-KQRYFmno.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-CPcuN5d8.js → useInitialThreadRequest-CIKn9Zyw.js} +1 -1
- package/dist/assets/{utils-fE4-NjiI.js → utils-BOLLxecq.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DL8BhG5u.js → withTransactionSidePanel-ClneTDW0.js} +2 -2
- package/dist/assets/{zeni-epic-state-BDJoMjoR.js → zeni-epic-state-CeMrW02Z.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-Cn4m82VU.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DTabcWxk.js +0 -1
- package/dist/assets/DrawerScreen-CMGdvP71.js +0 -1
- package/dist/assets/FeaturePreviewScreen-B_0uKukg.js +0 -1
- package/dist/assets/MagicLinkRoutes-CzGwkhkX.js +0 -72
- package/dist/assets/MobileAppDrawer-B2FnRj4O.js +0 -1
- package/dist/assets/NotFoundScreen-DIeJhZda.js +0 -1
- package/dist/assets/OAuthConsentScreen-CgMFQ18r.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-H0hB0AgF.js +0 -1
- package/dist/assets/PeopleRoutes-B_g8cfdv.js +0 -22
- package/dist/assets/PerformanceRoutes-MEt6tq7t.js +0 -1
- package/dist/assets/ReferralListScreen-bLo9_GQZ.js +0 -5
- package/dist/assets/RewardsRoutes-C7Z3exkk.js +0 -1
- package/dist/assets/ScreenRoutes-DXjEvmoW.js +0 -2
- package/dist/assets/SignInScreen-CSr-6Z_R.js +0 -1
- package/dist/assets/SignOutScreen-DnThEHBw.js +0 -9
- package/dist/assets/WiseConfirmationScreen-sm6bvEyo.js +0 -12
- package/dist/assets/getLocaleForTenant-B_Il-nCM.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DoAmGuPw.js +0 -1
- package/dist/assets/useCashManagementBanner-HwbKcvlA.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DgQRIsyS.js";import{a as o}from"./sentry-BHeH_DOJ.js";import{j as f,h as F,u as H,g as V,n as K}from"./core-BCzXpSj2.js";import{y as N,K as W,z as P,bg as _,E as M,Z as U,a0 as $,x as q,f as l,h as z,a9 as X,bh as Z}from"./index-jnJxCrIS.js";import{fI as G,eX as J,Pp as R,Pq as Q,vK as Y,vA as g,fK as ee,bS as ae,vF as re,Pr as ne}from"./zeni-epic-state-CeMrW02Z.js";import{D as te,e as se,n as oe,S as ie}from"./mui-BU88kzbO.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-BjXqzhKq.js";import{M as de}from"./MobileAppDrawer-CpsSMjQ2.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]="2966d817-2bc0-42f5-a419-5618d3dfbc0d",e._sentryDebugIdIdentifier="sentry-dbid-2966d817-2bc0-42f5-a419-5618d3dfbc0d")}catch{}})();const ce={overlayWidth:new M(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=N(),n=W();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>G(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(_,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,I="refer-and-earn-status-update",pe=K(function(e){const a=R(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([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(ne({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(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(X(Z));function ye({isReferralDrawerOpen:e}){const a=F(),r=H(),n=V(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,h]=o.useState(!1),p=P.getSignedInUser(),C=f(t=>J(t)),v=f(t=>R(t)),b=v.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),m=Q([v,w]),{areTenantIdsInSync:c}=U();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(Y()),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(ee(!0)))},[w,r,c]),o.useEffect(()=>{h(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),y=t=>{A(t)},{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=le({mobileExploreReferrer:"Rewards"});$({isDataReady:m===!0});const O={events:p?.userId!=null?[`private-encrypted-${p.userId}.${I}`]:[],eventCallback:(t,S,L)=>{L.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[m===!0?s.jsx(q,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(z.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:y}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{h(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...O})]})}export{ye as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-DgQRIsyS.js";import O from"./NotFoundScreen-_taUi6Es.js";import{a as p}from"./sentry-BHeH_DOJ.js";import{h as A,g as x,u as C,j as u,N as D,n as k,o as W,p as g}from"./core-BCzXpSj2.js";import{eX as E,Qj as b,Qz as S,FF as V,EO as U,FE as d,Fv as $,QM as B,FH as _}from"./zeni-epic-state-CeMrW02Z.js";import{z as N,a9 as L,b$ as Q,ag as T,bE as z,c0 as H}from"./index-jnJxCrIS.js";import"./mui-BU88kzbO.js";import{u as K,R as I}from"./ReimbursementApprovalRuleDetailScreen-CgGJOA1u.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="a1723cb0-164c-4fd8-856a-69a2e5e3e559",e._sentryDebugIdIdentifier="sentry-dbid-a1723cb0-164c-4fd8-856a-69a2e5e3e559")}catch{}})();const y="reimbursement-approval-rule-update",M=k(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(L(Q)),X=({isLoading:e})=>{const o=A(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>E(a)),c=u(a=>b(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,F,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(M,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",q=k(function(e){const o=b(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(_(t,!0))}}})(L(H)),G=()=>{const e=u(n=>E(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=z(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(X,{isLoading:s})},J=({isLoading:e})=>{const o=A(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>E(a)),c=u(a=>b(a));K();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(V())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,F,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(W,{children:[r.jsx(g,{path:"/",element:r.jsx(G,{})}),r.jsx(g,{path:"/new",element:r.jsx(I,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(I,{})}),r.jsx(g,{path:"*",element:r.jsx(O,{})})]})}export{oe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-DgQRIsyS.js";import{a as f}from"./sentry-BHeH_DOJ.js";import{u as T,j as g,h as _,g as O,i as F,n as k}from"./core-BCzXpSj2.js";import{kZ as Q,Qz as w,Qj as U,Fy as V,FK as B,FF as A,FG as E,QA as j,eX as z,FE as K}from"./zeni-epic-state-CeMrW02Z.js";import{z as N,y as P,B as $,bR as G,ag as q,bE as W,bS as X}from"./index-jnJxCrIS.js";import"./mui-BU88kzbO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="cf6a2b7b-b5b2-46ff-911a-a0af2f401f65",e._sentryDebugIdIdentifier="sentry-dbid-cf6a2b7b-b5b2-46ff-911a-a0af2f401f65")}catch{}})();function Z(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Q({})))},[p,t,e])}const H=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const R=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=R.concat(I);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(G);function J(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=N.getSignedInUser(),l=P(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const M=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,x=y.selectedRole?.selectedOption;let D=[];S==="role"&&x!=null?D=[{type:"attribute",subType:x,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(L=>({type:"user",subType:void 0,userId:L.userId,idType:"user",isImplicitActor:!1})));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(X);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?b.jsx(Y,{}):b.jsx(J,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=N.getSignedInUser(),l=P(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(Z(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,Z as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-D7MTBeqB.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as q,l as mt,o as ct,p as C}from"./core-C5W8nxR1.js";import{eX as H,QN as ue,c6 as pe,EJ as De,kI as dt,EW as oe,EV as re,QO as ut,bn as be,gp as Ue,QP as pt,Na as bt,kx as Le,Nb as Ae,Nc as gt,js as ht,Q5 as ft,jH as St,Ex as It,ub as Rt,jz as yt,Fh as Pe,QQ as $e,QR as At,QS as kt,QT as vt,QU as Ct,QV as Et,F1 as ke,jN as wt,Qe as xt,EX as Bt,EH as Tt,QW as jt,EG as Ft,QX as Dt,EP as ve,F5 as Ut,F4 as Lt,F0 as Pt,QY as Me,Kg as $t,bq as Mt,ES as _t,Fz as Nt,QZ as Ot,Q_ as zt,Fd as Gt,Fa as Ce,PA as Qt,EE as Zt,Q$ as _e,F$ as Ee,G7 as Ht,R0 as Vt,R1 as G,R2 as Wt,R3 as Ne,R4 as qt,R5 as Oe,R6 as ze,Fp as le,bu as Jt,bK as ge,cG as he,fE as Ge,fC as Qe,R7 as Kt,fz as Xt,PN as Yt,R8 as en,R9 as Ze,PR as tn,Qz as nn,Ra as an,QM as sn,G4 as we,G3 as on,Rb as rn,Rc as ln,Rd as mn,Re as cn,Rf as dn,Qk as un,FW as pn,F_ as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,L_ as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-BDJoMjoR.js";import{F as He,K as Ve,C as ee,U as E,z as $,c1 as We,w as te,e as k,aM as xe,o as F,au as X,G as Cn,a as qe,c2 as En,q as Q,a0 as Je,c3 as wn,I as ne,c4 as xn,Z as Bn,D as Tn,B as fe,g as Ke,a9 as jn,bp as Fn,a4 as Dn,y as Xe,c5 as Un,i as Ln}from"./index-zWiSHOLd.js";import{n as N,S as Pn}from"./mui-CD-lJRrw.js";import me from"./NotFoundScreen-DIeJhZda.js";import{S as Be}from"./SetupPagesScreen-DObnppv9.js";import{F as Ye}from"./FeaturePreviewScreen-B_0uKukg.js";import{a as f}from"./sentry-DVVsR48F.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DoAmGuPw.js";import{u as et}from"./useInitialThreadRequest-CPcuN5d8.js";import{D as $n}from"./DrawerScreen-CMGdvP71.js";import{M as tt}from"./MobileAppDrawer-B2FnRj4O.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CFc6siNR.js";import{FallBackRoute as _n}from"./ScreenRoutes-DXjEvmoW.js";import"./recharts-BnfhYobU.js";import"./analytics-DrcSmo8f.js";import"./plaid-D3pZvM_U.js";import"./dnd-BN-V7BQY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bcxhpfzr.js";import"./lexical-LmEGSncg.js";import"./pdf-BpbLbEAW.js";import"./utils-fE4-NjiI.js";import"./analyticsHelper-JSt5oFi8.js";import"./routePaths-DEzJucxI.js";import"./BusinessVerificationPageScreen-62HLVe0x.js";import"./ReimbursementApprovalRuleDetailScreen-C2FMWk-j.js";import"./getLocaleForTenant-B_Il-nCM.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]="a49f8d01-b716-4556-aba6-acfa495b86a3",e._sentryDebugIdIdentifier="sentry-dbid-a49f8d01-b716-4556-aba6-acfa495b86a3")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=qe.getLocalizedStrings(),On=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=Q(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=$.getSignedInUser(),I=w(p=>H(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(De(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-DgQRIsyS.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as q,l as mt,o as ct,p as C}from"./core-BCzXpSj2.js";import{eX as H,QN as ue,c6 as pe,EJ as De,kI as dt,EW as oe,EV as re,QO as ut,bn as be,gp as Ue,QP as pt,Na as bt,kx as Le,Nb as Ae,Nc as gt,js as ht,Q5 as ft,jH as St,Ex as It,ub as Rt,jz as yt,Fh as Pe,QQ as $e,QR as At,QS as kt,QT as vt,QU as Ct,QV as Et,F1 as ke,jN as wt,Qe as xt,EX as Bt,EH as Tt,QW as jt,EG as Ft,QX as Dt,EP as ve,F5 as Ut,F4 as Lt,F0 as Pt,QY as Me,Kg as $t,bq as Mt,ES as _t,Fz as Nt,QZ as Ot,Q_ as zt,Fd as Gt,Fa as Ce,PA as Qt,EE as Zt,Q$ as _e,F$ as Ee,G7 as Ht,R0 as Vt,R1 as G,R2 as Wt,R3 as Ne,R4 as qt,R5 as Oe,R6 as ze,Fp as le,bu as Jt,bK as ge,cG as he,fE as Ge,fC as Qe,R7 as Kt,fz as Xt,PN as Yt,R8 as en,R9 as Ze,PR as tn,Qz as nn,Ra as an,QM as sn,G4 as we,G3 as on,Rb as rn,Rc as ln,Rd as mn,Re as cn,Rf as dn,Qk as un,FW as pn,F_ as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,L_ as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-CeMrW02Z.js";import{N as He,K as Ve,C as ee,G as E,z as $,c1 as We,x as te,f as k,aM as xe,o as F,au as X,H as Cn,a as qe,c2 as En,r as Q,a0 as Je,c3 as wn,I as ne,c4 as xn,Z as Bn,E as Tn,B as fe,h as Ke,a9 as jn,bp as Fn,a4 as Dn,y as Xe,c5 as Un,i as Ln}from"./index-jnJxCrIS.js";import{n as N,S as Pn}from"./mui-BU88kzbO.js";import me from"./NotFoundScreen-_taUi6Es.js";import{S as Be}from"./SetupPagesScreen-Bi7ql3Uc.js";import{F as Ye}from"./FeaturePreviewScreen-BDSQN3lv.js";import{a as f}from"./sentry-BHeH_DOJ.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-BjXqzhKq.js";import{u as et}from"./useInitialThreadRequest-CIKn9Zyw.js";import{D as $n}from"./DrawerScreen-hmdKhO49.js";import{M as tt}from"./MobileAppDrawer-CpsSMjQ2.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DUXSVDw2.js";import{FallBackRoute as _n}from"./ScreenRoutes-DQbm0Bd3.js";import"./recharts-LNNCqKNo.js";import"./analytics-BWMRmW6M.js";import"./plaid-CnRfB1Gp.js";import"./dnd-CMRnbWd0.js";import"./stripe-DMRn4zHo.js";import"./lottie-D0l9jr5K.js";import"./lexical-CLfce6-g.js";import"./pdf-DF6S6f8j.js";import"./utils-BOLLxecq.js";import"./analyticsHelper-DG9Hj57M.js";import"./routePaths-BrpCPMmb.js";import"./BusinessVerificationPageScreen-Om0cSThR.js";import"./ReimbursementApprovalRuleDetailScreen-CgGJOA1u.js";import"./getLocaleForTenant-CJtZ2gVK.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]="2ec5d789-7df5-46e8-8fa5-b0bf3ad448ea",e._sentryDebugIdIdentifier="sentry-dbid-2ec5d789-7df5-46e8-8fa5-b0bf3ad448ea")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=qe.getLocalizedStrings(),On=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=Q(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=$.getSignedInUser(),I=w(p=>H(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(De(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-D7MTBeqB.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-C5W8nxR1.js";import{eX as L,fT as w,Mr as Te,kx as J,qR as Q,rG as A,kl as Re,jp as Me,ve as W,rL as Oe,bs as Ae,Ms as Fe,bn as ke,wn as De,Mt as Ee,Mu as je,v6 as Pe,Mv as H,Mw as Le,Mx as ve,My as Be,Mz as Ue,MA as I,MB as F,MC as k,MD as N,ME as D,MF as E,dK as Ve,w3 as xe,vT as q,vU as $,w9 as ze,vY as K,wf as Ge,MG as Ye,MH as He,MI as Ne,MJ as qe,MK as $e,fE as Ke,fC as Ze}from"./zeni-epic-state-BDJoMjoR.js";import{R as Xe,T as Je,X as Qe,Y as We,K as ea,C as ee,U as j,z as ae,Z as aa,I as sa,c as ta,$ as oa,a0 as na,w as ra,e as P,g as ia,a1 as la,q as se,a2 as ca,a3 as da,a4 as pa}from"./index-zWiSHOLd.js";import"./mui-CD-lJRrw.js";import fa from"./NotFoundScreen-DIeJhZda.js";import{F as ma}from"./FeaturePreviewScreen-B_0uKukg.js";import{a as _}from"./sentry-DVVsR48F.js";import{u as ua}from"./useInitialThreadRequest-CPcuN5d8.js";import{t as Z,a as X,b as _a}from"./routePaths-DEzJucxI.js";import{M as ha}from"./MobileAppDrawer-B2FnRj4O.js";import"./recharts-BnfhYobU.js";import"./analytics-DrcSmo8f.js";import"./plaid-D3pZvM_U.js";import"./dnd-BN-V7BQY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bcxhpfzr.js";import"./lexical-LmEGSncg.js";import"./pdf-BpbLbEAW.js";import"./utils-fE4-NjiI.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d16b4f14-0a34-446a-994c-f2b259457795",e._sentryDebugIdIdentifier="sentry-dbid-d16b4f14-0a34-446a-994c-f2b259457795")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:Q(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(K(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),U=d(n=>J(n)),M=d(n=>Q(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!v&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,v,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Ae(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Qe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(ga,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
1
|
+
import{j as p}from"./liveblocks-DgQRIsyS.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-BCzXpSj2.js";import{eX as L,fT as w,Mr as Te,kx as J,qR as X,rG as A,kl as Re,jp as Me,ve as W,rL as Oe,bs as Ae,Ms as Fe,bn as ke,wn as De,Mt as Ee,Mu as je,v6 as Pe,Mv as H,Mw as Le,Mx as ve,My as Be,Mz as Ve,MA as I,MB as F,MC as k,MD as N,ME as D,MF as E,dK as xe,w3 as Ue,vT as $,vU as q,w9 as ze,vY as K,wf as Ge,MG as Ye,MH as He,MI as Ne,MJ as $e,MK as qe,fE as Ke,fC as Ze}from"./zeni-epic-state-CeMrW02Z.js";import{Q as Qe,T as Je,V as Xe,Y as We,K as ea,C as ee,G as j,z as ae,Z as aa,I as sa,c as ta,$ as oa,a0 as na,x as ra,f as P,h as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-jnJxCrIS.js";import"./mui-BU88kzbO.js";import fa from"./NotFoundScreen-_taUi6Es.js";import{F as ma}from"./FeaturePreviewScreen-BDSQN3lv.js";import{a as _}from"./sentry-BHeH_DOJ.js";import{u as ua}from"./useInitialThreadRequest-CIKn9Zyw.js";import{t as Z,a as Q,b as _a}from"./routePaths-BrpCPMmb.js";import{M as ha}from"./MobileAppDrawer-CpsSMjQ2.js";import"./recharts-LNNCqKNo.js";import"./analytics-BWMRmW6M.js";import"./plaid-CnRfB1Gp.js";import"./dnd-CMRnbWd0.js";import"./stripe-DMRn4zHo.js";import"./lottie-D0l9jr5K.js";import"./lexical-CLfce6-g.js";import"./pdf-DF6S6f8j.js";import"./utils-BOLLxecq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="da0af043-7a1d-4caa-98bf-0d923be21f93",e._sentryDebugIdIdentifier="sentry-dbid-da0af043-7a1d-4caa-98bf-0d923be21f93")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e($e()),e(qe())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(K(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=xe(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!v&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,v,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const x=sa(),de=x?.loggedInUserRole!=null&&Ae(x?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),U=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Qe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(ga,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DgQRIsyS.js";import{C as j,z as w,aS as b,x as E,f as p,h as F,d9 as P,G as T}from"./index-jnJxCrIS.js";import"./mui-BU88kzbO.js";import m from"./NotFoundScreen-_taUi6Es.js";import{a as f}from"./sentry-BHeH_DOJ.js";import{u as L,j as y,h as V,g as A,n as R,o as U,p as u}from"./core-BCzXpSj2.js";import{eX as z,TF as C,P_ as G,TG as _,vK as K,fK as Y,TH as H,vI as O}from"./zeni-epic-state-CeMrW02Z.js";import{R as x}from"./ReferralListScreen-BinxYKYV.js";import"./recharts-LNNCqKNo.js";import"./analytics-BWMRmW6M.js";import"./plaid-CnRfB1Gp.js";import"./dnd-CMRnbWd0.js";import"./stripe-DMRn4zHo.js";import"./lottie-D0l9jr5K.js";import"./lexical-CLfce6-g.js";import"./pdf-DF6S6f8j.js";import"./utils-BOLLxecq.js";import"./useAskAiCfoHostNavButtonProps-BjXqzhKq.js";import"./MobileAppDrawer-CpsSMjQ2.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]="fcb1f77e-e69e-4590-9c4b-daeb7fb54606",e._sentryDebugIdIdentifier="sentry-dbid-fcb1f77e-e69e-4590-9c4b-daeb7fb54606")}catch{}})();const X=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(_()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const e=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=y(o=>z(o)),c=V(),v=A(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=y(o=>C(o)),D=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:S}=g(b.zeniAccountsConfig),k=G(S);f.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(K()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))},[l.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(X,{navigate:c,location:v,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(m,{})}),a.jsx(u,{path:"*",element:a.jsx(m,{})})]})}export{ue as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BH2h4M69.js","assets/sentry-BHeH_DOJ.js","assets/core-BCzXpSj2.js","assets/zeni-epic-state-CeMrW02Z.js","assets/index-jnJxCrIS.js","assets/mui-BU88kzbO.js","assets/analytics-BWMRmW6M.js","assets/utils-BOLLxecq.js","assets/withTransactionSidePanel-ClneTDW0.js","assets/useAskAiCfoHostNavButtonProps-BjXqzhKq.js","assets/TransactionDetailScreen-DkN9stCC.js","assets/decodeURIComponentSafe-BaVz5hiZ.js","assets/routePaths-BrpCPMmb.js","assets/NotFoundScreen-_taUi6Es.js","assets/useInitialThreadRequest-CIKn9Zyw.js","assets/analyticsHelper-DG9Hj57M.js","assets/CompanyPassportScreen-B8wIBTwN.js","assets/MobileAppDrawer-CpsSMjQ2.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CSP2rs4k.js","assets/FeaturePreviewScreen-BDSQN3lv.js","assets/ReferralListScreen-BinxYKYV.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-DXvHcHbk.js","assets/AddressScreen-DT4aul98.js","assets/DomesticWireDetailScreen-DyCIP-L-.js","assets/DrawerScreen-hmdKhO49.js","assets/SetupPagesScreen-Bi7ql3Uc.js","assets/BusinessVerificationPageScreen-Om0cSThR.js","assets/BillPayApprovalRoutes-DBrTLbUM.js","assets/ReimbursementApprovalRuleDetailScreen-CgGJOA1u.js","assets/getLocaleForTenant-CJtZ2gVK.js","assets/ReimbursementRoutes-BLwsvqh4.js","assets/ReimbursementApprovalRoutes-DUXSVDw2.js","assets/TransactionListRoutes-BPGGfQYb.js","assets/ZeniAccountStatementScreen-BMxfX19s.js","assets/SettingsRoutes-CngnqM2k.js","assets/accountMappingHelper-Dk_23sfW.js","assets/useEmailConnectResultRefresh-KQRYFmno.js","assets/QBOConnectionScreen-D8kad0sY.js","assets/empty-Huff3QoR.js","assets/index-kgnb8add.js","assets/url-CvYl_jYF.js","assets/index-RV1w-9NK.js","assets/ReportsRoutes-kfn77iwu.js","assets/ChargeCardRoutes-BaEr-4Sf.js","assets/useChargeCardPusherEvents-a1rzK4fg.js","assets/PeopleRoutes-W5cMaWf6.js","assets/ExpenseAutomationRoutes-ma2T2i_P.js","assets/TreasuryRoutes-D3yl0U9P.js","assets/useCashManagementBanner-Chf9Io8m.js","assets/VendorsRoutes-CSf7xhk-.js","assets/pathToGoBack-Ct5jhqDD.js","assets/ZeniAccountRoutes-Bvp0Q8q4.js","assets/AddressRoutes-pUo9c-tv.js","assets/PandLWithForecastRoutes-DTEkwhMd.js","assets/CustomerOnboardingRoutes-BSP_x0q_.js","assets/TransactionDetailRoutes-CCGKgR5c.js","assets/EntityDetailRoutes-BifybXji.js","assets/NotificationRoutes-Cu5dkfdj.js","assets/PerformanceRoutes-DyHolbpu.js","assets/RewardsRoutes-D-idKZz4.js","assets/TaskRoutes-CtH7gfhd.js","assets/TaskListScreen-B92kUrNr.js","assets/AiCfoScreen-BhF2jfJu.js","assets/CardsAiCfoScreen-CDZYVA_G.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as ls,eX as us,fE as ds,fC as cs,gk as ms,fr as _s,cU as pe,cA as hs,fU as Es,cs as ps,bE as Rs,bo as xs,fY as gs,v as Is,LZ as js,bs as Ts,L_ as As,bK as fs,bJ as Ds,bt as ys,co as bs,L$ as Cs,M0 as vs,cQ as Us,cT as ws,cS as Os,cz as Ps,cG as Fs,o9 as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as je,g1 as ks}from"./zeni-epic-state-CeMrW02Z.js";import{j as e}from"./liveblocks-DgQRIsyS.js";import{a as O}from"./sentry-BHeH_DOJ.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as Te,N as u,o as Ns,p as a}from"./core-BCzXpSj2.js";import{y as Zs,u as Ms,z as D,C as Gs,c as zs,d as $s,G as z,i as Ys,e as Ws,I as qs,L as F,a as Ae,t as _,P as Js,f as X,l}from"./index-jnJxCrIS.js";import"./mui-BU88kzbO.js";import{f as fe}from"./analyticsHelper-DG9Hj57M.js";import{t as Ks}from"./getLocaleForTenant-CJtZ2gVK.js";import"./recharts-LNNCqKNo.js";import"./analytics-BWMRmW6M.js";import"./plaid-CnRfB1Gp.js";import"./dnd-CMRnbWd0.js";import"./stripe-DMRn4zHo.js";import"./lottie-D0l9jr5K.js";import"./lexical-CLfce6-g.js";import"./pdf-DF6S6f8j.js";import"./utils-BOLLxecq.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]="64eea991-e84e-4fd9-bd7a-9249fdf4b461",o._sentryDebugIdIdentifier="sentry-dbid-64eea991-e84e-4fd9-bd7a-9249fdf4b461")}catch{}})();const Qs={dashboard:()=>t(()=>import("./DashboardRoutes-BH2h4M69.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t(()=>import("./BillPayRoutes-DXvHcHbk.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t(()=>import("./ReimbursementRoutes-BLwsvqh4.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t(()=>import("./TransactionListRoutes-BPGGfQYb.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t(()=>import("./SettingsRoutes-CngnqM2k.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t(()=>import("./ReportsRoutes-kfn77iwu.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t(()=>import("./ChargeCardRoutes-BaEr-4Sf.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t(()=>import("./PeopleRoutes-W5cMaWf6.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-ma2T2i_P.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t(()=>import("./TreasuryRoutes-D3yl0U9P.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t(()=>import("./VendorsRoutes-CSf7xhk-.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t(()=>import("./ZeniAccountRoutes-Bvp0Q8q4.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l(()=>t(()=>import("./ReportsRoutes-kfn77iwu.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),st=l(()=>t(()=>import("./AddressRoutes-pUo9c-tv.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),tt=l(()=>t(()=>import("./PeopleRoutes-W5cMaWf6.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),nt=l(()=>t(()=>import("./PandLWithForecastRoutes-DTEkwhMd.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),at=l(()=>t(()=>import("./CustomerOnboardingRoutes-BSP_x0q_.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),ot=l(()=>t(()=>import("./VendorsRoutes-CSf7xhk-.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),rt=l(()=>t(()=>import("./TransactionDetailRoutes-CCGKgR5c.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>t(()=>import("./EntityDetailRoutes-BifybXji.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),it=l(()=>t(()=>import("./DashboardRoutes-BH2h4M69.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),ye=l(()=>t(()=>import("./BillPayRoutes-DXvHcHbk.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),lt=l(()=>t(()=>import("./SettingsRoutes-CngnqM2k.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),be=l(()=>t(()=>import("./ReimbursementRoutes-BLwsvqh4.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ut=l(()=>t(()=>import("./ZeniAccountRoutes-Bvp0Q8q4.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),dt=l(()=>t(()=>import("./TreasuryRoutes-D3yl0U9P.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ct=l(()=>t(()=>import("./TransactionListRoutes-BPGGfQYb.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),mt=l(()=>t(()=>import("./ChargeCardRoutes-BaEr-4Sf.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),_t=l(()=>t(()=>import("./NotificationRoutes-Cu5dkfdj.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ht=l(()=>t(()=>import("./PerformanceRoutes-DyHolbpu.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),Et=l(()=>t(()=>import("./ExpenseAutomationRoutes-ma2T2i_P.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pt=l(()=>t(()=>import("./RewardsRoutes-D-idKZz4.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),Rt=l(()=>t(()=>import("./TaskRoutes-CtH7gfhd.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),xt=l(()=>t(()=>import("./AiCfoScreen-BhF2jfJu.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-CDZYVA_G.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),b=l(()=>t(()=>import("./NotFoundScreen-_taUi6Es.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gt=l(()=>t(()=>import("./TaskListScreen-B92kUrNr.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function St({setTenantEmailDomain:o}){const T=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G(n=>us(n)),{useFeatureGate:N}=Gs(),Z=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G(n=>n.tenantState.fetchState),j=G(n=>n.tenantState.activeTenantFetchState.fetchState),h=j==="Completed"||A==="Completed"?ds(ne,r):void 0,J=j==="Completed"||A==="Completed"?cs(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G(n=>ms(n));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(n=>M.tenantId!=null?Es(n,M.tenantId):void 0);O.useEffect(()=>{U(F.TENANT_FETCHING),o(i)},[i]),O.useEffect(()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}},[Q,v]),O.useEffect(()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(M,I,T,Me))},[M,ae,I,T,D]),O.useEffect(()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){H(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)));if(W){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}}(A,j,r,v,I,U,T))},[v,j]),O.useEffect(()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,Y.tenantsBaseInOrder))},[Y,A,r,I]),O.useEffect(()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())},[j,A,v,V]);const ie=O.useRef(!1);O.useEffect(()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,function(n=Xs,f=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},f)}())},[j,V]);const w=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&ys(E?.loggedInUserRoleMap),Qe=_e&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||Ye===!0||Xe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(Tt,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(b,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-DgQRIsyS.js";import{a as u}from"./sentry-BHeH_DOJ.js";import{h as L,g as Q,u as U,j as S,s as re,n as Z,i as H,o as ne,p as v}from"./core-BCzXpSj2.js";import{bn as De,eX as P,gp as Me,m$ as le,Oi as Te,hF as he,O9 as Ue,qR as _e,kx as be,mX as Re,hH as Be,Ob as Fe,Oa as Oe,QB as Ve,zl as ze,EO as Le,Qa as Ne,Qj as $e,c6 as ae,cL as Qe,cM as Ze,bs as He,Ma as Ge,xN as Ke,QC as Xe,Hd as qe,Eu as Je,El as Se,Ei as Ye,xR as ye,Eo as Ce,Er as Ie,Ex as oe,ub as se,xQ as We,k9 as J,kc as Ee,QD as en,ld as nn,y4 as tn,N1 as an,N2 as on,k7 as sn,QE as cn,ka as rn,rj as ln,MY as dn,MZ as un,rn as pn,hq as gn,Mi as ee,hi as de,hf as mn,hn as fn,Mj as hn,y1 as bn,QF as Sn,QG as yn,EL as Cn,fC as Ae,fE as xe,QH as In,gd as En,Ms as An,y0 as ue,gi as pe,gh as xn,x$ as vn,gg as wn,gf as kn,QI as jn,fH as ve,QJ as Pn,QK as Dn,y7 as Mn,x_ as ge,QL as Tn,fX as Un,xX as _n,bZ as Rn,c5 as Bn,c4 as Fn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-CeMrW02Z.js";import{C as Y,G as O,z as k,ag as we,bT as Qn,f as G,h as Zn,bE as Hn,I as K,B as ie,bU as Gn,i as ke,e as je,bV as Kn,ar as Xn,m as Pe,bW as qn,bX as Jn,bY as Yn,Z as Wn,bZ as et,r as nt,b_ as tt}from"./index-jnJxCrIS.js";import{n as V}from"./mui-BU88kzbO.js";import{M as B}from"./MobileAppDrawer-CpsSMjQ2.js";import{a as X,g as q,m as at}from"./accountMappingHelper-Dk_23sfW.js";import{t as ot,A as st}from"./AddressScreen-DT4aul98.js";import $ from"./NotFoundScreen-_taUi6Es.js";import{g as it}from"./analyticsHelper-DG9Hj57M.js";import{B as ct}from"./BusinessVerificationPageScreen-Om0cSThR.js";import{C as rt}from"./CompanyPassportScreen-B8wIBTwN.js";import{u as lt,a as dt}from"./useEmailConnectResultRefresh-KQRYFmno.js";import{q as me}from"./QBOConnectionScreen-D8kad0sY.js";import{B as ut}from"./BillPayApprovalRoutes-DBrTLbUM.js";import{R as pt}from"./ReimbursementApprovalRoutes-DUXSVDw2.js";import"./recharts-LNNCqKNo.js";import"./analytics-BWMRmW6M.js";import"./plaid-CnRfB1Gp.js";import"./dnd-CMRnbWd0.js";import"./stripe-DMRn4zHo.js";import"./lottie-D0l9jr5K.js";import"./lexical-CLfce6-g.js";import"./pdf-DF6S6f8j.js";import"./utils-BOLLxecq.js";import"./routePaths-BrpCPMmb.js";import"./empty-Huff3QoR.js";import"./pdf-lib-f4RyuKvB.js";import"./index-kgnb8add.js";import"./url-CvYl_jYF.js";import"./index-RV1w-9NK.js";import"./decodeURIComponentSafe-BaVz5hiZ.js";import"./ReimbursementApprovalRuleDetailScreen-CgGJOA1u.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]="f1b087df-8db7-416d-a708-2f6d473553a7",e._sentryDebugIdIdentifier="sentry-dbid-f1b087df-8db7-416d-a708-2f6d473553a7")}catch{}})();const gt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-D7MTBeqB.js";import{a as u}from"./sentry-DVVsR48
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,mt=Z(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:
|
|
9
|
+
`,mt=Z(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:r}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:l}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:A}=m,{bankAccount:h,expenseCategory1099:E}=f,_=X(a.accountMappingView.incomeAccountList,y.selectedOption),M=X(a.accountMappingView.expenseAccountList,g.selectedOption),x=X(a.accountMappingView.billPayAccountList,l.selectedOption),R=X(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),F=q(a.accountMappingView.accruedExpensesAccountList,A.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,E),T={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:R?.accountId,selectedPrepaidExpensesAccountIds:D.map(j=>j.accountId),selectedFixedAssetsAccountIds:N.map(j=>j.accountId),selectedAccruedExpensesAccountIds:F.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:d.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Fe())):e(he())},onSaveClick:()=>{e(Be()),r&&G.track(Zn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Re(a.currentTenant.companyId,n))}}})(Qn),ft=()=>{const e=L(),a=Q(),s=U(),{useFeatureGate:c,useDynamicConfig:r}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=r("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),y=De(f),g=S(d=>P(d)),{capitalizableAccounts:l,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=S(d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,j=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}},re),A=u.useCallback((d,C)=>{s(le(g.companyId,d,C))},[s,g.companyId]),h=u.useCallback(d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[j,W]=T[0]??[];j!=null&&s(le(g.companyId,j,W,void 0,Object.keys(C).length>0?C:null))},[s,g.companyId,b]),E=S(d=>Te(d.accountState),re),_=u.useMemo(()=>{const d={};for(const C of E)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d},[E]),[M,x]=u.useState(!1),[R,D]=u.useState(!1);u.useEffect(()=>{M===!1&&(s(he()),x(!0))},[M]);const N=S(d=>Ue(d)),F=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(B,{isAppContentDrawerOpen:R,handleDrawerToggle:F}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:l,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:A,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>F(!0)})]})},ht=V.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-D7MTBeqB.js";import{a as u}from"./sentry-DVVsR48
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,bt=Z(function(e,a){const s=P(e),c=Ne(e),
|
|
17
|
+
`,bt=Z(function(e,a){const s=P(e),c=Ne(e),r=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:r,analytics:G}},function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),St=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=H(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(E=>P(E)),y=S(E=>E.billPaySetupApproverViewState.fetchState),g=S(E=>E.remiSetupApproverViewState.fetchState),l=S(E=>Ve(E)),{isApprovalRulesV3Enabled:b,isLoading:I}=Hn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const A=K();u.useEffect(()=>{p||y!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))},[p,y,I,b,s]),u.useEffect(()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))},[t,g,I,b,s]);const h=E=>{n(E)};return A?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(B,{isAppContentDrawerOpen:r,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:A.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:l.fetchState})},yt=V.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-D7MTBeqB.js";import{a as u}from"./sentry-DVVsR48
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=Z(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:
|
|
25
|
+
`,Ct=Z(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Xe(e,s,n,t,c,r,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,r,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(ye(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?Se(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Je(r,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),It=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=H(),r=K(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,y]=u.useState(!1),g=S(D=>P(D)),l=S(D=>D.settingsViewState.bankConnection.fetchState),b=Qe(g,r?.loggedInUserRoleMap),I=Ze(g,r?.loggedInUserRoleMap),w=g?.userRole!=null&&He(g.userRole),A=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,E=ke(g,t,i),_=Ge(g,r?.loggedInUserRoleMap)&&E,{isCardsHidden:M}=je(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{f||l==="Completed"||(y(!0),s(Ke(!1)))},[f,s,l]);const R=D=>{m(D)};return b||A||I||_?o.jsxs(yt,{children:[o.jsx(B,{isAppContentDrawerOpen:p,handleDrawerToggle:R}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:A,isChargeCardEnabled:_,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{R(!0)}})]}):o.jsx($,{})},Et=V.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-D7MTBeqB.js";import{a as u}from"./sentry-DVVsR48
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,At=Z(function(e,a){const{companyId:s}=a,c=P(e),
|
|
33
|
+
`,At=Z(function(e,a){const{companyId:s}=a,c=P(e),r=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ye("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(Se(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ee(n))},handleConfirmCardSetupIntent:n=>{e(rn(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(J())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(qn),xt=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=H(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(h=>P(h)),y=S(h=>h.cardPaymentViewState),g=S(h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Xn(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=K();u.useEffect(()=>{I!=null&&s(We(I,!1))},[I,s]),u.useEffect(()=>{t||(i(!0),s(J()))},[t,s]),u.useEffect(()=>{p||(Ee(["card"]),m(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&b==="Completed"&&s(J())},[l,b]);const A=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(Et,{children:[o.jsx(B,{isAppContentDrawerOpen:r,handleDrawerToggle:A}),o.jsx(At,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{A(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=Z(function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="chargebee")?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="hubspot")?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,r))}}})(Jn),wt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=H();lt();const[c,r]=u.useState(!1),n=S(h=>h.tenantState.fetchState),t=S(h=>P(h)),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect(()=>{a(ln(te))},[a]);const[y,g]=u.useState(!1);u.useEffect(()=>{y||(g(!0),a(J()))},[y,a]);const l=h=>{r(h)},b=S(h=>dn(h,i)),I=S(h=>h.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:w,onAddPlaidAccount:A}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(B,{isAppContentDrawerOpen:c,handleDrawerToggle:l}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{l(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([h,E])=>[h,E?.message])),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:A,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-D7MTBeqB.js";import{a as u}from"./sentry-DVVsR48
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,Pt=()=>{const e=U(),{tenantEmailDomain:a}=H(),[s,c]=u.useState(!1),
|
|
49
|
+
`,Pt=()=>{const e=U(),{tenantEmailDomain:a}=H(),[s,c]=u.useState(!1),r=S(l=>P(l)).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=S(l=>Sn(l,n.userId)),i=S(l=>yn(l,r,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=i,m=l=>{c(l)},f=u.useCallback(l=>{e(se("user_reimbursement_account",l))},[]),y=u.useCallback(l=>{e(oe(l,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))},[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(B,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:y,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-D7MTBeqB.js";import{a as u}from"./sentry-DVVsR48
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,fe=({appContent:e})=>{const a=U(),s=L(),c=Q(),[
|
|
57
|
+
`,fe=({appContent:e})=>{const a=U(),s=L(),c=Q(),[r,n]=u.useState(!1),t=S(d=>P(d)),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),l=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=S(d=>be(d)),I=Ae(t),w=xe(g,t),A=!w&&b,h=ke(t,y,g),{isCardsHidden:E}=je(t?.tenantId),_=!h||E,{areTenantIdsInSync:M}=Wn();u.useEffect(()=>{M&&a(In(p,A))},[p,a,A,M]);const x=S(d=>En(d,A)),R=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=An(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,F=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(B,{isAppContentDrawerOpen:r,handleDrawerToggle:F}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:l===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{F(!0)},isLoading:R,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=function(j,W){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${W}`),z}(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=U(),a=S(l=>P(l)).companyId,s=S(l=>jn(l)),c=S(l=>ve(l)),r=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback(l=>{t(l)},[]),p=u.useCallback(l=>{e(Pn(l))},[]),m=u.useCallback(()=>{r?.userEmail!=null&&e(Dn({loggedInUserEmail:r.userEmail}))},[r?.userEmail]),f=u.useCallback(()=>{e(Mn())},[]);if(r==null)throw Error("Can't access Notification Settings page without signing in...");const y=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(Tn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))}},[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(B,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:r,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=S(l=>ve(l)),r=S(l=>P(l)),n=K(),t=k.getSignedInUser(),i=U(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,r);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))},[c.fetchState,a]);const y=xe(m,r),g=Ae(r);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Rn(r)?o.jsxs(ne,{children:[Bn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Fn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(rt,{})}),Nn(n?.loggedInUserRole??[],r)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,r)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(St,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};
|