@zeniai/web-app-ui 5.0.58-qa → 5.0.59-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-DCzR8OCn.js +1 -0
- package/dist/assets/AddressScreen-wOBj-HCv.js +9 -0
- package/dist/assets/AiCfoScreen-mgggtkaf.js +11 -0
- package/dist/assets/BillPayApprovalRoutes-DpOlIs0w.js +1 -0
- package/dist/assets/{BillPayRoutes-D2Tg7wgV.js → BillPayRoutes-DsOASVf6.js} +17 -17
- package/dist/assets/{BusinessVerificationPageScreen-C6k9jXdD.js → BusinessVerificationPageScreen-sQFRd4a5.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-DGM8_WGU.js → ChargeCardRoutes-BvjCZCM1.js} +8 -8
- package/dist/assets/CompanyPassportScreen-Bb3QEa8g.js +1 -0
- package/dist/assets/ConnectionAuthScreen-HAkvQi0a.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-C9kq-4yR.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-DgVb7oFC.js +23 -0
- package/dist/assets/{DashboardRoutes-Uo4GBKC0.js → DashboardRoutes-CbYO314V.js} +3 -3
- package/dist/assets/DefaultTenantHome-Cl3oeble.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-BxjPgW4g.js +18 -0
- package/dist/assets/DrawerScreen-fnMWGCDN.js +1 -0
- package/dist/assets/EntityDetailRoutes-CRR-Co7H.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CXWvtRVx.js → ExpenseAutomationRoutes-1fQl0Xke.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-DnTS-oKF.js +1 -0
- package/dist/assets/MagicLinkRoutes-B6rzPuXL.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-Db1eJapB.js +12 -0
- package/dist/assets/MobileAppDrawer-CdvHcp3y.js +1 -0
- package/dist/assets/NotFoundScreen-dHkDEiYr.js +1 -0
- package/dist/assets/{NotificationRoutes-mnrF3FTe.js → NotificationRoutes-BJKu4JAu.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-CENmGG3d.js +1 -0
- package/dist/assets/{PeopleRoutes-CsuYvtlQ.js → PeopleRoutes-Bhy26jxp.js} +11 -11
- package/dist/assets/PerformanceRoutes-Dop8yWip.js +1 -0
- package/dist/assets/{Preview-wXrzgSff.js → Preview-BdiNXgsl.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-wABXktJg.js → QBOConnectionScreen-DUt8At1u.js} +1 -1
- package/dist/assets/ReferralListScreen-uHn3C3WN.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-zxxsM58f.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DzObIyx1.js → ReimbursementApprovalRuleDetailScreen-DRMJhziI.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CCQVaplO.js → ReimbursementRoutes-BGbkr_F4.js} +10 -10
- package/dist/assets/ReportsRoutes--1_1buzs.js +1 -0
- package/dist/assets/RewardsRoutes-k-C7L1W1.js +1 -0
- package/dist/assets/ScreenRoutes-Bhtgp3oM.js +2 -0
- package/dist/assets/SettingsRoutes-CxkCoLng.js +57 -0
- package/dist/assets/{SetupPagesScreen-COv_gua1.js → SetupPagesScreen-t1qwVo9B.js} +5 -5
- package/dist/assets/SignInScreen-Ce31CJwl.js +1 -0
- package/dist/assets/SignOutScreen-CMhG0BW7.js +9 -0
- package/dist/assets/TaskListScreen-CtXjgdNK.js +9 -0
- package/dist/assets/TaskRoutes-BQRwFTHJ.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BVTiA3QH.js +1 -0
- package/dist/assets/TransactionDetailScreen-BTI7Hev7.js +5 -0
- package/dist/assets/{TransactionListRoutes-Bx_mLk9x.js → TransactionListRoutes-CU8hzJNJ.js} +1 -1
- package/dist/assets/TreasuryRoutes-BYqjnRDC.js +37 -0
- package/dist/assets/{VendorsRoutes-C0uM8Aew.js → VendorsRoutes-5EVc2YXe.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-ZkjgO4dq.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BGWOkOQ-.js → ZeniAccountRoutes-BnXOljzp.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-BqQv0Mce.js +9 -0
- package/dist/assets/{accountMappingHelper--WZjwY60.js → accountMappingHelper-CQTlmwyE.js} +1 -1
- package/dist/assets/{analytics-C-ZLKS9f.js → analytics-ByHRVeCB.js} +1 -1
- package/dist/assets/{analyticsHelper-P5_UP7e6.js → analyticsHelper-B_6gZROP.js} +1 -1
- package/dist/assets/{core-BQj7M3th.js → core-lRY8q-SH.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Dx9zGDr_.js → decodeURIComponentSafe-0eiRE7c4.js} +1 -1
- package/dist/assets/{dnd-BYpXi-Dk.js → dnd-CMhEp_mV.js} +1 -1
- package/dist/assets/{empty-BFJN2IH3.js → empty-CZq7_yQf.js} +1 -1
- package/dist/assets/{empty-DBK1yAAC.js → empty-ah5a6CVJ.js} +1 -1
- package/dist/assets/{emptyVideoElement-CwDIvg9a.js → emptyVideoElement-By9zh8D8.js} +1 -1
- package/dist/assets/epic--tiFVypJ.js +2 -0
- package/dist/assets/getLocaleForTenant-DH__PKwo.js +1 -0
- package/dist/assets/{index-lPKfREcR.js → index-BQU54aX-.js} +1 -1
- package/dist/assets/{index-CjveyV3c.js → index-CHj7ka4F.js} +1 -1
- package/dist/assets/{index-Bm779pez.js → index-CS4Vz_Fp.js} +1 -1
- package/dist/assets/{index-CJBs8ioM.js → index-DIK11NcN.js} +1 -1
- package/dist/assets/{index-D-qVvPZr.js → index-DiIyLceg.js} +2 -2
- package/dist/assets/{index-BQ7khhyZ.js → index-Dnsz_nQf.js} +16580 -15569
- package/dist/assets/{index-BzKHSzkl.js → index-zZ7NY9vy.js} +1 -1
- package/dist/assets/{lexical-BaPJckwm.js → lexical-BmtgeH39.js} +1 -1
- package/dist/assets/{liveblocks-CSh9szRw.js → liveblocks-D9Sx1e8B.js} +1 -1
- package/dist/assets/{lottie--J-ULoDN.js → lottie-DzfKCG62.js} +1 -1
- package/dist/assets/{mui-DMFdcGMc.js → mui-Cmn0yvCy.js} +1 -1
- package/dist/assets/{pathToGoBack-CnSjU9UU.js → pathToGoBack-Cz43dcn6.js} +1 -1
- package/dist/assets/{pdf-DL0jKvKA.js → pdf-D0NW3LZJ.js} +3 -3
- package/dist/assets/{pdf-lib-dmJ6Rh_Z.js → pdf-lib-DeAE1iiD.js} +1 -1
- package/dist/assets/{plaid-Cotnt2Mn.js → plaid-DXs7JLSQ.js} +1 -1
- package/dist/assets/{pusher-B_NS064G.js → pusher-Bwusat-w.js} +1 -1
- package/dist/assets/{react-z8VmJ9hA.js → react-C0Emr0BF.js} +1 -1
- package/dist/assets/{react-DxEIAu6S.js → react-CiMvLbNh.js} +1 -1
- package/dist/assets/{react-XeV-ibmg.js → react-DMqPUVNq.js} +1 -1
- package/dist/assets/{react-DM6H-bCy.js → react-DsWw4QR8.js} +1 -1
- package/dist/assets/{react-b_yODjzg.js → react-DxOuIgsx.js} +1 -1
- package/dist/assets/{react-CbbZInsP.js → react-t0Ctas_F.js} +1 -1
- package/dist/assets/{recharts-CxcSvx_6.js → recharts-D0iRu1gV.js} +1 -1
- package/dist/assets/{routePaths-DVCbD1as.js → routePaths-C3HgDUd-.js} +1 -1
- package/dist/assets/{sentry-D9Y14zld.js → sentry-COVXlYUV.js} +1 -1
- package/dist/assets/{url-vwYwiNiZ.js → url-DbIKZPfx.js} +1 -1
- package/dist/assets/{url-C5MmWyLm.js → url-cK4WeZz8.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BmcCsdUi.js +1 -0
- package/dist/assets/{useDeviceId-DisF7Ygt.js → useDeviceId-DQnlXnbu.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-C6W2meRJ.js +1 -0
- package/dist/assets/useInitialThreadRequest--4GxT9so.js +1 -0
- package/dist/assets/{utils-DR9lX595.js → utils-CM-ExQDe.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-672jz7Vz.js → withTransactionSidePanel-DrxENSVz.js} +3 -3
- package/dist/assets/{zeni-epic-state-CQBcHxM0.js → zeni-epic-state-Dl7wxqBX.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-Bma0OfiA.js +0 -1
- package/dist/assets/AddressScreen-CafHmsdE.js +0 -9
- package/dist/assets/AiCfoScreen-Bmx6U0Rp.js +0 -11
- package/dist/assets/BillPayApprovalRoutes-BfnixDIc.js +0 -1
- package/dist/assets/CompanyPassportScreen-6bJBtnFy.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BJz7YCTh.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-TG4VX17r.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-vZ4GZoYS.js +0 -23
- package/dist/assets/DefaultTenantHome-zjiLdRDr.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-Blul-YPy.js +0 -18
- package/dist/assets/DrawerScreen-DYyPEmVC.js +0 -1
- package/dist/assets/EntityDetailRoutes-Fs1wxaU0.js +0 -1
- package/dist/assets/FeaturePreviewScreen-DOiJZe3G.js +0 -1
- package/dist/assets/MagicLinkRoutes-C0x0ECA-.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CKAAe33-.js +0 -12
- package/dist/assets/MobileAppDrawer-Cbf6eKaT.js +0 -1
- package/dist/assets/NotFoundScreen-BqN9xCy_.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-D8b1Uyrc.js +0 -1
- package/dist/assets/PerformanceRoutes-CpkDwR47.js +0 -1
- package/dist/assets/ReferralListScreen-B5AVlzsF.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-C_QtyZuv.js +0 -1
- package/dist/assets/ReportsRoutes-DHItSFDF.js +0 -1
- package/dist/assets/RewardsRoutes-SDWucbtM.js +0 -1
- package/dist/assets/ScreenRoutes-B5jhk5OY.js +0 -2
- package/dist/assets/SettingsRoutes-CGXQ4b0U.js +0 -57
- package/dist/assets/SignInScreen-CnFzddbd.js +0 -1
- package/dist/assets/SignOutScreen-BJnV-qr8.js +0 -9
- package/dist/assets/TaskListScreen-BEbP6MV_.js +0 -9
- package/dist/assets/TaskRoutes-CGpSZs94.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BqrKmgWY.js +0 -1
- package/dist/assets/TransactionDetailScreen-BmICv2Q4.js +0 -5
- package/dist/assets/TreasuryRoutes-DYbLf4n6.js +0 -37
- package/dist/assets/WiseConfirmationScreen-C2MD3OAK.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BZs8jx4o.js +0 -9
- package/dist/assets/epic-ChV_kVNy.js +0 -2
- package/dist/assets/getLocaleForTenant-N9soJqF6.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Bvqw93U6.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Z9FWtkNt.js +0 -1
- package/dist/assets/useInitialThreadRequest-JVMOcCBt.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-D9Sx1e8B.js";import{a as o}from"./sentry-COVXlYUV.js";import{g as f,j as H,h as N,u as V,k as _}from"./core-lRY8q-SH.js";import{h as M,Z as F,z as R,b3 as W,C as U,M as $,A as z,d as l,f as Y,a2 as Q,b4 as Z}from"./index-Dnsz_nQf.js";import{eY as q,eO as G,LM as P,LN as J,ts as K,ti as g,e_ as X,bN as ee,tn as ae,LO as re}from"./zeni-epic-state-Dl7wxqBX.js";import{D as ne,e as te,n as se,S as oe}from"./mui-Cmn0yvCy.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-BmcCsdUi.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-C6W2meRJ.js";import{M as ce}from"./MobileAppDrawer-CdvHcp3y.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]="5ccc6857-7a14-4f33-9691-4ca12a1d567e",e._sentryDebugIdIdentifier="sentry-dbid-5ccc6857-7a14-4f33-9691-4ca12a1d567e")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=M(),n=F();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,I="refer-and-earn-status-update",pe=_(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ee([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(re({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(ae(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))}}})(Q(Z));function be({isReferralDrawerOpen:e}){const a=H(),r=N(),n=V(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,E]=o.useState(!1),[k,h]=o.useState(!1),p=R.getSignedInUser(),C=f(t=>G(t)),m=f(t=>P(t)),y=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=J([m,w]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(K()),E(!0))},[]),o.useEffect(()=>{!i&&y==="Not-Started"&&d&&(u(!0),r(g(!0)))},[y,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(x(!0),r(X(!0)))},[w,r,d]),o.useEffect(()=>{h(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),S=t=>{A(t)},{isAiCfoAccessEnabled:L,onAskAiCfoClick:O}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:v===!0});const T={events:p?.userId!=null?[`private-encrypted-${p.userId}.${I}`]:[],eventCallback:(t,b,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(z,{analytics:l,onLoad:t=>(b=>{p!=null&&b.trackPageLoaded(Y.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:S}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{h(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:L,onAskAiCfoClick:O,...T})]})}export{be as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-D9Sx1e8B.js";import x from"./NotFoundScreen-dHkDEiYr.js";import{a as p}from"./sentry-COVXlYUV.js";import{j as C,u as I,h as A,g as c,N as E,k,n as D,o as u}from"./core-lRY8q-SH.js";import{eO as T,MG as g,MW as S,Cp as V,By as U,Co as m,Cf as _,N9 as B}from"./zeni-epic-state-Dl7wxqBX.js";import{h as N,z as O,B as W,a2 as $,bJ as M,ab as z}from"./index-Dnsz_nQf.js";import"./mui-Cmn0yvCy.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-DRMJhziI.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="502fd599-1bfc-416c-9385-0e0c28a5492b",e._sentryDebugIdIdentifier="sentry-dbid-502fd599-1bfc-416c-9385-0e0c28a5492b")}catch{}})();const d="reimbursement-approval-rule-update",G=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(d)&&e(B(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(_(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})($(M)),J=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=c(n=>n.remiSetupApproverViewState.fetchState),o=c(n=>T(n)),w=N(),i=c(n=>g(n)),h=c(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(U(!0)))},[l,b,a]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${d}`]:[],eventCallback:(n,P,R)=>{n.endsWith(d)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(G,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(u,{path:"/",element:t.jsx(J,{})}),t.jsx(u,{path:"/new",element:t.jsx(v,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-D9Sx1e8B.js";import{a as y}from"./sentry-COVXlYUV.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-lRY8q-SH.js";import{MW as R,MG as E,Ci as x,Cr as _,Cp as S,Cq as h,MX as B}from"./zeni-epic-state-Dl7wxqBX.js";import{z as k,h as V,B as j,bA as F,ab as O}from"./index-Dnsz_nQf.js";import"./mui-Cmn0yvCy.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]="b86427b9-a39e-4715-97bd-634b1fd82745",e._sentryDebugIdIdentifier="sentry-dbid-b86427b9-a39e-4715-97bd-634b1fd82745")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!$(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function W(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{W as R,$ as i};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-CSh9szRw.js";import{j as q,h as re,u as Z,l as Y,g as E,N as $,k as J,i as mt,n as ct,o as C}from"./core-BQj7M3th.js";import{eN as V,MX as le,c0 as me,Bs as xe,jB as dt,BF as ne,BE as ae,MY as ut,bn as ce,fH as Te,MZ as pt,Jj as bt,jq as je,Jk as Se,Jl as gt,ik as ht,Md as ft,iA as St,Bg as It,s5 as yt,is as Rt,C0 as De,M_ as Fe,M$ as At,N0 as kt,N1 as vt,N2 as Ct,N3 as Et,BM as Ie,iG as Bt,Mm as wt,BG as xt,Bq as Tt,N4 as jt,Bp as Dt,N5 as Ft,By as ye,BQ as Ut,BP as Lt,BL as Nt,N6 as Ue,GD as Mt,bo as Pt,BB as $t,Ci as _t,N7 as Ot,N8 as Gt,BY as zt,BV as Re,LI as Ht,Bn as Zt,N9 as Le,CH as Ae,CP as Vt,Na as Wt,Nb as z,Nc as qt,Nd as Ne,Ne as Jt,Nf as Me,Ng as Pe,C8 as se,bt as Qt,bE as de,cA as ue,eT as $e,eR as _e,Nh as Kt,gC as Yt,LV as Xt,Ni as en,Nj as Oe,LZ as tn,MH as nn,Nk as an,MW as sn,CM as ke,CL as on,Nl as rn,Nm as ln,Nn as mn,No as cn,Np as dn,Ms as un,CC as pn,CG as bn,bv as gn,bD as hn,cv as fn,cj as Sn,bs as In,Ik as yn,cL as Rn,cN as An,cM as kn,cu as vn}from"./zeni-epic-state-CQBcHxM0.js";import{$ as Ge,q as ze,a as X,p as k,z as M,bK as He,y as ee,d as v,aD as ve,o as D,ap as K,F as Cn,D as Ze,bL as En,s as H,bM as Bn,j as te,bN as wn,M as xn,C as Tn,w as pe,f as Ve,a1 as jn,bb as Dn,Q as Fn,h as We,bO as Un,a5 as Ln}from"./index-BQ7khhyZ.js";import{n as _,S as Nn}from"./mui-DMFdcGMc.js";import ie from"./NotFoundScreen-BqN9xCy_.js";import{S as Ce}from"./SetupPagesScreen-COv_gua1.js";import{F as qe}from"./FeaturePreviewScreen-DOiJZe3G.js";import{a as f}from"./sentry-D9Y14zld.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-Bvqw93U6.js";import{u as Je}from"./useInitialThreadRequest-JVMOcCBt.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-Z9FWtkNt.js";import{D as Mn}from"./DrawerScreen-DYyPEmVC.js";import{M as Ke}from"./MobileAppDrawer-Cbf6eKaT.js";import{R as Pn}from"./ReimbursementApprovalRoutes-C_QtyZuv.js";import{FallBackRoute as $n}from"./ScreenRoutes-B5jhk5OY.js";import"./recharts-CxcSvx_6.js";import"./analytics-C-ZLKS9f.js";import"./plaid-Cotnt2Mn.js";import"./dnd-BYpXi-Dk.js";import"./stripe-DMRn4zHo.js";import"./lottie--J-ULoDN.js";import"./lexical-BaPJckwm.js";import"./pdf-DL0jKvKA.js";import"./utils-DR9lX595.js";import"./analyticsHelper-P5_UP7e6.js";import"./routePaths-DVCbD1as.js";import"./BusinessVerificationPageScreen-C6k9jXdD.js";import"./ReimbursementApprovalRuleDetailScreen-DzObIyx1.js";import"./getLocaleForTenant-N9soJqF6.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]="78cbb6c0-62db-4e29-9636-5552fae5a72d",e._sentryDebugIdIdentifier="sentry-dbid-78cbb6c0-62db-4e29-9636-5552fae5a72d")}catch{}})();const Ye=e=>`/${e}/reimbursements`,_n=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:L}}}=Ze.getLocalizedStrings(),On=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${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:`${K.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:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(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(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(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(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Bt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({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(Fe()),e(At());const i=Ye(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("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(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=q(),t=re(),n=Z(),{reimbursementId:r}=Y(),d=Ge(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),B=Z().pathname,j=B.includes("edit"),A=B.includes("reimbursement/new"),[F,w]=f.useState(!1),x=M.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(xe(!1,b,R,r)))});const P=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:P,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Gn=_.div`
|
|
1
|
+
import{j as s}from"./liveblocks-D9Sx1e8B.js";import{j as q,h as re,u as Z,l as X,g as E,N as $,k as J,i as mt,n as ct,o as C}from"./core-lRY8q-SH.js";import{eO as W,Na as le,c1 as me,Bt as xe,jC as dt,BG as ne,BF as ae,Nb as ut,bn as ce,fI as Te,Nc as pt,Jy as bt,jr as De,Jz as Se,JA as gt,il as ht,Ms as ft,iB as St,Bh as It,s6 as yt,it as Rt,C1 as je,Nd as Fe,Ne as At,Nf as vt,Ng as kt,Nh as Ct,Ni as Et,BN as Ie,iH as Bt,MB as wt,BH as xt,Br as Tt,Nj as Dt,Bq as jt,Nk as Ft,Bz as ye,BR as Ut,BQ as Nt,BM as Lt,Nl as Ue,GS as Mt,bo as Pt,BC as $t,Cj as _t,Nm as Ot,Nn as zt,BZ as Gt,BW as Re,LX as Ht,Bo as Zt,No as Ne,CI as Ae,CQ as Wt,Np as Vt,Nq as G,Nr as qt,Ns as Le,Nt as Jt,Nu as Me,Nv as Pe,C9 as se,bt as Qt,bF as de,cB as ue,eU as $e,eS as _e,Nw as Kt,gD as Xt,M8 as Yt,Nx as en,Ny as Oe,Mc as tn,MW as nn,Nz as an,N9 as sn,CN as ve,CM as on,NA as rn,NB as ln,NC as mn,ND as cn,NE as dn,MH as un,CD as pn,CH as bn,bv as gn,bE as hn,cw as fn,ck as Sn,bs as In,Iz as yn,cM as Rn,cO as An,cN as vn,cv as kn}from"./zeni-epic-state-Dl7wxqBX.js";import{w as ze,Z as Ge,g as Y,y as v,z as M,bK as He,A as ee,d as k,aD as ke,o as j,ap as K,G as Cn,D as Ze,bL as En,r as H,bM as Bn,I as te,bN as wn,M as xn,C as Tn,B as pe,f as We,a2 as Dn,bb as jn,N as Fn,h as Ve,bO as Un,a5 as Nn}from"./index-Dnsz_nQf.js";import{n as _,S as Ln}from"./mui-Cmn0yvCy.js";import ie from"./NotFoundScreen-dHkDEiYr.js";import{S as Ce}from"./SetupPagesScreen-t1qwVo9B.js";import{F as qe}from"./FeaturePreviewScreen-DnTS-oKF.js";import{a as f}from"./sentry-COVXlYUV.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-BmcCsdUi.js";import{u as Je}from"./useInitialThreadRequest--4GxT9so.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-C6W2meRJ.js";import{D as Mn}from"./DrawerScreen-fnMWGCDN.js";import{M as Ke}from"./MobileAppDrawer-CdvHcp3y.js";import{R as Pn}from"./ReimbursementApprovalRoutes-zxxsM58f.js";import{FallBackRoute as $n}from"./ScreenRoutes-Bhtgp3oM.js";import"./recharts-D0iRu1gV.js";import"./analytics-ByHRVeCB.js";import"./plaid-DXs7JLSQ.js";import"./dnd-CMhEp_mV.js";import"./stripe-DMRn4zHo.js";import"./lottie-DzfKCG62.js";import"./lexical-BmtgeH39.js";import"./pdf-D0NW3LZJ.js";import"./utils-CM-ExQDe.js";import"./analyticsHelper-B_6gZROP.js";import"./routePaths-C3HgDUd-.js";import"./BusinessVerificationPageScreen-sQFRd4a5.js";import"./ReimbursementApprovalRuleDetailScreen-DRMJhziI.js";import"./getLocaleForTenant-DH__PKwo.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]="de8ec561-43a1-4ce2-9f1c-e2df87b9ec2e",e._sentryDebugIdIdentifier="sentry-dbid-de8ec561-43a1-4ce2-9f1c-e2df87b9ec2e")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=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:N}}}=Ze.getLocalizedStrings(),On=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=M.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${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:`${K.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:R,isUserAdmin:me(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:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Lt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Nt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Bt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Xe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("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(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=q(),t=re(),n=Z(),{reimbursementId:r}=X(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(v.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),B=Z().pathname,D=B.includes("edit"),A=B.includes("reimbursement/new"),[F,w]=f.useState(!1),x=M.getSignedInUser(),I=E(p=>W(p)),g=E(p=>le(p,r)),L=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(xe(!1,b,R,r)))});const P=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{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(Hn,{children:s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:N.dropReceipt.upload,single:N.dropReceipt.single,or:N.dropReceipt.or,multiple:N.dropReceipt.multiple,receipts:N.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:N.dropReceipt.upload,single:N.dropReceipt.single,or:N.dropReceipt.or,multiple:N.dropReceipt.multiple,receipts:N.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:P,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=_.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
5
5
|
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
6
6
|
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
-
`,
|
|
7
|
+
`,Gn=_.div`
|
|
8
8
|
position: fixed;
|
|
9
9
|
top: 0;
|
|
10
10
|
left: 0;
|
|
@@ -33,27 +33,27 @@ import{j as s}from"./liveblocks-CSh9szRw.js";import{j as q,h as re,u as Z,l as Y
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
overflow-y: auto;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
`,
|
|
36
|
+
`,Wn=_.button`
|
|
37
37
|
align-self: flex-end;
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
40
40
|
cursor: pointer;
|
|
41
|
-
padding: ${
|
|
41
|
+
padding: ${j.sp2} ${j.sp3};
|
|
42
42
|
line-height: 1;
|
|
43
43
|
color: ${e=>e.theme.colors.hero};
|
|
44
44
|
&:hover {
|
|
45
45
|
color: ${e=>e.theme.colors.primary};
|
|
46
46
|
}
|
|
47
47
|
svg {
|
|
48
|
-
width: ${
|
|
49
|
-
height: ${
|
|
48
|
+
width: ${j.sp4};
|
|
49
|
+
height: ${j.sp4};
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Vn=_.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,qn=J(function(e,t){const n=Ue(e,t.reimbursementId),r=M.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,
|
|
56
|
+
`,qn=J(function(e,t){const n=Ue(e,t.reimbursementId),r=M.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Xe(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Bn);function Jn(){const e=q(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=X(),m=M.getSignedInUser(),o=E(y=>W(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Je(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(v.isLimitedCategoryForReimbursement),[u,B]=f.useState(!1),[D,A]=f.useState(!1),[F,w]=f.useState(!1),{isFeatureEnabled:x}=h(v.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(v.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),L=Mt(o),U=Pt(o.userRole),P=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&P==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t($t(c,!1,I)))},[u,c,t,P]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?w(!1):w(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,L,m]),f.useEffect(()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(xe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:x,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Qn=J(function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(wn);function Kn(){const e=q(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Ne(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Qn,{navigate:e,analytics:k,isAdmin:d})}const z=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:Be}=Ze.getLocalizedStrings(),we=Xn.reimbursement.bulkActions,Yn=_.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-CSh9szRw.js";import{j as q,h as re,u as Z,l as Y
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,ea=J(function(e,t){const n=Pe(e,
|
|
64
|
+
`,ea=J(function(e,t){const n=Pe(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=M.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=W(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Le(o))},onSubtabChange:o=>{e(G()),e(Me(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ve("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ve("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(Dn(jn));function ta(){const e=q(),t=re(),n=Z(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(Le(S)):console.log("Warning:Not a valid remiListTab");const O=Jt(r.subTab.toString());O!=null?t(Me(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(v.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(v.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(v.isReimbursementBulkActionEnabled),T=M.getSignedInUser(),u=E(S=>W(S)),[B,D]=f.useState(!1),[A,F]=f.useState(!1),w=te(),x=w?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Pe(S,z,h)),{areTenantIdsInSync:g}=xn(),L=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:P}=be({mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Qt(u),p=de(w?.loggedInUserRoleMap),V=ue(w?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{D(S)},{isFeatureEnabled:it}=a(v.isDebitCardFeatureEnabled),ot=$e(it,u),rt=_e(u),{remisProcessed:Q,remisProcessing:he}=E(S=>Kt(S));f.useEffect(()=>{Q===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:Q>1?we.reports:we.report},{variableName:"_has_",variableValue:Q>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[Q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,O,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(qe,{}):tt&&(!y||p)||V&&et?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(ee,{analytics:k,onLoad:S=>(O=>O.trackPageLoaded(We.Event.reimbursementHome))(S)}):null,s.jsx(Ke,{isAppContentDrawerOpen:B,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:x,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:P,...lt})]})]}):nt&&p?s.jsx($,{to:"../setup"}):w!=null&&Oe(u,w.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Ln)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,ia=J(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:
|
|
68
|
+
`,ia=J(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:k,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=q(),t=Z(),{tenantEmailDomain:n}=X(),r=Ve(),[d,c]=f.useState(!1),m=E(A=>W(A)),o=M.getSignedInUserTenant(n)?.companyId??m.companyId,a=M.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,B=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx($,{to:"../../../reimbursements"}):B&&R?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!B||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:A=>(F=>F.trackPageLoaded(We.Event.reimbursementPromoPage))(A)}),s.jsx(Ke,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Ma(){const e=E(V=>W(V)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ve(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),B=T&&u,{isFeatureEnabled:D}=m(v.isDepositAccountsFeatureEnabled),A=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Nn(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),w=yn(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),L=kn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:P}=X(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:B?s.jsx(Pn,{}):s.jsx($n,{isUserHasZeniAccountsAccess:x,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:L,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:P??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(qe,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Ma as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as p}from"./liveblocks-D9Sx1e8B.js";import{u as z,j as be,h as ye,l as Ce,g as d,k as ge,n as Ie,o as G}from"./core-lRY8q-SH.js";import{eO as L,f8 as I,IU as Se,jr as Q,IV as K,pJ as A,jf as we,ii as Te,t2 as Re,pO as Oe,bv as Ae,IW as Fe,bn as ke,u5 as De,IX as Ee,IY as je,s_ as Pe,t6 as Le,IZ as Y,I_ as Me,I$ as Be,J0 as ve,J1 as Ue,J2 as S,J3 as F,J4 as k,J5 as H,J6 as D,J7 as E,dC as Ve,tN as Je,tB as N,tC as $,tT as xe,tG as Z,tZ as ze,J8 as Ge,J9 as Ye,Ja as He,Jb as Ne,Jc as $e,eU as Ze,eS as qe}from"./zeni-epic-state-Dl7wxqBX.js";import{J as We,K as Qe,Z as Ke,g as X,y as j,z as ee,M as Xe,I as ea,a as aa,A as sa,d as P,f as ta,r as ae,W as oa,T as na,N as ra}from"./index-Dnsz_nQf.js";import"./mui-Cmn0yvCy.js";import ia from"./NotFoundScreen-dHkDEiYr.js";import{F as la}from"./FeaturePreviewScreen-DnTS-oKF.js";import{a as h}from"./sentry-COVXlYUV.js";import{u as ca,a as da,b as pa,c as fa}from"./useFetchSuggestedQuestionsWhenReady-C6W2meRJ.js";import{u as ma}from"./useInitialThreadRequest--4GxT9so.js";import{t as q,a as W}from"./routePaths-C3HgDUd-.js";import{M as ua}from"./MobileAppDrawer-CdvHcp3y.js";import"./recharts-D0iRu1gV.js";import"./analytics-ByHRVeCB.js";import"./plaid-DXs7JLSQ.js";import"./dnd-CMhEp_mV.js";import"./stripe-DMRn4zHo.js";import"./lottie-DzfKCG62.js";import"./lexical-BmtgeH39.js";import"./pdf-D0NW3LZJ.js";import"./utils-CM-ExQDe.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]="494cfddc-f5a5-4787-8af9-47be2c6963fe",e._sentryDebugIdIdentifier="sentry-dbid-494cfddc-f5a5-4787-8af9-47be2c6963fe")}catch{}})();const _a=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ha=e=>{e(Ye()),e(He()),e(Ne()),e($e())},ba=ge(function(e){const o=ee.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(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:Q(e),isAccountingProjectsEnabled:K(e),currentTenantCompanyName:a,statementEndPoint:`${ra}/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(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;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(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(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(Je({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,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=ae(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(l,{state:{pathnameStackToGoBack:i,referrer:w(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(H({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(H({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(ve({viewMode:a})),e(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(Le())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ha(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(oa);function ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=Ke(),u=na(f),a=be(),s=ye(),t=z(),{tenantEmailDomain:r}=Ce(),{useFeatureGate:c}=X(),{isFeatureEnabled:m}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=ee.getSignedInUser(),[i,C]=h.useState(!1),[M,se]=h.useState(!1),{isFeatureEnabled:B}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const v=d(n=>L(n)),te=v.company?.companyInfo.firstMonthOfFY??1,oe=ma(B?v?.companyId:void 0),g=d(n=>I(n).fetchState),ne=d(n=>Se(n)),{areTenantIdsInSync:b}=Xe(),T=d(n=>n.financeStatementState.selectedReportId),U=d(n=>Q(n)),R=d(n=>K(n)),re=d(n=>I(n).isCompareModeOn),_=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ie=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(C(!0),s(A(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!M&&g==="Completed"&&b&&(s(A(l.userId,!1,!0,!1)),se(!0))},[i,M,g,b]),h.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(T){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(_.timeframe));break;case"profit_and_loss_by_projects":R&&s(Re(_.timeframe));break;case"balance_sheet":s(Te(_.timeframe));break;case"cash_flow":s(we(_.timeframe))}},[i,T,O,b,U,R]);const V=ea(),le=V?.loggedInUserRole!=null&&Ae(V?.loggedInUserRole)!==!0,[ce,de]=h.useState(!1),J=n=>{de(n)},pe=aa(),fe=pa();return function(n){const{isDataReady:me}=n,{pathname:ue}=z(),x=We(ue??"")==="reports",_e=ca(me),he=h.useMemo(()=>x?_a:void 0,[x]);da({canFetchSuggestedQuestions:_e,pageContexts:he})}({isDataReady:g==="Completed"}),fa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(sa,{analytics:P,onLoad:n=>n.trackPageLoaded(ta.Event.reports)}):null,p.jsx(ua,{isAppContentDrawerOpen:ce,handleDrawerToggle:J}),p.jsx(ba,{firstMonthOfFY:te,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ie,selectedReportID:T,analytics:P,filter:_,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:R,isCompareModeOn:re,hasTransactionAccess:le,signedInUser:l,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:J,reportsResyncFetchState:ne.reportsResyncFetchState,isAiCfoAccessEnabled:fe&&pe&&!e,onAskAiCfoClick:()=>{if(u){const n=ae(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:oe})]})}const w=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 Ja(){const e=d(s=>L(s)),{useFeatureGate:o}=X(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ze(f,e),a=qe(e);return u===!0||a===!0?p.jsx(la,{}):p.jsxs(Ie,{children:[p.jsx(G,{path:"/",element:p.jsx(ya,{})}),p.jsx(G,{path:"*",element:p.jsx(ia,{})})]})}export{Ja as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-D9Sx1e8B.js";import{g as w,z as j,aJ as b,A as I,d as p,f as P,cD as F,y as L}from"./index-Dnsz_nQf.js";import"./mui-Cmn0yvCy.js";import l from"./NotFoundScreen-dHkDEiYr.js";import{a as d}from"./sentry-COVXlYUV.js";import{h as A,g as y,j as T,u as V,k as R,n as U,o as f}from"./core-lRY8q-SH.js";import{eO as z,Pv as C,Ml as O,Pw as D,ts as Y,e_ as q,Px as G,tq as J}from"./zeni-epic-state-Dl7wxqBX.js";import{R as x}from"./ReferralListScreen-uHn3C3WN.js";import"./recharts-D0iRu1gV.js";import"./analytics-ByHRVeCB.js";import"./plaid-DXs7JLSQ.js";import"./dnd-CMhEp_mV.js";import"./stripe-DMRn4zHo.js";import"./lottie-DzfKCG62.js";import"./lexical-BmtgeH39.js";import"./pdf-D0NW3LZJ.js";import"./utils-CM-ExQDe.js";import"./useAskAiCfoHostNavButtonProps-BmcCsdUi.js";import"./useFetchSuggestedQuestionsWhenReady-C6W2meRJ.js";import"./MobileAppDrawer-CdvHcp3y.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]="795aadf3-40b7-48e5-a969-9b51befdd2bf",e._sentryDebugIdIdentifier="sentry-dbid-795aadf3-40b7-48e5-a969-9b51befdd2bf")}catch{}})();const M=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=j.getSignedInUser();return{onDismissClick:()=>{e(D()),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(J())},onUpdateInviteFormLocalData:s=>{e(G({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(F),B=()=>{const e=A(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=y(o=>z(o)),c=T(),_=V(),{useDynamicConfig:g}=w(),u=j.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=y(o=>C(o)),k=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:v}=g(b.zeniAccountsConfig),N=O(v);d.useEffect(()=>{e(D()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),d.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(q(!0)))},[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(P.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:c,location:_,currentTenant:r,companyName:S,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(f,{path:"*",element:a.jsx(l,{})})]})}export{ue as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CbYO314V.js","assets/sentry-COVXlYUV.js","assets/core-lRY8q-SH.js","assets/zeni-epic-state-Dl7wxqBX.js","assets/index-Dnsz_nQf.js","assets/mui-Cmn0yvCy.js","assets/analytics-ByHRVeCB.js","assets/utils-CM-ExQDe.js","assets/withTransactionSidePanel-DrxENSVz.js","assets/useAskAiCfoHostNavButtonProps-BmcCsdUi.js","assets/useFetchSuggestedQuestionsWhenReady-C6W2meRJ.js","assets/TransactionDetailScreen-BTI7Hev7.js","assets/decodeURIComponentSafe-0eiRE7c4.js","assets/routePaths-C3HgDUd-.js","assets/NotFoundScreen-dHkDEiYr.js","assets/analyticsHelper-B_6gZROP.js","assets/CompanyPassportScreen-Bb3QEa8g.js","assets/MobileAppDrawer-CdvHcp3y.js","assets/FeaturePreviewScreen-DnTS-oKF.js","assets/ReferralListScreen-uHn3C3WN.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-DsOASVf6.js","assets/AddressScreen-wOBj-HCv.js","assets/DomesticWireDetailScreen-BxjPgW4g.js","assets/useInitialThreadRequest--4GxT9so.js","assets/DrawerScreen-fnMWGCDN.js","assets/SetupPagesScreen-t1qwVo9B.js","assets/BusinessVerificationPageScreen-sQFRd4a5.js","assets/BillPayApprovalRoutes-DpOlIs0w.js","assets/ReimbursementApprovalRuleDetailScreen-DRMJhziI.js","assets/getLocaleForTenant-DH__PKwo.js","assets/ReimbursementRoutes-BGbkr_F4.js","assets/ReimbursementApprovalRoutes-zxxsM58f.js","assets/TransactionListRoutes-CU8hzJNJ.js","assets/ZeniAccountStatementScreen-BqQv0Mce.js","assets/SettingsRoutes-CxkCoLng.js","assets/accountMappingHelper-CQTlmwyE.js","assets/QBOConnectionScreen-DUt8At1u.js","assets/empty-ah5a6CVJ.js","assets/index-CS4Vz_Fp.js","assets/url-DbIKZPfx.js","assets/index-BQU54aX-.js","assets/ReportsRoutes--1_1buzs.js","assets/ChargeCardRoutes-BvjCZCM1.js","assets/PeopleRoutes-Bhy26jxp.js","assets/ExpenseAutomationRoutes-1fQl0Xke.js","assets/TreasuryRoutes-BYqjnRDC.js","assets/VendorsRoutes-5EVc2YXe.js","assets/pathToGoBack-Cz43dcn6.js","assets/ZeniAccountRoutes-BnXOljzp.js","assets/AddressRoutes-DCzR8OCn.js","assets/PandLWithForecastRoutes-CENmGG3d.js","assets/CustomerOnboardingRoutes-DgVb7oFC.js","assets/TransactionDetailRoutes-BVTiA3QH.js","assets/EntityDetailRoutes-CRR-Co7H.js","assets/NotificationRoutes-BJKu4JAu.js","assets/PerformanceRoutes-Dop8yWip.js","assets/RewardsRoutes-k-C7L1W1.js","assets/TaskRoutes-BQRwFTHJ.js","assets/TaskListScreen-CtXjgdNK.js","assets/AiCfoScreen-mgggtkaf.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as n,bn as os,eO as ls,eU as cs,eS as ds,eT as ms,fD as us,eQ as _s,cP as Ae,cw as As,f9 as Es,co as ps,bD as Is,bq as gs,fe as xs,v as Ts,Iy as hs,bv as js,Iz as Us,bF as bs,fb as Ds,bE as Hs,bs as Rs,ck as ys,IA as fs,IB as Cs,cM as vs,cO as Os,cN as Ps,cv as Fs,cB as Ls,mm as Ee,eP as pe,fN as Bs,fi as Ie,fK as ge,fL as xe,fj as ks}from"./zeni-epic-state-Dl7wxqBX.js";import{j as e}from"./liveblocks-D9Sx1e8B.js";import{a as v}from"./sentry-COVXlYUV.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-lRY8q-SH.js";import{h as ws,u as zs,z as D,g as Gs,a as $s,c as Ys,y as L,I as qs,L as B,D as he,t as _,P as Ws,d as X,l}from"./index-Dnsz_nQf.js";import"./mui-Cmn0yvCy.js";import{f as je}from"./analyticsHelper-B_6gZROP.js";import{t as Ks}from"./getLocaleForTenant-DH__PKwo.js";import"./recharts-D0iRu1gV.js";import"./analytics-ByHRVeCB.js";import"./plaid-DXs7JLSQ.js";import"./dnd-CMhEp_mV.js";import"./stripe-DMRn4zHo.js";import"./lottie-DzfKCG62.js";import"./lexical-BmtgeH39.js";import"./pdf-D0NW3LZJ.js";import"./utils-CM-ExQDe.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="b576b31a-3efd-4739-916b-615ad5295229",i._sentryDebugIdIdentifier="sentry-dbid-b576b31a-3efd-4739-916b-615ad5295229")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-CbYO314V.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-DsOASVf6.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-BGbkr_F4.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-CU8hzJNJ.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-CxkCoLng.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes--1_1buzs.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-BvjCZCM1.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-Bhy26jxp.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-1fQl0Xke.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-BYqjnRDC.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-5EVc2YXe.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-BnXOljzp.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes--1_1buzs.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-DCzR8OCn.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-Bhy26jxp.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-CENmGG3d.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-DgVb7oFC.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-5EVc2YXe.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-BVTiA3QH.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-CRR-Co7H.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-CbYO314V.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),be=l(()=>n(()=>import("./BillPayRoutes-DsOASVf6.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-CxkCoLng.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),De=l(()=>n(()=>import("./ReimbursementRoutes-BGbkr_F4.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-BnXOljzp.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-BYqjnRDC.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-CU8hzJNJ.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-BvjCZCM1.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-BJKu4JAu.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),An=l(()=>n(()=>import("./PerformanceRoutes-Dop8yWip.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),En=l(()=>n(()=>import("./ExpenseAutomationRoutes-1fQl0Xke.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-k-C7L1W1.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-BQRwFTHJ.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-mgggtkaf.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-dHkDEiYr.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-CtXjgdNK.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),R=D.getSignedInUserTenant(o)?.tenantId,h=D.getSignedInUser(),K=os(h),G=Ms(),[N,Re]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=Gs(),Q=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),E=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=D.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:R,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),A=qs(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,J=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?Es(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(J!=null&&R!=null){const a=J.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(R,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[J,R]),v.useEffect(()=>{N||(Re(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=D.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,D]),v.useEffect(()=>{D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=D.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,R,h,f,U))},[R,E]),v.useEffect(()=>{D.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&f(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&R!=null?(O(),_.markActiveTenantFetchCompleted(R)):E==="Error"&&R!=null&&(_.markActiveTenantFetchFailed(R),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,R,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(a=Js,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Ds(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Hs(A?.loggedInUserRoleMap),Ke=oe&&Rs(A?.loggedInUserRoleMap),Qe=me&&ys(A?.loggedInUserRoleMap),Je=fs(A?.loggedInUserRoleMap),Xe=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||Ge===!0||Je===!0||Xe===!0;return D.isSignedIn()?R==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||K?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Qe||Ke?e.jsx(en,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(An,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(En,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(gn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(bn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Dn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Dn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),He=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,wn as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-D9Sx1e8B.js";import{a as u}from"./sentry-COVXlYUV.js";import{j as T,u as F,h as P,g as m,k as R,l as _,n as W,o as C}from"./core-lRY8q-SH.js";import{bn as Ie,eO as k,gw as ce,Kx as Ce,IV as xe,jr as le,lK as Ee,gy as Ae,Kz as je,Ky as ke,MY as we,x3 as Pe,By as ve,Mx as De,MG as Me,c1 as re,cG as Ue,cH as Te,IK as Be,MZ as Fe,IL as Re,vv as _e,M_ as Ve,DO as Oe,Be as Le,B5 as de,B2 as Ne,vz as ue,B8 as pe,Bb as ge,Bh as Y,s6 as q,vy as $e,j3 as X,j6 as me,M$ as Ke,k7 as Ge,vO as ze,Js as Ze,Jt as Je,j1 as He,N0 as Qe,j4 as We,N1 as Xe,vL as Ye,N2 as qe,N3 as en,Bv as nn,eS as fe,eU as he,N4 as tn,fw as an,IW as sn,vK as te,fB as ae,fA as on,vJ as cn,fz as ln,fy as rn,N5 as dn,eX as be,N6 as un,N7 as pn,vR as gn,vI as se,N8 as mn,fd as fn,vF as hn,bU as bn,c0 as yn,b$ as Sn,bV as In,bZ as Cn,bY as xn,bX as En,b_ as An,bW as jn}from"./zeni-epic-state-Dl7wxqBX.js";import{g as ee,y as M,z as x,ab as ye,bB as kn,d as K,f as wn,I as V,B as ne,bC as Pn,bD as vn,am as Dn,k as Se,bE as Mn,bF as Un,bG as Tn,a5 as Bn,M as Fn,bH as Rn,r as _n,bI as Vn}from"./index-Dnsz_nQf.js";import{n as U}from"./mui-Cmn0yvCy.js";import{M as v}from"./MobileAppDrawer-CdvHcp3y.js";import{a as N,g as $,m as On}from"./accountMappingHelper-CQTlmwyE.js";import{t as Ln,A as Nn}from"./AddressScreen-wOBj-HCv.js";import B from"./NotFoundScreen-dHkDEiYr.js";import{g as $n}from"./analyticsHelper-B_6gZROP.js";import{B as Kn}from"./BusinessVerificationPageScreen-sQFRd4a5.js";import{C as Gn}from"./CompanyPassportScreen-Bb3QEa8g.js";import{q as oe}from"./QBOConnectionScreen-DUt8At1u.js";import{B as zn}from"./BillPayApprovalRoutes-DpOlIs0w.js";import{R as Zn}from"./ReimbursementApprovalRoutes-zxxsM58f.js";import"./recharts-D0iRu1gV.js";import"./analytics-ByHRVeCB.js";import"./plaid-DXs7JLSQ.js";import"./dnd-CMhEp_mV.js";import"./stripe-DMRn4zHo.js";import"./lottie-DzfKCG62.js";import"./lexical-BmtgeH39.js";import"./pdf-D0NW3LZJ.js";import"./utils-CM-ExQDe.js";import"./routePaths-C3HgDUd-.js";import"./empty-ah5a6CVJ.js";import"./pdf-lib-DeAE1iiD.js";import"./index-CS4Vz_Fp.js";import"./url-DbIKZPfx.js";import"./index-BQU54aX-.js";import"./decodeURIComponentSafe-0eiRE7c4.js";import"./ReimbursementApprovalRuleDetailScreen-DRMJhziI.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]="d4d3e449-7284-4494-9ebb-cf6c0258d9dd",e._sentryDebugIdIdentifier="sentry-dbid-d4d3e449-7284-4494-9ebb-cf6c0258d9dd")}catch{}})();const Jn=U.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,Hn=R(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:S,fixedAssetsAccount:j,accruedExpensesAccount:y}=d,{bankAccount:I,expenseCategory1099:O}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),G=N(a.accountMappingView.expenseAccountList,g.selectedOption),z=N(a.accountMappingView.billPayAccountList,l.selectedOption),Z=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),L=$(a.accountMappingView.prepaidExpensesAccountList,S.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),D=$(a.accountMappingView.accruedExpensesAccountList,y.selectedOptions),J=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=On(a.accountMappingView.expenseAccounts1099FilingAccountList,O),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:G?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:Z?.accountId,selectedPrepaidExpensesAccountIds:L.map(w=>w.accountId),selectedFixedAssetsAccountIds:h.map(w=>w.accountId),selectedAccruedExpensesAccountIds:D.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:J.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:Q}))},onBackClick:()=>{ye(c)===!1?(i("../../dashboard"),e(je())):e(ce())},onSaveClick:()=>{e(Ae()),o&&K.track(wn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(kn),Qn=()=>{const e=T(),a=F(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(M.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(M.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(S=>k(S)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(S=>Ce(S)),E=S=>{g(S)};return t.jsxs(Jn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Hn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:ye(a),onClickMenuIcon:()=>E(!0)})]})},Wn=U.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,Xn=R(function(e,a){const i=k(e),c=De(e),o=Me(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:K}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),Yn=()=>{const e=T(),a=F(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(y=>k(y)),b=m(y=>y.billPaySetupApproverViewState.fetchState),g=m(y=>y.remiSetupApproverViewState.fetchState),l=m(y=>we(y)),E=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const S=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const j=y=>{n(y)};return S?.loggedInUserRoleMap!=null?t.jsxs(Wn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:j}),t.jsx(Xn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:S.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},qn=U.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 1 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,et=R(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=k(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(q(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(Y(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Le(o,s,n,r))},onRemoveConnection:n=>{e(Oe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=F(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>k(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Be(d,o?.loggedInUserRoleMap),E=Fe(d,o?.loggedInUserRoleMap),S=Re(d,o?.loggedInUserRoleMap),j=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const y=I=>{s(I)};return b||l||g||S?t.jsxs(qn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:y}),t.jsx(et,{navigate:e,location:a,companyId:j,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:S,isTreasuryEnabled:E,onClickMenuIcon:()=>{y(!0)}})]}):t.jsx(B,{})},tt=U.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
height: 100%;
|
|
28
|
+
width: 100%;
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
`,at=R(function(e,a){const{companyId:i}=a,c=k(e),o=a.roleMap.bill_pay_admin,n=Ke(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&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:s,stripeKey:Se.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:K}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(q("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(Y(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(He(n,s,r))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(Je())},handleResetCardPaymentErrorStatuses:()=>{e(Ze())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=Ln(n);e(Ge({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Mn),st=()=>{const e=T(),a=F(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>k(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Dn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,S=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=V();u.useEffect(()=>{S!=null&&i($e(S,!1))},[S,i]),u.useEffect(()=>{s||(r(!0),i(X()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(X())},[l,E]);const y=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:y}),t.jsx(at,{navigate:e,location:a,companyId:S,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{y(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=R(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Ye())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>k(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>Xe(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
|
|
34
|
+
display: flex;
|
|
35
|
+
height: 100%;
|
|
36
|
+
width: 100%;
|
|
37
|
+
flex: 1 1 auto;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
+
`,lt=U.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
height: 100%;
|
|
44
|
+
width: 100%;
|
|
45
|
+
flex: 1 1 auto;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
+
`,rt=()=>{const e=P(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(l=>k(l)).companyId??x.getSignedInUserTenant(a)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>qe(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(q("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(Y(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=U.div`
|
|
50
|
+
display: flex;
|
|
51
|
+
height: 100%;
|
|
52
|
+
width: 100%;
|
|
53
|
+
flex: 1 1 auto;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
align-items: center;
|
|
56
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
+
`,ie=({appContent:e})=>{const a=P(),i=T(),c=F(),[o,n]=u.useState(!1),s=m(h=>k(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(M.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(M.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(M.isTreasuryEnabled),E=m(h=>le(h)),S=fe(s),j=he(g,s),y=!j&&E,I=Bn(s,b,g),{areTenantIdsInSync:O}=Fn();u.useEffect(()=>{O&&a(tn(p,y))},[p,a,y,O]);const A=m(h=>an(h,y)),G=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),Z=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:L}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Rn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{L(!0)},isLoading:G,isBankingOnlyTenant:j,isCardsOnlyTenant:S,onAddressClick:h=>{const D=function(H,Q){let w=`/${H}/settings/my_profile`;return w=w.concat(`/new/${Q}`),w}(r,h),J=_n(c.state?.pathnameStackToGoBack,c.pathname);i(D,{state:{pathnameStackToGoBack:J}})},onGetOtp:h=>{const D={...A.myProfileLocalData,phone:h};a(te({localData:D})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,D)=>{a(on(h,D,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>k(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Zt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>k(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(M.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(W,{children:[yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Qn,{})}),Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Kn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Gn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),jn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(B,{})})]}):t.jsx(W,{children:t.jsx(C,{path:"*",element:t.jsx(B,{})})}):null}function pt(e){return t.jsxs(W,{children:[t.jsx(C,{path:"/",element:t.jsx(Yn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Zn,{}):t.jsx(B,{})}),t.jsx(C,{path:"*",element:t.jsx(B,{})})]})}export{Zt as default};
|