@zeniai/web-app-ui 5.0.91-qa → 5.0.92-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 (119) hide show
  1. package/dist/assets/AddressRoutes-CojtNX27.js +1 -0
  2. package/dist/assets/AddressScreen-CuGNy3IM.js +9 -0
  3. package/dist/assets/{AiCfoScreen-HGbtKnxx.js → AiCfoScreen-C9ttZvTj.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-WO8R24uy.js → BillPayApprovalRoutes-CL6D_7dw.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-OfGi1DH5.js → BillPayRoutes-fvhaclgV.js} +28 -28
  6. package/dist/assets/{BusinessVerificationPageScreen-Cwb0O2iw.js → BusinessVerificationPageScreen-Lfv0XtEV.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-rGxvQDtl.js → ChargeCardRoutes-D1tC8X9c.js} +9 -9
  8. package/dist/assets/{CompanyPassportScreen-BLCufivU.js → CompanyPassportScreen-BwKa_LUc.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-DcxIu2av.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-D76H2W7e.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DX7TTN0z.js → CustomerOnboardingRoutes-BjxUysyp.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-DsB2iHa0.js → DashboardRoutes-DSV2c9Hg.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-s96KbqYN.js → DefaultTenantHome-BM5doKP0.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-masdKbKT.js → DomesticWireDetailScreen-XA3QzAyw.js} +3 -3
  15. package/dist/assets/{DrawerScreen-D7lcO0VJ.js → DrawerScreen-2PFFQiRL.js} +1 -1
  16. package/dist/assets/EntityDetailRoutes-Cpm2zn0V.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-BXsX48QL.js +25 -0
  18. package/dist/assets/{FeaturePreviewScreen-D4qKJlp2.js → FeaturePreviewScreen-DBbU3hyx.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-CLs0WVB9.js → HubSpotOAuthCallbackScreen-mukQpBXO.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-CH7xneTX.js → MagicLinkRoutes-DKenhM-1.js} +8 -8
  21. package/dist/assets/MagicLinkSignInScreen-0g7D-J_c.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-Ccfg2tLY.js → MobileAppDrawer-C1owD1l4.js} +1 -1
  23. package/dist/assets/NotFoundScreen-CDTENjn3.js +1 -0
  24. package/dist/assets/{NotificationRoutes-DVhgz2MT.js → NotificationRoutes-CKh3SMt4.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-CdvqeO7v.js → OAuthConsentScreen-28eY7N8v.js} +1 -1
  26. package/dist/assets/PandLWithForecastRoutes-BRmUZUjI.js +1 -0
  27. package/dist/assets/{PeopleRoutes-DwTgxifH.js → PeopleRoutes-DhjKygIO.js} +9 -9
  28. package/dist/assets/PerformanceRoutes-CnVEsdqq.js +1 -0
  29. package/dist/assets/{Preview-CHoySpAn.js → Preview-BcfL_4SY.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-MmUXgGtM.js → QBOConnectionScreen-WmVdfC19.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-B2ACfYZr.js → ReferralListScreen-PEBFhlmP.js} +2 -2
  32. package/dist/assets/{ReimbursementApprovalRoutes-CT4lWRTd.js → ReimbursementApprovalRoutes-BkLIE_PW.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CNt84ZGM.js → ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-BHzTaVBa.js → ReimbursementRoutes-BiXGzoNt.js} +4 -4
  35. package/dist/assets/{ReportsRoutes-BDSCsmt2.js → ReportsRoutes-C6YTBKT9.js} +1 -1
  36. package/dist/assets/RewardsRoutes-CvorIu5L.js +1 -0
  37. package/dist/assets/ScreenRoutes-Dk4hXC7S.js +2 -0
  38. package/dist/assets/{SettingsRoutes-B5I2T9gT.js → SettingsRoutes-D8oriWAW.js} +3 -3
  39. package/dist/assets/{SetupPagesScreen-CWz4vIj-.js → SetupPagesScreen-BHZjOSHJ.js} +5 -5
  40. package/dist/assets/SignInScreen-Y6BuxpSu.js +1 -0
  41. package/dist/assets/SignOutScreen-CdkUNxjq.js +9 -0
  42. package/dist/assets/{TaskListScreen-DgDHZCji.js → TaskListScreen-DuuYXRRr.js} +2 -2
  43. package/dist/assets/{TaskRoutes-1dpFKupm.js → TaskRoutes-BMtkIWCF.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-BRCYDEe1.js → TransactionDetailRoutes-C3Fb8KbQ.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-Dz99_JkB.js → TransactionDetailScreen-CUNFX6ex.js} +2 -2
  46. package/dist/assets/TransactionListRoutes-C4xg5Sow.js +1 -0
  47. package/dist/assets/{TreasuryRoutes-DjyI2oxa.js → TreasuryRoutes-DJhXjsa5.js} +5 -5
  48. package/dist/assets/{VendorsRoutes-Df4R1sQP.js → VendorsRoutes-WEkjdTRS.js} +19 -19
  49. package/dist/assets/WiseConfirmationScreen-B3-p2tMs.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-C8pdGbMJ.js → ZeniAccountRoutes-C9ludMke.js} +11 -11
  51. package/dist/assets/{ZeniAccountStatementScreen-DmJw_u4G.js → ZeniAccountStatementScreen-BOPEKBSK.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-DZZWkdNS.js → accountMappingHelper-DWvcSK1C.js} +1 -1
  53. package/dist/assets/{analytics-BpTmj6-G.js → analytics-DYzLSwIZ.js} +1 -1
  54. package/dist/assets/{analyticsHelper-CWJll2iT.js → analyticsHelper-Dc1kU1of.js} +1 -1
  55. package/dist/assets/{core-lbYY5woS.js → core-BeBBWfga.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-Bt7TpCfB.js → decodeURIComponentSafe-OtMMCMcE.js} +1 -1
  57. package/dist/assets/{dnd-BBkXCQMv.js → dnd-UF85x-t5.js} +1 -1
  58. package/dist/assets/{empty-BXlVh-7L.js → empty-BWGTDoK6.js} +1 -1
  59. package/dist/assets/{empty-DuvQh38L.js → empty-BaCT02t1.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-DsiEcnQV.js → emptyVideoElement-BnRvKEhd.js} +1 -1
  61. package/dist/assets/epic-n0VtNHE8.js +2 -0
  62. package/dist/assets/getLocaleForTenant-CXwRfDGi.js +1 -0
  63. package/dist/assets/{index-D5mVmx24.js → index-BHdC4ErN.js} +1 -1
  64. package/dist/assets/{index-CmU3R7ot.js → index-BXVcb2Xp.js} +2 -2
  65. package/dist/assets/{index-YSIKqInC.js → index-CjNRshif.js} +1 -1
  66. package/dist/assets/{index-BnCtlDzJ.js → index-CvWmMArW.js} +1 -1
  67. package/dist/assets/{index-DBlyACY-.js → index-DS8xe4Yw.js} +1 -1
  68. package/dist/assets/{index-CR1sBuly.js → index-DWCyzMUX.js} +12214 -12214
  69. package/dist/assets/{index-9bPjdOkz.js → index-_ohVjyws.js} +1 -1
  70. package/dist/assets/{index-wZ-HUxAq.js → index-u46W4WpS.js} +1 -1
  71. package/dist/assets/{lexical-BoKYrzBU.js → lexical-C_ylRY16.js} +1 -1
  72. package/dist/assets/{liveblocks-BEuWW_o5.js → liveblocks-BNlilBXq.js} +1 -1
  73. package/dist/assets/{lottie-DW3oQVJC.js → lottie-DbxhFPB1.js} +1 -1
  74. package/dist/assets/{mui-hUAh7HgW.js → mui-CnlqDSRv.js} +1 -1
  75. package/dist/assets/{pathToGoBack-BTgB24PY.js → pathToGoBack-CHG8tIif.js} +1 -1
  76. package/dist/assets/{pdf-D4eIZozg.js → pdf-Dp2xnkno.js} +4 -4
  77. package/dist/assets/{pdf-lib-CQ6bcQhi.js → pdf-lib-BEgmFXIU.js} +1 -1
  78. package/dist/assets/{plaid-DtmQg7la.js → plaid-CBNEU__p.js} +1 -1
  79. package/dist/assets/{pusher-BH0WSonH.js → pusher-C2HLHaTd.js} +1 -1
  80. package/dist/assets/{react-FJ8t_fEG.js → react-7oI-YZOA.js} +1 -1
  81. package/dist/assets/{react-uiz0Bf7s.js → react-CVgRRIOa.js} +1 -1
  82. package/dist/assets/{react-I3T6BtSv.js → react-PfdOvJhF.js} +1 -1
  83. package/dist/assets/{react-u3t1vzKM.js → react-QblHkUSH.js} +1 -1
  84. package/dist/assets/{react-DPfcpAvs.js → react-V6AXUc49.js} +1 -1
  85. package/dist/assets/{react-DHaugbA3.js → react-vkffk7Xs.js} +1 -1
  86. package/dist/assets/{recharts-aApoEySM.js → recharts-C5E4pGR4.js} +1 -1
  87. package/dist/assets/{routePaths-BoWQ8YXQ.js → routePaths-aWjSXoc2.js} +1 -1
  88. package/dist/assets/{sentry-DsHW_1mX.js → sentry-CH2pQ4tM.js} +1 -1
  89. package/dist/assets/{url-CPbSl3Sf.js → url-BcTKj4a2.js} +1 -1
  90. package/dist/assets/{url-rO4wjCNo.js → url-CBu622rf.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Xp4UZg6R.js → useAiCfoDashboardSuggestedQuestionsChips-D5XSlLnm.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-DbBvDdaC.js +1 -0
  93. package/dist/assets/{useDeviceId-CUIt81hA.js → useDeviceId-W860NCQ9.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-oMQ4nobf.js → useInitialThreadRequest-DS5F5QV2.js} +1 -1
  95. package/dist/assets/{utils-AZPawxk4.js → utils-C2zbYn9G.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-C6lz4d-6.js → withTransactionSidePanel-Bsk-acAb.js} +2 -2
  97. package/dist/assets/zeni-epic-state-5fEaVO5b.js +13 -0
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -3
  100. package/dist/assets/AddressRoutes-D5m9Txpa.js +0 -1
  101. package/dist/assets/AddressScreen-9ZQKW4Vc.js +0 -9
  102. package/dist/assets/ConnectionAuthScreen-DPjlQt6j.js +0 -11
  103. package/dist/assets/CustomerOnboardingAuthScreen-BLnBp8eI.js +0 -1
  104. package/dist/assets/EntityDetailRoutes-DWIHI0bf.js +0 -1
  105. package/dist/assets/ExpenseAutomationRoutes-Df1ZmsUn.js +0 -25
  106. package/dist/assets/MagicLinkSignInScreen-Ij-bum6F.js +0 -12
  107. package/dist/assets/NotFoundScreen-DdK7GyZ6.js +0 -1
  108. package/dist/assets/PandLWithForecastRoutes-CSnkyLzm.js +0 -1
  109. package/dist/assets/PerformanceRoutes-BLUJTpzt.js +0 -1
  110. package/dist/assets/RewardsRoutes-YDsLsdCp.js +0 -1
  111. package/dist/assets/ScreenRoutes-r_yq8fzi.js +0 -2
  112. package/dist/assets/SignInScreen-Dp0TAL4V.js +0 -1
  113. package/dist/assets/SignOutScreen-DeydCvA_.js +0 -9
  114. package/dist/assets/TransactionListRoutes-C05fsgRv.js +0 -1
  115. package/dist/assets/WiseConfirmationScreen-W0w1BuqD.js +0 -12
  116. package/dist/assets/epic-CqNfoxZY.js +0 -2
  117. package/dist/assets/getLocaleForTenant-D8IeK8ro.js +0 -1
  118. package/dist/assets/useAskAiCfoHostNavButtonProps-D2I_ptqP.js +0 -1
  119. package/dist/assets/zeni-epic-state-DsxPZxrE.js +0 -13
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-BEuWW_o5.js";import{l as U,u as B,h as P,i as O,g as f,N as L,n as V,o as Ie,p as k}from"./core-lbYY5woS.js";import{cm as M,eQ as D,NJ as R,DP as ae,fg as H,Dx as ne,NL as Te,DS as we,NH as Ce,NI as se,N_ as ke,BZ as je,sK as be,NN as Ae,E1 as Ee,NK as re,cP as W,wU as oe,eW as ve,eY as De,OV as Fe,OW as Le,Dy as Ue,OX as Be,Dz as Pe,DI as Re,bv as Ne,bF as Oe,cx as Ve,bG as Me,cl as _e,ff as ze,bs as Ge,Jn as $e,ck as qe}from"./zeni-epic-state-DsxPZxrE.js";import{I as _,aq as He,z as A,R as z,c as j,c4 as We,c5 as Ke,c6 as q,K,m as Ze,V as Je,_ as Qe,C as ie,j as v,w as Xe,B as Ye,c7 as et,at as Z,n as tt,c8 as at,p as J,c9 as nt,T as X,ca as st,a9 as rt}from"./index-CR1sBuly.js";import{D as ot,n as N,S as it}from"./mui-hUAh7HgW.js";import ct from"./NotFoundScreen-DdK7GyZ6.js";import{S as Y}from"./SetupPagesScreen-CWz4vIj-.js";import{a as d}from"./sentry-DsHW_1mX.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import{u as ut}from"./useInitialThreadRequest-oMQ4nobf.js";import{M as ce}from"./MobileAppDrawer-Ccfg2tLY.js";import{F as dt}from"./FeaturePreviewScreen-D4qKJlp2.js";import{a as ee}from"./analyticsHelper-CWJll2iT.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./routePaths-BoWQ8YXQ.js";import"./BusinessVerificationPageScreen-Cwb0O2iw.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]="9fc6d541-0c5f-4920-925a-cd1b465ec017",t._sentryDebugIdIdentifier="sentry-dbid-9fc6d541-0c5f-4920-925a-cd1b465ec017")}catch{}})();const pt=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},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))}}})(We);function mt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=He(r),s=M(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,w]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,I=A.getSignedInUser(),S=f(C=>R(C,y)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(I==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,T,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(H()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(w(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(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:()=>{q(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),yt=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,w]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),I=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),T=f(x=>R(x,I));if(A.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(()=>{l||c!=="Not-Started"||I==null||(i(!0),o(H()))},[l,c,I,o]),d.useEffect(()=>{g||h!=="Not-Started"||I==null||(w(!0),o(ne()))},[g,h,I,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{q(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=N.div`
1
+ import{j as e}from"./liveblocks-BNlilBXq.js";import{l as U,u as B,h as P,i as O,g as f,N as L,n as V,o as Ie,p as k}from"./core-BeBBWfga.js";import{cm as M,eQ as D,NJ as R,DP as ae,fg as Z,Dx as ne,NL as Te,DS as we,NH as Ce,NI as se,N_ as ke,BZ as je,sM as be,NN as Ae,E1 as Ee,NK as re,cP as H,wU as oe,eW as ve,eY as De,OV as Fe,OW as Le,Dy as Ue,OX as Be,Dz as Pe,DI as Re,bv as Ne,bF as Oe,cx as Ve,bG as Me,cl as _e,ff as ze,bs as Ge,Jn as $e,ck as qe}from"./zeni-epic-state-5fEaVO5b.js";import{d as _,aq as Ze,z as A,v as z,f as j,c4 as He,c5 as Ke,c6 as q,K,m as We,V as Je,Z as Qe,a as ie,I as v,w as Xe,B as Ye,c7 as et,at as W,q as tt,c8 as at,p as J,c9 as nt,T as X,ca as st,a9 as rt}from"./index-DWCyzMUX.js";import{D as ot,n as N,S as it}from"./mui-CnlqDSRv.js";import ct from"./NotFoundScreen-CDTENjn3.js";import{S as Y}from"./SetupPagesScreen-BHZjOSHJ.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{u as ut}from"./useInitialThreadRequest-DS5F5QV2.js";import{M as ce}from"./MobileAppDrawer-C1owD1l4.js";import{F as dt}from"./FeaturePreviewScreen-DBbU3hyx.js";import{a as ee}from"./analyticsHelper-Dc1kU1of.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./routePaths-aWjSXoc2.js";import"./BusinessVerificationPageScreen-Lfv0XtEV.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]="51578642-23ea-49dd-b6dd-f98f612f4540",t._sentryDebugIdIdentifier="sentry-dbid-51578642-23ea-49dd-b6dd-f98f612f4540")}catch{}})();const pt=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},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))}}})(He);function mt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=Ze(r),s=M(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,w]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,I=A.getSignedInUser(),S=f(C=>R(C,y)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(I==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,T,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(Z()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(w(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(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:()=>{q(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),yt=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,w]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),I=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),T=f(x=>R(x,I));if(A.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(()=>{l||c!=="Not-Started"||I==null||(i(!0),o(Z()))},[l,c,I,o]),d.useEffect(()=>{g||h!=="Not-Started"||I==null||(w(!0),o(ne()))},[g,h,I,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{q(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as e}from"./liveblocks-BEuWW_o5.js";import{l as U,u as B,h as P,i as O,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,ht={overlayWidth:new Xe(100,100,48)},St=V(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:l=>{let i="page-not-found";l==="editPortfolio"?i=xt(s):l==="statements"?i=It(s):l==="taxLetter"?i=Tt(s):l==="settings"&&(i=wt(s));const g=tt(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:g}})},onColumnSortConfigChanged:(l,i)=>{t(Fe({uiState:{sortKey:l,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(et);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),o=U(),p=P(),r=K(),m=Ze(),s=f(b=>D(b)),{tenantEmailDomain:l}=O(),i=s.companyId??A.getSignedInUserTenant(l)?.companyId,[g,w]=d.useState(!1),u=f(b=>re(b)),c=u.fetchState,h=u.accountSummary?.totalBalance?.amount,y=f(b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),I=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),T=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=M(S?.loggedInUserRoleMap),F=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Je();d.useEffect(()=>{c==="Not-Started"&&!g&&E&&(w(!0),p(oe(!0)))},[g,p,c,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 C=()=>{o("..")},[le,ue]=d.useState(!1),Q=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Qe({isDataReady:c==="Completed"});const{useFeatureGate:G}=ie(),{isFeatureEnabled:me}=G(v.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=G(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=G(v.isTreasuryCommentingEnabled),ge=ut(i,{clearParams:c==="Completed"&&y?.fetchState==="Completed"}),he=ve(s),Se=De(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(I){const b=y?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:j,onLoad:()=>{}}):null,e.jsx(ot,{onClose:C,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:u.transactions.length===0||h===0}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(St,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return T&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!T&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(Ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Ct=N(it)`
9
+ `,ht={overlayWidth:new Xe(100,100,48)},St=V(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${W.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:l=>{let i="page-not-found";l==="editPortfolio"?i=xt(s):l==="statements"?i=It(s):l==="taxLetter"?i=Tt(s):l==="settings"&&(i=wt(s));const g=tt(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:g}})},onColumnSortConfigChanged:(l,i)=>{t(Fe({uiState:{sortKey:l,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(et);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),o=U(),p=P(),r=K(),m=We(),s=f(b=>D(b)),{tenantEmailDomain:l}=O(),i=s.companyId??A.getSignedInUserTenant(l)?.companyId,[g,w]=d.useState(!1),u=f(b=>re(b)),c=u.fetchState,h=u.accountSummary?.totalBalance?.amount,y=f(b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),I=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),T=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=M(S?.loggedInUserRoleMap),F=H(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Je();d.useEffect(()=>{c==="Not-Started"&&!g&&E&&(w(!0),p(oe(!0)))},[g,p,c,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 C=()=>{o("..")},[le,ue]=d.useState(!1),Q=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Qe({isDataReady:c==="Completed"});const{useFeatureGate:G}=ie(),{isFeatureEnabled:me}=G(v.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=G(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=G(v.isTreasuryCommentingEnabled),ge=ut(i,{clearParams:c==="Completed"&&y?.fetchState==="Completed"}),he=ve(s),Se=De(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(I){const b=y?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:j,onLoad:()=>{}}):null,e.jsx(ot,{onClose:C,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:u.transactions.length===0||h===0}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(St,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return T&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!T&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(Ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Ct=N(it)`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  flex-direction: column;
@@ -18,7 +18,7 @@ import{j as e}from"./liveblocks-BEuWW_o5.js";import{l as U,u as B,h as P,i as O,
18
18
  flex-direction: column;
19
19
  align-items: center;
20
20
  background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=U(),a=P(),n=K(),o=B(),p=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Le(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))},[r,s.fetchState,a]);const l=A.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(at,{currentTenantCompanyName:w,statementListView:s,isLoading:u,onBackClick:()=>{const c=J(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const bt=N.div`
21
+ `;function jt(){const t=U(),a=P(),n=K(),o=B(),p=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Le(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))},[r,s.fetchState,a]);const l=A.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(at,{currentTenantCompanyName:w,statementListView:s,isLoading:u,onBackClick:()=>{const c=J(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const bt=N.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-BEuWW_o5.js";import{l as U,u as B,h as P,i as O,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${t=>t.theme.colors.grey4};
29
- `;function At(){const t=U(),a=K(),n=B(),o=P(),p=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Be(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))},[r,s.fetchState,o]);const l=A.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(nt,{currentTenantCompanyName:w,taxLetterListView:s,isLoading:u,onBackClick:()=>{const c=J(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const Et=V(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(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(st),vt=()=>{const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,l]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||g==null||(l(!0),n(H()))},[i,n]);const g=A.getSignedInUserTenant(o)?.companyId??m.companyId,w=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{r(S)};if(w==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),y=M(h?.loggedInUserRoleMap),I=W(h?.loggedInUserRoleMap);if(u&&y)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&y||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:j,onLoad:S=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:c}),e.jsx(Et,{analytics:j,navigate:t,companyId:g,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=N.div`
29
+ `;function At(){const t=U(),a=K(),n=B(),o=P(),p=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Be(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))},[r,s.fetchState,o]);const l=A.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(nt,{currentTenantCompanyName:w,taxLetterListView:s,isLoading:u,onBackClick:()=>{const c=J(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const Et=V(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(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(st),vt=()=>{const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,l]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||g==null||(l(!0),n(Z()))},[i,n]);const g=A.getSignedInUserTenant(o)?.companyId??m.companyId,w=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{r(S)};if(w==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),y=M(h?.loggedInUserRoleMap),I=H(h?.loggedInUserRoleMap);if(u&&y)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&y||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:j,onLoad:S=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:c}),e.jsx(Et,{analytics:j,navigate:t,companyId:g,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=N.div`
30
30
  display: flex;
31
31
  width: 100%;
32
32
  height: 100%;
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-BEuWW_o5.js";import{l as U,u as B,h as P,i as O,
34
34
  justify-content: center;
35
35
  align-items: center;
36
36
  background-color: ${t=>t.theme.colors.grey5};
37
- `;function ea(){const t=B(),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&&Ne(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Oe(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),g=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),{isFeatureEnabled:w}=n(v.isDepositAccountsFeatureEnabled),u=w&&!s&&_e(r?.loggedInUserRoleMap),c=a.company!=null&&ze(a.company),h=o&&c===!0&&!s&&M(r?.loggedInUserRoleMap),{isFeatureEnabled:y}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=n(v.isDebitCardFeatureEnabled),S=rt(a,y,I)&&!s&&Ge(r?.loggedInUserRoleMap),T=$e(r?.loggedInUserRoleMap),x=qe(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ie,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):p&&h?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{ea as default};
37
+ `;function ea(){const t=B(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=H(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Ne(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Oe(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),g=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),{isFeatureEnabled:w}=n(v.isDepositAccountsFeatureEnabled),u=w&&!s&&_e(r?.loggedInUserRoleMap),c=a.company!=null&&ze(a.company),h=o&&c===!0&&!s&&M(r?.loggedInUserRoleMap),{isFeatureEnabled:y}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=n(v.isDebitCardFeatureEnabled),S=rt(a,y,I)&&!s&&Ge(r?.loggedInUserRoleMap),T=$e(r?.loggedInUserRoleMap),x=qe(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ie,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):p&&h?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{ea as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1mX.js";import{l as J,u as Y,i as R,g as S,n as K,h as z,o as at,p as B,N as G}from"./core-lbYY5woS.js";import{eQ as V,Kp as Ee,Kq as Ue,fT as X,cs as Ie,ct as be,vt as St,Kr as nt,vx as zt,Iu as ee,jD as te,vr as Yt,vl as qt,Ks as Me,vd as Ht,vc as Wt,v6 as Qt,vi as Zt,vy as Xt,Kt as he,Ku as Ne,ve as ea,Kv as pe,f1 as ft,vN as gt,vG as vt,Kw as xt,op as Tt,vB as yt,vz as Dt,Kx as Ct,vU as Et,vR as It,vC as bt,vT as Je,GR as kt,Ky as ta,Kz as aa,cv as na,KA as sa,KB as oa,KC as me,KD as ie,KE as ke,Iv as Ke,w7 as ye,It as De,vW as wt,vu as Ge,KF as la,Iw as H,KG as $e,vo as ia,KH as ca,KI as da,KJ as ze,KK as Ye,KL as qe,KM as He,w1 as we,KN as At,vK as jt,KO as ra,KP as ua,KQ as ha,KR as pa,KS as ma,KT as Sa,KU as fa,KV as ga,sW as va,sX as xa,HA as je,KW as Ta,KX as ya,j0 as Fe,bq as Da,KY as Ca,KZ as Ea,kB as Ia,kK as ba,Hz as Le,bE as st,K_ as Ft,He as Lt,K$ as ka,L0 as wa,L1 as Aa,kM as ja,L2 as ot,L3 as lt,L4 as it,L5 as ct,L6 as Fa,kI as La,L7 as Pa,kL as _a,L8 as Va,L9 as Pt,HW as _t,j$ as Ba,La as Oa,Lb as Pe,Lc as Vt,HU as Bt,yk as Ra,Ld as Ua,Le as Ma,kj as Ot,Lf as Na,Lg as Ja,I6 as Ka,qv as Ga,Lh as Rt,Li as dt,I3 as _e,Lj as rt,Lk as $a,I8 as za,Ll as Ya,Lm as qa,Ln as Ha,Lo as Wa,Lp as Qa,qy as Za,Lq as Xa,Ix as en,Lr as tn,HN as Ve,gM as an,Ls as nn,Lt as sn,gK as on,Lu as ln,Lv as cn,yo as dn,Lw as rn,Lx as un,Ly as hn,Lz as pn,k3 as mn,bn as Sn,eY as fn,eW as gn}from"./zeni-epic-state-DsxPZxrE.js";import{z as U,aq as Be,B as Ut,R as Q,c as j,a1 as Z,aw as vn,n as N,D as Ce,s as ce,ax as We,ay as xn,az as Tn,p as Qe,aA as yn,m as Dn,K as de,w as Ze,C as ae,j as $,aB as Cn,h as Xe,_ as Se,aC as En,aD as Mt,V as In,aE as bn,I as kn,aF as wn,at as Nt,aG as An,o as W,S as jn,y as Jt,Q as Fn,aH as Ln,aI as Pn,e as et,aJ as _n,aK as Vn,M as Bn,aL as On,aM as Rn}from"./index-CR1sBuly.js";import{n as M,D as Un,S as Kt}from"./mui-hUAh7HgW.js";import{t as Mn,A as Nn}from"./AddressScreen-9ZQKW4Vc.js";import le from"./NotFoundScreen-DdK7GyZ6.js";import{F as Jn}from"./FeaturePreviewScreen-D4qKJlp2.js";import{c as q,v as tt,d as Kn}from"./routePaths-BoWQ8YXQ.js";import{p as Gt}from"./pathToGoBack-BTgB24PY.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import{M as ge}from"./MobileAppDrawer-Ccfg2tLY.js";import{D as Gn}from"./DrawerScreen-D7lcO0VJ.js";import{g as $n,m as zn}from"./accountMappingHelper-DZZWkdNS.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.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]="870c38f2-f829-4f0e-af1c-e742e64058ad",e._sentryDebugIdIdentifier="sentry-dbid-870c38f2-f829-4f0e-af1c-e742e64058ad")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=K(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(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=R(),{scheduleType:o}=R();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>V(f)),r=Ee(o)??"accrued_expenses",h=U.getSignedInUser();if(h==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,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,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 p=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:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},$t=e=>{const a=Yn.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,r=c.some(m=>m.isRecommendedTransaction===!0),h=Ie(s.controllers),i=be(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=M.div`
1
+ import{j as l}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as J,u as Y,i as R,g as S,n as K,h as z,o as at,p as B,N as G}from"./core-BeBBWfga.js";import{eQ as V,Kp as Ee,Kq as Ue,fT as X,cs as Ie,ct as be,vt as St,Kr as nt,vx as zt,Iu as ee,jD as te,vr as Yt,vl as qt,Ks as Ne,vd as Ht,vc as Wt,v6 as Qt,vi as Zt,vy as Xt,Kt as he,Ku as Me,ve as ea,Kv as pe,f1 as ft,vN as gt,vG as vt,Kw as xt,op as Tt,vB as yt,vz as Dt,Kx as Ct,vU as Et,vR as It,vC as bt,vT as Je,GR as kt,Ky as ta,Kz as aa,cv as na,KA as sa,KB as oa,KC as me,KD as ie,KE as ke,Iv as Ke,w7 as ye,It as De,vW as wt,vu as Ge,KF as la,Iw as H,KG as $e,vo as ia,KH as ca,KI as da,KJ as ze,KK as Ye,KL as qe,KM as He,w1 as we,KN as At,vK as jt,KO as ra,KP as ua,KQ as ha,KR as pa,KS as ma,KT as Sa,KU as fa,KV as ga,sY as va,sZ as xa,HA as je,KW as Ta,KX as ya,j0 as Fe,bq as Da,KY as Ca,KZ as Ea,kB as Ia,kK as ba,Hz as Le,bE as st,K_ as Ft,He as Lt,K$ as ka,L0 as wa,L1 as Aa,kM as ja,L2 as ot,L3 as lt,L4 as it,L5 as ct,L6 as Fa,kI as La,L7 as Pa,kL as _a,L8 as Va,L9 as Pt,HW as _t,j$ as Ba,La as Oa,Lb as Pe,Lc as Vt,HU as Bt,yk as Ra,Ld as Ua,Le as Na,kj as Ot,Lf as Ma,Lg as Ja,I6 as Ka,qx as Ga,Lh as Rt,Li as dt,I3 as _e,Lj as rt,Lk as $a,I8 as za,Ll as Ya,Lm as qa,Ln as Ha,Lo as Wa,Lp as Qa,qA as Za,Lq as Xa,Ix as en,Lr as tn,HN as Ve,gM as an,Ls as nn,Lt as sn,gK as on,Lu as ln,Lv as cn,yo as dn,Lw as rn,Lx as un,Ly as hn,Lz as pn,k3 as mn,bn as Sn,eY as fn,eW as gn}from"./zeni-epic-state-5fEaVO5b.js";import{z as U,aq as Be,B as Ut,v as Q,f as j,a1 as Z,aw as vn,q as M,O as Ce,R as ce,ax as We,ay as xn,az as Tn,p as Qe,aA as yn,m as Dn,K as de,w as Ze,a as ae,I as $,aB as Cn,j as Xe,Z as Se,aC as En,aD as Nt,V as In,aE as bn,d as kn,aF as wn,at as Mt,aG as An,o as W,S as jn,y as Jt,Y as Fn,aH as Ln,aI as Pn,h as et,aJ as _n,aK as Vn,_ as Bn,aL as On,aM as Rn}from"./index-DWCyzMUX.js";import{n as N,D as Un,S as Kt}from"./mui-CnlqDSRv.js";import{t as Nn,A as Mn}from"./AddressScreen-CuGNy3IM.js";import le from"./NotFoundScreen-CDTENjn3.js";import{F as Jn}from"./FeaturePreviewScreen-DBbU3hyx.js";import{c as q,v as tt,d as Kn}from"./routePaths-aWjSXoc2.js";import{p as Gt}from"./pathToGoBack-CHG8tIif.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{M as ge}from"./MobileAppDrawer-C1owD1l4.js";import{D as Gn}from"./DrawerScreen-2PFFQiRL.js";import{g as $n,m as zn}from"./accountMappingHelper-DWvcSK1C.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="b42c488e-280c-4374-a4e6-81e0d06759b5",e._sentryDebugIdIdentifier="sentry-dbid-b42c488e-280c-4374-a4e6-81e0d06759b5")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=K(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(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=R(),{scheduleType:o}=R();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>V(f)),r=Ee(o)??"accrued_expenses",h=U.getSignedInUser();if(h==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,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,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 p=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:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},$t=e=>{const a=Yn.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,r=c.some(m=>m.isRecommendedTransaction===!0),h=Ie(s.controllers),i=be(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Zn=K(function(e){const a=V(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Me(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(St(n,o))},onDelete:o=>{e(ea(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Ne({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onEditAmount:(o,c)=>{e(Xt(n,o,c))},onJELinkClick:o=>{e(Zt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,r)=>{e(Qt(o,c,r))},onTransactionClick:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewPostedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewRecordedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewBillExpense:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onDetailPageChange:(o,c,r)=>{const{scheduleDetailsAccruedExpensesSection:h}=o,{amount:i,memo:m,months:d,scheduleAccruedExpenseCategory:u,scheduleClass:p,scheduleExpenseCategory:f,startDate:D,vendor:x}=h,I=p.selectedOption!=null?a.classList.find(b=>b.classId===p.selectedOption):void 0,C=f.selectedOption!=null?a.accountList.find(b=>b.qboId===f.selectedOption):void 0,E=u.selectedOption!=null?a.accruedAccountList.find(b=>b.qboId===u.selectedOption):void 0,w=d?.selectedOption;e(Ht({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),r!==!1||a.scheduleDetailId!=null||C?.accountId==null||a.isAccountingClassesEnabled!==!1&&I?.classId==null||E==null||x.selectedOption==null||m==null||i==null&&i==0||D==null||w==null||e(Wt({scheduleType:n}))}}})(xn),Xn=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=J(),t=Y(),n=z(),o=ce(),{tenantEmailDomain:c}=R(),[r,h]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=R();let m;i!=="new"&&(m=i);const d=es(i),u=S(y=>y.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),p="accrued_expenses",f=S(y=>Ue(y,"accrued_expenses")),D=S(y=>ee(y)),x=S(y=>y.classListState.fetchState),I=S(y=>te(y)),C=D!=="Completed"||x!=="Completed";g.useEffect(()=>{r===!1&&C?(n(Yt(p,m)),h(!0)):C===!1&&r===!1&&i!=="new"&&(n(qt(p,i)),h(!0))},[r]);const E=S(y=>V(y)),w=S(y=>X(y,E.companyId)),b=f.fetchState,k=f.allAccountList,P=f.allClassList,F=f.allAccruedAccountList,_=f.scheduleAccruedDetailsLocalData;if(d!==!0||f.fetchState==="Error")return l.jsx(le,{});const A=b==="Completed"&&r===!0;return b!=="Completed"&&b!=="Not-Started"?l.jsx(We,{}):l.jsxs(Qn,{children:[A===!0?l.jsx(Q,{analytics:j,onLoad:()=>{ts(f,p,w)}}):null,l.jsx(Zn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:P,accountList:k,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:_,selectedJEScheduleKey:u,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:j,controllerUserDetails:w,isAccountingClassesEnabled:I,status:f.selectedJEAccruedSchedule?.status.code})]})},es=e=>e!=null,ts=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=Ie(s.controllers),o=be(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...$t(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},as=M.div`
9
+ `,Zn=K(function(e){const a=V(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(St(n,o))},onDelete:o=>{e(ea(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onEditAmount:(o,c)=>{e(Xt(n,o,c))},onJELinkClick:o=>{e(Zt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,r)=>{e(Qt(o,c,r))},onTransactionClick:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewPostedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewRecordedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewBillExpense:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onDetailPageChange:(o,c,r)=>{const{scheduleDetailsAccruedExpensesSection:h}=o,{amount:i,memo:m,months:d,scheduleAccruedExpenseCategory:u,scheduleClass:p,scheduleExpenseCategory:f,startDate:D,vendor:x}=h,I=p.selectedOption!=null?a.classList.find(b=>b.classId===p.selectedOption):void 0,C=f.selectedOption!=null?a.accountList.find(b=>b.qboId===f.selectedOption):void 0,E=u.selectedOption!=null?a.accruedAccountList.find(b=>b.qboId===u.selectedOption):void 0,w=d?.selectedOption;e(Ht({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),r!==!1||a.scheduleDetailId!=null||C?.accountId==null||a.isAccountingClassesEnabled!==!1&&I?.classId==null||E==null||x.selectedOption==null||m==null||i==null&&i==0||D==null||w==null||e(Wt({scheduleType:n}))}}})(xn),Xn=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=J(),t=Y(),n=z(),o=ce(),{tenantEmailDomain:c}=R(),[r,h]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=R();let m;i!=="new"&&(m=i);const d=es(i),u=S(y=>y.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),p="accrued_expenses",f=S(y=>Ue(y,"accrued_expenses")),D=S(y=>ee(y)),x=S(y=>y.classListState.fetchState),I=S(y=>te(y)),C=D!=="Completed"||x!=="Completed";g.useEffect(()=>{r===!1&&C?(n(Yt(p,m)),h(!0)):C===!1&&r===!1&&i!=="new"&&(n(qt(p,i)),h(!0))},[r]);const E=S(y=>V(y)),w=S(y=>X(y,E.companyId)),b=f.fetchState,k=f.allAccountList,P=f.allClassList,F=f.allAccruedAccountList,_=f.scheduleAccruedDetailsLocalData;if(d!==!0||f.fetchState==="Error")return l.jsx(le,{});const A=b==="Completed"&&r===!0;return b!=="Completed"&&b!=="Not-Started"?l.jsx(We,{}):l.jsxs(Qn,{children:[A===!0?l.jsx(Q,{analytics:j,onLoad:()=>{ts(f,p,w)}}):null,l.jsx(Zn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:P,accountList:k,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:_,selectedJEScheduleKey:u,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:j,controllerUserDetails:w,isAccountingClassesEnabled:I,status:f.selectedJEAccruedSchedule?.status.code})]})},es=e=>e!=null,ts=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=Ie(s.controllers),o=be(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...$t(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},as=N.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Oe=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ns=K(function(e){const a=V(e),s=pe(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",r=t.state?.message==="expenseAutomation",h=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(r===!0){const i=Qe(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Gt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Je(c,i,h.length>0))},onDelete:i=>{e(bt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(It(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(Ct({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Ne({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:d,scheduleDetailsListSection:u}=i,{scheduleClass:p,scheduleExpenseCategory:f,accumulatedDepreciationCategory:D,assetId:x,months:I,startDate:C,postingDate:E,vendor:w}=d,b=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(v=>v.id===w?.selectedOption):void 0,k={id:b?.zeniId??w?.selectedOption??"",name:b?.name??w?.defaultOptions.find(v=>v.value===w?.selectedOption)?.label??"",logo:b?.logo},P=p.selectedOption!=null?a.classList.find(v=>v.classId===p.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(v=>v.qboId===f.selectedOption):void 0,_=D.selectedOption!=null?a.depAccountList.find(v=>v.qboId===D.selectedOption):void 0,A=I?.selectedOption,y=u.map((v,re)=>({...a.scheduleLocalData.jeScheduleDetails[re],amount:{...a.scheduleLocalData.jeScheduleDetails[re].amount,amount:v.amount}})),L=E.type==="day"?E.dayOfMonth?E.dayOfMonth:1:void 0,T=E.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:P?.classId,selectedAccumulatedDepreciationCategory:_?.accountId,selectedDate:C,selectedMonths:A,assetId:x,jeScheduleDetails:y,lastDayOfMonth:T,selectedDayOfMonth:L,selectedVendor:k},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||_?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&P?.classId==null||C==null||A==null||T!==!0&&L==null||e(Dt({scheduleType:c}))}}})(Tn),ss=()=>{const e=J(),a=Y(),s=z(),t=ce(),{tenantEmailDomain:n}=R(),[o,c]=g.useState(!1),{scheduleDetailId:r}=R(),h=a.state?.message==="expenseAutomation",i=os(r),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||r!=="new"||e("../schedules/fixed_assets")},[m,r]);const d="fixed_assets",u=S(T=>pe(T,d)),p=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Me(T,"common")),D=S(T=>ee(T)),x=S(T=>T.classListState.fetchState),I=S(T=>te(T)),C=S(T=>ft(T).selectedPeriod),E=D!=="Completed"||x!=="Completed";g.useEffect(()=>{o===!1&&E?(s(gt(d,y,!0)),c(!0)):E===!1&&o===!1&&(s(vt(d,r==="new"?void 0:r,!0)),c(!0))},[o]),g.useEffect(()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),h===!0){const{month:T,year:v}=C;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/fixed_assets")},[u.markAsCompleteStatus.fetchState]);const w=S(T=>V(T)),b=S(T=>X(T,w.companyId)),k=u.fetchState,P=u.allAccountList,F=u.allClassList,_=u.allDepreciationAccountList,A=u.scheduleDetailsLocalData.fixed_assets;let y;if(r!=="new"&&(y=r),i!==!0||u.fetchState==="Error")return l.jsx(le,{});const L=k==="Completed"&&o===!0;return k!=="Completed"?l.jsx(We,{}):l.jsxs(as,{children:[L===!0?l.jsx(Q,{analytics:j,onLoad:()=>{is(u,d,b)}}):null,l.jsx(ns,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:C,usedInExpenseAutomation:h,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},accountList:P,depAccountList:_,scheduleLocalData:A,selectedJEScheduleKey:m,scheduleDetailId:y,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:j,controllerUserDetails:b,isAccountingClassesEnabled:I,status:u.selectedJEScheduleTransaction?.status.code})]})},os=e=>e!=null,ls=e=>({transactionDate:e.date.format(Oe),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),is=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ie(s.controllers),c=be(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...ls(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Oe)??null,endMonth:r.endDate?.format(Oe)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},cs=M.div`
17
+ `,Oe=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ns=K(function(e){const a=V(e),s=pe(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",r=t.state?.message==="expenseAutomation",h=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(r===!0){const i=Qe(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Gt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Je(c,i,h.length>0))},onDelete:i=>{e(bt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(It(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(Ct({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:d,scheduleDetailsListSection:u}=i,{scheduleClass:p,scheduleExpenseCategory:f,accumulatedDepreciationCategory:D,assetId:x,months:I,startDate:C,postingDate:E,vendor:w}=d,b=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(v=>v.id===w?.selectedOption):void 0,k={id:b?.zeniId??w?.selectedOption??"",name:b?.name??w?.defaultOptions.find(v=>v.value===w?.selectedOption)?.label??"",logo:b?.logo},P=p.selectedOption!=null?a.classList.find(v=>v.classId===p.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(v=>v.qboId===f.selectedOption):void 0,_=D.selectedOption!=null?a.depAccountList.find(v=>v.qboId===D.selectedOption):void 0,A=I?.selectedOption,y=u.map((v,re)=>({...a.scheduleLocalData.jeScheduleDetails[re],amount:{...a.scheduleLocalData.jeScheduleDetails[re].amount,amount:v.amount}})),L=E.type==="day"?E.dayOfMonth?E.dayOfMonth:1:void 0,T=E.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:P?.classId,selectedAccumulatedDepreciationCategory:_?.accountId,selectedDate:C,selectedMonths:A,assetId:x,jeScheduleDetails:y,lastDayOfMonth:T,selectedDayOfMonth:L,selectedVendor:k},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||_?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&P?.classId==null||C==null||A==null||T!==!0&&L==null||e(Dt({scheduleType:c}))}}})(Tn),ss=()=>{const e=J(),a=Y(),s=z(),t=ce(),{tenantEmailDomain:n}=R(),[o,c]=g.useState(!1),{scheduleDetailId:r}=R(),h=a.state?.message==="expenseAutomation",i=os(r),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||r!=="new"||e("../schedules/fixed_assets")},[m,r]);const d="fixed_assets",u=S(T=>pe(T,d)),p=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ne(T,"common")),D=S(T=>ee(T)),x=S(T=>T.classListState.fetchState),I=S(T=>te(T)),C=S(T=>ft(T).selectedPeriod),E=D!=="Completed"||x!=="Completed";g.useEffect(()=>{o===!1&&E?(s(gt(d,y,!0)),c(!0)):E===!1&&o===!1&&(s(vt(d,r==="new"?void 0:r,!0)),c(!0))},[o]),g.useEffect(()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),h===!0){const{month:T,year:v}=C;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/fixed_assets")},[u.markAsCompleteStatus.fetchState]);const w=S(T=>V(T)),b=S(T=>X(T,w.companyId)),k=u.fetchState,P=u.allAccountList,F=u.allClassList,_=u.allDepreciationAccountList,A=u.scheduleDetailsLocalData.fixed_assets;let y;if(r!=="new"&&(y=r),i!==!0||u.fetchState==="Error")return l.jsx(le,{});const L=k==="Completed"&&o===!0;return k!=="Completed"?l.jsx(We,{}):l.jsxs(as,{children:[L===!0?l.jsx(Q,{analytics:j,onLoad:()=>{is(u,d,b)}}):null,l.jsx(ns,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:C,usedInExpenseAutomation:h,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},accountList:P,depAccountList:_,scheduleLocalData:A,selectedJEScheduleKey:m,scheduleDetailId:y,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:j,controllerUserDetails:b,isAccountingClassesEnabled:I,status:u.selectedJEScheduleTransaction?.status.code})]})},os=e=>e!=null,ls=e=>({transactionDate:e.date.format(Oe),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),is=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ie(s.controllers),c=be(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...ls(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Oe)??null,endMonth:r.endDate?.format(Oe)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},cs=N.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,11 +22,11 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Re=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ds=K(function(e,a){const s=V(e),t=pe(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,r=c.flatMap(h=>h.error).filter(h=>!!h)??[];return{onNavigateBack:()=>{if(n===!0){const h=Qe(a.location.state?.pathnameStackToGoBack),i=h.poppedPathname??Gt(2);a.navigate(i,{state:{pathnameStackToGoBack:h.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:h=>{e(Je(a.scheduleTab,h,r.length>0))},onDelete:h=>{e(bt(a.scheduleTab,h))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(It(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(h,i)=>{e(Et(a.scheduleTab,h,i))},onJELinkClick:h=>{e(Ct({selectedJELinkRowIndex:h})),s("./edit_link")},onTransactionClick:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(h,i)=>{h.trim().length>=2?e(Ne({searchString:h,entityType:i,searchOrigin:"common"})):h.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(h,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:d}=h,{scheduleClass:u,scheduleExpenseCategory:p,months:f,startDate:D,postingDate:x,vendor:I}=m,C=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(y=>y.id===I?.selectedOption):void 0,E={id:C?.zeniId??I?.selectedOption??"",name:C?.name??I?.defaultOptions.find(y=>y.value===I?.selectedOption)?.label??"",logo:C?.logo},w=u.selectedOption!=null?a.classList.find(y=>y.classId===u.selectedOption):void 0,b=p.selectedOption!=null?a.accountList.find(y=>y.qboId===p.selectedOption):void 0,k=f?.selectedOption,P=d.map((y,L)=>({...a.scheduleLocalData.jeScheduleDetails[L],amount:{...a.scheduleLocalData.jeScheduleDetails[L].amount,amount:y.amount}})),F=x.type==="day"?x.dayOfMonth?x.dayOfMonth:1:void 0,_=x.type==="lastDayOfMonth"||void 0,A={selectedAccount:b?.accountId,selectedClass:w?.classId,selectedDate:D,selectedMonths:k,jeScheduleDetails:P,lastDayOfMonth:_,selectedVendor:E,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:A,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||b?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||D==null||k==null||_!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),rs=()=>{const e=J(),a=Y(),s=z(),t=ce(),{tenantEmailDomain:n}=R(),[o,c]=g.useState(!1),r=a.state?.message==="expenseAutomation",{scheduleType:h,scheduleDetailId:i}=R(),m=us(h,i),d=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{d!=null&&d.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[d,i]);const u=Ee(h)??"prepaid_expenses",p=S(T=>pe(T,u)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),D=S(T=>Me(T,"common")),x=S(T=>ee(T)),I=S(T=>T.classListState.fetchState),C=S(T=>te(T)),E=S(T=>ft(T).selectedPeriod),w=x!=="Completed"||I!=="Completed";g.useEffect(()=>{o===!1&&w?(s(gt(u,y,!0)),c(!0)):w===!1&&o===!1&&(s(vt(u,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),r===!0){const{month:T,year:v}=E;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/prepaid_expenses")},[p.markAsCompleteStatus.fetchState]);const b=S(T=>V(T)),k=S(T=>X(T,b.companyId)),P=p.fetchState,F=p.allAccountList,_=p.allClassList,A=p.scheduleDetailsLocalData;let y;if(i!=="new"&&(y=i),m!==!0||p.fetchState==="Error")return l.jsx(le,{});const L=P==="Completed"&&o===!0;return P!=="Completed"?l.jsx(We,{}):l.jsxs(cs,{children:[L===!0?l.jsx(Q,{analytics:j,onLoad:()=>{ps(p,u,k)}}):null,l.jsx(ds,{location:a,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},usedInExpenseAutomation:r,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},expenseAutomationSelectedPeriod:E,navigate:e,classList:_,accountList:F,scheduleLocalData:A[u],selectedJEScheduleKey:d,scheduleDetailId:y,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:u,analytics:j,controllerUserDetails:k,isAccountingClassesEnabled:C,status:p.selectedJEScheduleTransaction?.status.code})]})},us=(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}),ps=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ie(s.controllers),c=be(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Re)??null,endMonth:r.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},ms={drawerLeftMargin:new Ze(0,0,100,200)},Ss=K(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:r}=pe(e,a.scheduleType),h=V(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,d=m!=null?aa(e,m):void 0,u=U.getSignedInUser(),p=e.tenantState.currentTenantId,f={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:h.tenantId??p},D=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:d,localData:c[n].jeScheduleDetails[t],saveStatus:r.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:D,isDisabled:r.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:na(Xe.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(kt(o))},onSaveClick:()=>{e(Je(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(sa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(Cn),fs=()=>{const e=Dn(),a=J(),s=z(),{scheduleDetailId:t}=R(),n=de(),o=ms.drawerLeftMargin.valuePx(n),{scheduleType:c}=R(),{useFeatureGate:r}=ae(),{isFeatureEnabled:h}=r($.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,d]=g.useState(!1);if(U.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const u=S(C=>pe(C,i));g.useEffect(()=>{u.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const p=u.selectedJELinkRowIndex,f=p!=null?u.scheduleDetailsLocalData[i].jeScheduleDetails[p]?.jeLink:null,D=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{D!=null&&s(kt(D))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&p!=null&&(d(!0),s(ta({scheduleType:i,jeScheduleDetailId:t,rowId:p})))});const x=S(C=>V(C)),I=S(C=>X(C,x.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(gs,{onClick:C=>C.stopPropagation(),children:u.fetchState!=="Completed"||u.selectedJEScheduleTransaction==null||p==null?l.jsx(Ut,{fetchState:u.fetchState}):l.jsx(Ss,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:p,jeScheduledTransaction:u.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:I,isVendorBulkUpdateOnTransactionEnabled:h})})})},gs=M(Kt)`
25
+ `,Re=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ds=K(function(e,a){const s=V(e),t=pe(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,r=c.flatMap(h=>h.error).filter(h=>!!h)??[];return{onNavigateBack:()=>{if(n===!0){const h=Qe(a.location.state?.pathnameStackToGoBack),i=h.poppedPathname??Gt(2);a.navigate(i,{state:{pathnameStackToGoBack:h.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:h=>{e(Je(a.scheduleTab,h,r.length>0))},onDelete:h=>{e(bt(a.scheduleTab,h))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(It(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(h,i)=>{e(Et(a.scheduleTab,h,i))},onJELinkClick:h=>{e(Ct({selectedJELinkRowIndex:h})),s("./edit_link")},onTransactionClick:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(h,i)=>{h.trim().length>=2?e(Me({searchString:h,entityType:i,searchOrigin:"common"})):h.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(h,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:d}=h,{scheduleClass:u,scheduleExpenseCategory:p,months:f,startDate:D,postingDate:x,vendor:I}=m,C=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(y=>y.id===I?.selectedOption):void 0,E={id:C?.zeniId??I?.selectedOption??"",name:C?.name??I?.defaultOptions.find(y=>y.value===I?.selectedOption)?.label??"",logo:C?.logo},w=u.selectedOption!=null?a.classList.find(y=>y.classId===u.selectedOption):void 0,b=p.selectedOption!=null?a.accountList.find(y=>y.qboId===p.selectedOption):void 0,k=f?.selectedOption,P=d.map((y,L)=>({...a.scheduleLocalData.jeScheduleDetails[L],amount:{...a.scheduleLocalData.jeScheduleDetails[L].amount,amount:y.amount}})),F=x.type==="day"?x.dayOfMonth?x.dayOfMonth:1:void 0,_=x.type==="lastDayOfMonth"||void 0,A={selectedAccount:b?.accountId,selectedClass:w?.classId,selectedDate:D,selectedMonths:k,jeScheduleDetails:P,lastDayOfMonth:_,selectedVendor:E,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:A,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||b?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||D==null||k==null||_!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),rs=()=>{const e=J(),a=Y(),s=z(),t=ce(),{tenantEmailDomain:n}=R(),[o,c]=g.useState(!1),r=a.state?.message==="expenseAutomation",{scheduleType:h,scheduleDetailId:i}=R(),m=us(h,i),d=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{d!=null&&d.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[d,i]);const u=Ee(h)??"prepaid_expenses",p=S(T=>pe(T,u)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),D=S(T=>Ne(T,"common")),x=S(T=>ee(T)),I=S(T=>T.classListState.fetchState),C=S(T=>te(T)),E=S(T=>ft(T).selectedPeriod),w=x!=="Completed"||I!=="Completed";g.useEffect(()=>{o===!1&&w?(s(gt(u,y,!0)),c(!0)):w===!1&&o===!1&&(s(vt(u,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),r===!0){const{month:T,year:v}=E;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/prepaid_expenses")},[p.markAsCompleteStatus.fetchState]);const b=S(T=>V(T)),k=S(T=>X(T,b.companyId)),P=p.fetchState,F=p.allAccountList,_=p.allClassList,A=p.scheduleDetailsLocalData;let y;if(i!=="new"&&(y=i),m!==!0||p.fetchState==="Error")return l.jsx(le,{});const L=P==="Completed"&&o===!0;return P!=="Completed"?l.jsx(We,{}):l.jsxs(cs,{children:[L===!0?l.jsx(Q,{analytics:j,onLoad:()=>{ps(p,u,k)}}):null,l.jsx(ds,{location:a,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},usedInExpenseAutomation:r,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},expenseAutomationSelectedPeriod:E,navigate:e,classList:_,accountList:F,scheduleLocalData:A[u],selectedJEScheduleKey:d,scheduleDetailId:y,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:u,analytics:j,controllerUserDetails:k,isAccountingClassesEnabled:C,status:p.selectedJEScheduleTransaction?.status.code})]})},us=(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}),ps=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ie(s.controllers),c=be(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Re)??null,endMonth:r.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},ms={drawerLeftMargin:new Ze(0,0,100,200)},Ss=K(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:r}=pe(e,a.scheduleType),h=V(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,d=m!=null?aa(e,m):void 0,u=U.getSignedInUser(),p=e.tenantState.currentTenantId,f={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:h.tenantId??p},D=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:d,localData:c[n].jeScheduleDetails[t],saveStatus:r.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:D,isDisabled:r.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:na(Xe.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(kt(o))},onSaveClick:()=>{e(Je(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(sa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(Cn),fs=()=>{const e=Dn(),a=J(),s=z(),{scheduleDetailId:t}=R(),n=de(),o=ms.drawerLeftMargin.valuePx(n),{scheduleType:c}=R(),{useFeatureGate:r}=ae(),{isFeatureEnabled:h}=r($.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,d]=g.useState(!1);if(U.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const u=S(C=>pe(C,i));g.useEffect(()=>{u.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const p=u.selectedJELinkRowIndex,f=p!=null?u.scheduleDetailsLocalData[i].jeScheduleDetails[p]?.jeLink:null,D=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{D!=null&&s(kt(D))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&p!=null&&(d(!0),s(ta({scheduleType:i,jeScheduleDetailId:t,rowId:p})))});const x=S(C=>V(C)),I=S(C=>X(C,x.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(gs,{onClick:C=>C.stopPropagation(),children:u.fetchState!=="Completed"||u.selectedJEScheduleTransaction==null||p==null?l.jsx(Ut,{fetchState:u.fetchState}):l.jsx(Ss,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:p,jeScheduledTransaction:u.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:I,isVendorBulkUpdateOnTransactionEnabled:h})})})},gs=N(Kt)`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  flex-direction: column;
29
- `,ve=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"}},xe=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"}},Te=()=>{const e=Y(),a=z(),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(ie(n))}},[e.pathname,s.currentTab,a]),s},ne="accrued_expenses",vs=K(function(e,a){const s=V(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:ne,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:ne,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:ne,searchText:t}))},onReloadReport:()=>{e(wt(ne))},onScroll:t=>{e(ze({scheduleType:ne,scrollYOffset:t}))},onClickNewButton:()=>{e(ca()),e(da()),j.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ia({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e($e({scheduleType:ne,fetchState:t}))}}})(En),xs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),[o,c]=g.useState(!1),r=J(),h=z(),{useFeatureGate:i}=ae(),m=ce();Te();const{isFeatureEnabled:d,isFeatureGateLoading:u}=i($.isOpexByVendorFeatureEnabled),p=U.getSignedInUser(),f=S(v=>V(v)),D={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:f.tenantId},x=g.useMemo(()=>({authParams:D,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:f.companyName}),[]),[I,C]=g.useState(!1),E=S(v=>ee(v)),w=S(v=>Ke(v,"accrued_expenses")),b=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),P=e.includes("accrued_expenses");g.useEffect(()=>{(b||k||P)&&I===!1&&E!=="Completed"&&(h(ye()),C(!0))},[I]),g.useEffect(()=>{u===!1&&(h(De({shouldFetchAccruedExpenses:P,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:b,shouldFetchOpexByVendor:d,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[E,k,u,d]),g.useEffect(()=>{t===!1&&w==="Completed"&&h(wt("accrued_expenses",{selectedTimeframe:Ge("accrued_expenses"),selectedCategoryId:"all"},!0))},[t,w]);const F=S(v=>la(v,ne)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:A}=fe({mobileExploreReferrer:"Vendors — Accrued Expenses"});Se({isDataReady:F.fetchState==="Completed"});const y=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||y!==!0||d!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),P||r("../opex");const L=S(v=>X(v,f.companyId)),T=v=>{c(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:o,handleDrawerToggle:T}),l.jsx(vs,{navigate:r,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:x,themeState:m,vendorTabsToShow:e,analytics:j,controllerUserDetails:L,isAiCfoAccessEnabled:_,onAskAiCfoClick:A,onClickMenuIcon:()=>T(!0)})]})},se="fixed_assets",Ts=K(function(e,a){const s=V(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:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(we(se))},onScroll:t=>{e(ze({scheduleType:se,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e($e({scheduleType:se,fetchState:t}))}}})(Mt),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z();Te();const{useFeatureGate:r}=ae(),h=ce(),{isFeatureEnabled:i,isFeatureGateLoading:m}=r($.isOpexByVendorFeatureEnabled),d=U.getSignedInUser(),u=S(v=>V(v)),p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:u.tenantId},f=g.useMemo(()=>({authParams:p,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName}),[]),[D,x]=g.useState(!1),I=S(v=>ee(v)),C=S(v=>Ke(v,"fixed_assets")),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),b=e.includes("accrued_expenses");g.useEffect(()=>{(E||w||b)&&D===!1&&I!=="Completed"&&(c(ye()),x(!0))},[D]),g.useEffect(()=>{m===!1&&(c(De({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:i,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[I,w,m,i]),g.useEffect(()=>{t===!1&&C==="Completed"&&c(we("fixed_assets",{selectedTimeframe:Ge("fixed_assets"),selectedCategoryId:"all"},!0))},[t,C]);const k=S(v=>At(v,se)),{isAiCfoAccessEnabled:P,onAskAiCfoClick:F}=fe({mobileExploreReferrer:"Vendors — Fixed Assets"});Se({isDataReady:k.fetchState==="Completed"});const _=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||_!==!0||i!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),w||o("../opex");const A=S(v=>X(v,u.companyId)),[y,L]=g.useState(!1),T=v=>{L(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Ts,{navigate:o,scheduleListReport:k,downloadParams:f,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:P,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},Ds=M.div`
29
+ `,ve=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"}},xe=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"}},Te=()=>{const e=Y(),a=z(),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(ie(n))}},[e.pathname,s.currentTab,a]),s},ne="accrued_expenses",vs=K(function(e,a){const s=V(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:ne,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:ne,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:ne,searchText:t}))},onReloadReport:()=>{e(wt(ne))},onScroll:t=>{e(ze({scheduleType:ne,scrollYOffset:t}))},onClickNewButton:()=>{e(ca()),e(da()),j.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ia({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e($e({scheduleType:ne,fetchState:t}))}}})(En),xs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),[o,c]=g.useState(!1),r=J(),h=z(),{useFeatureGate:i}=ae(),m=ce();Te();const{isFeatureEnabled:d,isFeatureGateLoading:u}=i($.isOpexByVendorFeatureEnabled),p=U.getSignedInUser(),f=S(v=>V(v)),D={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:f.tenantId},x=g.useMemo(()=>({authParams:D,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:f.companyName}),[]),[I,C]=g.useState(!1),E=S(v=>ee(v)),w=S(v=>Ke(v,"accrued_expenses")),b=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),P=e.includes("accrued_expenses");g.useEffect(()=>{(b||k||P)&&I===!1&&E!=="Completed"&&(h(ye()),C(!0))},[I]),g.useEffect(()=>{u===!1&&(h(De({shouldFetchAccruedExpenses:P,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:b,shouldFetchOpexByVendor:d,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[E,k,u,d]),g.useEffect(()=>{t===!1&&w==="Completed"&&h(wt("accrued_expenses",{selectedTimeframe:Ge("accrued_expenses"),selectedCategoryId:"all"},!0))},[t,w]);const F=S(v=>la(v,ne)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:A}=fe({mobileExploreReferrer:"Vendors — Accrued Expenses"});Se({isDataReady:F.fetchState==="Completed"});const y=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||y!==!0||d!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),P||r("../opex");const L=S(v=>X(v,f.companyId)),T=v=>{c(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:o,handleDrawerToggle:T}),l.jsx(vs,{navigate:r,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:x,themeState:m,vendorTabsToShow:e,analytics:j,controllerUserDetails:L,isAiCfoAccessEnabled:_,onAskAiCfoClick:A,onClickMenuIcon:()=>T(!0)})]})},se="fixed_assets",Ts=K(function(e,a){const s=V(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:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(we(se))},onScroll:t=>{e(ze({scheduleType:se,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e($e({scheduleType:se,fetchState:t}))}}})(Nt),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z();Te();const{useFeatureGate:r}=ae(),h=ce(),{isFeatureEnabled:i,isFeatureGateLoading:m}=r($.isOpexByVendorFeatureEnabled),d=U.getSignedInUser(),u=S(v=>V(v)),p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:u.tenantId},f=g.useMemo(()=>({authParams:p,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName}),[]),[D,x]=g.useState(!1),I=S(v=>ee(v)),C=S(v=>Ke(v,"fixed_assets")),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),b=e.includes("accrued_expenses");g.useEffect(()=>{(E||w||b)&&D===!1&&I!=="Completed"&&(c(ye()),x(!0))},[D]),g.useEffect(()=>{m===!1&&(c(De({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:i,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[I,w,m,i]),g.useEffect(()=>{t===!1&&C==="Completed"&&c(we("fixed_assets",{selectedTimeframe:Ge("fixed_assets"),selectedCategoryId:"all"},!0))},[t,C]);const k=S(v=>At(v,se)),{isAiCfoAccessEnabled:P,onAskAiCfoClick:F}=fe({mobileExploreReferrer:"Vendors — Fixed Assets"});Se({isDataReady:k.fetchState==="Completed"});const _=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||_!==!0||i!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),w||o("../opex");const A=S(v=>X(v,u.companyId)),[y,L]=g.useState(!1),T=v=>{L(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Ts,{navigate:o,scheduleListReport:k,downloadParams:f,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:P,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},Ds=N.div`
30
30
  display: flex;
31
31
  min-height: 100%;
32
32
  width: 100%;
@@ -34,7 +34,7 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
34
34
  flex-direction: column;
35
35
  align-items: center;
36
36
  background-color: ${e=>e.theme.colors.grey4};
37
- `,Cs=K(function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n=V(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},r=H(e),h=ra(e);return{report:r,uiState:h,isAccountingClassesEnabled:te(e),analytics:j,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:o,statementEndPoint:`${Z}/opexByVendor`,authParams:c,timezone:ke()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(xa(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(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(va(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ga(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(fa({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Sa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrSearchStarted:t=>{e(ma(t))},onPageFetchStarted:()=>{e(pa(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(ua({timeframe:t}))}}})(bn);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=Y(),{tenantEmailDomain:c}=R(),r=de(),h=U.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i($.isOpexByVendorFeatureEnabled),u=S(A=>H(A));if(h==null)throw Error("Can't access opex by vendor page without signing in...");Te();const[p,f]=g.useState(!1),D=S(A=>ee(A)),x=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),C=e.includes("accrued_expenses"),E=S(A=>me(A)),{isAiCfoAccessEnabled:w,onAskAiCfoClick:b}=fe({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});Se({isDataReady:u.fetchState==="Completed"&&u.isReportGenerated===!0});const{areTenantIdsInSync:k}=In();g.useEffect(()=>{(x||I||C)&&p===!1&&D!=="Completed"&&k&&(n(ye()),f(!0))},[p,k]),g.useEffect(()=>{k&&n(De({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:m===!0&&d===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[D,I,d,m,k]),u.fetchState!=="Completed"||u.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(u.isReportGenerated===!1&&u.fetchState==="Completed"||m===!1&&d===!1)&&t("../summary");const[P,F]=g.useState(!1),_=A=>{F(A)};return l.jsxs(Ds,{windowSize:r,children:[u.fetchState==="Completed"?l.jsx(Q,{analytics:j,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(ge,{isAppContentDrawerOpen:P,handleDrawerToggle:_}),l.jsx(Cs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:w,onAskAiCfoClick:b,onClickMenuIcon:()=>{_(!0)}})]})}const oe="prepaid_expenses",Is=K(function(e,a){const s=V(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:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(we(oe))},onScroll:t=>{e(ze({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e($e({scheduleType:oe,fetchState:t}))}}})(Mt),bs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z(),{useFeatureGate:r}=ae(),h=ce();Te();const i=U.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:d}=r($.isOpexByVendorFeatureEnabled),u=S(v=>V(v)),p=S(v=>Ke(v,"prepaid_expenses")),f={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},D=g.useMemo(()=>({authParams:f,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName}),[]),[x,I]=g.useState(!1),C=S(v=>ee(v)),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),b=e.includes("accrued_expenses");g.useEffect(()=>{(E||w||b)&&x===!1&&C!=="Completed"&&(c(ye()),I(!0))},[x]),g.useEffect(()=>{t===!1&&p==="Completed"&&c(we("prepaid_expenses",{selectedTimeframe:Ge("prepaid_expenses"),selectedCategoryId:"all"},!0))},[t,p]),g.useEffect(()=>{d===!1&&(c(De({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:w,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[C,w,d,m]);const k=S(v=>At(v,oe)),{isAiCfoAccessEnabled:P,onAskAiCfoClick:F}=fe({mobileExploreReferrer:"Vendors — Prepaid Expenses"});Se({isDataReady:k.fetchState==="Completed"});const _=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||_!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=S(v=>X(v,u.companyId)),[y,L]=g.useState(!1),T=v=>{L(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Is,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:k,downloadParams:D,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:P,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},ks=M.div`
37
+ `,Cs=K(function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n=V(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},r=H(e),h=ra(e);return{report:r,uiState:h,isAccountingClassesEnabled:te(e),analytics:j,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:o,statementEndPoint:`${Z}/opexByVendor`,authParams:c,timezone:ke()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(xa(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(va(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ga(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(fa({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Sa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrSearchStarted:t=>{e(ma(t))},onPageFetchStarted:()=>{e(pa(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(ua({timeframe:t}))}}})(bn);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=Y(),{tenantEmailDomain:c}=R(),r=de(),h=U.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i($.isOpexByVendorFeatureEnabled),u=S(A=>H(A));if(h==null)throw Error("Can't access opex by vendor page without signing in...");Te();const[p,f]=g.useState(!1),D=S(A=>ee(A)),x=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),C=e.includes("accrued_expenses"),E=S(A=>me(A)),{isAiCfoAccessEnabled:w,onAskAiCfoClick:b}=fe({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});Se({isDataReady:u.fetchState==="Completed"&&u.isReportGenerated===!0});const{areTenantIdsInSync:k}=In();g.useEffect(()=>{(x||I||C)&&p===!1&&D!=="Completed"&&k&&(n(ye()),f(!0))},[p,k]),g.useEffect(()=>{k&&n(De({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:m===!0&&d===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[D,I,d,m,k]),u.fetchState!=="Completed"||u.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(u.isReportGenerated===!1&&u.fetchState==="Completed"||m===!1&&d===!1)&&t("../summary");const[P,F]=g.useState(!1),_=A=>{F(A)};return l.jsxs(Ds,{windowSize:r,children:[u.fetchState==="Completed"?l.jsx(Q,{analytics:j,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(ge,{isAppContentDrawerOpen:P,handleDrawerToggle:_}),l.jsx(Cs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:w,onAskAiCfoClick:b,onClickMenuIcon:()=>{_(!0)}})]})}const oe="prepaid_expenses",Is=K(function(e,a){const s=V(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:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(we(oe))},onScroll:t=>{e(ze({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e($e({scheduleType:oe,fetchState:t}))}}})(Nt),bs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z(),{useFeatureGate:r}=ae(),h=ce();Te();const i=U.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:d}=r($.isOpexByVendorFeatureEnabled),u=S(v=>V(v)),p=S(v=>Ke(v,"prepaid_expenses")),f={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},D=g.useMemo(()=>({authParams:f,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName}),[]),[x,I]=g.useState(!1),C=S(v=>ee(v)),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),b=e.includes("accrued_expenses");g.useEffect(()=>{(E||w||b)&&x===!1&&C!=="Completed"&&(c(ye()),I(!0))},[x]),g.useEffect(()=>{t===!1&&p==="Completed"&&c(we("prepaid_expenses",{selectedTimeframe:Ge("prepaid_expenses"),selectedCategoryId:"all"},!0))},[t,p]),g.useEffect(()=>{d===!1&&(c(De({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:w,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[C,w,d,m]);const k=S(v=>At(v,oe)),{isAiCfoAccessEnabled:P,onAskAiCfoClick:F}=fe({mobileExploreReferrer:"Vendors — Prepaid Expenses"});Se({isDataReady:k.fetchState==="Completed"});const _=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||_!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=S(v=>X(v,u.companyId)),[y,L]=g.useState(!1),T=v=>{L(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Is,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:k,downloadParams:D,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:P,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},ks=N.div`
38
38
  display: flex;
39
39
  min-height: 100%;
40
40
  width: 100%;
@@ -42,46 +42,46 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
42
42
  flex-direction: column;
43
43
  align-items: center;
44
44
  background-color: ${e=>e.theme.colors.grey4};
45
- `,ws=K(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:r}=a,h=U.getSignedInUser(),i={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:ka(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:r?.bookkeeping_user===!0,filesEndPoint:Nt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:r,location:h,firstMonthOfFY:i}=a,m=()=>{const d=Qe(h.state?.pathnameStackToGoBack),u=d.poppedPathname??((p=2)=>{let f=p;a.isTrendPeriodSelected===!0&&(f=5);let D="../";for(let x=0;x<f;x++)D=`${D}../`;return D})(1);s(u,{state:{pathnameStackToGoBack:d.newStack}})};return{onSaveVendor:()=>{t!=null&&((d,u)=>{const{vendorId:p,vendorName:f,existingCategory:D,existingClass:x,existingOwner:I,selectedCategory:C,selectedClass:E,selectedOwner:w,isRecommendedCategorySelected:b,isRecommendedClassSelected:k,categoryRecommendationTypeSelected:P,classRecommendationTypeSelected:F}=Va(d,u);p!=null&&j.trackVendorDetailsSave(p,f??"",D,x,I,C,E,w,b,k,P,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(_a(n,void 0))},onVendorSpendTrendFilterTabClick:d=>{e(Pa(d))},saveVendorDetailLocalData:d=>{n!=null&&e(La({vendorId:n,localData:d}))},saveContactsInVendorTabDetailLocalData:(d,u)=>{e(Fa({vendorId:d,localData:{contacts:u}}))},onCancelClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&j.trackVendorDetailsCancel(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),m()},handleSpendTrendPercentChangeClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView?.vendorBasic,d.id!=null&&j.trackVendorDetailsSpendTrendHotlinkClicked(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email))},onSaveSuccess:()=>{n!=null&&e(ja("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),m()},onTrendSelectedPeriodChange:d=>{if(d==null)o!=null&&e(je(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const u=d.currentTimePeriod==null?d.addTimePeriod:{startDate:d.addTimePeriod.startDate,endDate:d.currentTimePeriod.endDate};e(Le(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:d.addTimePeriod},i)),e(je(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:u}))}},onVendorTabSelectionChanged:d=>{e(Aa(d))},onAddressClick:(d,u)=>{if(r==null)return;const p=Kn(r,d,u),f=N(h.state?.pathnameStackToGoBack,h.pathname);s(p,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:d=>{e(wa({collapsableStatus:d}))},onTransactionItemClick:d=>{const u=`${q(d,r)}`,p=N(h.state?.pathnameStackToGoBack,h.pathname);s(u,{state:{pathnameStackToGoBack:p}})},onLoadPreviousTransactionsClick:(d,u)=>{e(Ft({timePeriod:Fe(d),numberOfQuartersFetched:u})),e(Lt(c,Fe(d),!0,!0))}}})(wn);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=z(),t=Y(),n=J(),o=kn(),[c,r]=g.useState(!1),[h,i]=g.useState(!1),[m,d]=g.useState(!1),u=R(),p=u.vendorId,f=u.qboId,{tenantEmailDomain:D,timeframe:x,startDate:I,endDate:C}=u,E={id:f??"",name:"",type:"vendor",zeniId:p??"",qboId:f??""};g.useEffect(()=>{x!=null&&I!=null&&C!=null?r(!0):(r(!1),m===!1&&(d(!0),s(je(E,"EntityDetail"))))},[x,I,C]);const w=de(),b=S(O=>V(O)),k=S(O=>p!=null?Ta(O,p,E):void 0),P=S(O=>O.vendorState.vendorByID[p??""]),F=S(O=>V(O).company?.companyInfo.firstMonthOfFY??1),_=S(()=>ya(F,2)),A=Fe({startDate:_.startDate,endDate:Da()}),y=Ca(F),L=S(O=>Ea(O.trendWithTransactionsState,E,"EntityDetail")),[T,v]=g.useState(!1),re=c===!1&&m===!1?void 0:L?.selectedPeriod?.timePeriod??y;return g.useEffect(()=>(e==null&&k?.fetchState!=="Not-Started"||p==null||s(Ia(p,E)),()=>{e!=null&&p!=null&&s(ba(p))}),[p,t.state,s]),g.useEffect(()=>{k?.fetchState==="Completed"&&k?.vendorViewDetails.vendorView?.vendorBasic!=null&&((O,ue,Ae)=>{O.id!=null&&j.trackVendorDetails(O.id,O.name,Ae,O.account?.accountName,O.class?.className,O.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(k?.vendorViewDetails.vendorView?.vendorBasic,k?.vendorSpend,e),v(!1)},[k?.fetchState]),g.useEffect(()=>{if(k?.fetchState==="Completed"&&T===!1){re!=null&&c===!1&&(s(Le(E,"EntityDetail",{timeframe:L?.selectedPeriod?.timeframe??"quarter",timePeriod:re},F)),v(!0));const O=Ce.getLocalizedStrings().dateFormat.analytics;if(c===!0&&x!=null&&I!=null&&C!=null){v(!0);const ue=x,Ae={startDate:st(I,O.YYYYDashMMDashDDFormat),endDate:st(C,O.YYYYDashMMDashDDFormat)};s(Le(E,"EntityDetail",{timeframe:ue,timePeriod:Ae}))}}},[k?.fetchState,re,L?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{k?.fetchState==="Completed"&&h===!1&&(s(Ft({timePeriod:A,numberOfQuartersFetched:3})),s(Lt(E,k.allTransactionsTabData?.timePeriod??A,!1,!0)),i(!0))},[k?.fetchState,h]),p==null?l.jsx(le,{}):l.jsx(ks,{windowSize:w,children:l.jsx(ws,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:k,vendorId:p,currentTenant:b,selectedVendor:P,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:L?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:y,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:D})})}const As=Ce.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,js={containerWidth:new Ze(100,58)},Fs=M(jn)`
45
+ `,ws=K(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:r}=a,h=U.getSignedInUser(),i={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:ka(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:r?.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:r,location:h,firstMonthOfFY:i}=a,m=()=>{const d=Qe(h.state?.pathnameStackToGoBack),u=d.poppedPathname??((p=2)=>{let f=p;a.isTrendPeriodSelected===!0&&(f=5);let D="../";for(let x=0;x<f;x++)D=`${D}../`;return D})(1);s(u,{state:{pathnameStackToGoBack:d.newStack}})};return{onSaveVendor:()=>{t!=null&&((d,u)=>{const{vendorId:p,vendorName:f,existingCategory:D,existingClass:x,existingOwner:I,selectedCategory:C,selectedClass:E,selectedOwner:w,isRecommendedCategorySelected:b,isRecommendedClassSelected:k,categoryRecommendationTypeSelected:P,classRecommendationTypeSelected:F}=Va(d,u);p!=null&&j.trackVendorDetailsSave(p,f??"",D,x,I,C,E,w,b,k,P,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(_a(n,void 0))},onVendorSpendTrendFilterTabClick:d=>{e(Pa(d))},saveVendorDetailLocalData:d=>{n!=null&&e(La({vendorId:n,localData:d}))},saveContactsInVendorTabDetailLocalData:(d,u)=>{e(Fa({vendorId:d,localData:{contacts:u}}))},onCancelClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&j.trackVendorDetailsCancel(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),m()},handleSpendTrendPercentChangeClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView?.vendorBasic,d.id!=null&&j.trackVendorDetailsSpendTrendHotlinkClicked(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email))},onSaveSuccess:()=>{n!=null&&e(ja("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),m()},onTrendSelectedPeriodChange:d=>{if(d==null)o!=null&&e(je(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const u=d.currentTimePeriod==null?d.addTimePeriod:{startDate:d.addTimePeriod.startDate,endDate:d.currentTimePeriod.endDate};e(Le(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:d.addTimePeriod},i)),e(je(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:u}))}},onVendorTabSelectionChanged:d=>{e(Aa(d))},onAddressClick:(d,u)=>{if(r==null)return;const p=Kn(r,d,u),f=M(h.state?.pathnameStackToGoBack,h.pathname);s(p,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:d=>{e(wa({collapsableStatus:d}))},onTransactionItemClick:d=>{const u=`${q(d,r)}`,p=M(h.state?.pathnameStackToGoBack,h.pathname);s(u,{state:{pathnameStackToGoBack:p}})},onLoadPreviousTransactionsClick:(d,u)=>{e(Ft({timePeriod:Fe(d),numberOfQuartersFetched:u})),e(Lt(c,Fe(d),!0,!0))}}})(wn);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=z(),t=Y(),n=J(),o=kn(),[c,r]=g.useState(!1),[h,i]=g.useState(!1),[m,d]=g.useState(!1),u=R(),p=u.vendorId,f=u.qboId,{tenantEmailDomain:D,timeframe:x,startDate:I,endDate:C}=u,E={id:f??"",name:"",type:"vendor",zeniId:p??"",qboId:f??""};g.useEffect(()=>{x!=null&&I!=null&&C!=null?r(!0):(r(!1),m===!1&&(d(!0),s(je(E,"EntityDetail"))))},[x,I,C]);const w=de(),b=S(O=>V(O)),k=S(O=>p!=null?Ta(O,p,E):void 0),P=S(O=>O.vendorState.vendorByID[p??""]),F=S(O=>V(O).company?.companyInfo.firstMonthOfFY??1),_=S(()=>ya(F,2)),A=Fe({startDate:_.startDate,endDate:Da()}),y=Ca(F),L=S(O=>Ea(O.trendWithTransactionsState,E,"EntityDetail")),[T,v]=g.useState(!1),re=c===!1&&m===!1?void 0:L?.selectedPeriod?.timePeriod??y;return g.useEffect(()=>(e==null&&k?.fetchState!=="Not-Started"||p==null||s(Ia(p,E)),()=>{e!=null&&p!=null&&s(ba(p))}),[p,t.state,s]),g.useEffect(()=>{k?.fetchState==="Completed"&&k?.vendorViewDetails.vendorView?.vendorBasic!=null&&((O,ue,Ae)=>{O.id!=null&&j.trackVendorDetails(O.id,O.name,Ae,O.account?.accountName,O.class?.className,O.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(k?.vendorViewDetails.vendorView?.vendorBasic,k?.vendorSpend,e),v(!1)},[k?.fetchState]),g.useEffect(()=>{if(k?.fetchState==="Completed"&&T===!1){re!=null&&c===!1&&(s(Le(E,"EntityDetail",{timeframe:L?.selectedPeriod?.timeframe??"quarter",timePeriod:re},F)),v(!0));const O=Ce.getLocalizedStrings().dateFormat.analytics;if(c===!0&&x!=null&&I!=null&&C!=null){v(!0);const ue=x,Ae={startDate:st(I,O.YYYYDashMMDashDDFormat),endDate:st(C,O.YYYYDashMMDashDDFormat)};s(Le(E,"EntityDetail",{timeframe:ue,timePeriod:Ae}))}}},[k?.fetchState,re,L?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{k?.fetchState==="Completed"&&h===!1&&(s(Ft({timePeriod:A,numberOfQuartersFetched:3})),s(Lt(E,k.allTransactionsTabData?.timePeriod??A,!1,!0)),i(!0))},[k?.fetchState,h]),p==null?l.jsx(le,{}):l.jsx(ks,{windowSize:w,children:l.jsx(ws,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:k,vendorId:p,currentTenant:b,selectedVendor:P,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:L?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:y,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:D})})}const As=Ce.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,js={containerWidth:new Ze(100,58)},Fs=N(jn)`
46
46
  width: ${W.sp4};
47
47
  height: ${W.sp4};
48
48
  cursor: pointer;
49
49
  color: ${e=>e.theme.colors.brandColorJade};
50
- `,Ls=M.div`
50
+ `,Ls=N.div`
51
51
  display: flex;
52
52
  height: 100vh;
53
53
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
54
54
  width: 100%;
55
55
  overflow-y: scroll;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,Ps=M.div`
57
+ `,Ps=N.div`
58
58
  display: flex;
59
59
  flex-direction: column;
60
60
  width: ${e=>`${js.containerWidth.value(e.windowSize)}%`};
61
61
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
62
- `,_s=K(function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let r={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(r=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Nt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:j,entityId:a.billId,fetchVendorFetchStatus:r,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Ma({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Ot({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Pe({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Pe({fetchState:"Not-Started",error:void 0})),e(Vt({vendorId:s,w9Documents:[]}))}}})(Ln);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=z(),t=J(),{vendorId:n}=R(),o=de(),c=ce(),r=U.getSignedInUser(),[h,i]=g.useState(!1),{useFeatureGate:m}=ae(),{isFeatureEnabled:d}=m($.isVendorRecommendationFeatureEnabled),u=S(y=>V(y)).companyName,p=new AbortController,f=p.signal;let D,x,I,C,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");D=S(y=>Pt(y,n)),x=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),I=S(y=>y.vendorViewState.editVendorStateById[n]?.fetchStatus),E=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),C=S(y=>y.vendorFiling1099UploadDetailsState);const w=I?.fetchState==="In-Progress"||C?.w9FormUploadStatus?.fetchState==="In-Progress",b=()=>{c.toggle()};g.useEffect(()=>()=>{p.abort(),s(_t(n))},[]),g.useEffect(()=>{h||n!=null&&(i(!0),s(Ba(!1,n,f)))},[n]);const k=Be(I?.fetchState),P=Be(x?.fetchState),F=D.vendor?.contactIds,_=F?.[F.length-1],A=S(y=>y.contactState.contactById[_]);if(g.useEffect(()=>{n!=null&&k==="In-Progress"&&I?.fetchState==="Completed"&&D?.vendor!=null&&(s(Oa(n,D.vendor,A)),D?.vendor.filing1099W9Files?.[0]!=null&&s(Pe({fetchState:"Completed",error:void 0})))},[n,D?.vendor]),g.useEffect(()=>{P==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[x?.fetchState]),a===!0&&I?.fetchState!=="Completed"&&I?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(An,{})});if(r==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(Ls,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Fs,{onClick:b}),l.jsxs(Vs,{showContent:r.userEmailDomain==="zeni.ai",children:[l.jsx(Os,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:u})]})]}):null,l.jsx(_s,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:d,pdfTitle:E?As.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:D?.vendor?.legalName,isLoading:w}),l.jsx(Ps,{windowSize:o,children:e})]})}const Vs=M.div`
62
+ `,_s=K(function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let r={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(r=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:j,entityId:a.billId,fetchVendorFetchStatus:r,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Na({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Ot({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Pe({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Pe({fetchState:"Not-Started",error:void 0})),e(Vt({vendorId:s,w9Documents:[]}))}}})(Ln);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=z(),t=J(),{vendorId:n}=R(),o=de(),c=ce(),r=U.getSignedInUser(),[h,i]=g.useState(!1),{useFeatureGate:m}=ae(),{isFeatureEnabled:d}=m($.isVendorRecommendationFeatureEnabled),u=S(y=>V(y)).companyName,p=new AbortController,f=p.signal;let D,x,I,C,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");D=S(y=>Pt(y,n)),x=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),I=S(y=>y.vendorViewState.editVendorStateById[n]?.fetchStatus),E=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),C=S(y=>y.vendorFiling1099UploadDetailsState);const w=I?.fetchState==="In-Progress"||C?.w9FormUploadStatus?.fetchState==="In-Progress",b=()=>{c.toggle()};g.useEffect(()=>()=>{p.abort(),s(_t(n))},[]),g.useEffect(()=>{h||n!=null&&(i(!0),s(Ba(!1,n,f)))},[n]);const k=Be(I?.fetchState),P=Be(x?.fetchState),F=D.vendor?.contactIds,_=F?.[F.length-1],A=S(y=>y.contactState.contactById[_]);if(g.useEffect(()=>{n!=null&&k==="In-Progress"&&I?.fetchState==="Completed"&&D?.vendor!=null&&(s(Oa(n,D.vendor,A)),D?.vendor.filing1099W9Files?.[0]!=null&&s(Pe({fetchState:"Completed",error:void 0})))},[n,D?.vendor]),g.useEffect(()=>{P==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[x?.fetchState]),a===!0&&I?.fetchState!=="Completed"&&I?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(An,{})});if(r==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(Ls,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Fs,{onClick:b}),l.jsxs(Vs,{showContent:r.userEmailDomain==="zeni.ai",children:[l.jsx(Os,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:u})]})]}):null,l.jsx(_s,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:d,pdfTitle:E?As.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:D?.vendor?.legalName,isLoading:w}),l.jsx(Ps,{windowSize:o,children:e})]})}const Vs=N.div`
63
63
  display: ${e=>e.showContent?"flex":"none"};
64
64
  align-items: center;
65
- `,Bs=M.div`
65
+ `,Bs=N.div`
66
66
  margin-bottom: ${W.sp3};
67
67
  margin-top: ${W.sp3};
68
68
  margin-left: ${W.sp8};
69
69
  position: absolute;
70
70
  display: flex;
71
71
  align-items: center;
72
- `,Os=M.div`
72
+ `,Os=N.div`
73
73
  width: 1px;
74
74
  height: ${W.sp3};
75
75
  margin: ${W.sp0} ${W.sp3};
76
76
  background-color: ${e=>e.showAutofill?Jt.neutralGrey1Light:e.theme.colors.hero};
77
- `,Rs=M(Fn.StandardMedium)`
77
+ `,Rs=N(Fn.StandardMedium)`
78
78
  color: ${e=>e.showAutofill?Jt.neutralGrey5Light:e.theme.colors.primary};
79
- `,Us=M.div`
79
+ `,Us=N.div`
80
80
  width: 100%;
81
81
  height: 100vh;
82
82
  overflow: hidden;
83
83
  background-color: ${e=>e.theme.colors.grey4};
84
- `,Ms=K(function(e){const a=Na(e);return{vendorDetailView:Ja(e),globalMerchantView:a}},function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t}))},fetchRecommendation:t=>{e(Ga("tenant",t))},onSaveClick:()=>{e(Ka())},onBackClick:()=>{s("../review")}}})(Pn);function Ns(){const e=J();return l.jsx(Ms,{navigate:e})}const Js=M.div`
84
+ `,Ns=K(function(e){const a=Ma(e);return{vendorDetailView:Ja(e),globalMerchantView:a}},function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t}))},fetchRecommendation:t=>{e(Ga("tenant",t))},onSaveClick:()=>{e(Ka())},onBackClick:()=>{s("../review")}}})(Pn);function Ms(){const e=J();return l.jsx(Ns,{navigate:e})}const Js=N.div`
85
85
  display: flex;
86
86
  min-height: 100%;
87
87
  width: 100%;
@@ -89,11 +89,11 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
89
89
  flex-direction: column;
90
90
  align-items: center;
91
91
  background-color: ${e=>e.theme.colors.grey4};
92
- `,Ks=K(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=U.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},r=V(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:j,authParams:c,attachmentEndpoint:r.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/vendor_attachments_accounting_provider`:`${Z}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(_e(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Za({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const r=Gs(n);e(Qa({vendorId:t,currentSelection:r,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Ha({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(qa({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(Ya({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(za(t,n,o))},onClickCancelPopup:()=>{e($a())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(_e(null))}}})(_n);function pt(){const e=J(),a=z(),s=Y(),{tenantEmailDomain:t}=R(),n=de(),o=U.getSignedInUser(),{vendorId:c}=R(),r=S(u=>dt(u)),[h,i]=g.useState(!1),m=S(u=>dt(u).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&h===!1&&(a(_e(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const d=u=>u.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Q,{analytics:j,onLoad:d}):null,l.jsx(Q,{analytics:j,onLoad:d}),l.jsx(Gn,{isOpen:c!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx($s,{onClick:u=>u.stopPropagation(),children:l.jsx(Ns,{})})}),l.jsx(Js,{windowSize:n,children:l.jsx(Ks,{location:s,navigate:e,vendorFirstReviewDetails:r,tenantEmailDomain:t})})]})}const Gs=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,$s=M(Kt)`
92
+ `,Ks=K(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=U.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},r=V(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:j,authParams:c,attachmentEndpoint:r.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/vendor_attachments_accounting_provider`:`${Z}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(_e(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Za({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const r=Gs(n);e(Qa({vendorId:t,currentSelection:r,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Ha({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(qa({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(Ya({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(za(t,n,o))},onClickCancelPopup:()=>{e($a())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(_e(null))}}})(_n);function pt(){const e=J(),a=z(),s=Y(),{tenantEmailDomain:t}=R(),n=de(),o=U.getSignedInUser(),{vendorId:c}=R(),r=S(u=>dt(u)),[h,i]=g.useState(!1),m=S(u=>dt(u).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&h===!1&&(a(_e(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const d=u=>u.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Q,{analytics:j,onLoad:d}):null,l.jsx(Q,{analytics:j,onLoad:d}),l.jsx(Gn,{isOpen:c!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx($s,{onClick:u=>u.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Js,{windowSize:n,children:l.jsx(Ks,{location:s,navigate:e,vendorFirstReviewDetails:r,tenantEmailDomain:t})})]})}const Gs=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,$s=N(Kt)`
93
93
  display: flex;
94
94
  min-height: 100%;
95
95
  flex-direction: column;
96
- `,zs=K(function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:j,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:r}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(Bt(h)),j.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(Vt(h))},onResetVendorFiling1099FormStatus:()=>{e(Xa())},onAddressEditHandler:h=>{const i=Mn((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(h));e(Ot({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(_t(o));const h=`/${r}/vendors/filing_1099/`,i=N(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:i}})},onAddressClick:h=>{const i=function(d,u,p){let f=`/${d}/vendors/filing_1099/upload/${p}/edit`;return f=f.concat(`/new/${u}`),f}(r,h,o),m=N(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Bn}})(Vn);function Ys(){const e=J(),a=Y(),{vendorId:s}=R(),t=S(r=>V(r));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(r=>Pt(r,s));const{tenantEmailDomain:o}=t,c=t.companyId??U.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(zs,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const qs=M.div`
96
+ `,zs=K(function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:j,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:r}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(Bt(h)),j.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(Vt(h))},onResetVendorFiling1099FormStatus:()=>{e(Xa())},onAddressEditHandler:h=>{const i=Nn((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(h));e(Ot({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(_t(o));const h=`/${r}/vendors/filing_1099/`,i=M(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:i}})},onAddressClick:h=>{const i=function(d,u,p){let f=`/${d}/vendors/filing_1099/upload/${p}/edit`;return f=f.concat(`/new/${u}`),f}(r,h,o),m=M(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Bn}})(Vn);function Ys(){const e=J(),a=Y(),{vendorId:s}=R(),t=S(r=>V(r));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(r=>Pt(r,s));const{tenantEmailDomain:o}=t,c=t.companyId??U.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(zs,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const qs=N.div`
97
97
  display: flex;
98
98
  min-height: 100%;
99
99
  width: 100%;
@@ -101,7 +101,7 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
101
101
  flex-direction: column;
102
102
  align-items: center;
103
103
  background-color: ${e=>e.theme.colors.grey4};
104
- `,Hs=K(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(cn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(ln({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(Ve(!0))},onBackClick:()=>{e(sn()),e(on())},onVendorTabSelectionChanged:n=>{const o=ve(n);s(o),e(ie(xe(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:r}=o,h=$n(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=zn(a.accountMappingView.expenseAccounts1099FilingAccountList,r),m={selectedBankAccounts1099FilingAccountIds:h.map(d=>d.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(nn({data:m}))},onSaveClick:()=>{e(an()),t.track(et.Event.vendor1099TabSettingsSave)}}})(On);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=Y(),{tenantEmailDomain:c}=R(),r=de(),h=U.getSignedInUser(),[i,m]=g.useState(!1),[d,u]=g.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");Te();const p=S(b=>en(b)),f=S(b=>tn(b)),{isAiCfoAccessEnabled:D,onAskAiCfoClick:x}=fe({mobileExploreReferrer:"Vendors — 1099"});Se({isDataReady:p.fetchState==="Completed"}),g.useEffect(()=>{d||(u(!0),n(Ve(!1)))},[d,u]),g.useEffect(()=>{f.saveState.fetchState==="Completed"&&n(Ve(!1))},[f.saveState.fetchState]);const I=b=>{m(b)},C=S(b=>V(b)),E={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:C.tenantId},w=g.useMemo(()=>({authParams:E,tenantName:C.companyName,filing1099ReportEndPoint:`${Z}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[p.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Q,{analytics:j,onLoad:()=>j.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(qs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:i,handleDrawerToggle:I}),l.jsx(Hs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:j,vendorsFiling1099ListDetails:p,vendorTypeList:p.vendorTypeList,accountMappingView:f,downloadParams:w,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:D,onAskAiCfoClick:x,onClickMenuIcon:()=>{I(!0)}})]})]})}const Ws=M.div`
104
+ `,Hs=K(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(cn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(ln({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Ve(!0))},onBackClick:()=>{e(sn()),e(on())},onVendorTabSelectionChanged:n=>{const o=ve(n);s(o),e(ie(xe(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:r}=o,h=$n(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=zn(a.accountMappingView.expenseAccounts1099FilingAccountList,r),m={selectedBankAccounts1099FilingAccountIds:h.map(d=>d.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(nn({data:m}))},onSaveClick:()=>{e(an()),t.track(et.Event.vendor1099TabSettingsSave)}}})(On);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=Y(),{tenantEmailDomain:c}=R(),r=de(),h=U.getSignedInUser(),[i,m]=g.useState(!1),[d,u]=g.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");Te();const p=S(b=>en(b)),f=S(b=>tn(b)),{isAiCfoAccessEnabled:D,onAskAiCfoClick:x}=fe({mobileExploreReferrer:"Vendors — 1099"});Se({isDataReady:p.fetchState==="Completed"}),g.useEffect(()=>{d||(u(!0),n(Ve(!1)))},[d,u]),g.useEffect(()=>{f.saveState.fetchState==="Completed"&&n(Ve(!1))},[f.saveState.fetchState]);const I=b=>{m(b)},C=S(b=>V(b)),E={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:C.tenantId},w=g.useMemo(()=>({authParams:E,tenantName:C.companyName,filing1099ReportEndPoint:`${Z}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[p.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Q,{analytics:j,onLoad:()=>j.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(qs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:i,handleDrawerToggle:I}),l.jsx(Hs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:j,vendorsFiling1099ListDetails:p,vendorTypeList:p.vendorTypeList,accountMappingView:f,downloadParams:w,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:D,onAskAiCfoClick:x,onClickMenuIcon:()=>{I(!0)}})]})]})}const Ws=N.div`
105
105
  display: flex;
106
106
  min-height: 100%;
107
107
  width: 100%;
@@ -109,4 +109,4 @@ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
109
109
  flex-direction: column;
110
110
  align-items: center;
111
111
  background-color: ${e=>e.theme.colors.grey4};
112
- `,Qs=K(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:te(e),analytics:j}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(mn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(pn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(un({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(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(rn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))}}})(Rn);function Zs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=Y(),{tenantEmailDomain:c}=R(),r=de(),h=U.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i($.isOpexByVendorFeatureEnabled);Te();const u=e.includes("prepaid_expenses"),p=e.includes("fixed_assets"),f=e.includes("accrued_expenses"),D=S(L=>me(L));let x={};x=S(L=>dn(L,"vendorsTab"));const[I,C]=g.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=fe({mobileExploreReferrer:"Vendors Summary"});Se({isDataReady:x.fetchState==="Completed"});const b=S(L=>ee(L)),k=S(L=>H(L).isReportGenerated);S(L=>H(L).fetchState)==="Completed"&&k&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[P,F]=g.useState(!1);if(g.useEffect(()=>{(u||p)&&P===!1&&b!=="Completed"&&(n(ye()),F(!0))},[P]),g.useEffect(()=>{n(De({shouldFetchAccruedExpenses:f,shouldFetchFixedAssets:p,shouldFetchPrepaidExpenses:u,shouldFetchOpexByVendor:m&&d===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[b,p,d,m]),g.useEffect(()=>{I||x.fetchState!=="Completed"||(C(!0),j.trackVendorList(D.currentTab,D.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))},[x.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[_,A]=g.useState(!1),y=L=>{A(L)};return l.jsxs(Ws,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:_,handleDrawerToggle:y}),l.jsx(Qs,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:c,vendorTabsToShow:e,onClickMenuIcon:()=>{y(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:w})]})}function Eo(){const{useFeatureGate:e}=ae(),a=Y().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=U.getSignedInUser(),r=Sn(c),{isFeatureEnabled:h}=e($.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e($.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e($.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:d}=e($.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:u}=e($.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:p}=e($.isFiling1099FeatureEnabled),f=S(w=>V(w)),D=f?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];D!=="netsuite"&&m===!0&&x.push("prepaid_expenses"),D!=="netsuite"&&d===!0&&x.push("fixed_assets"),D!=="netsuite"&&u===!0&&x.push("accrued_expenses"),D!=="netsuite"&&p&&r&&(x.push("filing_1099"),h&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:I}=e($.isDebitCardFeatureEnabled),C=fn(I,f),E=gn(f);return C===!0||E===!0?l.jsx(at,{children:l.jsx(B,{path:"/*",element:l.jsx(Jn,{})})}):l.jsxs(at,{children:[l.jsx(B,{path:"/opex",element:h===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Zs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:d===!0?l.jsx(ss,{}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:d===!0?l.jsx(Xn,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(rs,{}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||d===!0?l.jsx(fs,{}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:u===!0?l.jsx(Hn,{setShouldNavigateBack:t}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(bs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:d===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:u===!0?l.jsx(xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:p&&r?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:p&&r?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:p&&r?l.jsx(ht,{appContent:l.jsx(Ys,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:p&&r?l.jsx(ht,{appContent:l.jsx(Nn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/",element:l.jsx(G,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(le,{})})]})}export{Eo as default};
112
+ `,Qs=K(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:te(e),analytics:j}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(mn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(pn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(un({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(rn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))}}})(Rn);function Zs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=Y(),{tenantEmailDomain:c}=R(),r=de(),h=U.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i($.isOpexByVendorFeatureEnabled);Te();const u=e.includes("prepaid_expenses"),p=e.includes("fixed_assets"),f=e.includes("accrued_expenses"),D=S(L=>me(L));let x={};x=S(L=>dn(L,"vendorsTab"));const[I,C]=g.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=fe({mobileExploreReferrer:"Vendors Summary"});Se({isDataReady:x.fetchState==="Completed"});const b=S(L=>ee(L)),k=S(L=>H(L).isReportGenerated);S(L=>H(L).fetchState)==="Completed"&&k&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[P,F]=g.useState(!1);if(g.useEffect(()=>{(u||p)&&P===!1&&b!=="Completed"&&(n(ye()),F(!0))},[P]),g.useEffect(()=>{n(De({shouldFetchAccruedExpenses:f,shouldFetchFixedAssets:p,shouldFetchPrepaidExpenses:u,shouldFetchOpexByVendor:m&&d===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[b,p,d,m]),g.useEffect(()=>{I||x.fetchState!=="Completed"||(C(!0),j.trackVendorList(D.currentTab,D.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))},[x.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[_,A]=g.useState(!1),y=L=>{A(L)};return l.jsxs(Ws,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:_,handleDrawerToggle:y}),l.jsx(Qs,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:c,vendorTabsToShow:e,onClickMenuIcon:()=>{y(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:w})]})}function Eo(){const{useFeatureGate:e}=ae(),a=Y().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=U.getSignedInUser(),r=Sn(c),{isFeatureEnabled:h}=e($.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e($.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e($.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:d}=e($.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:u}=e($.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:p}=e($.isFiling1099FeatureEnabled),f=S(w=>V(w)),D=f?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];D!=="netsuite"&&m===!0&&x.push("prepaid_expenses"),D!=="netsuite"&&d===!0&&x.push("fixed_assets"),D!=="netsuite"&&u===!0&&x.push("accrued_expenses"),D!=="netsuite"&&p&&r&&(x.push("filing_1099"),h&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:I}=e($.isDebitCardFeatureEnabled),C=fn(I,f),E=gn(f);return C===!0||E===!0?l.jsx(at,{children:l.jsx(B,{path:"/*",element:l.jsx(Jn,{})})}):l.jsxs(at,{children:[l.jsx(B,{path:"/opex",element:h===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Zs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:d===!0?l.jsx(ss,{}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:d===!0?l.jsx(Xn,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(rs,{}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||d===!0?l.jsx(fs,{}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:u===!0?l.jsx(Hn,{setShouldNavigateBack:t}):l.jsx(G,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(bs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:d===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:u===!0?l.jsx(xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:p&&r?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:p&&r?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:p&&r?l.jsx(ht,{appContent:l.jsx(Ys,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:p&&r?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(G,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/",element:l.jsx(G,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(le,{})})]})}export{Eo as default};
@@ -0,0 +1,12 @@
1
+ import{j as o}from"./liveblocks-BNlilBXq.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{s as u,h,g as y,N as I}from"./core-BeBBWfga.js";import{JG as w,eU as b,zF as x}from"./zeni-epic-state-5fEaVO5b.js";import{z as l,B as j,y as S,Y as D}from"./index-DWCyzMUX.js";import{n as g}from"./mui-CnlqDSRv.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="8a15a74e-4dd7-4a96-90e6-539ff4e65133",e._sentryDebugIdIdentifier="sentry-dbid-8a15a74e-4dd7-4a96-90e6-539ff4e65133")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",p=e.get("profileId")??"",[n,m]=f.useState(!1),a=h(),s=y(c=>w(c)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(i);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 b(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(m(!0),a(x(t,p,i)))},[n,a]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=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(D.LargeRegular)`
10
+ display: flex;
11
+ color: ${S.important};
12
+ `;export{W as default};