@zeniai/web-app-ui 5.0.61-qa → 5.0.62-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/AddressRoutes-CWbtPs0T.js +1 -0
  2. package/dist/assets/AddressScreen-BeHKG8v1.js +9 -0
  3. package/dist/assets/{AiCfoScreen-BP9Ft687.js → AiCfoScreen-BJfPMTeD.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-tYr_9OWR.js → BillPayApprovalRoutes-72raP4Au.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DmhKosIo.js → BillPayRoutes-CEWbGQhV.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DHwpyl1f.js → BusinessVerificationPageScreen-BUCm7Odf.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-DdDzkKLF.js → ChargeCardRoutes-CGWte3py.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-BK2OTKJu.js → CompanyPassportScreen-BmSdom0e.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-k86NOnxb.js → ConnectionAuthScreen-DF0fkXNR.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen--LKCq1mD.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-ibn4fZkx.js → CustomerOnboardingRoutes-COxgmIX3.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DsyeD2-B.js → DashboardRoutes-B9AUZ_Md.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-Dn3Q39m4.js → DefaultTenantHome-Bce_0IOJ.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-D6Fv4KmF.js → DomesticWireDetailScreen-BVFVWlSA.js} +3 -3
  15. package/dist/assets/DrawerScreen-BWViotCB.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-B6fpxmHW.js → EntityDetailRoutes-CKRWkL2F.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-hPdcTllf.js → ExpenseAutomationRoutes-DDrxLrQX.js} +1 -1
  18. package/dist/assets/FeaturePreviewScreen-Bu3Nmz6L.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-Cdzcjinn.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-XzPOaXDf.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-BsEeVHGJ.js → MobileAppDrawer-BuQb2buy.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DXPtR234.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CCNPEsKp.js → NotificationRoutes-DQOd5pN1.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-wJ4pN9t1.js → PandLWithForecastRoutes-Ch0vhwLL.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-uXI358fF.js → PeopleRoutes-DxzAopRH.js} +9 -9
  26. package/dist/assets/{PerformanceRoutes-DOyVY_Ow.js → PerformanceRoutes-BOLxnqNA.js} +1 -1
  27. package/dist/assets/{Preview-CIDoApcd.js → Preview-C1kzMAT1.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-BH7qNWPW.js → QBOConnectionScreen-DowWnT4I.js} +1 -1
  29. package/dist/assets/ReferralListScreen-Dj04SxiV.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-Dce13zkV.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CEnbrTbv.js → ReimbursementApprovalRuleDetailScreen-CErT0hoJ.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-BT2-7Gsa.js → ReimbursementRoutes-DbOJcy-l.js} +1 -1
  33. package/dist/assets/ReportsRoutes-m8OaVZVD.js +1 -0
  34. package/dist/assets/RewardsRoutes-Bhpz6tDz.js +1 -0
  35. package/dist/assets/ScreenRoutes-D3nR_ZAq.js +2 -0
  36. package/dist/assets/{SettingsRoutes-CLa1lnt-.js → SettingsRoutes-DXnpxjv_.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-CwdMwDRP.js → SetupPagesScreen-RaBTeZ3X.js} +5 -5
  38. package/dist/assets/{SignInScreen-DnvXxvnM.js → SignInScreen-BdxXXdlE.js} +1 -1
  39. package/dist/assets/SignOutScreen-Bpj0-554.js +9 -0
  40. package/dist/assets/TaskListScreen-DucJZ5Tc.js +9 -0
  41. package/dist/assets/TaskRoutes-BauTuLET.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-DkbxIzsT.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-DKG_MhFF.js → TransactionDetailScreen-DB2dMdqL.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-BSDQcv3U.js → TransactionListRoutes-SZ1iphEM.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-AWertsO5.js → TreasuryRoutes-CGEviXlY.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-DW9oOFbY.js → VendorsRoutes-CIeivuDV.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-C2YdpQUX.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-Bu65VebN.js → ZeniAccountRoutes-WZ6oPa1B.js} +1 -1
  49. package/dist/assets/ZeniAccountStatementScreen-BcTdJcif.js +9 -0
  50. package/dist/assets/{accountMappingHelper-C_yfNaYk.js → accountMappingHelper-Bqj2mJfi.js} +1 -1
  51. package/dist/assets/{analytics-BMapadfi.js → analytics-B_uP5uGX.js} +1 -1
  52. package/dist/assets/{analyticsHelper-hJglLz67.js → analyticsHelper-CsFRydiU.js} +1 -1
  53. package/dist/assets/{core-Bycbr_zS.js → core-Cgen4kAj.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-D8oY1hc9.js → decodeURIComponentSafe-DztnZ-A4.js} +1 -1
  55. package/dist/assets/{dnd-Jwp37Hwc.js → dnd-DhFfs1wM.js} +1 -1
  56. package/dist/assets/{empty-BVzRSYkS.js → empty-CfLsUtpF.js} +1 -1
  57. package/dist/assets/{empty-DvEtWNNn.js → empty-Dt-07Rye.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-wwbaO4KU.js → emptyVideoElement-v9g3UWiq.js} +1 -1
  59. package/dist/assets/{epic-C4FCGNFQ.js → epic-lM2FfDOS.js} +1 -1
  60. package/dist/assets/{getLocaleForTenant-hR2ZjLdG.js → getLocaleForTenant-Di1C7dV7.js} +1 -1
  61. package/dist/assets/{index-Co9dF_xb.js → index-BkCX5jRI.js} +1 -1
  62. package/dist/assets/{index-DB8zvt4r.js → index-C_giOD7z.js} +1 -1
  63. package/dist/assets/{index-C5fsf-f7.js → index-CiK_CtQ4.js} +1 -1
  64. package/dist/assets/{index-DmSlLFfZ.js → index-Dprn4SY3.js} +1 -1
  65. package/dist/assets/{index-Bo8i__Uw.js → index-Dwqwe5m-.js} +1 -1
  66. package/dist/assets/{index-D75hXUaQ.js → index-nofE1fwv.js} +2 -2
  67. package/dist/assets/{index-CkPLyKrL.js → index-trlF__w8.js} +12793 -12793
  68. package/dist/assets/{lexical-BFKF8Nqm.js → lexical-DJV7tysr.js} +1 -1
  69. package/dist/assets/{liveblocks-yYJhhlwl.js → liveblocks-CF908iAG.js} +1 -1
  70. package/dist/assets/{lottie-CQftbn5o.js → lottie-Ega9gP0x.js} +1 -1
  71. package/dist/assets/{mui-uwIb-0_u.js → mui-C7dUqSqV.js} +1 -1
  72. package/dist/assets/{pathToGoBack-6NBe70Qs.js → pathToGoBack-C7m35zDG.js} +1 -1
  73. package/dist/assets/{pdf-Clano961.js → pdf-CSmOdS_B.js} +3 -3
  74. package/dist/assets/{pdf-lib-qkfMQ_yu.js → pdf-lib-D5gPNITG.js} +1 -1
  75. package/dist/assets/{plaid-BtVuBiv6.js → plaid-CChs9PMx.js} +1 -1
  76. package/dist/assets/{pusher-CR1v05zD.js → pusher-C5oHaaZM.js} +1 -1
  77. package/dist/assets/{react-BwcG0A5u.js → react-CU9NYGdL.js} +1 -1
  78. package/dist/assets/{react-BjTfXtJu.js → react-CVXgK0Ih.js} +1 -1
  79. package/dist/assets/{react-BSMOFxva.js → react-ClL_vZpV.js} +1 -1
  80. package/dist/assets/{react-B-NPms-H.js → react-CrvQ92fR.js} +1 -1
  81. package/dist/assets/{react-DrnPjRY_.js → react-CsMGsa1f.js} +1 -1
  82. package/dist/assets/{react-D5gy2Tue.js → react-DrZcp68n.js} +1 -1
  83. package/dist/assets/{recharts-DgZ04ot6.js → recharts-Dyhe2tpB.js} +1 -1
  84. package/dist/assets/{routePaths-CMggNZ1T.js → routePaths-CqnfURaJ.js} +1 -1
  85. package/dist/assets/{sentry-CbgVFeom.js → sentry-cfxuOFew.js} +1 -1
  86. package/dist/assets/{url-CACUy1v-.js → url-B1qVva4A.js} +1 -1
  87. package/dist/assets/{url-Bvrri-wo.js → url-DOBNPG6D.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-C7xPewG5.js → useAskAiCfoHostNavButtonProps-C2mAQ-5p.js} +1 -1
  89. package/dist/assets/{useDeviceId-DGCuWe9z.js → useDeviceId-43L8M3To.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-DmtdISaY.js → useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-DBrdowkN.js → useInitialThreadRequest-CME_1dn5.js} +1 -1
  92. package/dist/assets/{utils-CUNvYJ5h.js → utils-DumEze_M.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-VWqgYGxS.js → withTransactionSidePanel-Dq1wepy8.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-CIfm8mou.js → zeni-epic-state-DrGehtra.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-CVfu5Dox.js +0 -1
  98. package/dist/assets/AddressScreen-7k7vjaFG.js +0 -9
  99. package/dist/assets/CustomerOnboardingAuthScreen-DbwBw2uW.js +0 -1
  100. package/dist/assets/DrawerScreen-Dzpv8ixO.js +0 -1
  101. package/dist/assets/FeaturePreviewScreen-CZ4kSWCz.js +0 -1
  102. package/dist/assets/MagicLinkRoutes-Bg0SJwWd.js +0 -72
  103. package/dist/assets/MagicLinkSignInScreen-3waOEQgZ.js +0 -12
  104. package/dist/assets/NotFoundScreen-BnQ9IpWO.js +0 -1
  105. package/dist/assets/ReferralListScreen-CTukyk1g.js +0 -5
  106. package/dist/assets/ReimbursementApprovalRoutes-DcSHObaL.js +0 -1
  107. package/dist/assets/ReportsRoutes-JuhC6wWc.js +0 -1
  108. package/dist/assets/RewardsRoutes-DSOl9Z0M.js +0 -1
  109. package/dist/assets/ScreenRoutes-Ck32XMYo.js +0 -2
  110. package/dist/assets/SignOutScreen-CL2ZVx-I.js +0 -9
  111. package/dist/assets/TaskListScreen-DCK_sYz_.js +0 -9
  112. package/dist/assets/TaskRoutes-BPawNp5H.js +0 -9
  113. package/dist/assets/TransactionDetailRoutes-DNNxQ-Pu.js +0 -1
  114. package/dist/assets/WiseConfirmationScreen-CfuT7R3M.js +0 -12
  115. package/dist/assets/ZeniAccountStatementScreen-D1W40t46.js +0 -9
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-yYJhhlwl.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as lt,n as Kt,o as te}from"./core-Bycbr_zS.js";import{eN as ie,bs as Ue,NZ as ka,eR as be,eS as ye,eT as Se,fO as ze,cq as $e,N_ as Ge,N$ as Ma,sL as ba,jy as ya,O0 as Sa,gC as oa,zd as Xe,zf as za,zg as $a,jo as ut,O1 as Ye,z1 as mt,O2 as Wt,O3 as qt,z4 as Da,O4 as Jt,Mq as _a,qX as Ct,za as Ga,gN as Qt,O5 as pt,O6 as Ze,bq as Xt,O7 as en,fz as wa,fy as Pa,zK as an,fx as Ta,M6 as tn,O8 as ht,cj as ft,cL as nn,Mp as da,Ak as rn,O9 as tt,zW as Fa,Oa as gt,Al as sn,MQ as on,Am as cn,Bg as dn,s5 as ln,Ba as un,zv as bt,zo as mn,Ob as Cn,fQ as pn,zE as yt,zI as St,fP as hn,Oc as fn,A6 as It,Od as gn,Oe as bn,Of as yn,zG as At,zr as Et,z7 as kt,zA as Dt,zy as _t,zC as Sn,ze as nt,Og as wt,Oh as va,zT as Ia,J5 as Pt,cM as Ya,Oi as In,Oj as An,Ok as En,Ol as kn,zQ as Na,Ad as Dn,A9 as _n,zM as wn,Ab as Pn,A1 as Tn,A3 as Fn,Om as Tt,Aj as Ft,GD as vn,On as xn,Oo as Bn,Op as Ln,Oq as vt,Or as On,AG as Un,zV as xt,zP as ca,zU as Rn,Os as jn,Ot as Nn,y_ as Vn,Ou as Bt,Ov as Lt,Ow as Hn,z0 as Mn,y$ as rt,Ox as zn,Oy as $n,Oz as Gn,J1 as Yn,OA as Za,OB as Zn,vB as Ot,k6 as Kn,gD as Wn,AL as qn,OC as Ut,OD as Jn,AM as Qn,OE as Xn,dc as er,sF as ar,AB as tr,Av as Oe,bv as nr,bD as rr,cv as sr,bE as or,Ik as cr}from"./zeni-epic-state-CIfm8mou.js";import{z as X,j as je,a as ce,p as Y,w as Ke,bY as xa,c7 as ir,r as ve,c8 as dr,c9 as lr,q as la,aJ as Fe,s as fe,bf as Ka,ca as ur,C as ua,k as Ba,h as Wa,d as J,D as qa,cb as mr,am as Ja,br as Je,cc as Va,cd as Cr,y as Qa,a1 as pr,ce as hr,ap as Rt,Q as Ha,M as jt,f as Nt,cf as fr,cg as gr,ch as br,ci as yr,cj as Sr,o as Aa,ck as Ir,cl as Ar,cm as Ua,$ as Er,cn as kr,co as Dr,cp as _r,cq as wr,a5 as Pr}from"./index-CkPLyKrL.js";import{n as _e,D as Vt,S as Tr}from"./mui-uwIb-0_u.js";import{a as i}from"./sentry-CbgVFeom.js";import{g as Ce,a as ma,b as Ht,c as Ie,d as Ae,e as Re,f as Ne,A as Fr,h as Xa,P as vr,i as et,s as Qe,j as Mt,k as Me,l as zt,m as xr,n as $t,p as Br,S as st}from"./SetupPagesScreen-CwdMwDRP.js";import La from"./NotFoundScreen-BnQ9IpWO.js";import{M as Ca}from"./MobileAppDrawer-BsEeVHGJ.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-C7xPewG5.js";import{c as Yt}from"./useFetchSuggestedQuestionsWhenReady-DmtdISaY.js";import{v as ot}from"./utils-CUNvYJ5h.js";import{t as Lr}from"./AddressScreen-7k7vjaFG.js";import"./recharts-DgZ04ot6.js";import"./analytics-BMapadfi.js";import"./plaid-BtVuBiv6.js";import"./dnd-Jwp37Hwc.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQftbn5o.js";import"./lexical-BFKF8Nqm.js";import"./pdf-Clano961.js";import"./analyticsHelper-hJglLz67.js";import"./routePaths-CMggNZ1T.js";import"./BusinessVerificationPageScreen-DHwpyl1f.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]="95037bfd-3b2f-476b-b5d7-c2afbcaf9eab",e._sentryDebugIdIdentifier="sentry-dbid-95037bfd-3b2f-476b-b5d7-c2afbcaf9eab")}catch{}})();function Or(){const e=le(),{cardId:t}=ia(),a=ue(),r=X.getSignedInUser(),n=y(Q=>ie(Q)),m=je(),C=Ue(m?.loggedInUserRoleMap),{useFeatureGate:p}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=p(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=p(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>ze(Q,n.companyId)),j=$e(v.controllers),{creditAccount:L,creditAccountRepayment:P}=y(Q=>Ge(Q)),V=y(Q=>Q.classListState.fetchState),u=!_&&d&&f,l=y(Q=>Ma(Q,t,u,d)),[w,T]=i.useState(!1),H=l.chargeCard,O=H?.cardCreatedByUser?.userId,K=y(Q=>O!=null?ba(Q.userRoleState,O):void 0),I=K?.accountingClassIDs[0],B=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),N=H?.cardHolderUser?.userId,R=y(Q=>N!=null?ba(Q.userRoleState,N):void 0),W=R?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Xe(t,u,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,G]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&f&&C&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&f&&C&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(ut())},[L.fetchState,P.fetchState,a,d,f,C,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,g,D,f),ae=ma(d,f,C,L,P),ne=Ht(x,l);return l.fetchState!=="Completed"?s.jsx(Ke,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(ir,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ur=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Wt({uiState:{sortKey:t,sortOrder:a}}))}}})(lr);function Rr(){const e=le(),t=ue(),a=ge(),r=X.getSignedInUser(),n=y(o=>ie(o)),[m,C]=i.useState(!1),p=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??jr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{m||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(C(!0),t(mt()))},[m,p,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return p.fetchState==="In-Progress"?s.jsx(dr,{onBackClick:S}):p.cashbackSummary.cashbackEarned.amount===0&&p.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Ur,{onBackClick:S})}const jr=e=>`/${e}/cards`,Nr={containerWidth:new ua(100,58)},Vr=({appContent:e})=>{const t=la(),a=ue(),r=le(),{cardId:n}=ia(),m=ge(),{useDynamicConfig:C}=ce(),[p,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(!1),F=X.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=C(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>qt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:j}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(Y.isDebitCardFeatureEnabled),P=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:P}),u=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,O=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:j,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&O&&u;i.useEffect(()=>{p===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Xe(n,K,O)))},[o,g.fetchState,p,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Jt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const B=X.getZeniOtpTokenForCardHolder(n),N=y(E=>Ct(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(Ke,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(N?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(zr,{children:[s.jsx(Ca,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Hr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:N.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:m,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Mr,{windowSize:t,children:e}):null]})},Hr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const m=Qt(e.addressState,a);if(m==null)throw Error("Can't access shippingAddress.");const C=pt(e,n),p=t.updateStatus,S=Ze(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Xt())||c,showMenuIcon:o,shippingAddress:m,vgsVaultId:Ba.cardVaultId,twoFAView:C,activationWaitStatus:p,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,chargeCardDetailState:C}=t,p=C.chargeCard?.cardProviderID,{tenantEmailDomain:S}=m;return{onGetOtp:o=>{p!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(an(r,o))},onResendOtp:o=>{p!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{p!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(en({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(ur),Mr=_e.div`
1
+ import{j as s}from"./liveblocks-CF908iAG.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as lt,n as Kt,o as te}from"./core-Cgen4kAj.js";import{eN as ie,bs as Ue,NZ as ka,eR as be,eS as ye,eT as Se,fO as ze,cq as $e,N_ as Ge,N$ as Ma,sL as ba,jy as ya,O0 as Sa,gC as oa,zd as Xe,zf as za,zg as $a,jo as ut,O1 as Ye,z1 as mt,O2 as Wt,O3 as qt,z4 as Da,O4 as Jt,Mq as _a,qX as Ct,za as Ga,gN as Qt,O5 as pt,O6 as Ze,bq as Xt,O7 as en,fz as wa,fy as Pa,zK as an,fx as Ta,M6 as tn,O8 as ht,cj as ft,cL as nn,Mp as da,Ak as rn,O9 as tt,zW as Fa,Oa as gt,Al as sn,MQ as on,Am as cn,Bg as dn,s5 as ln,Ba as un,zv as bt,zo as mn,Ob as Cn,fQ as pn,zE as yt,zI as St,fP as hn,Oc as fn,A6 as It,Od as gn,Oe as bn,Of as yn,zG as At,zr as Et,z7 as kt,zA as Dt,zy as _t,zC as Sn,ze as nt,Og as wt,Oh as va,zT as Ia,J5 as Pt,cM as Ya,Oi as In,Oj as An,Ok as En,Ol as kn,zQ as Na,Ad as Dn,A9 as _n,zM as wn,Ab as Pn,A1 as Tn,A3 as Fn,Om as Tt,Aj as Ft,GD as vn,On as xn,Oo as Ln,Op as On,Oq as vt,Or as Bn,AG as Un,zV as xt,zP as ca,zU as Rn,Os as jn,Ot as Nn,y_ as Vn,Ou as Lt,Ov as Ot,Ow as Hn,z0 as Mn,y$ as rt,Ox as zn,Oy as $n,Oz as Gn,J1 as Yn,OA as Za,OB as Zn,vB as Bt,k6 as Kn,gD as Wn,AL as qn,OC as Ut,OD as Jn,AM as Qn,OE as Xn,dc as er,sF as ar,AB as tr,Av as Be,bv as nr,bD as rr,cv as sr,bE as or,Ik as cr}from"./zeni-epic-state-DrGehtra.js";import{z as X,j as je,a as ce,p as Y,B as Ke,bY as xa,c7 as ir,n as ve,c8 as dr,c9 as lr,q as la,aJ as Fe,s as fe,bf as Ka,ca as ur,F as ua,k as La,h as Wa,d as J,D as qa,cb as mr,am as Ja,br as Je,cc as Va,cd as Cr,A as Qa,a1 as pr,ce as hr,ap as Rt,Q as Ha,M as jt,f as Nt,cf as fr,cg as gr,ch as br,ci as yr,cj as Sr,o as Aa,ck as Ir,cl as Ar,cm as Ua,v as Er,cn as kr,co as Dr,cp as _r,cq as wr,a5 as Pr}from"./index-trlF__w8.js";import{n as _e,D as Vt,S as Tr}from"./mui-C7dUqSqV.js";import{a as i}from"./sentry-cfxuOFew.js";import{g as Ce,a as ma,b as Ht,c as Ie,d as Ae,e as Re,f as Ne,A as Fr,h as Xa,P as vr,i as et,s as Qe,j as Mt,k as Me,l as zt,m as xr,n as $t,p as Lr,S as st}from"./SetupPagesScreen-RaBTeZ3X.js";import Oa from"./NotFoundScreen-DXPtR234.js";import{M as Ca}from"./MobileAppDrawer-BuQb2buy.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-C2mAQ-5p.js";import{c as Yt}from"./useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js";import{v as ot}from"./utils-DumEze_M.js";import{t as Or}from"./AddressScreen-BeHKG8v1.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./analyticsHelper-CsFRydiU.js";import"./routePaths-CqnfURaJ.js";import"./BusinessVerificationPageScreen-BUCm7Odf.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]="52dc4d9e-21eb-4f03-8b06-b680f05d8ba3",e._sentryDebugIdIdentifier="sentry-dbid-52dc4d9e-21eb-4f03-8b06-b680f05d8ba3")}catch{}})();function Br(){const e=le(),{cardId:t}=ia(),a=ue(),r=X.getSignedInUser(),n=y(Q=>ie(Q)),m=je(),C=Ue(m?.loggedInUserRoleMap),{useFeatureGate:p}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=p(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=p(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>ze(Q,n.companyId)),j=$e(v.controllers),{creditAccount:O,creditAccountRepayment:P}=y(Q=>Ge(Q)),V=y(Q=>Q.classListState.fetchState),u=!_&&d&&f,l=y(Q=>Ma(Q,t,u,d)),[w,T]=i.useState(!1),H=l.chargeCard,B=H?.cardCreatedByUser?.userId,K=y(Q=>B!=null?ba(Q.userRoleState,B):void 0),I=K?.accountingClassIDs[0],L=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),N=H?.cardHolderUser?.userId,R=y(Q=>N!=null?ba(Q.userRoleState,N):void 0),W=R?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Xe(t,u,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,G]),i.useEffect(()=>{O.fetchState!=="Completed"&&O.fetchState!=="In-Progress"&&d&&f&&C&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&f&&C&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(ut())},[O.fetchState,P.fetchState,a,d,f,C,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,g,D,f),ae=ma(d,f,C,O,P),ne=Ht(x,l);return l.fetchState!=="Completed"?s.jsx(Ke,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(ir,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:O,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:L?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ur=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Wt({uiState:{sortKey:t,sortOrder:a}}))}}})(lr);function Rr(){const e=le(),t=ue(),a=ge(),r=X.getSignedInUser(),n=y(o=>ie(o)),[m,C]=i.useState(!1),p=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??jr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{m||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(C(!0),t(mt()))},[m,p,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return p.fetchState==="In-Progress"?s.jsx(dr,{onBackClick:S}):p.cashbackSummary.cashbackEarned.amount===0&&p.fetchState==="Completed"?s.jsx(Oa,{}):s.jsx(Ur,{onBackClick:S})}const jr=e=>`/${e}/cards`,Nr={containerWidth:new ua(100,58)},Vr=({appContent:e})=>{const t=la(),a=ue(),r=le(),{cardId:n}=ia(),m=ge(),{useDynamicConfig:C}=ce(),[p,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(!1),F=X.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=C(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>qt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:j}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:O}=v(Y.isDebitCardFeatureEnabled),P=Se(O,k),V=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:P}),u=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:j,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&B&&u;i.useEffect(()=>{p===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Xe(n,K,B)))},[o,g.fetchState,p,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Jt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const L=X.getZeniOtpTokenForCardHolder(n),N=y(E=>Ct(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(Ke,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(N?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(zr,{children:[s.jsx(Ca,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Hr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:N.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:L,navigate:r,currentTenant:k,location:m,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Mr,{windowSize:t,children:e}):null]})},Hr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const m=Qt(e.addressState,a);if(m==null)throw Error("Can't access shippingAddress.");const C=pt(e,n),p=t.updateStatus,S=Ze(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Xt())||c,showMenuIcon:o,shippingAddress:m,vgsVaultId:La.cardVaultId,twoFAView:C,activationWaitStatus:p,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,chargeCardDetailState:C}=t,p=C.chargeCard?.cardProviderID,{tenantEmailDomain:S}=m;return{onGetOtp:o=>{p!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(an(r,o))},onResendOtp:o=>{p!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{p!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(en({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(ur),Mr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Nr.containerWidth.value(e.windowSize)}%`};
@@ -11,18 +11,18 @@ import{j as s}from"./liveblocks-yYJhhlwl.js";import{j as le,l as ia,h as ue,g as
11
11
  flex-direction: column;
12
12
  align-items: center;
13
13
  background-color: ${e=>e.theme.colors.grey4};
14
- `,Ea=qa.getLocalizedStrings().dateFormat,$r={overlayWidth:new ua(100,100,58)},Gr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:on(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:cn(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:m,isCashbackInfoFetchStateCompleted:C,isCreditCardInfoFetchStateCompleted:p,isDebitCardInfoFetchStateCompleted:S,controllerEmails:o,paymentDetails:c,productInformation:_,cashbackInformation:A,paymentSourceInformation:f,creditAccountInformation:U,debitAccountInformation:F,paymentInitiatedDate:k,sourcePage:h}=t,{tenantEmailDomain:b}=r;return{onBackNavigation:()=>{if(C&&p&&S&&A!=null&&J.trackCardsPayEarlyFormClick(o,_,A,"Back",c.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:c.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:c.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:c.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:c.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:k?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:k?.format(Ea.visual.MMMDCommaYYYYformat)},f,U,F),h==="cardPaymentHistory")t.closeDrawerHandler(!0),e(gt());else{const g=Ne(b);a(g)}},onUpdatePaymentAccountStatus:(g,d,D)=>{e(un(g,d,"bill_pay","bill_pay_detail",D))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:g=>{e(ln("external_account",g))},onEstablishConnectionClick:g=>{e(dn(g,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${b}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{m?window.open(`/${b}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(mr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:m,creditAccountInformation:C,debitAccountInformation:p,cashbackInformation:S,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:c,isCashbackInfoFetchStateCompleted:_,paymentInitiatedDate:A,retryRepayment:f})=>{const U=le(),{useDynamicConfig:F}=ce(),{configValue:k}=F(Fe.zeniAccountsConfig),h=tn(k),b=y($=>ht($)),{creditAccount:g}=y($=>Ge($)),d=y($=>ie($)),D=Wa(),v=la(),j=ue(),L=X.getSignedInUser(),P=je(),[V,u]=i.useState(!1),[l,w]=i.useState(!1),{configValue:T}=F(Fe.zeniCardsConfig),H=T.credit_card_auto_pay_threshold_by_company_id?.[d.companyId]??T.default_credit_card_auto_pay_threshold??Fr,O=ft(P?.loggedInUserRoleMap),K=nn(P?.loggedInUserRoleMap),I=!!d.companyZeniAccountInfo?.info?.isZeniAccountEnabled,B=y($=>da($,d.companyId)),N=B.companyChargeCardInfo?.primaryFundingAccount,R=B.allFundingAccounts.find($=>$.id===N?.accountId),W=y($=>ze($,d.companyId)),E=$e(W.controllers);i.useEffect(()=>{if(b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&j(rn()),b.fetchState==="Completed"&&!l){const $=d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=b.transferFromAccounts.find(ae=>ae.id===$);let se;if(m==="cardPaymentHistory"&&f){const ae=f.paymentAccountId!=null?b.transferFromAccounts.find(ne=>ne.id===f.paymentAccountId):void 0;se={amount:f.amount,isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ae??x}}else se={amount:{amount:g.balance.amount+g.hold.amount,currencyCode:g.balance.currencyCode,currencySymbol:g.balance.currencySymbol},isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};j(tt(se)),w(!0)}},[b.fetchState,l,m,f,b.transferFromAccounts,d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,d.companyChargeCardInfo?.info?.isAutoPayEnabled,g.balance.amount,g.balance.currencyCode,g.balance.currencySymbol,g.hold.amount,j]);const G={isZeniCheckingEnabled:d.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:R?.accType==="depositAccount",creditCardPaymentSourceAccountName:R?.label,creditCardPaymentSourceAccountType:R?.accType,creditCardPaymentSourceLastFourDigits:R?.accountLast4,creditCardPaymentSourceBalance:R?.accountBalance?.available?.amount??0};if(i.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&j(Fa(d.companyId,!0))},[B.fetchState]),i.useEffect(()=>{b.updateStatus==="Completed"&&S!=null&&_&&c&&o&&J.trackCardsPayEarlyPayNowClick(E,n,S,b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:A?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:A?.format(Ea.visual.MMMDCommaYYYYformat)},G,C,p)},[b.updateStatus,S,_,c,o,A]),i.useEffect(()=>{b.fetchState==="Completed"&&S!=null&&_&&c&&o&&!V&&e&&l&&S!=null&&(J.trackCardsPayEarlyFormView(E,n,S,a,d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,g.balance.amount,G,C,p),u(!0))},[b,_,c,o,V,e,l]),L==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),j(gt())};return s.jsx(s.Fragment,{children:s.jsx(Vt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:$r.overlayWidth.valuePercentage(v),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:D.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(Yr,{onClick:$=>$.stopPropagation(),children:s.jsx(Gr,{closeDrawerHandler:t,navigate:U,paymentDetails:b,creditAccountSpentAmount:r,onTransferClick:()=>{_&&c&&o&&S!=null&&J.trackCardsPayEarlyFormClick(E,n,S,"Pay Now",b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},G,C,p),j(sn({companyId:d.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:$=>{j(tt($))},currentTenant:d,hasZeniAccountsAdminAccess:O,isZeniAccountsUser:K,isZeniAccountSetupEnabled:I,productInformation:n,sourcePage:m,controllerEmails:E,autoPayThreshold:H,paymentSourceInformation:G,creditAccountInformation:C,debitAccountInformation:p,cashbackInformation:S,isCashbackInfoFetchStateCompleted:_,isCreditCardInfoFetchStateCompleted:c,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:A,maxInsuredAmount:h.maxInsuredAmount})})})})},Yr=_e(Tr)`
14
+ `,Ea=qa.getLocalizedStrings().dateFormat,$r={overlayWidth:new ua(100,100,58)},Gr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:on(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:cn(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:m,isCashbackInfoFetchStateCompleted:C,isCreditCardInfoFetchStateCompleted:p,isDebitCardInfoFetchStateCompleted:S,controllerEmails:o,paymentDetails:c,productInformation:_,cashbackInformation:A,paymentSourceInformation:f,creditAccountInformation:U,debitAccountInformation:F,paymentInitiatedDate:k,sourcePage:h}=t,{tenantEmailDomain:b}=r;return{onBackNavigation:()=>{if(C&&p&&S&&A!=null&&J.trackCardsPayEarlyFormClick(o,_,A,"Back",c.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:c.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:c.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:c.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:c.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:k?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:k?.format(Ea.visual.MMMDCommaYYYYformat)},f,U,F),h==="cardPaymentHistory")t.closeDrawerHandler(!0),e(gt());else{const g=Ne(b);a(g)}},onUpdatePaymentAccountStatus:(g,d,D)=>{e(un(g,d,"bill_pay","bill_pay_detail",D))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:g=>{e(ln("external_account",g))},onEstablishConnectionClick:g=>{e(dn(g,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${b}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{m?window.open(`/${b}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(mr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:m,creditAccountInformation:C,debitAccountInformation:p,cashbackInformation:S,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:c,isCashbackInfoFetchStateCompleted:_,paymentInitiatedDate:A,retryRepayment:f})=>{const U=le(),{useDynamicConfig:F}=ce(),{configValue:k}=F(Fe.zeniAccountsConfig),h=tn(k),b=y($=>ht($)),{creditAccount:g}=y($=>Ge($)),d=y($=>ie($)),D=Wa(),v=la(),j=ue(),O=X.getSignedInUser(),P=je(),[V,u]=i.useState(!1),[l,w]=i.useState(!1),{configValue:T}=F(Fe.zeniCardsConfig),H=T.credit_card_auto_pay_threshold_by_company_id?.[d.companyId]??T.default_credit_card_auto_pay_threshold??Fr,B=ft(P?.loggedInUserRoleMap),K=nn(P?.loggedInUserRoleMap),I=!!d.companyZeniAccountInfo?.info?.isZeniAccountEnabled,L=y($=>da($,d.companyId)),N=L.companyChargeCardInfo?.primaryFundingAccount,R=L.allFundingAccounts.find($=>$.id===N?.accountId),W=y($=>ze($,d.companyId)),E=$e(W.controllers);i.useEffect(()=>{if(b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&j(rn()),b.fetchState==="Completed"&&!l){const $=d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=b.transferFromAccounts.find(ae=>ae.id===$);let se;if(m==="cardPaymentHistory"&&f){const ae=f.paymentAccountId!=null?b.transferFromAccounts.find(ne=>ne.id===f.paymentAccountId):void 0;se={amount:f.amount,isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ae??x}}else se={amount:{amount:g.balance.amount+g.hold.amount,currencyCode:g.balance.currencyCode,currencySymbol:g.balance.currencySymbol},isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};j(tt(se)),w(!0)}},[b.fetchState,l,m,f,b.transferFromAccounts,d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,d.companyChargeCardInfo?.info?.isAutoPayEnabled,g.balance.amount,g.balance.currencyCode,g.balance.currencySymbol,g.hold.amount,j]);const G={isZeniCheckingEnabled:d.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:R?.accType==="depositAccount",creditCardPaymentSourceAccountName:R?.label,creditCardPaymentSourceAccountType:R?.accType,creditCardPaymentSourceLastFourDigits:R?.accountLast4,creditCardPaymentSourceBalance:R?.accountBalance?.available?.amount??0};if(i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&j(Fa(d.companyId,!0))},[L.fetchState]),i.useEffect(()=>{b.updateStatus==="Completed"&&S!=null&&_&&c&&o&&J.trackCardsPayEarlyPayNowClick(E,n,S,b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:A?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:A?.format(Ea.visual.MMMDCommaYYYYformat)},G,C,p)},[b.updateStatus,S,_,c,o,A]),i.useEffect(()=>{b.fetchState==="Completed"&&S!=null&&_&&c&&o&&!V&&e&&l&&S!=null&&(J.trackCardsPayEarlyFormView(E,n,S,a,d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,g.balance.amount,G,C,p),u(!0))},[b,_,c,o,V,e,l]),O==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),j(gt())};return s.jsx(s.Fragment,{children:s.jsx(Vt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:$r.overlayWidth.valuePercentage(v),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:D.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(Yr,{onClick:$=>$.stopPropagation(),children:s.jsx(Gr,{closeDrawerHandler:t,navigate:U,paymentDetails:b,creditAccountSpentAmount:r,onTransferClick:()=>{_&&c&&o&&S!=null&&J.trackCardsPayEarlyFormClick(E,n,S,"Pay Now",b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},G,C,p),j(sn({companyId:d.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:$=>{j(tt($))},currentTenant:d,hasZeniAccountsAdminAccess:B,isZeniAccountsUser:K,isZeniAccountSetupEnabled:I,productInformation:n,sourcePage:m,controllerEmails:E,autoPayThreshold:H,paymentSourceInformation:G,creditAccountInformation:C,debitAccountInformation:p,cashbackInformation:S,isCashbackInfoFetchStateCompleted:_,isCreditCardInfoFetchStateCompleted:c,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:A,maxInsuredAmount:h.maxInsuredAmount})})})})},Yr=_e(Tr)`
15
15
  display: flex;
16
16
  min-height: 100%;
17
17
  flex-direction: column;
18
- `,Zt="charge-card-transaction-update",Ra=qa.getLocalizedStrings().dateFormat,Zr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:m}=t,C=X.getSignedInUser(),p=e.tenantState.currentTenantId,S={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:p??""},o=Ma(e,r,a,m),c=Cn(e,r),_=pn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:c,vgsVaultId:Ba.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:S,isSnackbarOpen:_.isSnackbarOpen,cardsEndPoint:`${Rt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:m,cardProviderId:C,includeCreditAccountInfo:p,setIsPaymentOpen:S,controllerEmails:o,productInformation:c,cashbackInformation:_,primaryFundingAccountDetails:A,creditAccountInformation:f,debitAccountInformation:U,isChargeCardFeatureEnabled:F}=t,{tenantEmailDomain:k}=r;return{onEventReceived:h=>{h===Zt&&(e(Ga(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Xe(a,p,F))},onFetchChargeCardTransactionList:(h,b)=>{e(nt(a,h,b))},onUpdateScrollYOffset:h=>{},onGetOtp:h=>{C!=null&&e(Ta(h,"ChargeCardHolder",a))},onResendOtp:h=>{C!=null&&e(Pa(h,"ChargeCardHolder",a))},onVerifyOtp:(h,b)=>{C!=null&&e(wa(h,b,"ChargeCardHolder",a))},onVerifyOtpSuccess:h=>{h!=null&&X.saveZeniOtpTokenForCardHolder(h,a)},onColorCodeChange:h=>{e(Sn(a,h))},onLockChargeCard:(h,b)=>{e(_t(h,a,b))},onUnlockChargeCard:h=>{e(Dt(h,a))},onCloseChargeCard:h=>{e(kt(a,h))},onFetchChargeCardsRecurringExpenses:()=>{e(Et([a]))},updateChargeCardName:(h,b)=>{e(At(h,a,b))},updateChargeCardTransactionAttachments:(h,b)=>{b!=null&&e(yn({transactionId:h,data:b}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(h,b,g,d)=>{e(bn({chargeCardId:b,transactionId:h,fetchState:g,error:d}))},updateChargeCardTransactionReceiptsShowTick:(h,b,g)=>{e(gn({chargeCardId:b,transactionId:h,shouldShowTick:g}))},onChargeCardRevokeInviteClick:()=>{e(It(a))},updateChargeCardTransactionIsViewReceiptClicked:(h,b,g)=>{e(fn({chargeCardId:b,transactionId:h,isViewReceiptClicked:g}))},onChargeCardTransactionRowClick:(h,b)=>{const g=fe(m.state?.pathnameStackToGoBack,m.pathname);n(`../../transaction/${h}/${b}`,{state:{pathnameStackToGoBack:g}})},onBackClick:()=>{const h=ve(m.state?.pathnameStackToGoBack),b=Ne(k);n(b,{state:{pathnameStackToGoBack:h.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(hn())},onUpdateDebitCardPinAttempt:h=>{e(St(a,h)),h==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(h,b)=>{h?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):b!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:b.message}]}))},updateSpendLimit(h,b,g,d){e(yt(h,b,g.code,d))},shouldOpenCreditCardPaymentDrawer(h){h&&_!=null&&J.trackCardsPayEarlyClick(o,c,_,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:A?.accType==="depositAccount",creditCardPaymentSourceAccountName:A?.label,creditCardPaymentSourceAccountType:A?.accType,creditCardPaymentSourceLastFourDigits:A?.accountLast4,creditCardPaymentSourceBalance:A?.accountBalance?.available?.amount??0},f,U),S(h)}}})(pr(hr));function Kr(){const e=le(),t=ue(),a=ge(),{cardId:r}=ia(),[n,m]=i.useState(!1),[C,p]=i.useState(!1),{useDynamicConfig:S}=ce(),o=X.getSignedInUser(),c=y(M=>ie(M)),_=y(M=>ka(M).firstViewAfterActivation),A=y(M=>M.classListState.fetchState),{configValue:f}=S(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:U}=S(Fe.zeniCardsConfig),F=U.enable_card_controls_for_company_ids,k=U.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(c.companyId),[h,b]=i.useState(!1),[g,d]=i.useState(!1),{useFeatureGate:D}=ce(),{isFeatureEnabled:v}=D(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=D(Y.isDebitCardFeatureEnabled),L=Se(j,c),P=Ie({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:L}),{isFeatureEnabled:V}=D(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:u}=D(Y.isCardsCommentingEnabled),l=ye(c),w=be(c),T=c.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:v,isBookKeepingTenant:l,isDebitCardProductVisible:P,chargeCardsCreditAccountLimit:T}),O=!!c.companyDebitCardInfo?.info?.isDebitCardEnabled,K=!!c.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!c.userRole.includes("charge_card_user")&&H&&K;if(r==null)throw Error("Empty card id is not valid...");const B=y(M=>da(M,c.companyId)),{creditAccount:N,creditAccountRepayment:R}=y(M=>Ge(M)),W=X.getZeniOtpTokenForCardHolder(r),E=y(M=>Ma(M,r,I,H)),{isAiCfoAccessEnabled:G,onAskAiCfoClick:q}=Gt({mobileExploreReferrer:"Card Detail"});Yt({isDataReady:E.fetchState==="Completed"});const $=y(M=>Ye(M)),x=E.chargeCard,se=je(),ae=Ue(se?.loggedInUserRoleMap),ne=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",Q=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=ma(H,K,ae,N,R),Z=Ht(ne,E),he=Xa(ae,$),ke=Re(H,P,O,K),Be=E.depositAccountLimitFetchState.fetchState!=="Completed"&&E.depositAccountLimitFetchState.fetchState!=="In-Progress",we=y(M=>ze(M,c.companyId)),Pe=$e(we.controllers),ee=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ee?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ee?.accountingClassIDs[0],reportId:"class_list"}):void 0),oe=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>oe?.accountingClassIDs[0]!=null?ya(M.classState,{classId:oe?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=c?.userRole,Le=y(M=>Ze(M,!1,P,v).revokeCardInvite),aa=Ja(Le.saveStatus.fetchState);if(i.useEffect(()=>{if(aa==="In-Progress"&&Le.saveStatus.fetchState==="Completed"){const M=Ne(c.tenantEmailDomain);e(M)}},[aa,Le.saveStatus.fetchState,e,c.tenantEmailDomain]),i.useEffect(()=>{_&&n===!1&&re&&(m(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[_,n,re,Ee]),i.useEffect(()=>{h||E.fetchState==="Completed"||E.fetchState==="In-Progress"||r==null||(b(!0),t(Xe(r,I,H,!1)))},[h,E,r,t]),i.useEffect(()=>{!g&&E.fetchState==="Completed"&&E.chargeCard?.connectedAccountId!=null&&ne&&Be&&ae&&(d(!0),t(bt({depositAccountId:E.chargeCard?.connectedAccountId})))},[g,E,t,Be,ae]),i.useEffect(()=>{$.fetchState!=="Completed"&&$.fetchState!=="In-Progress"&&ae&&t(mt()),A!=="Completed"&&A!=="In-Progress"&&t(ut()),E.transactionStatistics.fetchState!=="Completed"&&E.transactionStatistics.fetchState!=="In-Progress"&&t(mn({chargeCardId:r})),B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&t(Fa(c.companyId,!0))},[$.fetchState,t,ae,A,E.transactionStatistics.fetchState,B.fetchState]),i.useEffect(()=>{if(!(E.fetchState!=="Completed"||H&&N.fetchState!=="Completed"||x==null||E.transactionStatistics.fetchState!=="Completed"||ne&&ae&&E.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;J.trackCardsCardDetailView(Pe,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Je(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Ra.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Ra.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Ra.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Je(x.balance.amount),cardAvailableLimit:Je(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Je(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:E.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:E.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:E.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:E.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:E.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:E.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Va(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ee?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Va(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:oe?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,Z)}},[E.fetchState,E.depositAccountLimitFetchState.fetchState,E.transactionStatistics.fetchState,N.fetchState,ae]),o==null)throw Error("Can't access card detail page without signing in...");const We=c.companyId??X.getSignedInUserTenant(c.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-${We}.${Zt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ve,frequency:qe,cardColor:z}=ja(x),De=x.cardHolderUserId===o.userId;J.trackCardsDetailPageViewed(r,M,me,Te,Ve,qe,z,De)}};i.useEffect(()=>{if(E.fetchState==="Completed"){const M=E.chargeCard;if(M?.status.code==="inactive"||ne&&M?.isPinSet===!1||Q&&_){const me=Ce(c.tenantEmailDomain,r,o,x,_);e(me)}}},[E.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:z,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;J.trackCardsDetailPageClicked(r,Te,Ve,qe,z,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:z,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;J.trackCardsVerifyPopUpClick(r,Te,Ve,qe,z,De,M,He,me)}},Oa=N.balance.amount+N.hold.amount,ha=c.companyChargeCardInfo?.info?.primaryFundingAccount,fa=B.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||E.fetchState==="Error"?s.jsx(La,{}):E.fetchState==="In-Progress"||E.fetchState==="Not-Started"||Le.saveStatus.fetchState==="In-Progress"||ne&&ae&&E.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(Cr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:_}),E.fetchState==="Completed"?s.jsx(Qa,{analytics:J,onLoad:na}):null,C===!0?s.jsx(at,{closeDrawerHandler:()=>p(!1),isPaymentDrawerOpen:C,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,creditAccountSpentAmount:Oa,isDebitCardInfoFetchStateCompleted:!ne||!ae||E.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!H||N.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ae||$.fetchState==="Completed",paymentInitiatedDate:R.initiatedRepaymentDate}):null,s.jsx(Zr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:p,cardIssuedByRoles:ee?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:oe?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:H,isDebitCardFeatureEnabled:P,isDebitCardSetupEnabled:O,isChargeCardSetupEnabled:K,isCardControlsEnabled:k,isEarlyPayEnabled:V,controllerEmails:Pe,chargeCardCashbackDetailState:$,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,classListFetchState:A,primaryFundingAccountDetails:fa,currentTenant:c,cardProviderId:E.chargeCard?.cardProviderID,cardId:r,creditAccount:N,creditAccountRepayment:R,includeCreditAccountInfo:I,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:f.documentAiReceiptMaxSizeLimitBytes!=null?f.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:G,onAskAiCfoClick:q,isCardsCommentingEnabled:u})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,m=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:m,limit:n}},Wr=_e.div`
18
+ `,Zt="charge-card-transaction-update",Ra=qa.getLocalizedStrings().dateFormat,Zr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:m}=t,C=X.getSignedInUser(),p=e.tenantState.currentTenantId,S={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:p??""},o=Ma(e,r,a,m),c=Cn(e,r),_=pn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:c,vgsVaultId:La.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:S,isSnackbarOpen:_.isSnackbarOpen,cardsEndPoint:`${Rt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:m,cardProviderId:C,includeCreditAccountInfo:p,setIsPaymentOpen:S,controllerEmails:o,productInformation:c,cashbackInformation:_,primaryFundingAccountDetails:A,creditAccountInformation:f,debitAccountInformation:U,isChargeCardFeatureEnabled:F}=t,{tenantEmailDomain:k}=r;return{onEventReceived:h=>{h===Zt&&(e(Ga(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Xe(a,p,F))},onFetchChargeCardTransactionList:(h,b)=>{e(nt(a,h,b))},onUpdateScrollYOffset:h=>{},onGetOtp:h=>{C!=null&&e(Ta(h,"ChargeCardHolder",a))},onResendOtp:h=>{C!=null&&e(Pa(h,"ChargeCardHolder",a))},onVerifyOtp:(h,b)=>{C!=null&&e(wa(h,b,"ChargeCardHolder",a))},onVerifyOtpSuccess:h=>{h!=null&&X.saveZeniOtpTokenForCardHolder(h,a)},onColorCodeChange:h=>{e(Sn(a,h))},onLockChargeCard:(h,b)=>{e(_t(h,a,b))},onUnlockChargeCard:h=>{e(Dt(h,a))},onCloseChargeCard:h=>{e(kt(a,h))},onFetchChargeCardsRecurringExpenses:()=>{e(Et([a]))},updateChargeCardName:(h,b)=>{e(At(h,a,b))},updateChargeCardTransactionAttachments:(h,b)=>{b!=null&&e(yn({transactionId:h,data:b}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(h,b,g,d)=>{e(bn({chargeCardId:b,transactionId:h,fetchState:g,error:d}))},updateChargeCardTransactionReceiptsShowTick:(h,b,g)=>{e(gn({chargeCardId:b,transactionId:h,shouldShowTick:g}))},onChargeCardRevokeInviteClick:()=>{e(It(a))},updateChargeCardTransactionIsViewReceiptClicked:(h,b,g)=>{e(fn({chargeCardId:b,transactionId:h,isViewReceiptClicked:g}))},onChargeCardTransactionRowClick:(h,b)=>{const g=fe(m.state?.pathnameStackToGoBack,m.pathname);n(`../../transaction/${h}/${b}`,{state:{pathnameStackToGoBack:g}})},onBackClick:()=>{const h=ve(m.state?.pathnameStackToGoBack),b=Ne(k);n(b,{state:{pathnameStackToGoBack:h.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(hn())},onUpdateDebitCardPinAttempt:h=>{e(St(a,h)),h==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(h,b)=>{h?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):b!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:b.message}]}))},updateSpendLimit(h,b,g,d){e(yt(h,b,g.code,d))},shouldOpenCreditCardPaymentDrawer(h){h&&_!=null&&J.trackCardsPayEarlyClick(o,c,_,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:A?.accType==="depositAccount",creditCardPaymentSourceAccountName:A?.label,creditCardPaymentSourceAccountType:A?.accType,creditCardPaymentSourceLastFourDigits:A?.accountLast4,creditCardPaymentSourceBalance:A?.accountBalance?.available?.amount??0},f,U),S(h)}}})(pr(hr));function Kr(){const e=le(),t=ue(),a=ge(),{cardId:r}=ia(),[n,m]=i.useState(!1),[C,p]=i.useState(!1),{useDynamicConfig:S}=ce(),o=X.getSignedInUser(),c=y(M=>ie(M)),_=y(M=>ka(M).firstViewAfterActivation),A=y(M=>M.classListState.fetchState),{configValue:f}=S(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:U}=S(Fe.zeniCardsConfig),F=U.enable_card_controls_for_company_ids,k=U.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(c.companyId),[h,b]=i.useState(!1),[g,d]=i.useState(!1),{useFeatureGate:D}=ce(),{isFeatureEnabled:v}=D(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=D(Y.isDebitCardFeatureEnabled),O=Se(j,c),P=Ie({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:O}),{isFeatureEnabled:V}=D(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:u}=D(Y.isCardsCommentingEnabled),l=ye(c),w=be(c),T=c.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:v,isBookKeepingTenant:l,isDebitCardProductVisible:P,chargeCardsCreditAccountLimit:T}),B=!!c.companyDebitCardInfo?.info?.isDebitCardEnabled,K=!!c.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!c.userRole.includes("charge_card_user")&&H&&K;if(r==null)throw Error("Empty card id is not valid...");const L=y(M=>da(M,c.companyId)),{creditAccount:N,creditAccountRepayment:R}=y(M=>Ge(M)),W=X.getZeniOtpTokenForCardHolder(r),E=y(M=>Ma(M,r,I,H)),{isAiCfoAccessEnabled:G,onAskAiCfoClick:q}=Gt({mobileExploreReferrer:"Card Detail"});Yt({isDataReady:E.fetchState==="Completed"});const $=y(M=>Ye(M)),x=E.chargeCard,se=je(),ae=Ue(se?.loggedInUserRoleMap),ne=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",Q=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=ma(H,K,ae,N,R),Z=Ht(ne,E),he=Xa(ae,$),ke=Re(H,P,B,K),Le=E.depositAccountLimitFetchState.fetchState!=="Completed"&&E.depositAccountLimitFetchState.fetchState!=="In-Progress",we=y(M=>ze(M,c.companyId)),Pe=$e(we.controllers),ee=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ee?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ee?.accountingClassIDs[0],reportId:"class_list"}):void 0),oe=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>oe?.accountingClassIDs[0]!=null?ya(M.classState,{classId:oe?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=c?.userRole,Oe=y(M=>Ze(M,!1,P,v).revokeCardInvite),aa=Ja(Oe.saveStatus.fetchState);if(i.useEffect(()=>{if(aa==="In-Progress"&&Oe.saveStatus.fetchState==="Completed"){const M=Ne(c.tenantEmailDomain);e(M)}},[aa,Oe.saveStatus.fetchState,e,c.tenantEmailDomain]),i.useEffect(()=>{_&&n===!1&&re&&(m(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[_,n,re,Ee]),i.useEffect(()=>{h||E.fetchState==="Completed"||E.fetchState==="In-Progress"||r==null||(b(!0),t(Xe(r,I,H,!1)))},[h,E,r,t]),i.useEffect(()=>{!g&&E.fetchState==="Completed"&&E.chargeCard?.connectedAccountId!=null&&ne&&Le&&ae&&(d(!0),t(bt({depositAccountId:E.chargeCard?.connectedAccountId})))},[g,E,t,Le,ae]),i.useEffect(()=>{$.fetchState!=="Completed"&&$.fetchState!=="In-Progress"&&ae&&t(mt()),A!=="Completed"&&A!=="In-Progress"&&t(ut()),E.transactionStatistics.fetchState!=="Completed"&&E.transactionStatistics.fetchState!=="In-Progress"&&t(mn({chargeCardId:r})),L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&t(Fa(c.companyId,!0))},[$.fetchState,t,ae,A,E.transactionStatistics.fetchState,L.fetchState]),i.useEffect(()=>{if(!(E.fetchState!=="Completed"||H&&N.fetchState!=="Completed"||x==null||E.transactionStatistics.fetchState!=="Completed"||ne&&ae&&E.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;J.trackCardsCardDetailView(Pe,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Je(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Ra.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Ra.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Ra.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Je(x.balance.amount),cardAvailableLimit:Je(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Je(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:E.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:E.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:E.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:E.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:E.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:E.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Va(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ee?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Va(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:oe?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,Z)}},[E.fetchState,E.depositAccountLimitFetchState.fetchState,E.transactionStatistics.fetchState,N.fetchState,ae]),o==null)throw Error("Can't access card detail page without signing in...");const We=c.companyId??X.getSignedInUserTenant(c.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-${We}.${Zt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ve,frequency:qe,cardColor:z}=ja(x),De=x.cardHolderUserId===o.userId;J.trackCardsDetailPageViewed(r,M,me,Te,Ve,qe,z,De)}};i.useEffect(()=>{if(E.fetchState==="Completed"){const M=E.chargeCard;if(M?.status.code==="inactive"||ne&&M?.isPinSet===!1||Q&&_){const me=Ce(c.tenantEmailDomain,r,o,x,_);e(me)}}},[E.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:z,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;J.trackCardsDetailPageClicked(r,Te,Ve,qe,z,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:z,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;J.trackCardsVerifyPopUpClick(r,Te,Ve,qe,z,De,M,He,me)}},Ba=N.balance.amount+N.hold.amount,ha=c.companyChargeCardInfo?.info?.primaryFundingAccount,fa=L.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||E.fetchState==="Error"?s.jsx(Oa,{}):E.fetchState==="In-Progress"||E.fetchState==="Not-Started"||Oe.saveStatus.fetchState==="In-Progress"||ne&&ae&&E.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(Cr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:_}),E.fetchState==="Completed"?s.jsx(Qa,{analytics:J,onLoad:na}):null,C===!0?s.jsx(at,{closeDrawerHandler:()=>p(!1),isPaymentDrawerOpen:C,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,creditAccountSpentAmount:Ba,isDebitCardInfoFetchStateCompleted:!ne||!ae||E.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!H||N.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ae||$.fetchState==="Completed",paymentInitiatedDate:R.initiatedRepaymentDate}):null,s.jsx(Zr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:p,cardIssuedByRoles:ee?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:oe?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:H,isDebitCardFeatureEnabled:P,isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:K,isCardControlsEnabled:k,isEarlyPayEnabled:V,controllerEmails:Pe,chargeCardCashbackDetailState:$,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,classListFetchState:A,primaryFundingAccountDetails:fa,currentTenant:c,cardProviderId:E.chargeCard?.cardProviderID,cardId:r,creditAccount:N,creditAccountRepayment:R,includeCreditAccountInfo:I,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:f.documentAiReceiptMaxSizeLimitBytes!=null?f.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:G,onAskAiCfoClick:q,isCardsCommentingEnabled:u})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,m=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:m,limit:n}},Wr=_e.div`
19
19
  display: flex;
20
20
  width: 100%;
21
21
  flex: 1 1 auto;
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,qr=pe(function(e,t){const a=Ze(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:In(e),bulkActionView:An(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:m,chargeCardListState:C,includeCreditAccountDebitSummaryAndCashbackInfo:p,isChargeCardFeatureEnabled:S,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:c,isDebitCardFeatureEnabled:_,isDebitCardSetupEnabled:A,isDebitCardTOSAccepted:f,isChargeCardTOSAccepted:U,controllerEmails:F,depositAccountListWithDebitCardIssued:k,primaryFundingAccountDetails:h,chargeCardSetUpViewFetchState:b,productInformation:g,cashbackInformation:d,creditAccountInformation:D,debitAccountInformation:v,updatePayNowInfoTooltip:j,isUserHasCardsAdminLevelAccess:L}=t,{tenantEmailDomain:P}=r,{cards:V}=C;return{onChargeCardRowClick:(u,l)=>{const w=zt(V,u);let T;w!=null&&((O=>{const K=O.limit.amount-O.available.amount,I=`${O.cardHolderUser?.firstName.toLowerCase()} ${O.cardHolderUser?.lastName.toLowerCase()}`,B=O.cardName,N=O.department?.className??"",R=O.limit.amount,W=O.creditLimitFrequency.name;J.trackCardsListRowClicked(I,B,N,K,R,W,m.userId===O.cardHolderUserId)})(w),Me(_,A,k)&&J.trackCardsCardListRowClick(F,g,"Card Row Item","row_clicked",l+1,{cardOwner:Va(w.cardHolderUser,!1),cardName:w.cardName,cardType:w.type.code.includes("credit")?"credit":"debit",cardStatus:w.status.code,cardUtilizationAmount:Je(w.limit.amount-w.available.amount),cardUtilizationPercent:w.limit.amount>0?Math.round((w.limit.amount-w.available.amount)/w.limit.amount*100):0,cardLimit:Je(w.limit.amount)},d,D,v)),T=w?.status.code==="request_on_hold"&&m.userId===w.cardHolderUserId?$t(P):Ce(P,u,m,w);const H=fe(n.state?.pathnameStackToGoBack,n.pathname);a(T,{state:{pathnameStackToGoBack:H}})},onFetchChargeCardsRecurringExpenses:u=>{e(Et(u))},onFetchDepositAccountLimit:u=>{e(bt({depositAccountId:u}))},onChargeCardResendInviteClick:u=>{e(Fn(u))},onChargeCardRevokeInviteClick:u=>{e(It(u))},onLockChargeCardList:(u,l)=>{e(Tn(u,l))},onUnlockChargeCardList:u=>{e(Pn(u))},onCloseChargeCardList:(u,l)=>{e(wn(u,l))},onRevokeChargeCardList:u=>{e(_n(u))},updateChargeCardListSpendLimit(u,l,w){e(Dn(u,l,w.code))},onLockChargeCard:(u,l)=>{e(_t(L,u,l))},onUnlockChargeCard:u=>{e(Dt(L,u))},onCloseChargeCard:(u,l)=>{e(kt(u,l))},onUpdateSpendLimit(u,l,w,T){e(yt(u,l,w.code,T))},updateChargeCardName:(u,l)=>{e(At(L,u,l))},onClickSetupIcon:()=>{J.trackCardsListPageClicked("settings"),Me(_,A,k)&&d!=null&&J.trackCardsSettingsClick(F,g,d,D,v);const u=xr(P),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onIssueCardClick:()=>{J.trackCardsListPageClicked("new card"),Me(_,A,k)&&d!=null&&J.trackCardsNewCardClick(F,g,d,"New Button","card_creation_initiated","Card List",D,v);const u=Jr(P),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onColumnSortConfigChanged:(u,l)=>{Me(_,A,k)&&d!=null&&J.trackCardsCardListSortClick(F,g,d,"Sort Icon","sort",u,l==="ascending"?"ASC":"DESC","Cards List",D,v),e(Na({uiState:{sortKey:u,sortOrder:l}}))},onSearchTextChanged:u=>{e(kn(u))},onReloadCards:()=>{e(Ia(p,_&&A,S&&c,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(_,A,k)&&d!=null&&J.trackCardsCashbackOverviewClick(F,g,d,"Cashback Overview","cashback_details_viewed",D,v),a("./cashback")},onClickStatementsIcon:()=>{Me(_,A,k)&&d!=null&&J.trackCardsStatementsClick(F,g,d,D,v),a("./statements")},onCreateNowClick:u=>{Me(_,A,k)&&d!=null&&J.trackCardsNewCardClick(F,g,d,"Promo Banner","card_creation_initiated","Card List",D,v),a(`./new?cardType=${u}`)},onPromoCardClick:u=>{a(u==="debit"&&_&&!f||u==="credit"&&o&&!U?`../promo?cardPromoType=${u}`:"./setup")},navigateToCreditCardPaymentPage:(u,l)=>{b==="Completed"&&r.company!=null&&d!=null&&J.trackCardsPayEarlyClick(F,g,d,"Card List",u,l,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:h?.accType==="depositAccount",creditCardPaymentSourceAccountName:h?.label,creditCardPaymentSourceAccountType:h?.accType,creditCardPaymentSourceLastFourDigits:h?.accountLast4,creditCardPaymentSourceBalance:h?.accountBalance?.available?.amount??0},D,v);const w=Qr(P);a(w)},navigateToCreditCardPaymentHistoryPage:()=>{const u=Xr(P),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},shouldShowPayNowInfoTooltip:j,onSetRowActionCardId:u=>{e(En(u))},onSetBulkActionCardIds:u=>{e(wt(u))}}})(fr);function ct({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=ge(),n=i.useCallback((z,De)=>{a(wt([])),t(z,De)},[a,t]),[m,C]=i.useState(!1),[p,S]=i.useState(X.getPayNowInfoTooltip()??!1),o=z=>{X.savePayNowInfoTooltip(z),S(z)},[c,_]=i.useState(!1),A=X.getSignedInUser(),f=y(z=>ie(z)),[U,F]=i.useState(!1),[k,h]=i.useState(!1),{isAiCfoAccessEnabled:b,onAskAiCfoClick:g}=Gt({mobileExploreReferrer:"Cards"}),d=f.userRole.includes("charge_card_user"),D=!d,v=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:j,useDynamicConfig:L}=ce(),{isFeatureEnabled:P}=j(Y.isCashbackFeatureEnabled),{isFeatureEnabled:V}=j(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=j(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=j(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:w}=j(Y.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:T}=j(Y.isCardsCommentingEnabled),H=Se(u,f),O=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:H}),K=be(f),I=ye(f),B=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,N=Ae({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I,isDebitCardProductVisible:O,chargeCardsCreditAccountLimit:B}),R=Mt({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I}),{configValue:W}=L(Fe.zeniCardsConfig),E=je(),G=Ue(E?.loggedInUserRoleMap),q=y(z=>ze(z,f.companyId)),$=$e(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,se=W.credit_card_pay_now_threshold_by_company_id?.[f.companyId]??W.default_credit_card_pay_now_threshold??vr,ae=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(f.companyId),ne=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Q=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(z=>ht(z)),xe=Ja(Ee.updateStatus),Z=y(z=>Ze(z,D,O&&v,N&&re)),he=Z.cards.filter(z=>z.type.code.includes("debit")).map(z=>z.connectedAccountId),ke=[...new Set(he)],Be=y(z=>Ye(z)),we=y(z=>va(z,ke)),Pe=y(z=>da(z,f.companyId)),ee=Pe.companyChargeCardInfo?.primaryFundingAccount,pa=Pe.allFundingAccounts.find(z=>z.id===ee?.accountId),oe=Z.fetchState,ea=Z.creditAccount;Yt({isDataReady:oe==="Completed"});const{creditAccountRepayment:de}=y(z=>Ge(z)),Le=y(z=>ka(z).firstViewAfterActivation),{areTenantIdsInSync:aa}=jt(),We=Xa(G,Be),ta=ma(N,re,G,ea,de),na=et(O,v,G,we,Z.debitCardSummary),ra=Re(N,O,v,re),sa=Z.creditAccount.balance.amount+Z.creditAccount.hold.amount;if(i.useEffect(()=>{oe==="Completed"&&(X.getPayNowInfoTooltip()==null||sa<se*Z.creditAccount.limit.amount/100)&&o(!0)},[oe,se,sa,Z.creditAccount.limit.amount]),i.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),C(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){C(!1),document.body.style.overflow="auto";const z=Ne(f.tenantEmailDomain);n(z)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,f.tenantEmailDomain]),i.useEffect(()=>{!U&&(re||v)&&aa&&(F(!0),a(Ia(D,O&&v,N&&re,!1)))},[U,D,a,aa]),i.useEffect(()=>{Le&&c===!1&&(_(!0),setTimeout(()=>{a(Sa())},5e3))},[Le,c]),i.useEffect(()=>{oe==="Completed"&&d&&Z.cards.length===1&&(Z.cards[0].status.code==="inactive"&&Z.cards[0].type.code==="business_physical_credit_card"?n(`./${Z.cards[0].id}/activate`):Z.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${Z.cards[0].id}`)))},[oe,d,r.state,n,Z.cards]),i.useEffect(()=>{if(oe==="Completed"&&d){const z=Z.cards.length,De=Z.cards.filter(He=>He.cardHolderUserId===A?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&z===De.length&&n("./onboard")}},[oe,Z.cards,d,n,A?.userId]),i.useEffect(()=>{oe!=="Completed"||N&&de.fetchState!=="Completed"||O&&v&&G&&we.fetchState!=="Completed"||J.trackCardsCardListView($,ra,We,ta,na)},[oe,ea,de.fetchState,we.fetchState,G]),A==null)throw Error("Can't access charge card list page without signing in...");const Oa=y(z=>Pt(z.userState,z.userRoleState,z.userListViewState,"cardAdmin")),ha=Ya(E?.loggedInUserRoleMap),fa=z=>{h(z)},M=Z.creditAccount.limit,me=()=>{C(!1),n("..")},Te=f.companyChargeCardInfo?.info!=null&&Qe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:N,isTOSAccepted:ne,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:ha}),Ve=f.companyDebitCardInfo?.info!=null&&Qe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:O,isTOSAccepted:Q,isSetupEnabled:v,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:ha});return re||v?s.jsxs(s.Fragment,{children:[oe==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Qa,{analytics:J,onLoad:()=>{J.trackPageLoaded(Nt.Event.cardsListPage),(N&&!re||O&&!v)&&J.trackCardsPromoView($,{isCreditCardOffered:N,isDebitCardOffered:O,isDebitCardEnabled:v,isCreditCardEnabled:re},"Banner",O&&!v?"Debit Card":N&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Le})]}):null,m===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:m,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(O&&v&&G)||we.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!N||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!G||Be.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Wr,{children:[s.jsx(Ca,{isAppContentDrawerOpen:k,handleDrawerToggle:fa}),s.jsx(qr,{isCashbackFeatureEnabled:P,isChargeCardFeatureEnabled:N,isDebitCardFeatureEnabled:O,isCreditCardProductVisibleForExpressInterest:R,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:p,creditCardPayNowThreshold:se,signedInUser:A,chargeCardListState:Z,location:r,admins:Oa.users,navigateAndClearBulkSelection:n,currentTenant:f,isCardControlsEnabled:ae,companyChargeCardInfoCreditAccountLimit:f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:f.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:G,includeCreditAccountDebitSummaryAndCashbackInfo:D,onClickMenuIcon:()=>{fa(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:v,isEarlyPayEnabled:l,isChargeCardPaymentHistoryFeatureEnabled:w,cashbackRate:x,controllerEmails:$,chargeCardCashbackDetailState:Be,depositAccountListWithDebitCardIssued:we,isChargeCardTOSAccepted:ne,isDebitCardTOSAccepted:Q,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:Pe.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:b,onAskAiCfoClick:g,isCardsCommentingEnabled:T})]})]}):(ne||Q)&&G===!0?s.jsx(ga,{to:"../setup"}):Te||Ve?s.jsx(ga,{to:"../promo"}):s.jsx(Ke,{fetchState:oe})}const Jr=e=>`/${e}/cards/new`,Qr=e=>`/${e}/cards/payment`,Xr=e=>`/${e}/cards/payment-history`,es=pe(function(e){const t=X.getSignedInUser(),a=ie(e),r=e.tenantState.currentTenantId,n=Tt(e),m={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},C=a?.companyName??"",p=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:vn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:m,companyName:C,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:p}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),m=n.poppedPathname??"..";r(m,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,m)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:m}}})},onFiltersChange:n=>{e(Bn({filters:n}))},onReloadPayments:()=>{e(Ft(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(xn({uiState:{downloadState:n}}))}}})(gr);function as(){const e=le(),t=ge(),a=ue(),{areTenantIdsInSync:r}=jt(),{useFeatureGate:n}=ce();if(X.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const m=y(q=>ie(q)),C=y(q=>Tt(q)),[p,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(null),F=!m.userRole.includes("charge_card_user"),k=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:h}=n(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:b}=n(Y.isDebitCardFeatureEnabled),g=Se(b,m),d=Ie({isDebitCardFeatureEnabled:b,isBankingOnlyTenant:g}),D=be(m),v=ye(m),j=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:h,isBookKeepingTenant:v,isDebitCardProductVisible:d,chargeCardsCreditAccountLimit:j}),P=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,V=je(),u=Ue(V?.loggedInUserRoleMap),l=y(q=>Ze(q,F,d&&k,L&&P)),w=i.useMemo(()=>{const q=l.cards.filter($=>$.type.code.includes("debit"));return[...new Set(q.map($=>$.connectedAccountId))]},[l.cards]),T=y(q=>Ye(q)),H=y(q=>va(q,w)),{creditAccountRepayment:O}=y(q=>Ge(q)),K=i.useMemo(()=>Xa(u,T),[u,T]),I=i.useMemo(()=>ma(L,P,u,l.creditAccount,O),[L,P,u,l.creditAccount,O]),B=i.useMemo(()=>et(d,k,u,H,l.debitCardSummary),[d,k,u,H,l.debitCardSummary]),N=i.useMemo(()=>Re(L,d,k,P),[L,d,k,P]),R=l.creditAccount.balance.amount+l.creditAccount.hold.amount,W=i.useMemo(()=>f!=null?C.repaymentHistory.find(q=>q.cardRepaymentId===f):void 0,[f,C.repaymentHistory]),E=i.useCallback(q=>{U(q),a(Ia(F,d&&k,L&&P,!1)),A(!0)},[a,F,d,k,L,P]),G=i.useCallback(()=>{A(!1),U(null),document.body.style.overflow="auto"},[]);return i.useEffect(()=>{p||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(S(!0),a(Ft()))},[p,a,C.fetchState]),i.useEffect(()=>{!o&&(P||k)&&r&&(c(!0),a(Ia(F,!1,L&&P,!1)))},[o,P,k,r,a,F,L]),s.jsxs(s.Fragment,{children:[_?s.jsx(at,{closeDrawerHandler:G,isPaymentDrawerOpen:_,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:R,productInformation:N,creditAccountInformation:I,debitAccountInformation:B,cashbackInformation:K,isDebitCardInfoFetchStateCompleted:!(d&&k&&u)||H.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!L||O.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!u||T.fetchState==="Completed",paymentInitiatedDate:O.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(es,{location:t,navigate:e,accountInfoByAccountId:C.accountInfoByAccountId,onRetryPaymentClick:E})]})}const it=_e.div`
25
+ `,qr=pe(function(e,t){const a=Ze(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:In(e),bulkActionView:An(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:m,chargeCardListState:C,includeCreditAccountDebitSummaryAndCashbackInfo:p,isChargeCardFeatureEnabled:S,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:c,isDebitCardFeatureEnabled:_,isDebitCardSetupEnabled:A,isDebitCardTOSAccepted:f,isChargeCardTOSAccepted:U,controllerEmails:F,depositAccountListWithDebitCardIssued:k,primaryFundingAccountDetails:h,chargeCardSetUpViewFetchState:b,productInformation:g,cashbackInformation:d,creditAccountInformation:D,debitAccountInformation:v,updatePayNowInfoTooltip:j,isUserHasCardsAdminLevelAccess:O}=t,{tenantEmailDomain:P}=r,{cards:V}=C;return{onChargeCardRowClick:(u,l)=>{const w=zt(V,u);let T;w!=null&&((B=>{const K=B.limit.amount-B.available.amount,I=`${B.cardHolderUser?.firstName.toLowerCase()} ${B.cardHolderUser?.lastName.toLowerCase()}`,L=B.cardName,N=B.department?.className??"",R=B.limit.amount,W=B.creditLimitFrequency.name;J.trackCardsListRowClicked(I,L,N,K,R,W,m.userId===B.cardHolderUserId)})(w),Me(_,A,k)&&J.trackCardsCardListRowClick(F,g,"Card Row Item","row_clicked",l+1,{cardOwner:Va(w.cardHolderUser,!1),cardName:w.cardName,cardType:w.type.code.includes("credit")?"credit":"debit",cardStatus:w.status.code,cardUtilizationAmount:Je(w.limit.amount-w.available.amount),cardUtilizationPercent:w.limit.amount>0?Math.round((w.limit.amount-w.available.amount)/w.limit.amount*100):0,cardLimit:Je(w.limit.amount)},d,D,v)),T=w?.status.code==="request_on_hold"&&m.userId===w.cardHolderUserId?$t(P):Ce(P,u,m,w);const H=fe(n.state?.pathnameStackToGoBack,n.pathname);a(T,{state:{pathnameStackToGoBack:H}})},onFetchChargeCardsRecurringExpenses:u=>{e(Et(u))},onFetchDepositAccountLimit:u=>{e(bt({depositAccountId:u}))},onChargeCardResendInviteClick:u=>{e(Fn(u))},onChargeCardRevokeInviteClick:u=>{e(It(u))},onLockChargeCardList:(u,l)=>{e(Tn(u,l))},onUnlockChargeCardList:u=>{e(Pn(u))},onCloseChargeCardList:(u,l)=>{e(wn(u,l))},onRevokeChargeCardList:u=>{e(_n(u))},updateChargeCardListSpendLimit(u,l,w){e(Dn(u,l,w.code))},onLockChargeCard:(u,l)=>{e(_t(O,u,l))},onUnlockChargeCard:u=>{e(Dt(O,u))},onCloseChargeCard:(u,l)=>{e(kt(u,l))},onUpdateSpendLimit(u,l,w,T){e(yt(u,l,w.code,T))},updateChargeCardName:(u,l)=>{e(At(O,u,l))},onClickSetupIcon:()=>{J.trackCardsListPageClicked("settings"),Me(_,A,k)&&d!=null&&J.trackCardsSettingsClick(F,g,d,D,v);const u=xr(P),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onIssueCardClick:()=>{J.trackCardsListPageClicked("new card"),Me(_,A,k)&&d!=null&&J.trackCardsNewCardClick(F,g,d,"New Button","card_creation_initiated","Card List",D,v);const u=Jr(P),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onColumnSortConfigChanged:(u,l)=>{Me(_,A,k)&&d!=null&&J.trackCardsCardListSortClick(F,g,d,"Sort Icon","sort",u,l==="ascending"?"ASC":"DESC","Cards List",D,v),e(Na({uiState:{sortKey:u,sortOrder:l}}))},onSearchTextChanged:u=>{e(kn(u))},onReloadCards:()=>{e(Ia(p,_&&A,S&&c,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(_,A,k)&&d!=null&&J.trackCardsCashbackOverviewClick(F,g,d,"Cashback Overview","cashback_details_viewed",D,v),a("./cashback")},onClickStatementsIcon:()=>{Me(_,A,k)&&d!=null&&J.trackCardsStatementsClick(F,g,d,D,v),a("./statements")},onCreateNowClick:u=>{Me(_,A,k)&&d!=null&&J.trackCardsNewCardClick(F,g,d,"Promo Banner","card_creation_initiated","Card List",D,v),a(`./new?cardType=${u}`)},onPromoCardClick:u=>{a(u==="debit"&&_&&!f||u==="credit"&&o&&!U?`../promo?cardPromoType=${u}`:"./setup")},navigateToCreditCardPaymentPage:(u,l)=>{b==="Completed"&&r.company!=null&&d!=null&&J.trackCardsPayEarlyClick(F,g,d,"Card List",u,l,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:h?.accType==="depositAccount",creditCardPaymentSourceAccountName:h?.label,creditCardPaymentSourceAccountType:h?.accType,creditCardPaymentSourceLastFourDigits:h?.accountLast4,creditCardPaymentSourceBalance:h?.accountBalance?.available?.amount??0},D,v);const w=Qr(P);a(w)},navigateToCreditCardPaymentHistoryPage:()=>{const u=Xr(P),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},shouldShowPayNowInfoTooltip:j,onSetRowActionCardId:u=>{e(En(u))},onSetBulkActionCardIds:u=>{e(wt(u))}}})(fr);function ct({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=ge(),n=i.useCallback((z,De)=>{a(wt([])),t(z,De)},[a,t]),[m,C]=i.useState(!1),[p,S]=i.useState(X.getPayNowInfoTooltip()??!1),o=z=>{X.savePayNowInfoTooltip(z),S(z)},[c,_]=i.useState(!1),A=X.getSignedInUser(),f=y(z=>ie(z)),[U,F]=i.useState(!1),[k,h]=i.useState(!1),{isAiCfoAccessEnabled:b,onAskAiCfoClick:g}=Gt({mobileExploreReferrer:"Cards"}),d=f.userRole.includes("charge_card_user"),D=!d,v=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:j,useDynamicConfig:O}=ce(),{isFeatureEnabled:P}=j(Y.isCashbackFeatureEnabled),{isFeatureEnabled:V}=j(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=j(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=j(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:w}=j(Y.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:T}=j(Y.isCardsCommentingEnabled),H=Se(u,f),B=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:H}),K=be(f),I=ye(f),L=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,N=Ae({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:L}),R=Mt({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I}),{configValue:W}=O(Fe.zeniCardsConfig),E=je(),G=Ue(E?.loggedInUserRoleMap),q=y(z=>ze(z,f.companyId)),$=$e(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,se=W.credit_card_pay_now_threshold_by_company_id?.[f.companyId]??W.default_credit_card_pay_now_threshold??vr,ae=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(f.companyId),ne=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Q=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(z=>ht(z)),xe=Ja(Ee.updateStatus),Z=y(z=>Ze(z,D,B&&v,N&&re)),he=Z.cards.filter(z=>z.type.code.includes("debit")).map(z=>z.connectedAccountId),ke=[...new Set(he)],Le=y(z=>Ye(z)),we=y(z=>va(z,ke)),Pe=y(z=>da(z,f.companyId)),ee=Pe.companyChargeCardInfo?.primaryFundingAccount,pa=Pe.allFundingAccounts.find(z=>z.id===ee?.accountId),oe=Z.fetchState,ea=Z.creditAccount;Yt({isDataReady:oe==="Completed"});const{creditAccountRepayment:de}=y(z=>Ge(z)),Oe=y(z=>ka(z).firstViewAfterActivation),{areTenantIdsInSync:aa}=jt(),We=Xa(G,Le),ta=ma(N,re,G,ea,de),na=et(B,v,G,we,Z.debitCardSummary),ra=Re(N,B,v,re),sa=Z.creditAccount.balance.amount+Z.creditAccount.hold.amount;if(i.useEffect(()=>{oe==="Completed"&&(X.getPayNowInfoTooltip()==null||sa<se*Z.creditAccount.limit.amount/100)&&o(!0)},[oe,se,sa,Z.creditAccount.limit.amount]),i.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),C(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){C(!1),document.body.style.overflow="auto";const z=Ne(f.tenantEmailDomain);n(z)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,f.tenantEmailDomain]),i.useEffect(()=>{!U&&(re||v)&&aa&&(F(!0),a(Ia(D,B&&v,N&&re,!1)))},[U,D,a,aa]),i.useEffect(()=>{Oe&&c===!1&&(_(!0),setTimeout(()=>{a(Sa())},5e3))},[Oe,c]),i.useEffect(()=>{oe==="Completed"&&d&&Z.cards.length===1&&(Z.cards[0].status.code==="inactive"&&Z.cards[0].type.code==="business_physical_credit_card"?n(`./${Z.cards[0].id}/activate`):Z.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${Z.cards[0].id}`)))},[oe,d,r.state,n,Z.cards]),i.useEffect(()=>{if(oe==="Completed"&&d){const z=Z.cards.length,De=Z.cards.filter(He=>He.cardHolderUserId===A?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&z===De.length&&n("./onboard")}},[oe,Z.cards,d,n,A?.userId]),i.useEffect(()=>{oe!=="Completed"||N&&de.fetchState!=="Completed"||B&&v&&G&&we.fetchState!=="Completed"||J.trackCardsCardListView($,ra,We,ta,na)},[oe,ea,de.fetchState,we.fetchState,G]),A==null)throw Error("Can't access charge card list page without signing in...");const Ba=y(z=>Pt(z.userState,z.userRoleState,z.userListViewState,"cardAdmin")),ha=Ya(E?.loggedInUserRoleMap),fa=z=>{h(z)},M=Z.creditAccount.limit,me=()=>{C(!1),n("..")},Te=f.companyChargeCardInfo?.info!=null&&Qe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:N,isTOSAccepted:ne,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:ha}),Ve=f.companyDebitCardInfo?.info!=null&&Qe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:B,isTOSAccepted:Q,isSetupEnabled:v,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:ha});return re||v?s.jsxs(s.Fragment,{children:[oe==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Qa,{analytics:J,onLoad:()=>{J.trackPageLoaded(Nt.Event.cardsListPage),(N&&!re||B&&!v)&&J.trackCardsPromoView($,{isCreditCardOffered:N,isDebitCardOffered:B,isDebitCardEnabled:v,isCreditCardEnabled:re},"Banner",B&&!v?"Debit Card":N&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Oe})]}):null,m===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:m,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(B&&v&&G)||we.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!N||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!G||Le.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Wr,{children:[s.jsx(Ca,{isAppContentDrawerOpen:k,handleDrawerToggle:fa}),s.jsx(qr,{isCashbackFeatureEnabled:P,isChargeCardFeatureEnabled:N,isDebitCardFeatureEnabled:B,isCreditCardProductVisibleForExpressInterest:R,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:p,creditCardPayNowThreshold:se,signedInUser:A,chargeCardListState:Z,location:r,admins:Ba.users,navigateAndClearBulkSelection:n,currentTenant:f,isCardControlsEnabled:ae,companyChargeCardInfoCreditAccountLimit:f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:f.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:G,includeCreditAccountDebitSummaryAndCashbackInfo:D,onClickMenuIcon:()=>{fa(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:v,isEarlyPayEnabled:l,isChargeCardPaymentHistoryFeatureEnabled:w,cashbackRate:x,controllerEmails:$,chargeCardCashbackDetailState:Le,depositAccountListWithDebitCardIssued:we,isChargeCardTOSAccepted:ne,isDebitCardTOSAccepted:Q,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:Pe.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:b,onAskAiCfoClick:g,isCardsCommentingEnabled:T})]})]}):(ne||Q)&&G===!0?s.jsx(ga,{to:"../setup"}):Te||Ve?s.jsx(ga,{to:"../promo"}):s.jsx(Ke,{fetchState:oe})}const Jr=e=>`/${e}/cards/new`,Qr=e=>`/${e}/cards/payment`,Xr=e=>`/${e}/cards/payment-history`,es=pe(function(e){const t=X.getSignedInUser(),a=ie(e),r=e.tenantState.currentTenantId,n=Tt(e),m={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},C=a?.companyName??"",p=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:vn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:m,companyName:C,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:p}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),m=n.poppedPathname??"..";r(m,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,m)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:m}}})},onFiltersChange:n=>{e(Ln({filters:n}))},onReloadPayments:()=>{e(Ft(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(xn({uiState:{downloadState:n}}))}}})(gr);function as(){const e=le(),t=ge(),a=ue(),{areTenantIdsInSync:r}=jt(),{useFeatureGate:n}=ce();if(X.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const m=y(q=>ie(q)),C=y(q=>Tt(q)),[p,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(null),F=!m.userRole.includes("charge_card_user"),k=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:h}=n(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:b}=n(Y.isDebitCardFeatureEnabled),g=Se(b,m),d=Ie({isDebitCardFeatureEnabled:b,isBankingOnlyTenant:g}),D=be(m),v=ye(m),j=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,O=Ae({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:h,isBookKeepingTenant:v,isDebitCardProductVisible:d,chargeCardsCreditAccountLimit:j}),P=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,V=je(),u=Ue(V?.loggedInUserRoleMap),l=y(q=>Ze(q,F,d&&k,O&&P)),w=i.useMemo(()=>{const q=l.cards.filter($=>$.type.code.includes("debit"));return[...new Set(q.map($=>$.connectedAccountId))]},[l.cards]),T=y(q=>Ye(q)),H=y(q=>va(q,w)),{creditAccountRepayment:B}=y(q=>Ge(q)),K=i.useMemo(()=>Xa(u,T),[u,T]),I=i.useMemo(()=>ma(O,P,u,l.creditAccount,B),[O,P,u,l.creditAccount,B]),L=i.useMemo(()=>et(d,k,u,H,l.debitCardSummary),[d,k,u,H,l.debitCardSummary]),N=i.useMemo(()=>Re(O,d,k,P),[O,d,k,P]),R=l.creditAccount.balance.amount+l.creditAccount.hold.amount,W=i.useMemo(()=>f!=null?C.repaymentHistory.find(q=>q.cardRepaymentId===f):void 0,[f,C.repaymentHistory]),E=i.useCallback(q=>{U(q),a(Ia(F,d&&k,O&&P,!1)),A(!0)},[a,F,d,k,O,P]),G=i.useCallback(()=>{A(!1),U(null),document.body.style.overflow="auto"},[]);return i.useEffect(()=>{p||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(S(!0),a(Ft()))},[p,a,C.fetchState]),i.useEffect(()=>{!o&&(P||k)&&r&&(c(!0),a(Ia(F,!1,O&&P,!1)))},[o,P,k,r,a,F,O]),s.jsxs(s.Fragment,{children:[_?s.jsx(at,{closeDrawerHandler:G,isPaymentDrawerOpen:_,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:R,productInformation:N,creditAccountInformation:I,debitAccountInformation:L,cashbackInformation:K,isDebitCardInfoFetchStateCompleted:!(d&&k&&u)||H.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!O||B.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!u||T.fetchState==="Completed",paymentInitiatedDate:B.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(es,{location:t,navigate:e,accountInfoByAccountId:C.accountInfoByAccountId,onRetryPaymentClick:E})]})}const it=_e.div`
26
26
  display: flex;
27
27
  height: 100vh;
28
28
  width: 100%;
@@ -31,7 +31,7 @@ import{j as s}from"./liveblocks-yYJhhlwl.js";import{j as le,l as ia,h as ue,g as
31
31
  overflow: auto;
32
32
  align-items: center;
33
33
  background-color: ${e=>e.theme.colors.grey4};
34
- `,dt=qa.getLocalizedStrings().months;function ts(){const e=le(),t=ue(),a=ge(),{creditAccount:r,creditAccountRepayment:n}=y(I=>Ge(I)),m=`${Rt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[C,p]=i.useState(!1),[S,o]=i.useState(!1),c=y(I=>Ln(I)),{useFeatureGate:_}=ce(),A=y(I=>ie(I)),{isFeatureEnabled:f}=_(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:U}=_(Y.isDebitCardFeatureEnabled),F=Se(U,A),k=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:F}),h=be(A),b=ye(A),g=A.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:f,isBookKeepingTenant:b,isDebitCardProductVisible:k,chargeCardsCreditAccountLimit:g}),D=!!A.companyDebitCardInfo?.info?.isDebitCardEnabled,v=!!A.companyChargeCardInfo?.info?.isChargeCardEnabled,j=y(I=>ze(I,A.companyId)),L=$e(j.controllers),P=y(I=>vt(I)),V=P.cards.filter(I=>I.type.code.includes("debit")).map(I=>I.connectedAccountId),u=[...new Set(V)],l=y(I=>va(I,u)),w=y(I=>On(I));i.useEffect(()=>{S||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(p(!0),t(za()))},[C,t,r.fetchState]),i.useEffect(()=>{S||r.fetchState!=="Completed"||r.id==null||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(o(!0),t(Un(r.id)))},[S,t,r.fetchState,r.id,c.fetchState]),i.useEffect(()=>{l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&k&&D&&t(xt()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&t(ca()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&k&&D&&t(Rn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&d&&v&&t($a())},[l.fetchState,k,D,P.fetchState,w.fetchState,n.fetchState,d,v]),i.useEffect(()=>{if(c.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&P.fetchState==="Completed"&&(!k||!D||l.fetchState==="Completed"&&w.fetchState==="Completed")){let I="",B="";if(c.statements.length>0){const E=c.statements[c.statements.length-1].period,[G,q]=E.split("-"),$=c.statements[0].period,[x,se]=$.split("-");I=`${dt[parseInt(q)-1]} ${G}`,B=`${dt[parseInt(se)-1]} ${x}`}const N=Re(d,k,D,v),R=ma(d,v,!0,r,n),W=et(k,D,!0,l,w);J.trackCardsCreditCardStatementsView(L,N,{numberOfStatements:c.statements.length,oldestStatementMonthYear:I,latestStatementMonthYear:B},R,W)}},[c.fetchState,r.fetchState,n.fetchState,l.fetchState,P.fetchState,w.fetchState]);const T=()=>{const I=ve(a.state?.pathnameStackToGoBack),B=I.poppedPathname??"..";e(B,{state:{pathnameStackToGoBack:I.newStack}})},H=y(I=>Ye(I)),O=X.getSignedInUser(),K={userId:O?.userId??"",sessionId:O?.zeniSessionId??"",tenantId:A.tenantId??""};if(O==null)throw Error("Can't access address page without signing in...");if(c.fetchState!=="Completed")return s.jsx(it,{children:s.jsx(br,{onBackClick:T})});{const I=Re(d,k,D,v);return s.jsx(it,{children:s.jsx(yr,{currentTenantCompanyName:A.companyName,statementListView:c,productInformation:I,onBackClick:T,authParams:K,controllerEmails:L,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:k,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:v,chargeCardCashbackDetailState:H,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:l,debitCardSummary:w,downloadEndPoint:m})})}}const ns={containerWidth:new ua(100,58)},rs=({appContent:e})=>{const t=la(),a=ue(),r=le(),n=ge(),{useDynamicConfig:m}=ce(),[C,p]=i.useState(!1),[S,o]=i.useState(!1),[c,_]=i.useState(!1),[A,f]=i.useState(!1),[U,F]=i.useState(!1),[k,h]=i.useState(!1),b=X.getSignedInUser();if(b==null)throw Error("Can't access onboarding card page without signing in...");const g=y(R=>ie(R)),{configValue:d}=m(Fe.zeniCardsConfig),D=y(R=>jn(R)),{tenantEmailDomain:v}=g,j=y(R=>R.settingsViewState.profile.fetchState),L=y(R=>R.chargeCardListState.fetchState),P=y(R=>R.settingsViewState.profile.userId),V=y(R=>R.chargeCardConfigState.fetchState);i.useEffect(()=>{C===!1&&j!=="In-Progress"&&j!=="Completed"&&(a(Nn()),p(!0)),S===!1&&V!=="In-Progress"&&V!=="Completed"&&(a(Da()),o(!0)),c===!1&&L==="Not-Started"&&(_(!0),a(ca()))},[C,c,L,S,V]),i.useEffect(()=>{j==="Completed"&&U===!1&&P!=null&&L==="Completed"&&D.cards.length>0&&(a(Vn({userId:P})),a(Bt({cardId:D.cards[D.cards.length-1].id})),F(!0))},[j,U,P,L]),i.useEffect(()=>{if(!A&&D.fetchState==="Completed"&&D.cards.length===0){const R=ve(n.state?.pathnameStackToGoBack),W=R.poppedPathname??Ne(v);r(W,{state:{pathnameStackToGoBack:R.newStack}})}},[D.fetchState,D.cards,A]);const u=y(R=>ka(R)),l=Ja(u.updateStatus.fetchState),w=u.currentDisplayedCardId,{useFeatureGate:T}=ce(),{isFeatureEnabled:H}=T(Y.isChargeCardFeatureEnabled),O=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,K=!g.userRole.includes("charge_card_user")&&H&&O,I=y(R=>w!=null?Lt(R.chargeCardState,w):null),B=()=>{w!=null&&(a(Xe(w,K,!0)),a(ca()),f(!0))};i.useEffect(()=>{if(A&&w!=null&&I!=null&&I.status.code!=="request_on_hold"){const R=Ce(g.tenantEmailDomain,w,b,I),W=fe(n.state?.pathnameStackToGoBack,n.pathname);a(Hn()),I?.type.code==="business_virtual_credit_card"&&a(_a()),r(R,{state:{pathnameStackToGoBack:W},replace:!0})}},[A,I?.status.code]),i.useEffect(()=>{l==="In-Progress"&&u.updateStatus.fetchState==="Completed"&&setTimeout(B,3e3)},[l,u.updateStatus.fetchState]);const N=R=>{h(R)};if(!A&&L!=="Completed"||j!=="Completed"||D.cards.length===0)return s.jsx(Ke,{fetchState:"In-Progress"});if(P==null)throw Error("Can't access my userId.");return s.jsxs(cs,{children:[s.jsx(Ca,{isAppContentDrawerOpen:k,handleDrawerToggle:N}),s.jsx(ss,{chargeCardListView:D,cardUserOnboardingView:u,navigate:r,currentTenant:g,myUserId:P,location:n,chargeCardCashbackRatePerTransaction:d.charge_card_cashback_rate_per_transaction!=null?d.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{N(!0)}}),e!=null?s.jsx(os,{windowSize:t,children:e}):null]})},ss=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const m=Ze(e,!1,!1,!1);let C=!1;return m.fetchState==="Completed"&&m.cards.length<=1&&(C=!0),{cards:r.cards,showMenuIcon:C,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:m}=t,{tenantEmailDomain:C}=m;return{updateCardUserOnboardingLocalData:p=>{e(rt({localData:p}))},onGetOtp:p=>{if(r.cardUserOnboardingLocalData!=null){const S={...r.cardUserOnboardingLocalData,phone:p};e(rt({localData:S}))}e(Ta(p,"CardUserOnboarding"))},onResendOtp:p=>{e(Pa(p,"CardUserOnboarding"))},onVerifyOtp:(p,S)=>{e(wa(p,S,"CardUserOnboarding"))},onVerifyOtpSuccess:p=>{e(Mn()),p!=null&&X.saveZeniOtpToken(p)},setCurrentDisplayedCardId:p=>{e(Bt({cardId:p}))},onBackClick:()=>{const p=ve(n.state?.pathnameStackToGoBack),S=p.poppedPathname??Ne(C);a(S,{state:{pathnameStackToGoBack:p.newStack}})}}})(Sr),os=_e.div`
34
+ `,dt=qa.getLocalizedStrings().months;function ts(){const e=le(),t=ue(),a=ge(),{creditAccount:r,creditAccountRepayment:n}=y(I=>Ge(I)),m=`${Rt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[C,p]=i.useState(!1),[S,o]=i.useState(!1),c=y(I=>On(I)),{useFeatureGate:_}=ce(),A=y(I=>ie(I)),{isFeatureEnabled:f}=_(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:U}=_(Y.isDebitCardFeatureEnabled),F=Se(U,A),k=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:F}),h=be(A),b=ye(A),g=A.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:f,isBookKeepingTenant:b,isDebitCardProductVisible:k,chargeCardsCreditAccountLimit:g}),D=!!A.companyDebitCardInfo?.info?.isDebitCardEnabled,v=!!A.companyChargeCardInfo?.info?.isChargeCardEnabled,j=y(I=>ze(I,A.companyId)),O=$e(j.controllers),P=y(I=>vt(I)),V=P.cards.filter(I=>I.type.code.includes("debit")).map(I=>I.connectedAccountId),u=[...new Set(V)],l=y(I=>va(I,u)),w=y(I=>Bn(I));i.useEffect(()=>{S||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(p(!0),t(za()))},[C,t,r.fetchState]),i.useEffect(()=>{S||r.fetchState!=="Completed"||r.id==null||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(o(!0),t(Un(r.id)))},[S,t,r.fetchState,r.id,c.fetchState]),i.useEffect(()=>{l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&k&&D&&t(xt()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&t(ca()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&k&&D&&t(Rn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&d&&v&&t($a())},[l.fetchState,k,D,P.fetchState,w.fetchState,n.fetchState,d,v]),i.useEffect(()=>{if(c.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&P.fetchState==="Completed"&&(!k||!D||l.fetchState==="Completed"&&w.fetchState==="Completed")){let I="",L="";if(c.statements.length>0){const E=c.statements[c.statements.length-1].period,[G,q]=E.split("-"),$=c.statements[0].period,[x,se]=$.split("-");I=`${dt[parseInt(q)-1]} ${G}`,L=`${dt[parseInt(se)-1]} ${x}`}const N=Re(d,k,D,v),R=ma(d,v,!0,r,n),W=et(k,D,!0,l,w);J.trackCardsCreditCardStatementsView(O,N,{numberOfStatements:c.statements.length,oldestStatementMonthYear:I,latestStatementMonthYear:L},R,W)}},[c.fetchState,r.fetchState,n.fetchState,l.fetchState,P.fetchState,w.fetchState]);const T=()=>{const I=ve(a.state?.pathnameStackToGoBack),L=I.poppedPathname??"..";e(L,{state:{pathnameStackToGoBack:I.newStack}})},H=y(I=>Ye(I)),B=X.getSignedInUser(),K={userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:A.tenantId??""};if(B==null)throw Error("Can't access address page without signing in...");if(c.fetchState!=="Completed")return s.jsx(it,{children:s.jsx(br,{onBackClick:T})});{const I=Re(d,k,D,v);return s.jsx(it,{children:s.jsx(yr,{currentTenantCompanyName:A.companyName,statementListView:c,productInformation:I,onBackClick:T,authParams:K,controllerEmails:O,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:k,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:v,chargeCardCashbackDetailState:H,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:l,debitCardSummary:w,downloadEndPoint:m})})}}const ns={containerWidth:new ua(100,58)},rs=({appContent:e})=>{const t=la(),a=ue(),r=le(),n=ge(),{useDynamicConfig:m}=ce(),[C,p]=i.useState(!1),[S,o]=i.useState(!1),[c,_]=i.useState(!1),[A,f]=i.useState(!1),[U,F]=i.useState(!1),[k,h]=i.useState(!1),b=X.getSignedInUser();if(b==null)throw Error("Can't access onboarding card page without signing in...");const g=y(R=>ie(R)),{configValue:d}=m(Fe.zeniCardsConfig),D=y(R=>jn(R)),{tenantEmailDomain:v}=g,j=y(R=>R.settingsViewState.profile.fetchState),O=y(R=>R.chargeCardListState.fetchState),P=y(R=>R.settingsViewState.profile.userId),V=y(R=>R.chargeCardConfigState.fetchState);i.useEffect(()=>{C===!1&&j!=="In-Progress"&&j!=="Completed"&&(a(Nn()),p(!0)),S===!1&&V!=="In-Progress"&&V!=="Completed"&&(a(Da()),o(!0)),c===!1&&O==="Not-Started"&&(_(!0),a(ca()))},[C,c,O,S,V]),i.useEffect(()=>{j==="Completed"&&U===!1&&P!=null&&O==="Completed"&&D.cards.length>0&&(a(Vn({userId:P})),a(Lt({cardId:D.cards[D.cards.length-1].id})),F(!0))},[j,U,P,O]),i.useEffect(()=>{if(!A&&D.fetchState==="Completed"&&D.cards.length===0){const R=ve(n.state?.pathnameStackToGoBack),W=R.poppedPathname??Ne(v);r(W,{state:{pathnameStackToGoBack:R.newStack}})}},[D.fetchState,D.cards,A]);const u=y(R=>ka(R)),l=Ja(u.updateStatus.fetchState),w=u.currentDisplayedCardId,{useFeatureGate:T}=ce(),{isFeatureEnabled:H}=T(Y.isChargeCardFeatureEnabled),B=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,K=!g.userRole.includes("charge_card_user")&&H&&B,I=y(R=>w!=null?Ot(R.chargeCardState,w):null),L=()=>{w!=null&&(a(Xe(w,K,!0)),a(ca()),f(!0))};i.useEffect(()=>{if(A&&w!=null&&I!=null&&I.status.code!=="request_on_hold"){const R=Ce(g.tenantEmailDomain,w,b,I),W=fe(n.state?.pathnameStackToGoBack,n.pathname);a(Hn()),I?.type.code==="business_virtual_credit_card"&&a(_a()),r(R,{state:{pathnameStackToGoBack:W},replace:!0})}},[A,I?.status.code]),i.useEffect(()=>{l==="In-Progress"&&u.updateStatus.fetchState==="Completed"&&setTimeout(L,3e3)},[l,u.updateStatus.fetchState]);const N=R=>{h(R)};if(!A&&O!=="Completed"||j!=="Completed"||D.cards.length===0)return s.jsx(Ke,{fetchState:"In-Progress"});if(P==null)throw Error("Can't access my userId.");return s.jsxs(cs,{children:[s.jsx(Ca,{isAppContentDrawerOpen:k,handleDrawerToggle:N}),s.jsx(ss,{chargeCardListView:D,cardUserOnboardingView:u,navigate:r,currentTenant:g,myUserId:P,location:n,chargeCardCashbackRatePerTransaction:d.charge_card_cashback_rate_per_transaction!=null?d.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{N(!0)}}),e!=null?s.jsx(os,{windowSize:t,children:e}):null]})},ss=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const m=Ze(e,!1,!1,!1);let C=!1;return m.fetchState==="Completed"&&m.cards.length<=1&&(C=!0),{cards:r.cards,showMenuIcon:C,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:m}=t,{tenantEmailDomain:C}=m;return{updateCardUserOnboardingLocalData:p=>{e(rt({localData:p}))},onGetOtp:p=>{if(r.cardUserOnboardingLocalData!=null){const S={...r.cardUserOnboardingLocalData,phone:p};e(rt({localData:S}))}e(Ta(p,"CardUserOnboarding"))},onResendOtp:p=>{e(Pa(p,"CardUserOnboarding"))},onVerifyOtp:(p,S)=>{e(wa(p,S,"CardUserOnboarding"))},onVerifyOtpSuccess:p=>{e(Mn()),p!=null&&X.saveZeniOtpToken(p)},setCurrentDisplayedCardId:p=>{e(Lt({cardId:p}))},onBackClick:()=>{const p=ve(n.state?.pathnameStackToGoBack),S=p.poppedPathname??Ne(C);a(S,{state:{pathnameStackToGoBack:p.newStack}})}}})(Sr),os=_e.div`
35
35
  display: flex;
36
36
  flex-direction: column;
37
37
  width: ${e=>`${ns.containerWidth.value(e.windowSize)}%`};
@@ -44,7 +44,7 @@ import{j as s}from"./liveblocks-yYJhhlwl.js";import{j as le,l as ia,h as ue,g as
44
44
  flex-direction: column;
45
45
  align-items: center;
46
46
  background-color: ${e=>e.theme.colors.grey4};
47
- `,is={containerWidth:new ua(100,58)},ds=({appContent:e})=>{const t=la(),a=ue(),r=le(),{cardId:n}=ia(),m=ge(),{useDynamicConfig:C,useFeatureGate:p}=ce(),[S,o]=i.useState(!1),[c,_]=i.useState(!1),[A,f]=i.useState(!1),[U,F]=i.useState(!1),k=X.getSignedInUser();if(k==null)throw Error("Can't access onboarding card page without signing in...");const h=y(B=>ie(B));if(n==null)throw Error("Empty card id is not valid...");const{configValue:b}=C(Fe.zeniCardsConfig),g=y(B=>zn(B,n)),{isFeatureEnabled:d}=p(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:D}=p(Y.isDebitCardFeatureEnabled),v=Se(D,h),j=Ie({isDebitCardFeatureEnabled:D,isBankingOnlyTenant:v}),L=be(h),P=ye(h),V=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,u=Ae({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:d,isBookKeepingTenant:P,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:V}),l=g.chargeCard,w=y(B=>B.chargeCardConfigState.fetchState);i.useEffect(()=>{S===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(Da()),o(!0)),c===!1&&g.fetchState==="Not-Started"&&(_(!0),a(Xe(n,!1,u)))},[c,g.fetchState,S,w]);const T=l?.type.code==="business_physical_debit_card"||l?.type.code==="business_virtual_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(A===!1&&(T===!1||T&&l.status?.code!=="active"||T&&l.status.code==="active"&&l.isPinSet||l.cardHolderUserId!==k.userId)){const B=Ce(h.tenantEmailDomain,n,k,l,!0),N=fe(m.state?.pathnameStackToGoBack,m.pathname);r(B,{state:{pathnameStackToGoBack:N}})}else if(A&&g.isRefreshingViewInBackground===!1&&l?.isPinSet===!0){a($n({chargeCardId:n}));const B=Ce(h.tenantEmailDomain,n,k,l,!0),N=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(B,{state:{pathnameStackToGoBack:N}})}}},[g.fetchState,l?.type.code,A,g.isRefreshingViewInBackground]);const H=X.getZeniOtpTokenForCardHolder(n),O=y(B=>Ct(B.userState,k.userId)),K=()=>{l?.isPinSet!==!0&&a(Ga(n,!0))};i.useEffect(()=>{g.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(K,3e3),f(!0))},[g.updateDebitCardPinAttemptFetchState.fetchState]);const I=B=>{F(B)};if(w!=="Completed"||l==null)return s.jsx(Ke,{fetchState:"In-Progress"});if(O?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(ms,{children:[s.jsx(Ca,{isAppContentDrawerOpen:U,handleDrawerToggle:I}),s.jsx(ls,{cardId:n,card:l,phone:O.phone,signedInUser:k,isSandboxEnv:Ka(),debitCardDetailState:g,signedInUserToken:H,navigate:r,currentTenant:h,location:m,chargeCardCashbackRatePerTransaction:b.charge_card_cashback_rate_per_transaction!=null?b.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?s.jsx(us,{windowSize:t,children:e}):null]})},ls=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=pt(e,a),n=t.updateStatus,m=Ze(e,!1,!1,!1);let C=!1;return m.fetchState==="Completed"&&m.cards.length<=1&&(C=!0),{showMenuIcon:C,vgsVaultId:Ba.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,debitCardDetailState:C}=t,p=C.chargeCard?.cardProviderID,{tenantEmailDomain:S}=m;return{onGetOtp:o=>{p!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(St(r,o))},onResendOtp:o=>{p!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{p!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Gn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(Ir),us=_e.div`
47
+ `,is={containerWidth:new ua(100,58)},ds=({appContent:e})=>{const t=la(),a=ue(),r=le(),{cardId:n}=ia(),m=ge(),{useDynamicConfig:C,useFeatureGate:p}=ce(),[S,o]=i.useState(!1),[c,_]=i.useState(!1),[A,f]=i.useState(!1),[U,F]=i.useState(!1),k=X.getSignedInUser();if(k==null)throw Error("Can't access onboarding card page without signing in...");const h=y(L=>ie(L));if(n==null)throw Error("Empty card id is not valid...");const{configValue:b}=C(Fe.zeniCardsConfig),g=y(L=>zn(L,n)),{isFeatureEnabled:d}=p(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:D}=p(Y.isDebitCardFeatureEnabled),v=Se(D,h),j=Ie({isDebitCardFeatureEnabled:D,isBankingOnlyTenant:v}),O=be(h),P=ye(h),V=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,u=Ae({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:d,isBookKeepingTenant:P,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:V}),l=g.chargeCard,w=y(L=>L.chargeCardConfigState.fetchState);i.useEffect(()=>{S===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(Da()),o(!0)),c===!1&&g.fetchState==="Not-Started"&&(_(!0),a(Xe(n,!1,u)))},[c,g.fetchState,S,w]);const T=l?.type.code==="business_physical_debit_card"||l?.type.code==="business_virtual_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(A===!1&&(T===!1||T&&l.status?.code!=="active"||T&&l.status.code==="active"&&l.isPinSet||l.cardHolderUserId!==k.userId)){const L=Ce(h.tenantEmailDomain,n,k,l,!0),N=fe(m.state?.pathnameStackToGoBack,m.pathname);r(L,{state:{pathnameStackToGoBack:N}})}else if(A&&g.isRefreshingViewInBackground===!1&&l?.isPinSet===!0){a($n({chargeCardId:n}));const L=Ce(h.tenantEmailDomain,n,k,l,!0),N=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(L,{state:{pathnameStackToGoBack:N}})}}},[g.fetchState,l?.type.code,A,g.isRefreshingViewInBackground]);const H=X.getZeniOtpTokenForCardHolder(n),B=y(L=>Ct(L.userState,k.userId)),K=()=>{l?.isPinSet!==!0&&a(Ga(n,!0))};i.useEffect(()=>{g.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(K,3e3),f(!0))},[g.updateDebitCardPinAttemptFetchState.fetchState]);const I=L=>{F(L)};if(w!=="Completed"||l==null)return s.jsx(Ke,{fetchState:"In-Progress"});if(B?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(ms,{children:[s.jsx(Ca,{isAppContentDrawerOpen:U,handleDrawerToggle:I}),s.jsx(ls,{cardId:n,card:l,phone:B.phone,signedInUser:k,isSandboxEnv:Ka(),debitCardDetailState:g,signedInUserToken:H,navigate:r,currentTenant:h,location:m,chargeCardCashbackRatePerTransaction:b.charge_card_cashback_rate_per_transaction!=null?b.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?s.jsx(us,{windowSize:t,children:e}):null]})},ls=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=pt(e,a),n=t.updateStatus,m=Ze(e,!1,!1,!1);let C=!1;return m.fetchState==="Completed"&&m.cards.length<=1&&(C=!0),{showMenuIcon:C,vgsVaultId:La.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,debitCardDetailState:C}=t,p=C.chargeCard?.cardProviderID,{tenantEmailDomain:S}=m;return{onGetOtp:o=>{p!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(St(r,o))},onResendOtp:o=>{p!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{p!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Gn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(Ir),us=_e.div`
48
48
  display: flex;
49
49
  flex-direction: column;
50
50
  width: ${e=>`${is.containerWidth.value(e.windowSize)}%`};
@@ -59,7 +59,7 @@ import{j as s}from"./liveblocks-yYJhhlwl.js";import{j as le,l as ia,h as ue,g as
59
59
  align-items: center;
60
60
  background-color: ${e=>e.theme.colors.grey4};
61
61
  box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
62
- `,Cs={overlayWidth:new ua(Ua[12],Ua[12],Ua[9])},ps=pe(function(e,t){const a=Za(e,!1,!1),r=t.lineId,n=a.customAddress[r],m=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:m,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:m=>{a!=null&&e(Ot(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const C=Lr(m);e(Kn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:C})),e(Wn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Zn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(Ar),hs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=la(),m=()=>{t()},C=y(p=>Yn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,p))?.newAddressId;return s.jsx(Vt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:Cs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(p,S)=>(S==="backdropClick"||S==="escapeKeyDown")&&m(),children:s.jsx(ps,{googleAPIKey:Ba.googleMapsAPIKey,onDismissClick:m,lineId:e,chargeCardTypeOption:a,newCustomAddressId:C})})},fs=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:m,isChargeCardSetupEnabled:C,isDebitCardSetupEnabled:p}=t,S=Za(e,a&&C,r&&p);return{companyName:t.companyName,signedInUser:t.signedInUser,issueChargeCards:S,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:m,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:C,isDebitCardSetupEnabled:p,cardHolderCandidates:S.userList.map(o=>o.user).filter(Boolean),allRoles:S.userList.map(o=>o.userRole),allAccountingClasses:S.allAccountingClasses,userList:S.userList}},function(e,t){return{onIssueCardClick:()=>{e(Qn())},onSaveChangesToLocalStore:a=>{e(Jn(a))},onDismissClick:()=>{e(Ut()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Ot(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(Dr);function gs(){const e=X.getSignedInUser(),t=le(),a=ue(),r=Er(),[n]=lt(),m=n.get("cardType"),{useFeatureGate:C}=ce(),{isFeatureEnabled:p}=C(Y.isIssuePhysicalCardEnabled),{isFeatureEnabled:S}=C(Y.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=C(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:c}=C(Y.isChargeCardFeatureEnabled),_=y(I=>ie(I)),A=Se(o,_),f=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:A}),U=be(_),F=ye(_),k=_.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=Ae({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:c,isBookKeepingTenant:F,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:k}),[b,g]=i.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");i.useEffect(()=>{b||(g(!0),a(qn(f&&D,h&&d,!1)))},[b,g,a]);const d=!!_.companyChargeCardInfo?.info?.isChargeCardEnabled,D=!!_.companyDebitCardInfo?.info?.isDebitCardEnabled,v=_.companyName,j=y(I=>Za(I,h&&d,f&&D)),L=j.fetchState,P=j.issueCardStatus.fetchState,V=j.lastSelfIssuedDebitCardId,u=y(I=>V!=null?Lt(I.chargeCardState,V):void 0),[l,w]=i.useState(null),[T,H]=i.useState(null),O=()=>{w(null)},K=(I,B)=>{w(I),H(B)};return i.useEffect(()=>{if(P==="Completed"){if(V!=null&&u?.type.code==="business_virtual_debit_card"){let I;I=u?.status.code==="request_on_hold"&&e.userId===u.cardHolderUserId?$t(_.tenantEmailDomain):Ce(_.tenantEmailDomain,V,e,u),t(I)}else t("../");a(Ut())}},[P,V]),L==="Completed"?s.jsxs(s.Fragment,{children:[l!==null&&T!==null?s.jsx(hs,{closeDrawerHandler:O,lineId:l,chargeCardTypeOption:T}):null,s.jsx(fs,{companyName:v,signedInUser:e,themeState:r,isIssuePhysicalCardEnabled:p,isIssuePhysicalDebitCardEnabled:S,isDebitCardFeatureEnabled:f,isChargeCardFeatureEnabled:h,isChargeCardSetupEnabled:d,isDebitCardSetupEnabled:D,navigate:t,fetchState:j.fetchState,openAddAddressDrawerHandler:K,defaultCardType:m==="creditCard"||m==="debitCard"?m:void 0})]}):L==="Error"?s.jsx(La,{}):s.jsx(kr,{})}const bs=_e.div`
62
+ `,Cs={overlayWidth:new ua(Ua[12],Ua[12],Ua[9])},ps=pe(function(e,t){const a=Za(e,!1,!1),r=t.lineId,n=a.customAddress[r],m=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:m,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:m=>{a!=null&&e(Bt(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const C=Or(m);e(Kn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:C})),e(Wn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Zn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(Ar),hs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=la(),m=()=>{t()},C=y(p=>Yn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,p))?.newAddressId;return s.jsx(Vt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:Cs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(p,S)=>(S==="backdropClick"||S==="escapeKeyDown")&&m(),children:s.jsx(ps,{googleAPIKey:La.googleMapsAPIKey,onDismissClick:m,lineId:e,chargeCardTypeOption:a,newCustomAddressId:C})})},fs=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:m,isChargeCardSetupEnabled:C,isDebitCardSetupEnabled:p}=t,S=Za(e,a&&C,r&&p);return{companyName:t.companyName,signedInUser:t.signedInUser,issueChargeCards:S,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:m,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:C,isDebitCardSetupEnabled:p,cardHolderCandidates:S.userList.map(o=>o.user).filter(Boolean),allRoles:S.userList.map(o=>o.userRole),allAccountingClasses:S.allAccountingClasses,userList:S.userList}},function(e,t){return{onIssueCardClick:()=>{e(Qn())},onSaveChangesToLocalStore:a=>{e(Jn(a))},onDismissClick:()=>{e(Ut()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Bt(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(Dr);function gs(){const e=X.getSignedInUser(),t=le(),a=ue(),r=Er(),[n]=lt(),m=n.get("cardType"),{useFeatureGate:C}=ce(),{isFeatureEnabled:p}=C(Y.isIssuePhysicalCardEnabled),{isFeatureEnabled:S}=C(Y.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=C(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:c}=C(Y.isChargeCardFeatureEnabled),_=y(I=>ie(I)),A=Se(o,_),f=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:A}),U=be(_),F=ye(_),k=_.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=Ae({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:c,isBookKeepingTenant:F,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:k}),[b,g]=i.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");i.useEffect(()=>{b||(g(!0),a(qn(f&&D,h&&d,!1)))},[b,g,a]);const d=!!_.companyChargeCardInfo?.info?.isChargeCardEnabled,D=!!_.companyDebitCardInfo?.info?.isDebitCardEnabled,v=_.companyName,j=y(I=>Za(I,h&&d,f&&D)),O=j.fetchState,P=j.issueCardStatus.fetchState,V=j.lastSelfIssuedDebitCardId,u=y(I=>V!=null?Ot(I.chargeCardState,V):void 0),[l,w]=i.useState(null),[T,H]=i.useState(null),B=()=>{w(null)},K=(I,L)=>{w(I),H(L)};return i.useEffect(()=>{if(P==="Completed"){if(V!=null&&u?.type.code==="business_virtual_debit_card"){let I;I=u?.status.code==="request_on_hold"&&e.userId===u.cardHolderUserId?$t(_.tenantEmailDomain):Ce(_.tenantEmailDomain,V,e,u),t(I)}else t("../");a(Ut())}},[P,V]),O==="Completed"?s.jsxs(s.Fragment,{children:[l!==null&&T!==null?s.jsx(hs,{closeDrawerHandler:B,lineId:l,chargeCardTypeOption:T}):null,s.jsx(fs,{companyName:v,signedInUser:e,themeState:r,isIssuePhysicalCardEnabled:p,isIssuePhysicalDebitCardEnabled:S,isDebitCardFeatureEnabled:f,isChargeCardFeatureEnabled:h,isChargeCardSetupEnabled:d,isDebitCardSetupEnabled:D,navigate:t,fetchState:j.fetchState,openAddAddressDrawerHandler:K,defaultCardType:m==="creditCard"||m==="debitCard"?m:void 0})]}):O==="Error"?s.jsx(Oa,{}):s.jsx(kr,{})}const bs=_e.div`
63
63
  display: flex;
64
64
  height: 100vh;
65
65
  width: 100%;
@@ -68,4 +68,4 @@ import{j as s}from"./liveblocks-yYJhhlwl.js";import{j as le,l as ia,h as ue,g as
68
68
  overflow: auto;
69
69
  align-items: center;
70
70
  background-color: ${e=>e.theme.colors.grey4};
71
- `,ys=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:m,myPendingActivationChargeCardListState:C}=t,{tenantEmailDomain:p}=r,{cards:S}=C;return{onChargeCardRowClick:o=>{const c=zt(S,o),_=Ce(p,o,m,c),A=fe(n.state?.pathnameStackToGoBack,n.pathname);a(_,{state:{pathnameStackToGoBack:A}})},onColumnSortConfigChanged:(o,c)=>{e(Na({uiState:{sortKey:o,sortOrder:c}}))},onReloadCards:()=>{e(ca())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Na({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(_r);function Ss(){const e=le(),t=ue(),a=ge(),r=Wa(),[n,m]=i.useState(!1),C=y(T=>Xn(T)),p=y(T=>ie(T)),S=y(T=>ze(T,p.companyId)),o=$e(S.controllers),{useFeatureGate:c}=ce(),{isFeatureEnabled:_}=c(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=c(Y.isDebitCardFeatureEnabled),f=Se(A,p),U=Ie({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:f}),F=!!p.companyDebitCardInfo?.info?.isDebitCardEnabled,k=!!p.companyChargeCardInfo?.info?.isChargeCardEnabled,h=je(),b=be(p),g=ye(p),d=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:_,isBookKeepingTenant:g,isDebitCardProductVisible:U,chargeCardsCreditAccountLimit:d}),v=Ue(h?.loggedInUserRoleMap),j=y(T=>Ye(T)),{creditAccount:L,creditAccountRepayment:P}=y(T=>Ge(T)),V=y(T=>vt(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),u=[...new Set(V)],l=y(T=>va(T,u));i.useEffect(()=>{n||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(ca()),t(Da()))},[n,t,C.fetchState]),i.useEffect(()=>{if(C.fetchState==="Completed"&&C.cards.length===1&&w!=null){const T=Ce(p.tenantEmailDomain,C.cards[0].id,w,C.cards[0]);e(T,{state:{message:a.state?.message}})}},[C.fetchState,C.cards]);const w=X.getSignedInUser();if(i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&D&&k&&v&&t(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&v&&t($a()),l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&U&&F&&v&&t(xt())},[L.fetchState,P.fetchState,t,l.fetchState,U,F,v,D,k]),w==null)throw Error("Can't access address page without signing in...");if(C.fetchState!=="Completed")return s.jsx(Ke,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const T=Re(D,U,F,k);return s.jsx(bs,{children:s.jsx(ys,{navigate:e,currentTenant:p,signedInUser:w,productInformation:T,myPendingActivationChargeCardListState:C,isChargeCardFeatureEnabled:D,isDebitCardFeatureEnabled:U,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:k,chargeCardCashbackDetailState:j,creditAccount:L,creditAccountRepayment:P,depositAccountListWithDebitCardIssued:l,controllerEmails:o,location:a})})}}const Is=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:m,isChargeCardSetupEnabled:C,signedInUser:p,location:S,productInformation:o,isEarlyPayEnabled:c,controllerEmails:_,chargeCardsCreditAccountLimit:A}=t;return{onSetupButtonClick:f=>{if(p!=null&&J.trackCardsPromoPageClicked("enable cards"),n)switch(J.trackCardsEnableCardsClick(_,o,"Cards Promo"),f){case"credit":e(Oe(r,!0,"charge_cards",c,!1));break;case"debit":e(Oe(r,!0,"debit_cards",c,!1));break;case"debit_and_credit":e(A===0?Oe(r,!0,"debit_cards",c,!0):Oe(r,!0,"charge_cards__debit_cards",c,!1))}else switch(J.trackCardsSetupCardsClick(_,o,"Cards Promo"),f){case"credit":e(Oe(r,!1,"charge_cards",c,!1));break;case"debit":e(Oe(r,!1,"debit_cards",c,!1));break;case"debit_and_credit":e(A===0?Oe(r,!1,"debit_cards",c,!0):Oe(r,!1,"charge_cards__debit_cards",c,!1))}},onBackClick:()=>{const f=ve(S.state?.pathnameStackToGoBack);let U=f.poppedPathname;U==null&&(U=m||C?"..":"../.."),a(U,{state:{pathnameStackToGoBack:f.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(tr(r))}}})(wr),As=()=>{const e=le(),{tenantEmailDomain:t}=ia(),[a]=lt(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:m,useFeatureGate:C}=ce(),[p,S]=i.useState(!1),{isFeatureEnabled:o}=C(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:c}=C(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:_}=C(Y.isChargeCardFeatureEnabled),{configValue:A}=m(Fe.zeniCardsConfig),f=y(ee=>ie(ee)),U=y(ee=>ze(ee,f.companyId)),F=$e(U.controllers),k=A.charge_card_cashback_rate_per_transaction!=null?A.charge_card_cashback_rate_per_transaction:.0175,h=ge(),b=X.getSignedInUserTenant(t)?.companyId??f.companyId,g=y(ee=>da(ee,b)),d=g.primaryFundingAccount,D=f.companyBillPayInfo?.info,v=be(f),j=ye(f),L=Se(o,f),P=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,V=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:L}),u=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:_,isBookKeepingTenant:j,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:P}),l=Mt({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:_,isBookKeepingTenant:j}),w=V&&u===!1,T=D?.businessVerificationStatus?.code==="verified"&&(w||d?.accType==="depositAccount"||er(d?.providerVerificationStatus?.code??"")),H=X.getSignedInUser(),O=!!f.companyZeniAccountInfo?.info?.isZeniAccountEnabled,K=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,I=!!f.company?.companyChargeCardInfo.isChargeCardEnabled,B=!!f.company?.companyDebitCardInfo.isDebitCardEnabled,N=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,R=ee=>{S(ee)},W=y(ee=>ee.chargeCardSetupViewState.fetchState);if(H==null)throw Error("Can't access Charge Card promo page without signing in...");const E=je(),G=Ue(E?.loggedInUserRoleMap),q=Ya(E?.loggedInUserRoleMap),[$,x]=i.useState(!1),[se,ae]=i.useState(!1),[ne,Q]=i.useState(!1);i.useEffect(()=>{$===!1&&h.state?.message==="activation"&&x(!0)},[h.state]),i.useEffect(()=>{se||W!=="Not-Started"||b==null||(ae(!0),n(Fa(b,!0)))},[se,W,b,n]);const re=f.companyChargeCardInfo?.info!=null&&Qe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:l,isTOSAccepted:K,isSetupEnabled:I,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:q}),Ee=f.companyDebitCardInfo?.info!=null&&Qe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:V,isTOSAccepted:N,isSetupEnabled:B,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:q}),xe=V&&Ee&&l&&P>=0&&re?"debit_and_credit":V&&Ee?"debit":"credit",Z=Br(r,xe),he=g?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=i.useRef(null);i.useEffect(()=>{he==="In-Progress"?ke.current=Z:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,Z]);const Be=he!=="In-Progress"&&he!=="Completed"||ke.current==null?Z:ke.current;i.useEffect(()=>{Z==="credit"&&(I||l===!1&&B)||Z==="debit"&&B||Z==="debit_and_credit"&&B&&I?e("../"):(Z==="debit_and_credit"&&K===!0&&N===!0||Z==="credit"&&(K===!0||l===!1&&N===!0)||Z==="debit"&&N===!0)&&G===!0&&e("../setup")},[T,I,B,Z,K,N]),i.useEffect(()=>{ne||(n(ar("cardAdmin")),Q(!0))},[ne]);const we=y(ee=>Pt(ee.userState,ee.userRoleState,ee.userListViewState,"cardAdmin")),Pe=Re(l,V,B,I);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Qa,{analytics:J,onLoad:()=>{if(J.trackPageLoaded(Nt.Event.cardsPromoPage),!!l&&!I||!!V&&!B||!!l&&!!V&&!B&&!I){const ee=Es({isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:I,isCreditCardProductVisibleForExpressInterest:l,isDebitCardProductVisible:V});J.trackCardsPromoView(F,Pe,"Page",ee,"Promo Page")}}}),s.jsx(xa,{showConfetti:$}),s.jsx(Ca,{isAppContentDrawerOpen:p,handleDrawerToggle:R}),s.jsx(Is,{signedInUser:H,location:h,showEnableCardButton:T,isCompanyBusinessVerificationAndPaymentSetUpDone:T,isChargeCardSetupEnabled:I,isDebitCardSetupEnabled:B,companyLegalName:f.companyName,adminList:we.users,isCheckingEnabled:O,navigate:e,companyId:b,cardPromoType:Be,controllerEmails:F,productInformation:Pe,isCreditCardProductVisible:u,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:c,cashbackRate:k,chargeCardsCreditAccountLimit:P,onClickMenuIcon:()=>{R(!0)}})]}):s.jsx(Ke,{fetchState:"Not-Started"})},Es=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Ks(){const e=ge(),t=y(W=>ie(W)),{useFeatureGate:a}=ce(),{isFeatureEnabled:r}=a(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=a(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:C}=a(Y.isChargeCardPaymentHistoryFeatureEnabled),p=Se(n,t),S=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:p}),o=Pr(t,r,n),c=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,_=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,A=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,U=je(),F=Ue(U?.loggedInUserRoleMap),k=Ya(U?.loggedInUserRoleMap),{isFeatureEnabled:h}=a(Y.isCashbackFeatureEnabled),b=t.userRole.includes("charge_card_user"),g=!b,d=!b&&A,D=t?.userRole!=null&&nr(t?.userRole),v=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!D)&&rr(U?.loggedInUserRoleMap),j=sr(U?.loggedInUserRoleMap),L=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!D)&&or(U?.loggedInUserRoleMap),{isFeatureEnabled:P}=a(Y.isDepositAccountsFeatureEnabled),V=P&&!D&&ft(U?.loggedInUserRoleMap),u=A&&!D,l=f&&!D,w=o&&!D&&Ue(U?.loggedInUserRoleMap),T=cr(U?.loggedInUserRoleMap),H=be(t),O=ye(t),K=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Ae({isCardsOnlyTenant:H,isChargeCardFeatureEnabled:r,isBookKeepingTenant:O,isDebitCardProductVisible:S,chargeCardsCreditAccountLimit:K}),B=t.companyChargeCardInfo?.info!=null&&Qe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:I,isTOSAccepted:c,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:k}),N=t.companyDebitCardInfo?.info!=null&&Qe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:S,isTOSAccepted:_,isSetupEnabled:f,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:k}),R=B||N;return s.jsxs(Kt,{children:[F?s.jsx(te,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:w,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:j,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(te,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isUserHasOnlyBillPayAccess:j,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:w,isUserHasOnlyCardAccess:T,productType:"charge_cards",type:"verification"})}):null,s.jsx(te,{path:"promo",element:s.jsx(As,{})}),u||l?s.jsxs(s.Fragment,{children:[s.jsx(te,{path:"/",element:s.jsx(ct,{isPaymentDrawerOpen:!1})}),w&&m?s.jsx(te,{path:"payment",element:s.jsx(ct,{isPaymentDrawerOpen:!0})}):null,s.jsx(te,{path:"activate",element:s.jsx(Ss,{})}),s.jsx(te,{path:"onboard",element:s.jsx(rs,{})}),F?s.jsx(te,{path:"new",element:s.jsx(gs,{})}):null,h&&g?s.jsx(te,{path:"cashback",element:s.jsx(Rr,{})}):null,d?s.jsx(te,{path:"statements",element:s.jsx(ts,{})}):null,w&&C&&A?s.jsx(te,{path:"payment-history",element:s.jsx(as,{})}):null,s.jsx(te,{path:":cardId/activate",element:s.jsx(Vr,{})}),s.jsx(te,{path:":cardId/setPin",element:s.jsx(ds,{})}),s.jsx(te,{path:":cardId/addToWallet",element:s.jsx(Or,{})}),s.jsx(te,{path:":cardId/*",element:s.jsx(Kr,{})}),s.jsx(te,{path:"*",element:s.jsx(La,{})})]}):(c||_)&&F?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../setup"})}):R?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../promo",state:e.state})}):s.jsx(te,{path:"*",element:null})]})}export{Ks as default};
71
+ `,ys=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:m,myPendingActivationChargeCardListState:C}=t,{tenantEmailDomain:p}=r,{cards:S}=C;return{onChargeCardRowClick:o=>{const c=zt(S,o),_=Ce(p,o,m,c),A=fe(n.state?.pathnameStackToGoBack,n.pathname);a(_,{state:{pathnameStackToGoBack:A}})},onColumnSortConfigChanged:(o,c)=>{e(Na({uiState:{sortKey:o,sortOrder:c}}))},onReloadCards:()=>{e(ca())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Na({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(_r);function Ss(){const e=le(),t=ue(),a=ge(),r=Wa(),[n,m]=i.useState(!1),C=y(T=>Xn(T)),p=y(T=>ie(T)),S=y(T=>ze(T,p.companyId)),o=$e(S.controllers),{useFeatureGate:c}=ce(),{isFeatureEnabled:_}=c(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=c(Y.isDebitCardFeatureEnabled),f=Se(A,p),U=Ie({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:f}),F=!!p.companyDebitCardInfo?.info?.isDebitCardEnabled,k=!!p.companyChargeCardInfo?.info?.isChargeCardEnabled,h=je(),b=be(p),g=ye(p),d=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:_,isBookKeepingTenant:g,isDebitCardProductVisible:U,chargeCardsCreditAccountLimit:d}),v=Ue(h?.loggedInUserRoleMap),j=y(T=>Ye(T)),{creditAccount:O,creditAccountRepayment:P}=y(T=>Ge(T)),V=y(T=>vt(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),u=[...new Set(V)],l=y(T=>va(T,u));i.useEffect(()=>{n||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(ca()),t(Da()))},[n,t,C.fetchState]),i.useEffect(()=>{if(C.fetchState==="Completed"&&C.cards.length===1&&w!=null){const T=Ce(p.tenantEmailDomain,C.cards[0].id,w,C.cards[0]);e(T,{state:{message:a.state?.message}})}},[C.fetchState,C.cards]);const w=X.getSignedInUser();if(i.useEffect(()=>{O.fetchState!=="Completed"&&O.fetchState!=="In-Progress"&&D&&k&&v&&t(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&v&&t($a()),l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&U&&F&&v&&t(xt())},[O.fetchState,P.fetchState,t,l.fetchState,U,F,v,D,k]),w==null)throw Error("Can't access address page without signing in...");if(C.fetchState!=="Completed")return s.jsx(Ke,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const T=Re(D,U,F,k);return s.jsx(bs,{children:s.jsx(ys,{navigate:e,currentTenant:p,signedInUser:w,productInformation:T,myPendingActivationChargeCardListState:C,isChargeCardFeatureEnabled:D,isDebitCardFeatureEnabled:U,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:k,chargeCardCashbackDetailState:j,creditAccount:O,creditAccountRepayment:P,depositAccountListWithDebitCardIssued:l,controllerEmails:o,location:a})})}}const Is=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:m,isChargeCardSetupEnabled:C,signedInUser:p,location:S,productInformation:o,isEarlyPayEnabled:c,controllerEmails:_,chargeCardsCreditAccountLimit:A}=t;return{onSetupButtonClick:f=>{if(p!=null&&J.trackCardsPromoPageClicked("enable cards"),n)switch(J.trackCardsEnableCardsClick(_,o,"Cards Promo"),f){case"credit":e(Be(r,!0,"charge_cards",c,!1));break;case"debit":e(Be(r,!0,"debit_cards",c,!1));break;case"debit_and_credit":e(A===0?Be(r,!0,"debit_cards",c,!0):Be(r,!0,"charge_cards__debit_cards",c,!1))}else switch(J.trackCardsSetupCardsClick(_,o,"Cards Promo"),f){case"credit":e(Be(r,!1,"charge_cards",c,!1));break;case"debit":e(Be(r,!1,"debit_cards",c,!1));break;case"debit_and_credit":e(A===0?Be(r,!1,"debit_cards",c,!0):Be(r,!1,"charge_cards__debit_cards",c,!1))}},onBackClick:()=>{const f=ve(S.state?.pathnameStackToGoBack);let U=f.poppedPathname;U==null&&(U=m||C?"..":"../.."),a(U,{state:{pathnameStackToGoBack:f.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(tr(r))}}})(wr),As=()=>{const e=le(),{tenantEmailDomain:t}=ia(),[a]=lt(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:m,useFeatureGate:C}=ce(),[p,S]=i.useState(!1),{isFeatureEnabled:o}=C(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:c}=C(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:_}=C(Y.isChargeCardFeatureEnabled),{configValue:A}=m(Fe.zeniCardsConfig),f=y(ee=>ie(ee)),U=y(ee=>ze(ee,f.companyId)),F=$e(U.controllers),k=A.charge_card_cashback_rate_per_transaction!=null?A.charge_card_cashback_rate_per_transaction:.0175,h=ge(),b=X.getSignedInUserTenant(t)?.companyId??f.companyId,g=y(ee=>da(ee,b)),d=g.primaryFundingAccount,D=f.companyBillPayInfo?.info,v=be(f),j=ye(f),O=Se(o,f),P=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,V=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:O}),u=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:_,isBookKeepingTenant:j,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:P}),l=Mt({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:_,isBookKeepingTenant:j}),w=V&&u===!1,T=D?.businessVerificationStatus?.code==="verified"&&(w||d?.accType==="depositAccount"||er(d?.providerVerificationStatus?.code??"")),H=X.getSignedInUser(),B=!!f.companyZeniAccountInfo?.info?.isZeniAccountEnabled,K=!!f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,I=!!f.company?.companyChargeCardInfo.isChargeCardEnabled,L=!!f.company?.companyDebitCardInfo.isDebitCardEnabled,N=!!f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,R=ee=>{S(ee)},W=y(ee=>ee.chargeCardSetupViewState.fetchState);if(H==null)throw Error("Can't access Charge Card promo page without signing in...");const E=je(),G=Ue(E?.loggedInUserRoleMap),q=Ya(E?.loggedInUserRoleMap),[$,x]=i.useState(!1),[se,ae]=i.useState(!1),[ne,Q]=i.useState(!1);i.useEffect(()=>{$===!1&&h.state?.message==="activation"&&x(!0)},[h.state]),i.useEffect(()=>{se||W!=="Not-Started"||b==null||(ae(!0),n(Fa(b,!0)))},[se,W,b,n]);const re=f.companyChargeCardInfo?.info!=null&&Qe({cardInfo:f.companyChargeCardInfo.info,isProductVisible:l,isTOSAccepted:K,isSetupEnabled:I,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:q}),Ee=f.companyDebitCardInfo?.info!=null&&Qe({cardInfo:f.companyDebitCardInfo.info,isProductVisible:V,isTOSAccepted:N,isSetupEnabled:L,isUserHasCardsAdminLevelAccess:G,isUserHasCardsAccess:q}),xe=V&&Ee&&l&&P>=0&&re?"debit_and_credit":V&&Ee?"debit":"credit",Z=Lr(r,xe),he=g?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=i.useRef(null);i.useEffect(()=>{he==="In-Progress"?ke.current=Z:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,Z]);const Le=he!=="In-Progress"&&he!=="Completed"||ke.current==null?Z:ke.current;i.useEffect(()=>{Z==="credit"&&(I||l===!1&&L)||Z==="debit"&&L||Z==="debit_and_credit"&&L&&I?e("../"):(Z==="debit_and_credit"&&K===!0&&N===!0||Z==="credit"&&(K===!0||l===!1&&N===!0)||Z==="debit"&&N===!0)&&G===!0&&e("../setup")},[T,I,L,Z,K,N]),i.useEffect(()=>{ne||(n(ar("cardAdmin")),Q(!0))},[ne]);const we=y(ee=>Pt(ee.userState,ee.userRoleState,ee.userListViewState,"cardAdmin")),Pe=Re(l,V,L,I);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Qa,{analytics:J,onLoad:()=>{if(J.trackPageLoaded(Nt.Event.cardsPromoPage),!!l&&!I||!!V&&!L||!!l&&!!V&&!L&&!I){const ee=Es({isDebitCardSetupEnabled:L,isChargeCardSetupEnabled:I,isCreditCardProductVisibleForExpressInterest:l,isDebitCardProductVisible:V});J.trackCardsPromoView(F,Pe,"Page",ee,"Promo Page")}}}),s.jsx(xa,{showConfetti:$}),s.jsx(Ca,{isAppContentDrawerOpen:p,handleDrawerToggle:R}),s.jsx(Is,{signedInUser:H,location:h,showEnableCardButton:T,isCompanyBusinessVerificationAndPaymentSetUpDone:T,isChargeCardSetupEnabled:I,isDebitCardSetupEnabled:L,companyLegalName:f.companyName,adminList:we.users,isCheckingEnabled:B,navigate:e,companyId:b,cardPromoType:Le,controllerEmails:F,productInformation:Pe,isCreditCardProductVisible:u,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:c,cashbackRate:k,chargeCardsCreditAccountLimit:P,onClickMenuIcon:()=>{R(!0)}})]}):s.jsx(Ke,{fetchState:"Not-Started"})},Es=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Ks(){const e=ge(),t=y(W=>ie(W)),{useFeatureGate:a}=ce(),{isFeatureEnabled:r}=a(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=a(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:C}=a(Y.isChargeCardPaymentHistoryFeatureEnabled),p=Se(n,t),S=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:p}),o=Pr(t,r,n),c=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,_=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,A=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,U=je(),F=Ue(U?.loggedInUserRoleMap),k=Ya(U?.loggedInUserRoleMap),{isFeatureEnabled:h}=a(Y.isCashbackFeatureEnabled),b=t.userRole.includes("charge_card_user"),g=!b,d=!b&&A,D=t?.userRole!=null&&nr(t?.userRole),v=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!D)&&rr(U?.loggedInUserRoleMap),j=sr(U?.loggedInUserRoleMap),O=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!D)&&or(U?.loggedInUserRoleMap),{isFeatureEnabled:P}=a(Y.isDepositAccountsFeatureEnabled),V=P&&!D&&ft(U?.loggedInUserRoleMap),u=A&&!D,l=f&&!D,w=o&&!D&&Ue(U?.loggedInUserRoleMap),T=cr(U?.loggedInUserRoleMap),H=be(t),B=ye(t),K=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Ae({isCardsOnlyTenant:H,isChargeCardFeatureEnabled:r,isBookKeepingTenant:B,isDebitCardProductVisible:S,chargeCardsCreditAccountLimit:K}),L=t.companyChargeCardInfo?.info!=null&&Qe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:I,isTOSAccepted:c,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:k}),N=t.companyDebitCardInfo?.info!=null&&Qe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:S,isTOSAccepted:_,isSetupEnabled:f,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:k}),R=L||N;return s.jsxs(Kt,{children:[F?s.jsx(te,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isReimbursementAdminLevelAccess:O,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:w,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:j,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(te,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isUserHasOnlyBillPayAccess:j,isReimbursementAdminLevelAccess:O,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:w,isUserHasOnlyCardAccess:T,productType:"charge_cards",type:"verification"})}):null,s.jsx(te,{path:"promo",element:s.jsx(As,{})}),u||l?s.jsxs(s.Fragment,{children:[s.jsx(te,{path:"/",element:s.jsx(ct,{isPaymentDrawerOpen:!1})}),w&&m?s.jsx(te,{path:"payment",element:s.jsx(ct,{isPaymentDrawerOpen:!0})}):null,s.jsx(te,{path:"activate",element:s.jsx(Ss,{})}),s.jsx(te,{path:"onboard",element:s.jsx(rs,{})}),F?s.jsx(te,{path:"new",element:s.jsx(gs,{})}):null,h&&g?s.jsx(te,{path:"cashback",element:s.jsx(Rr,{})}):null,d?s.jsx(te,{path:"statements",element:s.jsx(ts,{})}):null,w&&C&&A?s.jsx(te,{path:"payment-history",element:s.jsx(as,{})}):null,s.jsx(te,{path:":cardId/activate",element:s.jsx(Vr,{})}),s.jsx(te,{path:":cardId/setPin",element:s.jsx(ds,{})}),s.jsx(te,{path:":cardId/addToWallet",element:s.jsx(Br,{})}),s.jsx(te,{path:":cardId/*",element:s.jsx(Kr,{})}),s.jsx(te,{path:"*",element:s.jsx(Oa,{})})]}):(c||_)&&F?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../setup"})}):R?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../promo",state:e.state})}):s.jsx(te,{path:"*",element:null})]})}export{Ks as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-yYJhhlwl.js";import{a as g}from"./sentry-CbgVFeom.js";import{j as v,h as k,u as x,l as T,g as O,k as E}from"./core-Bycbr_zS.js";import{z as C,b1 as F,y as P,d as L,f as V,ab as N,b2 as j,ap as A,aq as U,s as B}from"./index-CkPLyKrL.js";import{eN as D,fB as _,rw as M,fw as R,c0 as z,Lv as G,bn as Y,pE as q,ps as H,j_ as Z,lu as S,Lw as $,bC as J,ct as b,lC as K,lF as Q}from"./zeni-epic-state-CIfm8mou.js";import"./mui-uwIb-0_u.js";import{c as W}from"./routePaths-CMggNZ1T.js";import{M as X}from"./MobileAppDrawer-BsEeVHGJ.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]="6e41f7e0-33b9-4499-823e-7fd25de34ae8",t._sentryDebugIdIdentifier="sentry-dbid-6e41f7e0-33b9-4499-823e-7fd25de34ae8")}catch{}})();const ee=E(function(t){const a=R(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,w={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:w}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(H(e))},onEditFileName:(e,n)=>{t(q(e,n.split(".")[0]))}}})(j);function de(){const t=v(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(_(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(M())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,N(i)?"Settings":"Company Passport")}),N(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:N(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-CF908iAG.js";import{a as g}from"./sentry-cfxuOFew.js";import{j as v,h as k,u as x,l as T,g as b,k as E}from"./core-Cgen4kAj.js";import{z as N,b1 as F,A as P,d as L,f as V,ab as O,b2 as j,ap as A,aq as U,s as B}from"./index-trlF__w8.js";import{eN as D,fB as _,rw as M,fw as R,c0 as z,Lv as G,bn as Y,pE as q,ps as H,j_ as Z,lu as S,Lw as $,bC as J,ct as C,lC as K,lF as Q}from"./zeni-epic-state-DrGehtra.js";import"./mui-C7dUqSqV.js";import{c as W}from"./routePaths-CqnfURaJ.js";import{M as X}from"./MobileAppDrawer-BuQb2buy.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]="8396202e-56b9-4b94-9107-d5eb383b0464",t._sentryDebugIdIdentifier="sentry-dbid-8396202e-56b9-4b94-9107-d5eb383b0464")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,w={companyInfo:{...n,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:w}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(H(e))},onEditFileName:(e,n)=>{t(q(e,n.split(".")[0]))}}})(j);function de(){const t=v(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b(s=>s.companyViewState.passportView.fetchState),o=b(s=>s.companyConfigState.fetchState),r=b(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(_(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(M())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-yYJhhlwl.js";import{a}from"./sentry-CbgVFeom.js";import{h as D,u as v,g as m,N as w}from"./core-Bycbr_zS.js";import{Ig as O,eN as A,fi as _,ml as U,fK as E,fh as j,eO as L,In as F}from"./zeni-epic-state-CIfm8mou.js";import{u as $,z as u,L as g,D as k,o as H}from"./index-CkPLyKrL.js";import{n as z}from"./mui-uwIb-0_u.js";import{t as R}from"./getLocaleForTenant-hR2ZjLdG.js";import{g as P,Q as G}from"./QBOConnectionScreen-BH7qNWPW.js";import"./recharts-DgZ04ot6.js";import"./analytics-BMapadfi.js";import"./plaid-BtVuBiv6.js";import"./dnd-Jwp37Hwc.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQftbn5o.js";import"./lexical-BFKF8Nqm.js";import"./pdf-Clano961.js";import"./utils-CUNvYJ5h.js";import"./empty-BVzRSYkS.js";import"./pdf-lib-qkfMQ_yu.js";import"./index-DmSlLFfZ.js";import"./url-CACUy1v-.js";import"./index-DB8zvt4r.js";import"./decodeURIComponentSafe-D8oY1hc9.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="f8f6cb81-5e78-403d-a489-46afc299ebc0",t._sentryDebugIdIdentifier="sentry-dbid-f8f6cb81-5e78-403d-a489-46afc299ebc0")}catch{}})();const K=z.div`
1
+ import{j as C}from"./liveblocks-CF908iAG.js";import{a}from"./sentry-cfxuOFew.js";import{h as D,u as v,g as m,N as w}from"./core-Cgen4kAj.js";import{Ig as O,eN as A,fi as _,ml as U,fK as E,fh as j,eO as L,In as F}from"./zeni-epic-state-DrGehtra.js";import{u as $,z as u,L as g,D as k,o as H}from"./index-trlF__w8.js";import{n as z}from"./mui-C7dUqSqV.js";import{t as R}from"./getLocaleForTenant-Di1C7dV7.js";import{g as P,Q as G}from"./QBOConnectionScreen-DowWnT4I.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.js";import"./empty-CfLsUtpF.js";import"./pdf-lib-D5gPNITG.js";import"./index-Dprn4SY3.js";import"./url-B1qVva4A.js";import"./index-C_giOD7z.js";import"./decodeURIComponentSafe-DztnZ-A4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="f8f6cb81-5e78-403d-a489-46afc299ebc0",t._sentryDebugIdIdentifier="sentry-dbid-f8f6cb81-5e78-403d-a489-46afc299ebc0")}catch{}})();const K=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as d}from"./liveblocks-CF908iAG.js";import{z as n}from"./index-trlF__w8.js";import{g as p}from"./QBOConnectionScreen-DowWnT4I.js";import"./sentry-cfxuOFew.js";import{u as a,N as i}from"./core-Cgen4kAj.js";import"./zeni-epic-state-DrGehtra.js";import"./recharts-Dyhe2tpB.js";import"./mui-C7dUqSqV.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.js";import"./empty-CfLsUtpF.js";import"./pdf-lib-D5gPNITG.js";import"./index-Dprn4SY3.js";import"./url-B1qVva4A.js";import"./index-C_giOD7z.js";import"./decodeURIComponentSafe-DztnZ-A4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-yYJhhlwl.js";import{t as $e,A as Ce}from"./AddressScreen-7k7vjaFG.js";import ze from"./NotFoundScreen-BnQ9IpWO.js";import{a as g}from"./sentry-CbgVFeom.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-Bycbr_zS.js";import{$ as de,j as le,z as B,a as ue,h as Je,p as _,s as V,y as H,d as N,w as we,f as X,al as Ke,q as Qe,am as Ie,k as te,an as Ze,ao as ke,o as He,ap as We,aq as xe,ar as Xe}from"./index-CkPLyKrL.js";import{bn as Ye,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I_ as st,bR as it,c0 as ge,rK as he,rv as rt,Ja as Y,rL as _e,GH as ct,k6 as Ue,Jb as Ve,Jc as dt,Jd as lt,Je as ut,j0 as pt,j3 as mt,rx as Be,rJ as gt,bC as Ee,ct as ht,rX as Te,pE as ft,ps as yt,j_ as St,fz as bt,fy as Ct,fx as It,Jf as kt,rp as xt,rY as Et,r$ as Tt,s2 as Ot,s8 as Pt,cS as At}from"./zeni-epic-state-CIfm8mou.js";import{n as fe}from"./mui-uwIb-0_u.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-BH7qNWPW.js";import"./recharts-DgZ04ot6.js";import"./analytics-BMapadfi.js";import"./plaid-BtVuBiv6.js";import"./dnd-Jwp37Hwc.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQftbn5o.js";import"./lexical-BFKF8Nqm.js";import"./pdf-Clano961.js";import"./utils-CUNvYJ5h.js";import"./empty-BVzRSYkS.js";import"./pdf-lib-qkfMQ_yu.js";import"./index-DmSlLFfZ.js";import"./url-CACUy1v-.js";import"./index-DB8zvt4r.js";import"./decodeURIComponentSafe-D8oY1hc9.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a6a24463-1248-4340-9914-a2d75806fcd9",t._sentryDebugIdIdentifier="sentry-dbid-a6a24463-1248-4340-9914-a2d75806fcd9")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),J===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-CF908iAG.js";import{t as $e,A as Ce}from"./AddressScreen-BeHKG8v1.js";import ze from"./NotFoundScreen-DXPtR234.js";import{a as g}from"./sentry-cfxuOFew.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-Cgen4kAj.js";import{v as de,j as le,z as B,a as ue,h as Je,p as _,s as V,A as H,d as N,B as we,f as X,al as Ke,q as Qe,am as Ie,k as te,an as Ze,ao as ke,o as He,ap as We,aq as xe,ar as Xe}from"./index-trlF__w8.js";import{bn as Ye,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I_ as st,bR as it,c0 as ge,rK as he,rv as rt,Ja as Y,rL as _e,GH as ct,k6 as Ue,Jb as Ve,Jc as dt,Jd as lt,Je as ut,j0 as pt,j3 as mt,rx as Be,rJ as gt,bC as Ee,ct as ht,rX as Te,pE as ft,ps as yt,j_ as St,fz as bt,fy as Ct,fx as It,Jf as kt,rp as xt,rY as Et,r$ as Tt,s2 as Ot,s8 as Pt,cS as At}from"./zeni-epic-state-DrGehtra.js";import{n as fe}from"./mui-C7dUqSqV.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DowWnT4I.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.js";import"./empty-CfLsUtpF.js";import"./pdf-lib-D5gPNITG.js";import"./index-Dprn4SY3.js";import"./url-B1qVva4A.js";import"./index-C_giOD7z.js";import"./decodeURIComponentSafe-DztnZ-A4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="94497845-8e2d-474e-8c38-1d8203771543",t._sentryDebugIdIdentifier="sentry-dbid-94497845-8e2d-474e-8c38-1d8203771543")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),J===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-yYJhhlwl.js";import{l as K,g as S,u as z,h as G,j as q,k as H,s as $a,n as at,o as w}from"./core-Bycbr_zS.js";import{eN as j,Jv as Me,bC as Ut,bq as ue,KI as za,hS as qa,KJ as xt,KK as Za,hV as nt,KL as Re,KM as Ha,h_ as Ja,KN as Tt,KO as Qa,i2 as ot,KP as je,KQ as Xa,cj as rt,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as Ae,KU as Yt,Jj as ee,bc as Vt,ja as Nt,mt as Gt,iV as Kt,Jl as te,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as $t,KY as be,tA as ve,tB as Ie,tY as me,tS as ae,tF as Ee,KZ as ln,K_ as dn,K$ as un,L0 as zt,L1 as Ce,L2 as mn,dB as Ue,qc as qt,L3 as pn,L4 as hn,L5 as fn,L6 as it,IH as ct,jq as pe,u4 as lt,qk as gn,L7 as bn,tC as wt,qf as le,qb as Zt,L8 as se,L9 as Cn,La as dt,IF as ut,sc as Ht,Lb as _n,Lc as kn,Ld as Sn,Le as mt,sp as yn,Lf as An,tE as Dt,sb as Jt,Lg as re,Lh as vn,bv as Qt,u8 as Xt,Li as In,Lj as En,Lk as xn,Ll as pt,u3 as Tn,Lm as wn,tD as Ft,u7 as Wt,Ln as ie,Lo as Dn,Lp as Fn,Lq as ea,jf as ta,mq as aa,jk as na,mo as oa,mn as sa,mm as ra,rA as On,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Nn,Lu as Gn,b5 as ht,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-CIfm8mou.js";import{z as R,Q as J,s as D,d as I,D as $,aQ as Wn,y as xe,aR as ia,f as V,aS as eo,j as Te,aT as ca,a as Ye,p as L,h as to,aU as ao,aV as no,K as la,q as oo,c as da,_ as so,aW as ro,aJ as ua,aX as io,aY as co,O as lo,aZ as uo,a_ as mo,am as po,r as ho,M as fo,a$ as go,b0 as ke}from"./index-CkPLyKrL.js";import{n as ft}from"./mui-uwIb-0_u.js";import{a as b}from"./sentry-CbgVFeom.js";import{w as ma}from"./withTransactionSidePanel-VWqgYGxS.js";import{b as pa,t as he,e as ne,a as gt,v as bo}from"./routePaths-CMggNZ1T.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-C7xPewG5.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-DmtdISaY.js";import ye from"./NotFoundScreen-BnQ9IpWO.js";import{t as ha}from"./analyticsHelper-hJglLz67.js";import{C as _o}from"./CompanyPassportScreen-BK2OTKJu.js";import{F as ko}from"./FeaturePreviewScreen-CZ4kSWCz.js";import{R as So}from"./ReferralListScreen-CTukyk1g.js";import"./recharts-DgZ04ot6.js";import"./analytics-BMapadfi.js";import"./plaid-BtVuBiv6.js";import"./dnd-Jwp37Hwc.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQftbn5o.js";import"./lexical-BFKF8Nqm.js";import"./pdf-Clano961.js";import"./utils-CUNvYJ5h.js";import"./TransactionDetailScreen-DKG_MhFF.js";import"./decodeURIComponentSafe-D8oY1hc9.js";import"./MobileAppDrawer-BsEeVHGJ.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]="f5b91c4c-d137-4517-9fd7-0958206526b8",e._sentryDebugIdIdentifier="sentry-dbid-f5b91c4c-d137-4517-9fd7-0958206526b8")}catch{}})();const yo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>j(x)),{tenantEmailDomain:p}=K(),C=z(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),h=G(),f=q(),k=S(x=>za(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(qa(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=pa({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Wn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=G(),a=q(),t=S(A=>Za(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>j(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ia,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=R.getSignedInUser(),i=S(F=>j(F)),{tenantEmailDomain:d}=K(),p=z(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),m=G(),h=q(),f=S(F=>Ha(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Ja(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=pa({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=G(),a=q(),t=S(_=>Qa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>j(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(je({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(je({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(je({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(je({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Xa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ia,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Eo=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ga)(ca),xo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ga)(ca);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.div`
1
+ import{j as l}from"./liveblocks-CF908iAG.js";import{l as K,g as S,u as z,h as G,j as q,k as H,s as $a,n as at,o as w}from"./core-Cgen4kAj.js";import{eN as j,Jv as Me,bC as Ut,bq as ue,KI as za,hS as qa,KJ as xt,KK as Za,hV as nt,KL as Re,KM as Ha,h_ as Ja,KN as Tt,KO as Qa,i2 as ot,KP as je,KQ as Xa,cj as rt,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as Ae,KU as Yt,Jj as ee,bc as Vt,ja as Nt,mt as Gt,iV as Kt,Jl as te,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as $t,KY as be,tA as ve,tB as Ie,tY as me,tS as ae,tF as Ee,KZ as ln,K_ as dn,K$ as un,L0 as zt,L1 as Ce,L2 as mn,dB as Ue,qc as qt,L3 as pn,L4 as hn,L5 as fn,L6 as it,IH as ct,jq as pe,u4 as lt,qk as gn,L7 as bn,tC as wt,qf as le,qb as Zt,L8 as se,L9 as Cn,La as dt,IF as ut,sc as Ht,Lb as _n,Lc as kn,Ld as Sn,Le as mt,sp as yn,Lf as An,tE as Dt,sb as Jt,Lg as re,Lh as vn,bv as Qt,u8 as Xt,Li as In,Lj as En,Lk as xn,Ll as pt,u3 as Tn,Lm as wn,tD as Ft,u7 as Wt,Ln as ie,Lo as Dn,Lp as Fn,Lq as ea,jf as ta,mq as aa,jk as na,mo as oa,mn as sa,mm as ra,rA as On,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Nn,Lu as Gn,b5 as ht,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-DrGehtra.js";import{z as R,Q as J,s as D,d as I,D as $,aQ as Wn,A as xe,aR as ia,f as V,aS as eo,j as Te,aT as ca,a as Ye,p as L,h as to,aU as ao,aV as no,K as la,q as oo,c as da,Z as so,aW as ro,aJ as ua,aX as io,aY as co,O as lo,aZ as uo,a_ as mo,am as po,n as ho,M as fo,a$ as go,b0 as ke}from"./index-trlF__w8.js";import{n as ft}from"./mui-C7dUqSqV.js";import{a as b}from"./sentry-cfxuOFew.js";import{w as ma}from"./withTransactionSidePanel-Dq1wepy8.js";import{b as pa,t as he,e as ne,a as gt,v as bo}from"./routePaths-CqnfURaJ.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-C2mAQ-5p.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js";import ye from"./NotFoundScreen-DXPtR234.js";import{t as ha}from"./analyticsHelper-CsFRydiU.js";import{C as _o}from"./CompanyPassportScreen-BmSdom0e.js";import{F as ko}from"./FeaturePreviewScreen-Bu3Nmz6L.js";import{R as So}from"./ReferralListScreen-Dj04SxiV.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.js";import"./TransactionDetailScreen-DB2dMdqL.js";import"./decodeURIComponentSafe-DztnZ-A4.js";import"./MobileAppDrawer-BuQb2buy.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]="269264d2-749b-4732-b058-5e62d0fed9cc",e._sentryDebugIdIdentifier="sentry-dbid-269264d2-749b-4732-b058-5e62d0fed9cc")}catch{}})();const yo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>j(x)),{tenantEmailDomain:p}=K(),C=z(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),h=G(),f=q(),k=S(x=>za(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(qa(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=pa({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Wn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=G(),a=q(),t=S(A=>Za(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>j(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ia,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=R.getSignedInUser(),i=S(F=>j(F)),{tenantEmailDomain:d}=K(),p=z(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),m=G(),h=q(),f=S(F=>Ha(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Ja(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=pa({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=G(),a=q(),t=S(_=>Qa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>j(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(je({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(je({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(je({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(je({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Xa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ia,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Eo=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ga)(ca),xo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ga)(ca);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;