@zeniai/web-app-ui 5.0.25-qa → 5.0.26-qa

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 (122) hide show
  1. package/dist/assets/AddressRoutes-Ddo5yFaY.js +1 -0
  2. package/dist/assets/AddressScreen-DbfnfF3g.js +9 -0
  3. package/dist/assets/{AiCfoScreen-c3WmsM7S.js → AiCfoScreen-B013GFMS.js} +1 -1
  4. package/dist/assets/BillPayApprovalRoutes-CZRSyPvo.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DBqyHQ7X.js → BillPayRoutes-CH2s-gzl.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DlerSwqe.js → BusinessVerificationPageScreen-BoEZFvFS.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-DWhHYo21.js → ChargeCardRoutes-B7hoiWSV.js} +8 -8
  8. package/dist/assets/CompanyPassportScreen-CRMqtZFn.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-C04-2mC6.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BmXLWm23.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DkC_d2sZ.js → CustomerOnboardingRoutes-Cj9bwQg1.js} +6 -6
  12. package/dist/assets/DashboardRoutes-kuz7A0GW.js +20 -0
  13. package/dist/assets/{DefaultTenantHome-CjzSnp03.js → DefaultTenantHome-CrJOB5X8.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-LY2LbfiX.js → DomesticWireDetailScreen-B8McV8L1.js} +3 -3
  15. package/dist/assets/DrawerScreen-C7f_NiZk.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-lzOy1ccj.js → EntityDetailRoutes-CZrU40Jr.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-D_77OTBs.js → ExpenseAutomationRoutes-C7mCSmyZ.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-CiNRRJaO.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-Nmy2VUN5.js → MagicLinkRoutes-CNG9KHKe.js} +2 -2
  20. package/dist/assets/MagicLinkSignInScreen-CdrB-rz9.js +12 -0
  21. package/dist/assets/MobileAppDrawer-DnUJz0tA.js +1 -0
  22. package/dist/assets/NotFoundScreen-DcJllQdb.js +1 -0
  23. package/dist/assets/{NotificationRoutes-z8dQlPoa.js → NotificationRoutes-Cv58FgVH.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-CxMrp76j.js +1 -0
  25. package/dist/assets/{PeopleRoutes-CllKrbwi.js → PeopleRoutes-72XyljMO.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-BN3XbJ8Y.js +1 -0
  27. package/dist/assets/{Preview-DMyRJ2f0.js → Preview-BAKw3AAf.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-B_jPbhuP.js → QBOConnectionScreen-Cw9-vrgq.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-DIWnUNDR.js → ReferralListScreen-C3zvIkrr.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-D-DKJaF1.js → ReimbursementApprovalRoutes-CMV2BtkL.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BGFNyRVm.js → ReimbursementApprovalRuleDetailScreen-CVP5Uq5I.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-jGUb1Fcu.js → ReimbursementRoutes-BaDf69Ue.js} +4 -4
  33. package/dist/assets/{ReportsRoutes-MfNsO04v.js → ReportsRoutes-Cg41Op_9.js} +1 -1
  34. package/dist/assets/RewardsRoutes-Dd6j2rAO.js +1 -0
  35. package/dist/assets/ScreenRoutes-DldUU7sr.js +2 -0
  36. package/dist/assets/{SettingsRoutes-CYwSFGK7.js → SettingsRoutes-Dn3k1EVr.js} +4 -4
  37. package/dist/assets/{SetupPagesScreen-Cilkcy82.js → SetupPagesScreen-DrJKLQxS.js} +1 -1
  38. package/dist/assets/SignInScreen-DfKF7OT4.js +1 -0
  39. package/dist/assets/SignOutScreen-CAOckvN-.js +9 -0
  40. package/dist/assets/TaskListScreen-B9vL8Oxs.js +9 -0
  41. package/dist/assets/TaskRoutes-D7u9YC7x.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-BdR87vgc.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen---9iPrdg.js → TransactionDetailScreen-DaK6ceRt.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-DmewD5lB.js → TransactionListRoutes-CIOjaSOe.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-DPo2M-9-.js → TreasuryRoutes-uVfHsmut.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-B2HVwxpf.js → VendorsRoutes-B7j00M1u.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen--5fe8Ha5.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-N6UjlYyq.js → ZeniAccountRoutes-RroFxPLH.js} +10 -10
  49. package/dist/assets/ZeniAccountStatementScreen-CeIEeVha.js +9 -0
  50. package/dist/assets/{accountMappingHelper-CEjaDvi1.js → accountMappingHelper-DdMTXagH.js} +1 -1
  51. package/dist/assets/{analytics-B3Q4UmLh.js → analytics-BsMspvaD.js} +1 -1
  52. package/dist/assets/{analyticsHelper-B4uZydFl.js → analyticsHelper-CQJg2P3F.js} +1 -1
  53. package/dist/assets/{core-CBFn_Yo_.js → core-PVb_PTOa.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-CqMC__af.js → decodeURIComponentSafe-mU8LeJGH.js} +1 -1
  55. package/dist/assets/{dnd-1A4kYEBz.js → dnd-DhtyOCgF.js} +1 -1
  56. package/dist/assets/{empty-C0ZlcUMX.js → empty-HlfDqjBl.js} +1 -1
  57. package/dist/assets/{empty-CuHDeEGA.js → empty-wep5Q-1y.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-L6eqPJfK.js → emptyVideoElement-DpJB9lfW.js} +1 -1
  59. package/dist/assets/{epic-BNVHfQUa.js → epic-CMMVrD8V.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-BlHoz8HV.js +1 -0
  61. package/dist/assets/{index-CpBFmiLM.js → index-BCcxTJng.js} +1 -1
  62. package/dist/assets/{index-CAO2_lCc.js → index-BWo_N8M7.js} +1 -1
  63. package/dist/assets/{index-DFEZoheE.js → index-CsPK-ZcF.js} +2 -2
  64. package/dist/assets/{index-ChMtRDkl.js → index-D5j-ijm9.js} +14700 -14610
  65. package/dist/assets/{index-BKmj_VFp.js → index-Dn-dGYDp.js} +1 -1
  66. package/dist/assets/{index-CDftMuwg.js → index-DnBq3nCg.js} +1 -1
  67. package/dist/assets/{index-D5HjsaAE.js → index-yb_kldBQ.js} +1 -1
  68. package/dist/assets/{lexical-Blenvqjv.js → lexical-CVfRQHxx.js} +1 -1
  69. package/dist/assets/{liveblocks-ypyKWtbM.js → liveblocks-DiLJJ0-W.js} +1 -1
  70. package/dist/assets/{lottie-xwOlCP2t.js → lottie-DGoffhx5.js} +1 -1
  71. package/dist/assets/{mui-D35VurIR.js → mui-Bs_Wx3U8.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DEbgHxxX.js → pathToGoBack-BrzgfZOY.js} +1 -1
  73. package/dist/assets/{pdf-B5d6xxqf.js → pdf-Cq31LyOe.js} +4 -4
  74. package/dist/assets/{pdf-lib-CUHgD73m.js → pdf-lib-CKEHYQuo.js} +1 -1
  75. package/dist/assets/{plaid-O0aD-5ib.js → plaid-CT0unNLB.js} +1 -1
  76. package/dist/assets/{pusher-C48G4Qny.js → pusher-BDivubpF.js} +1 -1
  77. package/dist/assets/{react-DBFLdS1u.js → react-AIza423u.js} +1 -1
  78. package/dist/assets/{react-BHZphYxv.js → react-B22DUlFC.js} +1 -1
  79. package/dist/assets/{react-DDnuJ4gm.js → react-CQHBdAiW.js} +1 -1
  80. package/dist/assets/{react-BaFEg--9.js → react-D12Thgxw.js} +1 -1
  81. package/dist/assets/{react-DlX6KwOM.js → react-D3IfLVtg.js} +1 -1
  82. package/dist/assets/{react-DOxDWALt.js → react-x856Ci_R.js} +1 -1
  83. package/dist/assets/{recharts-CSEhqlTE.js → recharts-CreyyBLx.js} +1 -1
  84. package/dist/assets/{routePaths-nlWWZ4ZI.js → routePaths-Cu41oBox.js} +1 -1
  85. package/dist/assets/{sentry-ylIvhyeZ.js → sentry-CRXtNjzG.js} +1 -1
  86. package/dist/assets/{url-D6aOj1HL.js → url-DraJKqO-.js} +1 -1
  87. package/dist/assets/{url-BUH-dUKP.js → url-arGh5ZAs.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-ZQtgg5zD.js +1 -0
  89. package/dist/assets/{useDeviceId-BJs7B5gi.js → useDeviceId-B5nwTsrh.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-BFAN9HG0.js → useInitialThreadRequest-BJAnehMw.js} +1 -1
  92. package/dist/assets/{utils-0qzBiEB0.js → utils-CfmtJLRd.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-Bon_8p_2.js → withTransactionSidePanel-LH23g840.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-DQMIbKEE.js → zeni-epic-state-4sJL0-hG.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-edSf0Hzf.js +0 -1
  98. package/dist/assets/AddressScreen-DXP1i7x7.js +0 -9
  99. package/dist/assets/BillPayApprovalRoutes-DHaXtrYO.js +0 -1
  100. package/dist/assets/CompanyPassportScreen-CuARsPx2.js +0 -1
  101. package/dist/assets/ConnectionAuthScreen-D7jj-mBL.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-DXLFxrq4.js +0 -1
  103. package/dist/assets/DashboardRoutes-e4wGQnEi.js +0 -20
  104. package/dist/assets/DrawerScreen-CdRI1pWE.js +0 -1
  105. package/dist/assets/FeaturePreviewScreen-pIQ4X1aP.js +0 -1
  106. package/dist/assets/MagicLinkSignInScreen-BVyspHCV.js +0 -12
  107. package/dist/assets/MobileAppDrawer-D23D-DVK.js +0 -1
  108. package/dist/assets/NotFoundScreen-BU5ZWYfy.js +0 -1
  109. package/dist/assets/PandLWithForecastRoutes-CA3r2X18.js +0 -1
  110. package/dist/assets/PerformanceRoutes-jV3YHfcW.js +0 -1
  111. package/dist/assets/RewardsRoutes-91uVLC96.js +0 -1
  112. package/dist/assets/ScreenRoutes-CqLlqtvw.js +0 -2
  113. package/dist/assets/SignInScreen-DUy4fwRG.js +0 -1
  114. package/dist/assets/SignOutScreen-DvIN_1Oz.js +0 -9
  115. package/dist/assets/TaskListScreen-DyrjcDli.js +0 -9
  116. package/dist/assets/TaskRoutes-BW1P-Ij8.js +0 -9
  117. package/dist/assets/TransactionDetailRoutes-BmJCEPNE.js +0 -1
  118. package/dist/assets/WiseConfirmationScreen-Dv2If-yw.js +0 -12
  119. package/dist/assets/ZeniAccountStatementScreen-BhyQMG6S.js +0 -9
  120. package/dist/assets/getLocaleForTenant-CpmXipgh.js +0 -1
  121. package/dist/assets/useAskAiCfoHostNavButtonProps-IrvXJbyC.js +0 -1
  122. package/dist/assets/useFetchSuggestedQuestionsWhenReady-kulIc847.js +0 -1
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-ypyKWtbM.js";import{a as y}from"./sentry-ylIvhyeZ.js";import{j as w,h as A,u as C,l as T,g as S,k as E}from"./core-CBFn_Yo_.js";import{ME as R,Mo as U,Cd as x,Cm as _,Ck as h,Cl as b,MF as k}from"./zeni-epic-state-DQMIbKEE.js";import{z as B,h as V,v as F,bz as j,aa as O}from"./index-ChMtRDkl.js";import"./mui-D35VurIR.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]="da282cee-a76d-42e6-a72f-5a98a3fa689f",e._sentryDebugIdIdentifier="sentry-dbid-da282cee-a76d-42e6-a72f-5a98a3fa689f")}catch{}})();function $(e){return k(e)==null}const M=E(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const f=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=D.concat(I);f.push({action:c.stepType.selectedOption,actors:v,operator:v.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(b(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(b(p))}},onResetClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=V(),r=S(p=>R(p)),i=S(p=>U(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(F,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
1
+ import{j as g}from"./liveblocks-DiLJJ0-W.js";import{a as y}from"./sentry-CRXtNjzG.js";import{j as w,h as A,u as C,l as T,g as b,k as E}from"./core-PVb_PTOa.js";import{ME as R,Mo as U,Cd as x,Cm as _,Ck as S,Cl as h,MF as k}from"./zeni-epic-state-4sJL0-hG.js";import{z as B,h as V,B as F,bz as j,aa as O}from"./index-D5j-ijm9.js";import"./mui-Bs_Wx3U8.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]="85117cef-51b5-46b2-9592-6db7d59ba058",e._sentryDebugIdIdentifier="sentry-dbid-85117cef-51b5-46b2-9592-6db7d59ba058")}catch{}})();function $(e){return k(e)==null}const M=E(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!$(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>U(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(F,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-ypyKWtbM.js";import{j as J,h as le,u as V,l as X,g as w,N as $,k as K,i as ut,n as pt,o as B}from"./core-CBFn_Yo_.js";import{eM as W,MU as me,b$ as ce,Bo as xe,jx as bt,BB as ae,BA as se,MV as gt,bm as de,fG as Te,MW as ht,Jg as ft,jm as je,Jh as Se,Ji as St,ig as It,Ma as yt,iw as Rt,Bc as At,s1 as Ct,io as vt,BY as De,MX as Fe,MY as kt,MZ as Et,M_ as Bt,M$ as wt,N0 as xt,BI as Ie,iC as Tt,Mj as jt,BC as Dt,Bm as Ft,N1 as Ut,Bl as Lt,N2 as Nt,Bu as ye,BM as Mt,BL as Pt,BH as $t,N3 as Ue,Gz as _t,bn as Ot,Bx as zt,Ce as Gt,N4 as Ht,N5 as Zt,BU as Vt,BR as Re,LF as Wt,Bj as Jt,N6 as Le,CD as Ae,CL as Kt,N7 as qt,N8 as H,N9 as Yt,Na as Ne,Nb as Qt,Nc as Me,Nd as Pe,C4 as ie,bs as Xt,bD as ue,cy as pe,eS as $e,eQ as _e,Ne as en,gy as tn,LS as nn,Nf as an,Ng as Oe,LW as sn,ME as on,Nh as rn,MT as ln,CI as Ce,CH as mn,Ni as cn,Nj as dn,Nk as un,Nl as pn,Nm as bn,Mp as gn,Cy as hn,CC as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,If as Cn,cJ as vn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-DQMIbKEE.js";import{I as ze,K as Ge,r as ee,d as C,z as M,bJ as He,w as te,c as v,aC as ve,o as U,ao as Q,C as wn,O as Ze,bK as xn,m as Z,F as Ve,bL as Tn,A as ne,bM as jn,G as Dn,x as Fn,v as be,f as We,a1 as Un,ba as Ln,J as Nn,h as Je,bN as Mn,a4 as Pn}from"./index-ChMtRDkl.js";import{n as _,S as $n}from"./mui-D35VurIR.js";import oe from"./NotFoundScreen-BU5ZWYfy.js";import{S as ke}from"./SetupPagesScreen-Cilkcy82.js";import{F as Ke}from"./FeaturePreviewScreen-pIQ4X1aP.js";import{a as g}from"./sentry-ylIvhyeZ.js";import{u as qe}from"./useInitialThreadRequest-BFAN9HG0.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-IrvXJbyC.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-kulIc847.js";import{D as _n}from"./DrawerScreen-CdRI1pWE.js";import{M as Xe}from"./MobileAppDrawer-D23D-DVK.js";import{R as On}from"./ReimbursementApprovalRoutes-D-DKJaF1.js";import{FallBackRoute as zn}from"./ScreenRoutes-CqLlqtvw.js";import"./recharts-CSEhqlTE.js";import"./analytics-B3Q4UmLh.js";import"./plaid-O0aD-5ib.js";import"./dnd-1A4kYEBz.js";import"./stripe-DMRn4zHo.js";import"./lottie-xwOlCP2t.js";import"./lexical-Blenvqjv.js";import"./pdf-B5d6xxqf.js";import"./utils-0qzBiEB0.js";import"./analyticsHelper-B4uZydFl.js";import"./routePaths-nlWWZ4ZI.js";import"./BusinessVerificationPageScreen-DlerSwqe.js";import"./ReimbursementApprovalRuleDetailScreen-BGFNyRVm.js";import"./getLocaleForTenant-CpmXipgh.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]="0482b206-4ee8-447c-a007-737f28f6ba32",e._sentryDebugIdIdentifier="sentry-dbid-0482b206-4ee8-447c-a007-737f28f6ba32")}catch{}})();const et=e=>`/${e}/reimbursements`,Gn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Hn=K(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=M.getSignedInUser(),d=de(c),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=me(e,t.reimbursementId),p=ht(e,c?.userId??"");let I=`${c?.firstName} ${c?.lastName}`,S=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,S=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,R=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,p)=>{i!=null&&e(se(i,l,p,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Mt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Nt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Dt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(jt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=Z(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Ct("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(At(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(xn);function Ee(){const e=J(),t=le(),n=V(),{reimbursementId:r}=X(),c=ze(),d=Ge(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(C.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(C.isReimbursementCommentingEnabled),x=V().pathname,R=x.includes("edit"),j=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=M.getSignedInUser(),T=w(u=>W(u)),f=w(u=>me(u,r)),D=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),P=ce(T?.userRole??[]);g.useEffect(()=>{(j&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||P&&f.billStatus==="rejected"||P===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx($,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:v,onLoad:u=>(N=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Jn,{children:[s.jsx(Kn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:D??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Zn=_.div`
1
+ import{j as s}from"./liveblocks-DiLJJ0-W.js";import{j as J,h as le,u as V,l as X,g as w,N as $,k as K,i as ut,n as pt,o as E}from"./core-PVb_PTOa.js";import{eM as W,MU as me,b$ as ce,Bo as xe,jx as bt,BB as ae,BA as se,MV as gt,bm as de,fG as Te,MW as ht,Jg as ft,jm as je,Jh as Se,Ji as St,ig as It,Ma as yt,iw as Rt,Bc as At,s1 as Ct,io as vt,BY as De,MX as Fe,MY as kt,MZ as Bt,M_ as Et,M$ as wt,N0 as xt,BI as Ie,iC as Tt,Mj as jt,BC as Dt,Bm as Ft,N1 as Ut,Bl as Lt,N2 as Nt,Bu as ye,BM as Mt,BL as Pt,BH as $t,N3 as Ue,Gz as _t,bn as Ot,Bx as zt,Ce as Gt,N4 as Ht,N5 as Zt,BU as Vt,BR as Re,LF as Wt,Bj as Jt,N6 as Le,CD as Ae,CL as Kt,N7 as qt,N8 as H,N9 as Yt,Na as Ne,Nb as Qt,Nc as Me,Nd as Pe,C4 as ie,bs as Xt,bD as ue,cy as pe,eS as $e,eQ as _e,Ne as en,gy as tn,LS as nn,Nf as an,Ng as Oe,LW as sn,ME as on,Nh as rn,MT as ln,CI as Ce,CH as mn,Ni as cn,Nj as dn,Nk as un,Nl as pn,Nm as bn,Mp as gn,Cy as hn,CC as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,If as Cn,cJ as vn,cL as kn,cK as Bn,cs as En}from"./zeni-epic-state-4sJL0-hG.js";import{x as ze,K as Ge,n as ee,l as C,z as M,bJ as He,y as te,d as v,aC as ve,o as U,ao as Q,F as wn,D as Ze,bK as xn,r as Z,I as Ve,bL as Tn,j as ne,bM as jn,J as Dn,C as Fn,B as be,g as We,a1 as Un,ba as Ln,O as Nn,h as Je,bN as Mn,a4 as Pn}from"./index-D5j-ijm9.js";import{n as _,S as $n}from"./mui-Bs_Wx3U8.js";import oe from"./NotFoundScreen-DcJllQdb.js";import{S as ke}from"./SetupPagesScreen-DrJKLQxS.js";import{F as Ke}from"./FeaturePreviewScreen-CiNRRJaO.js";import{a as g}from"./sentry-CRXtNjzG.js";import{u as qe}from"./useInitialThreadRequest-BJAnehMw.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-ZQtgg5zD.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";import{D as _n}from"./DrawerScreen-C7f_NiZk.js";import{M as Xe}from"./MobileAppDrawer-DnUJz0tA.js";import{R as On}from"./ReimbursementApprovalRoutes-CMV2BtkL.js";import{FallBackRoute as zn}from"./ScreenRoutes-DldUU7sr.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./analyticsHelper-CQJg2P3F.js";import"./routePaths-Cu41oBox.js";import"./BusinessVerificationPageScreen-BoEZFvFS.js";import"./ReimbursementApprovalRuleDetailScreen-CVP5Uq5I.js";import"./getLocaleForTenant-BlHoz8HV.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]="0ba57475-6824-44e0-baf8-6f8d17787511",e._sentryDebugIdIdentifier="sentry-dbid-0ba57475-6824-44e0-baf8-6f8d17787511")}catch{}})();const et=e=>`/${e}/reimbursements`,Gn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Hn=K(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=M.getSignedInUser(),d=de(c),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=me(e,t.reimbursementId),p=ht(e,c?.userId??"");let I=`${c?.firstName} ${c?.lastName}`,S=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,S=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,R=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,p)=>{i!=null&&e(se(i,l,p,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Mt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Nt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Dt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(jt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Et({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Bt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=Z(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Ct("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(At(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(xn);function Be(){const e=J(),t=le(),n=V(),{reimbursementId:r}=X(),c=ze(),d=Ge(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(C.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(C.isReimbursementCommentingEnabled),x=V().pathname,R=x.includes("edit"),j=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=M.getSignedInUser(),T=w(u=>W(u)),f=w(u=>me(u,r)),D=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),P=ce(T?.userRole??[]);g.useEffect(()=>{(j&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||P&&f.billStatus==="rejected"||P===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx($,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:v,onLoad:u=>(N=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Jn,{children:[s.jsx(Kn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:D??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-ypyKWtbM.js";import{j as J,h as le,u as V,l as X
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Yn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=M.getSignedInUser(),c=de(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ht(n.remiActivities,Zt(t.currentTenant),r));const i=ce(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=et(o),i=Z(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Jt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Wt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(De(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Vt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Tn);function Qn(){const e=J(),t=le(),n=V(),r=n.hash.substring(1),c=ze(),{reimbursementId:d}=X(),m=M.getSignedInUser(),o=w(E=>W(E)),a=w(E=>Ue(E,d??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:I}=Ve(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:x}=Ye({isAiCfoOpen:p,setIsAiCfoOpen:I,mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:R}=ee(),{isFeatureEnabled:j}=R(C.isLimitedCategoryForReimbursement),[b,k]=g.useState(!1),[y,T]=g.useState(!1),[f,D]=g.useState(!1),{isFeatureEnabled:P}=R(C.isReimbursementCommentingEnabled),{isFeatureEnabled:A}=R(C.isShowDeletedReimbursementsFeatureEnabled),F=w(E=>me(E,d??"")),u=_t(o),N=Ot(o.userRole),G=a.fetchState;if(g.useEffect(()=>{b||d==null?b==1&&G==="Error"&&e("page-not-found",{replace:!0}):(k(!0),t(zt(d,!1,A)))},[b,d,t,G]),g.useEffect(()=>{A&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&u===!1?D(!1):D(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(N||a.allApprovers.find(E=>E.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,N,o.isZeni,u,m]),g.useEffect(()=>{y||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||F.fetchState=="Completed"||F.fetchState=="In-Progress"||(T(!0),t(xe(!1,j,A,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))},[y,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:E=>(q=>{d!=null&&q.trackReimbursementReimbursementDetails(d)})(E)}),s.jsx(Yn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:P,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:f,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:S,onAskAiCfoClick:x})]})}const Xn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(H())},onCloseReviewItem:n=>{e(qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Kt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(jn);function ea(){const e=J(),t=w(d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(d=>Le(d)),r=ne(),c=r?.loggedInUserRole?.includes("admin")===!0;return g.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Xn,{navigate:e,analytics:v,isAdmin:c})}const z=sn(),tt="bulk-operation-update",re="reimbursement-approval-rule-update",{spendManagement:ta,common:Be}=Ze.getLocalizedStrings(),we=ta.reimbursement.bulkActions,na=_.div`
56
+ `,Yn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=M.getSignedInUser(),c=de(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ht(n.remiActivities,Zt(t.currentTenant),r));const i=ce(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=et(o),i=Z(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Jt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Wt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(De(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Vt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Tn);function Qn(){const e=J(),t=le(),n=V(),r=n.hash.substring(1),c=ze(),{reimbursementId:d}=X(),m=M.getSignedInUser(),o=w(B=>W(B)),a=w(B=>Ue(B,d??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:I}=Ve(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:x}=Ye({isAiCfoOpen:p,setIsAiCfoOpen:I,mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:R}=ee(),{isFeatureEnabled:j}=R(C.isLimitedCategoryForReimbursement),[b,k]=g.useState(!1),[y,T]=g.useState(!1),[f,D]=g.useState(!1),{isFeatureEnabled:P}=R(C.isReimbursementCommentingEnabled),{isFeatureEnabled:A}=R(C.isShowDeletedReimbursementsFeatureEnabled),F=w(B=>me(B,d??"")),u=_t(o),N=Ot(o.userRole),G=a.fetchState;if(g.useEffect(()=>{b||d==null?b==1&&G==="Error"&&e("page-not-found",{replace:!0}):(k(!0),t(zt(d,!1,A)))},[b,d,t,G]),g.useEffect(()=>{A&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&u===!1?D(!1):D(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(N||a.allApprovers.find(B=>B.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,N,o.isZeni,u,m]),g.useEffect(()=>{y||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||F.fetchState=="Completed"||F.fetchState=="In-Progress"||(T(!0),t(xe(!1,j,A,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))},[y,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:B=>(q=>{d!=null&&q.trackReimbursementReimbursementDetails(d)})(B)}),s.jsx(Yn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:P,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:f,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:S,onAskAiCfoClick:x})]})}const Xn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(H())},onCloseReviewItem:n=>{e(qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Kt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(jn);function ea(){const e=J(),t=w(d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(d=>Le(d)),r=ne(),c=r?.loggedInUserRole?.includes("admin")===!0;return g.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Xn,{navigate:e,analytics:v,isAdmin:c})}const z=sn(),tt="bulk-operation-update",re="reimbursement-approval-rule-update",{spendManagement:ta,common:Ee}=Ze.getLocalizedStrings(),we=ta.reimbursement.bulkActions,na=_.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-ypyKWtbM.js";import{j as J,h as le,u as V,l as X
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,aa=K(function(e,t){const n=Pe(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=M.getSignedInUser(),d=de(c),m=e.tenantState.currentTenantId,o=W(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(S=>S!=="deleted"));const p=n.fetchState,I=on(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(S=>S.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Nn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(H()),e(Ne(o))},onSubtabChange:o=>{e(H()),e(Me(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=Z(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=Z(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(bn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(pn(o))},onFiltersChange:o=>{e(un({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(dn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ie(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(cn(o))},removeAllTransactionsFromBulkActionList:()=>{e(H())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(mn(o,a??""));break;case"send_for_approval":e(Ce("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Ce("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(re)&&e(ln(!1))},onEventReceived:o=>{o===tt&&e(rn())}}})(Un(Ln));function sa(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Ve(),n=J(),r=le(),c=V(),d=c.state,m=Ge(),[o,a]=g.useState(null),i=ut("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect(()=>{if(d?.tab!=null&&d?.subTab!=null){const h=Yt(d.tab.toString());h!=null?r(Ne(h)):console.log("Warning:Not a valid remiListTab");const O=Qt(d.subTab.toString());O!=null?r(Me(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{r(H())}},[]);const{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(C.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(C.isBillPayCommentingEnabled),{isFeatureEnabled:x}=l(C.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=l(C.isReimbursementBulkActionEnabled),j=M.getSignedInUser(),b=w(h=>W(h)),[k,y]=g.useState(!1),[T,f]=g.useState(!1),D=ne(),P=D?.loggedInUserRole?.includes("admin")===!0,A=w(h=>Pe(h,z,R)),{areTenantIdsInSync:F}=Dn(),u=A.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:G}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:u==="Completed"}),g.useEffect(()=>{!T&&F&&(f(!0),r(ie(z,!0,I,!1,!0)))},[T,z,r,F]),j==null)throw Error("Can't access address page without signing in...");const E=!!b?.userRole&&Xt(b),q=ue(D?.loggedInUserRoleMap),nt=pe(D?.loggedInUserRoleMap),at=!!b.userReimbursementInfo?.isReimbursementTOSAccepted,st=!!b.companyReimbursementInfo?.info?.isReimbursementEnabled,it=!!b.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ot=w(h=>Te(h.companyState,b.companyId)),rt=ot?.company.featuresActivationInfo.connectedAccountProvider,ge=h=>{y(h)},{isFeatureEnabled:lt}=l(C.isDebitCardFeatureEnabled),mt=$e(lt,b),ct=_e(b),{remisProcessed:Y,remisProcessing:he}=w(h=>en(h));g.useEffect(()=>{Y===he&&o!=null&&(r(tn({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:Y>1?we.reports:we.report},{variableName:"_has_",variableValue:Y>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:nn(o)}]})),r(an()),setTimeout(()=>{r(ie(z,!0,I,!1,!0,!0))},3e3),a(null))},[Y,he]);const dt={events:b.companyId!=null?[`private-${b.companyId}.${tt}`,`private-${b.companyId}.${re}`]:[],eventCallback:(h,O,fe)=>{h.endsWith(re)?fe.onReimbursementApprovalRulesEventReceived?.(h):O.entity_type==="reimbursement"&&(a(O.operation_type),fe.onEventReceived(h))}};return c.pathname.endsWith("/reimbursements/")||c.pathname.endsWith("/reimbursements")||c.pathname.endsWith("/reimbursements/bulk-review")?mt===!0||ct===!0?s.jsx(Ke,{}):st&&(!E||q)||nt&&at?s.jsxs(s.Fragment,{children:[u==="Completed"?s.jsx(te,{analytics:v,onLoad:h=>(O=>O.trackPageLoaded(We.Event.reimbursementHome))(h)}):null,s.jsx(Xe,{isAppContentDrawerOpen:k,handleDrawerToggle:ge}),s.jsxs(na,{windowSize:m,children:[s.jsx(_n,{isOpen:i,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{n("./"),r(H())},children:s.jsx(ra,{onClick:h=>h.stopPropagation(),children:s.jsx(ea,{})})}),s.jsx(aa,{isShowDeletedBillsEnabled:p,isShowDeletedReimbursementEnabled:I,isBillPayCommentingEnabled:S,isReimbursementCommentingEnabled:x,location:c,navigate:n,currentTenant:b,period:z,isAdmin:P,isEmployee:E,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:A.createdByUserList,createdByUserListFetchState:A.createdByUserListFetchState,isDownloadEnabled:A.isDownloadEnabled,connectedAccountProvider:rt,isBulkActionEnabled:R,bulkSubmissionLimit:A.remiBulkSubmissionLimit,bulkSubmissionFetchState:A.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:N,onAskAiCfoClick:G,...dt})]})]}):it&&q?s.jsx($,{to:"../setup"}):D!=null&&Oe(b,D.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(be,{fetchState:"In-Progress"}):s.jsx(oe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=_($n)`
64
+ `,aa=K(function(e,t){const n=Pe(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=M.getSignedInUser(),d=de(c),m=e.tenantState.currentTenantId,o=W(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(S=>S!=="deleted"));const p=n.fetchState,I=on(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(S=>S.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Nn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(H()),e(Ne(o))},onSubtabChange:o=>{e(H()),e(Me(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=Z(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=Z(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(bn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(pn(o))},onFiltersChange:o=>{e(un({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(dn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ie(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(cn(o))},removeAllTransactionsFromBulkActionList:()=>{e(H())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(mn(o,a??""));break;case"send_for_approval":e(Ce("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Ce("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(re)&&e(ln(!1))},onEventReceived:o=>{o===tt&&e(rn())}}})(Un(Ln));function sa(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Ve(),n=J(),r=le(),c=V(),d=c.state,m=Ge(),[o,a]=g.useState(null),i=ut("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect(()=>{if(d?.tab!=null&&d?.subTab!=null){const h=Yt(d.tab.toString());h!=null?r(Ne(h)):console.log("Warning:Not a valid remiListTab");const O=Qt(d.subTab.toString());O!=null?r(Me(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{r(H())}},[]);const{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(C.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(C.isBillPayCommentingEnabled),{isFeatureEnabled:x}=l(C.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=l(C.isReimbursementBulkActionEnabled),j=M.getSignedInUser(),b=w(h=>W(h)),[k,y]=g.useState(!1),[T,f]=g.useState(!1),D=ne(),P=D?.loggedInUserRole?.includes("admin")===!0,A=w(h=>Pe(h,z,R)),{areTenantIdsInSync:F}=Dn(),u=A.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:G}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:u==="Completed"}),g.useEffect(()=>{!T&&F&&(f(!0),r(ie(z,!0,I,!1,!0)))},[T,z,r,F]),j==null)throw Error("Can't access address page without signing in...");const B=!!b?.userRole&&Xt(b),q=ue(D?.loggedInUserRoleMap),nt=pe(D?.loggedInUserRoleMap),at=!!b.userReimbursementInfo?.isReimbursementTOSAccepted,st=!!b.companyReimbursementInfo?.info?.isReimbursementEnabled,it=!!b.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ot=w(h=>Te(h.companyState,b.companyId)),rt=ot?.company.featuresActivationInfo.connectedAccountProvider,ge=h=>{y(h)},{isFeatureEnabled:lt}=l(C.isDebitCardFeatureEnabled),mt=$e(lt,b),ct=_e(b),{remisProcessed:Y,remisProcessing:he}=w(h=>en(h));g.useEffect(()=>{Y===he&&o!=null&&(r(tn({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:Y>1?we.reports:we.report},{variableName:"_has_",variableValue:Y>1?Ee.texts.have:Ee.texts.has},{variableName:"_action_",variableValue:nn(o)}]})),r(an()),setTimeout(()=>{r(ie(z,!0,I,!1,!0,!0))},3e3),a(null))},[Y,he]);const dt={events:b.companyId!=null?[`private-${b.companyId}.${tt}`,`private-${b.companyId}.${re}`]:[],eventCallback:(h,O,fe)=>{h.endsWith(re)?fe.onReimbursementApprovalRulesEventReceived?.(h):O.entity_type==="reimbursement"&&(a(O.operation_type),fe.onEventReceived(h))}};return c.pathname.endsWith("/reimbursements/")||c.pathname.endsWith("/reimbursements")||c.pathname.endsWith("/reimbursements/bulk-review")?mt===!0||ct===!0?s.jsx(Ke,{}):st&&(!B||q)||nt&&at?s.jsxs(s.Fragment,{children:[u==="Completed"?s.jsx(te,{analytics:v,onLoad:h=>(O=>O.trackPageLoaded(We.Event.reimbursementHome))(h)}):null,s.jsx(Xe,{isAppContentDrawerOpen:k,handleDrawerToggle:ge}),s.jsxs(na,{windowSize:m,children:[s.jsx(_n,{isOpen:i,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{n("./"),r(H())},children:s.jsx(ra,{onClick:h=>h.stopPropagation(),children:s.jsx(ea,{})})}),s.jsx(aa,{isShowDeletedBillsEnabled:p,isShowDeletedReimbursementEnabled:I,isBillPayCommentingEnabled:S,isReimbursementCommentingEnabled:x,location:c,navigate:n,currentTenant:b,period:z,isAdmin:P,isEmployee:B,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:A.createdByUserList,createdByUserListFetchState:A.createdByUserListFetchState,isDownloadEnabled:A.isDownloadEnabled,connectedAccountProvider:rt,isBulkActionEnabled:R,bulkSubmissionLimit:A.remiBulkSubmissionLimit,bulkSubmissionFetchState:A.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:N,onAskAiCfoClick:G,...dt})]})]}):it&&q?s.jsx($,{to:"../setup"}):D!=null&&Oe(b,D.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(be,{fetchState:"In-Progress"}):s.jsx(oe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=_($n)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,la=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:gn(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(fn(n))},onCreateNewRemiButtonClick:()=>{e(hn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Mn),ma=()=>{const e=J(),t=V(),{tenantEmailDomain:n}=X(),r=Je(),[c,d]=g.useState(!1),m=w(k=>W(k)),o=M.getSignedInUserTenant(n)?.companyId??m.companyId,a=M.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),p=ne(),I=ue(p?.loggedInUserRoleMap),S=pe(p?.loggedInUserRoleMap),x=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,R=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,j=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,b=k=>{d(k)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return R&&S&&x?s.jsx($,{to:"../../../reimbursements"}):j&&I?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!j||m.userReimbursementInfo&&S&&x===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:k=>(y=>y.trackPageLoaded(We.Event.reimbursementPromoPage))(k)}),s.jsx(Xe,{isAppContentDrawerOpen:c,handleDrawerToggle:b}),s.jsx(la,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{b(!0)}})]}):s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function _a(){const e=w(E=>W(E)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Je(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(C.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(C.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),p=e?.userRole!=null&&Sn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&In(t?.loggedInUserRoleMap),S=yn(t?.loggedInUserRoleMap),x=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,R=ue(t?.loggedInUserRoleMap),j=x&&R,{isFeatureEnabled:b}=m(C.isDepositAccountsFeatureEnabled),k=b&&!p&&Rn(t?.loggedInUserRoleMap),y=Pn(e,o,a)&&!p&&An(t?.loggedInUserRoleMap),T=Cn(t?.loggedInUserRoleMap),f=vn(t?.loggedInUserRoleMap),D=kn(t?.loggedInUserRoleMap),P=En(t?.loggedInUserRoleMap),A=Bn(t?.loggedInUserRoleMap),F=pe(t?.loggedInUserRoleMap),{tenantEmailDomain:u}=X(),N=V(),G=n===!0&&(R||F&&d);return s.jsxs(pt,{children:[N.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"verification"})}),s.jsx(B,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"setup"})}),s.jsx(B,{path:"promo",element:s.jsx(ma,{})}),s.jsx(B,{path:"approval-rules/*",element:j?s.jsx(On,{}):s.jsx(zn,{isUserHasZeniAccountsAccess:f,isUserHasChargeCardAccess:P,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:F,isUserHasTreasuryAccess:D,isTenantBankingOnly:i,tenantEmailDomain:u??""})}),G&&s.jsx(B,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(B,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(B,{path:"*",element:s.jsx($,{to:"../promo"})}),c&&R&&s.jsx(B,{path:"*",element:s.jsx($,{to:"../setup"})})]}):N.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"new",element:s.jsx(Ee,{})}),s.jsx(B,{path:":reimbursementId",element:s.jsx(Qn,{})}),s.jsx(B,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]}):s.jsx(B,{path:"*",element:s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${U.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]})}export{_a as default};
68
+ `,la=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:gn(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(fn(n))},onCreateNewRemiButtonClick:()=>{e(hn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Mn),ma=()=>{const e=J(),t=V(),{tenantEmailDomain:n}=X(),r=Je(),[c,d]=g.useState(!1),m=w(k=>W(k)),o=M.getSignedInUserTenant(n)?.companyId??m.companyId,a=M.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),p=ne(),I=ue(p?.loggedInUserRoleMap),S=pe(p?.loggedInUserRoleMap),x=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,R=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,j=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,b=k=>{d(k)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return R&&S&&x?s.jsx($,{to:"../../../reimbursements"}):j&&I?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!j||m.userReimbursementInfo&&S&&x===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:k=>(y=>y.trackPageLoaded(We.Event.reimbursementPromoPage))(k)}),s.jsx(Xe,{isAppContentDrawerOpen:c,handleDrawerToggle:b}),s.jsx(la,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{b(!0)}})]}):s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function _a(){const e=w(B=>W(B)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Je(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(C.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(C.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),p=e?.userRole!=null&&Sn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&In(t?.loggedInUserRoleMap),S=yn(t?.loggedInUserRoleMap),x=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,R=ue(t?.loggedInUserRoleMap),j=x&&R,{isFeatureEnabled:b}=m(C.isDepositAccountsFeatureEnabled),k=b&&!p&&Rn(t?.loggedInUserRoleMap),y=Pn(e,o,a)&&!p&&An(t?.loggedInUserRoleMap),T=Cn(t?.loggedInUserRoleMap),f=vn(t?.loggedInUserRoleMap),D=kn(t?.loggedInUserRoleMap),P=Bn(t?.loggedInUserRoleMap),A=En(t?.loggedInUserRoleMap),F=pe(t?.loggedInUserRoleMap),{tenantEmailDomain:u}=X(),N=V(),G=n===!0&&(R||F&&d);return s.jsxs(pt,{children:[N.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"verification"})}),s.jsx(E,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"setup"})}),s.jsx(E,{path:"promo",element:s.jsx(ma,{})}),s.jsx(E,{path:"approval-rules/*",element:j?s.jsx(On,{}):s.jsx(zn,{isUserHasZeniAccountsAccess:f,isUserHasChargeCardAccess:P,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:F,isUserHasTreasuryAccess:D,isTenantBankingOnly:i,tenantEmailDomain:u??""})}),G&&s.jsx(E,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(E,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(E,{path:"*",element:s.jsx($,{to:"../promo"})}),c&&R&&s.jsx(E,{path:"*",element:s.jsx($,{to:"../setup"})})]}):N.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"new",element:s.jsx(Be,{})}),s.jsx(E,{path:":reimbursementId",element:s.jsx(Qn,{})}),s.jsx(E,{path:":reimbursementId/edit",element:s.jsx(Be,{})}),s.jsx(E,{path:"*",element:s.jsx(oe,{})})]}):s.jsx(E,{path:"*",element:s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${U.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(E,{path:"*",element:s.jsx(oe,{})})]})}export{_a as default};
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-ypyKWtbM.js";import{u as x,j as fe,h as ue,l as _e,g as f,k as he,n as be,o as z}from"./core-CBFn_Yo_.js";import{eM as P,f7 as g,IC as Ie,pE as O,ja as ye,ic as Ce,s_ as ge,pJ as we,bu as Se,ID as Re,IE as Te,jm as Oe,bm as Fe,u0 as ke,IF as Ae,IG as De,sV as Ee,sZ as je,IH as G,II as Pe,IJ as Le,IK as Me,IL as Be,IM as w,IN as F,IO as k,IP as H,IQ as A,IR as D,dA as Ue,tI as ve,tw as Y,tx as N,tO as Ve,tB as $,tU as xe,IS as ze,IT as Ge,IU as He,IV as Ye,IW as Ne,eS as $e,eQ as qe}from"./zeni-epic-state-DQMIbKEE.js";import{D as Qe,F as Je,K as Ze,r as J,d as E,z as Z,G as Ke,A as We,a as Xe,w as ea,c as j,f as aa,m as K,U as sa,H as ta,J as oa}from"./index-ChMtRDkl.js";import"./mui-D35VurIR.js";import na from"./NotFoundScreen-BU5ZWYfy.js";import{F as ra}from"./FeaturePreviewScreen-pIQ4X1aP.js";import{a as h}from"./sentry-ylIvhyeZ.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-kulIc847.js";import{u as pa}from"./useInitialThreadRequest-BFAN9HG0.js";import{t as q,a as Q}from"./routePaths-nlWWZ4ZI.js";import{M as ma}from"./MobileAppDrawer-D23D-DVK.js";import"./recharts-CSEhqlTE.js";import"./analytics-B3Q4UmLh.js";import"./plaid-O0aD-5ib.js";import"./dnd-1A4kYEBz.js";import"./stripe-DMRn4zHo.js";import"./lottie-xwOlCP2t.js";import"./lexical-Blenvqjv.js";import"./pdf-B5d6xxqf.js";import"./utils-0qzBiEB0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="5eeb96eb-ea5d-494f-a223-9440b00d0026",e._sentryDebugIdIdentifier="sentry-dbid-5eeb96eb-ea5d-494f-a223-9440b00d0026")}catch{}})();const fa=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},_a=he(function(e){const o=Z.getSignedInUser(),p=e.tenantState.currentTenantId,u=P(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:j,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Oe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),m.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(ve({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Me({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Pe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(Ee()),e(je())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),p=Ze(),u=ta(p),a=fe(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=J(),{isFeatureEnabled:m}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=Z.getSignedInUser(),[i,y]=h.useState(!1),[L,W]=h.useState(!1),{isFeatureEnabled:M}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=f(n=>P(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(M?B?.companyId:void 0),C=f(n=>g(n).fetchState),ae=f(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),R=f(n=>n.financeStatementState.selectedReportId),se=f(n=>g(n).isCompareModeOn),_=f(n=>g(n).filter),T=f(n=>g(n).selectedReportAndTimeframeFetchState),te=f(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!L&&C==="Completed"&&b&&(s(O(l.userId,!1,!0,!1)),W(!0))},[i,L,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(we(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const U=We(),oe=U?.loggedInUserRole!=null&&Se(U?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),v=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),V=Qe(de??"")==="reports",pe=ia(ce),me=h.useMemo(()=>V?fa:void 0,[V]);la({canFetchSuggestedQuestions:pe,pageContexts:me})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:j,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(ma,{isAppContentDrawerOpen:ne,handleDrawerToggle:v}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:j,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:v,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:M,initialOpenThreadRequest:ee})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function va(){const e=f(s=>P(s)),{useFeatureGate:o}=J(),{isFeatureEnabled:p}=o(E.isDebitCardFeatureEnabled),u=$e(p,e),a=qe(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{va as default};
1
+ import{j as d}from"./liveblocks-DiLJJ0-W.js";import{u as x,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-PVb_PTOa.js";import{eM as M,f7 as g,IC as Ie,pE as O,ja as ye,ic as Ce,s_ as ge,pJ as Se,bu as we,ID as Re,IE as Te,jm as Oe,bm as Fe,u0 as ke,IF as Ae,IG as De,sV as je,sZ as Ee,IH as G,II as Me,IJ as Pe,IK as Le,IL as Be,IM as S,IN as F,IO as k,IP as H,IQ as A,IR as D,dA as Ue,tI as Ve,tw as Y,tx as N,tO as ve,tB as $,tU as xe,IS as ze,IT as Ge,IU as He,IV as Ye,IW as Ne,eS as $e,eQ as qe}from"./zeni-epic-state-4sJL0-hG.js";import{H as Qe,I as Je,K as Ze,n as J,l as j,z as Z,J as Ke,j as We,a as Xe,y as ea,d as E,g as aa,r as K,V as sa,M as ta,O as oa}from"./index-D5j-ijm9.js";import"./mui-Bs_Wx3U8.js";import na from"./NotFoundScreen-DcJllQdb.js";import{F as ra}from"./FeaturePreviewScreen-CiNRRJaO.js";import{a as h}from"./sentry-CRXtNjzG.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";import{u as pa}from"./useInitialThreadRequest-BJAnehMw.js";import{t as q,a as Q}from"./routePaths-Cu41oBox.js";import{M as fa}from"./MobileAppDrawer-DnUJz0tA.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="2aeea873-90bf-4f0e-b7c0-14325bc199cd",e._sentryDebugIdIdentifier="sentry-dbid-2aeea873-90bf-4f0e-b7c0-14325bc199cd")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},_a=he(function(e){const o=Z.getSignedInUser(),p=e.tenantState.currentTenantId,u=M(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:E,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Oe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ve({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Le({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Pe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Ee())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),p=Ze(),u=ta(p),a=me(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=J(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=Z.getSignedInUser(),[i,y]=h.useState(!1),[P,W]=h.useState(!1),{isFeatureEnabled:L}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>M(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(L?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),R=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),T=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!P&&C==="Completed"&&b&&(s(O(l.userId,!1,!0,!1)),W(!0))},[i,P,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Se(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const U=We(),oe=U?.loggedInUserRole!=null&&we(U?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),V=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),v=Qe(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>v?ma:void 0,[v]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:E,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:V}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:E,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:V,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:L,initialOpenThreadRequest:ee})]})}const w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Va(){const e=m(s=>M(s)),{useFeatureGate:o}=J(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=$e(p,e),a=qe(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Va as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-DiLJJ0-W.js";import{n as j,z as w,aI as y,y as E,d as p,g as F,cC as P,l as L}from"./index-D5j-ijm9.js";import"./mui-Bs_Wx3U8.js";import m from"./NotFoundScreen-DcJllQdb.js";import{a as d}from"./sentry-CRXtNjzG.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as f}from"./core-PVb_PTOa.js";import{eM as z,Pd as C,M3 as Y,Pe as k,tn as M,eY as G,Pf as O,tl as q}from"./zeni-epic-state-4sJL0-hG.js";import{R as x}from"./ReferralListScreen-C3zvIkrr.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./useAskAiCfoHostNavButtonProps-ZQtgg5zD.js";import"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";import"./MobileAppDrawer-DnUJz0tA.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]="d817dd87-6d26-4feb-9d77-364d403d5b2f",e._sentryDebugIdIdentifier="sentry-dbid-d817dd87-6d26-4feb-9d77-364d403d5b2f")}catch{}})();const B=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(k()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(q())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),H=()=>{const e=T(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=b(o=>z(o)),c=V(),_=A(),{useDynamicConfig:g}=j(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),v=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),I=Y(D);d.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&i===!1&&(e(M()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(B,{navigate:c,location:_,currentTenant:r,companyName:N,userName:v,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(H,{}):a.jsx(m,{})}),a.jsx(f,{path:"*",element:a.jsx(m,{})})]})}export{ue as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-kuz7A0GW.js","assets/sentry-CRXtNjzG.js","assets/core-PVb_PTOa.js","assets/zeni-epic-state-4sJL0-hG.js","assets/index-D5j-ijm9.js","assets/mui-Bs_Wx3U8.js","assets/analytics-BsMspvaD.js","assets/utils-CfmtJLRd.js","assets/withTransactionSidePanel-LH23g840.js","assets/useAskAiCfoHostNavButtonProps-ZQtgg5zD.js","assets/useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js","assets/TransactionDetailScreen-DaK6ceRt.js","assets/decodeURIComponentSafe-mU8LeJGH.js","assets/routePaths-Cu41oBox.js","assets/NotFoundScreen-DcJllQdb.js","assets/analyticsHelper-CQJg2P3F.js","assets/CompanyPassportScreen-CRMqtZFn.js","assets/MobileAppDrawer-DnUJz0tA.js","assets/FeaturePreviewScreen-CiNRRJaO.js","assets/ReferralListScreen-C3zvIkrr.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-CH2s-gzl.js","assets/AddressScreen-DbfnfF3g.js","assets/DomesticWireDetailScreen-B8McV8L1.js","assets/useInitialThreadRequest-BJAnehMw.js","assets/DrawerScreen-C7f_NiZk.js","assets/SetupPagesScreen-DrJKLQxS.js","assets/BusinessVerificationPageScreen-BoEZFvFS.js","assets/BillPayApprovalRoutes-CZRSyPvo.js","assets/ReimbursementApprovalRuleDetailScreen-CVP5Uq5I.js","assets/getLocaleForTenant-BlHoz8HV.js","assets/ReimbursementRoutes-BaDf69Ue.js","assets/ReimbursementApprovalRoutes-CMV2BtkL.js","assets/TransactionListRoutes-CIOjaSOe.js","assets/ZeniAccountStatementScreen-CeIEeVha.js","assets/SettingsRoutes-Dn3k1EVr.js","assets/accountMappingHelper-DdMTXagH.js","assets/QBOConnectionScreen-Cw9-vrgq.js","assets/empty-wep5Q-1y.js","assets/index-DnBq3nCg.js","assets/url-arGh5ZAs.js","assets/index-BCcxTJng.js","assets/ReportsRoutes-Cg41Op_9.js","assets/ChargeCardRoutes-B7hoiWSV.js","assets/PeopleRoutes-72XyljMO.js","assets/ExpenseAutomationRoutes-C7mCSmyZ.js","assets/TreasuryRoutes-uVfHsmut.js","assets/VendorsRoutes-B7j00M1u.js","assets/pathToGoBack-BrzgfZOY.js","assets/ZeniAccountRoutes-RroFxPLH.js","assets/AddressRoutes-Ddo5yFaY.js","assets/PandLWithForecastRoutes-CxMrp76j.js","assets/CustomerOnboardingRoutes-Cj9bwQg1.js","assets/TransactionDetailRoutes-BdR87vgc.js","assets/EntityDetailRoutes-CZrU40Jr.js","assets/NotificationRoutes-Cv58FgVH.js","assets/PerformanceRoutes-BN3XbJ8Y.js","assets/RewardsRoutes-Dd6j2rAO.js","assets/TaskRoutes-D7u9YC7x.js","assets/TaskListScreen-B9vL8Oxs.js","assets/AiCfoScreen-B013GFMS.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bm as os,eM as ls,eS as cs,eQ as ds,eR as ms,fC as us,eO as _s,cM as Ae,ct as As,f8 as Es,cl as ps,bB as Is,bp as gs,fd as xs,v as Ts,Ie as hs,bu as js,If as Us,bD as bs,fa as Hs,bC as Rs,br as Ds,cN as ys,Ig as fs,Ih as Cs,cJ as vs,cL as Os,cK as Ps,cs as Fs,cy as Ls,mh as Ee,eN as pe,Ii as Bs,fh as Ie,fI as ge,fJ as xe,fi as ks}from"./zeni-epic-state-4sJL0-hG.js";import{j as e}from"./liveblocks-DiLJJ0-W.js";import{a as v}from"./sentry-CRXtNjzG.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-PVb_PTOa.js";import{h as ws,u as zs,z as H,n as Gs,a as $s,c as Ys,l as L,j as Ws,L as B,D as he,t as _,P as qs,d as X,e as l}from"./index-D5j-ijm9.js";import"./mui-Bs_Wx3U8.js";import{f as je}from"./analyticsHelper-CQJg2P3F.js";import{t as Js}from"./getLocaleForTenant-BlHoz8HV.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="0a56d12b-31fb-4048-846c-e92a66dd0a22",i._sentryDebugIdIdentifier="sentry-dbid-0a56d12b-31fb-4048-846c-e92a66dd0a22")}catch{}})();const Ks={dashboard:()=>a(()=>import("./DashboardRoutes-kuz7A0GW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>a(()=>import("./BillPayRoutes-CH2s-gzl.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-BaDf69Ue.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20])),transactions:()=>a(()=>import("./TransactionListRoutes-CIOjaSOe.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>a(()=>import("./SettingsRoutes-Dn3k1EVr.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>a(()=>import("./ReportsRoutes-Cg41Op_9.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-B7hoiWSV.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>a(()=>import("./PeopleRoutes-72XyljMO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-C7mCSmyZ.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>a(()=>import("./TreasuryRoutes-uVfHsmut.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>a(()=>import("./VendorsRoutes-B7j00M1u.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-RroFxPLH.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>a(()=>import("./ReportsRoutes-Cg41Op_9.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),ea=l(()=>a(()=>import("./AddressRoutes-Ddo5yFaY.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sa=l(()=>a(()=>import("./PeopleRoutes-72XyljMO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),aa=l(()=>a(()=>import("./PandLWithForecastRoutes-CxMrp76j.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),na=l(()=>a(()=>import("./CustomerOnboardingRoutes-Cj9bwQg1.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),ta=l(()=>a(()=>import("./VendorsRoutes-B7j00M1u.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),ia=l(()=>a(()=>import("./TransactionDetailRoutes-BdR87vgc.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>a(()=>import("./EntityDetailRoutes-CZrU40Jr.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),ra=l(()=>a(()=>import("./DashboardRoutes-kuz7A0GW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),be=l(()=>a(()=>import("./BillPayRoutes-CH2s-gzl.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),oa=l(()=>a(()=>import("./SettingsRoutes-Dn3k1EVr.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),He=l(()=>a(()=>import("./ReimbursementRoutes-BaDf69Ue.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20]))),la=l(()=>a(()=>import("./ZeniAccountRoutes-RroFxPLH.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),ca=l(()=>a(()=>import("./TreasuryRoutes-uVfHsmut.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),da=l(()=>a(()=>import("./TransactionListRoutes-CIOjaSOe.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),ma=l(()=>a(()=>import("./ChargeCardRoutes-B7hoiWSV.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),ua=l(()=>a(()=>import("./NotificationRoutes-Cv58FgVH.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),_a=l(()=>a(()=>import("./PerformanceRoutes-BN3XbJ8Y.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),Aa=l(()=>a(()=>import("./ExpenseAutomationRoutes-C7mCSmyZ.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),Ea=l(()=>a(()=>import("./RewardsRoutes-Dd6j2rAO.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),pa=l(()=>a(()=>import("./TaskRoutes-D7u9YC7x.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),Ia=l(()=>a(()=>import("./AiCfoScreen-B013GFMS.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>a(()=>import("./NotFoundScreen-DcJllQdb.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),ga=l(()=>a(()=>import("./TaskListScreen-B9vL8Oxs.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function Za({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),D=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),J=os(h),G=Ms(),[N,De]=v.useState(!1),r=z(n=>ls(n)),{useFeatureGate:P}=Gs(),K=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&J,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(n=>n.tenantState.fetchState),E=z(n=>n.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(n=>us(n));if(o!=null){const n=H.getSignedInUserTenant(o);h!=null&&n!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ae=_s(),A=Ws(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ne=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(n=>w.tenantId!=null?Es(n,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&D!=null){const n=Q.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,D]),v.useEffect(()=>{N||(De(!0),f(B.TENANT_FETCHING)),ne.current?ne.current=!1:!Ts(ae,w)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s){if(pe(b?.userId,b?.zeniSessionId,n.tenantId),d(Bs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&he.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ae,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(W&&ts){k(Ie(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(q?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else W&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),W&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(W){X.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,D,h,f,U))},[D,E]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&f(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):E==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(n=Qs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Hs(r.company),We=Pe&&Ye===!0&&!C,qe=re&&Rs(A?.loggedInUserRoleMap),Je=oe&&Ds(A?.loggedInUserRoleMap),Ke=me&&ys(A?.loggedInUserRoleMap),Qe=fs(A?.loggedInUserRoleMap),Xe=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=We&&I,as=oe&&g,ns=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ne===!0||Ge===!0||Qe===!0||Xe===!0;return H.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||J&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||J?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(xa,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(ra,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ns||F?e.jsx(sa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(aa,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(na,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(ia,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(da,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(ga,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:qe||de||Ke||Je?e.jsx(ea,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(la,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(ca,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(_a,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(Aa,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(ua,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(ta,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(oa,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:as?e.jsx(ma,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(Ea,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(Ia,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const xa=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Ua,{tenantEmailDomain:O}):S?e.jsx(ja,{tenantEmailDomain:O}):U?e.jsx(ba,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(Ta,{tenantEmailDomain:O}):e.jsx(y,{}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ba=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,Za as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-ypyKWtbM.js";import{a as u}from"./sentry-ylIvhyeZ.js";import{j as T,u as R,h as P,g as m,k as B,l as _,n as H,o as C}from"./core-CBFn_Yo_.js";import{bm as Ie,eM as w,gr as ce,Kf as Ce,IE as xe,jm as le,lF as Ee,gt as Ae,Kh as ke,Kg as we,MG as je,w_ as Pe,Bt as ve,Mf as Me,Mo as De,b$ as re,cD as Ue,cE as Te,Ir as Fe,MH as Re,Is as Be,vq as _e,MI as Ve,DJ as Le,B9 as Oe,B0 as de,AZ as Ne,vu as ue,B3 as pe,B6 as ge,Bc as W,s1 as X,vt as $e,i_ as Y,j1 as me,MJ as Ge,k2 as Ke,vJ as ze,Ja as Je,Jb as Ze,iY as Qe,MK as qe,i$ as He,ML as Ye,vG as We,MM as Xe,MN as en,Bq as nn,eQ as fe,eS as he,MO as tn,fv as an,ID as sn,vF as te,fA as ae,fz as on,vE as cn,fy as ln,fx as rn,MP as dn,eV as be,MQ as un,MR as pn,vM as gn,vD as se,MS as mn,fc as fn,vA as hn,bS as bn,b_ as Sn,bZ as yn,bT as In,bX as Cn,bW as xn,bV as En,bY as An,bU as kn}from"./zeni-epic-state-DQMIbKEE.js";import{r as ee,d as D,z as x,aa as Se,bA as wn,c as G,f as jn,A as V,v as ne,bB as Pn,bC as vn,al as Mn,i as ye,bD as Dn,bE as Un,bF as Tn,a4 as Fn,G as Rn,bG as Bn,m as _n,bH as Vn}from"./index-ChMtRDkl.js";import{n as U}from"./mui-D35VurIR.js";import{M as v}from"./MobileAppDrawer-D23D-DVK.js";import{a as N,g as $,m as Ln}from"./accountMappingHelper-CEjaDvi1.js";import{t as On,A as Nn}from"./AddressScreen-DXP1i7x7.js";import F from"./NotFoundScreen-BU5ZWYfy.js";import{g as $n}from"./analyticsHelper-B4uZydFl.js";import{B as Gn}from"./BusinessVerificationPageScreen-DlerSwqe.js";import{C as Kn}from"./CompanyPassportScreen-CuARsPx2.js";import{q as oe}from"./QBOConnectionScreen-B_jPbhuP.js";import{B as zn}from"./BillPayApprovalRoutes-DHaXtrYO.js";import{R as Jn}from"./ReimbursementApprovalRoutes-D-DKJaF1.js";import"./recharts-CSEhqlTE.js";import"./analytics-B3Q4UmLh.js";import"./plaid-O0aD-5ib.js";import"./dnd-1A4kYEBz.js";import"./stripe-DMRn4zHo.js";import"./lottie-xwOlCP2t.js";import"./lexical-Blenvqjv.js";import"./pdf-B5d6xxqf.js";import"./utils-0qzBiEB0.js";import"./routePaths-nlWWZ4ZI.js";import"./empty-CuHDeEGA.js";import"./pdf-lib-CUHgD73m.js";import"./index-CDftMuwg.js";import"./url-BUH-dUKP.js";import"./index-CpBFmiLM.js";import"./decodeURIComponentSafe-CqMC__af.js";import"./ReimbursementApprovalRuleDetailScreen-BGFNyRVm.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]="40be4e55-5ca7-4a3e-8ec7-a3d1e6ff5e13",e._sentryDebugIdIdentifier="sentry-dbid-40be4e55-5ca7-4a3e-8ec7-a3d1e6ff5e13")}catch{}})();const Zn=U.div`
1
+ import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjzG.js";import{j as T,u as R,h as P,g as m,k as B,l as _,n as H,o as C}from"./core-PVb_PTOa.js";import{bm as Ie,eM as w,gr as ce,Kf as Ce,IE as xe,jm as le,lF as Ee,gt as Ae,Kh as ke,Kg as we,MG as je,w_ as Pe,Bt as ve,Mf as Me,Mo as De,b$ as re,cD as Ue,cE as Te,Ir as Fe,MH as Re,Is as Be,vq as _e,MI as Ve,DJ as Le,B9 as Oe,B0 as de,AZ as Ne,vu as ue,B3 as pe,B6 as ge,Bc as W,s1 as X,vt as $e,i_ as Y,j1 as me,MJ as Ge,k2 as Ke,vJ as Je,Ja as ze,Jb as Ze,iY as Qe,MK as qe,i$ as He,ML as Ye,vG as We,MM as Xe,MN as en,Bq as nn,eQ as fe,eS as he,MO as tn,fv as an,ID as sn,vF as te,fA as ae,fz as on,vE as cn,fy as ln,fx as rn,MP as dn,eV as be,MQ as un,MR as pn,vM as gn,vD as se,MS as mn,fc as fn,vA as hn,bS as bn,b_ as Sn,bZ as yn,bT as In,bX as Cn,bW as xn,bV as En,bY as An,bU as kn}from"./zeni-epic-state-4sJL0-hG.js";import{n as ee,l as D,z as x,aa as Se,bA as wn,d as G,g as jn,j as V,B as ne,bB as Pn,bC as vn,al as Mn,k as ye,bD as Dn,bE as Un,bF as Tn,a4 as Fn,J as Rn,bG as Bn,r as _n,bH as Vn}from"./index-D5j-ijm9.js";import{n as U}from"./mui-Bs_Wx3U8.js";import{M as v}from"./MobileAppDrawer-DnUJz0tA.js";import{a as N,g as $,m as Ln}from"./accountMappingHelper-DdMTXagH.js";import{t as On,A as Nn}from"./AddressScreen-DbfnfF3g.js";import F from"./NotFoundScreen-DcJllQdb.js";import{g as $n}from"./analyticsHelper-CQJg2P3F.js";import{B as Gn}from"./BusinessVerificationPageScreen-BoEZFvFS.js";import{C as Kn}from"./CompanyPassportScreen-CRMqtZFn.js";import{q as oe}from"./QBOConnectionScreen-Cw9-vrgq.js";import{B as Jn}from"./BillPayApprovalRoutes-CZRSyPvo.js";import{R as zn}from"./ReimbursementApprovalRoutes-CMV2BtkL.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./routePaths-Cu41oBox.js";import"./empty-wep5Q-1y.js";import"./pdf-lib-CKEHYQuo.js";import"./index-DnBq3nCg.js";import"./url-arGh5ZAs.js";import"./index-BCcxTJng.js";import"./decodeURIComponentSafe-mU8LeJGH.js";import"./ReimbursementApprovalRuleDetailScreen-CVP5Uq5I.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]="0eeb08b7-bf30-495e-82b0-383195116d2e",e._sentryDebugIdIdentifier="sentry-dbid-0eeb08b7-bf30-495e-82b0-383195116d2e")}catch{}})();const Zn=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as t}from"./liveblocks-ypyKWtbM.js";import{a as u}from"./sentry-ylIvhye
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Qn=B(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:k,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:L}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),z=N(a.accountMappingView.billPayAccountList,l.selectedOption),J=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),Q=Ln(a.accountMappingView.expenseAccounts1099FilingAccountList,L),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:J?.accountId,selectedPrepaidExpensesAccountIds:O.map(j=>j.accountId),selectedFixedAssetsAccountIds:h.map(j=>j.accountId),selectedAccruedExpensesAccountIds:M.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:Q};e(we({data:q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(ke())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(jn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(wn),qn=()=>{const e=T(),a=R(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>w(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Qn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Hn=U.div`
9
+ `,Qn=B(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:k,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:L}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),J=N(a.accountMappingView.billPayAccountList,l.selectedOption),z=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),Q=Ln(a.accountMappingView.expenseAccounts1099FilingAccountList,L),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:J?.accountId,selectedReimbursementsAccountId:z?.accountId,selectedPrepaidExpensesAccountIds:O.map(j=>j.accountId),selectedFixedAssetsAccountIds:h.map(j=>j.accountId),selectedAccruedExpensesAccountIds:M.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:Q};e(we({data:q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(ke())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(jn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(wn),qn=()=>{const e=T(),a=R(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>w(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Qn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Hn=U.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -30,7 +30,7 @@ import{j as t}from"./liveblocks-ypyKWtbM.js";import{a as u}from"./sentry-ylIvhye
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,at=B(function(e,a){const{companyId:i}=a,c=w(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(X("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(W(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(He(n))},updateCardPaymentModalState:n=>{e(qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(Qe(n,s,r))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Je())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=On(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>w(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Mn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(Y()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(Y())},[l,E]);const S=I=>{n(I)};return k?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=B(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(We())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>w(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>Ye(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
33
+ `,at=B(function(e,a){const{companyId:i}=a,c=w(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(X("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(W(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(He(n))},updateCardPaymentModalState:n=>{e(qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(Qe(n,s,r))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(ze())},onBillingAddressSave:n=>{e(Je(n))},onAddressEditHandler:n=>{if(n!=null){const s=On(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>w(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Mn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(Y()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(Y())},[l,E]);const S=I=>{n(I)};return k?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=B(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(We())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>w(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>Ye(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -54,4 +54,4 @@ import{j as t}from"./liveblocks-ypyKWtbM.js";import{a as u}from"./sentry-ylIvhye
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>w(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),k=he(g,s),S=!k&&E,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),J=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:k,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(Q,q){let j=`/${Q}/settings/my_profile`;return j=j.concat(`/new/${q}`),j}(r,h),Z=_n(c.state?.pathnameStackToGoBack,c.pathname);i(M,{state:{pathnameStackToGoBack:Z}})},onGetOtp:h=>{const M={...A.myProfileLocalData,phone:h};a(te({localData:M})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(on(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>w(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Jt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>w(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(H,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),kn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(H,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(H,{children:[t.jsx(C,{path:"/",element:t.jsx(Wn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Jn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Jt as default};
57
+ `,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>w(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),k=he(g,s),S=!k&&E,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,J=sn(s),z=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:z===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:J===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:k,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(Q,q){let j=`/${Q}/settings/my_profile`;return j=j.concat(`/new/${q}`),j}(r,h),Z=_n(c.state?.pathnameStackToGoBack,c.pathname);i(M,{state:{pathnameStackToGoBack:Z}})},onGetOtp:h=>{const M={...A.myProfileLocalData,phone:h};a(te({localData:M})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(on(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>w(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function zt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>w(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(H,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),kn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(H,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(H,{children:[t.jsx(C,{path:"/",element:t.jsx(Wn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(Jn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(zn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{zt as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-ypyKWtbM.js";import{j as J,u as X,h as Y,l as W,g as w,N as M,k as G,q as Xe}from"./core-CBFn_Yo_.js";import{bC as Ye,cN as Ie,M3 as ye,eM as F,ct as en,x9 as Z,w_ as nn,Mf as tn,Mi as an,pA as ee,po as ne,jW as te,rz as N,Mk as Ae,fz as $e,fy as We,fx as Ge,Ml as sn,xi as on,B9 as ke,B0 as _e,AZ as ve,AQ as K,B3 as Pe,B6 as we,Bc as Ee,s1 as De,fK as cn,co as rn,eS as un,eQ as dn,eR as ln,br as pn,Mm as mn,zS as le,Au as yn,Mn as fn,bD as gn,Cp as pe,Bt as Sn,Mo as bn,Mp as hn,Ct as Cn,Cx as In,rs as An,GD as kn,D2 as Ce,DX as me,Mq as _n,Mr as vn,Ms as Pn,Mt as He,Mu as wn,IZ as En,Ls as Dn,J9 as Tn,Mv as qe,Mw as xe,Dg as Ke,k2 as Un,pr as Qe,rB as On,bB as je,rN as Me,cr as Bn,Mx as Je,fb as xn,CM as Fn,CQ as Vn,My as jn,D5 as Re,Mz as Mn,MA as Rn,MB as Nn,MC as zn,fG as Ln,yt as Zn,MD as $n,yy as Wn,yx as Gn}from"./zeni-epic-state-DQMIbKEE.js";import{A as ae,r as ie,d as de,h as Te,aI as Q,z as D,w as se,c as E,v as Ue,f as $,bp as Hn,ao as oe,bq as V,br as qn,bs as Kn,aa as Ve,bt as Qn,m as Ne,ap as ze,K as Jn,x as Xn,bu as Yn,bv as et,bw as nt,a1 as tt}from"./index-ChMtRDkl.js";import{a as C}from"./sentry-ylIvhyeZ.js";import{n as Fe,D as at,S as it}from"./mui-D35VurIR.js";import{M as fe}from"./MobileAppDrawer-D23D-DVK.js";import R from"./NotFoundScreen-BU5ZWYfy.js";import{a as Le}from"./analyticsHelper-B4uZydFl.js";import{c as Ze}from"./routePaths-nlWWZ4ZI.js";import{B as Be}from"./BusinessVerificationPageScreen-DlerSwqe.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="7337307c-f47f-40db-82bb-0ef25394d060",e._sentryDebugIdIdentifier="sentry-dbid-7337307c-f47f-40db-82bb-0ef25394d060")}catch{}})();const st=Fe.div`
1
+ import{j as u}from"./liveblocks-DiLJJ0-W.js";import{j as J,u as X,h as Y,l as W,g as w,N as M,k as G,q as Xe}from"./core-PVb_PTOa.js";import{bC as Ye,cN as Ie,M3 as ye,eM as F,ct as en,x9 as Z,w_ as nn,Mf as tn,Mi as an,pA as ee,po as ne,jW as te,rz as N,Mk as Ae,fz as $e,fy as We,fx as Ge,Ml as sn,xi as on,B9 as ke,B0 as _e,AZ as ve,AQ as K,B3 as Pe,B6 as we,Bc as Ee,s1 as De,fK as cn,co as rn,eS as un,eQ as dn,eR as ln,br as pn,Mm as mn,zS as le,Au as yn,Mn as fn,bD as gn,Cp as pe,Bt as Sn,Mo as bn,Mp as hn,Ct as Cn,Cx as In,rs as An,GD as kn,D2 as Ce,DX as me,Mq as _n,Mr as vn,Ms as Pn,Mt as He,Mu as wn,IZ as En,Ls as Dn,J9 as Tn,Mv as qe,Mw as xe,Dg as Ke,k2 as Un,pr as Qe,rB as On,bB as je,rN as Me,cr as Bn,Mx as Je,fb as xn,CM as Fn,CQ as Vn,My as jn,D5 as Re,Mz as Mn,MA as Rn,MB as Nn,MC as zn,fG as Ln,yt as Zn,MD as $n,yy as Wn,yx as Gn}from"./zeni-epic-state-4sJL0-hG.js";import{j as ae,n as ie,l as de,h as Te,aI as Q,z as D,y as se,d as E,B as Ue,g as $,bp as Hn,ao as oe,bq as V,br as qn,bs as Kn,aa as Ve,bt as Qn,r as Ne,ap as ze,K as Jn,C as Xn,bu as Yn,bv as et,bw as nt,a1 as tt}from"./index-D5j-ijm9.js";import{a as C}from"./sentry-CRXtNjzG.js";import{n as Fe,D as at,S as it}from"./mui-Bs_Wx3U8.js";import{M as fe}from"./MobileAppDrawer-DnUJz0tA.js";import R from"./NotFoundScreen-DcJllQdb.js";import{a as Le}from"./analyticsHelper-CQJg2P3F.js";import{c as Ze}from"./routePaths-Cu41oBox.js";import{B as Be}from"./BusinessVerificationPageScreen-BoEZFvFS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="9f978392-5372-4218-8258-0b0c9f05afef",e._sentryDebugIdIdentifier="sentry-dbid-9f978392-5372-4218-8258-0b0c9f05afef")}catch{}})();const st=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as u}from"./liveblocks-DiLJJ0-W.js";import{a as f,b as T,q as A}from"./sentry-CRXtNjzG.js";import{h as D,j as z,g as l,u as M,N as O,k as j}from"./core-PVb_PTOa.js";import{u as F,z as s,h as P,d as E,D as N,f as _,g as B,U as V,i as $,T as q,k as v}from"./index-D5j-ijm9.js";import{eM as J,Id as Q,Ie as R,eN as W,fh as H,Ik as G,fF as K,cR as X,Il as b,Im as Y,In as Z,bQ as y}from"./zeni-epic-state-4sJL0-hG.js";import"./mui-Bs_Wx3U8.js";import{u as ee}from"./useDeviceId-B5nwTsrh.js";import{f as te}from"./analyticsHelper-CQJg2P3F.js";import{t as ne}from"./getLocaleForTenant-BlHoz8HV.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="c075991d-ec15-4d5f-a93a-710a93b46ba1",t._sentryDebugIdIdentifier="sentry-dbid-c075991d-ec15-4d5f-a93a-710a93b46ba1")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})(q),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();f.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),L=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>J(e)),S=l(e=>Q(e)),m=M(),w=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect(()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[h.fetchState,c]),f.useEffect(()=>{t(void 0)},[]),f.useEffect(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(S.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,w,void 0,S.tenantsInOrder),K().then(()=>{const e=$();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,w,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(O,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?u.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-DiLJJ0-W.js";import{a}from"./sentry-CRXtNjzG.js";import{h as u,u as m,j as p,N as g}from"./core-PVb_PTOa.js";import{z as c,B as y,t as h,d as f,g as b}from"./index-D5j-ijm9.js";import{IA as I,Ii as x,IB as j}from"./zeni-epic-state-4sJL0-hG.js";import{n as w}from"./mui-Bs_Wx3U8.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.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]="ca016c9e-f565-4c85-95d8-fef0d49cb0e7",e._sentryDebugIdIdentifier="sentry-dbid-ca016c9e-f565-4c85-95d8-fef0d49cb0e7")}catch{}})();function q(){const e=u(),t=m(),i=p(),n=a.useRef(!1),d=c.isSignedIn(),r=t.state?.message==="logout",o=r||d;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{c.clearAll(),e(I()),e(x(!1)),j(),h.reset(),f.trackLogout(b.Event.logoutSuccess),f.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `;export{q as default};
@@ -0,0 +1,9 @@
1
+ import{j as k}from"./liveblocks-DiLJJ0-W.js";import{a as m}from"./sentry-CRXtNjzG.js";import{j,h as N,u as R,g as G,l as $,k as O}from"./core-PVb_PTOa.js";import{I as v,z as K,n as M,l as U,y as _,d as z,g as V,cE as W,r as T,p as q}from"./index-D5j-ijm9.js";import{eM as H,Pk as L,Fo as C,Pl as w,Pg as J,EP as I,Pm as Q,ET as S,Es as X,Fp as b,Pn as B,gy as Y,Fe as Z,Fj as aa,F6 as ta,F4 as ea,Fk as sa,F1 as oa,Po as na,Pp as la,Pq as ia,Pr as u,e8 as ra,Ps as ca,Pt as pa}from"./zeni-epic-state-4sJL0-hG.js";import{n as ka}from"./mui-Bs_Wx3U8.js";import{u as ua}from"./useAskAiCfoHostNavButtonProps-ZQtgg5zD.js";import{c as da}from"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";import{M as ma}from"./MobileAppDrawer-DnUJz0tA.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="5c22094e-79d0-45ea-ba05-daba1708dba2",t._sentryDebugIdIdentifier="sentry-dbid-5c22094e-79d0-45ea-ba05-daba1708dba2")}catch{}})();const Ta=ka.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${t=>t.theme.colors.grey4};
9
+ `,fa=O(function(t,e){const o=L(t,e.isTaskTemplatesEnabled),{taskGroupId:l}=e,n=l!=null&&l!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(i=>({...i,tasks:i.tasks.filter(r=>r.taskGroupIds.includes(l))})).filter(i=>i.tasks.length>0)}:o;return{taskListView:n,tagListView:J(t),localData:n.localData,isTaskTemplatesEnabled:e.isTaskTemplatesEnabled}},function(t,e){const{navigate:o,currentTenant:l,location:n,isTaskTemplatesEnabled:i}=e,{tenantEmailDomain:r}=l,{groupByKey:f}=e.uiState;return{onTaskManagementRowClick:a=>{const s=ga(r,a),p=T(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{t(C(!0,i))},onNewTaskClick:()=>{if(e.localData.defaultTaskGroupId!=null){const a=y(r,e.localData.defaultTaskGroupId),s=T(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{t(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{t(ia({filters:a}))},onSearchTextChanged:a=>{t(la({searchText:a}))},onReloadCards:()=>{t(C(!0,i))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{t(na({localData:a}))},resetLocalData:()=>{t(w({taskGroupById:e.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{t(oa(e.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{t(ea(e.localData.selectedTaskIds,a,sa(e.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{t(ta(a))},onAddNewTaskToTaskGroup:a=>{if(e.localData.defaultTaskGroupId!=null){const s=ha(f,a);t(I({taskDetailLocalData:s}));const p=y(r,e.uiState.groupByKey==="groupName"?a:e.localData.defaultTaskGroupId),g=T(n.state?.pathnameStackToGoBack,n.pathname);o(p,{state:{pathnameStackToGoBack:g,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{t(aa(e.localData.selectedTaskIds.length>0?e.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{t(Z(a,s))},onTimeSpentUpdate:(a,s)=>{t(b({task:a,updates:s}))},onShowToast:a=>{t(Y(a))},onGroupByFilterChange:a=>{t(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{t(b({task:a,updates:s}))},onCreateTagClick:(a,s)=>{t(X(a,s))},handleGroupTemplateClick:a=>{t(S(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{t(S(a,[s]))},handleNewTaskInitialization:a=>{if(t(I({taskDetailLocalData:{...Q,name:a}})),e.localData.defaultTaskGroupId!=null){const s=y(r,e.localData.defaultTaskGroupId),p=T(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${r}/tasks/group/${a}`)}}})(W);function $a(){const{isAiCfoOpen:t,setIsAiCfoOpen:e}=v(),o=j(),l=N(),n=R(),i=K.getSignedInUser(),r=G(c=>H(c)),{taskGroupId:f}=$(),{useFeatureGate:a}=M(),{isFeatureEnabled:s}=a(U.isTaskTemplatesEnabled),[p,g]=m.useState(!1),[E,P]=m.useState(!1),h=G(c=>L(c,s)),D=G(c=>c.taskGroupState),d=h.fetchState,{isAiCfoAccessEnabled:F,onAskAiCfoClick:A}=ua({isAiCfoOpen:t,setIsAiCfoOpen:e,mobileExploreReferrer:"Task Checklist"});if(da({isDataReady:d==="Completed"}),m.useEffect(()=>{p||(g(!0),l(C(!1,s)))},[p,l]),m.useEffect(()=>{d==="Completed"&&l(w({taskGroupById:D.taskGroupById}))},[d,D.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return k.jsxs(k.Fragment,{children:[d==="Completed"?k.jsx(_,{analytics:z,onLoad:c=>(x=>x.trackPageLoaded(V.Event.taskListPage))(c)}):null,k.jsxs(Ta,{children:[k.jsx(ma,{isAppContentDrawerOpen:E,handleDrawerToggle:c=>{P(c)}}),k.jsx(fa,{location:n,navigate:o,currentTenant:r,taskGroupId:f,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:s,taskListFetchState:d,isAiCfoAccessEnabled:F,onAskAiCfoClick:A})]})]})}const ga=(t,e)=>`/${t}/tasks/${encodeURIComponent(e)}`,y=(t,e)=>`/${t}/tasks/new/${e}`,ha=(t,e)=>{if(t==="assignee"){const o=e.split(",");return{...u.taskDetailLocalData,assignee:o}}if(t==="priority"){const o=ra(e);return{...u.taskDetailLocalData,priority:o}}if(t==="status"){const o=ca(e);return{...u.taskDetailLocalData,status:o}}if(t==="tag"){const o=e.split(",");return{...u.taskDetailLocalData,tagIds:o}}if(t==="dueDate"){const o=pa(e);return{...u.taskDetailLocalData,dueDate:o}}return{...u.taskDetailLocalData}};export{$a as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-DiLJJ0-W.js";import z from"./NotFoundScreen-DcJllQdb.js";import{a as p}from"./sentry-CRXtNjzG.js";import{j as A,h as M,u as V,l as $,g as f,N as _,k as O,n as R,o as u}from"./core-PVb_PTOa.js";import{x as q,z as E,r as w,y as Q,d as T,g as W,cD as H,k as Z,ao as J,p as K}from"./index-D5j-ijm9.js";import{eM as C,Pg as G,EL as v,Ez as X,Fb as Y,Ph as P,Pi as aa,Ev as ea,Es as ta,pA as sa,po as na,jW as oa,EF as ia,Pj as ra,EC as ca,EQ as la,EP as da}from"./zeni-epic-state-4sJL0-hG.js";import{n as pa}from"./mui-Bs_Wx3U8.js";import{u as ma}from"./useInitialThreadRequest-BJAnehMw.js";import{M as ua}from"./MobileAppDrawer-DnUJz0tA.js";import ka from"./TaskListScreen-B9vL8Oxs.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./useAskAiCfoHostNavButtonProps-ZQtgg5zD.js";import"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="bf67e9ec-9b1a-4af1-adba-4cd9e3bca45b",a._sentryDebugIdIdentifier="sentry-dbid-bf67e9ec-9b1a-4af1-adba-4cd9e3bca45b")}catch{}})();const fa=O(function(a,t){const{location:n,taskGroupId:c}=t,d=P(a,t.taskId),l=C(a),i=c!=null?aa(a.taskGroupState,c):void 0,m=E.getSignedInUser(),e=l.tenantId,r={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:e??""},k=G(a);return{taskDetailSelectorView:d,authParams:r,isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:J.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${Z.appUrl}${t.location.pathname}`,tagListView:k,taskGroupName:c!=null&&i!=null&&i.isDefault===!1?i.name:void 0}},function(a,t){const{taskId:n,navigate:c,currentTenant:d,location:l,taskGroupId:i}=t,{tenantEmailDomain:m}=d;return{onSaveChangesToLocalStore:e=>{a(da({taskDetailLocalData:e,taskId:n}))},onSaveDetailClick:()=>{a(la(n,i))},onArchiveTaskClick:()=>{t.taskId!=null&&a(ca(t.taskId))},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const e=K(l.state?.pathnameStackToGoBack),r=e.poppedPathname??"../../dashboard";c(r,{state:{pathnameStackToGoBack:e.newStack}})}else{const e=B(m),r=w(l.state?.pathnameStackToGoBack,l.pathname);c(e,{state:{pathnameStackToGoBack:r}})}a(ra({taskId:n}))},onDeleteTaskClick:()=>{a(ia(n))},updateFilesEntity:e=>{a(oa({files:e}))},onDeleteFile:e=>{a(na(e))},onEditFileName:(e,r)=>{a(sa(e,r.split(".")[0]))},onReloadTaskDetailPage:()=>{a(v(!1,n))},onCreateTagClick:e=>{a(ta(e,n))},onDeleteTagClick:e=>{a(ea(e,n))}}})(H);function I(){const a=A(),t=M(),n=V(),c=q(),{taskId:d,taskGroupId:l}=$(),i=f(o=>C(o)),m=ma(i?.companyId),[e,r]=p.useState(!1),[k,F]=p.useState(!1),[S,L]=p.useState(!1),[b,N]=p.useState(!1),x=f(o=>G(o)),j=f(o=>o.taskGroupViewState.fetchState);p.useEffect(()=>{k||(F(!0),t(v(!1,d)))},[k,t]),p.useEffect(()=>{S||x.fetchState==="Completed"||(L(!0),t(X()))},[S,t,x.fetchState]),p.useEffect(()=>{b||j==="Completed"||(N(!0),t(Y()))},[b,t,j]);const y=f(o=>P(o,d)),g=y.fetchState,D=E.getSignedInUser();if(D==null)throw Error("Can't access task detail page without signing in...");if(g==="Error"&&y.error?.code===400){const{tenantEmailDomain:o}=i,h=B(o),U=w(n.state?.pathnameStackToGoBack,n.pathname);return s.jsx(_,{to:h,state:{pathnameStackToGoBack:U}})}return s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(Q,{analytics:T,onLoad:o=>(h=>h.trackPageLoaded(W.Event.taskDetailPage))(o)}):null,s.jsxs(ga,{children:[s.jsx(ua,{isAppContentDrawerOpen:e,handleDrawerToggle:o=>{r(o)}}),s.jsx(fa,{analytics:T,currentTenant:i,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:D,navigate:a,taskGroupId:l,taskId:d,taskDetailFetchState:g})]})]})}const ga=pa.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${a=>a.theme.colors.grey4};
9
+ `,B=a=>`/${a}/tasks`;function Aa(){return s.jsxs(R,{children:[s.jsx(u,{path:"/new",element:s.jsx(I,{})}),s.jsx(u,{path:"/new/:taskGroupId",element:s.jsx(I,{})}),s.jsx(u,{path:"/group/:taskGroupId",element:s.jsx(ka,{})}),s.jsx(u,{path:"/:taskId",element:s.jsx(I,{})}),s.jsx(u,{path:"*",element:s.jsx(z,{})})]})}export{Aa as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-DiLJJ0-W.js";import i from"./NotFoundScreen-DcJllQdb.js";import{T as r}from"./TransactionDetailScreen-DaK6ceRt.js";import"./sentry-CRXtNjzG.js";import{n as d,o as e}from"./core-PVb_PTOa.js";import"./zeni-epic-state-4sJL0-hG.js";import"./recharts-CreyyBLx.js";import"./index-D5j-ijm9.js";import"./mui-Bs_Wx3U8.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./useAskAiCfoHostNavButtonProps-ZQtgg5zD.js";import"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";import"./decodeURIComponentSafe-mU8LeJGH.js";import"./routePaths-Cu41oBox.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="256f287b-7a3d-4d6d-890e-a8cb9db8b86d",o._sentryDebugIdIdentifier="sentry-dbid-256f287b-7a3d-4d6d-890e-a8cb9db8b86d")}catch{}})();function q(){return t.jsxs(d,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{q as default};