@zeniai/web-app-ui 5.3.71-qa → 5.3.72-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.
- package/dist/assets/{AccountMappingScreen-Da8kjow8.js → AccountMappingScreen-Dv_mcE-s.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-RoPWu4_o.js → ActualMatchingMatchDetailScreen-DQhBSzc_.js} +1 -1
- package/dist/assets/AddressRoutes-CY6bt6oR.js +1 -0
- package/dist/assets/{AddressScreen-CPpf4Cpj.js → AddressScreen-DAE2XqXc.js} +2 -2
- package/dist/assets/AiCfoScreen-BPlLSgy4.js +22 -0
- package/dist/assets/{AppDrawer-BxZ3HI7E.js → AppDrawer-B_kTdlDU.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-c7b3I5yJ.js → BillPayApprovalRoutes-txmAkDB9.js} +1 -1
- package/dist/assets/{BillPayRoutes-BDhRNd6v.js → BillPayRoutes-CWUxKmBT.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-BvUcXpAj.js +9 -0
- package/dist/assets/CardsAiCfoScreen-nNC3ePcB.js +14 -0
- package/dist/assets/{ChargeCardRoutes-CWxqs0Z9.js → ChargeCardRoutes-Bbt0_9Bb.js} +6 -6
- package/dist/assets/{CompanyPassportScreen-CIym85mw.js → CompanyPassportScreen-rWKenTzd.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-CztazncJ.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-yZ66vYtS.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-D8GPJqi3.js +30 -0
- package/dist/assets/{DashboardRoutes-Bq7IQcLO.js → DashboardRoutes-B_JSZLqZ.js} +3 -3
- package/dist/assets/{DefaultTenantHome-Bpge3yFF.js → DefaultTenantHome-IBmbS2vi.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-ZaeUg4I5.js → DomesticWireDetailScreen-DdWDhL04.js} +4 -4
- package/dist/assets/{DrawerScreen-bhsbfXgO.js → DrawerScreen-I1OXPpov.js} +1 -1
- package/dist/assets/EntityDetailRoutes-DxNEAh7j.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-Dab9nQ3b.js → ExpenseAutomationRoutes-BJiDP5Wv.js} +6 -6
- package/dist/assets/FeaturePreviewScreen-BbHZWhrI.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CEvleGfK.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-Vlyx5Pej.js → InboxNotificationsProvider-CH-l5W7V.js} +1 -1
- package/dist/assets/InvoicingRoutes-CaFgkG0d.js +2 -0
- package/dist/assets/{MagicLinkRoutes-DonztJNa.js → MagicLinkRoutes-DEWQ6tjb.js} +20 -20
- package/dist/assets/MagicLinkSignInScreen-D7kTTahR.js +12 -0
- package/dist/assets/MobileAppDrawer-8BZVS4o3.js +1 -0
- package/dist/assets/NotFoundScreen-DnqoRCYC.js +1 -0
- package/dist/assets/NotificationRoutes-B6eJv18K.js +1 -0
- package/dist/assets/OAuthConsentScreen-9x_SIQZM.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-2XL-q-Jt.js +1 -0
- package/dist/assets/{PaymentLinkScreen-43J_ZGED.js → PaymentLinkScreen-C1S1ghTR.js} +5 -5
- package/dist/assets/PeopleRoutes-DVpXinz3.js +22 -0
- package/dist/assets/PerformanceRoutes-BRj-_-uP.js +1 -0
- package/dist/assets/{Preview-DqlOJJpJ.js → Preview-Ch5xsyMl.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Czz6muQW.js → QBOConnectionScreen-Dnjt4r9I.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-CzHkAZyB.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DN9la9Dm.js → ReimbursementApprovalRuleDetailScreen-DulfuoGj.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BGNOeI_H.js → ReimbursementRoutes-BE0aOAON.js} +7 -7
- package/dist/assets/{ReportsRoutes-D-cpB-sX.js → ReportsRoutes-NzIYaPVq.js} +1 -1
- package/dist/assets/RewardsRoutes-CwZUzIe1.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CNF1ceQn.js → ScheduleDetailsPrepaidExpensesScreen-JrbhJns8.js} +5 -5
- package/dist/assets/ScreenRoutes-DwyFQCfk.js +2 -0
- package/dist/assets/{SettingsRoutes-D_LLhbJv.js → SettingsRoutes-C1rh1f5s.js} +6 -6
- package/dist/assets/SetupPagesScreen-Cl5BAT-o.js +29 -0
- package/dist/assets/SignInScreen-_U7Bj35k.js +1 -0
- package/dist/assets/SignOutScreen-BgEdGGQF.js +9 -0
- package/dist/assets/TaskListScreen-CvKGMIZk.js +9 -0
- package/dist/assets/TaskRoutes-CEJdgyOG.js +9 -0
- package/dist/assets/TransactionDetailRoutes-S-naEoj9.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CWo5MdmD.js → TransactionDetailScreen-CNGUSd_b.js} +2 -2
- package/dist/assets/TransactionListRoutes-ChCViJl9.js +1 -0
- package/dist/assets/{TreasuryRoutes-B1C-ovJX.js → TreasuryRoutes-xGBsDsbG.js} +3 -3
- package/dist/assets/{VendorsRoutes-DoSPbM9C.js → VendorsRoutes-CxbN9ffS.js} +13 -13
- package/dist/assets/WiseConfirmationScreen--1X8GtN8.js +12 -0
- package/dist/assets/ZeniAccountRoutes-DKMn9Mvs.js +57 -0
- package/dist/assets/{ZeniAccountStatementScreen-kiOSzYpp.js → ZeniAccountStatementScreen-CY8Yij9t.js} +2 -2
- package/dist/assets/{accountMappingHelper-CeXF1Q4Q.js → accountMappingHelper-CnG-eRj3.js} +1 -1
- package/dist/assets/{analytics-DI5uqxwC.js → analytics-DlzSqyvZ.js} +1 -1
- package/dist/assets/{analyticsHelper-Df3DOmUB.js → analyticsHelper-Cq1viJip.js} +1 -1
- package/dist/assets/{core-_cqItzd_.js → core-D07hD3KT.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CzbN3zRu.js → decodeURIComponentSafe-D3MFRtCF.js} +1 -1
- package/dist/assets/{dnd-BzHSvmGV.js → dnd-B-KpYfWT.js} +1 -1
- package/dist/assets/{empty-CTsBwHYQ.js → empty-DRbThjIF.js} +1 -1
- package/dist/assets/{empty-IeCSs-Vp.js → empty-aXh7noZx.js} +1 -1
- package/dist/assets/{emptyVideoElement-BDIFj1OP.js → emptyVideoElement-BZocj0UF.js} +1 -1
- package/dist/assets/epic-Du2AdUHP.js +2 -0
- package/dist/assets/expenseAutomationHelper-CL7YOVzM.js +1 -0
- package/dist/assets/{getLocaleForTenant-DNtLZSig.js → getLocaleForTenant-4ThGApJK.js} +1 -1
- package/dist/assets/{index-_QekaZI8.js → index-54OCX1PW.js} +1 -1
- package/dist/assets/{index-DVhAab8j.js → index-B1xlAtau.js} +16884 -16790
- package/dist/assets/{index-CFtxbACp.js → index-BIOOl02m.js} +1 -1
- package/dist/assets/{index-z7nFmc82.js → index-BVdX_ubi.js} +2 -2
- package/dist/assets/{index-LjABwt4q.js → index-BxmwktwS.js} +1 -1
- package/dist/assets/{index-B_Z1rAKT.js → index-D5s14gxd.js} +1 -1
- package/dist/assets/{index-CMOD4X8_.js → index-YyHAbx34.js} +1 -1
- package/dist/assets/{index-aNhAY0yh.js → index-z9Fh-4S1.js} +1 -1
- package/dist/assets/{lexical-CXRKir6z.js → lexical-NIxvAmS2.js} +1 -1
- package/dist/assets/{liveblocks-gNIoHksP.js → liveblocks-CQOAuUNI.js} +1 -1
- package/dist/assets/{lottie-CjJcvZ3r.js → lottie-BIKpYE12.js} +1 -1
- package/dist/assets/{mui-CDH3xRD_.js → mui-XiTT8YBC.js} +1 -1
- package/dist/assets/{pathToGoBack-DqZRBX-C.js → pathToGoBack-RICxbZCJ.js} +1 -1
- package/dist/assets/{pdf-BZVEJwNE.js → pdf-Dli3mGO_.js} +3 -3
- package/dist/assets/{pdf-lib-DnzapqoA.js → pdf-lib-D9XJLVoD.js} +1 -1
- package/dist/assets/{plaid-Dvn5Z296.js → plaid-BG3pJamN.js} +1 -1
- package/dist/assets/{pusher-CcIFKuUn.js → pusher-D9DkHuMx.js} +1 -1
- package/dist/assets/{react-CPb70X99.js → react-BLzCbojr.js} +1 -1
- package/dist/assets/{react-AHfmXvhq.js → react-C-5ZNsBH.js} +1 -1
- package/dist/assets/{react-DClAw2ak.js → react-C1d1ocIu.js} +1 -1
- package/dist/assets/{react-t3XyoKqw.js → react-CrrxpEIc.js} +1 -1
- package/dist/assets/{react-DAXlQZC6.js → react-D2I9LF0A.js} +1 -1
- package/dist/assets/{react-CuiiYztJ.js → react-DkT18Fv5.js} +1 -1
- package/dist/assets/{recharts-BgEcqT8y.js → recharts-CgYqsGTH.js} +1 -1
- package/dist/assets/{routePaths-DM8AEJT0.js → routePaths-Byv4I0Ax.js} +1 -1
- package/dist/assets/{sentry-BzzHvh63.js → sentry-pp_6zWNc.js} +1 -1
- package/dist/assets/{stripSplatSuffix-D8FyJbXM.js → stripSplatSuffix-DA-gXJ77.js} +1 -1
- package/dist/assets/{url-BuE-ZvDR.js → url-TK5h7pVR.js} +1 -1
- package/dist/assets/{url-0BMhJWUX.js → url-yI9BET_f.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-DTg70T-B.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C6pX9M29.js → useAiCfoDashboardSuggestedQuestionsChips-BtQMXCJn.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-gzIjh_Rc.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-pc-PEvCr.js → useChargeCardPusherEvents-BYYn6vOu.js} +1 -1
- package/dist/assets/{useDeviceId-DYE-WS_B.js → useDeviceId-DCPRNX-s.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-C_tEfW8U.js +1 -0
- package/dist/assets/{useInitialThreadRequest-CSR_bJDf.js → useInitialThreadRequest-Cuwjfmqu.js} +1 -1
- package/dist/assets/useTaskManagerAccess-Y5qsn5_D.js +1 -0
- package/dist/assets/{useTaskManagerPusherEvents-C0fOaGqk.js → useTaskManagerPusherEvents-CgwVJFYR.js} +1 -1
- package/dist/assets/{utils-DZX8_JTm.js → utils-CrOdvv6w.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BKXId2BT.js → withTransactionSidePanel-BqueNlFJ.js} +4 -4
- package/dist/assets/{zeni-epic-state-ClqSlu6d.js → zeni-epic-state-B3TABHgO.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-C13OMsQB.js +0 -1
- package/dist/assets/AiCfoScreen-C1Zi5BWJ.js +0 -22
- package/dist/assets/BusinessVerificationPageScreen-CaVy5wIy.js +0 -9
- package/dist/assets/CardsAiCfoScreen-BHtNOqz6.js +0 -14
- package/dist/assets/ConnectionAuthScreen-C6aejitU.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-abpr3s2K.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-DVMAQtsb.js +0 -30
- package/dist/assets/EntityDetailRoutes-bilW2_CZ.js +0 -1
- package/dist/assets/FeaturePreviewScreen-ADHB7kMI.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-7DU1Mbfq.js +0 -1
- package/dist/assets/InvoicingRoutes-CiTJXDwp.js +0 -2
- package/dist/assets/MagicLinkSignInScreen-DdvxD6Sl.js +0 -12
- package/dist/assets/MobileAppDrawer-Boi7lIY0.js +0 -1
- package/dist/assets/NotFoundScreen-XQ69x1V9.js +0 -1
- package/dist/assets/NotificationRoutes-CjruMuyg.js +0 -1
- package/dist/assets/OAuthConsentScreen-fv9EuWPU.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CwPS1KT_.js +0 -1
- package/dist/assets/PeopleRoutes-B4wBQVwY.js +0 -22
- package/dist/assets/PerformanceRoutes-BaUrr9_i.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-BoJxAtXM.js +0 -1
- package/dist/assets/RewardsRoutes-Cp5QwRpd.js +0 -1
- package/dist/assets/ScreenRoutes-DSM6zpE1.js +0 -2
- package/dist/assets/SetupPagesScreen-PMDfztMD.js +0 -29
- package/dist/assets/SignInScreen-DXEwLRRd.js +0 -1
- package/dist/assets/SignOutScreen-rRGrVkZi.js +0 -9
- package/dist/assets/TaskListScreen-C_FDDeaV.js +0 -9
- package/dist/assets/TaskRoutes-DIOgMKYK.js +0 -9
- package/dist/assets/TransactionDetailRoutes-C6i9gm0l.js +0 -1
- package/dist/assets/TransactionListRoutes-DMziXkI4.js +0 -1
- package/dist/assets/WiseConfirmationScreen-CYU0SXmY.js +0 -12
- package/dist/assets/ZeniAccountRoutes-4rPFLUgD.js +0 -57
- package/dist/assets/epic-BpPMSALI.js +0 -2
- package/dist/assets/expenseAutomationHelper-CTin--xN.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-CQqHF-gN.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DQSYAHEz.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-XR0U1MaM.js +0 -1
- package/dist/assets/useTaskManagerAccess-CZYVdWyJ.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-gNIoHksP.js";import{a as r}from"./sentry-BzzHvh63.js";import{u as L,h as _,i as F,j as k,t as Z,l as O,s as q,g as X,N as V,n as oe,o as x}from"./core-_cqItzd_.js";import{a8 as Yn,n as g,aq as R,T as d,cc as et,cd as nt,ce as tt,cf as it,cg as ot,ch as at,ci as ct,cj as st,ck as rt,cl as dt,cm as lt,cn as ut,p as J,co as gt,cp as vt,z as W,ae as se,cq as mt,cr as pt,cs as St,ct as ft,cu as It,cv as ht,cw as Ct,cx as kt,cy as Et,cz as yt,P as bt,ai as rn,cA as xt,cB as At,cC as Dt,cD as jt,cE as Lt,cF as _t,cG as Pt,cH as wt,cI as $t,cJ as Ft,cK as Rt,t as He,m as _e,cL as Tt,cM as Ot,cN as Mt,cO as Nt,cP as Ut,cQ as Bt,cR as Vt}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import{A as K}from"./AddressScreen-CPpf4Cpj.js";import M from"./NotFoundScreen-XQ69x1V9.js";import{ZW as Ht,ZX as qt,vv as qe,ZY as G,vY as re,ZZ as Pe,Z_ as de,wz as be,wG as Qt,wL as dn,Z$ as we,wD as ln,yd as Qe,vX as ze,_0 as zt,_1 as un,wW as xe,_2 as le,w_ as Kt,_3 as Gt,_4 as gn,x1 as vn,z8 as Wt,_5 as Se,_6 as Ke,_7 as mn,vV as Zt,_8 as Xt,vP as Jt,_9 as Yt,yq as ei,_a as pn,yz as Ge,_b as ni,yw as ti,_c as $e,gk as Fe,_d as te,_e as ie,xg as ii,w1 as We,w6 as Sn,w4 as oi,v_ as ai,x9 as ci,w8 as si,xi as ri,_f as Ae,xr as fn,xp as fe,xn as ue,xm as di,_g as In,yF as Ze,_h as li,vW as hn,_i as Re,fI as Ie,wh as De,we as je,wr as Cn,wq as Te,wb as ui,wk as kn,wt as ae,VI as En,vZ as Oe,wo as gi,wp as vi,wn as mi,_j as pi,w$ as Si,wX as yn,_k as bn,vJ as Xe,_l as fi,vF as Ii,_m as hi,yL as Ci,yP as Q,yK as ki,xT as he,_n as Ei,_o as xn,yY as Je,_p as yi,yV as bi,_q as An,xW as xi,xX as H,x_ as Ai,_r as Dn,y8 as Ee,_s as Di,xh as jn,Ue as Ln,_t as ji,yi as Li,_u as _n,_v as _i,_w as Pi,_x as wi,zN as $i,_y as Fi,_z as Pn,z3 as wn,_A as $n,zL as ye,_B as Ri,zI as Ti,_C as Oi,_D as Mi,_E as Ni,_F as Ui,_G as Bi,_H as Ye,_I as Vi,ei as Hi,zR as qi,_J as Me,xB as Qi,xw as zi,_K as ge,xM as Fn,xE as ve,xD as Ki,xH as Rn,_L as Gi,xC as Wi,_M as Tn,z9 as On,zA as en,zv as Zi,_N as Xi,za as Ji,_O as Yi,zB as eo,zF as no,_P as Ne,wB as Mn,zm as to,wC as io,_Q as oo,_R as Nn,c9 as ao,mv as co,mw as so,_S as nn,wA as me,go as ro,mC as lo,zs as Un,A1 as uo,zp as Bn,v1 as go,uR as vo,hV as mo,UH as tn,UI as po,Gn as Vn,z_ as So,hN as fo,zX as Io,_T as ho,_U as Co,A7 as ko,A6 as Eo,_V as yo,_W as Hn,A4 as bo,_X as xo,_Y as Ao,ym as Do,_Z as jo}from"./zeni-epic-state-ClqSlu6d.js";import{M as Lo}from"./MobileAppDrawer-Boi7lIY0.js";import{q as pe}from"./QBOConnectionScreen-Czz6muQW.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";import"./InboxNotificationsProvider-Vlyx5Pej.js";import"./useTaskManagerAccess-CZYVdWyJ.js";import"./empty-CTsBwHYQ.js";import"./pdf-lib-DnzapqoA.js";import"./index-B_Z1rAKT.js";import"./url-BuE-ZvDR.js";import"./index-aNhAY0yh.js";import"./decodeURIComponentSafe-CzbN3zRu.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="486d797d-e91e-4b89-9df0-c584c0d204db",t._sentryDebugIdIdentifier="sentry-dbid-486d797d-e91e-4b89-9df0-c584c0d204db")}catch{}})();const $=({event:t,isReady:e=!0})=>e?c.jsx(Yn,{analytics:g,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function _o(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:m,hasMore:p,items:f,nextCursor:I,auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:h}=k(Ht),y=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),D=`/${n??""}/invoicing`,b=r.useCallback(((P,U)=>{const T=qt(D,P,U,E);T!=null&&(g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{entity:P,entityId:U,fromScreen:"audit_log",toScreen:P}),e(T))}),[E,e,D]);r.useEffect((()=>{const P=setTimeout((()=>u(a)),300);return()=>clearTimeout(P)}),[a]),r.useEffect((()=>{i&&t(qe({filters:y,keepExistingListItems:!1,sort:v}))}),[i,y,v,t]);const A=m==="Not-Started"||m==="In-Progress"&&f.length===0,C=m==="In-Progress"&&f.length>0,j=m==="Completed";return N(m)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingAuditLogPage,isReady:j}),c.jsx(et,{auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:h,entries:f,hasMore:p,isLoading:A,isLoadingMore:C,searchValue:a,sortState:l,onEntityLinkClick:b,onLoadMore:()=>{p&&I!=null&&t(qe({cursor:I,filters:y,keepExistingListItems:!0,sort:v}))},onSearchChange:o,onSortChange:S})]})}function Ce(t,e=!1){const n=L(),i=k((s=>G(s).productNextCursor!=null)),a=k((s=>G(s).productNextCursor)),o=k((s=>G(s).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&o!=="Not-Started"||n(re({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&o!=="In-Progress"&&i&&a!=null&&n(re({cursor:a,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,o,i,a])}function Y(t,e,n,i){const[a,o]=r.useState(0),[s,u]=r.useState(!1),l=r.useRef(t);return r.useEffect((()=>{const S=l.current==="In-Progress";l.current=t,t==="Completed"&&S&&n!=null&&(u(!0),i(n))}),[t,n,i]),r.useEffect((()=>{s&&!e&&(u(!1),o((S=>S+1)))}),[s,e]),a}const Po=new Set(["plan"]),wo=O((function(t,e){const{view:n}=e;return{applicableItemOptions:n.applicableItemOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboClassHierarchy:n.qboClassHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,catalogProductLifecycleActionOptions:n.catalogProductLifecycleActionOptions,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,isLoading:e.isLoading,isRunningLifecycleAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",itemId:e.itemId,localData:n.localData,plan:n.plan}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{itemId:i}=e;return{onBack:()=>e.navigate(`${n}/catalog`),onLifecycleAction:i!==""?a=>{i!==""&&(g.trackInvoicingActionClick(d.Event.invoicingCatalogItemLifecycleAction,{action:a,fromScreen:"catalog_item_detail",itemId:i}),t(ln({action:a,id:i})))}:void 0,onEditChange:a=>{i!==""&&t(we({id:i,localData:a}))},onSaveEdit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemEdited,{itemId:i}),t(dn({id:i}))},onSubFamilyLifecycleAction:(a,o)=>{i!==""&&t(Qt({action:o,id:a,parentItemId:i}))}}}))(nt);function $o(){const t=L(),e=_(),{item_id:n,tenantEmailDomain:i}=F(),[a]=Z(),{areTenantIdsInSync:o}=R(),s=(u=a.get("kind"))!=null&&Po.has(u)?u:"plan";var u;const l=k((y=>Pe(y,n))),{pageFetchState:S}=l,v=S.fetchState;r.useEffect((()=>(t(de({id:n})),()=>{t(de({id:n}))})),[t,n]),r.useEffect((()=>{o&&t(be({id:n,kind:s}))}),[o,n,s,t]);const m=r.useCallback((y=>t(be({cacheOverride:!0,id:y,kind:s}))),[t,s]),p=Y(l.fetchState,l.isFormLoading,n,m),f=v==="Completed"&&!l.isFormLoading;Ce(o,!0);const[I,E]=r.useState(f?n:void 0);r.useEffect((()=>{n!=null&&f&&E(n)}),[n,f]);const h=I!==n&&(v==="Not-Started"||v==="In-Progress"||l.isFormLoading);return N(v)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCatalogItemDetailPage,isReady:f}),c.jsx(wo,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:s,isLoading:h,view:l},p)]})}const Fo=new Set(["addon","charge","plan"]),Ro=new Set(["plan"]),To=O((function(t,e){const n=Pe(t,e.itemId);return{fieldHelp:n.fieldHelp,qboClassHierarchy:n.qboClassHierarchy,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,applicabilityValues:n.applicabilityValues,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,applicableItemOptions:n.applicableItemOptions,defaultType:e.isEdit?void 0:e.defaultType,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save catalog item.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,pricingModelValues:n.pricingModelValues,prorationValues:n.prorationValues,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,tierTypeValues:n.tierTypeValues}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:a}=e,o=a!=null?`${n}/catalog/${encodeURIComponent(a)}`:`${n}/catalog`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemFormCancelled),t(de({id:a})),e.navigate(`${n}/catalog`)},onChange:s=>{t(we({id:a,localData:s}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemSaved,{mode:i}),t(dn({id:a}))}}}))(tt);function Oo(){const t=L(),e=_(),{item_id:n,tenantEmailDomain:i}=F(),[a]=Z(),{areTenantIdsInSync:o}=R(),s=n!=null,u=a.get("type"),l=u!=null&&Fo.has(u)?u:void 0,S=(v=a.get("kind"))!=null&&Ro.has(v)?v:"plan";var v;const m=k((p=>Pe(p,n)));return Ce(o,!0),r.useEffect((()=>{o&&t(be({id:n,kind:S}))}),[o,n,S,t]),r.useEffect((()=>{s||l==null||m.localData.catalogType===l||t(we({localData:{...m.localData,catalogType:l}}))}),[s,l,m.localData?.catalogType,t]),r.useEffect((()=>{if(m.fetchState==="Completed"){const p=m.savedItemId??n,f=p!=null?`/${i}/invoicing/catalog/${encodeURIComponent(p)}`:`/${i}/invoicing/catalog`;e(f),t(de({id:n}))}}),[m.fetchState,m.savedItemId,n,t,e,i]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCatalogItemFormPage}),c.jsx(To,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:s,itemId:n})]})}const Mo={addons:"addon",all:"item",charges:"charge",plans:"plan"},No=O((function(t,e){const n=G(t),i=e.activeTab==="plans",a=e.activeTab==="all",o=i?n.plans:a?[...n.plans,...n.products]:n.products,s=i||a&&n.fetchState==="In-Progress"?n.fetchState:n.productFetchState.fetchState;return{catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,counts:n.count,countsLoading:n.countsFetchState.fetchState==="Not-Started"||n.countsFetchState.fetchState==="In-Progress",hasMore:i?n.planNextCursor!=null:a&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:s==="Not-Started"||s==="In-Progress"&&o.length===0,isLoadingMore:s==="In-Progress"&&o.length>0,plans:n.plans,productColumns:n.productColumns,products:n.products}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",a=e.activeTab==="all",o=i?e.planNextCursor:e.productNextCursor;return{activeTab:e.activeTab,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTabChange:e.onTabChange,onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const s=Mo[e.activeTab];g.trackInvoicingActionClick(d.Event.invoicingAddCatalogItemClicked,{itemType:s}),e.navigate(`${n}/catalog/new?type=${s}`)},onItemClick:(s,u)=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemRowClicked,{itemId:u}),e.navigate(`${n}/catalog/${encodeURIComponent(u)}`)},onCatalogItemLifecycleAction:(s,u)=>{g.trackInvoicingActionClick(d.Event.invoicingCatalogItemLifecycleAction,{action:u,fromScreen:"catalog_list",itemId:s}),t(ln({action:zt(u),id:s}))},onLoadMore:()=>{if(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"catalog",tab:e.activeTab}),a)return e.planNextCursor!=null&&t(ze({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(re({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));o!=null&&t(i?ze({cursor:o,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):re({cursor:o,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(it);function Uo(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState("plans"),[l,S]=r.useState(""),[v,m]=r.useState(null),p=r.useMemo((()=>v!=null?{dir:v.direction,field:v.columnKey}:void 0),[v]),f=l.trim()!==""?l.trim():void 0,I=r.useMemo((()=>({search:f,type:"plan"})),[f]),E=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),h=k((P=>G(P))),y=h.planFilters.search,D=h.planSort,b=h.planNextCursor,A=h.productNextCursor,C=h.fetchState==="Completed",j=h.runningActionId??null;return r.useEffect((()=>{const P=setTimeout((()=>S(a)),300);return()=>clearTimeout(P)}),[a]),r.useEffect((()=>{i&&t(Qe({cacheOverride:!1,planFilters:I,productFilters:E,planSort:p,productSort:p}))}),[i,t,I,E,p]),r.useEffect((()=>{i&&(f!==y||p?.field!==D?.field||p?.dir!==D?.dir)&&t(Qe({cacheOverride:!0,planFilters:I,productFilters:E,planSort:p,productSort:p}))}),[y,D,i,t,I,E,f,p]),N(h.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCatalogPage,isReady:C}),c.jsx(No,{navigate:e,tenantEmailDomain:n,activeTab:s,searchValue:a,sortState:v,planFilters:I,productFilters:E,sort:p,planNextCursor:b,productNextCursor:A,runningCatalogItemActionId:j,onSearchChange:o,onTabChange:u,onSortChange:m})]})}const Bo=O((function(t,e){const n=un(t,e.couponId);return{fieldHelp:n.fieldHelp,applyOnOptions:n.applyOnOptions,discountTypeOptions:n.discountTypeOptions,durationTypeOptions:n.durationTypeOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save coupon.":void 0,isQboConnected:n.isQboConnected,isQboPickerDataLoading:n.isQboPickerDataLoading,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCouponFormCancelled),t(le({id:i})),e.navigate(`${n}/discounts`)},onChange:s=>{t(Gt({id:i,localData:s}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCouponSaved,{mode:a}),t(Kt({id:i}))}}}))(ot);function Vo(){const t=L(),e=_(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),{fetchState:o,savedCouponId:s}=k((u=>un(u,n)));return r.useEffect((()=>{a&&t(xe({id:n}))}),[a,n,t]),r.useEffect((()=>{if(o==="Completed"){const u=s??n,l=u!=null?`/${i}/invoicing/discounts/${encodeURIComponent(u)}`:`/${i}/invoicing/discounts`;e(l),t(le({id:n}))}}),[o,s,n,t,e,i]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCouponFormPage}),c.jsx(Bo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const Ho=O((function(t){const e=gn(t);return{fieldHelp:e.fieldHelp,customers:e.customers,planNames:e.planNames,errorMessage:e.fetchState==="Error"?e.error?.message??"Failed to create invoice. Please try again.":void 0,isSubmitting:e.fetchState==="In-Progress",localData:e.localData,settings:e.settings}}),(function(t){return{dispatch:t}}),(function(t,{dispatch:e},n){const i=`/${n.tenantEmailDomain}/invoicing`;return{...t,onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:a=>{e(mn(a))},onSubmit:()=>{const a=Xt(t.localData);g.trackInvoicingActionClick(d.Event.invoicingInvoiceCreated,{customerId:a.customer_id,lineItemCount:a.line_items?.length}),e(Jt(a))}}}))(ct);function qo(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),[i]=Z(),{areTenantIdsInSync:a}=R(),o=i.get("customerId"),s=k((b=>gn(b))),u=s.fetchState,l=s.localData,S=s.savedInvoiceId,v=k(vn),m=k((b=>Wt(b))),p=k(Se),f=m.fetchState==="Not-Started"||m.fetchState==="In-Progress"&&v==null,I=p.fetchState==="Not-Started"||p.fetchState==="In-Progress"&&p.customers.length===0,E=f||I,h=m.fetchState==="Completed"&&p.fetchState==="Completed";r.useEffect((()=>(t(Ke()),()=>{t(Ke())})),[t]);const y=r.useRef(!1);r.useEffect((()=>{y.current||o==null||o===""||l.customerId!==""||(y.current=!0,t(mn({...l,customerId:o})))}),[o,l,t]),r.useEffect((()=>{a&&t(Zt({cacheOverride:!1}))}),[a,t]);const D=r.useRef(u);return r.useEffect((()=>{const b=D.current;if(D.current=u,b!=="Completed"&&u==="Completed"){const A=S!=null?`/${n}/invoicing/invoices/${encodeURIComponent(S)}`:`/${n}/invoicing/invoices`;e(A)}}),[u,S,e,n]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCreateInvoicePage,isReady:h}),E?c.jsx(at,{}):c.jsx(Ho,{navigate:e,tenantEmailDomain:n})]})}const Qo=O((function(t,e){const{detailView:n}=e;return{fieldHelp:e.detailView.fieldHelp,creditNote:n.creditNote,creditNoteId:e.creditNoteId,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onBack:()=>e.navigate(`${n}/credits`),onCustomerClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(st);function zo(){const t=L(),e=_(),{credit_note_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((u=>Yt(u,n??""))),s=o.fetchState==="Completed";return r.useEffect((()=>{a&&n!=null&&t(ei({id:n}))}),[a,n,t]),N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCreditDetailPage,isReady:s}),c.jsx(Qo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:o})]})}const Ko=O((function(t){const e=pn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",creditNotes:e.creditNotes,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.creditNotes.length===0,isLoadingMore:n==="In-Progress"&&e.creditNotes.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"credits",status:e.activeStatus}),t(ti({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(rt);function Go(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,creditNoteListFetchState:h}=k((D=>{const b=pn(D);return{activeStatus:b.activeTab,appliedSearch:b.filters.search,appliedSort:b.sort,nextCursor:b.nextCursor,creditNoteListFetchState:b.fetchState}}),q),y=h==="Completed";return r.useEffect((()=>{const D=setTimeout((()=>u(a)),300);return()=>clearTimeout(D)}),[a]),r.useEffect((()=>{i&&t(Ge({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ge({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCreditsListPage,isReady:y}),c.jsx(Ko,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,onSearchChange:o,onStatusChange:D=>t(ni(D)),onSortChange:S})]})}const qn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Wo=O((function(t,e){const{editView:n,hasLoadedRecord:i}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,hasUnsavedBillingAddress:n.hasUnsavedBillingAddress,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:!i&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),hasPaymentLinkEmailPreviewFailed:n.emailPreviewFetchState.fetchState==="Error",isPaymentLinkEmailPreviewLoading:n.emailPreviewFetchState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",paymentLinkEmailPreview:n.emailPreview,isSendingPaymentLink:n.record.sendLinkState.fetchState==="In-Progress",localData:n.localData,paymentMethods:n.record.paymentMethods,sendPaymentLinkErrorMessage:n.record.sendLinkState.fetchState==="Error"?n.record.sendLinkState.error?.message??"Failed to send payment link.":void 0,sentPaymentLinkEmail:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkEmail:void 0,sentPaymentLinkMagicUrl:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkMagicUrl:void 0,stripeConnected:n.record.stripeConnected}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e;return{onBack:()=>e.navigate(`${n}/customers`),onChange:a=>{t(Ae({id:i,localData:a}))},onCreateInvoice:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customer_detail"}),e.navigate(`${n}/invoices/create`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onCreatePromotionalCredits:()=>{g.trackInvoicingActionClick(d.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customer_detail"}),e.onCreatePromotionalCredits()},onNewSubscription:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customer_detail"}),e.navigate(`${n}/subscriptions/new`)},onDiscardEdit:()=>{t(fe(ue)),t(di({id:i}))},onOpenAddress:()=>{const a=qn(e.tenantEmailDomain??"",ue,i),o=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(a,{state:{pathnameStackToGoBack:o}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:a=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerEdited,{customerId:i}),t(Ae({id:i,localData:a})),t(fn({id:i}))},onFetchPaymentLinkEmailPreview:a=>t(ri({cacheOverride:a,customerId:i})),onSendPaymentLink:(a,o,s)=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentLinkSent,{customerId:i,fromScreen:"customer_detail"}),t(si({body:s,customerId:i,email:a,subject:o}))},onSubscriptionClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)}}}))(ut);function Zo(){const t=L(),e=_(),n=X(),{customer_id:i,tenantEmailDomain:a}=F(),{areTenantIdsInSync:o}=R(),s=k((T=>$e(T,i))),u=s.pageFetchState.fetchState,l=u==="Completed"&&!s.isFormLoading,[S,v]=r.useState(!1),[m,p]=r.useState(!1),[f,I]=r.useState(l?i:void 0);r.useEffect((()=>{i!=null&&l&&I(i)}),[i,l]);const E=f===i,{plaidTokenFetchState:h,promotionalCreditSubmitState:y}=s,{paymentMethodSaveState:D,setupIntentFetchState:b,stripeConnected:A}=s.record,C=r.useRef(s.record.sendLinkState.fetchState);r.useEffect((()=>{const T=s.record.sendLinkState.fetchState;C.current!=="Error"&&T==="Error"&&t(Fe({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),C.current=T}),[t,s.record.sendLinkState.fetchState]);const j=b.fetchState==="Error"?b.error?.message??"Failed to start card setup.":D.fetchState==="Error"?D.error?.message??"Failed to save payment method.":h.fetchState==="Error"?h.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(te()),t(ie()),()=>{t(te()),t(ie())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(p(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{o&&i!=null&&t(ii({id:i}))}),[o,i,t]),r.useEffect((()=>{o&&i!=null&&A&&t(We({customerId:i}))}),[o,i,t,A]);const P=r.useCallback((T=>t(Sn({id:T}))),[t]),U=Y(s.fetchState,s.isFormLoading,i,P);return N(u)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCustomerDetailPage,isReady:l}),c.jsx(Wo,{customerId:i??"",editView:s,hasLoadedRecord:E,location:n,navigate:e,tenantEmailDomain:a,onAddPaymentMethod:()=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentMethodAddClicked,{customerId:i??"",fromScreen:"customer_detail"}),t(te()),i!=null&&A&&t(We({customerId:i})),v(!0)},onCreatePromotionalCredits:()=>{t(ie()),p(!0)}},U),c.jsx(dt,{errorMessage:j,isCreatingSetupIntent:b.fetchState==="In-Progress",isSaving:D.fetchState==="In-Progress",open:S,plaidLinkToken:s.record.plaidLinkToken,saveSucceeded:D.fetchState==="Completed",setupIntent:s.record.setupIntent,stripeConnected:A,onChooseCard:()=>{i!=null&&t(ai({customerId:i}))},onClose:()=>{v(!1),t(te())},onSavePaymentMethod:T=>{i!=null&&(g.trackInvoicingActionClick(d.Event.invoicingPaymentMethodSaved,{customerId:i,fromScreen:"customer_detail"}),t(oi({customerId:i,data:T})))}}),c.jsx(lt,{currentBalance:s.record.invoicingCustomer?.promotionalCredits,currencyCode:s.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:y.fetchState==="Error"?y.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:y.fetchState==="In-Progress",open:m,submitSucceeded:y.fetchState==="Completed",onClose:()=>{p(!1),t(ie())},onSubmit:({amount:T,description:ne})=>{i!=null&&(g.trackInvoicingActionClick(d.Event.invoicingPromotionalCreditsAdded,{amount:T,customerId:i,fromScreen:"customer_detail"}),t(ci({amount:T,customerId:i,currencyCode:s.record.invoicingCustomer?.preferredCurrencyCode,description:ne})))}})]})}const Xo=O((function(t,e){const n=$e(t,e.customerId);return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save customer.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(o),onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerFormCancelled),t(In({id:i})),t(fe(ue)),e.navigate(`${n}/customers`)},onChange:s=>{t(Ae({id:i,localData:s}))},onOpenAddress:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddressOpened,{entity:"customer",fromScreen:"customer_form"});const s=qn(e.tenantEmailDomain??"",ue,i),u=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerSaved,{mode:a}),t(fn({id:i}))}}}))(gt);function Jo(){const t=L(),e=_(),n=X(),{customer_id:i,tenantEmailDomain:a}=F(),{areTenantIdsInSync:o}=R(),{fetchState:s,savedCustomerId:u}=k((l=>$e(l,i)));return r.useEffect((()=>{o&&i!=null&&t(Sn({id:i}))}),[o,i,t]),r.useEffect((()=>{if(s==="Completed"){const l=u??i,S=l!=null?`/${a}/invoicing/customers/${encodeURIComponent(l)}`:`/${a}/invoicing/customers`;e(S),t(In({id:i}))}}),[s,u,i,t,e,a]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCustomerFormPage}),c.jsx(Xo,{customerId:i,location:n,navigate:e,tenantEmailDomain:a})]})}const Yo=O((function(t){const e=Se(t),{fetchState:n}=e;return{addressesById:t.addressState.addressesById,columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",customers:e.customers,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.customers.length===0,isLoadingMore:n==="In-Progress"&&e.customers.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onAddCustomer:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,a)=>{switch(a){case"createInvoice":g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":g.trackInvoicingActionClick(d.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":g.trackInvoicingActionClick(d.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"customers",status:e.activeStatus}),t(hn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(vt);function ea(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,customerListFetchState:h}=k((D=>{const b=Se(D);return{activeStatus:b.activeTab,appliedSearch:b.filters.search,appliedSort:b.sort,nextCursor:b.nextCursor,customerListFetchState:b.fetchState}}),q),y=h==="Completed";return r.useEffect((()=>{const D=setTimeout((()=>u(a)),300);return()=>clearTimeout(D)}),[a]),r.useEffect((()=>{i&&t(Ze({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ze({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingCustomersListPage,isReady:y}),c.jsx(Yo,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,onSearchChange:o,onStatusChange:D=>t(li(D)),onSortChange:S})]})}const Le=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),na=O((function(t,e){const{authParams:n,csvDownloadUrl:i,filters:a,sessionId:o,view:s}=e,u=o==null?void 0:s.diagnosticsBySession[o],l=u?.fetch.fetchState??"Not-Started";return{authParams:n,csvDownloadUrl:i,diagnostics:u?.items??[],errorMessage:l==="Error"?u?.fetch.error?.message:void 0,expired:u?.expired??!1,filters:a,hasMore:u?.nextCursor!=null,isLoading:l==="Not-Started"||l==="In-Progress",isLoadingMore:l==="In-Progress"&&(u?.items.length??0)>0,session:Le(s,o)}}),(function(t,e){const{filters:n,navigate:i,sessionId:a,tenantEmailDomain:o,view:s}=e,u=a==null?void 0:s.diagnosticsBySession[a],l=Le(s,a),S=s.actionStateByKind.retry?.fetchState==="In-Progress",v=s.actionStateByKind.rollback?.fetchState==="In-Progress",m=l?.status==="done"&&l.rollback_available_until!=null&&new Date(l.rollback_available_until).getTime()>Date.now()&&!v;return{onBack:()=>i(`/${o}/invoicing/data_import`),onDownloadCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"download_csv",fromScreen:"data_import_detail",sessionId:a})},onDownloadError:()=>{t(Fe({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{a!=null&&u?.nextCursor!=null&&t(je({...n,cursor:u.nextCursor,sessionId:a}))},onRetry:l?.status!=="failed"||S?void 0:()=>{a!=null&&(g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"retry",fromScreen:"data_import_detail",sessionId:a}),t(Te(a)))},onRollback:m?()=>{a!=null&&(g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"rollback",fromScreen:"data_import_detail",sessionId:a}),t(Cn(a)))}:void 0}}))(mt);function ta(){const t=L(),e=_(),{sessionId:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),[o,s]=r.useState({}),u=k(Re),l=k(Ie),S=r.useMemo((()=>{const E=W.getSignedInUser();return{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:l.tenantId}}),[l.tenantId]),v=Le(u,n),m=n==null?void 0:u.diagnosticsBySession[n];r.useEffect((()=>{a&&n!=null&&t(De(n))}),[a,t,n]),r.useEffect((()=>{if(!a||n==null)return;const E=setTimeout((()=>{t(je({...o,sessionId:n}))}),300);return()=>clearTimeout(E)}),[a,t,o,n]);const p=v?.status==="scanning"||v?.status==="importing";r.useEffect((()=>{if(!a||n==null||!p)return;const E=setInterval((()=>{t(De(n)),t(je({...o,sessionId:n}))}),3e3);return()=>clearInterval(E)}),[a,t,o,p,n]);const f=r.useMemo((()=>{if(n==null)return"";const E=new URLSearchParams;o.moduleId!=null&&E.set("module_id",o.moduleId),o.level!=null&&E.set("level",o.level),o.outcome!=null&&E.set("outcome",o.outcome),o.search!=null&&o.search.trim()!==""&&E.set("search",o.search.trim());const h=E.toString();return`${se?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${h===""?"":`?${h}`}`}),[o,n]),I=m?.fetch.fetchState??"Not-Started";return N(I)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDataImportDetailPage,isReady:v!=null&&I!=="Not-Started"}),c.jsx(na,{authParams:S,csvDownloadUrl:f,filters:o,navigate:e,sessionId:n,tenantEmailDomain:i,view:u,onFiltersChange:s})]})}const Qn=t=>`invoicing_active_migration:${t}`,ce=(t,e)=>{if(t!=null&&t!=="")try{const n=Qn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},ia=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:a,statusRows:o}=e.view;return{isLoading:!(a.fetchState!=="Not-Started"&&a.fetchState!=="In-Progress"||o.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:o}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,a=o=>{const s=o??null;t(ae(s)),ce(i,s),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"continue",sessionId:o}),a(o)},onNewImport:()=>{g.trackInvoicingActionClick(d.Event.invoicingNewImportClicked),a()},onRetrySession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"retry",sessionId:o}),t(Te(o)),a(o)},onRollbackSession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"rollback",sessionId:o}),t(Cn(o))},onViewSession:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"view_details",sessionId:o}),n(`/${i}/invoicing/data_import/${encodeURIComponent(o)}`)}}}))(pt);function oa(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),a=k(Re);r.useEffect((()=>{i&&(t(ui()),t(kn()))}),[i,t]);const o=a.statusFetch.fetchState==="Completed"&&a.sessionsFetch.fetchState==="Completed";return c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDataImportHubPage,isReady:o}),c.jsx(ia,{navigate:e,tenantEmailDomain:n,view:a})]})}const aa=O((function(t,e){const{activeId:n,authParams:i,integrationsView:a,settings:o,templatesDownloadUrl:s,view:u}=e,{actionStateByKind:l,sessionDetail:S,sessions:v}=u,m=a.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee")),p=n!=null?S[n]:void 0;return{authParams:i,templatesDownloadUrl:s,chargebeeConnected:o?.chargebee_connected===!0||(m?.isValid??!1),chargebeeConnectorAvailable:m!=null,chargebeeSite:o?.chargebee_site,connectError:l.connect?.error?.message,connecting:l.connect?.fetchState==="In-Progress",retrying:l.retry?.fetchState==="In-Progress",session:p??v.find((f=>f.id===n)),starting:l.start?.fetchState==="In-Progress",uploading:l.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:a}=e;return{onBack:e.onBack,onDownloadError:()=>{t(Fe({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onDownloadTemplates:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportTemplatesDownloaded)},onFetchFromChargebee:()=>{g.trackInvoicingActionClick(d.Event.invoicingChargebeeConnectClicked),t(mi())},onGoToIntegrations:()=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"data_import_migrate",toScreen:"settings_integrations"}),i(`/${a}/invoicing/settings`)},onGoToOverview:()=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"data_import_migrate",toScreen:"overview"}),i(`/${a}/invoicing/overview`)},onRetry:()=>{n!=null&&(g.trackInvoicingActionClick(d.Event.invoicingImportSessionAction,{action:"retry",fromScreen:"data_import_migrate",sessionId:n}),t(Te(n)))},onSaveLater:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportStarted),n!=null&&t(vi(n))},onUpload:o=>{g.trackInvoicingActionClick(d.Event.invoicingImportFileUploaded),t(gi({files:o}))},onViewDetails:n==null?void 0:()=>i(`/${a}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(St);function ca(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),a=k(vn),o=k(Ie),s=r.useMemo((()=>{const h=W.getSignedInUser();return{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:o.tenantId}}),[o.tenantId]),u=`${se?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/templates`,l=o.companyId??W.getSignedInUserTenant(n??"")?.companyId,S=k((h=>En(h,l))),v=k(Re),{activeMigrationSessionId:m}=v,p=m??void 0,f=p!=null?v.sessionDetail[p]??v.sessions.find((h=>h.id===p)):void 0;r.useEffect((()=>{i&&(t(Oe()),t(kn()))}),[i,t]),r.useEffect((()=>{if(m!=null)return;const h=(y=>{if(y==null||y==="")return null;try{return sessionStorage.getItem(Qn(y))}catch{return null}})(n);h!=null&&t(ae(h))}),[m,t,n]),r.useEffect((()=>{ce(n,m)}),[m,n]);const I=f?.status,E=I==="scanning"||I==="importing";return r.useEffect((()=>{if(!i||p==null||!E)return;const h=setInterval((()=>{t(De(p))}),3e3);return()=>clearInterval(h)}),[i,p,E,t]),r.useEffect((()=>{I==="done"&&(t(ae(null)),ce(n,null))}),[t,I,n]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDataImportMigratePage}),c.jsx(aa,{activeId:p,authParams:s,integrationsView:S,navigate:e,settings:a,templatesDownloadUrl:u,tenantEmailDomain:n,view:v,onBack:()=>{t(ae(null)),ce(n,null),e(`/${n}/invoicing/data_import`)}})]})}const sa=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,discountsAccountName:n.discountsAccountName,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${n}/discounts`),onLifecycleAction:a=>{g.trackInvoicingActionClick(d.Event.invoicingCouponLifecycleAction,{action:a,couponId:i,fromScreen:"discount_detail",status:e.editView.coupon?.status}),t(yn({action:a,id:i}))},onSaveEdit:a=>{g.trackInvoicingActionClick(d.Event.invoicingCouponEdited,{couponId:i}),t(Si({data:a,id:i}))}}}))(ft);function ra(){const t=L(),e=_(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((I=>pi(I,n))),s=o.actionState.fetchState==="In-Progress",u=o.pageFetchState.fetchState,l=u==="Completed",[S,v]=r.useState(l?n:void 0);r.useEffect((()=>{n!=null&&l&&v(n)}),[n,l]);const m=S===n;r.useEffect((()=>(t(le({id:n})),()=>{t(le({id:n}))})),[n,t]),r.useEffect((()=>{a&&t(xe({id:n}))}),[a,n,t]);const p=r.useCallback((I=>t(xe({cacheOverride:!0,id:I}))),[t]),f=Y(o.fetchState,o.isFormLoading,n,p);return N(u)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDiscountDetailPage,isReady:l}),c.jsx(sa,{hasLoadedRecord:m,couponId:n??"",discountLifecycleActionOptions:o.discountLifecycleActionOptions,editView:o,isRunningLifecycleAction:s,navigate:e,tenantEmailDomain:i},f)]})}const da=O((function(t){const e=bn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,discountLifecycleActionOptions:e.discountLifecycleActionOptions,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",coupons:e.coupons,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.coupons.length===0,isLoadingMore:n==="In-Progress"&&e.coupons.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onCouponClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,a)=>{g.trackInvoicingActionClick(d.Event.invoicingCouponLifecycleAction,{action:a,couponId:i,fromScreen:"discounts_list"}),t(yn({action:a,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"discounts",status:e.activeStatus}),t(Ii({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(It);function la(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,couponListFetchState:h,runningDiscountActionId:y}=k((b=>{const A=bn(b);return{activeStatus:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,couponListFetchState:A.fetchState,runningDiscountActionId:A.runningActionId??null}}),q),D=h==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>u(a)),300);return()=>clearTimeout(b)}),[a]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Xe({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDiscountsListPage,isReady:D}),c.jsx(da,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,runningDiscountActionId:y,onSearchChange:o,onStatusChange:b=>t(fi(b)),onSortChange:S})]})}const ua=O((function(t,e){const{readView:n}=e;return{fieldHelp:e.readView.fieldHelp,caseId:e.caseId,dunningAttempts:e.dunningAttempts,dunningCase:n.dunningCase,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{caseId:i}=e,a=i!=="",{dunningCase:o}=e.readView,s={amount:o?.amount?.amount,caseId:i,customerId:o?.customerID,invoiceId:o?.invoiceID,status:o?.status,subscriptionId:o?.subscriptionID};return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:u=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:u,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(u)}`)},onCancel:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"cancel",fromScreen:"dunning_detail"}),t(Q({action:"cancel",id:i}))}:void 0,onResolve:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"resolve",fromScreen:"dunning_detail"}),t(Q({action:"resolve",id:i}))}:void 0,onResume:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"resume",fromScreen:"dunning_detail"}),t(Q({action:"resume",id:i}))}:void 0,onRetry:a?()=>{g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...s,action:"retry",fromScreen:"dunning_detail"}),t(Q({action:"retry",id:i}))}:void 0}}))(Ct);function ga(){const t=L(),e=_(),{case_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((C=>hi(C,n??""))),s=o.fetchState==="Completed",u=o.dunningCase?.invoiceID,[l,S]=r.useState("idle"),[v,m]=r.useState(!1),[p,f]=r.useState(),[I,E]=r.useState(!1),h=r.useCallback((()=>{S("idle"),m(!1),f(void 0),E(!1)}),[]),y=r.useCallback((()=>{if(n==null)return;t(Ci({id:n})),S("idle"),m(!1);const C=o.emailPreview.preview;f(C==null?void 0:{body:C.body,cc:C.cc,subject:C.subject,to:C.to}),E(!0)}),[n,t,o.emailPreview.preview]),D=r.useCallback((C=>{n!=null&&l!=="pending"&&(m(!1),S("pending"),g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{action:"send-email",amount:o.dunningCase?.amount?.amount,caseId:n,customerId:o.dunningCase?.customerID,fromScreen:"dunning_detail",invoiceId:o.dunningCase?.invoiceID,status:o.dunningCase?.status,subscriptionId:o.dunningCase?.subscriptionID}),t(Q({action:"send-email",body:C,id:n})))}),[n,t,l,o.dunningCase]),b=r.useMemo((()=>o.emailPreview.preview==null?void 0:{bodyToken:o.emailPreview.preview.bodyToken,renderedHtmlTemplate:o.emailPreview.preview.renderedHtmlTemplate,subjectToken:o.emailPreview.preview.subjectToken}),[o.emailPreview.preview]);r.useEffect((()=>{a&&n!=null&&t(ki({id:n}))}),[a,n,t]),r.useEffect((()=>{a&&u!=null&&t(he({invoiceId:u}))}),[a,u,t]),r.useEffect((()=>{S("idle"),m(!1),f(void 0),E(!1)}),[n]),r.useEffect((()=>{a||(S("idle"),m(!1),f(void 0),E(!1))}),[a]),r.useEffect((()=>{I&&p==null&&o.emailPreview.preview!=null&&f({body:o.emailPreview.preview.body,cc:o.emailPreview.preview.cc,subject:o.emailPreview.preview.subject,to:o.emailPreview.preview.to})}),[o.emailPreview.preview,p,I]),r.useEffect((()=>{l==="pending"&&(o.actionState.fetchState!=="In-Progress"?v&&o.actionState.fetchState==="Completed"?(n!=null&&t(Ei({id:n})),h()):v&&o.actionState.fetchState==="Error"&&S("failed"):m(!0))}),[n,h,t,l,v,o.actionState.fetchState]);const A=u!=null&&o.linkedInvoice?.id===u?o.linkedInvoice.dunningAttempts:void 0;return N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDunningDetailPage,isReady:s}),c.jsx(ua,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:o,dunningAttempts:A,onSendEmail:y}),c.jsx(ht,{initialDraft:p,isPreviewLoading:o.emailPreview.fetchState==="Not-Started"||o.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:h,onSend:D,open:I,preview:b,previewErrorMessage:o.emailPreview.fetchState==="Error"?o.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?o.actionState.error?.message:void 0})]})}const va=O((function(t){const e=xn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",dunningCases:e.dunningCases,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.dunningCases.length===0,isLoadingMore:n==="In-Progress"&&e.dunningCases.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=a=>{const o=e.dunningCases.find((s=>s.id===a));return{amount:o?.amount?.amount,caseId:a,customerId:o?.customerID,fromScreen:"dunning_list",invoiceId:o?.invoiceID,status:o?.status,subscriptionId:o?.subscriptionID}};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>e.navigate(`${n}/data_import`),onDunningCaseClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingDunningCaseRowClicked,i(a)),e.navigate(`${n}/dunning/${encodeURIComponent(a)}`)},onRowAction:(a,o)=>{o!=="retry"&&o!=="resume"&&o!=="resolve"&&o!=="cancel"||(g.trackInvoicingActionClick(d.Event.invoicingDunningAction,{...i(a),action:o}),t(Q({action:o,id:a})))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"dunning",status:e.activeStatus}),t(bi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(kt);function ma(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,dunningCaseListFetchState:h,dunningCases:y}=k((b=>{const A=xn(b);return{activeStatus:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,dunningCaseListFetchState:A.fetchState,dunningCases:A.dunningCases}}),q),D=h==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>u(a)),300);return()=>clearTimeout(b)}),[a]),r.useEffect((()=>{i&&t(Je({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Je({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDunningListPage,isReady:D}),c.jsx(va,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,dunningCases:y,nextCursor:E,onSearchChange:o,onStatusChange:b=>t(yi(b)),onSortChange:S})]})}const pa=O((function(t,e){const{view:n}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:n.billingAddress,invoice:n.invoice,invoiceId:e.invoiceId,shippingAddress:n.shippingAddress,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isSaving:n.actionState.fetchState==="In-Progress",isVoiding:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e,{invoice:a}=e.view,o={amount:a?.total?.amount,customerId:a?.customerID,invoiceId:i,status:a?.status};return{onBack:()=>e.navigate(`${n}/invoices`),onCustomerClick:s=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(s)}`)},onIssueCreditNote:()=>{g.trackInvoicingActionClick(d.Event.invoicingIssueCreditNoteClicked,{...o,fromScreen:"invoice_detail"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{g.trackInvoicingActionClick(d.Event.invoicingRecordPaymentClicked,{...o,fromScreen:"invoice_detail"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceRegenerated,{...o,fromScreen:"invoice_detail"}),t(H({action:"regenerate",invoiceId:i}))},onSaveEdit:s=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceEdited,{...o,fromScreen:"invoice_detail"}),t(Ai({data:{due_date:s.due_date!==""?s.due_date:void 0,notes:s.notes.trim()!==""?s.notes.split(`
|
|
2
|
-
`).map((u=>u.trim())).filter((u=>u!=="")).map((u=>({note:u}))):void 0,po_number:s.po_number!==""?s.po_number:null},invoiceId:i}))},onSendReminder:()=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceReminderSent,{...o,fromScreen:"invoice_detail"}),t(H({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:s=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:s,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(s)}`)},onVoid:s=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceVoided,{...o,fromScreen:"invoice_detail"}),t(H({action:"void",invoiceId:i,body:s}))}}}))(Et);function Sa(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=k((f=>An(f,n??""))),s=o.pageFetchState.fetchState,u=s==="Completed",[l,S]=r.useState(u?n:void 0);r.useEffect((()=>{n!=null&&u&&S(n)}),[n,u]);const v=l===n;r.useEffect((()=>{a&&n!=null&&t(xi({invoiceId:n}))}),[a,n,t]);const m=r.useCallback((f=>t(he({invoiceId:f}))),[t]),p=Y(o.actionState.fetchState,o.fetchState==="In-Progress",n,m);return N(s)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingInvoiceDetailPage,isReady:u}),c.jsx(pa,{invoiceId:n??"",hasLoadedRecord:v,navigate:e,tenantEmailDomain:i,view:o},p)]})}const fa=O((function(t){const e=Dn(t),{fetchState:n}=e;return{counts:e.counts,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,invoices:e.invoices,statusOptions:e.statusOptions,isLoading:n==="Not-Started"||n==="In-Progress"&&e.invoices.length===0,isLoadingMore:n==="In-Progress"&&e.invoices.length>0,kpis:e.kpis,kpisLoading:e.kpisFetchState.fetchState==="Not-Started"||e.kpisFetchState.fetchState==="In-Progress"&&e.kpis==null,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=a=>{const o=e.invoices.find((s=>s.id===a));return{amount:o?.total?.amount,customerId:o?.customerID,fromScreen:"invoices_list",invoiceId:a,status:o?.status}};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onCreateInvoice:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceRowClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onRowAction:(a,o)=>{switch(o){case"recordPayment":g.trackInvoicingActionClick(d.Event.invoicingRecordPaymentClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}/record-payment`);break;case"issueCreditNote":g.trackInvoicingActionClick(d.Event.invoicingIssueCreditNoteClicked,i(a)),e.navigate(`${n}/invoices/${encodeURIComponent(a)}/issue-credit-note`);break;case"sendReminder":g.trackInvoicingActionClick(d.Event.invoicingInvoiceReminderSent,i(a)),t(H({action:"send-reminder",invoiceId:a}));break;case"regenerate":g.trackInvoicingActionClick(d.Event.invoicingInvoiceRegenerated,i(a)),t(H({action:"regenerate",invoiceId:a}));break;case"void":g.trackInvoicingActionClick(d.Event.invoicingInvoiceVoided,i(a)),t(H({action:"void",invoiceId:a}))}},onVoidInvoice:(a,o)=>{g.trackInvoicingActionClick(d.Event.invoicingInvoiceVoided,i(a)),t(H({action:"void",invoiceId:a,body:o}))},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"invoices",status:e.activeStatus}),t(jn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(yt);function Ia(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,invoiceListFetchState:h,voidingInvoiceId:y,invoices:D}=k((A=>{const C=Dn(A);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:A.invoicingInvoiceListState.sort,nextCursor:C.nextCursor,invoiceListFetchState:C.fetchState,voidingInvoiceId:C.runningActionId,invoices:C.invoices}}),q),b=h==="Completed";return r.useEffect((()=>{const A=setTimeout((()=>u(a)),300);return()=>clearTimeout(A)}),[a]),r.useEffect((()=>{i&&t(Ee({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(Ee({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingInvoicesListPage,isReady:b}),c.jsx(fa,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,invoices:D,nextCursor:E,voidingInvoiceId:y,onSearchChange:o,onStatusChange:A=>{t(Di(A)),t(Ee({cacheOverride:!1,filters:m,sort:v}))},onSortChange:S})]})}function on(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),i=bt(),a=rn(),[o,s]=r.useState(!1),{acceptTermsState:u,status:l}=k(Ln),S=ji(i?.loggedInUserRoleMap),v=`/${n}/invoicing`,m=p=>{s(p)};return l==="completed"?c.jsx(V,{to:`${v}/overview`,replace:!0}):l==="settings"&&S?c.jsx(V,{to:`${v}/settings`,replace:!0}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingPromoPage}),c.jsx(Lo,{isAppContentDrawerOpen:o,handleDrawerToggle:m}),c.jsx(xt,{analytics:g,isAccepting:u.fetchState==="In-Progress",isReadOnlyUser:!S,meetingUrl:a("invoicing_promo"),onAcceptClick:()=>{g.trackInvoicingActionClick(d.Event.invoicingTermsAccepted),t(Li())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{m(!0)}})]})}const ha=O((function(t,e){const n=_n(t,e.invoiceId),{invoice:i,localData:a,reasonCodeOptions:o,submitState:s,typeOptions:u}=n;return{fieldHelp:n.fieldHelp,amountDue:i?.amountDue,currencyCode:i?.currencyCode??"USD",customerName:i?.customerName??"",errorMessage:s.fetchState==="Error"?s.error?.message??"Failed to issue credit note. Please try again.":void 0,invoiceNumber:i?.invoiceNumber??e.invoiceId,isSubmitting:s.fetchState==="In-Progress",localData:a,reasonCodeOptions:o,typeOptions:u}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:a=>{t(Fi({localData:a}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t($i())}}}))(At);function Ca(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),{fetchState:o,invoice:s,isPageReady:u,issuedCreditNoteId:l,submitState:S}=k((f=>_n(f,n??""))),v=`/${i}/invoicing`,m=r.useRef(null);r.useEffect((()=>{t(_i()),m.current=null}),[t,n]),r.useEffect((()=>{a&&n!=null&&t(he({invoiceId:n}))}),[a,t,n]),r.useEffect((()=>{s!=null&&n!=null&&o==="Completed"&&m.current!==n&&(m.current=n,t(Pi({localData:wi(s)})))}),[t,o,s,n]);const p=r.useRef(S.fetchState);return r.useEffect((()=>{const f=p.current;p.current=S.fetchState,f!=="Completed"&&S.fetchState==="Completed"&&l!=null&&e(`${v}/credits/${encodeURIComponent(l)}`)}),[l,e,S.fetchState,v]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingIssueCreditNotePage,isReady:u}),c.jsx(ha,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const ka=O((function(t){return{invoicingOverview:Pn(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{g.trackInvoicingActionClick(d.Event.invoicingOverviewRefreshed),t(wn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{g.trackInvoicingActionClick(d.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{g.trackInvoicingActionClick(d.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(Dt);function Ea(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a]=r.useState((()=>{const s=new Date;return{month:s.getMonth()+1,year:s.getFullYear()}})),o=k((s=>Pn(s).fetchState))==="Completed";return r.useEffect((()=>{i&&t(wn(a))}),[i,t,a]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingOverviewPage,isReady:o}),c.jsx(ka,{navigate:e,selectedPeriod:a,tenantEmailDomain:n})]})}const ya=O((function(t){const e=$n(t),{fetchState:n}=e;return{columns:e.columns,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.transactions.length===0,isLoadingMore:n==="In-Progress"&&e.transactions.length>0,tabIds:e.tabIds,transactions:e.transactions}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeType:e.activeType,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTypeChange:e.onTypeChange,onViewTransactionCustomer:e.onViewTransactionCustomer,onViewTransactionInvoice:e.onViewTransactionInvoice,onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"payments",tab:e.activeType}),t(Ti({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(jt);function ba(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeType:p,appliedSearch:f,appliedSort:I,nextCursor:E,transactionListFetchState:h,transactions:y}=k((j=>{const P=$n(j);return{activeType:P.activeTab,appliedSearch:P.filters.search,appliedSort:P.sort,nextCursor:P.nextCursor,transactionListFetchState:P.fetchState,transactions:P.transactions}}),q),D=h==="Completed",b=`/${n}/invoicing`,A=r.useCallback((j=>{const P=y.find((T=>T.id===j)),U=P?.linkedInvoices?.[0]?.invoiceID??P?.invoiceID;U!=null&&(g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${b}/invoices/${encodeURIComponent(U)}`))}),[e,b,y]),C=r.useCallback((j=>{const P=y.find((U=>U.id===j))?.customerID;P!=null&&(g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:P,fromScreen:"payments_list",toScreen:"customer"}),e(`${b}/customers/${encodeURIComponent(P)}`))}),[e,b,y]);return r.useEffect((()=>{const j=setTimeout((()=>u(a)),300);return()=>clearTimeout(j)}),[a]),r.useEffect((()=>{i&&t(ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(ye({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingPaymentsListPage,isReady:D}),c.jsx(ya,{navigate:e,tenantEmailDomain:n,activeType:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,onSearchChange:o,onTypeChange:j=>{t(Ri(j)),t(ye({cacheOverride:!1,filters:m,sort:v}))},onSortChange:S,onViewTransactionCustomer:C,onViewTransactionInvoice:A})]})}const xa=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id};function an(){const t=L(),e=_(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:a}=R(),o=n!=null&&n!=="",s=k(Se),u=k((C=>Oi(C))),l=k(Mi),S=k((C=>An(C,n??""))),v=S.invoice,m=`/${i}/invoicing`,p=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Ni()),p.current=null,f.current=""}),[t,n]),r.useEffect((()=>{a&&t(o&&n!=null?he({invoiceId:n}):hn({filters:{},keepExistingListItems:!1}))}),[a,t,n,o]),r.useEffect((()=>{o&&v!=null&&n!=null&&S.fetchState==="Completed"&&p.current!==n&&(p.current=n,t(Ui({contextInvoiceId:n,localData:Bi(v)})))}),[t,v,n,S.fetchState,o]),r.useEffect((()=>{if(o)return;const C=u.localData.customerId;C!==""&&C!==f.current&&(f.current=C,t(jn({filters:{customerId:C},keepExistingListItems:!1})),u.localData.invoiceToLink!==""&&t(Ye({localData:{...u.localData,customerId:C,invoiceToLink:""}})))}),[t,u.localData,o]);const I=r.useRef(l.fetchState);r.useEffect((()=>{const C=I.current;if(I.current=l.fetchState,C!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${m}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${m}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,m]);const E=r.useMemo((()=>s.customers.map((C=>({id:C.id,name:xa(C)})))),[s.customers]),h=k((C=>Vi(C,u.localData.customerId))),y=r.useMemo((()=>h.map((C=>{return{amountDue:(j=C.amountDue,P=Hi.currencySymbol,Pt("0,0.00",j,P)),amountDueValue:C.amountDue,id:C.id,label:C.invoiceNumber};var j,P}))),[h]),D=r.useMemo((()=>{if(!o||v==null)return;const C=v.currencyCode??"USD",j=v.amountDue?.amount??0;return{amountDue:Lt("0,0.00",v.amountDue),amountDueValue:j,currencyCode:C,customerName:v.customerName??v.customerID,invoiceId:v.id,invoiceNumber:v.invoiceNumber??v.id}}),[v,o]),b=o?`${m}/invoices/${encodeURIComponent(n??"")}`:`${m}/payments`,A=!o||S.fetchState==="Completed"&&u.localData.invoiceToLink!=="";return c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingRecordPaymentPage,isReady:A}),c.jsx(_t,{customers:E,fieldHelp:u.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:u.gatewayOptions,invoiceContext:D,invoiceOptions:y,isSubmitting:l.fetchState==="In-Progress",localData:u.localData,mode:o?"invoice":"customer",paymentMethodOptions:u.paymentMethodOptions,onBack:()=>{e(b)},onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingRecordPaymentCancelled),e(b)},onChange:C=>{t(Ye({localData:C}))},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingPaymentRecorded,{customerId:u.localData.customerId,invoiceId:o?n:u.localData.invoiceToLink,paymentMethod:u.localData.paymentMethod}),t(qi(o?n??void 0:void 0))}})]})}const zn=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Aa=O((function(t,e){const{editView:n}=e,i=n.subscription,a=i?.status,o=a!=null&&e.commercialEditAllowedFromStatuses.includes(a);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.addons,canEditCommercial:o,charges:n.charges,coupons:n.coupons,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),isRunningAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:n.localData,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=="",o=(s,u)=>{const{subscription:l}=e.editView;g.trackInvoicingActionClick(d.Event.invoicingSubscriptionLifecycleAction,{action:s,amount:l?.mrr?.amount,customerId:l?.customerID,fromScreen:"subscription_detail",status:l?.status,subscriptionId:i}),t(Rn({action:s,id:i,body:u}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:s=>{t(ge({id:i,localData:s}))},onChangeTermEnd:a?s=>{const u=s?.trim()??"";u!==""&&o("change_term_end",{term_ends_at:u})}:void 0,onCustomerClick:s=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(s)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(fe(ve)),t(Ki({id:i}))},onOpenAddress:()=>{const s=zn(e.tenantEmailDomain??"",ve,i),u=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:u}})},onViewInvoices:()=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"subscription_detail",subscriptionId:i,toScreen:"invoices"}),e.navigate(`${n}/invoices`)},onSaveEdit:s=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(ge({id:i,localData:s})),t(Fn({id:i}))},onCancelSubscription:a?s=>{o("cancel",{cancel_reason_code:s.cancelReasonCode,end_of_term:!1,...s.cancelReason!=null&&s.cancelReason.trim()!==""?{cancel_reason:s.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:a?(s,u)=>{s!=="pause"?o(s):o(s,u!=null&&u.trim()!==""?{resume_date:u.trim()}:void 0)}:void 0}}))(wt);function Da(){const t=L(),e=_(),n=X(),{subscription_id:i,tenantEmailDomain:a}=F(),{areTenantIdsInSync:o}=R(),s=k((y=>Me(y,i))),{subscriptionCommercialEditAllowedFromStatuses:u,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:S}=s,v=s.pageFetchState.fetchState,m=v==="Completed"&&!s.isFormLoading,[p,f]=r.useState(m?i:void 0);r.useEffect((()=>{i!=null&&m&&f(i)}),[i,m]);const I=p===i;Ce(o),r.useEffect((()=>{o&&i!=null&&t(Qi({id:i}))}),[o,i,t]);const E=r.useCallback((y=>t(zi({id:y}))),[t]),h=Y(s.fetchState,s.isFormLoading,i,E);return N(v)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingSubscriptionDetailPage,isReady:m}),c.jsx(Aa,{hasLoadedRecord:I,commercialEditAllowedFromStatuses:u,editView:s,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:S,navigate:e,subscriptionId:i??"",tenantEmailDomain:a},h)]})}const ja=O((function(t,e){const n=Me(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.addons,charges:n.charges,coupons:n.coupons,customers:n.customers,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=null?"edit":"create";return{onCancel:()=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionFormCancelled),t(Tn({id:i})),t(fe(ve)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:o=>{t(ge({id:i,localData:o}))},onOpenAddress:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddressOpened,{entity:"subscription",fromScreen:"subscription_form"});const o=zn(e.tenantEmailDomain??"",ve,i),s=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:s}})},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionSaved,{mode:a}),t(Fn({id:i}))}}}))($t);function La(){const t=L(),e=_(),n=X(),{subscription_id:i,tenantEmailDomain:a}=F(),[o]=Z(),{areTenantIdsInSync:s}=R(),u=o.get("customerId"),{fetchState:l,savedSubscriptionId:S}=k((p=>Gi(p,i))),v=k((p=>Me(p,i).localData));Ce(s),r.useEffect((()=>{s&&t(Wi({subscriptionId:i}))}),[s,i,t]);const m=r.useRef(!1);return r.useEffect((()=>{m.current||i!=null||u==null||u===""||v.customerId!==""||(m.current=!0,t(ge({id:i,localData:{...v,customerId:u}})))}),[u,i,v,t]),r.useEffect((()=>{if(l==="Completed"){const p=S??i,f=p!=null?`/${a}/invoicing/subscriptions/${encodeURIComponent(p)}`:`/${a}/invoicing/subscriptions`;e(f),t(Tn({id:i}))}}),[l,S,i,t,e,a]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingSubscriptionFormPage}),c.jsx(ja,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:a})]})}const _a=O((function(t){const e=On(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.subscriptions.length===0,isLoadingMore:n==="In-Progress"&&e.subscriptions.length>0,cancelReasonCodeOptions:e.cancelReasonCodeOptions,lifecycleActionOptions:e.subscriptionLifecycleActionOptions,subscriptions:e.subscriptions,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=(a,o,s)=>{const u=e.subscriptions.find((l=>l.id===a));g.trackInvoicingActionClick(d.Event.invoicingSubscriptionLifecycleAction,{action:o,amount:u?.mrr?.amount,customerId:u?.customerID,fromScreen:"subscriptions_list",status:u?.status,subscriptionId:a}),t(Rn({action:o,id:a,body:s}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{g.trackInvoicingActionClick(d.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(a,o)=>{const s=o?.trim()??"";s!==""&&i(a,"change_term_end",{term_ends_at:s})},onSubscriptionAction:(a,o,s)=>{o!=="pause"?i(a,o):i(a,o,s!=null&&s.trim()!==""?{resume_date:s.trim()}:void 0)},onCancelSubscription:(a,o)=>{i(a,"cancel",{cancel_reason_code:o.cancelReasonCode,end_of_term:!1,...o.cancelReason!=null&&o.cancelReason.trim()!==""?{cancel_reason:o.cancelReason.trim()}:{}})},onSubscriptionClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingSubscriptionRowClicked,{subscriptionId:a}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&(g.trackInvoicingActionClick(d.Event.invoicingListLoadMore,{entity:"subscriptions",status:e.activeStatus}),t(Ji({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort})))}}}))(Ft);function Pa(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[a,o]=r.useState(""),[s,u]=r.useState(""),[l,S]=r.useState(null),v=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:s.trim()!==""?s.trim():void 0})),[s]),{activeStatus:p,appliedSearch:f,appliedSort:I,nextCursor:E,subscriptionListFetchState:h,runningActionSubscriptionId:y,subscriptions:D}=k((C=>{const j=On(C);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:j.sort,nextCursor:j.nextCursor,subscriptionListFetchState:j.fetchState,runningActionSubscriptionId:j.runningActionId??null,subscriptions:j.subscriptions}}),q),b=h==="Completed";r.useEffect((()=>{const C=setTimeout((()=>u(a)),300);return()=>clearTimeout(C)}),[a]),r.useEffect((()=>{i&&t(en({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||v?.field!==I?.field||v?.dir!==I?.dir)&&t(en({cacheOverride:!0,filters:m,sort:v}))}),[i,t,m,v,f,I]);const A=r.useRef(y);return r.useEffect((()=>{const C=A.current!=null&&y==null;A.current=y,C&&i&&t(Zi())}),[y,i,t]),N(h)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingSubscriptionsListPage,isReady:b}),c.jsx(_a,{navigate:e,tenantEmailDomain:n,activeStatus:p,searchValue:a,sortState:l,filters:m,sort:v,nextCursor:E,runningActionSubscriptionId:y,subscriptions:D,onSearchChange:o,onStatusChange:C=>t(Xi(C)),onSortChange:S})]})}const wa=O((function(t,e){const{readView:n}=e;return{isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress",transaction:n.transaction,transactionId:e.transactionId}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{transactionId:i}=e;return{onBack:()=>e.navigate(`${n}/payments`),onCustomerClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{customerId:a,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(a)}`)},onInvoiceClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onSubscriptionClick:a=>{g.trackInvoicingActionClick(d.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onCapture:i!==""?()=>{g.trackInvoicingActionClick(d.Event.invoicingTransactionCaptured,{transactionId:i}),t(no({action:"capture",id:i}))}:void 0}}))(Rt);function $a(){const t=L(),e=_(),{tenantEmailDomain:n,transaction_id:i}=F(),{areTenantIdsInSync:a}=R(),o=k((u=>Yi(u,i??""))),s=o.fetchState==="Completed";return r.useEffect((()=>{a&&i!=null&&t(eo({id:i}))}),[a,i,t]),N(o.fetchState)?c.jsx(M,{}):c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingTransactionDetailPage,isReady:s}),c.jsx(wa,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:o})]})}function Kn(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:a=!1}=t,o=L(),{areTenantIdsInSync:s}=R(),u=k(Ne),l=u.connection?.connected===!0,S=u.connectionFetchState.fetchState;return r.useEffect((()=>{e&&s&&(a&&S!=="Not-Started"||o(Mn()),n&&o(to()))}),[s,o,e,n,a]),r.useEffect((()=>{e&&s&&l&&i&&o(io())}),[s,o,e,l,i]),{isQboConnected:l,qboView:u}}const Fa={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function ee(t){const e=L(),{areTenantIdsInSync:n}=R(),{tenantEmailDomain:i}=F(),{fetchState:a,fieldHelp:o,logoFile:s,saveState:u,settings:l,stripeConnectState:S}=k(oo),{configError:v,configFetchState:m,dunningScheduleActionOptions:p,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:I,qboSyncStatusOptions:E}=k(Nn),h=k(Ne);Kn({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const y=k(Ie),D=t==="dunning"||t==="quickbooks",b=y.companyId??W.getSignedInUserTenant(i??"")?.companyId,A=k((w=>En(w,b))),C=ao(y.userRole??[]),j=y.tenantId??"",P=W.getSignedInUser(),U={userId:P?.userId??"",sessionId:P?.zeniSessionId??"",tenantId:j},T=s?.fileId,ne=k((w=>T!=null&&T!==""?co(w,T):void 0)),Ue=k((w=>T!=null&&T!==""?so(w,T):void 0)),Gn=T!=null&&T!==""&&ne!=null?{[T]:ne}:{},Wn=T!=null&&T!==""&&Ue!=null?{[T]:Ue}:{};r.useEffect((()=>(e(nn()),()=>{e(nn())})),[e]),r.useEffect((()=>{n&&(a!=="Not-Started"&&a!=="Error"||e(Oe()))}),[n,e,a]),r.useEffect((()=>{n&&D&&m==="Not-Started"&&e(me())}),[n,e,m,D]),r.useEffect((()=>{if(!n)return;const w=P?.userId;w!=null&&w!==""&&j!==""&&He.shouldFetchActiveTenant(j)&&(He.markActiveTenantFetchStarted(j),e(ro(w,j,P?.zeniSessionId)))}),[n,e,P?.userId,P?.zeniSessionId,j]);const Zn=p.length>0||f.length>0,Xn=a==="Not-Started"||a==="In-Progress"&&l==null||D&&!Zn&&(m==="Not-Started"||m==="In-Progress"),Jn=a==="Completed"&&(!D||m==="Completed"),Be=A.externalConnections?.revenue?.find((w=>w.connectionName==="chargebee"))?.connectionId,ke=se?.invoicingMicroServiceBaseUrl,Ve=ke!=null&&ke.length>0?`${ke}/1.0/webhooks/stripe`:"",z={deleteConnectionError:A.externalConnections?.deleteConnectionError?.message,deleteConnectionState:A.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:A,isAdmin:C,isStripeBusy:S.fetchState==="In-Progress",onConnectStripe:w=>{g.trackInvoicingActionClick(d.Event.invoicingStripeConnectClicked,{fromScreen:t??"hub"}),e(Io(w))},onDisconnect:(w,B)=>{j!==""&&(g.trackInvoicingActionClick(d.Event.invoicingIntegrationDisconnected,{entity:B,entityId:w,fromScreen:t??"hub"}),e(fo(j,w,tn(B))))},onDisconnectStripe:()=>{g.trackInvoicingActionClick(d.Event.invoicingStripeDisconnected,{fromScreen:t??"hub"}),e(So())},onReconnectQBO:()=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"reconnect",fromScreen:t??"hub"});const w=y.tenantEmailDomain??i??"";pe.init("/connection/auth",w),pe.handleClick()},onRefreshQBO:()=>{A.integrations.refreshQBO.fetchState!=="In-Progress"&&(g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"refresh",fromScreen:t??"hub"}),e(Vn()))},onSaveChargeBeeCredentials:(w,B)=>{Be!=null&&j!==""&&(g.trackInvoicingActionClick(d.Event.invoicingChargebeeCredentialsSaved,{fromScreen:t??"hub"}),e(mo(j,Be,tn("revenue"),po("chargebee"),{api_key:w,site:B})))},saveChargeBeeError:A.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:A.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:l,stripeError:S.fetchState==="Error"?S.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:Ve};return{authParams:U,deleteFileStatusById:Gn,fieldHelp:o,dunningScheduleActionOptions:p,filesEndPoint:se?.fileMicroServiceBaseUrl??"",integrationsSectionProps:z,isInvoicingPageReady:Jn,isLoading:Xn,isSaving:u.fetchState==="In-Progress",isStripeBusy:S.fetchState==="In-Progress",logoFile:s,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:I,qboSyncStatusOptions:E,qboView:h,saveErrorMessage:u.fetchState==="Error"?u.error?.message??"Failed to save settings.":D&&m==="Error"?v?.message??"Failed to load invoicing configuration.":void 0,settings:l,stripeError:S.fetchState==="Error"?S.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:Ve,updateFileStatusById:Wn,onConnectStripe:z.onConnectStripe,onDeleteFile:w=>{g.trackInvoicingActionClick(d.Event.invoicingLogoRemoved,{fromScreen:t??"hub"}),e(vo(w,j))},onDisconnectStripe:z.onDisconnectStripe,onEditFileName:(w,B)=>{g.trackInvoicingActionClick(d.Event.invoicingLogoRenamed,{fromScreen:t??"hub"}),e(go(w,B.split(".")[0],j))},onReconnectQBO:z.onReconnectQBO,onRefreshQBO:z.onRefreshQBO,onRetryQboSyncTask:w=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"retry_task",entityId:w,fromScreen:t??"hub"}),e(Bn(w))},onSave:w=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsSaved,{fieldsChanged:Object.keys(w).filter((B=>JSON.stringify(w[B])!==JSON.stringify(l?.[B]))),tab:t??"hub"}),e(uo({settings:w,snackbarSection:Fa[t??""]}))},onStartQboBackfill:w=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"backfill",fromScreen:t??"hub"}),e(Un(w))},updateFilesEntity:w=>{g.trackInvoicingActionClick(d.Event.invoicingLogoUploaded,{fromScreen:t??"hub"}),e(lo({files:w}))}}}function cn({appContent:t}){const e=_(),n=X(),i=L(),{tenantEmailDomain:a}=F(),o=ee("branding"),s=k((l=>ho(l)));r.useEffect((()=>{s.saveState.fetchState==="Completed"&&i(Co())}),[s.saveState.fetchState,i]);const u=_e(s.saveState.fetchState);return r.useEffect((()=>{u==="In-Progress"&&s.saveState.fetchState==="Completed"&&e("..")}),[u,s.saveState.fetchState,e]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingBrandingSettingsPage,isReady:o.isInvoicingPageReady}),c.jsx(Tt,{address:s.address,fieldHelp:s.fieldHelp,addressLabel:s.addressLabel,appContent:t,authParams:o.authParams,dateFormatOptions:s.dateFormatOptions,deleteFileStatusById:o.deleteFileStatusById,filesEndPoint:o.filesEndPoint,isLoading:o.isLoading,isSaving:o.isSaving,localData:s.localData,logoFile:o.logoFile,saveErrorMessage:o.saveErrorMessage,settings:o.settings,updateFileStatusById:o.updateFileStatusById,onBackClick:()=>e(".."),onChange:l=>{i(yo({localData:l}))},onDeleteFile:o.onDeleteFile,onEditFileName:o.onEditFileName,onOpenAddress:()=>{g.trackInvoicingActionClick(d.Event.invoicingAddressOpened,{entity:"branding",fromScreen:"settings_branding"});const l=`/${a}/invoicing/settings/branding/${Eo}/`,S=J(n.state?.pathnameStackToGoBack,n.pathname);e(l,{state:{pathnameStackToGoBack:S}})},onSubmit:()=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsSaved,{tab:"branding"}),i(ko())},updateFilesEntity:o.updateFilesEntity})]})}function Ra(){const t=_(),e=ee("dunning");return c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingDunningSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Ot,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Ta(){const t=_(),e=ee("integrations");return c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingIntegrationsSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Mt,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Oa(){const t=_(),e=ee("payment-destination");return c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingPaymentDestinationSettingsPage,isReady:e.isInvoicingPageReady}),c.jsx(Nt,{fieldHelp:e.fieldHelp,isLoading:e.isLoading,isStripeBusy:e.isStripeBusy,saveErrorMessage:e.saveErrorMessage,settings:e.settings,stripeError:e.stripeError,stripeWebhookUrl:e.stripeWebhookUrl,onBackClick:()=>t(".."),onConnectStripe:e.onConnectStripe})]})}const Ma=["autoCreateItems","closedPeriodVoidAsCreditMemo","customerMatching","isSyncEnabled","syncStartDate","trackingCategoriesEnabled"],Na=O((function(t){const e=Hn(t);return{accountMappingKindOptions:e.accountMappingKindOptions,fieldHelp:e.fieldHelp,accounts:e.accounts,connection:e.connection,customerMatchingOptions:e.customerMatchingOptions,isBackfilling:e.backfillState.fetchState==="In-Progress",isLoading:e.isLoading,isSaving:e.saveState.fetchState==="In-Progress",isSyncEnabledSaved:e.isSyncEnabledSaved,localData:e.localData,nestedAccountHierarchy:e.nestedAccountHierarchy,retryFetchStateByTaskId:e.retryFetchStateByTaskId,saveErrorMessage:e.saveState.fetchState==="Error"?e.saveState.error?.message:void 0,syncHealth:e.syncHealth,syncStatusOptions:e.syncStatusOptions}}),(function(t,e){return{onChange:n=>{t(Ao({localData:n}))},onReset:()=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsReset,{tab:"quickbooks"}),t(xo())},onRetryTask:n=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"retry_task",entityId:n,fromScreen:"settings_qbo"}),t(Bn(n))},onSave:()=>{g.trackInvoicingActionClick(d.Event.invoicingSettingsSaved,{fieldsChanged:e.changedFields,tab:"quickbooks"}),t(bo())},onStartBackfill:n=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"backfill",fromScreen:"settings_qbo"}),t(Un(n))}}}))(Ut);function Ua(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),i=k(Ie),{configFetchState:a,localData:o,savedLocalData:s,saveState:u,settingsFetchState:l}=k(Hn),S=r.useMemo((()=>{return m=o,p=s,[...[...new Set([...Object.keys(m.accountIdByMappingCode),...Object.keys(p.accountIdByMappingCode)])].some((f=>(m.accountIdByMappingCode[f]??"")!==(p.accountIdByMappingCode[f]??"")))?["account_mappings"]:[],...Ma.filter((f=>m[f]!==p[f]))];var m,p}),[o,s]),v=_e(u.fetchState);return r.useEffect((()=>{v==="In-Progress"&&u.fetchState==="Completed"&&e("..")}),[e,v,u.fetchState]),r.useEffect((()=>{l!=="Not-Started"&&l!=="Error"||t(Oe())}),[t,l]),r.useEffect((()=>{a==="Not-Started"&&t(me())}),[a,t]),Kn({fetchSyncHealth:!0,loadAccountingPickers:!0}),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingQboSettingsPage}),c.jsx(Na,{changedFields:S,onBackClick:()=>e(".."),onReconnect:()=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"reconnect",fromScreen:"settings_qbo"}),pe.init("/connection/auth",i.tenantEmailDomain??n??""),pe.handleClick()},onRefresh:()=>{g.trackInvoicingActionClick(d.Event.invoicingQboAction,{action:"refresh",fromScreen:"settings_qbo"}),t(Vn())}})]})}const Ba={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function Va(){const t=rn(),e=L(),n=_(),[i,a]=Z(),o=ee(),{canEnableInvoicing:s,isEnablingInvoicing:u,isInvoicingEnabled:l,isQboConfigured:S,isStripeConnected:v}=k(Nn),m=i.get("tab");return r.useEffect((()=>{if(m==null)return;const p=Ba[m];a({},{replace:!0}),p!=null&&n(p,{replace:!0})}),[m,n,a]),c.jsxs(c.Fragment,{children:[c.jsx($,{event:d.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),c.jsx(Bt,{analytics:g,integrationsSectionProps:{...o.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:u,isLoading:o.isLoading,meetingUrl:t("invoicing_settings"),settings:o.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:s,isQboConfigured:S,isStripePaymentsReady:v,onEnableInvoicingClick:l?void 0:()=>{g.trackInvoicingActionClick(d.Event.invoicingEnableClicked),e(Do())}})]})}function sn(){return c.jsxs(oe,{children:[c.jsx(x,{index:!0,element:c.jsx(Va,{})}),c.jsx(x,{path:"payment-destination",element:c.jsx(Oa,{})}),c.jsx(x,{path:"branding",element:c.jsx(cn,{})}),c.jsx(x,{path:"branding/:addressType",element:c.jsx(cn,{appContent:c.jsx(K,{isSubPage:!0,hideAddressBackButton:!0})})}),c.jsx(x,{path:"integrations",element:c.jsx(Ta,{})}),c.jsx(x,{path:"dunning",element:c.jsx(Ra,{})}),c.jsx(x,{path:"quickbooks",element:c.jsx(Ua,{})}),c.jsx(x,{path:"*",element:c.jsx(V,{to:"..",replace:!0})})]})}function Sc(){const t=L(),e=_(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),{enableState:a,fetchState:o,status:s}=k(Ln),u=_e(a.fetchState),l=`/${n}/invoicing`,S=r.useRef(!1),v=k((m=>Ne(m).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(o!=="Not-Started"?o!=="Error"||S.current||(S.current=!0,t(me({cacheOverride:!1}))):t(me({cacheOverride:!1})))}),[i,t,o]),r.useEffect((()=>{i&&v==="Not-Started"&&t(Mn())}),[i,t,v]),r.useEffect((()=>{u==="In-Progress"&&a.fetchState==="Completed"&&(e(`${l}/catalog`),t(jo()))}),[u,a.fetchState,l,t,e]),s==null&&o!=="Error"?c.jsx(Vt,{fetchState:"In-Progress"}):s==="not_started"?c.jsxs(oe,{children:[c.jsx(x,{path:"promo",element:c.jsx(on,{})}),c.jsx(x,{path:"*",element:c.jsx(V,{to:`${l}/promo`,replace:!0})})]}):s==="settings"?c.jsxs(oe,{children:[c.jsx(x,{path:"promo",element:c.jsx(on,{})}),c.jsx(x,{path:"settings/*",element:c.jsx(sn,{})}),c.jsx(x,{path:"*",element:c.jsx(V,{to:`${l}/settings`,replace:!0})})]}):c.jsxs(oe,{children:[c.jsx(x,{path:"/",element:c.jsx(V,{to:"overview",replace:!0})}),c.jsx(x,{path:"overview",element:c.jsx(Ea,{})}),c.jsx(x,{path:"promo",element:c.jsx(V,{to:`${l}/overview`,replace:!0})}),c.jsx(x,{path:"customers",element:c.jsx(ea,{})}),c.jsx(x,{path:"customers/new",element:c.jsx(Jo,{})}),c.jsx(x,{path:"customers/new/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"customers/:customer_id",element:c.jsx(Zo,{})}),c.jsx(x,{path:"customers/:customer_id/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"subscriptions",element:c.jsx(Pa,{})}),c.jsx(x,{path:"subscriptions/new",element:c.jsx(La,{})}),c.jsx(x,{path:"subscriptions/new/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"subscriptions/:subscription_id",element:c.jsx(Da,{})}),c.jsx(x,{path:"subscriptions/:subscription_id/:addressType",element:c.jsx(K,{})}),c.jsx(x,{path:"invoices",element:c.jsx(Ia,{})}),c.jsx(x,{path:"invoices/create",element:c.jsx(qo,{})}),c.jsx(x,{path:"invoices/:invoice_id",element:c.jsx(Sa,{})}),c.jsx(x,{path:"invoices/:invoice_id/record-payment",element:c.jsx(an,{})}),c.jsx(x,{path:"invoices/:invoice_id/issue-credit-note",element:c.jsx(Ca,{})}),c.jsx(x,{path:"payments",element:c.jsx(ba,{})}),c.jsx(x,{path:"payments/record",element:c.jsx(an,{})}),c.jsx(x,{path:"payments/:transaction_id",element:c.jsx($a,{})}),c.jsx(x,{path:"credits",element:c.jsx(Go,{})}),c.jsx(x,{path:"credits/:credit_note_id",element:c.jsx(zo,{})}),c.jsx(x,{path:"discounts",element:c.jsx(la,{})}),c.jsx(x,{path:"discounts/new",element:c.jsx(Vo,{})}),c.jsx(x,{path:"discounts/:coupon_id",element:c.jsx(ra,{})}),c.jsx(x,{path:"dunning",element:c.jsx(ma,{})}),c.jsx(x,{path:"dunning/:case_id",element:c.jsx(ga,{})}),c.jsx(x,{path:"catalog",element:c.jsx(Uo,{})}),c.jsx(x,{path:"catalog/new",element:c.jsx(Oo,{})}),c.jsx(x,{path:"catalog/:item_id",element:c.jsx($o,{})}),c.jsx(x,{path:"settings/*",element:c.jsx(sn,{})}),c.jsx(x,{path:"audit_log",element:c.jsx(_o,{})}),c.jsx(x,{path:"data_import",element:c.jsx(oa,{})}),c.jsx(x,{path:"data_import/migrate",element:c.jsx(ca,{})}),c.jsx(x,{path:"data_import/:sessionId",element:c.jsx(ta,{})}),c.jsx(x,{path:"*",element:c.jsx(M,{})})]})}export{Sc as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-gNIoHksP.js";import{a as g}from"./sentry-BzzHvh63.js";import{u as O,g as w,h as _,t as M,j as l,N as U}from"./core-_cqItzd_.js";import{z as r,E as P,G as V,S as A,n as N,T as W,Z as $,$ as G,W as R}from"./index-DVhAab8j.js";import{fI as X,U3 as Z,Uw as q,Un as B,gl as H,gn as J,Us as K,gX as Q,dk as Y,Ux as ee,Uy as te}from"./zeni-epic-state-ClqSlu6d.js";import{n as ne}from"./mui-CDH3xRD_.js";import{u as se}from"./useDeviceId-DYE-WS_B.js";import{f as ae}from"./analyticsHelper-Df3DOmUB.js";import{t as ie}from"./getLocaleForTenant-DNtLZSig.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.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]="53db3ba1-7a01-440c-ae6b-b26ff29f8458",t._sentryDebugIdIdentifier="sentry-dbid-53db3ba1-7a01-440c-ae6b-b26ff29f8458")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=O(),a=w(),m=_(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:z}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),I=l((e=>e.tenantState.signInState)),h=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>X(e))),b=l((e=>Z(e))),D=r.getSignedInUser(),v=P().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(q(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),g.useEffect((()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(b.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(J(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Q().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(W.Event.loginSuccess,"email",Y(o.productSettings))}),2e3))}),[I,S,y,s,o,b,v,a.state,t]);const E=g.useCallback((()=>{m("/signin/auth")}),[m]),j=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),F=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx($,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:E});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||D!=null){const e=a.state?.origin??"/";return u.jsx(U,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(U,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(G,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
z-index: 9999;
|
|
11
|
-
background-color: ${t=>t.theme.colors.background};
|
|
12
|
-
`;export{Te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as _}from"./liveblocks-gNIoHksP.js";import{a as f}from"./sentry-BzzHvh63.js";import{u as te,j as t,i as $e,g as Ge,h as Ue,q as F}from"./core-_cqItzd_.js";import{fI as ne,U4 as Me,U5 as se,gc as Ne,fH as xe,Ue as Pe,U7 as Re,U8 as Ve,q2 as je,gp as Le,Ub as b,Ug as Oe,Uh as Q,gq as qe,Ui as Ze,Eh as ze,h4 as He,cW as We,Uj as Ye,gb as Je,gr as Ke}from"./zeni-epic-state-ClqSlu6d.js";import{w as Qe,i as Xe,c as ea,_ as aa,d as ta,h as na,u as sa,f as c,j as oa,g as ia,z as ra,e as da,q as ca,r as la,y as ua,s as fa,v as X,L as ma,I as ha,J as ba,p as S,n as ee,B as pa,N as ae,D as ga,F as Sa}from"./index-DVhAab8j.js";import{D as Ea}from"./mui-CDH3xRD_.js";import{u as ka}from"./InboxNotificationsProvider-Vlyx5Pej.js";import{u as Ca}from"./useTaskManagerAccess-CZYVdWyJ.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="a58e4cff-e434-4ffc-a20c-66075acb21c0",l._sentryDebugIdIdentifier="sentry-dbid-a58e4cff-e434-4ffc-a20c-66075acb21c0")}catch{}})();const Ta=Qe((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=$e(),a=Ge(),E=ea(),n=Ue(),B=Ne(),r=te(),{useFeatureGate:d}=aa(),p=ta(),{isTaskManagerAccessEnabled:k}=Ca(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>xe(e))),{status:ie}=t(Pe),G=$.uiState.currentChatSessionId,C=na(),{setLoading:re}=sa(),[w,U]=f.useState(void 0),v=F("/:tenantEmailDomain/dashboard")!==null,M=F("/:tenantEmailDomain/reports")!==null,m=F("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:N}=d(c.isDebitCardFeatureEnabled),le=oa(o,ce,N),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),x=t((e=>Re(e))),{isFeatureEnabled:T}=d(c.isReferralFeatureEnabled),A=t((e=>Ve(e)));f.useEffect((()=>{C&&T&&!m&&A.fetchState==="Not-Started"&&r(je(!0))}),[C,T,A.fetchState,m]);const D=t((e=>e.tenantState)),fe=t((e=>D.fetchState==="Completed"?Le(e):[])),g=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:me}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:he}=d(c.isArAgingFeatureEnabled),P=ia(),{isFeatureEnabled:be}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarNewYearAnimationEnabled),Ee=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",ke=t((e=>b(e).totalUnreadCount)),Ce=t((e=>b(e).reducedFetchCountState)),R=t((e=>b(e).notificationDetailsByTab.tasks.uiState.unreadCount)),V=t((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),j=t((e=>b(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:L,isLoading:O,isFetchingMore:q,hasFetchedAll:Z,fetchMore:Te}=ka();f.useEffect((()=>{const e=setTimeout((()=>Te?.()),0);return()=>clearTimeout(e)})),f.useEffect((()=>{if(O===!1&&q===!1&&Z===!0)if(o?.companyId!=null&&L!=null){const e=`dashboard_${o.companyId}`;U(L.filter((u=>u.roomId===e&&u.readAt==null)).length)}else U(0)}),[O,q,Z]),f.useEffect((()=>{C&&k&&!m&&j.fetchState==="Not-Started"&&B.tenantId!=null&&r(Oe("task_manager","dashboard"))}),[C,k,m,j.fetchState,B.tenantId,r]),f.useEffect((()=>{m||I.fetchState!=="Not-Started"||r(Q({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[m,I.fetchState,r]),f.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(Q({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ce,count:ke},z=s!=null?ra.getSignedInUserTenant(s):null,H=t((e=>z?.tenantId!=null?qe(e,z.tenantId):void 0)),h=[];me===!1&&h.push("accounts_payable_aging"),he===!1&&h.push("accounts_receivable_aging"),h.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&h.push("rewards_card"),P===!1&&h.push("expense_automation_card");const W=t((e=>Ze(e,h).fetchState)),Y=t((e=>ze(e).fetchState)),ye=v&&(W==="Completed"||W==="Error")||M&&(Y==="Completed"||Y==="Error")||!v&&!M?void 0:"disabled",we=f.useMemo((()=>He(o.userRole)),[o.userRole]),ve=We(we),Ae=o?.rewardsLastViewedTime==null,De=p?.userEmail!=null&&x.fetchState==="Completed"&&Ye(x.notificationSettings,p.userEmail,N,o,k),J=da(),Fe=J&&ca(a);return _.jsx(Ea,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:_.jsx(la,{signedInUser:p,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?fe:H!=null?[H]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:X(a),isInvoicing:fa(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:ve,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:Ee,isNotificationsTabVisible:De,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:P,selectedMenu:ua(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ae,rewardsPlan:A.rewardsPlan},isAiCfoAccessEnabled:J,onNotificationIconClick:()=>{i(!1);let e=R===0&&V>0?"notifications/comments":"notifications/tasks";X(a)&&(e=R===0&&V>0?"../../notifications/comments":"../../notifications/tasks");const u=S(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=S(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:S(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void pa({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=S(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=S(a.state?.pathnameStackToGoBack,a.pathname),K=e.type,_e=ae(K)&&K!=="command_center";if(ae(e.type)&&g[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(g[o.tenantId].month,g[o.tenantId].year,"Sidebar"),_e&&g[o.tenantId]!=null){const y=g[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const Be=ga(e.type);Sa(e.type)?(G!=null&&r(Ke()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${Be}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(ma.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:ba(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{E.toggle()},isAiCfo:Fe,aiCfoView:$,isOnDashboard:v,updateCurrentChatSessionId:e=>{r(Je({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:be,isTaskManagerAccessEnabled:k,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:ge,newYearAnimationEnabled:Se})})})),Ba=l=>{const i=te(),s=t((E=>ne(E))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(E,n)=>{Xe(n)&&Me(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return _.jsx(Ta,{...l,...a})};export{Ba as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-gNIoHksP.js";import{h as r,l as i}from"./core-_cqItzd_.js";import{am as n}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import"./sentry-BzzHvh63.js";import"./zeni-epic-state-ClqSlu6d.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="f2f6ef04-8019-4dfe-8bec-98d5efe59039",o._sentryDebugIdIdentifier="sentry-dbid-f2f6ef04-8019-4dfe-8bec-98d5efe59039")}catch{}})();const f=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as mt,b as lt,o as ft,j as N}from"./liveblocks-gNIoHksP.js";import ut from"./NotFoundScreen-XQ69x1V9.js";import{a as k}from"./sentry-BzzHvh63.js";import{h as ht,g as pt,i as kt,u as gt,j as S,l as St,n as bt,o as X}from"./core-_cqItzd_.js";import{cB as It,U7 as z,fI as J,h4 as Ct,Ub as b,a15 as Q,Uh as m,U5 as y,Ax as F,Ge as Tt,a16 as At,U4 as yt,Uj as Et,AC as _t,a17 as j,br as $,gk as w,AG as Y,a18 as Nt,cN as Bt,cG as xt}from"./zeni-epic-state-ClqSlu6d.js";import{aq as wt,d as Ut,_ as Gt,f as vt,as as Dt,dK as Rt,p as B,dL as Pt,w as Mt,dM as jt,i as $t,a4 as Ft}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-DQSYAHEz.js";import{u as qt}from"./useTaskManagerAccess-CZYVdWyJ.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="7693ac01-0255-45cb-9992-f94a650d5572",t._sentryDebugIdIdentifier="sentry-dbid-7693ac01-0255-45cb-9992-f94a650d5572")}catch{}})();const Lt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Wt=St((function(t,l){const n=z(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=b(t),f=J(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:G}=l;return{onNotificationClick:(e,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,C=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:C,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,C=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:C,message:"triggerBackClick"}})}d==="unread"&&t(Y("task_manager","read",[e],!1))},onCommentNotificationClick:(e,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(e),t(j([e],$())));let i=`/${h}/${r[1]}`;const C=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!xt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:C,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(e,s)=>{t(y(e,s))},onUpdateNotificationTabState:(e,s)=>{t(m(e,s))},onUpdateNotificationViewCurrentTabAndSubTab:(e,s)=>{t(Q(e,s));const d=`../${e}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:e=>{t(Nt(e))},onFetchMoreNotifications:(e,s)=>{if(e==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(F("task_manager","dashboard",d))}else G?.()},onUpdateNotificationStatus:(e,s,d,r)=>{e==="tasks"?t(Y("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t(j([i],$())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:e=>{e==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Lt(o,I).then((()=>{t(j(o,$())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const e=Ft(n.state?.pathnameStackToGoBack),s=e.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:e.newStack}})},onSettingsClick:()=>{const e=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:e}})}}}))(Mt(jt)),Ht=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=wt(),c=It(h??""),o=gt(),f=Ut(),[I,G]=k.useState(!1),e=S((a=>z(a))),s=S((a=>J(a))),{useFeatureGate:d}=Gt(),{isFeatureEnabled:r}=d(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:C}=Vt({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const Z=Ct(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=S((a=>b(a).notificationDetailsByTab.tasks.fetchState)),q=S((a=>b(a).currentTab)),v=S((a=>b(a).currentSubTab)),tt=S((a=>b(a).notificationDetailsByTab.comments.fetchCountState)),D=S((a=>b(a).notificationDetailsByTab.comments.fetchState)),at=S((a=>b(a).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((a=>b(a).allExternalNotifications)).filter((a=>a.inboxNotification.readAt==null)).map((a=>a.inboxNotification.id)),st=Rt().allUsers,{inboxNotifications:x,isLoading:E,hasFetchedAll:T,isFetchingMore:R,fetchMore:ot}=mt(),{threads:L,isLoading:W,fetchMore:H,isFetchingMore:K,hasFetchedAll:O}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(q!==c&&c!=null&&o(Q(c)),c==null){const a=`../${q}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(a,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&T===!0&&s?.companyId!=null&&x!=null){const a=`dashboard_${s.companyId}`,p=x.filter((A=>A.roomId===a&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,T]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const a=setTimeout((()=>ot?.()),0);return()=>clearTimeout(a)}));const P=E||R===!0||T!==!0||E||R===!0||T!==!0;k.useEffect((()=>{P&&D!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):P||D!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[P,D]),k.useEffect((()=>{o(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{e.fetchState!=="In-Progress"&&e.fetchState!=="Completed"&&I===!1&&(G(!0),o(Tt()))}),[e.fetchState]),k.useEffect((()=>{if(E===!1&&W===!1&&x!=null&&L!=null){const a=`dashboard_${s.companyId}`,p=x.filter((u=>u.roomId===a)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=L.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(K||O===!0||H==null||H(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,R,K,T,O,W,x?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(a,p)=>{if($t(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];v==="all"?_.push("read","unread"):v!=="mentions"&&_.push(v),o(F("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=qt(f);return N.jsx(Wt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:i,onAskAiCfoClick:C,...nt})};function ma(){return N.jsxs(bt,{children:[N.jsx(X,{path:"/:selectedTab",element:N.jsx(Ht,{})}),N.jsx(X,{path:"*",element:N.jsx(ut,{})})]})}export{ma as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-gNIoHksP.js";import{a as r}from"./sentry-BzzHvh63.js";import{u as A,g as j,j as o,N as C}from"./core-_cqItzd_.js";import{UK as M,fI as P,gp as x,UL as z,UM as D,UN as L,UO as N,pV as R,Tp as k}from"./zeni-epic-state-ClqSlu6d.js";import{z as h,ah as I}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="c0c0c2dd-06ea-49f7-89ff-99c0b9b0a35f",n._sentryDebugIdIdentifier="sentry-dbid-c0c0c2dd-06ea-49f7-89ff-99c0b9b0a35f")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo((()=>M(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o((e=>P(e))),l=o((e=>x(e))),d=o((e=>e.tenantState.fetchState)),y=o(z),b=o(D),c=o(L),[U,v]=r.useState(null),[S,E]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(N())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(R(a.userId,a.zeniSessionId??void 0))))}),[f,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((T=>T.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),u=U??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:v,approveError:S??b,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(k(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{E("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-gNIoHksP.js";import{h as G,u as W,g as z,i as H,j as d,l as J,n as K,o as C}from"./core-_cqItzd_.js";import{fI as v,Ai as R,vb as Q,VC as M,v6 as T,bq as X,c0 as Z,v7 as ee,VD as ae,Vk as S,ek as te,E6 as se,VE as oe,Eu as re,e0 as ne,d$ as ce}from"./zeni-epic-state-ClqSlu6d.js";import{ai as ie,z as le,aq as de,as as fe,P as me,a8 as pe,n as w,aD as ue,p as he,_ as Fe,f as ge}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import Ie from"./NotFoundScreen-XQ69x1V9.js";import{F as be}from"./FeaturePreviewScreen-ADHB7kMI.js";import{a as F}from"./sentry-BzzHvh63.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-DQSYAHEz.js";import{u as Se}from"./useInitialThreadRequest-CSR_bJDf.js";import{t as Te}from"./routePaths-DM8AEJT0.js";import{M as ye}from"./MobileAppDrawer-Boi7lIY0.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";import"./InboxNotificationsProvider-Vlyx5Pej.js";import"./useTaskManagerAccess-CZYVdWyJ.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="159edb35-db07-4dc9-a2cf-e0f90f46f506",s._sentryDebugIdIdentifier="sentry-dbid-159edb35-db07-4dc9-a2cf-e0f90f46f506")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=J((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(M(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),f=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:f,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=G(),a=W(),o=z(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=F.useState(!1),[f,A]=F.useState(!1),g=le.getSignedInUser(),D=d((t=>v(t))),_=D.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),k=d((t=>t.profitAndLossState)),x=d((t=>t.reportUIOptionsState.selectedForecast)),P=t=>k.pandLByForecastID[t]!=null&&ee(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();fe({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:V}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&I)u(!0),l||a(Q());else if(l&&!f){A(!0);const t=((m,L,O)=>L!=null?m.forecasts.findIndex((b=>b.id===L)):O!=null?m.forecasts.findIndex((b=>b.id===O)):m.forecasts.length>0?0:-1)(i,r,x?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=x?.index?(a(M(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!P(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,f,A,R,T,I]);const E=me(),$=E?.loggedInUserRole!=null&&X(E.loggedInUserRole),B=Se(D?.companyId,{clearParams:l&&f}),[N,Y]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const j=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:w,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:N,handleDrawerToggle:j}),n.jsx(Ae,{firstMonthOfFY:_,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:P,meetingUrl:Z(h.toString()),hasTransactionAccess:$,isAiCfoAccessEnabled:q,onAskAiCfoClick:V,initialOpenThreadRequest:B,onClickMenuIcon:()=>{j(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=Fe(),{isFeatureEnabled:a}=e(ge.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(K,{children:[n.jsx(C,{path:"/",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-gNIoHksP.js";import{Vy as re,fI as N,m2 as _,e0 as Y,d$ as le,Sp as J,UX as de,D1 as Ee,Vz as X,CS as je,Db as Le,D5 as ce,CW as pe,D9 as Te,D6 as ve,VA as ue,sw as Ae,g9 as Ve,gG as Fe,VB as G,C_ as me,CZ as ge,De as Re,c9 as Oe}from"./zeni-epic-state-ClqSlu6d.js";import{a1 as fe,_ as Q,f as H,z as W,j as Ce,U as he,af as ye,az as be,aA as Be,ab as Se,M as R,ag as we,G as K,aB as Ze,aq as Ue,as as $e,a8 as ze,n as De,T as Ge,p as He,aC as _e,P as We}from"./index-DVhAab8j.js";import{D as xe,n as M,S as Ie}from"./mui-CDH3xRD_.js";import ae from"./NotFoundScreen-XQ69x1V9.js";import{a as d}from"./sentry-BzzHvh63.js";import{u as ee,i as Ke,j as g,h as Me,g as qe,l as Xe,n as se,o as z}from"./core-_cqItzd_.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-DQSYAHEz.js";import{M as Ye}from"./MobileAppDrawer-Boi7lIY0.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";import"./InboxNotificationsProvider-Vlyx5Pej.js";import"./useTaskManagerAccess-CZYVdWyJ.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]="715059dc-00dc-4fd1-9a28-1eabebf0a6e4",e._sentryDebugIdIdentifier="sentry-dbid-715059dc-00dc-4fd1-9a28-1eabebf0a6e4")}catch{}})();const Je={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Qe=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,B]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),P=g((l=>_(l))),{useFeatureGate:x}=Q(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),E=Y(I,p),T=le(p),v=J(p),Z=de(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=!E&&P&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(X()),b()},A=()=>{O===!0?S(!0):h()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(H.isChargeCardFeatureEnabled),L=Ce(p,j,I),{isCardsHidden:V}=he(p?.tenantId),y=!L||V,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:P,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:T,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),B(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(v))},onCloseClick:A,isLoading:D||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{D===!1&&w!=null&&m(Ee(w))}),[D,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Pe,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Be,{...s})]})})},ea=M(Ie)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,ke=M(we.H6Regular)`
|
|
6
|
-
margin-top: ${R.sp7};
|
|
7
|
-
padding-left: ${R.sp8};
|
|
8
|
-
padding-right: ${R.sp8};
|
|
9
|
-
color: ${e=>e.theme.colors.primary};
|
|
10
|
-
word-break: break-word;
|
|
11
|
-
`,Pe=M(we.LargeRegularSp)`
|
|
12
|
-
color: ${e=>e.theme.colors.hero};
|
|
13
|
-
padding-left: ${R.sp8};
|
|
14
|
-
padding-right: ${R.sp8};
|
|
15
|
-
margin-bottom: 30px;
|
|
16
|
-
margin-top: ${R.sp4};
|
|
17
|
-
white-space: pre-line;
|
|
18
|
-
`,aa={overlayWidth:new Se(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,B]=d.useState(!1),[k,S]=d.useState(!1),w=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>_(o))),{useFeatureGate:P}=Q(),{isFeatureEnabled:x}=P(H.isDebitCardFeatureEnabled),I=Y(x,r),E=le(r),T=J(r),v=de(r),Z=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const D=()=>{b(),m(X())},h=()=>{O===!0?S(!0):D()},A={onOkClick:()=>{S(!1),D()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=P(H.isChargeCardFeatureEnabled),L=Ce(r,j,x),{isCardsHidden:V}=he(r?.tenantId),y=!L||V,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(ce({peopleLocalData:o})),B(!0)},onResetClick:D,onSaveClick:()=>{m(f==="zeni_only"?Te(e):ve())},onCloseClick:h,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:Z===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:E,isLoading:U};return d.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(b(),m(X()))}),[w.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Pe,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Ze,{...s})]})})},ta=M(Ie)`
|
|
19
|
-
display: flex;
|
|
20
|
-
min-height: 100%;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
`,na=Xe((function(e,t){const c=ue(e),n=W.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:_(e),analytics:De}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}}))(_e);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=Me(),n=ee(),f=qe(),{areTenantIdsInSync:i}=Ue(),b=W.getSignedInUser(),C=g((s=>N(s))),{useFeatureGate:m}=Q(),{isFeatureEnabled:O}=m(H.isDebitCardFeatureEnabled),B=g((s=>_(s))),k=!Y(O,C)&&B,S=J(C),w=C?.tenantId,{tenantEmailDomain:r}=C,[p,P]=d.useState(!1),[x,I]=d.useState(!1),[E,T]=d.useState(!1),[v,Z]=d.useState("off"),[U,D]=d.useState(!1),h=s=>{D(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Ve(s.userState,s.userRoleState,s.userListViewState,"manager"))),V=g((s=>Fe(s))),y=C?.companyId;d.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),Z(u.uiState.mode),P(!0),n(me()))}),[p,b,w,n,u.uiState.mode,i]),d.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),T(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:De,onLoad:s=>s.trackPageLoaded(Ge.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,E===!0?a.jsx(Qe,{closeDrawerHandler:F,isEditPeopleDrawerOpen:E,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:U,handleDrawerToggle:h}),a.jsx(na,{navigate:c,signedInUser:b,isZeni:C.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(G({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(f.state?.pathnameStackToGoBack,f.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function ka(){const e=We();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-gNIoHksP.js";import E from"./NotFoundScreen-XQ69x1V9.js";import{a as r}from"./sentry-BzzHvh63.js";import{h as _,g as v,j as p,i as M,u as U,N as O,l as P,n as z,o as b}from"./core-_cqItzd_.js";import{fI as N,a19 as h,bo as B,bn as F,iO as V,gk as $}from"./zeni-epic-state-ClqSlu6d.js";import{c as q,z as I,as as G,dN as H}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-DQSYAHEz.js";import{M as K}from"./MobileAppDrawer-Boi7lIY0.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";import"./InboxNotificationsProvider-Vlyx5Pej.js";import"./useTaskManagerAccess-CZYVdWyJ.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]="2705c20b-da9c-45f8-b40f-7f3b5286e550",e._sentryDebugIdIdentifier="sentry-dbid-2705c20b-da9c-45f8-b40f-7f3b5286e550")}catch{}})();const L=P((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(H),Q=()=>{const e=_(),t=v(),c=q(),o=p((a=>N(a))),{aggregatedReportViewState:n}=p((a=>h(a))),{tenantEmailDomain:m}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=F(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=J({mobileExploreReferrer:"Performance"});return G({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(O,{to:`/${m}/dashboard`,replace:!0})};function be(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(Q,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{be as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-gNIoHksP.js";import Z from"./NotFoundScreen-XQ69x1V9.js";import{a as p}from"./sentry-BzzHvh63.js";import{h as C,g as N,u as V,j as u,N as D,l as k,n as z,o as g}from"./core-_cqItzd_.js";import{fI as E,Zf as w,Zw as h,NQ as U,NM as L,NP as f,NF as B,ZV as T,NJ as F,NS as J}from"./zeni-epic-state-ClqSlu6d.js";import{z as $,w as O,ca as K,v as W,bT as M,cb as P}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import{u as Q,R as x}from"./ReimbursementApprovalRuleDetailScreen-DN9la9Dm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="af8b5e09-34d2-42eb-89fb-e9b3eaa027fa",e._sentryDebugIdIdentifier="sentry-dbid-af8b5e09-34d2-42eb-89fb-e9b3eaa027fa")}catch{}})();const j="reimbursement-approval-rule-update",q=k((function(e){return{approvalView:w(e),remiSetupApproverViewUpdateData:h(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(T(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(O(K)),G=({isLoading:e})=>{const s=C(),n=N(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>w(o))),b=u((o=>h(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",H=k((function(e){const s=w(e),n=h(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(T(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(J(t,!0))}}}))(O(P)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=M(e?.tenantId);return s?r.jsx(Y,{isLoading:n}):r.jsx(G,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=N(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>w(i)));Q();const y=u((i=>h(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(F(!1,!0)))}),[v,b,e,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(A)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(X,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(Z,{})})]})}export{le as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-gNIoHksP.js";import{z as b,a8 as N,n as d,T as S,e2 as E,_ as I,f as k}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import g from"./NotFoundScreen-XQ69x1V9.js";import{a as m}from"./sentry-BzzHvh63.js";import{u as C,j as h,h as F,g as L,l as T,n as _,o as f,N as y}from"./core-_cqItzd_.js";import{fI as U,a28 as w,a29 as p,DY as P,q2 as V,a2a as q,DW as z}from"./zeni-epic-state-ClqSlu6d.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.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]="a51a029c-ab90-4425-8100-4b47acfce802",e._sentryDebugIdIdentifier="sentry-dbid-a51a029c-ab90-4425-8100-4b47acfce802")}catch{}})();const G=T((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),d.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&d.trackInviteEmailClicked("cancel")}}}))(E),R=()=>{const e=C(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>U(o))),c=F(),j=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>w(o))),x=u?.firstName!=null?u.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(N,{analytics:d,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:c,location:j,currentTenant:r,companyName:D,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(_,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-XQ69x1V9.js","assets/sentry-BzzHvh63.js","assets/core-_cqItzd_.js","assets/zeni-epic-state-ClqSlu6d.js","assets/index-DVhAab8j.js","assets/mui-CDH3xRD_.js","assets/analytics-DI5uqxwC.js","assets/utils-DZX8_JTm.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-Bq7IQcLO.js","assets/withTransactionSidePanel-BKXId2BT.js","assets/useAskAiCfoHostNavButtonProps-DQSYAHEz.js","assets/TransactionDetailScreen-CWo5MdmD.js","assets/decodeURIComponentSafe-CzbN3zRu.js","assets/useInitialThreadRequest-CSR_bJDf.js","assets/routePaths-DM8AEJT0.js","assets/expenseAutomationHelper-CTin--xN.js","assets/stripSplatSuffix-D8FyJbXM.js","assets/analyticsHelper-Df3DOmUB.js","assets/CompanyPassportScreen-CIym85mw.js","assets/MobileAppDrawer-Boi7lIY0.js","assets/InboxNotificationsProvider-Vlyx5Pej.js","assets/useTaskManagerAccess-CZYVdWyJ.js","assets/useAiCfoDashboardSuggestedQuestionsChips-C6pX9M29.js","assets/FeaturePreviewScreen-ADHB7kMI.js","assets/BillPayRoutes-BDhRNd6v.js","assets/AddressScreen-CPpf4Cpj.js","assets/DomesticWireDetailScreen-ZaeUg4I5.js","assets/BusinessVerificationPageScreen-CaVy5wIy.js","assets/DrawerScreen-bhsbfXgO.js","assets/SetupPagesScreen-PMDfztMD.js","assets/BillPayApprovalRoutes-c7b3I5yJ.js","assets/ReimbursementApprovalRuleDetailScreen-DN9la9Dm.js","assets/getLocaleForTenant-DNtLZSig.js","assets/ReimbursementRoutes-BGNOeI_H.js","assets/ReimbursementApprovalRoutes-BoJxAtXM.js","assets/TransactionListRoutes-DMziXkI4.js","assets/ZeniAccountStatementScreen-kiOSzYpp.js","assets/SettingsRoutes-D_LLhbJv.js","assets/AccountMappingScreen-Da8kjow8.js","assets/QBOConnectionScreen-Czz6muQW.js","assets/empty-CTsBwHYQ.js","assets/index-B_Z1rAKT.js","assets/url-BuE-ZvDR.js","assets/index-aNhAY0yh.js","assets/accountMappingHelper-CeXF1Q4Q.js","assets/useEmailConnectResultRefresh-XR0U1MaM.js","assets/ReportsRoutes-D-cpB-sX.js","assets/ChargeCardRoutes-CWxqs0Z9.js","assets/useChargeCardPusherEvents-pc-PEvCr.js","assets/PeopleRoutes-B4wBQVwY.js","assets/ExpenseAutomationRoutes-Dab9nQ3b.js","assets/useActualMatchingMatchDetail-CQqHF-gN.js","assets/ScheduleDetailsPrepaidExpensesScreen-CNF1ceQn.js","assets/pathToGoBack-DqZRBX-C.js","assets/TreasuryRoutes-B1C-ovJX.js","assets/VendorsRoutes-DoSPbM9C.js","assets/ZeniAccountRoutes-4rPFLUgD.js","assets/AddressRoutes-C13OMsQB.js","assets/PandLWithForecastRoutes-CwPS1KT_.js","assets/CustomerOnboardingRoutes-DVMAQtsb.js","assets/TransactionDetailRoutes-C6i9gm0l.js","assets/EntityDetailRoutes-bilW2_CZ.js","assets/InvoicingRoutes-CiTJXDwp.js","assets/NotificationRoutes-CjruMuyg.js","assets/PerformanceRoutes-BaUrr9_i.js","assets/ActualMatchingMatchDetailScreen-RoPWu4_o.js","assets/RewardsRoutes-Cp5QwRpd.js","assets/TaskRoutes-DIOgMKYK.js","assets/TaskListScreen-C_FDDeaV.js","assets/useTaskManagerPusherEvents-C0fOaGqk.js","assets/AiCfoScreen-C1Zi5BWJ.js","assets/CardsAiCfoScreen-BHtNOqz6.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as s,bn as Es,fI as hs,e0 as ps,d$ as gs,B7 as xs,dj as Rs,c9 as js,gM as Is,gc as Ts,dg as pe,cH as As,gq as bs,cz as Ds,bF as fs,br as ys,Uk as vs,v as Cs,Un as Os,bq as Us,Uo as Ps,bL as ws,bK as Fs,bu as Ls,cv as Vs,Up as ks,Uq as Hs,db as Bs,de as Ss,dd as Ns,cG as Ms,cN as Zs,pV as ge,gl as xe,g$ as $s,gn as Re,gO as je,gP as Ie,go as zs}from"./zeni-epic-state-ClqSlu6d.js";import{j as e}from"./liveblocks-gNIoHksP.js";import{a as P}from"./sentry-BzzHvh63.js";import{N as u,u as Gs,h as qs,i as Ys,g as Ws,j as $,q as Te,n as Ks,o as t}from"./core-_cqItzd_.js";import{O as l,E as Qs,u as Xs,z as y,_ as Js,e as en,g as sn,f as S,j as nn,U as tn,P as an,L as F,G as Ae,t as _,Q as on,R as rn,n as te}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import{f as be}from"./analyticsHelper-Df3DOmUB.js";import{t as ln}from"./getLocaleForTenant-DNtLZSig.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="4ed25008-ae33-4238-9408-56aa7babf0a9",o._sentryDebugIdIdentifier="sentry-dbid-4ed25008-ae33-4238-9408-56aa7babf0a9")}catch{}})();const un=l((()=>s((()=>import("./NotFoundScreen-XQ69x1V9.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),dn=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),cn=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(V===!0){if(o)return e.jsx(fe,{tenantEmailDomain:C});if(i)return e.jsx(De,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(fe,{tenantEmailDomain:C}):i?e.jsx(De,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):D?e.jsx(cn,{tenantEmailDomain:C}):N?e.jsx(dn,{tenantEmailDomain:C}):e.jsx(un,{})},mn={dashboard:()=>s((()=>import("./DashboardRoutes-Bq7IQcLO.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-BDhRNd6v.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-BGNOeI_H.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-DMziXkI4.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-D_LLhbJv.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-D-cpB-sX.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CWxqs0Z9.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-B4wBQVwY.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-Dab9nQ3b.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-B1C-ovJX.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-DoSPbM9C.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-4rPFLUgD.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},_n=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},En=l((()=>s((()=>import("./ReportsRoutes-D-cpB-sX.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),hn=l((()=>s((()=>import("./AddressRoutes-C13OMsQB.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),pn=l((()=>s((()=>import("./PeopleRoutes-B4wBQVwY.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gn=l((()=>s((()=>import("./PandLWithForecastRoutes-CwPS1KT_.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xn=l((()=>s((()=>import("./CustomerOnboardingRoutes-DVMAQtsb.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),Rn=l((()=>s((()=>import("./VendorsRoutes-DoSPbM9C.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),jn=l((()=>s((()=>import("./TransactionDetailRoutes-C6i9gm0l.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-bilW2_CZ.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),In=l((()=>s((()=>import("./DashboardRoutes-Bq7IQcLO.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-BDhRNd6v.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),Tn=l((()=>s((()=>import("./SettingsRoutes-D_LLhbJv.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),An=l((()=>s((()=>import("./InvoicingRoutes-CiTJXDwp.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-BGNOeI_H.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),bn=l((()=>s((()=>import("./ZeniAccountRoutes-4rPFLUgD.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),Dn=l((()=>s((()=>import("./TreasuryRoutes-B1C-ovJX.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),fn=l((()=>s((()=>import("./TransactionListRoutes-DMziXkI4.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),yn=l((()=>s((()=>import("./ChargeCardRoutes-CWxqs0Z9.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),vn=l((()=>s((()=>import("./NotificationRoutes-CjruMuyg.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Cn=l((()=>s((()=>import("./PerformanceRoutes-BaUrr9_i.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),On=l((()=>s((()=>import("./ExpenseAutomationRoutes-Dab9nQ3b.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Un=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-RoPWu4_o.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Pn=l((()=>s((()=>import("./RewardsRoutes-Cp5QwRpd.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),wn=l((()=>s((()=>import("./TaskRoutes-DIOgMKYK.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),Fn=l((()=>s((()=>import("./AiCfoScreen-C1Zi5BWJ.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-BHtNOqz6.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-XQ69x1V9.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ln=l((()=>s((()=>import("./TaskListScreen-C_FDDeaV.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Vn=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Gs(),N=qs(),{tenantEmailDomain:i}=Ys(),V=Qs().mode,{setLoading:O,clearAllLoading:C,clearLoading:k}=Xs(),f=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),K=Es(I),z=Ws(),[L,we]=P.useState(!1),r=$((a=>hs(a))),{useFeatureGate:H}=Js(),M=en(),Q=sn(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,X=p==="Completed"||T==="Completed"?gs(r):void 0,re=p==="Completed"||T==="Completed"?xs(r)&&!Rs(r):void 0,ke=nn(r,Ve,oe),{isCardsHidden:He}=tn(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:J}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rn==="DEV",Ze=r?.userRole!=null&&js(r.userRole),G=$((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&be(I,r,V)}const Z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=an(),$e=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),ze=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&f!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),n=fs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();n.isAfter(d,"month")===!1?D(vs(f,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,D,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,n){if(xe(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);n&&Ae.updateAppLocaleID(ln(n)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?te.identify(a.userId,{tenant_id:a.tenantId}):te.resetUserIdentity()})(Z,I,D,qe))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,n,d,q,B){if(c==null&&n==null)return void console.warn("There is no current tenant selected!!");const Y=n!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==n,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(Y&&cs){B(Re(n));const W=y.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),xe(d?.userId,d?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),B(je(d.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),B(Ie(d.userId,n)))}else Y&&ms&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),B(je(d.userId,n))),Y&&_s&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),B(Ie(d.userId,n)));if(Y){te.identify(d.userId,{tenant_id:n});const W=n==null||n!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),q(F.TENANT_FETCHING),B(zs(d.userId,n,d.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(ge(d.userId,d.zeniSessionId)))}})(T,p,r,f,I,O,D))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),I!=null&&be(I,r,V,void 0,G.tenantsBaseInOrder))}),[G,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(C(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=_n,A=3e3){setTimeout((()=>{const c=n=>{if(n>=a.length)return;const d=a[n],q=mn[d];q!=null?q().then((()=>ae((()=>c(n+1))))).catch((()=>ae((()=>c(n+1))))):c(n+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:Ye}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:We}=H(S.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Qe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,Xe=Ps(h?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",ne=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ns=ue&&Fs(h?.loggedInUserRoleMap),ts=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Vs(h?.loggedInUserRoleMap),os=ks(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Bs(h?.loggedInUserRoleMap),ls=Ss(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),g=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&x,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Xe===!0||os===!0||rs===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&D(ge(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(ne===!0||K&&!ee)&&es&&Je!==!0&&E===!1&&X===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||ne!==!0||ee||K?!L||ne!==!1||ee||K?L&&r?.userRole&&E!=null&&X!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(t,{element:e.jsx(on,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Vn,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:w?e.jsx(In,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:w?e.jsx(En,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:ds||w?e.jsx(pn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:w?e.jsx(gn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(xn,{})}),e.jsx(t,{path:"transaction/*",element:w&&U===!1||Ke||Qe?e.jsx(jn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:w&&U===!1?e.jsx(fn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(Ln,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(wn,{})}),e.jsx(t,{path:"address/*",element:ns||me||as||ts?e.jsx(hn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:R?e.jsx(bn,{}):e.jsx(b,{})}),e.jsx(t,{path:"treasury/*",element:j?e.jsx(Dn,{}):e.jsx(b,{})}),e.jsx(t,{path:"performance",element:Q===!0?e.jsx(Cn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:Q===!0&&U===!1?e.jsx(On,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"expense-automation/actual-matching/:matchId",element:Q===!0&&U===!1&&We===!0?e.jsx(Un,{}):e.jsx(b,{})}),e.jsx(t,{path:"notifications/*",element:e.jsx(vn,{})}),e.jsx(t,{path:"vendors/*",element:$e?e.jsx(Rn,{}):e.jsx(b,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Se?e.jsx(Tn,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(t,{path:"invoicing/*",element:Me&&Ze?e.jsx(An,{}):e.jsx(b,{})}),e.jsx(t,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(yn,{}):e.jsx(b,{})}),e.jsx(t,{path:"rewards/*",element:Ye?e.jsx(Pn,{}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:M?e.jsx(Fn,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(t,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,zn as S};
|