@zeniai/web-app-ui 5.2.18-qa → 5.2.19-next
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/AddressRoutes-D14Xrcr-.js +1 -0
- package/dist/assets/AddressScreen-DM3Cytik.js +9 -0
- package/dist/assets/AiCfoScreen-C7VAZJ1A.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-8Ll-z-xT.js → BillPayApprovalRoutes-C9icCWAb.js} +1 -1
- package/dist/assets/{BillPayRoutes-pfP5wo_C.js → BillPayRoutes-DffUP74I.js} +12 -12
- package/dist/assets/{BusinessVerificationPageScreen-MOMZNf2n.js → BusinessVerificationPageScreen-qG6q7Wb6.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-BahaNrfe.js +14 -0
- package/dist/assets/{ChargeCardRoutes-CkepWz7M.js → ChargeCardRoutes-SaV3T-oM.js} +10 -10
- package/dist/assets/CompanyPassportScreen-CQUCnlmj.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DxTli2yc.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DCVZbjhG.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-Ber4B0KW.js +30 -0
- package/dist/assets/{DashboardRoutes-MCNi0Cm3.js → DashboardRoutes-CDwIkoUk.js} +4 -4
- package/dist/assets/{DefaultTenantHome-B8QXwYfi.js → DefaultTenantHome-CLCoE5KB.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Cy5XGzM3.js +18 -0
- package/dist/assets/DrawerScreen-CFq_1rdP.js +1 -0
- package/dist/assets/EntityDetailRoutes-lCFdhj0N.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BnRbsSz6.js +25 -0
- package/dist/assets/FeaturePreviewScreen-1q69VsC1.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-X0-DSjZb.js +1 -0
- package/dist/assets/MagicLinkRoutes-Dfdz57KO.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-3rm3mwQp.js +12 -0
- package/dist/assets/MobileAppDrawer-uvkpUvp_.js +1 -0
- package/dist/assets/NotFoundScreen-DR4zbgK0.js +1 -0
- package/dist/assets/{NotificationRoutes-CghqA--C.js → NotificationRoutes-Cd2QvtFH.js} +1 -1
- package/dist/assets/OAuthConsentScreen-B3JPBskg.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-W3OrOyHu.js +1 -0
- package/dist/assets/PeopleRoutes-DNg7Ihue.js +22 -0
- package/dist/assets/PerformanceRoutes-o3ofDHl6.js +1 -0
- package/dist/assets/{Preview-C3t9OASa.js → Preview-GrKYlvV7.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BxSTUR6Z.js → QBOConnectionScreen-Bky1RVSb.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DGVz-GX1.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BCDSmsvv.js → ReimbursementApprovalRuleDetailScreen-4DU8eod7.js} +1 -1
- package/dist/assets/{ReimbursementRoutes--vh1Dgkn.js → ReimbursementRoutes-C1MfITXr.js} +8 -8
- package/dist/assets/{ReportsRoutes-B0L7XL0D.js → ReportsRoutes-CoMGWCHx.js} +1 -1
- package/dist/assets/RewardsRoutes-e7w8wtnX.js +1 -0
- package/dist/assets/ScreenRoutes-KCqCdpwt.js +2 -0
- package/dist/assets/SettingsRoutes-BZ_pWEty.js +57 -0
- package/dist/assets/{SetupPagesScreen-z1fhy2nD.js → SetupPagesScreen-D_WJHeIH.js} +5 -5
- package/dist/assets/SignInScreen-BNoucZFL.js +1 -0
- package/dist/assets/SignOutScreen-CMf4hwn3.js +9 -0
- package/dist/assets/TaskListScreen-C_rNr9Jk.js +9 -0
- package/dist/assets/TaskRoutes-CpISGdNU.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-Ds78cNrz.js → TransactionDetailRoutes-CmH9g66g.js} +1 -1
- package/dist/assets/TransactionDetailScreen-BAzuDRZQ.js +5 -0
- package/dist/assets/{TransactionListRoutes-CbJW0jN6.js → TransactionListRoutes-CoFY3pbX.js} +1 -1
- package/dist/assets/TreasuryRoutes--lIehLfz.js +37 -0
- package/dist/assets/{VendorsRoutes-WaC1MSeH.js → VendorsRoutes-BlvpjJIF.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-C62-fzuC.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-ChKECbqX.js → ZeniAccountRoutes-DsEwo2kw.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-DsIySC9T.js +9 -0
- package/dist/assets/{accountMappingHelper-B-kf-Qnc.js → accountMappingHelper-DF_wZmqr.js} +1 -1
- package/dist/assets/{analytics-DtYJ-EGT.js → analytics-CsrWBSkJ.js} +1 -1
- package/dist/assets/{analyticsHelper-DcIIaR44.js → analyticsHelper-eo4F52XS.js} +1 -1
- package/dist/assets/{core-DnZcjy6X.js → core-Ct1Na3r4.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CjxujRw-.js → decodeURIComponentSafe-Dl7JnLtd.js} +1 -1
- package/dist/assets/{dnd-eoV-_JYH.js → dnd-DXTfJSUb.js} +1 -1
- package/dist/assets/{empty-Dq2hLrCm.js → empty-C9Atwx5F.js} +1 -1
- package/dist/assets/{empty-DkIaLxCd.js → empty-enRUfXAJ.js} +1 -1
- package/dist/assets/{emptyVideoElement-BFB9pddL.js → emptyVideoElement-BWmmLkB3.js} +1 -1
- package/dist/assets/epic-CPUd8eYu.js +2 -0
- package/dist/assets/getLocaleForTenant-C9iKXyPU.js +1 -0
- package/dist/assets/{index-Bar5dTpy.js → index-BBFNuY8-.js} +15820 -16753
- package/dist/assets/{index-nn6YvIGD.js → index-C5jp_Nos.js} +1 -1
- package/dist/assets/{index-DUKU6sVX.js → index-CpAcGISI.js} +1 -1
- package/dist/assets/index-Czu7h9lW.css +1 -0
- package/dist/assets/{index-D_CZgugN.js → index-DD29fIsd.js} +1 -1
- package/dist/assets/{index-Wtyhkk6J.js → index-DHN0iULb.js} +1 -1
- package/dist/assets/{index-C8_nlYo6.js → index-D_W5SS2j.js} +2 -2
- package/dist/assets/{index-Dmm4l94W.js → index-Lktm9qH-.js} +1 -1
- package/dist/assets/{index-CiCTnO2S.js → index-UCOMlrxB.js} +1 -1
- package/dist/assets/{lexical-CSqytB8g.js → lexical-5nbymAIm.js} +1 -1
- package/dist/assets/liveblocks-P0DntAgT.js +54 -0
- package/dist/assets/{lottie-Dz5luYQG.js → lottie-7Wgw-CzS.js} +1 -1
- package/dist/assets/{mui-sr6zger7.js → mui-SSWNL1tt.js} +1 -1
- package/dist/assets/{pathToGoBack-DpO-gBzq.js → pathToGoBack-wtH43kNb.js} +1 -1
- package/dist/assets/{pdf-BNSeVvBm.js → pdf-COhrBMN3.js} +3 -3
- package/dist/assets/{pdf-lib-DwpnbCVp.js → pdf-lib-DerHPYIF.js} +1 -1
- package/dist/assets/{plaid-QvRDxgoN.js → plaid-CdfVkhIW.js} +1 -1
- package/dist/assets/{pusher-senIjtt-.js → pusher-hTFVCAHJ.js} +1 -1
- package/dist/assets/{react-CBRcLxW-.js → react-C3avayV7.js} +1 -1
- package/dist/assets/{react-CiyNePZ5.js → react-CB88nZl5.js} +1 -1
- package/dist/assets/{react-OAPKV4uC.js → react-CYqO4utD.js} +1 -1
- package/dist/assets/{react-ClmbMdlp.js → react-Ci3GJXKz.js} +1 -1
- package/dist/assets/{react-CuKQRzYG.js → react-DAcDxy2I.js} +1 -1
- package/dist/assets/{react-BGDkRw8Y.js → react-G31LEvJE.js} +1 -1
- package/dist/assets/{recharts-Bim6mdwu.js → recharts-KVNUr0cO.js} +1 -1
- package/dist/assets/routePaths-Dvh0MCMy.js +1 -0
- package/dist/assets/{sentry-DFI2OQU2.js → sentry-CfbcqWq3.js} +1 -1
- package/dist/assets/{url-p6YiHaLn.js → url-CbJg2s3J.js} +1 -1
- package/dist/assets/{url-4e0ZWhZq.js → url-FHfZtBCR.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-zVG2a35W.js → useAiCfoDashboardSuggestedQuestionsChips-BLXE02N5.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BeiXTDS4.js +1 -0
- package/dist/assets/useCashManagementBanner-D5vpE0Fa.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-0JCfQ36-.js → useChargeCardPusherEvents-B55cb89o.js} +1 -1
- package/dist/assets/{useDeviceId-DasP_-mC.js → useDeviceId-BAVWaoiW.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-2wnXRew_.js → useEmailConnectResultRefresh-DZEhjfaj.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DW3cIl_2.js → useInitialThreadRequest-J5ElkQVA.js} +1 -1
- package/dist/assets/{utils-cHxIh7E8.js → utils-BmRSZi-a.js} +1 -1
- package/dist/assets/withTransactionSidePanel-u9hB8oy5.js +21 -0
- package/dist/assets/{zeni-epic-state-m4zoW3ek.js → zeni-epic-state-x9uZgubN.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +6 -9
- package/dist/assets/AddressRoutes-C8XYQ13t.js +0 -1
- package/dist/assets/AddressScreen-DCby60TJ.js +0 -9
- package/dist/assets/AiCfoScreen-BV-DOocp.js +0 -22
- package/dist/assets/CardsAiCfoScreen-C6GxFeya.js +0 -14
- package/dist/assets/CompanyPassportScreen-CF1WCnT9.js +0 -1
- package/dist/assets/ConnectionAuthScreen-CBqhtWai.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DkQZlHKP.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-B4msejL-.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-CTMJQoQi.js +0 -18
- package/dist/assets/DrawerScreen-B34R7bdb.js +0 -1
- package/dist/assets/EntityDetailRoutes-D5iLxjcN.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Bem3Gc7u.js +0 -25
- package/dist/assets/FeaturePreviewScreen-O1rkkX9g.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Bzg62ZZu.js +0 -1
- package/dist/assets/MagicLinkRoutes-CSc1SUSL.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BVxqZuYQ.js +0 -12
- package/dist/assets/MobileAppDrawer-BoTcj0FT.js +0 -1
- package/dist/assets/NotFoundScreen-D7eT4TBn.js +0 -1
- package/dist/assets/OAuthConsentScreen-BzSEu8Ts.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BfaNIbxL.js +0 -1
- package/dist/assets/PeopleRoutes-B44-Upod.js +0 -22
- package/dist/assets/PerformanceRoutes-Bv8XOGTE.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-D_w-vyXX.js +0 -1
- package/dist/assets/RewardsRoutes-4lrT5UUo.js +0 -1
- package/dist/assets/ScreenRoutes-x2ZEU7XA.js +0 -2
- package/dist/assets/SettingsRoutes-CLQ49ROa.js +0 -57
- package/dist/assets/SignInScreen-CbCM_7kJ.js +0 -1
- package/dist/assets/SignOutScreen-CPqtbwhE.js +0 -9
- package/dist/assets/TaskListScreen-ChqMZGua.js +0 -9
- package/dist/assets/TaskRoutes-DqVkv1wh.js +0 -9
- package/dist/assets/TransactionDetailScreen-DTD0gbHD.js +0 -5
- package/dist/assets/TreasuryRoutes-BzPs578Q.js +0 -37
- package/dist/assets/WiseConfirmationScreen-DP0HNbpz.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-nptp5yY4.js +0 -9
- package/dist/assets/epic-Blr6eiMV.js +0 -2
- package/dist/assets/getLocaleForTenant-DIOFG6A5.js +0 -1
- package/dist/assets/index-Cx4f0JbF.css +0 -1
- package/dist/assets/liveblocks-DKL6viSK.js +0 -54
- package/dist/assets/routePaths-BQ28bs96.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DZXDQgDN.js +0 -1
- package/dist/assets/useCashManagementBanner-DM17aUQt.js +0 -1
- package/dist/assets/withTransactionSidePanel-CBujpiDq.js +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-P0DntAgT.js";import{A as d}from"./AddressScreen-DM3Cytik.js";import i from"./NotFoundScreen-DR4zbgK0.js";import"./sentry-CfbcqWq3.js";import{o as s,p as r}from"./core-Ct1Na3r4.js";import"./zeni-epic-state-x9uZgubN.js";import"./recharts-KVNUr0cO.js";import"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-P0DntAgT.js";import{a as h}from"./sentry-CfbcqWq3.js";import{h as T,u as _,g as E,i as j,j as B,n as $}from"./core-Ct1Na3r4.js";import{K as M,y as D,z as K,e as L,B as N,C as R,f as C,h as S,n as z,k as b,p as F}from"./index-BBFNuY8-.js";import{N2 as k,h$ as U,eZ as G,N3 as O,c7 as V,N4 as q,lm as H}from"./zeni-epic-state-x9uZgubN.js";import{n as Z}from"./mui-SSWNL1tt.js";import J from"./NotFoundScreen-DR4zbgK0.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]="4d73ce55-b89f-4083-b8c7-6d32edde93d6",e._sentryDebugIdIdentifier="sentry-dbid-4d73ce55-b89f-4083-b8c7-6d32edde93d6")}catch{}})();const Q=Z.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,W=$((function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}}),(function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=F(d?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=X(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}}))(z);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=E(),{addressId:s,addressType:u}=j(),g=M(),I=D(),v=K.getSignedInUser(),[f,x]=h.useState(s==null),p=B((m=>s!=null?k(m,s).fetchState:"Not-Started")),A=L();if(v==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect((()=>{f||s==null||(x(!0),d(U(s,!1)))}),[f,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(N,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(R,{analytics:C,onLoad:P}),r.jsx(Q,{windowSize:g,children:r.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(J,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{re as A,X as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as c}from"./liveblocks-P0DntAgT.js";import{a as r}from"./sentry-CfbcqWq3.js";import{u as xe,h as Pe,g as we,j as J,i as ye,n as Ee}from"./core-Ct1Na3r4.js";import{Z as Te,de as ve,z as Ae,K as Qe,df as _e,dg as Ue,bb as X,dh as se,di as Oe,ba as ae,p as V,C as R,f as I,dj as B,dk as je,dl as Fe,a3 as Le,h as De,a9 as Re,dm as Be,dn as Me,a4 as Ve,dp as $e,dq as Ge,dr as Ne,r as qe,b6 as ze,ds as He}from"./index-BBFNuY8-.js";import{gp as We,eY as oe,eZ as Ye,iH as Ze,Ug as Ke,fs as Je,iR as Xe,iN as et,e_ as M,fz as tt,g8 as st,g9 as at,g1 as ot,g5 as ee,ga as nt,gb as it,gc as rt,gd as lt,ge as dt,gf as ct}from"./zeni-epic-state-x9uZgubN.js";import{D as ut,n as k,S as mt,P as pt}from"./mui-SSWNL1tt.js";import{u as ht}from"./useAiCfoDashboardSuggestedQuestionsChips-BLXE02N5.js";import{p as St}from"./pathToGoBack-wtH43kNb.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="44841d80-7306-4161-9b1b-dfced4f377bd",e._sentryDebugIdIdentifier="sentry-dbid-44841d80-7306-4161-9b1b-dfced4f377bd")}catch{}})();const ne="chat-response-generated",gt=Ee((function(e,o){const t=oe(e),m=o.isSubmitting,s=t.uiState?.currentChatSessionId,h=s!=null?tt(e.aiCfoState,s):[],S=Me(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:o.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ve}/tableDownload`,emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,skills:st(e).skills,syntheticAnswers:h,resolveSyntheticAnswerCardTile:Ge(e),resolveSyntheticAnswerPolicyTile:$e(e),...S}}),(function(e,o){const{location:t,currentTenant:m,userId:s,navigate:h,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,setIsAiCfoOpen:b}=o,p=m.tenantEmailDomain;return{onEventReceived:(a,l)=>{if(a===ne&&typeof l.text=="string"&&typeof l.metadata=="object"){const d=l,g=rt(d.type),u=d.metadata.chat_session_id??null,{currentChatSession:n,currentQuestionAnswer:P,currentQuestionAnswerSummary:A}=ae(x,u);g!=="answer"?I.trackAICFOChatResponseGenerated(g,P?.question.questionText??"",d.text,u,He(A,n),d.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(d.text,P?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,lt(d.visualization?.type??"")??null,u,d.summarized_title,d.metadata.message_id??null),e(dt({chatSessionId:d.metadata.chat_session_id,responseType:g,fetchState:{fetchState:"Completed",error:void 0}})),e(ct({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:s}))}},onSubmit:(a,l,d,g,u)=>{a&&ze(e,a,l,S,x,s,g,d,void 0,u)},onFetchSkills:()=>{e(it())},updateCurrentInput:a=>{e(ee(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{e(nt(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{h(-1)},onCloseClick:()=>{const a=V(t.state?.pathnameStackToGoBack),l=a.poppedPathname??St(1);h(l,{state:{...t.state,pathnameStackToGoBack:a.newStack}}),e(ee(""))},togglePageView:()=>{const a=V(t.state?.pathnameStackToGoBack),l=a.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;h(l,{state:{...se(t.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),b(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{h(-1)},onNewChatClick:()=>{S!=null&&e(ot());const a=qe(t.state?.pathnameStackToGoBack,t.pathname);h(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,l)=>{e(at({questionAnswerId:a,isCollapsed:l}))},onMenuClick:o.onMenuClick,...Ne(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:v,currentChatSessionId:S,onAfterCardsCreationSubmit:()=>{b(!0),h(`/${p}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{b(!0),h(`/${p}/cards/policy`,{state:{...t.state}})}})}}))(Re(Be)),Rt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Te(),t=xe(),m=Pe(),s=we(),[h,S]=r.useState(!1),{allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,onCardPolicyVendorSearchTextChange:b}=ve();r.useEffect((()=>{t(We())}),[t]);const p=J((i=>oe(i))),a=Ae.getSignedInUser(),{session_id:l}=ye(),d=Qe(),g=Le(d),u=J((i=>Ye(i))),n=p.uiState.currentChatSessionId,P=u.tenantEmailDomain,{handleUploadPromoClose:A,isUploadPromoVisible:ie}=_e({isFileUploadEnabled:e,tenantEmailDomain:P}),Q=Ue({currentTenant:u,currentChatSessionId:n,aiCfoView:p}),{isSuggestedQuestionsLoading:re,suggestedPromptQuestions:le}=ht(),w=s.state,y=w?.aiCfoInitialQuestion,$=!!w?.aiCfoShouldSubmit;r.useEffect((()=>{const i=s.state;if(i?.[X]!==!0)return;S(!0);const f={...i};delete f[X],m(s,{replace:!0,state:f})}),[s.pathname,s.search,s.state,m]);const[de,_]=r.useState(null),[ce,U]=r.useState(!1),[ue,O]=r.useState(void 0),[me,j]=r.useState(void 0),G=r.useRef(!1);r.useEffect((()=>{if(!G.current&&y!=null&&y!==""){const i=s.state;_(y),U($),O(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const f=i?.aiCfoSuggestionIndex;j(typeof f=="number"?f:void 0),G.current=!0}}),[y,$,s.state]);const pe=r.useCallback((()=>{_(null),U(!1),O(void 0),j(void 0),m(s.pathname,{replace:!0,state:se(s.state)})}),[s.pathname,s.state,m]),N=r.useMemo((()=>new URLSearchParams(s.search)),[s.search]),q=N.get("ref")??w?.aiCfoRef,F=N.get("emailRefId")??w?.aiCfoEmailRefId,z=r.useRef(!1);r.useEffect((()=>{z.current||q!=="month-end-email"||F==null||n!=null||a==null||(t(Ze("controller",a.userId,F,"MONTH_END_EMAIL")),z.current=!0)}),[q,F,n,t,a]);const E=p.uiState.lastContextMessage;r.useEffect((()=>{E!=null&&E!==""&&n!=null&&(_(E),U(!0),O(void 0),j(void 0),t(Ke()))}),[E,n,t]);const he=u.masterTOSInfo,C=he?.isMasterTOSAccepted??!1,{visitedSessions:H}=Oe(n),L=p.fetchState,D=p.uiState.chatSessionsNextPageToken.hasMore||!p.uiState.chatSessionsFirstPageFetched,W=n!=null?p.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",Y=n==null||(p.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),Z=p.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Se}=ae(Z,n),ge=Se.length===0;r.useEffect((()=>{C||g||m("../dashboard",{state:{...s.state,message:"open_ai_cfo_drawer"}})}),[C,g,m,s.state]);const fe=r.useCallback((()=>{const i=V(s.state?.pathnameStackToGoBack),f=u.tenantEmailDomain;m(i.poppedPathname??(f!=null?`/${f}/dashboard`:".."),{state:{...s.state,pathnameStackToGoBack:i.newStack}})}),[u.tenantEmailDomain,s.state,m]);r.useEffect((()=>{n!=null&&l!==n&&m(`../ai-cfo/${n}`,{state:{...s.state}})}),[n,l]),r.useEffect((()=>{l!=null&&n==null&&l!=="new_chat"&&l!=="explore"&&t(Je({sessionId:l,agentId:"controller"}))}),[]);const Ce=r.useMemo((()=>({events:H.map((i=>`private-encrypted-chat-${i}.${ne}`)),eventCallback:(i,f,ke)=>ke.onEventReceived(i,f)})),[H]);r.useEffect((()=>{L!=="In-Progress"&&D&&t(Xe())}),[L,D,t]),r.useEffect((()=>{n!=null&&W!=="In-Progress"&&Y&&a!=null&&L==="Completed"&&!D&&t(et(n,a.userId))}),[W,Y,n,a,t]);const K=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(a==null||l==null)throw Error("Can't access AI Controller page without signing in...");const be=n!=null&&p.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";if(!C&&g)return c.jsxs(Ct,{children:[c.jsx(R,{analytics:I,onLoad:K}),Q.drawerElement,c.jsx(bt,{children:c.jsx(te,{children:c.jsx(B,{isTOSAccepted:!1,acceptMasterTOSState:p.masterTOSAcceptanceState,onCloseClick:fe,onCompleteClick:()=>{u.userRoleId!=null&&t(M(u.userRoleId))}})})})]});const Ie=c.jsxs(c.Fragment,{children:[h&&!C?c.jsx(R,{analytics:I,onLoad:K}):null,c.jsx(B,{isTOSAccepted:C,acceptMasterTOSState:p.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||t(M(u.userRoleId)),S(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(ft,{children:[c.jsx(R,{analytics:I,onLoad:i=>i.trackPageLoaded(De.Event.aiCFOPage)}),g&&Q.drawerElement,c.jsx(gt,{...Ce,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:Z,allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,openOnboardingPage:()=>S(!0),userId:a.userId,setIsAiCfoOpen:o,navigate:m,sessionFromUrl:l,location:s,isSubmitting:be,isEmptyChatWithSession:ge,currentTenant:u,emailLinkQuestion:de??void 0,autoSubmitEmailLinkQuestion:ce,onEmailLinkQuestionProcessed:pe,routedInitialQuestionSource:ue,routedInitialQuestionSuggestionIndex:me,onCardPolicyVendorSearchTextChange:b,onMenuClick:g?Q.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ie,onUploadPromoClose:A,exploreSuggestedPromptQuestions:le,exploreSuggestedPromptQuestionsLoading:re}),h&&g?c.jsx(ut,{anchor:"right",open:h,transitionDuration:250,PaperProps:{component:It,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:c.jsx(te,{onClick:i=>i.stopPropagation(),children:c.jsx(B,{isTOSAccepted:C,acceptMasterTOSState:p.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||t(M(u.userRoleId)),S(!1)}})})}):null]}),h&&!g?c.jsx(je,{open:h,onClose:()=>S(!1),children:c.jsx(Fe,{children:Ie})}):null]})},te=k(mt)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,ft=k.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Ct=k.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,bt=k.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,It=k(pt)`
|
|
20
|
+
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
21
|
+
color: ${({theme:e})=>e.colors.grey4};
|
|
22
|
+
`;export{Rt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-DKL6viSK.js";import{a as v}from"./sentry-DFI2OQU2.js";import{h as U,g as B,u as j,j as y,N as z,n as k,i as W,o as te,p as D}from"./core-DnZcjy6X.js";import{e$ as V,QG as A,Qm as h,zR as E,zJ as q,zN as R,zC as Q,Qo as K,zT as ae,zF as G,zW as J,zS as C}from"./zeni-epic-state-m4zoW3ek.js";import{z as O,a9 as M,bL as oe,ag as T,bC as H,bM as le,E as X,B as Y,bN as pe,bO as se}from"./index-Bar5dTpy.js";import"./mui-sr6zger7.js";import{u as Z,i as ne}from"./ReimbursementApprovalRuleDetailScreen-BCDSmsvv.js";import re from"./NotFoundScreen-D7eT4TBn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="2e5ed8aa-0a11-4665-a70c-6c5dd7cf7e02",e._sentryDebugIdIdentifier="sentry-dbid-2e5ed8aa-0a11-4665-a70c-6c5dd7cf7e02")}catch{}})();const P="bill-approval-rule-update",ie=k((function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(P)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Q(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}}))(M(oe)),ce=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>V(s))),i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!1)))}),[a,l,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${P}`]:[],eventCallback:(s,w,S)=>{s.endsWith(P)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ie,{currentTenant:u,location:t,navigate:p,...m})},_="bill-approval-rule-update",ue=k((function(e){const p=A(e),t=h(e).billPaySetupApproverViewUpdateData,o={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o[r.id]=r.name);const a={};for(const r of Object.values(e.classState.classesByKey))r?.classId!=null&&(a[r.classId]=r.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Q(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(ae(a,!0))}}}))(M(le)),de=()=>{const e=y((o=>V(o))),{isApprovalRulesV3Enabled:p,isLoading:t}=H(e?.tenantId);return p?c.jsx(ve,{isLoading:t}):c.jsx(ce,{isLoading:t})},ve=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>V(s)));Z();const i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!0)))}),[a,l,e,o]),O.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${_}`]:[],eventCallback:(s,w,S)=>{s.endsWith(_)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ue,{currentTenant:u,location:t,navigate:p,isLoading:e,...m})},fe=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let r=t.allApprovalRules.length===0;return p.approvalRuleId&&(r=t.allApprovalRules.findIndex((n=>n.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:r,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=T(p.location);return{onApprovalRuleDataUpdated:l=>{const u=f=>{const m=[];return f.forEach((s=>{const w=s.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),S=s.actors.selectedNonUsers.map((b=>{const I=!!ne(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}})),g=w.concat(S);m.push({action:s.stepType.selectedOption,actors:g,operator:g.length>1?s.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),m},i={amount:{type:"amount",comparator:"range",min:{amount:l.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:l.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(n==="approval_create"){const f={criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}else{const f={approvalRuleId:r,criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(J(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(pe);function ye(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),r=X(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(v.useEffect((()=>{l||(u(!0),p(G(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(fe,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t})}const ge=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],r={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(a.push(n.id),r[n.id]=n.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:r,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=T(p.location);return{onApprovalRuleDataUpdated:l=>{const u=g=>{const b=[];return g.forEach((I=>{const L=I.actorKind?.selectedOption,N=I.selectedRole?.selectedOption;let x=[];L==="role"&&N!=null?x=[{type:"attribute",subType:N,userId:void 0,idType:void 0,isImplicitActor:!1}]:L==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map((ee=>({type:"user",userId:ee.userId,isImplicitActor:!1}))));const F=I.action??"require_approval";b.push({action:F,actors:x,operator:x.length>1?F==="require_approval"?"or":"and":"is"})})),b},i=l.amountCriteria,f=l.vendorCriteria,m=l.departmentCriteria,s={};if(i!=null&&i.comparator.selectedOption!=null){const g=i.comparator.selectedOption;s.amount={type:"amount",comparator:g,min:g==="less_than"?void 0:i.min,max:g==="greater_than"?void 0:i.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(s.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const S=m?.selection.selectedOptions??[];if(S.length>0&&(s.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:S}),n==="approval_create"){const g={name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}else{const g={approvalRuleId:r,name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(J(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:l=>{e(R(l)),t(n==="approval_update"?`../../${l}/edit`:`../${l}/edit`)}}}))(se);function $(){const e=y((t=>V(t))),{isApprovalRulesV3Enabled:p}=H(e?.tenantId);return p?c.jsx(me,{}):c.jsx(ye,{})}function me(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),r=X(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(Z(),v.useEffect((()=>{l||(u(!0),p(G(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(ge,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t},o??"new")}function xe(){return c.jsxs(te,{children:[c.jsx(D,{path:"/",element:c.jsx(de,{})}),c.jsx(D,{path:"/new",element:c.jsx($,{})}),c.jsx(D,{path:"/:approvalRuleId/edit",element:c.jsx($,{})}),c.jsx(D,{path:"*",element:c.jsx(re,{})})]})}export{xe as B};
|
|
1
|
+
import{j as c}from"./liveblocks-P0DntAgT.js";import{a as v}from"./sentry-CfbcqWq3.js";import{h as U,g as B,u as j,j as y,N as z,n as k,i as W,o as te,p as D}from"./core-Ct1Na3r4.js";import{eZ as O,Qq as A,Q6 as h,zM as E,zE as q,zI as R,zx as Q,Q8 as K,zO as ae,zA as M,zR as Z,zN as C}from"./zeni-epic-state-x9uZgubN.js";import{z as V,a9 as G,bL as oe,ag as P,bC as H,bM as le,y as J,B as X,bN as pe,bO as se}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{u as Y,i as ne}from"./ReimbursementApprovalRuleDetailScreen-4DU8eod7.js";import re from"./NotFoundScreen-DR4zbgK0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="a0f6bebc-bcb3-45d1-9448-b86302e63208",e._sentryDebugIdIdentifier="sentry-dbid-a0f6bebc-bcb3-45d1-9448-b86302e63208")}catch{}})();const T="bill-approval-rule-update",ie=k((function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(T)&&e(K(!1))},onBackClick:()=>{P(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Q(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}}))(G(oe)),ce=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>O(s))),i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!1)))}),[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${T}`]:[],eventCallback:(s,w,S)=>{s.endsWith(T)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ie,{currentTenant:u,location:t,navigate:p,...m})},_="bill-approval-rule-update",ue=k((function(e){const p=A(e),t=h(e).billPaySetupApproverViewUpdateData,o={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o[r.id]=r.name);const a={};for(const r of Object.values(e.classState.classesByKey))r?.classId!=null&&(a[r.classId]=r.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(K(!1))},onBackClick:()=>{P(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Q(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(ae(a,!0))}}}))(G(le)),de=()=>{const e=y((o=>O(o))),{isApprovalRulesV3Enabled:p,isLoading:t}=H(e?.tenantId);return p?c.jsx(ve,{isLoading:t}):c.jsx(ce,{isLoading:t})},ve=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>O(s)));Y();const i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!0)))}),[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${_}`]:[],eventCallback:(s,w,S)=>{s.endsWith(_)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ue,{currentTenant:u,location:t,navigate:p,isLoading:e,...m})},fe=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let r=t.allApprovalRules.length===0;return p.approvalRuleId&&(r=t.allApprovalRules.findIndex((n=>n.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:r,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=P(p.location);return{onApprovalRuleDataUpdated:l=>{const u=f=>{const m=[];return f.forEach((s=>{const w=s.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),S=s.actors.selectedNonUsers.map((b=>{const I=!!ne(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}})),g=w.concat(S);m.push({action:s.stepType.selectedOption,actors:g,operator:g.length>1?s.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),m},i={amount:{type:"amount",comparator:"range",min:{amount:l.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:l.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(n==="approval_create"){const f={criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}else{const f={approvalRuleId:r,criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Z(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(pe);function ye(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(v.useEffect((()=>{l||(u(!0),p(M(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(X,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(fe,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t})}const ge=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],r={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(a.push(n.id),r[n.id]=n.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:r,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=P(p.location);return{onApprovalRuleDataUpdated:l=>{const u=g=>{const b=[];return g.forEach((I=>{const L=I.actorKind?.selectedOption,N=I.selectedRole?.selectedOption;let x=[];L==="role"&&N!=null?x=[{type:"attribute",subType:N,userId:void 0,idType:void 0,isImplicitActor:!1}]:L==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map((ee=>({type:"user",userId:ee.userId,isImplicitActor:!1}))));const F=I.action??"require_approval";b.push({action:F,actors:x,operator:x.length>1?F==="require_approval"?"or":"and":"is"})})),b},i=l.amountCriteria,f=l.vendorCriteria,m=l.departmentCriteria,s={};if(i!=null&&i.comparator.selectedOption!=null){const g=i.comparator.selectedOption;s.amount={type:"amount",comparator:g,min:g==="less_than"?void 0:i.min,max:g==="greater_than"?void 0:i.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(s.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const S=m?.selection.selectedOptions??[];if(S.length>0&&(s.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:S}),n==="approval_create"){const g={name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}else{const g={approvalRuleId:r,name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Z(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:l=>{e(R(l)),t(n==="approval_update"?`../../${l}/edit`:`../${l}/edit`)}}}))(se);function $(){const e=y((t=>O(t))),{isApprovalRulesV3Enabled:p}=H(e?.tenantId);return p?c.jsx(me,{}):c.jsx(ye,{})}function me(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(Y(),v.useEffect((()=>{l||(u(!0),p(M(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(X,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(ge,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t},o??"new")}function xe(){return c.jsxs(te,{children:[c.jsx(D,{path:"/",element:c.jsx(de,{})}),c.jsx(D,{path:"/new",element:c.jsx($,{})}),c.jsx(D,{path:"/:approvalRuleId/edit",element:c.jsx($,{})}),c.jsx(D,{path:"*",element:c.jsx(re,{})})]})}export{xe as B};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DKL6viSK.js";import{h as J,u as se,g as K,i as ae,j as v,N as te,n as X,l as ia,o as oa,p as y}from"./core-DnZcjy6X.js";import{e$ as H,PY as Ue,bs as wt,KM as la,bq as Bt,bJ as pe,PZ as At,z7 as Ct,Am as $e,zG as sa,bn as Ee,P_ as ra,P$ as ca,c7 as da,Q0 as ua,kL as xt,Q1 as Et,Q2 as Dt,AX as Me,zm as Ae,Q3 as pa,yX as tt,Q4 as ma,F0 as ba,y$ as ha,z5 as jt,Q5 as fe,Q6 as Ne,An as Oe,Q7 as ga,Q8 as Sa,Aq as ze,Q9 as ya,AD as fa,Qa as Tt,A7 as at,Ac as Ia,Qb as va,Qc as ue,Qd as Pt,Qe as Ft,Qf as Rt,gy as ka,zr as Le,cD as Vt,Qg as wa,fD as Ba,Qh as Aa,Qi as Ca,fI as $t,fG as Lt,Qj as Qe,Qk as xa,Ql as Ea,NG as Ze,Qm as Da,NH as oe,NI as He,Qn as ja,Qo as Ta,Qp as Pa,Ae as nt,Ab as Fa,Qq as Ra,Qr as Va,Qs as $a,zZ as La,Qt as _a,Qu as Ga,Qv as Ua,cr as _t,cT as Gt,kW as Ma,bP as Na,bo as Ut,bQ as Mt,yd as Oa,Qw as za,EP as Qa,EV as Za,uz as Ha,Ao as Wa,B2 as qa,l7 as ye,Qx as Ja,Qy as Nt,lB as Ka,l1 as Ot,lm as zt,ll as it,bE as be,bO as Xa,Qz as Ya,QA as Ie,jG as en,QB as ot,QC as tn,jK as an,k3 as nn,Bg as on,QD as ln,lu as sn,B6 as rn,QE as lt,Ba as cn,Bf as dn,Bc as un,B4 as pn,QF as Qt,zg as mn,QG as bn,QH as hn,gn,gm as Sn,gl as yn,la as fn,ls as st,lD as In,r$ as vn,lj as kn,B8 as wn,jQ as Bn,lI as An,QI as Cn,jI as xn,rS as En,QJ as Dn,A3 as jn,bK as Tn,bt as Pn,Mu as Fn,cW as Rn,cV as Vn,cC as $n,cJ as Ln}from"./zeni-epic-state-m4zoW3ek.js";import{E as me,z as $,D as ve,a0 as We,w as le,i as S,aS as Ce,B as re,o as x,F as De,e as D,bh as _n,q as Z,a4 as qe,r as E,J as ke,bi as rt,bj as ct,bk as Gn,al as Un,H as Mn,aM as Nn,G as Zt,a as je,I as Je,bl as On,au as Ht,bm as zn,Z as Qn,g as Wt,a9 as Zn,bn as Hn,bo as Wn,bp as qn,bq as Jn,br as Kn,bs as Xn,bt as Yn,bu as ei,bv as ti,x as ai,bw as ni,be as ii,bx as oi,by as li,d as si}from"./index-Bar5dTpy.js";import{n as _,S as ri}from"./mui-sr6zger7.js";import{A as dt}from"./AddressScreen-DCby60TJ.js";import{g as ie,a as Te,i as qt,V as Ke,b as Xe,c as ci,v as di,d as ui,A as he,D as ge}from"./DomesticWireDetailScreen-CTMJQoQi.js";import{a as f}from"./sentry-DFI2OQU2.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DZXDQgDN.js";import{u as Jt}from"./useInitialThreadRequest-DW3cIl_2.js";import xe from"./NotFoundScreen-D7eT4TBn.js";import{D as pi}from"./DrawerScreen-B34R7bdb.js";import{M as Kt}from"./MobileAppDrawer-BoTcj0FT.js";import{F as Xt}from"./FeaturePreviewScreen-O1rkkX9g.js";import{S as Pe}from"./SetupPagesScreen-z1fhy2nD.js";import{B as mi}from"./BillPayApprovalRoutes-8Ll-z-xT.js";import{FallBackRoute as bi}from"./ScreenRoutes-x2ZEU7XA.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";import"./analyticsHelper-DcIIaR44.js";import"./routePaths-BQ28bs96.js";import"./BusinessVerificationPageScreen-MOMZNf2n.js";import"./ReimbursementApprovalRuleDetailScreen-BCDSmsvv.js";import"./getLocaleForTenant-DIOFG6A5.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]="14c11f51-be0e-4447-9421-d393affe7604",e._sentryDebugIdIdentifier="sentry-dbid-14c11f51-be0e-4447-9421-d393affe7604")}catch{}})();const hi=X((function(e,t){const l=Ue(e,t.billId),n=$.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=Z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=Ee(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=ra(l.billActivities,ca(t.currentTenant),n);d=g,p=b}const m=da(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&ua(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(fe({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(jt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ha(l,s))},onSaveRealTimeApprovals:o=>{e(ba(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ma({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=Z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(pa({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Dt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Et({billId:l}))}}}))(_n);function gi(){const e=J(),t=se(),l=K(),{billId:n}=ae(),c=me(),r=$.getSignedInUser(),u=ve(),o=v((z=>H(z))),s=v((z=>Ue(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&wt(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,I]=f.useState(!1),[j,A]=f.useState(!1),[C,G]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:L}=T(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:k}=T(S.isBillPayCommentingEnabled),{isFeatureEnabled:W}=T(S.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=U(Ce.zeniAssistConfig),w=la(o),O=Bt(o.userRole),M=g&&pe(u?.loggedInUserRoleMap),F=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:q}=T(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect((()=>{L&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&w===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(O||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,O,M,o.isZeni,w,r]),f.useEffect((()=>{n!=null&&t(At(n))}),[n]),f.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Ct(n??"",L,F,!1)))}),[b,s,n,t]),f.useEffect((()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,L,F,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(sa()))}),[j,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:z=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(z)}),a.jsx(hi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:L,location:l,navigate:e,isBillPayCommentingEnabled:k,isRealTimeApprovalEnabled:C,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:F,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const _e=je.getLocalizedStrings().spendManagement.billPay.billDetails,ut=je.getLocalizedStrings().common,Si={containerWidth:new Zt(100,58)},pt=X((function(e,t){const l=$.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=$.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(fa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Nn);function B({appContent:e}){const t=se(),l=J(),{billId:n}=ae(),c=K(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=ke(),s=me(),i=$.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:I}=p(Ce.zeniAssistConfig),j=I.user_ids!=null&&i?.userId!=null&&I.user_ids.includes(i?.userId),A=v((R=>H(R))),[C,G]=f.useState(!1),[T,U]=f.useState(!1),[L,k]=f.useState(!1),[W,N]=f.useState(),w=v((R=>Ne(R,m,g,n)));let O=w.fetchState,M=w.file,F=w.showAutofill;const q=v((R=>Ue(R,n??"")));u===!1&&(O=q.fetchState,M=q.transactionDetails?.attachments?.[0],F=!1);const Y=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;f.useEffect((()=>{n==null&&t(Oe(!0))}),[n,t]),f.useEffect((()=>{O==="Not-Started"&&(u&&T?U(!1):!u&&C&&G(!1))}),[n]),f.useEffect((()=>{C||n==null||u||(G(!0),t(Ct(n,h,j,!1)),T||(U(!0),t($e(!1,h,j,b,n)))),u&&!T&&(U(!0),t($e(!1,h,j,b,n)))}),[C,T,u,n,t]);const z={onOkClick:()=>{if(k(!1),!W)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",R,i?.userEmail??"","yes"),t(Sa({replaceBillData:!0,billId:n})),t(ze(W,m,n))},onCancelClick:()=>{if(k(!1),!W)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",R,i?.userEmail??"","no"),t(ga({file:W,billId:n}))}},ee=f.useCallback((()=>{const R=Z(c.state?.pathnameStackToGoBack),ce=R.poppedPathname??ie(A.tenantEmailDomain);t(fe({billId:n})),l(ce,{state:{pathnameStackToGoBack:R.newStack}})}),[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||q.fetchState==="Error")return a.jsx(xe,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(bt,{}),a.jsx(Re,{}),a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:k,setPayload:N,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||F?null:a.jsx(mt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Gn,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const R=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[F&&o!=="small"?a.jsx(bt,{}):null,L?a.jsx(Un,{titleComponent:a.jsx(Bi,{children:_e.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:_e.overwriteDescription}),primaryButtonText:ut.yes,secondaryButtonText:ut.no,action:z,isEditPopup:!0}):null,o==="small"||F?null:a.jsx(mt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:F,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:fi(u,q,w),setShowConfirmationPopup:k,setPayload:N,showActionButtons:Ii(u,w),isInitialEdit:!!w.isInitialEdit,billStage:R}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function fi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(vi,{children:[a.jsx(ki,{children:`${_e.recurringBill.recurringCycle}
|
|
2
|
-
${n}/${c}`}),a.jsx(wi,{})]}):void 0}function
|
|
1
|
+
import{j as a}from"./liveblocks-P0DntAgT.js";import{h as K,u as se,g as J,i as ae,j as I,N as te,n as X,l as ia,o as oa,p as y}from"./core-Ct1Na3r4.js";import{eZ as W,PI as Ge,bs as wt,Kz as la,bq as Bt,bJ as pe,PJ as At,z2 as Ct,Ah as $e,zB as sa,bn as Ee,PK as ra,PL as ca,c7 as da,PM as ua,kG as xt,PN as Et,PO as Dt,AS as Me,zh as Ae,PP as pa,yS as tt,PQ as ma,EX as ba,yW as ha,z0 as jt,PR as fe,PS as Ne,Ai as Oe,PT as ga,PU as Sa,Al as ze,PV as ya,Ay as fa,PW as Tt,A2 as at,A7 as va,PX as Ia,PY as ue,PZ as Pt,P_ as Ft,P$ as Rt,gw as ka,zm as Le,cC as Vt,Q0 as wa,fB as Ba,Q1 as Aa,Q2 as Ca,fG as $t,fE as Lt,Q3 as Qe,Q4 as xa,Q5 as Ea,Nt as Ze,Q6 as Da,Nu as oe,Nv as We,Q7 as ja,Q8 as Ta,Q9 as Pa,A9 as nt,A6 as Fa,Qa as Ra,Qb as Va,Qc as $a,zU as La,Qd as _a,Qe as Ua,Qf as Ga,cq as _t,cS as Ut,kR as Ma,bP as Na,bo as Gt,bQ as Mt,y8 as Oa,Qg as za,EK as Qa,EQ as Za,uu as Wa,Aj as Ha,AZ as qa,l2 as ye,Qh as Ka,Qi as Nt,lw as Ja,kY as Ot,lh as zt,lg as it,bE as be,bO as Xa,Qj as Ya,Qk as ve,jB as en,Ql as ot,Qm as tn,jF as an,j_ as nn,Bb as on,Qn as ln,lp as sn,B1 as rn,Qo as lt,B5 as cn,Ba as dn,B7 as un,A$ as pn,Qp as Qt,zb as mn,Qq as bn,Qr as hn,gl as gn,gk as Sn,gj as yn,l5 as fn,ln as st,ly as vn,rW as In,le as kn,B3 as wn,jL as Bn,lD as An,Qs as Cn,jD as xn,rN as En,Qt as Dn,z_ as jn,bK as Tn,bt as Pn,Mh as Fn,cV as Rn,cU as Vn,cB as $n,cI as Ln}from"./zeni-epic-state-x9uZgubN.js";import{y as me,z as $,e as Ie,a0 as He,A as le,d as S,aS as Ce,B as re,o as x,C as De,f as D,bh as _n,p as Z,a4 as qe,r as E,K as ke,bi as rt,bj as ct,bk as Un,al as Gn,I as Mn,aM as Nn,F as Zt,O as je,J as Ke,bl as On,au as Wt,bm as zn,_ as Qn,h as Ht,a9 as Zn,bn as Wn,bo as Hn,bp as qn,bq as Kn,br as Jn,bs as Xn,bt as Yn,bu as ei,bv as ti,v as ai,bw as ni,be as ii,bx as oi,by as li,i as si}from"./index-BBFNuY8-.js";import{n as _,S as ri}from"./mui-SSWNL1tt.js";import{A as dt}from"./AddressScreen-DM3Cytik.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ci,v as di,d as ui,A as he,D as ge}from"./DomesticWireDetailScreen-Cy5XGzM3.js";import{a as f}from"./sentry-CfbcqWq3.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{u as Kt}from"./useInitialThreadRequest-J5ElkQVA.js";import xe from"./NotFoundScreen-DR4zbgK0.js";import{D as pi}from"./DrawerScreen-CFq_1rdP.js";import{M as Jt}from"./MobileAppDrawer-uvkpUvp_.js";import{F as Xt}from"./FeaturePreviewScreen-1q69VsC1.js";import{S as Pe}from"./SetupPagesScreen-D_WJHeIH.js";import{B as mi}from"./BillPayApprovalRoutes-C9icCWAb.js";import{FallBackRoute as bi}from"./ScreenRoutes-KCqCdpwt.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";import"./analyticsHelper-eo4F52XS.js";import"./routePaths-Dvh0MCMy.js";import"./BusinessVerificationPageScreen-qG6q7Wb6.js";import"./ReimbursementApprovalRuleDetailScreen-4DU8eod7.js";import"./getLocaleForTenant-C9iKXyPU.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]="977ff043-7d50-44d8-957f-8cc99bc33595",e._sentryDebugIdIdentifier="sentry-dbid-977ff043-7d50-44d8-957f-8cc99bc33595")}catch{}})();const hi=X((function(e,t){const l=Ge(e,t.billId),n=$.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=Z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=Ee(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=ra(l.billActivities,ca(t.currentTenant),n);d=g,p=b}const m=da(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&ua(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(fe({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(jt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ha(l,s))},onSaveRealTimeApprovals:o=>{e(ba(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ma({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=Z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(pa({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Dt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Et({billId:l}))}}}))(_n);function gi(){const e=K(),t=se(),l=J(),{billId:n}=ae(),c=me(),r=$.getSignedInUser(),u=Ie(),o=I((z=>W(z))),s=I((z=>Ge(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});He({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&wt(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,v]=f.useState(!1),[j,A]=f.useState(!1),[C,U]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:G}=le(),{isFeatureEnabled:L}=T(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:k}=T(S.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(S.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=G(Ce.zeniAssistConfig),w=la(o),O=Bt(o.userRole),M=g&&pe(u?.loggedInUserRoleMap),F=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:q}=T(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect((()=>{L&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&w===!1?U(!1):U(s.billActivities[0]?.isRealTimeApprovalEnabled&&(O||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,O,M,o.isZeni,w,r]),f.useEffect((()=>{n!=null&&t(At(n))}),[n]),f.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(v(!0),t(Ct(n??"",L,F,!1)))}),[b,s,n,t]),f.useEffect((()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,L,F,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(sa()))}),[j,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:z=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(z)}),a.jsx(hi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:L,location:l,navigate:e,isBillPayCommentingEnabled:k,isRealTimeApprovalEnabled:C,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:F,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const _e=je.getLocalizedStrings().spendManagement.billPay.billDetails,ut=je.getLocalizedStrings().common,Si={containerWidth:new Zt(100,58)},pt=X((function(e,t){const l=$.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Wt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=$.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(fa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Nn);function B({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=ke(),s=me(),i=$.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:v}=p(Ce.zeniAssistConfig),j=v.user_ids!=null&&i?.userId!=null&&v.user_ids.includes(i?.userId),A=I((R=>W(R))),[C,U]=f.useState(!1),[T,G]=f.useState(!1),[L,k]=f.useState(!1),[H,N]=f.useState(),w=I((R=>Ne(R,m,g,n)));let O=w.fetchState,M=w.file,F=w.showAutofill;const q=I((R=>Ge(R,n??"")));u===!1&&(O=q.fetchState,M=q.transactionDetails?.attachments?.[0],F=!1);const Y=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;f.useEffect((()=>{n==null&&t(Oe(!0))}),[n,t]),f.useEffect((()=>{O==="Not-Started"&&(u&&T?G(!1):!u&&C&&U(!1))}),[n]),f.useEffect((()=>{C||n==null||u||(U(!0),t(Ct(n,h,j,!1)),T||(G(!0),t($e(!1,h,j,b,n)))),u&&!T&&(G(!0),t($e(!1,h,j,b,n)))}),[C,T,u,n,t]);const z={onOkClick:()=>{if(k(!1),!H)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",R,i?.userEmail??"","yes"),t(Sa({replaceBillData:!0,billId:n})),t(ze(H,m,n))},onCancelClick:()=>{if(k(!1),!H)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",R,i?.userEmail??"","no"),t(ga({file:H,billId:n}))}},ee=f.useCallback((()=>{const R=Z(c.state?.pathnameStackToGoBack),ce=R.poppedPathname??ie(A.tenantEmailDomain);t(fe({billId:n})),l(ce,{state:{pathnameStackToGoBack:R.newStack}})}),[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||q.fetchState==="Error")return a.jsx(xe,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(bt,{}),a.jsx(Re,{}),a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:k,setPayload:N,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||F?null:a.jsx(mt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const R=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[F&&o!=="small"?a.jsx(bt,{}):null,L?a.jsx(Gn,{titleComponent:a.jsx(Bi,{children:_e.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:_e.overwriteDescription}),primaryButtonText:ut.yes,secondaryButtonText:ut.no,action:z,isEditPopup:!0}):null,o==="small"||F?null:a.jsx(mt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:F,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:fi(u,q,w),setShowConfirmationPopup:k,setPayload:N,showActionButtons:vi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:R}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function fi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(Ii,{children:[a.jsx(ki,{children:`${_e.recurringBill.recurringCycle}
|
|
2
|
+
${n}/${c}`}),a.jsx(wi,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const mt=_.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
5
5
|
margin-left: ${x.sp5};
|
|
6
6
|
position: absolute;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
|
-
`,
|
|
9
|
+
`,Ii=_.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
justify-content: center;
|
|
12
12
|
align-items: center;
|
|
13
13
|
padding-top: 9px;
|
|
14
14
|
gap: ${x.sp2};
|
|
15
15
|
margin-bottom: -${x.sp2};
|
|
16
|
-
`,ki=_(
|
|
16
|
+
`,ki=_(Ke.StandardMedium)``,wi=_((e=>f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))))`
|
|
17
17
|
color: ${e=>e.theme.colors.hero};
|
|
18
18
|
height: ${x.sp3};
|
|
19
19
|
width: ${x.sp3};
|
|
@@ -64,20 +64,20 @@ import{j as a}from"./liveblocks-DKL6viSK.js";import{h as J,u as se,g as K,i as a
|
|
|
64
64
|
flex-direction: column;
|
|
65
65
|
width: ${e=>`${Si.containerWidth.value(e.windowSize)}%`};
|
|
66
66
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
|
-
`,Bi=_(
|
|
67
|
+
`,Bi=_(Ke.H6Regular)`
|
|
68
68
|
margin-top: ${x.sp7};
|
|
69
69
|
padding-left: ${x.sp8};
|
|
70
70
|
padding-right: ${x.sp8};
|
|
71
71
|
color: ${e=>e.theme.colors.primary};
|
|
72
72
|
word-break: break-word;
|
|
73
|
-
`,Ai=_(
|
|
73
|
+
`,Ai=_(Ke.LargeRegularSp)`
|
|
74
74
|
color: ${e=>e.theme.colors.hero};
|
|
75
75
|
padding-left: ${x.sp8};
|
|
76
76
|
padding-right: ${x.sp8};
|
|
77
77
|
margin-bottom: 30px;
|
|
78
78
|
margin-top: ${x.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,Ci=X((function(e,t){return{billsReviewView:Tt(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(
|
|
80
|
+
`,Ci=X((function(e,t){return{billsReviewView:Tt(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(Ia(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(va());break;case"approve":case"review":e(at("approved",n??""));break;case"reject":e(at("rejected",n??""))}}}}))(zn);function xi(){const e=K(),t=I((n=>n.billsBulkActionViewState.bulkSubmissionFetchState.fetchState)),{billsForReview:l}=I((n=>Tt(n)));return f.useEffect((()=>{t!=="Completed"&&l.length!==0||e("./")}),[t,l.length]),a.jsx(Ci,{navigate:e,analytics:D})}const ne=Ea(),ea="bulk-operation-update",Ue="bill-approval-rule-update",{spendManagement:Ei,common:ht}=je.getLocalizedStrings(),gt=Ei.billPay.bulkActions,Di=_.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-DKL6viSK.js";import{h as J,u as se,g as K,i as a
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,ji=X((function(e,t){const l=$.getSignedInUser(),n=Ee(l),c=Rt(e,ne,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):t.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Ze(e,"common"),s=e.tenantState.currentTenantId,i=
|
|
88
|
+
`,ji=X((function(e,t){const l=$.getSignedInUser(),n=Ee(l),c=Rt(e,ne,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):t.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Ze(e,"common"),s=e.tenantState.currentTenantId,i=W(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Da(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter((b=>b.isDeleted===!1)),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:h,analytics:D,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ne,spendManagementEndPoint:`${qe}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:g.affectedEntityIds}}),(function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ue()),e(Pt(o))},onSubtabChange:o=>{e(ue()),e(Ft(o))},onTransactionClick:(o,s)=>{const i=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Pi(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;D?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(_a(o))},onReloadTransactions:()=>{e(Le(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(La(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e($a({filters:o})),o.categories.every((s=>s.field!=null&&s.values?.length!==0))&&D.trackSpendManagmentFilterChange("bill_pay",o.categories.map((s=>`${s.field}-${JSON.stringify(s.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&D.trackSpendManagementDownloadClick("bill_pay"),e(Va({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Ra(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Fa(o,s??""));break;case"send_for_approval":e(nt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(nt("approve")),t.navigate("./bulk-review");break;case"review":e(Pa()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ue)&&e(Ta(!1))},onEventReceived:o=>{o===ea&&e(ja())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(We({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}}))(Zn(Wn));function Ti(){const e=K(),t=se(),l=J(),n=ke(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,i]=f.useState(null),d=ia("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect((()=>(c?.tab!=null&&c?.subTab!=null&&(t(Pt(c?.tab)),t(Ft(c?.subTab))),()=>{t(ue())})),[]);const p=$.getSignedInUser(),m=I((P=>W(P))),{areTenantIdsInSync:h}=Qn(),[g,b]=f.useState(!1),{useFeatureGate:v}=le(),{isFeatureEnabled:j}=v(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:A}=v(S.isBillPayCommentingEnabled),{isFeatureEnabled:C}=v(S.isReimbursementCommentingEnabled),{isFeatureEnabled:U}=v(S.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:T}=v(S.isBillPayBulkActionEnabled),{isFeatureEnabled:G}=v(S.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:L}=v(S.isBillPayDetectInsufficientFundsEnabled),k=I((P=>Rt(P,ne,T,p?.userId))),{isFeatureEnabled:H}=v(S.isDebitCardFeatureEnabled),N=k.fetchState,{isAiCfoAccessEnabled:w,onAskAiCfoClick:O}=Ye({mobileExploreReferrer:"Bills List"});He({isDataReady:N==="Completed"});const M=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,F=!!m.companyBillPayInfo?.info?.isBillPayEnabled,q=I((P=>ka(P.companyState,m.companyId))),Y=q?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect((()=>{!g&&F&&h&&(b(!0),t(Le(ne,!0,j,G)))}),[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const z=(P,de)=>{t(xa({uiState:{sortKey:P,sortOrder:de},period:ne}))},ee=Vt(r?.loggedInUserRoleMap),R=pe(r?.loggedInUserRoleMap),ce=P=>{o(P)},{billsProcessed:Q,billsProcessing:we}=I((P=>wa(P)));f.useEffect((()=>{Q===we&&s!=null&&(t(Ba({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:Q>1?gt.bills:gt.bill},{variableName:"_has_",variableValue:Q>1?ht.texts.have:ht.texts.has},{variableName:"_action_",variableValue:Aa(s)}]})),t(Ca()),setTimeout((()=>{t(Le(ne,!0,j,!0,G))}),3e3),i(null))}),[Q,we]);const ta={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${ea}`,`private-encrypted-${m.companyId}.${Ue}`]:[],eventCallback:(P,de,et)=>{P.endsWith(Ue)?et.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(i(de.operation_type),et.onEventReceived(P))}},aa=$t(H,m),na=Lt(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?aa===!0||na===!0?a.jsx(Xt,{}):F?a.jsxs(a.Fragment,{children:[N==="Completed"?a.jsx(De,{analytics:D,onLoad:P=>(de=>de.trackPageLoaded(Ht.Event.billPayHome))(P)}):null,a.jsxs(Di,{windowSize:n,children:[a.jsx(Jt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(pi,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Fi,{onClick:P=>P.stopPropagation(),children:a.jsx(xi,{})})}),a.jsx(ji,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:A,isReimbursementCommentingEnabled:C,period:ne,isAdmin:!1,uiState:k.uiState,onColumnSortConfigChanged:z,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:j,isShowDeletedReimbursementEnabled:U,isBulkActionEnabled:T,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:k.isDownloadEnabled,connectedAccountProvider:Y,bulkSubmissionLimit:k.billBulkSubmissionLimit,bulkSubmissionFetchState:k.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:k.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:G,isDetectInsufficientFundsEnabled:L,isAiCfoAccessEnabled:w,onAskAiCfoClick:O,...ta})]})]}):M===!0&&R===!0?a.jsx(te,{to:"../setup"}):r!=null&&Qe(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:N}):a.jsx(xe,{})}const Pi=e=>`/${e}/bills/setup`,Fi=_(ri)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Ri}},appName:Vi}=je.getLocalizedStrings(),$i=X((function(e,t){const l=$.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=Z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ee(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Vi} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Na(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Ut(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,I=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Mt(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),A=H(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:xt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:A.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:I,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}}),(function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(it(i));const d=yt(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(zt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Oe(i))},onSaveChangesToLocalStore:(i,d,p,m,h)=>{const g=Ui(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(Me("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Nt("draft"))},reviewBillDetails:()=>{const i=Li(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(fe({billId:i}))},clearBillPayReviewLocalState:()=>e(Ja()),onClickDismiss:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ye(!1,i));const d=_i(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ye(!1,i));const d=Gi(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ye(!1,i));const d=qt(s,l,i),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(fe({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(jt(l))},onAttachmentClick:(i,d)=>{const p=Te(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=Z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(i,d){e(qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Wa(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ha("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Za(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Qa(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(za({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(Wn);function St(){const e=J(),t=K(),l=se(),{billId:n,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(S.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(S.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(S.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(S.isShaDisabled),{isFeatureEnabled:I}=r(S.isOurDisabled),{isFeatureEnabled:j}=r(S.isBillPayDetectInsufficientFundsEnabled),{configValue:A}=u(Ce.zeniAccountsConfig),C=Ga(A),{configValue:G}=u(Ce.sameDayAchDisablementConfig),T=Ua(G),U=$.getSignedInUser(),L=v((Q=>H(Q))),k=v((Q=>Ne(Q,m,g,n))),W=Jt(L?.companyId,{clearParams:k.fetchState==="Completed"}),{isAiCfoAccessEnabled:N,onAskAiCfoClick:w}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:k.fetchState==="Completed"});const O=L.companyId??$.getSignedInUserTenant(c)?.companyId,M=!!L.companyZeniAccountInfo?.info?.isZeniAccountEnabled,F=ve(),q=_t(F?.loggedInUserRoleMap),Y=Gt(F?.loggedInUserRoleMap),z=pe(F?.loggedInUserRoleMap),ee=Bt(L.userRole);if(f.useEffect((()=>{n!=null&&l(At(n))}),[n]),U==null)throw Error("Can't access address page without signing in...");const R=v((Q=>Ma(Q.accountState,Q.accountListState,"billPayAccountList"))),ce={pathname:"../",search:t.search};return k.isDeleted===!0||k.billStage=="paid"||k.fetchState=="Not-Started"?a.jsx(te,{to:ce}):k.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:k.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:Q=>(we=>{n!=null&&k.deleteStatus.fetchState!=="Completed"&&we.trackBillPayEditBill(n,k.isRecurring)})(Q)}),a.jsx($i,{initialOpenThreadRequest:W??void 0,location:t,navigate:e,currentTenant:L,billId:n,companyId:O,billDetailsView:k,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:R,isInternationalPaymentShaVsOurEnabled:i,vendor:k.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:I,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:M,hasZeniAccountsAdminAccess:q,isZeniAccountsUser:Y,isBillPayAdmin:z,isSuperAdmin:ee,accountsPromoConfig:C,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:N,onAskAiCfoClick:w})]})}const yt=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Li=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},V="paymentDetails",Ui=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ut(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[V]?.paymentDate?be(t[V].paymentDate.toString()):void 0,paymentType:t[V]?.paymentType!=null?t[V]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===t[V]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:t[V]?.paymentType?.method!=null&&t[V].paymentType.method.includes(Xa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[V]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[V]?.recurringPaymentType?.selectedOption===Ri.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[V]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ya(t[V]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[V]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[V]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[V]?.recurringPaymentDetails?.startDate?be(t[V]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[V]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[V]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[V]?.recurringPaymentDetails?.updateRecurringBills},h=Mi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Mi=(e,t,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=t.find((p=>p.classId===o.class.selectedOption)));const d=Jn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Ni=_.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Ri}},appName:Vi}=je.getLocalizedStrings(),$i=X((function(e,t){const l=$.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=Z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ee(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Vi} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Na(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Gt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,v=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Mt(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),A=W(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:xt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:A.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:v,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}}),(function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(it(i));const d=yt(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(zt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Oe(i))},onSaveChangesToLocalStore:(i,d,p,m,h)=>{const g=Gi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ja({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(Me("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Nt("draft"))},reviewBillDetails:()=>{const i=Li(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(fe({billId:i}))},clearBillPayReviewLocalState:()=>e(Ka()),onClickDismiss:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ye(!1,i));const d=_i(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ye(!1,i));const d=Ui(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ye(!1,i));const d=qt(s,l,i),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(fe({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(jt(l))},onAttachmentClick:(i,d)=>{const p=Te(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=Z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(We({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(i,d){e(qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Jn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ha(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Wa("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Za(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Qa(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(za({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(Hn);function St(){const e=K(),t=J(),l=se(),{billId:n,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(S.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(S.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(S.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(S.isShaDisabled),{isFeatureEnabled:v}=r(S.isOurDisabled),{isFeatureEnabled:j}=r(S.isBillPayDetectInsufficientFundsEnabled),{configValue:A}=u(Ce.zeniAccountsConfig),C=Ua(A),{configValue:U}=u(Ce.sameDayAchDisablementConfig),T=Ga(U),G=$.getSignedInUser(),L=I((Q=>W(Q))),k=I((Q=>Ne(Q,m,g,n))),H=Kt(L?.companyId,{clearParams:k.fetchState==="Completed"}),{isAiCfoAccessEnabled:N,onAskAiCfoClick:w}=Ye({mobileExploreReferrer:"Bill Details"});He({isDataReady:k.fetchState==="Completed"});const O=L.companyId??$.getSignedInUserTenant(c)?.companyId,M=!!L.companyZeniAccountInfo?.info?.isZeniAccountEnabled,F=Ie(),q=_t(F?.loggedInUserRoleMap),Y=Ut(F?.loggedInUserRoleMap),z=pe(F?.loggedInUserRoleMap),ee=Bt(L.userRole);if(f.useEffect((()=>{n!=null&&l(At(n))}),[n]),G==null)throw Error("Can't access address page without signing in...");const R=I((Q=>Ma(Q.accountState,Q.accountListState,"billPayAccountList"))),ce={pathname:"../",search:t.search};return k.isDeleted===!0||k.billStage=="paid"||k.fetchState=="Not-Started"?a.jsx(te,{to:ce}):k.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:k.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:Q=>(we=>{n!=null&&k.deleteStatus.fetchState!=="Completed"&&we.trackBillPayEditBill(n,k.isRecurring)})(Q)}),a.jsx($i,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:L,billId:n,companyId:O,billDetailsView:k,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:R,isInternationalPaymentShaVsOurEnabled:i,vendor:k.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:v,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:M,hasZeniAccountsAdminAccess:q,isZeniAccountsUser:Y,isBillPayAdmin:z,isSuperAdmin:ee,accountsPromoConfig:C,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:N,onAskAiCfoClick:w})]})}const yt=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Li=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Ui=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},V="paymentDetails",Gi=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Gt(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[V]?.paymentDate?be(t[V].paymentDate.toString()):void 0,paymentType:t[V]?.paymentType!=null?t[V]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===t[V]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:t[V]?.paymentType?.method!=null&&t[V].paymentType.method.includes(Xa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[V]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[V]?.recurringPaymentType?.selectedOption===Ri.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[V]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ya(t[V]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[V]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[V]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[V]?.recurringPaymentDetails?.startDate?be(t[V]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[V]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[V]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[V]?.recurringPaymentDetails?.updateRecurringBills},h=Mi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Mi=(e,t,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=t.find((p=>p.classId===o.class.selectedOption)));const d=Kn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Ni=_.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-DKL6viSK.js";import{h as J,u as se,g as K,i as a
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
100
|
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
-
`,Oi=X((function(e,t){const{vendorId:l,billId:n}=t,c=
|
|
101
|
+
`,Oi=X((function(e,t){const{vendorId:l,billId:n}=t,c=ve(e,l),r=Ne(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(nn(s))},onSaveHandler:()=>{e(an(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(tn({data:i}))},onCancel:()=>{(()=>{const s=Z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??ft();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const i=Xe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(en({fetchState:"Not-Started"}));const s=Z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??ft(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}}))(Xn);function zi(){const e=K(),t=J(),l=ke(),{vendorId:n,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=$.getSignedInUser(),s=I((g=>W(g))),i=Z(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=I((g=>ve(g,n))),{isFeatureEnabled:m}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(S.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Ni,{windowSize:l,children:[a.jsx(Je,{vendorId:n,billId:c}),a.jsx(Oi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},Qi=_.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-DKL6viSK.js";import{h as J,u as se,g as K,i as a
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
109
|
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
-
`,Zi=X((function(e,t){const{vendorId:l}=t,n=
|
|
110
|
+
`,Zi=X((function(e,t){const{vendorId:l}=t,n=ve(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=ln(e,c||"international_business",t.billId),u=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[sn(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(pn(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(dn(s)),p&&e(un(i,d))},onCurrencyUpdated:(s,i,d)=>{e(cn(s,i,d,!1))},onCancel:()=>{(()=>{const s=Z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??vt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const i=Xe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(rn({fetchState:"Not-Started"}));const s=Z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??vt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}}))(Yn);function Wi(){const e=K(),t=J(),l=ke(),{vendorId:n,billId:c}=ae(),r=se(),u=me(),o=$.getSignedInUser(),s=I((C=>W(C))),i=Z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=I((C=>C.vendorViewState.newVendorState.fetchStatus.fetchState)),h=I((C=>n!=null?C.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started")),g=n!==void 0?h:m;f.useEffect((()=>{d===!1&&g==="Not-Started"&&n!=null&&(r(ye(!1,n)),p(!0))}),[d,g,n]);const[b,v]=f.useState(!1);f.useEffect((()=>{b||g==="In-Progress"||(v(!0),r(on(c,n)))}),[b,g,r]);const j=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",A=I((C=>ve(C,n)));if(o==null)throw Error("Can't access international wire page without signing in...");return j==="billDetail"&&A.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:A.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Qi,{windowSize:l,children:[a.jsx(Je,{vendorId:n,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:j})]})}const vt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},It=_.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-DKL6viSK.js";import{h as J,u as se,g as K,i as a
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Wi=X((function(e,t){const l=$.getSignedInUser(),n=Qt(e,t.billId),c=bn(e),r=Ee(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Mt(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(fe({}))},saveBillDetails:(o,s)=>{o&&e(Dt({billId:n,data:s})),e(Me(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Et({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Nt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Te(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ae(t.billId,"retry"))}}}))(ti);function kt(){const e=J(),t=se(),l=K(),{billId:n}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(S.isBillPayDetectInsufficientFundsEnabled),o=ke(),s=$.getSignedInUser(),{isFeatureEnabled:i}=c(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(S.isBillPayCommentingEnabled),m=Z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(S.isRecurringBillsFeatureEnabled),b=v((A=>H(A))),I=v((A=>Qt(A,n))),j=I.fetchState??"Not-Started";if(f.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),f.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),f.useEffect((()=>{const A=I.vendor?.name,C=I.vendor?.id,G=I.totalAmount.amount,T=I.recipientTotalAmount.amount,U=I.invoiceNumber;A&&C&&t(mn(A,C,G,T,U,n))}),[]),h==null)return a.jsx(te,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(vt,{windowSize:o,children:a.jsx(ei,{})}):a.jsx(vt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=X((function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=H(e),o=$.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:i,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,t.billId)),i!=null&&e(En(i))},saveVendorDetailLocalData:i=>{e(zt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Cn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:i=>{e(An(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?qt(s,t.billId,u):ui(s,t.billId,u):p=di(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?wn(i,"vendor",u):Bn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(kn({files:i}))},onEditFileName:(i,d)=>{e(vn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(In("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(fn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const i=Z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ci(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(yn(i,"BillPayVendor"))},onResendOtp:i=>{e(Sn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(gn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(hn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Ot(i,!1))}}}))(oi),Be=()=>{const e=J(),t=se(),l=ai(),n=K(),{billId:c,vendorId:r}=ae(),u=v((b=>H(b))),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(S.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=v((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=v((b=>Ie(b,r))),h=v((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),g=r!==void 0?h:p;return f.useEffect((()=>{i===!1&&g==="Not-Started"&&r!=null&&(t(ye(!1,r)),d(!0))}),[i,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ni,{}):g==="Error"?a.jsx(ii,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ke,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=X((function(e,t){const{companyId:l}=t;return{billPaySetupView:Dn(e,l),analytics:D,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(jn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(li),Ki=()=>{const e=J(),t=K(),{tenantEmailDomain:l}=ae(),[n,c]=f.useState(!1),r=me(),u=v((h=>H(h))),o=u.companyId??$.getSignedInUserTenant(l)?.companyId,s=$.getSignedInUser(),i=ve(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||i!=null&&Qe(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:n,handleDrawerToggle:m}),a.jsx(Ji,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=v((F=>H(F))),t=ve(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(S.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:zi,{isFeatureEnabled:o}=c(S.isDebitCardFeatureEnabled),s=$t(o,e),i=Lt(e),d=K(),p=e?.userRole!=null&&wt(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Vt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Tn(t?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,I=b&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(S.isChargeCardFeatureEnabled),A=si(e,j,o)&&!p,C=A&&Pn(t?.loggedInUserRoleMap),G=Fn(t?.loggedInUserRoleMap),T=Gt(t?.loggedInUserRoleMap),U=Rn(t?.loggedInUserRoleMap),L=b&&T,k=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&U,W=Vn(t?.loggedInUserRoleMap),N=$n(t?.loggedInUserRoleMap),w=Ln(t?.loggedInUserRoleMap),O=A&&W,{tenantEmailDomain:M}=ae();return a.jsxs(oa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:G,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:G,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(y,{path:"approval-rules/*",element:m?a.jsx(mi,{}):a.jsx(bi,{showZeniAccountRoute:L,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:w,showTreasuryRoute:k,isTenantBankingOnly:s,showChargeCardRoute:O,tenantEmailDomain:M??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:G,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Ti,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(Xt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&Qe(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(B,{appContent:a.jsx(St,{})})}),a.jsx(y,{path:":billId",element:a.jsx(B,{appContent:a.jsx(gi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(B,{appContent:a.jsx(St,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(B,{appContent:a.jsx(kt,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(B,{appContent:a.jsx(kt,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(B,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(B,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(xe,{})})]}):a.jsx(y,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(xe,{})})]})}export{jo as default};
|
|
119
|
+
`,Hi=X((function(e,t){const l=$.getSignedInUser(),n=Qt(e,t.billId),c=bn(e),r=Ee(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Mt(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(fe({}))},saveBillDetails:(o,s)=>{o&&e(Dt({billId:n,data:s})),e(Me(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Et({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Nt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Te(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ae(t.billId,"retry"))}}}))(ti);function kt(){const e=K(),t=se(),l=J(),{billId:n}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(S.isBillPayDetectInsufficientFundsEnabled),o=ke(),s=$.getSignedInUser(),{isFeatureEnabled:i}=c(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(S.isBillPayCommentingEnabled),m=Z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(S.isRecurringBillsFeatureEnabled),b=I((A=>W(A))),v=I((A=>Qt(A,n))),j=v.fetchState??"Not-Started";if(f.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),f.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),f.useEffect((()=>{const A=v.vendor?.name,C=v.vendor?.id,U=v.totalAmount.amount,T=v.recipientTotalAmount.amount,G=v.invoiceNumber;A&&C&&t(mn(A,C,U,T,G,n))}),[]),h==null)return a.jsx(te,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(It,{windowSize:o,children:a.jsx(ei,{})}):a.jsx(It,{windowSize:o,children:a.jsx(Hi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=X((function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=W(e),o=$.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Wt.fileMicroServiceBaseUrl}`,authParams:i,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,t.billId)),i!=null&&e(En(i))},saveVendorDetailLocalData:i=>{e(zt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Cn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:i=>{e(An(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?qt(s,t.billId,u):ui(s,t.billId,u):p=di(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?wn(i,"vendor",u):Bn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(kn({files:i}))},onEditFileName:(i,d)=>{e(In(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(vn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(fn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(We({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const i=Z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ci(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(yn(i,"BillPayVendor"))},onResendOtp:i=>{e(Sn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(gn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(hn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Ot(i,!1))}}}))(oi),Be=()=>{const e=K(),t=se(),l=ai(),n=J(),{billId:c,vendorId:r}=ae(),u=I((b=>W(b))),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(S.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=I((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=I((b=>ve(b,r))),h=I((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),g=r!==void 0?h:p;return f.useEffect((()=>{i===!1&&g==="Not-Started"&&r!=null&&(t(ye(!1,r)),d(!0))}),[i,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ni,{}):g==="Error"?a.jsx(ii,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Je,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ki=X((function(e,t){const{companyId:l}=t;return{billPaySetupView:Dn(e,l),analytics:D,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(jn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(li),Ji=()=>{const e=K(),t=J(),{tenantEmailDomain:l}=ae(),[n,c]=f.useState(!1),r=me(),u=I((h=>W(h))),o=u.companyId??$.getSignedInUserTenant(l)?.companyId,s=$.getSignedInUser(),i=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||i!=null&&Qe(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Ht.Event.billPayPromoPage))(h)}),a.jsx(Jt,{isAppContentDrawerOpen:n,handleDrawerToggle:m}),a.jsx(Ki,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=I((F=>W(F))),t=Ie(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(S.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Wi:zi,{isFeatureEnabled:o}=c(S.isDebitCardFeatureEnabled),s=$t(o,e),i=Lt(e),d=J(),p=e?.userRole!=null&&wt(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Vt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Tn(t?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,v=b&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(S.isChargeCardFeatureEnabled),A=si(e,j,o)&&!p,C=A&&Pn(t?.loggedInUserRoleMap),U=Fn(t?.loggedInUserRoleMap),T=Ut(t?.loggedInUserRoleMap),G=Rn(t?.loggedInUserRoleMap),L=b&&T,k=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&G,H=Vn(t?.loggedInUserRoleMap),N=$n(t?.loggedInUserRoleMap),w=Ln(t?.loggedInUserRoleMap),O=A&&H,{tenantEmailDomain:M}=ae();return a.jsxs(oa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:U,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:U,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(Ji,{})}),a.jsx(y,{path:"approval-rules/*",element:m?a.jsx(mi,{}):a.jsx(bi,{showZeniAccountRoute:L,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:w,showTreasuryRoute:k,isTenantBankingOnly:s,showChargeCardRoute:O,tenantEmailDomain:M??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:U,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Ti,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(Xt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&Qe(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(B,{appContent:a.jsx(St,{})})}),a.jsx(y,{path:":billId",element:a.jsx(B,{appContent:a.jsx(gi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(B,{appContent:a.jsx(St,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(B,{appContent:a.jsx(kt,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(B,{appContent:a.jsx(kt,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(B,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(B,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(B,{appContent:a.jsx(Be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(B,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(B,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(B,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(xe,{})})]}):a.jsx(y,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(xe,{})})]})}export{jo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-P0DntAgT.js";import{a as V}from"./sentry-CfbcqWq3.js";import{h as ae,g as ne,u as se,i as oe,j as k,N as ie,n as re}from"./core-Ct1Na3r4.js";import{e as ce,A as ue,aS as de,z,C as pe,f as B,ag as E,h as x,bH as le,au as me,r as P,av as U}from"./index-BBFNuY8-.js";import{Qe as fe,eZ as G,tV as ye,KC as Se,zU as ge,Dj as Ie,G4 as he,GJ as be,HJ as Te,QB as De,QC as Oe,QD as Ce,QE as ke,QF as Ve,N3 as Ae,PG as Ne,Ni as we,En as Fe,Nj as _e,Er as ve,lm as Ee,gl as xe,gk as ze,gj as Be,rW as Pe,rN as Ue,rK as Re,le as je,u2 as Le,u0 as R,bE as j,ue as L,cA as Me}from"./zeni-epic-state-x9uZgubN.js";import{n as Ge}from"./mui-SSWNL1tt.js";import{d as M}from"./routePaths-Dvh0MCMy.js";import{M as Qe}from"./MobileAppDrawer-uvkpUvp_.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="24243581-4d35-42a1-b9f0-b80525723bec",t._sentryDebugIdIdentifier="sentry-dbid-24243581-4d35-42a1-b9f0-b80525723bec")}catch{}})();const Ze=Ge.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as C}from"./liveblocks-DKL6viSK.js";import{a as V}from"./sentry-DFI2OQU
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,qe=re((function(t,u){const{businessVerificationDetails:n}=u,i=G(t),y=z.getSignedInUser(),S=i.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=Ae(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Ne(t.companyConfigState),s=we(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:y,navigate:S,location:l}=u,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:d,companyIndustryType:D,companyLegalName:O,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:r,primaryContactName:o,primaryContactUserId:c,primaryContactSyncToken:T,syncToken:f,fileIds:a,incDate:p,typeOfIncorporation:A,stateOfIncorporation:N,sourceOfFunds:w,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:Q,companySourceOfFundsDescription:Z,transactionVolume:q,transactionVolumeDescription:H,purposeOfAccount:J,purposeOfAccountDescription:K,regulatedStatus:W,regulatedStatusDescription:$,usNexus:X,usNexusTypes:Y}=e,_=D?.selectedOption,ee={companyId:n,companyDescription:s,companyIndustry:d.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:O,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:p!=null?j(p?.toString()):p,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:w?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map((v=>v.length===2?v:U(v)))??[],companySourceOfFunds:Q?.selectedOption??"",companySourceOfFundsDescription:Z,transactionVolume:q?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:K,regulatedStatus:W??"",regulatedStatusDescription:$,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:c,firstName:o.firstName,lastName:o.lastName,email:r,syncToken:T};t(L({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:e=>{const s=e.map((d=>{const{officerType:D,userId:O,name:g,email:m,nationalityCountryCode:I,ssn:r,dob:o,phone:c,syncToken:T,selectDocument:f,role:a,ownership:p,isSelectedForVerification:A,userVerificationStatus:N,treasuryUserVerificationStatus:w,fileIds:F}=d;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:D,userId:O,firstName:g.firstName,lastName:g.lastName,email:m,ssn:r,nationalityCountryCode:I?.selectedOption!=null?U(I.selectedOption):void 0,phone:c,birthday:o!=null?j(o?.toString()):o,syncToken:T,titleAtCompany:a.selectedOption,ownershipInCompany:p,documentTypeSelectedForVerification:h,isSelectedForVerification:A,userVerificationStatus:N,treasuryUserVerificationStatus:w,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(L({officers:s}))},onSaveDetailsClick:e=>{t(R(n,e,i))},onSendForVerificationClick:e=>{t(R(n,e,i,!0))},onAddressClick:e=>{const s=M(b,e),d=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:d}})},onRegisteredAddressClick:e=>{const s=M(b,e),d=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{t(Le({companyId:n})),S("../setup")},updateFilesEntity:e=>{t(je({files:e}))},onDeleteFile:e=>{t(Re(e))},onDeleteFileList:e=>{t(Ue(e))},onEditFileName:(e,s)=>{t(Pe(e,s.split(".")[0]))},onGetOtp:e=>{t(Be(e,"SpendManagementSetup"))},onResendOtp:e=>{t(ze(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(xe(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(Ee({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=_e(e.documentType);s!=null&&t(ve({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(Fe({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(le),tt=({productType:t})=>{const u=ae(),n=ne(),i=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:e}=oe(),s=ce(),{useDynamicConfig:d}=ue(),{configValue:D}=d(de.zeniAccountsConfig),O=fe(D),g=k((a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}})),m=k((a=>a.companyConfigState.fetchState)),I=k((a=>a.userRoleConfigState.fetchState)),r=k((a=>G(a))),o=r.companyId??z.getSignedInUserTenant(e)?.companyId;if(V.useEffect((()=>{m==="Not-Started"&&i(ye()),I==="Not-Started"&&i(Se(!0))}),[m,I,i]),V.useEffect((()=>{if(!y&&g==="Not-Started"&&o!=null)switch(S(!0),t){case"zeni_accounts":i(Te(o,!0));break;case"zeni_treasury":i(be(o,!0));break;case"reimbursement":i(he(o,!0));break;case"charge_cards":i(Ie(o,!0));break;default:i(ge(o,!0))}}),[y,g,o,i]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let c;switch(t){case"zeni_accounts":c=r.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":c=r.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":c=r.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||r.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":c=r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:c=r.companyBillPayInfo?.info?.isBillPayTOSAccepted}const T=a=>{b(a)},f=k((a=>{switch(t){case"zeni_accounts":return Ve(a,o);case"zeni_treasury":return ke(a,o);case"charge_cards":return Ce(a,o);case"reimbursement":return Oe(a,o);default:return De(a,o)}}));return c===!1?C.jsx(ie,{to:"../promo"}):C.jsxs(Ze,{children:[C.jsx(pe,{analytics:B,onLoad:a=>(p=>{switch(t){case"zeni_accounts":return p.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return p.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return p.trackPageLoaded(x.Event.billPayBusinessVerification,E(n)?"Settings":void 0)}})(a)}),E(n)?C.jsx(Qe,{isAppContentDrawerOpen:l,handleDrawerToggle:T}):null,C.jsx(qe,{businessVerificationDetails:f,navigate:u,location:n,companyId:o,analytics:B,currentTenant:r,productType:t,isSettings:E(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{T(!0)},maxInsuredAmount:O.maxInsuredAmount})]})};export{tt as B};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-P0DntAgT.js";import{a as l}from"./sentry-CfbcqWq3.js";import{u as pe,h as he,g as Ce,j as M,i as fe,n as Se}from"./core-Ct1Na3r4.js";import{Z as ge,de as be,z as ye,df as Pe,dh as z,di as Ie,ba as W,C as we,f as $,dj as H,dt as Ee,O as ke,h as Ae,a9 as Te,dm as xe,dn as Ue,a4 as _e,dr as Oe,b6 as ve,ds as Qe}from"./index-BBFNuY8-.js";import{gp as Fe,eY as G,eZ as $e,fs as De,iR as Le,iN as Ve,e_ as N,g9 as je,g1 as Re,g5 as B,ga as qe,gc as Me,gd as He,ge as Ne,gf as Be}from"./zeni-epic-state-x9uZgubN.js";import{D as ze,n as L,P as We,S as Ge}from"./mui-SSWNL1tt.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="221b025b-0d33-4c5e-9e01-ffe0a9d682c1",e._sentryDebugIdIdentifier="sentry-dbid-221b025b-0d33-4c5e-9e01-ffe0a9d682c1")}catch{}})();const Y="chat-response-generated",Z="cards/ask",X="card_policy_hero";function D(e){return`/${e}/cards`}function J(e){return`/${e}/cards/policy`}const Ye=Se((function(e,a){const o=G(e),c=a.isSubmitting,d=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:c,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...d}}),(function(e,a){const{location:o,currentTenant:c,userId:d,navigate:m,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,cardPolicyPageContext:U}=a,i=c.tenantEmailDomain,C=o.state?.referrer,p=C===X?J(i):D(i);return{onEventReceived:(n,t)=>{if(n===Y&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,f=Me(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);f!=="answer"?$.trackAICFOChatResponseGenerated(f,u?.question.questionText??"",s.text,b,Qe(P,y),s.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,He(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Ne({chatSessionId:s.metadata.chat_session_id,responseType:f,fetchState:{fetchState:"Completed",error:void 0}})),e(Be({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:d}))}},onSubmit:(n,t,s,f)=>{n&&ve(e,n,t,h,E,d,f,s,U)},updateCurrentInput:n=>{e(B(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(qe(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(p,{state:{...o.state}}),e(B(""))},togglePageView:()=>{m(p,{state:z(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{h!=null&&e(Re()),m((function(n){return`/${n}/${Z}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(je({questionAnswerId:n,isCollapsed:t}))},...Oe(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:x,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),m(D(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),m(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(Te(xe)),{spendManagement:{chargeCard:{cardsAiCfoHero:K,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),A=K.pageTitle,Ze=ee.pageTitle,Xe=K.chatHeaderSubtitle,Je=ee.chatHeaderSubtitle,St=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=ge(),o=pe(),c=he(),d=Ce(),[m,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect((()=>{o(Fe())}),[o]);const i=M((r=>G(r))),C=ye.getSignedInUser(),{session_id:p}=fe(),n=M((r=>$e(r))),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:f,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=d.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,I=y?.referrer===X,te=I?"card_policy":void 0,se=l.useMemo((()=>({title:I?Ze:A,subtitle:I?Je:Xe})),[I]),[ae,_]=l.useState(null),[oe,O]=l.useState(!1),v=l.useRef(!1);l.useEffect((()=>{v.current||u==null||u===""||(_(u),O(P),v.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),O(!1),c(d.pathname,{replace:!0,state:z(d.state)})}),[d.pathname,d.state,c]),ie=n.masterTOSInfo,S=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect((()=>{if(S&&k.current!=null){const{question:r,shouldSubmit:w}=k.current;k.current=null,_(r),O(w),v.current=!1}}),[S]);const{visitedSessions:V}=Ie(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,j=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),q=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(q,t),le=re.length===0;l.useEffect((()=>{t!=null&&p!==t&&c((function(r,w){return`/${r}/${Z}/${w}`})(s,t),{state:{...d.state},replace:!0})}),[t,p,s,c,d.state]),l.useEffect((()=>{p!=null&&t==null&&p!=="new_chat"&&o(De({sessionId:p,agentId:"controller"}))}),[]);const de=l.useMemo((()=>({events:V.map((r=>`private-encrypted-chat-${r}.${Y}`)),eventCallback:(r,w,me)=>me.onEventReceived(r,w)})),[V]);if(l.useEffect((()=>{Q!=="In-Progress"&&F&&o(Le())}),[Q,F,o]),l.useEffect((()=>{t!=null&&j!=="In-Progress"&&R&&C!=null&&Q==="Completed"&&!F&&o(Ve(t,C.userId))}),[j,R,t,C,o]),C==null)throw Error("Can't access Cards AI CFO page without signing in...");const ce=p??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return g.jsxs(et,{children:[g.jsx(we,{analytics:$,onLoad:r=>r.trackPageLoaded(Ae.Event.aiCFOPage)}),S?g.jsx(Ye,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:q,allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,openOnboardingPage:()=>h(!0),userId:C.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:A,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:f,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>{c(I?J(s):D(s),{state:{...d.state}})},onCompleteClick:()=>{S||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(N(n.userRoleId)))}}),g.jsx(ze,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:tt,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:g.jsx(Ke,{onClick:r=>r.stopPropagation(),children:g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>h(!1),onCompleteClick:()=>{S||n.userRoleId==null||o(N(n.userRoleId)),h(!1)}})})})]})},Ke=L(Ge)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,et=L.div`
|
|
6
|
+
flex: 1 1 auto;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
`,tt=L(We)`
|
|
12
|
+
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
|
+
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
+
`;export{St as default};
|