@zeniai/web-app-ui 5.0.53-dev → 5.0.54-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-DTMsA7Yj.js +1 -0
- package/dist/assets/AddressScreen-CcaxSfVo.js +9 -0
- package/dist/assets/{AiCfoScreen-BZewpLje.js → AiCfoScreen-B5lAePrp.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-CJR4AuBS.js → BillPayApprovalRoutes-DPnfb8zl.js} +1 -1
- package/dist/assets/{BillPayRoutes-DnKnqkZc.js → BillPayRoutes-BBZidA16.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-CIapP8vT.js → BusinessVerificationPageScreen-BhuG90mr.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-C_dKBRuF.js → ChargeCardRoutes-DX76xSoe.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-CO0ra3b3.js → CompanyPassportScreen-DpH624sQ.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BzFFitvW.js → ConnectionAuthScreen-BX7Pa_YN.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-C1yW7Iny.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DAfAcoCp.js → CustomerOnboardingRoutes-B8wYKuDN.js} +1 -1
- package/dist/assets/DashboardRoutes-DGhgHRhk.js +20 -0
- package/dist/assets/{DefaultTenantHome-CoIL9zlW.js → DefaultTenantHome-CoxCqmlf.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DmlqBc99.js → DomesticWireDetailScreen-Dvg1eLYN.js} +3 -3
- package/dist/assets/DrawerScreen-B-sRWR4S.js +1 -0
- package/dist/assets/{EntityDetailRoutes-BUJ_kkZN.js → EntityDetailRoutes-D1XR-owB.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BeIoMNyV.js → ExpenseAutomationRoutes-BsYvzSsm.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-CCz00Z1b.js +1 -0
- package/dist/assets/{MagicLinkRoutes-Qs5jpSqt.js → MagicLinkRoutes-Bu7hVADb.js} +21 -21
- package/dist/assets/MagicLinkSignInScreen-DsDVQQsC.js +12 -0
- package/dist/assets/{MobileAppDrawer--t6IvFv1.js → MobileAppDrawer-BQOESYmo.js} +1 -1
- package/dist/assets/NotFoundScreen-C8VJaibs.js +1 -0
- package/dist/assets/{NotificationRoutes-sTDUm3UC.js → NotificationRoutes-CAjZQlzL.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-DzntFAmM.js +1 -0
- package/dist/assets/{PeopleRoutes-tT0eCYuT.js → PeopleRoutes-_9Hs8cVl.js} +5 -5
- package/dist/assets/PerformanceRoutes-CTkbM-C6.js +1 -0
- package/dist/assets/{Preview-6f9LxPkS.js → Preview-By4v_mKm.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DUGBXHYt.js → QBOConnectionScreen-B-MlUjKI.js} +1 -1
- package/dist/assets/ReferralListScreen-RMa3rgwl.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-VgH79DJX.js → ReimbursementApprovalRoutes-BfuW7QsT.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-COa1H9AX.js → ReimbursementApprovalRuleDetailScreen-CKkTHOgV.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-B1ZkkbHf.js → ReimbursementRoutes-FPCDfDNQ.js} +4 -4
- package/dist/assets/ReportsRoutes-yAN3M1vB.js +1 -0
- package/dist/assets/RewardsRoutes-C_kw-ByV.js +1 -0
- package/dist/assets/ScreenRoutes-DDOPHzW7.js +2 -0
- package/dist/assets/{SettingsRoutes-BxKE1ve9.js → SettingsRoutes-C6DKlWjz.js} +1 -1
- package/dist/assets/{SetupPagesScreen-CQlX6aNj.js → SetupPagesScreen-BBerJQI5.js} +1 -1
- package/dist/assets/SignInScreen-C7QqxJ8Y.js +1 -0
- package/dist/assets/SignOutScreen-CB1LomnI.js +9 -0
- package/dist/assets/{TaskListScreen-Bgae74H_.js → TaskListScreen-CDIu8qtm.js} +2 -2
- package/dist/assets/TaskRoutes-A-CziYUE.js +9 -0
- package/dist/assets/TransactionDetailRoutes-DL0DiNI5.js +1 -0
- package/dist/assets/{TransactionDetailScreen-PaWtkTEH.js → TransactionDetailScreen-D0bGNbu6.js} +2 -2
- package/dist/assets/{TransactionListRoutes-DHWR3aVx.js → TransactionListRoutes-3wrw7u3L.js} +1 -1
- package/dist/assets/{TreasuryRoutes-NSgI8Cqk.js → TreasuryRoutes-CsXQXXp2.js} +5 -5
- package/dist/assets/{VendorsRoutes-pV_XlyDs.js → VendorsRoutes-C3O2vhe9.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-CwR-EPA8.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-CKJA4fI8.js → ZeniAccountRoutes-D7JUPZxy.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-OSIiPbP1.js +9 -0
- package/dist/assets/{accountMappingHelper-Blov7ltS.js → accountMappingHelper-CczsFzU8.js} +1 -1
- package/dist/assets/{analytics-DMOhZ7ep.js → analytics-i6vOjy-6.js} +1 -1
- package/dist/assets/{analyticsHelper-CcQrbJpT.js → analyticsHelper-Dd3idKMc.js} +1 -1
- package/dist/assets/{core-BpuExePz.js → core-BsJxSguc.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BRoMr-Xr.js → decodeURIComponentSafe-Bp5j7gGB.js} +1 -1
- package/dist/assets/{dnd-Ool1WkEK.js → dnd-BqCDXelY.js} +1 -1
- package/dist/assets/{empty-BBb-0fG-.js → empty-D5Oa0fhU.js} +1 -1
- package/dist/assets/{empty-BUF0u-3V.js → empty-D9Z_gqRM.js} +1 -1
- package/dist/assets/{emptyVideoElement-Uzds3hpE.js → emptyVideoElement-D41eczF_.js} +1 -1
- package/dist/assets/{epic-CrZKkaDL.js → epic-sKmWpqZI.js} +1 -1
- package/dist/assets/getLocaleForTenant-BdkMpp_Q.js +1 -0
- package/dist/assets/{index-64WyzcEc.js → index-AkOyjrrT.js} +1 -1
- package/dist/assets/{index-CPMhopDR.js → index-B0mC9t-Y.js} +2 -2
- package/dist/assets/{index-6Rjzb8Pu.js → index-BTUjigpK.js} +1 -1
- package/dist/assets/{index-Cx6RZ5wc.js → index-BkCVhoyD.js} +1 -1
- package/dist/assets/{index-DidLjpq0.js → index-C_W1h50m.js} +14432 -14396
- package/dist/assets/{index-B2-OsYcb.js → index-DaBhzNLK.js} +1 -1
- package/dist/assets/{index-CiibyDuy.js → index-DfgLrt7Q.js} +1 -1
- package/dist/assets/{lexical-9B5gs5tG.js → lexical-DEnPiQ42.js} +1 -1
- package/dist/assets/{liveblocks-3WpI1obg.js → liveblocks-UD7liCcn.js} +1 -1
- package/dist/assets/{lottie-DFxKNIfK.js → lottie-Ct3047c5.js} +1 -1
- package/dist/assets/{mui-Bpme9BmU.js → mui-DnnuWLRL.js} +1 -1
- package/dist/assets/{pathToGoBack-JibONr5D.js → pathToGoBack-C1WhhbQW.js} +1 -1
- package/dist/assets/{pdf-CAA7iyNe.js → pdf-DUV5M5M4.js} +4 -4
- package/dist/assets/{pdf-lib-CRl3mCcE.js → pdf-lib-BVxjensB.js} +1 -1
- package/dist/assets/{plaid-CTMaHWW7.js → plaid-BQcpbHIu.js} +1 -1
- package/dist/assets/{pusher-By_9ihm6.js → pusher-DcJourS6.js} +1 -1
- package/dist/assets/{react-Df7GsDYV.js → react-BDwASVQ9.js} +1 -1
- package/dist/assets/{react-DMWTUnLu.js → react-CBkwrldV.js} +1 -1
- package/dist/assets/{react-CyvOMBtf.js → react-CCYPhKs0.js} +1 -1
- package/dist/assets/{react-CHKpQfw4.js → react-D0p9gUgD.js} +1 -1
- package/dist/assets/{react-B9l5xNkw.js → react-D2poDKQT.js} +1 -1
- package/dist/assets/{react-C9RjToco.js → react-DHcpugZ0.js} +1 -1
- package/dist/assets/{recharts-D5_tB-NC.js → recharts-ColGXU81.js} +1 -1
- package/dist/assets/{routePaths-D7d1SJs7.js → routePaths-TGpk-uov.js} +1 -1
- package/dist/assets/{sentry-z6zkwC0R.js → sentry-BMtgafda.js} +1 -1
- package/dist/assets/{url-C-EF6k4f.js → url-Bl7RYhJD.js} +1 -1
- package/dist/assets/{url-CVCmlGqq.js → url-BwBwNsXX.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C2sPakGi.js +1 -0
- package/dist/assets/{useDeviceId-C8t7Lzes.js → useDeviceId-otTlvlMz.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-KQZwBlZC.js +1 -0
- package/dist/assets/{useInitialThreadRequest-C2mjRKeW.js → useInitialThreadRequest-BUEtuoP8.js} +1 -1
- package/dist/assets/{utils-Cb7KsPLv.js → utils-BlFIrWFi.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C5hIBso3.js → withTransactionSidePanel-DcrBlKeK.js} +2 -2
- package/dist/assets/{zeni-epic-state-RQBIdQMH.js → zeni-epic-state-xHyXPoIL.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-D2DRkabM.js +0 -1
- package/dist/assets/AddressScreen-Dz7dukxj.js +0 -9
- package/dist/assets/CustomerOnboardingAuthScreen-D-b9p5yP.js +0 -1
- package/dist/assets/DashboardRoutes-D-Yad_Gu.js +0 -20
- package/dist/assets/DrawerScreen-Ojlk_glq.js +0 -1
- package/dist/assets/FeaturePreviewScreen-XMp6Ks_m.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-C7anMkyc.js +0 -12
- package/dist/assets/NotFoundScreen-DwnzoLJU.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-C7spTjMj.js +0 -1
- package/dist/assets/PerformanceRoutes-CK0d_z0a.js +0 -1
- package/dist/assets/ReferralListScreen-Cf0Eqtgm.js +0 -5
- package/dist/assets/ReportsRoutes-DE0ZO7KW.js +0 -1
- package/dist/assets/RewardsRoutes--KPLXTbA.js +0 -1
- package/dist/assets/ScreenRoutes-DjE90VcS.js +0 -2
- package/dist/assets/SignInScreen-CjjSOtbr.js +0 -1
- package/dist/assets/SignOutScreen-Cff_01TR.js +0 -9
- package/dist/assets/TaskRoutes-BFnfWd1X.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BqiPhNjn.js +0 -1
- package/dist/assets/WiseConfirmationScreen-ryAAdtIC.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BoeVpxsO.js +0 -9
- package/dist/assets/getLocaleForTenant-CjnKm7X5.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-D5Yjge45.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Bjj9kjVA.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-UD7liCcn.js";import{A as d}from"./AddressScreen-CcaxSfVo.js";import i from"./NotFoundScreen-C8VJaibs.js";import"./sentry-BMtgafda.js";import{n as s,o as r}from"./core-BsJxSguc.js";import"./zeni-epic-state-xHyXPoIL.js";import"./recharts-ColGXU81.js";import"./index-C_W1h50m.js";import"./mui-DnnuWLRL.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./utils-BlFIrWFi.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-UD7liCcn.js";import{a as h}from"./sentry-BMtgafda.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-BsJxSguc.js";import{q as $,h as D,z as L,A as K,B as J,y as N,d as C,f as S,m as z,j as b,r as F}from"./index-C_W1h50m.js";import{J0 as k,gM as R,eN as U,J1 as q,c0 as G,J2 as O,k6 as V}from"./zeni-epic-state-xHyXPoIL.js";import{n as H}from"./mui-DnnuWLRL.js";import Q from"./NotFoundScreen-C8VJaibs.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]="975d0afc-b1a6-4f1f-8c36-89e97f2c7221",e._sentryDebugIdIdentifier="sentry-dbid-975d0afc-b1a6-4f1f-8c36-89e97f2c7221")}catch{}})();const W=H.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,X=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=U(e),a=t.roleMap!=null&&q(t.roleMap),r=i||c==="user_address"||G(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=F(r?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=r?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=Y(a);e(V({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=j(),{addressId:s,addressType:u}=E(),f=$(),A=D(),I=L.getSignedInUser(),[g,v]=h.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),x=K();if(I==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{g||s==null||(v(!0),r(R(s,!1)))},[g,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?d.jsx(J,{fetchState:p,style:{backgroundColor:A.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(N,{analytics:C,onLoad:P}),d.jsx(W,{windowSize:f,children:d.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):d.jsx(Q,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,Y as t};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-UD7liCcn.js";import{a as r}from"./sentry-BMtgafda.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-BsJxSguc.js";import{K as ce,cF as ue,z as de,q as me,cG as pe,cH as fe,cI as he,cJ as $,y as Se,d as v,O as q,cK as ge,cL as Ce,f as be,a1 as ke,cM as we,R as Ie,s as Pe,r as G,aX as Ee,cN as Te}from"./index-C_W1h50m.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Py as ve,eM as Ue,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Re,fs as Ne}from"./zeni-epic-state-xHyXPoIL.js";import{D as je,n as U,P as qe,S as Ge}from"./mui-DnnuWLRL.js";import{p as Ve}from"./pathToGoBack-C1WhhbQW.js";import"./recharts-ColGXU81.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./utils-BlFIrWFi.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="e556d9b6-9dad-41b9-a327-76fd64a1f5e6",s._sentryDebugIdIdentifier="sentry-dbid-e556d9b6-9dad-41b9-a327-76fd64a1f5e6")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[K,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||b==null||b===""||(E(b),T(O),Q.current=!0)},[b,O]);const J=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(E(k),T(!0),a(ve()))},[k,t,a]);const X=c.masterTOSInfo,w=X?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Y}=$(N,t),Z=Y.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Z,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:J,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ge)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
`,We=U.div`
|
|
6
6
|
height: 100vh;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,ze=U(
|
|
8
|
+
`,ze=U(qe)`
|
|
9
9
|
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
10
10
|
color: ${({theme:s})=>s.colors.grey4};
|
|
11
11
|
`;export{dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-UD7liCcn.js";import{a as y}from"./sentry-BMtgafda.js";import{j as B,u as U,h as j,g as v,N as $,k as T,l as N,n as O,o as h}from"./core-BsJxSguc.js";import{eN as L,Mj as A,L$ as b,x9 as w,x3 as F,x7 as x,wY as M,M1 as W,w$ as q,xb as z,xa as C}from"./zeni-epic-state-xHyXPoIL.js";import{h as P,z as k,B as V,a1 as Y,bx as G,aa as _,by as H}from"./index-C_W1h50m.js";import"./mui-DnnuWLRL.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-CKkTHOgV.js";import K from"./NotFoundScreen-C8VJaibs.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]="da225e2a-cb3c-4443-84b7-ce29c94436cf",e._sentryDebugIdIdentifier="sentry-dbid-da225e2a-cb3c-4443-84b7-ce29c94436cf")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(Y(G)),X=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=f.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-3WpI1obg.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as S}from"./core-BpuExePz.js";import{eN as Z,LB as Ge,bv as At,GE as ra,bo as xt,bD as ue,LC as Bt,wt as Et,xD as Ue,x0 as ca,bn as je,LD as da,LE as pa,c0 as ua,LF as ma,jq as Dt,LG as jt,LH as Tt,yc as Oe,wI as Be,LI as ba,wh as it,LJ as ha,Bo as ga,wl as ya,wr as Pt,LK as Ie,LL as Ne,xE as ze,LM as Sa,LN as fa,xH as Ze,LO as Ia,xU as ka,LP as Ft,xo as ot,xt as va,LQ as wa,LR as pe,LS as Rt,LT as Lt,LU as Vt,fH as Ca,wN as Me,cv as $t,LV as Aa,gC as xa,LW as Ba,LX as Ea,eT as Ut,eR as Mt,LY as He,LZ as Da,L_ as ja,Jk as We,L$ as Ta,Jl as ie,Jm as qe,M0 as Pa,M1 as Fa,M2 as Ra,xv as lt,xs as La,M3 as Va,M4 as $a,M5 as Ua,xe as Ma,M6 as _a,M7 as Ga,M8 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vz as Za,M9 as Ha,Bb as Wa,Bh as qa,s6 as Ja,xF as Ka,yj as Qa,jO as fe,Ma as Xa,Mb as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mc as tn,Md as ke,ik as an,Me as rt,Mf as nn,ip as on,iK as ln,yx as sn,Mg as rn,k9 as cn,yn as dn,Mh as ct,yr as pn,yw as un,yt as mn,yl as bn,Mi as Wt,wC as hn,Mj as gn,Mk as yn,fz as Sn,fy as fn,fx as In,jR as kn,k7 as dt,ki as vn,pF as wn,j_ as Cn,yp as An,iv as xn,kn as Bn,Ml as En,im as Dn,pw as jn,Mm as Tn,xk as Pn,bE as Fn,bs as Rn,Il as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-RQBIdQMH.js";import{h as me,z as L,A as ve,G as Je,a as oe,d as y,aI as Ee,B as ce,o as E,x as Te,e as j,b4 as _n,p as z,N as Ke,s as D,q as we,b5 as pt,b6 as ut,b7 as Gn,af as On,E as Nn,aC as zn,y as qt,D as Qe,Z as Xe,b8 as Zn,ao as Jt,b9 as Hn,I as Wn,g as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,w as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-DidLjpq0.js";import{n as V,S as di}from"./mui-Bpme9BmU.js";import{A as mt}from"./AddressScreen-Dz7dukxj.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DmlqBc99.js";import{a as f}from"./sentry-z6zkwC0R.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-D5Yjge45.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Bjj9kjVA.js";import{u as Xt}from"./useInitialThreadRequest-C2mjRKeW.js";import De from"./NotFoundScreen-DwnzoLJU.js";import{D as bi}from"./DrawerScreen-Ojlk_glq.js";import{M as Yt}from"./MobileAppDrawer--t6IvFv1.js";import{F as ea}from"./FeaturePreviewScreen-XMp6Ks_m.js";import{S as Re}from"./SetupPagesScreen-CQlX6aNj.js";import{B as hi}from"./BillPayApprovalRoutes-CJR4AuBS.js";import{FallBackRoute as gi}from"./ScreenRoutes-DjE90VcS.js";import"./recharts-D5_tB-NC.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./utils-Cb7KsPLv.js";import"./analyticsHelper-CcQrbJpT.js";import"./routePaths-D7d1SJs7.js";import"./BusinessVerificationPageScreen-CIapP8vT.js";import"./ReimbursementApprovalRuleDetailScreen-COa1H9AX.js";import"./getLocaleForTenant-CjnKm7X5.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]="81f969a9-80fb-43ce-a840-3904c7c22229",e._sentryDebugIdIdentifier="sentry-dbid-81f969a9-80fb-43ce-a840-3904c7c22229")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-UD7liCcn.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as S}from"./core-BsJxSguc.js";import{eN as Z,LB as Ge,bv as At,GE as ra,bo as xt,bD as ue,LC as Bt,wt as Et,xD as Ue,x0 as ca,bn as je,LD as da,LE as pa,c0 as ua,LF as ma,jq as Dt,LG as jt,LH as Tt,yc as Oe,wI as Be,LI as ba,wh as it,LJ as ha,Bo as ga,wl as ya,wr as Pt,LK as Ie,LL as Ne,xE as ze,LM as Sa,LN as fa,xH as Ze,LO as Ia,xU as ka,LP as Ft,xo as ot,xt as va,LQ as wa,LR as pe,LS as Rt,LT as Lt,LU as Vt,fH as Ca,wN as Me,cv as $t,LV as Aa,gC as xa,LW as Ba,LX as Ea,eT as Ut,eR as Mt,LY as He,LZ as Da,L_ as ja,Jk as We,L$ as Ta,Jl as ie,Jm as qe,M0 as Pa,M1 as Fa,M2 as Ra,xv as lt,xs as La,M3 as Va,M4 as $a,M5 as Ua,xe as Ma,M6 as _a,M7 as Ga,M8 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vz as Za,M9 as Ha,Bb as Wa,Bh as qa,s6 as Ja,xF as Ka,yj as Qa,jO as fe,Ma as Xa,Mb as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mc as tn,Md as ke,ik as an,Me as rt,Mf as nn,ip as on,iK as ln,yx as sn,Mg as rn,k9 as cn,yn as dn,Mh as ct,yr as pn,yw as un,yt as mn,yl as bn,Mi as Wt,wC as hn,Mj as gn,Mk as yn,fz as Sn,fy as fn,fx as In,jR as kn,k7 as dt,ki as vn,pF as wn,j_ as Cn,yp as An,iv as xn,kn as Bn,Ml as En,im as Dn,pw as jn,Mm as Tn,xk as Pn,bE as Fn,bs as Rn,Il as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-xHyXPoIL.js";import{h as me,z as L,A as ve,K as Je,a as oe,p as y,aI as Ee,B as ce,o as E,y as Te,d as j,b4 as _n,r as z,R as Ke,s as D,q as we,b5 as pt,b6 as ut,b7 as Gn,af as On,G as Nn,aC as zn,E as qt,D as Qe,I as Xe,b8 as Zn,ao as Jt,b9 as Hn,M as Wn,f as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,x as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-C_W1h50m.js";import{n as V,S as di}from"./mui-DnnuWLRL.js";import{A as mt}from"./AddressScreen-CcaxSfVo.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-Dvg1eLYN.js";import{a as f}from"./sentry-BMtgafda.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-C2sPakGi.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-KQZwBlZC.js";import{u as Xt}from"./useInitialThreadRequest-BUEtuoP8.js";import De from"./NotFoundScreen-C8VJaibs.js";import{D as bi}from"./DrawerScreen-B-sRWR4S.js";import{M as Yt}from"./MobileAppDrawer-BQOESYmo.js";import{F as ea}from"./FeaturePreviewScreen-CCz00Z1b.js";import{S as Re}from"./SetupPagesScreen-BBerJQI5.js";import{B as hi}from"./BillPayApprovalRoutes-DPnfb8zl.js";import{FallBackRoute as gi}from"./ScreenRoutes-DDOPHzW7.js";import"./recharts-ColGXU81.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./utils-BlFIrWFi.js";import"./analyticsHelper-Dd3idKMc.js";import"./routePaths-TGpk-uov.js";import"./BusinessVerificationPageScreen-BhuG90mr.js";import"./ReimbursementApprovalRuleDetailScreen-CKkTHOgV.js";import"./getLocaleForTenant-BdkMpp_Q.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]="a650b578-d0bd-42f2-9cad-030bfd1ac015",e._sentryDebugIdIdentifier="sentry-dbid-a650b578-d0bd-42f2-9cad-030bfd1ac015")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-UD7liCcn.js";import{a as V}from"./sentry-BMtgafda.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-BsJxSguc.js";import{A as ce,a as ue,aI as de,z as E,y as pe,d as M,aa as v,f as z,bt as le,ao as me,s as B,ap as P}from"./index-C_W1h50m.js";import{M7 as fe,eN as G,rx as ye,GI as Se,xe as ge,zX as Ie,Cu as be,D7 as he,E0 as De,Mu as Oe,Mv as Te,Mw as ke,Mx as Ce,My as Ve,J1 as we,Lw as Ae,Jd as Ne,k6 as _e,fz as xe,fy as Fe,fx as ve,pF as ze,pw as Ee,pt as Me,j_ as Be,rG as Pe,rE as R,bC as L,rS as j,ct as Re}from"./zeni-epic-state-xHyXPoIL.js";import{n as Le}from"./mui-DnnuWLRL.js";import{c as U}from"./routePaths-TGpk-uov.js";import{M as je}from"./MobileAppDrawer-BQOESYmo.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="cc43e607-0c8b-466a-bbe5-a6e4a0a00458",e._sentryDebugIdIdentifier="sentry-dbid-cc43e607-0c8b-466a-bbe5-a6e4a0a00458")}catch{}})();const Ue=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-3WpI1obg.js";import{a as V}from"./sentry-z6zkwC0
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:h,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:h}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:J,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:W,purposeOfAccountDescription:X,regulatedStatus:H,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:Y}=t,x=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:x==null||x===""?void 0:x,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(F=>F.length===2?F:P(F))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:J,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:W?.selectedOption??"",purposeOfAccountDescription:X,regulatedStatus:H??"",regulatedStatusDescription:K,usNexus:Q,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?P(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Pe({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Me(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(ve(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(xe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Qe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,h]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??E.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(he(n,!0));break;case"reimbursement":r(be(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{h(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:M,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,v(i)?"Settings":void 0)}})(a)}),v(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:M,currentTenant:c,productType:e,isSettings:v(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Qe as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-3WpI1obg.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Qt,o as te}from"./core-BpuExePz.js";import{eN as ie,bs as Be,N_ as _a,eR as Se,eS as Ie,eT as Ae,fO as Me,cq as ze,N$ as $e,O0 as $a,sM as Sa,jy as Ia,O1 as Aa,gC as ca,ze as aa,zg as Ga,zh as Ya,jo as Ct,O2 as Ge,z2 as pt,O3 as Xt,O4 as Jt,z5 as wa,O5 as en,Mr as Pa,qY as ht,zb as Za,gN as an,O6 as ft,O7 as Ye,bq as tn,O8 as nn,fz as Ta,fy as Fa,zL as rn,fx as va,M7 as sn,O9 as gt,cj as bt,cL as on,Mq as ua,Al as cn,Oa as rt,zX as Oa,Ob as yt,Am as dn,MR as ln,An as un,Bh as mn,s6 as Cn,Bb as pn,zw as St,zp as hn,Oc as fn,fQ as gn,zF as It,zJ as At,fP as bn,Od as yn,A7 as Et,Oe as Sn,Of as In,Og as An,zH as kt,zs as Dt,z8 as _t,zB as wt,zz as Pt,zD as En,zf as st,Oh as Tt,Oi as xa,zU as Ea,J6 as Ft,cM as Ka,Oj as kn,Ok as Dn,Ol as _n,Om as wn,zR as Ha,Ae as Pn,Aa as Tn,zN as Fn,Ac as vn,A2 as On,A4 as xn,On as vt,Ak as Ot,GE as Bn,Oo as Ln,Op as Rn,Oq as Un,Or as xt,Os as jn,AH as Nn,zW as Bt,zQ as da,zV as Vn,Ot as Hn,Ou as Mn,y$ as zn,Ov as Lt,Ow as Rt,Ox as $n,z1 as Gn,z0 as ot,Oy as Yn,Oz as Zn,OA as Kn,J2 as Wn,OB as Wa,OC as qn,vC as Ut,k6 as Qn,gD as Xn,AM as Jn,OD as jt,OE as er,AN as ar,OF as tr,dc as nr,sG as rr,AC as sr,Aw as xe,bv as or,bD as ir,cv as cr,bE as dr,Il as lr}from"./zeni-epic-state-RQBIdQMH.js";import{z as J,A as Re,a as oe,d as Z,B as Ze,bX as Ba,c6 as ur,p as ve,c7 as mr,c8 as Cr,q as ma,aI as Fe,s as be,be as qa,c9 as pr,y as Ca,j as La,h as Qa,e as Q,D as Xa,ca as hr,G as Nt,al as Ja,bq as Je,cb as Ma,cc as fr,x as et,a1 as gr,cd as br,ao as Vt,N as za,I as Ht,g as Mt,ce as yr,cf as Sr,cg as Ir,ch as Ar,ci as Er,o as ka,cj as kr,ck as Dr,cl as ja,w as _r,cm as wr,cn as Pr,co as Tr,cp as Fr,a4 as vr}from"./index-DidLjpq0.js";import{n as _e,D as zt,S as Or}from"./mui-Bpme9BmU.js";import{a as c}from"./sentry-z6zkwC0R.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Ue,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-CQlX6aNj.js";import Ra from"./NotFoundScreen-DwnzoLJU.js";import{M as ha}from"./MobileAppDrawer--t6IvFv1.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-D5Yjge45.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-Bjj9kjVA.js";import{v as ct}from"./utils-Cb7KsPLv.js";import{t as Ur}from"./AddressScreen-Dz7dukxj.js";import"./recharts-D5_tB-NC.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./analyticsHelper-CcQrbJpT.js";import"./routePaths-D7d1SJs7.js";import"./BusinessVerificationPageScreen-CIapP8vT.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]="4204ac0d-7126-43d1-a904-0f0a4b4d3e0f",e._sentryDebugIdIdentifier="sentry-dbid-4204ac0d-7126-43d1-a904-0f0a4b4d3e0f")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
|
|
1
|
+
import{j as s}from"./liveblocks-UD7liCcn.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Qt,o as te}from"./core-BsJxSguc.js";import{eN as ie,bs as Be,N_ as _a,eR as Se,eS as Ie,eT as Ae,fO as Me,cq as ze,N$ as $e,O0 as $a,sM as Sa,jy as Ia,O1 as Aa,gC as ca,ze as aa,zg as Ga,zh as Ya,jo as Ct,O2 as Ge,z2 as pt,O3 as Xt,O4 as Jt,z5 as wa,O5 as en,Mr as Pa,qY as ht,zb as Za,gN as an,O6 as ft,O7 as Ye,bq as tn,O8 as nn,fz as Ta,fy as Fa,zL as rn,fx as va,M7 as sn,O9 as gt,cj as bt,cL as on,Mq as ua,Al as cn,Oa as rt,zX as Oa,Ob as yt,Am as dn,MR as ln,An as un,Bh as mn,s6 as Cn,Bb as pn,zw as St,zp as hn,Oc as fn,fQ as gn,zF as It,zJ as At,fP as bn,Od as yn,A7 as Et,Oe as Sn,Of as In,Og as An,zH as kt,zs as Dt,z8 as _t,zB as wt,zz as Pt,zD as En,zf as st,Oh as Tt,Oi as xa,zU as Ea,J6 as Ft,cM as Ka,Oj as kn,Ok as Dn,Ol as _n,Om as wn,zR as Ha,Ae as Pn,Aa as Tn,zN as Fn,Ac as vn,A2 as On,A4 as xn,On as vt,Ak as Ot,GE as Bn,Oo as Ln,Op as Rn,Oq as Un,Or as xt,Os as jn,AH as Nn,zW as Bt,zQ as da,zV as Vn,Ot as Hn,Ou as Mn,y$ as zn,Ov as Lt,Ow as Rt,Ox as $n,z1 as Gn,z0 as ot,Oy as Yn,Oz as Zn,OA as Kn,J2 as Wn,OB as Wa,OC as qn,vC as Ut,k6 as Qn,gD as Xn,AM as Jn,OD as jt,OE as er,AN as ar,OF as tr,dc as nr,sG as rr,AC as sr,Aw as xe,bv as or,bD as ir,cv as cr,bE as dr,Il as lr}from"./zeni-epic-state-xHyXPoIL.js";import{z as J,A as Re,a as oe,p as Z,B as Ze,bX as Ba,c6 as ur,r as ve,c7 as mr,c8 as Cr,q as ma,aI as Fe,s as be,be as qa,c9 as pr,E as Ca,j as La,h as Qa,d as Q,D as Xa,ca as hr,K as Nt,al as Ja,bq as Je,cb as Ma,cc as fr,y as et,a1 as gr,cd as br,ao as Vt,R as za,M as Ht,f as Mt,ce as yr,cf as Sr,cg as Ir,ch as Ar,ci as Er,o as ka,cj as kr,ck as Dr,cl as ja,x as _r,cm as wr,cn as Pr,co as Tr,cp as Fr,a4 as vr}from"./index-C_W1h50m.js";import{n as _e,D as zt,S as Or}from"./mui-DnnuWLRL.js";import{a as c}from"./sentry-BMtgafda.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Ue,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-BBerJQI5.js";import Ra from"./NotFoundScreen-C8VJaibs.js";import{M as ha}from"./MobileAppDrawer-BQOESYmo.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-C2sPakGi.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-KQZwBlZC.js";import{v as ct}from"./utils-BlFIrWFi.js";import{t as Ur}from"./AddressScreen-CcaxSfVo.js";import"./recharts-ColGXU81.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./analyticsHelper-Dd3idKMc.js";import"./routePaths-TGpk-uov.js";import"./BusinessVerificationPageScreen-BhuG90mr.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]="f32767ad-4788-478a-a3ff-88262432ad63",e._sentryDebugIdIdentifier="sentry-dbid-f32767ad-4788-478a-a3ff-88262432ad63")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-UD7liCcn.js";import{a as g}from"./sentry-BMtgafda.js";import{j as v,h as x,u as k,l as T,g as O,k as E}from"./core-BsJxSguc.js";import{z as b,b0 as F,y as P,d as L,f as V,aa as N,b1 as j,ao as A,ap as U,s as B}from"./index-C_W1h50m.js";import{eN as D,fB as _,rx as M,fw as R,c0 as z,Lw as G,bn as Y,pF as H,pt as Z,j_ as $,lu as S,Lx as q,bC as J,ct as C,lC as K,lF as Q}from"./zeni-epic-state-xHyXPoIL.js";import"./mui-DnnuWLRL.js";import{c as W}from"./routePaths-TGpk-uov.js";import{M as X}from"./MobileAppDrawer-BQOESYmo.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="6afcd465-ddb3-4e7b-8311-dc55ddd70534",n._sentryDebugIdIdentifier="sentry-dbid-6afcd465-ddb3-4e7b-8311-dc55ddd70534")}catch{}})();const ee=E(function(n){const a=R(n),i=b.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),t=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const t=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,w={companyInfo:{...t,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.companySubIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:w}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(q(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n($({files:e}))},onDeleteFile:e=>{n(Z(e))},onEditFileName:(e,t)=>{n(H(e,t.split(".")[0]))}}})(j);function de(){const n=v(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),t=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??b.getSignedInUserTenant(l)?.companyId;if(b.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||t!=="Not-Started"||d==null||(p(!0),a(_(d)))},[c,t,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(M())},[o,a]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,N(i)?"Settings":"Company Passport")}),N(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:N(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-UD7liCcn.js";import{a}from"./sentry-BMtgafda.js";import{h as D,u as v,g as u,N as w}from"./core-BsJxSguc.js";import{Ih as O,eN as A,fi as _,ml as U,fK as E,fh as j,eO as L,Io as F}from"./zeni-epic-state-xHyXPoIL.js";import{u as $,z as c,L as g,D as k,o as H}from"./index-C_W1h50m.js";import{n as z}from"./mui-DnnuWLRL.js";import{t as R}from"./getLocaleForTenant-BdkMpp_Q.js";import{g as P,Q as G}from"./QBOConnectionScreen-B-MlUjKI.js";import"./recharts-ColGXU81.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./utils-BlFIrWFi.js";import"./empty-D5Oa0fhU.js";import"./pdf-lib-BVxjensB.js";import"./index-DfgLrt7Q.js";import"./url-BwBwNsXX.js";import"./index-DaBhzNLK.js";import"./decodeURIComponentSafe-Bp5j7gGB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="0ae4bc04-71c6-498a-885b-aaa1e72bddfe",t._sentryDebugIdIdentifier="sentry-dbid-0ae4bc04-71c6-498a-885b-aaa1e72bddfe")}catch{}})();const K=z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-UD7liCcn.js";import{z as n}from"./index-C_W1h50m.js";import{g as p}from"./QBOConnectionScreen-B-MlUjKI.js";import"./sentry-BMtgafda.js";import{u as a,N as i}from"./core-BsJxSguc.js";import"./zeni-epic-state-xHyXPoIL.js";import"./recharts-ColGXU81.js";import"./mui-DnnuWLRL.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./utils-BlFIrWFi.js";import"./empty-D5Oa0fhU.js";import"./pdf-lib-BVxjensB.js";import"./index-DfgLrt7Q.js";import"./url-BwBwNsXX.js";import"./index-DaBhzNLK.js";import"./decodeURIComponentSafe-Bp5j7gGB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-DAfAcoCp.js → CustomerOnboardingRoutes-B8wYKuDN.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-UD7liCcn.js";import{t as $e,A as Ce}from"./AddressScreen-CcaxSfVo.js";import Me from"./NotFoundScreen-C8VJaibs.js";import{a as g}from"./sentry-BMtgafda.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as ze,n as qe,o as z}from"./core-BsJxSguc.js";import{x as de,A as le,z as B,a as ue,h as Ke,p as _,s as V,y as H,d as N,B as we,f as Y,ak as Qe,q as Je,al as Ie,j as te,am as Ze,an as ke,o as He,ao as We,ap as xe,aq as Ye}from"./index-C_W1h50m.js";import{bn as Xe,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I$ as st,bR as it,c0 as ge,rL as he,rw as rt,Jb as X,rM as _e,GI as ct,k6 as Ue,Jc as Ve,Jd as dt,Je as lt,Jf as ut,j0 as pt,j3 as mt,ry as Be,rK as gt,bC as Te,ct as ht,rY as Ee,pF as ft,pt as yt,j_ as St,fz as bt,fy as Ct,fx as It,Jg as kt,rq as xt,rZ as Tt,s0 as Et,s3 as Ot,s9 as Pt,cS as At}from"./zeni-epic-state-xHyXPoIL.js";import{n as fe}from"./mui-DnnuWLRL.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-B-MlUjKI.js";import"./recharts-ColGXU81.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./utils-BlFIrWFi.js";import"./empty-D5Oa0fhU.js";import"./pdf-lib-BVxjensB.js";import"./index-DfgLrt7Q.js";import"./url-BwBwNsXX.js";import"./index-DaBhzNLK.js";import"./decodeURIComponentSafe-Bp5j7gGB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="0643ca54-dcc6-48d0-bdd0-2fedd0d1684a",t._sentryDebugIdIdentifier="sentry-dbid-0643ca54-dcc6-48d0-bdd0-2fedd0d1684a")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=Ke(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:E}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,K=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),M===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),K===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:E,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-UD7liCcn.js";import{l as K,g as k,u as z,h as N,j as q,k as H,s as $a,n as nt,o as D}from"./core-BsJxSguc.js";import{eN as L,Jw as Me,bC as Yt,bq as de,KJ as za,hS as qa,KK as wt,KL as Za,hV as ot,KM as Re,KN as Ha,h_ as Qa,KO as xt,KP as Ja,i2 as st,KQ as je,KR as Xa,cj as it,KS as Wa,KT as en,JQ as tn,iY as an,KU as nn,bn as ye,KV as Vt,Jk as W,bc as Gt,ja as Nt,mt as Kt,iV as $t,Jm as ee,Jl as Z,f2 as on,fk as sn,KW as rn,KX as cn,KY as zt,KZ as ge,tB as ve,tC as Ie,tZ as ue,tT as te,tG as Ae,K_ as ln,K$ as dn,L0 as un,L1 as qt,L2 as be,L3 as mn,dB as Ue,qd as Zt,L4 as pn,L5 as hn,L6 as fn,L7 as ct,II as lt,jq as me,u5 as dt,ql as gn,L8 as bn,tD as Dt,qg as ce,qc as Ht,L9 as oe,La as Cn,Lb as ut,IG as mt,sd as Qt,Lc as _n,Ld as kn,Le as Sn,Lf as pt,sq as yn,Lg as vn,tF as Ot,sc as Jt,Lh as se,Li as In,bv as Xt,u9 as Wt,Lj as An,Lk as En,Ll as Tn,Lm as ht,u4 as wn,Ln as xn,tE as Ft,u8 as ea,Lo as re,Lp as Dn,Lq as On,Lr as ta,jf as aa,mq as na,jk as oa,mo as sa,mn as ra,mm as ia,rB as Fn,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Ls as Un,Dd as Yn,Lt as Vn,Lu as Gn,Lv as Nn,b5 as ft,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Qn,eT as Jn,eR as Xn}from"./zeni-epic-state-xHyXPoIL.js";import{z as j,R as Q,s as O,d as A,D as $,aP as Wn,K as Ee,y as Te,aQ as ca,f as V,aR as eo,A as we,aS as la,a as Ye,p as M,h as to,aT as ao,aU as no,q as oo,c as da,_ as so,aV as ro,aI as ua,aW as io,aX as co,O as lo,aY as xe,aZ as uo,al as mo,r as po,M as ho,a_ as fo,a$ as _e}from"./index-C_W1h50m.js";import{n as gt}from"./mui-DnnuWLRL.js";import{a as _}from"./sentry-BMtgafda.js";import{w as ma}from"./withTransactionSidePanel-DcrBlKeK.js";import{b as pa,t as pe,e as ae,a as bt,v as go}from"./routePaths-TGpk-uov.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-C2sPakGi.js";import{c as De,b as bo}from"./useFetchSuggestedQuestionsWhenReady-KQZwBlZC.js";import Se from"./NotFoundScreen-C8VJaibs.js";import{t as ha}from"./analyticsHelper-Dd3idKMc.js";import{C as Co}from"./CompanyPassportScreen-DpH624sQ.js";import{F as _o}from"./FeaturePreviewScreen-CCz00Z1b.js";import{R as ko}from"./ReferralListScreen-RMa3rgwl.js";import"./recharts-ColGXU81.js";import"./analytics-i6vOjy-6.js";import"./plaid-BQcpbHIu.js";import"./dnd-BqCDXelY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ct3047c5.js";import"./lexical-DEnPiQ42.js";import"./pdf-DUV5M5M4.js";import"./utils-BlFIrWFi.js";import"./TransactionDetailScreen-D0bGNbu6.js";import"./decodeURIComponentSafe-Bp5j7gGB.js";import"./MobileAppDrawer-BQOESYmo.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]="4847f0bd-0b69-4b39-a48d-40199c9b0f9e",e._sentryDebugIdIdentifier="sentry-dbid-4847f0bd-0b69-4b39-a48d-40199c9b0f9e")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),u=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=u?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${Q}/agingDetailedReport`,timezone:Me()}),[]),m=_.useMemo(()=>r!=null?Yt(r):de(),[r]),C=N(),d=q(),h=k(T=>za(T,m,o)),S=_.useCallback(()=>{o!=null&&h.fetchState!=="In-Progress"&&h.fetchState!=="Completed"&&C(qa(o,m))},[m]),y=_.useCallback(()=>{d("../../",{relative:"path"})},[]),F=_.useCallback((T,B)=>{C(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{C(wt({downloadState:T}))},[]),v=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);d(B);const he=O(g.state?.pathnameStackToGoBack,g.pathname);d(B,{state:{pathnameStackToGoBack:he}})}},[f,e]),w=_.useCallback(()=>{h.vendor!=null&&A.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),h.vendor.id,h.vendor.name)},[h.vendor,m]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{h.fetchState==="Completed"&&w()},[w,h.fetchState]),l.jsx(Wn,{apAgingDetail:h,downloadParams:c,reportDate:m,analytics:A,onTransactionClick:v,onReload:S,onBackClick:y,onColumnSortConfigChanged:F,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=N(),n=q(),o=k(v=>Za(v)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(v=>v.tenantState.currentTenantId),f=k(v=>L(v)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${Q}/agingReport`,timezone:Me()}),[]),c=o.apAgingUIState.selectedDate??de(),m=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(c))},[]);_.useEffect(()=>{m()},[]);const C=_.useCallback(()=>{n("../",{relative:"path"})},[]),d=_.useCallback(v=>{t(Re({searchString:v}))},[]),h=_.useCallback((v,w)=>{t(Re({sortKey:w,sortOrder:v}))},[]),S=_.useCallback(v=>{n(`./${v}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),y=_.useCallback(v=>{t(Re({downloadState:v}))},[]),F=_.useCallback((v,w)=>{},[]),E=_.useCallback((v,w)=>{t(Re({selectedDate:v,agingDateSelectionType:w})),t(ot(v))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:v=>v.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:A,onReloadReport:m,onBackClick:C,onSearchTextChange:d,onSortOrderChange:h,onEntityNameClick:S,updateDownloadStateHandler:y,onSelectedDateChanged:E,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:u}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${Q}/agingDetailedReport`,timezone:Me()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),m=N(),C=q(),d=k(w=>Ha(w,c,o)),h=_.useCallback(()=>{o!=null&&d.fetchState!=="In-Progress"&&d.fetchState!=="Completed"&&m(Qa(o,c))},[c]),S=_.useCallback(()=>{C("../../",{relative:"path"})},[]),y=_.useCallback((w,T)=>{m(xt({sortKey:w,sortOrder:T}))},[]),F=_.useCallback(w=>{m(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(u!=null){const T=pa({id:w.transactionId,type:w.transactionType},u);C(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);C(T,{state:{pathnameStackToGoBack:B}})}},[u,e]),v=_.useCallback(()=>{d.customer!=null&&A.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),d.customer.id,d.customer.name)},[d.customer,c]);return _.useEffect(()=>{h()},[]),_.useEffect(()=>{d.fetchState==="Completed"&&v()},[d.fetchState,v]),l.jsx(eo,{arAgingDetail:d,downloadParams:p,reportDate:c,analytics:A,onTransactionClick:E,onReload:h,onBackClick:S,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=N(),n=q(),o=k(E=>Ja(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(E=>L(E)),f=u.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${Q}/agingReport`,timezone:Me()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(st(p))},[]);_.useEffect(()=>{c()},[]);const m=_.useCallback(()=>{n("../",{relative:"path"})},[]),C=_.useCallback(E=>{t(je({searchString:E}))},[]),d=_.useCallback((E,v)=>{t(je({sortKey:v,sortOrder:E}))},[]),h=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(je({downloadState:E}))},[]),y=_.useCallback((E,v)=>{t(je({selectedDate:E,agingDateSelectionType:v})),t(st(E))},[]),F=_.useCallback((E,v)=>{t(Xa({nodeId:E,isCollapsed:v}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:E=>E.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:A,onReloadReport:c,onBackClick:m,onSearchTextChange:C,onSortOrderChange:d,onEntityNameClick:h,updateDownloadStateHandler:S,onSelectedDateChanged:y,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?A.trackZeniAccountsCashBalancePromoClicked("Move Money"):(A.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else A.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:A}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=ye(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:A}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=it(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=it(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: 1 1 auto;
|
|
4
|
+
min-height: 100%;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
+
`,Do=gt.div`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex: 1 1 auto;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
+
`;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=N(),u=z(),{tenantEmailDomain:f}=K(),g=to();return l.jsxs(xo,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:b=>{b.trim().length>=2?i(ee({searchString:b,searchOrigin:"navbar"})):b.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:b=>{n!=null&&A?.trackSearch(V.Event.search,Fo(a),b.type,b.name,n);const p=ae(b,f),c=O(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:o===!0&&r!=null?l.jsx(no,{onClick:r}):null}),l.jsx(Do,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Pt(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=z(),n=N(),{useFeatureGate:o}=Ye(),{isFeatureEnabled:r}=o(M.isDepositAccountsFeatureEnabled),s=k(h=>h.cashBalanceState.fetchState),i=k(h=>h.cardBalanceState.fetchState),u=j.getSignedInUser();if(u==null)throw Error("Can't access dashboard detail without signing in...");const f=Vt((h=>{const S=Gt(h,"/").split("/");return S[S.length-1]})(t.pathname));let g="Not-Started",b="";const p=$.getLocalizedStrings();switch(f){case"cash_balance":g=s,b=p.reportTitleById.cash_balance;break;case"card_balance":g=i,b=p.reportTitleById.card_balance;break;default:console.error(`${f} is not supported!`)}const{isAiCfoAccessEnabled:c,onAskAiCfoClick:m}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:f==="card_balance"?"Card Balance":"Cash Balance"});De({isDataReady:g==="Completed"});const C=k(h=>h.entityAutoCompleteState.autoCompleteText.navbar),d=k(h=>W(h,"navbar"));return _.useEffect(()=>{g==="Not-Started"&&function(h,S,y){switch(S){case"card_balance":h($t());break;case"cash_balance":h(Nt()),y===!0&&h(Kt());break;default:throw new Error(`balance report type ${S} is not yet supported`)}}(n,f,r)},[u,n,g]),l.jsxs(l.Fragment,{children:[g==="Completed"?l.jsx(Te,{analytics:A,onLoad:h=>((S,y)=>{switch(y){case"card_balance":S.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${y}!`)}})(h,f)}):null,l.jsx(Oo,{title:b,reportId:f,autoCompleteText:C,entityAutoCompleteView:d,isAiCfoAccessEnabled:c,onAskAiCfoClick:m})]})}const Fo=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Po=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=N(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Ee(),u=oo(),f=lo(u),g=$a(),b=k(B=>on(B)),p=b.uiState?.currentChatSessionId,c=b.allSessionsWithOrderedQuestionAnswers??Po,m=j.getSignedInUser()?.userId,C=da(),d=bo()&&C&&r!=null,h=so(),S=ro(h),{useDynamicConfig:y}=Ye(),{configValue:F}=y(ua.aiCfoMessageDynamicConfig),E=_.useMemo(()=>Array.isArray(F.default_message_list)?F.default_message_list:[],[F.default_message_list]),v=_.useMemo(()=>(S!=null&&S.length>0?S:E).slice(0,2),[E,S]),w=_.useCallback((B,he)=>{if(m==null||B.trim()==="")return;const fe=io(g.getState());if(f){const Fe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Fe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!fe}})}else{if(fe)return t(sn(B)),void s(!0);i(B),s(!0),co(t,B,"insights_section",p,c,m,he,void 0)}},[c,p,t,f,o.pathname,o.state,a,n,s,i,g,r,m]),T=_.useCallback(()=>{if(f){const B=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0)},[f,o.pathname,o.state,a,n,s,r]);return _.useMemo(()=>{if(d)return{onAskSomethingElseClick:T,onSuggestedQuestionClick:w,suggestedQuestions:v}},[d,T,w,v])}const Bo=H(function(e){const a=rn(e),t=cn(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${Q}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue("month")),e(te(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ge({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(xe),Ro=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),r=k(s=>zt(s)).mode==="compare_mode";return l.jsx(Bo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Lo=H(function(e){const a=dn(e),t=un(e),n=qt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${Q}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(be({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(xe),Mo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashPosition"}),r=k(s=>qt(s)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},G=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Je(){return l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(J,{})}),l.jsx(D,{path:"/:forecastId",element:l.jsx(J,{})}),l.jsx(D,{path:"/:forecastId/*",element:l.jsx(Se,{})})]})}const Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Yo=H(function(e){const a=Zt(e),t=pn(e),n=hn(e),o=fn(e),r=ct(e),{scrollPosition:s,...i}=r,u=t.reportTitle,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${Q}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Ht(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(oe({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(gn())},onResyncReports:()=>{e(dt("net_burn_or_income_by_classes"))}}})(xe),Vo=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),i=k(h=>ct(h)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(h=>ut(h.forecastState,g??"")),p=k(h=>Zt(h)),c=k(h=>mt(h)),m=k(h=>me(h)),C=i.mode==="compare_mode",d=p.dataAvailable;return _.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const h=b?.forecastPeriod,S=d!=null&&h.endDate.isAfter(d?.endDate)===!0?d:h;a(te(e.firstMonthOfFY,{startDate:S.endDate.startOf(f),endDate:S?.endDate}))}},[g]),l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,analytics:A,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Go=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},No=H(function(e){const a=Qt(e),t=_n(e),n=kn(e),o=Sn(e),r=pt(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.operating_expenses,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${Q}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Go(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Jt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(yn())},onResyncReports:()=>{e(dt("operating_expenses_by_classes"))}}})(xe),Ko=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardOpEx"}),i=k(y=>pt(y)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(y=>ut(y.forecastState,g??"")),p=k(y=>Qt(y)),c=k(y=>mt(y)),m=k(y=>me(y)),C=i.mode==="compare_mode",d=p.dataAvailable;_.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const y=b?.forecastPeriod,F=d!=null&&y.endDate.isAfter(d?.endDate)===!0?d:y;a(te(e.firstMonthOfFY,{startDate:F.endDate.startOf(f),endDate:F?.endDate}))}},[g]);const h=we(),S=h?.loggedInUserRole!=null&&Xt(h?.loggedInUserRole)!==!0;return l.jsx(No,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,forecastIdFromUrlPath:r,analytics:A,hasTransactionAccess:S,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},$o=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},zo=H(function(e){const a=Wt(e),t=An(e),n=En(e),o=Tn(e),r=ht(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.revenue,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${Q}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=$o(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(ea(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(xn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(wn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(xe),qo=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardRevenue"}),i=k(d=>ht(d)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(d=>ut(d.forecastState,g??"")),p=k(d=>Wt(d)).dataAvailable,c=i.mode==="compare_mode",m=k(d=>me(d)),C=k(d=>mt(d));return _.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const d=b?.forecastPeriod,h=p!=null&&d.endDate.isAfter(p?.endDate)===!0?p:d;a(te(e.firstMonthOfFY,{startDate:h.endDate.startOf(f),endDate:h?.endDate}))}},[g]),l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:m,isCompareModeOn:c,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:A,reportsResyncFetchState:C.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Zo=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Ho=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=W(e,"navbar");return{report:a,analytics:A,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{A.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ta(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(uo),Qo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Ho,{tenantEmailDomain:a,location:t,navigate:n})},Jo=gt.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: 1 1 auto;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
background-color: ${e=>e.theme.colors.grey5};
|
|
19
|
+
align-items: center;
|
|
20
|
+
`,le=3,Ct=1;function Xo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;De({isDataReady:!0});const u={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...u});break;case"revenue":i=l.jsx(qo,{...u});break;case"net_burn_or_income":i=l.jsx(Vo,{...u});break;case"cash_position":i=l.jsx(Mo,{...u});break;case"top_expenses":i=l.jsx(Qo,{...u});break;case"cash_in_cash_out":i=l.jsx(Ro,{...u});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Jo,{children:i}):null}function J(){const e=z(),a=N(),{forecastId:t}=K();let n="Not-Started";const o=k(c=>pt(c).fetchState),r=k(c=>ht(c).fetchState),s=k(c=>ct(c).fetchState),i=k(c=>c.cashPositionState.fetchState),u=k(c=>c.topExState.fetchState),f=k(c=>c.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k(c=>L(c)),b=g?.company?.companyInfo?.firstMonthOfFY??1,p=Vt((c=>{const m=Gt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(p){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=u;break;case"cash_in_cash_out":n=f;break;default:console.error(`${p} is not supported!`)}return _.useEffect(()=>{n==="Not-Started"&&function(c,m,C,d){switch(m){case"operating_expenses":c(ia(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Jt(!1,d)));break;case"revenue":c(ra(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(ea(!1,d)));break;case"net_burn_or_income":c(sa(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Ht(!1,d)));break;case"cash_position":c(oa(!0));break;case"top_expenses":c(na());break;case"cash_in_cash_out":c(aa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,p,b,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(Te,{analytics:A,onLoad:c=>((m,C)=>{const d=e.state?.referrer;switch(C){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,d);break;case"revenue":m.trackPageLoaded(V.Event.revenues,d);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,d);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,d);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,d);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,d);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,p)}):null,l.jsx(Xo,{firstMonthOfFY:b,fetchState:n,reportId:p,forecastId:t})]})}var Xe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Ca(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var _t={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Xe?173:189,"=":Xe?61:187,";":Xe?59:186,"'":222,"[":219,"]":221,"\\":220},X={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},rt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},R={16:!1,18:!1,17:!1,91:!1},P={},Le=1;Le<20;Le++)_t["f".concat(Le)]=111+Le;var x=[],Bt=!1,_a="all",Rt=[],Ge=function(e){return _t[e.toLowerCase()]||X[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function jt(e){_a=e||"all"}function ke(){return _a||"all"}var et=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),u=i.length,f=i[u-1],g=f==="*"?"*":Ge(f);if(P[g]){t||(t=ke());var b=u>1?ba(X,i):[];P[g]=P[g].filter(function(p){return!((!n||p.method===n)&&p.scope===t&&function(c,m){for(var C=c.length>=m.length?c:m,d=c.length>=m.length?m:c,h=!0,S=0;S<C.length;S++)d.indexOf(C[S])===-1&&(h=!1);return h}(p.mods,b))})}})};function Lt(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,R)Object.prototype.hasOwnProperty.call(R,r)&&(!R[r]&&a.mods.indexOf(+r)>-1||R[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||R[16]||R[18]||R[17]||R[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Mt(e,a){var t=P["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),x.indexOf(n)===-1&&n!==229&&x.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var C=rt[m];e[m]&&x.indexOf(C)===-1?x.push(C):!e[m]&&x.indexOf(C)>-1?x.splice(x.indexOf(C),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(C))))}),n in R){for(var o in R[n]=!0,X)X[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[rt[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(x.indexOf(17)===-1&&x.push(17),x.indexOf(18)===-1&&x.push(18),R[17]=!0,R[18]=!0);var s=ke();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&Lt(e,t[i],s,a);if(n in P){for(var u=0;u<P[n].length;u++)if((e.type==="keydown"&&P[n][u].keydown||e.type==="keyup"&&P[n][u].keyup)&&P[n][u].key){for(var f=P[n][u],g=f.splitKey,b=f.key.split(g),p=[],c=0;c<b.length;c++)p.push(Ge(b[c]));p.sort().join("")===x.sort().join("")&&Lt(e,f,s,a)}}}}function U(e,a,t){x=[];var n=Ca(e),o=[],r="all",s=document,i=0,u=!1,f=!0,g="+",b=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(u=a.keyup),a.keydown!==void 0&&(f=a.keydown),a.capture!==void 0&&(b=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=ba(X,e)),(e=(e=e[e.length-1])==="*"?"*":Ge(e))in P||(P[e]=[]),P[e].push({keyup:u,keydown:f,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(p){return Rt.indexOf(p)>-1}(s)&&window&&(Rt.push(s),We(s,"keydown",function(p){Mt(p,s)},b),Bt||(Bt=!0,We(window,"focus",function(){x=[]},b)),We(s,"keyup",function(p){Mt(p,s),function(c){var m=c.keyCode||c.which||c.charCode,C=x.indexOf(m);if(C>=0&&x.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var d in R[m]=!1,X)X[d]===m&&(U[d]=!1)}(p)},b))}var tt={setScope:jt,getScope:ke,deleteScope:function(e,a){var t,n;for(var o in e||(e=ke()),P)if(Object.prototype.hasOwnProperty.call(P,o))for(t=P[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;ke()===e&&jt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ge(e)),x.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(P).forEach(function(t){var n=P[t].find(function(o){return o.scope===a&&o.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(e===void 0)Object.keys(P).forEach(function(s){return delete P[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&et(s)});else if(typeof e=="object")e.key&&et(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),et({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:_t,modifier:X,modifierMap:rt};for(var at in tt)Object.prototype.hasOwnProperty.call(tt,at)&&(U[at]=tt[at]);if(typeof window<"u"){var Wo=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=Wo),U},window.hotkeys=U}U.filter=function(){return!0};var Ut=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function es(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,u=o.keydown,f=o.filterPreventDefault,g=f===void 0||f,b=o.enabled,p=b===void 0||b,c=o.enableOnContentEditable,m=c!==void 0&&c,C=_.useRef(null),d=_.useCallback(function(h,S){var y,F;return s&&!s(h)?!g:!!(Ut(h,["INPUT","TEXTAREA","SELECT"])&&!Ut(h,r)||(y=h.target)!=null&&y.isContentEditable&&!m)||!!(C.current===null||document.activeElement===C.current||(F=C.current)!=null&&F.contains(document.activeElement))&&(a(h,S),!0)},n?[C,r,s].concat(n):[C,r,s]);return _.useEffect(function(){if(p)return i&&u!==!0&&(t.keydown=!1),U(e,t||{},d),function(){return U.unbind(e,d)};U.unbind(e,d)},[d,e,p]),C}U.isPressed;const ts=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],as=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),Ce=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ns=(e,a,t,n)=>Ce(void 0,e,_e,a,t),os=(e,a,t,n,o)=>({card:{dimension:ft(_e),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),ss=H(function(e,a){const t=cs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:u,hasUserSeenTreasuryVideo:f,treasuryFetchState:g}=a;let b=n.map((p,c)=>{if(p==="reimbursement_promo_card"||p==="bill_pay_promo_card")return ns(t,p,c);if(p==="zeni_promo_card")return Ce({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,_e,p,c);if(p==="treasury_promo_card")return os(g,p,c,u,f);if(p==="information_card")return Ce(void 0,"Completed",_e,p,c);{const m=o.find(C=>C?.reportId===p);return m?function(C,d,h,S){const y=C.reportId;switch(y){case"card_balance":case"cash_balance":return[as(C,d,h,y,S)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[Ce(C,d,h,y,S)];case"net_burn_or_income_story_card":return[Ce(C,d,h,"net_burn_or_income_story_card",S)];default:return console.error(`card type ${y} not yet supported!`),[]}}(m,m.fetchState,_e,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(b=b.filter(p=>ts.includes(p.card.cardType)==0).filter(p=>{const c=p.data?.availableNumberOfPeriods;return c!=null?c>0:p.card.cardType!="top_expenses"||p.data==null||function(m){if(m==null||m.length===0)return!0;let C=!0;for(const d of m)if(d.balance.available.amount!==0){C=!1;break}return C}(p.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:b,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:W(e,"navbar")},analytics:A,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)A.trackDashboardCardClicked("cards promo",2),A.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&A.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(A.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,u,f,g){switch(u){case"card_balance":i($t());break;case"cash_balance":i(Nt());break;case"operating_expenses":i(ia(!0));break;case"revenue":i(ra(!0));break;case"net_burn_or_income":i(sa(!0));break;case"net_burn_or_income_story_card":i(Qn(!0));break;case"cash_position":i(oa(!0));break;case"top_expenses":i(na());break;case"cash_in_cash_out":i(aa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(f));break;case"task_card":i($n());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(ot(de()));break;case"accounts_receivable_aging":i(st(de()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${u} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{A.trackTimeframeSwitch(ha(r),is(o),"Dashboard"),function(s,i,u){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(ue(u));break;case"top_expenses":s(ta(u));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Nn(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(A.trackUpdateBurnRateCalculatorSettings(r,s,Vn(s)),e(Gn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ee({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ae(o,a.tenantEmailDomain):go(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(fo);function rs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=q(),n=N(),o=z(),r=j.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ye(),u=ye(r),[f,g]=_.useState(!1),[b,p]=_.useState(!1),c=da(),{tenantEmailDomain:m}=K(),{isAiCfoAccessEnabled:C,onAskAiCfoClick:d}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"Dashboard"}),h=k(I=>I.tenantState.fetchState==="Completed"||I.tenantState.activeTenantFetchState.fetchState==="Completed"?L(I):void 0),S=h??j.getSignedInUserTenant(m),y=S.tenantId,F=S.companyId;_.useEffect(()=>{f===!1&&o.state?.message==="activation"&&(n(Fn(F)),g(!0))},[o.state,f,F,n]),_.useEffect(()=>{c&&!b&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),p(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,b,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(M.isApAgingFeatureEnabled),{isFeatureEnabled:v}=s(M.isExpenseAutomationEnabled),{isFeatureEnabled:w}=s(M.isExpenseAutomationEnabledV2),T=w||v&&u,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),he=mo(T),{isFeatureEnabled:fe}=s(M.isArAgingFeatureEnabled),{isFeatureEnabled:Fe}=s(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:kt}=s(M.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(M.isDashboardSidebarNewYearAnimationEnabled),{configValue:St}=i(ua.zeniCardsConfig),va=St.charge_card_cashback_rate_per_transaction==null?.0175:St.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const I=po(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:I.newStack}})}const[yt,Ia]=_.useState(!1),[Ne,Aa]=_.useState(!1);es("command+p, Control+p",I=>{Aa(!Ne),I.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ne]);const vt=h?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const ne=k(I=>L(I)?.excludedResources),Ea=k(I=>I.expenseAutomationViewState.selectedPeriodByTenantId),Ta=!!h?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!h?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=h?.company!=null&&Pn(h.company),Ke=B&&Da,$e=we(),Oa=it($e?.loggedInUserRoleMap),Y=[],It=ne?.resources?.find(I=>I.resource==="/reports/top_expenses")==null,Fa=ne?.resources?.find(I=>I.resource==="/reports/task_card")==null,ze=h?.userRole!=null&&Xt(h?.userRole),Pa=ne?.resources?.find(I=>I.resource==="/bills")==null&&!ze,Ba=ne?.resources?.find(I=>I.resource==="/reimbursements")==null,Ra=Bn($e?.loggedInUserRoleMap),ja=Rn($e?.loggedInUserRoleMap),La=h?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=h?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fundsDetails;It===!1&&Y.push("top_expenses"),Fa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),fe===!1&&Y.push("accounts_receivable_aging"),(T===!1||ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Fe===!1&&Y.push("zeni_accounts_promo_card"),kt===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:At}=ho();_.useLayoutEffect(()=>{yt&&he===T||vt!==!0||!At||ne?.fetchState!=="Completed"&&ne?.fetchState!=="Error"||(Ia(!0),n(jn(r.userId,F,y,!0,!1,Y)))},[yt,r,y,n,It,vt,ne?.fetchState,At]);const Ya=k(I=>I.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Va=k(I=>I.revenueState.uiState.selectedForecast?.id),Ga=k(I=>I.cardBalanceState.fetchState),ie=k(I=>Ln(I,Y,r,w,v,Ke)),Na=ie.fetchState;De({isDataReady:!0});const Et=h?.isTreasuryVideoViewed===!0||ie.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Na==="Completed"?l.jsx(Te,{analytics:A,onLoad:I=>{I.trackPageLoaded(V.Event.dashboard),Ke&&!Et&&I.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:C,onAskAiCfoClick:d,onDragAndDropCard:(I,Ka)=>{const Tt=function(Pe,qe,Be){const Ze=Be.indexOf(Pe),He=Be.indexOf(qe);if(Ze===-1||He===-1||Ze===He)return Be;const Qe=[...Be];return Qe.splice(Ze,1),Qe.splice(He,0,Pe),Qe}(I,Ka,ie.cardsOrdered);Tt.some((Pe,qe)=>Pe!==ie.cardsOrdered[qe])&&n(Mn(Tt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:y,companyId:F,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:fe,isBillPayEnabled:wa,isReimbursementEnabled:Ta,isSummaryCardsFiltered:Ne,isForecastOn:Ya,selectedForecastOnDashboard:Va,isVisitingFirstTime:f,isZeniAccountEnabled:Fe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:T&&ze===!1,selectedPeriod:Ea[y],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Ga,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:Et,treasuryFetchState:xa})]})}const is=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},cs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=we(),a=e?.excludedResources?.find(f=>f.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=k(f=>L(f)),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=Jn(s,r),u=Xn(r);return i===!0||u===!0?l.jsx(nt,{children:l.jsx(D,{path:"/*",element:l.jsx(_o,{})})}):l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(rs,{})}),l.jsx(D,{path:"cash_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"card_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"operating_expenses/*",element:l.jsx(J,{})}),l.jsx(D,{path:"operating_expenses/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"revenue/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"revenue/*",element:l.jsx(J,{})}),l.jsx(D,{path:"net_burn_or_income/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"net_burn_or_income/*",element:l.jsx(J,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_payable_aging/*",element:l.jsx(yo,{})}),l.jsx(D,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(So,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(D,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(D,{path:"cash_position/*",element:l.jsx(J,{})}),l.jsx(D,{path:"top_expenses/*",element:a===!0?l.jsx(J,{}):l.jsx(Se,{})}),l.jsx(D,{path:"cash_in_cash_out/*",element:l.jsx(J,{})}),l.jsx(D,{path:"company_details",element:l.jsx(Co,{})}),l.jsx(D,{path:"referrals/*",element:l.jsx(ko,{})}),l.jsx(D,{path:"*",element:l.jsx(Se,{})})]})}export{js as default};
|