@zeniai/web-app-ui 5.2.13-qa → 5.2.14-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-C5ICjwhT.js +1 -0
- package/dist/assets/AddressScreen-DqXE5RDJ.js +9 -0
- package/dist/assets/{AiCfoScreen-D4NgYwUZ.js → AiCfoScreen-Bq9qNM-U.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DLlsLPac.js → BillPayApprovalRoutes-Cgsqt2XF.js} +1 -1
- package/dist/assets/{BillPayRoutes-ChrQ1pAZ.js → BillPayRoutes-D8ICOArG.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BGwTSYvf.js → BusinessVerificationPageScreen-DlMhX3L_.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-DFBwVCAL.js → CardsAiCfoScreen-evFd6UUn.js} +3 -3
- package/dist/assets/{ChargeCardRoutes-BPIoTFc8.js → ChargeCardRoutes-czvHDNab.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-uugzo1WU.js → CompanyPassportScreen-CzLA5zCy.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-5nIimMuJ.js → ConnectionAuthScreen-VR4MFOhW.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B7Anpyxh.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BH_QwFxA.js → CustomerOnboardingRoutes-CeoeigLq.js} +4 -4
- package/dist/assets/{DashboardRoutes-DevVcpsc.js → DashboardRoutes-522JIWbO.js} +1 -1
- package/dist/assets/{DefaultTenantHome-kfraLn2O.js → DefaultTenantHome-CBA28Llo.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-D-A33-aQ.js → DomesticWireDetailScreen-C-1bKP7r.js} +3 -3
- package/dist/assets/{DrawerScreen-CaJ0qHuQ.js → DrawerScreen-DAMt3OKh.js} +1 -1
- package/dist/assets/EntityDetailRoutes-CGG59Jmf.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-BeNa4w-O.js → ExpenseAutomationRoutes-DcYqfqSi.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-IYXzvJjG.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-DuB_-O5h.js → HubSpotOAuthCallbackScreen-LTrYsA2J.js} +1 -1
- package/dist/assets/MagicLinkRoutes-DzdDjge4.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CC54CnuQ.js +12 -0
- package/dist/assets/MobileAppDrawer-7KFASJmR.js +1 -0
- package/dist/assets/NotFoundScreen-1FWTFg5q.js +1 -0
- package/dist/assets/{NotificationRoutes-B4vYlLWS.js → NotificationRoutes-CLLE6idd.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-DNdUxTN0.js → OAuthConsentScreen-D4soKi0X.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-Dvmv9t_a.js → PandLWithForecastRoutes-CLOwX80d.js} +1 -1
- package/dist/assets/PeopleRoutes-RKPAQcdN.js +22 -0
- package/dist/assets/PerformanceRoutes-BL-ag8V3.js +1 -0
- package/dist/assets/{Preview-Mf-iNnbX.js → Preview-Crb4CpIB.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DhWWlIqn.js → QBOConnectionScreen-Doubr8Lv.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-YqkT81e-.js → ReimbursementApprovalRoutes-CuXrRY6O.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CgQrnfRD.js → ReimbursementApprovalRuleDetailScreen-CxT_ZU1Q.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-59ojWJmB.js → ReimbursementRoutes-B9v1csuM.js} +7 -7
- package/dist/assets/{ReportsRoutes-BlJSzoDH.js → ReportsRoutes-CYYBopNx.js} +1 -1
- package/dist/assets/RewardsRoutes-DQ-aEUje.js +1 -0
- package/dist/assets/ScreenRoutes-3ZRh9969.js +2 -0
- package/dist/assets/{SettingsRoutes-DZmVvwdN.js → SettingsRoutes-CLHJHv6D.js} +1 -1
- package/dist/assets/{SetupPagesScreen-BA7qIYz5.js → SetupPagesScreen-D-KjoZ4s.js} +5 -5
- package/dist/assets/{SignInScreen-B1pXXUPE.js → SignInScreen-DzUQQLWX.js} +1 -1
- package/dist/assets/SignOutScreen-CrFXavCN.js +9 -0
- package/dist/assets/{TaskListScreen-FhRi98gu.js → TaskListScreen-D1GJ72DV.js} +2 -2
- package/dist/assets/TaskRoutes-BShsttwI.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-Cc6D8ifC.js → TransactionDetailRoutes-NBFzTv3J.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BUXJ5aYk.js → TransactionDetailScreen-BXByY28g.js} +2 -2
- package/dist/assets/{TransactionListRoutes-mvNlEqh4.js → TransactionListRoutes-ClVpGZj3.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DM7Eo_Ug.js → TreasuryRoutes-CmxZydJL.js} +1 -1
- package/dist/assets/{VendorsRoutes-Dd1EboaF.js → VendorsRoutes-caL_MoH5.js} +13 -13
- package/dist/assets/WiseConfirmationScreen-C_2P8pKj.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-CPFO7nCH.js → ZeniAccountRoutes-3mgFL_9o.js} +1 -1
- package/dist/assets/ZeniAccountStatementScreen-B27kJkJn.js +9 -0
- package/dist/assets/{accountMappingHelper-DPo5_oRM.js → accountMappingHelper-B0l8lAeR.js} +1 -1
- package/dist/assets/{analytics-C3yKGO2p.js → analytics-CO5gayAE.js} +1 -1
- package/dist/assets/analyticsHelper-BaOtwD25.js +1 -0
- package/dist/assets/{core-QBDM2m9E.js → core-DrRun-Wp.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-V0q2i3Mt.js → decodeURIComponentSafe-BqXEXApE.js} +1 -1
- package/dist/assets/{dnd-DTpdpLY3.js → dnd-C7lg2kUY.js} +1 -1
- package/dist/assets/{empty-DOkYgcMg.js → empty-BxU8KR-q.js} +1 -1
- package/dist/assets/{empty-CFhDMTFy.js → empty-CcJKsg0A.js} +1 -1
- package/dist/assets/{emptyVideoElement--yp8X02p.js → emptyVideoElement-Jmh-gus6.js} +1 -1
- package/dist/assets/{epic-DhMQUuQ_.js → epic-CkW-Ur48.js} +1 -1
- package/dist/assets/getLocaleForTenant-C5iVY_JU.js +1 -0
- package/dist/assets/{index-PvNZ50rx.js → index-2hIX2kLH.js} +1 -1
- package/dist/assets/{index-Dgg3TEkF.js → index-4Tf9Bt0i.js} +1 -1
- package/dist/assets/{index-_F7n4D5D.js → index-BJ6_cpY3.js} +1 -1
- package/dist/assets/{index-BTTC92ci.js → index-CdzL9szH.js} +3235 -3221
- package/dist/assets/{index-ChYlKp3n.js → index-CfbU7SR1.js} +1 -1
- package/dist/assets/{index-BMXF4zS6.js → index-DdvKvtaE.js} +1 -1
- package/dist/assets/{index-C-I3RcJQ.js → index-T7IByhHr.js} +1 -1
- package/dist/assets/{index-BD-4IlOh.js → index-cnTKKS-Z.js} +2 -2
- package/dist/assets/{lexical-DBGXZJbY.js → lexical-Cceo9d8G.js} +1 -1
- package/dist/assets/{liveblocks-ufh19lah.js → liveblocks-0jcT8Dx_.js} +1 -1
- package/dist/assets/{lottie-Ceg93JYe.js → lottie-C4eBAM7n.js} +1 -1
- package/dist/assets/{mui-CB8RW45Z.js → mui-BCzMCgwZ.js} +1 -1
- package/dist/assets/{pathToGoBack-Bi5ALgzm.js → pathToGoBack-aFGIF63I.js} +1 -1
- package/dist/assets/{pdf-DdbTijar.js → pdf-C1ioMmzA.js} +3 -3
- package/dist/assets/{pdf-lib-DuOAYy25.js → pdf-lib-gor9sGMc.js} +1 -1
- package/dist/assets/{plaid-DAwCYgVP.js → plaid-B0k6aBM1.js} +1 -1
- package/dist/assets/{pusher-CiZh5qhj.js → pusher-CnlBFFea.js} +1 -1
- package/dist/assets/{react-XuQaBloD.js → react-5qcvQnQi.js} +1 -1
- package/dist/assets/{react-b_GUNHoi.js → react-C6dV2Ihe.js} +1 -1
- package/dist/assets/{react-BNUtRbVm.js → react-COTuHHMD.js} +1 -1
- package/dist/assets/{react-C-M5T2pV.js → react-CPmZ-IlI.js} +1 -1
- package/dist/assets/{react-C4Bd6CfY.js → react-CbFHkYXj.js} +1 -1
- package/dist/assets/{react-BQkbVo66.js → react-CeH9yclr.js} +1 -1
- package/dist/assets/{recharts-B8SFxg38.js → recharts-BJColP3b.js} +1 -1
- package/dist/assets/{routePaths-DRm-ixUG.js → routePaths-CHhQNN3M.js} +1 -1
- package/dist/assets/{sentry-Co2H8v0G.js → sentry-Cix5j_Oe.js} +1 -1
- package/dist/assets/{url-D7tTbw7b.js → url-C58jRUwt.js} +1 -1
- package/dist/assets/{url-BD8IMRo-.js → url-C5XmMoE_.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DB15Xiff.js → useAiCfoDashboardSuggestedQuestionsChips-rxliwAgH.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-fe0P1a5j.js +1 -0
- package/dist/assets/{useCashManagementBanner-D33gFRsv.js → useCashManagementBanner-BT0je4k3.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-Dh8PVdN6.js → useChargeCardPusherEvents-BbwX5V1a.js} +1 -1
- package/dist/assets/{useDeviceId-SWL_t36p.js → useDeviceId-34Upzybn.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BjbbVkjV.js → useEmailConnectResultRefresh-BeuZj6XY.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-B3FrSAeQ.js → useInitialThreadRequest-E7aaQNIx.js} +1 -1
- package/dist/assets/{utils-CWM6Tene.js → utils-CvfvTDv6.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DhAeegie.js → withTransactionSidePanel-B_GhVWS9.js} +2 -2
- package/dist/assets/{zeni-epic-state-BF09v22i.js → zeni-epic-state-D1OApLJ3.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-ByLwqq1f.js +0 -1
- package/dist/assets/AddressScreen-Bn9eD_vN.js +0 -9
- package/dist/assets/CustomerOnboardingAuthScreen-B9Xfrjh0.js +0 -1
- package/dist/assets/EntityDetailRoutes-DYfqqhFQ.js +0 -1
- package/dist/assets/FeaturePreviewScreen-C9BLvwka.js +0 -1
- package/dist/assets/MagicLinkRoutes-ZPdOYVHg.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-wqd6TRdZ.js +0 -12
- package/dist/assets/MobileAppDrawer-CWymkkwv.js +0 -1
- package/dist/assets/NotFoundScreen-CIe1EEoJ.js +0 -1
- package/dist/assets/PeopleRoutes-f84JOb6h.js +0 -22
- package/dist/assets/PerformanceRoutes-CQbkvkKD.js +0 -1
- package/dist/assets/RewardsRoutes-DkHhpbpf.js +0 -1
- package/dist/assets/ScreenRoutes-DoO6VBZw.js +0 -2
- package/dist/assets/SignOutScreen-Dc75amk7.js +0 -9
- package/dist/assets/TaskRoutes-Gzx1KgZq.js +0 -9
- package/dist/assets/WiseConfirmationScreen-DC9T83oN.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Cm4JCiss.js +0 -9
- package/dist/assets/analyticsHelper-BveTv6Ie.js +0 -1
- package/dist/assets/getLocaleForTenant-D6zJFfH-.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CPVGdgCK.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-0jcT8Dx_.js";import{A as d}from"./AddressScreen-DqXE5RDJ.js";import i from"./NotFoundScreen-1FWTFg5q.js";import"./sentry-Cix5j_Oe.js";import{o as s,p as r}from"./core-DrRun-Wp.js";import"./zeni-epic-state-D1OApLJ3.js";import"./recharts-BJColP3b.js";import"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-0jcT8Dx_.js";import{a as S}from"./sentry-Cix5j_Oe.js";import{h as T,u as _,g as E,i as j,j as B,n as D}from"./core-DrRun-Wp.js";import{J as M,y as $,z as L,f as N,C as K,E as z,g as C,j as m,D as F,p as h,s as R}from"./index-CdzL9szH.js";import{N4 as w,hY as U,eZ as G,N5 as O,c7 as V,N6 as q,lm as H}from"./zeni-epic-state-D1OApLJ3.js";import{n as J}from"./mui-BCzMCgwZ.js";import Y from"./NotFoundScreen-1FWTFg5q.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]="bbaba8db-74ed-4b47-a25e-6b464e644af0",e._sentryDebugIdIdentifier="sentry-dbid-bbaba8db-74ed-4b47-a25e-6b464e644af0")}catch{}})();const Z=J.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
|
+
`,Q=D((function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=w(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}}),(function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=R(d?.pathnameStackToGoBack);let s=n.poppedPathname??I();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=W(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(m.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 re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=E(),{addressId:s,addressType:u}=j(),g=M(),k=$(),v=L.getSignedInUser(),[f,x]=S.useState(s==null),p=B((b=>s!=null?w(b,s).fetchState:"Not-Started")),A=N();if(v==null)throw Error("Can't access address page without signing in...");const P=b=>b.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return S.useEffect((()=>{f||s==null||(x(!0),d(U(s,!1)))}),[f,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(K,{fetchState:p,style:{backgroundColor:k.colors.grey5}}):s!=null&&p==="Error"?(a(`${I(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(z,{analytics:C,onLoad:P}),r.jsx(Z,{windowSize:g,children:r.jsx(Q,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(Y,{})}const I=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},W=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{re as A,W as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-ufh19lah.js";import{a as l}from"./sentry-Co2H8v0G.js";import{u as we,h as Pe,g as ye,j as K,i as Ee,n as Te}from"./core-QBDM2m9E.js";import{Z as ve,de as Ae,z as Qe,J as _e,df as Oe,dg as Ue,bb as X,dh as ae,di as je,ba as oe,r as V,F as B,f as I,dj as R,dk as Fe,dl as Le,a3 as De,h as Be,a9 as Re,dm as Me,dn as Ve,a4 as $e,dp as Ge,dq as qe,dr as Ne,v as ze,b6 as He,ds as We}from"./index-BTTC92ci.js";import{gp as Ye,eY as ne,eZ as Ze,iE as Je,Uj as Ke,fs as Xe,iO as et,iK as tt,e_ as M,fz as st,g8 as at,g9 as ot,g1 as nt,j2 as ee,g5 as te,ga as it,gb as rt,gc as lt,gd as dt,ge as ct,gf as ut}from"./zeni-epic-state-BF09v22i.js";import{D as mt,n as k,S as pt,P as ht}from"./mui-CB8RW45Z.js";import{u as St}from"./useAiCfoDashboardSuggestedQuestionsChips-DB15Xiff.js";import{p as gt}from"./pathToGoBack-Bi5ALgzm.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="71afd406-8740-4669-a731-7c6e023ab8c3",e._sentryDebugIdIdentifier="sentry-dbid-71afd406-8740-4669-a731-7c6e023ab8c3")}catch{}})();const ie="chat-response-generated",ft=Te((function(e,n){const a=ne(e),p=n.isSubmitting,o=a.uiState?.currentChatSessionId,S=o!=null?st(e.aiCfoState,o):[],d=Ve(e,{allUsers:n.allUsers,onCardPolicyVendorSearchTextChange:n.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:n.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:p,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${$e}/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,skills:at(e).skills,syntheticAnswers:S,resolveSyntheticAnswerCardTile:qe(e),resolveSyntheticAnswerPolicyTile:Ge(e),...d}}),(function(e,n){const{location:a,currentTenant:p,userId:o,navigate:S,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,setIsAiCfoOpen:b}=n,h=p.tenantEmailDomain;return{onEventReceived:(s,t)=>{if(s===ie&&typeof t.text=="string"&&typeof t.metadata=="object"){const c=t,g=lt(c.type),m=c.metadata.chat_session_id??null,{currentChatSession:i,currentQuestionAnswer:w,currentQuestionAnswerSummary:A}=oe(x,m);g!=="answer"?I.trackAICFOChatResponseGenerated(g,w?.question.questionText??"",c.text,m,We(A,i),c.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(c.text,w?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,dt(c.visualization?.type??"")??null,m,c.summarized_title,c.metadata.message_id??null),e(ct({chatSessionId:c.metadata.chat_session_id,responseType:g,fetchState:{fetchState:"Completed",error:void 0}})),e(ut({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:o}))}},onSubmit:(s,t,c,g,m)=>{s&&He(e,s,t,d,x,o,g,c,void 0,m)},onFetchSkills:()=>{e(rt())},updateCurrentInput:s=>{e(te(s))},onStopSubmit:()=>{},onUpdateScrollYOffset:s=>{e(it(s))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const s=V(a.state?.pathnameStackToGoBack),t=s.poppedPathname??gt(1);S(t,{state:{...a.state,pathnameStackToGoBack:s.newStack}}),e(te(""))},togglePageView:()=>{const s=V(a.state?.pathnameStackToGoBack),t=s.poppedPathname??`/${p.tenantEmailDomain}/dashboard`;S(t,{state:{...ae(a.state),pathnameStackToGoBack:s.newStack,message:"open_ai_cfo_drawer"}}),b(!0)},onCopy:()=>{},onThumbsUp:(s,t)=>{d!=null&&t?.messageId!=null&&e(ee(d,t.messageId,"positive",t.questionText,t.answerText))},onThumbsDown:(s,t)=>{d!=null&&t?.messageId!=null&&e(ee(d,t.messageId,"negative",t.questionText,t.answerText))},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{d!=null&&e(nt());const s=ze(a.state?.pathnameStackToGoBack,a.pathname);S(`/${p.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:s.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(s,t)=>{e(ot({questionAnswerId:s,isCollapsed:t}))},onMenuClick:n.onMenuClick,...Ne(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:v,currentChatSessionId:d,onAfterCardsCreationSubmit:()=>{b(!0),S(`/${h}/cards`,{state:{...a.state}})},onAfterCardPolicySubmit:()=>{b(!0),S(`/${h}/cards/policy`,{state:{...a.state}})}})}}))(Re(Me)),Rt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:n}=ve(),a=we(),p=Pe(),o=ye(),[S,d]=l.useState(!1),{allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,onCardPolicyVendorSearchTextChange:b}=Ae();l.useEffect((()=>{a(Ye())}),[a]);const h=K((r=>ne(r))),s=Qe.getSignedInUser(),{session_id:t}=Ee(),c=_e(),g=De(c),m=K((r=>Ze(r))),i=h.uiState.currentChatSessionId,w=m.tenantEmailDomain,{handleUploadPromoClose:A,isUploadPromoVisible:re}=Oe({isFileUploadEnabled:e,tenantEmailDomain:w}),Q=Ue({currentTenant:m,currentChatSessionId:i,aiCfoView:h}),{isSuggestedQuestionsLoading:le,suggestedPromptQuestions:de}=St(),P=o.state,y=P?.aiCfoInitialQuestion,$=!!P?.aiCfoShouldSubmit;l.useEffect((()=>{const r=o.state;if(r?.[X]!==!0)return;d(!0);const f={...r};delete f[X],p(o,{replace:!0,state:f})}),[o.pathname,o.search,o.state,p]);const[ce,_]=l.useState(null),[ue,O]=l.useState(!1),[me,U]=l.useState(void 0),[pe,j]=l.useState(void 0),G=l.useRef(!1);l.useEffect((()=>{if(!G.current&&y!=null&&y!==""){const r=o.state;_(y),O($),U(r?.aiCfoInitialSubmissionSource!=null?r.aiCfoInitialSubmissionSource:void 0);const f=r?.aiCfoSuggestionIndex;j(typeof f=="number"?f:void 0),G.current=!0}}),[y,$,o.state]);const he=l.useCallback((()=>{_(null),O(!1),U(void 0),j(void 0),p(o.pathname,{replace:!0,state:ae(o.state)})}),[o.pathname,o.state,p]),q=l.useMemo((()=>new URLSearchParams(o.search)),[o.search]),N=q.get("ref")??P?.aiCfoRef,F=q.get("emailRefId")??P?.aiCfoEmailRefId,z=l.useRef(!1);l.useEffect((()=>{z.current||N!=="month-end-email"||F==null||i!=null||s==null||(a(Je("controller",s.userId,F,"MONTH_END_EMAIL")),z.current=!0)}),[N,F,i,a,s]);const E=h.uiState.lastContextMessage;l.useEffect((()=>{E!=null&&E!==""&&i!=null&&(_(E),O(!0),U(void 0),j(void 0),a(Ke()))}),[E,i,a]);const Se=m.masterTOSInfo,C=Se?.isMasterTOSAccepted??!1,{visitedSessions:H}=je(i),L=h.fetchState,D=h.uiState.chatSessionsNextPageToken.hasMore||!h.uiState.chatSessionsFirstPageFetched,W=i!=null?h.fetchChatSessionHistoryByChatSessionId?.[i]?.fetchState??"Not-Started":"Not-Started",Y=i==null||(h.uiState.chatHistoryNextPageToken[i]?.hasMore??!0),Z=h.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ge}=oe(Z,i),fe=ge.length===0;l.useEffect((()=>{C||g||p("../dashboard",{state:{...o.state,message:"open_ai_cfo_drawer"}})}),[C,g,p,o.state]);const Ce=l.useCallback((()=>{const r=V(o.state?.pathnameStackToGoBack),f=m.tenantEmailDomain;p(r.poppedPathname??(f!=null?`/${f}/dashboard`:".."),{state:{...o.state,pathnameStackToGoBack:r.newStack}})}),[m.tenantEmailDomain,o.state,p]);l.useEffect((()=>{i!=null&&t!==i&&p(`../ai-cfo/${i}`,{state:{...o.state}})}),[i,t]),l.useEffect((()=>{t!=null&&i==null&&t!=="new_chat"&&t!=="explore"&&a(Xe({sessionId:t,agentId:"controller"}))}),[]);const be=l.useMemo((()=>({events:H.map((r=>`private-encrypted-chat-${r}.${ie}`)),eventCallback:(r,f,xe)=>xe.onEventReceived(r,f)})),[H]);l.useEffect((()=>{L!=="In-Progress"&&D&&a(et())}),[L,D,a]),l.useEffect((()=>{i!=null&&W!=="In-Progress"&&Y&&s!=null&&L==="Completed"&&!D&&a(tt(i,s.userId))}),[W,Y,i,s,a]);const J=r=>r.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(s==null||t==null)throw Error("Can't access AI Controller page without signing in...");const Ie=i!=null&&h.responseStateByChatSessionId?.[i]?.answer?.fetchState==="In-Progress";if(!C&&g)return u.jsxs(bt,{children:[u.jsx(B,{analytics:I,onLoad:J}),Q.drawerElement,u.jsx(It,{children:u.jsx(se,{children:u.jsx(R,{isTOSAccepted:!1,acceptMasterTOSState:h.masterTOSAcceptanceState,onCloseClick:Ce,onCompleteClick:()=>{m.userRoleId!=null&&a(M(m.userRoleId))}})})})]});const ke=u.jsxs(u.Fragment,{children:[S&&!C?u.jsx(B,{analytics:I,onLoad:J}):null,u.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:h.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>d(!1):void 0,onCloseClick:()=>d(!1),onCompleteClick:()=>{C||m.userRoleId==null||a(M(m.userRoleId)),d(!1)}})]});return u.jsxs(u.Fragment,{children:[u.jsxs(Ct,{children:[u.jsx(B,{analytics:I,onLoad:r=>r.trackPageLoaded(Be.Event.aiCFOPage)}),g&&Q.drawerElement,u.jsx(ft,{...be,currentChatSessionId:i,allSessionsWithOrderedQuestionAnswers:Z,allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,openOnboardingPage:()=>d(!0),userId:s.userId,setIsAiCfoOpen:n,navigate:p,sessionFromUrl:t,location:o,isSubmitting:Ie,isEmptyChatWithSession:fe,currentTenant:m,emailLinkQuestion:ce??void 0,autoSubmitEmailLinkQuestion:ue,onEmailLinkQuestionProcessed:he,routedInitialQuestionSource:me,routedInitialQuestionSuggestionIndex:pe,onCardPolicyVendorSearchTextChange:b,onMenuClick:g?Q.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:re,onUploadPromoClose:A,exploreSuggestedPromptQuestions:de,exploreSuggestedPromptQuestionsLoading:le}),S&&g?u.jsx(mt,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:kt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:u.jsx(se,{onClick:r=>r.stopPropagation(),children:u.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:h.masterTOSAcceptanceState,onCloseClick:()=>d(!1),onCompleteClick:()=>{C||m.userRoleId==null||a(M(m.userRoleId)),d(!1)}})})}):null]}),S&&!g?u.jsx(Fe,{open:S,onClose:()=>d(!1),children:u.jsx(Le,{children:ke})}):null]})},se=k(pt)`
|
|
1
|
+
import{j as u}from"./liveblocks-0jcT8Dx_.js";import{a as l}from"./sentry-Cix5j_Oe.js";import{u as we,h as Pe,g as Ee,j as K,i as ye,n as Te}from"./core-DrRun-Wp.js";import{Z as ve,de as Ae,z as Qe,J as _e,df as Oe,dg as Ue,bb as X,dh as ae,di as je,ba as oe,s as V,E as B,g as I,dj as R,dk as Fe,dl as Le,a3 as De,j as Be,a9 as Re,dm as Me,dn as Ve,a4 as $e,dp as Ge,dq as qe,dr as Ne,w as ze,b6 as He,ds as We}from"./index-CdzL9szH.js";import{gp as Ye,eY as ne,eZ as Ze,iE as Je,Uj as Ke,fs as Xe,iO as et,iK as tt,e_ as M,fz as st,g8 as at,g9 as ot,g1 as nt,j2 as ee,g5 as te,ga as it,gb as rt,gc as lt,gd as dt,ge as ct,gf as ut}from"./zeni-epic-state-D1OApLJ3.js";import{D as mt,n as k,S as pt,P as ht}from"./mui-BCzMCgwZ.js";import{u as St}from"./useAiCfoDashboardSuggestedQuestionsChips-rxliwAgH.js";import{p as gt}from"./pathToGoBack-aFGIF63I.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="88d8a05a-fbb7-4c50-9d4b-dbb4cbd46e53",e._sentryDebugIdIdentifier="sentry-dbid-88d8a05a-fbb7-4c50-9d4b-dbb4cbd46e53")}catch{}})();const ie="chat-response-generated",ft=Te((function(e,n){const a=ne(e),p=n.isSubmitting,o=a.uiState?.currentChatSessionId,S=o!=null?st(e.aiCfoState,o):[],d=Ve(e,{allUsers:n.allUsers,onCardPolicyVendorSearchTextChange:n.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:n.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:p,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${$e}/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,skills:at(e).skills,syntheticAnswers:S,resolveSyntheticAnswerCardTile:qe(e),resolveSyntheticAnswerPolicyTile:Ge(e),...d}}),(function(e,n){const{location:a,currentTenant:p,userId:o,navigate:S,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,setIsAiCfoOpen:b}=n,h=p.tenantEmailDomain;return{onEventReceived:(s,t)=>{if(s===ie&&typeof t.text=="string"&&typeof t.metadata=="object"){const c=t,g=lt(c.type),m=c.metadata.chat_session_id??null,{currentChatSession:i,currentQuestionAnswer:w,currentQuestionAnswerSummary:A}=oe(x,m);g!=="answer"?I.trackAICFOChatResponseGenerated(g,w?.question.questionText??"",c.text,m,We(A,i),c.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(c.text,w?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,dt(c.visualization?.type??"")??null,m,c.summarized_title,c.metadata.message_id??null),e(ct({chatSessionId:c.metadata.chat_session_id,responseType:g,fetchState:{fetchState:"Completed",error:void 0}})),e(ut({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:o}))}},onSubmit:(s,t,c,g,m)=>{s&&He(e,s,t,d,x,o,g,c,void 0,m)},onFetchSkills:()=>{e(rt())},updateCurrentInput:s=>{e(te(s))},onStopSubmit:()=>{},onUpdateScrollYOffset:s=>{e(it(s))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const s=V(a.state?.pathnameStackToGoBack),t=s.poppedPathname??gt(1);S(t,{state:{...a.state,pathnameStackToGoBack:s.newStack}}),e(te(""))},togglePageView:()=>{const s=V(a.state?.pathnameStackToGoBack),t=s.poppedPathname??`/${p.tenantEmailDomain}/dashboard`;S(t,{state:{...ae(a.state),pathnameStackToGoBack:s.newStack,message:"open_ai_cfo_drawer"}}),b(!0)},onCopy:()=>{},onThumbsUp:(s,t)=>{d!=null&&t?.messageId!=null&&e(ee(d,t.messageId,"positive",t.questionText,t.answerText))},onThumbsDown:(s,t)=>{d!=null&&t?.messageId!=null&&e(ee(d,t.messageId,"negative",t.questionText,t.answerText))},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{d!=null&&e(nt());const s=ze(a.state?.pathnameStackToGoBack,a.pathname);S(`/${p.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:s.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(s,t)=>{e(ot({questionAnswerId:s,isCollapsed:t}))},onMenuClick:n.onMenuClick,...Ne(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:v,currentChatSessionId:d,onAfterCardsCreationSubmit:()=>{b(!0),S(`/${h}/cards`,{state:{...a.state}})},onAfterCardPolicySubmit:()=>{b(!0),S(`/${h}/cards/policy`,{state:{...a.state}})}})}}))(Re(Me)),Rt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:n}=ve(),a=we(),p=Pe(),o=Ee(),[S,d]=l.useState(!1),{allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,onCardPolicyVendorSearchTextChange:b}=Ae();l.useEffect((()=>{a(Ye())}),[a]);const h=K((r=>ne(r))),s=Qe.getSignedInUser(),{session_id:t}=ye(),c=_e(),g=De(c),m=K((r=>Ze(r))),i=h.uiState.currentChatSessionId,w=m.tenantEmailDomain,{handleUploadPromoClose:A,isUploadPromoVisible:re}=Oe({isFileUploadEnabled:e,tenantEmailDomain:w}),Q=Ue({currentTenant:m,currentChatSessionId:i,aiCfoView:h}),{isSuggestedQuestionsLoading:le,suggestedPromptQuestions:de}=St(),P=o.state,E=P?.aiCfoInitialQuestion,$=!!P?.aiCfoShouldSubmit;l.useEffect((()=>{const r=o.state;if(r?.[X]!==!0)return;d(!0);const f={...r};delete f[X],p(o,{replace:!0,state:f})}),[o.pathname,o.search,o.state,p]);const[ce,_]=l.useState(null),[ue,O]=l.useState(!1),[me,U]=l.useState(void 0),[pe,j]=l.useState(void 0),G=l.useRef(!1);l.useEffect((()=>{if(!G.current&&E!=null&&E!==""){const r=o.state;_(E),O($),U(r?.aiCfoInitialSubmissionSource!=null?r.aiCfoInitialSubmissionSource:void 0);const f=r?.aiCfoSuggestionIndex;j(typeof f=="number"?f:void 0),G.current=!0}}),[E,$,o.state]);const he=l.useCallback((()=>{_(null),O(!1),U(void 0),j(void 0),p(o.pathname,{replace:!0,state:ae(o.state)})}),[o.pathname,o.state,p]),q=l.useMemo((()=>new URLSearchParams(o.search)),[o.search]),N=q.get("ref")??P?.aiCfoRef,F=q.get("emailRefId")??P?.aiCfoEmailRefId,z=l.useRef(!1);l.useEffect((()=>{z.current||N!=="month-end-email"||F==null||i!=null||s==null||(a(Je("controller",s.userId,F,"MONTH_END_EMAIL")),z.current=!0)}),[N,F,i,a,s]);const y=h.uiState.lastContextMessage;l.useEffect((()=>{y!=null&&y!==""&&i!=null&&(_(y),O(!0),U(void 0),j(void 0),a(Ke()))}),[y,i,a]);const Se=m.masterTOSInfo,C=Se?.isMasterTOSAccepted??!1,{visitedSessions:H}=je(i),L=h.fetchState,D=h.uiState.chatSessionsNextPageToken.hasMore||!h.uiState.chatSessionsFirstPageFetched,W=i!=null?h.fetchChatSessionHistoryByChatSessionId?.[i]?.fetchState??"Not-Started":"Not-Started",Y=i==null||(h.uiState.chatHistoryNextPageToken[i]?.hasMore??!0),Z=h.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ge}=oe(Z,i),fe=ge.length===0;l.useEffect((()=>{C||g||p("../dashboard",{state:{...o.state,message:"open_ai_cfo_drawer"}})}),[C,g,p,o.state]);const Ce=l.useCallback((()=>{const r=V(o.state?.pathnameStackToGoBack),f=m.tenantEmailDomain;p(r.poppedPathname??(f!=null?`/${f}/dashboard`:".."),{state:{...o.state,pathnameStackToGoBack:r.newStack}})}),[m.tenantEmailDomain,o.state,p]);l.useEffect((()=>{i!=null&&t!==i&&p(`../ai-cfo/${i}`,{state:{...o.state}})}),[i,t]),l.useEffect((()=>{t!=null&&i==null&&t!=="new_chat"&&t!=="explore"&&a(Xe({sessionId:t,agentId:"controller"}))}),[]);const be=l.useMemo((()=>({events:H.map((r=>`private-encrypted-chat-${r}.${ie}`)),eventCallback:(r,f,xe)=>xe.onEventReceived(r,f)})),[H]);l.useEffect((()=>{L!=="In-Progress"&&D&&a(et())}),[L,D,a]),l.useEffect((()=>{i!=null&&W!=="In-Progress"&&Y&&s!=null&&L==="Completed"&&!D&&a(tt(i,s.userId))}),[W,Y,i,s,a]);const J=r=>r.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(s==null||t==null)throw Error("Can't access AI Controller page without signing in...");const Ie=i!=null&&h.responseStateByChatSessionId?.[i]?.answer?.fetchState==="In-Progress";if(!C&&g)return u.jsxs(bt,{children:[u.jsx(B,{analytics:I,onLoad:J}),Q.drawerElement,u.jsx(It,{children:u.jsx(se,{children:u.jsx(R,{isTOSAccepted:!1,acceptMasterTOSState:h.masterTOSAcceptanceState,onCloseClick:Ce,onCompleteClick:()=>{m.userRoleId!=null&&a(M(m.userRoleId))}})})})]});const ke=u.jsxs(u.Fragment,{children:[S&&!C?u.jsx(B,{analytics:I,onLoad:J}):null,u.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:h.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>d(!1):void 0,onCloseClick:()=>d(!1),onCompleteClick:()=>{C||m.userRoleId==null||a(M(m.userRoleId)),d(!1)}})]});return u.jsxs(u.Fragment,{children:[u.jsxs(Ct,{children:[u.jsx(B,{analytics:I,onLoad:r=>r.trackPageLoaded(Be.Event.aiCFOPage)}),g&&Q.drawerElement,u.jsx(ft,{...be,currentChatSessionId:i,allSessionsWithOrderedQuestionAnswers:Z,allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,openOnboardingPage:()=>d(!0),userId:s.userId,setIsAiCfoOpen:n,navigate:p,sessionFromUrl:t,location:o,isSubmitting:Ie,isEmptyChatWithSession:fe,currentTenant:m,emailLinkQuestion:ce??void 0,autoSubmitEmailLinkQuestion:ue,onEmailLinkQuestionProcessed:he,routedInitialQuestionSource:me,routedInitialQuestionSuggestionIndex:pe,onCardPolicyVendorSearchTextChange:b,onMenuClick:g?Q.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:re,onUploadPromoClose:A,exploreSuggestedPromptQuestions:de,exploreSuggestedPromptQuestionsLoading:le}),S&&g?u.jsx(mt,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:kt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:u.jsx(se,{onClick:r=>r.stopPropagation(),children:u.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:h.masterTOSAcceptanceState,onCloseClick:()=>d(!1),onCompleteClick:()=>{C||m.userRoleId==null||a(M(m.userRoleId)),d(!1)}})})}):null]}),S&&!g?u.jsx(Fe,{open:S,onClose:()=>d(!1),children:u.jsx(Le,{children:ke})}):null]})},se=k(pt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-ufh19lah.js";import{a as v}from"./sentry-Co2H8v0G.js";import{h as U,g as B,u as j,j as y,N as $,n as k,i as W,o as te,p as D}from"./core-QBDM2m9E.js";import{eZ as O,Qs as A,Q8 as h,zO as E,zG as Q,zK as R,zz as q,Qa as K,zQ as ae,zC as G,zT as M,zP as C}from"./zeni-epic-state-BF09v22i.js";import{z as V,a9 as Z,bL as oe,ag as P,bC as H,bM as le,y as J,E as X,bN as pe,bO as se}from"./index-BTTC92ci.js";import"./mui-CB8RW45Z.js";import{u as Y,i as ne}from"./ReimbursementApprovalRuleDetailScreen-CgQrnfRD.js";import re from"./NotFoundScreen-CIe1EEoJ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="ee09f181-1c05-4615-93e5-ce2229219914",e._sentryDebugIdIdentifier="sentry-dbid-ee09f181-1c05-4615-93e5-ce2229219914")}catch{}})();const T="bill-approval-rule-update",ie=k((function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(T)&&e(K(!1))},onBackClick:()=>{P(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}}))(Z(oe)),ce=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>O(s))),i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(Q(!0,!0,!1)))}),[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${T}`]:[],eventCallback:(s,w,S)=>{s.endsWith(T)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx($,{to:"../../promo"}):c.jsx(ie,{currentTenant:u,location:t,navigate:p,...m})},_="bill-approval-rule-update",ue=k((function(e){const p=A(e),t=h(e).billPaySetupApproverViewUpdateData,o={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o[r.id]=r.name);const a={};for(const r of Object.values(e.classState.classesByKey))r?.classId!=null&&(a[r.classId]=r.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(K(!1))},onBackClick:()=>{P(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(ae(a,!0))}}}))(Z(le)),de=()=>{const e=y((o=>O(o))),{isApprovalRulesV3Enabled:p,isLoading:t}=H(e?.tenantId);return p?c.jsx(ve,{isLoading:t}):c.jsx(ce,{isLoading:t})},ve=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>O(s)));Y();const i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(Q(!0,!0,!0)))}),[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${_}`]:[],eventCallback:(s,w,S)=>{s.endsWith(_)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx($,{to:"../../promo"}):c.jsx(ue,{currentTenant:u,location:t,navigate:p,isLoading:e,...m})},fe=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let r=t.allApprovalRules.length===0;return p.approvalRuleId&&(r=t.allApprovalRules.findIndex((n=>n.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:r,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=P(p.location);return{onApprovalRuleDataUpdated:l=>{const u=f=>{const m=[];return f.forEach((s=>{const w=s.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),S=s.actors.selectedNonUsers.map((b=>{const I=!!ne(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}})),g=w.concat(S);m.push({action:s.stepType.selectedOption,actors:g,operator:g.length>1?s.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),m},i={amount:{type:"amount",comparator:"range",min:{amount:l.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:l.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(n==="approval_create"){const f={criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}else{const f={approvalRuleId:r,criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(pe);function ye(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(v.useEffect((()=>{l||(u(!0),p(G(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(X,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(fe,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t})}const ge=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],r={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(a.push(n.id),r[n.id]=n.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:r,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=P(p.location);return{onApprovalRuleDataUpdated:l=>{const u=g=>{const b=[];return g.forEach((I=>{const L=I.actorKind?.selectedOption,N=I.selectedRole?.selectedOption;let x=[];L==="role"&&N!=null?x=[{type:"attribute",subType:N,userId:void 0,idType:void 0,isImplicitActor:!1}]:L==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map((ee=>({type:"user",userId:ee.userId,isImplicitActor:!1}))));const F=I.action??"require_approval";b.push({action:F,actors:x,operator:x.length>1?F==="require_approval"?"or":"and":"is"})})),b},i=l.amountCriteria,f=l.vendorCriteria,m=l.departmentCriteria,s={};if(i!=null&&i.comparator.selectedOption!=null){const g=i.comparator.selectedOption;s.amount={type:"amount",comparator:g,min:g==="less_than"?void 0:i.min,max:g==="greater_than"?void 0:i.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(s.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const S=m?.selection.selectedOptions??[];if(S.length>0&&(s.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:S}),n==="approval_create"){const g={name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}else{const g={approvalRuleId:r,name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:l=>{e(R(l)),t(n==="approval_update"?`../../${l}/edit`:`../${l}/edit`)}}}))(se);function z(){const e=y((t=>O(t))),{isApprovalRulesV3Enabled:p}=H(e?.tenantId);return p?c.jsx(me,{}):c.jsx(ye,{})}function me(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(Y(),v.useEffect((()=>{l||(u(!0),p(G(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(X,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(ge,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t},o??"new")}function xe(){return c.jsxs(te,{children:[c.jsx(D,{path:"/",element:c.jsx(de,{})}),c.jsx(D,{path:"/new",element:c.jsx(z,{})}),c.jsx(D,{path:"/:approvalRuleId/edit",element:c.jsx(z,{})}),c.jsx(D,{path:"*",element:c.jsx(re,{})})]})}export{xe as B};
|
|
1
|
+
import{j as c}from"./liveblocks-0jcT8Dx_.js";import{a as v}from"./sentry-Cix5j_Oe.js";import{h as U,g as B,u as j,j as y,N as $,n as k,i as W,o as te,p as D}from"./core-DrRun-Wp.js";import{eZ as O,Qs as A,Q8 as h,zO as E,zG as Q,zK as R,zz as q,Qa as K,zQ as ae,zC as G,zT as M,zP as C}from"./zeni-epic-state-D1OApLJ3.js";import{z as V,a9 as Z,bL as oe,ag as P,bC as H,bM as le,y as J,C as X,bN as pe,bO as se}from"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import{u as Y,i as ne}from"./ReimbursementApprovalRuleDetailScreen-CxT_ZU1Q.js";import re from"./NotFoundScreen-1FWTFg5q.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="91b68cb4-36a5-429d-a20f-b15ec38155e7",e._sentryDebugIdIdentifier="sentry-dbid-91b68cb4-36a5-429d-a20f-b15ec38155e7")}catch{}})();const T="bill-approval-rule-update",ie=k((function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(T)&&e(K(!1))},onBackClick:()=>{P(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}}))(Z(oe)),ce=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>O(s))),i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(Q(!0,!0,!1)))}),[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${T}`]:[],eventCallback:(s,w,S)=>{s.endsWith(T)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx($,{to:"../../promo"}):c.jsx(ie,{currentTenant:u,location:t,navigate:p,...m})},_="bill-approval-rule-update",ue=k((function(e){const p=A(e),t=h(e).billPaySetupApproverViewUpdateData,o={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o[r.id]=r.name);const a={};for(const r of Object.values(e.classState.classesByKey))r?.classId!=null&&(a[r.classId]=r.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(K(!1))},onBackClick:()=>{P(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(ae(a,!0))}}}))(Z(le)),de=()=>{const e=y((o=>O(o))),{isApprovalRulesV3Enabled:p,isLoading:t}=H(e?.tenantId);return p?c.jsx(ve,{isLoading:t}):c.jsx(ce,{isLoading:t})},ve=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y((s=>s.billPaySetupApproverViewState.fetchState)),u=y((s=>O(s)));Y();const i=y((s=>A(s))),f=y((s=>h(s).billPaySetupApproverViewUpdateData));if(v.useEffect((()=>{f?.updateStatus.fetchState==="Completed"&&o(E())}),[f]),v.useEffect((()=>{a||l!=="Not-Started"||e||(r(!0),o(Q(!0,!0,!0)))}),[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect((()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))}),[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${_}`]:[],eventCallback:(s,w,S)=>{s.endsWith(_)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx($,{to:"../../promo"}):c.jsx(ue,{currentTenant:u,location:t,navigate:p,isLoading:e,...m})},fe=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let r=t.allApprovalRules.length===0;return p.approvalRuleId&&(r=t.allApprovalRules.findIndex((n=>n.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:r,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=P(p.location);return{onApprovalRuleDataUpdated:l=>{const u=f=>{const m=[];return f.forEach((s=>{const w=s.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),S=s.actors.selectedNonUsers.map((b=>{const I=!!ne(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}})),g=w.concat(S);m.push({action:s.stepType.selectedOption,actors:g,operator:g.length>1?s.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),m},i={amount:{type:"amount",comparator:"range",min:{amount:l.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:l.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(n==="approval_create"){const f={criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}else{const f={approvalRuleId:r,criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(pe);function ye(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(v.useEffect((()=>{l||(u(!0),p(G(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(X,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(fe,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t})}const ge=k((function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],r={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(a.push(n.id),r[n.id]=n.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:r,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=P(p.location);return{onApprovalRuleDataUpdated:l=>{const u=g=>{const b=[];return g.forEach((I=>{const L=I.actorKind?.selectedOption,N=I.selectedRole?.selectedOption;let x=[];L==="role"&&N!=null?x=[{type:"attribute",subType:N,userId:void 0,idType:void 0,isImplicitActor:!1}]:L==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map((ee=>({type:"user",userId:ee.userId,isImplicitActor:!1}))));const F=I.action??"require_approval";b.push({action:F,actors:x,operator:x.length>1?F==="require_approval"?"or":"and":"is"})})),b},i=l.amountCriteria,f=l.vendorCriteria,m=l.departmentCriteria,s={};if(i!=null&&i.comparator.selectedOption!=null){const g=i.comparator.selectedOption;s.amount={type:"amount",comparator:g,min:g==="less_than"?void 0:i.min,max:g==="greater_than"?void 0:i.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(s.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const S=m?.selection.selectedOptions??[];if(S.length>0&&(s.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:S}),n==="approval_create"){const g={name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}else{const g={approvalRuleId:r,name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:l=>{e(R(l)),t(n==="approval_update"?`../../${l}/edit`:`../${l}/edit`)}}}))(se);function z(){const e=y((t=>O(t))),{isApprovalRulesV3Enabled:p}=H(e?.tenantId);return p?c.jsx(me,{}):c.jsx(ye,{})}function me(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y((i=>h(i))),d=y((i=>A(i))),[l,u]=v.useState(!1);if(Y(),v.useEffect((()=>{l||(u(!0),p(G(!0)))})),v.useEffect((()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(X,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(ge,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t},o??"new")}function xe(){return c.jsxs(te,{children:[c.jsx(D,{path:"/",element:c.jsx(de,{})}),c.jsx(D,{path:"/new",element:c.jsx(z,{})}),c.jsx(D,{path:"/:approvalRuleId/edit",element:c.jsx(z,{})}),c.jsx(D,{path:"*",element:c.jsx(re,{})})]})}export{xe as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-ufh19lah.js";import{h as K,u as se,g as Y,i as ae,j as k,N as te,n as J,l as ia,o as oa,p as y}from"./core-QBDM2m9E.js";import{eZ as W,PK as Ge,bs as wt,KB as la,bq as Bt,bJ as pe,PL as At,z4 as Ct,Aj as $e,zD as sa,bn as Ee,PM as ra,PN as ca,c7 as da,PO as ua,kG as xt,PP as Et,PQ as Dt,AU as Me,zj as Ae,PR as pa,yU as tt,PS as ma,EZ as ba,yY as ha,z2 as jt,PT as fe,PU as Oe,Ak as Ne,PV as ga,PW as Sa,An as ze,PX as ya,AA as fa,PY as Tt,A4 as at,A9 as va,PZ as ka,P_ as ue,P$ as Pt,Q0 as Ft,Q1 as Rt,gt as Ia,zo as Le,cC as Vt,Q2 as wa,fB as Ba,Q3 as Aa,Q4 as Ca,fG as $t,fE as Lt,Q5 as Qe,Q6 as xa,Q7 as Ea,Nv as Ze,Q8 as Da,Nw as oe,Nx as We,Q9 as ja,Qa as Ta,Qb as Pa,Ab as nt,A8 as Fa,Qc as Ra,Qd as Va,Qe as $a,zW as La,Qf as Ua,Qg as _a,Qh as Ga,cq as Ut,cS as _t,kR as Ma,bP as Oa,bo as Gt,bQ as Mt,ya as Na,Qi as za,EM as Qa,ES as Za,uw as Wa,Al as Ha,A$ as qa,l2 as ye,Qj as Ka,Qk as Ot,lw as Ya,kY as Nt,lh as zt,lg as it,bE as be,bO as Ja,Ql as Xa,Qm as ve,jB as en,Qn as ot,Qo as tn,jF as an,j_ as nn,Bd as on,Qp as ln,lp as sn,B3 as rn,Qq as lt,B7 as cn,Bc as dn,B9 as un,B1 as pn,Qr as Qt,zd as mn,Qs as bn,Qt as hn,gl as gn,gk as Sn,gj as yn,l5 as fn,ln as st,ly as vn,rY as kn,le as In,B5 as wn,jL as Bn,lD as An,Qu as Cn,jD as xn,rP as En,Qv as Dn,A0 as jn,bK as Tn,bt as Pn,Mj as Fn,cV as Rn,cU as Vn,cB as $n,cI as Ln}from"./zeni-epic-state-BF09v22i.js";import{y as me,z as $,e as ke,a0 as He,A as le,c as S,aS as Ce,E as re,o as x,F as De,f as D,bh as Un,r as Z,a4 as qe,v as E,J as Ie,bi as rt,bj as ct,bk as _n,al as Gn,K as Mn,aM as On,H as Zt,O as je,M as Ke,bl as Nn,au as Wt,bm as zn,_ as Qn,h as Ht,a9 as Zn,bn as Wn,bo as Hn,bp as qn,bq as Kn,br as Yn,bs as Jn,bt as Xn,bu as ei,bv as ti,B as ai,bw as ni,be as ii,bx as oi,by as li,i as si}from"./index-BTTC92ci.js";import{n as U,S as ri}from"./mui-CB8RW45Z.js";import{A as dt}from"./AddressScreen-Bn9eD_vN.js";import{g as ie,a as Te,i as qt,V as Ye,b as Je,c as ci,v as di,d as ui,A as he,D as ge}from"./DomesticWireDetailScreen-D-A33-aQ.js";import{a as f}from"./sentry-Co2H8v0G.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import{u as Kt}from"./useInitialThreadRequest-B3FrSAeQ.js";import xe from"./NotFoundScreen-CIe1EEoJ.js";import{D as pi}from"./DrawerScreen-CaJ0qHuQ.js";import{M as Yt}from"./MobileAppDrawer-CWymkkwv.js";import{F as Jt}from"./FeaturePreviewScreen-C9BLvwka.js";import{S as Pe}from"./SetupPagesScreen-BA7qIYz5.js";import{B as mi}from"./BillPayApprovalRoutes-DLlsLPac.js";import{FallBackRoute as bi}from"./ScreenRoutes-DoO6VBZw.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./analyticsHelper-BveTv6Ie.js";import"./routePaths-DRm-ixUG.js";import"./BusinessVerificationPageScreen-BGwTSYvf.js";import"./ReimbursementApprovalRuleDetailScreen-CgQrnfRD.js";import"./getLocaleForTenant-D6zJFfH-.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]="0be7dd32-4439-4280-981a-8fd05967fffd",e._sentryDebugIdIdentifier="sentry-dbid-0be7dd32-4439-4280-981a-8fd05967fffd")}catch{}})();const hi=J((function(e,t){const l=Ge(e,t.billId),n=$.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=Z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=Ee(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=ra(l.billActivities,ca(t.currentTenant),n);d=g,p=b}const m=da(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&ua(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(fe({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(jt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ha(l,s))},onSaveRealTimeApprovals:o=>{e(ba(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ma({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=Z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(pa({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Dt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Et({billId:l}))}}}))(Un);function gi(){const e=K(),t=se(),l=Y(),{billId:n}=ae(),c=me(),r=$.getSignedInUser(),u=ke(),o=k((z=>W(z))),s=k((z=>Ge(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});He({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&wt(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,v]=f.useState(!1),[j,A]=f.useState(!1),[C,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:G}=le(),{isFeatureEnabled:L}=T(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(S.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(S.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=G(Ce.zeniAssistConfig),w=la(o),N=Bt(o.userRole),M=g&&pe(u?.loggedInUserRoleMap),F=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:q}=T(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect((()=>{L&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&w===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(N||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,N,M,o.isZeni,w,r]),f.useEffect((()=>{n!=null&&t(At(n))}),[n]),f.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(v(!0),t(Ct(n??"",L,F,!1)))}),[b,s,n,t]),f.useEffect((()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,L,F,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(sa()))}),[j,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:z=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(z)}),a.jsx(hi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:L,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:F,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Ue=je.getLocalizedStrings().spendManagement.billPay.billDetails,ut=je.getLocalizedStrings().common,Si={containerWidth:new Zt(100,58)},pt=J((function(e,t){const l=$.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Wt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=$.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(fa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Ne(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(On);function B({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=me(),i=$.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:v}=p(Ce.zeniAssistConfig),j=v.user_ids!=null&&i?.userId!=null&&v.user_ids.includes(i?.userId),A=k((R=>W(R))),[C,_]=f.useState(!1),[T,G]=f.useState(!1),[L,I]=f.useState(!1),[H,O]=f.useState(),w=k((R=>Oe(R,m,g,n)));let N=w.fetchState,M=w.file,F=w.showAutofill;const q=k((R=>Ge(R,n??"")));u===!1&&(N=q.fetchState,M=q.transactionDetails?.attachments?.[0],F=!1);const X=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;f.useEffect((()=>{n==null&&t(Ne(!0))}),[n,t]),f.useEffect((()=>{N==="Not-Started"&&(u&&T?G(!1):!u&&C&&_(!1))}),[n]),f.useEffect((()=>{C||n==null||u||(_(!0),t(Ct(n,h,j,!1)),T||(G(!0),t($e(!1,h,j,b,n)))),u&&!T&&(G(!0),t($e(!1,h,j,b,n)))}),[C,T,u,n,t]);const z={onOkClick:()=>{if(I(!1),!H)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",R,i?.userEmail??"","yes"),t(Sa({replaceBillData:!0,billId:n})),t(ze(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",R,i?.userEmail??"","no"),t(ga({file:H,billId:n}))}},ee=f.useCallback((()=>{const R=Z(c.state?.pathnameStackToGoBack),ce=R.poppedPathname??ie(A.tenantEmailDomain);t(fe({billId:n})),l(ce,{state:{pathnameStackToGoBack:R.newStack}})}),[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(N==="Error"||q.fetchState==="Error")return a.jsx(xe,{});if(N!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(bt,{}),a.jsx(Re,{}),a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:O,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||F?null:a.jsx(mt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const R=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[F&&o!=="small"?a.jsx(bt,{}):null,L?a.jsx(Gn,{titleComponent:a.jsx(Bi,{children:Ue.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:Ue.overwriteDescription}),primaryButtonText:ut.yes,secondaryButtonText:ut.no,action:z,isEditPopup:!0}):null,o==="small"||F?null:a.jsx(mt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:F,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:fi(u,q,w),setShowConfirmationPopup:I,setPayload:O,showActionButtons:vi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:R}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function fi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(Ii,{children:`${Ue.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-0jcT8Dx_.js";import{h as K,u as se,g as Y,i as ae,j as k,N as te,n as J,l as ia,o as oa,p as y}from"./core-DrRun-Wp.js";import{eZ as W,PK as Ge,bs as wt,KB as la,bq as Bt,bJ as pe,PL as At,z4 as Ct,Aj as $e,zD as sa,bn as Ee,PM as ra,PN as ca,c7 as da,PO as ua,kG as xt,PP as Et,PQ as Dt,AU as Me,zj as Ae,PR as pa,yU as tt,PS as ma,EZ as ba,yY as ha,z2 as jt,PT as fe,PU as Oe,Ak as Ne,PV as ga,PW as Sa,An as ze,PX as ya,AA as fa,PY as Tt,A4 as at,A9 as va,PZ as ka,P_ as ue,P$ as Pt,Q0 as Ft,Q1 as Rt,gt as Ia,zo as Le,cC as Vt,Q2 as wa,fB as Ba,Q3 as Aa,Q4 as Ca,fG as $t,fE as Lt,Q5 as Qe,Q6 as xa,Q7 as Ea,Nv as Ze,Q8 as Da,Nw as oe,Nx as We,Q9 as ja,Qa as Ta,Qb as Pa,Ab as nt,A8 as Fa,Qc as Ra,Qd as Va,Qe as $a,zW as La,Qf as Ua,Qg as _a,Qh as Ga,cq as Ut,cS as _t,kR as Ma,bP as Oa,bo as Gt,bQ as Mt,ya as Na,Qi as za,EM as Qa,ES as Za,uw as Wa,Al as Ha,A$ as qa,l2 as ye,Qj as Ka,Qk as Ot,lw as Ya,kY as Nt,lh as zt,lg as it,bE as be,bO as Ja,Ql as Xa,Qm as ve,jB as en,Qn as ot,Qo as tn,jF as an,j_ as nn,Bd as on,Qp as ln,lp as sn,B3 as rn,Qq as lt,B7 as cn,Bc as dn,B9 as un,B1 as pn,Qr as Qt,zd as mn,Qs as bn,Qt as hn,gl as gn,gk as Sn,gj as yn,l5 as fn,ln as st,ly as vn,rY as kn,le as In,B5 as wn,jL as Bn,lD as An,Qu as Cn,jD as xn,rP as En,Qv as Dn,A0 as jn,bK as Tn,bt as Pn,Mj as Fn,cV as Rn,cU as Vn,cB as $n,cI as Ln}from"./zeni-epic-state-D1OApLJ3.js";import{y as me,z as $,f as ke,a0 as He,A as le,c as S,aS as Ce,C as re,o as x,E as De,g as D,bh as Un,s as Z,a4 as qe,w as E,J as Ie,bi as rt,bj as ct,bk as _n,al as Gn,K as Mn,aM as On,H as Zt,O as je,M as Ke,bl as Nn,au as Wt,bm as zn,_ as Qn,j as Ht,a9 as Zn,bn as Wn,bo as Hn,bp as qn,bq as Kn,br as Yn,bs as Jn,bt as Xn,bu as ei,bv as ti,S as ai,bw as ni,be as ii,bx as oi,by as li,d as si}from"./index-CdzL9szH.js";import{n as U,S as ri}from"./mui-BCzMCgwZ.js";import{A as dt}from"./AddressScreen-DqXE5RDJ.js";import{g as ie,a as Te,i as qt,V as Ye,b as Je,c as ci,v as di,d as ui,A as he,D as ge}from"./DomesticWireDetailScreen-C-1bKP7r.js";import{a as f}from"./sentry-Cix5j_Oe.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-fe0P1a5j.js";import{u as Kt}from"./useInitialThreadRequest-E7aaQNIx.js";import xe from"./NotFoundScreen-1FWTFg5q.js";import{D as pi}from"./DrawerScreen-DAMt3OKh.js";import{M as Yt}from"./MobileAppDrawer-7KFASJmR.js";import{F as Jt}from"./FeaturePreviewScreen-IYXzvJjG.js";import{S as Pe}from"./SetupPagesScreen-D-KjoZ4s.js";import{B as mi}from"./BillPayApprovalRoutes-Cgsqt2XF.js";import{FallBackRoute as bi}from"./ScreenRoutes-3ZRh9969.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./analyticsHelper-BaOtwD25.js";import"./routePaths-CHhQNN3M.js";import"./BusinessVerificationPageScreen-DlMhX3L_.js";import"./ReimbursementApprovalRuleDetailScreen-CxT_ZU1Q.js";import"./getLocaleForTenant-C5iVY_JU.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]="b50739df-0ba0-4411-ae9d-d1fc41967e7e",e._sentryDebugIdIdentifier="sentry-dbid-b50739df-0ba0-4411-ae9d-d1fc41967e7e")}catch{}})();const hi=J((function(e,t){const l=Ge(e,t.billId),n=$.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=Z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=Ee(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=ra(l.billActivities,ca(t.currentTenant),n);d=g,p=b}const m=da(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&ua(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(fe({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(jt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ha(l,s))},onSaveRealTimeApprovals:o=>{e(ba(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ma({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=Z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(pa({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Dt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Et({billId:l}))}}}))(Un);function gi(){const e=K(),t=se(),l=Y(),{billId:n}=ae(),c=me(),r=$.getSignedInUser(),u=ke(),o=k((z=>W(z))),s=k((z=>Ge(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});He({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&wt(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,v]=f.useState(!1),[j,A]=f.useState(!1),[C,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:G}=le(),{isFeatureEnabled:L}=T(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(S.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(S.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=G(Ce.zeniAssistConfig),w=la(o),N=Bt(o.userRole),M=g&&pe(u?.loggedInUserRoleMap),F=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:q}=T(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect((()=>{L&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&w===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(N||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,N,M,o.isZeni,w,r]),f.useEffect((()=>{n!=null&&t(At(n))}),[n]),f.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(v(!0),t(Ct(n??"",L,F,!1)))}),[b,s,n,t]),f.useEffect((()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,L,F,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(sa()))}),[j,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(De,{analytics:D,onLoad:z=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(z)}),a.jsx(hi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:L,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:F,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Ue=je.getLocalizedStrings().spendManagement.billPay.billDetails,ut=je.getLocalizedStrings().common,Si={containerWidth:new Zt(100,58)},pt=J((function(e,t){const l=$.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Wt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=$.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(fa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Ne(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(On);function B({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=me(),i=$.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:v}=p(Ce.zeniAssistConfig),j=v.user_ids!=null&&i?.userId!=null&&v.user_ids.includes(i?.userId),A=k((R=>W(R))),[C,_]=f.useState(!1),[T,G]=f.useState(!1),[L,I]=f.useState(!1),[H,O]=f.useState(),w=k((R=>Oe(R,m,g,n)));let N=w.fetchState,M=w.file,F=w.showAutofill;const q=k((R=>Ge(R,n??"")));u===!1&&(N=q.fetchState,M=q.transactionDetails?.attachments?.[0],F=!1);const X=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;f.useEffect((()=>{n==null&&t(Ne(!0))}),[n,t]),f.useEffect((()=>{N==="Not-Started"&&(u&&T?G(!1):!u&&C&&_(!1))}),[n]),f.useEffect((()=>{C||n==null||u||(_(!0),t(Ct(n,h,j,!1)),T||(G(!0),t($e(!1,h,j,b,n)))),u&&!T&&(G(!0),t($e(!1,h,j,b,n)))}),[C,T,u,n,t]);const z={onOkClick:()=>{if(I(!1),!H)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",R,i?.userEmail??"","yes"),t(Sa({replaceBillData:!0,billId:n})),t(ze(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const R=M!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",R,i?.userEmail??"","no"),t(ga({file:H,billId:n}))}},ee=f.useCallback((()=>{const R=Z(c.state?.pathnameStackToGoBack),ce=R.poppedPathname??ie(A.tenantEmailDomain);t(fe({billId:n})),l(ce,{state:{pathnameStackToGoBack:R.newStack}})}),[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(N==="Error"||q.fetchState==="Error")return a.jsx(xe,{});if(N!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(bt,{}),a.jsx(Re,{}),a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:O,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||F?null:a.jsx(mt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const R=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[F&&o!=="small"?a.jsx(bt,{}):null,L?a.jsx(Gn,{titleComponent:a.jsx(Bi,{children:Ue.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:Ue.overwriteDescription}),primaryButtonText:ut.yes,secondaryButtonText:ut.no,action:z,isEditPopup:!0}):null,o==="small"||F?null:a.jsx(mt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(pt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:F,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:fi(u,q,w),setShowConfirmationPopup:I,setPayload:O,showActionButtons:vi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:R}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function fi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(Ii,{children:`${Ue.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(wi,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const mt=U.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-0jcT8Dx_.js";import{a as V}from"./sentry-Cix5j_Oe.js";import{h as ae,g as ne,u as se,i as oe,j as k,N as ie,n as re}from"./core-DrRun-Wp.js";import{f as ce,A as ue,aS as de,z,E as le,g as B,ag as E,j as x,bH as pe,au as me,w as P,av as L}from"./index-CdzL9szH.js";import{Qg as fe,eZ as G,tX as ye,KE as Se,zW as ge,Dl as Ie,G6 as he,GL as Te,HL as be,QD as De,QE as Oe,QF as Ce,QG as ke,QH as Ve,N5 as Ae,PI as we,Nk as Ne,Ep as Fe,Nl as _e,Et as ve,lm as Ee,gl as xe,gk as ze,gj as Be,rY as Pe,rP as Le,rM as Re,le as Ue,u4 as Me,u2 as R,bE as U,ug as M,cA as je}from"./zeni-epic-state-D1OApLJ3.js";import{n as Ge}from"./mui-BCzMCgwZ.js";import{d as j}from"./routePaths-CHhQNN3M.js";import{M as Qe}from"./MobileAppDrawer-7KFASJmR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="c973e4e0-b999-426c-928c-2b1e6d6c60ea",t._sentryDebugIdIdentifier="sentry-dbid-c973e4e0-b999-426c-928c-2b1e6d6c60ea")}catch{}})();const He=Ge.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as C}from"./liveblocks-ufh19lah.js";import{a as V}from"./sentry-Co2H8v0
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,Ze=re((function(t,u){const{businessVerificationDetails:n}=u,i=G(t),y=z.getSignedInUser(),S=i.tenantId,p={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},T=Ae(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=
|
|
9
|
+
`,Ze=re((function(t,u){const{businessVerificationDetails:n}=u,i=G(t),y=z.getSignedInUser(),S=i.tenantId,p={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},T=Ae(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=we(t.companyConfigState),s=Ne(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:p,isDisabled:T,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:y,navigate:S,location:p}=u,{tenantEmailDomain:T}=y;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:d,companyIndustryType:D,companyLegalName:O,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:r,primaryContactName:o,primaryContactUserId:c,primaryContactSyncToken:b,syncToken:f,fileIds:a,incDate:l,typeOfIncorporation:A,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:Q,companySourceOfFundsDescription:H,transactionVolume:Z,transactionVolumeDescription:q,purposeOfAccount:W,purposeOfAccountDescription:$,regulatedStatus:K,regulatedStatusDescription:X,usNexus:Y,usNexusTypes:J}=e,_=D?.selectedOption,ee={companyId:n,companyDescription:s,companyIndustry:d.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:O,taxIdOrEIN:g,website:m!=""&&m!=null?je(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:l!=null?U(l?.toString()):l,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map((v=>v.length===2?v:L(v)))??[],companySourceOfFunds:Q?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:q,purposeOfAccount:W?.selectedOption??"",purposeOfAccountDescription:$,regulatedStatus:K??"",regulatedStatusDescription:X,usNexus:Y,usNexusTypes:J?.selectedOptions??[]},te={userId:c,firstName:o.firstName,lastName:o.lastName,email:r,syncToken:b};t(M({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:e=>{const s=e.map((d=>{const{officerType:D,userId:O,name:g,email:m,nationalityCountryCode:I,ssn:r,dob:o,phone:c,syncToken:b,selectDocument:f,role:a,ownership:l,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=d;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:D,userId:O,firstName:g.firstName,lastName:g.lastName,email:m,ssn:r,nationalityCountryCode:I?.selectedOption!=null?L(I.selectedOption):void 0,phone:c,birthday:o!=null?U(o?.toString()):o,syncToken:b,titleAtCompany:a.selectedOption,ownershipInCompany:l,documentTypeSelectedForVerification:h,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(M({officers:s}))},onSaveDetailsClick:e=>{t(R(n,e,i))},onSendForVerificationClick:e=>{t(R(n,e,i,!0))},onAddressClick:e=>{const s=j(T,e),d=P(p.state?.pathnameStackToGoBack,p.pathname);S(s,{state:{pathnameStackToGoBack:d}})},onRegisteredAddressClick:e=>{const s=j(T,e),d=P(p.state?.pathnameStackToGoBack,p.pathname);S(s,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{t(Me({companyId:n})),S("../setup")},updateFilesEntity:e=>{t(Ue({files:e}))},onDeleteFile:e=>{t(Re(e))},onDeleteFileList:e=>{t(Le(e))},onEditFileName:(e,s)=>{t(Pe(e,s.split(".")[0]))},onGetOtp:e=>{t(Be(e,"SpendManagementSetup"))},onResendOtp:e=>{t(ze(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(xe(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(Ee({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=_e(e.documentType);s!=null&&t(ve({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(Fe({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(pe),tt=({productType:t})=>{const u=ae(),n=ne(),i=se(),[y,S]=V.useState(!1),[p,T]=V.useState(!1),{tenantEmailDomain:e}=oe(),s=ce(),{useDynamicConfig:d}=ue(),{configValue:D}=d(de.zeniAccountsConfig),O=fe(D),g=k((a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}})),m=k((a=>a.companyConfigState.fetchState)),I=k((a=>a.userRoleConfigState.fetchState)),r=k((a=>G(a))),o=r.companyId??z.getSignedInUserTenant(e)?.companyId;if(V.useEffect((()=>{m==="Not-Started"&&i(ye()),I==="Not-Started"&&i(Se(!0))}),[m,I,i]),V.useEffect((()=>{if(!y&&g==="Not-Started"&&o!=null)switch(S(!0),t){case"zeni_accounts":i(be(o,!0));break;case"zeni_treasury":i(Te(o,!0));break;case"reimbursement":i(he(o,!0));break;case"charge_cards":i(Ie(o,!0));break;default:i(ge(o,!0))}}),[y,g,o,i]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let c;switch(t){case"zeni_accounts":c=r.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":c=r.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":c=r.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||r.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":c=r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:c=r.companyBillPayInfo?.info?.isBillPayTOSAccepted}const b=a=>{T(a)},f=k((a=>{switch(t){case"zeni_accounts":return Ve(a,o);case"zeni_treasury":return ke(a,o);case"charge_cards":return Ce(a,o);case"reimbursement":return Oe(a,o);default:return De(a,o)}}));return c===!1?C.jsx(ie,{to:"../promo"}):C.jsxs(He,{children:[C.jsx(le,{analytics:B,onLoad:a=>(l=>{switch(t){case"zeni_accounts":return l.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return l.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return l.trackPageLoaded(x.Event.billPayBusinessVerification,E(n)?"Settings":void 0)}})(a)}),E(n)?C.jsx(Qe,{isAppContentDrawerOpen:p,handleDrawerToggle:b}):null,C.jsx(Ze,{businessVerificationDetails:f,navigate:u,location:n,companyId:o,analytics:B,currentTenant:r,productType:t,isSettings:E(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{b(!0)},maxInsuredAmount:O.maxInsuredAmount})]})};export{tt as B};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-0jcT8Dx_.js";import{a as l}from"./sentry-Cix5j_Oe.js";import{u as pe,h as he,g as fe,j as M,i as Ce,n as Se}from"./core-DrRun-Wp.js";import{Z as ge,de as be,z as ye,df as Pe,dh as z,di as Ie,ba as W,E as we,g as $,dj as H,dt as Ee,O as ke,j as Ae,a9 as Te,dm as xe,dn as Oe,a4 as _e,dr as Ue,b6 as ve,ds as Qe}from"./index-CdzL9szH.js";import{gp as Fe,eY as G,eZ as $e,fs as je,iO as De,iK as Le,e_ as B,g9 as Ve,g1 as Re,g5 as N,ga as qe,gc as Me,gd as He,ge as Be,gf as Ne}from"./zeni-epic-state-D1OApLJ3.js";import{D as ze,n as D,P as We,S as Ge}from"./mui-BCzMCgwZ.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="122cf87f-25fe-42f7-9508-79445038464b",e._sentryDebugIdIdentifier="sentry-dbid-122cf87f-25fe-42f7-9508-79445038464b")}catch{}})();const Y="chat-response-generated",Z="cards/ask",K="card_policy_hero";function j(e){return`/${e}/cards`}function X(e){return`/${e}/cards/policy`}const Ye=Se((function(e,a){const o=G(e),c=a.isSubmitting,d=Oe(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:c,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...d}}),(function(e,a){const{location:o,currentTenant:c,userId:d,navigate:m,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,cardPolicyPageContext:O}=a,i=c.tenantEmailDomain,f=o.state?.referrer,p=f===K?X(i):j(i);return{onEventReceived:(n,t)=>{if(n===Y&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,C=Me(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);C!=="answer"?$.trackAICFOChatResponseGenerated(C,u?.question.questionText??"",s.text,b,Qe(P,y),s.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,He(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Be({chatSessionId:s.metadata.chat_session_id,responseType:C,fetchState:{fetchState:"Completed",error:void 0}})),e(Ne({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:d}))}},onSubmit:(n,t,s,C)=>{n&&ve(e,n,t,h,E,d,C,s,O)},updateCurrentInput:n=>{e(N(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(qe(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(p,{state:{...o.state}}),e(N(""))},togglePageView:()=>{m(p,{state:z(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{h!=null&&e(Re()),m((function(n){return`/${n}/${Z}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(Ve({questionAnswerId:n,isCollapsed:t}))},...Ue(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:x,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),m(j(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),m(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(Te(xe)),{spendManagement:{chargeCard:{cardsAiCfoHero:J,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),A=J.pageTitle,Ze=ee.pageTitle,Ke=J.chatHeaderSubtitle,Xe=ee.chatHeaderSubtitle,St=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=ge(),o=pe(),c=he(),d=fe(),[m,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,onCardPolicyVendorSearchTextChange:O}=be();l.useEffect((()=>{o(Fe())}),[o]);const i=M((r=>G(r))),f=ye.getSignedInUser(),{session_id:p}=Ce(),n=M((r=>$e(r))),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:C,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=d.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,I=y?.referrer===K,te=I?"card_policy":void 0,se=l.useMemo((()=>({title:I?Ze:A,subtitle:I?Xe:Ke})),[I]),[ae,_]=l.useState(null),[oe,U]=l.useState(!1),v=l.useRef(!1);l.useEffect((()=>{v.current||u==null||u===""||(_(u),U(P),v.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),U(!1),c(d.pathname,{replace:!0,state:z(d.state)})}),[d.pathname,d.state,c]),ie=n.masterTOSInfo,S=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect((()=>{if(S&&k.current!=null){const{question:r,shouldSubmit:w}=k.current;k.current=null,_(r),U(w),v.current=!1}}),[S]);const{visitedSessions:L}=Ie(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,V=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),q=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(q,t),le=re.length===0;l.useEffect((()=>{t!=null&&p!==t&&c((function(r,w){return`/${r}/${Z}/${w}`})(s,t),{state:{...d.state},replace:!0})}),[t,p,s,c,d.state]),l.useEffect((()=>{p!=null&&t==null&&p!=="new_chat"&&o(je({sessionId:p,agentId:"controller"}))}),[]);const de=l.useMemo((()=>({events:L.map((r=>`private-encrypted-chat-${r}.${Y}`)),eventCallback:(r,w,me)=>me.onEventReceived(r,w)})),[L]);if(l.useEffect((()=>{Q!=="In-Progress"&&F&&o(De())}),[Q,F,o]),l.useEffect((()=>{t!=null&&V!=="In-Progress"&&R&&f!=null&&Q==="Completed"&&!F&&o(Le(t,f.userId))}),[V,R,t,f,o]),f==null)throw Error("Can't access Cards AI CFO page without signing in...");const ce=p??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return g.jsxs(et,{children:[g.jsx(we,{analytics:$,onLoad:r=>r.trackPageLoaded(Ae.Event.aiCFOPage)}),S?g.jsx(Ye,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:q,allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:A,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:C,onCardPolicyVendorSearchTextChange:O,cardPolicyPageContext:te}):g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>{c(I?X(s):j(s),{state:{...d.state}})},onCompleteClick:()=>{S||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(B(n.userRoleId)))}}),g.jsx(ze,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:tt,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:g.jsx(Je,{onClick:r=>r.stopPropagation(),children:g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>h(!1),onCompleteClick:()=>{S||n.userRoleId==null||o(B(n.userRoleId)),h(!1)}})})})]})},Je=D(Ge)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,et=
|
|
5
|
+
`,et=D.div`
|
|
6
6
|
flex: 1 1 auto;
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
min-height: 0;
|
|
10
10
|
width: 100%;
|
|
11
|
-
`,tt=
|
|
11
|
+
`,tt=D(We)`
|
|
12
12
|
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
13
|
color: ${({theme:e})=>e.colors.grey4};
|
|
14
14
|
`;export{St as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-ufh19lah.js";import{u as me,j as i,h as le,g as he,i as Ve,N as Je,s as _t,n as Pe,t as _n,o as cs,p as ce}from"./core-QBDM2m9E.js";import{fa as Pt,Sc as os,fm as wt,bt as Fe,Sd as is,Se as ds,e$ as fn,Sf as Pn,f8 as wn,Sg as Tn,Sh as vn,Si as Fn,Sj as xn,f9 as Bn,fl as Ln,Sk as Rn,Sl as ls,ff as us,fe as ms,Sm as Cs,Cq as On,fo as ia,Sn as ps,So as hs,f1 as fs,f0 as gs,fB as Ye,fh as Un,fg as jn,Sp as Ss,fi as bs,BX as ys,BW as Is,B_ as ks,C0 as Es,fu as As,eY as Mn,Sq as Ds,Sr as _s,fz as Nn,Ss as Ps,fA as yt,C6 as ws,C3 as Ts,eZ as ge,St as qa,fE as xe,fF as Be,fG as Le,gA as da,cx as la,Su as ua,Sv as Tt,vc as $a,kO as za,Sw as Ya,CG as ka,fp as Qe,CI as vt,kE as Vn,Sx as ma,Cu as _a,Sy as vs,Sz as Fs,Cx as Qa,SA as xs,QA as Ja,fk as Hn,CD as Sa,hZ as Bs,SB as Gn,fb as Ca,bo as Ls,SC as Rs,gl as Xa,gk as et,Da as Os,gj as at,Qg as Us,SD as $n,cq as zn,cS as js,Qz as wa,DL as Yn,SE as gn,Dl as Pa,SF as Zn,DM as Ms,QY as Ns,DN as Vs,ES as Hs,uw as Gs,EM as $s,SG as zs,CH as ca,SH as Ys,SI as Zs,SJ as Ks,SK as Ws,SL as qs,SM as Ft,SN as Qs,CX as Kn,CQ as Js,SO as Xs,gC as ec,D4 as Wn,D8 as qn,gB as ac,SP as tc,Dx as Qn,SQ as nc,SR as rc,SS as sc,D6 as Jn,CT as Xn,CA as er,D0 as ar,C_ as tr,D2 as cc,ST as nr,SU as oc,fw as ic,fx as dc,fy as lc,SV as tt,fq as rr,cU as xt,SW as uc,SX as mc,SY as Cc,SZ as pc,Dg as It,DE as hc,DA as fc,Dc as gc,DC as Sc,Ds as bc,Du as yc,S_ as sr,DK as Ga,KB as Ic,S$ as kc,T0 as Ec,T1 as Ac,T2 as cr,T3 as Dc,E5 as _c,Dk as or,Df as Ne,Dj as Pc,T4 as wc,T5 as Tc,Cr as vc,T6 as ir,fj as dr,T7 as Fc,Ct as xc,Cs as Sn,T8 as Bc,T9 as Lc,Ta as Rc,N6 as Oc,Tb as Bt,Tc as Uc,yd as lr,lm as jc,hP as Mc,Ea as Nc,Td as ur,f5 as Vc,f6 as Hc,Te as Gc,dj as $c,fn as zc,E0 as Yc,DW as qe,bs as Zc,bJ as Kc,cC as Wc,bK as qc,Mj as Qc}from"./zeni-epic-state-BF09v22i.js";import{e as Re,cp as mr,r as we,cq as Cr,cr as pr,cs as Jc,O as ea,a0 as Lt,ct as Xc,cu as eo,Z as hr,a as fr,$ as gr,v as ye,A as ue,c as Z,ar as ya,cv as Sr,cw as ao,cx as to,z as te,E as Ta,ce as nt,cy as no,cz as ro,cA as so,J as va,aS as Ze,br as Rt,cB as co,H as Fa,m as rt,y as Ot,f as X,a9 as st,cC as oo,bE as ba,cD as kt,cE as io,F as Ut,cF as lo,au as br,a4 as Et,cG as uo,_ as yr,d as Ir,h as kr,cH as mo,cI as Co,cJ as po,cK as ho,cL as fo,cM as go,cN as So,o as Za,cO as bo,cP as yo,cQ as ht,B as Io,cR as ko,cS as Eo,cT as Ao,cU as Do,cV as _o,i as Po}from"./index-BTTC92ci.js";import{n as He,D as Er,S as wo}from"./mui-CB8RW45Z.js";import{a as r}from"./sentry-Co2H8v0G.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import{M as Ie}from"./MobileAppDrawer-CWymkkwv.js";import{d as jt}from"./recharts-B8SFxg38.js";import{g as _e,a as Ba,b as Ar,c as Oe,d as Ue,e as Xe,f as aa,h as ta,A as To,i as Mt,P as vo,j as Nt,s as Ia,k as Dr,l as oa,m as _r,n as Fo,o as Pr,p as xo,S as bn}from"./SetupPagesScreen-BA7qIYz5.js";import{u as wr}from"./useInitialThreadRequest-B3FrSAeQ.js";import ct from"./NotFoundScreen-CIe1EEoJ.js";import{u as Vt}from"./useChargeCardPusherEvents-Dh8PVdN6.js";import{n as yn}from"./utils-CWM6Tene.js";import{t as Bo}from"./AddressScreen-Bn9eD_vN.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./analyticsHelper-BveTv6Ie.js";import"./routePaths-DRm-ixUG.js";import"./BusinessVerificationPageScreen-BGwTSYvf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5205b399-b41e-491a-a7b7-a75cb26dae0d",e._sentryDebugIdIdentifier="sentry-dbid-5205b399-b41e-491a-a7b7-a75cb26dae0d")}catch{}})();const Lo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},Tr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Lo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function vr(){const e=me(),n=i((a=>Pt(a.cardPolicyState))),t=i((a=>os(a.cardPolicyState)));r.useEffect((()=>{t!==""||n==="Completed"&&t===""||n==="In-Progress"||e(wt())}),[e,n,t])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Ro=e=>Un(e,!1),Oo=e=>jn(e.name,!1);function Uo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Re(),y=Fe(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback((E=>{S(E)}),[]),m=r.useCallback((()=>{P(!0)}),[P]),{isAiCfoAccessEnabled:C,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{a(is()),a(ds()),a(fn())}),[a]);const w=i((E=>Pn(E.cardPolicyState))),l=i((E=>wn(E.cardPolicyState))),j=i((E=>Tn(E.cardPolicyState))),B=i((E=>vn(E.cardPolicyState))),L=i((E=>Fn(E.cardPolicyState))),p=i((E=>xn(E.cardPolicyState))),h=i((E=>Bn(E.cardPolicyState))),v=i((E=>Pt(E.cardPolicyState))),u=i((E=>E.chargeCardConfigState.receiptRequiredAboveAmount.amount)),T=i((E=>E.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&a(Ln())}),[a,w]),vr();const k=i((E=>Rn(E.createCardPolicyState))),U=i((E=>ls(E.createCardPolicyState))),A=i((E=>us(E.cardPolicyState))),b=i((E=>ms(E.cardPolicyState))),x=i((E=>Cs(E.createCardPolicyState))),d=i((E=>On(E)));r.useEffect((()=>{d.fetchState==="Not-Started"&&a(ia(!1,!1,!1))}),[d.fetchState,a]);const f=r.useMemo((()=>l.map(Ro)),[l]),M=r.useMemo((()=>h.map(Oo)),[h]),V=r.useMemo((()=>d.cards.filter((E=>!mr(E.status.code))).map(Tr)),[d.cards]),O=w==="Completed"&&d.fetchState==="Completed"&&T==="Completed";r.useEffect((()=>{O&&x==null&&a(ps({cardsMasterList:V,defaultRequireReceiptAmount:u,suggestedAllowMerchants:j,suggestedBlockMerchants:B,suggestedAllowCategories:L,suggestedBlockCategories:p}))}),[T,a,O,x,V,u,j,B,L,p]);const R=r.useMemo((()=>jt((E=>{a(wt(E))}),250)),[a]);r.useEffect((()=>()=>{R.cancel()}),[R]);const z=r.useCallback((E=>{R(E)}),[R]),$=k.fetchState,_=t!=null?`/${t}/cards/policy`:"..",D=r.useCallback((()=>{const E=we(n.state?.pathnameStackToGoBack),W=E.poppedPathname??_;e(W,{state:{pathnameStackToGoBack:E.newStack}})}),[n.state,e,_]),G=r.useCallback((()=>{e(_)}),[e,_]),Q=r.useCallback((E=>{a(hs(E))}),[a]),I=r.useCallback((E=>{const W=Cr(E);a(fs({templates:[W]}))}),[a]),N=r.useCallback((E=>{E.length!==0&&a(gs(E))}),[a]),K=r.useCallback((()=>{a(fn())}),[a]),J=r.useRef($);r.useEffect((()=>{const E=J.current;J.current=$,$==="Completed"&&E!=="Completed"&&U!=null&&(a(Ye({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(_))}),[a,$,U,e,_]);const o=$==="Error"?k.error?.message??In.createPolicyGenericErrorMessage:void 0;return y&&t!=null?x==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(pr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:D,onClickMenuIcon:m,isAiCfoAccessEnabled:C,onAskAiCfoClick:F})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Jc,{formDraft:x,vendorSearchOptions:M,categorySearchOptions:f,isVendorSearchLoading:v==="In-Progress",onVendorSearchTextChange:z,submitState:$,submitErrorMessage:o,documentUploadState:A,uploadedFileName:b,isAiCfoAccessEnabled:C,onAskAiCfoClick:F,onBackClick:D,onCancelClick:G,onClickMenuIcon:m,onFormChange:Q,onSubmit:I,onUploadDocument:N,onRemoveDocument:K})]}):c.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:jo}}}=ea.getLocalizedStrings(),Mo=e=>Un(e,!1),No=e=>jn(e.name,!1);function Vo(){const e=le(),n=he(),{tenantEmailDomain:t,templateId:a}=Ve(),s=me(),y=Re(),g=Fe(y?.loggedInUserRoleMap),[S,P]=r.useState(!1),m=r.useCallback((o=>{P(o)}),[]),C=r.useCallback((()=>{m(!0)}),[m]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),l=i((o=>Ss(o))),j=i((o=>Pn(o.cardPolicyState))),B=i((o=>wn(o.cardPolicyState))),L=i((o=>Tn(o.cardPolicyState))),p=i((o=>vn(o.cardPolicyState))),h=i((o=>Fn(o.cardPolicyState))),v=i((o=>xn(o.cardPolicyState))),u=i((o=>Bn(o.cardPolicyState))),T=i((o=>Pt(o.cardPolicyState))),k=i((o=>On(o))),U=i((o=>a!=null?bs(o.cardPolicyState,a):void 0)),A=r.useMemo((()=>l.templateId===a&&l.formDraft!=null?l.formDraft:U!=null?ys(U):void 0),[l.templateId,l.formDraft,U,a]);r.useEffect((()=>{if(a==null)return;const o=l.detailFetchState.fetchState;l.templateId===a&&(o==="Completed"||o==="In-Progress")||U!=null||s(Is(a))}),[s,a,l.templateId,l.detailFetchState.fetchState,U]),r.useEffect((()=>{j!=="Completed"&&j!=="In-Progress"&&s(Ln())}),[s,j]),vr();const b=i((o=>o.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{k.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[k.fetchState,s]);const x=r.useMemo((()=>B.map(Mo)),[B]),d=r.useMemo((()=>u.map(No)),[u]),f=r.useMemo((()=>k.cards.filter((o=>!mr(o.status.code))).map(Tr)),[k.cards]);Lt({isDataReady:A!=null});const M=r.useMemo((()=>{if(A!=null)return Xc({draft:A,cardRows:f,categorySearchOptions:x,vendorSearchOptions:d,defaultRequireReceiptAmount:b,suggestedAllowMerchants:L,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:v})}),[A,f,x,d,b,L,p,h,v]),[V,O]=r.useState(void 0),R=r.useRef(!1);r.useEffect((()=>{R.current||V!=null||M==null||(R.current=!0,O(M))}),[V,M]);const z=r.useCallback((o=>{O(o)}),[]),$=r.useMemo((()=>jt((o=>{s(wt(o))}),250)),[s]);r.useEffect((()=>()=>{$.cancel()}),[$]);const _=r.useCallback((o=>{$(o)}),[$]),D=l.updateFetchState.fetchState,G=t!=null?`/${t}/cards/policy`:"..",Q=r.useCallback((()=>{const o=we(n.state?.pathnameStackToGoBack),E=o.poppedPathname??G;e(E,{state:{pathnameStackToGoBack:o.newStack}})}),[n.state,e,G]),I=r.useCallback((()=>{e(G)}),[e,G]),N=r.useCallback((o=>{if(a==null)return;const E=Cr(o);s(ks(E)),s(Es(a))}),[s,a]),K=r.useRef(D);r.useEffect((()=>{const o=K.current;K.current=D,D==="Completed"&&o!=="Completed"&&(s(Ye({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(G))}),[s,D,e,G]);const J=D==="Error"?l.updateFetchState.error?.message??jo.updatePolicyGenericErrorMessage:void 0;return!g||t==null||a==null?c.jsx(Je,{to:"..",replace:!0}):V!=null&&j==="Completed"&&k.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:m}),c.jsx(eo,{templateName:l.template?.name??"",formDraft:V,vendorSearchOptions:d,categorySearchOptions:x,isVendorSearchLoading:T==="In-Progress",onVendorSearchTextChange:_,submitState:D,submitErrorMessage:J,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:Q,onCancelClick:I,onClickMenuIcon:C,onFormChange:z,onSubmit:N})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:m}),c.jsx(pr,{showUploadDocumentSection:!1,navBarTitle:l.template?.name,onBackClick:Q,onClickMenuIcon:C,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function Fr(e,n,t){return n?e.filter((a=>a!=null&&a.trim().length>0)).slice(0,t):[]}function xr(e){return i((n=>e==null||e===""?{chips:ft,isResolved:!1}:(function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ft:ft,isResolved:s}})(As(n,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Ho,subheadline:Go,pageTitle:$o}}}}=ea.getLocalizedStrings(),zo=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Yo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Re(),y=Fe(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback((_=>{S(_)}),[]),m=r.useCallback((()=>{P(!0)}),[P]),{useFeatureGate:C}=ue(),{isFeatureEnabled:F}=C(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=C(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:l,onAskAiCfoClick:j}=xa({mobileExploreReferrer:"Card Policy"}),B=i((_=>Ds(_))),L=i((_=>Rn(_.createCardPolicyState))),p=i((_=>_s(_.createCardPolicyState))),h=i((_=>p==null?[]:Nn(_.aiCfoState,p).filter((D=>D.kind==="creating_policy"))),_t),v=L.fetchState==="In-Progress"?Math.max(h.length,1):0,u=i((_=>Ps(_.createCardPolicyState))),T=ya(L.fetchState);r.useEffect((()=>{if(T==="In-Progress"&&L.fetchState==="Completed"&&p!=null)h.forEach((_=>{a(yt({chatSessionId:p,id:_.id,entityIds:u,kind:"created_policy"}))}));else if(T==="In-Progress"&&L.fetchState==="Error"&&p!=null){h.forEach((D=>{a(yt({chatSessionId:p,id:D.id,kind:"errored_policy"}))}));const _=L.error?.message!=null&&L.error.message.length>0?L.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;a(Ye({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:_}]}))}}),[L.error?.message,L.fetchState,a,p,u,h,T]);const k=B.fetchState.fetchState;r.useEffect((()=>{k!=="Not-Started"&&k!=="Error"||a(ws())}),[a,k]);const U=B.archiveFetchState.fetchState,A=ya(U);r.useEffect((()=>{A==="In-Progress"&&U==="Completed"&&a(Ye({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[U,a,A]);const b=r.useMemo((()=>B.templates.map(zo)),[B.templates]);Lt({isDataReady:B.fetchState.fetchState==="Completed"});const x=b.length>0||v>0,d=(function(_){const{hasAnyPolicies:D,isChargeCardAdmin:G,isFileUploadEnabled:Q}=_,I=le(),N=he(),{tenantEmailDomain:K}=Ve(),{isAiCfoOpen:J,setIsAiCfoOpen:o}=hr(),E=fr(),W=gr(),ne=i((oe=>Mn(oe))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:q,isResolved:ke}=xr("card_policy"),Te=r.useMemo((()=>Fr(q,ke,3)),[q,ke]),[fe,se]=r.useState(""),Ee=W&&E&&K!=null&&!J,re=r.useCallback((oe=>{if(K==null)return;const fa=ye(N.state?.pathnameStackToGoBack,N.pathname);I(`/${K}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:oe,aiCfoShouldSubmit:oe!=null&&oe.trim().length>0}})}),[N.pathname,N.state,I,K]),Ce=r.useCallback((oe=>{oe.trim().length!==0&&(se(""),re(oe))}),[re]),Ae=r.useCallback((()=>{const oe=fe.trim();oe.length!==0&&(se(""),re(oe))}),[fe,re]),ee=r.useCallback((()=>{}),[]),ve=r.useCallback((oe=>{se(oe)}),[]),De=r.useCallback((()=>{o(!0)}),[o]),ae=r.useCallback((()=>{re(void 0)}),[re]);return r.useMemo((()=>{if(Ee&&!D&&G)return{aiAgentName:$o,headline:Ho,subheadline:Go,promptChips:Te,composer:{currentInput:fe,isSubmitting:ne,isFileUploadEnabled:Q,onInputChange:ve,onSubmit:Ae,onStopSubmit:ee},onPromptClick:Ce,onOpenSidePanel:De,onOpenFullView:ae,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[fe,D,Ee,G,Q,ne,ve,ae,De,Ce,ee,Ae,Te])})({hasAnyPolicies:x,isChargeCardAdmin:y,isFileUploadEnabled:F}),f=w&&d!=null?c.jsx(Sr,{...d}):null,M=l&&f==null,V=r.useCallback((()=>{const _=we(n.state?.pathnameStackToGoBack),D=_.poppedPathname??"..";e(D,{state:{pathnameStackToGoBack:_.newStack}})}),[n.state,e]),O=r.useCallback((()=>{t!=null&&e(`/${t}/cards/policy/new`)}),[e,t]),R=r.useCallback((_=>{t!=null&&e(`/${t}/cards/policy/${_}/edit`)}),[e,t]),z=r.useCallback((_=>{a(Ts(_))}),[a]),$=B.fetchState.fetchState;return!x&&$!=="Completed"&&$!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(ao,{onBackClick:V,onNewPolicyClick:O,onClickMenuIcon:m,isAiCfoAccessEnabled:l,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(to,{policies:b,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:v,onBackClick:V,onNewPolicyClick:O,onEditPolicyClick:R,onArchivePolicyClick:z,onClickMenuIcon:m,policyAiCfoHero:f,isAiCfoAccessEnabled:M,onAskAiCfoClick:j})]})}function Zo(){const e=le(),{cardId:n}=Ve(),t=me(),a=te.getSignedInUser(),s=i((q=>ge(q))),y=Re(),g=Fe(y?.loggedInUserRoleMap),{useFeatureGate:S}=ue();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[P,m]=r.useState(!1),C=i((q=>qa(q).firstViewAfterActivation));if(n==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=S(Z.isChargeCardFeatureEnabled),l=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=S(Z.isDebitCardFeatureEnabled),B=xe(s),L=Be(s),p=Le(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=Oe({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),u=Ue({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:w,isBookKeepingTenant:L,isDebitCardProductVisible:v,chargeCardsCreditAccountLimit:h}),T=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=i((q=>da(q,s.companyId))),U=la(k.controllers),{creditAccount:A,creditAccountRepayment:b}=i((q=>ua(q))),x=i((q=>q.classListState.fetchState)),d=!F&&u&&l,f=i((q=>Tt(q,n,d,u))),[M,V]=r.useState(!1),O=f.chargeCard,R=O?.cardCreatedByUser?.userId,z=i((q=>R!=null?$a(q.userRoleState,R):void 0)),$=z?.accountingClassIDs[0],_=i((q=>$!=null?za(q.classState,{classId:$,reportId:"class_list"}):void 0)),D=O?.cardHolderUser?.userId,G=i((q=>D!=null?$a(q.userRoleState,D):void 0)),Q=G?.accountingClassIDs[0],I=i((q=>Q!=null?za(q.classState,{classId:Q,reportId:"class_list"}):void 0)),N=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",K=O?.type.code==="business_physical_debit_card";r.useEffect((()=>{C&&P===!1&&N&&(m(!0),setTimeout((()=>{t(Ya()),K&&t(Ye({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[C,P,N,K]),r.useEffect((()=>{M||f.fetchState==="Completed"||f.fetchState==="In-Progress"||n==null||(V(!0),t(ka(n,d,!1)))}),[M,f,n,t]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(N===!1||N&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||C===!1&&P===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const q=_e(s.tenantEmailDomain,n,a,O,C);e(q)}}),[f.fetchState,C,N]),r.useEffect((()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&l&&g&&t(Qe()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&u&&l&&g&&t(vt()),x!=="Completed"&&x!=="In-Progress"&&t(Vn())}),[A.fetchState,b.fetchState,t,u,l,g,x]);const J=()=>{if(a!=null&&n!=null){t(Ya());const q=_e(s.tenantEmailDomain,n,a);e(q)}},o=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",E=Xe(u,v,T,l),W=Ba(u,l,g,A,b),ne=Ar(o,f);return f.fetchState!=="Completed"?c.jsx(Ta,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(nt,{showConfetti:C}),c.jsx(no,{onGotItClick:J,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:U,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:l,productInformation:E,creditAccountInformation:W,debitAccountInformation:ne,chargeCardDetailView:f,creditAccount:A,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:_?.className,cardHolderRoles:G?.userRoles,cardHolderDepartmentName:I?.className})]})}const Br="charge-card-transaction-update",Lr="charge-card-transaction-created",Rr="charge-card-transaction-declined",Or="charge-card-transaction-updated",Ur="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ot="credit-account-balance-updated",it="charge-card-created",Gt="charge-card-limit-updated",$t="charge-card-limit-reset",zt="charge-card-renamed",Ko="charge-card-department-updated",jr="charge-card-repayment-completed",Mr="charge-card-payment-date-updated",La="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,n)=>e==null||e===""?[]:n.map((t=>`private-encrypted-${e}.${t}`)),Wo=[Ra,La],qo=Pe((function(e){const n=ma(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(n,t)=>{e(vs({uiState:{sortKey:n,sortOrder:t}}))}}}))(so);function Qo(){const e=le(),n=me(),t=he(),a=te.getSignedInUser(),s=i((j=>ge(j))),{useFeatureGate:y}=ue(),{isFeatureEnabled:g}=y(Z.isCardsCommentingEnabled),[S,P]=r.useState(!1),m=i((j=>ma(j))),C=wr(s.companyId,{clearParams:m.fetchState==="Completed"}),F=r.useCallback((()=>{const j=we(t.state?.pathnameStackToGoBack),B=j.poppedPathname??Jo(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:j.newStack}})}),[e,t,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,Wo),onEvent:j=>{switch(j){case Ra:case La:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect((()=>{S||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(P(!0),n(_a()))}),[S,m,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const l=m.cashbackSummary?.cashbackEarned?.amount!=null&&m.fetchState!=="Not-Started";return m.fetchState!=="In-Progress"||l?(m.cashbackSummary?.cashbackEarned?.amount??0)===0&&m.fetchState==="Completed"?c.jsx(ct,{}):c.jsx(qo,{onBackClick:F,isCardsCommentingEnabled:g,initialOpenThreadRequest:C}):c.jsx(ro,{onBackClick:F})}const Jo=e=>`/${e}/cards`,Xo={containerWidth:new Fa(100,58)},ei=({appContent:e})=>{const n=va(),t=me(),a=le(),{cardId:s}=Ve(),y=he(),{useDynamicConfig:g}=ue(),[S,P]=r.useState(!1),[m,C]=r.useState(!1),[F,w]=r.useState(!1),[l,j]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const L=i((I=>ge(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=g(Ze.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,v=i((I=>Fs(I,s))),u=v.chargeCard,T=i((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:k}=ue(),{isFeatureEnabled:U}=k(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(Z.isDebitCardFeatureEnabled),b=Le(A,L),x=Oe({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:b}),d=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,f=L.userRole.includes("charge_card_user"),M=xe(L),V=Be(L),O=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=Ue({isCardsOnlyTenant:M,isChargeCardFeatureEnabled:U,isBookKeepingTenant:V,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:O}),z=!f&&R&&d;r.useEffect((()=>{S===!1&&T!=="In-Progress"&&T!=="Completed"&&(t(Qa()),P(!0)),m===!1&&v.fetchState==="Not-Started"&&(C(!0),t(ka(s,z,R)))}),[m,v.fetchState,S,T]);const $=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(v.fetchState==="Completed"){if(F===!1&&($===!1||$&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==B.userId)){const I=_e(L.tenantEmailDomain,s,B,u,!0),N=ye(y.state?.pathnameStackToGoBack,y.pathname);a(I,{state:{pathnameStackToGoBack:N}})}else if(F&&v.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(xs({chargeCardId:s}));const I=_e(L.tenantEmailDomain,s,B,u,!0),N=ye(y.state?.pathnameStackToGoBack,y.pathname);t(Ja()),a(I,{state:{pathnameStackToGoBack:N}})}}}),[v.fetchState,u?.type.code,F,v.isRefreshingViewInBackground]);const _=te.getZeniOtpTokenForCardHolder(s),D=i((I=>Hn(I.userState,B.userId))),G=()=>{u?.status?.code!=="active"&&t(Sa(s,!0))};r.useEffect((()=>{v.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(G,3e3),w(!0))}),[v.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const Q=I=>{j(I)};if(T!=="Completed"||u==null)return c.jsx(Ta,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(D?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(ni,{children:[c.jsx(Ie,{isAppContentDrawerOpen:l,handleDrawerToggle:Q}),c.jsx(ai,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:D.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:v,signedInUserToken:_,navigate:a,currentTenant:L,location:y,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Q(!0)}}),e!=null?c.jsx(ti,{windowSize:n,children:e}):null]})},ai=Pe((function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const y=Bs(e.addressState,t);if(y==null)throw Error("Can't access shippingAddress.");const g=Gn(e,s),S=n.updateStatus,P=Ca(e,!1,!1,!1);let m=!1;P.fetchState==="Completed"&&P.cards.length<=1&&(m=!0);const C=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Ls())||C,showMenuIcon:m,shippingAddress:y,vgsVaultId:rt.cardVaultId,twoFAView:g,activationWaitStatus:S,isRefreshingViewInBackground:n.isRefreshingViewInBackground}}),(function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:y,chargeCardDetailState:g}=n,S=g.chargeCard?.cardProviderID,{tenantEmailDomain:P}=y;return{onGetOtp:m=>{S!=null&&e(at(m,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:m=>{e(Os(a,m))},onResendOtp:m=>{S!=null&&e(et(m,"ChargeCardHolder",a))},onVerifyOtp:(m,C)=>{S!=null&&e(Xa(m,C,"ChargeCardHolder",a))},onVerifyOtpSuccess:m=>{m!=null&&te.saveZeniOtpTokenForCardHolder(m,a)},onCVVActivateSuccess:()=>{e(Rs({chargeCardId:a}))},onBackClick:()=>{const m=we(s.state?.pathnameStackToGoBack),C=m.poppedPathname==null||m.poppedPathname.includes("onboard")===!0?ta(P):m.poppedPathname;t(C,{state:{pathnameStackToGoBack:m.newStack}})}}}))(co),ti=He.div`
|
|
1
|
+
import{j as c}from"./liveblocks-0jcT8Dx_.js";import{u as me,j as i,h as le,g as he,i as Ve,N as Je,s as _t,n as Pe,t as _n,o as cs,p as ce}from"./core-DrRun-Wp.js";import{fa as Pt,Sc as os,fm as wt,bt as Fe,Sd as is,Se as ds,e$ as fn,Sf as Pn,f8 as wn,Sg as Tn,Sh as vn,Si as Fn,Sj as xn,f9 as Bn,fl as Ln,Sk as Rn,Sl as ls,ff as us,fe as ms,Sm as Cs,Cq as On,fo as ia,Sn as ps,So as hs,f1 as fs,f0 as gs,fB as Ye,fh as Un,fg as jn,Sp as Ss,fi as bs,BX as ys,BW as Is,B_ as ks,C0 as Es,fu as As,eY as Mn,Sq as Ds,Sr as _s,fz as Nn,Ss as Ps,fA as yt,C6 as ws,C3 as Ts,eZ as ge,St as qa,fE as xe,fF as Be,fG as Le,gA as da,cx as la,Su as ua,Sv as Tt,vc as $a,kO as za,Sw as Ya,CG as ka,fp as Qe,CI as vt,kE as Vn,Sx as ma,Cu as _a,Sy as vs,Sz as Fs,Cx as Qa,SA as xs,QA as Ja,fk as Hn,CD as Sa,hZ as Bs,SB as Gn,fb as Ca,bo as Ls,SC as Rs,gl as Xa,gk as et,Da as Os,gj as at,Qg as Us,SD as $n,cq as zn,cS as js,Qz as wa,DL as Yn,SE as gn,Dl as Pa,SF as Zn,DM as Ms,QY as Ns,DN as Vs,ES as Hs,uw as Gs,EM as $s,SG as zs,CH as ca,SH as Ys,SI as Zs,SJ as Ks,SK as Ws,SL as qs,SM as Ft,SN as Qs,CX as Kn,CQ as Js,SO as Xs,gC as ec,D4 as Wn,D8 as qn,gB as ac,SP as tc,Dx as Qn,SQ as nc,SR as rc,SS as sc,D6 as Jn,CT as Xn,CA as er,D0 as ar,C_ as tr,D2 as cc,ST as nr,SU as oc,fw as ic,fx as dc,fy as lc,SV as tt,fq as rr,cU as xt,SW as uc,SX as mc,SY as Cc,SZ as pc,Dg as It,DE as hc,DA as fc,Dc as gc,DC as Sc,Ds as bc,Du as yc,S_ as sr,DK as Ga,KB as Ic,S$ as kc,T0 as Ec,T1 as Ac,T2 as cr,T3 as Dc,E5 as _c,Dk as or,Df as Ne,Dj as Pc,T4 as wc,T5 as Tc,Cr as vc,T6 as ir,fj as dr,T7 as Fc,Ct as xc,Cs as Sn,T8 as Bc,T9 as Lc,Ta as Rc,N6 as Oc,Tb as Bt,Tc as Uc,yd as lr,lm as jc,hP as Mc,Ea as Nc,Td as ur,f5 as Vc,f6 as Hc,Te as Gc,dj as $c,fn as zc,E0 as Yc,DW as qe,bs as Zc,bJ as Kc,cC as Wc,bK as qc,Mj as Qc}from"./zeni-epic-state-D1OApLJ3.js";import{f as Re,cp as mr,s as we,cq as Cr,cr as pr,cs as Jc,O as ea,a0 as Lt,ct as Xc,cu as eo,Z as hr,a as fr,$ as gr,w as ye,A as ue,c as Z,ar as ya,cv as Sr,cw as ao,cx as to,z as te,C as Ta,ce as nt,cy as no,cz as ro,cA as so,J as va,aS as Ze,br as Rt,cB as co,H as Fa,p as rt,y as Ot,g as X,a9 as st,cC as oo,bE as ba,cD as kt,cE as io,E as Ut,cF as lo,au as br,a4 as Et,cG as uo,_ as yr,e as Ir,j as kr,cH as mo,cI as Co,cJ as po,cK as ho,cL as fo,cM as go,cN as So,o as Za,cO as bo,cP as yo,cQ as ht,S as Io,cR as ko,cS as Eo,cT as Ao,cU as Do,cV as _o,d as Po}from"./index-CdzL9szH.js";import{n as He,D as Er,S as wo}from"./mui-BCzMCgwZ.js";import{a as r}from"./sentry-Cix5j_Oe.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-fe0P1a5j.js";import{M as Ie}from"./MobileAppDrawer-7KFASJmR.js";import{d as jt}from"./recharts-BJColP3b.js";import{g as _e,a as Ba,b as Ar,c as Oe,d as Ue,e as Xe,f as aa,h as ta,A as To,i as Mt,P as vo,j as Nt,s as Ia,k as Dr,l as oa,m as _r,n as Fo,o as Pr,p as xo,S as bn}from"./SetupPagesScreen-D-KjoZ4s.js";import{u as wr}from"./useInitialThreadRequest-E7aaQNIx.js";import ct from"./NotFoundScreen-1FWTFg5q.js";import{u as Vt}from"./useChargeCardPusherEvents-BbwX5V1a.js";import{n as yn}from"./utils-CvfvTDv6.js";import{t as Bo}from"./AddressScreen-DqXE5RDJ.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./analyticsHelper-BaOtwD25.js";import"./routePaths-CHhQNN3M.js";import"./BusinessVerificationPageScreen-DlMhX3L_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2d9d0d72-6fec-4e62-9300-fc4bdf5aecd6",e._sentryDebugIdIdentifier="sentry-dbid-2d9d0d72-6fec-4e62-9300-fc4bdf5aecd6")}catch{}})();const Lo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},Tr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Lo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function vr(){const e=me(),n=i((a=>Pt(a.cardPolicyState))),t=i((a=>os(a.cardPolicyState)));r.useEffect((()=>{t!==""||n==="Completed"&&t===""||n==="In-Progress"||e(wt())}),[e,n,t])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Ro=e=>Un(e,!1),Oo=e=>jn(e.name,!1);function Uo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Re(),y=Fe(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback((E=>{S(E)}),[]),m=r.useCallback((()=>{P(!0)}),[P]),{isAiCfoAccessEnabled:C,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{a(is()),a(ds()),a(fn())}),[a]);const w=i((E=>Pn(E.cardPolicyState))),l=i((E=>wn(E.cardPolicyState))),j=i((E=>Tn(E.cardPolicyState))),B=i((E=>vn(E.cardPolicyState))),L=i((E=>Fn(E.cardPolicyState))),p=i((E=>xn(E.cardPolicyState))),h=i((E=>Bn(E.cardPolicyState))),v=i((E=>Pt(E.cardPolicyState))),u=i((E=>E.chargeCardConfigState.receiptRequiredAboveAmount.amount)),T=i((E=>E.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&a(Ln())}),[a,w]),vr();const k=i((E=>Rn(E.createCardPolicyState))),U=i((E=>ls(E.createCardPolicyState))),A=i((E=>us(E.cardPolicyState))),b=i((E=>ms(E.cardPolicyState))),x=i((E=>Cs(E.createCardPolicyState))),d=i((E=>On(E)));r.useEffect((()=>{d.fetchState==="Not-Started"&&a(ia(!1,!1,!1))}),[d.fetchState,a]);const f=r.useMemo((()=>l.map(Ro)),[l]),M=r.useMemo((()=>h.map(Oo)),[h]),V=r.useMemo((()=>d.cards.filter((E=>!mr(E.status.code))).map(Tr)),[d.cards]),O=w==="Completed"&&d.fetchState==="Completed"&&T==="Completed";r.useEffect((()=>{O&&x==null&&a(ps({cardsMasterList:V,defaultRequireReceiptAmount:u,suggestedAllowMerchants:j,suggestedBlockMerchants:B,suggestedAllowCategories:L,suggestedBlockCategories:p}))}),[T,a,O,x,V,u,j,B,L,p]);const R=r.useMemo((()=>jt((E=>{a(wt(E))}),250)),[a]);r.useEffect((()=>()=>{R.cancel()}),[R]);const z=r.useCallback((E=>{R(E)}),[R]),$=k.fetchState,_=t!=null?`/${t}/cards/policy`:"..",D=r.useCallback((()=>{const E=we(n.state?.pathnameStackToGoBack),W=E.poppedPathname??_;e(W,{state:{pathnameStackToGoBack:E.newStack}})}),[n.state,e,_]),G=r.useCallback((()=>{e(_)}),[e,_]),Q=r.useCallback((E=>{a(hs(E))}),[a]),I=r.useCallback((E=>{const W=Cr(E);a(fs({templates:[W]}))}),[a]),N=r.useCallback((E=>{E.length!==0&&a(gs(E))}),[a]),K=r.useCallback((()=>{a(fn())}),[a]),J=r.useRef($);r.useEffect((()=>{const E=J.current;J.current=$,$==="Completed"&&E!=="Completed"&&U!=null&&(a(Ye({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(_))}),[a,$,U,e,_]);const o=$==="Error"?k.error?.message??In.createPolicyGenericErrorMessage:void 0;return y&&t!=null?x==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(pr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:D,onClickMenuIcon:m,isAiCfoAccessEnabled:C,onAskAiCfoClick:F})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Jc,{formDraft:x,vendorSearchOptions:M,categorySearchOptions:f,isVendorSearchLoading:v==="In-Progress",onVendorSearchTextChange:z,submitState:$,submitErrorMessage:o,documentUploadState:A,uploadedFileName:b,isAiCfoAccessEnabled:C,onAskAiCfoClick:F,onBackClick:D,onCancelClick:G,onClickMenuIcon:m,onFormChange:Q,onSubmit:I,onUploadDocument:N,onRemoveDocument:K})]}):c.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:jo}}}=ea.getLocalizedStrings(),Mo=e=>Un(e,!1),No=e=>jn(e.name,!1);function Vo(){const e=le(),n=he(),{tenantEmailDomain:t,templateId:a}=Ve(),s=me(),y=Re(),g=Fe(y?.loggedInUserRoleMap),[S,P]=r.useState(!1),m=r.useCallback((o=>{P(o)}),[]),C=r.useCallback((()=>{m(!0)}),[m]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),l=i((o=>Ss(o))),j=i((o=>Pn(o.cardPolicyState))),B=i((o=>wn(o.cardPolicyState))),L=i((o=>Tn(o.cardPolicyState))),p=i((o=>vn(o.cardPolicyState))),h=i((o=>Fn(o.cardPolicyState))),v=i((o=>xn(o.cardPolicyState))),u=i((o=>Bn(o.cardPolicyState))),T=i((o=>Pt(o.cardPolicyState))),k=i((o=>On(o))),U=i((o=>a!=null?bs(o.cardPolicyState,a):void 0)),A=r.useMemo((()=>l.templateId===a&&l.formDraft!=null?l.formDraft:U!=null?ys(U):void 0),[l.templateId,l.formDraft,U,a]);r.useEffect((()=>{if(a==null)return;const o=l.detailFetchState.fetchState;l.templateId===a&&(o==="Completed"||o==="In-Progress")||U!=null||s(Is(a))}),[s,a,l.templateId,l.detailFetchState.fetchState,U]),r.useEffect((()=>{j!=="Completed"&&j!=="In-Progress"&&s(Ln())}),[s,j]),vr();const b=i((o=>o.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{k.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[k.fetchState,s]);const x=r.useMemo((()=>B.map(Mo)),[B]),d=r.useMemo((()=>u.map(No)),[u]),f=r.useMemo((()=>k.cards.filter((o=>!mr(o.status.code))).map(Tr)),[k.cards]);Lt({isDataReady:A!=null});const M=r.useMemo((()=>{if(A!=null)return Xc({draft:A,cardRows:f,categorySearchOptions:x,vendorSearchOptions:d,defaultRequireReceiptAmount:b,suggestedAllowMerchants:L,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:v})}),[A,f,x,d,b,L,p,h,v]),[V,O]=r.useState(void 0),R=r.useRef(!1);r.useEffect((()=>{R.current||V!=null||M==null||(R.current=!0,O(M))}),[V,M]);const z=r.useCallback((o=>{O(o)}),[]),$=r.useMemo((()=>jt((o=>{s(wt(o))}),250)),[s]);r.useEffect((()=>()=>{$.cancel()}),[$]);const _=r.useCallback((o=>{$(o)}),[$]),D=l.updateFetchState.fetchState,G=t!=null?`/${t}/cards/policy`:"..",Q=r.useCallback((()=>{const o=we(n.state?.pathnameStackToGoBack),E=o.poppedPathname??G;e(E,{state:{pathnameStackToGoBack:o.newStack}})}),[n.state,e,G]),I=r.useCallback((()=>{e(G)}),[e,G]),N=r.useCallback((o=>{if(a==null)return;const E=Cr(o);s(ks(E)),s(Es(a))}),[s,a]),K=r.useRef(D);r.useEffect((()=>{const o=K.current;K.current=D,D==="Completed"&&o!=="Completed"&&(s(Ye({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(G))}),[s,D,e,G]);const J=D==="Error"?l.updateFetchState.error?.message??jo.updatePolicyGenericErrorMessage:void 0;return!g||t==null||a==null?c.jsx(Je,{to:"..",replace:!0}):V!=null&&j==="Completed"&&k.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:m}),c.jsx(eo,{templateName:l.template?.name??"",formDraft:V,vendorSearchOptions:d,categorySearchOptions:x,isVendorSearchLoading:T==="In-Progress",onVendorSearchTextChange:_,submitState:D,submitErrorMessage:J,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:Q,onCancelClick:I,onClickMenuIcon:C,onFormChange:z,onSubmit:N})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:m}),c.jsx(pr,{showUploadDocumentSection:!1,navBarTitle:l.template?.name,onBackClick:Q,onClickMenuIcon:C,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function Fr(e,n,t){return n?e.filter((a=>a!=null&&a.trim().length>0)).slice(0,t):[]}function xr(e){return i((n=>e==null||e===""?{chips:ft,isResolved:!1}:(function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ft:ft,isResolved:s}})(As(n,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Ho,subheadline:Go,pageTitle:$o}}}}=ea.getLocalizedStrings(),zo=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Yo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Re(),y=Fe(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback((_=>{S(_)}),[]),m=r.useCallback((()=>{P(!0)}),[P]),{useFeatureGate:C}=ue(),{isFeatureEnabled:F}=C(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=C(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:l,onAskAiCfoClick:j}=xa({mobileExploreReferrer:"Card Policy"}),B=i((_=>Ds(_))),L=i((_=>Rn(_.createCardPolicyState))),p=i((_=>_s(_.createCardPolicyState))),h=i((_=>p==null?[]:Nn(_.aiCfoState,p).filter((D=>D.kind==="creating_policy"))),_t),v=L.fetchState==="In-Progress"?Math.max(h.length,1):0,u=i((_=>Ps(_.createCardPolicyState))),T=ya(L.fetchState);r.useEffect((()=>{if(T==="In-Progress"&&L.fetchState==="Completed"&&p!=null)h.forEach((_=>{a(yt({chatSessionId:p,id:_.id,entityIds:u,kind:"created_policy"}))}));else if(T==="In-Progress"&&L.fetchState==="Error"&&p!=null){h.forEach((D=>{a(yt({chatSessionId:p,id:D.id,kind:"errored_policy"}))}));const _=L.error?.message!=null&&L.error.message.length>0?L.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;a(Ye({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:_}]}))}}),[L.error?.message,L.fetchState,a,p,u,h,T]);const k=B.fetchState.fetchState;r.useEffect((()=>{k!=="Not-Started"&&k!=="Error"||a(ws())}),[a,k]);const U=B.archiveFetchState.fetchState,A=ya(U);r.useEffect((()=>{A==="In-Progress"&&U==="Completed"&&a(Ye({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[U,a,A]);const b=r.useMemo((()=>B.templates.map(zo)),[B.templates]);Lt({isDataReady:B.fetchState.fetchState==="Completed"});const x=b.length>0||v>0,d=(function(_){const{hasAnyPolicies:D,isChargeCardAdmin:G,isFileUploadEnabled:Q}=_,I=le(),N=he(),{tenantEmailDomain:K}=Ve(),{isAiCfoOpen:J,setIsAiCfoOpen:o}=hr(),E=fr(),W=gr(),ne=i((oe=>Mn(oe))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:q,isResolved:ke}=xr("card_policy"),Te=r.useMemo((()=>Fr(q,ke,3)),[q,ke]),[fe,se]=r.useState(""),Ee=W&&E&&K!=null&&!J,re=r.useCallback((oe=>{if(K==null)return;const fa=ye(N.state?.pathnameStackToGoBack,N.pathname);I(`/${K}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:oe,aiCfoShouldSubmit:oe!=null&&oe.trim().length>0}})}),[N.pathname,N.state,I,K]),Ce=r.useCallback((oe=>{oe.trim().length!==0&&(se(""),re(oe))}),[re]),Ae=r.useCallback((()=>{const oe=fe.trim();oe.length!==0&&(se(""),re(oe))}),[fe,re]),ee=r.useCallback((()=>{}),[]),ve=r.useCallback((oe=>{se(oe)}),[]),De=r.useCallback((()=>{o(!0)}),[o]),ae=r.useCallback((()=>{re(void 0)}),[re]);return r.useMemo((()=>{if(Ee&&!D&&G)return{aiAgentName:$o,headline:Ho,subheadline:Go,promptChips:Te,composer:{currentInput:fe,isSubmitting:ne,isFileUploadEnabled:Q,onInputChange:ve,onSubmit:Ae,onStopSubmit:ee},onPromptClick:Ce,onOpenSidePanel:De,onOpenFullView:ae,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[fe,D,Ee,G,Q,ne,ve,ae,De,Ce,ee,Ae,Te])})({hasAnyPolicies:x,isChargeCardAdmin:y,isFileUploadEnabled:F}),f=w&&d!=null?c.jsx(Sr,{...d}):null,M=l&&f==null,V=r.useCallback((()=>{const _=we(n.state?.pathnameStackToGoBack),D=_.poppedPathname??"..";e(D,{state:{pathnameStackToGoBack:_.newStack}})}),[n.state,e]),O=r.useCallback((()=>{t!=null&&e(`/${t}/cards/policy/new`)}),[e,t]),R=r.useCallback((_=>{t!=null&&e(`/${t}/cards/policy/${_}/edit`)}),[e,t]),z=r.useCallback((_=>{a(Ts(_))}),[a]),$=B.fetchState.fetchState;return!x&&$!=="Completed"&&$!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(ao,{onBackClick:V,onNewPolicyClick:O,onClickMenuIcon:m,isAiCfoAccessEnabled:l,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(to,{policies:b,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:v,onBackClick:V,onNewPolicyClick:O,onEditPolicyClick:R,onArchivePolicyClick:z,onClickMenuIcon:m,policyAiCfoHero:f,isAiCfoAccessEnabled:M,onAskAiCfoClick:j})]})}function Zo(){const e=le(),{cardId:n}=Ve(),t=me(),a=te.getSignedInUser(),s=i((q=>ge(q))),y=Re(),g=Fe(y?.loggedInUserRoleMap),{useFeatureGate:S}=ue();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[P,m]=r.useState(!1),C=i((q=>qa(q).firstViewAfterActivation));if(n==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=S(Z.isChargeCardFeatureEnabled),l=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=S(Z.isDebitCardFeatureEnabled),B=xe(s),L=Be(s),p=Le(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=Oe({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),u=Ue({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:w,isBookKeepingTenant:L,isDebitCardProductVisible:v,chargeCardsCreditAccountLimit:h}),T=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=i((q=>da(q,s.companyId))),U=la(k.controllers),{creditAccount:A,creditAccountRepayment:b}=i((q=>ua(q))),x=i((q=>q.classListState.fetchState)),d=!F&&u&&l,f=i((q=>Tt(q,n,d,u))),[M,V]=r.useState(!1),O=f.chargeCard,R=O?.cardCreatedByUser?.userId,z=i((q=>R!=null?$a(q.userRoleState,R):void 0)),$=z?.accountingClassIDs[0],_=i((q=>$!=null?za(q.classState,{classId:$,reportId:"class_list"}):void 0)),D=O?.cardHolderUser?.userId,G=i((q=>D!=null?$a(q.userRoleState,D):void 0)),Q=G?.accountingClassIDs[0],I=i((q=>Q!=null?za(q.classState,{classId:Q,reportId:"class_list"}):void 0)),N=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",K=O?.type.code==="business_physical_debit_card";r.useEffect((()=>{C&&P===!1&&N&&(m(!0),setTimeout((()=>{t(Ya()),K&&t(Ye({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[C,P,N,K]),r.useEffect((()=>{M||f.fetchState==="Completed"||f.fetchState==="In-Progress"||n==null||(V(!0),t(ka(n,d,!1)))}),[M,f,n,t]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(N===!1||N&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||C===!1&&P===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const q=_e(s.tenantEmailDomain,n,a,O,C);e(q)}}),[f.fetchState,C,N]),r.useEffect((()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&l&&g&&t(Qe()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&u&&l&&g&&t(vt()),x!=="Completed"&&x!=="In-Progress"&&t(Vn())}),[A.fetchState,b.fetchState,t,u,l,g,x]);const J=()=>{if(a!=null&&n!=null){t(Ya());const q=_e(s.tenantEmailDomain,n,a);e(q)}},o=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",E=Xe(u,v,T,l),W=Ba(u,l,g,A,b),ne=Ar(o,f);return f.fetchState!=="Completed"?c.jsx(Ta,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(nt,{showConfetti:C}),c.jsx(no,{onGotItClick:J,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:U,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:l,productInformation:E,creditAccountInformation:W,debitAccountInformation:ne,chargeCardDetailView:f,creditAccount:A,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:_?.className,cardHolderRoles:G?.userRoles,cardHolderDepartmentName:I?.className})]})}const Br="charge-card-transaction-update",Lr="charge-card-transaction-created",Rr="charge-card-transaction-declined",Or="charge-card-transaction-updated",Ur="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ot="credit-account-balance-updated",it="charge-card-created",Gt="charge-card-limit-updated",$t="charge-card-limit-reset",zt="charge-card-renamed",Ko="charge-card-department-updated",jr="charge-card-repayment-completed",Mr="charge-card-payment-date-updated",La="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,n)=>e==null||e===""?[]:n.map((t=>`private-encrypted-${e}.${t}`)),Wo=[Ra,La],qo=Pe((function(e){const n=ma(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(n,t)=>{e(vs({uiState:{sortKey:n,sortOrder:t}}))}}}))(so);function Qo(){const e=le(),n=me(),t=he(),a=te.getSignedInUser(),s=i((j=>ge(j))),{useFeatureGate:y}=ue(),{isFeatureEnabled:g}=y(Z.isCardsCommentingEnabled),[S,P]=r.useState(!1),m=i((j=>ma(j))),C=wr(s.companyId,{clearParams:m.fetchState==="Completed"}),F=r.useCallback((()=>{const j=we(t.state?.pathnameStackToGoBack),B=j.poppedPathname??Jo(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:j.newStack}})}),[e,t,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,Wo),onEvent:j=>{switch(j){case Ra:case La:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect((()=>{S||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(P(!0),n(_a()))}),[S,m,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const l=m.cashbackSummary?.cashbackEarned?.amount!=null&&m.fetchState!=="Not-Started";return m.fetchState!=="In-Progress"||l?(m.cashbackSummary?.cashbackEarned?.amount??0)===0&&m.fetchState==="Completed"?c.jsx(ct,{}):c.jsx(qo,{onBackClick:F,isCardsCommentingEnabled:g,initialOpenThreadRequest:C}):c.jsx(ro,{onBackClick:F})}const Jo=e=>`/${e}/cards`,Xo={containerWidth:new Fa(100,58)},ei=({appContent:e})=>{const n=va(),t=me(),a=le(),{cardId:s}=Ve(),y=he(),{useDynamicConfig:g}=ue(),[S,P]=r.useState(!1),[m,C]=r.useState(!1),[F,w]=r.useState(!1),[l,j]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const L=i((I=>ge(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=g(Ze.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,v=i((I=>Fs(I,s))),u=v.chargeCard,T=i((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:k}=ue(),{isFeatureEnabled:U}=k(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(Z.isDebitCardFeatureEnabled),b=Le(A,L),x=Oe({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:b}),d=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,f=L.userRole.includes("charge_card_user"),M=xe(L),V=Be(L),O=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=Ue({isCardsOnlyTenant:M,isChargeCardFeatureEnabled:U,isBookKeepingTenant:V,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:O}),z=!f&&R&&d;r.useEffect((()=>{S===!1&&T!=="In-Progress"&&T!=="Completed"&&(t(Qa()),P(!0)),m===!1&&v.fetchState==="Not-Started"&&(C(!0),t(ka(s,z,R)))}),[m,v.fetchState,S,T]);const $=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(v.fetchState==="Completed"){if(F===!1&&($===!1||$&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==B.userId)){const I=_e(L.tenantEmailDomain,s,B,u,!0),N=ye(y.state?.pathnameStackToGoBack,y.pathname);a(I,{state:{pathnameStackToGoBack:N}})}else if(F&&v.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(xs({chargeCardId:s}));const I=_e(L.tenantEmailDomain,s,B,u,!0),N=ye(y.state?.pathnameStackToGoBack,y.pathname);t(Ja()),a(I,{state:{pathnameStackToGoBack:N}})}}}),[v.fetchState,u?.type.code,F,v.isRefreshingViewInBackground]);const _=te.getZeniOtpTokenForCardHolder(s),D=i((I=>Hn(I.userState,B.userId))),G=()=>{u?.status?.code!=="active"&&t(Sa(s,!0))};r.useEffect((()=>{v.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(G,3e3),w(!0))}),[v.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const Q=I=>{j(I)};if(T!=="Completed"||u==null)return c.jsx(Ta,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(D?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(ni,{children:[c.jsx(Ie,{isAppContentDrawerOpen:l,handleDrawerToggle:Q}),c.jsx(ai,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:D.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:v,signedInUserToken:_,navigate:a,currentTenant:L,location:y,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Q(!0)}}),e!=null?c.jsx(ti,{windowSize:n,children:e}):null]})},ai=Pe((function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const y=Bs(e.addressState,t);if(y==null)throw Error("Can't access shippingAddress.");const g=Gn(e,s),S=n.updateStatus,P=Ca(e,!1,!1,!1);let m=!1;P.fetchState==="Completed"&&P.cards.length<=1&&(m=!0);const C=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Ls())||C,showMenuIcon:m,shippingAddress:y,vgsVaultId:rt.cardVaultId,twoFAView:g,activationWaitStatus:S,isRefreshingViewInBackground:n.isRefreshingViewInBackground}}),(function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:y,chargeCardDetailState:g}=n,S=g.chargeCard?.cardProviderID,{tenantEmailDomain:P}=y;return{onGetOtp:m=>{S!=null&&e(at(m,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:m=>{e(Os(a,m))},onResendOtp:m=>{S!=null&&e(et(m,"ChargeCardHolder",a))},onVerifyOtp:(m,C)=>{S!=null&&e(Xa(m,C,"ChargeCardHolder",a))},onVerifyOtpSuccess:m=>{m!=null&&te.saveZeniOtpTokenForCardHolder(m,a)},onCVVActivateSuccess:()=>{e(Rs({chargeCardId:a}))},onBackClick:()=>{const m=we(s.state?.pathnameStackToGoBack),C=m.poppedPathname==null||m.poppedPathname.includes("onboard")===!0?ta(P):m.poppedPathname;t(C,{state:{pathnameStackToGoBack:m.newStack}})}}}))(co),ti=He.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Xo.containerWidth.value(e.windowSize)}%`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-0jcT8Dx_.js";import{a as g}from"./sentry-Cix5j_Oe.js";import{h as w,u as x,g as T,i as k,j as b,n as E}from"./core-DrRun-Wp.js";import{z as C,be as P,E as F,g as V,j,ag as O,bf as A,au as L,av as M,w as U}from"./index-CdzL9szH.js";import{eZ as D,gn as B,tX as _,gi as R,c7 as z,PI as G,bn as Y,rY as Z,rM as H,le as J,mP as S,PJ as X,bE as $,cA as N,mZ as q,n0 as K}from"./zeni-epic-state-D1OApLJ3.js";import"./mui-BCzMCgwZ.js";import{d as Q}from"./routePaths-CHhQNN3M.js";import{M as W}from"./MobileAppDrawer-7KFASJmR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="7c39b65b-a3f5-41d7-b1b9-8c9e89fd3d1b",t._sentryDebugIdIdentifier="sentry-dbid-7c39b65b-a3f5-41d7-b1b9-8c9e89fd3d1b")}catch{}})();const ee=E((function(t){const a=R(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}}),(function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=Q(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(q({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map((I=>I.length===2?I:M(I)))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(X(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(J({files:e}))},onDeleteFile:e=>{t(H(e))},onEditFileName:(e,n)=>{t(Z(e,n.split(".")[0]))}}}))(A);function de(){const t=w(),a=x(),i=T(),{tenantEmailDomain:l}=k(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b((s=>s.companyViewState.passportView.fetchState)),o=b((s=>s.companyConfigState.fetchState)),r=b((s=>D(s))),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))}),[c,n,d,a]),g.useEffect((()=>{o==="Not-Started"&&a(_())}),[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-0jcT8Dx_.js";import{a}from"./sentry-Cix5j_Oe.js";import{u as w,g as D,j as u,N as v}from"./core-DrRun-Wp.js";import{Mf as O,eZ as A,g3 as _,oi as j,gw as h,g2 as U,fC as L,Mm as F}from"./zeni-epic-state-D1OApLJ3.js";import{u as $,z as f,L as g,O as k,o as H}from"./index-CdzL9szH.js";import{n as z}from"./mui-BCzMCgwZ.js";import{t as R}from"./getLocaleForTenant-C5iVY_JU.js";import{g as M,Q as P}from"./QBOConnectionScreen-Doubr8Lv.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./empty-BxU8KR-q.js";import"./pdf-lib-gor9sGMc.js";import"./index-BJ6_cpY3.js";import"./url-C58jRUwt.js";import"./index-2hIX2kLH.js";import"./decodeURIComponentSafe-BqXEXApE.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="fadee79e-30e1-406a-9d57-386f12edb84a",t._sentryDebugIdIdentifier="sentry-dbid-fadee79e-30e1-406a-9d57-386f12edb84a")}catch{}})();const G=z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-0jcT8Dx_.js";import{z as n}from"./index-CdzL9szH.js";import{g as d}from"./QBOConnectionScreen-Doubr8Lv.js";import"./sentry-Cix5j_Oe.js";import{g as p,N as s}from"./core-DrRun-Wp.js";import"./zeni-epic-state-D1OApLJ3.js";import"./recharts-BJColP3b.js";import"./mui-BCzMCgwZ.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./empty-BxU8KR-q.js";import"./pdf-lib-gor9sGMc.js";import"./index-BJ6_cpY3.js";import"./url-C58jRUwt.js";import"./index-2hIX2kLH.js";import"./decodeURIComponentSafe-BqXEXApE.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]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|