@zeniai/web-app-ui 5.3.24-qa → 5.3.25-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-DBBdkCwK.js → AccountMappingScreen-C0aQk3eU.js} +2 -2
- package/dist/assets/AddressRoutes-sfAfU_xp.js +1 -0
- package/dist/assets/{AddressScreen-B2w4_PKl.js → AddressScreen-BD6hfTYm.js} +2 -2
- package/dist/assets/{AiCfoScreen-CqaebBsK.js → AiCfoScreen-BQBOwbGt.js} +1 -1
- package/dist/assets/{AppDrawer-CKB499oT.js → AppDrawer-DhN1iuHe.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-CZ1LN8um.js → BillPayApprovalRoutes-D-5hMi6f.js} +1 -1
- package/dist/assets/{BillPayRoutes-CQ68uF6m.js → BillPayRoutes-Bl_cSE9O.js} +10 -10
- package/dist/assets/{BusinessVerificationPageScreen-DcWVPrfh.js → BusinessVerificationPageScreen-C37udtB6.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-BXy3FrXI.js → CardsAiCfoScreen-DmUDeMY2.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-Dv_9gHLl.js → ChargeCardRoutes-BbRPoXSC.js} +8 -8
- package/dist/assets/CompanyPassportScreen-C02FQ11m.js +1 -0
- package/dist/assets/ConnectionAuthScreen-MC_AsURR.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-96EM2Iem.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CchBXDRW.js → CustomerOnboardingRoutes-C3c9eOtd.js} +2 -2
- package/dist/assets/{DashboardRoutes-CdzeWYFZ.js → DashboardRoutes-C_2UjNDc.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CsHhgUxV.js → DefaultTenantHome-DhIA-Auv.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-jQEBeMm8.js → DomesticWireDetailScreen-BQNmPyj8.js} +3 -3
- package/dist/assets/{DrawerScreen-BxvAHfn3.js → DrawerScreen-BRJIwisq.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-A1jj_wD6.js → EntityDetailRoutes-DbfX6l2s.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BWhl8VPU.js → ExpenseAutomationRoutes-BTeDD1VK.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-o3aGYwm3.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-RBVExOv1.js → HubSpotOAuthCallbackScreen-WSu5A4Ct.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-wKDejaDE.js → InboxNotificationsProvider-DDRknvRh.js} +1 -1
- package/dist/assets/InvoicingRoutes-BC26Hbp1.js +2 -0
- package/dist/assets/{MagicLinkRoutes-DZNt_dSs.js → MagicLinkRoutes-BjW61OFo.js} +9 -9
- package/dist/assets/{MagicLinkSignInScreen-C8VHmxv1.js → MagicLinkSignInScreen-CuZ2N1Pw.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DpejEUKo.js → MobileAppDrawer-Dt611RZ9.js} +1 -1
- package/dist/assets/NotFoundScreen-RGfzDsux.js +1 -0
- package/dist/assets/{NotificationRoutes-DVdA_FNb.js → NotificationRoutes-BrF6wQ3V.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-dMY5nBa0.js → OAuthConsentScreen-BmxCN9Az.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-D57GW1cM.js → PandLWithForecastRoutes-CHdKE6AL.js} +1 -1
- package/dist/assets/PaymentLinkScreen-DvX14mnT.js +21 -0
- package/dist/assets/{PeopleRoutes-Dn3ixuya.js → PeopleRoutes-DdiAV2ss.js} +3 -3
- package/dist/assets/{PerformanceRoutes-BvYJFI_Z.js → PerformanceRoutes-DJdm2Hjh.js} +1 -1
- package/dist/assets/{Preview-QWFcM5zJ.js → Preview-CscVzNW8.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-C366HwrW.js → QBOConnectionScreen-Ck8uFfex.js} +22 -22
- package/dist/assets/ReimbursementApprovalRoutes-5mZE12FG.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CsvqRnAa.js → ReimbursementApprovalRuleDetailScreen-BFUt_Xh2.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CNEWxfxv.js → ReimbursementRoutes-CLw3cjMk.js} +4 -4
- package/dist/assets/{ReportsRoutes-2VOVKXB1.js → ReportsRoutes-CBUKpJzK.js} +1 -1
- package/dist/assets/RewardsRoutes-BBrOnwnJ.js +1 -0
- package/dist/assets/ScreenRoutes-BUG6uyqt.js +2 -0
- package/dist/assets/{SettingsRoutes-DncRJVSz.js → SettingsRoutes-D9auvf6o.js} +1 -1
- package/dist/assets/{SetupPagesScreen-DeEl3avt.js → SetupPagesScreen-C6kDqRGd.js} +5 -5
- package/dist/assets/{SignInScreen-CjKuVPgf.js → SignInScreen-DRDEbF4D.js} +1 -1
- package/dist/assets/SignOutScreen-uoV20vWX.js +9 -0
- package/dist/assets/{TaskListScreen-DxnAUhd5.js → TaskListScreen-Cln-YyNE.js} +2 -2
- package/dist/assets/{TaskRoutes-BFSJCXvT.js → TaskRoutes-CMDSqiu4.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-DMotJtMw.js +1 -0
- package/dist/assets/{TransactionDetailScreen-O2btGOsz.js → TransactionDetailScreen-B38w1Q4M.js} +1 -1
- package/dist/assets/{TransactionListRoutes-C_J1qRL2.js → TransactionListRoutes-CtUzO7h7.js} +1 -1
- package/dist/assets/{TreasuryRoutes--6WRfqbv.js → TreasuryRoutes-CaCxjqBo.js} +1 -1
- package/dist/assets/{VendorsRoutes-1M6iQid4.js → VendorsRoutes-P3oVwEbQ.js} +12 -12
- package/dist/assets/{WiseConfirmationScreen-uEwTTtUw.js → WiseConfirmationScreen-BCBFNvno.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-DSe57kIf.js → ZeniAccountRoutes-BRGQxOqx.js} +9 -9
- package/dist/assets/{ZeniAccountStatementScreen-wuqmOaNw.js → ZeniAccountStatementScreen-DQaLVOUo.js} +1 -1
- package/dist/assets/{accountMappingHelper-Dxym9iZl.js → accountMappingHelper-L9SkIWKz.js} +1 -1
- package/dist/assets/{analytics-D6lgRN4g.js → analytics-CsbG8awP.js} +1 -1
- package/dist/assets/{analyticsHelper-BAyQ5I4q.js → analyticsHelper-DtAHYi5r.js} +1 -1
- package/dist/assets/{core-dudeiae1.js → core-CGqhbBHO.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DdtJweGV.js → decodeURIComponentSafe-6FvQaIqS.js} +1 -1
- package/dist/assets/{dnd-w5RIXJhq.js → dnd-CyZNzT3I.js} +1 -1
- package/dist/assets/{empty-BQ-kH7ke.js → empty-CIUWZs8G.js} +1 -1
- package/dist/assets/{empty-S4_FsbsM.js → empty-EE_1cMfQ.js} +1 -1
- package/dist/assets/{emptyVideoElement-BOMXiLde.js → emptyVideoElement-CPGcaaig.js} +1 -1
- package/dist/assets/{epic-B6GCyFsa.js → epic-Cxd3kHt9.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-CNM6-ogC.js → expenseAutomationHelper-wwug0Eyp.js} +1 -1
- package/dist/assets/{getLocaleForTenant-Cpc4BQ5R.js → getLocaleForTenant-CSGkphtC.js} +1 -1
- package/dist/assets/{index-CTLvjwvC.js → index-BVFow4eV.js} +1 -1
- package/dist/assets/{index-BqrSHrqP.js → index-BcNWzeQF.js} +1 -1
- package/dist/assets/{index-CRLGPEBi.js → index-BswIxmLx.js} +1 -1
- package/dist/assets/{index-DpPNNcCA.js → index-CoKBrrSw.js} +2175 -2175
- package/dist/assets/{index-JYUQRle9.js → index-CpkJ0bAk.js} +1 -1
- package/dist/assets/{index-B2u8Reic.js → index-Dv01hTrY.js} +1 -1
- package/dist/assets/{index-D5TSKAOG.js → index-QncEC5ur.js} +1 -1
- package/dist/assets/{index-DvQ-vYdk.js → index-tzevB3Ch.js} +2 -2
- package/dist/assets/{lexical-C-raBUAt.js → lexical-C5ZCOEAv.js} +1 -1
- package/dist/assets/{liveblocks-BbYAHGiW.js → liveblocks-D83XGo_c.js} +1 -1
- package/dist/assets/{lottie-DNeeuCiH.js → lottie-DeqWxWVC.js} +1 -1
- package/dist/assets/{mui-DOWmAnEx.js → mui-CD71lp6N.js} +1 -1
- package/dist/assets/{pathToGoBack-DijDyQJF.js → pathToGoBack-CoDJzfH-.js} +1 -1
- package/dist/assets/{pdf-DOlTc5K5.js → pdf-D4eEcTTi.js} +4 -4
- package/dist/assets/{pdf-lib-DldClLY6.js → pdf-lib-Bd7L71QV.js} +1 -1
- package/dist/assets/{plaid-DLQRcG8N.js → plaid-C8_LWTII.js} +1 -1
- package/dist/assets/{pusher-BblTL6fP.js → pusher-BsMqYR11.js} +1 -1
- package/dist/assets/{react-CqBqEhXX.js → react-1_9r2O7V.js} +1 -1
- package/dist/assets/{react-fmNHKjFg.js → react-BEE0PagD.js} +1 -1
- package/dist/assets/{react-C91EH6ov.js → react-CNf4SjYR.js} +1 -1
- package/dist/assets/{react-CE2R_Gca.js → react-Dd8IfcKg.js} +1 -1
- package/dist/assets/{react-DNk2CrYB.js → react-DvKEjk5s.js} +1 -1
- package/dist/assets/{react-Dg9ESyCy.js → react-l2dFGOnI.js} +1 -1
- package/dist/assets/{recharts-B1E_Vcxh.js → recharts-2kmMgB1t.js} +1 -1
- package/dist/assets/{routePaths-CKi0kijJ.js → routePaths-DU2fgaW2.js} +1 -1
- package/dist/assets/{sentry-BOojnQyr.js → sentry-BPfEBx2C.js} +1 -1
- package/dist/assets/{url-9L1oZ1DN.js → url-DSofFSVz.js} +1 -1
- package/dist/assets/{url-Csy-z1a3.js → url-WFx5ES50.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CV2CbS_g.js → useAiCfoDashboardSuggestedQuestionsChips-BBuMQpNs.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C4V1Wf7u.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BMqY0sxt.js → useChargeCardPusherEvents-B1n0Fi92.js} +1 -1
- package/dist/assets/{useDeviceId-DHa0QldK.js → useDeviceId-D_DsCe-9.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BkDgJaeO.js → useEmailConnectResultRefresh-BxNSbaGA.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-LMcL-Aqa.js → useInitialThreadRequest-CP8MsLNf.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-B8w6mJa8.js → useTaskManagerAccess-Dl-8FUHJ.js} +1 -1
- package/dist/assets/{utils-wJEG-Wcu.js → utils-B6XFkcn3.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-e7n25G5R.js → withTransactionSidePanel-D0UiF_in.js} +1 -1
- package/dist/assets/{zeni-epic-state-Dc6DIqGa.js → zeni-epic-state-DASyz1An.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-B_KlQ5l4.js +0 -1
- package/dist/assets/CompanyPassportScreen-CA83T6v2.js +0 -1
- package/dist/assets/ConnectionAuthScreen-D5kWfHq7.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BE65CVvR.js +0 -1
- package/dist/assets/FeaturePreviewScreen-DJVzHSu6.js +0 -1
- package/dist/assets/InvoicingRoutes-Ct661m9L.js +0 -2
- package/dist/assets/NotFoundScreen-DyEaBoCc.js +0 -1
- package/dist/assets/PaymentLinkScreen-DWgevViD.js +0 -21
- package/dist/assets/ReimbursementApprovalRoutes-bETIIvv3.js +0 -1
- package/dist/assets/RewardsRoutes-D-DDx4kZ.js +0 -1
- package/dist/assets/ScreenRoutes-JdLv48Sy.js +0 -2
- package/dist/assets/SignOutScreen-sRADO8nf.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BMeucnIf.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Dlbp0rlc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as B}from"./liveblocks-
|
|
1
|
+
import{j as B}from"./liveblocks-D83XGo_c.js";import{a as o}from"./sentry-BPfEBx2C.js";import{h as K,g as W,u as X,j as m,s as q,l as Y}from"./core-CGqhbBHO.js";import{ag as Z,I as ee,d as G,z as te,q as $,ah as ne,k as ae,S as ce}from"./index-CoKBrrSw.js";import{bn as se,fB as oe,gS as ie,of as H,TD as re,i5 as J,gd as le,o6 as ue,TE as de,TF as pe,tg as ge,lF as me,o4 as Ae,o0 as be,ob as fe,i7 as Ie,TG as ye,TH as Se}from"./zeni-epic-state-DASyz1An.js";import{n as he}from"./mui-CD71lp6N.js";import{M as Ee}from"./MobileAppDrawer-Dt611RZ9.js";import{q as R}from"./QBOConnectionScreen-Ck8uFfex.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-L9SkIWKz.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="bc185fe6-1781-438d-8ff9-01654a7178b6",a._sentryDebugIdIdentifier="sentry-dbid-bc185fe6-1781-438d-8ff9-01654a7178b6")}catch{}})();const l="zeni_pending_projects_enable",u={pending:"pending",ready:"ready"},ve=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as B}from"./liveblocks-BbYAHGiW.js";import{a as o}from"./sentry-BOojnQy
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${a=>a.theme.colors.grey4};
|
|
9
|
-
`,we=Y((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(l),c=i===u.pending||i===u.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:A}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:v,vendorsAccountSection:w,filing1099Section:C}=r,{incomeAccount:x,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:T}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:V,accruedExpensesAccount:O}=w,{bankAccount:M,expenseCategory1099:
|
|
9
|
+
`,we=Y((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(l),c=i===u.pending||i===u.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:A}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:v,vendorsAccountSection:w,filing1099Section:C}=r,{incomeAccount:x,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:T}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:V,accruedExpensesAccount:O}=w,{bankAccount:M,expenseCategory1099:k}=C,b=h(e.accountMappingView.incomeAccountList,x.selectedOption),_=h(e.accountMappingView.expenseAccountList,F.selectedOption),f=h(e.accountMappingView.billPayAccountList,s.selectedOption),j=h(e.accountMappingView.reimbursementsAccountList,T.selectedOption),P=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),D=E(e.accountMappingView.fixedAssetsAccountList,V.selectedOptions),I=E(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),L=E(e.accountMappingView.bankAccounts1099FilingAccountList,M.selectedOptions),y=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,k),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:_?.accountId,selectedBillPayAccountId:f?.accountId,selectedReimbursementsAccountId:j?.accountId,selectedPrepaidExpensesAccountIds:P.map((n=>n.accountId)),selectedFixedAssetsAccountIds:D.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:I.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:L.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:y};a(Se({data:t}))},onBackClick:()=>{$(c)===!1?(i("../../dashboard"),a(ye())):a(J())},onSaveClick:()=>{a(Ie()),A&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(fe(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(l);d===u.pending||d===u.ready||a(r?Ae(e.currentTenant.companyId):be(e.currentTenant.companyId))}}}))(ne),je=()=>{const a=Z(),e=K(),i=W(),c=X(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A(G.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A(G.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:v,isDynamicConfigLoading:w}=r("transaction_categorization_config"),C=!w&&v?.capitalization_enabled===!0,x=te.getSignedInUser(),F=se(x),s=m((t=>oe(t))),{capitalizableAccounts:T,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:V,currencySymbol:O}=m((t=>{const n=t.tenantState.currentTenantId,g=n!=null?t.tenantState.tenantsById[n]:void 0,S=ie(t.companyState,s.companyId);return{capitalizableAccounts:g?.capitalizableAccounts??null,capitalizableAccountOverrides:g?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),q),M=o.useCallback(((t,n)=>{c(H(s.companyId,t,n))}),[c,s.companyId]),k=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[U,N]of g)N===null?delete n[U]:n[U]=N;const[S,Q]=g[0]??[];S!=null&&c(H(s.companyId,S,Q,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),q),_=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[f,j]=o.useState(!1),[P,D]=o.useState(!1);o.useEffect((()=>{f===!1&&(c(J()),j(!0))}),[f]);const I=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(l)===u.pending&&(sessionStorage.removeItem(l),c(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(l)===u.ready&&s?.companyId!=null&&(sessionStorage.removeItem(l),c(ue(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{I&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),R.init("/connection/auth",s.tenantEmailDomain),R.handleClick())}),[I,s?.tenantEmailDomain,c]);const L=m((t=>pe(t))),y=t=>{D(t)};return B.jsxs(ve,{children:[B.jsx(Ee,{isAppContentDrawerOpen:P,handleDrawerToggle:y}),B.jsx(we,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:L,isFiling1099FeatureEnabled:d&&F,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:C,capitalizableAccounts:T,accountNamesById:_,capitalizableAccountOverrides:p,currencySymbol:O,isCapitalizationThresholdSaving:V,onSaveCapitalizationAccountThreshold:M,onSaveCapitalizationAccountThresholds:k,location:i,isSettings:$(i),onClickMenuIcon:()=>y(!0)})]})};export{l as P,je as U,u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-D83XGo_c.js";import{A as o}from"./AddressScreen-BD6hfTYm.js";import i from"./NotFoundScreen-RGfzDsux.js";import"./sentry-BPfEBx2C.js";import{n as s,o as r}from"./core-CGqhbBHO.js";import"./zeni-epic-state-DASyz1An.js";import"./recharts-2kmMgB1t.js";import"./index-CoKBrrSw.js";import"./mui-CD71lp6N.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="31d0e0e8-dcf1-419d-b2be-6dc359df28c9",t._sentryDebugIdIdentifier="sentry-dbid-31d0e0e8-dcf1-419d-b2be-6dc359df28c9")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(o,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(o,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-D83XGo_c.js";import{a as S}from"./sentry-BPfEBx2C.js";import{h as T,u as P,g as j,i as E,j as B,l as U}from"./core-CGqhbBHO.js";import{$,E as M,z as D,U as L,a5 as K,a6 as z,k as C,S as b,a1 as F,X as h,a2 as N}from"./index-CoKBrrSw.js";import{Ui as _,il as R,fB as G,Uj as O,c7 as V,Uk as q,ml as H}from"./zeni-epic-state-DASyz1An.js";import{n as X}from"./mui-CD71lp6N.js";import J from"./NotFoundScreen-RGfzDsux.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="ea67c54e-7c9d-4b1e-9a99-bf790b0c9edb",e._sentryDebugIdIdentifier="sentry-dbid-ea67c54e-7c9d-4b1e-9a99-bf790b0c9edb")}catch{}})();const Q=X.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as n}from"./liveblocks-BbYAHGiW.js";import{a as h}from"./sentry-BOojnQy
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,W=U((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=G(e),a=s.roleMap!=null&&O(s.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:
|
|
9
|
+
`,W=U((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=G(e),a=s.roleMap!=null&&O(s.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=_(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=N(d?.pathnameStackToGoBack);let t=r.poppedPathname??k();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(t=`${t}?${g}`)}o(t,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(b.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(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(F);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=P(),r=j(),{addressId:t,addressType:u}=E(),g=$(),v=M(),I=D.getSignedInUser(),[p,w]=S.useState(t==null),f=B((m=>t!=null?_(m,t).fetchState:"Not-Started")),x=L();if(I==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(t!=null?b.Event.editAddress:b.Event.addAddress),y=l??u;return S.useEffect((()=>{p||t==null||(w(!0),d(R(t,!1)))}),[p,t,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?n.jsx(K,{fetchState:f,style:{backgroundColor:v.colors.grey5}}):t!=null&&f==="Error"?(a(`${k(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(z,{analytics:C,onLoad:A}),n.jsx(Q,{windowSize:g,children:n.jsx(W,{location:r,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(J,{})}const k=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},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{ne as A,Y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-BbYAHGiW.js";import{a as l}from"./sentry-BOojnQyr.js";import{u as Ue,h as Le,g as Fe,j as _,i as Be,l as Re}from"./core-dudeiae1.js";import{a as Ve,e2 as Me,z as $e,$ as Ge,e3 as qe,e4 as Ne,bm as le,e5 as he,e6 as He,bl as ge,a2 as H,a6 as $,l as w,e7 as G,e8 as ze,e9 as We,as as Ye,S as Je,w as Ke,ea as Xe,eb as Ze,at as et,ec as tt,ed as st,ee as at,ef as ot,p as nt,bi as re,eg as it}from"./index-DpPNNcCA.js";import{fA as z,gp as E,gx as W,Ta as lt,gr as Y,gH as rt,fB as dt,j0 as ct,a14 as ut,g4 as mt,je as pt,ja as St,fC as q,gb as ht,a15 as gt,a16 as ft,a17 as Ct,jx as N,gq as kt,gk as de,jK as ce,gm as ue,gs as It,a18 as me,jz as bt,j7 as vt,jl as Et,jv as pe,ji as Pt,jo as xt,gt as wt,gu as yt,gv as Tt,gw as At}from"./zeni-epic-state-Dc6DIqGa.js";import{D as Qt,n as y,S as jt,P as Ot}from"./mui-DOWmAnEx.js";import{u as _t}from"./useAiCfoDashboardSuggestedQuestionsChips-CV2CbS_g.js";import{p as Dt}from"./pathToGoBack-DijDyQJF.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.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]="af2ca7a3-7226-4165-81e6-b5278750ab27",e._sentryDebugIdIdentifier="sentry-dbid-af2ca7a3-7226-4165-81e6-b5278750ab27")}catch{}})();const fe="chat-response-generated";function Ut(e,o){if(o.kind!=="save")return;if(o.fetchState==="In-Progress")return{status:"saving"};if(o.fetchState==="Error")return{status:"failed"};if(o.fetchState!=="Completed")return;const s=E(e).skills.find((p=>p.macroId===o.savedMacroId));return s==null?void 0:{status:"saved",command:s.name}}const Lt=Re((function(e,o){const s=z(e),p=o.isSubmitting,n=s.uiState?.currentChatSessionId,S=n!=null?ht(e.aiCfoState,n):[],c=Ze(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange}),C=gt(e),g=ft(e),P=Ct(e);return{showSampleQuestions:o.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:p,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${et}/tableDownload`,exportDownloadEndPoint:at(),emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,skills:E(e).skills,skillSaveState:Ut(e,P),skillsEnabled:E(e).skillsEnabled,skillsList:E(e).skills,skillsListError:E(e).fetchState==="Error",skillsListLoading:E(e).fetchState==="In-Progress",skillsCanPublish:E(e).canPublish,skillSaving:P.fetchState==="In-Progress",skillSaveError:P.fetchState==="Error",skillVersionHistory:C.macroId!=null?{macroId:C.macroId,versions:C.versions,error:C.fetchState==="Error",loading:C.fetchState==="In-Progress"}:void 0,skillRestoreBody:g.macroId!=null&&g.version!=null?{macroId:g.macroId,version:g.version,instructions:g.instructions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillDetail:N(e).detail,skillDetailError:N(e).fetchState==="Error",skillDetailLoading:N(e).fetchState==="In-Progress",syntheticAnswers:S,resolveSyntheticAnswerCardTile:st(e),resolveSyntheticAnswerPolicyTile:tt(e),...c}}),(function(e,o){const{location:s,currentTenant:p,userId:n,navigate:S,currentChatSessionId:c,allSessionsWithOrderedQuestionAnswers:C,isAiCardCreationEnabled:g,isCardPolicyEnabled:P,setIsAiCfoOpen:x}=o,T=p.tenantEmailDomain;return{onEventReceived:(t,a)=>{if(t===fe&&typeof a.text=="string"&&typeof a.metadata=="object"){const d=a,u=wt(d.type),h=d.metadata.chat_session_id??null,{currentChatSession:k,currentQuestionAnswer:A,currentQuestionAnswerSummary:b}=ge(C,h);u!=="answer"?w.trackAICFOChatResponseGenerated(u,A?.question.questionText??"",d.text,h,it(b,k),d.metadata.message_id??null):w.trackAICFOChatAnswerGenerated(d.text,A?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,yt(d.visualization?.type??"")??null,h,d.summarized_title,d.metadata.message_id??null),e(Tt({chatSessionId:d.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),e(At({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:n}))}},onSubmit:(t,a,d,u,h)=>{t&&re(e,t,a,c,C,n,u,d,void 0,h)},onFetchSkills:()=>{e(W())},onOpenSkill:t=>{e(Pt({macroId:t})),e(xt({macroId:t}))},onSaveSkill:(t,a)=>{e(pe({draft:t,macroId:a}))},onSaveSkillDraft:t=>{const a=t.displayName?.trim()??"",d=t.name?.trim()??"";e(pe({draft:{name:a.length>0?a:d,description:t.description?.trim()??null,instructions:t.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(t,a)=>{e(Et({macroId:t,version:a}))},onDeleteSkill:t=>{e(vt({macroId:t}))},onSetSkillVisibility:(t,a)=>{e(bt({macroId:t,visibility:a}))},onCloseSkillDetail:()=>{e(me())},onRunSkill:(t,a)=>{e(Y()),e(de()),re(e,a,"user_input",void 0,C,n,void 0,void 0,void 0,t),e(me())},updateCurrentInput:t=>{e(ue(t))},onStopSubmit:()=>{},onUpdateScrollYOffset:t=>{e(It(t))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??Dt(1);S(a,{state:{...s.state,pathnameStackToGoBack:t.newStack}}),e(ue(""))},togglePageView:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??`/${p.tenantEmailDomain}/dashboard`;S(a,{state:{...he(s.state),pathnameStackToGoBack:t.newStack,message:"open_ai_cfo_drawer"}}),x(!0)},onCopy:()=>{},onThumbsUp:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"positive",a.questionText,a.answerText))},onThumbsDown:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"negative",a.questionText,a.answerText))},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{e(Y()),c!=null&&e(de());const t=nt(s.state?.pathnameStackToGoBack,s.pathname);S(`/${p.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:t.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(t,a)=>{e(kt({questionAnswerId:t,isCollapsed:a}))},onMenuClick:o.onMenuClick,...ot(e,{isAiCardCreationEnabled:g,isCardPolicyEnabled:P,currentChatSessionId:c,onAfterCardsCreationSubmit:()=>{x(!0),S(`/${T}/cards`,{state:{...s.state}})},onAfterCardPolicySubmit:()=>{x(!0),S(`/${T}/cards/policy`,{state:{...s.state}})}})}}))(Ke(Xe)),os=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Ve(),s=Ue(),p=Le(),n=Fe(),[S,c]=l.useState(!1),C=_((i=>z(i).uiState.isSkillsBrowserOpen===!0)),g=_((i=>E(i).skillsEnabled)),P=l.useCallback((()=>{s(W()),s(lt())}),[s]),x=l.useCallback((()=>{s(Y())}),[s]);l.useEffect((()=>{s(W())}),[s]);const{allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,onCardPolicyVendorSearchTextChange:d}=Me();l.useEffect((()=>{s(rt())}),[s]);const u=_((i=>z(i))),h=$e.getSignedInUser(),{session_id:k}=Be(),A=Ge(),b=Ye(A),f=_((i=>dt(i))),r=u.uiState.currentChatSessionId,J=f.tenantEmailDomain,{handleUploadPromoClose:Ce,isUploadPromoVisible:ke}=qe({isFileUploadEnabled:e,tenantEmailDomain:J}),D=Ne({currentTenant:f,currentChatSessionId:r,aiCfoView:u,skillsEnabled:g,onCloseSkills:x,onOpenSkills:P}),{isSuggestedQuestionsLoading:Ie,suggestedPromptQuestions:be}=_t(),Q=n.state,j=Q?.aiCfoInitialQuestion,K=!!Q?.aiCfoShouldSubmit;l.useEffect((()=>{const i=n.state;if(i?.[le]!==!0)return;c(!0);const I={...i};delete I[le],p(n,{replace:!0,state:I})}),[n.pathname,n.search,n.state,p]);const[ve,U]=l.useState(null),[Ee,L]=l.useState(!1),[Pe,F]=l.useState(void 0),[xe,B]=l.useState(void 0),X=l.useRef(!1);l.useEffect((()=>{if(!X.current&&j!=null&&j!==""){const i=n.state;U(j),L(K),F(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const I=i?.aiCfoSuggestionIndex;B(typeof I=="number"?I:void 0),X.current=!0}}),[j,K,n.state]);const we=l.useCallback((()=>{U(null),L(!1),F(void 0),B(void 0),p(n.pathname,{replace:!0,state:he(n.state)})}),[n.pathname,n.state,p]),Z=l.useMemo((()=>new URLSearchParams(n.search)),[n.search]),ee=Z.get("ref")??Q?.aiCfoRef,R=Z.get("emailRefId")??Q?.aiCfoEmailRefId,te=l.useRef(!1);l.useEffect((()=>{te.current||ee!=="month-end-email"||R==null||r!=null||h==null||(s(ct("controller",h.userId,R,"MONTH_END_EMAIL")),te.current=!0)}),[ee,R,r,s,h]);const O=u.uiState.lastContextMessage;l.useEffect((()=>{O!=null&&O!==""&&r!=null&&(U(O),L(!0),F(void 0),B(void 0),s(ut()))}),[O,r,s]);const ye=f.masterTOSInfo,v=ye?.isMasterTOSAccepted??!1,{visitedSessions:se}=He(r),V=u.fetchState,M=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,ae=r!=null?u.fetchChatSessionHistoryByChatSessionId?.[r]?.fetchState??"Not-Started":"Not-Started",oe=r==null||(u.uiState.chatHistoryNextPageToken[r]?.hasMore??!0),ne=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Te}=ge(ne,r),Ae=Te.length===0;l.useEffect((()=>{v||b||p("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})}),[v,b,p,n.state]);const Qe=l.useCallback((()=>{const i=H(n.state?.pathnameStackToGoBack),I=f.tenantEmailDomain;p(i.poppedPathname??(I!=null?`/${I}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})}),[f.tenantEmailDomain,n.state,p]);l.useEffect((()=>{r!=null&&k!==r&&p(`../ai-cfo/${r}`,{state:{...n.state}})}),[r,k]),l.useEffect((()=>{k!=null&&r==null&&k!=="new_chat"&&k!=="explore"&&s(mt({sessionId:k,agentId:"controller"}))}),[]);const je=l.useMemo((()=>({events:se.map((i=>`private-encrypted-chat-${i}.${fe}`)),eventCallback:(i,I,De)=>De.onEventReceived(i,I)})),[se]);l.useEffect((()=>{V!=="In-Progress"&&M&&s(pt())}),[V,M,s]),l.useEffect((()=>{r!=null&&ae!=="In-Progress"&&oe&&h!=null&&V==="Completed"&&!M&&s(St(r,h.userId))}),[ae,oe,r,h,s]);const ie=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(h==null||k==null)throw Error("Can't access AI Controller page without signing in...");const Oe=r!=null&&u.responseStateByChatSessionId?.[r]?.answer?.fetchState==="In-Progress";if(!v&&b)return m.jsxs(Bt,{children:[m.jsx($,{analytics:w,onLoad:ie}),D.drawerElement,m.jsx(Rt,{children:m.jsx(Se,{children:m.jsx(G,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:Qe,onCompleteClick:()=>{f.userRoleId!=null&&s(q(f.userRoleId))}})})})]});const _e=m.jsxs(m.Fragment,{children:[S&&!v?m.jsx($,{analytics:w,onLoad:ie}):null,m.jsx(G,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,showHeader:!1,togglePageView:v?()=>c(!1):void 0,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})]});return m.jsxs(m.Fragment,{children:[m.jsxs(Ft,{children:[m.jsx($,{analytics:w,onLoad:i=>i.trackPageLoaded(Je.Event.aiCFOPage)}),b&&D.drawerElement,m.jsx(Lt,{...je,currentChatSessionId:r,allSessionsWithOrderedQuestionAnswers:ne,allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,openOnboardingPage:()=>c(!0),userId:h.userId,setIsAiCfoOpen:o,navigate:p,sessionFromUrl:k,location:n,isSubmitting:Oe,isEmptyChatWithSession:Ae,currentTenant:f,emailLinkQuestion:ve??void 0,autoSubmitEmailLinkQuestion:Ee,onEmailLinkQuestionProcessed:we,routedInitialQuestionSource:Pe,routedInitialQuestionSuggestionIndex:xe,onCardPolicyVendorSearchTextChange:d,onMenuClick:b?D.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ke,onUploadPromoClose:Ce,exploreSuggestedPromptQuestions:be,exploreSuggestedPromptQuestionsLoading:Ie,isSkillsOpen:C,isCreateSkillEnabled:g,promoDismissalScope:J}),S&&b?m.jsx(Qt,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:Vt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>c(!1),children:m.jsx(Se,{onClick:i=>i.stopPropagation(),children:m.jsx(G,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})})}):null]}),S&&!b?m.jsx(ze,{open:S,onClose:()=>c(!1),children:m.jsx(We,{children:_e})}):null]})},Se=y(jt)`
|
|
1
|
+
import{j as m}from"./liveblocks-D83XGo_c.js";import{a as l}from"./sentry-BPfEBx2C.js";import{u as Ue,h as Le,g as Fe,j as _,i as Be,l as Re}from"./core-CGqhbBHO.js";import{a as Ve,e2 as Me,z as $e,$ as Ge,e3 as qe,e4 as Ne,bm as le,e5 as he,e6 as He,bl as ge,a2 as H,a6 as $,k as w,e7 as G,e8 as ze,e9 as We,as as Ye,S as Je,w as Ke,ea as Xe,eb as Ze,at as et,ec as tt,ed as st,ee as at,ef as ot,p as nt,bi as re,eg as it}from"./index-CoKBrrSw.js";import{fA as z,gp as E,gx as W,Ta as lt,gr as Y,gH as rt,fB as dt,j0 as ct,a14 as ut,g4 as mt,je as pt,ja as St,fC as q,gb as ht,a15 as gt,a16 as ft,a17 as Ct,jx as N,gq as kt,gk as de,jK as ce,gm as ue,gs as It,a18 as me,jz as bt,j7 as vt,jl as Et,jv as pe,ji as Pt,jo as xt,gt as wt,gu as yt,gv as Tt,gw as At}from"./zeni-epic-state-DASyz1An.js";import{D as Qt,n as y,S as jt,P as Ot}from"./mui-CD71lp6N.js";import{u as _t}from"./useAiCfoDashboardSuggestedQuestionsChips-BBuMQpNs.js";import{p as Dt}from"./pathToGoBack-CoDJzfH-.js";import"./recharts-2kmMgB1t.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.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]="2c3f2e6a-995c-4aa3-a856-d55004eefde6",e._sentryDebugIdIdentifier="sentry-dbid-2c3f2e6a-995c-4aa3-a856-d55004eefde6")}catch{}})();const fe="chat-response-generated";function Ut(e,o){if(o.kind!=="save")return;if(o.fetchState==="In-Progress")return{status:"saving"};if(o.fetchState==="Error")return{status:"failed"};if(o.fetchState!=="Completed")return;const s=E(e).skills.find((p=>p.macroId===o.savedMacroId));return s==null?void 0:{status:"saved",command:s.name}}const Lt=Re((function(e,o){const s=z(e),p=o.isSubmitting,n=s.uiState?.currentChatSessionId,S=n!=null?ht(e.aiCfoState,n):[],c=Ze(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange}),C=gt(e),g=ft(e),P=Ct(e);return{showSampleQuestions:o.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:p,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${et}/tableDownload`,exportDownloadEndPoint:at(),emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,skills:E(e).skills,skillSaveState:Ut(e,P),skillsEnabled:E(e).skillsEnabled,skillsList:E(e).skills,skillsListError:E(e).fetchState==="Error",skillsListLoading:E(e).fetchState==="In-Progress",skillsCanPublish:E(e).canPublish,skillSaving:P.fetchState==="In-Progress",skillSaveError:P.fetchState==="Error",skillVersionHistory:C.macroId!=null?{macroId:C.macroId,versions:C.versions,error:C.fetchState==="Error",loading:C.fetchState==="In-Progress"}:void 0,skillRestoreBody:g.macroId!=null&&g.version!=null?{macroId:g.macroId,version:g.version,instructions:g.instructions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillDetail:N(e).detail,skillDetailError:N(e).fetchState==="Error",skillDetailLoading:N(e).fetchState==="In-Progress",syntheticAnswers:S,resolveSyntheticAnswerCardTile:st(e),resolveSyntheticAnswerPolicyTile:tt(e),...c}}),(function(e,o){const{location:s,currentTenant:p,userId:n,navigate:S,currentChatSessionId:c,allSessionsWithOrderedQuestionAnswers:C,isAiCardCreationEnabled:g,isCardPolicyEnabled:P,setIsAiCfoOpen:x}=o,T=p.tenantEmailDomain;return{onEventReceived:(t,a)=>{if(t===fe&&typeof a.text=="string"&&typeof a.metadata=="object"){const d=a,u=wt(d.type),h=d.metadata.chat_session_id??null,{currentChatSession:k,currentQuestionAnswer:A,currentQuestionAnswerSummary:b}=ge(C,h);u!=="answer"?w.trackAICFOChatResponseGenerated(u,A?.question.questionText??"",d.text,h,it(b,k),d.metadata.message_id??null):w.trackAICFOChatAnswerGenerated(d.text,A?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,yt(d.visualization?.type??"")??null,h,d.summarized_title,d.metadata.message_id??null),e(Tt({chatSessionId:d.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),e(At({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:n}))}},onSubmit:(t,a,d,u,h)=>{t&&re(e,t,a,c,C,n,u,d,void 0,h)},onFetchSkills:()=>{e(W())},onOpenSkill:t=>{e(Pt({macroId:t})),e(xt({macroId:t}))},onSaveSkill:(t,a)=>{e(pe({draft:t,macroId:a}))},onSaveSkillDraft:t=>{const a=t.displayName?.trim()??"",d=t.name?.trim()??"";e(pe({draft:{name:a.length>0?a:d,description:t.description?.trim()??null,instructions:t.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(t,a)=>{e(Et({macroId:t,version:a}))},onDeleteSkill:t=>{e(vt({macroId:t}))},onSetSkillVisibility:(t,a)=>{e(bt({macroId:t,visibility:a}))},onCloseSkillDetail:()=>{e(me())},onRunSkill:(t,a)=>{e(Y()),e(de()),re(e,a,"user_input",void 0,C,n,void 0,void 0,void 0,t),e(me())},updateCurrentInput:t=>{e(ue(t))},onStopSubmit:()=>{},onUpdateScrollYOffset:t=>{e(It(t))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??Dt(1);S(a,{state:{...s.state,pathnameStackToGoBack:t.newStack}}),e(ue(""))},togglePageView:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??`/${p.tenantEmailDomain}/dashboard`;S(a,{state:{...he(s.state),pathnameStackToGoBack:t.newStack,message:"open_ai_cfo_drawer"}}),x(!0)},onCopy:()=>{},onThumbsUp:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"positive",a.questionText,a.answerText))},onThumbsDown:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"negative",a.questionText,a.answerText))},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{e(Y()),c!=null&&e(de());const t=nt(s.state?.pathnameStackToGoBack,s.pathname);S(`/${p.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:t.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(t,a)=>{e(kt({questionAnswerId:t,isCollapsed:a}))},onMenuClick:o.onMenuClick,...ot(e,{isAiCardCreationEnabled:g,isCardPolicyEnabled:P,currentChatSessionId:c,onAfterCardsCreationSubmit:()=>{x(!0),S(`/${T}/cards`,{state:{...s.state}})},onAfterCardPolicySubmit:()=>{x(!0),S(`/${T}/cards/policy`,{state:{...s.state}})}})}}))(Ke(Xe)),os=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Ve(),s=Ue(),p=Le(),n=Fe(),[S,c]=l.useState(!1),C=_((i=>z(i).uiState.isSkillsBrowserOpen===!0)),g=_((i=>E(i).skillsEnabled)),P=l.useCallback((()=>{s(W()),s(lt())}),[s]),x=l.useCallback((()=>{s(Y())}),[s]);l.useEffect((()=>{s(W())}),[s]);const{allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,onCardPolicyVendorSearchTextChange:d}=Me();l.useEffect((()=>{s(rt())}),[s]);const u=_((i=>z(i))),h=$e.getSignedInUser(),{session_id:k}=Be(),A=Ge(),b=Ye(A),f=_((i=>dt(i))),r=u.uiState.currentChatSessionId,J=f.tenantEmailDomain,{handleUploadPromoClose:Ce,isUploadPromoVisible:ke}=qe({isFileUploadEnabled:e,tenantEmailDomain:J}),D=Ne({currentTenant:f,currentChatSessionId:r,aiCfoView:u,skillsEnabled:g,onCloseSkills:x,onOpenSkills:P}),{isSuggestedQuestionsLoading:Ie,suggestedPromptQuestions:be}=_t(),Q=n.state,j=Q?.aiCfoInitialQuestion,K=!!Q?.aiCfoShouldSubmit;l.useEffect((()=>{const i=n.state;if(i?.[le]!==!0)return;c(!0);const I={...i};delete I[le],p(n,{replace:!0,state:I})}),[n.pathname,n.search,n.state,p]);const[ve,U]=l.useState(null),[Ee,L]=l.useState(!1),[Pe,F]=l.useState(void 0),[xe,B]=l.useState(void 0),X=l.useRef(!1);l.useEffect((()=>{if(!X.current&&j!=null&&j!==""){const i=n.state;U(j),L(K),F(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const I=i?.aiCfoSuggestionIndex;B(typeof I=="number"?I:void 0),X.current=!0}}),[j,K,n.state]);const we=l.useCallback((()=>{U(null),L(!1),F(void 0),B(void 0),p(n.pathname,{replace:!0,state:he(n.state)})}),[n.pathname,n.state,p]),Z=l.useMemo((()=>new URLSearchParams(n.search)),[n.search]),ee=Z.get("ref")??Q?.aiCfoRef,R=Z.get("emailRefId")??Q?.aiCfoEmailRefId,te=l.useRef(!1);l.useEffect((()=>{te.current||ee!=="month-end-email"||R==null||r!=null||h==null||(s(ct("controller",h.userId,R,"MONTH_END_EMAIL")),te.current=!0)}),[ee,R,r,s,h]);const O=u.uiState.lastContextMessage;l.useEffect((()=>{O!=null&&O!==""&&r!=null&&(U(O),L(!0),F(void 0),B(void 0),s(ut()))}),[O,r,s]);const ye=f.masterTOSInfo,v=ye?.isMasterTOSAccepted??!1,{visitedSessions:se}=He(r),V=u.fetchState,M=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,ae=r!=null?u.fetchChatSessionHistoryByChatSessionId?.[r]?.fetchState??"Not-Started":"Not-Started",oe=r==null||(u.uiState.chatHistoryNextPageToken[r]?.hasMore??!0),ne=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Te}=ge(ne,r),Ae=Te.length===0;l.useEffect((()=>{v||b||p("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})}),[v,b,p,n.state]);const Qe=l.useCallback((()=>{const i=H(n.state?.pathnameStackToGoBack),I=f.tenantEmailDomain;p(i.poppedPathname??(I!=null?`/${I}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})}),[f.tenantEmailDomain,n.state,p]);l.useEffect((()=>{r!=null&&k!==r&&p(`../ai-cfo/${r}`,{state:{...n.state}})}),[r,k]),l.useEffect((()=>{k!=null&&r==null&&k!=="new_chat"&&k!=="explore"&&s(mt({sessionId:k,agentId:"controller"}))}),[]);const je=l.useMemo((()=>({events:se.map((i=>`private-encrypted-chat-${i}.${fe}`)),eventCallback:(i,I,De)=>De.onEventReceived(i,I)})),[se]);l.useEffect((()=>{V!=="In-Progress"&&M&&s(pt())}),[V,M,s]),l.useEffect((()=>{r!=null&&ae!=="In-Progress"&&oe&&h!=null&&V==="Completed"&&!M&&s(St(r,h.userId))}),[ae,oe,r,h,s]);const ie=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(h==null||k==null)throw Error("Can't access AI Controller page without signing in...");const Oe=r!=null&&u.responseStateByChatSessionId?.[r]?.answer?.fetchState==="In-Progress";if(!v&&b)return m.jsxs(Bt,{children:[m.jsx($,{analytics:w,onLoad:ie}),D.drawerElement,m.jsx(Rt,{children:m.jsx(Se,{children:m.jsx(G,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:Qe,onCompleteClick:()=>{f.userRoleId!=null&&s(q(f.userRoleId))}})})})]});const _e=m.jsxs(m.Fragment,{children:[S&&!v?m.jsx($,{analytics:w,onLoad:ie}):null,m.jsx(G,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,showHeader:!1,togglePageView:v?()=>c(!1):void 0,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})]});return m.jsxs(m.Fragment,{children:[m.jsxs(Ft,{children:[m.jsx($,{analytics:w,onLoad:i=>i.trackPageLoaded(Je.Event.aiCFOPage)}),b&&D.drawerElement,m.jsx(Lt,{...je,currentChatSessionId:r,allSessionsWithOrderedQuestionAnswers:ne,allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,openOnboardingPage:()=>c(!0),userId:h.userId,setIsAiCfoOpen:o,navigate:p,sessionFromUrl:k,location:n,isSubmitting:Oe,isEmptyChatWithSession:Ae,currentTenant:f,emailLinkQuestion:ve??void 0,autoSubmitEmailLinkQuestion:Ee,onEmailLinkQuestionProcessed:we,routedInitialQuestionSource:Pe,routedInitialQuestionSuggestionIndex:xe,onCardPolicyVendorSearchTextChange:d,onMenuClick:b?D.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ke,onUploadPromoClose:Ce,exploreSuggestedPromptQuestions:be,exploreSuggestedPromptQuestionsLoading:Ie,isSkillsOpen:C,isCreateSkillEnabled:g,promoDismissalScope:J}),S&&b?m.jsx(Qt,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:Vt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>c(!1),children:m.jsx(Se,{onClick:i=>i.stopPropagation(),children:m.jsx(G,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})})}):null]}),S&&!b?m.jsx(ze,{open:S,onClose:()=>c(!1),children:m.jsx(We,{children:_e})}):null]})},Se=y(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-BbYAHGiW.js";import{a as n,R as ba}from"./sentry-BOojnQyr.js";import{u as Ae,j as r,g as Sa,h as ka,q as H}from"./core-dudeiae1.js";import{fB as _e,SY as Ea,SZ as De,g5 as wa,gr as J,gx as ke,S_ as ya,S$ as Ia,gL as Ta,pF as va,T0 as $a,T1 as Ee,gi as Ba,T2 as v,fA as xa,gp as Aa,T3 as _a,T4 as we,T5 as Da,T6 as ye,T7 as Fa,Db as Ma,gj as Za,g_ as Ga,cS as Ha,T8 as ja,T9 as La,qh as Va,g4 as Na,j3 as Pa,Ta as Ra,vA as Oa,gk as Ua}from"./zeni-epic-state-Dc6DIqGa.js";import{w as za,i as Ya,a as qa,c as Ja,E as Ka,I as Wa,d as C,e as Qa,u as Xa,f as et,g as at,h as tt,j as nt,k as ot,z as st,l as j,p as g,m as Ie,n as rt,o as it,q as Te,r as lt,s as ve,v as dt,x as ct,y as K,A as $e,B as ut,C as Ct,D as mt,L as pt,F as ht,H as ft,J as W,K as gt,M as bt}from"./index-DpPNNcCA.js";import{A as St,b as kt,I as Et,a as Be,d as wt,D as xe}from"./mui-DOWmAnEx.js";import{u as yt}from"./InboxNotificationsProvider-wKDejaDE.js";import{u as It}from"./useTaskManagerAccess-B8w6mJa8.js";import{u as Tt}from"./expenseAutomationHelper-CNM6-ogC.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},m=new a.Error().stack;m&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[m]="7a074ee7-2f69-4027-8fb3-69604af5ee6e",a._sentryDebugIdIdentifier="sentry-dbid-7a074ee7-2f69-4027-8fb3-69604af5ee6e")}catch{}})();const $="AppDrawer",c={root:`${$}-root`,drawer:`${$}-drawer`,appBar:`${$}-appBar`,menuButton:`${$}-menuButton`,appBarZenilogo:`${$}-appBarZenilogo`,drawerZenilogo:`${$}-drawerZenilogo`},vt=W("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:K,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),$t=za((function({tenantEmailDomain:a}){const{isAiCfoOpen:m,setIsAiCfoOpen:b}=qa(),[L,A]=ba.useState(!1),[S,Fe]=n.useState(!1),t=Sa(),i=ka(),Q=wa(),X=Ja(),o=Ae(),[Me,Ze]=n.useState(!1),V=Ka(),ee=t.pathname.includes("/ai-cfo/");n.useEffect((()=>{ee||o(J())}),[o,ee]),n.useEffect((()=>{o(J())}),[o,a]);const{useFeatureGate:u}=Wa(),{isFeatureEnabled:ae}=u(C.isDebitCardFeatureEnabled),k=Qa(),s=r((e=>_e(e))),te=s.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ge}=Xa(),B=et(),{isTaskManagerAccessEnabled:_,isZeniUser:He}=It(k),ne=at(),E=tt();n.useEffect((()=>{E&&B&&o(ke())}),[o,E,s.tenantId,B]);const[N,je]=n.useState(void 0),Le=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Ve}=u(C.isChargeCardFeatureEnabled),Ne=nt(s,Ve,ae),{isFeatureEnabled:Pe}=u(C.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(C.isReferralFeatureEnabled),Re=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",oe=r((e=>ya(e)));n.useEffect((()=>{const e=()=>{Ze(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>Ia(e))),p=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),h=r((e=>Ta(e))),{monthEndCloseChecksView:w}=h,Oe=H("/signout")!==null,F=H("/:tenantEmailDomain/dashboard")!==null,se=H("/:tenantEmailDomain/reports")!==null,f=H("/:tenantEmailDomain/onboarding/*")!==null,re=Tt();n.useEffect((()=>{E&&D&&!f&&P.fetchState==="Not-Started"&&o(va(!0))}),[E,D,P.fetchState,f]),n.useEffect((()=>{if(re){const e=t.state?.origin;if(e!=null){const d=$a(e);d!=null&&o(Ee(d))}}}),[re,t.state]);const Ue=Oe||f,R=r((e=>e.tenantState)),ze=r((e=>R.fetchState==="Completed"?Ba(e):[])),{isFeatureEnabled:Ye}=u(C.isApAgingFeatureEnabled),{isFeatureEnabled:qe}=u(C.isArAgingFeatureEnabled),{isFeatureEnabled:Je}=u(C.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ke}=u(C.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:We}=u(C.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Qe}=u(C.isDashboardSidebarNewYearAnimationEnabled),Xe=r((e=>v(e).totalUnreadCount)),ea=r((e=>v(e).notificationDetailsByTab.tasks.uiState.unreadCount)),aa=r((e=>v(e).notificationDetailsByTab.comments.uiState.unreadCount)),ta=r((e=>v(e).reducedFetchCountState)),ie=r((e=>v(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>xa(e))),na=r((e=>Aa(e).skillsEnabled)),{status:le}=r(_a),[y,U]=n.useState(void 0),z=O.uiState.currentChatSessionId,M=y!=null?O.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,de=ot(M),{inboxNotifications:Y,isLoading:ce,isFetchingMore:ue,hasFetchedAll:Ce,fetchMore:oa}=yt(),Z=r((e=>v(e).notificationDetailsByTab.comments.fetchCountState));n.useEffect((()=>{const e=setTimeout((()=>oa?.()),0);return()=>clearTimeout(e)})),n.useEffect((()=>{if(y!=null)return de==="In-Progress"&&M==="Completed"?(o(we({chatSessionId:y})),U(void 0),void i(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(M==="Error"&&(o(we({chatSessionId:y})),U(void 0)))}),[o,t.state,i,M,y,de,a]),n.useEffect((()=>{if(ce===!1&&ue===!1&&Ce===!0&&s?.companyId!=null&&Y!=null){const e=`dashboard_${s.companyId}`;je(Y.filter((d=>d.roomId===e&&d.readAt==null)).length)}}),[ce,ue,Ce,s?.companyId,Y]),n.useEffect((()=>{E&&_&&!f&&ie.fetchState==="Not-Started"&&Q.tenantId!=null&&o(Da("task_manager","dashboard"))}),[E,_,f,ie.fetchState,Q.tenantId,o]),n.useEffect((()=>{f||Z.fetchState!=="Not-Started"||o(ye({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,Z.fetchState,o]),n.useEffect((()=>{if(N!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&o(ye({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(De({unreadCount:N},"comments")))}}),[N,Z.fetchState]);const sa={fetchStatus:ta,count:Xe},I=[];Ye===!1&&I.push("accounts_payable_aging"),qe===!1&&I.push("accounts_receivable_aging"),I.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&I.push("rewards_card"),ne===!1&&I.push("expense_automation_card");const me=r((e=>Fa(e,I).fetchState)),pe=r((e=>Ma(e).fetchState)),he=a!=null?st.getSignedInUserTenant(a):null,fe=r((e=>he?.tenantId!=null?Za(e,he.tenantId):void 0)),ra=F&&(me==="Completed"||me==="Error")||se&&(pe==="Completed"||pe==="Error")||!F&&!se?void 0:"disabled",ia=n.useMemo((()=>Ga(s.userRole)),[s.userRole]),la=Ha(ia),T=e=>{A(e)},da=Re,ca=s?.rewardsLastViewedTime==null,ua=k?.userEmail!=null&&oe.fetchState==="Completed"&&ja(oe.notificationSettings,k.userEmail,ae,s,_),Ca=n.useCallback((e=>{const d=t.state?.referrer;if(w.monthEndCloseChecks?.auditSummary!=null&&j.trackMonthCloseAuditPage(e.month,e.year,w.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",w.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null),o(La(s.tenantId,e)),p[s.tenantId]!=null){const x=g(t.state?.pathnameStackToGoBack,t.pathname);i(`/${a}/month_end_close_checks/review/${h.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:h.currentSelectedView}})}o(Ee(h.currentSelectedView)),h.reconciliation.selectedAccountId!=null&&o(Va({selectedAccountId:void 0}))}),[h.reconciliation.selectedAccountId,h.currentSelectedView,s.tenantId,w.monthEndCloseChecks?.auditSummary,w.monthEndCloseChecks?.reportEmailSentDate,p,a,t.state,t.pathname]),ma=n.useMemo((()=>({zIndex:S?12:Ie[2]})),[S]),pa=B&&rt(t),ge=l.jsx(it,{signedInUser:k,currentTenantId:R.currentTenantId??"",tenants:R.fetchState==="Completed"?ze:fe!=null?[fe]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ca,rewardsPlan:P.rewardsPlan},selectedMenu:m===!0?ve("ai_cfo"):Te(t)&&le!=="completed"?ve("invoicing"):dt(t),isTenantDropdownDisabled:ra,isSettings:lt(t),isInvoicing:Te(t)&&le==="completed",isSettingsFeatureEnabled:Pe,currentTenant:s,isVendorsTabVisible:la,isZeniAccountEnabled:Le,isChargeCardEnabled:Ne,isTreasuryEnabled:da,isNotificationsTabVisible:ua,notificationCountDetails:sa,isExpenseAutomationEnabledForUser:ne,isAiCfoAccessEnabled:B,skillsEnabled:na&&B,onNotificationIconClick:()=>{T(!1);const e=He?ea===0&&aa>0?"notifications/comments":"notifications/tasks":"notifications/comments",d=g(t.state?.pathnameStackToGoBack,t.pathname);i(`${a}/${e}`,{state:{pathnameStackToGoBack:d}})},onZeniLogoClick:()=>{X.toggle()},handleTenantSelect:e=>{Ge(pt.TENANT_SWITCHING),T(!1),ht({dispatch:o,navigate:i,pathToNavigate:ft(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,d)=>{if(k!=null&&j.trackSidePanelClicked(e.type,e.group),T(!1),a==null)return;if(e.type==="skills")return te?(o(ke()),o(Ra()),void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void $e({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});if(o(J()),e.type==="invoicing")return m&&b(!1),o(Oa({cacheOverride:!1})),void i(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(m&&ut(e.type)&&b(!1),e.type==="ai_cfo"){if(j.trackAICFOChatScreenStateChanged("viewed","left_menu",z??null,null),!te)return void $e({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});const G=g(t.state?.pathnameStackToGoBack,t.pathname);return void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const x=g(t.state?.pathnameStackToGoBack,t.pathname),q=e.type,Se=bt(q)&&q!=="command_center";if(q!=="command_center"&&!Se||p[s.tenantId]==null||j.trackMonthEndCloseClicked(p[s.tenantId].month,p[s.tenantId].year,"Sidebar"),Se&&p[s.tenantId]!=null){const G=p[s.tenantId];return void i(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})}const ga=Ct(e.type);mt(e.type)?(z!=null&&o(Ua()),i(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:d,referrer:"Sidebar"}})):i(`../${a}/${ga}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})},onDeleteChatSession:e=>{o(Pa(e)),z===e&&U(e)},handleLogOutClick:()=>{T(!1);const e=g(t.state?.pathnameStackToGoBack,t.pathname);i("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{i(`${a}/settings/my_profile`)},handleReferralsClick:()=>{i(`${a}/rewards/refer`)},handleBackClick:()=>{i(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:w,onPeriodChange:Ca,onCalendarOpen:Fe,aiCfoView:O,isAiCfo:pa,isOnDashboard:F,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{o(Na({sessionId:e,agentId:"controller"})),i(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Je,thanksGivingAnimationEnabled:Ke,christmasAnimationEnabled:We,newYearAnimationEnabled:Qe}),ha=l.jsx(St,{position:"fixed",className:c.appBar,style:{borderBottom:Me?`1px solid ${V.colors.grey2}`:""},children:l.jsxs(kt,{style:{minHeight:ct},children:[l.jsx(Et,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>T(!0),className:c.menuButton,size:"large",children:l.jsx(Bt,{})}),l.jsx(xt,{className:c.appBarZenilogo,onClick:()=>{X.toggle()}})]})}),be=Be((e=>e.breakpoints.up("md"))),fa=Be((e=>e.breakpoints.down("md")));return a==null?null:l.jsxs(vt,{className:c.root,children:[l.jsx(wt,{}),Ue===!1?l.jsxs(l.Fragment,{children:[be||!F?null:ha,l.jsxs("nav",{className:c.drawer,children:[be?null:l.jsx(xe,{container:window.document.body,variant:"temporary",open:L,onClose:()=>T(!1),PaperProps:{sx:{width:K,zIndex:Ie[2],borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background}},ModalProps:{keepMounted:!0},children:ge}),fa?null:l.jsx(xe,{PaperProps:{sx:{width:K,borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background,...ma}},variant:"permanent",open:!0,children:ge})]})]}):null]})})),qt=({tenantEmailDomain:a})=>{const m=Ae(),b=r((A=>_e(A))),L={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{Ya(S)&&Ea(S.mode)==="dashboard"&&m(De({unreadCount:S.data.unread},"tasks"))}};return l.jsx($t,{tenantEmailDomain:a,...L})},Bt=W((a=>n.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
1
|
+
import{j as l}from"./liveblocks-D83XGo_c.js";import{a as n,R as ba}from"./sentry-BPfEBx2C.js";import{u as Ae,j as r,g as Sa,h as ka,q as H}from"./core-CGqhbBHO.js";import{fB as _e,SY as Ea,SZ as De,g5 as wa,gr as J,gx as ke,S_ as ya,S$ as Ia,gL as Ta,pF as va,T0 as $a,T1 as Ee,gi as Ba,T2 as v,fA as xa,gp as Aa,T3 as _a,T4 as we,T5 as Da,T6 as ye,T7 as Fa,Db as Ma,gj as Za,g_ as Ga,cS as Ha,T8 as Va,T9 as ja,qh as La,g4 as Na,j3 as Pa,Ta as Ra,vA as Oa,gk as Ua}from"./zeni-epic-state-DASyz1An.js";import{w as za,i as Ya,a as qa,c as Ja,E as Ka,I as Wa,d as C,e as Qa,u as Xa,f as et,N as at,g as tt,h as nt,j as ot,z as st,k as V,p as g,m as Ie,l as rt,n as it,o as Te,q as lt,r as ve,s as dt,v as ct,x as K,y as $e,A as ut,B as Ct,C as mt,L as pt,D as ht,F as ft,H as W,J as gt,K as bt}from"./index-CoKBrrSw.js";import{A as St,b as kt,I as Et,a as Be,d as wt,D as xe}from"./mui-CD71lp6N.js";import{u as yt}from"./InboxNotificationsProvider-DDRknvRh.js";import{u as It}from"./useTaskManagerAccess-Dl-8FUHJ.js";import{u as Tt}from"./expenseAutomationHelper-wwug0Eyp.js";import"./recharts-2kmMgB1t.js";import"./analytics-CsbG8awP.js";import"./plaid-C8_LWTII.js";import"./dnd-CyZNzT3I.js";import"./stripe-cKAAJElX.js";import"./lottie-DeqWxWVC.js";import"./lexical-C5ZCOEAv.js";import"./pdf-D4eEcTTi.js";import"./utils-B6XFkcn3.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},m=new a.Error().stack;m&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[m]="6592e844-5dcc-4f62-a01a-36d6fd25e94d",a._sentryDebugIdIdentifier="sentry-dbid-6592e844-5dcc-4f62-a01a-36d6fd25e94d")}catch{}})();const $="AppDrawer",c={root:`${$}-root`,drawer:`${$}-drawer`,appBar:`${$}-appBar`,menuButton:`${$}-menuButton`,appBarZenilogo:`${$}-appBarZenilogo`,drawerZenilogo:`${$}-drawerZenilogo`},vt=W("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:K,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),$t=za((function({tenantEmailDomain:a}){const{isAiCfoOpen:m,setIsAiCfoOpen:b}=qa(),[j,A]=ba.useState(!1),[S,Fe]=n.useState(!1),t=Sa(),i=ka(),Q=wa(),X=Ja(),o=Ae(),[Me,Ze]=n.useState(!1),L=Ka(),ee=t.pathname.includes("/ai-cfo/");n.useEffect((()=>{ee||o(J())}),[o,ee]),n.useEffect((()=>{o(J())}),[o,a]);const{useFeatureGate:u}=Wa(),{isFeatureEnabled:ae}=u(C.isDebitCardFeatureEnabled),k=Qa(),s=r((e=>_e(e))),te=s.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ge}=Xa(),B=et(),{isTaskManagerAccessEnabled:_,isZeniUser:He}=It(k),ne=at(),E=tt();n.useEffect((()=>{E&&B&&o(ke())}),[o,E,s.tenantId,B]);const[N,Ve]=n.useState(void 0),je=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Le}=u(C.isChargeCardFeatureEnabled),Ne=nt(s,Le,ae),{isFeatureEnabled:Pe}=u(C.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(C.isReferralFeatureEnabled),Re=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",oe=r((e=>ya(e)));n.useEffect((()=>{const e=()=>{Ze(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>Ia(e))),p=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),h=r((e=>Ta(e))),{monthEndCloseChecksView:w}=h,Oe=H("/signout")!==null,F=H("/:tenantEmailDomain/dashboard")!==null,se=H("/:tenantEmailDomain/reports")!==null,f=H("/:tenantEmailDomain/onboarding/*")!==null,re=Tt();n.useEffect((()=>{E&&D&&!f&&P.fetchState==="Not-Started"&&o(va(!0))}),[E,D,P.fetchState,f]),n.useEffect((()=>{if(re){const e=t.state?.origin;if(e!=null){const d=$a(e);d!=null&&o(Ee(d))}}}),[re,t.state]);const Ue=Oe||f,R=r((e=>e.tenantState)),ze=r((e=>R.fetchState==="Completed"?Ba(e):[])),{isFeatureEnabled:Ye}=u(C.isApAgingFeatureEnabled),{isFeatureEnabled:qe}=u(C.isArAgingFeatureEnabled),{isFeatureEnabled:Je}=u(C.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ke}=u(C.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:We}=u(C.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Qe}=u(C.isDashboardSidebarNewYearAnimationEnabled),Xe=r((e=>v(e).totalUnreadCount)),ea=r((e=>v(e).notificationDetailsByTab.tasks.uiState.unreadCount)),aa=r((e=>v(e).notificationDetailsByTab.comments.uiState.unreadCount)),ta=r((e=>v(e).reducedFetchCountState)),ie=r((e=>v(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>xa(e))),na=r((e=>Aa(e).skillsEnabled)),{status:le}=r(_a),[y,U]=n.useState(void 0),z=O.uiState.currentChatSessionId,M=y!=null?O.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,de=ot(M),{inboxNotifications:Y,isLoading:ce,isFetchingMore:ue,hasFetchedAll:Ce,fetchMore:oa}=yt(),Z=r((e=>v(e).notificationDetailsByTab.comments.fetchCountState));n.useEffect((()=>{const e=setTimeout((()=>oa?.()),0);return()=>clearTimeout(e)})),n.useEffect((()=>{if(y!=null)return de==="In-Progress"&&M==="Completed"?(o(we({chatSessionId:y})),U(void 0),void i(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(M==="Error"&&(o(we({chatSessionId:y})),U(void 0)))}),[o,t.state,i,M,y,de,a]),n.useEffect((()=>{if(ce===!1&&ue===!1&&Ce===!0&&s?.companyId!=null&&Y!=null){const e=`dashboard_${s.companyId}`;Ve(Y.filter((d=>d.roomId===e&&d.readAt==null)).length)}}),[ce,ue,Ce,s?.companyId,Y]),n.useEffect((()=>{E&&_&&!f&&ie.fetchState==="Not-Started"&&Q.tenantId!=null&&o(Da("task_manager","dashboard"))}),[E,_,f,ie.fetchState,Q.tenantId,o]),n.useEffect((()=>{f||Z.fetchState!=="Not-Started"||o(ye({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,Z.fetchState,o]),n.useEffect((()=>{if(N!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&o(ye({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(De({unreadCount:N},"comments")))}}),[N,Z.fetchState]);const sa={fetchStatus:ta,count:Xe},I=[];Ye===!1&&I.push("accounts_payable_aging"),qe===!1&&I.push("accounts_receivable_aging"),I.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&I.push("rewards_card"),ne===!1&&I.push("expense_automation_card");const me=r((e=>Fa(e,I).fetchState)),pe=r((e=>Ma(e).fetchState)),he=a!=null?st.getSignedInUserTenant(a):null,fe=r((e=>he?.tenantId!=null?Za(e,he.tenantId):void 0)),ra=F&&(me==="Completed"||me==="Error")||se&&(pe==="Completed"||pe==="Error")||!F&&!se?void 0:"disabled",ia=n.useMemo((()=>Ga(s.userRole)),[s.userRole]),la=Ha(ia),T=e=>{A(e)},da=Re,ca=s?.rewardsLastViewedTime==null,ua=k?.userEmail!=null&&oe.fetchState==="Completed"&&Va(oe.notificationSettings,k.userEmail,ae,s,_),Ca=n.useCallback((e=>{const d=t.state?.referrer;if(w.monthEndCloseChecks?.auditSummary!=null&&V.trackMonthCloseAuditPage(e.month,e.year,w.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",w.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null),o(ja(s.tenantId,e)),p[s.tenantId]!=null){const x=g(t.state?.pathnameStackToGoBack,t.pathname);i(`/${a}/month_end_close_checks/review/${h.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:h.currentSelectedView}})}o(Ee(h.currentSelectedView)),h.reconciliation.selectedAccountId!=null&&o(La({selectedAccountId:void 0}))}),[h.reconciliation.selectedAccountId,h.currentSelectedView,s.tenantId,w.monthEndCloseChecks?.auditSummary,w.monthEndCloseChecks?.reportEmailSentDate,p,a,t.state,t.pathname]),ma=n.useMemo((()=>({zIndex:S?12:Ie[2]})),[S]),pa=B&&rt(t),ge=l.jsx(it,{signedInUser:k,currentTenantId:R.currentTenantId??"",tenants:R.fetchState==="Completed"?ze:fe!=null?[fe]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ca,rewardsPlan:P.rewardsPlan},selectedMenu:m===!0?ve("ai_cfo"):Te(t)&&le!=="completed"?ve("invoicing"):dt(t),isTenantDropdownDisabled:ra,isSettings:lt(t),isInvoicing:Te(t)&&le==="completed",isSettingsFeatureEnabled:Pe,currentTenant:s,isVendorsTabVisible:la,isZeniAccountEnabled:je,isChargeCardEnabled:Ne,isTreasuryEnabled:da,isNotificationsTabVisible:ua,notificationCountDetails:sa,isExpenseAutomationEnabledForUser:ne,isAiCfoAccessEnabled:B,skillsEnabled:na&&B,onNotificationIconClick:()=>{T(!1);const e=He?ea===0&&aa>0?"notifications/comments":"notifications/tasks":"notifications/comments",d=g(t.state?.pathnameStackToGoBack,t.pathname);i(`${a}/${e}`,{state:{pathnameStackToGoBack:d}})},onZeniLogoClick:()=>{X.toggle()},handleTenantSelect:e=>{Ge(pt.TENANT_SWITCHING),T(!1),ht({dispatch:o,navigate:i,pathToNavigate:ft(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,d)=>{if(k!=null&&V.trackSidePanelClicked(e.type,e.group),T(!1),a==null)return;if(e.type==="skills")return te?(o(ke()),o(Ra()),void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void $e({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});if(o(J()),e.type==="invoicing")return m&&b(!1),o(Oa({cacheOverride:!1})),void i(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(m&&ut(e.type)&&b(!1),e.type==="ai_cfo"){if(V.trackAICFOChatScreenStateChanged("viewed","left_menu",z??null,null),!te)return void $e({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});const G=g(t.state?.pathnameStackToGoBack,t.pathname);return void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const x=g(t.state?.pathnameStackToGoBack,t.pathname),q=e.type,Se=bt(q)&&q!=="command_center";if(q!=="command_center"&&!Se||p[s.tenantId]==null||V.trackMonthEndCloseClicked(p[s.tenantId].month,p[s.tenantId].year,"Sidebar"),Se&&p[s.tenantId]!=null){const G=p[s.tenantId];return void i(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})}const ga=Ct(e.type);mt(e.type)?(z!=null&&o(Ua()),i(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:d,referrer:"Sidebar"}})):i(`../${a}/${ga}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})},onDeleteChatSession:e=>{o(Pa(e)),z===e&&U(e)},handleLogOutClick:()=>{T(!1);const e=g(t.state?.pathnameStackToGoBack,t.pathname);i("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{i(`${a}/settings/my_profile`)},handleReferralsClick:()=>{i(`${a}/rewards/refer`)},handleBackClick:()=>{i(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:w,onPeriodChange:Ca,onCalendarOpen:Fe,aiCfoView:O,isAiCfo:pa,isOnDashboard:F,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{o(Na({sessionId:e,agentId:"controller"})),i(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Je,thanksGivingAnimationEnabled:Ke,christmasAnimationEnabled:We,newYearAnimationEnabled:Qe}),ha=l.jsx(St,{position:"fixed",className:c.appBar,style:{borderBottom:Me?`1px solid ${L.colors.grey2}`:""},children:l.jsxs(kt,{style:{minHeight:ct},children:[l.jsx(Et,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>T(!0),className:c.menuButton,size:"large",children:l.jsx(Bt,{})}),l.jsx(xt,{className:c.appBarZenilogo,onClick:()=>{X.toggle()}})]})}),be=Be((e=>e.breakpoints.up("md"))),fa=Be((e=>e.breakpoints.down("md")));return a==null?null:l.jsxs(vt,{className:c.root,children:[l.jsx(wt,{}),Ue===!1?l.jsxs(l.Fragment,{children:[be||!F?null:ha,l.jsxs("nav",{className:c.drawer,children:[be?null:l.jsx(xe,{container:window.document.body,variant:"temporary",open:j,onClose:()=>T(!1),PaperProps:{sx:{width:K,zIndex:Ie[2],borderRight:"none",backgroundImage:"none",backgroundColor:L.colors.background}},ModalProps:{keepMounted:!0},children:ge}),fa?null:l.jsx(xe,{PaperProps:{sx:{width:K,borderRight:"none",backgroundImage:"none",backgroundColor:L.colors.background,...ma}},variant:"permanent",open:!0,children:ge})]})]}):null]})})),qt=({tenantEmailDomain:a})=>{const m=Ae(),b=r((A=>_e(A))),j={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{Ya(S)&&Ea(S.mode)==="dashboard"&&m(De({unreadCount:S.data.unread},"tasks"))}};return l.jsx($t,{tenantEmailDomain:a,...j})},Bt=W((a=>n.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
2
2
|
height: 20px;
|
|
3
3
|
width: 20px;
|
|
4
4
|
color: ${a=>a.theme.colors.primary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-BbYAHGiW.js";import{a as d}from"./sentry-BOojnQyr.js";import{h as U,g as B,u as j,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-dudeiae1.js";import{fB as P,XU as w,XB as R,GK as E,GC as X,GG as A,Gv as q,XD as K,Gz as ae,GM as oe,Gy as z,GP as M,GL as C}from"./zeni-epic-state-Dc6DIqGa.js";import{z as O,w as Q,bW as pe,r as T,bQ as Y,bX as le,E as Z,a5 as H,bY as se,bZ as ne}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import{u as J,i as re}from"./ReimbursementApprovalRuleDetailScreen-CsvqRnAa.js";import ie from"./NotFoundScreen-DyEaBoCc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="99feed3c-5ccf-44f6-b701-2e81d682b5ef",e._sentryDebugIdIdentifier="sentry-dbid-99feed3c-5ccf-44f6-b701-2e81d682b5ef")}catch{}})();const _="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(Q(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(X(!0,!0,!1)))}),[a,p,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${_}`]:[],eventCallback:(r,h,b)=>{r.endsWith(_)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(Q(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Y(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));J();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(X(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,I,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(z(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(H,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((k=>({type:"attribute",subType:k.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((k=>({type:"user",userId:k.userId,isImplicitActor:!1}))));const G=m.action??"require_approval";I.push({action:G,actors:D,operator:D.length>1?G==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function $(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Y(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(J(),d.useEffect((()=>{p||(f(!0),l(z(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(H,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx($,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx($,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|
|
1
|
+
import{j as u}from"./liveblocks-D83XGo_c.js";import{a as d}from"./sentry-BPfEBx2C.js";import{h as U,g as B,u as j,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-CGqhbBHO.js";import{fB as P,XU as w,XB as R,GK as E,GC as q,GG as A,Gv as X,XD as K,Gz as ae,GM as oe,Gy as z,GP as M,GL as C}from"./zeni-epic-state-DASyz1An.js";import{z as O,w as Q,bW as pe,q as T,bQ as Y,bX as le,E as Z,a5 as H,bY as se,bZ as ne}from"./index-CoKBrrSw.js";import"./mui-CD71lp6N.js";import{u as J,i as re}from"./ReimbursementApprovalRuleDetailScreen-BFUt_Xh2.js";import ie from"./NotFoundScreen-RGfzDsux.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="f85f6456-23f4-4e86-8dec-64c9767683ce",e._sentryDebugIdIdentifier="sentry-dbid-f85f6456-23f4-4e86-8dec-64c9767683ce")}catch{}})();const _="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(Q(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${_}`]:[],eventCallback:(r,h,I)=>{r.endsWith(_)&&I.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(Q(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Y(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));J();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const I={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,b,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...I})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),I=r.actors.selectedNonUsers.map((b=>{const m=!!re(b.value);return{type:m?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(I);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(z(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(H,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const b=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((k=>({type:"attribute",subType:k.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((k=>({type:"user",userId:k.userId,isImplicitActor:!1}))));const G=m.action??"require_approval";b.push({action:G,actors:D,operator:D.length>1?G==="require_approval"?"or":"and":"is"})})),b},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const I=g?.selection.selectedOptions??[];if(I.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:I}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function $(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Y(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(J(),d.useEffect((()=>{p||(f(!0),l(z(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(H,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx($,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx($,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|