@zeniai/web-app-ui 5.0.38-dev → 5.0.39-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.
Files changed (110) hide show
  1. package/dist/assets/AddressRoutes-BXbFwAXT.js +1 -0
  2. package/dist/assets/AddressScreen-C-f6mtJZ.js +9 -0
  3. package/dist/assets/{AiCfoScreen-CS983lgP.js → AiCfoScreen-CmTBo90W.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-xlaTTs0C.js → BillPayApprovalRoutes-vH5FwPQ5.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D1VOPUoh.js → BillPayRoutes-BCXGuAq0.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DkwOmH2q.js → BusinessVerificationPageScreen-CxlnwjVC.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-D3YURNcK.js → ChargeCardRoutes-4rYNXNJo.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-C9mXVXr2.js → CompanyPassportScreen-SWqvnizh.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-C5Rpfpbz.js → ConnectionAuthScreen-Dus2a0Rk.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-D4ToWJeI.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-jyaMTpEJ.js → CustomerOnboardingRoutes-V1uPzsBk.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-DOzvVzpe.js → DashboardRoutes-CYOp2IlF.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-C1eNf6k6.js → DefaultTenantHome-B9mNUMdb.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BtQ6Rgup.js → DomesticWireDetailScreen-T8SUQMjp.js} +3 -3
  15. package/dist/assets/DrawerScreen-k1pxe0v-.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-DYK4VtQ3.js → EntityDetailRoutes-BkAYzk4-.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-B4M_VHfs.js → ExpenseAutomationRoutes-Co8PkpF6.js} +1 -1
  18. package/dist/assets/FeaturePreviewScreen-BLO6Bexe.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-R6EiOSCx.js → MagicLinkRoutes-7XuD_PlH.js} +6 -6
  20. package/dist/assets/MagicLinkSignInScreen-Ts_mFZSG.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-DuACKsl0.js → MobileAppDrawer-8wMyvvdV.js} +1 -1
  22. package/dist/assets/NotFoundScreen-CVO1T_j5.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CckRRzHX.js → NotificationRoutes-DnByMzB_.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-Dlw30mT3.js → PandLWithForecastRoutes-BpZUpgF6.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-DoaUfpUb.js → PeopleRoutes-CmnyiOf1.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-Dl2_fYm_.js +1 -0
  27. package/dist/assets/{Preview-cHYFAIpu.js → Preview-Bd7fQ3dX.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-DKGxKd0E.js → QBOConnectionScreen-DysX32k6.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-7JoEaSvx.js → ReferralListScreen-jPJpjbeC.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-q_xqohRp.js → ReimbursementApprovalRoutes-CcSHarz2.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DYUjSPeD.js → ReimbursementApprovalRuleDetailScreen-BifnujSK.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-nLXGYdhr.js → ReimbursementRoutes-YNKgfdPN.js} +4 -4
  33. package/dist/assets/{ReportsRoutes-cpKf6Nnv.js → ReportsRoutes-D0ySZrtq.js} +1 -1
  34. package/dist/assets/{RewardsRoutes-eJMK01sJ.js → RewardsRoutes-Sd_9LuOj.js} +1 -1
  35. package/dist/assets/ScreenRoutes-E90Sm0n8.js +2 -0
  36. package/dist/assets/{SettingsRoutes-5cOxrdTC.js → SettingsRoutes-X29HXUit.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-sAZpJNGi.js → SetupPagesScreen-cNU649a3.js} +1 -1
  38. package/dist/assets/{SignInScreen-DPfGBdeh.js → SignInScreen-DteX1Ydh.js} +1 -1
  39. package/dist/assets/SignOutScreen-Dt89dDRp.js +9 -0
  40. package/dist/assets/{TaskListScreen-BYNqXG0-.js → TaskListScreen-C-gmtBHz.js} +2 -2
  41. package/dist/assets/{TaskRoutes-DDPxg7CG.js → TaskRoutes-CFCruBZ7.js} +1 -1
  42. package/dist/assets/TransactionDetailRoutes-Br_UGsjG.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-B5lMAMSc.js → TransactionDetailScreen-Lwa1-na2.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-qyh1PD-Z.js → TransactionListRoutes-B0NZS3qj.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-DuPOO_Nm.js → TreasuryRoutes-DNldbh_a.js} +5 -5
  46. package/dist/assets/{VendorsRoutes-B7HHnZHh.js → VendorsRoutes-DXKV_d0K.js} +16 -16
  47. package/dist/assets/WiseConfirmationScreen-Dd2pz_Ub.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-DXp1wP2W.js → ZeniAccountRoutes-TR_t8cGe.js} +6 -6
  49. package/dist/assets/ZeniAccountStatementScreen-CgX1qrsS.js +9 -0
  50. package/dist/assets/{accountMappingHelper-L2gJ16H8.js → accountMappingHelper-E1x5okE5.js} +1 -1
  51. package/dist/assets/{analytics-DaGIvUkL.js → analytics-bOU2NuQd.js} +1 -1
  52. package/dist/assets/{analyticsHelper-DPM8WM8o.js → analyticsHelper-BlCfitSU.js} +1 -1
  53. package/dist/assets/{core-D5Hit8x-.js → core-DZxCQ5Bu.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-DDEb_ZPT.js → decodeURIComponentSafe-BzMzzx7s.js} +1 -1
  55. package/dist/assets/{dnd-BWi02USV.js → dnd-DlOyvOfI.js} +1 -1
  56. package/dist/assets/{empty-Dcm4EccV.js → empty-DdOz-Yld.js} +1 -1
  57. package/dist/assets/{empty-CEC058x9.js → empty-WtAU24Zt.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-Cg1_5pdj.js → emptyVideoElement-DrvFcV3_.js} +1 -1
  59. package/dist/assets/{epic-DqLG1WPh.js → epic-Cjcg-k6H.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-DpFCp4hi.js +1 -0
  61. package/dist/assets/{index-BzkVYl7p.js → index-Bnt4DrBm.js} +2 -2
  62. package/dist/assets/{index-B51-hBP4.js → index-CmRYEARN.js} +1 -1
  63. package/dist/assets/{index-C7yI3-qS.js → index-CtQjNzsr.js} +11649 -11651
  64. package/dist/assets/{index-Bv05727x.js → index-DDRClfQW.js} +1 -1
  65. package/dist/assets/{index-D7pxWynk.js → index-DJ3blipq.js} +1 -1
  66. package/dist/assets/{index-1TQnr6ma.js → index-DSXOfevB.js} +1 -1
  67. package/dist/assets/{index-CFTsy12u.js → index-DXLBJNXj.js} +1 -1
  68. package/dist/assets/{lexical-yXjK_sjC.js → lexical-DrUvlKRq.js} +1 -1
  69. package/dist/assets/{liveblocks-BPC8B-82.js → liveblocks-DZqP4zBd.js} +1 -1
  70. package/dist/assets/{lottie-CgXU1WMN.js → lottie-FsLW8B91.js} +1 -1
  71. package/dist/assets/{mui-DW04nVBh.js → mui-JGW0YBlw.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DqR4pfCe.js → pathToGoBack-D-K8tKB7.js} +1 -1
  73. package/dist/assets/{pdf-D6P4p3u8.js → pdf-CGAiVFsk.js} +4 -4
  74. package/dist/assets/{pdf-lib-CL8r24Xn.js → pdf-lib-opkMBM7m.js} +1 -1
  75. package/dist/assets/{plaid-BnTbuxYK.js → plaid-DYvRZGjg.js} +1 -1
  76. package/dist/assets/{pusher-DqEBDOP6.js → pusher-G0Jr19zz.js} +1 -1
  77. package/dist/assets/{react-CJQgzcbn.js → react-BfSqt5KG.js} +1 -1
  78. package/dist/assets/{react-D8etWraJ.js → react-BqrtnqU6.js} +1 -1
  79. package/dist/assets/{react-D-TJl3XF.js → react-CL9IIpWC.js} +1 -1
  80. package/dist/assets/{react-DvihdbV2.js → react-C_NkjW-O.js} +1 -1
  81. package/dist/assets/{react-BgBQCF9f.js → react-LmihdrP8.js} +1 -1
  82. package/dist/assets/{react-wL8RpiLQ.js → react-Ud6uAQKs.js} +1 -1
  83. package/dist/assets/{recharts-BAxVJ6il.js → recharts-_nzHAC1j.js} +1 -1
  84. package/dist/assets/{routePaths-DpkdUp-r.js → routePaths-D0N0HcnI.js} +1 -1
  85. package/dist/assets/{sentry-CWaXw80H.js → sentry-BX7ktq7C.js} +1 -1
  86. package/dist/assets/{url-BFVr25rm.js → url-BheTWemO.js} +1 -1
  87. package/dist/assets/{url-wSZ4fiLg.js → url-CT9TRcKS.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-COcfEAPF.js → useAskAiCfoHostNavButtonProps-CYJ1ZXIh.js} +1 -1
  89. package/dist/assets/{useDeviceId-CgooY8pH.js → useDeviceId-DqPWUNKu.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-Dye8etNE.js → useFetchSuggestedQuestionsWhenReady-k28J-Ry_.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-7gkW3kbz.js → useInitialThreadRequest-4RaR8e8p.js} +1 -1
  92. package/dist/assets/{utils-DjtfEx4B.js → utils-2p1Ymknq.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-BgPYSbeD.js → withTransactionSidePanel-DHrlHkzm.js} +3 -3
  94. package/dist/assets/{zeni-epic-state-CVuyWhoX.js → zeni-epic-state-Bd5L4xLB.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +3 -3
  97. package/dist/assets/AddressRoutes-CFlzwdul.js +0 -1
  98. package/dist/assets/AddressScreen-Cw-dklU2.js +0 -9
  99. package/dist/assets/CustomerOnboardingAuthScreen-7kd7LmmV.js +0 -1
  100. package/dist/assets/DrawerScreen-DMCWWoqu.js +0 -1
  101. package/dist/assets/FeaturePreviewScreen-C9nGcb2y.js +0 -1
  102. package/dist/assets/MagicLinkSignInScreen-B9R6T5PL.js +0 -12
  103. package/dist/assets/NotFoundScreen-By6iX_AK.js +0 -1
  104. package/dist/assets/PerformanceRoutes-pWHyN4NV.js +0 -1
  105. package/dist/assets/ScreenRoutes-gbWBIULy.js +0 -2
  106. package/dist/assets/SignOutScreen-BsvCrb0A.js +0 -9
  107. package/dist/assets/TransactionDetailRoutes-BVkzBZ86.js +0 -1
  108. package/dist/assets/WiseConfirmationScreen-HWW7D6Im.js +0 -12
  109. package/dist/assets/ZeniAccountStatementScreen-kuKTdjdd.js +0 -9
  110. package/dist/assets/getLocaleForTenant-BDiDnhsV.js +0 -1
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BPC8B-82.js";import{j as U,u as w,h as q,l as Q,g as L,N as C,k as Z,n as Ae,o as v}from"./core-D5Hit8x-.js";import{eN as R,iQ as T,NP as H,Gr as ue,bq as ie,NQ as he,jr as W,JT as X,NR as se,NS as Se,bC as x,Go as me,NT as ke,NU as re,NV as Ie,NW as pe,NX as be,NY as ve,NZ as de,HE as Ye,bn as xe}from"./zeni-epic-state-CVuyWhoX.js";import{D as K,e as B,c5 as ee,r as _,p as te,a as fe,d as J,J as Ee,z as Pe}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.js";import{a as A}from"./sentry-CWaXw80H.js";import{w as ae}from"./withTransactionSidePanel-BgPYSbeD.js";import{p as ne,b as ce}from"./routePaths-DpkdUp-r.js";import{u as Le}from"./utils-DjtfEx4B.js";import{d as P}from"./decodeURIComponentSafe-DDEb_ZPT.js";import{Z as je}from"./ZeniAccountStatementScreen-kuKTdjdd.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import"./TransactionDetailScreen-B5lMAMSc.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]="04c72f7e-b3d8-4c9c-9220-ec156a8feaa5",a._sentryDebugIdIdentifier="sentry-dbid-04c72f7e-b3d8-4c9c-9220-ec156a8feaa5")}catch{}})();const G=a=>Le(a),ze=Z(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,G(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=K.getLocalizedStrings(),r=G(e.selectedAccount.tranListType),s=Be(t,n,c,r,e.bookCloseDate);B.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:s},type:G(e.selectedAccount.tranListType)})),a(ue(r,T(s),!1,r==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(s))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:G(e.selectedAccount.tranListType)}))}}})(ee),F=ae(function({...a}){const e=U(),t=w(),n=q(),c=t.pathname.substring(t.pathname.lastIndexOf("/")+1),{tenantEmailDomain:o}=Q(),r=K.getLocalizedStrings(),{accountType:s,title:u,subTitle:h}=Me(c),D="month",g=L(p=>R(p)),Y=g.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:y,initialTimeframeTick:S}=Ce(c,Y,g.bookCloseDate),[k,j]=A.useState(!1),[z,E]=A.useState(void 0),m=A.useMemo(()=>{const p=T(S);return{tranListType:c,accountType:H(s),title:u,subTitle:h,timeframe:D,period:p}},[c,D,s,y]);A.useEffect(()=>{if(!k&&m!=null){j(!0),B.trackTransactionList(void 0,void 0,void 0,m.title);const p=G(m.tranListType);n(ue(p,m.period,!0,p==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[k,m,n]);let I=m;return m!=null&&z!=null&&(I={...m,period:z}),I==null?i.jsx(C,{to:"../"}):i.jsx(ze,{firstMonthOfFY:Y,tenantEmailDomain:o,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:y,navigate:e,selectedAccount:I,referrerType:c,bookCloseDate:g.bookCloseDate,onSelectedTimePeriodChange:p=>E(p),...a})}),Me=a=>{let e="",t="",n="";const c=K.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Ce=(a,e,t)=>{const n=ie();let c=ie().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:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(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},Oe=Z(function(a,e){const t=ke(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:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();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)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Fe=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,classIdEncoded:u,timeframe:h,startDate:D,endDate:g,titleEncoded:Y}=Q(),y=P(r??""),S=P(s??""),k=P(u??""),j=P(Y??""),z=L(f=>Se(f.transactionListState,S,y,k)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(f=>R(f)),$=N.company?.companyInfo.firstMonthOfFY??1;let d;const l=Ge(y,S,k,h,D,g,j);if(l){const f={startDate:x(D,"YYYY-MM-DD"),endDate:x(g,"YYYY-MM-DD")},V=Ne(z?.dateRange,f);d={accountId:S,accountType:H(y),classId:k,title:j,timeframe:h,period:V}}A.useEffect(()=>{E||d==null||(m(!0),B.trackTransactionList(d.accountId,void 0,a,d.title),c(me(d.accountId,d.accountType,d.classId,d.period)))},[E,d,c]);let M=d;d!=null&&I!=null&&(M={...d,period:I});const O=[r,s,u,h,D,g,Y].filter(f=>f!=null);return l&&M!=null?i.jsx(Oe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:M,referrerType:a,onSelectedTimePeriodChange:f=>p(f),...e}):i.jsx(C,{to:Te(O.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ge=(a,e,t,n,c,o,r)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&r!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),_e=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();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)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=$e(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,timeframe:u,startDate:h,endDate:D,titleEncoded:g,excludeSubAccounts:Y}=Q(),y=P(r??""),S=P(s??""),k=P(g??""),j=!(Y!=null&&Y==="exclude_subaccounts"),z=L(b=>Ie(b.transactionListState,S,y)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(b=>R(b)),$=N.company?.featuresActivationInfo.connectedAccountProvider==="unit",d=N.company?.companyInfo.firstMonthOfFY??1;let l;const M=we(y,S,u,h,D,k);if(M){const b={startDate:x(h,"YYYY-MM-DD"),endDate:x(D,"YYYY-MM-DD")},ye=Re(z?.dateRange,b);l={accountId:S,accountType:H(y),title:k,timeframe:u,period:ye}}let O=l;l!=null&&I!=null&&(O={...l,period:I});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(J.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Ee();A.useEffect(()=>{!E&&l!=null&&oe&&(m(!0),B.trackTransactionList(l.accountId,void 0,a,l.title),c(pe(l.accountId,l.accountType,l.period,void 0,!1,j)))},[E,l,c,oe]);const ge=[r,s,u,h,D,g].filter(b=>b!=null);return M&&O!=null?i.jsx(_e,{firstMonthOfFY:d,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:b=>p(b),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},we=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,Re=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),$e=a=>`/${a}/transactions/${Ye}/statements`;function mt(){const a=w().state?.referrer,e=Pe.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(J.isExpenseAutomationEnabled),o=L(u=>u.expenseAutomationViewState.selectedPeriodByTenantId)[L(u=>R(u)).tenantId],{isFeatureEnabled:r}=n(J.isExpenseAutomationEnabledV2),s=r||c&&t;return i.jsxs(Ae,{children:[i.jsx(v,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(v,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/uncategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/uncategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/missing-receipts/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Fe,{referrerType:a})})]})}export{mt as default};
1
+ import{j as i}from"./liveblocks-DZqP4zBd.js";import{j as U,u as w,h as q,l as Q,g as L,N as C,k as Z,n as Ae,o as v}from"./core-DZxCQ5Bu.js";import{eN as R,iQ as T,NP as H,Gr as ue,bq as ie,NQ as he,jr as W,JT as X,NR as se,NS as Se,bC as x,Go as me,NT as ke,NU as re,NV as Ie,NW as pe,NX as be,NY as ve,NZ as de,HE as Ye,bn as xe}from"./zeni-epic-state-Bd5L4xLB.js";import{D as K,e as B,c5 as ee,r as _,p as te,a as fe,d as J,J as Ee,z as Pe}from"./index-CtQjNzsr.js";import"./mui-JGW0YBlw.js";import{a as A}from"./sentry-BX7ktq7C.js";import{w as ae}from"./withTransactionSidePanel-DHrlHkzm.js";import{p as ne,b as ce}from"./routePaths-D0N0HcnI.js";import{u as Le}from"./utils-2p1Ymknq.js";import{d as P}from"./decodeURIComponentSafe-BzMzzx7s.js";import{Z as je}from"./ZeniAccountStatementScreen-CgX1qrsS.js";import"./recharts-_nzHAC1j.js";import"./analytics-bOU2NuQd.js";import"./plaid-DYvRZGjg.js";import"./dnd-DlOyvOfI.js";import"./stripe-DMRn4zHo.js";import"./lottie-FsLW8B91.js";import"./lexical-DrUvlKRq.js";import"./pdf-CGAiVFsk.js";import"./useAskAiCfoHostNavButtonProps-CYJ1ZXIh.js";import"./useFetchSuggestedQuestionsWhenReady-k28J-Ry_.js";import"./TransactionDetailScreen-Lwa1-na2.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]="04c72f7e-b3d8-4c9c-9220-ec156a8feaa5",a._sentryDebugIdIdentifier="sentry-dbid-04c72f7e-b3d8-4c9c-9220-ec156a8feaa5")}catch{}})();const G=a=>Le(a),ze=Z(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,G(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=K.getLocalizedStrings(),r=G(e.selectedAccount.tranListType),s=Be(t,n,c,r,e.bookCloseDate);B.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:s},type:G(e.selectedAccount.tranListType)})),a(ue(r,T(s),!1,r==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(s))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:G(e.selectedAccount.tranListType)}))}}})(ee),F=ae(function({...a}){const e=U(),t=w(),n=q(),c=t.pathname.substring(t.pathname.lastIndexOf("/")+1),{tenantEmailDomain:o}=Q(),r=K.getLocalizedStrings(),{accountType:s,title:u,subTitle:h}=Me(c),D="month",g=L(p=>R(p)),Y=g.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:y,initialTimeframeTick:S}=Ce(c,Y,g.bookCloseDate),[k,j]=A.useState(!1),[z,E]=A.useState(void 0),m=A.useMemo(()=>{const p=T(S);return{tranListType:c,accountType:H(s),title:u,subTitle:h,timeframe:D,period:p}},[c,D,s,y]);A.useEffect(()=>{if(!k&&m!=null){j(!0),B.trackTransactionList(void 0,void 0,void 0,m.title);const p=G(m.tranListType);n(ue(p,m.period,!0,p==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[k,m,n]);let I=m;return m!=null&&z!=null&&(I={...m,period:z}),I==null?i.jsx(C,{to:"../"}):i.jsx(ze,{firstMonthOfFY:Y,tenantEmailDomain:o,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:y,navigate:e,selectedAccount:I,referrerType:c,bookCloseDate:g.bookCloseDate,onSelectedTimePeriodChange:p=>E(p),...a})}),Me=a=>{let e="",t="",n="";const c=K.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Ce=(a,e,t)=>{const n=ie();let c=ie().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:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(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},Oe=Z(function(a,e){const t=ke(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:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();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)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Fe=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,classIdEncoded:u,timeframe:h,startDate:D,endDate:g,titleEncoded:Y}=Q(),y=P(r??""),S=P(s??""),k=P(u??""),j=P(Y??""),z=L(f=>Se(f.transactionListState,S,y,k)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(f=>R(f)),$=N.company?.companyInfo.firstMonthOfFY??1;let d;const l=Ge(y,S,k,h,D,g,j);if(l){const f={startDate:x(D,"YYYY-MM-DD"),endDate:x(g,"YYYY-MM-DD")},V=Ne(z?.dateRange,f);d={accountId:S,accountType:H(y),classId:k,title:j,timeframe:h,period:V}}A.useEffect(()=>{E||d==null||(m(!0),B.trackTransactionList(d.accountId,void 0,a,d.title),c(me(d.accountId,d.accountType,d.classId,d.period)))},[E,d,c]);let M=d;d!=null&&I!=null&&(M={...d,period:I});const O=[r,s,u,h,D,g,Y].filter(f=>f!=null);return l&&M!=null?i.jsx(Oe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:M,referrerType:a,onSelectedTimePeriodChange:f=>p(f),...e}):i.jsx(C,{to:Te(O.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ge=(a,e,t,n,c,o,r)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&r!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),_e=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();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)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=$e(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,timeframe:u,startDate:h,endDate:D,titleEncoded:g,excludeSubAccounts:Y}=Q(),y=P(r??""),S=P(s??""),k=P(g??""),j=!(Y!=null&&Y==="exclude_subaccounts"),z=L(b=>Ie(b.transactionListState,S,y)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(b=>R(b)),$=N.company?.featuresActivationInfo.connectedAccountProvider==="unit",d=N.company?.companyInfo.firstMonthOfFY??1;let l;const M=we(y,S,u,h,D,k);if(M){const b={startDate:x(h,"YYYY-MM-DD"),endDate:x(D,"YYYY-MM-DD")},ye=Re(z?.dateRange,b);l={accountId:S,accountType:H(y),title:k,timeframe:u,period:ye}}let O=l;l!=null&&I!=null&&(O={...l,period:I});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(J.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Ee();A.useEffect(()=>{!E&&l!=null&&oe&&(m(!0),B.trackTransactionList(l.accountId,void 0,a,l.title),c(pe(l.accountId,l.accountType,l.period,void 0,!1,j)))},[E,l,c,oe]);const ge=[r,s,u,h,D,g].filter(b=>b!=null);return M&&O!=null?i.jsx(_e,{firstMonthOfFY:d,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:b=>p(b),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},we=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,Re=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),$e=a=>`/${a}/transactions/${Ye}/statements`;function mt(){const a=w().state?.referrer,e=Pe.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(J.isExpenseAutomationEnabled),o=L(u=>u.expenseAutomationViewState.selectedPeriodByTenantId)[L(u=>R(u)).tenantId],{isFeatureEnabled:r}=n(J.isExpenseAutomationEnabledV2),s=r||c&&t;return i.jsxs(Ae,{children:[i.jsx(v,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(v,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/uncategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/uncategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/missing-receipts/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Fe,{referrerType:a})})]})}export{mt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-BPC8B-82.js";import{j as B,u as U,h as M,l as O,g as f,N as L,k as N,n as Te,o as k}from"./core-D5Hit8x-.js";import{ck as V,eN as D,MB as R,D7 as ae,fc as Z,CR as ne,MD as Ie,Da as we,Mz as ke,MA as se,MR as be,Bh as Ae,s6 as je,MF as Ee,Dl as ve,MC as re,cN as W,wc as oe,eR as De,eT as Fe,NM as Le,NN as Be,CS as Ue,NO as Me,CT as Re,D0 as Pe,bv as Oe,bD as Ne,cv as Ve,bE as _e,cj as ze,fb as $e,bs as Ge,Il as He,ci as Ze}from"./zeni-epic-state-CVuyWhoX.js";import{A as _,al as We,z as j,w as z,e as b,b_ as Ke,b$ as qe,c0 as H,Z as K,h as Je,J as Qe,H as Xe,a as ie,d as v,C as Ye,v as et,c1 as tt,ao as q,r as at,c2 as nt,p as J,c3 as st,T as X,c4 as rt,a4 as ot}from"./index-C7yI3-qS.js";import{D as it,n as P,S as ct}from"./mui-DW04nVBh.js";import lt from"./NotFoundScreen-By6iX_AK.js";import{S as Y}from"./SetupPagesScreen-sAZpJNGi.js";import{a as d}from"./sentry-CWaXw80H.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import{c as dt}from"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import{M as ce}from"./MobileAppDrawer-DuACKsl0.js";import{F as pt}from"./FeaturePreviewScreen-C9nGcb2y.js";import{a as ee}from"./analyticsHelper-DPM8WM8o.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.js";import"./routePaths-DpkdUp-r.js";import"./BusinessVerificationPageScreen-DkwOmH2q.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]="125b3abc-0923-4ea7-a9b4-54154d4faead",t._sentryDebugIdIdentifier="sentry-dbid-125b3abc-0923-4ea7-a9b4-54154d4faead")}catch{}})();const mt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}})(Ke);function ft(){const t=B(),a=U(),n=M(),{tenantEmailDomain:o}=O(),p=_(),r=f(w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=We(r),s=V(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,I]=d.useState(!1),[u,l]=d.useState(!1),g=f(w=>D(w)),h=j.getSignedInUserTenant(o)?.companyId??g.companyId,C=j.getSignedInUser(),S=f(w=>R(w,h)),T=f(w=>w.treasurySetupViewState.fetchState),x=f(w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||T!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,T,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(Z()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(I(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const yt=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{H(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{H(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(Ae(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(qe),gt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=O(),o=M(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),C=j.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>ke(x)),T=f(x=>R(x,C));if(j.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||C==null||(s(!0),o(ae(C,!0,!1)))},[m,u,C,o]),d.useEffect(()=>{c||l!=="Not-Started"||C==null||(i(!0),o(Z()))},[c,l,C,o]),d.useEffect(()=>{y||g!=="Not-Started"||C==null||(I(!0),o(ne()))},[y,g,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{H(b,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ht=P.div`
1
+ import{j as e}from"./liveblocks-DZqP4zBd.js";import{j as L,u as U,h as M,l as O,g as f,N as B,k as N,n as Ce,o as k}from"./core-DZxCQ5Bu.js";import{ck as V,eN as D,MB as R,D7 as ae,fc as H,CR as ne,MD as Te,Da as we,Mz as ke,MA as se,MR as be,Bh as Ae,s6 as je,MF as Ee,Dl as ve,MC as re,cN as W,wc as oe,eR as De,eT as Fe,NM as Be,NN as Le,CS as Ue,NO as Me,CT as Re,D0 as Pe,bv as Oe,bD as Ne,cv as Ve,bE as _e,cj as ze,fb as $e,bs as Ge,Il as Ze,ci as He}from"./zeni-epic-state-Bd5L4xLB.js";import{A as _,al as We,z as j,w as z,e as b,b_ as Ke,b$ as qe,c0 as Z,Z as K,h as Je,J as Qe,I as Xe,a as ie,d as v,y as Ye,B as et,c1 as tt,ao as q,r as at,c2 as nt,p as J,c3 as st,m as X,c4 as rt,a4 as ot}from"./index-CtQjNzsr.js";import{D as it,n as P,S as ct}from"./mui-JGW0YBlw.js";import lt from"./NotFoundScreen-CVO1T_j5.js";import{S as Y}from"./SetupPagesScreen-cNU649a3.js";import{a as d}from"./sentry-BX7ktq7C.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-CYJ1ZXIh.js";import{c as dt}from"./useFetchSuggestedQuestionsWhenReady-k28J-Ry_.js";import{M as ce}from"./MobileAppDrawer-8wMyvvdV.js";import{F as pt}from"./FeaturePreviewScreen-BLO6Bexe.js";import{a as ee}from"./analyticsHelper-BlCfitSU.js";import"./recharts-_nzHAC1j.js";import"./analytics-bOU2NuQd.js";import"./plaid-DYvRZGjg.js";import"./dnd-DlOyvOfI.js";import"./stripe-DMRn4zHo.js";import"./lottie-FsLW8B91.js";import"./lexical-DrUvlKRq.js";import"./pdf-CGAiVFsk.js";import"./utils-2p1Ymknq.js";import"./routePaths-D0N0HcnI.js";import"./BusinessVerificationPageScreen-CxlnwjVC.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]="9b7ddb07-fdee-43a0-9172-da71baf03b09",t._sentryDebugIdIdentifier="sentry-dbid-9b7ddb07-fdee-43a0-9172-da71baf03b09")}catch{}})();const mt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Te(r))}}})(Ke);function ft(){const t=L(),a=U(),n=M(),{tenantEmailDomain:o}=O(),p=_(),r=f(w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=We(r),s=V(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,T]=d.useState(!1),[u,l]=d.useState(!1),g=f(w=>D(w)),h=j.getSignedInUserTenant(o)?.companyId??g.companyId,I=j.getSignedInUser(),S=f(w=>R(w,h)),C=f(w=>w.treasurySetupViewState.fetchState),x=f(w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(I==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||C!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,C,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(H()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(T(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(B,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||C!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const yt=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(Ae(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(qe),gt=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=M(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,T]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),I=j.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>ke(x)),C=f(x=>R(x,I));if(j.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||I==null||(s(!0),o(ae(I,!0,!1)))},[m,u,I,o]),d.useEffect(()=>{c||l!=="Not-Started"||I==null||(i(!0),o(H()))},[c,l,I,o]),d.useEffect(()=>{y||g!=="Not-Started"||I==null||(T(!0),o(ne()))},[y,g,I,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:C,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{Z(b,"review",S.treasuryTransferMoneyLocalData,C.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ht=P.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as e}from"./liveblocks-BPC8B-82.js";import{j as B,u as U,h as M,l as O,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:c=>{let i="page-not-found";c==="editPortfolio"?i=Ct(s):c==="statements"?i=Tt(s):c==="taxLetter"?i=It(s):c==="settings"&&(i=wt(s));const y=at(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(Le({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(tt);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=B(),p=M(),r=K(),m=Je(),s=f(A=>D(A)),{tenantEmailDomain:c}=O(),i=s.companyId??j.getSignedInUserTenant(c)?.companyId,[y,I]=d.useState(!1),u=f(A=>re(A)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(A=>A.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),T=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Qe();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(I(!0),p(oe(!0)))},[y,p,l,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const w=()=>{o("..")},[le,ue]=d.useState(!1),Q=A=>{ue(A)},{isAiCfoOpen:de,setIsAiCfoOpen:pe}=Xe(),{isAiCfoAccessEnabled:me,onAskAiCfoClick:fe}=ut({isAiCfoOpen:de,setIsAiCfoOpen:pe,mobileExploreReferrer:"Treasury"});dt({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:ye}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ge}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:he}=$(v.isTreasuryCommentingEnabled),Se=De(s),xe=Fe(ye,s);if(Se===!0&&xe!==!0)return e.jsx(pt,{});if(C){const A=h?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&h?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(kt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(gt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(ft,{}):null]})}),e.jsxs(ht,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(xt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:ge,navigate:o,currentTenant:s,location:n,companyId:i,analytics:b,isTreasuryCommentingEnabled:he,handleDrawerToggle:Q,isLoading:A,isAiCfoAccessEnabled:me,onAskAiCfoClick:fe})]})]})}return T&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!T&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const Ct=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,kt=P(ct)`
9
+ `,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:c=>{let i="page-not-found";c==="editPortfolio"?i=It(s):c==="statements"?i=Ct(s):c==="taxLetter"?i=Tt(s):c==="settings"&&(i=wt(s));const y=at(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(Be({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(tt);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=L(),p=M(),r=K(),m=Je(),s=f(A=>D(A)),{tenantEmailDomain:c}=O(),i=s.companyId??j.getSignedInUserTenant(c)?.companyId,[y,T]=d.useState(!1),u=f(A=>re(A)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(A=>A.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),I=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),C=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Qe();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(T(!0),p(oe(!0)))},[y,p,l,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const w=()=>{o("..")},[le,ue]=d.useState(!1),Q=A=>{ue(A)},{isAiCfoOpen:de,setIsAiCfoOpen:pe}=Xe(),{isAiCfoAccessEnabled:me,onAskAiCfoClick:fe}=ut({isAiCfoOpen:de,setIsAiCfoOpen:pe,mobileExploreReferrer:"Treasury"});dt({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:ye}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ge}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:he}=$(v.isTreasuryCommentingEnabled),Se=De(s),xe=Fe(ye,s);if(Se===!0&&xe!==!0)return e.jsx(pt,{});if(I){const A=h?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&h?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(kt,{onClick:Ie=>Ie.stopPropagation(),children:[t===!0?e.jsx(gt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(ft,{}):null]})}),e.jsxs(ht,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(xt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:ge,navigate:o,currentTenant:s,location:n,companyId:i,analytics:b,isTreasuryCommentingEnabled:he,handleDrawerToggle:Q,isLoading:A,isAiCfoAccessEnabled:me,onAskAiCfoClick:fe})]})]})}return C&&x?e.jsx(B,{to:"../setup"}):s.companyTreasuryInfo?.info&&!C&&F?e.jsx(B,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const It=t=>`/${t}/treasury/edit-portfolio`,Ct=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,kt=P(ct)`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  flex-direction: column;
@@ -18,7 +18,7 @@ import{j as e}from"./liveblocks-BPC8B-82.js";import{j as B,u as U,h as M,l as O,
18
18
  flex-direction: column;
19
19
  align-items: center;
20
20
  background-color: ${t=>t.theme.colors.grey4};
21
- `;function At(){const t=B(),a=M(),n=K(),o=U(),p=`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Be(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))},[r,s.fetchState,a]);const c=j.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:I,statementListView:s,isLoading:u,onBackClick:()=>{const l=J(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const jt=P.div`
21
+ `;function At(){const t=L(),a=M(),n=K(),o=U(),p=`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Le(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))},[r,s.fetchState,a]);const c=j.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:T,statementListView:s,isLoading:u,onBackClick:()=>{const l=J(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const jt=P.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-BPC8B-82.js";import{j as B,u as U,h as M,l as O,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${t=>t.theme.colors.grey4};
29
- `;function Et(){const t=B(),a=K(),n=U(),o=M(),p=`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Me(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Re(!1)))},[r,s.fetchState,o]);const c=j.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(jt,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=J(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const vt=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(Pe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(rt),Dt=()=>{const t=B(),a=U(),n=M(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,c]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||y==null||(c(!0),n(Z()))},[i,n]);const y=j.getSignedInUserTenant(o)?.companyId??m.companyId,I=j.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const g=_(),h=V(g?.loggedInUserRoleMap),C=W(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||C)){if(a.state?.message==="activation"){const S=J(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=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(vt,{analytics:b,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=P.div`
29
+ `;function Et(){const t=L(),a=K(),n=U(),o=M(),p=`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Me(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Re(!1)))},[r,s.fetchState,o]);const c=j.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(jt,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=J(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const vt=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(Pe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(rt),Dt=()=>{const t=L(),a=U(),n=M(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,c]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||y==null||(c(!0),n(H()))},[i,n]);const y=j.getSignedInUserTenant(o)?.companyId??m.companyId,T=j.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(T==null)throw Error("Can't access treasury promo page without signing in...");const g=_(),h=V(g?.loggedInUserRoleMap),I=W(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(B,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||I)){if(a.state?.message==="activation"){const S=J(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=>(C=>C.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(vt,{analytics:b,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=P.div`
30
30
  display: flex;
31
31
  width: 100%;
32
32
  height: 100%;
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-BPC8B-82.js";import{j as B,u as U,h as M,l as O,
34
34
  justify-content: center;
35
35
  align-items: center;
36
36
  background-color: ${t=>t.theme.colors.grey5};
37
- `;function ta(){const t=U(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=W(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&_e(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(v.isDepositAccountsFeatureEnabled),u=I&&!s&&ze(r?.loggedInUserRoleMap),l=a.company!=null&&$e(a.company),g=o&&l===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(v.isDebitCardFeatureEnabled),S=ot(a,h,C)&&!s&&Ge(r?.loggedInUserRoleMap),T=He(r?.loggedInUserRoleMap),x=Ze(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Te,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:T,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),g?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):p&&g?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};
37
+ `;function ta(){const t=U(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=W(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&_e(r?.loggedInUserRoleMap),{isFeatureEnabled:T}=n(v.isDepositAccountsFeatureEnabled),u=T&&!s&&ze(r?.loggedInUserRoleMap),l=a.company!=null&&$e(a.company),g=o&&l===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=n(v.isDebitCardFeatureEnabled),S=ot(a,h,I)&&!s&&Ge(r?.loggedInUserRoleMap),C=Ze(r?.loggedInUserRoleMap),x=He(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ce,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),g?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):p&&g?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80H.js";import{j as M,u as q,l as J,g as S,k as G,h as Y,n as nt,o as B,N as K}from"./core-D5Hit8x-.js";import{eN as O,Jh as Ee,Ji as Ue,fP as ee,cq as be,cr as ke,uN as ft,Jj as st,uR as Yt,Hv as te,jr as ae,uL as qt,uF as Ht,Jk as Ne,ux as Qt,uw as Wt,uq as Zt,uC as Xt,uS as ea,Jl as pe,Jm as Me,uy as ta,Jn as he,eY as gt,v5 as vt,u_ as xt,Jo as Tt,nT as Ct,uV as yt,uT as Dt,Jp as It,vc as Et,v9 as bt,uW as kt,vb as Ge,FX as wt,Jq as aa,Jr as na,ct as sa,Js as oa,Jt as la,Ju as me,Jv as ce,Jw as we,Hw as $e,vr as ye,Hu as De,ve as At,uO as Ke,Jx as ia,Hx as Q,Jy as ze,uI as ca,Jz as da,JA as ra,JB as Ye,JC as qe,JD as He,JE as Qe,vl as Ae,JF as jt,v2 as Ft,JG as ua,JH as pa,JI as ha,JJ as ma,JK as Sa,JL as fa,JM as ga,JN as va,si as xa,sj as Ta,GB as Fe,JO as Ca,JP as ya,iQ as Pe,bq as Da,JQ as Ia,JR as Ea,kp as ba,ky as ka,GA as _e,bC as ot,JS as Pt,Gg as _t,JT as wa,JU as Aa,JV as ja,kA as Fa,JW as lt,JX as it,JY as ct,JZ as dt,J_ as Pa,kw as _a,J$ as Va,kz as La,K0 as Oa,K1 as Vt,GX as Lt,jP as Ba,K2 as Ja,K3 as Ve,K4 as Ot,GV as Bt,xE as Ra,K5 as Ua,K6 as Na,k7 as Jt,K7 as Ma,K8 as Ga,H7 as $a,p_ as Ka,K9 as Rt,Ka as rt,H4 as Le,Kb as ut,Kc as za,H9 as Ya,Kd as qa,Ke as Ha,Kf as Qa,Kg as Wa,Kh as Za,q1 as Xa,Ki as en,Hy as tn,Kj as an,GO as Oe,gy as nn,Kk as sn,Kl as on,gw as ln,Km as cn,Kn as dn,xI as rn,Ko as un,Kp as pn,Kq as hn,Kr as mn,jT as Sn,bn as fn,eT as gn,eR as vn}from"./zeni-epic-state-CVuyWhoX.js";import{z as R,al as Be,v as Ut,w as Z,e as P,M as X,ar as xn,r as N,D as Ie,x as de,as as We,at as Tn,au as Cn,p as Ze,av as yn,h as Dn,Z as re,C as Xe,a as ne,d as z,aw as In,j as et,H as Se,ax as En,ay as Nt,J as bn,az as kn,A as wn,aA as An,ao as Mt,aB as jn,o as W,S as Fn,F as Gt,Q as Pn,aC as _n,aD as Vn,g as tt,aE as Ln,aF as On,m as Bn,aG as Jn,aH as Rn}from"./index-C7yI3-qS.js";import{n as U,D as Un,S as $t}from"./mui-DW04nVBh.js";import{t as Nn,A as Mn}from"./AddressScreen-Cw-dklU2.js";import ie from"./NotFoundScreen-By6iX_AK.js";import{F as Gn}from"./FeaturePreviewScreen-C9nGcb2y.js";import{b as H,v as at,c as $n}from"./routePaths-DpkdUp-r.js";import{p as Kt}from"./pathToGoBack-DqR4pfCe.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import{c as ge}from"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import{M as ve}from"./MobileAppDrawer-DuACKsl0.js";import{D as Kn}from"./DrawerScreen-DMCWWoqu.js";import{g as zn,m as Yn}from"./accountMappingHelper-L2gJ16H8.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="fc31f3d2-6ef8-4432-a206-f83dabeea345",e._sentryDebugIdIdentifier="sentry-dbid-fc31f3d2-6ef8-4432-a206-f83dabeea345")}catch{}})();const qn=Ie.getLocalizedStrings(),Hn=G(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(st({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(st({selectedTransaction:void 0})),e(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${H(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(ft(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(xn),Qn=({setShouldNavigateBack:e})=>{const a=M(),s=q(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>O(f)),d=Ee(o)??"accrued_expenses",u=R.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,d)),m=i.selectedJELinkRowIndex,r=S(f=>ee(f,c.companyId)),p=Be(i.updateStatus.fetchState);g.useEffect(()=>{p==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[p,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const h=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[h===!0?l.jsx(Z,{analytics:P,onLoad:()=>{Wn(i,d,r)}}):null,l.jsx(Hn,{signedInUser:u,attachmentEndPoint:`${X}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:d,navigate:a,analytics:P,controllerUserDetails:r,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},zt=e=>{const a=qn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,d=c.some(m=>m.isRecommendedTransaction===!0),u=be(s.controllers),i=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:d,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:i})},Zn=U.div`
1
+ import{j as l}from"./liveblocks-DZqP4zBd.js";import{a as g}from"./sentry-BX7ktq7C.js";import{j as M,u as q,l as J,g as S,k as G,h as Y,n as nt,o as B,N as K}from"./core-DZxCQ5Bu.js";import{eN as O,Jh as Ee,Ji as Ue,fP as ee,cq as be,cr as ke,uN as ft,Jj as st,uR as Yt,Hv as te,jr as ae,uL as qt,uF as Ht,Jk as Ne,ux as Wt,uw as Qt,uq as Zt,uC as Xt,uS as ea,Jl as pe,Jm as Me,uy as ta,Jn as he,eY as gt,v5 as vt,u_ as xt,Jo as Tt,nT as Ct,uV as yt,uT as Dt,Jp as It,vc as Et,v9 as bt,uW as kt,vb as Ge,FX as wt,Jq as aa,Jr as na,ct as sa,Js as oa,Jt as la,Ju as me,Jv as ce,Jw as we,Hw as $e,vr as ye,Hu as De,ve as At,uO as Ke,Jx as ia,Hx as W,Jy as ze,uI as ca,Jz as da,JA as ra,JB as Ye,JC as qe,JD as He,JE as We,vl as Ae,JF as jt,v2 as Ft,JG as ua,JH as pa,JI as ha,JJ as ma,JK as Sa,JL as fa,JM as ga,JN as va,si as xa,sj as Ta,GB as Fe,JO as Ca,JP as ya,iQ as Pe,bq as Da,JQ as Ia,JR as Ea,kp as ba,ky as ka,GA as _e,bC as ot,JS as Pt,Gg as _t,JT as wa,JU as Aa,JV as ja,kA as Fa,JW as lt,JX as it,JY as ct,JZ as dt,J_ as Pa,kw as _a,J$ as Va,kz as La,K0 as Oa,K1 as Vt,GX as Lt,jP as Ba,K2 as Ja,K3 as Ve,K4 as Ot,GV as Bt,xE as Ra,K5 as Ua,K6 as Na,k7 as Jt,K7 as Ma,K8 as Ga,H7 as $a,p_ as Ka,K9 as Rt,Ka as rt,H4 as Le,Kb as ut,Kc as za,H9 as Ya,Kd as qa,Ke as Ha,Kf as Wa,Kg as Qa,Kh as Za,q1 as Xa,Ki as en,Hy as tn,Kj as an,GO as Oe,gy as nn,Kk as sn,Kl as on,gw as ln,Km as cn,Kn as dn,xI as rn,Ko as un,Kp as pn,Kq as hn,Kr as mn,jT as Sn,bn as fn,eT as gn,eR as vn}from"./zeni-epic-state-Bd5L4xLB.js";import{z as R,al as Be,B as Ut,w as Z,e as P,M as X,ar as xn,r as N,D as Ie,x as de,as as Qe,at as Tn,au as Cn,p as Ze,av as yn,h as Dn,Z as re,y as Xe,a as ne,d as z,aw as In,j as et,I as Se,ax as En,ay as Nt,J as bn,az as kn,A as wn,aA as An,ao as Mt,aB as jn,o as Q,S as Fn,F as Gt,W as Pn,aC as _n,aD as Vn,g as tt,aE as Ln,aF as On,s as Bn,aG as Jn,aH as Rn}from"./index-CtQjNzsr.js";import{n as U,D as Un,S as $t}from"./mui-JGW0YBlw.js";import{t as Nn,A as Mn}from"./AddressScreen-C-f6mtJZ.js";import ie from"./NotFoundScreen-CVO1T_j5.js";import{F as Gn}from"./FeaturePreviewScreen-BLO6Bexe.js";import{b as H,v as at,c as $n}from"./routePaths-D0N0HcnI.js";import{p as Kt}from"./pathToGoBack-D-K8tKB7.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-CYJ1ZXIh.js";import{c as ge}from"./useFetchSuggestedQuestionsWhenReady-k28J-Ry_.js";import{M as ve}from"./MobileAppDrawer-8wMyvvdV.js";import{D as Kn}from"./DrawerScreen-k1pxe0v-.js";import{g as zn,m as Yn}from"./accountMappingHelper-E1x5okE5.js";import"./recharts-_nzHAC1j.js";import"./analytics-bOU2NuQd.js";import"./plaid-DYvRZGjg.js";import"./dnd-DlOyvOfI.js";import"./stripe-DMRn4zHo.js";import"./lottie-FsLW8B91.js";import"./lexical-DrUvlKRq.js";import"./pdf-CGAiVFsk.js";import"./utils-2p1Ymknq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="d4b4ab75-6d5e-43ae-a778-1d03832e0005",e._sentryDebugIdIdentifier="sentry-dbid-d4b4ab75-6d5e-43ae-a778-1d03832e0005")}catch{}})();const qn=Ie.getLocalizedStrings(),Hn=G(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(st({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(st({selectedTransaction:void 0})),e(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${H(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(ft(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(xn),Wn=({setShouldNavigateBack:e})=>{const a=M(),s=q(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>O(f)),d=Ee(o)??"accrued_expenses",u=R.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,d)),m=i.selectedJELinkRowIndex,r=S(f=>ee(f,c.companyId)),p=Be(i.updateStatus.fetchState);g.useEffect(()=>{p==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[p,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const h=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[h===!0?l.jsx(Z,{analytics:P,onLoad:()=>{Qn(i,d,r)}}):null,l.jsx(Hn,{signedInUser:u,attachmentEndPoint:`${X}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:d,navigate:a,analytics:P,controllerUserDetails:r,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},zt=e=>{const a=qn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Qn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,d=c.some(m=>m.isRecommendedTransaction===!0),u=be(s.controllers),i=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:d,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:i})},Zn=U.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Xn=G(function(e){const a=O(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ne(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(ft(n,o))},onDelete:o=>{e(ta(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onEditAmount:(o,c)=>{e(ea(n,o,c))},onJELinkClick:o=>{e(Xt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,d)=>{e(Zt(o,c,d))},onTransactionClick:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewPostedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewRecordedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewBillExpense:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onDetailPageChange:(o,c,d)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:i,memo:m,months:r,scheduleAccruedExpenseCategory:p,scheduleClass:h,scheduleExpenseCategory:f,startDate:C,vendor:y}=u,E=h.selectedOption!=null?a.classList.find(k=>k.classId===h.selectedOption):void 0,D=f.selectedOption!=null?a.accountList.find(k=>k.qboId===f.selectedOption):void 0,I=p.selectedOption!=null?a.accruedAccountList.find(k=>k.qboId===p.selectedOption):void 0,w=r?.selectedOption;e(Qt({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),d!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||I==null||y.selectedOption==null||m==null||i==null&&i==0||C==null||w==null||e(Wt({scheduleType:n}))}}})(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=M(),t=q(),n=Y(),o=de(),{tenantEmailDomain:c}=J(),[d,u]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=J();let m;i!=="new"&&(m=i);const r=ts(i),p=S(x=>x.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),h="accrued_expenses",f=S(x=>Ue(x,"accrued_expenses")),C=S(x=>te(x)),y=S(x=>x.classListState.fetchState),E=S(x=>ae(x)),D=C!=="Completed"||y!=="Completed";g.useEffect(()=>{d===!1&&D?(n(qt(h,m)),u(!0)):D===!1&&d===!1&&i!=="new"&&(n(Ht(h,i)),u(!0))},[d]);const I=S(x=>O(x)),w=S(x=>ee(x,I.companyId)),k=f.fetchState,b=f.allAccountList,j=f.allClassList,F=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(r!==!0||f.fetchState==="Error")return l.jsx(ie,{});const L=k==="Completed"&&d===!0;return k!=="Completed"&&k!=="Not-Started"?l.jsx(We,{}):l.jsxs(Zn,{children:[L===!0?l.jsx(Z,{analytics:P,onLoad:()=>{as(f,h,w)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:j,accountList:b,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:p,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:P,controllerUserDetails:w,isAccountingClassesEnabled:E,status:f.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=U.div`
9
+ `,Xn=G(function(e){const a=O(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ne(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(ft(n,o))},onDelete:o=>{e(ta(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onEditAmount:(o,c)=>{e(ea(n,o,c))},onJELinkClick:o=>{e(Xt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,d)=>{e(Zt(o,c,d))},onTransactionClick:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewPostedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewRecordedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewBillExpense:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onDetailPageChange:(o,c,d)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:i,memo:m,months:r,scheduleAccruedExpenseCategory:p,scheduleClass:h,scheduleExpenseCategory:f,startDate:C,vendor:y}=u,E=h.selectedOption!=null?a.classList.find(k=>k.classId===h.selectedOption):void 0,D=f.selectedOption!=null?a.accountList.find(k=>k.qboId===f.selectedOption):void 0,I=p.selectedOption!=null?a.accruedAccountList.find(k=>k.qboId===p.selectedOption):void 0,w=r?.selectedOption;e(Wt({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),d!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||I==null||y.selectedOption==null||m==null||i==null&&i==0||C==null||w==null||e(Qt({scheduleType:n}))}}})(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=M(),t=q(),n=Y(),o=de(),{tenantEmailDomain:c}=J(),[d,u]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=J();let m;i!=="new"&&(m=i);const r=ts(i),p=S(x=>x.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),h="accrued_expenses",f=S(x=>Ue(x,"accrued_expenses")),C=S(x=>te(x)),y=S(x=>x.classListState.fetchState),E=S(x=>ae(x)),D=C!=="Completed"||y!=="Completed";g.useEffect(()=>{d===!1&&D?(n(qt(h,m)),u(!0)):D===!1&&d===!1&&i!=="new"&&(n(Ht(h,i)),u(!0))},[d]);const I=S(x=>O(x)),w=S(x=>ee(x,I.companyId)),k=f.fetchState,b=f.allAccountList,j=f.allClassList,F=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(r!==!0||f.fetchState==="Error")return l.jsx(ie,{});const L=k==="Completed"&&d===!0;return k!=="Completed"&&k!=="Not-Started"?l.jsx(Qe,{}):l.jsxs(Zn,{children:[L===!0?l.jsx(Z,{analytics:P,onLoad:()=>{as(f,h,w)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:j,accountList:b,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:p,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:P,controllerUserDetails:w,isAccountingClassesEnabled:E,status:f.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=U.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Je=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G(function(e){const a=O(e),s=he(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",d=t.state?.message==="expenseAutomation",u=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(d===!0){const i=Ze(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Kt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Ge(c,i,u.length>0))},onDelete:i=>{e(kt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(It({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:r,scheduleDetailsListSection:p}=i,{scheduleClass:h,scheduleExpenseCategory:f,accumulatedDepreciationCategory:C,assetId:y,months:E,startDate:D,postingDate:I,vendor:w}=r,k=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(A=>A.id===w?.selectedOption):void 0,b={id:k?.zeniId??w?.selectedOption??"",name:k?.name??w?.defaultOptions.find(A=>A.value===w?.selectedOption)?.label??"",logo:k?.logo},j=h.selectedOption!=null?a.classList.find(A=>A.classId===h.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(A=>A.qboId===f.selectedOption):void 0,V=C.selectedOption!=null?a.depAccountList.find(A=>A.qboId===C.selectedOption):void 0,L=E?.selectedOption,x=p.map((A,$)=>({...a.scheduleLocalData.jeScheduleDetails[$],amount:{...a.scheduleLocalData.jeScheduleDetails[$].amount,amount:A.amount}})),_=I.type==="day"?I.dayOfMonth?I.dayOfMonth:1:void 0,T=I.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:D,selectedMonths:L,assetId:y,jeScheduleDetails:x,lastDayOfMonth:T,selectedDayOfMonth:_,selectedVendor:b},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&j?.classId==null||D==null||L==null||T!==!0&&_==null||e(Dt({scheduleType:c}))}}})(Cn),os=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),{scheduleDetailId:d}=J(),u=a.state?.message==="expenseAutomation",i=ls(d),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||d!=="new"||e("../schedules/fixed_assets")},[m,d]);const r="fixed_assets",p=S(T=>he(T,r)),h=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ne(T,"common")),C=S(T=>te(T)),y=S(T=>T.classListState.fetchState),E=S(T=>ae(T)),D=S(T=>gt(T).selectedPeriod),I=C!=="Completed"||y!=="Completed";g.useEffect(()=>{o===!1&&I?(s(vt(r,x,!0)),c(!0)):I===!1&&o===!1&&(s(xt(r,d==="new"?void 0:d,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),u===!0){const{month:T,year:A}=D;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/fixed_assets")},[p.markAsCompleteStatus.fetchState]);const w=S(T=>O(T)),k=S(T=>ee(T,w.companyId)),b=p.fetchState,j=p.allAccountList,F=p.allClassList,V=p.allDepreciationAccountList,L=p.scheduleDetailsLocalData.fixed_assets;let x;if(d!=="new"&&(x=d),i!==!0||p.fetchState==="Error")return l.jsx(ie,{});const _=b==="Completed"&&o===!0;return b!=="Completed"?l.jsx(We,{}):l.jsxs(ns,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{cs(p,r,k)}}):null,l.jsx(ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:h,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},accountList:j,depAccountList:V,scheduleLocalData:L,selectedJEScheduleKey:m,scheduleDetailId:x,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:P,controllerUserDetails:k,isAccountingClassesEnabled:E,status:p.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Je),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Je)??null,endMonth:d.endDate?.format(Je)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=U.div`
17
+ `,Je=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G(function(e){const a=O(e),s=he(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",d=t.state?.message==="expenseAutomation",u=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(d===!0){const i=Ze(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Kt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Ge(c,i,u.length>0))},onDelete:i=>{e(kt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(It({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:r,scheduleDetailsListSection:p}=i,{scheduleClass:h,scheduleExpenseCategory:f,accumulatedDepreciationCategory:C,assetId:y,months:E,startDate:D,postingDate:I,vendor:w}=r,k=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(A=>A.id===w?.selectedOption):void 0,b={id:k?.zeniId??w?.selectedOption??"",name:k?.name??w?.defaultOptions.find(A=>A.value===w?.selectedOption)?.label??"",logo:k?.logo},j=h.selectedOption!=null?a.classList.find(A=>A.classId===h.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(A=>A.qboId===f.selectedOption):void 0,V=C.selectedOption!=null?a.depAccountList.find(A=>A.qboId===C.selectedOption):void 0,L=E?.selectedOption,x=p.map((A,$)=>({...a.scheduleLocalData.jeScheduleDetails[$],amount:{...a.scheduleLocalData.jeScheduleDetails[$].amount,amount:A.amount}})),_=I.type==="day"?I.dayOfMonth?I.dayOfMonth:1:void 0,T=I.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:D,selectedMonths:L,assetId:y,jeScheduleDetails:x,lastDayOfMonth:T,selectedDayOfMonth:_,selectedVendor:b},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&j?.classId==null||D==null||L==null||T!==!0&&_==null||e(Dt({scheduleType:c}))}}})(Cn),os=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),{scheduleDetailId:d}=J(),u=a.state?.message==="expenseAutomation",i=ls(d),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||d!=="new"||e("../schedules/fixed_assets")},[m,d]);const r="fixed_assets",p=S(T=>he(T,r)),h=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ne(T,"common")),C=S(T=>te(T)),y=S(T=>T.classListState.fetchState),E=S(T=>ae(T)),D=S(T=>gt(T).selectedPeriod),I=C!=="Completed"||y!=="Completed";g.useEffect(()=>{o===!1&&I?(s(vt(r,x,!0)),c(!0)):I===!1&&o===!1&&(s(xt(r,d==="new"?void 0:d,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),u===!0){const{month:T,year:A}=D;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/fixed_assets")},[p.markAsCompleteStatus.fetchState]);const w=S(T=>O(T)),k=S(T=>ee(T,w.companyId)),b=p.fetchState,j=p.allAccountList,F=p.allClassList,V=p.allDepreciationAccountList,L=p.scheduleDetailsLocalData.fixed_assets;let x;if(d!=="new"&&(x=d),i!==!0||p.fetchState==="Error")return l.jsx(ie,{});const _=b==="Completed"&&o===!0;return b!=="Completed"?l.jsx(Qe,{}):l.jsxs(ns,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{cs(p,r,k)}}):null,l.jsx(ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:h,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},accountList:j,depAccountList:V,scheduleLocalData:L,selectedJEScheduleKey:m,scheduleDetailId:x,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:P,controllerUserDetails:k,isAccountingClassesEnabled:E,status:p.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Je),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Je)??null,endMonth:d.endDate?.format(Je)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=U.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,11 +22,11 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Re=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G(function(e,a){const s=O(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,d=c.flatMap(u=>u.error).filter(u=>!!u)??[];return{onNavigateBack:()=>{if(n===!0){const u=Ze(a.location.state?.pathnameStackToGoBack),i=u.poppedPathname??Kt(2);a.navigate(i,{state:{pathnameStackToGoBack:u.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e(Ge(a.scheduleTab,u,d.length>0))},onDelete:u=>{e(kt(a.scheduleTab,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(u,i)=>{e(Et(a.scheduleTab,u,i))},onJELinkClick:u=>{e(It({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,i)=>{u.trim().length>=2?e(Me({searchString:u,entityType:i,searchOrigin:"common"})):u.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(u,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:r}=u,{scheduleClass:p,scheduleExpenseCategory:h,months:f,startDate:C,postingDate:y,vendor:E}=m,D=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(x=>x.id===E?.selectedOption):void 0,I={id:D?.zeniId??E?.selectedOption??"",name:D?.name??E?.defaultOptions.find(x=>x.value===E?.selectedOption)?.label??"",logo:D?.logo},w=p.selectedOption!=null?a.classList.find(x=>x.classId===p.selectedOption):void 0,k=h.selectedOption!=null?a.accountList.find(x=>x.qboId===h.selectedOption):void 0,b=f?.selectedOption,j=r.map((x,_)=>({...a.scheduleLocalData.jeScheduleDetails[_],amount:{...a.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}})),F=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,V=y.type==="lastDayOfMonth"||void 0,L={selectedAccount:k?.accountId,selectedClass:w?.classId,selectedDate:C,selectedMonths:b,jeScheduleDetails:j,lastDayOfMonth:V,selectedVendor:I,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:L,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||k?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||C==null||b==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),us=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),d=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:i}=J(),m=ps(u,i),r=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{r!=null&&r.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[r,i]);const p=Ee(u)??"prepaid_expenses",h=S(T=>he(T,p)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),C=S(T=>Ne(T,"common")),y=S(T=>te(T)),E=S(T=>T.classListState.fetchState),D=S(T=>ae(T)),I=S(T=>gt(T).selectedPeriod),w=y!=="Completed"||E!=="Completed";g.useEffect(()=>{o===!1&&w?(s(vt(p,x,!0)),c(!0)):w===!1&&o===!1&&(s(xt(p,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(h.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),d===!0){const{month:T,year:A}=I;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/prepaid_expenses")},[h.markAsCompleteStatus.fetchState]);const k=S(T=>O(T)),b=S(T=>ee(T,k.companyId)),j=h.fetchState,F=h.allAccountList,V=h.allClassList,L=h.scheduleDetailsLocalData;let x;if(i!=="new"&&(x=i),m!==!0||h.fetchState==="Error")return l.jsx(ie,{});const _=j==="Completed"&&o===!0;return j!=="Completed"?l.jsx(We,{}):l.jsxs(ds,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{ms(h,p,b)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:C,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:C},usedInExpenseAutomation:d,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},expenseAutomationSelectedPeriod:I,navigate:e,classList:V,accountList:F,scheduleLocalData:L[p],selectedJEScheduleKey:r,scheduleDetailId:x,selectedScheduledJournalEntries:h.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:p,analytics:P,controllerUserDetails:b,isAccountingClassesEnabled:D,status:h.selectedJEScheduleTransaction?.status.code})]})},ps=(e,a)=>Ee(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Re)??null,endMonth:d.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Xe(0,0,100,200)},fs=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:d}=he(e,a.scheduleType),u=O(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,r=m!=null?na(e,m):void 0,p=R.getSignedInUser(),h=e.tenantState.currentTenantId,f={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u.tenantId??h},C=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:c[n].jeScheduleDetails[t],saveStatus:d.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:C,isDisabled:d.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:sa(et.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(la({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Ge(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(In),gs=()=>{const e=Dn(),a=M(),s=Y(),{scheduleDetailId:t}=J(),n=re(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=J(),{useFeatureGate:d}=ne(),{isFeatureEnabled:u}=d(z.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,r]=g.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const p=S(D=>he(D,i));g.useEffect(()=>{p.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const h=p.selectedJELinkRowIndex,f=h!=null?p.scheduleDetailsLocalData[i].jeScheduleDetails[h]?.jeLink:null,C=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{C!=null&&s(wt(C))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&h!=null&&(r(!0),s(aa({scheduleType:i,jeScheduleDetailId:t,rowId:h})))});const y=S(D=>O(D)),E=S(D=>ee(D,y.companyId));return l.jsx(Un,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(vs,{onClick:D=>D.stopPropagation(),children:p.fetchState!=="Completed"||p.selectedJEScheduleTransaction==null||h==null?l.jsx(Ut,{fetchState:p.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:h,jeScheduledTransaction:p.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:E,isVendorBulkUpdateOnTransactionEnabled:u})})})},vs=U($t)`
25
+ `,Re=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G(function(e,a){const s=O(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,d=c.flatMap(u=>u.error).filter(u=>!!u)??[];return{onNavigateBack:()=>{if(n===!0){const u=Ze(a.location.state?.pathnameStackToGoBack),i=u.poppedPathname??Kt(2);a.navigate(i,{state:{pathnameStackToGoBack:u.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e(Ge(a.scheduleTab,u,d.length>0))},onDelete:u=>{e(kt(a.scheduleTab,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(u,i)=>{e(Et(a.scheduleTab,u,i))},onJELinkClick:u=>{e(It({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,i)=>{u.trim().length>=2?e(Me({searchString:u,entityType:i,searchOrigin:"common"})):u.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(u,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:r}=u,{scheduleClass:p,scheduleExpenseCategory:h,months:f,startDate:C,postingDate:y,vendor:E}=m,D=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(x=>x.id===E?.selectedOption):void 0,I={id:D?.zeniId??E?.selectedOption??"",name:D?.name??E?.defaultOptions.find(x=>x.value===E?.selectedOption)?.label??"",logo:D?.logo},w=p.selectedOption!=null?a.classList.find(x=>x.classId===p.selectedOption):void 0,k=h.selectedOption!=null?a.accountList.find(x=>x.qboId===h.selectedOption):void 0,b=f?.selectedOption,j=r.map((x,_)=>({...a.scheduleLocalData.jeScheduleDetails[_],amount:{...a.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}})),F=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,V=y.type==="lastDayOfMonth"||void 0,L={selectedAccount:k?.accountId,selectedClass:w?.classId,selectedDate:C,selectedMonths:b,jeScheduleDetails:j,lastDayOfMonth:V,selectedVendor:I,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:L,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||k?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||C==null||b==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),us=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),d=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:i}=J(),m=ps(u,i),r=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{r!=null&&r.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[r,i]);const p=Ee(u)??"prepaid_expenses",h=S(T=>he(T,p)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),C=S(T=>Ne(T,"common")),y=S(T=>te(T)),E=S(T=>T.classListState.fetchState),D=S(T=>ae(T)),I=S(T=>gt(T).selectedPeriod),w=y!=="Completed"||E!=="Completed";g.useEffect(()=>{o===!1&&w?(s(vt(p,x,!0)),c(!0)):w===!1&&o===!1&&(s(xt(p,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(h.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),d===!0){const{month:T,year:A}=I;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/prepaid_expenses")},[h.markAsCompleteStatus.fetchState]);const k=S(T=>O(T)),b=S(T=>ee(T,k.companyId)),j=h.fetchState,F=h.allAccountList,V=h.allClassList,L=h.scheduleDetailsLocalData;let x;if(i!=="new"&&(x=i),m!==!0||h.fetchState==="Error")return l.jsx(ie,{});const _=j==="Completed"&&o===!0;return j!=="Completed"?l.jsx(Qe,{}):l.jsxs(ds,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{ms(h,p,b)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:C,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:C},usedInExpenseAutomation:d,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},expenseAutomationSelectedPeriod:I,navigate:e,classList:V,accountList:F,scheduleLocalData:L[p],selectedJEScheduleKey:r,scheduleDetailId:x,selectedScheduledJournalEntries:h.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:p,analytics:P,controllerUserDetails:b,isAccountingClassesEnabled:D,status:h.selectedJEScheduleTransaction?.status.code})]})},ps=(e,a)=>Ee(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Re)??null,endMonth:d.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Xe(0,0,100,200)},fs=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:d}=he(e,a.scheduleType),u=O(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,r=m!=null?na(e,m):void 0,p=R.getSignedInUser(),h=e.tenantState.currentTenantId,f={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u.tenantId??h},C=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:c[n].jeScheduleDetails[t],saveStatus:d.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:C,isDisabled:d.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:sa(et.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(la({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Ge(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(In),gs=()=>{const e=Dn(),a=M(),s=Y(),{scheduleDetailId:t}=J(),n=re(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=J(),{useFeatureGate:d}=ne(),{isFeatureEnabled:u}=d(z.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,r]=g.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const p=S(D=>he(D,i));g.useEffect(()=>{p.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const h=p.selectedJELinkRowIndex,f=h!=null?p.scheduleDetailsLocalData[i].jeScheduleDetails[h]?.jeLink:null,C=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{C!=null&&s(wt(C))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&h!=null&&(r(!0),s(aa({scheduleType:i,jeScheduleDetailId:t,rowId:h})))});const y=S(D=>O(D)),E=S(D=>ee(D,y.companyId));return l.jsx(Un,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(vs,{onClick:D=>D.stopPropagation(),children:p.fetchState!=="Completed"||p.selectedJEScheduleTransaction==null||h==null?l.jsx(Ut,{fetchState:p.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:h,jeScheduledTransaction:p.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:E,isVendorBulkUpdateOnTransactionEnabled:u})})})},vs=U($t)`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  flex-direction: column;
29
- `,xe=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},Te=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Ce=()=>{const e=q(),a=Y(),s=S(t=>me(t));return g.useEffect(()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ce(n))}},[e.pathname,s.currentTab,a]),s},se="accrued_expenses",xs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(At(se))},onScroll:t=>{e(Ye({scheduleType:se,scrollYOffset:t}))},onClickNewButton:()=>{e(da()),e(ra()),P.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ca({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:se,fetchState:t}))}}})(En),Ts=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),[d,u]=g.useState(!1),i=M(),m=Y(),{useFeatureGate:r}=ne(),p=de();Ce();const{isFeatureEnabled:h,isFeatureGateLoading:f}=r(z.isOpexByVendorFeatureEnabled),C=R.getSignedInUser(),y=S(v=>O(v)),E={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:y.tenantId},D=g.useMemo(()=>({authParams:E,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:y.companyName}),[]),[I,w]=g.useState(!1),k=S(v=>te(v)),b=S(v=>$e(v,"accrued_expenses")),j=e.includes("prepaid_expenses"),F=e.includes("fixed_assets"),V=e.includes("accrued_expenses");g.useEffect(()=>{(j||F||V)&&I===!1&&k!=="Completed"&&(m(ye()),w(!0))},[I]),g.useEffect(()=>{f===!1&&(m(De({shouldFetchAccruedExpenses:V,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:j,shouldFetchOpexByVendor:h,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[k,F,f,h]),g.useEffect(()=>{o===!1&&b==="Completed"&&m(At("accrued_expenses",{selectedTimeframe:Ke("accrued_expenses"),selectedCategoryId:"all"},!0))},[o,b]);const L=S(v=>ia(v,se)),{isAiCfoAccessEnabled:x,onAskAiCfoClick:_}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Accrued Expenses"});ge({isDataReady:L.fetchState==="Completed"});const T=S(v=>Q(v).isReportGenerated);S(v=>Q(v).fetchState)!=="Completed"||T!==!0||h!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),V||i("../opex");const A=S(v=>ee(v,y.companyId)),$=v=>{u(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:d,handleDrawerToggle:$}),l.jsx(xs,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:L,downloadParams:D,themeState:p,vendorTabsToShow:e,analytics:P,controllerUserDetails:A,isAiCfoAccessEnabled:x,onAskAiCfoClick:_,onClickMenuIcon:()=>$(!0)})]})},oe="fixed_assets",Cs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(Ae(oe))},onScroll:t=>{e(Ye({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:oe,fetchState:t}))}}})(Nt),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y();Ce();const{useFeatureGate:i}=ne(),m=de(),{isFeatureEnabled:r,isFeatureGateLoading:p}=i(z.isOpexByVendorFeatureEnabled),h=R.getSignedInUser(),f=S(v=>O(v)),C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f.tenantId},y=g.useMemo(()=>({authParams:C,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[E,D]=g.useState(!1),I=S(v=>te(v)),w=S(v=>$e(v,"fixed_assets")),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&E===!1&&I!=="Completed"&&(u(ye()),D(!0))},[E]),g.useEffect(()=>{p===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:k,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[I,b,p,r]),g.useEffect(()=>{o===!1&&w==="Completed"&&u(Ae("fixed_assets",{selectedTimeframe:Ke("fixed_assets"),selectedCategoryId:"all"},!0))},[o,w]);const F=S(v=>jt(v,oe)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Fixed Assets"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>Q(v).isReportGenerated);S(v=>Q(v).fetchState)!=="Completed"||x!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),b||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(Cs,{navigate:d,scheduleListReport:F,downloadParams:y,previousTabPosition:a,setPreviousTabPosition:s,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},Ds=U.div`
29
+ `,xe=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},Te=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Ce=()=>{const e=q(),a=Y(),s=S(t=>me(t));return g.useEffect(()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ce(n))}},[e.pathname,s.currentTab,a]),s},se="accrued_expenses",xs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(At(se))},onScroll:t=>{e(Ye({scheduleType:se,scrollYOffset:t}))},onClickNewButton:()=>{e(da()),e(ra()),P.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ca({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:se,fetchState:t}))}}})(En),Ts=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),[d,u]=g.useState(!1),i=M(),m=Y(),{useFeatureGate:r}=ne(),p=de();Ce();const{isFeatureEnabled:h,isFeatureGateLoading:f}=r(z.isOpexByVendorFeatureEnabled),C=R.getSignedInUser(),y=S(v=>O(v)),E={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:y.tenantId},D=g.useMemo(()=>({authParams:E,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:y.companyName}),[]),[I,w]=g.useState(!1),k=S(v=>te(v)),b=S(v=>$e(v,"accrued_expenses")),j=e.includes("prepaid_expenses"),F=e.includes("fixed_assets"),V=e.includes("accrued_expenses");g.useEffect(()=>{(j||F||V)&&I===!1&&k!=="Completed"&&(m(ye()),w(!0))},[I]),g.useEffect(()=>{f===!1&&(m(De({shouldFetchAccruedExpenses:V,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:j,shouldFetchOpexByVendor:h,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[k,F,f,h]),g.useEffect(()=>{o===!1&&b==="Completed"&&m(At("accrued_expenses",{selectedTimeframe:Ke("accrued_expenses"),selectedCategoryId:"all"},!0))},[o,b]);const L=S(v=>ia(v,se)),{isAiCfoAccessEnabled:x,onAskAiCfoClick:_}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Accrued Expenses"});ge({isDataReady:L.fetchState==="Completed"});const T=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||T!==!0||h!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),V||i("../opex");const A=S(v=>ee(v,y.companyId)),$=v=>{u(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:d,handleDrawerToggle:$}),l.jsx(xs,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:L,downloadParams:D,themeState:p,vendorTabsToShow:e,analytics:P,controllerUserDetails:A,isAiCfoAccessEnabled:x,onAskAiCfoClick:_,onClickMenuIcon:()=>$(!0)})]})},oe="fixed_assets",Cs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(Ae(oe))},onScroll:t=>{e(Ye({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:oe,fetchState:t}))}}})(Nt),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y();Ce();const{useFeatureGate:i}=ne(),m=de(),{isFeatureEnabled:r,isFeatureGateLoading:p}=i(z.isOpexByVendorFeatureEnabled),h=R.getSignedInUser(),f=S(v=>O(v)),C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f.tenantId},y=g.useMemo(()=>({authParams:C,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[E,D]=g.useState(!1),I=S(v=>te(v)),w=S(v=>$e(v,"fixed_assets")),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&E===!1&&I!=="Completed"&&(u(ye()),D(!0))},[E]),g.useEffect(()=>{p===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:k,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[I,b,p,r]),g.useEffect(()=>{o===!1&&w==="Completed"&&u(Ae("fixed_assets",{selectedTimeframe:Ke("fixed_assets"),selectedCategoryId:"all"},!0))},[o,w]);const F=S(v=>jt(v,oe)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Fixed Assets"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||x!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),b||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(Cs,{navigate:d,scheduleListReport:F,downloadParams:y,previousTabPosition:a,setPreviousTabPosition:s,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},Ds=U.div`
30
30
  display: flex;
31
31
  min-height: 100%;
32
32
  width: 100%;
@@ -34,7 +34,7 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
34
34
  flex-direction: column;
35
35
  align-items: center;
36
36
  background-color: ${e=>e.theme.colors.grey4};
37
- `,Is=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=O(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},d=Q(e),u=ua(e);return{report:d,uiState:u,isAccountingClassesEnabled:ae(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${X}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(xa(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(va(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(ga({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(fa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrSearchStarted:t=>{e(Sa(t))},onPageFetchStarted:()=>{e(ma(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(pa({timeframe:t}))}}})(kn);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled),f=S(_=>Q(_));if(m==null)throw Error("Can't access opex by vendor page without signing in...");Ce();const[C,y]=g.useState(!1),E=S(_=>te(_)),D=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),w=e.includes("accrued_expenses"),k=S(_=>me(_)),{isAiCfoAccessEnabled:b,onAskAiCfoClick:j}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});ge({isDataReady:f.fetchState==="Completed"&&f.isReportGenerated===!0});const{areTenantIdsInSync:F}=bn();g.useEffect(()=>{(D||I||w)&&C===!1&&E!=="Completed"&&F&&(c(ye()),y(!0))},[C,F]),g.useEffect(()=>{F&&c(De({shouldFetchAccruedExpenses:w,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:D,shouldFetchOpexByVendor:p===!0&&h===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[E,I,h,p,F]),f.fetchState!=="Completed"||f.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(f.isReportGenerated===!1&&f.fetchState==="Completed"||p===!1&&h===!1)&&o("../summary");const[V,L]=g.useState(!1),x=_=>{L(_)};return l.jsxs(Ds,{windowSize:i,children:[f.fetchState==="Completed"?l.jsx(Z,{analytics:P,onLoad:_=>{k.previousTab==null?_.trackVendorOperatingExpensesPageLoaded("Side Panel"):_.trackVendorOperatingExpenses(k.currentTab,k.previousTab??null)}}):null,l.jsx(ve,{isAppContentDrawerOpen:V,handleDrawerToggle:x}),l.jsx(Is,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:b,onAskAiCfoClick:j,onClickMenuIcon:()=>{x(!0)}})]})}const le="prepaid_expenses",bs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(Ae(le))},onScroll:t=>{e(Ye({scheduleType:le,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:le,fetchState:t}))}}})(Nt),ks=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y(),{useFeatureGate:i}=ne(),m=de();Ce();const r=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:h}=i(z.isOpexByVendorFeatureEnabled),f=S(v=>O(v)),C=S(v=>$e(v,"prepaid_expenses")),y={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:f.tenantId},E=g.useMemo(()=>({authParams:y,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[D,I]=g.useState(!1),w=S(v=>te(v)),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&D===!1&&w!=="Completed"&&(u(ye()),I(!0))},[D]),g.useEffect(()=>{o===!1&&C==="Completed"&&u(Ae("prepaid_expenses",{selectedTimeframe:Ke("prepaid_expenses"),selectedCategoryId:"all"},!0))},[o,C]),g.useEffect(()=>{h===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[w,b,h,p]);const F=S(v=>jt(v,le)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Prepaid Expenses"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>Q(v).isReportGenerated);S(v=>Q(v).fetchState)!=="Completed"||x!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(bs,{navigate:d,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:E,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},ws=U.div`
37
+ `,Is=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=O(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},d=W(e),u=ua(e);return{report:d,uiState:u,isAccountingClassesEnabled:ae(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${X}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(xa(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(va(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(ga({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(fa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrSearchStarted:t=>{e(Sa(t))},onPageFetchStarted:()=>{e(ma(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(pa({timeframe:t}))}}})(kn);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled),f=S(_=>W(_));if(m==null)throw Error("Can't access opex by vendor page without signing in...");Ce();const[C,y]=g.useState(!1),E=S(_=>te(_)),D=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),w=e.includes("accrued_expenses"),k=S(_=>me(_)),{isAiCfoAccessEnabled:b,onAskAiCfoClick:j}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});ge({isDataReady:f.fetchState==="Completed"&&f.isReportGenerated===!0});const{areTenantIdsInSync:F}=bn();g.useEffect(()=>{(D||I||w)&&C===!1&&E!=="Completed"&&F&&(c(ye()),y(!0))},[C,F]),g.useEffect(()=>{F&&c(De({shouldFetchAccruedExpenses:w,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:D,shouldFetchOpexByVendor:p===!0&&h===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[E,I,h,p,F]),f.fetchState!=="Completed"||f.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(f.isReportGenerated===!1&&f.fetchState==="Completed"||p===!1&&h===!1)&&o("../summary");const[V,L]=g.useState(!1),x=_=>{L(_)};return l.jsxs(Ds,{windowSize:i,children:[f.fetchState==="Completed"?l.jsx(Z,{analytics:P,onLoad:_=>{k.previousTab==null?_.trackVendorOperatingExpensesPageLoaded("Side Panel"):_.trackVendorOperatingExpenses(k.currentTab,k.previousTab??null)}}):null,l.jsx(ve,{isAppContentDrawerOpen:V,handleDrawerToggle:x}),l.jsx(Is,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:b,onAskAiCfoClick:j,onClickMenuIcon:()=>{x(!0)}})]})}const le="prepaid_expenses",bs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(Ae(le))},onScroll:t=>{e(Ye({scheduleType:le,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:le,fetchState:t}))}}})(Nt),ks=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y(),{useFeatureGate:i}=ne(),m=de();Ce();const r=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:h}=i(z.isOpexByVendorFeatureEnabled),f=S(v=>O(v)),C=S(v=>$e(v,"prepaid_expenses")),y={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:f.tenantId},E=g.useMemo(()=>({authParams:y,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[D,I]=g.useState(!1),w=S(v=>te(v)),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&D===!1&&w!=="Completed"&&(u(ye()),I(!0))},[D]),g.useEffect(()=>{o===!1&&C==="Completed"&&u(Ae("prepaid_expenses",{selectedTimeframe:Ke("prepaid_expenses"),selectedCategoryId:"all"},!0))},[o,C]),g.useEffect(()=>{h===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[w,b,h,p]);const F=S(v=>jt(v,le)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Prepaid Expenses"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||x!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(bs,{navigate:d,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:E,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},ws=U.div`
38
38
  display: flex;
39
39
  min-height: 100%;
40
40
  width: 100%;
@@ -43,8 +43,8 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
43
43
  align-items: center;
44
44
  background-color: ${e=>e.theme.colors.grey4};
45
45
  `,As=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:d}=a,u=R.getSignedInUser(),i={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:wa(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:d?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:d,location:u,firstMonthOfFY:i}=a,m=()=>{const r=Ze(u.state?.pathnameStackToGoBack),p=r.poppedPathname??((h=2)=>{let f=h;a.isTrendPeriodSelected===!0&&(f=5);let C="../";for(let y=0;y<f;y++)C=`${C}../`;return C})(1);s(p,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,p)=>{const{vendorId:h,vendorName:f,existingCategory:C,existingClass:y,existingOwner:E,selectedCategory:D,selectedClass:I,selectedOwner:w,isRecommendedCategorySelected:k,isRecommendedClassSelected:b,categoryRecommendationTypeSelected:j,classRecommendationTypeSelected:F}=Oa(r,p);h!=null&&P.trackVendorDetailsSave(h,f??"",C,y,E,D,I,w,k,b,j,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(La(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Va(r))},saveVendorDetailLocalData:r=>{n!=null&&e(_a({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,p)=>{e(Pa({vendorId:r,localData:{contacts:p}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&P.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(lt()),e(it()),e(ct()),e(dt()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&P.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Fa("Not-Started",n)),e(lt()),e(it()),e(ct()),e(dt()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)o!=null&&e(Fe(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const p=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(_e(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},i)),e(Fe(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:p}))}},onVendorTabSelectionChanged:r=>{e(ja(r))},onAddressClick:(r,p)=>{if(d==null)return;const h=$n(d,r,p),f=N(u.state?.pathnameStackToGoBack,u.pathname);s(h,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:r=>{e(Aa({collapsableStatus:r}))},onTransactionItemClick:r=>{const p=`${H(r,d)}`,h=N(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:h}})},onLoadPreviousTransactionsClick:(r,p)=>{e(Pt({timePeriod:Pe(r),numberOfQuartersFetched:p})),e(_t(c,Pe(r),!0,!0))}}})(An);function pt({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=q(),n=M(),o=wn(),[c,d]=g.useState(!1),[u,i]=g.useState(!1),[m,r]=g.useState(!1),p=J(),h=p.vendorId,f=p.qboId,{tenantEmailDomain:C,timeframe:y,startDate:E,endDate:D}=p,I={id:f??"",name:"",type:"vendor",zeniId:h??"",qboId:f??""};g.useEffect(()=>{y!=null&&E!=null&&D!=null?d(!0):(d(!1),m===!1&&(r(!0),s(Fe(I,"EntityDetail"))))},[y,E,D]);const w=re(),k=S(v=>O(v)),b=S(v=>h!=null?Ca(v,h,I):void 0),j=S(v=>v.vendorState.vendorByID[h??""]),F=S(v=>O(v).company?.companyInfo.firstMonthOfFY??1),V=S(()=>ya(F,2)),L=Pe({startDate:V.startDate,endDate:Da()}),x=Ia(F),_=S(v=>Ea(v.trendWithTransactionsState,I,"EntityDetail")),[T,A]=g.useState(!1),$=c===!1&&m===!1?void 0:_?.selectedPeriod?.timePeriod??x;return g.useEffect(()=>(e==null&&b?.fetchState!=="Not-Started"||h==null||s(ba(h,I)),()=>{e!=null&&h!=null&&s(ka(h))}),[h,t.state,s]),g.useEffect(()=>{b?.fetchState==="Completed"&&b?.vendorViewDetails.vendorView?.vendorBasic!=null&&((v,ue,je)=>{v.id!=null&&P.trackVendorDetails(v.id,v.name,je,v.account?.accountName,v.class?.className,v.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(b?.vendorViewDetails.vendorView?.vendorBasic,b?.vendorSpend,e),A(!1)},[b?.fetchState]),g.useEffect(()=>{if(b?.fetchState==="Completed"&&T===!1){$!=null&&c===!1&&(s(_e(I,"EntityDetail",{timeframe:_?.selectedPeriod?.timeframe??"quarter",timePeriod:$},F)),A(!0));const v=Ie.getLocalizedStrings().dateFormat.analytics;if(c===!0&&y!=null&&E!=null&&D!=null){A(!0);const ue=y,je={startDate:ot(E,v.YYYYDashMMDashDDFormat),endDate:ot(D,v.YYYYDashMMDashDDFormat)};s(_e(I,"EntityDetail",{timeframe:ue,timePeriod:je}))}}},[b?.fetchState,$,_?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{b?.fetchState==="Completed"&&u===!1&&(s(Pt({timePeriod:L,numberOfQuartersFetched:3})),s(_t(I,b.allTransactionsTabData?.timePeriod??L,!1,!0)),i(!0))},[b?.fetchState,u]),h==null?l.jsx(ie,{}):l.jsx(ws,{windowSize:w,children:l.jsx(As,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:b,vendorId:h,currentTenant:k,selectedVendor:j,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:_?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:x,vendorEntity:I,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:C})})}const js=Ie.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Fs={containerWidth:new Xe(100,58)},Ps=U(Fn)`
46
- width: ${W.sp4};
47
- height: ${W.sp4};
46
+ width: ${Q.sp4};
47
+ height: ${Q.sp4};
48
48
  cursor: pointer;
49
49
  color: ${e=>e.theme.colors.brandColorJade};
50
50
  `,_s=U.div`
@@ -63,16 +63,16 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
63
63
  display: ${e=>e.showContent?"flex":"none"};
64
64
  align-items: center;
65
65
  `,Bs=U.div`
66
- margin-bottom: ${W.sp3};
67
- margin-top: ${W.sp3};
68
- margin-left: ${W.sp8};
66
+ margin-bottom: ${Q.sp3};
67
+ margin-top: ${Q.sp3};
68
+ margin-left: ${Q.sp8};
69
69
  position: absolute;
70
70
  display: flex;
71
71
  align-items: center;
72
72
  `,Js=U.div`
73
73
  width: 1px;
74
- height: ${W.sp3};
75
- margin: ${W.sp0} ${W.sp3};
74
+ height: ${Q.sp3};
75
+ margin: ${Q.sp0} ${Q.sp3};
76
76
  background-color: ${e=>e.showAutofill?Gt.neutralGrey1Light:e.theme.colors.hero};
77
77
  `,Rs=U(Pn.StandardMedium)`
78
78
  color: ${e=>e.showAutofill?Gt.neutralGrey5Light:e.theme.colors.primary};
@@ -89,7 +89,7 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
89
89
  flex-direction: column;
90
90
  align-items: center;
91
91
  background-color: ${e=>e.theme.colors.grey4};
92
- `,$s=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},d=O(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:c,attachmentEndpoint:d.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${X}/vendor_attachments_accounting_provider`:`${X}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Le(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(ut())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const d=Ks(n);e(Za({vendorId:t,currentSelection:d,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Qa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ya(t,n,o))},onClickCancelPopup:()=>{e(za())},onClearGlobalMerchantAutoCompleteResults:()=>{e(ut())},onClickRedirectToQBO:()=>{window.open(`${et.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Le(null))}}})(Ln);function mt(){const e=M(),a=Y(),s=q(),{tenantEmailDomain:t}=J(),n=re(),o=R.getSignedInUser(),{vendorId:c}=J(),d=S(p=>rt(p)),[u,i]=g.useState(!1),m=S(p=>rt(p).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&u===!1&&(a(Le(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const r=p=>p.trackPageLoaded(tt.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Z,{analytics:P,onLoad:r}):null,l.jsx(Z,{analytics:P,onLoad:r}),l.jsx(Kn,{isOpen:c!=null,drawerLeftMargin:new Xe(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(zs,{onClick:p=>p.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:d,tenantEmailDomain:t})})]})}const Ks=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,zs=U($t)`
92
+ `,$s=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},d=O(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:c,attachmentEndpoint:d.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${X}/vendor_attachments_accounting_provider`:`${X}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Le(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(ut())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const d=Ks(n);e(Za({vendorId:t,currentSelection:d,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Qa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Wa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ya(t,n,o))},onClickCancelPopup:()=>{e(za())},onClearGlobalMerchantAutoCompleteResults:()=>{e(ut())},onClickRedirectToQBO:()=>{window.open(`${et.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Le(null))}}})(Ln);function mt(){const e=M(),a=Y(),s=q(),{tenantEmailDomain:t}=J(),n=re(),o=R.getSignedInUser(),{vendorId:c}=J(),d=S(p=>rt(p)),[u,i]=g.useState(!1),m=S(p=>rt(p).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&u===!1&&(a(Le(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const r=p=>p.trackPageLoaded(tt.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Z,{analytics:P,onLoad:r}):null,l.jsx(Z,{analytics:P,onLoad:r}),l.jsx(Kn,{isOpen:c!=null,drawerLeftMargin:new Xe(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(zs,{onClick:p=>p.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:d,tenantEmailDomain:t})})]})}const Ks=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,zs=U($t)`
93
93
  display: flex;
94
94
  min-height: 100%;
95
95
  flex-direction: column;
@@ -101,7 +101,7 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
101
101
  flex-direction: column;
102
102
  align-items: center;
103
103
  background-color: ${e=>e.theme.colors.grey4};
104
- `,Qs=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Oe(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=xe(n);s(o),e(ce(Te(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:d}=o,u=zn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Yn(a.accountMappingView.expenseAccounts1099FilingAccountList,d),m={selectedBankAccounts1099FilingAccountIds:u.map(r=>r.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:m}))},onSaveClick:()=>{e(nn()),t.track(tt.Event.vendor1099TabSettingsSave)}}})(Jn);function St({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),[r,p]=g.useState(!1),[h,f]=g.useState(!1);if(m==null)throw Error("Can't access vendor filing 1099 page without signing in...");Ce();const C=S(j=>tn(j)),y=S(j=>an(j)),{isAiCfoAccessEnabled:E,onAskAiCfoClick:D}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — 1099"});ge({isDataReady:C.fetchState==="Completed"}),g.useEffect(()=>{h||(f(!0),c(Oe(!1)))},[h,f]),g.useEffect(()=>{y.saveState.fetchState==="Completed"&&c(Oe(!1))},[y.saveState.fetchState]);const I=j=>{p(j)},w=S(j=>O(j)),k={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:w.tenantId},b=g.useMemo(()=>({authParams:k,tenantName:w.companyName,filing1099ReportEndPoint:`${X}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[C.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Z,{analytics:P,onLoad:()=>P.trackPageLoaded(tt.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:r,handleDrawerToggle:I}),l.jsx(Qs,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:C,vendorTypeList:C.vendorTypeList,accountMappingView:y,downloadParams:b,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:D,onClickMenuIcon:()=>{I(!0)}})]})]})}const Ws=U.div`
104
+ `,Ws=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Oe(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=xe(n);s(o),e(ce(Te(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:d}=o,u=zn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Yn(a.accountMappingView.expenseAccounts1099FilingAccountList,d),m={selectedBankAccounts1099FilingAccountIds:u.map(r=>r.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:m}))},onSaveClick:()=>{e(nn()),t.track(tt.Event.vendor1099TabSettingsSave)}}})(Jn);function St({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),[r,p]=g.useState(!1),[h,f]=g.useState(!1);if(m==null)throw Error("Can't access vendor filing 1099 page without signing in...");Ce();const C=S(j=>tn(j)),y=S(j=>an(j)),{isAiCfoAccessEnabled:E,onAskAiCfoClick:D}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — 1099"});ge({isDataReady:C.fetchState==="Completed"}),g.useEffect(()=>{h||(f(!0),c(Oe(!1)))},[h,f]),g.useEffect(()=>{y.saveState.fetchState==="Completed"&&c(Oe(!1))},[y.saveState.fetchState]);const I=j=>{p(j)},w=S(j=>O(j)),k={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:w.tenantId},b=g.useMemo(()=>({authParams:k,tenantName:w.companyName,filing1099ReportEndPoint:`${X}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[C.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Z,{analytics:P,onLoad:()=>P.trackPageLoaded(tt.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:r,handleDrawerToggle:I}),l.jsx(Ws,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:C,vendorTypeList:C.vendorTypeList,accountMappingView:y,downloadParams:b,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:D,onClickMenuIcon:()=>{I(!0)}})]})]})}const Qs=U.div`
105
105
  display: flex;
106
106
  min-height: 100%;
107
107
  width: 100%;
@@ -109,4 +109,4 @@ import{j as l}from"./liveblocks-BPC8B-82.js";import{a as g}from"./sentry-CWaXw80
109
109
  flex-direction: column;
110
110
  align-items: center;
111
111
  background-color: ${e=>e.theme.colors.grey4};
112
- `,Zs=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:ae(e),analytics:P}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(pn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))}}})(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled);Ce();const f=e.includes("prepaid_expenses"),C=e.includes("fixed_assets"),y=e.includes("accrued_expenses"),E=S(A=>me(A));let D={};D=S(A=>rn(A,"vendorsTab"));const[I,w]=g.useState(!1),{isAiCfoAccessEnabled:k,onAskAiCfoClick:b}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors Summary"});ge({isDataReady:D.fetchState==="Completed"});const j=S(A=>te(A)),F=S(A=>Q(A).isReportGenerated);S(A=>Q(A).fetchState)==="Completed"&&F&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[V,L]=g.useState(!1);if(g.useEffect(()=>{(f||C)&&V===!1&&j!=="Completed"&&(c(ye()),L(!0))},[V]),g.useEffect(()=>{c(De({shouldFetchAccruedExpenses:y,shouldFetchFixedAssets:C,shouldFetchPrepaidExpenses:f,shouldFetchOpexByVendor:p&&h===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[j,C,h,p]),g.useEffect(()=>{I||D.fetchState!=="Completed"||(w(!0),P.trackVendorList(E.currentTab,E.previousTab??null,D.totalVendorCount,D.uiState.sortKey,D.uiState.ytdSpendSelection))},[D.fetchState]),m==null)throw Error("Can't access address page without signing in...");const[x,_]=g.useState(!1),T=A=>{_(A)};return l.jsxs(Ws,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:x,handleDrawerToggle:T}),l.jsx(Zs,{location:d,navigate:o,vendorsListDetails:D,tenantEmailDomain:u,vendorTabsToShow:e,onClickMenuIcon:()=>{T(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:k,onAskAiCfoClick:b})]})}function bo(){const{useFeatureGate:e}=ne(),a=q().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),d=fn(c),{isFeatureEnabled:u}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:h}=e(z.isFiling1099FeatureEnabled),f=S(w=>O(w)),C=f?.externalConnections?.accounting[0]?.connectionName,y=["vendors_tab"];C!=="netsuite"&&m===!0&&y.push("prepaid_expenses"),C!=="netsuite"&&r===!0&&y.push("fixed_assets"),C!=="netsuite"&&p===!0&&y.push("accrued_expenses"),C!=="netsuite"&&h&&d&&(y.push("filing_1099"),u&&y.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:E}=e(z.isDebitCardFeatureEnabled),D=gn(E,f),I=vn(f);return D===!0||I===!0?l.jsx(nt,{children:l.jsx(B,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(nt,{children:[l.jsx(B,{path:"/opex",element:u===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(os,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(us,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?l.jsx(gs,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:p===!0?l.jsx(Qn,{setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(ks,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:r===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:p===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:h&&d?l.jsx(St,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:h&&d?l.jsx(St,{vendorTabsToShow:y,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:h&&d?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:h&&d?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/",element:l.jsx(K,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(ie,{})})]})}export{bo as default};
112
+ `,Zs=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:ae(e),analytics:P}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(pn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))}}})(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled);Ce();const f=e.includes("prepaid_expenses"),C=e.includes("fixed_assets"),y=e.includes("accrued_expenses"),E=S(A=>me(A));let D={};D=S(A=>rn(A,"vendorsTab"));const[I,w]=g.useState(!1),{isAiCfoAccessEnabled:k,onAskAiCfoClick:b}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors Summary"});ge({isDataReady:D.fetchState==="Completed"});const j=S(A=>te(A)),F=S(A=>W(A).isReportGenerated);S(A=>W(A).fetchState)==="Completed"&&F&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[V,L]=g.useState(!1);if(g.useEffect(()=>{(f||C)&&V===!1&&j!=="Completed"&&(c(ye()),L(!0))},[V]),g.useEffect(()=>{c(De({shouldFetchAccruedExpenses:y,shouldFetchFixedAssets:C,shouldFetchPrepaidExpenses:f,shouldFetchOpexByVendor:p&&h===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[j,C,h,p]),g.useEffect(()=>{I||D.fetchState!=="Completed"||(w(!0),P.trackVendorList(E.currentTab,E.previousTab??null,D.totalVendorCount,D.uiState.sortKey,D.uiState.ytdSpendSelection))},[D.fetchState]),m==null)throw Error("Can't access address page without signing in...");const[x,_]=g.useState(!1),T=A=>{_(A)};return l.jsxs(Qs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:x,handleDrawerToggle:T}),l.jsx(Zs,{location:d,navigate:o,vendorsListDetails:D,tenantEmailDomain:u,vendorTabsToShow:e,onClickMenuIcon:()=>{T(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:k,onAskAiCfoClick:b})]})}function bo(){const{useFeatureGate:e}=ne(),a=q().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),d=fn(c),{isFeatureEnabled:u}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:h}=e(z.isFiling1099FeatureEnabled),f=S(w=>O(w)),C=f?.externalConnections?.accounting[0]?.connectionName,y=["vendors_tab"];C!=="netsuite"&&m===!0&&y.push("prepaid_expenses"),C!=="netsuite"&&r===!0&&y.push("fixed_assets"),C!=="netsuite"&&p===!0&&y.push("accrued_expenses"),C!=="netsuite"&&h&&d&&(y.push("filing_1099"),u&&y.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:E}=e(z.isDebitCardFeatureEnabled),D=gn(E,f),I=vn(f);return D===!0||I===!0?l.jsx(nt,{children:l.jsx(B,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(nt,{children:[l.jsx(B,{path:"/opex",element:u===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(os,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(us,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?l.jsx(gs,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:p===!0?l.jsx(Wn,{setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(ks,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:r===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:p===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:h&&d?l.jsx(St,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:h&&d?l.jsx(St,{vendorTabsToShow:y,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:h&&d?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:h&&d?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/",element:l.jsx(K,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(ie,{})})]})}export{bo as default};
@@ -0,0 +1,12 @@
1
+ import{j as o}from"./liveblocks-DZqP4zBd.js";import{a as f}from"./sentry-BX7ktq7C.js";import{q as u,h,g as y,N as I}from"./core-DZxCQ5Bu.js";import{IE as b,eO as w,yZ as x}from"./zeni-epic-state-Bd5L4xLB.js";import{z as l,B as j,F as S,W as E}from"./index-CtQjNzsr.js";import{n as g}from"./mui-JGW0YBlw.js";import"./recharts-_nzHAC1j.js";import"./analytics-bOU2NuQd.js";import"./plaid-DYvRZGjg.js";import"./dnd-DlOyvOfI.js";import"./stripe-DMRn4zHo.js";import"./lottie-FsLW8B91.js";import"./lexical-DrUvlKRq.js";import"./pdf-CGAiVFsk.js";import"./utils-2p1Ymknq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6373e09e-d1bf-4f78-9a60-306e27042522",e._sentryDebugIdIdentifier="sentry-dbid-6373e09e-d1bf-4f78-9a60-306e27042522")}catch{}})();const R=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,m]=f.useState(!1),a=h(),i=y(c=>b(c)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(m(!0),a(x(t,p,s)))},[n,a]),i.fetchState==="Error"?o.jsx(D,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},D=g.div`
2
+ display: flex;
3
+ width: 100%;
4
+ height: 100vh;
5
+ flex-direction: row;
6
+ justify-content: center;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey5};
9
+ `,_=g(E.LargeRegular)`
10
+ display: flex;
11
+ color: ${S.important};
12
+ `;export{R as default};