@zeniai/web-app-ui 5.0.91-dev → 5.0.92-delhi
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-CE6qbSGk.js +1 -0
- package/dist/assets/AddressScreen-DkNGrVnB.js +9 -0
- package/dist/assets/{AiCfoScreen-oHaKO3YZ.js → AiCfoScreen-CBgoj8T3.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes--JiwbSlw.js → BillPayApprovalRoutes-C1lNadBd.js} +1 -1
- package/dist/assets/{BillPayRoutes-iu-y_0bY.js → BillPayRoutes-XB7I7eUG.js} +28 -28
- package/dist/assets/{BusinessVerificationPageScreen-BZ6pMYtD.js → BusinessVerificationPageScreen--jb-_NEK.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-B8BvvLNn.js → ChargeCardRoutes-DOEHpyTj.js} +9 -9
- package/dist/assets/{CompanyPassportScreen-Crt0Wguw.js → CompanyPassportScreen-D7ikOuXi.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-DwfBvaYz.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CBQd1E02.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-C-eOXGDS.js → CustomerOnboardingRoutes-BWaOo9Cx.js} +4 -4
- package/dist/assets/{DashboardRoutes-TSlOHhjs.js → DashboardRoutes-dcyTNBEG.js} +3 -3
- package/dist/assets/{DefaultTenantHome-C_6PZH2v.js → DefaultTenantHome-Dhg7vrEu.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-Dgz3xvTR.js → DomesticWireDetailScreen-CWJhFUWD.js} +3 -3
- package/dist/assets/{DrawerScreen-DA7W7_FJ.js → DrawerScreen-si6Z3FY7.js} +1 -1
- package/dist/assets/EntityDetailRoutes-BWGTBran.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-Dx7-sEdk.js +25 -0
- package/dist/assets/{FeaturePreviewScreen-ZZAPjaff.js → FeaturePreviewScreen-RHOSmVgb.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-DOC4BX5c.js → HubSpotOAuthCallbackScreen-DX72NDGu.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-DvIXgxg3.js → MagicLinkRoutes-DhknIQ1P.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-Csd_nalm.js +12 -0
- package/dist/assets/{MobileAppDrawer-3z1V-CUc.js → MobileAppDrawer-L1vMrpyU.js} +1 -1
- package/dist/assets/NotFoundScreen-DNyI2qP0.js +1 -0
- package/dist/assets/{NotificationRoutes-Bo0zZ1Kt.js → NotificationRoutes-BebZvEZ8.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-Dbc4UpDH.js → OAuthConsentScreen-yciwdWjI.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-BUDeznHk.js +1 -0
- package/dist/assets/{PeopleRoutes-B92Pa5DO.js → PeopleRoutes-DRqZK4c2.js} +9 -9
- package/dist/assets/PerformanceRoutes-Cw2gpkuZ.js +1 -0
- package/dist/assets/{Preview-CHoySpAn.js → Preview-BcfL_4SY.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BVyeqZrM.js → QBOConnectionScreen-Diwd8goY.js} +1 -1
- package/dist/assets/{ReferralListScreen-Dos23hEe.js → ReferralListScreen-FRlmT8bW.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-DHAddbeN.js → ReimbursementApprovalRoutes-hbP66Q4T.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DBa6iD2W.js → ReimbursementApprovalRuleDetailScreen-r2EHynjx.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BmvzogVc.js → ReimbursementRoutes-CJ0Iu1Bq.js} +4 -4
- package/dist/assets/{ReportsRoutes-BxWR6xqe.js → ReportsRoutes-Cmgp5c3c.js} +1 -1
- package/dist/assets/RewardsRoutes-CoU5gCUm.js +1 -0
- package/dist/assets/ScreenRoutes-jHX_ty3K.js +2 -0
- package/dist/assets/{SettingsRoutes-jK4Q3qxF.js → SettingsRoutes-Bc8cfpu9.js} +3 -3
- package/dist/assets/{SetupPagesScreen-BqUpkFrc.js → SetupPagesScreen-_y1NMEC2.js} +5 -5
- package/dist/assets/SignInScreen-CynYCo01.js +1 -0
- package/dist/assets/SignOutScreen-Ce_OJMih.js +9 -0
- package/dist/assets/{TaskListScreen-BKqqal1w.js → TaskListScreen-BCZoyA5m.js} +2 -2
- package/dist/assets/{TaskRoutes-_u7Wmqyu.js → TaskRoutes-CY23LK4j.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-Cw9Uc-n0.js → TransactionDetailRoutes-CK2GDeKW.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-DIVwpSfj.js → TransactionDetailScreen-Cx-HHzFa.js} +2 -2
- package/dist/assets/TransactionListRoutes-BE9BuMAQ.js +1 -0
- package/dist/assets/{TreasuryRoutes-Ch-gY5t9.js → TreasuryRoutes-Bd287a7a.js} +5 -5
- package/dist/assets/{VendorsRoutes-Bx7Q80V-.js → VendorsRoutes-BrpUXe7d.js} +19 -19
- package/dist/assets/WiseConfirmationScreen-BOCW2491.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-OuhMj1ig.js → ZeniAccountRoutes-C8WqQUrk.js} +11 -11
- package/dist/assets/{ZeniAccountStatementScreen-Brn3KW0y.js → ZeniAccountStatementScreen-HdIES2jY.js} +1 -1
- package/dist/assets/{accountMappingHelper-DZZWkdNS.js → accountMappingHelper-DWvcSK1C.js} +1 -1
- package/dist/assets/{analytics-BpTmj6-G.js → analytics-DYzLSwIZ.js} +1 -1
- package/dist/assets/{analyticsHelper-B0HqRRKS.js → analyticsHelper-DXH2vTTa.js} +1 -1
- package/dist/assets/{core-lbYY5woS.js → core-BeBBWfga.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Bt7TpCfB.js → decodeURIComponentSafe-OtMMCMcE.js} +1 -1
- package/dist/assets/{dnd-BBkXCQMv.js → dnd-UF85x-t5.js} +1 -1
- package/dist/assets/{empty-BXlVh-7L.js → empty-BWGTDoK6.js} +1 -1
- package/dist/assets/{empty-DuvQh38L.js → empty-BaCT02t1.js} +1 -1
- package/dist/assets/{emptyVideoElement-DsiEcnQV.js → emptyVideoElement-BnRvKEhd.js} +1 -1
- package/dist/assets/epic-n0VtNHE8.js +2 -0
- package/dist/assets/getLocaleForTenant-BM3MG3N6.js +1 -0
- package/dist/assets/{index-D5mVmx24.js → index-BHdC4ErN.js} +1 -1
- package/dist/assets/{index-CmU3R7ot.js → index-BXVcb2Xp.js} +2 -2
- package/dist/assets/{index-YSIKqInC.js → index-CjNRshif.js} +1 -1
- package/dist/assets/{index-BnCtlDzJ.js → index-CvWmMArW.js} +1 -1
- package/dist/assets/{index-DBlyACY-.js → index-DS8xe4Yw.js} +1 -1
- package/dist/assets/{index-CsttCRun.js → index-MRloqTru.js} +12214 -12214
- package/dist/assets/{index-9bPjdOkz.js → index-_ohVjyws.js} +1 -1
- package/dist/assets/{index-wZ-HUxAq.js → index-u46W4WpS.js} +1 -1
- package/dist/assets/{lexical-BoKYrzBU.js → lexical-C_ylRY16.js} +1 -1
- package/dist/assets/{liveblocks-BEuWW_o5.js → liveblocks-BNlilBXq.js} +1 -1
- package/dist/assets/{lottie-DW3oQVJC.js → lottie-DbxhFPB1.js} +1 -1
- package/dist/assets/{mui-hUAh7HgW.js → mui-CnlqDSRv.js} +1 -1
- package/dist/assets/{pathToGoBack-BTgB24PY.js → pathToGoBack-CHG8tIif.js} +1 -1
- package/dist/assets/{pdf-D4eIZozg.js → pdf-Dp2xnkno.js} +4 -4
- package/dist/assets/{pdf-lib-CQ6bcQhi.js → pdf-lib-BEgmFXIU.js} +1 -1
- package/dist/assets/{plaid-DtmQg7la.js → plaid-CBNEU__p.js} +1 -1
- package/dist/assets/{pusher-BH0WSonH.js → pusher-C2HLHaTd.js} +1 -1
- package/dist/assets/{react-FJ8t_fEG.js → react-7oI-YZOA.js} +1 -1
- package/dist/assets/{react-uiz0Bf7s.js → react-CVgRRIOa.js} +1 -1
- package/dist/assets/{react-I3T6BtSv.js → react-PfdOvJhF.js} +1 -1
- package/dist/assets/{react-u3t1vzKM.js → react-QblHkUSH.js} +1 -1
- package/dist/assets/{react-DPfcpAvs.js → react-V6AXUc49.js} +1 -1
- package/dist/assets/{react-DHaugbA3.js → react-vkffk7Xs.js} +1 -1
- package/dist/assets/{recharts-aApoEySM.js → recharts-C5E4pGR4.js} +1 -1
- package/dist/assets/{routePaths-AncZCFgJ.js → routePaths-Dmzz0h9N.js} +1 -1
- package/dist/assets/{sentry-DsHW_1mX.js → sentry-CH2pQ4tM.js} +1 -1
- package/dist/assets/{url-CPbSl3Sf.js → url-BcTKj4a2.js} +1 -1
- package/dist/assets/{url-rO4wjCNo.js → url-CBu622rf.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BOZLDiKO.js → useAiCfoDashboardSuggestedQuestionsChips-CNrlO2ie.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DVBsWNa4.js +1 -0
- package/dist/assets/{useDeviceId-CUIt81hA.js → useDeviceId-W860NCQ9.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Ce_TAmYW.js → useInitialThreadRequest-DA9qj7yj.js} +1 -1
- package/dist/assets/{utils-AZPawxk4.js → utils-C2zbYn9G.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C9nI8iAG.js → withTransactionSidePanel-B7h02ghb.js} +2 -2
- package/dist/assets/zeni-epic-state-5fEaVO5b.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -3
- package/dist/assets/AddressRoutes-CfEBmv0d.js +0 -1
- package/dist/assets/AddressScreen-Dic8fdZj.js +0 -9
- package/dist/assets/ConnectionAuthScreen-CMvgcToC.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BWu3bg8J.js +0 -1
- package/dist/assets/EntityDetailRoutes-BC2rYBUq.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-BLnzE6sM.js +0 -25
- package/dist/assets/MagicLinkSignInScreen-Do3HpkUK.js +0 -12
- package/dist/assets/NotFoundScreen-CcPbqGwL.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CK7phZDt.js +0 -1
- package/dist/assets/PerformanceRoutes-zwUtk6Fa.js +0 -1
- package/dist/assets/RewardsRoutes-DfxqaoUk.js +0 -1
- package/dist/assets/ScreenRoutes-CJd27YIj.js +0 -2
- package/dist/assets/SignInScreen-DMKJW3-3.js +0 -1
- package/dist/assets/SignOutScreen-DcxoE-cS.js +0 -9
- package/dist/assets/TransactionListRoutes-DdeRCYAU.js +0 -1
- package/dist/assets/WiseConfirmationScreen-DRuEprOC.js +0 -12
- package/dist/assets/epic-CqNfoxZY.js +0 -2
- package/dist/assets/getLocaleForTenant-BJg8tROe.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-B6D1gPTU.js +0 -1
- package/dist/assets/zeni-epic-state-DsxPZxrE.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BNlilBXq.js";import{A as d}from"./AddressScreen-DkNGrVnB.js";import i from"./NotFoundScreen-DNyI2qP0.js";import"./sentry-CH2pQ4tM.js";import{o as s,p as r}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./index-MRloqTru.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}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 d}from"./liveblocks-BNlilBXq.js";import{a as h}from"./sentry-CH2pQ4tM.js";import{l as T,h as _,u as j,i as E,g as B,n as K}from"./core-BeBBWfga.js";import{K as M,m as $,z as D,d as L,B as R,v as z,f as C,h as S,_ as F,j as b,p as N}from"./index-MRloqTru.js";import{K8 as k,g_ as U,eQ as G,K9 as O,c2 as V,Ka as q,kj as H}from"./zeni-epic-state-5fEaVO5b.js";import{n as Q}from"./mui-CnlqDSRv.js";import J from"./NotFoundScreen-DNyI2qP0.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]="977f0672-ce37-4e0c-885e-68dac1365f2a",e._sentryDebugIdIdentifier="sentry-dbid-977f0672-ce37-4e0c-885e-68dac1365f2a")}catch{}})();const W=Q.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
|
+
`,X=K(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),r=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:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=N(r?.pathnameStackToGoBack);let s=n.poppedPathname??v();const u=r?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=Y(a);e(H({addressType:c,addressToCreate:r})),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)}}})(F);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=j(),{addressId:s,addressType:u}=E(),f=M(),w=$(),I=D.getSignedInUser(),[g,x]=h.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=L();if(I==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(()=>{g||s==null||(x(!0),r(U(s,!1)))},[g,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?d.jsx(R,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(z,{analytics:C,onLoad:P}),d.jsx(W,{windowSize:f,children:d.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(J,{})}const v=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=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{de as A,Y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-BNlilBXq.js";import{a as i}from"./sentry-CH2pQ4tM.js";import{h as ge,l as Ce,u as Ie,g as q,i as be,n as ke}from"./core-BeBBWfga.js";import{Q as we,cO as Pe,z as xe,K as Ee,cP as Qe,cQ as Te,cR as z,cS as ve,cT as Y,p as D,v as W,f as E,cU as H,cV as ye,a0 as _e,h as Oe,a6 as Ue,cW as Ae,a1 as Le,q as De,b0 as Fe,cX as Be}from"./index-MRloqTru.js";import{fI as je,f7 as Z,eQ as Re,hE as Me,QL as Ge,eP as Ve,hO as $e,hK as Ne,fy as K,fs as qe,fl as ze,fp as X,ft as We,fu as He,fv as Ke,fw as Xe,fx as Je}from"./zeni-epic-state-5fEaVO5b.js";import{D as Ye,n as b,S as Ze,P as et}from"./mui-CnlqDSRv.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-CNrlO2ie.js";import{p as st}from"./pathToGoBack-CHG8tIif.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="44e0a9f1-7773-4a11-8d43-36fbf55bea8e",o._sentryDebugIdIdentifier="sentry-dbid-44e0a9f1-7773-4a11-8d43-36fbf55bea8e")}catch{}})();const ee="chat-response-generated",ot=ke(function(o,n){const t=Z(o),m=n.isSubmitting;return{showSampleQuestions:n.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Le}/tableDownload`,emailLinkQuestion:n.emailLinkQuestion,autoSubmitEmailLinkQuestion:n.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:n.onEmailLinkQuestionProcessed,routedInitialQuestionSource:n.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:n.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:n.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:n.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:n.isFileUploadEnabled,isUploadPromoVisible:n.isUploadPromoVisible,onUploadPromoClose:n.onUploadPromoClose}},function(o,n){const{location:t,currentTenant:m,userId:r,navigate:g,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:c}=n;return{onEventReceived:(e,l)=>{if(e===ee&&typeof l.text=="string"&&typeof l.metadata=="object"){const u=l,p=He(u.type),d=u.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:k,currentQuestionAnswerSummary:Q}=Y(C,d);p!=="answer"?E.trackAICFOChatResponseGenerated(p,k?.question.questionText??"",u.text,d,Be(Q,s),u.metadata.message_id??null):E.trackAICFOChatAnswerGenerated(u.text,k?.question.questionText??"",(u.follow_up_questions?.length??0)>0,!!u.assumptions,!!u.insights,u.visualization!=null,Ke(u.visualization?.type??"")??null,d,u.summarized_title,u.metadata.message_id??null),o(Xe({chatSessionId:u.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),o(Je({chatSessionId:u.metadata.chat_session_id,answerPayload:u,userId:r}))}},onSubmit:(e,l,u,p)=>{e&&Fe(o,e,l,S,C,r,p,u)},updateCurrentInput:e=>{o(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{o(We(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{g(-1)},onCloseClick:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??st(1);g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),o(X(""))},togglePageView:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),c(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{g(-1)},onNewChatClick:()=>{S!=null&&o(ze());const e=De(t.state?.pathnameStackToGoBack,t.pathname);g(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,l)=>{o(qe({questionAnswerId:e,isCollapsed:l}))},onMenuClick:n.onMenuClick}})(Ue(Ae)),Et=({isFileUploadEnabled:o})=>{const{setIsAiCfoOpen:n}=we(),t=ge(),m=Ce(),r=Ie(),[g,S]=i.useState(!1);i.useEffect(()=>{t(je())},[t]);const{customPageTitle:C}=Pe(),c=q(a=>Z(a)),e=xe.getSignedInUser(),{session_id:l}=be(),u=Ee(),p=_e(u),d=q(a=>Re(a)),s=c.uiState.currentChatSessionId,k=d.tenantEmailDomain,{handleUploadPromoClose:Q,isUploadPromoVisible:te}=Qe({isFileUploadEnabled:o,tenantEmailDomain:k}),T=Te({currentTenant:d,currentChatSessionId:s,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=r.state,P=w?.aiCfoInitialQuestion,F=!!w?.aiCfoShouldSubmit;i.useEffect(()=>{const a=r.state;if(a?.[z]!==!0)return;S(!0);const h={...a};delete h[z],m(r,{replace:!0,state:h})},[r.pathname,r.search,r.state,m]);const[ae,v]=i.useState(null),[ne,y]=i.useState(!1),[ie,_]=i.useState(void 0),[re,O]=i.useState(void 0),B=i.useRef(!1);i.useEffect(()=>{if(!B.current&&P!=null&&P!==""){const a=r.state;v(P),y(F),_(a?.aiCfoInitialSubmissionSource!=null?a.aiCfoInitialSubmissionSource:void 0);const h=a?.aiCfoSuggestionIndex;O(typeof h=="number"?h:void 0),B.current=!0}},[P,F,r.state]);const le=i.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),j=i.useMemo(()=>new URLSearchParams(r.search),[r.search]),R=j.get("ref")??w?.aiCfoRef,U=j.get("emailRefId")??w?.aiCfoEmailRefId,M=i.useRef(!1);i.useEffect(()=>{M.current||R!=="month-end-email"||U==null||s!=null||e==null||(t(Me("controller",e.userId,U,"MONTH_END_EMAIL")),M.current=!0)},[R,U,s,t,e]);const x=c.uiState.lastContextMessage;i.useEffect(()=>{x!=null&&x!==""&&s!=null&&(v(x),y(!0),_(void 0),O(void 0),t(Ge()))},[x,s,t]);const ue=d.masterTOSInfo,I=ue?.isMasterTOSAccepted??!1,{visitedSessions:G}=ve(s),A=c.fetchState,L=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,V=s!=null?c.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",$=s==null||(c.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),N=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=Y(N,s),de=ce.length===0;i.useEffect(()=>{I||p||m("../dashboard",{state:{...r.state,message:"open_ai_cfo_drawer"}})},[I,p,m,r.state]);const me=i.useCallback(()=>{const a=D(r.state?.pathnameStackToGoBack),h=d.tenantEmailDomain;m(a.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...r.state,pathnameStackToGoBack:a.newStack}})},[d.tenantEmailDomain,r.state,m]);i.useEffect(()=>{s!=null&&l!==s&&m(`../ai-cfo/${s}`,{state:{...r.state}})},[s,l]),i.useEffect(()=>{l!=null&&s==null&&l!=="new_chat"&&l!=="explore"&&t(Ve({sessionId:l,agentId:"controller"}))},[]);const pe=i.useMemo(()=>({events:G.map(a=>`private-encrypted-chat-${a}.${ee}`),eventCallback:(a,h,Se)=>Se.onEventReceived(a,h)}),[G]);i.useEffect(()=>{A!=="In-Progress"&&L&&t($e())},[A,L,t]),i.useEffect(()=>{s!=null&&V!=="In-Progress"&&$&&e!=null&&A==="Completed"&&!L&&t(Ne(s,e.userId))},[V,$,s,e,t]);const fe=a=>a.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||l==null)throw Error("Can't access AI Controller page without signing in...");const he=s!=null&&c.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return!I&&p?f.jsxs(nt,{children:[f.jsx(W,{analytics:E,onLoad:fe}),T.drawerElement,f.jsx(it,{children:f.jsx(J,{children:f.jsx(H,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:me,onCompleteClick:()=>{d.userRoleId!=null&&t(K(d.userRoleId))}})})})]}):f.jsxs(at,{children:[f.jsx(W,{analytics:E,onLoad:a=>a.trackPageLoaded(Oe.Event.aiCFOPage)}),p&&T.drawerElement,f.jsx(ot,{...pe,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>S(!0),userId:e.userId,setIsAiCfoOpen:n,navigate:m,sessionFromUrl:l,location:r,isSubmitting:he,isEmptyChatWithSession:de,customPageTitle:C,currentTenant:d,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:p?T.open:void 0,isFileUploadEnabled:o,isUploadPromoVisible:te,onUploadPromoClose:Q,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),f.jsx(Ye,{anchor:"right",open:g,transitionDuration:250,PaperProps:{component:rt,style:{width:p?"100%":`${ye}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:f.jsx(J,{onClick:a=>a.stopPropagation(),children:f.jsx(H,{isTOSAccepted:I,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>S(!1),onCompleteClick:()=>{I||d.userRoleId==null||t(K(d.userRoleId)),S(!1)}})})})]})},J=b(Ze)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-BNlilBXq.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{l as B,u as U,h as T,g as v,N,n as j,i as $,o as O,p as h}from"./core-BeBBWfga.js";import{eQ as L,Nr as R,N7 as b,xR as x,xL as F,xP as I,xE as W,N9 as q,xH as z,xT as H,xS as D}from"./zeni-epic-state-5fEaVO5b.js";import{m as P,z as k,B as V,a6 as Q,bD as G,af as _,bE as J}from"./index-MRloqTru.js";import"./mui-CnlqDSRv.js";import{i as K}from"./ReimbursementApprovalRuleDetailScreen-r2EHynjx.js";import M from"./NotFoundScreen-DNyI2qP0.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]="a2107945-fc7d-49b8-85a1-35e50dd0b61f",e._sentryDebugIdIdentifier="sentry-dbid-a2107945-fc7d-49b8-85a1-35e50dd0b61f")}catch{}})();const w="bill-approval-rule-update",X=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(Q(G)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!K(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(D(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(D(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(J);function C(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(C,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(C,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as ae,g as v,N as te,n as X,k as na,o as ia,p as S}from"./core-lbYY5woS.js";import{eQ as Z,MJ as Ne,bv as It,HD as oa,bo as wt,bF as pe,MK as Ct,x9 as xt,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as Bt,MO as At,MP as Et,yU as _e,xo as Be,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as Me,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as Ca,N3 as xa,eY as Vt,eW as $t,N4 as ze,N5 as Ba,N6 as Aa,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Na,cl as Lt,cN as Ut,jO as _a,bL as Ma,bq as Nt,bM as _t,wf as Ga,Nh as Oa,BT as za,BZ as Za,sK as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as Mt,kt as Qa,jV as Gt,ke as Ot,kd as it,bE as be,bK as Ja,Nk as Xa,Nl as ve,iy as Ya,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qa as kn,kb as vn,z5 as In,iI as wn,kA as Cn,Nt as xn,iA as Bn,q1 as An,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-DsxPZxrE.js";import{m as me,z as V,I as Ie,_ as We,C as le,j as y,aN as Ae,B as re,o as A,R as je,c as D,ba as Ln,p as z,a1 as qe,n as E,K as we,bb as rt,bc as ct,bd as Un,ak as Nn,y as _n,aH as Mn,w as Zt,D as Ke,Q as Qe,be as Gn,at as Ht,bf as On,V as zn,e as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Qn,bl as Jn,bm as Xn,bn as Yn,bo as ei,s as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-CsttCRun.js";import{n as U,S as si}from"./mui-hUAh7HgW.js";import{A as dt}from"./AddressScreen-Dic8fdZj.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-Dgz3xvTR.js";import{a as f}from"./sentry-DsHW_1mX.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-B6D1gPTU.js";import{u as Kt}from"./useInitialThreadRequest-Ce_TAmYW.js";import Ee from"./NotFoundScreen-CcPbqGwL.js";import{D as ui}from"./DrawerScreen-DA7W7_FJ.js";import{M as Qt}from"./MobileAppDrawer-3z1V-CUc.js";import{F as Jt}from"./FeaturePreviewScreen-ZZAPjaff.js";import{S as Pe}from"./SetupPagesScreen-BqUpkFrc.js";import{B as pi}from"./BillPayApprovalRoutes--JiwbSlw.js";import{FallBackRoute as mi}from"./ScreenRoutes-CJd27YIj.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./analyticsHelper-B0HqRRKS.js";import"./routePaths-AncZCFgJ.js";import"./BusinessVerificationPageScreen-BZ6pMYtD.js";import"./ReimbursementApprovalRuleDetailScreen-DBa6iD2W.js";import"./getLocaleForTenant-BJg8tROe.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]="040711a9-1c8c-4ac6-b3d3-3b714d483e6c",e._sentryDebugIdIdentifier="sentry-dbid-040711a9-1c8c-4ac6-b3d3-3b714d483e6c")}catch{}})();const bi=X(function(e,t){const l=Ne(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.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 n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Bt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;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(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({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(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{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(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Ln);function hi(){const e=Q(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Ne(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,C]=f.useState(!1),[x,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:N}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=N(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(Ct(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(xt(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t($e(!1,$,L,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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 ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:x,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},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:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=Q(),{billId:i}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),C=v(F=>Z(F)),[x,_]=f.useState(!1),[T,N]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,L=B.showAutofill;const K=v(F=>Ne(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const Y=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?N(!1):!u&&x&&_(!1))},[i]),f.useEffect(()=>{x||i==null||u||(_(!0),t(xt(i,h,j,!1)),T||(N(!0),t($e(!1,h,j,b,i)))),u&&!T&&(N(!0),t($e(!1,h,j,b,i)))},[x,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(C.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{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:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Nn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:L,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-BNlilBXq.js";import{l as J,h as se,u as Q,i as ae,g as v,N as te,n as Y,k as na,o as ia,p as S}from"./core-BeBBWfga.js";import{eQ as Z,MJ as Me,bv as It,HD as oa,bo as wt,bF as pe,MK as xt,x9 as Ct,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as At,MO as Bt,MP as Et,yU as Ne,xo as Ae,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as _e,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as xa,N3 as Ca,eY as Vt,eW as $t,N4 as ze,N5 as Aa,N6 as Ba,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Ma,cl as Lt,cN as Ut,jO as Na,bL as _a,bq as Mt,bM as Nt,wf as Ga,Nh as Oa,BT as za,BZ as Za,sM as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as _t,kt as Ja,jV as Gt,ke as Ot,kd as it,bE as be,bK as Qa,Nk as Ya,Nl as ve,iy as Xa,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qc as kn,kb as vn,z5 as In,iI as wn,kA as xn,Nt as Cn,iA as An,q3 as Bn,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-5fEaVO5b.js";import{m as me,z as V,d as Ie,Z as We,a as le,I as y,aN as Be,B as re,o as B,v as je,f as D,ba as Ln,p as z,a1 as qe,q as E,K as we,bb as rt,bc as ct,bd as Un,ak as Mn,y as Nn,aH as _n,w as Zt,O as Ke,Y as Je,be as Gn,at as Ht,bf as On,V as zn,h as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Jn,bl as Qn,bm as Yn,bn as Xn,bo as ei,R as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-MRloqTru.js";import{n as U,S as si}from"./mui-CnlqDSRv.js";import{A as dt}from"./AddressScreen-DkNGrVnB.js";import{g as ie,a as Te,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CWJhFUWD.js";import{a as f}from"./sentry-CH2pQ4tM.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DVBsWNa4.js";import{u as Kt}from"./useInitialThreadRequest-DA9qj7yj.js";import Ee from"./NotFoundScreen-DNyI2qP0.js";import{D as ui}from"./DrawerScreen-si6Z3FY7.js";import{M as Jt}from"./MobileAppDrawer-L1vMrpyU.js";import{F as Qt}from"./FeaturePreviewScreen-RHOSmVgb.js";import{S as Pe}from"./SetupPagesScreen-_y1NMEC2.js";import{B as pi}from"./BillPayApprovalRoutes-C1lNadBd.js";import{FallBackRoute as mi}from"./ScreenRoutes-jHX_ty3K.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./analyticsHelper-DXH2vTTa.js";import"./routePaths-Dmzz0h9N.js";import"./BusinessVerificationPageScreen--jb-_NEK.js";import"./ReimbursementApprovalRuleDetailScreen-r2EHynjx.js";import"./getLocaleForTenant-BM3MG3N6.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]="b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0",e._sentryDebugIdIdentifier="sentry-dbid-b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0")}catch{}})();const bi=Y(function(e,t){const l=Me(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.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 n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;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(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({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 n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{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(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Ne(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Ln);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Me(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[C,N]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:_}=M(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=_.user_ids!=null&&r?.userId!=null&&_.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?N(!1):N(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,L,X,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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 ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(_n);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,N]=f.useState(!1),[T,M]=f.useState(!1),[$,I]=f.useState(!1),[H,_]=f.useState(),A=v(F=>_e(F,m,g,i));let q=A.fetchState,W=A.file,L=A.showAutofill;const K=v(F=>Me(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const X=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&C&&N(!1))},[i]),f.useEffect(()=>{C||i==null||u||(N(!0),t(Ct(i,h,j,!1)),T||(M(!0),t($e(!1,h,j,b,i)))),u&&!T&&(M(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:_,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{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:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Mn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:L,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:_,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
5
|
-
margin-left: ${
|
|
5
|
+
margin-left: ${B.sp5};
|
|
6
6
|
position: absolute;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
@@ -11,15 +11,15 @@ import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as a
|
|
|
11
11
|
justify-content: center;
|
|
12
12
|
align-items: center;
|
|
13
13
|
padding-top: 9px;
|
|
14
|
-
gap: ${
|
|
15
|
-
margin-bottom: -${
|
|
16
|
-
`,vi=U(
|
|
14
|
+
gap: ${B.sp2};
|
|
15
|
+
margin-bottom: -${B.sp2};
|
|
16
|
+
`,vi=U(Je.StandardMedium)``,Ii=U(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
|
-
height: ${
|
|
19
|
-
width: ${
|
|
20
|
-
`,
|
|
21
|
-
width: ${
|
|
22
|
-
height: ${
|
|
18
|
+
height: ${B.sp3};
|
|
19
|
+
width: ${B.sp3};
|
|
20
|
+
`,Yt=U(e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
21
|
+
width: ${B.sp3};
|
|
22
|
+
height: ${B.sp3};
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
color: ${e=>e.theme.colors.champion};
|
|
25
25
|
&:hover {
|
|
@@ -57,27 +57,27 @@ import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as a
|
|
|
57
57
|
left: 0;
|
|
58
58
|
right: 0;
|
|
59
59
|
bottom: 0;
|
|
60
|
-
background-color: ${
|
|
60
|
+
background-color: ${Nn.overlayBackgroundBlack};
|
|
61
61
|
z-index: 5;
|
|
62
62
|
`,Ve=U.div`
|
|
63
63
|
display: flex;
|
|
64
64
|
flex-direction: column;
|
|
65
65
|
width: ${e=>`${gi.containerWidth.value(e.windowSize)}%`};
|
|
66
66
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
|
-
`,wi=U(
|
|
68
|
-
margin-top: ${
|
|
69
|
-
padding-left: ${
|
|
70
|
-
padding-right: ${
|
|
67
|
+
`,wi=U(Je.H6Regular)`
|
|
68
|
+
margin-top: ${B.sp7};
|
|
69
|
+
padding-left: ${B.sp8};
|
|
70
|
+
padding-right: ${B.sp8};
|
|
71
71
|
color: ${e=>e.theme.colors.primary};
|
|
72
72
|
word-break: break-word;
|
|
73
|
-
`,
|
|
73
|
+
`,xi=U(Je.LargeRegularSp)`
|
|
74
74
|
color: ${e=>e.theme.colors.hero};
|
|
75
|
-
padding-left: ${
|
|
76
|
-
padding-right: ${
|
|
75
|
+
padding-left: ${B.sp8};
|
|
76
|
+
padding-right: ${B.sp8};
|
|
77
77
|
margin-bottom: 30px;
|
|
78
|
-
margin-top: ${
|
|
78
|
+
margin-top: ${B.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,
|
|
80
|
+
`,Ci=Y(function(e,t){return{billsReviewView:jt(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(ka(l))},onProceedForBulkActionClick:(l,i)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(at("approved",i??""));break;case"reject":e(at("rejected",i??""))}}}})(On);function Ai(){const e=J(),t=v(i=>i.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=v(i=>jt(i));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Ci,{navigate:e,analytics:D})}const ne=Ba(),Xt="bulk-operation-update",Ue="bill-approval-rule-update",{spendManagement:Bi,common:bt}=Ke.getLocalizedStrings(),ht=Bi.billPay.bulkActions,Ei=U.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as a
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Di=
|
|
88
|
+
`,Di=Y(function(e,t){const l=V.getSignedInUser(),i=De(l),c=Ft(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,n=Z(e),d=n?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Ea(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:i,billPayApprovalRulesAffectedEntityIds:g.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:i,location:c,period:r}=t,{tenantEmailDomain:u}=i;return{updateTabToState:o=>{e(ue()),e(Tt(o))},onSubtabChange:o=>{e(ue()),e(Pt(o))},onTransactionClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(n,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ti(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`,n=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:n}})},onSearchTextChanged:o=>{e(La(o))},onReloadTransactions:()=>{e(Le(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e($a(i.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Va({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(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Pa(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(Ta()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ue)&&e(ja(!1))},onEventReceived:o=>{o===Xt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}})(Zn(Hn));function ji(){const e=J(),t=se(),l=Q(),i=we(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,n]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(c?.tab!=null&&c?.subTab!=null&&(t(Tt(c?.tab)),t(Pt(c?.subTab))),()=>{t(ue())}),[]);const p=V.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:h}=zn(),[g,b]=f.useState(!1),{useFeatureGate:k}=le(),{isFeatureEnabled:j}=k(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:x}=k(y.isBillPayCommentingEnabled),{isFeatureEnabled:C}=k(y.isReimbursementCommentingEnabled),{isFeatureEnabled:N}=k(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:T}=k(y.isBillPayBulkActionEnabled),{isFeatureEnabled:M}=k(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=k(y.isBillPayDetectInsufficientFundsEnabled),I=v(P=>Ft(P,ne,T,p?.userId)),{isFeatureEnabled:H}=k(y.isDebitCardFeatureEnabled),_=I.fetchState,{isAiCfoAccessEnabled:A,onAskAiCfoClick:q}=Xe({mobileExploreReferrer:"Bills List"});We({isDataReady:_==="Completed"});const W=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,L=!!m.companyBillPayInfo?.info?.isBillPayEnabled,K=v(P=>va(P.companyState,m.companyId)),X=K?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!g&&L&&h&&(b(!0),t(Le(ne,!0,j,M)))},[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const G=(P,de)=>{t(Aa({uiState:{sortKey:P,sortOrder:de},period:ne}))},ee=Rt(r?.loggedInUserRoleMap),F=pe(r?.loggedInUserRoleMap),ce=P=>{o(P)},{billsProcessed:O,billsProcessing:xe}=v(P=>Ia(P));f.useEffect(()=>{O===xe&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:O>1?ht.bills:ht.bill},{variableName:"_has_",variableValue:O>1?bt.texts.have:bt.texts.has},{variableName:"_action_",variableValue:xa(s)}]})),t(Ca()),setTimeout(()=>{t(Le(ne,!0,j,!0,M))},3e3),n(null))},[O,xe]);const ea={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Xt}`,`private-encrypted-${m.companyId}.${Ue}`]:[],eventCallback:(P,de,et)=>{P.endsWith(Ue)?et.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(n(de.operation_type),et.onEventReceived(P))}},ta=Vt(H,m),aa=$t(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Qt,{}):L?a.jsxs(a.Fragment,{children:[_==="Completed"?a.jsx(je,{analytics:D,onLoad:P=>(de=>de.trackPageLoaded(Wt.Event.billPayHome))(P)}):null,a.jsxs(Ei,{windowSize:i,children:[a.jsx(Jt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Pi,{onClick:P=>P.stopPropagation(),children:a.jsx(Ai,{})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:x,isReimbursementCommentingEnabled:C,period:ne,isAdmin:!1,uiState:I.uiState,onColumnSortConfigChanged:G,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:j,isShowDeletedReimbursementEnabled:N,isBulkActionEnabled:T,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:X,bulkSubmissionLimit:I.billBulkSubmissionLimit,bulkSubmissionFetchState:I.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:I.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:M,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:A,onAskAiCfoClick:q,...ea})]})]}):W===!0&&F===!0?a.jsx(te,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:_}):a.jsx(Ee,{})}const Ti=e=>`/${e}/bills/setup`,Pi=U(si)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=Ke.getLocalizedStrings(),Vi=X(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},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 n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ma(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Nt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!_t(p,t.billDetailsView.approvalRules.allApprovalRules,l),C=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Bt(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:C.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Gt(d,!1)),e(Ot({localData:{vendorName:n??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:n=>{n!=null&&e(Oe(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Ge(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=Ni(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Qa({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Mt("draft"))},reviewBillDetails:()=>{const n=$i(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ka()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="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:n=>{e(fe(!1,n));const d=Li(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Ui(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Qn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,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:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Ga("bill_pay","bill_pay_detail")),e(Oa({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=Q(),t=J(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:C}=u(Ae.zeniAccountsConfig),x=Ua(C),{configValue:_}=u(Ae.sameDayAchDisablementConfig),T=Na(_),N=V.getSignedInUser(),$=v(O=>Z(O)),I=v(O=>Me(O,m,g,i)),H=Kt($?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:M,onAskAiCfoClick:B}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:I.fetchState==="Completed"});const q=$.companyId??V.getSignedInUserTenant(c)?.companyId,W=!!$.companyZeniAccountInfo?.info?.isZeniAccountEnabled,L=Ie(),K=Lt(L?.loggedInUserRoleMap),Y=Ut(L?.loggedInUserRoleMap),G=pe(L?.loggedInUserRoleMap),ee=wt($.userRole);if(f.useEffect(()=>{i!=null&&l(Ct(i))},[i]),N==null)throw Error("Can't access address page without signing in...");const F=v(O=>_a(O.accountState,O.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(Ce=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&Ce.trackBillPayEditBill(i,I.isRecurring)})(O)}),a.jsx(Vi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:$,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:K,isZeniAccountsUser:Y,isBillPayAdmin:G,isSuperAdmin:ee,accountsPromoConfig:x,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:M,onAskAiCfoClick:B})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},$i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},Li=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Ui=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",Ni=(e,t,l,i,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Nt(),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[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Ja)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Xa(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},h=_i(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,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:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},_i=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=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:n,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},Mi=U.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=Ke.getLocalizedStrings(),Vi=Y(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},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 n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=_a(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Mt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Nt(p,t.billDetailsView.approvalRules.allApprovalRules,l),x=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:At(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:x.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Gt(d,!1)),e(Ot({localData:{vendorName:n??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:n=>{n!=null&&e(Oe(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Ge(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=Mi(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ja({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(Ne("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(_t("draft"))},reviewBillDetails:()=>{const n=$i(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ka()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="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:n=>{e(fe(!1,n));const d=Li(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Ui(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Jn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,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:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Ga("bill_pay","bill_pay_detail")),e(Oa({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=J(),t=Q(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:x}=u(Be.zeniAccountsConfig),C=Ua(x),{configValue:N}=u(Be.sameDayAchDisablementConfig),T=Ma(N),M=V.getSignedInUser(),$=v(O=>Z(O)),I=v(O=>_e(O,m,g,i)),H=Kt($?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:_,onAskAiCfoClick:A}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:I.fetchState==="Completed"});const q=$.companyId??V.getSignedInUserTenant(c)?.companyId,W=!!$.companyZeniAccountInfo?.info?.isZeniAccountEnabled,L=Ie(),K=Lt(L?.loggedInUserRoleMap),X=Ut(L?.loggedInUserRoleMap),G=pe(L?.loggedInUserRoleMap),ee=wt($.userRole);if(f.useEffect(()=>{i!=null&&l(xt(i))},[i]),M==null)throw Error("Can't access address page without signing in...");const F=v(O=>Na(O.accountState,O.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(xe=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&xe.trackBillPayEditBill(i,I.isRecurring)})(O)}),a.jsx(Vi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:$,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:K,isZeniAccountsUser:X,isBillPayAdmin:G,isSuperAdmin:ee,accountsPromoConfig:C,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:_,onAskAiCfoClick:A})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},$i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},Li=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Ui=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",Mi=(e,t,l,i,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Mt(),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[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Qa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ya(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},h=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,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:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Ni=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=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:n,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},_i=U.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -97,8 +97,8 @@ import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as a
|
|
|
97
97
|
flex-direction: column;
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
|
-
box-shadow: ${e=>`0px 2px ${
|
|
101
|
-
`,Gi=
|
|
100
|
+
box-shadow: ${e=>`0px 2px ${B.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
+
`,Gi=Y(function(e,t){const{vendorId:l,billId:i}=t,c=ve(e,l),r=_e(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,i);return{billId:i,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(an(s))},onSaveHandler:()=>{e(tn(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:n}=s;e(en({data:n}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??St();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const n=Ye(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Xa({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??St(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}})(Qn);function Oi(){const e=J(),t=Q(),l=we(),{vendorId:i,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=V.getSignedInUser(),s=v(g=>Z(g)),n=z(t.state?.pathnameStackToGoBack),d=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v(g=>ve(g,i)),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.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 ${B.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(_i,{windowSize:l,children:[a.jsx(Qe,{vendorId:i,billId:c}),a.jsx(Gi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=U.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -106,8 +106,8 @@ import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as a
|
|
|
106
106
|
flex-direction: column;
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
|
-
box-shadow: ${e=>`0px 2px ${
|
|
110
|
-
`,Zi=
|
|
109
|
+
box-shadow: ${e=>`0px 2px ${B.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
+
`,Zi=Y(function(e,t){const{vendorId:l}=t,i=ve(e,l),c=l!=null?i.editVendorState?.vendorDetailLocalData?.vendorType:i.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",t.billId),u=i.editVendorState??i.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[ln(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:i,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:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,n,d,p)=>{e(cn(s)),p&&e(dn(n,d))},onCurrencyUpdated:(s,n,d)=>{e(rn(s,n,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??ft();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const n=Ye(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??ft(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}})(Yn);function Hi(){const e=J(),t=Q(),l=we(),{vendorId:i,billId:c}=ae(),r=se(),u=me(),o=V.getSignedInUser(),s=v(C=>Z(C)),n=z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=v(C=>C.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(C=>i!=null?C.vendorViewState.editVendorStateById[i]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),g=i!==void 0?h:m;f.useEffect(()=>{d===!1&&g==="Not-Started"&&i!=null&&(r(fe(!1,i)),p(!0))},[d,g,i]);const[b,k]=f.useState(!1);f.useEffect(()=>{b||g==="In-Progress"||(k(!0),r(nn(c,i)))},[b,g,r]);const j=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",x=v(C=>ve(C,i));if(o==null)throw Error("Can't access international wire page without signing in...");return j==="billDetail"&&x.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:x.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${B.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Qe,{vendorId:i,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:j})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},kt=U.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -115,5 +115,5 @@ import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as a
|
|
|
115
115
|
flex-direction: column;
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
|
-
box-shadow: ${e=>`0px 2px ${
|
|
119
|
-
`,Wi=X(function(e,t){const l=V.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!_t(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,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(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(_e(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(At({billId:i}))},updateBillDetailSaveBillCode:()=>{e(Mt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ei);function vt(){const e=Q(),t=se(),l=J(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=V.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(C=>Z(C)),k=v(C=>zt(C,i)),j=k.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(`../${i}`)},[]),f.useEffect(()=>{const C=k.vendor?.name,x=k.vendor?.id,_=k.totalAmount.amount,T=k.recipientTotalAmount.amount,N=k.invoiceNumber;C&&x&&t(pn(C,x,_,T,N,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Yn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=X(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=V.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(Bn(u??void 0,t.billId)),n!=null&&e(An(n))},saveVendorDetailLocalData:n=>{e(Ot({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(xn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(Cn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Xe(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Gt(n,!1))}}})(ii),xe=()=>{const e=Q(),t=se(),l=ti(),i=J(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(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(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{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:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ki=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(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:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Qi=()=>{const e=Q(),t=J(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??V.getSignedInUserTenant(l)?.companyId,s=V.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.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||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Qt,{isAppContentDrawerOpen:i,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 Do(){const e=v(M=>Z(M)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Oi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Vt(o,e),n=$t(e),d=J(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&Lt(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),C=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),x=Pn(t?.loggedInUserRoleMap),_=Ut(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),N=Rn(t?.loggedInUserRoleMap),$=Vn(t?.loggedInUserRoleMap),I=$n(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:x,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:x,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Qi,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:_,isUserHasChargeCardAccess:N,isUserHasBillPayAccess:$,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:C,isUserHasOnlyCardAccess:x,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Jt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{Do as default};
|
|
118
|
+
box-shadow: ${e=>`0px 2px ${B.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
+
`,Wi=Y(function(e,t){const l=V.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,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(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(Ne(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:i}))},updateBillDetailSaveBillCode:()=>{e(_t("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ae(t.billId,"retry"))}}})(ei);function vt(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=V.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(x=>Z(x)),k=v(x=>zt(x,i)),j=k.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(`../${i}`)},[]),f.useEffect(()=>{const x=k.vendor?.name,C=k.vendor?.id,N=k.totalAmount.amount,T=k.recipientTotalAmount.amount,M=k.invoiceNumber;x&&C&&t(pn(x,C,N,T,M,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Xn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=Y(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=V.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(An(u??void 0,t.billId)),n!=null&&e(Bn(n))},saveVendorDetailLocalData:n=>{e(Ot({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(Cn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(xn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Ye(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Gt(n,!1))}}})(ii),Ce=()=>{const e=J(),t=se(),l=ti(),i=Q(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(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(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Qe,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ki=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(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:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Ji=()=>{const e=J(),t=Q(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??V.getSignedInUserTenant(l)?.companyId,s=V.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.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||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Jt,{isAppContentDrawerOpen:i,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 Do(){const e=v(_=>Z(_)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Oi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Vt(o,e),n=$t(e),d=Q(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&Lt(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),x=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),C=Pn(t?.loggedInUserRoleMap),N=Ut(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),M=Rn(t?.loggedInUserRoleMap),$=Vn(t?.loggedInUserRoleMap),I=$n(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:C,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:C,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ji,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:N,isUserHasChargeCardAccess:M,isUserHasBillPayAccess:$,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:C,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Qt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${B.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{Do as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-BNlilBXq.js";import{a as N}from"./sentry-CH2pQ4tM.js";import{l as ae,u as ne,h as se,i as ie,g as C,N as oe,n as re}from"./core-BeBBWfga.js";import{d as ce,a as ue,aN as de,z,v as pe,f as B,af as E,h as x,bz as le,at as me,q as P,au as R}from"./index-MRloqTru.js";import{Nf as fe,eQ as q,sb as ye,HH as Se,xW as ge,AD as Ie,Da as he,DP as be,EI as De,NC as Oe,ND as Te,NE as ke,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as ve,fD as Fe,fC as Ee,qc as xe,q3 as ze,q0 as Be,kb as Pe,sk as Re,si as M,bE as L,sw as U,cv as Me}from"./zeni-epic-state-5fEaVO5b.js";import{n as Le}from"./mui-CnlqDSRv.js";import{d as j}from"./routePaths-Dmzz0h9N.js";import{M as Ue}from"./MobileAppDrawer-L1vMrpyU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="d6d8c367-3065-48b5-8797-6297c50a5a98",e._sentryDebugIdIdentifier="sentry-dbid-d6d8c367-3065-48b5-8797-6297c50a5a98")}catch{}})();const je=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-BEuWW_o5.js";import{a as N}from"./sentry-DsHW_1m
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,qe=re(function(e,d){const{businessVerificationDetails:i}=d,r=q(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=Ve(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=we(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:V,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:G,companySourceOfFundsDescription:H,transactionVolume:K,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:$,regulatedStatus:Q,regulatedStatusDescription:J,usNexus:X,usNexusTypes:Y}=t,v=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:V?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(F=>F.length===2?F:R(F))??[],companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:$,regulatedStatus:Q??"",regulatedStatusDescription:J,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_}=p;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:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(M(i,t,r))},onSendForVerificationClick:t=>{e(M(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(xe(t,s.split(".")[0]))},onGetOtp:t=>{e(Ee(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(ve(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=N.useState(!1),[l,b]=N.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){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=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>q(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(N.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),N.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ne(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(je,{children:[k.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(x.Event.billPayBusinessVerification,E(i)?"Settings":void 0)}})(a)}),E(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(qe,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:E(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
|