@zeniai/web-app-ui 5.3.32-dev → 5.3.32-prod
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-BXftSVn-.js +9 -0
- package/dist/assets/AddressRoutes-Dx1aQN-n.js +1 -0
- package/dist/assets/{AddressScreen-LFBV9KsX.js → AddressScreen-TLZdvXNy.js} +2 -2
- package/dist/assets/{AiCfoScreen-N1tWqaxl.js → AiCfoScreen-DmLnUFml.js} +1 -1
- package/dist/assets/{AppDrawer-DmTC2F7R.js → AppDrawer-BnHpD6dG.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-sbvXc3_Z.js → BillPayApprovalRoutes-DPALyyf2.js} +1 -1
- package/dist/assets/{BillPayRoutes-Cf4T_cOn.js → BillPayRoutes-qAhjjusa.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-BYV8fDWH.js +9 -0
- package/dist/assets/{CardsAiCfoScreen-p_ZDfSVk.js → CardsAiCfoScreen-Cd63K_-0.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-DWtJK7tn.js → ChargeCardRoutes-BH9evnp_.js} +7 -7
- package/dist/assets/{CompanyPassportScreen-Cr55ZhHa.js → CompanyPassportScreen-D0g6Nmxq.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-CpG3pE-i.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CXLOaLgp.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-CI_z4poM.js +30 -0
- package/dist/assets/{DashboardRoutes-DmGJojZS.js → DashboardRoutes-C_4oAXQg.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CWi1XNJj.js → DefaultTenantHome-D3eb-jo9.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-i7JC-m7w.js +18 -0
- package/dist/assets/{DrawerScreen-DVJ1nhu5.js → DrawerScreen-DUO1Z5ow.js} +1 -1
- package/dist/assets/EntityDetailRoutes-B2ai8pR3.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-OyBtxM5J.js → ExpenseAutomationRoutes-DQA6yQ4O.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-CjFoHQHk.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-qemWA0jI.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-DBc6Mphu.js → InboxNotificationsProvider-7eYmgI1F.js} +1 -1
- package/dist/assets/{InvoicingRoutes-B1FBFxmX.js → InvoicingRoutes-DOUUybBE.js} +2 -2
- package/dist/assets/{MagicLinkRoutes-70CKQAmw.js → MagicLinkRoutes-CTs6OYkH.js} +7 -7
- package/dist/assets/MagicLinkSignInScreen-CDEl_Ic_.js +12 -0
- package/dist/assets/MobileAppDrawer-BMvh-RAa.js +1 -0
- package/dist/assets/NotFoundScreen-Wkt8x0Ja.js +1 -0
- package/dist/assets/NotificationRoutes-BF1aTPUh.js +1 -0
- package/dist/assets/OAuthConsentScreen-8oM_ijmg.js +1 -0
- package/dist/assets/{PandLWithForecastRoutes-DHCQWgYM.js → PandLWithForecastRoutes-DvwOSp2G.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-nMdnk521.js → PaymentLinkScreen-D0VzMTpF.js} +4 -4
- package/dist/assets/PeopleRoutes-CMx_k0hr.js +22 -0
- package/dist/assets/PerformanceRoutes-OuxZJbf_.js +1 -0
- package/dist/assets/{Preview-C_55fm97.js → Preview-Dkzm36JB.js} +1 -1
- package/dist/assets/QBOConnectionScreen-Cxvr0UGn.js +100 -0
- package/dist/assets/ReimbursementApprovalRoutes-ChPdj5ky.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-kIivYyt0.js +1 -0
- package/dist/assets/ReimbursementRoutes-DlTMcw_k.js +68 -0
- package/dist/assets/{ReportsRoutes-BMuQOI7M.js → ReportsRoutes-DUvTlB32.js} +1 -1
- package/dist/assets/RewardsRoutes-CANJzBfw.js +1 -0
- package/dist/assets/ScreenRoutes-B2jpCRd2.js +2 -0
- package/dist/assets/{SettingsRoutes-6XcFcNwI.js → SettingsRoutes-D405mYiE.js} +7 -7
- package/dist/assets/{SetupPagesScreen-BxDIT7Xu.js → SetupPagesScreen-o-PhLBXH.js} +5 -5
- package/dist/assets/SignInScreen-CsdAWM0a.js +1 -0
- package/dist/assets/SignOutScreen-DjO_hTaY.js +9 -0
- package/dist/assets/TaskListScreen-D5rs0HLr.js +9 -0
- package/dist/assets/TaskRoutes-IWzYaX-F.js +9 -0
- package/dist/assets/TransactionDetailRoutes-DExFe-03.js +1 -0
- package/dist/assets/{TransactionDetailScreen-2kUyCbFm.js → TransactionDetailScreen-7v-3l9dA.js} +2 -2
- package/dist/assets/TransactionListRoutes-hxVuwPcb.js +1 -0
- package/dist/assets/TreasuryRoutes-C4GA1Tde.js +37 -0
- package/dist/assets/{VendorsRoutes-zeljYW53.js → VendorsRoutes-DLC5o9yJ.js} +20 -20
- package/dist/assets/WiseConfirmationScreen-BJNaaQrG.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-Dl9FUScI.js → ZeniAccountRoutes-CPdfqL23.js} +9 -9
- package/dist/assets/ZeniAccountStatementScreen-Butd8DWu.js +9 -0
- package/dist/assets/{accountMappingHelper-ZLBxLrOl.js → accountMappingHelper-DsN6SM7a.js} +1 -1
- package/dist/assets/{analytics-DHBkdK00.js → analytics-NBT5BH2R.js} +1 -1
- package/dist/assets/{analyticsHelper-C8sM1z8L.js → analyticsHelper-Bw6Cjeqd.js} +1 -1
- package/dist/assets/{core-DuNHGHBC.js → core-Dlma5MIa.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CcNRl55W.js → decodeURIComponentSafe-MgEJs-XP.js} +1 -1
- package/dist/assets/{dnd-DKR3QBLX.js → dnd-BgBEAfSC.js} +1 -1
- package/dist/assets/{empty-DRiI770H.js → empty-BRn9rxGR.js} +1 -1
- package/dist/assets/{empty-BA0WbUFe.js → empty-DpC6uPKD.js} +1 -1
- package/dist/assets/{emptyVideoElement-h3Sv0Oh_.js → emptyVideoElement-BpruyOrt.js} +1 -1
- package/dist/assets/epic-TdjWG3DC.js +2 -0
- package/dist/assets/{expenseAutomationHelper-DGi7tuOw.js → expenseAutomationHelper-BpaM_jjL.js} +1 -1
- package/dist/assets/{getLocaleForTenant-D1jcEP43.js → getLocaleForTenant-B0nO-Z7L.js} +1 -1
- package/dist/assets/{index-CxkwDRG8.js → index-Blw4A66-.js} +30310 -31275
- package/dist/assets/{index-y1KlwLzp.js → index-BtQ2P-s4.js} +1 -1
- package/dist/assets/{index-DgXVMYGv.js → index-CYHgs6V3.js} +1 -1
- package/dist/assets/{index-CFb8siio.js → index-CexFEAIL.js} +1 -1
- package/dist/assets/{index-DplrRYRh.js → index-Cr8P80rT.js} +1 -1
- package/dist/assets/{index-DRythsNE.js → index-DHUOQOTf.js} +1 -1
- package/dist/assets/{index-bPK7WXlx.js → index-YntXYqu4.js} +2 -2
- package/dist/assets/{index-B21g9_qj.js → index-ui_UfE_7.js} +1 -1
- package/dist/assets/{lexical-CcqvVKiN.js → lexical-Cc-23sPJ.js} +1 -1
- package/dist/assets/{liveblocks-BkTNzfNi.js → liveblocks-BD1fi6wA.js} +1 -1
- package/dist/assets/{lottie-DACJJNY9.js → lottie-Dd5kLrRz.js} +1 -1
- package/dist/assets/{mui-DaLeH41l.js → mui-DPmPgDDD.js} +1 -1
- package/dist/assets/{pathToGoBack-CmznLvKE.js → pathToGoBack-C5NlBrdk.js} +1 -1
- package/dist/assets/{pdf-BjtwR-dW.js → pdf-BCsxh4ki.js} +3 -3
- package/dist/assets/{pdf-lib-oygBYinp.js → pdf-lib-BSghpPvP.js} +1 -1
- package/dist/assets/{plaid-BVNoSR_u.js → plaid-w5kSeMkL.js} +1 -1
- package/dist/assets/{pusher-Db4sFIYV.js → pusher-D_NnYp1B.js} +1 -1
- package/dist/assets/{react-CYKQo_kF.js → react-BRcmo_so.js} +1 -1
- package/dist/assets/{react-1oTTb5wo.js → react-BYFmdCmG.js} +1 -1
- package/dist/assets/{react-CEkBTHgm.js → react-BiCIC8nJ.js} +1 -1
- package/dist/assets/{react-CMoOPPDa.js → react-CKnkKWiv.js} +1 -1
- package/dist/assets/{react-CNf8hG5M.js → react-Co4WxHXe.js} +1 -1
- package/dist/assets/{react-eY-XTCmQ.js → react-wEOgqpw3.js} +1 -1
- package/dist/assets/{recharts-CkuQpH_L.js → recharts-WuCIKI4c.js} +1 -1
- package/dist/assets/{routePaths-CKTfFzY9.js → routePaths-1GgW-roh.js} +1 -1
- package/dist/assets/{sentry-CNLjKkQW.js → sentry-C6D8WJ15.js} +1 -1
- package/dist/assets/{url-C3nvEZls.js → url-7hMA9KrE.js} +1 -1
- package/dist/assets/url-BVCS53n5.js +6 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BnMQqj78.js → useAiCfoDashboardSuggestedQuestionsChips-Cox0FTmj.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-5qRN6gKs.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-B74EcXIV.js → useChargeCardPusherEvents-Cu201ke6.js} +1 -1
- package/dist/assets/{useDeviceId-J3kskmrp.js → useDeviceId-p2IpPhWq.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-pFVkjSX_.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DANB6KeB.js → useInitialThreadRequest-Ddm4sao-.js} +1 -1
- package/dist/assets/useTaskManagerAccess-BKVtGCGL.js +1 -0
- package/dist/assets/utils-Bv9LDtmr.js +36 -0
- package/dist/assets/{withTransactionSidePanel-CbsHNOl9.js → withTransactionSidePanel-QyMR1bIP.js} +2 -2
- package/dist/assets/{zeni-epic-state-IKQP0lNP.js → zeni-epic-state-2zvjmkUL.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AccountMappingScreen-Dst-9gUw.js +0 -9
- package/dist/assets/AddressRoutes-O-cTW9EV.js +0 -1
- package/dist/assets/BusinessVerificationPageScreen--LjYD0BK.js +0 -9
- package/dist/assets/ConnectionAuthScreen-D-vDZGov.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Cs_F35vo.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-deFe2P-n.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-D5RLzOT3.js +0 -18
- package/dist/assets/EntityDetailRoutes-DJgrP2Nz.js +0 -1
- package/dist/assets/FeaturePreviewScreen-BhrA_knX.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Dm5LF-fb.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CC7wdqci.js +0 -12
- package/dist/assets/MobileAppDrawer-BtnNKdri.js +0 -1
- package/dist/assets/NotFoundScreen-DjDyDYWZ.js +0 -1
- package/dist/assets/NotificationRoutes-Jy_Q0gUN.js +0 -1
- package/dist/assets/OAuthConsentScreen-DB2EvPsq.js +0 -1
- package/dist/assets/PeopleRoutes-rPdm-Ydn.js +0 -22
- package/dist/assets/PerformanceRoutes-CF0jBH_I.js +0 -1
- package/dist/assets/QBOConnectionScreen-Dlky0ESM.js +0 -100
- package/dist/assets/ReimbursementApprovalRoutes-Bf9cBzdf.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-XQSOHGYn.js +0 -1
- package/dist/assets/ReimbursementRoutes-CgvBDllF.js +0 -68
- package/dist/assets/RewardsRoutes-CF7hyIJJ.js +0 -1
- package/dist/assets/ScreenRoutes-vV1s5761.js +0 -2
- package/dist/assets/SignInScreen-UcqpfzAX.js +0 -1
- package/dist/assets/SignOutScreen-14vW04Vy.js +0 -9
- package/dist/assets/TaskListScreen-CwNgkHwd.js +0 -9
- package/dist/assets/TaskRoutes-uBt2S29g.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Burs226A.js +0 -1
- package/dist/assets/TransactionListRoutes-Dm5jOGqp.js +0 -1
- package/dist/assets/TreasuryRoutes-C3nO4w9n.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BBqG7Bw5.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BjcRzB88.js +0 -9
- package/dist/assets/epic-leJAVePQ.js +0 -2
- package/dist/assets/url-CaYHIgYK.js +0 -6
- package/dist/assets/useAskAiCfoHostNavButtonProps-D-XiURTy.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-F2D_LM69.js +0 -1
- package/dist/assets/useTaskManagerAccess-CgZlooKP.js +0 -1
- package/dist/assets/utils-BN2UhEgk.js +0 -36
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as B}from"./liveblocks-BD1fi6wA.js";import{a as o}from"./sentry-C6D8WJ15.js";import{h as K,g as W,u as X,j as m,s as q,l as Y}from"./core-Dlma5MIa.js";import{ag as Z,I as ee,d as G,z as te,r as $,ah as ne,l as ae,S as ce}from"./index-Blw4A66-.js";import{bn as se,fB as oe,gS as ie,of as H,TD as re,i5 as J,gd as le,o6 as ue,TE as de,TF as pe,tg as ge,lF as me,o4 as Ae,o0 as be,ob as Ie,i7 as fe,TG as ye,TH as Se}from"./zeni-epic-state-2zvjmkUL.js";import{n as he}from"./mui-DPmPgDDD.js";import{M as Ee}from"./MobileAppDrawer-BMvh-RAa.js";import{q as R}from"./QBOConnectionScreen-Cxvr0UGn.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-DsN6SM7a.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="18c3b971-2f3c-4932-a933-53d8e4728346",a._sentryDebugIdIdentifier="sentry-dbid-18c3b971-2f3c-4932-a933-53d8e4728346")}catch{}})();const l="zeni_pending_projects_enable",u={pending:"pending",ready:"ready"},ve=he.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${a=>a.theme.colors.grey4};
|
|
9
|
+
`,we=Y((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(l),c=i===u.pending||i===u.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:A}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:v,vendorsAccountSection:w,filing1099Section:C}=r,{incomeAccount:x,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:T}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:V,accruedExpensesAccount:O}=w,{bankAccount:M,expenseCategory1099:P}=C,b=h(e.accountMappingView.incomeAccountList,x.selectedOption),_=h(e.accountMappingView.expenseAccountList,F.selectedOption),I=h(e.accountMappingView.billPayAccountList,s.selectedOption),j=h(e.accountMappingView.reimbursementsAccountList,T.selectedOption),k=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),D=E(e.accountMappingView.fixedAssetsAccountList,V.selectedOptions),f=E(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),L=E(e.accountMappingView.bankAccounts1099FilingAccountList,M.selectedOptions),y=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,P),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:_?.accountId,selectedBillPayAccountId:I?.accountId,selectedReimbursementsAccountId:j?.accountId,selectedPrepaidExpensesAccountIds:k.map((n=>n.accountId)),selectedFixedAssetsAccountIds:D.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:f.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:L.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:y};a(Se({data:t}))},onBackClick:()=>{$(c)===!1?(i("../../dashboard"),a(ye())):a(J())},onSaveClick:()=>{a(fe()),A&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(Ie(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(l);d===u.pending||d===u.ready||a(r?Ae(e.currentTenant.companyId):be(e.currentTenant.companyId))}}}))(ne),je=()=>{const a=Z(),e=K(),i=W(),c=X(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A(G.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A(G.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:v,isDynamicConfigLoading:w}=r("transaction_categorization_config"),C=!w&&v?.capitalization_enabled===!0,x=te.getSignedInUser(),F=se(x),s=m((t=>oe(t))),{capitalizableAccounts:T,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:V,currencySymbol:O}=m((t=>{const n=t.tenantState.currentTenantId,g=n!=null?t.tenantState.tenantsById[n]:void 0,S=ie(t.companyState,s.companyId);return{capitalizableAccounts:g?.capitalizableAccounts??null,capitalizableAccountOverrides:g?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),q),M=o.useCallback(((t,n)=>{c(H(s.companyId,t,n))}),[c,s.companyId]),P=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[U,N]of g)N===null?delete n[U]:n[U]=N;const[S,Q]=g[0]??[];S!=null&&c(H(s.companyId,S,Q,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),q),_=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[I,j]=o.useState(!1),[k,D]=o.useState(!1);o.useEffect((()=>{I===!1&&(c(J()),j(!0))}),[I]);const f=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(l)===u.pending&&(sessionStorage.removeItem(l),c(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(l)===u.ready&&s?.companyId!=null&&(sessionStorage.removeItem(l),c(ue(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{f&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),R.init("/connection/auth",s.tenantEmailDomain),R.handleClick())}),[f,s?.tenantEmailDomain,c]);const L=m((t=>pe(t))),y=t=>{D(t)};return B.jsxs(ve,{children:[B.jsx(Ee,{isAppContentDrawerOpen:k,handleDrawerToggle:y}),B.jsx(we,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:L,isFiling1099FeatureEnabled:d&&F,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:C,capitalizableAccounts:T,accountNamesById:_,capitalizableAccountOverrides:p,currencySymbol:O,isCapitalizationThresholdSaving:V,onSaveCapitalizationAccountThreshold:M,onSaveCapitalizationAccountThresholds:P,location:i,isSettings:$(i),onClickMenuIcon:()=>y(!0)})]})};export{l as P,je as U,u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BD1fi6wA.js";import{A as o}from"./AddressScreen-TLZdvXNy.js";import i from"./NotFoundScreen-Wkt8x0Ja.js";import"./sentry-C6D8WJ15.js";import{n as s,o as r}from"./core-Dlma5MIa.js";import"./zeni-epic-state-2zvjmkUL.js";import"./recharts-WuCIKI4c.js";import"./index-Blw4A66-.js";import"./mui-DPmPgDDD.js";import"./analytics-NBT5BH2R.js";import"./plaid-w5kSeMkL.js";import"./dnd-BgBEAfSC.js";import"./stripe-cKAAJElX.js";import"./lottie-Dd5kLrRz.js";import"./lexical-Cc-23sPJ.js";import"./pdf-BCsxh4ki.js";import"./utils-Bv9LDtmr.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="31d0e0e8-dcf1-419d-b2be-6dc359df28c9",t._sentryDebugIdIdentifier="sentry-dbid-31d0e0e8-dcf1-419d-b2be-6dc359df28c9")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(o,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(o,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-BD1fi6wA.js";import{a as h}from"./sentry-C6D8WJ15.js";import{h as T,u as P,g as j,i as E,j as B,l as U}from"./core-Dlma5MIa.js";import{$,E as M,z as D,U as L,a5 as K,a6 as z,l as C,S,a1 as F,X as b,a2 as N}from"./index-Blw4A66-.js";import{Ui as _,il as R,fB as G,Uj as O,c7 as V,Uk as q,ml as H}from"./zeni-epic-state-2zvjmkUL.js";import{n as X}from"./mui-DPmPgDDD.js";import J from"./NotFoundScreen-Wkt8x0Ja.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]="d17107cf-56a8-4213-9430-d7cbcb40551f",e._sentryDebugIdIdentifier="sentry-dbid-d17107cf-56a8-4213-9430-d7cbcb40551f")}catch{}})();const Q=X.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as n}from"./liveblocks-BkTNzfNi.js";import{a as h}from"./sentry-CNLjKkQ
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,W=U((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=G(e),a=s.roleMap!=null&&O(s.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=_(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=N(d?.pathnameStackToGoBack);let t=r.poppedPathname??v();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(t=`${t}?${g}`)}o(t,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(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)}}}))(F);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=P(),r=j(),{addressId:t,addressType:u}=E(),g=$(),I=M(),k=D.getSignedInUser(),[f,w]=h.useState(t==null),p=B((m=>t!=null?_(m,t).fetchState:"Not-Started")),x=L();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((()=>{f||t==null||(w(!0),d(R(t,!1)))}),[f,t,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?n.jsx(K,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):t!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(z,{analytics:C,onLoad:A}),n.jsx(Q,{windowSize:g,children:n.jsx(W,{location:r,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(J,{})}const 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{ne as A,Y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-BkTNzfNi.js";import{a as l}from"./sentry-CNLjKkQW.js";import{u as Ue,h as Le,g as Fe,j as _,i as Be,l as Re}from"./core-DuNHGHBC.js";import{a as Ve,e2 as Me,z as $e,$ as Ne,e3 as qe,e4 as Ge,bm as le,e5 as he,e6 as He,bl as ge,a2 as H,a6 as $,h as x,e7 as N,e8 as ze,e9 as We,as as Je,N as Ke,w as Xe,ea as Ye,eb as Ze,at as et,ec as tt,ed as st,ee as at,ef as ot,p as nt,bi as re,eg as it}from"./index-CxkwDRG8.js";import{fA as z,gp as E,gx as W,Tq as lt,gr as J,gH as rt,fB as dt,j0 as ct,a1k as ut,g4 as mt,je as pt,ja as St,fC as q,gb as ht,a1l as gt,a1m as ft,a1n as Ct,jP as G,gq as kt,gk as de,k0 as ce,gm as ue,gs as It,a1o as me,jR as bt,j7 as vt,jl as Et,jN as pe,ji as Pt,jo as wt,gt as xt,gu as yt,gv as Tt,gw as At}from"./zeni-epic-state-IKQP0lNP.js";import{D as Qt,n as y,S as jt,P as Ot}from"./mui-DaLeH41l.js";import{u as _t}from"./useAiCfoDashboardSuggestedQuestionsChips-BnMQqj78.js";import{p as Dt}from"./pathToGoBack-CmznLvKE.js";import"./recharts-CkuQpH_L.js";import"./analytics-DHBkdK00.js";import"./plaid-BVNoSR_u.js";import"./dnd-DKR3QBLX.js";import"./stripe-cKAAJElX.js";import"./lottie-DACJJNY9.js";import"./lexical-CcqvVKiN.js";import"./pdf-BjtwR-dW.js";import"./utils-BN2UhEgk.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="8eb2a734-cd67-46b6-b69a-5418237b214d",e._sentryDebugIdIdentifier="sentry-dbid-8eb2a734-cd67-46b6-b69a-5418237b214d")}catch{}})();const fe="chat-response-generated";function Ut(e,o){if(o.kind!=="save")return;if(o.fetchState==="In-Progress")return{status:"saving"};if(o.fetchState==="Error")return{status:"failed"};if(o.fetchState!=="Completed")return;const s=E(e).skills.find((p=>p.macroId===o.savedMacroId));return s==null?void 0:{status:"saved",command:s.name}}const Lt=Re((function(e,o){const s=z(e),p=o.isSubmitting,n=s.uiState?.currentChatSessionId,S=n!=null?ht(e.aiCfoState,n):[],c=Ze(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange}),C=gt(e),g=ft(e),P=Ct(e);return{showSampleQuestions:o.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:p,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${et}/tableDownload`,exportDownloadEndPoint:at(),emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,skills:E(e).skills,skillSaveState:Ut(e,P),skillsEnabled:E(e).skillsEnabled,skillsList:E(e).skills,skillsListError:E(e).fetchState==="Error",skillsListLoading:E(e).fetchState==="In-Progress",skillsCanPublish:E(e).canPublish,skillSaving:P.fetchState==="In-Progress",skillSaveError:P.fetchState==="Error",skillVersionHistory:C.macroId!=null?{macroId:C.macroId,versions:C.versions,error:C.fetchState==="Error",loading:C.fetchState==="In-Progress"}:void 0,skillRestoreBody:g.macroId!=null&&g.version!=null?{macroId:g.macroId,version:g.version,instructions:g.instructions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillDetail:G(e).detail,skillDetailError:G(e).fetchState==="Error",skillDetailLoading:G(e).fetchState==="In-Progress",syntheticAnswers:S,resolveSyntheticAnswerCardTile:st(e),resolveSyntheticAnswerPolicyTile:tt(e),...c}}),(function(e,o){const{location:s,currentTenant:p,userId:n,navigate:S,currentChatSessionId:c,allSessionsWithOrderedQuestionAnswers:C,isAiCardCreationEnabled:g,isCardPolicyEnabled:P,setIsAiCfoOpen:w}=o,T=p.tenantEmailDomain;return{onEventReceived:(t,a)=>{if(t===fe&&typeof a.text=="string"&&typeof a.metadata=="object"){const d=a,u=xt(d.type),h=d.metadata.chat_session_id??null,{currentChatSession:k,currentQuestionAnswer:A,currentQuestionAnswerSummary:b}=ge(C,h);u!=="answer"?x.trackAICFOChatResponseGenerated(u,A?.question.questionText??"",d.text,h,it(b,k),d.metadata.message_id??null):x.trackAICFOChatAnswerGenerated(d.text,A?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,yt(d.visualization?.type??"")??null,h,d.summarized_title,d.metadata.message_id??null),e(Tt({chatSessionId:d.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),e(At({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:n}))}},onSubmit:(t,a,d,u,h)=>{t&&re(e,t,a,c,C,n,u,d,void 0,h)},onFetchSkills:()=>{e(W())},onOpenSkill:t=>{e(Pt({macroId:t})),e(wt({macroId:t}))},onSaveSkill:(t,a)=>{e(pe({draft:t,macroId:a}))},onSaveSkillDraft:t=>{const a=t.displayName?.trim()??"",d=t.name?.trim()??"";e(pe({draft:{name:a.length>0?a:d,description:t.description?.trim()??null,instructions:t.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(t,a)=>{e(Et({macroId:t,version:a}))},onDeleteSkill:t=>{e(vt({macroId:t}))},onSetSkillVisibility:(t,a)=>{e(bt({macroId:t,visibility:a}))},onCloseSkillDetail:()=>{e(me())},onRunSkill:(t,a)=>{e(J()),e(de()),re(e,a,"user_input",void 0,C,n,void 0,void 0,void 0,t),e(me())},updateCurrentInput:t=>{e(ue(t))},onStopSubmit:()=>{},onUpdateScrollYOffset:t=>{e(It(t))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??Dt(1);S(a,{state:{...s.state,pathnameStackToGoBack:t.newStack}}),e(ue(""))},togglePageView:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??`/${p.tenantEmailDomain}/dashboard`;S(a,{state:{...he(s.state),pathnameStackToGoBack:t.newStack,message:"open_ai_cfo_drawer"}}),w(!0)},onCopy:()=>{},onThumbsUp:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"positive",a.questionText,a.answerText))},onThumbsDown:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"negative",a.questionText,a.answerText))},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{e(J()),c!=null&&e(de());const t=nt(s.state?.pathnameStackToGoBack,s.pathname);S(`/${p.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:t.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(t,a)=>{e(kt({questionAnswerId:t,isCollapsed:a}))},onMenuClick:o.onMenuClick,...ot(e,{isAiCardCreationEnabled:g,isCardPolicyEnabled:P,currentChatSessionId:c,onAfterCardsCreationSubmit:()=>{w(!0),S(`/${T}/cards`,{state:{...s.state}})},onAfterCardPolicySubmit:()=>{w(!0),S(`/${T}/cards/policy`,{state:{...s.state}})}})}}))(Xe(Ye)),os=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Ve(),s=Ue(),p=Le(),n=Fe(),[S,c]=l.useState(!1),C=_((i=>z(i).uiState.isSkillsBrowserOpen===!0)),g=_((i=>E(i).skillsEnabled)),P=l.useCallback((()=>{s(W()),s(lt())}),[s]),w=l.useCallback((()=>{s(J())}),[s]);l.useEffect((()=>{s(W())}),[s]);const{allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,onCardPolicyVendorSearchTextChange:d}=Me();l.useEffect((()=>{s(rt())}),[s]);const u=_((i=>z(i))),h=$e.getSignedInUser(),{session_id:k}=Be(),A=Ne(),b=Je(A),f=_((i=>dt(i))),r=u.uiState.currentChatSessionId,K=f.tenantEmailDomain,{handleUploadPromoClose:Ce,isUploadPromoVisible:ke}=qe({isFileUploadEnabled:e,tenantEmailDomain:K}),D=Ge({currentTenant:f,currentChatSessionId:r,aiCfoView:u,skillsEnabled:g,onCloseSkills:w,onOpenSkills:P}),{isSuggestedQuestionsLoading:Ie,suggestedPromptQuestions:be}=_t(),Q=n.state,j=Q?.aiCfoInitialQuestion,X=!!Q?.aiCfoShouldSubmit;l.useEffect((()=>{const i=n.state;if(i?.[le]!==!0)return;c(!0);const I={...i};delete I[le],p(n,{replace:!0,state:I})}),[n.pathname,n.search,n.state,p]);const[ve,U]=l.useState(null),[Ee,L]=l.useState(!1),[Pe,F]=l.useState(void 0),[we,B]=l.useState(void 0),Y=l.useRef(!1);l.useEffect((()=>{if(!Y.current&&j!=null&&j!==""){const i=n.state;U(j),L(X),F(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const I=i?.aiCfoSuggestionIndex;B(typeof I=="number"?I:void 0),Y.current=!0}}),[j,X,n.state]);const xe=l.useCallback((()=>{U(null),L(!1),F(void 0),B(void 0),p(n.pathname,{replace:!0,state:he(n.state)})}),[n.pathname,n.state,p]),Z=l.useMemo((()=>new URLSearchParams(n.search)),[n.search]),ee=Z.get("ref")??Q?.aiCfoRef,R=Z.get("emailRefId")??Q?.aiCfoEmailRefId,te=l.useRef(!1);l.useEffect((()=>{te.current||ee!=="month-end-email"||R==null||r!=null||h==null||(s(ct("controller",h.userId,R,"MONTH_END_EMAIL")),te.current=!0)}),[ee,R,r,s,h]);const O=u.uiState.lastContextMessage;l.useEffect((()=>{O!=null&&O!==""&&r!=null&&(U(O),L(!0),F(void 0),B(void 0),s(ut()))}),[O,r,s]);const ye=f.masterTOSInfo,v=ye?.isMasterTOSAccepted??!1,{visitedSessions:se}=He(r),V=u.fetchState,M=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,ae=r!=null?u.fetchChatSessionHistoryByChatSessionId?.[r]?.fetchState??"Not-Started":"Not-Started",oe=r==null||(u.uiState.chatHistoryNextPageToken[r]?.hasMore??!0),ne=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Te}=ge(ne,r),Ae=Te.length===0;l.useEffect((()=>{v||b||p("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})}),[v,b,p,n.state]);const Qe=l.useCallback((()=>{const i=H(n.state?.pathnameStackToGoBack),I=f.tenantEmailDomain;p(i.poppedPathname??(I!=null?`/${I}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})}),[f.tenantEmailDomain,n.state,p]);l.useEffect((()=>{r!=null&&k!==r&&p(`../ai-cfo/${r}`,{state:{...n.state}})}),[r,k]),l.useEffect((()=>{k!=null&&r==null&&k!=="new_chat"&&k!=="explore"&&s(mt({sessionId:k,agentId:"controller"}))}),[]);const je=l.useMemo((()=>({events:se.map((i=>`private-encrypted-chat-${i}.${fe}`)),eventCallback:(i,I,De)=>De.onEventReceived(i,I)})),[se]);l.useEffect((()=>{V!=="In-Progress"&&M&&s(pt())}),[V,M,s]),l.useEffect((()=>{r!=null&&ae!=="In-Progress"&&oe&&h!=null&&V==="Completed"&&!M&&s(St(r,h.userId))}),[ae,oe,r,h,s]);const ie=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(h==null||k==null)throw Error("Can't access AI Controller page without signing in...");const Oe=r!=null&&u.responseStateByChatSessionId?.[r]?.answer?.fetchState==="In-Progress";if(!v&&b)return m.jsxs(Bt,{children:[m.jsx($,{analytics:x,onLoad:ie}),D.drawerElement,m.jsx(Rt,{children:m.jsx(Se,{children:m.jsx(N,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:Qe,onCompleteClick:()=>{f.userRoleId!=null&&s(q(f.userRoleId))}})})})]});const _e=m.jsxs(m.Fragment,{children:[S&&!v?m.jsx($,{analytics:x,onLoad:ie}):null,m.jsx(N,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,showHeader:!1,togglePageView:v?()=>c(!1):void 0,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})]});return m.jsxs(m.Fragment,{children:[m.jsxs(Ft,{children:[m.jsx($,{analytics:x,onLoad:i=>i.trackPageLoaded(Ke.Event.aiCFOPage)}),b&&D.drawerElement,m.jsx(Lt,{...je,currentChatSessionId:r,allSessionsWithOrderedQuestionAnswers:ne,allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,openOnboardingPage:()=>c(!0),userId:h.userId,setIsAiCfoOpen:o,navigate:p,sessionFromUrl:k,location:n,isSubmitting:Oe,isEmptyChatWithSession:Ae,currentTenant:f,emailLinkQuestion:ve??void 0,autoSubmitEmailLinkQuestion:Ee,onEmailLinkQuestionProcessed:xe,routedInitialQuestionSource:Pe,routedInitialQuestionSuggestionIndex:we,onCardPolicyVendorSearchTextChange:d,onMenuClick:b?D.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ke,onUploadPromoClose:Ce,exploreSuggestedPromptQuestions:be,exploreSuggestedPromptQuestionsLoading:Ie,isSkillsOpen:C,isCreateSkillEnabled:g,promoDismissalScope:K}),S&&b?m.jsx(Qt,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:Vt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>c(!1),children:m.jsx(Se,{onClick:i=>i.stopPropagation(),children:m.jsx(N,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})})}):null]}),S&&!b?m.jsx(ze,{open:S,onClose:()=>c(!1),children:m.jsx(We,{children:_e})}):null]})},Se=y(jt)`
|
|
1
|
+
import{j as m}from"./liveblocks-BD1fi6wA.js";import{a as l}from"./sentry-C6D8WJ15.js";import{u as Ue,h as Le,g as Fe,j as _,i as Be,l as Re}from"./core-Dlma5MIa.js";import{a as Ve,e2 as Me,z as $e,$ as Ge,e3 as qe,e4 as Ne,bm as le,e5 as he,e6 as He,bl as ge,a2 as H,a6 as $,l as w,e7 as G,e8 as ze,e9 as We,as as Ye,S as Je,w as Ke,ea as Xe,eb as Ze,at as et,ec as tt,ed as st,ee as at,ef as ot,p as nt,bi as re,eg as it}from"./index-Blw4A66-.js";import{fA as z,gp as E,gx as W,Ta as lt,gr as Y,gH as rt,fB as dt,j0 as ct,a14 as ut,g4 as mt,je as pt,ja as St,fC as q,gb as ht,a15 as gt,a16 as ft,a17 as Ct,jx as N,gq as kt,gk as de,jK as ce,gm as ue,gs as It,a18 as me,jz as bt,j7 as vt,jl as Et,jv as pe,ji as Pt,jo as xt,gt as wt,gu as yt,gv as Tt,gw as At}from"./zeni-epic-state-2zvjmkUL.js";import{D as Qt,n as y,S as jt,P as Ot}from"./mui-DPmPgDDD.js";import{u as _t}from"./useAiCfoDashboardSuggestedQuestionsChips-Cox0FTmj.js";import{p as Dt}from"./pathToGoBack-C5NlBrdk.js";import"./recharts-WuCIKI4c.js";import"./analytics-NBT5BH2R.js";import"./plaid-w5kSeMkL.js";import"./dnd-BgBEAfSC.js";import"./stripe-cKAAJElX.js";import"./lottie-Dd5kLrRz.js";import"./lexical-Cc-23sPJ.js";import"./pdf-BCsxh4ki.js";import"./utils-Bv9LDtmr.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="af2ca7a3-7226-4165-81e6-b5278750ab27",e._sentryDebugIdIdentifier="sentry-dbid-af2ca7a3-7226-4165-81e6-b5278750ab27")}catch{}})();const fe="chat-response-generated";function Ut(e,o){if(o.kind!=="save")return;if(o.fetchState==="In-Progress")return{status:"saving"};if(o.fetchState==="Error")return{status:"failed"};if(o.fetchState!=="Completed")return;const s=E(e).skills.find((p=>p.macroId===o.savedMacroId));return s==null?void 0:{status:"saved",command:s.name}}const Lt=Re((function(e,o){const s=z(e),p=o.isSubmitting,n=s.uiState?.currentChatSessionId,S=n!=null?ht(e.aiCfoState,n):[],c=Ze(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange}),C=gt(e),g=ft(e),P=Ct(e);return{showSampleQuestions:o.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:p,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${et}/tableDownload`,exportDownloadEndPoint:at(),emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,skills:E(e).skills,skillSaveState:Ut(e,P),skillsEnabled:E(e).skillsEnabled,skillsList:E(e).skills,skillsListError:E(e).fetchState==="Error",skillsListLoading:E(e).fetchState==="In-Progress",skillsCanPublish:E(e).canPublish,skillSaving:P.fetchState==="In-Progress",skillSaveError:P.fetchState==="Error",skillVersionHistory:C.macroId!=null?{macroId:C.macroId,versions:C.versions,error:C.fetchState==="Error",loading:C.fetchState==="In-Progress"}:void 0,skillRestoreBody:g.macroId!=null&&g.version!=null?{macroId:g.macroId,version:g.version,instructions:g.instructions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillDetail:N(e).detail,skillDetailError:N(e).fetchState==="Error",skillDetailLoading:N(e).fetchState==="In-Progress",syntheticAnswers:S,resolveSyntheticAnswerCardTile:st(e),resolveSyntheticAnswerPolicyTile:tt(e),...c}}),(function(e,o){const{location:s,currentTenant:p,userId:n,navigate:S,currentChatSessionId:c,allSessionsWithOrderedQuestionAnswers:C,isAiCardCreationEnabled:g,isCardPolicyEnabled:P,setIsAiCfoOpen:x}=o,T=p.tenantEmailDomain;return{onEventReceived:(t,a)=>{if(t===fe&&typeof a.text=="string"&&typeof a.metadata=="object"){const d=a,u=wt(d.type),h=d.metadata.chat_session_id??null,{currentChatSession:k,currentQuestionAnswer:A,currentQuestionAnswerSummary:b}=ge(C,h);u!=="answer"?w.trackAICFOChatResponseGenerated(u,A?.question.questionText??"",d.text,h,it(b,k),d.metadata.message_id??null):w.trackAICFOChatAnswerGenerated(d.text,A?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,yt(d.visualization?.type??"")??null,h,d.summarized_title,d.metadata.message_id??null),e(Tt({chatSessionId:d.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),e(At({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:n}))}},onSubmit:(t,a,d,u,h)=>{t&&re(e,t,a,c,C,n,u,d,void 0,h)},onFetchSkills:()=>{e(W())},onOpenSkill:t=>{e(Pt({macroId:t})),e(xt({macroId:t}))},onSaveSkill:(t,a)=>{e(pe({draft:t,macroId:a}))},onSaveSkillDraft:t=>{const a=t.displayName?.trim()??"",d=t.name?.trim()??"";e(pe({draft:{name:a.length>0?a:d,description:t.description?.trim()??null,instructions:t.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(t,a)=>{e(Et({macroId:t,version:a}))},onDeleteSkill:t=>{e(vt({macroId:t}))},onSetSkillVisibility:(t,a)=>{e(bt({macroId:t,visibility:a}))},onCloseSkillDetail:()=>{e(me())},onRunSkill:(t,a)=>{e(Y()),e(de()),re(e,a,"user_input",void 0,C,n,void 0,void 0,void 0,t),e(me())},updateCurrentInput:t=>{e(ue(t))},onStopSubmit:()=>{},onUpdateScrollYOffset:t=>{e(It(t))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??Dt(1);S(a,{state:{...s.state,pathnameStackToGoBack:t.newStack}}),e(ue(""))},togglePageView:()=>{const t=H(s.state?.pathnameStackToGoBack),a=t.poppedPathname??`/${p.tenantEmailDomain}/dashboard`;S(a,{state:{...he(s.state),pathnameStackToGoBack:t.newStack,message:"open_ai_cfo_drawer"}}),x(!0)},onCopy:()=>{},onThumbsUp:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"positive",a.questionText,a.answerText))},onThumbsDown:(t,a)=>{c!=null&&a?.messageId!=null&&e(ce(c,a.messageId,"negative",a.questionText,a.answerText))},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{e(Y()),c!=null&&e(de());const t=nt(s.state?.pathnameStackToGoBack,s.pathname);S(`/${p.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:t.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(t,a)=>{e(kt({questionAnswerId:t,isCollapsed:a}))},onMenuClick:o.onMenuClick,...ot(e,{isAiCardCreationEnabled:g,isCardPolicyEnabled:P,currentChatSessionId:c,onAfterCardsCreationSubmit:()=>{x(!0),S(`/${T}/cards`,{state:{...s.state}})},onAfterCardPolicySubmit:()=>{x(!0),S(`/${T}/cards/policy`,{state:{...s.state}})}})}}))(Ke(Xe)),os=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Ve(),s=Ue(),p=Le(),n=Fe(),[S,c]=l.useState(!1),C=_((i=>z(i).uiState.isSkillsBrowserOpen===!0)),g=_((i=>E(i).skillsEnabled)),P=l.useCallback((()=>{s(W()),s(lt())}),[s]),x=l.useCallback((()=>{s(Y())}),[s]);l.useEffect((()=>{s(W())}),[s]);const{allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,onCardPolicyVendorSearchTextChange:d}=Me();l.useEffect((()=>{s(rt())}),[s]);const u=_((i=>z(i))),h=$e.getSignedInUser(),{session_id:k}=Be(),A=Ge(),b=Ye(A),f=_((i=>dt(i))),r=u.uiState.currentChatSessionId,J=f.tenantEmailDomain,{handleUploadPromoClose:Ce,isUploadPromoVisible:ke}=qe({isFileUploadEnabled:e,tenantEmailDomain:J}),D=Ne({currentTenant:f,currentChatSessionId:r,aiCfoView:u,skillsEnabled:g,onCloseSkills:x,onOpenSkills:P}),{isSuggestedQuestionsLoading:Ie,suggestedPromptQuestions:be}=_t(),Q=n.state,j=Q?.aiCfoInitialQuestion,K=!!Q?.aiCfoShouldSubmit;l.useEffect((()=>{const i=n.state;if(i?.[le]!==!0)return;c(!0);const I={...i};delete I[le],p(n,{replace:!0,state:I})}),[n.pathname,n.search,n.state,p]);const[ve,U]=l.useState(null),[Ee,L]=l.useState(!1),[Pe,F]=l.useState(void 0),[xe,B]=l.useState(void 0),X=l.useRef(!1);l.useEffect((()=>{if(!X.current&&j!=null&&j!==""){const i=n.state;U(j),L(K),F(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const I=i?.aiCfoSuggestionIndex;B(typeof I=="number"?I:void 0),X.current=!0}}),[j,K,n.state]);const we=l.useCallback((()=>{U(null),L(!1),F(void 0),B(void 0),p(n.pathname,{replace:!0,state:he(n.state)})}),[n.pathname,n.state,p]),Z=l.useMemo((()=>new URLSearchParams(n.search)),[n.search]),ee=Z.get("ref")??Q?.aiCfoRef,R=Z.get("emailRefId")??Q?.aiCfoEmailRefId,te=l.useRef(!1);l.useEffect((()=>{te.current||ee!=="month-end-email"||R==null||r!=null||h==null||(s(ct("controller",h.userId,R,"MONTH_END_EMAIL")),te.current=!0)}),[ee,R,r,s,h]);const O=u.uiState.lastContextMessage;l.useEffect((()=>{O!=null&&O!==""&&r!=null&&(U(O),L(!0),F(void 0),B(void 0),s(ut()))}),[O,r,s]);const ye=f.masterTOSInfo,v=ye?.isMasterTOSAccepted??!1,{visitedSessions:se}=He(r),V=u.fetchState,M=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,ae=r!=null?u.fetchChatSessionHistoryByChatSessionId?.[r]?.fetchState??"Not-Started":"Not-Started",oe=r==null||(u.uiState.chatHistoryNextPageToken[r]?.hasMore??!0),ne=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Te}=ge(ne,r),Ae=Te.length===0;l.useEffect((()=>{v||b||p("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})}),[v,b,p,n.state]);const Qe=l.useCallback((()=>{const i=H(n.state?.pathnameStackToGoBack),I=f.tenantEmailDomain;p(i.poppedPathname??(I!=null?`/${I}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})}),[f.tenantEmailDomain,n.state,p]);l.useEffect((()=>{r!=null&&k!==r&&p(`../ai-cfo/${r}`,{state:{...n.state}})}),[r,k]),l.useEffect((()=>{k!=null&&r==null&&k!=="new_chat"&&k!=="explore"&&s(mt({sessionId:k,agentId:"controller"}))}),[]);const je=l.useMemo((()=>({events:se.map((i=>`private-encrypted-chat-${i}.${fe}`)),eventCallback:(i,I,De)=>De.onEventReceived(i,I)})),[se]);l.useEffect((()=>{V!=="In-Progress"&&M&&s(pt())}),[V,M,s]),l.useEffect((()=>{r!=null&&ae!=="In-Progress"&&oe&&h!=null&&V==="Completed"&&!M&&s(St(r,h.userId))}),[ae,oe,r,h,s]);const ie=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(h==null||k==null)throw Error("Can't access AI Controller page without signing in...");const Oe=r!=null&&u.responseStateByChatSessionId?.[r]?.answer?.fetchState==="In-Progress";if(!v&&b)return m.jsxs(Bt,{children:[m.jsx($,{analytics:w,onLoad:ie}),D.drawerElement,m.jsx(Rt,{children:m.jsx(Se,{children:m.jsx(G,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:Qe,onCompleteClick:()=>{f.userRoleId!=null&&s(q(f.userRoleId))}})})})]});const _e=m.jsxs(m.Fragment,{children:[S&&!v?m.jsx($,{analytics:w,onLoad:ie}):null,m.jsx(G,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,showHeader:!1,togglePageView:v?()=>c(!1):void 0,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})]});return m.jsxs(m.Fragment,{children:[m.jsxs(Ft,{children:[m.jsx($,{analytics:w,onLoad:i=>i.trackPageLoaded(Je.Event.aiCFOPage)}),b&&D.drawerElement,m.jsx(Lt,{...je,currentChatSessionId:r,allSessionsWithOrderedQuestionAnswers:ne,allUsers:T,isAiCardCreationEnabled:t,isCardPolicyEnabled:a,openOnboardingPage:()=>c(!0),userId:h.userId,setIsAiCfoOpen:o,navigate:p,sessionFromUrl:k,location:n,isSubmitting:Oe,isEmptyChatWithSession:Ae,currentTenant:f,emailLinkQuestion:ve??void 0,autoSubmitEmailLinkQuestion:Ee,onEmailLinkQuestionProcessed:we,routedInitialQuestionSource:Pe,routedInitialQuestionSuggestionIndex:xe,onCardPolicyVendorSearchTextChange:d,onMenuClick:b?D.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ke,onUploadPromoClose:Ce,exploreSuggestedPromptQuestions:be,exploreSuggestedPromptQuestionsLoading:Ie,isSkillsOpen:C,isCreateSkillEnabled:g,promoDismissalScope:J}),S&&b?m.jsx(Qt,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:Vt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>c(!1),children:m.jsx(Se,{onClick:i=>i.stopPropagation(),children:m.jsx(G,{isTOSAccepted:v,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:()=>c(!1),onCompleteClick:()=>{v||f.userRoleId==null||s(q(f.userRoleId)),c(!1)}})})}):null]}),S&&!b?m.jsx(ze,{open:S,onClose:()=>c(!1),children:m.jsx(We,{children:_e})}):null]})},Se=y(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-BkTNzfNi.js";import{a as n,R as ba}from"./sentry-CNLjKkQW.js";import{u as Ae,j as r,g as Sa,h as ka,q as j}from"./core-DuNHGHBC.js";import{fB as _e,Tc as Ea,Td as De,g5 as wa,gr as K,gx as ke,Te as Ta,Tf as ya,gL as va,pX as Ia,Tg as Ba,Th as Ee,gi as $a,Ti as I,fA as xa,gp as Aa,Tj as _a,Tk as we,Tl as Da,Tm as Te,Tn as Fa,Dr as Ma,gj as Za,g_ as Ga,cS as ja,To as Ha,Tp as La,qy as Va,g4 as Na,j3 as Pa,Tq as Ra,vR as Oa,gk as Ua}from"./zeni-epic-state-IKQP0lNP.js";import{w as za,i as qa,a as Ya,U as Ka,E as Wa,O as Xa,y as C,c as Ja,u as Qa,d as et,n as at,e as tt,f as nt,g as ot,z as st,h as H,p as g,m as ye,j as rt,K as it,k as ve,l as lt,Y as Ie,o as dt,q as ct,r as W,s as Be,v as ut,x as Ct,A as mt,L as pt,B as ht,C as ft,D as X,F as gt,Z as bt}from"./index-CxkwDRG8.js";import{A as St,b as kt,I as Et,a as $e,d as wt,D as xe}from"./mui-DaLeH41l.js";import{u as Tt}from"./InboxNotificationsProvider-DBc6Mphu.js";import{u as yt}from"./useTaskManagerAccess-CgZlooKP.js";import{u as vt}from"./expenseAutomationHelper-DGi7tuOw.js";import"./recharts-CkuQpH_L.js";import"./analytics-DHBkdK00.js";import"./plaid-BVNoSR_u.js";import"./dnd-DKR3QBLX.js";import"./stripe-cKAAJElX.js";import"./lottie-DACJJNY9.js";import"./lexical-CcqvVKiN.js";import"./pdf-BjtwR-dW.js";import"./utils-BN2UhEgk.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},m=new a.Error().stack;m&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[m]="3cb892f2-d034-4a79-aa0f-2e795650f2d7",a._sentryDebugIdIdentifier="sentry-dbid-3cb892f2-d034-4a79-aa0f-2e795650f2d7")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},It=X("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:W,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"}}))),Bt=za((function({tenantEmailDomain:a}){const{isAiCfoOpen:m,setIsAiCfoOpen:b}=Ya(),[L,A]=ba.useState(!1),[S,Fe]=n.useState(!1),t=Sa(),i=ka(),J=wa(),Q=Ka(),o=Ae(),[Me,Ze]=n.useState(!1),V=Wa(),ee=t.pathname.includes("/ai-cfo/");n.useEffect((()=>{ee||o(K())}),[o,ee]),n.useEffect((()=>{o(K())}),[o,a]);const{useFeatureGate:u}=Xa(),{isFeatureEnabled:ae}=u(C.isDebitCardFeatureEnabled),k=Ja(),s=r((e=>_e(e))),te=s.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ge}=Qa(),$=et(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=yt(k),ne=at(),E=tt();n.useEffect((()=>{E&&$&&o(ke())}),[o,E,s.tenantId,$]);const[N,He]=n.useState(void 0),Le=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Ve}=u(C.isChargeCardFeatureEnabled),Ne=nt(s,Ve,ae),{isFeatureEnabled:Pe}=u(C.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(C.isReferralFeatureEnabled),Re=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",oe=r((e=>Ta(e)));n.useEffect((()=>{const e=()=>{Ze(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>ya(e))),p=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),h=r((e=>va(e))),{monthEndCloseChecksView:w}=h,Oe=j("/signout")!==null,F=j("/:tenantEmailDomain/dashboard")!==null,se=j("/:tenantEmailDomain/reports")!==null,f=j("/:tenantEmailDomain/onboarding/*")!==null,re=vt();n.useEffect((()=>{E&&D&&!f&&P.fetchState==="Not-Started"&&o(Ia(!0))}),[E,D,P.fetchState,f]),n.useEffect((()=>{if(re){const e=t.state?.origin;if(e!=null){const d=Ba(e);d!=null&&o(Ee(d))}}}),[re,t.state]);const Ue=Oe||f,R=r((e=>e.tenantState)),ze=r((e=>R.fetchState==="Completed"?$a(e):[])),{isFeatureEnabled:qe}=u(C.isApAgingFeatureEnabled),{isFeatureEnabled:Ye}=u(C.isArAgingFeatureEnabled),{isFeatureEnabled:Ke}=u(C.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:We}=u(C.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Xe}=u(C.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Je}=u(C.isDashboardSidebarNewYearAnimationEnabled),Qe=r((e=>I(e).totalUnreadCount)),ea=r((e=>I(e).notificationDetailsByTab.tasks.uiState.unreadCount)),aa=r((e=>I(e).notificationDetailsByTab.comments.uiState.unreadCount)),ta=r((e=>I(e).reducedFetchCountState)),ie=r((e=>I(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>xa(e))),na=r((e=>Aa(e).skillsEnabled)),{status:le}=r(_a),[T,U]=n.useState(void 0),z=O.uiState.currentChatSessionId,M=T!=null?O.deleteChatSessionStateByChatSessionId[T]?.fetchState:void 0,de=ot(M),{inboxNotifications:q,isLoading:ce,isFetchingMore:ue,hasFetchedAll:Ce,fetchMore:oa}=Tt(),Z=r((e=>I(e).notificationDetailsByTab.comments.fetchCountState));n.useEffect((()=>{const e=setTimeout((()=>oa?.()),0);return()=>clearTimeout(e)})),n.useEffect((()=>{if(T!=null)return de==="In-Progress"&&M==="Completed"?(o(we({chatSessionId:T})),U(void 0),void i(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(M==="Error"&&(o(we({chatSessionId:T})),U(void 0)))}),[o,t.state,i,M,T,de,a]),n.useEffect((()=>{if(ce===!1&&ue===!1&&Ce===!0&&s?.companyId!=null&&q!=null){const e=`dashboard_${s.companyId}`;He(q.filter((d=>d.roomId===e&&d.readAt==null)).length)}}),[ce,ue,Ce,s?.companyId,q]),n.useEffect((()=>{E&&_&&!f&&ie.fetchState==="Not-Started"&&J.tenantId!=null&&o(Da("task_manager","dashboard"))}),[E,_,f,ie.fetchState,J.tenantId,o]),n.useEffect((()=>{f||Z.fetchState!=="Not-Started"||o(Te({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,Z.fetchState,o]),n.useEffect((()=>{if(N!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&o(Te({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(De({unreadCount:N},"comments")))}}),[N,Z.fetchState]);const sa={fetchStatus:ta,count:Qe},y=[];qe===!1&&y.push("accounts_payable_aging"),Ye===!1&&y.push("accounts_receivable_aging"),y.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&y.push("rewards_card"),ne===!1&&y.push("expense_automation_card");const me=r((e=>Fa(e,y).fetchState)),pe=r((e=>Ma(e).fetchState)),he=a!=null?st.getSignedInUserTenant(a):null,fe=r((e=>he?.tenantId!=null?Za(e,he.tenantId):void 0)),ra=F&&(me==="Completed"||me==="Error")||se&&(pe==="Completed"||pe==="Error")||!F&&!se?void 0:"disabled",ia=n.useMemo((()=>Ga(s.userRole)),[s.userRole]),la=ja(ia),v=e=>{A(e)},da=Re,ca=s?.rewardsLastViewedTime==null,ua=k?.userEmail!=null&&oe.fetchState==="Completed"&&Ha(oe.notificationSettings,k.userEmail,ae,s,_),Ca=n.useCallback((e=>{const d=t.state?.referrer;if(w.monthEndCloseChecks?.auditSummary!=null&&H.trackMonthCloseAuditPage(e.month,e.year,w.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",w.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null),o(La(s.tenantId,e)),p[s.tenantId]!=null){const x=g(t.state?.pathnameStackToGoBack,t.pathname);i(`/${a}/month_end_close_checks/review/${h.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:h.currentSelectedView}})}o(Ee(h.currentSelectedView)),h.reconciliation.selectedAccountId!=null&&o(Va({selectedAccountId:void 0}))}),[h.reconciliation.selectedAccountId,h.currentSelectedView,s.tenantId,w.monthEndCloseChecks?.auditSummary,w.monthEndCloseChecks?.reportEmailSentDate,p,a,t.state,t.pathname]),ma=n.useMemo((()=>({zIndex:S?12:ye[2]})),[S]),pa=$&&rt(t),ge=l.jsx(it,{signedInUser:k,currentTenantId:R.currentTenantId??"",tenants:R.fetchState==="Completed"?ze:fe!=null?[fe]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ca,rewardsPlan:P.rewardsPlan},selectedMenu:m===!0?Ie("ai_cfo"):ve(t)&&le!=="completed"?Ie("invoicing"):dt(t),isTenantDropdownDisabled:ra,isSettings:lt(t),isInvoicing:ve(t)&&le==="completed",isSettingsFeatureEnabled:Pe,currentTenant:s,isVendorsTabVisible:la,isZeniAccountEnabled:Le,isChargeCardEnabled:Ne,isTreasuryEnabled:da,isNotificationsTabVisible:ua,notificationCountDetails:sa,isExpenseAutomationEnabledForUser:ne,isAiCfoAccessEnabled:$,skillsEnabled:na&&$,onNotificationIconClick:()=>{v(!1);const e=je?ea===0&&aa>0?"notifications/comments":"notifications/tasks":"notifications/comments",d=g(t.state?.pathnameStackToGoBack,t.pathname);i(`${a}/${e}`,{state:{pathnameStackToGoBack:d}})},onZeniLogoClick:()=>{Q.toggle()},handleTenantSelect:e=>{Ge(pt.TENANT_SWITCHING),v(!1),ht({dispatch:o,navigate:i,pathToNavigate:ft(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,d)=>{if(k!=null&&H.trackSidePanelClicked(e.type,e.group),v(!1),a==null)return;if(e.type==="skills")return te?(o(ke()),o(Ra()),void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void Be({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});if(o(K()),e.type==="invoicing")return m&&b(!1),o(Oa({cacheOverride:!1})),void i(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(m&&ut(e.type)&&b(!1),e.type==="ai_cfo"){if(H.trackAICFOChatScreenStateChanged("viewed","left_menu",z??null,null),!te)return void Be({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});const G=g(t.state?.pathnameStackToGoBack,t.pathname);return void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const x=g(t.state?.pathnameStackToGoBack,t.pathname),Y=e.type,Se=bt(Y)&&Y!=="command_center";if(Y!=="command_center"&&!Se||p[s.tenantId]==null||H.trackMonthEndCloseClicked(p[s.tenantId].month,p[s.tenantId].year,"Sidebar"),Se&&p[s.tenantId]!=null){const G=p[s.tenantId];return void i(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})}const ga=Ct(e.type);mt(e.type)?(z!=null&&o(Ua()),i(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:d,referrer:"Sidebar"}})):i(`../${a}/${ga}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})},onDeleteChatSession:e=>{o(Pa(e)),z===e&&U(e)},handleLogOutClick:()=>{v(!1);const e=g(t.state?.pathnameStackToGoBack,t.pathname);i("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{i(`${a}/settings/my_profile`)},handleReferralsClick:()=>{i(`${a}/rewards/refer`)},handleBackClick:()=>{i(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:w,onPeriodChange:Ca,onCalendarOpen:Fe,aiCfoView:O,isAiCfo:pa,isOnDashboard:F,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{o(Na({sessionId:e,agentId:"controller"})),i(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Ke,thanksGivingAnimationEnabled:We,christmasAnimationEnabled:Xe,newYearAnimationEnabled:Je}),ha=l.jsx(St,{position:"fixed",className:c.appBar,style:{borderBottom:Me?`1px solid ${V.colors.grey2}`:""},children:l.jsxs(kt,{style:{minHeight:ct},children:[l.jsx(Et,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>v(!0),className:c.menuButton,size:"large",children:l.jsx($t,{})}),l.jsx(xt,{className:c.appBarZenilogo,onClick:()=>{Q.toggle()}})]})}),be=$e((e=>e.breakpoints.up("md"))),fa=$e((e=>e.breakpoints.down("md")));return a==null?null:l.jsxs(It,{className:c.root,children:[l.jsx(wt,{}),Ue===!1?l.jsxs(l.Fragment,{children:[be||!F?null:ha,l.jsxs("nav",{className:c.drawer,children:[be?null:l.jsx(xe,{container:window.document.body,variant:"temporary",open:L,onClose:()=>v(!1),PaperProps:{sx:{width:W,zIndex:ye[2],borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background}},ModalProps:{keepMounted:!0},children:ge}),fa?null:l.jsx(xe,{PaperProps:{sx:{width:W,borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background,...ma}},variant:"permanent",open:!0,children:ge})]})]}):null]})})),Yt=({tenantEmailDomain:a})=>{const m=Ae(),b=r((A=>_e(A))),L={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{qa(S)&&Ea(S.mode)==="dashboard"&&m(De({unreadCount:S.data.unread},"tasks"))}};return l.jsx(Bt,{tenantEmailDomain:a,...L})},$t=X((a=>n.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
1
|
+
import{j as l}from"./liveblocks-BD1fi6wA.js";import{a as n,R as ba}from"./sentry-C6D8WJ15.js";import{u as Ae,j as r,g as Sa,h as ka,q as H}from"./core-Dlma5MIa.js";import{fB as _e,SY as Ea,SZ as De,g5 as wa,gr as J,gx as ke,S_ as ya,S$ as Ia,gL as Ta,pF as va,T0 as $a,T1 as Ee,gi as Ba,T2 as v,fA as xa,gp as Aa,T3 as _a,T4 as we,T5 as Da,T6 as ye,T7 as Fa,Db as Ma,gj as Za,g_ as Ga,cS as Ha,T8 as ja,T9 as La,qh as Va,g4 as Na,j3 as Pa,Ta as Ra,vA as Oa,gk as Ua}from"./zeni-epic-state-2zvjmkUL.js";import{w as za,i as Ya,a as qa,c as Ja,E as Ka,I as Wa,d as C,e as Qa,u as Xa,f as et,g as at,h as tt,j as nt,k as ot,z as st,l as j,p as g,m as Ie,n as rt,o as it,q as Te,r as lt,s as ve,v as dt,x as ct,y as K,A as $e,B as ut,C as Ct,D as mt,L as pt,F as ht,H as ft,J as W,K as gt,M as bt}from"./index-Blw4A66-.js";import{A as St,b as kt,I as Et,a as Be,d as wt,D as xe}from"./mui-DPmPgDDD.js";import{u as yt}from"./InboxNotificationsProvider-7eYmgI1F.js";import{u as It}from"./useTaskManagerAccess-BKVtGCGL.js";import{u as Tt}from"./expenseAutomationHelper-BpaM_jjL.js";import"./recharts-WuCIKI4c.js";import"./analytics-NBT5BH2R.js";import"./plaid-w5kSeMkL.js";import"./dnd-BgBEAfSC.js";import"./stripe-cKAAJElX.js";import"./lottie-Dd5kLrRz.js";import"./lexical-Cc-23sPJ.js";import"./pdf-BCsxh4ki.js";import"./utils-Bv9LDtmr.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},m=new a.Error().stack;m&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[m]="7a074ee7-2f69-4027-8fb3-69604af5ee6e",a._sentryDebugIdIdentifier="sentry-dbid-7a074ee7-2f69-4027-8fb3-69604af5ee6e")}catch{}})();const $="AppDrawer",c={root:`${$}-root`,drawer:`${$}-drawer`,appBar:`${$}-appBar`,menuButton:`${$}-menuButton`,appBarZenilogo:`${$}-appBarZenilogo`,drawerZenilogo:`${$}-drawerZenilogo`},vt=W("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:K,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),$t=za((function({tenantEmailDomain:a}){const{isAiCfoOpen:m,setIsAiCfoOpen:b}=qa(),[L,A]=ba.useState(!1),[S,Fe]=n.useState(!1),t=Sa(),i=ka(),Q=wa(),X=Ja(),o=Ae(),[Me,Ze]=n.useState(!1),V=Ka(),ee=t.pathname.includes("/ai-cfo/");n.useEffect((()=>{ee||o(J())}),[o,ee]),n.useEffect((()=>{o(J())}),[o,a]);const{useFeatureGate:u}=Wa(),{isFeatureEnabled:ae}=u(C.isDebitCardFeatureEnabled),k=Qa(),s=r((e=>_e(e))),te=s.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ge}=Xa(),B=et(),{isTaskManagerAccessEnabled:_,isZeniUser:He}=It(k),ne=at(),E=tt();n.useEffect((()=>{E&&B&&o(ke())}),[o,E,s.tenantId,B]);const[N,je]=n.useState(void 0),Le=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Ve}=u(C.isChargeCardFeatureEnabled),Ne=nt(s,Ve,ae),{isFeatureEnabled:Pe}=u(C.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(C.isReferralFeatureEnabled),Re=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",oe=r((e=>ya(e)));n.useEffect((()=>{const e=()=>{Ze(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>Ia(e))),p=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),h=r((e=>Ta(e))),{monthEndCloseChecksView:w}=h,Oe=H("/signout")!==null,F=H("/:tenantEmailDomain/dashboard")!==null,se=H("/:tenantEmailDomain/reports")!==null,f=H("/:tenantEmailDomain/onboarding/*")!==null,re=Tt();n.useEffect((()=>{E&&D&&!f&&P.fetchState==="Not-Started"&&o(va(!0))}),[E,D,P.fetchState,f]),n.useEffect((()=>{if(re){const e=t.state?.origin;if(e!=null){const d=$a(e);d!=null&&o(Ee(d))}}}),[re,t.state]);const Ue=Oe||f,R=r((e=>e.tenantState)),ze=r((e=>R.fetchState==="Completed"?Ba(e):[])),{isFeatureEnabled:Ye}=u(C.isApAgingFeatureEnabled),{isFeatureEnabled:qe}=u(C.isArAgingFeatureEnabled),{isFeatureEnabled:Je}=u(C.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ke}=u(C.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:We}=u(C.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Qe}=u(C.isDashboardSidebarNewYearAnimationEnabled),Xe=r((e=>v(e).totalUnreadCount)),ea=r((e=>v(e).notificationDetailsByTab.tasks.uiState.unreadCount)),aa=r((e=>v(e).notificationDetailsByTab.comments.uiState.unreadCount)),ta=r((e=>v(e).reducedFetchCountState)),ie=r((e=>v(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>xa(e))),na=r((e=>Aa(e).skillsEnabled)),{status:le}=r(_a),[y,U]=n.useState(void 0),z=O.uiState.currentChatSessionId,M=y!=null?O.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,de=ot(M),{inboxNotifications:Y,isLoading:ce,isFetchingMore:ue,hasFetchedAll:Ce,fetchMore:oa}=yt(),Z=r((e=>v(e).notificationDetailsByTab.comments.fetchCountState));n.useEffect((()=>{const e=setTimeout((()=>oa?.()),0);return()=>clearTimeout(e)})),n.useEffect((()=>{if(y!=null)return de==="In-Progress"&&M==="Completed"?(o(we({chatSessionId:y})),U(void 0),void i(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(M==="Error"&&(o(we({chatSessionId:y})),U(void 0)))}),[o,t.state,i,M,y,de,a]),n.useEffect((()=>{if(ce===!1&&ue===!1&&Ce===!0&&s?.companyId!=null&&Y!=null){const e=`dashboard_${s.companyId}`;je(Y.filter((d=>d.roomId===e&&d.readAt==null)).length)}}),[ce,ue,Ce,s?.companyId,Y]),n.useEffect((()=>{E&&_&&!f&&ie.fetchState==="Not-Started"&&Q.tenantId!=null&&o(Da("task_manager","dashboard"))}),[E,_,f,ie.fetchState,Q.tenantId,o]),n.useEffect((()=>{f||Z.fetchState!=="Not-Started"||o(ye({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,Z.fetchState,o]),n.useEffect((()=>{if(N!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&o(ye({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(De({unreadCount:N},"comments")))}}),[N,Z.fetchState]);const sa={fetchStatus:ta,count:Xe},I=[];Ye===!1&&I.push("accounts_payable_aging"),qe===!1&&I.push("accounts_receivable_aging"),I.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&I.push("rewards_card"),ne===!1&&I.push("expense_automation_card");const me=r((e=>Fa(e,I).fetchState)),pe=r((e=>Ma(e).fetchState)),he=a!=null?st.getSignedInUserTenant(a):null,fe=r((e=>he?.tenantId!=null?Za(e,he.tenantId):void 0)),ra=F&&(me==="Completed"||me==="Error")||se&&(pe==="Completed"||pe==="Error")||!F&&!se?void 0:"disabled",ia=n.useMemo((()=>Ga(s.userRole)),[s.userRole]),la=Ha(ia),T=e=>{A(e)},da=Re,ca=s?.rewardsLastViewedTime==null,ua=k?.userEmail!=null&&oe.fetchState==="Completed"&&ja(oe.notificationSettings,k.userEmail,ae,s,_),Ca=n.useCallback((e=>{const d=t.state?.referrer;if(w.monthEndCloseChecks?.auditSummary!=null&&j.trackMonthCloseAuditPage(e.month,e.year,w.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",w.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null),o(La(s.tenantId,e)),p[s.tenantId]!=null){const x=g(t.state?.pathnameStackToGoBack,t.pathname);i(`/${a}/month_end_close_checks/review/${h.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:h.currentSelectedView}})}o(Ee(h.currentSelectedView)),h.reconciliation.selectedAccountId!=null&&o(Va({selectedAccountId:void 0}))}),[h.reconciliation.selectedAccountId,h.currentSelectedView,s.tenantId,w.monthEndCloseChecks?.auditSummary,w.monthEndCloseChecks?.reportEmailSentDate,p,a,t.state,t.pathname]),ma=n.useMemo((()=>({zIndex:S?12:Ie[2]})),[S]),pa=B&&rt(t),ge=l.jsx(it,{signedInUser:k,currentTenantId:R.currentTenantId??"",tenants:R.fetchState==="Completed"?ze:fe!=null?[fe]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ca,rewardsPlan:P.rewardsPlan},selectedMenu:m===!0?ve("ai_cfo"):Te(t)&&le!=="completed"?ve("invoicing"):dt(t),isTenantDropdownDisabled:ra,isSettings:lt(t),isInvoicing:Te(t)&&le==="completed",isSettingsFeatureEnabled:Pe,currentTenant:s,isVendorsTabVisible:la,isZeniAccountEnabled:Le,isChargeCardEnabled:Ne,isTreasuryEnabled:da,isNotificationsTabVisible:ua,notificationCountDetails:sa,isExpenseAutomationEnabledForUser:ne,isAiCfoAccessEnabled:B,skillsEnabled:na&&B,onNotificationIconClick:()=>{T(!1);const e=He?ea===0&&aa>0?"notifications/comments":"notifications/tasks":"notifications/comments",d=g(t.state?.pathnameStackToGoBack,t.pathname);i(`${a}/${e}`,{state:{pathnameStackToGoBack:d}})},onZeniLogoClick:()=>{X.toggle()},handleTenantSelect:e=>{Ge(pt.TENANT_SWITCHING),T(!1),ht({dispatch:o,navigate:i,pathToNavigate:ft(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,d)=>{if(k!=null&&j.trackSidePanelClicked(e.type,e.group),T(!1),a==null)return;if(e.type==="skills")return te?(o(ke()),o(Ra()),void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void $e({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});if(o(J()),e.type==="invoicing")return m&&b(!1),o(Oa({cacheOverride:!1})),void i(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:g(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(m&&ut(e.type)&&b(!1),e.type==="ai_cfo"){if(j.trackAICFOChatScreenStateChanged("viewed","left_menu",z??null,null),!te)return void $e({location:t,navigate:i,mergeState:{referrer:"Sidebar"}});const G=g(t.state?.pathnameStackToGoBack,t.pathname);return void i(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const x=g(t.state?.pathnameStackToGoBack,t.pathname),q=e.type,Se=bt(q)&&q!=="command_center";if(q!=="command_center"&&!Se||p[s.tenantId]==null||j.trackMonthEndCloseClicked(p[s.tenantId].month,p[s.tenantId].year,"Sidebar"),Se&&p[s.tenantId]!=null){const G=p[s.tenantId];return void i(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})}const ga=Ct(e.type);mt(e.type)?(z!=null&&o(Ua()),i(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:d,referrer:"Sidebar"}})):i(`../${a}/${ga}`,{state:{pathnameStackToGoBack:x,message:d,referrer:"Sidebar"}})},onDeleteChatSession:e=>{o(Pa(e)),z===e&&U(e)},handleLogOutClick:()=>{T(!1);const e=g(t.state?.pathnameStackToGoBack,t.pathname);i("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{i(`${a}/settings/my_profile`)},handleReferralsClick:()=>{i(`${a}/rewards/refer`)},handleBackClick:()=>{i(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:w,onPeriodChange:Ca,onCalendarOpen:Fe,aiCfoView:O,isAiCfo:pa,isOnDashboard:F,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{o(Na({sessionId:e,agentId:"controller"})),i(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Je,thanksGivingAnimationEnabled:Ke,christmasAnimationEnabled:We,newYearAnimationEnabled:Qe}),ha=l.jsx(St,{position:"fixed",className:c.appBar,style:{borderBottom:Me?`1px solid ${V.colors.grey2}`:""},children:l.jsxs(kt,{style:{minHeight:ct},children:[l.jsx(Et,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>T(!0),className:c.menuButton,size:"large",children:l.jsx(Bt,{})}),l.jsx(xt,{className:c.appBarZenilogo,onClick:()=>{X.toggle()}})]})}),be=Be((e=>e.breakpoints.up("md"))),fa=Be((e=>e.breakpoints.down("md")));return a==null?null:l.jsxs(vt,{className:c.root,children:[l.jsx(wt,{}),Ue===!1?l.jsxs(l.Fragment,{children:[be||!F?null:ha,l.jsxs("nav",{className:c.drawer,children:[be?null:l.jsx(xe,{container:window.document.body,variant:"temporary",open:L,onClose:()=>T(!1),PaperProps:{sx:{width:K,zIndex:Ie[2],borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background}},ModalProps:{keepMounted:!0},children:ge}),fa?null:l.jsx(xe,{PaperProps:{sx:{width:K,borderRight:"none",backgroundImage:"none",backgroundColor:V.colors.background,...ma}},variant:"permanent",open:!0,children:ge})]})]}):null]})})),qt=({tenantEmailDomain:a})=>{const m=Ae(),b=r((A=>_e(A))),L={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{Ya(S)&&Ea(S.mode)==="dashboard"&&m(De({unreadCount:S.data.unread},"tasks"))}};return l.jsx($t,{tenantEmailDomain:a,...L})},Bt=W((a=>n.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
2
2
|
height: 20px;
|
|
3
3
|
width: 20px;
|
|
4
4
|
color: ${a=>a.theme.colors.primary};
|
|
5
|
-
`,xt=
|
|
5
|
+
`,xt=W((a=>n.createElement("svg",{viewBox:"0 0 102 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},n.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"}),n.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"}),n.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"}),n.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"}),n.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"}),n.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"}),n.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
6
|
height: ${gt.sp4};
|
|
7
7
|
width: 102px;
|
|
8
8
|
color: ${a=>a.theme.colors.primary};
|
|
9
9
|
cursor: pointer;
|
|
10
|
-
`;export{
|
|
10
|
+
`;export{qt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-BkTNzfNi.js";import{a as d}from"./sentry-CNLjKkQW.js";import{h as U,g as B,u as j,j as y,N as G,l as V,i as W,n as te,o as x}from"./core-DuNHGHBC.js";import{fB as P,Y8 as w,XR as R,G_ as E,GS as q,GW as A,GL as X,XT as H,GP as ae,H0 as oe,GO as K,H3 as Y,G$ as C}from"./zeni-epic-state-IKQP0lNP.js";import{z as O,w as z,bW as pe,l as T,bQ as Q,bX as le,E as Z,a5 as J,bY as se,bZ as ne}from"./index-CxkwDRG8.js";import"./mui-DaLeH41l.js";import{u as M,i as re}from"./ReimbursementApprovalRuleDetailScreen-XQSOHGYn.js";import ie from"./NotFoundScreen-DjDyDYWZ.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]="697c1fdc-974f-4812-8911-843842443d1d",e._sentryDebugIdIdentifier="sentry-dbid-697c1fdc-974f-4812-8911-843842443d1d")}catch{}})();const k="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(k)&&e(H(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(z(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,I)=>{r.endsWith(k)&&I.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(G,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(H(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(X(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(z(le)),ve=()=>{const e=y((o=>P(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=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));M();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const I={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,b,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(G,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...I})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),I=r.actors.selectedNonUsers.map((b=>{const m=!!re(b.value);return{type:m?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(I);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Y(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(K(!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(J,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const b=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";b.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),b},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const I=g?.selection.selectedOptions??[];if(I.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:I}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Y(!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}=Q(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(M(),d.useEffect((()=>{p||(f(!0),l(K(!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(J,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(F,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|
|
1
|
+
import{j as u}from"./liveblocks-BD1fi6wA.js";import{a as d}from"./sentry-C6D8WJ15.js";import{h as U,g as B,u as j,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-Dlma5MIa.js";import{fB as P,XU as w,XB as R,GK as E,GC as X,GG as A,Gv as q,XD as K,Gz as ae,GM as oe,Gy as z,GP as M,GL as C}from"./zeni-epic-state-2zvjmkUL.js";import{z as O,w as Q,bW as pe,r as T,bQ as Y,bX as le,E as Z,a5 as H,bY as se,bZ as ne}from"./index-Blw4A66-.js";import"./mui-DPmPgDDD.js";import{u as J,i as re}from"./ReimbursementApprovalRuleDetailScreen-kIivYyt0.js";import ie from"./NotFoundScreen-Wkt8x0Ja.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="99feed3c-5ccf-44f6-b701-2e81d682b5ef",e._sentryDebugIdIdentifier="sentry-dbid-99feed3c-5ccf-44f6-b701-2e81d682b5ef")}catch{}})();const _="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(Q(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(X(!0,!0,!1)))}),[a,p,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${_}`]:[],eventCallback:(r,h,b)=>{r.endsWith(_)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(Q(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Y(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));J();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(X(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,I,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(z(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(H,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((k=>({type:"attribute",subType:k.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((k=>({type:"user",userId:k.userId,isImplicitActor:!1}))));const G=m.action??"require_approval";I.push({action:G,actors:D,operator:D.length>1?G==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function $(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Y(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(J(),d.useEffect((()=>{p||(f(!0),l(z(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(H,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx($,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx($,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|