@zeniai/web-app-ui 5.1.61-dev → 5.1.62-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-DvuqFlm5.js +1 -0
- package/dist/assets/AddressScreen-D7DCNUGo.js +9 -0
- package/dist/assets/{AiCfoScreen-bE_YH6Fi.js → AiCfoScreen-Bv6DgXwH.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-BYeOa3fn.js → BillPayApprovalRoutes-DxIJLeU6.js} +1 -1
- package/dist/assets/{BillPayRoutes-Q37Bip2_.js → BillPayRoutes-CxAjptk9.js} +9 -9
- package/dist/assets/{BusinessVerificationPageScreen-DDNp0i_6.js → BusinessVerificationPageScreen-HLhTZBjl.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-BQXIEsXX.js +14 -0
- package/dist/assets/{ChargeCardRoutes-CYNI9iYT.js → ChargeCardRoutes-CF9hoDo5.js} +11 -11
- package/dist/assets/CompanyPassportScreen-Dd-P8T6z.js +1 -0
- package/dist/assets/ConnectionAuthScreen-BWQPD0qS.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BycVZ7K6.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-Cespkqcr.js → CustomerOnboardingRoutes-B4tFhrDj.js} +4 -4
- package/dist/assets/{DashboardRoutes-D42ZwOZ2.js → DashboardRoutes-uPgpLI1W.js} +3 -3
- package/dist/assets/{DefaultTenantHome-DjxQUC_9.js → DefaultTenantHome-Bhp_uriR.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-YZRErnfJ.js +18 -0
- package/dist/assets/DrawerScreen-BqYmVuny.js +1 -0
- package/dist/assets/EntityDetailRoutes-DbpAgwXS.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CrHU_K2U.js → ExpenseAutomationRoutes-ChVJkArc.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-kp5WtNsg.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-BAfTUuIq.js +1 -0
- package/dist/assets/MagicLinkRoutes-CGh8IMWW.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BFMyglUM.js +12 -0
- package/dist/assets/MobileAppDrawer-BuakBUGx.js +1 -0
- package/dist/assets/NotFoundScreen-AsC21qGx.js +1 -0
- package/dist/assets/NotificationRoutes-B06j6V42.js +1 -0
- package/dist/assets/{OAuthConsentScreen-oGOpIW2V.js → OAuthConsentScreen-B6euKfvQ.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-DfEV7guz.js +1 -0
- package/dist/assets/{PeopleRoutes-D_iNvraD.js → PeopleRoutes-qz_hXV4C.js} +4 -4
- package/dist/assets/{PerformanceRoutes-CNOho0fU.js → PerformanceRoutes-v5FcQW2N.js} +1 -1
- package/dist/assets/{Preview-DgYvT3D-.js → Preview-lrK4F27Y.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-o1myqUmo.js → QBOConnectionScreen-Cx74YOuE.js} +1 -1
- package/dist/assets/ReferralListScreen-G8WgDfU8.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-yvcY1FyR.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CwTYQVzk.js → ReimbursementApprovalRuleDetailScreen-s9Cc-PAW.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-C-egDkm9.js → ReimbursementRoutes-vHQ3hpWm.js} +11 -11
- package/dist/assets/{ReportsRoutes-CvVV3qr2.js → ReportsRoutes-DIUc8s5q.js} +1 -1
- package/dist/assets/RewardsRoutes-lnm6cAkX.js +1 -0
- package/dist/assets/ScreenRoutes-CAtz09zv.js +2 -0
- package/dist/assets/{SettingsRoutes-CDmDtEjA.js → SettingsRoutes-B4g8CJnG.js} +8 -8
- package/dist/assets/{SetupPagesScreen-Dh8Hk4GJ.js → SetupPagesScreen-BkPb95y9.js} +5 -5
- package/dist/assets/SignInScreen-Dhh5qz65.js +1 -0
- package/dist/assets/SignOutScreen-3sXSL_QM.js +9 -0
- package/dist/assets/TaskListScreen-DGOHeeuZ.js +9 -0
- package/dist/assets/TaskRoutes-CDomkVrp.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-B0zjqIdX.js → TransactionDetailRoutes-BXwhj2nX.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-CbYNGoLT.js → TransactionDetailScreen-DUZV5JDK.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BMhnQERQ.js → TransactionListRoutes-CDDcflri.js} +1 -1
- package/dist/assets/TreasuryRoutes-CZyF8G2k.js +37 -0
- package/dist/assets/{VendorsRoutes-C-7eDYZA.js → VendorsRoutes-B0mGOZoL.js} +23 -23
- package/dist/assets/WiseConfirmationScreen-B3-wTx7l.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-CYCO4Mlh.js → ZeniAccountRoutes-BeZsG6M5.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-CU5lpB3Y.js +9 -0
- package/dist/assets/{accountMappingHelper-BPz1owqi.js → accountMappingHelper-CSvCSQoY.js} +1 -1
- package/dist/assets/{analytics-C-A3qVJh.js → analytics-DCrhd8oB.js} +1 -1
- package/dist/assets/{analyticsHelper-CB3wiVZA.js → analyticsHelper-CQXeRvKo.js} +1 -1
- package/dist/assets/{core-SRRzy8qJ.js → core-DmAftQ4g.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Bz-26BXW.js → decodeURIComponentSafe-C70tsXnj.js} +1 -1
- package/dist/assets/{dnd-CR8sMRK3.js → dnd-3F1D24DQ.js} +1 -1
- package/dist/assets/{empty-BjaZv87n.js → empty-B3YzB_Zh.js} +1 -1
- package/dist/assets/{empty-Btqk4ZK3.js → empty-CDCfsLV4.js} +1 -1
- package/dist/assets/{emptyVideoElement-CcSCePHi.js → emptyVideoElement-CFNhZ55F.js} +1 -1
- package/dist/assets/epic-Bmb0p0Me.js +2 -0
- package/dist/assets/getLocaleForTenant-C55KVru2.js +1 -0
- package/dist/assets/{index-CejiZfG4.js → index-B2dyNLwa.js} +1 -1
- package/dist/assets/{index-JPErnqsm.js → index-BJ17Ijlb.js} +2 -2
- package/dist/assets/{index-CxtVVz4g.js → index-BTn1WqO7.js} +1 -1
- package/dist/assets/{index-CEFX9nem.js → index-BpGaPboJ.js} +1 -1
- package/dist/assets/{index-rTYnRLvf.js → index-DPrh5XVZ.js} +1 -1
- package/dist/assets/{index-6PBzTIZ2.js → index-DniSRtks.js} +1 -1
- package/dist/assets/{index-DQiNpCi5.js → index-DsVH62ZK.js} +13159 -13147
- package/dist/assets/{index-DiKyQs4W.js → index-EyTFjAAZ.js} +1 -1
- package/dist/assets/{lexical-qJrDnJMV.js → lexical-PVlNGkpS.js} +1 -1
- package/dist/assets/{liveblocks-DS8sOLD1.js → liveblocks-evjZPqs_.js} +1 -1
- package/dist/assets/{lottie-Coq2aDEW.js → lottie-CmTLY-9t.js} +1 -1
- package/dist/assets/{mui-DQ-jfgFM.js → mui-PcDpEhsm.js} +1 -1
- package/dist/assets/{pathToGoBack-BmSmVqnZ.js → pathToGoBack-Dt8AwbCr.js} +1 -1
- package/dist/assets/{pdf-D2Xq7623.js → pdf-CbXlPYUs.js} +4 -4
- package/dist/assets/{pdf-lib-fB9Fkl6A.js → pdf-lib-CU5FhbnZ.js} +1 -1
- package/dist/assets/{plaid-DWZgMqW3.js → plaid-DSnXUEUK.js} +1 -1
- package/dist/assets/{pusher-Xj81uOBz.js → pusher-Cwyg5VVV.js} +1 -1
- package/dist/assets/{react-eGjCUI9Z.js → react-CDqmK3AW.js} +1 -1
- package/dist/assets/{react-BlqDZveQ.js → react-CJ1HWQ69.js} +1 -1
- package/dist/assets/{react-CgdBA-iC.js → react-CY1ZQ6op.js} +1 -1
- package/dist/assets/{react-DRyTZBkZ.js → react-Cf5hLxOq.js} +1 -1
- package/dist/assets/{react-DyXk5i5q.js → react-EoTfQhVb.js} +1 -1
- package/dist/assets/{react-DrjKWElm.js → react-ymB_cbpE.js} +1 -1
- package/dist/assets/{recharts-CHATJmXy.js → recharts-CgEqsrFw.js} +1 -1
- package/dist/assets/routePaths-Dq5U7lhs.js +1 -0
- package/dist/assets/{sentry-B2Aew07S.js → sentry-CCZGmBkl.js} +1 -1
- package/dist/assets/{url-BOKPP8B2.js → url-9kg5cual.js} +1 -1
- package/dist/assets/{url-BfvldWlU.js → url-BKaTO14S.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D-BWgoPI.js → useAiCfoDashboardSuggestedQuestionsChips-BzB3gTK8.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-COXanSTX.js → useAskAiCfoHostNavButtonProps-uVGdd0zj.js} +1 -1
- package/dist/assets/useCashManagementBanner-BB3WgTJ-.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-oFZCnH6V.js → useChargeCardPusherEvents-BOkZNaGv.js} +1 -1
- package/dist/assets/{useDeviceId-obtSvxuy.js → useDeviceId-DGJPBja9.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-FRZ2xd4V.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DY5p7j5O.js → useInitialThreadRequest-D9ebiXdA.js} +1 -1
- package/dist/assets/{utils-D8kKiFqT.js → utils--mWNe9J7.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C3WgEurr.js → withTransactionSidePanel-iGXE6khP.js} +2 -2
- package/dist/assets/{zeni-epic-state-DcKqCCCg.js → zeni-epic-state-vtQ66nN6.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-BWnt9cIC.js +0 -1
- package/dist/assets/AddressScreen-Cyw252uq.js +0 -9
- package/dist/assets/CardsAiCfoScreen-OIj82XD6.js +0 -14
- package/dist/assets/CompanyPassportScreen-B529KL6X.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BhglfBxw.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BODgBJcA.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-C8RoK7MV.js +0 -18
- package/dist/assets/DrawerScreen-BJPPsAw9.js +0 -1
- package/dist/assets/EntityDetailRoutes-DPZ-OJr4.js +0 -1
- package/dist/assets/FeaturePreviewScreen-sSF2UCv0.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Cr8RPtj3.js +0 -1
- package/dist/assets/MagicLinkRoutes-UfcpgHsN.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-T9sB_-W8.js +0 -12
- package/dist/assets/MobileAppDrawer-CjCM5bjN.js +0 -1
- package/dist/assets/NotFoundScreen-CflOAMKa.js +0 -1
- package/dist/assets/NotificationRoutes-BkHhaOdW.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-eeY-GDaz.js +0 -1
- package/dist/assets/ReferralListScreen-BUtp3UMq.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-CS0osEZO.js +0 -1
- package/dist/assets/RewardsRoutes-ByI0ZIpM.js +0 -1
- package/dist/assets/ScreenRoutes-BUsrnJNl.js +0 -2
- package/dist/assets/SignInScreen-DMdUjPFw.js +0 -1
- package/dist/assets/SignOutScreen-Du8uZhJl.js +0 -9
- package/dist/assets/TaskListScreen-Bojtuf_r.js +0 -9
- package/dist/assets/TaskRoutes-DFB7uLPO.js +0 -9
- package/dist/assets/TreasuryRoutes-Cn_6Bv2l.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BOqcCxC3.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BZCaKTup.js +0 -9
- package/dist/assets/epic-DDYIjE2A.js +0 -2
- package/dist/assets/getLocaleForTenant-BDBK629h.js +0 -1
- package/dist/assets/routePaths-CN_gBlNJ.js +0 -1
- package/dist/assets/useCashManagementBanner-C9MfAi7A.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-CM4GNdWT.js +0 -1
package/dist/assets/{TransactionDetailScreen-CbYNGoLT.js → TransactionDetailScreen-DUZV5JDK.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as x}from"./liveblocks-
|
|
1
|
+
import{j as x}from"./liveblocks-evjZPqs_.js";import{a as i}from"./sentry-CCZGmBkl.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as Ee,N as Ze,n as Qe}from"./core-DmAftQ4g.js";import{nM as he,eW as Z,gn as Xe,Od as et,mZ as tt,mH as at,bn as nt,cT as be,bs as Ie,r8 as q,Nc as H,Oe as ve,Of as oe,NC as De,kG as Ce,Og as ke,NH as se,NI as ce,lv as Ae,K7 as ie,N6 as M,kA as Oe,ky as Ue,kK as ot,nz as st,Oh as ct,Oi as it,vl as K,kF as xe,Js as _e,cY as rt,cZ as lt,Oj as dt,N5 as ut,Ok as mt,vh as pt,Ol as ft,Om as ht,On as yt,Oo as St,Op as gt,kJ as Tt,Oq as Et,Or as bt,N7 as It,Os as vt,Ot as Dt,Ou as Ct,Jm as kt,Jc as At,JB as Ot,kL as Ut,K8 as ye,nE as xt}from"./zeni-epic-state-vtQ66nN6.js";import{W as J,U as _,z as we,aQ as Pe,m as _t,Z as wt,aR as Pt,y as Ft,p as ae,I as Vt,aS as Nt,q as ne,_ as Bt,aT as Rt,c as Fe,aU as zt,au as Lt,a2 as te}from"./index-DsVH62ZK.js";import{n as Gt,S as jt,D as $t}from"./mui-PcDpEhsm.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-uVGdd0zj.js";import{d as Ve}from"./decodeURIComponentSafe-C70tsXnj.js";import{h as Ne,c as Be,g as Wt,e as qt}from"./routePaths-Dq5U7lhs.js";import{u as Ht}from"./utils--mWNe9J7.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="e5ba4b05-2229-4ad5-ac37-01039611dc53",t._sentryDebugIdIdentifier="sentry-dbid-e5ba4b05-2229-4ad5-ac37-01039611dc53")}catch{}})();function Jt(t=!0){const e=W(),s=Ke(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Yt(t,e){const s=function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>Z(h)),E=k.companyId,U=S(h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:w,capitalizableAccountOverrides:N,dismissedAccounts:L}=S(h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(w);G.current=w;const B=i.useRef(N);B.current=N;const P=i.useRef(L);P.current=L;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const b of R)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),Q=B.current??{},Y=P.current;for(const z of u)if($.has(z.accountId)&&Q[z.accountId]==null&&Y?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void g(!0)},[v]),D=i.useCallback((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)},[r,E]),F=i.useCallback(()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))},[r,E,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=we.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Z(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),E=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")}),w=S(u=>oe(u)),N=S(u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")}),L=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[B,P]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),b=N?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(B?R||U==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),P(!0),s(Ae(E))))},[s,l,f?.fetchState,f?.transaction,E,c,r,p,B,R,U,b]),i.useEffect(()=>{w.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[w.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:w,uiState:N,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Zt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=wt(),r=W(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Qt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Qt=Gt(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function Xt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=g(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:S}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(S),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=Se(),n=Te(),o=q(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),S=e??p,A=s??Ve(r??"");let y;Be(S,A)&&(y={id:S,type:W(A)});const m=y!=null?g(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Qe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),S=Z(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:S.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${Lt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??ze(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ne(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(K({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,S=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:S}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(St({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(gt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Xt(t,a):void 0}})(zt);function ya(){const t=Te(),e=q(),s=Se(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=Vt(),c=g(d=>Z(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),S=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),U=Be(C,b),_=g(d=>d.transactionVendorViewState),B=re(),{isFeatureEnabled:L}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:N}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:W(b)}},[U,C,b]),l=I!=null?g(d=>H(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=g(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=g(d=>oe(d)),E=g(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=g(d=>Ce(d.accountState,d.accountListState,"accountList")),[Q,J]=i.useState(!1),[z,le]=i.useState(!1),[Le,de]=i.useState(!1),Ge=i.useCallback(d=>Ne(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{J(!1),le(!1)},me=Bt();Yt();const X=i.useRef(l?.transaction);X.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Jt($e,()=>{const d=[];if(X.current!=null)for(const ee of X.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{Le||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&ge(l?.transaction),D!=null&&(!r||p&&S===!1)&&(Q?z||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),ge(l?.transaction),J(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Ye,onAskAiCfoClick:Je}=Mt({mobileExploreReferrer:"Transaction Details"});return Nt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Zt,{isOpen:v,transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Ye,onAskAiCfoClick:Je,isTransactionCommentingEnabled:L,isProjectsTransactionsEnabled:N,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&x.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Ze,{to:ze(Me.length)})}const ze=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},ge=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Zt as C,ya as T,Yt as a,Jt as b,ta as c,aa as d,ea as e,re as f,Xt as g,ha as u};
|
|
5
|
+
`;function Xt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=Ee(),g=e??p,A=s??Ve(r??"");let y;Ne(g,A)&&(y={id:g,type:q(A)});const m=y!=null?S(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Qe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=we.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Z(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${Lt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??ze(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Be(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(_e(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(K({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(bt(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Et(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Xt(t,a):void 0}})(zt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),c=S(d=>Z(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&be(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(_.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=Ee(),[v,k]=i.useState(!1),E=Ve(f??""),U=Ne(C,E),w=S(d=>d.transactionVendorViewState),N=re(),{isFeatureEnabled:L}=a(_.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(_.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=a(_.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:q(E)}},[U,C,E]),l=I!=null?S(d=>H(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?w.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),b=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[Q,Y]=i.useState(!1),[z,le]=i.useState(!1),[Le,de]=i.useState(!1),Ge=i.useCallback(d=>Be(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{Y(!1),le(!1)},me=Nt();Jt();const X=i.useRef(l?.transaction);X.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Yt($e,()=>{const d=[];if(X.current!=null)for(const ee of X.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(_e(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{Le||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(Q?z||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:b?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),Y(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=Mt({mobileExploreReferrer:"Transaction Details"});return Bt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Zt,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:N,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:L,isProjectsTransactionsEnabled:B,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&x.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Ze,{to:ze(Me.length)})}const ze=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Zt as C,ya as T,Jt as a,Yt as b,ta as c,aa as d,ea as e,re as f,Xt as g,ha as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DS8sOLD1.js";import{h as K,g as U,u as W,i as H,j as h,N as z,n as Q,o as ve,p as j}from"./core-SRRzy8qJ.js";import{eV as Z,qO as X,jT as u,RC as ee,JZ as De,bo as le,RD as be,ku as te,ND as ae,RE as ue,RF as Pe,bE as Y,JV as ye,RG as Ee,RH as me,RI as je,JY as Ae,RJ as xe,RK as pe,RL as Me,RM as ge,RN as Le,RO as Ce,RP as fe,L9 as Be}from"./zeni-epic-state-DcKqCCCg.js";import{a as de,W as ne,U as J,d as G,co as ce,s as q,k as oe,V as Fe,B as Oe}from"./index-DQiNpCi5.js";import"./mui-DQ-jfgFM.js";import{a as g}from"./sentry-B2Aew07S.js";import{w as se}from"./withTransactionSidePanel-C3WgEurr.js";import{p as ie,c as re}from"./routePaths-CN_gBlNJ.js";import{v as Re}from"./utils-D8kKiFqT.js";import{d as b}from"./decodeURIComponentSafe-Bz-26BXW.js";import{Z as Ge}from"./ZeniAccountStatementScreen-BZCaKTup.js";import"./recharts-CHATJmXy.js";import"./analytics-C-A3qVJh.js";import"./plaid-DWZgMqW3.js";import"./dnd-CR8sMRK3.js";import"./stripe-DMRn4zHo.js";import"./lottie-Coq2aDEW.js";import"./lexical-qJrDnJMV.js";import"./pdf-D2Xq7623.js";import"./useAskAiCfoHostNavButtonProps-COXanSTX.js";import"./TransactionDetailScreen-CbYNGoLT.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]="cbac566a-ea46-47fc-920c-b42c78ce6a22",a._sentryDebugIdIdentifier="sentry-dbid-cbac566a-ea46-47fc-920c-b42c78ce6a22")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Re(a),we=Q(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:N(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),V=se(function({...a}){const e=K(),t=U(),n=W(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=H(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>Z(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(J.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ne=Q(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),Je=se(function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Z(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(J.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=qe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Q(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ke=se(function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Z(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(J.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=We(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ze,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Qe=Q(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=K(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=H(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(v=>Z(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Xe(p,A,S,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(J.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(J.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,S,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Qe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>Z(n)).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Je,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ke,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-evjZPqs_.js";import{h as H,g as U,u as K,i as Q,j as h,N as z,n as Z,o as ve,p as j}from"./core-DmAftQ4g.js";import{eW as W,qP as X,jU as u,RD as ee,J_ as De,bo as le,RE as Pe,kv as te,NE as ae,RF as ue,RG as Ee,bE as Y,JW as ye,RH as be,RI as me,RJ as je,JZ as Ae,RK as xe,RL as pe,RM as Me,RN as ge,RO as Le,RP as Ce,RQ as fe,La as Be}from"./zeni-epic-state-vtQ66nN6.js";import{O as de,W as ne,U as q,c as G,co as ce,q as N,p as oe,X as Fe,n as Oe}from"./index-DsVH62ZK.js";import"./mui-PcDpEhsm.js";import{a as g}from"./sentry-CCZGmBkl.js";import{w as se}from"./withTransactionSidePanel-iGXE6khP.js";import{p as ie,c as re}from"./routePaths-Dq5U7lhs.js";import{v as Re}from"./utils--mWNe9J7.js";import{d as P}from"./decodeURIComponentSafe-C70tsXnj.js";import{Z as Ge}from"./ZeniAccountStatementScreen-CU5lpB3Y.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./useAskAiCfoHostNavButtonProps-uVGdd0zj.js";import"./TransactionDetailScreen-DUZV5JDK.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]="c90fccca-ddf9-419f-aa4e-64ab570f00e0",a._sentryDebugIdIdentifier="sentry-dbid-c90fccca-ddf9-419f-aa4e-64ab570f00e0")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],V=a=>Re(a),we=Z(function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,V(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=V(e.selectedAccount.tranListType),m=Je(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:V(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:V(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=H(),t=U(),n=K(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>W(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:E}=$e(o,p,I.bookCloseDate),[B,b]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(E);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){b(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=V(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Je=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ve=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(S??""),x=P(I??""),C=h(d=>Ee(d.transactionListState,A,p,k)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(d=>W(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=Ne(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{E||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ve,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=Z(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),He=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(S??""),x=P(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(d=>W(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=Ke(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{E||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(We,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(v=>W(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Xe(p,A,S,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&b!=null&&(i={...r,period:b});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!E&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[E,r,c,_]);const ke=[l,m,S,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>W(n)).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})})]})}export{kt as default};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-evjZPqs_.js";import{h as U,g as L,u as P,i as O,j as y,N as B,n as N,o as we,p as k}from"./core-DmAftQ4g.js";import{cp as G,eW as D,Qm as R,Gl as ae,fU as q,G3 as ne,Qo as Ie,Go as ke,Qk as be,Ql as se,QB as je,Es as Ae,u9 as Ee,Qq as ve,GH as De,Qn as re,cS as H,yo as oe,fz as Fe,fB as Be,RA as Ue,RB as Le,G4 as Pe,RC as Re,G5 as Me,Ge as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as ze,fT as $e,bt as Qe,LV as qe,cn as He}from"./zeni-epic-state-vtQ66nN6.js";import{I as _,ar as We,z as A,x as z,c as b,ch as Ze,ci as Ke,cj as Q,Z as W,m as Je,X as Xe,_ as Ye,W as ie,U as E,y as et,B as tt,ck as at,au as Z,q as nt,cl as st,p as K,cm as rt,D as X,cn as ot,a9 as it}from"./index-DsVH62ZK.js";import{D as ct,n as M,S as lt}from"./mui-PcDpEhsm.js";import ut from"./NotFoundScreen-AsC21qGx.js";import{S as Y}from"./SetupPagesScreen-BkPb95y9.js";import{a as p}from"./sentry-CCZGmBkl.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-uVGdd0zj.js";import{u as pt}from"./useInitialThreadRequest-D9ebiXdA.js";import{u as mt}from"./useCashManagementBanner-BB3WgTJ-.js";import{M as ce}from"./MobileAppDrawer-BuakBUGx.js";import{F as ft}from"./FeaturePreviewScreen-kp5WtNsg.js";import{a as ee}from"./analyticsHelper-CQXeRvKo.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./routePaths-Dq5U7lhs.js";import"./BusinessVerificationPageScreen-HLhTZBjl.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="51b6b362-e499-4ed1-b397-752d0bf2de02",t._sentryDebugIdIdentifier="sentry-dbid-51b6b362-e499-4ed1-b397-752d0bf2de02")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ze);function gt(){const t=U(),a=L(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=We(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=A.getSignedInUserTenant(o)?.companyId??h.companyId,C=A.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(B,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ee("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ae(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),St=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=A.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`,Ct={overlayWidth:new et(100,100,48)},Tt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:r}=a,{tenantEmailDomain:l}=o;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let u="page-not-found";i==="editPortfolio"?u=wt(l):i==="statements"?u=It(l):i==="taxLetter"?u=kt(l):i==="settings"&&(u=bt(l));const T=nt(m.state?.pathnameStackToGoBack,m.pathname);n(u,{state:{pathnameStackToGoBack:T}})},onColumnSortConfigChanged:(i,u)=>{t(Ue({uiState:{sortKey:i,sortOrder:u}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(r?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${l}/checking/cash_management`)}}})(at);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=L(),o=U(),m=P(),s=W(),f=Je(),r=y(j=>D(j)),{tenantEmailDomain:l}=O(),i=r.companyId??A.getSignedInUserTenant(l)?.companyId,[u,T]=p.useState(!1),d=y(j=>re(j)),c=d.fetchState,h=d.accountSummary?.totalBalance?.amount,g=y(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),w=!!r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=G(S?.loggedInUserRoleMap),F=H(S?.loggedInUserRoleMap),{areTenantIdsInSync:v}=Xe();p.useEffect(()=>{c==="Not-Started"&&!u&&v&&(T(!0),m(oe(!0)))},[u,m,c,v]),p.useEffect(()=>{d.transactionsFetchState.fetchState==="Completed"&&d.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[d.transactionsFetchState.fetchState,d.transactions.length]);const I=()=>{o("..")},[le,ue]=p.useState(!1),J=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=dt({mobileExploreReferrer:"Treasury"});Ye({isDataReady:c==="Completed"});const me=mt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(E.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(E.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(E.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(E.isCashManagementFeatureEnabled),Se=pt(i,{clearParams:c==="Completed"&&g?.fetchState==="Completed"}),xe=Fe(r),Ce=Be(fe,r);if(xe===!0&&Ce!==!0)return e.jsx(ft,{});if(C){const j=g?.fetchState!=="Completed"||d.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[d.accountSummaryFetchState.fetchState==="Completed"&&g?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(ct,{onClose:I,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:Ct.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(jt,{onClick:Te=>Te.stopPropagation(),children:[t===!0?e.jsx(St,{isFirstTransfer:d.transactions.length===0||h===0}):null,a===!0?e.jsx(gt,{}):null]})}),e.jsxs(xt,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(Tt,{treasuryDetailsView:d,isAutoTransferRuleEnabled:ye,navigate:o,currentTenant:r,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:J,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(B,{to:"../setup"}):r.companyTreasuryInfo?.info&&!w&&F?e.jsx(B,{to:"../promo",state:n.state}):e.jsx(tt,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const wt=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,kt=t=>`/${t}/treasury/tax-letter`,bt=t=>`/${t}/treasury/setup`,jt=M(lt)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,At=M.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
width: 100%;
|
|
17
|
+
flex: 1 1 auto;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
21
|
+
`;function Et(){const t=U(),a=P(),n=W(),o=L(),m=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Le(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),a(Pe(!1)))},[s,r.fetchState,a]);const l=A.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(At,{windowSize:n,children:e.jsx(st,{currentTenantCompanyName:T,statementListView:r,isLoading:d,onBackClick:()=>{const c=K(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const vt=M.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
+
`;function Dt(){const t=U(),a=W(),n=L(),o=P(),m=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Re(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),o(Me(!1)))},[s,r.fetchState,o]);const l=A.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(vt,{windowSize:a,children:e.jsx(rt,{currentTenantCompanyName:T,taxLetterListView:r,isLoading:d,onBackClick:()=>{const c=K(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const Ft=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Ve(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}})(ot),Bt=()=>{const t=U(),a=L(),n=P(),{tenantEmailDomain:o}=O(),[m,s]=p.useState(!1),f=y(S=>D(S)),[r,l]=p.useState(!1),i=y(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);p.useEffect(()=>{r||i?.fetchState!=="Not-Started"||u==null||(l(!0),n(q()))},[i,n]);const u=A.getSignedInUserTenant(o)?.companyId??f.companyId,T=A.getSignedInUser(),d=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{s(S)};if(T==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),g=G(h?.loggedInUserRoleMap),C=H(h?.loggedInUserRoleMap);if(d&&g)return e.jsx(B,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!d&&g||C)){if(a.state?.message==="activation"){const S=K(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:c}),e.jsx(Ft,{analytics:b,navigate:t,companyId:u,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=M.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
+
`;function sa(){const t=L(),a=y(v=>D(v)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(E.isTreasuryEnabled),m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=H(s?.loggedInUserRoleMap),r=a?.userRole!=null&&Oe(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!r)&&Ne(s?.loggedInUserRoleMap),i=Ge(s?.loggedInUserRoleMap),u=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!r)&&_e(s?.loggedInUserRoleMap),{isFeatureEnabled:T}=n(E.isDepositAccountsFeatureEnabled),d=T&&!r&&ze(s?.loggedInUserRoleMap),c=a.company!=null&&$e(a.company),h=o&&c===!0&&!r&&G(s?.loggedInUserRoleMap),{isFeatureEnabled:g}=n(E.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(E.isDebitCardFeatureEnabled),S=it(a,g,C)&&!r&&Qe(s?.loggedInUserRoleMap),w=qe(s?.loggedInUserRoleMap),x=He(s?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(we,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Bt,{})}),e.jsx(k,{path:"statements",element:e.jsx(Et,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Dt,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ut,{})})]}):m&&h?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{sa as default};
|