1import{j as e}from"./vendor-puck-lPnaRYA0.js";import{P as ge,N as Ne,c as O,n as ue,a as Ie,E as q,u as J,l as B,k as _e,aI as $,ce as me,m as De,_ as be,U as je,bT as oe,b as L,d as U,K as I,g as w,d4 as Q,A as H,L as K,j as Te,h as ve,az as Se,e as pe,a2 as X,aB as Ce,bD as Be,q as G,b9 as Fe,ba as Ae,bu as Ee,bv as Re,b1 as Le,bU as Ue,T as Me}from"./index-RB0XfhDF.js";import{u as Ye}from"./useBasketData-uP612E2a.js";import{r as y,u as z,f as We,L as Y,d as He,e as Oe}from"./vendor-react-TOOSQ9Q-.js";import{T as ze}from"./TariffSignupStep-P4rIXuMb.js";import{u as _,t as A}from"./vendor-i18n-eTj0Pfmx.js";import{S as ie,a as fe}from"./SignupUserPage-maAb6Sug.js";import{S as Z}from"./Stepper-qWYpQwc_.js";import{N as Ge}from"./NoResults-eDW_802t.js";import{P as $e}from"./ProductList--0hJS3kJ.js";import{o as W,A as ye,c as N,B as ke,$ as qe,a as we}from"./vendor-bootstrap-fxQA9rHL.js";import{P as M,I as Qe}from"./InvoiceBasketSummary-R5VtebCP.js";import{a as Ve,S as Xe,P as Ke,u as Je}from"./RazorPayQuickCheckout-P78dqooM.js";import{B as ee}from"./ButtonWithConfirmation-wWLdDObD.js";import{u as Ze}from"./PopupManager-nNamE0Xc.js";import{u as et}from"./useSetting-f0U2AO6O.js";import{C as tt}from"./CheckoutBackButton-4zqLcytU.js";import{g as ae}from"./MyPlanSection-9TuvOy4s.js";import{D as R}from"./vendor-luxon-2n2xc3QM.js";import{C as st}from"./CollapsingCard-sw89xTXr.js";import{R as nt,a as ce}from"./ResponsiveTable-7E-TCjI3.js";import{H as at}from"./HelloSignIframe-2PX1r5xo.js";import{E as ot}from"./ESignatureFramePage-ePRmAD9V.js";import{C as te,W as se,F as ne}from"./index-tLEYRpDt.js";import"./vendor-calendar-WlMSM93F.js";import"./vendor-motion-BX6prKAE.js";import"./signalr-_cBiI_oD.js";import"./PlanCard-2LeoZMXu.js";import"./ArkLargeCard-WLFrQjE5.js";import"./index-Wb5kOtrp.js";import"./FilterBarLocationSelector-GZ-KqGvf.js";import"./StickyWrapper-1jcvPfWI.js";import"./SignupForm-igpPFKqC.js";import"./scrollToTop-xXR16Nar.js";import"./EInvoicingCard-YOoP-kvP.js";import"./SaveButton-Zs7dQYK_.js";import"./ActivitySectionLayout-Ue8FYAhm.js";import"./assertThisInitialized-4q6YPdh3.js";import"./InvoiceItemFactory-B6EhNVA7.js";import"./SpreedlyCardForm-c4UepGnM.js";import"./useExternalScript-hhwke5gZ.js";const it=a=>{const{invoiceData:t,checkoutData:s,handleNext:n}=a,{t:i}=_();return e.jsxs(e.Fragment,{children:[e.jsx(ge,{title:i("Join a plan")}),e.jsxs("main",{children:[e.jsx(Ne,{fixedHeader:!0}),e.jsx(ze,{handleNext:n,invoiceData:t,checkoutData:s})]})]})},rt=({count:a=5})=>{const{isSmDown:t}=O();return e.jsx(e.Fragment,{children:Array.from({length:a}).map((s,n)=>e.jsxs("div",{className:ue("d-flex gap-3 rounded-3 bg-body p-3 mb-3",{"flex-column":t}),children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(W,{as:"div",animation:"wave",children:e.jsx(W,{xs:12,className:"rounded-2",style:{height:t?100:120,width:t?100:120}})})}),e.jsxs("div",{className:"flex-fill d-flex flex-column gap-2",children:[e.jsx(W,{as:"div",animation:"wave",children:e.jsx(W,{xs:6,className:"mb-2"})}),e.jsxs(W,{as:"div",animation:"wave",children:[e.jsx(W,{xs:12}),e.jsx(W,{xs:10})]}),e.jsx("div",{className:"d-flex flex-wrap gap-3 mt-auto",children:e.jsx("div",{className:"flex-fill text-end mt-auto",children:e.jsx(W,{as:"div",animation:"wave",children:e.jsx(W,{xs:4,className:"ms-auto",style:{height:24,width:80}})})})})]})]},`skeleton-${n}`))})},ct=a=>{const{t}=_(),{checkoutData:s}=a,n=s.planData,{getProductImageUrl:i}=Ie(),{currentProfile:o}=q(),{httpClient:l,business:d}=J(),r=B.products.products({profileId:o?.Id,selectedPlans:[n?.tariff?.Id??0]}),u=De()(["Products"]),{resource:c}=_e(l,n.tariff?r:null,u,{data:{selectedPlans:[n?.tariff?.Id]}});y.useEffect(()=>{$("signup_store_viewed")},[]);const m=x=>{const b=n.contract.CoworkerProducts;x.forEach(v=>{const T=c?.Products.find(F=>F.Id===v.id),S=b.find(F=>F.ProductId===v.id)?.Quantity??0;T&&v.quantity>S&&$("signup_store_item_added",{product_name:T.Name,product_price:T.Price})});const f=x.map(v=>{const T=c?.Products.find(S=>S.Id===v.id);if(T)return{ProductId:T.Id,Quantity:v.quantity,RegularCharge:v.option==="addToPlan"}}).filter(v=>v!=null).filter(v=>v.Quantity>0),j=be.cloneDeep(n.contract);j.CoworkerProducts=f,n.setContract(v=>({...v,CoworkerProducts:j.CoworkerProducts}))},h=x=>!x.TrackStock||x.AllowNegativeStock?!0:(x.CurrentStock??0)>0,p=(c?.Products??[]).map(x=>({description:x.Description,id:x.Id,image:i(d,x,400,400),name:x.Name,price:x.Price,currencyCode:x.ProductCurrencyCode,quantity:n.contract.CoworkerProducts.find(b=>b.ProductId===x.Id)?.Quantity??0,option:n.contract.CoworkerProducts.find(b=>b.ProductId===x.Id)?.RegularCharge?"addToPlan":"oneOff",alwaysOneOff:x.AlwaysOneOff,alwaysRecurrent:x.AlwaysRecurrent,hasStock:h(x),stockLevel:x.AllowNegativeStock?void 0:x.CurrentStock??0}));return e.jsx("div",{children:e.jsxs(me,{title:t("Add-ons"),canExpand:!1,children:[!c&&e.jsx(rt,{}),c&&e.jsxs(e.Fragment,{children:[p.length==0&&e.jsx(Ge,{}),e.jsx($e,{onProductsChange:m,products:p})]})]})})},lt=a=>{const{signupSteps:t,invoiceData:s,checkoutData:n,handleNext:i,handleBack:o}=a,l=n.planData,d=je();return e.jsx(ie,{stepComponent:e.jsx(ct,{checkoutData:n,invoiceData:s}),checkoutData:n,invoiceData:s,onNext:i,onBack:o,isNextDisabled:s.previewInvoice==null||s.previewInvoice.WasSuccessful===!1,stepperComponent:e.jsx(Z,{currentStep:2,steps:t}),basketSummaryComponent:r=>e.jsx(oe,{basket:l.basket,invoiceData:s,controller:r}),showTeamInfo:!!d.team_guid})},dt=a=>{const{t}=_(),{getRoutePath:s}=L(),{basket:n,selected:i,onSelected:o,invoice:l,tabIndex:d,discountCode:r}=a,{getBoolSetting:u}=U(),c=n.some(h=>h.Type==="contract"),m=()=>s(w.public_signup_checkout,{"*":"complete"},{});return!u(I.payments.spreedly.enabled)||!c&&!u(I.payments.spreedly.enabledForContacts)||c&&!u(I.payments.spreedly.enabledForMembers)?null:e.jsx(M,{onSelected:o,selected:i,title:t("Pay by Card"),subtitle:t("Secure payment processing"),tabIndex:d,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:t("Your payment details are handled securely. Please complete the form below with your payment and billing details.")}),e.jsx(Ve,{getReturnUrl:m,invoice:l,basket:n,discountCode:r,border:!1})]})})},ut=a=>{const{t}=_(),{selected:s,onSelected:n,basket:i,invoice:o,tabIndex:l,discountCode:d}=a,{getBoolSetting:r}=U(),{getRoutePath:u}=L();if(!r(I.payments.stripeCheckout.enabled))return null;const c=()=>`${window.location.origin}${u(w.public_signup_checkout,{"*":"complete"})}`;return e.jsx(M,{onSelected:n,selected:s,title:t("Pay by Stripe"),subtitle:t("Secure payment processing via Stripe"),tabIndex:l,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:t("Your payment details are handled securely by Stripe. Please complete the form below with your payment and billing details.")}),e.jsx(Xe,{discountCode:d,completeUrl:c,invoice:o,basket:i})]})})},le=a=>{const t=z(),{isSmDown:s}=O(),{getRoutePath:n}=L(),{invoiceData:i,selected:o,onSelected:l,tabIndex:d,name:r,description:u,confirmationMessage:c}=a,{t:m}=_(),h=async()=>{await i.createInvoice(B.basket.invoiceCreate,i.basket),setTimeout(()=>{t(n(w.public_signup_checkout,{"*":"complete"},{}))},500)};return e.jsx(M,{onSelected:l,selected:o,title:r??m("Pay later"),subtitle:m("Complete your payment later."),tabIndex:d,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:u??m("You can complete your payment later by selecting this option. Your account may not be activated until payment is completed. We will contact you with further instructions.")}),e.jsx("div",{className:"my-3",children:e.jsx(Q,{})}),e.jsx("div",{className:"float-end mt-2",children:e.jsx(ee,{message:c??m("Do you want to confirm this order and pay later? We may need to contact you with further instructions."),label:m("Complete checkout"),options:{title:m("Complete checkout"),confirmLabel:m("Yes, complete checkout"),cancelLabel:m("Not yet!")}
1,size:s?"lg":"sm",variant:"primary",buttonClassName:s?"w-100 d-flex justify-content-center":"mb-0 p-1 fs-sm",fn:h})})]})})},mt=a=>{const t=z(),{getBoolSetting:s}=U(),{coworker:n,refetchAuth:i}=q(),{business:o,httpClient:l}=J(),{getRoutePath:d}=L(),{basket:r,invoiceData:u,selected:c,onSelected:m,tabIndex:h}=a,{t:p}=_(),{isSmDown:x}=O(),[b,f]=y.useState(!1);Ze({url:`${o.NativeHomeUrlWithLanguage}/Callbacks/GoCardlessPre/?id=${n?.Id}&returnUrl=closepopup`,isOpen:b,onOpen:()=>console.log("Popup opened"),onClose:()=>{f(!1),T()},onMessage:C=>console.log("Message from popup:",C)});const[j,v]=y.useState(!1),T=async()=>{await i();const C=await l.get(B.system.coworker);v(!C.data?.HasGoCardlessContractNumber)},S=()=>{v(!1),f(!0)},F=async()=>{await u.createInvoice(B.basket.invoiceCreate,u.basket),setTimeout(()=>{t(d(w.public_signup_checkout,{"*":"complete"},{}))},500)},P=r.some(C=>C.Type==="contract");return!s(I.payments.goCardless.enabled)||!n?.EnableGoCardlessPayments&&(!P&&!s(I.payments.goCardless.enabledForContacts)||P&&!s(I.payments.goCardless.enabledForMembers))?null:e.jsx(M,{onSelected:m,selected:c,title:p("Pay by Bank Account"),subtitle:p("Secure bank payment processing"),tabIndex:h,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("p",{className:"m-0",children:[p("Depending on your bank, payment can take several days to process. Your account may not be activated until payment is completed.")," ",p("Payments are processed securely through GoCardless.")]}),j&&e.jsxs(ye,{variant:"warning",className:"mt-3",children:[e.jsx("strong",{children:p("Unable to link your bank account")}
1),e.jsx("br",{}),p("We were unable to link your bank account. Please try again or contact us for assistance.")]}),n?.HasGoCardlessContractNumber&&e.jsxs(e.Fragment,{children:[e.jsxs(ye,{variant:"success",className:"mt-3",children:[e.jsx("strong",{children:p("Your bank account is linked")}),e.jsx("br",{}),p("You have a bank account linked to your account with us. Any invoices past due will be automatically paid using GoCardless.")]}),e.jsx("div",{className:"mt-2 text-end",children:e.jsx(ee,{size:x?"lg":"md",buttonClassName:x?"w-100 d-flex justify-content-center":"",message:p("Do you want to confirm this order and pay by bank?"),label:p("Complete checkout"),options:{title:p("Complete checkout"),confirmLabel:p("Yes, complete checkout"),cancelLabel:p("Not yet!")},variant:"primary",fn:F})})]})]}),e.jsx("div",{className:"mt-3",children:e.jsx(Q,{})}),!n?.HasGoCardlessContractNumber&&e.jsx("div",{className:"mt-3 text-end",children:e.jsx(H,{classNames:"mb-0 p-1 fs-sm",size:"sm",variant:"primary",onClick:S,children:p("Link your bank account")}
1)})]})})},pt=a=>{const t=z(),{getRoutePath:s}=L(),{invoiceData:n,selected:i,onSelected:o,tabIndex:l,title:d,subtitle:r,description:u}=a,{t:c}=_(),{isSmDown:m}=O(),h=async()=>{await n.createInvoice(B.basket.invoiceCreate,n.basket),setTimeout(()=>{t(s(w.public_signup_checkout,{"*":"complete"},{}))},500)};return e.jsx(M,{onSelected:o,selected:i,title:d??c("Nothing to pay"),subtitle:r??c("You can complete this transaction without payment."),tabIndex:l,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:u??c("You can complete this transaction without payment. Your account may not be activated until we contact you with further instructions.")}),e.jsx("div",{className:"mt-3",children:e.jsx(Q,{})}),e.jsx("div",{className:"float-end mt-2",children:e.jsx(ee,{message:c("Do you want to confirm this order?"),label:c("Complete checkout"),options:{title:c("Complete checkout"),confirmLabel:c("Yes, complete checkout"),cancelLabel:c("Not yet!")},size:m?"lg":"sm",variant:"primary",buttonClassName:m?"w-100 d-flex justify-content-center":"mb-0 p-1 fs-sm",fn:h})})]})})},ht=a=>{const{t}=_(),{selected:s,onSelected:n,basket:i,invoice:o,tabIndex:l,discountCode:d}=a,{getBoolSetting:r}=U();return r(I.payments.paypalStandardRest.enabled)?e.jsx(M,{onSelected:n,selected:s,title:t("Pay by PayPal "),subtitle:t("Secure payment processing via PayPal"),tabIndex:l,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:t("Your payment details are handled securely by PayPal.")}),e.jsx(Ke,{invoice:o,basket:i,discountCode:d})]})}):null},xt=a=>{const{t}=_(),{selected:s,onSelected:n,invoice:i,basket:o,discountCode:l,tabIndex:d,guestInvoiceToken:r}=a,{payments:u}=U(),{isSmDown:c}=O(),m=u.razorpay?.enabled,{error:h,loading:p,sessionData:x,paymentInitiated:b,razorpayLoaded:f,startPayment:j,verifying:v}=Je({invoice:i,basket:o,discountCode:l,completionRoute:r?w.public_invoice_pay:w.public_signup_checkout,completionRouteParams:r?{}:{"*":"complete"},guestInvoiceToken:r});return!m||!i?.Id&&o.length===0?null:e.jsx(M,{onSelected:n,selected:s,title:t("Pay by RazorPay"),subtitle:t("Secure payment via RazorPay (Cards, UPI, Wallets, Net Banking)"),tabIndex:d,children:e.jsxs(e.Fragment,{children:[s&&e.jsx("p",{children:t("Your payment will be processed securely by RazorPay.")}),s&&p&&e.jsxs("div",{className:"text-center py-3",children:[e.jsx(K,{show:!0}),e.jsx("p",{className:"text-muted mt-2",children:t("Loading payment details...")})]}),s&&v&&e.jsxs("div",{className:"text-center py-3",children:[e.jsx(K,{show:!0}),e.jsx("p",{className:"text-muted mt-2",children:t("Verifying payment...")})]}),s&&h&&e.jsx("div",{className:"alert alert-danger mb-3",children:h}),s&&!p&&!v&&e.jsx("div",{className:"mt-4 text-center",children:e.jsx(H,{onClick:j,variant:"primary",disabled:!f||b||v,classNames:c?"w-100":void 0,children:t(f&&x?"Submit Payment":f?"Continue to Payment":"Loading RazorPay...")})}),s&&e.jsx("div",{className:"mt-3",children:e.jsx(Q,{})})]})})},de="forte-checkout-v2",ft=a=>{const{t}=_(),{selected:s,onSelected:n,invoice:i,tabIndex:o}=a,{getBoolSetting:l}=U(),{httpClient:d}=J(),{coworker:r}=q(),u=z(),{getRoutePath:c}=L(),[m,h]=y.useState(null),[p,x]=y.useState(!1),[b,f]=y.useState(null),j=y.useRef(null),v=l(I.payments.forte.echeckEnabled),T=l(I.payments.forte.creditCardEnabled),S=l(I.payments.forte.useSandbox),F=[...v?["echeck"]:[],...T?["visa","mast","disc","amex"]:[]].join(","),P=S?"https://sandbox.forte.net/checkout/v2/js":"https://checkout.forte.net/v2/js";return y.useEffect(()=>{!s||!i?.Id||(x(!0),f(null),d.get(B.basket.payments.forte.getSignature(i.Id)).then(C=>h(C.data)).catch(C=>f(C?.response?.data??t("Failed to load payment details"))).finally(()=>x(!1)))},[s,i?.Id]),y.useEffect(()=>{if(!m||!j.current)return;const C=document.getElementById(de);C&&C.remove();const k=document.createElement("script");return k.id=de,k.src=P,k.async=!0,k.onload=()=>{setTimeout(()=>{j.current?.click()},500)},document.head.appendChild(k),()=>{const D=document.getElementById(de);D&&D.remove()}},[m,P]),y.useEffect(()=>{if(!s||!i?.Id)return;const C=k=>{let D;
1try{D=typeof k.data=="string"?JSON.parse(k.data):k.data}catch{return}switch(D.event){case"success":d.post(B.basket.payments.forte.result(i.Id),D).then(()=>{u(c(w.public_signup_checkout,{"*":"complete"},{invoice_id:i.Id}))}).catch(re=>{f(re?.response?.data??t("Payment processing failed"))});break;case"failure":f(D.response_description??t("Payment failed"));break}};return window.forteCallback=C,()=>{delete window.forteCallback}},[s,i?.Id]),!v&&!T||!i?.Id?null:e.jsx(M,{onSelected:n,selected:s,title:t("Pay by ACH / eCheck"),subtitle:t("Pay directly from your bank account via Forte"),tabIndex:o,children:e.jsxs(e.Fragment,{children:[p&&e.jsx(K,{show:!0}),b&&e.jsx("div",{className:"alert alert-danger",children:b}),m&&!p&&e.jsxs("div",{children:[e.jsx("p",{children:t("Complete your payment securely via Forte.")}),e.jsx("button",{ref:j,type:"button",className:"btn btn-primary fortebtn",api_access_id:m.apiAccessId,method:"sale",version_number:"2.0",location_id:m.locationId,hash_method:"sha256",allowed_methods:F,embedded:"true",callback:"forteCallback",save_token:"true",total_amount:m.totalAmount,utc_time:m.utcTime,order_number:m.orderNumber,signature:m.signature,billing_name_attr:"edit",billing_name:m.billToName,billing_company_name_attr:"edit",billing_company_name:r?.CompanyName??"",billing_street_line1_attr:"edit",billing_street_line1:m.billToAddress,billing_locality_attr:"edit",billing_locality:m.billToCity,billing_postal_code_attr:"edit",billing_postal_code:m.billToPostCode,billing_email_address_attr:"edit",billing_email_address:r?.Email??"",children:t("Complete payment")}),e.jsx("style",{children:` 2 /* this style needs to be here... */ 3 .fortebtn { 4 display: none; 5 } 6 7 `}),e.jsx("div",{id:"fco-embedded",style:{width:"100%",height:500,marginTop:16}})]})]})})},yt=a=>{const t=z(),{isSmDown:s}=O(),{getRoutePath:n}=L(),{invoiceData:i,selected:o,onSelected:l,tabIndex:d}=a,{t:r}=_(),u=async()=>{const c=await i.createInvoice(B.basket.invoiceCreate,i.basket);t(n(w.public_signup_checkout,{"*":"payment"},{invoice_id:c.Id}))};return e.jsx(M,{onSelected:l,selected:o,title:r("Pay via invoice"),subtitle:r("Create an invoice and choose how to pay it."),tabIndex:d,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:r("We will issue the invoice for this order and open its payment page, where you can choose how to pay.")}),e.jsx("div",{className:"my-3",children:e.jsx(Q,{})}),e.jsx("div",{className:"float-end mt-2",children:e.jsx(ee,{message:r("Do you want to confirm this order and create an invoice?"),label:r("Create invoice"),options:{title:r("Create invoice"),confirmLabel:r("Yes, create invoice"),cancelLabel:r("Not yet!")},size:s?"lg":"sm",variant:"primary",buttonClassName:s?"w-100 d-flex justify-content-center":"mb-0 p-1 fs-sm",disabled:i.isCreatingInvoice,fn:u})})]})})},gt=a=>{const{t}=_(),{selected:s,onSelected:n,invoice:i,tabIndex:o}=a,{payments:l}=U(),{business:d}=J(),[r,u]=y.useState(!1);if(!l.xero.enabled||!i?.UniqueId)return null;const c=()=>{u(!0),window.location.href=`${d.NativeHomeUrlWithLanguage}/integrations/xero/pay/?invoiceid=${i.UniqueId}`};return e.jsx(M,{onSelected:n,selected:s,title:t("Pay by Xero"),subtitle:t("You will be redirected to Xero to complete payment for this invoice."),tabIndex:o,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:t("You will be redirected to Xero to complete payment for this invoice.")}),e.jsx("div",{className:"float-end mt-2",children:e.jsx(H,{variant:"primary",size:"sm",disabled:r,onClick:c,classNames:"mb-0 p-1 fs-sm",children:t(r?"Redirecting to Xero...":"Complete payment")})})]})})},bt=a=>{const{config:t}=Te(),{invoiceData:s,selected:n,onSelected:i,tabIndex:o,name:l,description:d,confirmationMessage:r}=a,{t:u}=_(),{isSmDown:c}=O(),m=async()=>{const h=await s.createInvoice(B.basket.invoiceCreate,s.basket),p=`https://${t.apiBaseUrl}/callbacks/hostedPagePaymentsStart`;setTimeout(()=>{window.location.href=`${p}?invoiceId=${s.invoiceId??h?.Id}&providerKey=${a.providerIndex}`},500)};return e.jsx(M,{onSelected:i,selected:n,title:l??u("Pay"),subtitle:u("Complete your payment with our secure hosted provider."),tabIndex:o,children:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:d??u("You will be redirected to our secure hosted payment provider to complete your payment. Your account may not be activated until payment is completed. We will contact you with further instructions if needed.")}),e.jsx("div",{className:"my-3",children:e.jsx(Q,{})}),e.jsx("div",{className:"float-end mt-2",children:e.jsx(ee,{message:r??u("Do you want to confirm this order and proceed to payment? We will redirect you to our secure hosted payment provider. Your account may not be activated until payment is completed. We will contact you with further instructions if needed."),label:u("Complete checkout"),options:{title:u("Complete checkout"),confirmLabel:u("Yes, complete checkout"),cancelLabel:u("Not yet!")}
7,variant:"primary",size:c?"lg":"sm",buttonClassName:c?"w-100 d-flex justify-content-center":"mb-0 p-1 fs-sm",fn:m})})]})})},Pe="checkout_back_url",jt=a=>{const{invoiceData:t,checkoutData:s}=a,{getRoutePath:n}=L(),{hasBilling:i,payments:o}=U(),l=We(),[,d]=ve(Pe,l.pathname+l.search);y.useEffect(()=>{d(l.pathname+l.search)},[l]);const{t:r}=_(),{coworker:u}=q(),{value:c,setSetting:m}=et("checkout_selectedPaymentMethod"),[h,p]=y.useState(c),x=s.planData,b=(s.proposalData?.Invoices??[]).some(F=>F.Paid),f=t.ok&&t.previewInvoice&&t.previewInvoice.CoworkerId!=u?.Id,j=b||(t.previewInvoice?t.previewInvoice.DueAmount<=0:!1),v=i&&o.xero.enabled&&!j&&!f&&!t.existingInvoice,T=i&&o.xero.enabled&&!!t.existingInvoice?.UniqueId;y.useEffect(()=>{c&&!be.isEqual(c,h)&&p(c)},[c]),y.useEffect(()=>{h&&m(h)},[h]),y.useEffect(()=>{b&&m("NothingToPay")},[b]),y.useEffect(()=>{$("signup_payment_started",{payment_method:h})},[]);let S=0;return e.jsxs("div",{className:"d-flex flex-column gap-4 justify-content-center mt-0",children:[i&&e.jsx("div",{children:r("Choose your preferred payment method")}),!o.hasPaymentGateway&&!f&&!j&&e.jsxs("div",{children:[e.jsx(Se,{variant:"warning",children:r("No payment methods available. Please contact us to arrange an alternative payment method.")}),e.jsxs("div",{className:"d-flex gap-2 mt-2",children:[e.jsx(H,{variant:"outline-primary",as:Y,to:n(w.public_contact),children:r("Contact us")}),e.jsx(H,{variant:"primary",as:Y,to:n(w.user_help_desk,void 0,{action:"create"}),children:r("Open a support ticket")})]})]}),!i&&e.jsx(le,{tabIndex:++S,invoiceData:t,name:r("Confirm your subscription"),confirmationMessage:r("Do you want to confirm your subscription? We will contact you with further instructions to complete the payment and activate your account."),description:r(" We will contact you with further instructions to complete the payment and activate your account."),onSelected:()=>p("GoCardless"),selected:h=="GoCardless",basket:x.basket}),i&&e.jsxs(e.Fragment,{children:[f&&e.jsx(e.Fragment,{children:e.jsx(le,{tabIndex:++S,invoiceData:t,name:r("Pay via team"),description:r("These
7charges and any future charges associated with this plan will be paid by your team."),onSelected:()=>p("GoCardless"),selected:h=="GoCardless",basket:x.basket})}),!f&&e.jsxs(e.Fragment,{children:[!b&&e.jsxs(e.Fragment,{children:[o.goCardless.enabled&&e.jsx(mt,{tabIndex:++S,invoiceData:t,onSelected:()=>p("GoCardless"),selected:h=="GoCardless",basket:x.basket}),!j&&!t.checkoutInvoice&&t.previewInvoice&&e.jsx(le,{tabIndex:++S,invoiceData:t,onSelected:()=>p("Spreedly"),selected:h=="Spreedly",basket:x.basket}),v&&e.jsx(yt,{tabIndex:++S,invoiceData:t,onSelected:()=>p("PayViaInvoice"),selected:h=="PayViaInvoice"})]}),j&&e.jsx(pt,{tabIndex:++S,invoiceData:t,onSelected:()=>p("NothingToPay"),selected:h=="NothingToPay",basket:x.basket,title:b?"Proposal already paid":"Nothing to pay",subtitle:b?"You have already paid the charges for this proposal.":"You can complete this transaction without payment. Your account may not be activated until we contact you with further instructions.",description:b?"You have already paid the charges for this proposal.":"You can complete this transaction without payment. Your account may not be activated until we contact you with further instructions."}),!j&&t.checkoutInvoice&&e.jsxs(e.Fragment,{children:[o.spreedly.enabled&&e.jsx(dt,{tabIndex:++S,invoice:t.existingInvoice,onSelected:()=>p("Spreedly"),selected:h=="Spreedly",basket:x.basket,discountCode:t.discountCode}),o.stripe.enabled&&e.jsx(ut,{tabIndex:++S,invoice:t.existingInvoice,onSelected:()=>p("StripeCheckout"),selected:h=="StripeCheckout",basket:x.basket,discountCode:t.discountCode}),o.paypal.enabled&&e.jsx(ht,{tabIndex:++S,invoice:t.existingInvoice,onSelected:()=>p("PayPalStandardRest"),selected:h=="PayPalStandardRest",basket:x.basket,discountCode:t.discountCode}),o.razorpay.enabled&&e.jsx(xt,{tabIndex:++S,invoice:t.existingInvoice,onSelected:()=>p("RazorPay"),selected:h=="RazorPay",basket:x.basket,discountCode:t.discountCode}),o.forte.enabled&&e.jsx(ft,{tabIndex:++S,invoice:t.existingInvoice,onSelected:()=>p("Forte"),selected:h=="Forte"}),T&&e.jsx(gt,{tabIndex:++S,invoice:t.existingInvoice,onSelected:()=>p("Xero"),selected:h=="Xero"}),[o.hostedPaymentProviders.providers[0]?.enabled,o.hostedPaymentProviders.providers[1]?.enabled,o.hostedPaymentProviders.providers[2]?.enabled].map((F,P)=>{if(!F)return null;const C=P+1,k=[o.hostedPaymentProviders.providers[0]?.name,o.hostedPaymentProviders.providers[1]?.name,o.hostedPaymentProviders.providers[2]?.name][P]||r("Hosted payment");return e.jsx(bt,{tabIndex:++S,providerIndex:C,invoiceData:t,onSelected:()=>p(k),selected:h==k,basket:x.basket,name:k},C)})]})]})]})]})},vt=a=>{const{message:t}=a;return e.jsx("div",{children:e.jsx(N,{className:"p-4",children:e.jsx("div",{className:"justify-content-center",children:e.jsxs("div",{className:"text-center p-4",children:[e.jsx("p",{children:e.jsx(K,{show:!0,scale:2})}),e.jsx("p",{children:t})]})})})})},St=a=>{const{hasBilling:t}=U(),{t:s}=_(),{currentStepIndex:n,signupSteps:i,invoiceData:o,checkoutData:l,handleNext:d,handleBack:r}=a,u=y.useMemo(()=>e.jsx(me,{title:s(t?"Payment":"Summary"),children:e.jsx(jt,{checkoutData:l,invoiceData:o})}),[l]),c=y.useMemo(()=>e.jsx(vt,{message:s("Loading payment options, it won't be long...")}),[]),m=o.previewInvoice==null?c:u,h=o.existingInvoice==null||o.previewInvoice!=null;return e.jsx(e.Fragment,{children:e.jsx(ie,{existingInvoice:o.existingInvoice!=null,stepComponent:m,checkoutData:l,invoiceData:o,onNext:d,onBack:r,showBasketPanel:h,isNextDisabled:o.previewInvoice==null||o.previewInvoice.WasSuccessful===!1,hasNextButton:!1,stepperComponent:e.jsx(Z,{currentStep:n,steps:i}),basketSummaryComponent:p=>o.existingInvoice!=null?e.jsx(Qe,{invoiceData:o}):e.jsx(oe,{hasNextButton:!1,basket:l.planData.basket,invoiceData:o,controller:p}),showTeamInfo:!1})})},Ct=a=>{const{t}=_(),{proposal:s}=a,n=s.Contracts.flatMap(o=>({TariffId:o.Tariff?.Id,TariffName:o.Tariff?.Name,TermsAndConditions:o.Tariff?.TermsAndConditions})).filter(o=>o.TermsAndConditions),i=Array.from(new Map(n.map(o=>[o.TariffId,o])).values());return e.jsx(e.Fragment,{children:e.jsxs("div",{children:[i.length===0&&t("Please confirm you wish to accept this proposal."),i.length!==0&&t("Please review and accept the terms and conditions before proceeding."),i.map((o,l)=>e.jsx(N,{className:"mb-3",children:e.jsxs(N.Body,{className:"terms-and-conditions p-0 last-p-no-margin",children:[e.jsx(N.Title,{className:"mb-3",children:t('Terms and Conditions for "{{tariffName}}"',{tariffName:o.TariffName})}),e.jsx(Ce,{children:o.TermsAndConditions})]})},l))]})})},kt=a=>{const{checkoutData:t}=a,{confirm:s}=pe(),n=z(),{getRoutePath:i}=L(),{t:o}=_();if(!t?.proposalData?.Proposal)return e.jsx("div",{className:"text-center",children:e.jsx(K,{scale:1.5,show:!0})});const l=t.proposalData.Proposal,d=t.proposalData.BillRun,r=async()=>{await t.loginWithProposal(),$("signup_proposal_accepted"),setTimeout(()=>{n(i(w.public_signup_checkout,{"*":"account"},"keep"))},1e3)},u=async()=>{await s({render:c=>e.jsx(Ct,{controller:c,proposal:l})},{size:"lg",title:o("Accept proposal"),confirmText:o("Accept and continue"),cancelText:o("Never mind"),confirmHandler:()=>r})};return e.jsxs(e.Fragment,{children:[e.jsx(ge,{title:o("Your proposal from {{locationName}}",{locationName:l.IssuedBy.Name})}),e.jsx("div",{className:"mb-4",children:e.jsxs(me,{title:o("Your proposal from {{locationName}}",{locationName:l.IssuedBy.Name}
7),children:[e.jsx(wt,{proposal:l,t:o}),e.jsx(Pt,{proposal:l,t:o})]})}),e.jsx(Dt,{proposal:l,billRun:d,t:o}),e.jsxs("div",{className:"my-4 d-flex justify-content-end gap-2",children:[e.jsx(H,{as:Y,to:i(w.public_contact),variant:"outline-primary",children:o("Contact us")}),e.jsx(H,{variant:"primary",disabled:t.proposalData?.Proposal==null,onClick:u,children:o("Accept proposal")})]})]})},wt=({proposal:a,t})=>e.jsx("div",{className:"mb-4",children:a.HasExpired&&e.jsx(Se,{variant:"warning",children:t("This proposal has expired. Please contact us for more information.")})}),Pt=({proposal:a,t})=>a.HasFileToSend?e.jsxs(e.Fragment,{children:[e.jsx("iframe",{src:`${a.IssuedBy.NativeHomeUrl}/api/public/proposals/${a.UniqueId}/pdf?download=false`,title:t("Proposal PDF"),width:"100%",height:"600px",className:"border-0"}),e.jsx(ke,{className:"p-0 mt-3",variant:"link",href:`${a.IssuedBy.NativeHomeUrl}/api/public/proposals/${a.UniqueId}/pdf?download=true`,children:t("Download proposal PDF")})]}):e.jsx("div",{className:"d-flex flex-column gap-4",children:a.Contracts.map(s=>e.jsx(Nt,{contract:s,proposal:a,t},s.UniqueId))}),Nt=({contract:a,proposal:t,t:s})=>e.jsxs("div",{children:[e.jsx("h5",{className:"mb-3 fs-5 fw-bolder",children:a.Tariff?.Name}),e.jsx(N,{className:"mb-3 rounded-3",children:e.jsxs(N.Body,{className:"d-flex flex-column gap-5",children:[e.jsx(It,{contract:a,t:s}),e.jsx(_t,{contract:a,proposal:t,t:s})]})})]}),It=({contract:a,t})=>{const s=i=>i?R.fromISO(i).toLocaleString(R.DATE_MED):"â",n=()=>{if(a.ContractTermUtc)return a.ContractTermUtc;const i=a.Tariff?.DefaultContractTerm;return i&&i>0&&a.StartDateUtc?R.fromISO(a.StartDateUtc).plus({months:i}).toISO():null};return e.jsxs("div",{className:"d-flex justify-content-between flex-md-row flex-column gap-3",children:[e.jsxs("div",{className:"d-flex flex-column gap-3 flex-fill",children:[e.jsx("strong",{children:t("Start date")}),s(a.StartDateUtc)]}),e.jsxs("div",{className:"d-flex flex-column gap-3 flex-fill",children:[e.jsx("strong",{children:t("Minimum term")}),s(n())]}),e.jsxs("div",{className:"d-flex flex-column gap-3 flex-fill",children:[e.jsx("strong",{children:t("Cancellation date")}),s(a.CancellationDateUtc)]}),e.jsxs("div",{className:"d-flex flex-column gap-3 flex-fill",children:[e.jsx("strong",{children:t("Billed on")}),a.BillingDay?t("Day {{day}}, {{renewalLabel}}",{day:a.BillingDay,renewalLabel:ae(t,a)}):"â"]})]})},_t=({contract:a,proposal:t,t:s})=>e.jsxs("div",{className:"d-flex flex-column gap-5",children:[e.jsx(N,{className:"border-1 rounded-4 p-0 overflow-hidden",children:e.jsxs(nt,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 fw-bolder rounded-end-0 fs-base bg-secondary-subtle",children:s("Item")}),e.jsx("th",{className:"p-3 text-end fs-base fw-bolder bg-secondary-subtle",children:s("Qty.")}),e.jsx("th",{className:"p-3 text-end fw-bolder rounded-start-0 fs-base bg-secondary-subtle",children:s("Price")})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsxs("td",{valign:"middle",className:"fw-bolder px-4 py-3 border-0",children:[e.jsx(ce,{children:s("Plan")}),a.Tariff?.Name]}),e.jsxs("td",{valign:"middle",className:"fw-bolder text-end px-4 py-3 border-0",children:[e.jsx(ce,{children:s("Quantity")}),a.Quantity]}),e.jsxs("td",{valign:"middle",className:"fw-bolder text-end px-4 py-3 border-0",children:[e.jsx(ce,{children:s("Price")}),X(a.Tariff.Currency.Code,a.TotalPrice),e.jsx("br",{}),e.jsx("span",{className:"text-body fw-light",children:ae(s,a)})]})]}),t.Products.map(n=>e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:"fw-bold",children:n.Product.Name}),n.RepeatFromUtc&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("small",{children:s("From {{date}}",{date:R.fromISO(n.RepeatFromUtc).toLocaleString(R.DATE_MED)})})]}),n.RepeatUntilUtc&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("small",{children:s("Until {{date}}",{date:R.fromISO(n.RepeatUntilUtc).toLocaleString(R.DATE_MED)})})]})]}),e.jsx("td",{className:"text-end",children:n.Quantity}),e.jsxs("td",{className:"text-end",children:[X(a.Tariff.Currency.Code,n.Price),e.jsx("br",{}),e.jsx("span",{className:"text-body",children:n.IsContractProduct?ae(s,a):s("One-time charge")}
7)]})]},n.UniqueId))]})]})}),t.Notes&&e.jsxs("div",{className:"d-flex flex-column gap-3",children:[e.jsx("h6",{className:"fw-bolder mb-0",children:s("Notes")}),e.jsx("div",{className:"notes-content",children:e.jsx(Ce,{children:t.Notes})})]}),a.Schedules?.length>0&&e.jsxs("div",{className:"d-flex flex-column",children:[e.jsx("div",{className:"fw-bolder mb-3",children:s("Scheduled price changes")}),a.Schedules.map((n,i)=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"d-flex justify-content-between gap-2",children:[e.jsx("div",{className:"items-center fw-bolder",children:s("From {{date}}",{date:R.fromISO(n.ApplyOn).toLocaleString(R.DATE_MED)})}),e.jsxs("div",{className:"text-end",children:[e.jsx("div",{className:"fw-bolder",children:X(a.Tariff.Currency.Code,n.Price)}),a.BillingDay?s("Day {{day}}, {{renewalLabel}}",{day:a.BillingDay,renewalLabel:ae(s,a)}):"â"]})]},n.UniqueId),i<a.Schedules.length-1&&e.jsx("hr",{className:"my-3"})]}))]})]}),Dt=({proposal:a,billRun:t,t:s})=>{if(!t||!t.length)return null;const n=Tt(t),i=Ft(n,a,s);return e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"mb-3 fs-4 fw-bolder",children:s("Payment schedule")}),i]})},Tt=a=>Object.entries(a.reduce((s,n)=>(s[n.Date]=s[n.Date]||[],s[n.Date].push(n),s),{})).map(([s,n])=>({date:s,items:n,total:n.reduce((i,o)=>i+Number(o.Total??0),0)})).sort((s,n)=>s.date.localeCompare(n.date)),Bt=a=>{const t=a.items.map(s=>({d:s.Description,t:Number(s.Total??0)})).sort((s,n)=>s.d.localeCompare(n.d)||s.t-n.t);return JSON.stringify(t)},Ft=(a,t,s)=>{const n=[];let i=null,o=null,l=0;const d=()=>{i&&n.push(e.jsxs("div",{className:"mb-2",children:[e.jsx(st,{expandLabel:s("View"),label:e.jsxs("div",{className:"d-flex justify-content-between align-items-center gap-3",children:[e.jsx("div",{className:"fw-bolder",children:R.fromISO(i.date).toLocaleString(R.DATE_MED)}),e.jsx("div",{className:"text-body fw-bolder",children:X(t.Tariff?.Currency?.Code||t.IssuedBy?.Currency?.Code,i.total)})]}),children:e.jsx(N,{className:"border-1 rounded-4 p-0 overflow-hidden",children:e.jsxs(qe,{responsive:!0,className:"m-0 p-0",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"bg-secondary-subtle p-3",children:s("Item")}),e.jsx("th",{className:"text-end bg-secondary-subtle p-3",children:s("Qty.")}),e.jsx("th",{className:"text-end bg-secondary-subtle p-3",children:s("Price")})]})}),e.jsx("tbody",{children:i.items.map((r,u)=>e.jsxs("tr",{children:[e.jsx("td",{className:"fw-bold py-3 px-4 border-0",children:r.Description}),e.jsx("td",{className:"text-end py-3 px-4 border-0",children:"1"}),e.jsx("td",{className:"text-end py-3 px-4 border-0",children:X(t.IssuedBy.Currency.Code,r.Total)})]},u))})]})})}),l>0&&e.jsxs("div",{className:"d-flex align-items-center gap-2 my-3",children:[e.jsx("hr",{className:"flex-grow-1 border-dark"}),l===1?s("Same price for 1 more month"):s("Same price for the next {{months}} months",{months:l,count:l}),e.jsx("hr",{className:"flex-grow-1 border-dark"})]})]},i.date))};for(const r of a){const u=Bt(r);if(o===null){i=r,o=u;continue}u===o?l++:(d(),i=r,o=u,l=0)}return d(),n},At=a=>{const{t}=_(),s=z(),{confirm:n}=pe(),{signupSteps:i,checkoutData:o}=a,l=async()=>{const d="/";await n(t("Are you sure you want to exit the sign-up process?"),{title:t("Exit sign-up?"),confirmText:t("Exit sign-up"),cancelText:t("Continue"),confirmButtonClass:"btn btn-danger"})&&setTimeout(()=>{s(d)},500)};return e.jsxs("div",{children:[e.jsx(Be,{children:e.jsxs("div",{className:"d-flex justify-content-between align-items-top w-100",children:[e.jsx("div",{className:ue("flex-grow-0"),children:e.jsx(tt,{buttonClassName:"text-body fw-light"})}),e.jsx("div",{className:"flex-fill",children:e.jsx(Z,{currentStep:1,steps:i})}),e.jsx("div",{className:ue("flex-grow-0"),children:e.jsx(ke,{variant:"link",className:"text-body pt-1",children:e.jsx(G,{name:"close",className:"cursor-pointer",onClick:l})})})]})}),e.jsx(we,{className:"my-7",children:e.jsx(kt,{checkoutData:o})})]})},Et=a=>{const{t}=_(),{httpClient:s}=J(),{controller:n,checkoutData:i,onSignatureComplete:o}=a,l=i.proposalData?.Proposal,[d,r]=y.useState(null),u=async()=>
7{if(l){const h=B.proposals.esign.start(l.UniqueId),p=await s.get(h.url);r(p.data)}};y.useEffect(()=>{n.setNextEnabled(!1)},[]),y.useEffect(()=>{u()},[l]);const c=()=>{$("signup_signature_completed"),n.setNextEnabled(!0),o&&o()},m=!!d&&!!l;return e.jsxs(we,{className:"p-0",children:[m&&e.jsx(at,{onComplete:c,fileId:d.Id,prompt:""}),!m&&e.jsx(ot,{message:t("Preparing your document for signing... Please wait.")})]})},Rt=a=>{const[t,s]=y.useState(!1),{signupSteps:n,invoiceData:i,checkoutData:o,handleNext:l,handleBack:d}=a,r=o.planData;return e.jsx(ie,{stepComponent:{render:u=>e.jsx(Et,{onSignatureComplete:()=>s(!0),controller:u,checkoutData:o,invoiceData:i})},checkoutData:o,invoiceData:i,onNext:l,onBack:d,isNextDisabled:i.previewInvoice==null||i.previewInvoice.WasSuccessful===!1,stepperComponent:e.jsx(Z,{currentStep:3,steps:n}),showBasketPanel:t,basketSummaryComponent:u=>e.jsx(oe,{basket:r.basket,invoiceData:i,controller:u})})},Lt=a=>{const{onPaymentFailed:t}=a,[s]=He(),{refetchAuth:n}=q(),{controller:i,invoiceData:o}=a,l=y.useRef(!1),d=s.get("stripe_session_id"),r=s.get("spreedly_session_id"),u=s.get("invoice_id"),c=s.get("paypal_session_id"),m=s.get("razorpay_session_id"),h=[d,r,c,m].every(f=>!f),p=d?"stripe":r?"spreedly":c?"paypal":m?"razorpay":"manual",x=y.useCallback(f=>{!f||l.current||(l.current=!0,$("signup_completed",{plan_name:[...new Set(f.Lines?.filter(j=>j.TariffName).map(j=>j.TariffName))].join(", "),payment_method:p,value:f.DueAmount,currency:f.Currency?.Code,...Fe()}))},[p]),[b]=ve(Pe,"/");return y.useEffect(()=>{n(),Ae(),i.setBackVisible(!1),i.setNextVisible(!1)},[]),e.jsxs(e.Fragment,{children:[d&&e.jsx(te,{endpoint:B.basket.payments.stripeCheckout.sessionStatus(d,1),renderWaiting:()=>e.jsx(se,{}),renderComplete:f=>e.jsx(V,{invoice:f.invoice,onComplete:x}),renderFailed:()=>e.jsx(ne,{goBackUrl:b}),onPaymentFailed:t}),r&&e.jsx(te,{endpoint:u?B.basket.payments.spreedly.invoiceSessionStatus(Number(u),1):B.basket.payments.spreedly.sessionStatus(r,1),renderWaiting:()=>e.jsx(se,{}),renderComplete:f=>e.jsx(V,{invoice:f.invoice,onComplete:x}),renderFailed:()=>e.jsx(ne,{goBackUrl:b}),onPaymentFailed:t}),c&&e.jsx(te,{endpoint:B.basket.payments.paypalStandardRest.sessionStatus(c,1),renderWaiting:()=>e.jsx(se,{}),renderComplete:f=>e.jsx(V,{invoice:f.invoice,onComplete:x}),renderFailed:()=>e.jsx(ne,{goBackUrl:b}),onPaymentFailed:t}),m&&e.jsx(te,{endpoint:B.basket.payments.razorpay.sessionStatus(m),renderWaiting:()=>e.jsx(se,{}),renderComplete:f=>e.jsx(V,{invoice:f.invoice,onComplete:x}),renderFailed:()=>e.jsx(ne,{goBackUrl:b}),onPaymentFailed:t}),h&&e.jsx(V,{invoice:o.previewInvoice,onComplete:x})]})},V=a=>{const{invoice:t,onComplete:s}=a,{getRoutePath:n}=L(),{canAccessSection:i,getBoolSetting:o}=U(),{publicMenuItems:l}=Ee(),{coworker:d}=q(),{isSmDown:r}=O();y.useEffect(()=>{s(t)},[t,s]);const u=r?{minWidth:0,width:"100%",height:"100%",minHeight:120}:{minWidth:180},c=r?"border rounded-2 p-2 flex-fill w-100 h-100 text-center d-flex flex-column justify-content-center align-items-center":"border rounded-2 p-2 flex-fill",m=[{enabledSetting:I.account.account.enabled,element:e.jsxs(N,{as:Y,to:n(w.profile_professional),className:c,style:u,children:[e.jsx(G,{name:"user",className:"mb-2"}),A("Update your profile")]})},{enabledSetting:I.communityBoard.enabled,accessSetting:I.communityBoard.access,element:e.jsxs(N,{as:Y,to:n(w.community_board_list),className:c,style:u,children:[e.jsx(G,{name:"team",className:"mb-2"}),A("Meet the community")]})},{enabledSetting:I.events.enabled,accessSetting:I.events.access,element:e.jsxs(N,{as:Y,to:n(w.public_events,{view:"list"}),className:c,style:u,children:[e.jsx(G,{name:"ticket",className:"mb-2"}),A("Explore our events")]})},{enabledSetting:I.helpdesk.enabled,accessSetting:I.helpdesk.access,element:e.jsxs(N,{as:Y,to:n(w.user_help_desk),className:c,style:u,children:[e.jsx(G,{name:"support",className:"mb-2"}),A("Ask for help")]})},{enabledSetting:I.directory.enabled,accessSetting:I.directory.access,element:e.jsxs(N,{as:Y,to:n(w.community_directory_list),className:c,style:u,children:[e.jsx(G,{name:"team",className:"mb-2"}),A("Find professionals")]})}],h=l.find(p=>p.menuCategory==Re.MeetingSpace);return e.jsxs("div",{children:[e.jsx("div",{children:e.jsxs(N,{className:"p-4 mb-2",children:[e.jsx(N.Title,{className:"text-center mb-2",children:A("You are all done!")}),e.jsxs(N.Body,{className:"text-center",children:[e.jsx("div",{className:"d-flex justify-content-center",children:e.jsx(Le,{duration:3e3})}
7),e.jsx("p",{className:"m-0",children:A("Thank you for completing this transaction!")}),d?.Active&&e.jsx("p",{children:A("You can now access your account and start using our services.")}),!d?.Active&&e.jsx("p",{children:A("Your account is not yet active. We will be in touch soon with next steps.")}),e.jsx(H,{classNames:r?"w-100":"",as:Y,to:n(w.profile_dashboard_personal),variant:"primary",onClick:()=>{},children:A("Access your account")})]})]})}),e.jsxs(N,{children:[e.jsx(N.Header,{className:"text-center",children:e.jsx("h5",{children:A("Next Steps")})}),e.jsx(N.Body,{children:e.jsxs("div",{className:"d-flex flex-wrap gap-3 justify-content-center",children:[h?.children?.[0]!=null&&e.jsxs(N,{as:Y,to:h.children[0].url,className:c,style:u,children:[e.jsx(G,{name:"calendar",className:"mb-2"}),A("Make a booking")]}),m.map((p,x)=>p.enabledSetting&&!o(p.enabledSetting)||p.accessSetting&&!i(p.accessSetting)?null:e.jsx("div",{style:r?{flex:"0 0 calc(33.333% - 0.75rem)"}:{flex:"0 0 auto"},children:p.element},x))]})})]})]})},Ut=a=>{const{signupSteps:t,invoiceData:s,checkoutData:n,handleNext:i,handleBack:o}=a,l=n.planData,[d,r]=y.useState(!1),u=d?[...t.slice(0,-1),{type:"error",name:"Payment Failed"}]:[...t];return e.jsx(ie,{stepComponent:{render:c=>e.jsx(Lt,{onPaymentFailed:()=>r(!0),controller:c,checkoutData:n,invoiceData:s})},showBasketPanel:!1,checkoutData:n,invoiceData:s,onNext:i,onBack:o,isNextDisabled:s.previewInvoice==null||s.previewInvoice.WasSuccessful===!1,stepperComponent:e.jsx(Z,{currentStep:t.length+1,steps:u}),basketSummaryComponent:c=>e.jsx(oe,{basket:l.basket,invoiceData:s,controller:c})})},Ps=()=>{const a=z(),{hasBilling:t,getBoolSetting:s,canSignup:n,canEnquire:i}=U(),{isAuthenticated:o}=q(),{getRoutePath:l}=L(),{t:d}=_(),r=Oe(),{showModal:u}=pe(),c=Ue(),m=Ye(c.planData.basket),h=r["*"],p=m.invoiceId,x=c.proposalId,b=c.planData.basket.some(g=>g.Type==="booking"),f=Me(),j=je(),v=c?.proposalData?.Proposal.HasFileToSign,T=s("Signup.ShowStoreOnSignUp"),S=s("Storecove.Enabled"),F=c.fieldsData?.some(g=>g.Type==="Additional")||S,P=g=>{if(p)return[{name:g(t?"Payment":"Summary"),path:"payment"},{name:g("Complete"),path:"complete"}];if(b)return[{name:g("Account"),path:"account"},{name:g(t?"Payment":"Summary"),path:"payment"},{name:g("Complete"),path:"complete"}];const E=[];return x?E.push({name:g("Proposal"),path:"proposal"}):(E.push({name:g("Membership"),path:"tariffs"}),T&&E.push({name:g("Add-ons"),path:"add-ons"})),E.push({name:g("Account"),path:"account"}),v&&E.push({name:g("Signature"),path:"signature"}),F&&E.push({name:g("Additional details"),path:"additional-details"}),E.push({name:g(t?"Payment":"Summary"),path:"payment"},{name:g("Complete"),path:"complete"}),E},C=P(d).findIndex(g=>g.path===h),k=(g,E)=>{const xe=P(d)[C+1];xe&&a(l(w.public_signup_checkout,{"*":xe.path},g&&E?{plan_id:g.id.toString(),start:E.toISO(),invite_guid:j.invite_guid??void 0,team_guid:j.team_guid??void 0,discountCode:j.discountCode??void 0,refererGuid:j.refererGuid??void 0,...f}:"keep"))},D=()=>{const g=P(d)[C-1];a(g?l(w.public_signup_checkout,{"*":g.path},"keep"):"/")},re=async()=>{await u(e.jsx("p",{children:d("Sorry, we are not able to process your signup at the moment. Please contact us for more information.")}),{title:d("Sign-up unavailable")}),a("/")},he=o||n||i;return y.useEffect(()=>{he||re(),h||a("tariffs"),$("signup_start",{referrer:document.referrer})},[]),he?h=="proposal"?e.jsx(At,{signupSteps:P(d),checkoutData:c,handleNext:k,handleBack:D}):h=="tariffs"?e.jsx(it,{signupSteps:P(d),invoiceData:m,checkoutData:c,handleNext:k,handleBack:D}):h=="signature"?e.jsx(Rt,{signupSteps:P(d),invoiceData:m,checkoutData:c,handleNext:k,handleBack:D}):h=="add-ons"?e.jsx(e.Fragment,{children:e.jsx(lt,{signupSteps:P(d),invoiceData:m,checkoutData:c,handleNext:k,handleBack:D})}):h=="account"?e.jsx(fe,{showPlanAdditionals:!0,currentStepIndex:C+1,fieldsToShow:"default",signupSteps:P(d),invoiceData:m,checkoutData:c,handleNext:k,handleBack:D,showTeamInfo:!!j.team_guid}):h=="additional-details"?e.jsx(fe,{currentStepIndex:C+1,signupSteps:P(d),invoiceData:m,showPlanAdditionals:!0,fieldsToShow:"additional",checkoutData:c,handleNext:k,handleBack:D,showTeamInfo:!!j.team_guid}):h=="payment"?e.jsx(St,{currentStepIndex:C+1,signupSteps:P(d),invoiceData:m,checkoutData:c,handleNext:k,handleBack:D}):h=="complete"?e.jsx(Ut,{signupSteps:P(d),invoiceData:m,checkoutData:c,handleNext:k,handleBack:D}):e.jsx(e.Fragment,{}):null};export{Ps as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.