@zeniai/web-app-ui 5.0.85-qa → 5.0.86-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 (139) hide show
  1. package/dist/assets/AddressRoutes-DgEY9uyX.js +1 -0
  2. package/dist/assets/{AddressScreen-BtcayE54.js → AddressScreen-CnGdseVP.js} +2 -2
  3. package/dist/assets/AiCfoScreen-C2gUHPZf.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-9-Csp2U9.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DsFE6diU.js → BillPayRoutes-q1G-HOG9.js} +18 -18
  6. package/dist/assets/{BusinessVerificationPageScreen-DyDPvAa7.js → BusinessVerificationPageScreen-D4q4raDT.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-CSRXXtJq.js → ChargeCardRoutes-B9R8GuRe.js} +9 -9
  8. package/dist/assets/CompanyPassportScreen-ByZS8ECt.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-DXMFv4zF.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-knI9lPPe.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-l2IJ6Hus.js → CustomerOnboardingRoutes-YAUJymHi.js} +4 -4
  12. package/dist/assets/DashboardRoutes-CR_Eiq9o.js +20 -0
  13. package/dist/assets/{DefaultTenantHome-BhXvYXq9.js → DefaultTenantHome-DwlSdo4L.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-U7m2J1ru.js +18 -0
  15. package/dist/assets/DrawerScreen-_gX7HdVn.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-DqZ47hHU.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-CVojfTBC.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-DKtIkE5j.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-WWoFOb2m.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-g2y4CG2P.js → MagicLinkRoutes-BZEud5Lo.js} +21 -21
  21. package/dist/assets/MagicLinkSignInScreen-D0oZcrz4.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-CQBNZVi-.js → MobileAppDrawer-DrIh5jJg.js} +1 -1
  23. package/dist/assets/NotFoundScreen-BBj2rX_R.js +1 -0
  24. package/dist/assets/{NotificationRoutes-CvOb5_M_.js → NotificationRoutes-DVHpj6YG.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-BzjWhRQg.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-7aSf0ep-.js +1 -0
  27. package/dist/assets/PeopleRoutes-CSEkDDLu.js +22 -0
  28. package/dist/assets/PerformanceRoutes-CDlljgVc.js +1 -0
  29. package/dist/assets/{Preview-C8WOe1SB.js → Preview-C8bsUUOu.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DaV5GdQG.js → QBOConnectionScreen-BmMKTrMs.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-Bls1S21T.js → ReferralListScreen-C51C5goG.js} +2 -2
  32. package/dist/assets/ReimbursementApprovalRoutes-BbC6CIcT.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DbnieOyX.js → ReimbursementApprovalRuleDetailScreen-BbYEUJEU.js} +1 -1
  34. package/dist/assets/ReimbursementRoutes-D-0FZjs9.js +68 -0
  35. package/dist/assets/ReportsRoutes-BEw8kZp5.js +1 -0
  36. package/dist/assets/RewardsRoutes-CkpiNxLy.js +1 -0
  37. package/dist/assets/ScreenRoutes-Dc0UseAg.js +2 -0
  38. package/dist/assets/{SettingsRoutes-C6LVb3V1.js → SettingsRoutes-CEbVRwbt.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-BbYqHHxm.js → SetupPagesScreen-P0OPONPn.js} +5 -5
  40. package/dist/assets/SignInScreen-DB6Z1J1V.js +1 -0
  41. package/dist/assets/SignOutScreen-BB84FKCU.js +9 -0
  42. package/dist/assets/TaskListScreen-Bp2ScJrS.js +9 -0
  43. package/dist/assets/TaskRoutes-CWhPTaiP.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-CxlUtejM.js +1 -0
  45. package/dist/assets/TransactionDetailScreen-Ci7wUJ8m.js +5 -0
  46. package/dist/assets/TransactionListRoutes-BCPHc0EZ.js +1 -0
  47. package/dist/assets/TreasuryRoutes-BtYQynDf.js +37 -0
  48. package/dist/assets/{VendorsRoutes-CiiYmal_.js → VendorsRoutes-RYVvqvwk.js} +28 -28
  49. package/dist/assets/WiseConfirmationScreen-RH0Xu2QX.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-H-lyZt2Y.js → ZeniAccountRoutes-BJIy1chm.js} +12 -12
  51. package/dist/assets/ZeniAccountStatementScreen-BtroA3vI.js +9 -0
  52. package/dist/assets/{accountMappingHelper-CXzOuSqF.js → accountMappingHelper-5LvFlOj7.js} +1 -1
  53. package/dist/assets/{analytics-CRD_Mcgv.js → analytics-BE9oUBzD.js} +1 -1
  54. package/dist/assets/{analyticsHelper-BpXMyiZT.js → analyticsHelper-ClnSplSs.js} +1 -1
  55. package/dist/assets/{core-BZAtj_dP.js → core-D1cXuJMi.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-K7ukqtFq.js → decodeURIComponentSafe-Did0aZyt.js} +1 -1
  57. package/dist/assets/{dnd-CYktLE_1.js → dnd-DbPPTppj.js} +1 -1
  58. package/dist/assets/{empty-DDhd2rI6.js → empty-BHW5kDnt.js} +1 -1
  59. package/dist/assets/{empty-BtWrOCqn.js → empty-CfqAKA3M.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-Bspjk9Ta.js → emptyVideoElement-BofOruLs.js} +1 -1
  61. package/dist/assets/epic-CUqueK5i.js +2 -0
  62. package/dist/assets/getLocaleForTenant-BVN8Zhv2.js +1 -0
  63. package/dist/assets/{index-DvtTYnxY.js → index-3aBFjHPN.js} +1 -1
  64. package/dist/assets/{index-3xpE1-f9.js → index-B4eiJr7Z.js} +1 -1
  65. package/dist/assets/{index-5Uhv29OT.js → index-BSfz3Hzd.js} +1 -1
  66. package/dist/assets/{index-BOpWIlV0.js → index-CRe2wmI_.js} +1 -1
  67. package/dist/assets/{index-l0jEAtpj.js → index-Cc13Ni3u.js} +15411 -15406
  68. package/dist/assets/{index-DvJe2aYX.js → index-DF3os92T.js} +2 -2
  69. package/dist/assets/{index-fjLnhDUD.js → index-DjDfMTxy.js} +1 -1
  70. package/dist/assets/{index-rFU-5LRD.js → index-n6IrYjfy.js} +1 -1
  71. package/dist/assets/{lexical-CtWr-ANo.js → lexical-Du70nM1B.js} +1 -1
  72. package/dist/assets/{liveblocks-B381bPI5.js → liveblocks-Hyy2O23M.js} +1 -1
  73. package/dist/assets/{lottie-M6FrlJUx.js → lottie-qu8VyEpw.js} +1 -1
  74. package/dist/assets/{mui-Ded5Lnjo.js → mui-B2prtfNk.js} +1 -1
  75. package/dist/assets/{pathToGoBack-itTyzDhS.js → pathToGoBack-C7gPpVBh.js} +1 -1
  76. package/dist/assets/{pdf-CXxzr_OL.js → pdf-Cvwxd6W6.js} +4 -4
  77. package/dist/assets/{pdf-lib-BOf1Mpdf.js → pdf-lib-D1w2Ub95.js} +1 -1
  78. package/dist/assets/{plaid-CigRTw2w.js → plaid-4w70Yh4I.js} +1 -1
  79. package/dist/assets/{pusher-DD87NXN7.js → pusher-Bvm9V4qD.js} +1 -1
  80. package/dist/assets/{react-CeRpBRgM.js → react-B4GuIedn.js} +1 -1
  81. package/dist/assets/{react-Ct2u64kQ.js → react-BCjBqrrm.js} +1 -1
  82. package/dist/assets/{react-5meyD7ty.js → react-BZq53fCf.js} +1 -1
  83. package/dist/assets/{react-0OYfftd4.js → react-BfNTrsTo.js} +1 -1
  84. package/dist/assets/{react-TqMAXqlI.js → react-CBBEPwWt.js} +1 -1
  85. package/dist/assets/{react-D4qnCHni.js → react-CUSCkthZ.js} +1 -1
  86. package/dist/assets/{recharts-CxMFTRT8.js → recharts-CrZf7bKF.js} +1 -1
  87. package/dist/assets/routePaths-CYWO_4aN.js +1 -0
  88. package/dist/assets/{sentry-N_eviIZg.js → sentry-BTyPPF0t.js} +1 -1
  89. package/dist/assets/{url-giMXuS4f.js → url-CsQlFR2d.js} +1 -1
  90. package/dist/assets/{url-tPbFjbci.js → url-Dq7O3gKi.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-CQ5wXGV2.js +1 -0
  92. package/dist/assets/{useDeviceId-DesiQfLG.js → useDeviceId-D81NtSvK.js} +1 -1
  93. package/dist/assets/useFetchSuggestedQuestionsWhenReady-C8wykHii.js +1 -0
  94. package/dist/assets/{useInitialThreadRequest-rt9wsjsl.js → useInitialThreadRequest-DTnvA37x.js} +1 -1
  95. package/dist/assets/{utils-DvZFRPln.js → utils-C_-saZ2j.js} +1 -1
  96. package/dist/assets/withTransactionSidePanel-BLrf1QAn.js +21 -0
  97. package/dist/assets/{zeni-epic-state-BYztznIU.js → zeni-epic-state-CbUjX_b3.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -4
  100. package/dist/assets/AddressRoutes-ByNvllYO.js +0 -1
  101. package/dist/assets/AiCfoScreen-DGB9zDPa.js +0 -22
  102. package/dist/assets/BillPayApprovalRoutes-DNR93njT.js +0 -1
  103. package/dist/assets/CompanyPassportScreen-Bz4mLFh7.js +0 -1
  104. package/dist/assets/ConnectionAuthScreen-ByV6Tmro.js +0 -11
  105. package/dist/assets/CustomerOnboardingAuthScreen-DjBElWhF.js +0 -1
  106. package/dist/assets/DashboardRoutes-BQXZD2Lg.js +0 -20
  107. package/dist/assets/DomesticWireDetailScreen-S8pB6QMG.js +0 -18
  108. package/dist/assets/DrawerScreen-NjKnf1YY.js +0 -1
  109. package/dist/assets/EntityDetailRoutes-zm-3jflF.js +0 -1
  110. package/dist/assets/ExpenseAutomationRoutes-be35OPw4.js +0 -25
  111. package/dist/assets/FeaturePreviewScreen-Bt2H4Z6l.js +0 -1
  112. package/dist/assets/HubSpotOAuthCallbackScreen-C_xNoer0.js +0 -1
  113. package/dist/assets/MagicLinkSignInScreen-Hncas8bE.js +0 -12
  114. package/dist/assets/NotFoundScreen-B-5op0jc.js +0 -1
  115. package/dist/assets/OAuthConsentScreen-BOhp2ut-.js +0 -1
  116. package/dist/assets/PandLWithForecastRoutes-2AFcv1lQ.js +0 -1
  117. package/dist/assets/PeopleRoutes-CokVmeNh.js +0 -22
  118. package/dist/assets/PerformanceRoutes-DFdim8gz.js +0 -1
  119. package/dist/assets/ReimbursementApprovalRoutes-Uulp1bt3.js +0 -1
  120. package/dist/assets/ReimbursementRoutes-CfyEG0Oh.js +0 -68
  121. package/dist/assets/ReportsRoutes-DGF8a5_O.js +0 -1
  122. package/dist/assets/RewardsRoutes-CR3jZvlK.js +0 -1
  123. package/dist/assets/ScreenRoutes-BlUphh6q.js +0 -2
  124. package/dist/assets/SignInScreen-C5U7E7kj.js +0 -1
  125. package/dist/assets/SignOutScreen-f_wBxqm6.js +0 -9
  126. package/dist/assets/TaskListScreen-Jne3kBc1.js +0 -9
  127. package/dist/assets/TaskRoutes-FcXfZbsF.js +0 -9
  128. package/dist/assets/TransactionDetailRoutes-C3foecuN.js +0 -1
  129. package/dist/assets/TransactionDetailScreen-CmMgSwsr.js +0 -5
  130. package/dist/assets/TransactionListRoutes-YIOk2iJl.js +0 -1
  131. package/dist/assets/TreasuryRoutes-CMvaheZZ.js +0 -37
  132. package/dist/assets/WiseConfirmationScreen-B3VNahBo.js +0 -12
  133. package/dist/assets/ZeniAccountStatementScreen-dZ9YFFOZ.js +0 -9
  134. package/dist/assets/epic-CvldkuU3.js +0 -2
  135. package/dist/assets/getLocaleForTenant-B6DiABoj.js +0 -1
  136. package/dist/assets/routePaths-ChRahAmw.js +0 -1
  137. package/dist/assets/useAskAiCfoHostNavButtonProps-DCgVyLJS.js +0 -1
  138. package/dist/assets/useFetchSuggestedQuestionsWhenReady-DhDRKto8.js +0 -1
  139. package/dist/assets/withTransactionSidePanel-D9xxZEyy.js +0 -21
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-B381bPI5.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-BZAtj_dP.js";import{J5 as k,J6 as v,J7 as T,za as B,yY as G,J8 as D,J9 as oe,Ja as se,z0 as ie,eR as $,z7 as le,z4 as re}from"./zeni-epic-state-BYztznIU.js";import{Z as g,o as r,n as de,e as j,j as J,p as ce,k as me,q as pe,r as H,y as ue,S as he,s as xe,v as ge,m as fe,w as we,x as be,A as Se,B as ye,C as ke,E as ve,F as je,G as $e}from"./index-l0jEAtpj.js";import{n as m}from"./mui-Ded5Lnjo.js";import f from"./NotFoundScreen-B-5op0jc.js";import{a as I}from"./sentry-N_eviIZg.js";import"./recharts-CxMFTRT8.js";import"./analytics-CRD_Mcgv.js";import"./plaid-CigRTw2w.js";import"./dnd-CYktLE_1.js";import"./stripe-DMRn4zHo.js";import"./lottie-M6FrlJUx.js";import"./lexical-CtWr-ANo.js";import"./pdf-CXxzr_OL.js";import"./utils-DvZFRPln.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]="4679fdf8-9368-4c69-9eda-5973968562f9",e._sentryDebugIdIdentifier="sentry-dbid-4679fdf8-9368-4c69-9eda-5973968562f9")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-Hyy2O23M.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as L,N as ae,n as ne,o as p}from"./core-D1cXuJMi.js";import{Jz as k,JA as v,JB as T,zz as z,zl as G,JC as B,JD as oe,JE as se,zp as ie,eR as $,zw as le,zt as de}from"./zeni-epic-state-CbUjX_b3.js";import{K as g,o as d,w as re,d as j,h as J,v as ce,p as me,$ as pe,j as H,C as ue,A as he,k as xe,n as ge,m as fe,q as we,B as be,x as Se,T as ye,S as ke,y as ve,E as je,F as $e}from"./index-Cc13Ni3u.js";import{n as m}from"./mui-B2prtfNk.js";import f from"./NotFoundScreen-BBj2rX_R.js";import{a as I}from"./sentry-BTyPPF0t.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.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]="808a9ff1-63b3-4c4d-a66e-1c2c94840d1d",e._sentryDebugIdIdentifier="sentry-dbid-808a9ff1-63b3-4c4d-a66e-1c2c94840d1d")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,8 +6,8 @@ import{j as t}from"./liveblocks-B381bPI5.js";import{l as S,k as x,j as C,u as y,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(de);function F(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
9
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(z(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(re);function F(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const ze=m.div`
11
11
  display: flex;
12
12
  height: 100vh;
13
13
  width: 100%;
@@ -15,8 +15,8 @@ import{j as t}from"./liveblocks-B381bPI5.js";import{l as S,k as x,j as C,u as y,
15
15
  flex-direction: column;
16
16
  align-items: center;
17
17
  background-color: ${e=>e.theme.colors.grey4};
18
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,De=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:D(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Ae();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=Pe(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function ze({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(De,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const Ae=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
18
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Be=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:B(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Ae();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=Pe(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function De({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(ze,{windowSize:o,children:t.jsx(Be,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const Ae=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Ee=m.div`
20
20
  display: flex;
21
21
  height: 100%;
22
22
  width: 100%;
@@ -24,8 +24,8 @@ import{j as t}from"./liveblocks-B381bPI5.js";import{l as S,k as x,j as C,u as y,
24
24
  flex-direction: column;
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(T({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
27
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Ne=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(z(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:r}=i;e(T({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),r=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}})(pe);function Le(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ee,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -33,40 +33,40 @@ import{j as t}from"./liveblocks-B381bPI5.js";import{l as S,k as x,j as C,u as y,
33
33
  flex-direction: column;
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Te=x(function(e){const a=k(e),n=v(e),o=D(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},He=m(ke)`
38
- width: ${r.sp4};
39
- height: ${r.sp4};
40
- margin-bottom: ${r.sp3};
41
- margin-top: ${r.sp3};
42
- margin-left: ${r.sp8};
36
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Te=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(z(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:r}=i;e(se({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),r=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}})(xe);function Ge(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},He=m(ke)`
38
+ width: ${d.sp4};
39
+ height: ${d.sp4};
40
+ margin-bottom: ${d.sp3};
41
+ margin-top: ${d.sp3};
42
+ margin-left: ${d.sp8};
43
43
  cursor: pointer;
44
44
  position: absolute;
45
45
  color: ${e=>e.theme.colors.brandColorJade};
46
- `,Me=m.div`
46
+ `,Ke=m.div`
47
47
  display: flex;
48
48
  height: 100vh;
49
49
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
50
  width: 100vw;
51
51
  overflow-y: scroll;
52
52
  background-color: ${e=>e.theme.colors.grey4};
53
- `,Ve=m.div`
53
+ `,Me=m.div`
54
54
  display: flex;
55
55
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
56
  flex-direction: column;
57
57
  width: ${e=>`${Je.containerWidth.value(e.windowSize)}%`};
58
58
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
- padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,_e=m.div`
59
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
61
+ `,Ve=m.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
65
65
  justify-content: center;
66
- padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
66
+ padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
67
67
  height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
68
  overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,Ke=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),d=i.get("token"),M=n.pathname.includes("address"),w=g(),V=ge(),z=fe(),b=we(),_=()=>{V.toggle()},K=E(u=>k(u)),W=E(u=>v(u)),{authParams:U,fetchState:c,billAttachment:q,billFetchState:A,companyName:R,currencySymbol:Y,amount:O}=K,{tenantId:P,userId:L,sessionId:N}=U,{fetchState:Z,internationalBankAccountCreateStatus:Q}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&a(le(s,o,d))},[b,c,s,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(L,N,P),l!=null&&a(re(l)))},[c,b,L,N,P,l,a]),c==="Error"?t.jsx(f,{}):Z==="Completed"||Q.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:z.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${z.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&A==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",s??"",R,l??"",We(n.pathname),Y,O))(u)}),t.jsxs(Me,{windowSize:w,children:[w!=="small"?t.jsx(He,{onClick:_}):null,t.jsx(_e,{windowSize:w,isAddressPage:M,children:A==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(Ke,{file:q,type:"bill"})}),t.jsx(Ve,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Ue,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(ze,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
72
+ `,_e=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),r=i.get("token"),K=n.pathname.includes("address"),w=g(),M=ge(),D=fe(),b=we(),V=()=>{M.toggle()},_=L(u=>k(u)),W=L(u=>v(u)),{authParams:U,fetchState:c,billAttachment:q,billFetchState:A,companyName:R,currencySymbol:O,amount:Q}=_,{tenantId:P,userId:E,sessionId:N}=U,{fetchState:X,internationalBankAccountCreateStatus:Y}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&r!=null&&a(le(s,o,r))},[b,c,s,o,r,a]),I.useEffect(()=>{b&&c==="Completed"&&($(E,N,P),l!=null&&a(de(l)))},[c,b,E,N,P,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${D.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&A==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",R,l??"",We(n.pathname),O,Q))(u)}),t.jsxs(Ke,{windowSize:w,children:[w!=="small"?t.jsx(He,{onClick:V}):null,t.jsx(Ve,{windowSize:w,isAddressPage:K,children:A==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(_e,{file:q,type:"bill"})}),t.jsx(Me,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return t.jsx($e,{})}function rt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Ue,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(De,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Le,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{rt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-Hyy2O23M.js";import{a as f}from"./sentry-BTyPPF0t.js";import{h as J,u as w,j as O,q as _,g as l,N as T}from"./core-D1cXuJMi.js";import{z as r,m as M,D as P,e as V,d as A,f as N,s as q,T as R,g as Q}from"./index-Cc13Ni3u.js";import{eQ as W,Jk as $,Ju as B,Jl as G,eR as H,fk as K,Jq as X,fJ as Y,cU as Z,Jv as ee,Jw as te}from"./zeni-epic-state-CbUjX_b3.js";import{n as ne}from"./mui-B2prtfNk.js";import{u as se}from"./useDeviceId-D81NtSvK.js";import{f as ae}from"./analyticsHelper-ClnSplSs.js";import{t as ie}from"./getLocaleForTenant-BVN8Zhv2.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="81081f06-0475-452b-8bfa-ef656e26ea34",t._sentryDebugIdIdentifier="sentry-dbid-81081f06-0475-452b-8bfa-ef656e26ea34")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=J(),a=w(),m=O(),[b]=_(),n=b.get("token"),p=b.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>W(e)),k=l(e=>$(e)),E=r.getSignedInUser(),v=M().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(G(k.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=Q();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,y,s,o,k,v,a.state,t]);const U=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(q,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{De as default};
@@ -1 +1 @@
1
- import{j as P}from"./liveblocks-B381bPI5.js";import{a as c}from"./sentry-N_eviIZg.js";import{h as be,g as s,l as qe,u as Ke,j as ea,i as M}from"./core-BZAtj_dP.js";import{eQ as he,eX as aa,eY as Se,eS as ta,bn as na,f5 as sa,eZ as oa,e_ as ia,f0 as ra,f3 as da,fd as la,f4 as g,f7 as ca,f8 as ue,fb as ua,f9 as fa,fa as ma,fc as pa,cJ as ba,ff as ha,cP as Sa,bv as ga,eP as Ea,fk as ka,fl as Ca,fj as ya}from"./zeni-epic-state-BYztznIU.js";import{a3 as Ia,a4 as Ta,v as wa,y as _a,z as k,Z as Aa,a5 as Fa,T as Da,w as va,u as $a,S as r,a6 as Ba,a7 as Ga,d as xa,a as Ma,a8 as Ra,Y as Na,a9 as Pa,aa as Ua,ab as fe,ac as me,L as Va,ad as Oa,ae as pe,e as R,r as _,W as ja,af as N,ag as La}from"./index-l0jEAtpj.js";import{D as Ya}from"./mui-Ded5Lnjo.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="e709cffe-d01d-4a4f-adde-9e0dcc01b75a",m._sentryDebugIdIdentifier="sentry-dbid-e709cffe-d01d-4a4f-adde-9e0dcc01b75a")}catch{}})();const za=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=qe(),t=Ke(),C=wa(),o=ea(),U=ta(),p=be(),{useFeatureGate:i}=_a(),V=k.getSignedInUser(),A=na(V),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),O=s(e=>sa(e)),j=O.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,Y=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:we}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),_e=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabledV2),Q=J||W&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ge}=i(r.isTreasuryEnabled),{isFeatureEnabled:xe}=i(r.isTaskManagerCustomerUserAccessEnabled),Me=A||!A&&xe,Re=n.company!=null&&la(n.company),w=Ge&&Re,Ne=s(e=>g(e).totalUnreadCount),Pe=s(e=>g(e).reducedFetchCountState),X=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=Ga();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&U.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Pe,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),z===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const je=xa(),oe=s(e=>fa(e,S,h,J,W,w).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||Y&&(ie==="Completed"||ie==="Error")||!D&&!Y?void 0:"disabled",Ye=c.useMemo(()=>pa(n.userRole),[n.userRole]),ze=ba(Ye),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Ma(),We=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[w,de,le,t.pathname,a]),[Je,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Qe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Xe=Pa(Qe);return P.jsx(Ya,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:P.jsx(Ua,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?_e:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:we,isVendorsTabVisible:ze,isZeniAccountEnabled:z,isChargeCardEnabled:Te,isTreasuryEnabled:w,treasuryYieldPercentage:Xe,isTreasuryPopupVisible:Je,isNotificationsTabVisible:He,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:Q&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=X===0&&q>0?"notifications/comments":"notifications/tasks";me(t)&&(e=X===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=_(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=_(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=_(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Oa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Me,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),qa=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return P.jsx(za,{...m,...t})};export{qa as M};
1
+ import{j as P}from"./liveblocks-Hyy2O23M.js";import{a as c}from"./sentry-BTyPPF0t.js";import{h as pe,g as s,l as Qe,u as Xe,j as ea,i as R}from"./core-D1cXuJMi.js";import{eQ as he,eX as aa,eY as Se,eS as ta,bn as na,f5 as sa,eZ as oa,e_ as ia,f0 as ra,f3 as da,fd as la,f4 as g,f7 as ca,f8 as ue,fb as ua,f9 as fa,fa as ma,fc as ba,cJ as pa,ff as ha,cP as Sa,bv as ga,eP as Ea,fk as ka,fl as Ca,fj as ya}from"./zeni-epic-state-CbUjX_b3.js";import{a3 as Ia,a4 as Ta,n as _a,C as wa,z as k,K as Aa,a5 as Fa,R as Da,q as va,u as $a,A as r,a6 as Ba,a7 as Ga,c as xa,a as Ra,a8 as Ma,Y as Na,a9 as Pa,aa as Ua,ab as fe,ac as me,L as Va,ad as Oa,ae as be,d as M,j as w,W as ja,af as N,ag as La}from"./index-Cc13Ni3u.js";import{D as Ya}from"./mui-B2prtfNk.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="0ef66ced-6bb0-45df-b585-a6533e921fd6",m._sentryDebugIdIdentifier="sentry-dbid-0ef66ced-6bb0-45df-b585-a6533e921fd6")}catch{}})();const za=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Qe(),t=Xe(),C=_a(),o=ea(),U=ta(),b=pe(),{useFeatureGate:i}=wa(),V=k.getSignedInUser(),A=na(V),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),O=s(e=>sa(e)),j=O.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,Y=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:z}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:_e}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&b(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:q}=i(r.isExpenseAutomationEnabledV2),J=q||W&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ge}=i(r.isTreasuryEnabled),{isFeatureEnabled:xe}=i(r.isTaskManagerCustomerUserAccessEnabled),Re=A||!A&&xe,Me=n.company!=null&&la(n.company),_=Ge&&Me,Ne=s(e=>g(e).totalUnreadCount),Pe=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=Ga();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&U.tenantId!=null&&b(ca("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||b(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(b(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),b(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Oe={fetchStatus:Pe,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),z===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),J===!1&&S.push("expense_automation_card");const je=xa(),oe=s(e=>fa(e,S,h,q,W,_).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||Y&&(ie==="Completed"||ie==="Error")||!D&&!Y?void 0:"disabled",Ye=c.useMemo(()=>ba(n.userRole),[n.userRole]),ze=pa(Ye),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Ra(),We=re&&Ma(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>_&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[_,de,le,t.pathname,a]),[qe,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Je=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Ke=Pa(Je);return P.jsx(Ya,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:P.jsx(Ua,{signedInUser:V,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:_e,isVendorsTabVisible:ze,isZeniAccountEnabled:z,isChargeCardEnabled:Te,isTreasuryEnabled:_,treasuryYieldPercentage:Ke,isTreasuryPopupVisible:qe,isNotificationsTabVisible:He,notificationCountDetails:Oe,isExpenseAutomationEnabledForUser:J&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(t)&&(e=K===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=w(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=w(t.state?.pathnameStackToGoBack,t.pathname);return M.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=w(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,p=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&M.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),p&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=La(e.type);be(e.type)?(j!=null&&b(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Va.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let p=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Oa(l)?p+="settings/my_profile":be(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(b(ka(e.tenantId)),b(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;M.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:We,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{b(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Re,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),Qa=m=>{const d=pe(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return P.jsx(za,{...m,...t})};export{Qa as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-Hyy2O23M.js";import{j as r,k as i}from"./core-D1cXuJMi.js";import{O as n}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.js";import"./sentry-BTyPPF0t.js";import"./zeni-epic-state-CbUjX_b3.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="6abb37d2-952f-4fd9-932f-e89903f793e2",o._sentryDebugIdIdentifier="sentry-dbid-6abb37d2-952f-4fd9-932f-e89903f793e2")}catch{}})();const f=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(f,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-B381bPI5.js";import lt from"./NotFoundScreen-B-5op0jc.js";import{a as k}from"./sentry-N_eviIZg.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-BZAtj_dP.js";import{cr as St,eZ as z,eQ as H,fc as bt,f4 as b,Pl as Z,f8 as d,eY as y,qC as M,vX as It,Pm as Ct,eX as Tt,ff as yt,qH as Et,Pn as $,bq as F,gO as x,qL as Y,Po as _t,cC as At,cw as Nt}from"./zeni-epic-state-BYztznIU.js";import{U as Bt,z as wt,y as xt,S as Pt,ct as Rt,r as N,a3 as vt,cu as Dt,a4 as Ut,k as Gt}from"./index-l0jEAtpj.js";import"./mui-Ded5Lnjo.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-DCgVyLJS.js";import{c as Ft}from"./useFetchSuggestedQuestionsWhenReady-DhDRKto8.js";import"./recharts-CxMFTRT8.js";import"./analytics-CRD_Mcgv.js";import"./plaid-CigRTw2w.js";import"./dnd-CYktLE_1.js";import"./stripe-DMRn4zHo.js";import"./lottie-M6FrlJUx.js";import"./lexical-CtWr-ANo.js";import"./pdf-CXxzr_OL.js";import"./utils-DvZFRPln.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="a91df91f-4758-4f17-9080-14a6d2ef2992",t._sentryDebugIdIdentifier="sentry-dbid-a91df91f-4758-4f17-9080-14a6d2ef2992")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=z(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Z(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Y("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Dt)),qt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>z(e)),o=S(e=>H(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Ft({isDataReady:!0});const J=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),q=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),K=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:V,isLoading:L,fetchMore:W,isFetchingMore:O,hasFetchedAll:Q}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(q!==i&&i!=null&&s(Z(i)),i==null){const e=`../${q}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{K.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(E===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[E,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=E||D===!0||C!==!0||E||D===!0||C!==!0;k.useEffect(()=>{U&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&L===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),_=p.map(f=>f.id),it=p.map(f=>{const G=V.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(O||Q===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,D,O,C,Q,L,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];R==="all"?_.push("read","unread"):R!=="mentions"&&_.push(R),s(M("task_manager",T,_,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:J,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return A.jsxs(gt,{children:[A.jsx(X,{path:"/:selectedTab",element:A.jsx(qt,{})}),A.jsx(X,{path:"*",element:A.jsx(lt,{})})]})}export{ie as default};
1
+ import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-Hyy2O23M.js";import lt from"./NotFoundScreen-BBj2rX_R.js";import{a as k}from"./sentry-BTyPPF0t.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as W}from"./core-D1cXuJMi.js";import{cr as St,eZ as Q,eQ as Z,fc as bt,f4 as b,PR as H,f8 as d,eY as y,qX as M,wk as It,PS as Ct,eX as Tt,ff as yt,r0 as At,PT as $,bq as F,gO as x,r4 as Y,PU as Et,cC as _t,cw as Nt}from"./zeni-epic-state-CbUjX_b3.js";import{U as wt,z as Bt,C as xt,A as Pt,ct as Rt,j as N,a3 as Ut,cu as Dt,a4 as vt,p as Gt}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-CQ5wXGV2.js";import{c as Ft}from"./useFetchSuggestedQuestionsWhenReady-C8wykHii.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="da421a33-dfee-4d8c-81f2-20f66f8fa532",t._sentryDebugIdIdentifier="sentry-dbid-da421a33-dfee-4d8c-81f2-20f66f8fa532")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Z(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:w,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(w(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(H(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Y("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(w(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,w).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Ut(Dt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=wt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[w,P]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>Z(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Ft({isDataReady:!0});const J=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),K=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:B,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:X,fetchMore:z,isFetchingMore:L,hasFetchedAll:O}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(H(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{K.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const v=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{v&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):v||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[v,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&w===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&X===!1&&B!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(L||O===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,L,C,O,X,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(vt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s(M("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:J,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(W,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(W,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
@@ -0,0 +1 @@
1
+ import{j as m}from"./liveblocks-Hyy2O23M.js";import{a as r}from"./sentry-BTyPPF0t.js";import{h as A,u as J,g as o,N as M}from"./core-D1cXuJMi.js";import{JJ as C,eQ as P,f3 as j,JK as x,JL as z,JM as D,JN as L,mS as N,IF as R}from"./zeni-epic-state-CbUjX_b3.js";import{z as h,M as I}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="64d0a7f3-d8fa-4333-b8cc-eb70741e6f3c",n._sentryDebugIdIdentifier="sentry-dbid-64d0a7f3-d8fa-4333-b8cc-eb70741e6f3c")}catch{}})();function ee(){const n=A(),s=J(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>P(e)),l=o(e=>j(e)),d=o(e=>e.tenantState.fetchState),y=o(x),S=o(z),c=o(D),[b,v]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(L())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(N(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=b??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:v,approveError:E??S,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(R(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(M,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-Hyy2O23M.js";import{j as Y,h as z,u as Q,l as Z,g as d,k as H,n as J,o as I}from"./core-D1cXuJMi.js";import{eQ as v,qL as P,qj as X,Kf as O,qe as T,bv as ee,bn as ae,bT as te,qf as se,Kg as oe,K1 as C,dE as re,uh as ne,Kh as ce,uE as ie,eW as le,eU as de}from"./zeni-epic-state-CbUjX_b3.js";import{z as me,U as fe,c as pe,C as q,A as M,x as ue,d as $,al as he,j as be}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.js";import ge from"./NotFoundScreen-BBj2rX_R.js";import{F as Fe}from"./FeaturePreviewScreen-DKtIkE5j.js";import{a as b}from"./sentry-BTyPPF0t.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-CQ5wXGV2.js";import{c as Ce}from"./useFetchSuggestedQuestionsWhenReady-C8wykHii.js";import{u as Te}from"./useInitialThreadRequest-DTnvA37x.js";import{t as Se}from"./routePaths-CYWO_4aN.js";import{M as ye}from"./MobileAppDrawer-DrIh5jJg.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="a8654c05-7b16-48cf-bec6-d1ccbe07c8b0",s._sentryDebugIdIdentifier="sentry-dbid-a8654c05-7b16-48cf-bec6-d1ccbe07c8b0")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=H(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=be(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function R(){const s=Y(),e=z(),a=Q(),{forecastId:o,tenantEmailDomain:r}=Z(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),y=d(t=>v(t)),w=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();Ce({isDataReady:l});const{isAiCfoAccessEnabled:W,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,U)=>L!=null?f.forecasts.findIndex(F=>F.id===L):U!=null?f.forecasts.findIndex(F=>F.id===U):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(O(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&g&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,P,T,g]);const j=pe(),N=j?.loggedInUserRole!=null&&ee(j.loggedInUserRole),{useFeatureGate:_}=q(),{isFeatureEnabled:D}=_(M.isReportsCommentingEnabled),G=Te(D?y?.companyId:void 0,{clearParams:l&&m}),[K,V]=b.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:K,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:w,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:N,isAiCfoAccessEnabled:W,onAskAiCfoClick:B,isReportsCommentingEnabled:D,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d(c=>v(c)),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Fe,{}):n.jsxs(J,{children:[n.jsx(I,{path:"/",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(R,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(ge,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-Hyy2O23M.js";import{Ka as te,eQ as q,jC as W,eW as Y,eU as ne,HC as N,JQ as oe,tl as Ee,Kb as Q,t9 as ke,tu as Ie,to as ie,td as re,ts as Pe,tp as je,Kc as le,v3 as Te,Kd as Le,fz as ve,Ke as $,ti as de,tg as ce,tx as Fe,c2 as Ae}from"./zeni-epic-state-CbUjX_b3.js";import{K as pe,C as X,A as E,z as G,a6 as ue,I as me,ah as ge,ai as Re,E as he,o as R,J as fe,D as Ce,aj as Oe,U as Ve,x as Ue,d as be,f as Be,j as Ze,ak as Ke,c as $e}from"./index-Cc13Ni3u.js";import{D as ye,n as M,S as we}from"./mui-B2prtfNk.js";import ae from"./NotFoundScreen-BBj2rX_R.js";import{a as r}from"./sentry-BTyPPF0t.js";import{h as ee,l as ze,g as m,j as He,u as We,k as Ge,n as se,o as K}from"./core-D1cXuJMi.js";import{u as Me}from"./useAskAiCfoHostNavButtonProps-CQ5wXGV2.js";import{c as _e}from"./useFetchSuggestedQuestionsWhenReady-C8wykHii.js";import{M as Je}from"./MobileAppDrawer-DrIh5jJg.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.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]="6eb0c9d3-c463-4e18-a31e-336b880656f5",a._sentryDebugIdIdentifier="sentry-dbid-6eb0c9d3-c463-4e18-a31e-336b880656f5")}catch{}})();const Qe={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>q(e)),D=m(e=>W(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Y(k,u),L=ne(u),v=N(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(Q()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Ye,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:z.discardTitle}),descriptionComponent:s.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Ye=M(we)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,Se=M(fe.H6Regular)`
6
+ margin-top: ${R.sp7};
7
+ padding-left: ${R.sp8};
8
+ padding-right: ${R.sp8};
9
+ color: ${a=>a.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,De=M(fe.LargeRegularSp)`
12
+ color: ${a=>a.theme.colors.hero};
13
+ padding-left: ${R.sp8};
14
+ padding-right: ${R.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${R.sp4};
17
+ white-space: pre-line;
18
+ `,Ne={overlayWidth:new he(100,100,48)},H=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>q(i)),u=m(i=>W(i)),{useFeatureGate:D}=X(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=Y(f,d),P=ne(d),L=N(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(Q())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(Q()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:H.discardTitle}),descriptionComponent:s.jsx(De,{children:H.discardDescription}),primaryButtonText:H.discard,secondaryButtonText:H.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=M(we)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,aa=Ge(function(a,t){const l=le(a),n=G.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:W(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a($({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a($({searchText:o}))}}}})(Ke);function J({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=He(),n=ee(),g=We(),{areTenantIdsInSync:o}=Ve(),y=G.getSignedInUser(),h=m(e=>q(e)),{useFeatureGate:p}=X(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>W(e)),I=!Y(O,h)&&V,w=N(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=Me({mobileExploreReferrer:"People"}),c=m(e=>le(e));_e({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n($({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),L(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n($({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Ue,{analytics:be,onLoad:e=>e.trackPageLoaded(Be.Event.members)}):null,f===!0?s.jsx(Xe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(Je,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,_)=>{n($({sortKey:e,sortOrder:_}))},onRowClick:e=>{const _=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=Ze(g.state?.pathnameStackToGoBack,g.pathname);l(_,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function Sa(){const a=$e();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx(K,{path:"/",element:s.jsx(J,{})}),s.jsx(K,{path:"new",element:s.jsx(J,{isInvitePeopleDrawerOpen:!0})}),s.jsx(K,{path:":userId/edit",element:s.jsx(J,{isEditPeopleDrawerOpen:!0})}),s.jsx(K,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx(K,{path:"*",element:s.jsx(ae,{})})})}export{Sa as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-Hyy2O23M.js";import E from"./NotFoundScreen-BBj2rX_R.js";import{a as r}from"./sentry-BTyPPF0t.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as V,o as b}from"./core-D1cXuJMi.js";import{eQ as z,PV as h,bo as F,bn as N,hi as B,gO as Q}from"./zeni-epic-state-CbUjX_b3.js";import{n as $,z as I,cv as q}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-CQ5wXGV2.js";import{c as H}from"./useFetchSuggestedQuestionsWhenReady-C8wykHii.js";import{M as J}from"./MobileAppDrawer-DrIh5jJg.js";import"./recharts-CrZf7bKF.js";import"./analytics-BE9oUBzD.js";import"./plaid-4w70Yh4I.js";import"./dnd-DbPPTppj.js";import"./stripe-DMRn4zHo.js";import"./lottie-qu8VyEpw.js";import"./lexical-Du70nM1B.js";import"./pdf-Cvwxd6W6.js";import"./utils-C_-saZ2j.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]="ab9c92eb-84b5-45b0-9d54-aea252caf08a",e._sentryDebugIdIdentifier="sentry-dbid-ab9c92eb-84b5-45b0-9d54-aea252caf08a")}catch{}})();const K=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(q),L=()=>{const e=_(),t=v(),c=$(),o=p(a=>z(a)),{aggregatedReportViewState:n}=p(a=>h(a)),{tenantEmailDomain:u}=M(),f=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=S||k||x,l=r.useCallback((a,i,T)=>{f(B({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(f(Q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),m.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return H({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:u,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${u}/dashboard`,replace:!0})};function pe(){return s.jsxs(V,{children:[s.jsx(b,{path:"*",element:s.jsx(L,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-N_eviIZg.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-BTyPPF0t.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-B381bPI5.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-N_eviIZg.js";import{L as dt,bT as Tc,eQ as Ac,IS as Rc,Jk as kl,c2 as Tl,fk as Al,fl as Rl}from"./zeni-epic-state-BYztznIU.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-DvZFRPln.js";import{r as un}from"./empty-BtWrOCqn.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-BOf1Mpdf.js";import{r as Gl}from"./index-rFU-5LRD.js";import{r as zl}from"./index-DvtTYnxY.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-BZAtj_dP.js";import{u as Kl,z as Pc,L as Wl,K as Jl,M as Xl,j as Ql,e as tf}from"./index-l0jEAtpj.js";import"./mui-Ded5Lnjo.js";import{d as Pe}from"./decodeURIComponentSafe-K7ukqtFq.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="8d40d024-db4d-4e51-ae03-f9d46a7b3f27",t._sentryDebugIdIdentifier="sentry-dbid-8d40d024-db4d-4e51-ae03-f9d46a7b3f27")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-Hyy2O23M.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BTyPPF0t.js";import{L as dt,bT as Tc,eQ as Ac,Jk as Rc,JO as kl,c2 as Tl,fk as Al,fl as Rl}from"./zeni-epic-state-CbUjX_b3.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-C_-saZ2j.js";import{r as un}from"./empty-CfqAKA3M.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-D1w2Ub95.js";import{r as Gl}from"./index-n6IrYjfy.js";import{r as zl}from"./index-3aBFjHPN.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-D1cXuJMi.js";import{u as Kl,z as Pc,L as Wl,_ as Jl,N as Xl,h as Ql,d as tf}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.js";import{d as Pe}from"./decodeURIComponentSafe-Did0aZyt.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="a142790a-3073-4462-9ce1-7cbe4992225f",t._sentryDebugIdIdentifier="sentry-dbid-a142790a-3073-4462-9ce1-7cbe4992225f")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,5 +1,5 @@
1
- import{j as s}from"./liveblocks-B381bPI5.js";import{a as o}from"./sentry-N_eviIZg.js";import{g as f,j as F,h as _,u as H,k as M}from"./core-BZAtj_dP.js";import{m as V,Z as W,z as R,b3 as U,F as N,U as $,A as z,e as l,g as K,a3 as Q,b4 as Z}from"./index-l0jEAtpj.js";import{e_ as q,eQ as G,Mc as P,Md as J,tK as X,tA as g,f0 as Y,bO as ee,tF as re,Me as ae}from"./zeni-epic-state-BYztznIU.js";import{D as ne,e as te,n as se,S as oe}from"./mui-Ded5Lnjo.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-DCgVyLJS.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-DhDRKto8.js";import{M as de}from"./MobileAppDrawer-CQBNZVi-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="f65240db-b59c-4436-be8e-5373be5d0629",e._sentryDebugIdIdentifier="sentry-dbid-f65240db-b59c-4436-be8e-5373be5d0629")}catch{}})();const ce={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=V(),n=W();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>q(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
1
+ import{j as s}from"./liveblocks-Hyy2O23M.js";import{a as o}from"./sentry-BTyPPF0t.js";import{g as f,j as H,h as F,u as M,k as V}from"./core-D1cXuJMi.js";import{m as W,K as _,z as R,b3 as U,E as N,U as $,x as z,d as l,f as G,a3 as Q,b4 as Z}from"./index-Cc13Ni3u.js";import{e_ as K,eQ as q,MF as P,MG as J,u7 as X,tZ as g,f0 as Y,bO as ee,u2 as re,MH as ae}from"./zeni-epic-state-CbUjX_b3.js";import{D as ne,e as te,n as se,S as oe}from"./mui-B2prtfNk.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-CQ5wXGV2.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-C8wykHii.js";import{M as de}from"./MobileAppDrawer-DrIh5jJg.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="fecc896d-21b7-4e11-ab00-25e7d0824e1c",e._sentryDebugIdIdentifier="sentry-dbid-fecc896d-21b7-4e11-ab00-25e7d0824e1c")}catch{}})();const ce={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=W(),n=_();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>K(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,I="refer-and-earn-status-update",pe=M(function(e){const r=P(e),a=e.referralViewState.rewardsPlanFetchState,n=ee([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ae({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(Q(Z));function Se({isReferralDrawerOpen:e}){const r=F(),a=_(),n=H(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,b]=o.useState(!1),p=R.getSignedInUser(),m=f(t=>G(t)),C=f(t=>P(t)),h=C.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([C,w]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{m?.rewardsLastViewedTime==null&&D===!1&&(a(X()),E(!0))},[]),o.useEffect(()=>{!i&&h==="Not-Started"&&c&&(u(!0),a(g(!0)))},[h,a,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),a(Y(!0)))},[w,a,c]),o.useEffect(()=>{b(e!=null&&e===!0)},[e]);const[A,j]=o.useState(!1),v=t=>{j(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:L}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const T={events:p?.userId!=null?[`private-encrypted-${p.userId}.${I}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(K.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:A,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{b(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:r,currentTenant:m,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:L,...T})]})}export{Se as R};
5
+ `,I="refer-and-earn-status-update",pe=V(function(e){const r=P(e),a=e.referralViewState.rewardsPlanFetchState,n=ee([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ae({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(Q(Z));function Se({isReferralDrawerOpen:e}){const r=H(),a=F(),n=M(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,m]=o.useState(!1),p=R.getSignedInUser(),C=f(t=>q(t)),h=f(t=>P(t)),b=h.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([h,w]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(a(X()),E(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&c&&(u(!0),a(g(!0)))},[b,a,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),a(Y(!0)))},[w,a,c]),o.useEffect(()=>{m(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),v=t=>{A(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:L}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const T={events:p?.userId!=null?[`private-encrypted-${p.userId}.${I}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(G.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{m(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:r,currentTenant:C,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:L,...T})]})}export{Se as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-Hyy2O23M.js";import x from"./NotFoundScreen-BBj2rX_R.js";import{a as p}from"./sentry-BTyPPF0t.js";import{j as C,u as I,h as D,g as l,N as A,k as E,n as k,o as u}from"./core-D1cXuJMi.js";import{eQ as T,Nz as g,NP as S,D4 as V,Cd as N,D3 as d,CW as U,O3 as _}from"./zeni-epic-state-CbUjX_b3.js";import{m as O,z as W,B as $,a3 as z,bJ as B,ac as P}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-BbYEUJEU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="05d80ccf-e6ae-4b7d-9586-ae9f9cd9936e",e._sentryDebugIdIdentifier="sentry-dbid-05d80ccf-e6ae-4b7d-9586-ae9f9cd9936e")}catch{}})();const m="reimbursement-approval-rule-update",J=E(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:c}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(_(!1))},onBackClick:()=>{P(c)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(d(s)),a(`./${s}/edit`)):(e(d()),a("./new"))}}})(z(B)),Q=()=>{const e=C(),r=I(),a=D(),[c,s]=p.useState(!1),[f,y]=p.useState(!1),b=l(n=>n.remiSetupApproverViewState.fetchState),o=l(n=>T(n)),w=O(),i=l(n=>g(n)),h=l(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{c||b!=="Not-Started"||(s(!0),a(N(!0)))},[c,b,a]),W.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(A,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(u,{path:"/",element:t.jsx(Q,{})}),t.jsx(u,{path:"/new",element:t.jsx(v,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-B381bPI5.js";import{a as y}from"./sentry-N_eviIZg.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-BZAtj_dP.js";import{Nm as R,N6 as E,CA as x,CJ as _,CH as S,CI as h,Nn as k}from"./zeni-epic-state-BYztznIU.js";import{z as B,m as N,x as V,bA as j,ac as F}from"./index-l0jEAtpj.js";import"./mui-Ded5Lnjo.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]="6212639a-fc28-4d90-b500-c41ea2b0c885",e._sentryDebugIdIdentifier="sentry-dbid-6212639a-fc28-4d90-b500-c41ea2b0c885")}catch{}})();function O(e){return k(e)==null}const $=U(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=F(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const m=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),v=D.concat(I);m.push({action:u.stepType.selectedOption,actors:v,operator:v.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m};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:c(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:c(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 G(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!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(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,O as i};
1
+ import{j as g}from"./liveblocks-Hyy2O23M.js";import{a as y}from"./sentry-BTyPPF0t.js";import{j as A,h as w,u as T,l as U,g as b,k as E}from"./core-D1cXuJMi.js";import{NP as D,Nz as C,CZ as x,D6 as _,D4 as S,D5 as h,NQ as B}from"./zeni-epic-state-CbUjX_b3.js";import{z as k,m as N,B as V,bA as j,ac as F}from"./index-Cc13Ni3u.js";import"./mui-B2prtfNk.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]="5b491109-e583-4a5f-8033-58b73a8f9f6a",e._sentryDebugIdIdentifier="sentry-dbid-5b491109-e583-4a5f-8033-58b73a8f9f6a")}catch{}})();function O(e){return B(e)==null}const P=E(function(e,a){const t=D(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=F(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const f=[];return p.forEach(c=>{const R=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=!!O(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=R.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(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 G(){const e=A(),a=w(),t=T(),{approvalRuleId:s}=U(),n=k.getSignedInUser(),l=N(),r=b(p=>D(p)),i=b(p=>C(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(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(P,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,O as i};