1try{let s="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new s.Error).stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="2b2d5547-c72b-4be7-85ed-791b1d4cce56",s._sentryDebugIdIdentifier="sentry-dbid-2b2d5547-c72b-4be7-85ed-791b1d4cce56")}catch(R){}import{r as s,j as e}from"./CSvdPb0x.js";import{b as a,v as n,y as o,yN as t,i6 as d,yO as r,cp as i,b2 as l,bj as c,cv as u,cs as p,yP as m,bO as y,go as h,aP as f,yQ as j,ao as b,bh as g,B as x,cO as w,yR as C,nR as I,fs as N,yS as k,aL as _,iX as v}from"./B97aNPiN.js";import{F as S}from"./i4oUavaI.js";import{P as T,a as A,b as P,C as U}from"./dge5Vv9y.js";import{T as D}from"./CyMd1KRX.js";import{a as L}from"./CZo9ZWI4.js";import{C as M,a as O}from"./RFMGYJeq.js";import"./D6ESIijv.js";import"./DDRd_XHV.js";const B=s.memo(({addonType:B,addonId:R,coupon:$,cleanInvoice:E=!0,isPaymentMethodVisible:Y=!0,planName:q,withYearlyUpgrade:z=!0,onSuccess:F=()=>{},onModalClose:G})=>{const Q=a(),{push:V}=n(),{amount:X,fullAmount:H,errorMessage:J,couponAdded:K,isLoading:W,currency:Z}=o(t),{from_channel:ss}=o(d),es=o(r,{addonId:R}),as=o(i,{addonType:B,duration:30===es?.duration?360:30}),[ns,os]=s.useState($),[ts,ds]=s.useState(),[rs,is]=s.useState(!1),[ls,cs]=s.useState(!1),us=ls?as:es,ps=30===us?.duration?"Monthly":"Yearly",ms=isNaN(X)?e.jsx(l,{height:48,width:120,className:"title-m-t-0"}):e.jsx("span",{children:c(X,{currency:Z})}),{onActivateOlsAddon:ys}=u(),hs=s.useCallback(()=>{Q(p({addons:[{status:!0,addonId:us.id||R}],couponName:ns}))},[ns,us]),fs=s.useCallback(()=>{G(),Q({type:m}),V({pathname:`${y}/${h}`}),setTimeout(()=>Q(f({name:j})),300)},[]),js=s.useCallback(()=>{os(""),Q(p({addons:[{status:!0,addonId:us.id}]}))},[us]);return s.useEffect(()=>()=>E&&Q({type:m}),[]),e.jsxs(M,{children:[e.jsx("h1",{children:"Confirmation"}),e.jsx("p",{children:"Review your order"}),e.jsxs(T,{children:[e.jsxs(A,{children:[e.jsx("p",{children:us?.plan_name||q}),!b(as)&&z&&e.jsxs("div",{className:"tw:flex tw:items-center",children:[e.jsxs("p",{className:"tw:mb-0!",children:["Billed ",ps]}),e.jsx(g,{type:"vertical"}),e.jsx(x,{type:"link",onClick:()=>{const s=ls?es:as;cs(s=>!s),Q(p({addons:[{status:!0,addonId:s.id}],couponName:ns}))},children:"Change"})]})]}),e.jsx(P,{children:ms})]}),e.jsxs(O,{children:[e.jsx(w,{}),"Addon price with applied discounts ",c(H,{currency:Z}),e.jsx(D,{className:"tw:ml-5"})]}),ts&&e.jsx(S,{text:ts,className:"error-message-out",onLink:fs}),3!==ss&&Y&&e.jsx(L,{value:ns,status:J||K,isLoading:W,onChange:s=>os(s),onClick:hs,onClearCoupon:js}),Y&&e.jsx(U,{onChangePayment:fs}),e.jsx(x,{block:!0,size:"large",type:"primary",disabled:J||rs,loading:rs,onClick:async()=>{is(!0);const s=await Q(C({status:!0,addonId:us.id||R,couponName:ns})),e=()=>{Q(f({})),_("success",`${us.plan_name||q} was purchased`),Q({type:m}),F()};if(s)ds(s.toString()),is(!1);else{if(is(!1),B===I){await Q(N({show_ugc_upsell:!1}));const{data:s,error:a}=await k.getUGCUserStatus();return a&&_("error",a),e(),void(s?.ugcUrl&&window.open(s.ugcUrl,"_self","noopener, noreferrer"))}B===v&&ys(),e()}},children:"Confirm"})]})});export{B 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.