@zeniai/web-app-ui 5.4.21-prod → 5.4.22-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-o9UNAAN2.js → AccountMappingScreen-C5mOiJ2U.js} +2 -2
- package/dist/assets/ActualMatchingMatchDetailScreen-wHD8fSWU.js +1 -0
- package/dist/assets/AddressRoutes-CVWN9CJv.js +1 -0
- package/dist/assets/AddressScreen-DgUwrml_.js +9 -0
- package/dist/assets/AiCfoScreen-yDQ2sphg.js +22 -0
- package/dist/assets/{AppDrawer-BycMyj5M.js → AppDrawer-DzYZBC2G.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-FZbtoTk1.js → BillPayApprovalRoutes-BcCgse3-.js} +1 -1
- package/dist/assets/BillPayRoutes-HAS0-pNc.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-DM_jBIuD.js +9 -0
- package/dist/assets/CardsAiCfoScreen-yrI2CL7M.js +14 -0
- package/dist/assets/ChargeCardRoutes-DgtmFgR6.js +71 -0
- package/dist/assets/CompanyPassportScreen-BLtXgkEd.js +1 -0
- package/dist/assets/ConnectionAuthScreen-CuZmfRIp.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BjmJLllh.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-N9fmUi4M.js → CustomerOnboardingRoutes-C0b805o-.js} +7 -7
- package/dist/assets/CustomersRoutes-DD5Gx1mW.js +8 -0
- package/dist/assets/DashboardRoutes-C8RZkkYj.js +20 -0
- package/dist/assets/DefaultTenantHome-C6Ygdgwt.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-BxClNf2J.js +18 -0
- package/dist/assets/DrawerScreen-BHaectiO.js +1 -0
- package/dist/assets/EntityDetailRoutes-BJzuW7dq.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BKrWZyYV.js +38 -0
- package/dist/assets/FallBackRoute-DuMHkNqk.js +2 -0
- package/dist/assets/FeaturePreviewScreen-DHt0WFS8.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Di0pbhHE.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-Dp-eDJC-.js → InboxNotificationsProvider-CiKEEv6Q.js} +1 -1
- package/dist/assets/InvoicingRoutes-Bsq4ym98.js +3 -0
- package/dist/assets/MagicLinkRoutes-DJX5Nm1n.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CD7Pya_j.js +12 -0
- package/dist/assets/MobileAppDrawer-BWNb5zLN.js +1 -0
- package/dist/assets/NotFoundScreen-DXy-BCit.js +1 -0
- package/dist/assets/NotificationRoutes-B2xHVaqf.js +1 -0
- package/dist/assets/OAuthConsentScreen-BA2eBLib.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Dm5Vnr71.js +1 -0
- package/dist/assets/PaymentLinkScreen-CndVAq3p.js +21 -0
- package/dist/assets/PeopleRoutes-kralZgbz.js +22 -0
- package/dist/assets/PerformanceRoutes-DJhuo9qY.js +1 -0
- package/dist/assets/{Preview-C5WCMZ5q.js → Preview--c8D4GAG.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BwiFGkNK.js → QBOConnectionScreen-DroXrkno.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-B2ftFL0O.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CHTcY28V.js +1 -0
- package/dist/assets/{ReimbursementRoutes-IyEE77RL.js → ReimbursementRoutes-CI3m7PHD.js} +9 -9
- package/dist/assets/ReportsRoutes-C7A0Ycu_.js +1 -0
- package/dist/assets/RewardsRoutes-Dkg4zGB8.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-COClCOXU.js → ScheduleDetailsPrepaidExpensesScreen-ZwdXW6K5.js} +5 -5
- package/dist/assets/ScreenRoutes-B_WT7FAm.js +2 -0
- package/dist/assets/{SettingsRoutes-B8qt67Bj.js → SettingsRoutes-_XBnyBgG.js} +6 -6
- package/dist/assets/{SetupPagesScreen-UjK2D0Rv.js → SetupPagesScreen-D6ssIWb0.js} +5 -5
- package/dist/assets/SignInScreen-H_SOl_FQ.js +1 -0
- package/dist/assets/SignOutScreen-OFswrnt8.js +9 -0
- package/dist/assets/{TaskListScreen-2_ij-Yu1.js → TaskListScreen-Bmj5V_dR.js} +2 -2
- package/dist/assets/TaskRoutes-D6cEqDZN.js +9 -0
- package/dist/assets/TransactionDetailRoutes-D-b6zdg4.js +1 -0
- package/dist/assets/TransactionDetailScreen-JBKbtouq.js +5 -0
- package/dist/assets/TransactionListRoutes-THtfycHC.js +1 -0
- package/dist/assets/TreasuryRoutes-CgHwdyKd.js +37 -0
- package/dist/assets/{VendorsRoutes-uW7VJmDE.js → VendorsRoutes-jETcYESc.js} +18 -18
- package/dist/assets/WiseConfirmationScreen-BpRHCykr.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DPX2T0Kt.js → ZeniAccountRoutes-C8cr5UMy.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-DAs1_LIC.js +9 -0
- package/dist/assets/{accountMappingHelper-FvEDI2O0.js → accountMappingHelper-DSd2V454.js} +1 -1
- package/dist/assets/{analytics-CzizEiux.js → analytics-Vgn85Ur_.js} +4 -4
- package/dist/assets/analyticsHelper-CWMk7_rd.js +1 -0
- package/dist/assets/{core-Bx5kG7oj.js → core-CbdTrw7T.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DMAtWdNT.js → decodeURIComponentSafe-D7APy95S.js} +1 -1
- package/dist/assets/{dnd-BT4GhSLO.js → dnd-DuiAlI7w.js} +1 -1
- package/dist/assets/empty-B1nH_ieU.js +1 -0
- package/dist/assets/{empty-Cn912Jag.js → empty-CjoB5KP4.js} +1 -1
- package/dist/assets/{emptyVideoElement-BTRIh8mw.js → emptyVideoElement-B6iUrc8S.js} +1 -1
- package/dist/assets/epic-CCMzkkv8.js +2 -0
- package/dist/assets/expenseAutomationHelper-CgTsmmCm.js +1 -0
- package/dist/assets/getLocaleForTenant-B8EqveGi.js +1 -0
- package/dist/assets/{index-CfvGavEm.js → index-BFdcFsSo.js} +1 -1
- package/dist/assets/index-BNFAuGus.js +1 -0
- package/dist/assets/{index-DkHntkmh.js → index-CnIO6_IQ.js} +14764 -14764
- package/dist/assets/{index-BphJBpvs.js → index-DjPsG1Xt.js} +1 -1
- package/dist/assets/{index-CtJA2cwC.js → index-LGKtWUy9.js} +1 -1
- package/dist/assets/{index-Did1JRAl.js → index-naWU0Itr.js} +2 -2
- package/dist/assets/{empty-BtyJHOUL.js → index-pWh5QyXZ.js} +1 -1
- package/dist/assets/{index-But38I3J.js → index-wSCaSCb5.js} +1 -1
- package/dist/assets/{lexical-BVHU6OCB.js → lexical-B-vxEaRQ.js} +1 -1
- package/dist/assets/{liveblocks-BD_ga8W6.js → liveblocks-BLpmr1Pv.js} +15 -15
- package/dist/assets/{lottie-EXw6nebq.js → lottie-Lb1ftKY1.js} +1 -1
- package/dist/assets/{mui-BaMyMAqO.js → mui-DNGY4bFU.js} +2 -2
- package/dist/assets/{pathToGoBack-BzRgSVEC.js → pathToGoBack-CJCquoqC.js} +1 -1
- package/dist/assets/{pdf-DnsysvFr.js → pdf-B1uD4Ovv.js} +3 -3
- package/dist/assets/{pdf-lib-DTKmmSz0.js → pdf-lib-BKN88Kre.js} +1 -1
- package/dist/assets/{plaid-BmyHDSR7.js → plaid-DhfTjhua.js} +1 -1
- package/dist/assets/{pusher-BADlF29B.js → pusher-BPtf_EL-.js} +1 -1
- package/dist/assets/{react-B-WPW2lk.js → react-B10NZVQI.js} +1 -1
- package/dist/assets/{react-B4hLpFdk.js → react-BAEKpD-r.js} +1 -1
- package/dist/assets/{react-Dz5IyPy2.js → react-Bhjp4pzB.js} +1 -1
- package/dist/assets/{react-tdpT-_R0.js → react-DEDzyvMl.js} +1 -1
- package/dist/assets/{react-B-SJqSpk.js → react-DGl2P4dK.js} +1 -1
- package/dist/assets/{react-DCWsxx3l.js → react-arX5WESX.js} +1 -1
- package/dist/assets/{recharts-Bcj70bk1.js → recharts-CTh_JhT_.js} +1 -1
- package/dist/assets/{reportTimeframe-CUcsFj60.js → reportTimeframe-DeLnONFM.js} +1 -1
- package/dist/assets/{routePaths-Cxh0_DtI.js → routePaths-CV12X_S-.js} +1 -1
- package/dist/assets/{sentry-DsaQHQmX.js → sentry-DWNq3t8E.js} +2 -2
- package/dist/assets/{stripSplatSuffix-B3Bc_avB.js → stripSplatSuffix-DP9nmQOu.js} +1 -1
- package/dist/assets/{url-DAJdS_e6.js → url-B2x9G6No.js} +4 -4
- package/dist/assets/{url-DjR0oJYL.js → url-BqlXUDAr.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-D-Ym3wTm.js +1 -0
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Dqg5VVaq.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-DXFswt7R.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-Cq6Y4mMW.js +1 -0
- package/dist/assets/{useDeviceId-BviPVfDF.js → useDeviceId-dj9QS4Ga.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-qgk6N8cm.js +1 -0
- package/dist/assets/useEnsureVendorListLoaded-CIShbpK4.js +1 -0
- package/dist/assets/useInitialThreadRequest-DAUsQlCl.js +1 -0
- package/dist/assets/useIsCustomersTabEnabled-C6mkabn2.js +1 -0
- package/dist/assets/useTaskManagerAccess-Cm5trA3i.js +1 -0
- package/dist/assets/useTaskManagerPusherEvents-C1gzc-aA.js +1 -0
- package/dist/assets/{utils-Rng1Um8N.js → utils-CrhrpmD8.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-DTG3VL6U.js → withTransactionSidePanel-D-hDwbdr.js} +5 -5
- package/dist/assets/{zeni-epic-state-CP_8Me3V.js → zeni-epic-state-C5DO1jkr.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/ActualMatchingMatchDetailScreen-Bq4tInFn.js +0 -1
- package/dist/assets/AddressRoutes-CTXOzi6Q.js +0 -1
- package/dist/assets/AddressScreen-CpY6qzLi.js +0 -9
- package/dist/assets/AiCfoScreen-CeSkAjuX.js +0 -22
- package/dist/assets/BillPayRoutes-DR1qovIJ.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-Byhif9Ma.js +0 -9
- package/dist/assets/CardsAiCfoScreen-DuMDy2QA.js +0 -14
- package/dist/assets/ChargeCardRoutes-CkebfhOF.js +0 -71
- package/dist/assets/CompanyPassportScreen-B9QeqdTn.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BxSdWxSi.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-LYqD1O_j.js +0 -1
- package/dist/assets/CustomersRoutes-BPgppFga.js +0 -8
- package/dist/assets/DashboardRoutes-BsicDORh.js +0 -20
- package/dist/assets/DefaultTenantHome-k44UkE7_.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-C3YIjUYE.js +0 -18
- package/dist/assets/DrawerScreen-C86vnRJz.js +0 -1
- package/dist/assets/EntityDetailRoutes-A4ws8Hyd.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-D5mOe8NQ.js +0 -38
- package/dist/assets/FeaturePreviewScreen-DUY6p3ge.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-DD_LJq4g.js +0 -1
- package/dist/assets/InvoicingRoutes-CN-eG_gg.js +0 -3
- package/dist/assets/MagicLinkRoutes-DugkbFub.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-AD90LU49.js +0 -12
- package/dist/assets/MobileAppDrawer-DDeilglm.js +0 -1
- package/dist/assets/NotFoundScreen-oYE2WlvI.js +0 -1
- package/dist/assets/NotificationRoutes-CebTwOdA.js +0 -1
- package/dist/assets/OAuthConsentScreen-DwCYB8ry.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-C8BIa_6t.js +0 -1
- package/dist/assets/PaymentLinkScreen-Brc4c_uL.js +0 -21
- package/dist/assets/PeopleRoutes-BadtTp85.js +0 -22
- package/dist/assets/PerformanceRoutes-CELeTcmt.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-DfYqyG3t.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DE6y72u6.js +0 -1
- package/dist/assets/ReportsRoutes-CAjdNb2Z.js +0 -1
- package/dist/assets/RewardsRoutes-B5s3qeYK.js +0 -1
- package/dist/assets/ScreenRoutes-C9LqvM4m.js +0 -2
- package/dist/assets/SignInScreen-DyroBcKr.js +0 -1
- package/dist/assets/SignOutScreen-BvkzQcmU.js +0 -9
- package/dist/assets/TaskRoutes-YSc8SAKu.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Brl4E-L9.js +0 -1
- package/dist/assets/TransactionDetailScreen-DPXvNf-7.js +0 -5
- package/dist/assets/TransactionListRoutes-CL-K7ix6.js +0 -1
- package/dist/assets/TreasuryRoutes-B7-wS8Oy.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BLgEu5jI.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-B-69HKZM.js +0 -9
- package/dist/assets/analyticsHelper-jqkqthAa.js +0 -1
- package/dist/assets/epic-BVSwA_uf.js +0 -2
- package/dist/assets/expenseAutomationHelper-CAr9eXjQ.js +0 -1
- package/dist/assets/getLocaleForTenant-Cvq70l-z.js +0 -1
- package/dist/assets/index-Dc4mB2Op.js +0 -1
- package/dist/assets/index-bKm528DW.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-iGCUO44-.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-COa1RGwu.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-B0IAA2LU.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-jDlyzqdm.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-df266Q2H.js +0 -1
- package/dist/assets/useEnsureVendorListLoaded-CCsBxqME.js +0 -1
- package/dist/assets/useInitialThreadRequest-Dspu5rPv.js +0 -1
- package/dist/assets/useIsCustomersTabEnabled-BiAWPXPy.js +0 -1
- package/dist/assets/useTaskManagerAccess-CW2xYz9y.js +0 -1
- package/dist/assets/useTaskManagerPusherEvents-UN1wlS1b.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as L}from"./liveblocks-BLpmr1Pv.js";import{a as i}from"./sentry-DWNq3t8E.js";import{h as H,g as K,u as X,j as A,s as W,l as Z}from"./core-CbdTrw7T.js";import{az as ee,p as te,_ as B,z as ne,B as q,be as ae,c as ce,R as oe}from"./index-CnIO6_IQ.js";import{bm as se,fJ as ie,g_ as ue,oR as J,YP as re,il as G,gl as le,oE as de,YQ as pe,YR as ge,YS as me,uG as Ae,mb as be,oC as Ie,oy as ye,oN as fe,oJ as Se,io as Ee,YT as he,YU as ve}from"./zeni-epic-state-C5DO1jkr.js";import{n as we}from"./mui-DNGY4bFU.js";import{M as Ce}from"./MobileAppDrawer-BWNb5zLN.js";import{q as Q}from"./QBOConnectionScreen-DroXrkno.js";import{g as E,a as h,m as ze}from"./accountMappingHelper-DSd2V454.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="a056ddca-3622-41e9-ad7c-70d0e2cac2e7",n._sentryDebugIdIdentifier="sentry-dbid-a056ddca-3622-41e9-ad7c-70d0e2cac2e7")}catch{}})();const r="zeni_pending_projects_enable",l={pending:"pending",ready:"ready"},xe=we.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as R}from"./liveblocks-BD_ga8W6.js";import{a as i}from"./sentry-DsaQHQm
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${n=>n.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,Fe=Z((function(n,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(n),isAccountingClassesUpdateInProgress:n.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(n),isAccountingProjectsUpdateInProgress:(()=>{const u=sessionStorage.getItem(r),a=u===l.pending||u===l.ready;return n.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||a})(),isAutoReviewIncomeWithoutCustomerEnabled:me(n),isAutoReviewIncomeWithoutCustomerUpdateInProgress:n.companyViewState.passportView?.autoReviewIncomeWithoutCustomerUpdateStatus?.fetchState==="In-Progress",isRevenueAutomationEnabled:e.isRevenueAutomationEnabled,isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(n,e){const{navigate:u,location:a,isFiling1099FeatureEnabled:p}=e;return{onAccountMappingChange:s=>{const{uncategorizedAccountSection:d,billsAccountSection:v,reimbursementsAccountSection:w,vendorsAccountSection:C,filing1099Section:z}=s,{incomeAccount:x,expenseAccount:F}=d,{billPayAccount:T}=v,{reimbursementsAccount:c}=w,{prepaidExpensesAccount:V,fixedAssetsAccount:g,accruedExpensesAccount:P}=C,{bankAccount:O,expenseCategory1099:M}=z,_=E(e.accountMappingView.incomeAccountList,x.selectedOption),b=E(e.accountMappingView.expenseAccountList,F.selectedOption),j=E(e.accountMappingView.billPayAccountList,T.selectedOption),I=E(e.accountMappingView.reimbursementsAccountList,c.selectedOption),k=h(e.accountMappingView.prepaidExpensesAccountList,V.selectedOptions),R=h(e.accountMappingView.fixedAssetsAccountList,g.selectedOptions),D=h(e.accountMappingView.accruedExpensesAccountList,P.selectedOptions),y=h(e.accountMappingView.bankAccounts1099FilingAccountList,O.selectedOptions),U=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,M),f={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:b?.accountId,selectedBillPayAccountId:j?.accountId,selectedReimbursementsAccountId:I?.accountId,selectedPrepaidExpensesAccountIds:k.map((t=>t.accountId)),selectedFixedAssetsAccountIds:R.map((t=>t.accountId)),selectedAccruedExpensesAccountIds:D.map((t=>t.accountId)),selectedBankAccounts1099FilingAccountIds:y.map((t=>t.accountId)),selectedExpenseAccounts1099FilingAccountIds:U};n(ve({data:f}))},onBackClick:()=>{q(a)===!1?(u("../../dashboard"),n(he())):n(G())},onSaveClick:()=>{n(Ee()),p&&ce.track(oe.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:s=>{n(Se(e.currentTenant.companyId,s))},onAutoReviewIncomeWithoutCustomerToggle:s=>{n(fe(e.currentTenant.companyId,s))},onAccountingProjectsToggle:s=>{const d=sessionStorage.getItem(r);d===l.pending||d===l.ready||n(s?Ie(e.currentTenant.companyId):ye(e.currentTenant.companyId))}}}))(ae),De=()=>{const n=ee(),e=H(),u=K(),a=X(),{useFeatureGate:p,useDynamicConfig:s}=te(),{isFeatureEnabled:d}=p(B.isFiling1099FeatureEnabled),{isFeatureEnabled:v}=p(B.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:w}=p(B.isRevenueAutomationEnabled),{configValue:C,isDynamicConfigLoading:z}=s("transaction_categorization_config"),x=!z&&C?.capitalization_enabled===!0,F=ne.getSignedInUser(),T=se(F),c=A((t=>ie(t))),{capitalizableAccounts:V,capitalizableAccountOverrides:g,isCapitalizationThresholdSaving:P,currencySymbol:O}=A((t=>{const o=t.tenantState.currentTenantId,m=o!=null?t.tenantState.tenantsById[o]:void 0,S=ue(t.companyState,c.companyId);return{capitalizableAccounts:m?.capitalizableAccounts??null,capitalizableAccountOverrides:m?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),W),M=i.useCallback(((t,o)=>{a(J(c.companyId,t,o))}),[a,c.companyId]),_=i.useCallback((t=>{const o={...g??{}},m=Object.entries(t);for(const[N,Y]of m)Y===null?delete o[N]:o[N]=Y;const[S,$]=m[0]??[];S!=null&&a(J(c.companyId,S,$,void 0,Object.keys(o).length>0?o:null))}),[a,c.companyId,g]),b=A((t=>re(t.accountState)),W),j=i.useMemo((()=>{const t={};for(const o of b)o.accountId!=null&&o.accountName!=null&&(t[o.accountId]=o.accountName);return t}),[b]),[I,k]=i.useState(!1),[R,D]=i.useState(!1);i.useEffect((()=>{I===!1&&(a(G()),k(!0))}),[I]);const y=A((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));i.useEffect((()=>{sessionStorage.getItem(r)===l.pending&&(sessionStorage.removeItem(r),a(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[a]),i.useEffect((()=>{sessionStorage.getItem(r)===l.ready&&c?.companyId!=null&&(sessionStorage.removeItem(r),a(de(c.companyId)))}),[c?.companyId,a]),i.useEffect((()=>{y&&c?.tenantEmailDomain!=null&&(sessionStorage.setItem(r,l.pending),a(pe()),Q.init("/connection/auth",c.tenantEmailDomain),Q.handleClick())}),[y,c?.tenantEmailDomain,a]);const U=A((t=>ge(t))),f=t=>{D(t)};return L.jsxs(xe,{children:[L.jsx(Ce,{isAppContentDrawerOpen:R,handleDrawerToggle:f}),L.jsx(Fe,{currentTenant:c,navigate:e,meetingUrl:n("account_mapping"),accountMappingView:U,isFiling1099FeatureEnabled:d&&T,isAccruedExpensesFeatureEnabled:v,isRevenueAutomationEnabled:w,isCapitalizationFeatureEnabled:x,capitalizableAccounts:V,accountNamesById:j,capitalizableAccountOverrides:g,currencySymbol:O,isCapitalizationThresholdSaving:P,onSaveCapitalizationAccountThreshold:M,onSaveCapitalizationAccountThresholds:_,location:u,isSettings:q(u),onClickMenuIcon:()=>f(!0)})]})};export{r as P,De as U,l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BLpmr1Pv.js";import{a as y}from"./sentry-DWNq3t8E.js";import{a5 as A,c1 as R}from"./index-CnIO6_IQ.js";import"./mui-DNGY4bFU.js";import{u as F}from"./useActualMatchingMatchDetail-D-Ym3wTm.js";import b from"./NotFoundScreen-DXy-BCit.js";import{i as P,h as U,g as w}from"./core-CbdTrw7T.js";import"./zeni-epic-state-C5DO1jkr.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";import"./stripSplatSuffix-DP9nmQOu.js";import"./decodeURIComponentSafe-D7APy95S.js";import"./routePaths-CV12X_S-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="6b4cdc4c-35ab-4475-8d41-1aeb473de315",t._sentryDebugIdIdentifier="sentry-dbid-6b4cdc4c-35ab-4475-8d41-1aeb473de315")}catch{}})();function V(){const{matchId:t,tenantEmailDomain:e}=P(),o=U(),n=w(),k=F(t??""),r=y.useCallback((()=>{const v=A(n.state?.pathnameStackToGoBack);o(v.poppedPathname??`/${e??""}/month_end_close_checks/review`,{state:{pathnameStackToGoBack:v.newStack}})}),[n.state,o,e]);if(t==null)return s.jsx(b,{});const{match:i,detailFetchState:a,handleOpenBill:l,handleRefresh:c,handleUndoReversal:h,handleApproveAndReverse:d,handleIgnoreMatchSuggestion:p,lastMatchResults:f,lastUndoResults:g,refreshStatus:m,ignoreStatus:u,matchAndReverseStatus:S,undoReversalStatus:I}=k;return i==null?a.fetchState==="Not-Started"||a.fetchState==="In-Progress"?s.jsx(R,{detailFetchState:a.fetchState,isIgnoreInFlight:u.fetchState==="In-Progress",isApproveInFlight:S.fetchState==="In-Progress",isUndoInFlight:I.fetchState==="In-Progress",refreshStatus:m.fetchState,onNavigateBack:r,onOpenBill:l,onApproveAndReverse:d,onIgnoreMatchSuggestion:p,onRefresh:c,onUndoReversal:h,lastMatchResults:f,lastUndoResults:g}):s.jsx(b,{}):s.jsx(R,{match:i,detailFetchState:a.fetchState,isIgnoreInFlight:u.fetchState==="In-Progress",isApproveInFlight:S.fetchState==="In-Progress",isUndoInFlight:I.fetchState==="In-Progress",refreshStatus:m.fetchState,onNavigateBack:r,onOpenBill:l,onApproveAndReverse:d,onIgnoreMatchSuggestion:p,onRefresh:c,onUndoReversal:h,lastMatchResults:f,lastUndoResults:g})}export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BLpmr1Pv.js";import{A as i}from"./AddressScreen-DgUwrml_.js";import s from"./NotFoundScreen-DXy-BCit.js";import"./sentry-DWNq3t8E.js";import{n as d,o as r}from"./core-CbdTrw7T.js";import"./zeni-epic-state-C5DO1jkr.js";import"./recharts-CTh_JhT_.js";import"./index-CnIO6_IQ.js";import"./mui-DNGY4bFU.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="c1501551-0737-433d-9247-7e0f507b1a6b",t._sentryDebugIdIdentifier="sentry-dbid-c1501551-0737-433d-9247-7e0f507b1a6b")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-BLpmr1Pv.js";import{a as b}from"./sentry-DWNq3t8E.js";import{h as T,u as P,g as j,i as E,j as B,l as M}from"./core-CbdTrw7T.js";import{a2 as $,z as D,V as L,a8 as R,a9 as K,c as _,R as S,a4 as z,W as h,a5 as F}from"./index-CnIO6_IQ.js";import{a1R as C,iB as N,fJ as U,a1r as V,c8 as G,_x as O,mT as q}from"./zeni-epic-state-C5DO1jkr.js";import{u as H,n as J}from"./mui-DNGY4bFU.js";import W from"./NotFoundScreen-DXy-BCit.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]="315f4835-921a-46c2-9b3a-e9fe39ac6fb7",e._sentryDebugIdIdentifier="sentry-dbid-315f4835-921a-46c2-9b3a-e9fe39ac6fb7")}catch{}})();const Q=J.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,X=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=U(e),t=s.roleMap!=null&&V(s.roleMap),n=i||c==="user_address"||G(l?.userRole??[])||t?void 0:"readonly";if(o==null){const a=O(c,e);return{addressToEdit:a?.addressToCreate,loadingState:a?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:n,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const d=C(e,o);return{addressToEdit:d.address,loadingState:d.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:n}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=t=>{if(t==="express-pay")o("../express-pay/add-wire");else{const n=i.state,d=F(n?.pathnameStackToGoBack);let a=d.poppedPathname??v();const u=n?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(a=`${a}?${g}`)}o(a,{state:{pathnameStackToGoBack:d.newStack}})}};return{onSubmitHandler:t=>{const n=Y(t);e(q({addressType:c,addressToCreate:n})),_?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:t.street.addressString,city:t.city,state:t.state,country:t.country.selectedOption??"",postalCode:t.postalCode,suite:t.suite,secondaryInfo:t.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(z);function re({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const t=T(),n=P(),d=j(),{addressId:a,addressType:u}=E(),g=$(),I=H(),k=D.getSignedInUser(),[f,w]=b.useState(a==null),p=B((m=>a!=null?C(m,a).fetchState:"Not-Started")),x=L();if(k==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(a!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect((()=>{f||a==null||(w(!0),n(N(a,!1)))}),[f,a,n]),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)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(R,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):a!=null&&p==="Error"?(t(`${v(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(K,{analytics:_,onLoad:A}),r.jsx(Q,{windowSize:g,children:r.jsx(X,{location:d,navigate:t,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:a,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):r.jsx(W,{})}const v=(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{re as A,Y as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-BLpmr1Pv.js";import{a as n}from"./sentry-DWNq3t8E.js";import{u as Lt,h as Ut,i as Vt,g as Bt,j as v,l as Ft}from"./core-CbdTrw7T.js";import{ee as Mt,g as $t,n as Nt,ef as Gt,z as Ht,a2 as qt,eg as zt,eh as Wt,ei as Yt,aE as Ve,ej as We,ek as Kt,aD as Ye,a5 as ge,a9 as ce,c as M,el as me,em as Jt,en as Xt,ax as Zt,R as es,w as ts,eo as ss,ep as ns,aj as as,eq as os,er as is,es as rs,et as ls,s as us,aw as Be,eu as ds}from"./index-CnIO6_IQ.js";import{fI as F,gx as R,Ve as cs,a3Q as ms,a3R as Ss,jY as hs,a3S as ps,jV as fs,a3T as Se,jB as K,k2 as J,jH as Ie,jo as he,jm as gs,k4 as Is,jQ as Ke,Vm as Fe,gz as $,gO as Cs,Vl as ks,V7 as Me,fJ as bs,jf as vs,a3U as Es,gc as Ps,jx as ws,jt as ys,fK as pe,gj as xs,a3V as Rs,a3W as Ts,a3X as Os,gy as js,gs as $e,kg as Ne,gu as Ge,gA as As,a3Y as He,k5 as _s,jq as Ds,jK as Qs,k0 as qe,jN as Ls,gB as Us,gC as Vs,gD as Bs,gE as Fs}from"./zeni-epic-state-C5DO1jkr.js";import{D as Ms,n as N,S as $s,v as Ns}from"./mui-DNGY4bFU.js";import{u as Gs}from"./useAiCfoDashboardSuggestedQuestionsChips-Dqg5VVaq.js";import{p as Hs}from"./pathToGoBack-CJCquoqC.js";import{l as qs}from"./routePaths-CV12X_S-.js";import{u as zs}from"./useTaskManagerPusherEvents-C1gzc-aA.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="61f61cec-a0b5-4e86-a6fc-4a97e751fbd9",t._sentryDebugIdIdentifier="sentry-dbid-61f61cec-a0b5-4e86-a6fc-4a97e751fbd9")}catch{}})();const Ws=["claimed","running","succeeded","failed","timeout"],fe=t=>typeof t=="string"&&t!=="",Je="chat-response-generated";function Ys(t,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const h=R(t).skills.find((s=>s.macroId===r.savedMacroId));return h==null?void 0:{status:"saved",command:h.name}}const Ks=Ft((function(t,r){const h=F(t),s=r.isSubmitting,d=h.uiState?.currentChatSessionId,l=d!=null?xs(t.aiCfoState,d):[],i=ns(t,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),g=Rs(t),p=Ts(t),f=Os(t);return{showSampleQuestions:r.sessionFromUrl==="explore"&&h.uiState.currentChatSessionId==null,aiCfoView:h,isSubmitting:s,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${as}/tableDownload`,exportDownloadEndPoint:rs(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:R(t).skills,skillSaveState:Ys(t,f),skillsEnabled:R(t).skillsEnabled,skillsList:R(t).skills,skillsListError:R(t).fetchState==="Error",skillsListLoading:R(t).fetchState==="In-Progress",skillsCanPublish:R(t).canPublish,skillSaving:f.fetchState==="In-Progress",skillSaveError:f.fetchState==="Error",skillVersionHistory:g.macroId!=null?{macroId:g.macroId,versions:g.versions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillRestoreBody:p.macroId!=null&&p.version!=null?{macroId:p.macroId,version:p.version,instructions:p.instructions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillDetail:J(t).detail,skillDetailError:J(t).fetchState==="Error",skillDetailLoading:J(t).fetchState==="In-Progress",syntheticAnswers:l,resolveSyntheticAnswerCardTile:is(t),resolveSyntheticAnswerPolicyTile:os(t),...i}}),(function(t,r){const{location:h,currentTenant:s,userId:d,navigate:l,currentChatSessionId:i,allSessionsWithOrderedQuestionAnswers:g,isAiCardCreationEnabled:p,isCardPolicyEnabled:f,setIsAiCfoOpen:U}=r,V=s.tenantEmailDomain;return{onEventReceived:(a,o)=>{if(a===Je&&typeof o.text=="string"&&typeof o.metadata=="object"){const c=o,O=Us(c.type),E=c.metadata.chat_session_id??null,{currentChatSession:j,currentQuestionAnswer:G,currentQuestionAnswerSummary:A}=Ye(g,E);O!=="answer"?M.trackAICFOChatResponseGenerated(O,G?.question.questionText??"",c.text,E,ds(A,j),c.metadata.message_id??null):M.trackAICFOChatAnswerGenerated(c.text,G?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,Vs(c.visualization?.type??"")??null,E,c.summarized_title,c.metadata.message_id??null),t(Bs({chatSessionId:c.metadata.chat_session_id,responseType:O,fetchState:{fetchState:"Completed",error:void 0}})),t(Fs({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:d}))}},onSubmit:(a,o,c,O,E)=>{a&&Be(t,a,o,i,g,d,O,c,void 0,E)},onFetchSkills:()=>{t(Ke())},onOpenSkill:a=>{t(Ie({macroId:a})),t(Ls({macroId:a}))},onSaveSkill:(a,o)=>{t(qe({draft:a,macroId:o}))},onSaveSkillDraft:a=>{const o=a.displayName?.trim()??"",c=a.name?.trim()??"";t(qe({draft:{name:o.length>0?o:c,description:a.description?.trim()??null,instructions:a.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(a,o)=>{t(Qs({macroId:a,version:o}))},onDeleteSkill:a=>{t(Ds({macroId:a}))},onSetSkillVisibility:(a,o)=>{t(_s({macroId:a,visibility:o}))},onCloseSkillDetail:()=>{t(He())},onRunSkill:(a,o)=>{t($()),t($e()),Be(t,o,"user_input",void 0,g,d,void 0,void 0,void 0,a),t(He())},updateCurrentInput:a=>{t(Ge(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(As(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{l(-1)},onCloseClick:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??Hs(1);l(o,{state:{...h.state,pathnameStackToGoBack:a.newStack}}),t(Ge(""))},togglePageView:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??`/${s.tenantEmailDomain}/dashboard`;l(o,{state:{...We(h.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),U(!0)},onCopy:()=>{},onThumbsUp:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ne(i,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ne(i,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{l(-1)},onNewChatClick:()=>{t($()),i!=null&&t($e());const a=us(h.state?.pathnameStackToGoBack,h.pathname);l(`/${s.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,o)=>{t(js({questionAnswerId:a,isCollapsed:o}))},onMenuClick:r.onMenuClick,...ls(t,{isAiCardCreationEnabled:p,isCardPolicyEnabled:f,currentChatSessionId:i,onAfterCardsCreationSubmit:()=>{U(!0),l(`/${V}/cards`,{state:{...h.state}})},onAfterCardPolicySubmit:()=>{U(!0),l(`/${V}/cards/policy`,{state:{...h.state}})}})}}))(ts(ss)),bn=({isFileUploadEnabled:t})=>{const r=Mt(),{setIsAiCfoOpen:h}=$t(),s=Lt(),d=Ut(),{session_id:l}=Vt(),i=Bt(),g=new URLSearchParams(i.search).get("routine")??void 0,[p,f]=n.useState(!1),U=v((e=>F(e).uiState.isSkillsBrowserOpen===!0)),V=v((e=>R(e).skillsEnabled)),a=v((e=>F(e).uiState.isRoutinesBrowserOpen===!0)),o=v((e=>cs(e))),c=v((e=>ms(e))),O=v((e=>Ss(e))),[E,j]=n.useState(void 0),[G,A]=n.useState(!1),[Xe,Ce]=n.useState(void 0),Ze=n.useCallback((()=>{Ce(void 0),j(void 0),A(!0)}),[]),et=n.useCallback((e=>{j(e),A(!0)}),[]),tt=n.useCallback((()=>{j(void 0),A(!1)}),[]),st=n.useCallback((e=>{s(hs({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),j(void 0),A(!1)}),[s,E]),P=g,ke=o.routines.find((e=>e.scheduleId===P)),C=v((e=>ps(e))),nt=n.useCallback((e=>{s(fs({scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{s(P!=null?K({scheduleId:P}):Se())}),[s,P]);const B=ke?.macroId,at=v((e=>J(e))),be=B!=null&&B!==""&&at.fetchState==="Not-Started";n.useEffect((()=>{be&&B!=null&&s(Ie({macroId:B}))}),[s,be,B]);const ot=v((e=>F(e).uiState.currentChatSessionId))??l,k=o.routines.find((e=>e.scheduleId===g))??o.routines.find((e=>e.scheduleId===Nt(ot))),T=k?.scheduleId??null,[ve,it]=n.useState(!0);n.useEffect((()=>{T!=null&&s(K({scheduleId:T}))}),[s,T]);const Ee=C.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;n.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{s(K({scheduleId:P})),s(he())}),5e3);return()=>window.clearInterval(e)}),[s,Ee,P]);const rt=n.useCallback((e=>{Ce(e),j(void 0),A(!0)}),[]),lt=n.useCallback((e=>{s(gs({scheduleId:e.scheduleId}))}),[s]),ut=n.useCallback(((e,m)=>{s(Is({enabled:m,scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{a&&s(he())}),[s,a]);const Pe=v((e=>R(e).skills)),X=n.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),dt=n.useCallback((e=>{s(Ie({macroId:e}))}),[s]),Z=n.useCallback((()=>{s(Ke()),s(Fe())}),[s]),ct=n.useCallback((()=>{s($())}),[s]),{allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,onCardPolicyVendorSearchTextChange:pt}=Gt();n.useEffect((()=>{s(Cs())}),[s]);const I=v((e=>F(e))),y=Ht.getSignedInUser();n.useEffect((()=>l==="routines"?(s($()),void s(ks())):l==="skills"?(s(Se()),s(Me()),void s(Fe())):(T==null&&s(Se()),s(Me()),void s($()))),[s,T,g,l]);const ft=qt(),_=Zt(ft),b=v((e=>bs(e))),u=I.uiState.currentChatSessionId,w=b.tenantEmailDomain,L=w!=null&&w!=="",ee=n.useCallback((e=>{L&&d(`/${w}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[L,d,w]),te=n.useCallback((()=>{L&&d(`/${w}/ai-cfo/routines`)}),[L,d,w]),se=n.useCallback(((e,m)=>{const D=e.sessionId??C.sessionId;D!=null&&L&&d(`/${w}/ai-cfo/${D}?routine=${encodeURIComponent(m)}`)}),[L,d,C.sessionId,w]),gt=n.useMemo((()=>k==null?void 0:{error:C.fetchState==="Error",kind:"routineRuns",loading:C.fetchState==="In-Progress"||C.fetchState==="Not-Started",routineName:k.name,schedule:zt(k),skillName:k.isAdHoc===!0?void 0:X.find((e=>e.macroId===k.macroId))?.name,onOpenSkill:k.isAdHoc===!0?void 0:Z,runs:C.runs,tzName:k.tzName,unreadCount:k.unreadRuns,open:ve,onToggle:()=>it((e=>!e)),onOpenRun:e=>se(e,k.scheduleId),onOpenRoutine:()=>ee(k),onOpenRoutines:te}),[Z,te,ee,se,ve,k,C.fetchState,C.runs,X]),{handleUploadPromoClose:It,isUploadPromoVisible:Ct}=Wt({isFileUploadEnabled:t,tenantEmailDomain:w}),ne=Yt({currentTenant:b,currentChatSessionId:u,aiCfoView:I,skillsEnabled:V,onCloseSkills:ct,onOpenSkills:Z}),{isSuggestedQuestionsLoading:kt,suggestedPromptQuestions:bt}=Gs(),H=i.state,q=H?.aiCfoInitialQuestion,we=!!H?.aiCfoShouldSubmit;n.useEffect((()=>{const e=i.state;if(e?.[Ve]!==!0)return;f(!0);const m={...e};delete m[Ve],d(i,{replace:!0,state:m})}),[i.pathname,i.search,i.state,d]);const[vt,ae]=n.useState(null),[Et,oe]=n.useState(!1),[Pt,ie]=n.useState(void 0),[wt,re]=n.useState(void 0),ye=n.useRef(!1);n.useEffect((()=>{if(!ye.current&&q!=null&&q!==""){const e=i.state;ae(q),oe(we),ie(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const m=e?.aiCfoSuggestionIndex;re(typeof m=="number"?m:void 0),ye.current=!0}}),[q,we,i.state]);const yt=n.useCallback((()=>{ae(null),oe(!1),ie(void 0),re(void 0),d(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,d]),xe=n.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??H?.aiCfoRef,le=xe.get("emailRefId")??H?.aiCfoEmailRefId,Te=n.useRef(!1);n.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||y==null||(s(vs("controller",y.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,s,y]);const z=I.uiState.lastContextMessage;n.useEffect((()=>{z!=null&&z!==""&&u!=null&&(ae(z),oe(!0),ie(void 0),re(void 0),s(Es()))}),[z,u,s]);const xt=b.masterTOSInfo,x=xt?.isMasterTOSAccepted??!1,{visitedSessions:Oe}=Kt(u),W=I.fetchState,Y=I.uiState.chatSessionsNextPageToken.hasMore||!I.uiState.chatSessionsFirstPageFetched,je=u!=null?I.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(I.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),_e=I.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Rt}=Ye(_e,u),Tt=Rt.length===0;n.useEffect((()=>{x||_||d("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,_,d,i.state]);const Ot=n.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),m=b.tenantEmailDomain;d(e.poppedPathname??(m!=null?`/${m}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[b.tenantEmailDomain,i.state,d]),De=n.useRef(void 0),Qe=n.useRef(void 0);n.useEffect((()=>{const e=l!==De.current,m=u!==Qe.current;De.current=l,Qe.current=u,l!==u&&(!e||l==null||qs(l)?m&&u!=null&&d(`../ai-cfo/${u}`,{state:{...i.state}}):s(Ps({sessionId:l,agentId:"controller"})))}),[u,l]);const jt=n.useMemo((()=>({events:Oe.map((e=>`private-encrypted-chat-${e}.${Je}`)),eventCallback:(e,m,D)=>D.onEventReceived(e,m)})),[Oe]);n.useEffect((()=>{W!=="In-Progress"&&Y&&s(ws())}),[W,Y,s]),n.useEffect((()=>{u!=null&&je!=="In-Progress"&&Ae&&y!=null&&(l===u||W==="Completed"&&!Y)&&s(ys(u,y.userId))}),[je,W,Ae,Y,u,y,l,s]);const ue=y?.userId,At=n.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),Le=n.useCallback((e=>{const m=e!=null&&(e===P||e===T);(a||m)&&s(he()),m&&s(K({scheduleId:e}))}),[s,a,T,P]);zs({events:At,onSubscribed:()=>Le(P??T),onEvent:(e,m)=>{const D=(de=>{if(de==null||typeof de!="object")return null;const Q=de;return fe(Q.schedule_id)&&fe(Q.run_id)?{scheduleId:Q.schedule_id,runId:Q.run_id,status:Ws.find((Qt=>Qt===Q.status))??null,finishedAt:fe(Q.finished_at)?Q.finished_at:null}:null})(m);D!=null&&Le(D.scheduleId)}});const Ue=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(y==null||l==null)throw Error("Can't access AI Controller page without signing in...");const _t=u!=null&&I.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&_)return S.jsxs(Xs,{children:[S.jsx(ce,{analytics:M,onLoad:Ue}),ne.drawerElement,S.jsx(Zs,{children:S.jsx(ze,{children:S.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:Ot,onCompleteClick:()=>{b.userRoleId!=null&&s(pe(b.userRoleId))}})})})]});const Dt=S.jsxs(S.Fragment,{children:[p&&!x?S.jsx(ce,{analytics:M,onLoad:Ue}):null,S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>f(!1):void 0,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})]});return S.jsxs(S.Fragment,{children:[S.jsxs(Js,{children:[S.jsx(ce,{analytics:M,onLoad:e=>e.trackPageLoaded(es.Event.aiCFOPage)}),_&&ne.drawerElement,S.jsx(Ks,{answerExportEndPoint:r,...jt,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:_e,allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,openOnboardingPage:()=>f(!0),userId:y.userId,setIsAiCfoOpen:h,navigate:d,sessionFromUrl:l,location:i,isSubmitting:_t,isEmptyChatWithSession:Tt,currentTenant:b,emailLinkQuestion:vt??void 0,autoSubmitEmailLinkQuestion:Et,onEmailLinkQuestionProcessed:yt,routedInitialQuestionSource:Pt,routedInitialQuestionSuggestionIndex:wt,onCardPolicyVendorSearchTextChange:pt,onMenuClick:_?ne.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:Ct,onUploadPromoClose:It,exploreSuggestedPromptQuestions:bt,exploreSuggestedPromptQuestionsLoading:kt,isSkillsOpen:U,isRoutinesOpen:a,routineCanCreate:O,routineEditing:E,routineEditorOpen:G,routineListError:o.fetchState==="Error",routineListLoading:o.fetchState==="In-Progress",routineMaxRoutines:o.maxRoutines,routineSaveError:c.fetchState==="Error",routineSaving:c.fetchState==="In-Progress",routineSchedulableSkills:X,routines:o.routines,onRoutineCreate:Ze,onRoutineDelete:lt,routineHistoryError:C.fetchState==="Error",routineHistoryLoading:C.fetchState==="In-Progress",chatSidePanel:gt,routineDetail:ke,routineRunningScheduleId:c.runningScheduleId,routineRuns:C.runs,onRoutineEdit:et,onRoutineOpenRun:(e,m)=>se(m,e.scheduleId),onRoutineRun:nt,onRoutineCloseDetail:te,onRoutineDraft:rt,routineDraftPrompt:Xe,onRoutineOpenDetail:ee,onRoutineEditorCancel:tt,onRoutineLoadSkillInstructions:dt,onRoutineSave:st,onRoutineSetEnabled:ut,isCreateSkillEnabled:V,promoDismissalScope:w}),p&&_?S.jsx(Ms,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:en,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:S.jsx(ze,{onClick:e=>e.stopPropagation(),children:S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})})}):null]}),p&&!_?S.jsx(Jt,{open:p,onClose:()=>f(!1),children:S.jsx(Xt,{children:Dt})}):null]})},ze=N($s)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Js=N.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Xs=N.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,Zs=N.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,en=N(Ns)`
|
|
20
|
+
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
21
|
+
color: ${({theme:t})=>t.colors.grey4};
|
|
22
|
+
`;export{bn as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-BD_ga8W6.js";import{a as o,R as $a}from"./sentry-DsaQHQmX.js";import{u as Ze,j as r,g as Ba,h as xa,q as H}from"./core-Bx5kG7oj.js";import{fJ as Fe,UW as Aa,UX as Re,gd as Va,gz as Q,UY as ee,jJ as ye,jh as Te,UZ as _a,U_ as Da,gT as Ma,qi as Za,U$ as Fa,V0 as $e,gq as Ra,V1 as x,fI as Ga,gx as ja,V2 as Ha,V3 as Pa,V4 as La,V5 as Be,V6 as Na,V7 as xe,V8 as Ua,ER as Oa,gr as qa,h6 as za,cZ as Ya,V9 as Ja,Va as Wa,qV as Ka,gc as Xa,jb as Qa,Vb as et,Vc as at,wZ as tt,gs as nt}from"./zeni-epic-state-CP_8Me3V.js";import{w as ot,i as st,a as rt,v as it,p as lt,_ as m,c as dt,u as ct,d as ut,K as mt,e as Ct,f as pt,D as ht,M as ft,g as gt,z as bt,h as P,j as h,m as Ae,k as St,H as kt,l as Ve,n as Et,F as _e,o as wt,B as It,q as te,r as ae,s as vt,x as yt,y as Tt,L as $t,A as Bt,C as xt,E as At,I as Vt}from"./index-DkHntkmh.js";import{u as _t,q as Dt,r as Mt,I as Zt,p as De,t as Ft,D as Me,s as ne}from"./mui-BaMyMAqO.js";import{u as Rt}from"./InboxNotificationsProvider-Dp-eDJC-.js";import{u as Gt}from"./useTaskManagerAccess-CW2xYz9y.js";import{u as jt}from"./useIsCustomersTabEnabled-BiAWPXPy.js";import{u as Ht}from"./expenseAutomationHelper-CAr9eXjQ.js";import"./recharts-Bcj70bk1.js";import"./analytics-CzizEiux.js";import"./plaid-BmyHDSR7.js";import"./dnd-BT4GhSLO.js";import"./stripe-cKAAJElX.js";import"./lottie-EXw6nebq.js";import"./lexical-BVHU6OCB.js";import"./pdf-DnsysvFr.js";import"./utils-Rng1Um8N.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="db3ff06e-bcfe-4d4c-9dcc-b173a1a5ea99",a._sentryDebugIdIdentifier="sentry-dbid-db3ff06e-bcfe-4d4c-9dcc-b173a1a5ea99")}catch{}})();const A="AppDrawer",c={root:`${A}-root`,drawer:`${A}-drawer`,appBar:`${A}-appBar`,menuButton:`${A}-menuButton`,appBarZenilogo:`${A}-appBarZenilogo`,drawerZenilogo:`${A}-drawerZenilogo`},Pt=ne("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:te,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"}}))),Lt=ot((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:S}=rt(),[L,V]=$a.useState(!1),[k,Ge]=o.useState(!1),t=Ba(),s=xa(),oe=Va(),se=it(),n=Ze(),[je,He]=o.useState(!1),N=_t(),re=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{re||(n(Q()),n(ee()))}),[n,re]),o.useEffect((()=>{n(Q()),n(ee())}),[n,a]);const{useFeatureGate:u}=lt(),{isFeatureEnabled:ie}=u(m.isDebitCardFeatureEnabled),E=dt(),i=r((e=>Fe(e))),U=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Pe}=ct(),w=ut(),{isTaskManagerAccessEnabled:_,isZeniUser:Le}=Gt(E),le=mt(),I=Ct(),D=(function(e=2e3){const[l,p]=o.useState(!1);return o.useEffect((()=>{if(l)return;const B=window.requestIdleCallback;if(B==null){const X=window.setTimeout((()=>p(!0)),e);return()=>window.clearTimeout(X)}const G=B((()=>p(!0)),{timeout:e});return()=>{window.cancelIdleCallback?.(G)}}),[e,l]),l})();o.useEffect((()=>{D&&I&&w&&(n(ye()),n(Te()))}),[n,D,I,i.tenantId,w]);const[O,Ne]=o.useState(void 0),Ue=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Oe}=u(m.isChargeCardFeatureEnabled),qe=pt(i,Oe,ie),{isFeatureEnabled:ze}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:M}=u(m.isReferralFeatureEnabled),Ye=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",de=r((e=>_a(e)));o.useEffect((()=>{const e=()=>{He(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const q=r((e=>Da(e))),f=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),g=r((e=>Ma(e))),{monthEndCloseChecksView:v}=g,Je=H("/signout")!==null,Z=H("/:tenantEmailDomain/dashboard")!==null,ce=H("/:tenantEmailDomain/reports")!==null,b=H("/:tenantEmailDomain/onboarding/*")!==null,ue=Ht();o.useEffect((()=>{D&&I&&M&&!b&&q.fetchState==="Not-Started"&&n(Za(!0))}),[D,I,M,q.fetchState,b]),o.useEffect((()=>{if(ue){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n($e(l))}}}),[ue,t.state]);const We=Je||b,z=r((e=>e.tenantState)),Ke=r((e=>z.fetchState==="Completed"?Ra(e):[])),{isFeatureEnabled:Xe}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Qe}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ta}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:na}=u(m.isDashboardSidebarNewYearAnimationEnabled),oa=r((e=>x(e).totalUnreadCount)),sa=r((e=>x(e).notificationDetailsByTab.tasks.uiState.unreadCount)),ra=r((e=>x(e).notificationDetailsByTab.comments.uiState.unreadCount)),ia=r((e=>x(e).reducedFetchCountState)),me=r((e=>x(e).notificationDetailsByTab.tasks.fetchCountState)),Y=r((e=>Ga(e))),la=r((e=>ja(e).skillsEnabled)),da=r((e=>Ha(e))),Ce=r((e=>Pa(e).routines)),ca=o.useMemo((()=>Ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:ht(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[Ce]),ua=new URLSearchParams(t.search).get("routine")??ft(t.pathname.split("/ai-cfo/")[1])??void 0,ma=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:pe}=r(La),[y,J]=o.useState(void 0),W=Y.uiState.currentChatSessionId,F=y!=null?Y.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,he=gt(F),{inboxNotifications:K,isLoading:fe,isFetchingMore:ge,hasFetchedAll:be,fetchMore:Ca}=Rt(),R=r((e=>x(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>Ca?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(y!=null)return he==="In-Progress"&&F==="Completed"?(n(Be({chatSessionId:y})),J(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(Be({chatSessionId:y})),J(void 0)))}),[n,t.state,s,F,y,he,a]),o.useEffect((()=>{if(fe===!1&&ge===!1&&be===!0&&i?.companyId!=null&&K!=null){const e=`dashboard_${i.companyId}`;Ne(K.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[fe,ge,be,i?.companyId,K]),o.useEffect((()=>{I&&_&&!b&&me.fetchState==="Not-Started"&&oe.tenantId!=null&&n(Na("task_manager","dashboard"))}),[I,_,b,me.fetchState,oe.tenantId,n]),o.useEffect((()=>{b||R.fetchState!=="Not-Started"||n(xe({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[b,R.fetchState,n]),o.useEffect((()=>{if(O!=null){const{fetchState:e}=R;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n(xe({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Re({unreadCount:O},"comments")))}}),[O,R.fetchState]);const pa={fetchStatus:ia,count:oa},T=[];Xe===!1&&T.push("accounts_payable_aging"),Qe===!1&&T.push("accounts_receivable_aging"),T.push("zeni_accounts_promo_card","treasury_promo_card"),M===!1&&T.push("rewards_card"),le===!1&&T.push("expense_automation_card");const Se=r((e=>Ua(e,T).fetchState)),ke=r((e=>Oa(e).fetchState)),Ee=a!=null?bt.getSignedInUserTenant(a):null,we=r((e=>Ee?.tenantId!=null?qa(e,Ee.tenantId):void 0)),ha=Z&&(Se==="Completed"||Se==="Error")||ce&&(ke==="Completed"||ke==="Error")||!Z&&!ce?void 0:"disabled",fa=o.useMemo((()=>za(i.userRole)),[i.userRole]),ga=Ya(fa),ba=jt(),$=e=>{V(e)},Sa=Ye,ka=i?.rewardsLastViewedTime==null,Ea=E?.userEmail!=null&&de.fetchState==="Completed"&&Ja(de.notificationSettings,E.userEmail,ie,i,_),wa=o.useCallback((e=>{const l=t.state?.referrer;if(v.monthEndCloseChecks?.auditSummary!=null&&P.trackMonthCloseAuditPage(e.month,e.year,v.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",v.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Wa(i.tenantId,e)),f[i.tenantId]!=null){const p=h(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${g.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:p,referrer:g.currentSelectedView}})}n($e(g.currentSelectedView)),g.reconciliation.selectedAccountId!=null&&n(Ka({selectedAccountId:void 0}))}),[g.reconciliation.selectedAccountId,g.currentSelectedView,i.tenantId,v.monthEndCloseChecks?.auditSummary,v.monthEndCloseChecks?.reportEmailSentDate,f,a,t.state,t.pathname]),Ia=o.useMemo((()=>({zIndex:k?12:Ae[2]})),[k]),va=w&&St(t),Ie=d.jsx(kt,{signedInUser:E,currentTenantId:z.currentTenantId??"",tenants:z.fetchState==="Completed"?Ke:we!=null?[we]:[],rewardsConfiguration:{isRewardsTabVisible:M,isRewardsAnimated:ka,rewardsPlan:q.rewardsPlan},selectedMenu:C===!0?_e("ai_cfo"):Ve(t)&&pe!=="completed"?_e("invoicing"):wt(t),isTenantDropdownDisabled:ha,isSettings:Et(t),isInvoicing:Ve(t)&&pe==="completed",isSettingsFeatureEnabled:ze,currentTenant:i,isVendorsTabVisible:ga,isCustomersTabVisible:ba,isZeniAccountEnabled:Ue,isChargeCardEnabled:qe,isTreasuryEnabled:Sa,isNotificationsTabVisible:Ea,notificationCountDetails:pa,isExpenseAutomationEnabledForUser:le,isAiCfoAccessEnabled:w,skillsEnabled:la&&w,routinesEnabled:da===!0&&w,routines:ca,selectedRoutineId:ua,onRoutineSelect:ma,onNotificationIconClick:()=>{$(!1);const e=Le?sa===0&&ra>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=h(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{se.toggle()},handleTenantSelect:e=>{Pe($t.TENANT_SWITCHING),$(!1),Bt({dispatch:n,navigate:s,pathToNavigate:xt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:E})},handleMenuChange:(e,l)=>{if(E!=null&&P.trackSidePanelClicked(e.type,e.group),$(!1),a==null)return;if(e.type==="routines")return U?(n(Te()),n(et()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return U?(n(ye()),n(at()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(Q()),n(ee()),e.type==="invoicing")return C&&S(!1),n(tt({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&vt(e.type)&&S(!1),e.type==="ai_cfo"){if(P.trackAICFOChatScreenStateChanged("viewed","left_menu",W??null,null),!U)return void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const j=h(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:j,referrer:"Sidebar"}})}const p=h(t.state?.pathnameStackToGoBack,t.pathname),B=e.type,G=Vt(B)&&B!=="command_center";if(B!=="command_center"&&!G||f[i.tenantId]==null||P.trackMonthEndCloseClicked(f[i.tenantId].month,f[i.tenantId].year,"Sidebar"),G&&f[i.tenantId]!=null){const j=f[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${j.month}-${j.year}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})}const X=yt(e.type);Tt(e.type)?(W!=null&&n(nt()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:p.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${X}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Qa(e)),W===e&&J(e)},handleLogOutClick:()=>{$(!1);const e=h(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:v,onPeriodChange:wa,onCalendarOpen:Ge,aiCfoView:Y,isAiCfo:va,isOnDashboard:Z,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Xa({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:ea,thanksGivingAnimationEnabled:aa,christmasAnimationEnabled:ta,newYearAnimationEnabled:na}),ya=d.jsx(Dt,{position:"fixed",className:c.appBar,style:{borderBottom:je?`1px solid ${N.colors.grey2}`:""},children:d.jsxs(Mt,{style:{minHeight:It},children:[d.jsx(Zt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>$(!0),className:c.menuButton,size:"large",children:d.jsx(Nt,{})}),d.jsx(Ut,{className:c.appBarZenilogo,onClick:()=>{se.toggle()}})]})}),ve=De((e=>e.breakpoints.up("md"))),Ta=De((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Pt,{className:c.root,children:[d.jsx(Ft,{}),We===!1?d.jsxs(d.Fragment,{children:[ve||!Z?null:ya,d.jsxs("nav",{className:c.drawer,children:[ve?null:d.jsx(Me,{container:window.document.body,variant:"temporary",open:L,onClose:()=>$(!1),PaperProps:{sx:{width:te,zIndex:Ae[2],borderRight:"none",backgroundImage:"none",backgroundColor:N.colors.background}},ModalProps:{keepMounted:!0},children:Ie}),Ta?null:d.jsx(Me,{PaperProps:{sx:{width:te,borderRight:"none",backgroundImage:"none",backgroundColor:N.colors.background,...Ia}},variant:"permanent",open:!0,children:Ie})]})]}):null]})})),c1=({tenantEmailDomain:a})=>{const C=Ze(),S=r((V=>Fe(V))),L={events:S.userRoleId!=null?[`private-encrypted-${S.userRoleId}.dashboard-user-notification`]:[],eventCallback:(V,k)=>{st(k)&&Aa(k.mode)==="dashboard"&&C(Re({unreadCount:k.data.unread},"tasks"))}};return d.jsx(Lt,{tenantEmailDomain:a,...L})},Nt=ne((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.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 d}from"./liveblocks-BLpmr1Pv.js";import{a as o,R as $a}from"./sentry-DWNq3t8E.js";import{u as Fe,j as r,g as Ba,h as xa,q as H}from"./core-CbdTrw7T.js";import{fJ as Ze,V5 as Va,V6 as Ge,gd as Aa,gz as K,V7 as ee,jQ as ye,jo as Te,V8 as _a,V9 as Da,gT as Ma,qt as Fa,Va as Za,Vb as $e,gq as Ga,Vc as x,fI as Ra,gx as ja,Vd as Ha,Ve as La,Vf as Pa,Vg as Be,Vh as Na,Vi as xe,Vj as Oa,E$ as Ua,gr as qa,h6 as za,cO as Ya,Vk as Ja,h9 as Qa,r4 as Wa,gc as Xa,ji as Ka,Vl as et,Vm as at,x8 as tt,gs as nt}from"./zeni-epic-state-C5DO1jkr.js";import{w as ot,f as st,g as rt,j as it,p as lt,_ as m,k as dt,u as ct,a as ut,h as mt,m as Ct,i as pt,q as ht,n as ft,o as gt,z as bt,c as L,s as h,v as Ve,x as St,y as kt,A as Ae,B as Et,X as _e,C as wt,Y as It,D as te,E as ae,F as vt,H as yt,I as Tt,L as $t,J as Bt,M as xt,N as Vt,O as At}from"./index-CnIO6_IQ.js";import{u as _t,q as Dt,r as Mt,I as Ft,p as De,t as Zt,D as Me,s as ne}from"./mui-DNGY4bFU.js";import{u as Gt}from"./InboxNotificationsProvider-CiKEEv6Q.js";import{u as Rt}from"./useTaskManagerAccess-Cm5trA3i.js";import{u as jt}from"./useIsCustomersTabEnabled-C6mkabn2.js";import{u as Ht}from"./expenseAutomationHelper-CgTsmmCm.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="755fcc74-3289-455e-967e-d7c6d9394a60",a._sentryDebugIdIdentifier="sentry-dbid-755fcc74-3289-455e-967e-d7c6d9394a60")}catch{}})();const V="AppDrawer",c={root:`${V}-root`,drawer:`${V}-drawer`,appBar:`${V}-appBar`,menuButton:`${V}-menuButton`,appBarZenilogo:`${V}-appBarZenilogo`,drawerZenilogo:`${V}-drawerZenilogo`},Lt=ne("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:te,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"}}))),Pt=ot((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:S}=rt(),[P,A]=$a.useState(!1),[k,Re]=o.useState(!1),t=Ba(),s=xa(),oe=Aa(),se=it(),n=Fe(),[je,He]=o.useState(!1),N=_t(),re=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{re||(n(K()),n(ee()))}),[n,re]),o.useEffect((()=>{n(K()),n(ee())}),[n,a]);const{useFeatureGate:u}=lt(),{isFeatureEnabled:ie}=u(m.isDebitCardFeatureEnabled),E=dt(),i=r((e=>Ze(e))),O=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Le}=ct(),w=ut(),{isTaskManagerAccessEnabled:_,isZeniUser:Pe}=Rt(E),le=mt(),I=Ct(),D=(function(e=2e3){const[l,p]=o.useState(!1);return o.useEffect((()=>{if(l)return;const B=window.requestIdleCallback;if(B==null){const X=window.setTimeout((()=>p(!0)),e);return()=>window.clearTimeout(X)}const R=B((()=>p(!0)),{timeout:e});return()=>{window.cancelIdleCallback?.(R)}}),[e,l]),l})();o.useEffect((()=>{D&&I&&w&&(n(ye()),n(Te()))}),[n,D,I,i.tenantId,w]);const[U,Ne]=o.useState(void 0),Oe=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Ue}=u(m.isChargeCardFeatureEnabled),qe=pt(i,Ue,ie),{isFeatureEnabled:ze}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:M}=u(m.isReferralFeatureEnabled),Ye=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",de=r((e=>_a(e)));o.useEffect((()=>{const e=()=>{He(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const q=r((e=>Da(e))),f=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),g=r((e=>Ma(e))),{monthEndCloseChecksView:v}=g,Je=H("/signout")!==null,F=H("/:tenantEmailDomain/dashboard")!==null,ce=H("/:tenantEmailDomain/reports")!==null,b=H("/:tenantEmailDomain/onboarding/*")!==null,ue=Ht();o.useEffect((()=>{D&&I&&M&&!b&&q.fetchState==="Not-Started"&&n(Fa(!0))}),[D,I,M,q.fetchState,b]),o.useEffect((()=>{if(ue){const e=t.state?.origin;if(e!=null){const l=Za(e);l!=null&&n($e(l))}}}),[ue,t.state]);const Qe=Je||b,z=r((e=>e.tenantState)),We=r((e=>z.fetchState==="Completed"?Ga(e):[])),{isFeatureEnabled:Xe}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Ke}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ta}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:na}=u(m.isDashboardSidebarNewYearAnimationEnabled),oa=r((e=>x(e).totalUnreadCount)),sa=r((e=>x(e).notificationDetailsByTab.tasks.uiState.unreadCount)),ra=r((e=>x(e).notificationDetailsByTab.comments.uiState.unreadCount)),ia=r((e=>x(e).reducedFetchCountState)),me=r((e=>x(e).notificationDetailsByTab.tasks.fetchCountState)),Y=r((e=>Ra(e))),la=r((e=>ja(e).skillsEnabled)),da=r((e=>Ha(e))),Ce=r((e=>La(e).routines)),ca=o.useMemo((()=>Ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:ht(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[Ce]),ua=new URLSearchParams(t.search).get("routine")??ft(t.pathname.split("/ai-cfo/")[1])??void 0,ma=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:pe}=r(Pa),[y,J]=o.useState(void 0),Q=Y.uiState.currentChatSessionId,Z=y!=null?Y.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,he=gt(Z),{inboxNotifications:W,isLoading:fe,isFetchingMore:ge,hasFetchedAll:be,fetchMore:Ca}=Gt(),G=r((e=>x(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>Ca?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(y!=null)return he==="In-Progress"&&Z==="Completed"?(n(Be({chatSessionId:y})),J(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(Z==="Error"&&(n(Be({chatSessionId:y})),J(void 0)))}),[n,t.state,s,Z,y,he,a]),o.useEffect((()=>{if(fe===!1&&ge===!1&&be===!0&&i?.companyId!=null&&W!=null){const e=`dashboard_${i.companyId}`;Ne(W.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[fe,ge,be,i?.companyId,W]),o.useEffect((()=>{I&&_&&!b&&me.fetchState==="Not-Started"&&oe.tenantId!=null&&n(Na("task_manager","dashboard"))}),[I,_,b,me.fetchState,oe.tenantId,n]),o.useEffect((()=>{b||G.fetchState!=="Not-Started"||n(xe({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[b,G.fetchState,n]),o.useEffect((()=>{if(U!=null){const{fetchState:e}=G;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n(xe({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ge({unreadCount:U},"comments")))}}),[U,G.fetchState]);const pa={fetchStatus:ia,count:oa},T=[];Xe===!1&&T.push("accounts_payable_aging"),Ke===!1&&T.push("accounts_receivable_aging"),T.push("zeni_accounts_promo_card","treasury_promo_card"),M===!1&&T.push("rewards_card"),le===!1&&T.push("expense_automation_card");const Se=r((e=>Oa(e,T).fetchState)),ke=r((e=>Ua(e).fetchState)),Ee=a!=null?bt.getSignedInUserTenant(a):null,we=r((e=>Ee?.tenantId!=null?qa(e,Ee.tenantId):void 0)),ha=F&&(Se==="Completed"||Se==="Error")||ce&&(ke==="Completed"||ke==="Error")||!F&&!ce?void 0:"disabled",fa=o.useMemo((()=>za(i.userRole)),[i.userRole]),ga=Ya(fa),ba=jt(),$=e=>{A(e)},Sa=Ye,ka=i?.rewardsLastViewedTime==null,Ea=E?.userEmail!=null&&de.fetchState==="Completed"&&Ja(de.notificationSettings,E.userEmail,ie,i,_),wa=o.useCallback((e=>{const l=t.state?.referrer;if(v.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(e.month,e.year,v.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",v.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Qa(i.tenantId,e)),f[i.tenantId]!=null){const p=h(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${g.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:p,referrer:g.currentSelectedView}})}n($e(g.currentSelectedView)),g.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[g.reconciliation.selectedAccountId,g.currentSelectedView,i.tenantId,v.monthEndCloseChecks?.auditSummary,v.monthEndCloseChecks?.reportEmailSentDate,f,a,t.state,t.pathname]),Ia=o.useMemo((()=>({zIndex:k?12:Ve[2]})),[k]),va=w&&St(t),Ie=d.jsx(kt,{signedInUser:E,currentTenantId:z.currentTenantId??"",tenants:z.fetchState==="Completed"?We:we!=null?[we]:[],rewardsConfiguration:{isRewardsTabVisible:M,isRewardsAnimated:ka,rewardsPlan:q.rewardsPlan},selectedMenu:C===!0?_e("ai_cfo"):Ae(t)&&pe!=="completed"?_e("invoicing"):wt(t),isTenantDropdownDisabled:ha,isSettings:Et(t),isInvoicing:Ae(t)&&pe==="completed",isSettingsFeatureEnabled:ze,currentTenant:i,isVendorsTabVisible:ga,isCustomersTabVisible:ba,isZeniAccountEnabled:Oe,isChargeCardEnabled:qe,isTreasuryEnabled:Sa,isNotificationsTabVisible:Ea,notificationCountDetails:pa,isExpenseAutomationEnabledForUser:le,isAiCfoAccessEnabled:w,skillsEnabled:la&&w,routinesEnabled:da===!0&&w,routines:ca,selectedRoutineId:ua,onRoutineSelect:ma,onNotificationIconClick:()=>{$(!1);const e=Pe?sa===0&&ra>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=h(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{se.toggle()},handleTenantSelect:e=>{Le($t.TENANT_SWITCHING),$(!1),Bt({dispatch:n,navigate:s,pathToNavigate:xt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:E})},handleMenuChange:(e,l)=>{if(E!=null&&L.trackSidePanelClicked(e.type,e.group),$(!1),a==null)return;if(e.type==="routines")return O?(n(Te()),n(et()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return O?(n(ye()),n(at()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(K()),n(ee()),e.type==="invoicing")return C&&S(!1),n(tt({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&vt(e.type)&&S(!1),e.type==="ai_cfo"){if(L.trackAICFOChatScreenStateChanged("viewed","left_menu",Q??null,null),!O)return void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const j=h(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:j,referrer:"Sidebar"}})}const p=h(t.state?.pathnameStackToGoBack,t.pathname),B=e.type,R=At(B)&&B!=="command_center";if(B!=="command_center"&&!R||f[i.tenantId]==null||L.trackMonthEndCloseClicked(f[i.tenantId].month,f[i.tenantId].year,"Sidebar"),R&&f[i.tenantId]!=null){const j=f[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${j.month}-${j.year}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})}const X=yt(e.type);Tt(e.type)?(Q!=null&&n(nt()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:p.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${X}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Ka(e)),Q===e&&J(e)},handleLogOutClick:()=>{$(!1);const e=h(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:v,onPeriodChange:wa,onCalendarOpen:Re,aiCfoView:Y,isAiCfo:va,isOnDashboard:F,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Xa({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:ea,thanksGivingAnimationEnabled:aa,christmasAnimationEnabled:ta,newYearAnimationEnabled:na}),ya=d.jsx(Dt,{position:"fixed",className:c.appBar,style:{borderBottom:je?`1px solid ${N.colors.grey2}`:""},children:d.jsxs(Mt,{style:{minHeight:It},children:[d.jsx(Ft,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>$(!0),className:c.menuButton,size:"large",children:d.jsx(Nt,{})}),d.jsx(Ot,{className:c.appBarZenilogo,onClick:()=>{se.toggle()}})]})}),ve=De((e=>e.breakpoints.up("md"))),Ta=De((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Lt,{className:c.root,children:[d.jsx(Zt,{}),Qe===!1?d.jsxs(d.Fragment,{children:[ve||!F?null:ya,d.jsxs("nav",{className:c.drawer,children:[ve?null:d.jsx(Me,{container:window.document.body,variant:"temporary",open:P,onClose:()=>$(!1),PaperProps:{sx:{width:te,zIndex:Ve[2],borderRight:"none",backgroundImage:"none",backgroundColor:N.colors.background}},ModalProps:{keepMounted:!0},children:Ie}),Ta?null:d.jsx(Me,{PaperProps:{sx:{width:te,borderRight:"none",backgroundImage:"none",backgroundColor:N.colors.background,...Ia}},variant:"permanent",open:!0,children:Ie})]})]}):null]})})),c1=({tenantEmailDomain:a})=>{const C=Fe(),S=r((A=>Ze(A))),P={events:S.userRoleId!=null?[`private-encrypted-${S.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,k)=>{st(k)&&Va(k.mode)==="dashboard"&&C(Ge({unreadCount:k.data.unread},"tasks"))}};return d.jsx(Pt,{tenantEmailDomain:a,...P})},Nt=ne((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.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};
|
|
5
|
-
`,
|
|
6
|
-
height: ${
|
|
5
|
+
`,Ot=ne((a=>o.createElement("svg",{viewBox:"0 0 102 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{d:"M73.4046 13.2609H57.77C58.0392 15.0844 58.8324 16.5249 60.352 17.5133C61.5784 18.3113 62.9424 18.5733 64.3842 18.407C64.8867 18.3484 65.3952 18.2539 65.8738 18.0935C67.1433 17.6676 68.0945 16.8923 68.4559 15.5031H73.2777C73.1629 16.3885 72.8877 17.1866 72.4845 17.938C71.4734 19.8189 69.9228 21.1159 67.9414 21.8302C64.3076 23.138 60.7875 22.9178 57.5642 20.6588C55.1293 18.9526 53.7318 16.5465 53.3034 13.6055C52.9959 11.4973 53.2065 9.43809 54.1374 7.49857C55.6988 4.2453 58.2761 2.29381 61.8273 1.67642C64.048 1.28995 66.2124 1.54361 68.2202 2.60969C71.2784 4.23333 73.0085 6.79743 73.4405 10.2314C73.5649 11.2161 73.5374 12.202 73.407 13.2621L73.4046 13.2609ZM68.3554 9.72765C68.3278 9.51706 68.3159 9.334 68.2788 9.15692C68.0622 8.12913 67.4915 7.32388 66.6767 6.68735C65.7697 5.97902 64.7264 5.68349 63.5825 5.62486C61.0543 5.49444 58.8289 7.02356 58.0918 9.44408C58.0655 9.52903 58.0595 9.62116 58.0416 9.72765H68.3566H68.3554Z",fill:"currentColor"}),o.createElement("path",{d:"M52.7423 17.86V21.9162C52.7423 22.0478 52.6346 22.1555 52.503 22.1555H34.5854C34.5854 22.1555 34.595 19.9659 34.5783 19.1008C34.5723 18.7861 34.662 18.5528 34.8786 18.3183C38.3664 14.535 41.8458 10.7445 45.3276 6.95397C45.452 6.81877 45.744 6.49093 45.744 6.49093H35.6396C35.5079 6.49093 35.4003 6.38324 35.4003 6.25163V2.14645C35.4003 2.01483 35.5079 1.90715 35.6396 1.90715H52.6334C52.6334 1.90715 52.6274 4.18288 52.6418 5.17239C52.6454 5.41767 52.5341 5.57321 52.3833 5.73713C50.1543 8.15884 41.5048 17.6219 41.5048 17.6219H52.5042C52.6358 17.6219 52.7435 17.7296 52.7435 17.8612L52.7423 17.86Z",fill:"currentColor"}),o.createElement("path",{d:"M94.0631 22.0758H89.7353C89.6037 22.0758 89.496 21.9694 89.496 21.8377C89.4925 20.5539 89.4733 14.3919 89.4769 11.3696C89.4769 10.6397 89.4195 9.92064 89.2041 9.21829C88.6142 7.29553 87.0528 6.12056 85.0367 6.07151C83.7122 6.0392 82.5288 6.37542 81.58 7.34578C80.8406 8.10196 80.4386 9.02686 80.2998 10.0642C80.2388 10.5213 80.2148 10.9879 80.2136 11.4498C80.2076 14.429 80.2088 20.5539 80.21 21.8365C80.21 21.9682 80.1023 22.0758 79.9707 22.0758H75.6047C75.4731 22.0758 75.3654 21.9705 75.3654 21.8389C75.3606 20.512 75.3403 13.9576 75.387 10.6349C75.4205 8.27546 76.1838 6.1433 77.78 4.36411C79.2062 2.77516 80.9973 1.84189 83.1056 1.52243C84.8441 1.258 86.5658 1.3286 88.2254 1.93642C91.4727 3.12454 93.3954 5.47924 94.093 8.83302C94.2557 9.61314 94.3072 10.4268 94.3131 11.226C94.3335 14.3321 94.3083 20.5503 94.3036 21.8401C94.3036 21.9717 94.1959 22.077 94.0643 22.077L94.0631 22.0758Z",fill:"currentColor"}),o.createElement("path",{d:"M97.2196 1.90527H101.482C101.613 1.90527 101.721 2.01176 101.721 2.14338L101.772 21.9035C101.772 22.0363 101.666 22.144 101.533 22.144H97.2256C97.094 22.144 96.9863 22.0363 96.9863 21.9047L96.9803 2.14457C96.9803 2.01296 97.088 1.90527 97.2196 1.90527Z",fill:"currentColor"}),o.createElement("path",{d:"M17.1795 0.0270299C16.9776 -0.0551712 16.7491 0.057251 16.6911 0.267589C16.6706 0.342537 16.6476 0.417486 16.6234 0.491225C16.4022 1.1573 16.0299 1.76655 15.5197 2.27789C14.6566 3.14221 13.5082 3.61971 12.2861 3.62091H12.2825C11.0627 3.62091 9.91435 3.14584 9.05124 2.28394C8.54111 1.77381 8.16636 1.16455 7.94394 0.499687C7.91976 0.425947 7.89679 0.350999 7.87503 0.276051C7.81701 0.0657128 7.58854 -0.0455005 7.38666 0.0367007C6.20321 0.522655 5.108 1.17906 4.13125 1.97447C4.00795 2.07481 3.96806 2.24525 4.02729 2.39273C4.07686 2.51603 4.13004 2.63813 4.18565 2.7578C4.62204 3.70916 5.22888 4.58557 5.99166 5.34714C7.67316 7.02501 9.90589 7.94977 12.2813 7.94977H12.2897C14.6675 7.94736 16.9027 7.01897 18.5829 5.33626C19.3445 4.57348 19.9489 3.69586 20.3841 2.7445C20.4397 2.62362 20.4917 2.50153 20.5413 2.37823C20.6005 2.23075 20.5606 2.0603 20.4373 1.95997C19.4594 1.16576 18.3629 0.511775 17.1795 0.0270299Z",fill:"#97C3B9"}),o.createElement("path",{d:"M20.3984 21.2422C19.962 20.2933 19.3564 19.4193 18.596 18.6602C16.9133 16.9799 14.6733 16.0527 12.2979 16.0575C8.71131 16.0611 5.61789 18.196 4.2108 21.2604C4.1564 21.38 4.10321 21.5009 4.05244 21.623C3.992 21.7705 4.03189 21.9422 4.1564 22.0437C5.13435 22.8367 6.22956 23.4895 7.41181 23.973C7.61369 24.0552 7.84095 23.944 7.90018 23.7337C7.92073 23.6575 7.9437 23.5838 7.96908 23.5088C8.57713 21.698 10.2876 20.3888 12.3016 20.3864H12.3064C13.5261 20.3864 14.6745 20.8615 15.5376 21.7234C16.0466 22.2311 16.4189 22.8379 16.6413 23.5004C16.6667 23.5741 16.6897 23.649 16.7102 23.724C16.7694 23.9343 16.9967 24.0455 17.1986 23.9621C18.382 23.4762 19.476 22.821 20.4528 22.0256C20.5761 21.9252 20.616 21.7536 20.5567 21.6061C20.5072 21.4828 20.454 21.3619 20.3984 21.241V21.2422Z",fill:"#97C3B9"}),o.createElement("path",{d:"M0.494416 9.85376C0.31309 9.85376 0.161985 9.98795 0.13539 10.1669C0.045936 10.7676 0 11.3829 0 12.0091C0 12.6401 0.0483536 13.2603 0.141434 13.8659C0.169238 14.0448 0.320343 14.1778 0.501669 14.1778L24.0934 14.1427C24.2747 14.1427 24.4258 14.0086 24.4524 13.8296C24.5419 13.2288 24.589 12.6135 24.5878 11.9862C24.5878 11.3551 24.5395 10.735 24.4464 10.1294C24.4186 9.95047 24.2675 9.8175 24.0862 9.8175L0.494416 9.85256V9.85376Z",fill:"#97C3B9"}))))`
|
|
6
|
+
height: ${Vt.sp4};
|
|
7
7
|
width: 102px;
|
|
8
8
|
color: ${a=>a.theme.colors.primary};
|
|
9
9
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-BD_ga8W6.js";import{a as d}from"./sentry-DsaQHQmX.js";import{h as U,g as j,u as B,j as y,N as W,l as V,i as q,n as te,o as x}from"./core-Bx5kG7oj.js";import{fJ as _,_p as w,_6 as R,Iq as E,Ik as K,Io as A,Id as z,_8 as J,Ih as ae,Is as oe,Ig as G,Iv as H,Ir as C}from"./zeni-epic-state-CP_8Me3V.js";import{z as P,w as M,c0 as pe,n as k,bW as Q,c1 as le,a5 as X,c2 as se,c3 as ne}from"./index-DkHntkmh.js";import{u as Y}from"./mui-BaMyMAqO.js";import{u as Z}from"./useEnsureVendorListLoaded-CCsBxqME.js";import{i as re}from"./ReimbursementApprovalRuleDetailScreen-DE6y72u6.js";import ie from"./NotFoundScreen-oYE2WlvI.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]="4b475545-0fa0-42e7-9093-e38f9a53a054",e._sentryDebugIdIdentifier="sentry-dbid-4b475545-0fa0-42e7-9093-e38f9a53a054")}catch{}})();const T="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(T)&&e(J(!1))},onBackClick:()=>{k(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(M(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>_(r))),c=y((r=>w(r))),m=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{m?.updateStatus.fetchState==="Completed"&&o(E())}),[m]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(K(!0,!0,!1)))}),[a,p,e,o]),P.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 S={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${T}`]:[],eventCallback:(r,h,I)=>{r.endsWith(T)&&I.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(W,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...S})},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(J(!1))},onBackClick:()=>{k(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(M(le)),ve=()=>{const e=y((o=>_(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Q(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),m=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),S=y((i=>_(i)));Z();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(K(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||m!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,m,e,o]),P.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:S.companyId!=null?[`private-encrypted-${S.companyId}.${L}`]:[],eventCallback:(i,b,g)=>{i.endsWith(L)&&g.onApprovalRulesEventReceived(i)}};return S?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(W,{to:"../../promo"}):u.jsx(de,{currentTenant:S,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=k(l.location);return{onApprovalRuleDataUpdated:p=>{const f=m=>{const S=[];return m.forEach((r=>{const h=r.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),I=r.actors.selectedNonUsers.map((b=>{const g=!!re(b.value);return{type:g?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!g}})),i=h.concat(I);S.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},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 m={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}else{const m={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}},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(H(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=q(),a=P.getSignedInUser(),n=Y(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(G(!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(X,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const Se=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=k(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const b=[];return i.forEach((g=>{const N=g.actorKind?.selectedOption,ee=g.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((O=>({type:"attribute",subType:O.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map((O=>({type:"user",userId:O.userId,isImplicitActor:!1}))));const $=g.action??"require_approval";b.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),b},c=p.amountCriteria,m=p.vendorCriteria,S=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=m?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:m?.operator.selectedOption??"is",vendorIds:h});const I=S?.selection.selectedOptions??[];if(I.length>0&&(r.department={type:"department",operator:S?.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(H(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function F(){const e=y((t=>_(t))),{isApprovalRulesV3Enabled:l}=Q(e?.tenantId);return l?u.jsx(ge,{}):u.jsx(me,{})}function ge(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=q(),a=P.getSignedInUser(),n=Y(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(Z(),d.useEffect((()=>{p||(f(!0),l(G(!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(X,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(Se,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function Ce(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(F,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{Ce as B};
|
|
1
|
+
import{j as u}from"./liveblocks-BLpmr1Pv.js";import{a as d}from"./sentry-DWNq3t8E.js";import{h as U,g as j,u as B,j as y,N as W,l as V,i as q,n as te,o as x}from"./core-CbdTrw7T.js";import{fJ as P,Xz as w,Xg as R,IA as E,Iu as X,Iy as A,In as z,Xi as K,Ir as ae,IC as oe,Iq as J,IF as G,IB as C}from"./zeni-epic-state-C5DO1jkr.js";import{z as k,w as H,bh as pe,B as O,b0 as M,bi as le,a8 as Q,bj as se,bk as ne}from"./index-CnIO6_IQ.js";import{u as Y}from"./mui-DNGY4bFU.js";import{u as Z}from"./useEnsureVendorListLoaded-CIShbpK4.js";import{i as re}from"./ReimbursementApprovalRuleDetailScreen-CHTcY28V.js";import ie from"./NotFoundScreen-DXy-BCit.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]="83691e95-825f-44fb-ad1e-1c5ed4bf2ab7",e._sentryDebugIdIdentifier="sentry-dbid-83691e95-825f-44fb-ad1e-1c5ed4bf2ab7")}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:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(H(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[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))),m=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{m?.updateStatus.fetchState==="Completed"&&o(E())}),[m]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(X(!0,!0,!1)))}),[a,p,e,o]),k.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 S={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(W,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...S})},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:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(H(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=M(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),m=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),S=y((i=>P(i)));Z();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||m!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,m,e,o]),k.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:S.companyId!=null?[`private-encrypted-${S.companyId}.${L}`]:[],eventCallback:(i,b,g)=>{i.endsWith(L)&&g.onApprovalRulesEventReceived(i)}};return S?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(W,{to:"../../promo"}):u.jsx(de,{currentTenant:S,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=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=m=>{const S=[];return m.forEach((r=>{const h=r.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),I=r.actors.selectedNonUsers.map((b=>{const g=!!re(b.value);return{type:g?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!g}})),i=h.concat(I);S.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},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 m={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}else{const m={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}},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(G(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=q(),a=k.getSignedInUser(),n=Y(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(J(!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(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const Se=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=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const b=[];return i.forEach((g=>{const N=g.actorKind?.selectedOption,ee=g.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map((T=>({type:"user",userId:T.userId,isImplicitActor:!1}))));const $=g.action??"require_approval";b.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),b},c=p.amountCriteria,m=p.vendorCriteria,S=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=m?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:m?.operator.selectedOption??"is",vendorIds:h});const I=S?.selection.selectedOptions??[];if(I.length>0&&(r.department={type:"department",operator:S?.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(G(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function F(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=M(e?.tenantId);return l?u.jsx(ge,{}):u.jsx(me,{})}function ge(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=q(),a=k.getSignedInUser(),n=Y(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(Z(),d.useEffect((()=>{p||(f(!0),l(J(!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(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(Se,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function Ce(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(F,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{Ce as B};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-BLpmr1Pv.js";import{h as q,u as le,g as K,i as ee,j as v,N as Y,l as Q,q as tt,n as nt,o as y}from"./core-CbdTrw7T.js";import{fJ as H,WS as _e,bp as Ia,Tp as it,bn as va,bK as de,WT as ka,HQ as wa,Jd as Re,Ir as ot,bm as Ce,WU as lt,WV as st,c8 as rt,WW as ct,mb as xa,WX as Ba,WY as Ca,JH as Ue,I7 as xe,WZ as dt,HE as ea,W_ as ut,Nz as pt,HI as mt,HO as Aa,W$ as Se,X0 as Ge,Je as Me,I4 as Da,X1 as bt,X2 as ht,Jh as Oe,X3 as gt,Jn as St,X4 as Ea,IS as aa,IX as yt,X5 as ft,X6 as ce,X7 as Ta,X8 as ja,X9 as Pa,g_ as It,Ic as Ve,cz as Fa,Xa as vt,gl as kt,Xb as wt,Xc as xt,er as Ra,eq as Va,Xd as Ne,Xe as Bt,Xf as Ct,VY as ze,Xg as At,V_ as ie,VZ as Xe,Xh as Dt,Xi as Et,Xj as Tt,IZ as ta,IW as jt,Xk as Pt,Xl as Ft,Xm as Rt,II as Vt,Xn as $t,Xo as Lt,cm as $a,ec as La,mm as _t,bP as Ut,bw as _a,bQ as Ua,GU as Gt,Xp as Mt,Nm as Ot,Ns as Nt,CY as zt,Jf as Xt,JO as Wt,mz as ge,Xq as Zt,Xr as Ga,n1 as Ht,mt as Ma,mO as Oa,mN as na,bF as pe,bO as Jt,Xs as qt,Xt as ye,kZ as Kt,Xu as ia,Xv as Qt,l1 as Yt,lm as en,K0 as an,Xw as tn,mW as nn,JS as on,Xx as oa,JW as ln,J$ as sn,JZ as rn,JQ as cn,Xy as Na,HZ as dn,Xz as un,XA as pn,gK as mn,gJ as bn,gI as hn,mC as gn,mU as la,n3 as Sn,vr as yn,mL as fn,JU as In,l7 as vn,n8 as kn,XB as wn,k$ as xn,vi as Bn,XC as Cn,IO as An,bL as Dn,bs as En,hb as Tn,ef as jn,ee as Pn,cy as Fn,cF as Rn}from"./zeni-epic-state-C5DO1jkr.js";import{z as V,V as fe,al as We,p as oe,_ as f,au as Ze,a8 as se,N as A,a9 as Ae,c as E,aH as Vn,a5 as Z,aj as He,s as D,a2 as Ie,aI as sa,aJ as ra,aK as $n,aL as Ln,ag as _n,aM as Un,ac as za,G as De,ah as Je,aN as Gn,af as Xa,aO as Mn,aC as On,R as Wa,w as Nn,aP as zn,aQ as Xn,aR as Wn,aS as Zn,aT as Hn,aU as Jn,aV as qn,aW as Kn,aX as Qn,j as Yn,aY as ei,aZ as ai,a_ as ti,az as ni,a$ as ii,i as oi}from"./index-CnIO6_IQ.js";import{u as ue,n as _,S as li}from"./mui-DNGY4bFU.js";import{A as ca}from"./AddressScreen-DgUwrml_.js";import{g as ne,a as Ee,i as Za,V as qe,b as Ke,c as si,v as ri,d as ci,A as me,D as be}from"./DomesticWireDetailScreen-BxClNf2J.js";import{a as g}from"./sentry-DWNq3t8E.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";import{u as Ha}from"./useInitialThreadRequest-DAUsQlCl.js";import{u as di}from"./BusinessVerificationPageScreen-DM_jBIuD.js";import Be from"./NotFoundScreen-DXy-BCit.js";import{D as ui}from"./DrawerScreen-BHaectiO.js";import{M as Ja}from"./MobileAppDrawer-BWNb5zLN.js";import{F as qa}from"./FeaturePreviewScreen-DHt0WFS8.js";import{S as Te}from"./SetupPagesScreen-D6ssIWb0.js";import{B as pi}from"./BillPayApprovalRoutes-BcCgse3-.js";import{F as mi}from"./FallBackRoute-DuMHkNqk.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";import"./routePaths-CV12X_S-.js";import"./InboxNotificationsProvider-CiKEEv6Q.js";import"./useTaskManagerAccess-Cm5trA3i.js";import"./useIsCustomersTabEnabled-C6mkabn2.js";import"./analyticsHelper-CWMk7_rd.js";import"./useEnsureVendorListLoaded-CIShbpK4.js";import"./ReimbursementApprovalRuleDetailScreen-CHTcY28V.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="4e6c5acf-a9d2-40e5-9d49-85f47d365ab2",e._sentryDebugIdIdentifier="sentry-dbid-4e6c5acf-a9d2-40e5-9d49-85f47d365ab2")}catch{}})();const bi=Q((function(e,a){const l=_e(e,a.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=Z(a.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ce(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=lt(l.billActivities,st(a.currentTenant),n);i=S,d=h}const p=rt(a.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ct(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xa(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${He}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:a.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:a.hasZeniAssistAccess,analytics:E,showMarkAsPaidButtonToCreator:m}}),(function(e,a){const{billId:l,currentTenant:n,location:c,navigate:r}=a,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{E.trackBillPayDeleteBill(l,o),e(Aa(l))},cancelAndDeleteBill:(o,s)=>{s===!0?E.trackBillPayCancelAndDeleteBill(l,o):E.trackBillPayCancelBill(l),e(mt(l,s))},onSaveRealTimeApprovals:o=>{e(pt(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ut({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(ea(l,o.type,"")):e(ea(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=Z(a.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(dt({billId:a.billId}))},onRefundPaymentClick:()=>{e(xe(a.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ca({data:i,billId:l})),e(Ue(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Ba({billId:l}))}}}))(Vn);function hi(){const e=q(),a=le(),l=K(),{billId:n}=ee(),c=ue(),r=V.getSignedInUser(),u=fe(),o=v((U=>H(U))),s=v((U=>_e(U,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Ha(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&Ia(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,C]=g.useState(!1),[I,j]=g.useState(!1),[B,T]=g.useState(!1),{useFeatureGate:k,useDynamicConfig:$}=oe(),{isFeatureEnabled:N}=k(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:G}=k(f.isBillPayDetectInsufficientFundsEnabled),{configValue:z}=$(Ze.zeniAssistConfig),X=it(o),w=va(o.userRole),M=h&&de(u?.loggedInUserRoleMap),L=z.user_ids!=null&&r?.userId!=null&&z.user_ids.includes(r?.userId),{isFeatureEnabled:W}=k(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:J}=k(f.billPaySetupShowInternationalPaymentByWise);if(g.useEffect((()=>{N&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&X===!1?T(!1):T(s.billActivities[0]?.isRealTimeApprovalEnabled&&(w||M||s.allApprovers.find((U=>U.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,w,M,o.isZeni,X,r]),g.useEffect((()=>{n!=null&&a(ka(n))}),[n]),g.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(C(!0),a(wa(n??"",N,L,!1)))}),[b,s,n,a]),g.useEffect((()=>{I||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(j(!0),a(Re(!1,N,L,J,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&a(ot()))}),[I,s,n,a,N,L,J]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?t.jsx(Y,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[t.jsx(Ae,{analytics:E,onLoad:U=>(O=>{n!=null&&O.trackBillPayBillDetails(n,s.isRecurring)})(U)}),t.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:N,location:l,navigate:e,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:W,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:G,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const $e=De.getLocalizedStrings().spendManagement.billPay.billDetails,da=De.getLocalizedStrings().common,gi={containerWidth:new za(100,58)},ua=Q((function(e,a){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=a.showActionButtons,u=r&&a.file==null;return{uploadInvoiceEndPoint:`${Xa.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:a.billId,file:a.file,showAutofill:a.showAutofill,analytics:E,entityId:a.billId,showTitlebarIcon:r,showTitlebar:r&&a?.file!=null,uploadStatus:a.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...a.showAutofill?{}:{backgroundColor:a.backgroundColor,paddingBottom:"128px"}}}}),(function(e,a){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(a.file!=null||a.billId!=null||a.isInitialEdit?(a.setPayload(n),a.setShowConfirmationPopup(!0)):e(Oe(n,a.isVendorRecommendationEnabled,a.billId)))},updateInvoiceUploadFetchState:n=>{e(St({fetchState:{fetchState:n,error:void 0},billId:a.billId}))},onSkipAutofill:n=>{E?.trackBillPaySkipAutofill(),e(Me(n))},onDeleteClick:()=>{e(gt({billId:a.billId})),E?.trackInvoiceActionClick(a.billStage??"","delete",l?.userEmail??"",null)}}}))(Un);function x({appContent:e}){const a=le(),l=q(),{billId:n}=ee(),c=K(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(f.billPaySetupShowInternationalPaymentByWise),{configValue:C}=p(Ze.zeniAssistConfig),I=C.user_ids!=null&&i?.userId!=null&&C.user_ids.includes(i?.userId),j=v((P=>H(P)));di();const[B,T]=g.useState(!1),[k,$]=g.useState(!1),[N,G]=g.useState(!1),[z,X]=g.useState(),w=v((P=>Ge(P,m,h,n)));let M=w.fetchState,L=w.file,W=w.showAutofill;const J=v((P=>_e(P,n??"")));u===!1&&(M=J.fetchState,L=J.transactionDetails?.attachments?.[0],W=!1);const U=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;g.useEffect((()=>{n==null&&a(Me(!0))}),[n,a]),g.useEffect((()=>{M==="Not-Started"&&(u&&k?$(!1):!u&&B&&T(!1))}),[n]),g.useEffect((()=>{B||n==null||u||(T(!0),a(wa(n,S,I,!1)),a(Da(n)),k||($(!0),a(Re(!1,S,I,b,n)))),u&&!k&&($(!0),a(Re(!1,S,I,b,n)))}),[B,k,u,n,a,S,I,b]);const O={onOkClick:()=>{if(G(!1),!z)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","yes"),a(ht({replaceBillData:!0,billId:n})),a(Oe(z,m,n))},onCancelClick:()=>{if(G(!1),!z)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","no"),a(bt({file:z,billId:n}))}},ae=g.useCallback((()=>{const P=Z(c.state?.pathnameStackToGoBack),ve=P.poppedPathname??ne(j.tenantEmailDomain);a(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:P.newStack}})}),[c.state,j.tenantEmailDomain,n,a,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||J.fetchState==="Error")return t.jsx(Be,{});if(M!="Completed")return n==null&&o!=="small"?t.jsx(sa,{fallback:ae,children:t.jsxs(je,{windowSize:o,children:[t.jsx(ma,{}),t.jsx(Pe,{}),t.jsx(ua,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:G,setPayload:X,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:U}),t.jsx(Fe,{windowSize:o,children:t.jsx(ra,{isNewBill:!0})})]})}):t.jsxs(je,{windowSize:o,children:[o==="small"||W?null:t.jsx(pa,{children:t.jsx(Ka,{onClick:ae,"data-testid":"nav-bar-back-click"})}),o!=="small"?t.jsx(Pe,{}):null,t.jsx($n,{}),t.jsx(Fe,{windowSize:o,children:t.jsx(ra,{isNewBill:n==null})})]});{const P=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return t.jsx(sa,{fallback:ae,children:t.jsxs(je,{windowSize:o,children:[W&&o!=="small"?t.jsx(ma,{}):null,N?t.jsx(Ln,{titleComponent:t.jsx(wi,{children:$e.overwriteTitle}),descriptionComponent:t.jsx(xi,{children:$e.overwriteDescription}),primaryButtonText:da.yes,secondaryButtonText:da.no,action:O,isEditPopup:!0}):null,o==="small"||W?null:t.jsx(pa,{children:t.jsx(Si,{})}),o!=="small"?t.jsx(Pe,{}):null,t.jsx(ua,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:W,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,J,w),setShowConfirmationPopup:G,setPayload:X,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:P}),t.jsx(Fe,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=Gn();return t.jsx(Ka,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,a,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=a.transactionDetails?.recurringBillInstance,c=a.recurringBillConfigDetail?.totalPaymentCycles),a?.isRecurring===!0?t.jsxs(Ii,{children:[t.jsx(vi,{children:`${$e.recurringBill.recurringCycle}
|
|
2
|
+
${n}/${c}`}),t.jsx(ki,{})]}):void 0}function fi(e,a){const l=a.billActivities?.[0],n=a.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(a.billStage==="draft"||n)}const pa=_.div`
|
|
3
|
+
margin-bottom: 20px;
|
|
4
|
+
margin-top: 20px;
|
|
5
|
+
margin-left: ${A.sp5};
|
|
6
|
+
position: absolute;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
`,Ii=_.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding-top: 9px;
|
|
14
|
+
gap: ${A.sp2};
|
|
15
|
+
margin-bottom: -${A.sp2};
|
|
16
|
+
`,vi=_(Je.StandardMedium)``,ki=_((e=>g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))))`
|
|
17
|
+
color: ${e=>e.theme.colors.hero};
|
|
18
|
+
height: ${A.sp3};
|
|
19
|
+
width: ${A.sp3};
|
|
20
|
+
`,Ka=_((e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))))`
|
|
21
|
+
width: ${A.sp3};
|
|
22
|
+
height: ${A.sp3};
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
color: ${e=>e.theme.colors.champion};
|
|
25
|
+
&:hover {
|
|
26
|
+
color: ${e=>e.theme.colors.primary};
|
|
27
|
+
}
|
|
28
|
+
`,je=_.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
height: 100vh;
|
|
31
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
position: relative;
|
|
34
|
+
&::after {
|
|
35
|
+
content: "";
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 57px;
|
|
38
|
+
left: 42%;
|
|
39
|
+
width: 1px;
|
|
40
|
+
height: calc(100% - 57px);
|
|
41
|
+
background-color: ${e=>e.theme.colors.grey2};
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
z-index: 3;
|
|
44
|
+
display: ${e=>e.windowSize==="small"?"none":"block"};
|
|
45
|
+
}
|
|
46
|
+
`,Pe=_.div`
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 56px;
|
|
49
|
+
left: 0;
|
|
50
|
+
width: 42%;
|
|
51
|
+
height: 1px;
|
|
52
|
+
background-color: ${e=>e.theme.colors.grey2};
|
|
53
|
+
z-index: 3;
|
|
54
|
+
`,ma=_.div`
|
|
55
|
+
position: fixed;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
background-color: ${_n.overlayBackgroundBlack};
|
|
61
|
+
z-index: 5;
|
|
62
|
+
`,Fe=_.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
width: ${e=>`${gi.containerWidth.value(e.windowSize)}%`};
|
|
66
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
|
+
`,wi=_(Je.H6Regular)`
|
|
68
|
+
margin-top: ${A.sp7};
|
|
69
|
+
padding-left: ${A.sp8};
|
|
70
|
+
padding-right: ${A.sp8};
|
|
71
|
+
color: ${e=>e.theme.colors.primary};
|
|
72
|
+
word-break: break-word;
|
|
73
|
+
`,xi=_(Je.LargeRegularSp)`
|
|
74
|
+
color: ${e=>e.theme.colors.hero};
|
|
75
|
+
padding-left: ${A.sp8};
|
|
76
|
+
padding-right: ${A.sp8};
|
|
77
|
+
margin-bottom: 30px;
|
|
78
|
+
margin-top: ${A.sp4};
|
|
79
|
+
white-space: pre-line;
|
|
80
|
+
`,Bi=Q((function(e,a){return{billsReviewView:Ea(e),analytics:a.analytics}}),(function(e,a){return{onCloseOverlay:()=>{a.navigate(`/${a.tenantEmailDomain}/bills`),e(ce())},onCloseReviewItem:l=>{e(ft(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(yt());break;case"approve":case"review":e(aa("approved",n??""));break;case"reject":e(aa("rejected",n??""))}}}}))(Mn);function Ci({tenantEmailDomain:e}){const a=q(),l=v((c=>c.billsBulkActionViewState.bulkSubmissionFetchState.fetchState)),{billsForReview:n}=v((c=>Ea(c)));return g.useEffect((()=>{l!=="Completed"&&n.length!==0||a(`/${e}/bills`)}),[l,n.length,e]),t.jsx(Bi,{navigate:a,analytics:E,tenantEmailDomain:e})}const te=Ct(),Qa="bulk-operation-update",Le="bill-approval-rule-update",{common:ke}=De.getLocalizedStrings(),Ai=_.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
min-height: 100%;
|
|
83
|
+
width: 100%;
|
|
84
|
+
flex: 1 1 auto;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
+
`,Di=Q((function(e,a){const l=V.getSignedInUser(),n=Ce(l),c=Pa(e,te,a.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;a.isUserHasOnlyBillpayAccess&&a.roleMap&&c.currentTab==="pending_approval"&&(a.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):a.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),a.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=ze(e,"common"),s=e.tenantState.currentTenantId,i=H(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,S=c.fetchState,h=At(e);return{transactionList:a.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter((b=>b.isDeleted===!1)),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:S,analytics:E,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:te,spendManagementEndPoint:`${He}/spendManagement`,isShowDeletedBillsEnabled:a.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:a.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:h.affectedEntityIds}}),(function(e,a){const{navigate:l,currentTenant:n,location:c,period:r}=a,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ce()),e(Ta(o))},onSubtabChange:o=>{e(ce()),e(ja(o))},onTransactionClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ti(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=a.currentTenant;E?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e($t(o))},onReloadTransactions:()=>{e(Ve(r,!0,a.isShowDeletedBillsEnabled,a.isInternationalWireEnabled)),e(Vt(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Rt({filters:o})),o.categories.every((s=>s.field!=null&&s.values?.length!==0))&&E.trackSpendManagmentFilterChange("bill_pay",o.categories.map((s=>`${s.field}-${JSON.stringify(s.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&E.trackSpendManagementDownloadClick("bill_pay"),e(Ft({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Pt(o))},removeAllTransactionsFromBulkActionList:()=>{e(ce())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(jt(o,s??""));break;case"send_for_approval":e(ta("send_for_approval")),a.navigate("./bulk-review");break;case"approve":e(ta("approve")),a.navigate("./bulk-review");break;case"review":e(Tt()),a.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Le)&&e(Et(!1))},onEventReceived:o=>{o===Qa&&e(Dt())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(Xe({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}}))(Nn(zn));function Ei(){const e=q(),a=le(),l=K(),n=Ie(),c=l.state,r=fe(),[u,o]=g.useState(!1),[s,i]=g.useState(null),d=tt("/:tenantEmailDomain/bills/bulk-review")!=null;g.useEffect((()=>(c?.tab!=null&&c?.subTab!=null&&(a(Ta(c?.tab)),a(ja(c?.subTab))),()=>{a(ce())})),[]);const p=V.getSignedInUser(),m=v((F=>H(F))),{areTenantIdsInSync:S}=On(),[h,b]=g.useState(!1),{useFeatureGate:C}=oe(),{isFeatureEnabled:I}=C(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:j}=C(f.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:B}=C(f.isBillPayBulkActionEnabled),{isFeatureEnabled:T}=C(f.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:k}=C(f.isBillPayDetectInsufficientFundsEnabled),$=v((F=>Pa(F,te,B,p?.userId))),{isFeatureEnabled:N}=C(f.isDebitCardFeatureEnabled),G=$.fetchState,{isAiCfoAccessEnabled:z,onAskAiCfoClick:X}=Qe({mobileExploreReferrer:"Bills List"});We({isDataReady:G==="Completed"});const w=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,M=!!m.companyBillPayInfo?.info?.isBillPayEnabled,L=v((F=>It(F.companyState,m.companyId))),W=L?.company.featuresActivationInfo.connectedAccountProvider;if(g.useEffect((()=>{!h&&M&&S&&(b(!0),a(Ve(te,!0,I,T)))}),[h,te,S,a]),p==null)throw Error("Can't access address page without signing in...");const J=(F,re)=>{a(Bt({uiState:{sortKey:F,sortOrder:re},period:te}))},U=Fa(r?.loggedInUserRoleMap),O=de(r?.loggedInUserRoleMap),ae=F=>{o(F)},{billsProcessed:P,billsProcessing:ve}=v((F=>vt(F)));g.useEffect((()=>{P===ve&&s!=null&&(a(kt({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:P>1?ke.headers.bills:ke.texts.bill2},{variableName:"_has_",variableValue:P>1?ke.texts.have:ke.texts.has},{variableName:"_action_",variableValue:wt(s)}]})),a(xt()),setTimeout((()=>{a(Ve(te,!0,I,!0,T))}),3e3),i(null))}),[P,ve]);const Ya={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Qa}`,`private-encrypted-${m.companyId}.${Le}`]:[],eventCallback:(F,re,Ye)=>{F.endsWith(Le)?Ye.onBillPayApprovalRulesEventReceived?.(F):re?.entity_type==="bill"&&(i(re.operation_type),Ye.onEventReceived(F))}},et=Ra(N,m),at=Va(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?et===!0||at===!0?t.jsx(qa,{}):M?t.jsxs(t.Fragment,{children:[G==="Completed"?t.jsx(Ae,{analytics:E,onLoad:F=>(re=>re.trackPageLoaded(Wa.Event.billPayHome))(F)}):null,t.jsxs(Ai,{windowSize:n,children:[t.jsx(Ja,{isAppContentDrawerOpen:u,handleDrawerToggle:ae}),t.jsx(ui,{isOpen:d,drawerLeftMargin:new za(0,0,300,600),onClose:()=>{e(`/${m.tenantEmailDomain}/bills`),a(ce())},children:t.jsx(ji,{onClick:F=>F.stopPropagation(),children:t.jsx(Ci,{tenantEmailDomain:m.tenantEmailDomain})})}),t.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",period:te,isAdmin:!1,uiState:$.uiState,onColumnSortConfigChanged:J,isUserHasOnlyBillpayAccess:U,isShowDeletedBillsEnabled:I,isShowDeletedReimbursementEnabled:j,isBulkActionEnabled:B,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ae(!0)},isDownloadEnabled:$.isDownloadEnabled,connectedAccountProvider:W,bulkSubmissionLimit:$.billBulkSubmissionLimit,bulkSubmissionFetchState:$.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:$.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:T,isDetectInsufficientFundsEnabled:k,isAiCfoAccessEnabled:z,onAskAiCfoClick:X,...Ya})]})]}):w===!0&&O===!0?t.jsx(Y,{to:"../setup"}):r!=null&&Ne(m,r.loggedInUserRoleMap)?t.jsx(Y,{to:"../promo"}):t.jsx(se,{fetchState:G}):t.jsx(Be,{})}const Ti=e=>`/${e}/bills/setup`,ji=_(li)`
|
|
89
|
+
display: flex;
|
|
90
|
+
min-height: 100%;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
`,{common:{currency:he},spendManagement:{billPay:{billDetails:Pi}},appName:Fi}=De.getLocalizedStrings(),Ri=Q((function(e,a){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=Z(a.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ce(l);a.billId!=null&&a.billDetailsView!=null&&(i=`${a.billDetailsView.createdBy?.firstName??Fi} ${a.billDetailsView.createdBy?.lastName??""}`),d||!a.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=a.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ut(a.billDetailsView.paymentDetailsSection?.paymentType?.method),S=a.currentTenant.createTime,h=_a(),b=a.sameDayAchDisablementConfig.newTenantTenureLimitMonths,C=S.add(b,"month").isAfter(h),I=!!(a.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Ua(p,a.billDetailsView.approvalRules.allApprovalRules,l,a.billDetailsView.vendor?.id,a.billDetailsView.classId),j=H(e);return{billDetails:a.billDetailsView,isAccountingClassesEnabled:xa(e),billId:a.billId,createdBy:i,createTime:a.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${He}/transaction_attachment`,analytics:E,showBackButton:u,isAdmin:a.isBillPayAdmin,isSuperAdmin:a.isSuperAdmin,connectedAccountProvider:j.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:I,isZeniUser:d,isNewUser:C,sameDayAchDisablementConfig:a.sameDayAchDisablementConfig}}),(function(e,a){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=a,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(na(i));const d=ha(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??a.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ma(d,!1)),e(Oa({localData:{vendorName:i??a.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(na());const p=ha(s,void 0,l),m=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Oe(i,a.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Me(i))},onSaveChangesToLocalStore:(i,d,p,m,S)=>{const h=_i(a.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:S}},p,d,a.isInternationalPaymentShaVsOurEnabled,m,a.vendor);e(Ht({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(Ue("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(Ga("draft"))},reviewBillDetails:()=>{const i=Vi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(Zt()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=$i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Li(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=Za(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{a.navigate("../")},deleteBill:()=>{l!=null&&e(Aa(l))},onAttachmentClick:(i,d)=>{const p=Ee(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=Z(a.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(Xe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Wt(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Hn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Xt(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(zt("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Nt(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Ot(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Gt("bill_pay","bill_pay_detail")),e(Mt({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(Xn);function ba(){const e=q(),a=K(),l=le(),{billId:n,tenantEmailDomain:c}=ee(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(f.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:p}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:m}=r(f.isRecurringBillsFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=r(f.isShaDisabled),{isFeatureEnabled:b}=r(f.isOurDisabled),{isFeatureEnabled:C}=r(f.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=u(Ze.sameDayAchDisablementConfig),j=Lt(I),B=V.getSignedInUser(),T=v((O=>H(O))),k=v((O=>Ge(O,p,S,n))),$=Ha(T?.companyId,{clearParams:k.fetchState==="Completed"}),{isAiCfoAccessEnabled:N,onAskAiCfoClick:G}=Qe({mobileExploreReferrer:"Bill Details"});We({isDataReady:k.fetchState==="Completed"});const z=T.companyId??V.getSignedInUserTenant(c)?.companyId,X=fe(),w=$a(X?.loggedInUserRoleMap),M=La(X?.loggedInUserRoleMap),L=de(X?.loggedInUserRoleMap),W=va(T.userRole);if(g.useEffect((()=>{n!=null&&l(ka(n))}),[n]),g.useEffect((()=>{n!=null&&l(Da(n))}),[n,l]),B==null)throw Error("Can't access address page without signing in...");const J=v((O=>_t(O.accountState,O.accountListState,"billPayAccountList"))),U={pathname:"../",search:a.search};return k.isDeleted===!0||k.billStage=="paid"||k.fetchState=="Not-Started"?t.jsx(Y,{to:U}):k.deleteStatus.fetchState==="In-Progress"||s?t.jsx(se,{fetchState:k.deleteStatus.fetchState}):t.jsxs(t.Fragment,{children:[t.jsx(Ae,{analytics:E,onLoad:O=>(ae=>{n!=null&&k.deleteStatus.fetchState!=="Completed"&&ae.trackBillPayEditBill(n,k.isRecurring)})(O)}),t.jsx(Ri,{initialOpenThreadRequest:$??void 0,location:a,navigate:e,currentTenant:T,billId:n,companyId:z,billDetailsView:k,isMagicLinkEnabled:o,isVendorRecommendationEnabled:p,isLocalCurrencyEnabled:d,uncategorizedAccounts:J,isInternationalPaymentShaVsOurEnabled:i,vendor:k.vendor,isShaDisabled:h,isOurDisabled:b,isRecurringBillsFeatureEnabled:m,hasZeniAccountsAdminAccess:w,isZeniAccountsUser:M,isBillPayAdmin:L,isSuperAdmin:W,isDetectInsufficientFundsEnabled:C,sameDayAchDisablementConfig:j,isAiCfoAccessEnabled:N,onAskAiCfoClick:G})]})}const ha=(e,a,l)=>{let n=`/${e}/bill/`;return l==null?n=a!=null?n.concat(`new/vendor/${encodeURIComponent(a)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=a!=null?n.concat(`${encodeURIComponent(a)}/edit`):n.concat("create")),n},Vi=(e,a)=>{let l=`/${e}/bill/`;return l=a===void 0?l.concat("new/review"):l.concat(`${a}/edit/review`),l},$i=(e,a,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(a)}/edit/ach`),n},Li=(e,a,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(a)}/edit/domestic`),n},R="paymentDetails",_i=(e,a,l,n,c,r,u)=>{const o={invoiceNumber:a.whatFor.invoiceNumber,memo:a.whatFor.memo,invoiceDate:a.whatFor.invoiceDate?pe(a.whatFor.invoiceDate.toString()):_a(),billDueDate:a.whatFor.billDueDate?pe(a.whatFor.billDueDate.toString()):void 0,currencyCode:a.whatFor.currency,recipientCurrencyCode:a.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:a.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:a[R]?.paymentDate?pe(a[R].paymentDate.toString()):void 0,paymentType:a[R]?.paymentType!=null?a[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===a[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:a[R]?.paymentType?.method!=null&&a[R].paymentType.method.includes(Jt)&&u?.vendorCurrencyCode===he.currencyCode&&c?a[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=a[R]?.recurringPaymentType?.selectedOption===Pi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:a[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:qt(a[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:a[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(a[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:a[R]?.recurringPaymentDetails?.startDate?pe(a[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:a[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:a[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:a[R]?.recurringPaymentDetails?.updateRecurringBills},S=Ui(e.accountList.accounts,e.classList.classes,e.lineDetailSection,a.lineItems,n,l),h=Object.keys(S).length>0?Wn(S):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:S,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Ui=(e,a,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=a.find((p=>p.classId===o.class.selectedOption)));const d=Zn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Gi=_.div`
|
|
93
|
+
display: flex;
|
|
94
|
+
height: 100vh;
|
|
95
|
+
width: 100%;
|
|
96
|
+
flex: 1 1 auto;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
align-items: center;
|
|
99
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
100
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
+
`,Mi=Q((function(e,a){const{vendorId:l,billId:n}=a,c=ye(e,l),r=Ge(e,a.isVendorRecommendationEnabled,a.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:a.bankAccountContext}}),(function(e,a){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=a,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(en(s))},onSaveHandler:()=>{e(Yt(a.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(Qt({data:i}))},onCancel:()=>{(()=>{const s=Z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??ga();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ia())},onAddressClick:s=>{const i=Ke(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Kt({fetchState:"Not-Started"}));const s=Z(a.location.state?.pathnameStackToGoBack),i=s.poppedPathname??ga(0);a.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ia())}}}))(Jn);function Oi(){const e=q(),a=K(),l=Ie(),{vendorId:n,billId:c}=ee(),{useFeatureGate:r}=oe(),u=ue(),o=V.getSignedInUser(),s=v((h=>H(h))),i=Z(a.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v((h=>ye(h,n))),{isFeatureEnabled:m}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):t.jsxs(Gi,{windowSize:l,children:[t.jsx(qe,{vendorId:n,billId:c}),t.jsx(Mi,{location:a,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:S})]})}const ga=(e=2)=>{let a="../";for(let l=0;l<e;l++)a=`${a}../`;return a},Ni=_.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
height: 100vh;
|
|
104
|
+
width: 100%;
|
|
105
|
+
flex: 1 1 auto;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
align-items: center;
|
|
108
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
109
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
+
`,zi=Q((function(e,a){const{vendorId:l}=a,n=ye(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=tn(e,c||"international_business",a.billId),u=n.editVendorState??n.newVendorState,o=a.billId!=null?e.editBillDetailViewState.editBillStateById[nn(a.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:a.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}}),(function(e,a){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=a,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(cn(a.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(sn(s)),p&&e(rn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(ln(s,i,d,!1))},onCancel:()=>{(()=>{const s=Z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??Sa();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(oa())},onAddressClick:s=>{const i=Ke(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(on({fetchState:"Not-Started"}));const s=Z(a.location.state?.pathnameStackToGoBack),i=s.poppedPathname??Sa(0);a.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(oa())}}}))(qn);function Xi(){const e=q(),a=K(),l=Ie(),{vendorId:n,billId:c}=ee(),r=le(),u=ue(),o=V.getSignedInUser(),s=v((B=>H(B))),i=Z(a.state?.pathnameStackToGoBack),[d,p]=g.useState(!1),m=v((B=>B.vendorViewState.newVendorState.fetchStatus.fetchState)),S=v((B=>n!=null?B.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started")),h=n!==void 0?S:m;g.useEffect((()=>{d===!1&&h==="Not-Started"&&n!=null&&(r(ge(!1,n)),p(!0))}),[d,h,n]);const[b,C]=g.useState(!1);g.useEffect((()=>{b||h==="In-Progress"||(C(!0),r(an(c,n)))}),[b,h,r]);const I=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",j=v((B=>ye(B,n)));if(o==null)throw Error("Can't access international wire page without signing in...");return I==="billDetail"&&j.editVendorState?.saveStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:j.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):t.jsxs(Ni,{windowSize:l,children:[t.jsx(qe,{vendorId:n,billId:c}),t.jsx(zi,{location:a,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:I})]})}const Sa=(e=2)=>{let a="../";for(let l=0;l<e;l++)a=`${a}../`;return a},ya=_.div`
|
|
111
|
+
display: flex;
|
|
112
|
+
height: 100vh;
|
|
113
|
+
width: 100%;
|
|
114
|
+
flex: 1 1 auto;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
118
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
+
`,Wi=Q((function(e,a){const l=V.getSignedInUser(),n=Na(e,a.billId),c=un(e),r=Ce(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Ua(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:a.billId,billpayApprovalView:c,analytics:E,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,a){const{location:l,billId:n,currentTenant:c,navigate:r}=a,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Ca({billId:n,data:s})),e(Ue(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Ba({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Ga("pending_approval"))},onClickEdit:()=>{a.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{a.billId!=null&&e(xe(a.billId,"retry"))}}}))(Qn);function fa(){const e=q(),a=le(),l=K(),{billId:n}=ee(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(f.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(f.isVendorRecommendationFeatureEnabled),p=Z(l.state?.pathnameStackToGoBack),{poppedPathname:m}=p,{isFeatureEnabled:S}=c(f.isRecurringBillsFeatureEnabled),h=v((I=>H(I))),b=v((I=>Na(I,n))),C=b.fetchState??"Not-Started";if(g.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),g.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),g.useEffect((()=>{const I=b.vendor?.name,j=b.vendor?.id,B=b.totalAmount.amount,T=b.recipientTotalAmount.amount,k=b.invoiceNumber;I&&j&&a(dn(I,j,B,T,k,n))}),[]),m==null)return t.jsx(Y,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return C==="In-Progress"?t.jsx(ya,{windowSize:o,children:t.jsx(Kn,{})}):t.jsx(ya,{windowSize:o,children:t.jsx(Wi,{location:l,navigate:e,currentTenant:h,billId:n,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:S,isDetectInsufficientFundsEnabled:u})})}const Zi=Q((function(e,a){const{vendorId:l}=a,n=e.entityAutoCompleteState.autoCompleteText.common,c=ze(e,"common"),r=l!=null?"edit":"create",u=H(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:a.vendorViewDetails,screenType:r,filesEndPoint:`${Xa.fileMicroServiceBaseUrl}`,authParams:i,analytics:E,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,a){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=a,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,a.billId)),i!=null&&e(Bn(i))},saveVendorDetailLocalData:i=>{e(Oa({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(wn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(la(u))},updateSelectedVendorForCreate:i=>{e(kn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Za(s,a.billId,u):ci(s,a.billId,u):p=ri(s,a.billId,u);const m=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):vn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Ke(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(fn({files:i}))},onEditFileName:(i,d)=>{e(yn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(la(a.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(Sn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(gn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(Xe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=Z(a.location.state?.pathnameStackToGoBack),d=i.poppedPathname??si(n.tenantEmailDomain,a.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(hn(i,"BillPayVendor"))},onResendOtp:i=>{e(bn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(mn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(pn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Ma(i,!1))}}}))(ti),we=()=>{const e=q(),a=le(),l=Yn(),n=K(),{billId:c,vendorId:r}=ee(),u=v((b=>H(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(f.isBillPayLocalCurrencyFeatureEnabled),[i,d]=g.useState(!1),p=v((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=v((b=>ye(b,r))),S=v((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?S:p;return g.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(a(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?t.jsx(ei,{}):h==="Error"?t.jsx(ai,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):t.jsxs(t.Fragment,{children:[t.jsx(qe,{vendorId:r,billId:c}),t.jsx(Zi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Hi=Q((function(e,a){const{companyId:l}=a;return{billPaySetupView:Cn(e,l),analytics:E,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,a){const{companyId:l,navigate:n}=a;return{onButtonClick:()=>{e(An(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(ii),Ji=()=>{const e=ni(),a=q(),l=K(),{tenantEmailDomain:n}=ee(),[c,r]=g.useState(!1),u=ue(),o=v((h=>H(h))),s=o.companyId??V.getSignedInUserTenant(n)?.companyId,i=V.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),S=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?t.jsx(Y,{to:"../../../bills"}):p===!0&&m===!0?t.jsx(Y,{to:"../../bills/setup"}):p===!1||d!=null&&Ne(o,d.loggedInUserRoleMap)?t.jsxs(t.Fragment,{children:[t.jsx(Ae,{analytics:E,onLoad:h=>(b=>b.trackPageLoaded(Wa.Event.billPayPromoPage))(h)}),t.jsx(Ja,{isAppContentDrawerOpen:c,handleDrawerToggle:S}),t.jsx(Hi,{companyId:s,navigate:a,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function jo(){const e=v((W=>H(W))),a=fe(),l=de(a?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Xi:Oi,{isFeatureEnabled:o}=c(f.isDebitCardFeatureEnabled),s=Ra(o,e),i=Va(e),d=K(),p=e?.userRole!=null&&Ia(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(a?.loggedInUserRoleMap),S=Fa(a?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Dn(a?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,C=b&&$a(a?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(f.isChargeCardFeatureEnabled),j=oi(e,I,o)&&!p,B=j&&En(a?.loggedInUserRoleMap),T=Tn(a?.loggedInUserRoleMap),k=La(a?.loggedInUserRoleMap),$=jn(a?.loggedInUserRoleMap),N=b&&k,G=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&$,z=Pn(a?.loggedInUserRoleMap),X=Fn(a?.loggedInUserRoleMap),w=Rn(a?.loggedInUserRoleMap),M=j&&z,{tenantEmailDomain:L}=ee();return t.jsxs(nt,{children:[d.pathname.includes("/bills")?t.jsxs(t.Fragment,{children:[t.jsx(y,{path:"setup",element:t.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"setup"})}),t.jsx(y,{path:"verification",element:t.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"verification"})}),t.jsx(y,{path:"promo",element:t.jsx(Ji,{})}),t.jsx(y,{path:"approval-rules/*",element:m?t.jsx(pi,{}):t.jsx(mi,{showZeniAccountRoute:N,isUserHasBillPayAccess:X,isUserHasReimbursementAccess:w,showTreasuryRoute:G,isTenantBankingOnly:s,showChargeCardRoute:M,tenantEmailDomain:L??""})}),t.jsx(y,{path:"international-wire",element:t.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&t.jsx(y,{path:"*",element:t.jsx(Ei,{})}),(s===!0||i===!0)&&t.jsx(y,{path:"/*",element:t.jsx(qa,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&t.jsx(y,{path:"*",element:t.jsx(Y,{to:"../setup"})}),a!=null&&Ne(e,a.loggedInUserRoleMap)&&t.jsx(y,{path:"*",element:t.jsx(Y,{to:"../promo"})})]}):d.pathname.includes("/bill")?t.jsxs(t.Fragment,{children:[t.jsx(y,{path:"new",element:t.jsx(x,{appContent:t.jsx(ba,{})})}),t.jsx(y,{path:":billId",element:t.jsx(x,{appContent:t.jsx(hi,{})})}),t.jsx(y,{path:":billId/edit",element:t.jsx(x,{appContent:t.jsx(ba,{})})}),t.jsx(y,{path:"new/review",element:t.jsx(x,{appContent:t.jsx(fa,{})})}),t.jsx(y,{path:":billId/edit/review",element:t.jsx(x,{appContent:t.jsx(fa,{})})}),t.jsx(y,{path:"/:billId/:addressType",element:t.jsx(x,{appContent:t.jsx(ca,{isSubPage:!0})})}),t.jsx(y,{path:"/new/:addressType",element:t.jsx(x,{appContent:t.jsx(ca,{isSubPage:!0})})}),t.jsx(y,{path:"new/vendor/create",element:t.jsx(x,{appContent:t.jsx(we,{})})}),t.jsx(y,{path:"new/vendor/:vendorId/edit",element:t.jsx(x,{appContent:t.jsx(we,{})})}),t.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:t.jsx(x,{appContent:t.jsx(me,{})})}),t.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:t.jsx(x,{appContent:t.jsx(be,{})})}),t.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:t.jsx(x,{appContent:t.jsx(u,{})})}),t.jsx(y,{path:"new/vendor/create/ach",element:t.jsx(x,{appContent:t.jsx(me,{})})}),t.jsx(y,{path:"new/vendor/create/domestic",element:t.jsx(x,{appContent:t.jsx(be,{})})}),t.jsx(y,{path:"new/vendor/create/international",element:t.jsx(x,{appContent:t.jsx(u,{})})}),t.jsx(y,{path:":billId/edit/vendor/create/ach",element:t.jsx(x,{appContent:t.jsx(me,{})})}),t.jsx(y,{path:":billId/edit/vendor/create/domestic",element:t.jsx(x,{appContent:t.jsx(be,{})})}),t.jsx(y,{path:":billId/edit/vendor/create/international",element:t.jsx(x,{appContent:t.jsx(u,{})})}),t.jsx(y,{path:":billId/edit/vendor/create",element:t.jsx(x,{appContent:t.jsx(we,{})})}),t.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:t.jsx(x,{appContent:t.jsx(we,{})})}),t.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:t.jsx(x,{appContent:t.jsx(me,{})})}),t.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:t.jsx(x,{appContent:t.jsx(be,{})})}),t.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:t.jsx(x,{appContent:t.jsx(u,{})})}),t.jsx(y,{path:":billId/edit/vendor/create/ach",element:t.jsx(x,{appContent:t.jsx(me,{})})}),t.jsx(y,{path:":billId/edit/vendor/create/domestic",element:t.jsx(x,{appContent:t.jsx(be,{})})}),t.jsx(y,{path:":billId/edit/vendor/create/international",element:t.jsx(x,{appContent:t.jsx(u,{})})}),t.jsx(y,{path:"*",element:t.jsx(Be,{})})]}):t.jsx(y,{path:"*",element:t.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${n.colors.dropShadowNormal}`}})}),t.jsx(y,{path:"*",element:t.jsx(Be,{})})]})}export{jo as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as O}from"./sentry-DWNq3t8E.js";import{u as q,j as h,h as se,g as oe,i as ie,N as re,l as ce}from"./core-CbdTrw7T.js";import{fJ as R,Iu as ue,II as de,LU as le,OK as pe,Po as me,Qd as fe,a18 as ye,Cn as Se,Tt as ge,a1l as Ie,a1m as he,a1n as be,a1o as Te,a1p as Ce,a1q as De,a1r as Oe,YV as ke,a1s as Ve,N4 as we,MY as Ae,a1t as Ne,N0 as ve,mT as Fe,gK as _e,gJ as xe,gI as Ee,vr as Be,vi as Re,vf as ze,mL as Pe,Cw as Le,Cu as z,bF as P,CI as L,cw as Ue}from"./zeni-epic-state-C5DO1jkr.js";import{b0 as Me,V as je,p as Ge,au as Ke,z as B,a9 as qe,c as U,B as x,R as E,d0 as Je,af as Ye,s as M,bg as j}from"./index-CnIO6_IQ.js";import{n as Ze}from"./mui-DNGY4bFU.js";import{j as w}from"./liveblocks-BLpmr1Pv.js";import{d as G}from"./routePaths-CV12X_S-.js";import{M as $e}from"./MobileAppDrawer-BWNb5zLN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e8a48be9-16e9-413a-9aef-d92170f1817a",e._sentryDebugIdIdentifier="sentry-dbid-e8a48be9-16e9-413a-9aef-d92170f1817a")}catch{}})();function it(){const e=q(),r=h((u=>R(u))),a=r?.tenantId,{isApprovalRulesV3Enabled:s,isLoading:l}=Me(a),p=h((u=>u.billPaySetupApproverViewState.fetchState));O.useEffect((()=>{a==null||l||p==="Not-Started"&&e(ue(!0,!0,s))}),[a,l,s,p,e])}function K(e,r,a,s=!1){switch(r){case"zeni_accounts":e(fe(a,!0,s));break;case"zeni_treasury":e(me(a,!0,s));break;case"reimbursement":e(pe(a,!0,s));break;case"charge_cards":e(le(a,!0,s));break;default:e(de(a,!0,s))}}const Qe=Ze.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,We=ce((function(e,r){const{businessVerificationDetails:a}=r,s=R(e),l=B.getSignedInUser(),p=s.tenantId,u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:p??""},b=Oe(r.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=ke(e.companyConfigState),o=Ve(e.userRoleConfigState);return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${Ye.fileMicroServiceBaseUrl}`,authParams:u,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:o.companyTitles}}),(function(e,r){const{companyId:a,productType:s,currentTenant:l,navigate:p,location:u}=r,{tenantEmailDomain:b}=l;return{onCompanyDetailsChanged:t=>{const{companyDescription:o,companyIndustry:m,companyIndustryType:k,companyLegalName:V,companyTaxId:y,companyWebsite:f,companyPhone:S,primaryContactEmail:d,primaryContactName:i,primaryContactUserId:T,primaryContactSyncToken:C,syncToken:c,fileIds:D,incDate:n,typeOfIncorporation:g,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:v,countriesOfOperations:I,companySourceOfFunds:J,companySourceOfFundsDescription:Y,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:Q,purposeOfAccountDescription:W,regulatedStatus:H,regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te}=t,F=k?.selectedOption,ae={companyId:a,companyDescription:o,companyIndustry:m.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:V,taxIdOrEIN:y,website:f!=""&&f!=null?Ue(f):void 0,phone:S,syncToken:c,fileIds:D,incDate:n!=null?P(n?.toString()):n,typeOfIncorporation:g?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:v?.selectedOption??"",countriesOfOperations:I?.selectedOptions.map((_=>_.length===2?_:j(_)))??[],companySourceOfFunds:J?.selectedOption??"",companySourceOfFundsDescription:Y,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:Q?.selectedOption??"",purposeOfAccountDescription:W,regulatedStatus:H??"",regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te?.selectedOptions??[]},ne={userId:T,firstName:i.firstName,lastName:i.lastName,email:d,syncToken:C};e(L({companyDetails:ae,primaryContactDetails:ne}))},onCompanyOfficerUpdated:t=>{const o=t.map((m=>{const{officerType:k,userId:V,name:y,email:f,nationalityCountryCode:S,ssn:d,dob:i,phone:T,syncToken:C,selectDocument:c,role:D,ownership:n,isSelectedForVerification:g,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:v}=m;let I;return c.selectDocumentType==="driverLicense"?I="driving_license":c.selectDocumentType==="passport"?I="passport":c.selectDocumentType==="stateId"?I="id_document":c.selectDocumentType==="ssnCard"&&(I="social_security_card"),{officerType:k,userId:V,firstName:y.firstName,lastName:y.lastName,email:f,ssn:d,nationalityCountryCode:S?.selectedOption!=null?j(S.selectedOption):void 0,phone:T,birthday:i!=null?P(i?.toString()):i,syncToken:C,titleAtCompany:D.selectedOption,ownershipInCompany:n,documentTypeSelectedForVerification:I,isSelectedForVerification:g,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:v,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(L({officers:o}))},onSaveDetailsClick:t=>{e(z(a,t,s))},onSendForVerificationClick:t=>{e(z(a,t,s,!0))},onAddressClick:t=>{const o=G(b,t),m=M(u.state?.pathnameStackToGoBack,u.pathname);p(o,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:t=>{const o=G(b,t),m=M(u.state?.pathnameStackToGoBack,u.pathname);p(o,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{e(Le({companyId:a})),p("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(ze(t))},onDeleteFileList:t=>{e(Re(t))},onEditFileName:(t,o)=>{e(Be(t,o.split(".")[0]))},onGetOtp:t=>{e(Ee(t,"SpendManagementSetup"))},onResendOtp:t=>{e(xe(t,"SpendManagementSetup"))},onVerifyOtp:(t,o)=>{e(_e(t,o,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,o)=>{e(Fe({addressType:t,addressToCreate:o}))},onIdentityDocumentUploadedForAutofill:t=>{if(a==null)return;const o=Ne(t.documentType);o!=null&&e(ve({target:"setup",companyId:a,officerType:t.officerType,fileId:t.fileId,documentType:o}))},onCompanyDocumentUploadedForAutofill:t=>{a!=null&&e(Ae({target:"setup",companyId:a,fileId:t.fileId,documentType:t.documentType}))},onResetKycKybClick:()=>{e(we())}}}))(Je),rt=({productType:e})=>{const r=se(),a=oe(),s=q(),[l,p]=O.useState(!1),[u,b]=O.useState(!1),{tenantEmailDomain:t}=ie(),o=je(),{useDynamicConfig:m}=Ge(),{configValue:k}=m(Ke.zeniAccountsConfig),V=ye(k),y=h((n=>{switch(e){case"zeni_accounts":return n.zeniAccountSetupViewState.fetchState;case"reimbursement":return n.remiSetupViewState.fetchState;case"charge_cards":return n.chargeCardSetupViewState.fetchState;case"zeni_treasury":return n.treasurySetupViewState.fetchState;default:return n.billPaySetupViewState.fetchState}})),f=h((n=>n.companyConfigState.fetchState)),S=h((n=>n.userRoleConfigState.fetchState)),d=h((n=>R(n))),i=d.companyId??B.getSignedInUserTenant(t)?.companyId;O.useEffect((()=>{f==="Not-Started"&&s(Se()),S==="Not-Started"&&s(ge(!0))}),[f,S,s]),O.useEffect((()=>{l||y!=="Not-Started"||i==null||(p(!0),K(s,e,i))}),[l,y,i,s]);const T=h((n=>{switch(e){case"zeni_accounts":return Ce(n,i);case"zeni_treasury":return Te(n,i);case"charge_cards":return be(n,i);case"reimbursement":return he(n,i);default:return Ie(n,i)}})),C=T.kycKybResetStatus.fetchState;if(O.useEffect((()=>{C==="Completed"&&i!=null&&(K(s,e,i,!0),s(De()))}),[C,i,e,s]),B.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let c;switch(e){case"zeni_accounts":c=d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":c=d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":c=d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":c=d.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:c=d.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=n=>{b(n)};return c===!1?w.jsx(re,{to:"../promo"}):w.jsxs(Qe,{children:[w.jsx(qe,{analytics:U,onLoad:n=>(g=>{switch(e){case"zeni_accounts":return g.trackPageLoaded(E.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return g.trackPageLoaded(E.Event.reimbursementBusinessVerification);default:return g.trackPageLoaded(E.Event.billPayBusinessVerification,x(a)?"Settings":void 0)}})(n)}),x(a)?w.jsx($e,{isAppContentDrawerOpen:u,handleDrawerToggle:D}):null,w.jsx(We,{businessVerificationDetails:T,navigate:r,location:a,companyId:i,analytics:U,currentTenant:d,productType:e,isSettings:x(a),roleMap:o?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:V.maxInsuredAmount})]})};export{rt as B,K as d,it as u};
|