@zeniai/web-app-ui 5.4.18-dev → 5.4.19-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-4Zeu95kU.js → AccountMappingScreen-BpJDQCQx.js} +2 -2
- package/dist/assets/ActualMatchingMatchDetailScreen-fK8c-oot.js +1 -0
- package/dist/assets/AddressRoutes-_bCuEkwx.js +1 -0
- package/dist/assets/AddressScreen-Dh4KOVQ1.js +9 -0
- package/dist/assets/AiCfoScreen-03lSUwaj.js +22 -0
- package/dist/assets/AppDrawer-DtBNEFvY.js +10 -0
- package/dist/assets/{BillPayApprovalRoutes-B4dh4WxY.js → BillPayApprovalRoutes-D1JvUYMQ.js} +1 -1
- package/dist/assets/{BillPayRoutes-DZx-x_-P.js → BillPayRoutes-DosvZj42.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-CeIfGxLQ.js +9 -0
- package/dist/assets/CardsAiCfoScreen-C8_v-BYR.js +14 -0
- package/dist/assets/{ChargeCardRoutes-Db9V9An_.js → ChargeCardRoutes-BZz4pRiz.js} +10 -10
- package/dist/assets/{CompanyPassportScreen-Db20J8Yl.js → CompanyPassportScreen-BieP2EZa.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-C1MNasE2.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DYKZjGKN.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-De4sHn4O.js → CustomerOnboardingRoutes-DyVqaxvR.js} +3 -3
- package/dist/assets/CustomersRoutes-CtL2o5-n.js +8 -0
- package/dist/assets/DashboardRoutes-7yhAEy7g.js +20 -0
- package/dist/assets/{DefaultTenantHome-BN__AQ5l.js → DefaultTenantHome-DHs0Czed.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BIF8BW0a.js +18 -0
- package/dist/assets/{DrawerScreen-DUhkZI2Z.js → DrawerScreen-XY9r5sqx.js} +1 -1
- package/dist/assets/EntityDetailRoutes-CLCMxp18.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-DcjeaHHd.js → ExpenseAutomationRoutes-CA-VSGA_.js} +6 -6
- package/dist/assets/{FallBackRoute-orqRsHMl.js → FallBackRoute-BmlOw1z3.js} +2 -2
- package/dist/assets/FeaturePreviewScreen-C2u4cMYG.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CdL4B6fj.js +1 -0
- package/dist/assets/InboxNotificationsProvider-DvvXiK-n.js +1 -0
- package/dist/assets/InvoicingRoutes-Ds8bd8V8.js +3 -0
- package/dist/assets/MagicLinkRoutes-BCx3YLpp.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BJFFKbta.js +12 -0
- package/dist/assets/MobileAppDrawer-BLYS912H.js +1 -0
- package/dist/assets/NotFoundScreen-BDU6ccX1.js +1 -0
- package/dist/assets/NotificationRoutes-B3DfKahf.js +1 -0
- package/dist/assets/OAuthConsentScreen-DMS9CTOV.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-D4c4br1B.js +1 -0
- package/dist/assets/PaymentLinkScreen-BEA834bi.js +21 -0
- package/dist/assets/PeopleRoutes-By8BlbIz.js +22 -0
- package/dist/assets/PerformanceRoutes-CQ6Hxkqk.js +1 -0
- package/dist/assets/{Preview-Db0nRlxD.js → Preview-lAFQaJcB.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BEn_CddB.js → QBOConnectionScreen-DyZaNX6V.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-CPfPh7_I.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DrgxKZH7.js +1 -0
- package/dist/assets/ReimbursementRoutes-Bq5czlC0.js +68 -0
- package/dist/assets/ReportsRoutes-DxNr6i5Y.js +1 -0
- package/dist/assets/RewardsRoutes-CO6TuNiV.js +1 -0
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-BxMaq7Gq.js +33 -0
- package/dist/assets/ScreenRoutes-LEc4L-Ek.js +2 -0
- package/dist/assets/{SettingsRoutes-CCWla9X1.js → SettingsRoutes-Cc8RIjZt.js} +6 -6
- package/dist/assets/{SetupPagesScreen-C5PRNruc.js → SetupPagesScreen-BgAn4bD3.js} +5 -5
- package/dist/assets/SignInScreen-Di05f1i8.js +1 -0
- package/dist/assets/SignOutScreen-CiQsSj2I.js +9 -0
- package/dist/assets/{TaskListScreen-C7smUYFP.js → TaskListScreen-CBFYc4EW.js} +2 -2
- package/dist/assets/TaskRoutes-w6Z4j7Vq.js +9 -0
- package/dist/assets/TransactionDetailRoutes-ggKexh3-.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CHzsnTr9.js → TransactionDetailScreen-BBWVy8TW.js} +2 -2
- package/dist/assets/{TransactionListRoutes-ChJOrV96.js → TransactionListRoutes-B7kikvJW.js} +1 -1
- package/dist/assets/TreasuryRoutes-DnYXMIpO.js +37 -0
- package/dist/assets/{VendorsRoutes-CVu8jS5h.js → VendorsRoutes-BtVR0Vii.js} +18 -18
- package/dist/assets/WiseConfirmationScreen-8Hcaa3Fc.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-D3ONSR9y.js → ZeniAccountRoutes-VM-T0h6_.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-CM9U5Zls.js +9 -0
- package/dist/assets/{accountMappingHelper-CHQgwqfy.js → accountMappingHelper-8C9JQylV.js} +1 -1
- package/dist/assets/{analytics-D051O7ML.js → analytics-u8j262Ga.js} +1 -1
- package/dist/assets/{analyticsHelper-DkNc3mKz.js → analyticsHelper-CKG9W7dC.js} +1 -1
- package/dist/assets/{core-BBlQ3ArL.js → core-BVdj_noT.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-YbpxzvKa.js → decodeURIComponentSafe-JMSvQveN.js} +1 -1
- package/dist/assets/{dnd-CU3yeazS.js → dnd-Ex3ltzzE.js} +1 -1
- package/dist/assets/{empty-BiAWzWBi.js → empty-C5tm1JkN.js} +1 -1
- package/dist/assets/{index-fVadamkP.js → empty-C97tUCQZ.js} +1 -1
- package/dist/assets/{emptyVideoElement-CRPwTqUS.js → emptyVideoElement-Hn3yI6W2.js} +1 -1
- package/dist/assets/epic-BPbLNJeP.js +2 -0
- package/dist/assets/expenseAutomationHelper-BtpowfoM.js +1 -0
- package/dist/assets/{getLocaleForTenant-DTPcYF0O.js → getLocaleForTenant-CI9ZVduS.js} +1 -1
- package/dist/assets/{index-MRZKoeCT.js → index-B1EE-QC-.js} +2 -2
- package/dist/assets/index-BtE2ozWs.js +1 -0
- package/dist/assets/{index-s4pcd-16.js → index-CCd99LPb.js} +1 -1
- package/dist/assets/{index--CQENyaz.js → index-Ch4hjMoy.js} +1 -1
- package/dist/assets/{index-ClwW47Zs.js → index-Dme9CBSK.js} +15750 -15711
- package/dist/assets/{empty-B3C-udVF.js → index-OsAw6lBi.js} +1 -1
- package/dist/assets/{index-jomr_c-N.js → index-TJhTBaFX.js} +1 -1
- package/dist/assets/{index-CaztP9tz.js → index-UCW7ypYi.js} +1 -1
- package/dist/assets/{lexical-DVH-xgq1.js → lexical-CVwGZsIc.js} +1 -1
- package/dist/assets/{liveblocks-CuUK5O_2.js → liveblocks-XOqCw7q2.js} +1 -1
- package/dist/assets/{lottie-Du4lbH8J.js → lottie-C5YZIzuj.js} +1 -1
- package/dist/assets/{mui--aGBnNu2.js → mui-BZ0jnpww.js} +1 -1
- package/dist/assets/{pathToGoBack-DOePc_e5.js → pathToGoBack-BYz7DD9r.js} +1 -1
- package/dist/assets/{pdf-lib-Cvsvldn7.js → pdf-lib-BIDHf6ZS.js} +1 -1
- package/dist/assets/{pdf-CrvsvvW3.js → pdf-q1-3GLH6.js} +3 -3
- package/dist/assets/{plaid-7P9b69CP.js → plaid-CCMRXiQR.js} +1 -1
- package/dist/assets/{pusher-DdvpIMG0.js → pusher-DF-wuBh7.js} +1 -1
- package/dist/assets/{react-CjVSd3S9.js → react-BzblgiCG.js} +1 -1
- package/dist/assets/{react-B8GJK4jq.js → react-CGkIeSIu.js} +1 -1
- package/dist/assets/{react-D-JjM7p6.js → react-Cjn3drUx.js} +1 -1
- package/dist/assets/{react-CUlf2ISA.js → react-Czniha8W.js} +1 -1
- package/dist/assets/{react-Bz6aBujY.js → react-D35bcyMl.js} +1 -1
- package/dist/assets/{react-DoYRVAKa.js → react-znTjPsiU.js} +1 -1
- package/dist/assets/{recharts-CkREU3LH.js → recharts-VHHravhf.js} +1 -1
- package/dist/assets/{reportTimeframe-ChAOzqo_.js → reportTimeframe-BTqRG1HM.js} +1 -1
- package/dist/assets/routePaths-TIOEKAr9.js +1 -0
- package/dist/assets/{sentry-D0lP5-8e.js → sentry-CNIAdl-1.js} +1 -1
- package/dist/assets/stripSplatSuffix-CLHAbjpi.js +1 -0
- package/dist/assets/{url-GwD82u5j.js → url-CyyPACTT.js} +1 -1
- package/dist/assets/{url-nN4BnP9N.js → url-uObfQ0XR.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-ClGwke9Y.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-usJW6KKQ.js → useAiCfoDashboardSuggestedQuestionsChips-CF91keX4.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DO-bnRp-.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-DPfHk-vM.js → useChargeCardPusherEvents-DTd9bnXH.js} +1 -1
- package/dist/assets/{useDeviceId-pp3Grc-z.js → useDeviceId-CF-WgrL6.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BJWnx3gQ.js +1 -0
- package/dist/assets/useEnsureVendorListLoaded-U686iOkV.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DmfmyzKI.js → useInitialThreadRequest-DCdvOJx6.js} +1 -1
- package/dist/assets/useIsCustomersTabEnabled-DZ7jecHx.js +1 -0
- package/dist/assets/{useTaskManagerAccess-DrmpkeUw.js → useTaskManagerAccess-Z6bIfXqO.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-CHhZ2DRZ.js → useTaskManagerPusherEvents-Doj7t2BI.js} +1 -1
- package/dist/assets/{utils-Ctp9Zfhk.js → utils-BtSqr9lx.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CKC1_4cy.js → withTransactionSidePanel-DybBA6JZ.js} +2 -2
- package/dist/assets/{zeni-epic-state-aUBx6G2Q.js → zeni-epic-state-BSu6fdxh.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/ActualMatchingMatchDetailScreen-B6pl-MVl.js +0 -1
- package/dist/assets/AddressRoutes-zjWkB0xf.js +0 -1
- package/dist/assets/AddressScreen-Czlolp2X.js +0 -9
- package/dist/assets/AiCfoScreen-BhfmD__h.js +0 -22
- package/dist/assets/AppDrawer-B7GEeTxi.js +0 -10
- package/dist/assets/BusinessVerificationPageScreen-je1np7-9.js +0 -9
- package/dist/assets/CardsAiCfoScreen-abedaxWu.js +0 -14
- package/dist/assets/ConnectionAuthScreen-BmJpUHtJ.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Deo-LVYJ.js +0 -1
- package/dist/assets/DashboardRoutes-CCGs4e1_.js +0 -20
- package/dist/assets/DomesticWireDetailScreen-6W-Er5_q.js +0 -18
- package/dist/assets/EntityDetailRoutes-BrJAd36h.js +0 -1
- package/dist/assets/FeaturePreviewScreen-Dcu53_tf.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-ClZsPGpZ.js +0 -1
- package/dist/assets/InboxNotificationsProvider-DiTDJFwP.js +0 -1
- package/dist/assets/InvoicingRoutes-BTvzZ8JV.js +0 -3
- package/dist/assets/MagicLinkRoutes-V1DxaNiW.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-DnCx8Y6G.js +0 -12
- package/dist/assets/MobileAppDrawer-Bql3K6nh.js +0 -1
- package/dist/assets/NotFoundScreen-CTik05r2.js +0 -1
- package/dist/assets/NotificationRoutes-wSm6mA8N.js +0 -1
- package/dist/assets/OAuthConsentScreen-BELrcqAy.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Dpao8SIb.js +0 -1
- package/dist/assets/PaymentLinkScreen-vbM_NtP3.js +0 -21
- package/dist/assets/PeopleRoutes-CJeBX2Ca.js +0 -22
- package/dist/assets/PerformanceRoutes-W4NxEUmH.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-CSZJghRB.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js +0 -1
- package/dist/assets/ReimbursementRoutes-BUZKWvJ7.js +0 -68
- package/dist/assets/ReportsRoutes-BUZ4r7hx.js +0 -1
- package/dist/assets/RewardsRoutes-DuYZ4TXP.js +0 -1
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DN2DZsFw.js +0 -33
- package/dist/assets/ScreenRoutes-CxP9HSCe.js +0 -2
- package/dist/assets/SignInScreen-BScZ138a.js +0 -1
- package/dist/assets/SignOutScreen-Bk-Y8Sbv.js +0 -9
- package/dist/assets/TaskRoutes-DPcu4NRR.js +0 -9
- package/dist/assets/TransactionDetailRoutes-yEwix446.js +0 -1
- package/dist/assets/TreasuryRoutes-C24SAGLB.js +0 -37
- package/dist/assets/WiseConfirmationScreen-Dt6hB5m-.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-CmfHt6Wr.js +0 -9
- package/dist/assets/epic-DwBfFPJQ.js +0 -2
- package/dist/assets/expenseAutomationHelper-SA0jUIyg.js +0 -1
- package/dist/assets/index-ae04Qn4V.js +0 -1
- package/dist/assets/routePaths-D0jOibXk.js +0 -1
- package/dist/assets/stripSplatSuffix-CFosfir7.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-nJ3hpXEY.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CWWQxV2L.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-B6j7j1rG.js +0 -1
- package/dist/assets/useEnsureVendorListLoaded-COBYTL2U.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as U}from"./liveblocks-
|
|
1
|
+
import{j as U}from"./liveblocks-XOqCw7q2.js";import{a as i}from"./sentry-CNIAdl-1.js";import{h as Q,g as H,u as X,j as A,s as J,l as Z}from"./core-BVdj_noT.js";import{az as ee,p as te,_ as B,z as ne,B as $,be as ae,c as ce,R as oe}from"./index-Dme9CBSK.js";import{bm as se,fJ as ie,g_ as ue,oR as W,YJ as re,il as G,gl as le,oE as de,YK as pe,YL as ge,YM as me,uB as Ae,mb as be,oC as Ie,oy as ye,oN as fe,oJ as Se,io as Ee,YN as he,YO as ve}from"./zeni-epic-state-BSu6fdxh.js";import{n as we}from"./mui-BZ0jnpww.js";import{M as Ce}from"./MobileAppDrawer-BLYS912H.js";import{q}from"./QBOConnectionScreen-DyZaNX6V.js";import{g as E,a as h,m as ze}from"./accountMappingHelper-8C9JQylV.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]="4b08f4d2-e233-43f0-a9d8-42d842c0d12e",n._sentryDebugIdIdentifier="sentry-dbid-4b08f4d2-e233-43f0-a9d8-42d842c0d12e")}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 U}from"./liveblocks-CuUK5O_2.js";import{a as i}from"./sentry-D0lP5-8
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${n=>n.theme.colors.grey4};
|
|
9
|
-
`,Fe=
|
|
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:O}=C,{bankAccount:M,expenseCategory1099:P}=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),D=h(e.accountMappingView.fixedAssetsAccountList,g.selectedOptions),L=h(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),y=h(e.accountMappingView.bankAccounts1099FilingAccountList,M.selectedOptions),R=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,P),f={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:b?.accountId,selectedBillPayAccountId:j?.accountId,selectedReimbursementsAccountId:I?.accountId,selectedPrepaidExpensesAccountIds:k.map((t=>t.accountId)),selectedFixedAssetsAccountIds:D.map((t=>t.accountId)),selectedAccruedExpensesAccountIds:L.map((t=>t.accountId)),selectedBankAccounts1099FilingAccountIds:y.map((t=>t.accountId)),selectedExpenseAccounts1099FilingAccountIds:R};n(ve({data:f}))},onBackClick:()=>{$(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),Le=()=>{const n=ee(),e=Q(),u=H(),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:O,currencySymbol:M}=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??"$"}}),J),P=i.useCallback(((t,o)=>{a(W(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,K]=m[0]??[];S!=null&&a(W(c.companyId,S,K,void 0,Object.keys(o).length>0?o:null))}),[a,c.companyId,g]),b=A((t=>re(t.accountState)),J),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),[D,L]=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 R=A((t=>ge(t))),f=t=>{L(t)};return U.jsxs(xe,{children:[U.jsx(Ce,{isAppContentDrawerOpen:D,handleDrawerToggle:f}),U.jsx(Fe,{currentTenant:c,navigate:e,meetingUrl:n("account_mapping"),accountMappingView:R,isFiling1099FeatureEnabled:d&&T,isAccruedExpensesFeatureEnabled:v,isRevenueAutomationEnabled:w,isCapitalizationFeatureEnabled:x,capitalizableAccounts:V,accountNamesById:j,capitalizableAccountOverrides:g,currencySymbol:M,isCapitalizationThresholdSaving:O,onSaveCapitalizationAccountThreshold:P,onSaveCapitalizationAccountThresholds:_,location:u,isSettings:$(u),onClickMenuIcon:()=>f(!0)})]})};export{r as P,Le as U,l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-XOqCw7q2.js";import{a as y}from"./sentry-CNIAdl-1.js";import{a5 as A,c1 as R}from"./index-Dme9CBSK.js";import"./mui-BZ0jnpww.js";import{u as F}from"./useActualMatchingMatchDetail-ClGwke9Y.js";import b from"./NotFoundScreen-BDU6ccX1.js";import{i as P,h as U,g as w}from"./core-BVdj_noT.js";import"./zeni-epic-state-BSu6fdxh.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.js";import"./stripSplatSuffix-CLHAbjpi.js";import"./decodeURIComponentSafe-JMSvQveN.js";import"./routePaths-TIOEKAr9.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-XOqCw7q2.js";import{A as i}from"./AddressScreen-Dh4KOVQ1.js";import s from"./NotFoundScreen-BDU6ccX1.js";import"./sentry-CNIAdl-1.js";import{n as d,o as r}from"./core-BVdj_noT.js";import"./zeni-epic-state-BSu6fdxh.js";import"./recharts-VHHravhf.js";import"./index-Dme9CBSK.js";import"./mui-BZ0jnpww.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.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-XOqCw7q2.js";import{a as h}from"./sentry-CNIAdl-1.js";import{h as T,u as P,g as j,i as E,j as B,l as L}from"./core-BVdj_noT.js";import{a2 as M,z as $,V as D,a8 as K,a9 as R,c as _,R as S,a4 as z,W as b,a5 as F}from"./index-Dme9CBSK.js";import{a1L as C,iB as N,fJ as U,a1l as V,c8 as G,_r as O,mT as q}from"./zeni-epic-state-BSu6fdxh.js";import{u as H,n as J}from"./mui-BZ0jnpww.js";import W from"./NotFoundScreen-BDU6ccX1.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]="4d5b67f4-3eb0-4677-9303-7fe708462ff9",e._sentryDebugIdIdentifier="sentry-dbid-4d5b67f4-3eb0-4677-9303-7fe708462ff9")}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=L((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=U(e),a=s.roleMap!=null&&V(s.roleMap),n=i||c==="user_address"||G(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=O(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:n,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const d=C(e,o);return{addressToEdit:d.address,loadingState:d.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:n}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const n=i.state,d=F(n?.pathnameStackToGoBack);let t=d.poppedPathname??v();const u=n?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(t=`${t}?${f}`)}o(t,{state:{pathnameStackToGoBack:d.newStack}})}};return{onSubmitHandler:a=>{const n=Y(a);e(q({addressType:c,addressToCreate:n})),_?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(z);function re({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),n=P(),d=j(),{addressId:t,addressType:u}=E(),f=M(),I=H(),k=$.getSignedInUser(),[g,w]=h.useState(t==null),p=B((m=>t!=null?C(m,t).fetchState:"Not-Started")),x=D();if(k==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(t!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect((()=>{g||t==null||(w(!0),n(N(t,!1)))}),[g,t,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)?!g&&p==="Not-Started"||g&&p==="In-Progress"?r.jsx(K,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):t!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(R,{analytics:_,onLoad:A}),r.jsx(Q,{windowSize:f,children:r.jsx(X,{location:d,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,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-XOqCw7q2.js";import{a as n}from"./sentry-CNIAdl-1.js";import{u as Lt,h as Ut,i as Bt,g as Vt,j as v,l as Ft}from"./core-BVdj_noT.js";import{ee as Mt,g as Nt,n as $t,ef as Gt,z as Ht,a2 as qt,eg as zt,eh as Wt,ei as Kt,aE as Be,ej as We,ek as Yt,aD as Ke,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 Ve,eu as ds}from"./index-Dme9CBSK.js";import{fI as F,gx as R,V8 as cs,a3K as ms,a3L as Ss,jY as hs,a3M as ps,jV as fs,a3N as Se,jB as Y,k2 as J,jH as Ie,jo as he,jm as gs,k4 as Is,jQ as Ye,Vg as Fe,gz as N,gO as Cs,Vf as ks,V1 as Me,fJ as bs,jf as vs,a3O as Es,gc as Ps,jx as ws,jt as ys,fK as pe,gj as xs,a3P as Rs,a3Q as Ts,a3R as Os,gy as js,gs as Ne,kg as $e,gu as Ge,gA as As,a3S as He,k5 as _s,jq as Ds,jK as Qs,k0 as qe,jN as Ls,gB as Us,gC as Bs,gD as Vs,gE as Fs}from"./zeni-epic-state-BSu6fdxh.js";import{D as Ms,n as $,S as Ns,v as $s}from"./mui-BZ0jnpww.js";import{u as Gs}from"./useAiCfoDashboardSuggestedQuestionsChips-CF91keX4.js";import{p as Hs}from"./pathToGoBack-BYz7DD9r.js";import{l as qs}from"./routePaths-TIOEKAr9.js";import{u as zs}from"./useTaskManagerPusherEvents-Doj7t2BI.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.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]="f7410512-85dc-4b0c-99b5-34e5ce5935f5",t._sentryDebugIdIdentifier="sentry-dbid-f7410512-85dc-4b0c-99b5-34e5ce5935f5")}catch{}})();const Ws=["claimed","running","succeeded","failed","timeout"],fe=t=>typeof t=="string"&&t!=="",Je="chat-response-generated";function Ks(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 Ys=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:Ks(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,B=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}=Ke(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,Bs(c.visualization?.type??"")??null,E,c.summarized_title,c.metadata.message_id??null),t(Vs({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&&Ve(t,a,o,i,g,d,O,c,void 0,E)},onFetchSkills:()=>{t(Ye())},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(N()),t(Ne()),Ve(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($e(i,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{i!=null&&o?.messageId!=null&&t($e(i,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{l(-1)},onNewChatClick:()=>{t(N()),i!=null&&t(Ne());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(`/${B}/cards`,{state:{...h.state}})},onAfterCardPolicySubmit:()=>{U(!0),l(`/${B}/cards/policy`,{state:{...h.state}})}})}}))(ts(ss)),bn=({isFileUploadEnabled:t})=>{const r=Mt(),{setIsAiCfoOpen:h}=Nt(),s=Lt(),d=Ut(),{session_id:l}=Bt(),i=Vt(),g=new URLSearchParams(i.search).get("routine")??void 0,[p,f]=n.useState(!1),U=v((e=>F(e).uiState.isSkillsBrowserOpen===!0)),B=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?Y({scheduleId:P}):Se())}),[s,P]);const V=ke?.macroId,at=v((e=>J(e))),be=V!=null&&V!==""&&at.fetchState==="Not-Started";n.useEffect((()=>{be&&V!=null&&s(Ie({macroId:V}))}),[s,be,V]);const ot=v((e=>F(e).uiState.currentChatSessionId))??l,k=o.routines.find((e=>e.scheduleId===g))??o.routines.find((e=>e.scheduleId===$t(ot))),T=k?.scheduleId??null,[ve,it]=n.useState(!0);n.useEffect((()=>{T!=null&&s(Y({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(Y({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(Ye()),s(Fe())}),[s]),ct=n.useCallback((()=>{s(N())}),[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(N()),void s(ks())):l==="skills"?(s(Se()),s(Me()),void s(Fe())):(T==null&&s(Se()),s(Me()),void s(N()))),[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=Kt({currentTenant:b,currentChatSessionId:u,aiCfoView:I,skillsEnabled:B,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?.[Be]!==!0)return;f(!0);const m={...e};delete m[Be],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}=Yt(u),W=I.fetchState,K=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}=Ke(_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"&&K&&s(ws())}),[W,K,s]),n.useEffect((()=>{u!=null&&je!=="In-Progress"&&Ae&&y!=null&&(l===u||W==="Completed"&&!K)&&s(ys(u,y.userId))}),[je,W,Ae,K,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(Y({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(Ys,{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:B,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=$(Ns)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Js=$.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Xs=$.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,Zs=$.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,en=$($s)`
|
|
20
|
+
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
21
|
+
color: ${({theme:t})=>t.colors.grey4};
|
|
22
|
+
`;export{bn as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-XOqCw7q2.js";import{a as o,R as $a}from"./sentry-CNIAdl-1.js";import{u as Fe,j as r,g as Ba,h as xa,q as H}from"./core-BVdj_noT.js";import{fJ as Ze,U$ as Aa,V0 as Ge,gd as Va,gz as K,V1 as ee,jQ as ye,jo as Te,V2 as _a,V3 as Da,gT as Ma,qo as Fa,V4 as Za,V5 as $e,gq as Ga,V6 as x,fI as Ra,gx as ja,V7 as Ha,V8 as La,V9 as Pa,Va as Be,Vb as Na,Vc as xe,Vd as Oa,EW as Ua,gr as qa,h6 as za,cO as Ya,Ve as Ja,h9 as Wa,q$ as Qa,gc as Xa,ji as Ka,Vf as et,Vg as at,x3 as tt,gs as nt}from"./zeni-epic-state-BSu6fdxh.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 Ae,x as St,y as kt,A as Ve,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 At,O as Vt}from"./index-Dme9CBSK.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-BZ0jnpww.js";import{u as Gt}from"./InboxNotificationsProvider-DvvXiK-n.js";import{u as Rt}from"./useTaskManagerAccess-Z6bIfXqO.js";import{u as jt}from"./useIsCustomersTabEnabled-DZ7jecHx.js";import{u as Ht}from"./expenseAutomationHelper-BtpowfoM.js";import"./recharts-VHHravhf.js";import"./analytics-u8j262Ga.js";import"./plaid-CCMRXiQR.js";import"./dnd-Ex3ltzzE.js";import"./stripe-cKAAJElX.js";import"./lottie-C5YZIzuj.js";import"./lexical-CVwGZsIc.js";import"./pdf-q1-3GLH6.js";import"./utils-BtSqr9lx.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]="50504e95-0aed-482d-9b55-9772969c5b28",a._sentryDebugIdIdentifier="sentry-dbid-50504e95-0aed-482d-9b55-9772969c5b28")}catch{}})();const A="AppDrawer",c={root:`${A}-root`,drawer:`${A}-drawer`,appBar:`${A}-appBar`,menuButton:`${A}-menuButton`,appBarZenilogo:`${A}-appBarZenilogo`,drawerZenilogo:`${A}-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,V]=$a.useState(!1),[k,Re]=o.useState(!1),t=Ba(),s=xa(),oe=Va(),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 We=Je||b,z=r((e=>e.tenantState)),Qe=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),W=Y.uiState.currentChatSessionId,Z=y!=null?Y.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,he=gt(Z),{inboxNotifications:Q,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&&Q!=null){const e=`dashboard_${i.companyId}`;Ne(Q.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[fe,ge,be,i?.companyId,Q]),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=>{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&&L.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(Qa({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"?Qe: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: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",W??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=Vt(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)?(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(Ka(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: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,{}),We===!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: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=Fe(),S=r((V=>Ze(V))),P={events:S.userRoleId!=null?[`private-encrypted-${S.userRoleId}.dashboard-user-notification`]:[],eventCallback:(V,k)=>{st(k)&&Aa(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
|
+
height: 20px;
|
|
3
|
+
width: 20px;
|
|
4
|
+
color: ${a=>a.theme.colors.primary};
|
|
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: ${At.sp4};
|
|
7
|
+
width: 102px;
|
|
8
|
+
color: ${a=>a.theme.colors.primary};
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
`;export{c1 as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-CuUK5O_2.js";import{a as d}from"./sentry-D0lP5-8e.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-BBlQ3ArL.js";import{fI as P,Xi as w,W$ as R,Il as E,If as K,Ij as A,I8 as X,X1 as z,Ic as ae,In as oe,Ib as G,Iq as H,Im as C}from"./zeni-epic-state-aUBx6G2Q.js";import{z as k,w as J,bh as pe,C as O,b0 as M,bi as le,a8 as Q,bj as se,bk as ne}from"./index-ClwW47Zs.js";import{u as Y}from"./mui--aGBnNu2.js";import{u as Z}from"./useEnsureVendorListLoaded-COBYTL2U.js";import{i as re}from"./ReimbursementApprovalRuleDetailScreen-kqCAU4nf.js";import ie from"./NotFoundScreen-CTik05r2.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]="a82beaef-8e31-44b6-825b-f23337b0fff1",e._sentryDebugIdIdentifier="sentry-dbid-a82beaef-8e31-44b6-825b-f23337b0fff1")}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(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(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(K(!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(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(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(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]),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(H(!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(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(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(H(!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(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(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};
|
|
1
|
+
import{j as u}from"./liveblocks-XOqCw7q2.js";import{a as d}from"./sentry-CNIAdl-1.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 D}from"./core-BVdj_noT.js";import{fJ as P,Xt as w,Xa as R,Iv as E,Ip as X,It as A,Ii as K,Xc as z,Im as ae,Ix as oe,Il as J,IA as G,Iw as C}from"./zeni-epic-state-BSu6fdxh.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-Dme9CBSK.js";import{u as Y}from"./mui-BZ0jnpww.js";import{u as Z}from"./useEnsureVendorListLoaded-U686iOkV.js";import{i as re}from"./ReimbursementApprovalRuleDetailScreen-DrgxKZH7.js";import ie from"./NotFoundScreen-BDU6ccX1.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]="911e1f3d-6cbb-4a66-ae2f-5d2e263abde4",e._sentryDebugIdIdentifier="sentry-dbid-911e1f3d-6cbb-4a66-ae2f-5d2e263abde4")}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(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(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(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(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 x=[];N==="role"?x=ee.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(x=(g.persons?.selectedUsers??[]).map((T=>({type:"user",userId:T.userId,isImplicitActor:!1}))));const $=g.action??"require_approval";b.push({action:$,actors:x,operator:x.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(D,{path:"/",element:u.jsx(ve,{})}),u.jsx(D,{path:"/new",element:u.jsx(F,{})}),u.jsx(D,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(D,{path:"*",element:u.jsx(ie,{})})]})}export{Ce as B};
|