PageSourceSearch

https://asecure.cloud/assets/UpdateSubscriptionModal-DFebjzW-.js

js asecure.cloud collected 2026-10-02 14:53:15 UTC 12,068 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/toast-DlTzouoe.js","assets/vendor-react-q_qiyTTa.js","assets/vendor-q0W-3L2j.js","assets/vendor-react-dom-CQNok9NA.js","assets/vendor-BtMX7E_C.css","assets/vendor-toast-BkbVYhAd.js","assets/vendor-toast-GNLSjkBZ.css"])))=>i.map(i=>d[i]);
2var z=Object.defineProperty;var R=(a,o,s)=>o in a?z(a,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[o]=s;var r=(a,o,s)=>R(a,typeof o!="symbol"?o+"":o,s);import{_ as E}from"./vendor-syntax-BW49hFqs.js";import{r as _,j as e}from"./vendor-react-q_qiyTTa.js";import{c as I}from"./vendor-redux-Bq68MXSv.js";import{j as U,M as k,I as N,C as J,k as w}from"./vendor-semantic-DUt9fbZG.js";import{aG as q,h as G,as as f,bO as V,B as H}from"./main-CEjC89ce.js";import{aF as W,aG as Q,aH as A,aI as T,aJ as O,aK as Z,aL as K}from"./vendor-q0W-3L2j.js";import{k as X,h as ee}from"./apigw-DaiZDbkq.js";import{F as se}from"./FeedbackModal-D-XgnZU4.js";import"./vendor-utils-Cep4RFcs.js";import"./vendor-react-dom-CQNok9NA.js";import"./vendor-router-BfyMGTt_.js";import"./vendor-yaml-D_yuxGry.js";import"./vendor-toast-BkbVYhAd.js";const te=a=>{E(()=>import("./toast-DlTzouoe.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(o=>{o.showSuccess(a)})},S={style:{base:{base:{fontSize:"18px",color:"#424770",letterSpacing:"0.025em",fontFamily:"Source Code Pro, monospace","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}}}},ne=({stripePromise:a,closePaymentModal:o,proquantity:s,planValue:n,eplanType:t,amount:i,accountsOngoing:d,accountsOneTime:l,subscriptionCode:m,email:h,name:x,yearlyOption:j,licenseType:c})=>{const p=W(),g=y=>{te("Payment successful")},u=Q(),[P,v]=_.useState(!1),F=(y,C,$,Y)=>async()=>{if(v(!0),!y||!C)return;const M=C.getElement(A,T,O),{error:b,paymentMethod:de}=await y.createPaymentMethod({type:"card",card:M});b&&alert(b.message);const{tokenerror:D,token:B}=await y.createToken(M);if(b)v(!1),console.log("error",D);else{let L={name:Y,email:$,accountsOngoing:d,accountsOneTime:l,token:B.id,planId:n,quantity:+s,planType:t,amount:i,subscriptionCode:m,yearlyOption:j,licenseType:c};v(!0),X(L,()=>{o(),g()})}};return e.jsxs(U,{className:"stripeform",onSubmit:F(p,u,h,x),children:[e.jsxs("label",{children:["Card number",e.jsx(A,{options:S})]}),e.jsxs("label",{children:["Expiration date",e.jsx(T,{options:S})]}),e.jsxs("label",{children:["CVC",e.jsx(O,{options:S})]}),e.jsx("button",{style:{float:"right",width:"100%"},id:"stripebutton",type:"submit",disabled:!a||P,children:P?"Processing...":"Pay"})]})};function ae({userSession:a}){return{userSession:a}}const oe=I(ae)(ne),ie=({onClosePaymentModal:a,ispaymentopen:o,quantity:s,planId:n,planType:t,oneTimeAmount:i,email:d,name:l,accountsOngoing:m,accountsOneTime:h,subscriptionCode:x,yearlyOption:j,licenseType:c})=>{const p=Z("pk_live_51HQk4yIlEYyrJHILVEsC6ZJvZYCSf5rBxRDJpolpGSOxtgzyi6j6ppZGkJQAmnWXbpcSmNWBvC6mv5JuGq9mxkTN0060DoecwQ");return e.jsx(K,{stripe:p,children:e.jsx(oe,{stripePromise:p,closePaymentModal:a,proquantity:s,planValue:n,eplanType:t,amount:i,email:d,name:l,accountsOngoing:m,accountsOneTime:h,subscriptionCode:x,yearlyOption:j,licenseType:c})})},ce=a=>{E(()=>import("./toast-DlTzouoe.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(o=>{o.showSuccess(a)})};class re extends _.Component{constructor(s){super(s);r(this,"onLoad",()=>{var d;const{userProfile:s}=this.props.userSession;q("Pricing Modal","Open Modal",s.userId);const n=((d=s==null?void 0:s.subscription)==null?void 0:d.accountsOngoing)||0;let t=this.props.preSelectedAccounts||this.props.currentOngoing||1;n>0&&(n<3?t=3:(n<10,t=10));const i=this.props.preSelectedYearly!==void 0?this.props.preSelectedYearly:!0;this.setState({accountsOngoing:t,yearlyOption:i,currentAccounts:n,ispaymentopen:!1},function(){this.getFinalPrice()})});r(this,"openPaymentModal",()=>{this.setState({ispaymentopen:!0})});r(this,"closePaymentModal",()=>{this.props.dispatch(G()),this.closeModal()});r(this,"closeModal",()=>{this.setState({accountsOngoing:1,ispaymentopen:!1}),this.props.closeModal()});r(this,"handleAccountSelection",s=>{s==="custom"?this.setState({accountsOngoing:0,customAccountInput:""}):this.setState({accountsOngoing:s,customAccountInput:""},function(){this.getFinalPrice()})});r(this,"handleCustomAccountChange",s=>{const n=parseInt(s.target.value)||0;this.setState({customAccountInput:s.target.value,accountsOngoing:n>0?n:0},function(){n>0&&this.getFinalPrice()})});r(this,"handleYearlyToggle",s=>{this.setState({yearlyOption:s},function(){this.getFinalPrice()})});r(this,"getFinalPrice",()=>{const{accountsOngoing:s,yearlyOption:n}=this.state,t=this.calculatePremiumPrice(s,n);
2this.setState({finalPrice:t||0})});r(this,"calculatePremiumPrice",(s,n=!1)=>{let t;if(s===1)t=125;else if(s===3)t=300;else if(s>=10)t=s*75;else return null;return n?Math.round(t*12*.85):t});r(this,"getPerAccountPrice",s=>s===1?125:s===3?100:s>=10?75:null);r(this,"getSavingsPercent",s=>s===3?20:s>=10?40:0);r(this,"handleCancelSubscription",()=>{window.confirm("Are you sure you want to cancel your subscription?")&&ee(()=>{ce("Subscription cancelled"),this.closePaymentModal()})});this.state={ispaymentopen:!1,finalPrice:0,accountsOngoing:1,customAccountInput:"",yearlyOption:!0,showContactModal:!1,currentAccounts:0}}componentDidMount(){}render(){const{ispaymentopen:s,finalPrice:n,accountsOngoing:t,yearlyOption:i,showContactModal:d,currentAccounts:l}=this.state,{email:m,name:h}=this.props.userSession.userProfile,{hideTriggerButton:x,isOpen:j}=this.props,c=this.calculatePremiumPrice(t,i);this.getPerAccountPrice(t);const p=l>=10,g=l>0;return e.jsxs(k,{size:"small",open:j,onMount:this.onLoad,onClose:this.closeModal,className:"update-subscription-modal checkout-modal",trigger:x?null:e.jsx(H,{color:"blue",size:40,content:"Update Subscription",onClick:this.props.openModal}),children:[e.jsx(N,{name:"close",onClick:this.closeModal,style:{position:"absolute",top:"16px",right:"16px",cursor:"pointer",fontSize:"18px",color:"#666",zIndex:1e3}}),e.jsx(k.Content,{children:e.jsx(J,{children:s?e.jsxs("div",{className:"payment-section",children:[e.jsxs("div",{className:"payment-header",children:[e.jsx("h2",{children:"Payment Details"}),e.jsx("p",{children:"Complete your purchase securely"})]}),e.jsx(ie,{onClosePaymentModal:this.closePaymentModal,ispaymentopen:s,quantity:t,planType:"Premium",oneTimeAmount:n,email:m,name:h,accountsOngoing:t,accountsOneTime:0,subscriptionCode:"",yearlyOption:i,licenseType:"ongoing"}),e.jsx("div",{style:{textAlign:"center",marginTop:"20px"},children:e.jsx("a",{href:"#",className:"back-link",onClick:u=>{u.preventDefault(),this.setState({ispaymentopen:!1})},children:"← Back to plan selection"})})]}):e.jsxs("div",{className:"checkout-layout",children:[e.jsxs("div",{className:"checkout-header",children:[e.jsx("h2",{children:"Complete Your Purchase"}),e.jsx("p",{children:"You're almost there! Review your plan and proceed to payment."})]}),e.jsxs("div",{className:"billing-toggle",children:[e.jsxs("button",{className:`toggle-btn ${i?"active":""}`,onClick:()=>this.handleYearlyToggle(!0),children:["Yearly",e.jsx("span",{className:"discount-tag",children:"Save 15%"})]}),e.jsx("button",{className:`toggle-btn ${i?"":"active"}`,onClick:()=>this.handleYearlyToggle(!1),children:"Monthly"})]}),g&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"current-plan-info",children:[e.jsx(N,{name:"info circle"}),e.jsxs("span",{children:["You currently have ",e.jsxs("strong",{children:[l," account",l>1?"s":""]})]})]}),e.jsx("p",{className:"upgrade-prompt",children:"Select an upgrade option below:"})]}),e.jsx("div",{className:"account-selection",children:p?e.jsxs("div",{className:"max-tier-message",children:[e.jsx("p",{children:"You're on our largest self-service plan (10 accounts)."}),e.jsxs("p",{children:["Need more accounts?"," ",e.jsx("a",{href:"#",onClick:u=>{u.preventDefault(),this.setState({showContactModal:!0})},children:"Contact us for enterprise pricing"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"account-buttons",children:[l<1&&e.jsx("button",{className:t===1?"active":"",onClick:()=>this.handleAccountSelection(1),children:"1 account"}),l<3&&e.jsxs("button",{className:t===3?"active":"",onClick:()=>this.handleAccountSelection(3),children:["3 accounts",e.jsx("span",{className:"save-tag",children:"Save 20%"})]}),l<10&&e.jsxs("button",{className:t===10?"active":"",onClick:()=>this.handleAccountSelection(10),children:["10 accounts",e.jsx("span",{className:"save-tag",children:"Save 40%"})]})]}),e.jsxs("p",{className:"custom-note",children:["Need a different number of accounts?"," ",e.jsx("a",{href:"#",onClick:u=>{u.preventDefault(),this.setState({showContactModal:!0})},children:"Contact us for custom pricing"})]})]})}),e.jsxs("div",{className:"order-summary-card",children:[e.jsxs("div",{className:"summary-header",children:[e.jsx("h3",{children:"Premium Plan"}),e.jsxs("span",{className:"plan-badge",children:[t," account",t>1?"s":""]})]}),e.jsxs("div",{className:"summary-details",children:[e.jsxs("div",{className:"detail-row",children:[e.jsxs("span",{children:[t," account",t>1?"s":""," × $125/mo"]}),e.jsxs("span",{children:["$",t*125,"/mo"]})]}),t===3&&e.jsxs("div",{className:"detail-row savings-row",children:[e.jsx("span",{children:"Bundle discount (20% off)"}),e.jsxs("span",{className:"savings-amount",children:["-$",t*125-300,"/mo"]})]}),t===10&&e.jsxs("div",{className:"detail-row savings-row",children:[e.jsx("span",{children:"Bundle discount (40% off)"}),e.jsxs("span",{className:"savings-amount",children:["-$",t*125-750,"/mo"]})]}),e.jsxs("div",{className:"detail-row subtotal-row",children:[e.jsx("span",{children:"Monthly subtotal"}),e.jsxs("span",{children:["$",c?i?Math.round(c/12):c:t*125,"/mo"]})]}),i&&c&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"detail-row",children:[e.jsx("span",{children:"Annual billing (×12 months)"}),e.jsxs("span",{children:["$",Math.round(c/.85)]})]}),e.jsxs("div",{className:"detail-row savings-row",children:[e.jsx("span",{children:"Annual discount (15% off)"}),e.jsxs("span",{className:"savings-amount",children:["-$",Math.round(c/.85)-c]})]})]})]}),e.jsxs("div",{className:"summary-total",children:[e.jsxs("div",{className:"total-row",children:[e.jsx("span",{children:"Total"}),e.jsxs("span",{className:"total-amount",children:["$",c||n,i?"/yr":"/mo"]})]}),e.jsxs("p",{className:"next-cycle-note",children:[i?"Billed annually":"Billed monthly"," starting next cycle"]}),g&&e.jsx("p",{className:"proration-note",children:"* Today you'll be charged a prorated amount to align with your current billing cycle"})]}),e.jsx("button",{className:"checkout-btn",onClick:this.openPaymentModal,disabled:!c||t===0,children:"Continue to Payment"}),e.jsxs("div",{className:"secure-note",children:[e.jsx(N,{name:"lock"}),e.jsx("span",{children:"Secure checkout powered by Stripe"})]})]}),e.jsxs("div",{className:"features-summary",children:[e.jsx("h4",{children:"What's included:"}),e.jsxs("div",{className:"features-grid",children:[e.jsxs("div",{className:"feature-item",children:[e.jsx(f,{}),e.jsx("span",{children:"Unlimited assessments"})]}),e.jsxs("div",{className:"feature-item",children:[e.jsx(f,{}),e.jsx("span",{children:"20+ compliance reports"})]}),e.jsxs("div",{className:"feature-item",children:[e.jsx(f,{}),e.jsx("span",{children:"Well-Architected reviews"})]}),e.jsxs("div",{className:"feature-item",children:[e.jsx(f,{}),e.jsx("span",{children:"Priority support"})]})]})]}),this.props.showCancel&&e.jsx("div",{style:{marginTop:"24px",paddingTop:"24px",borderTop:"1px solid #e5e7eb"},children:e.jsxs(w,{warning:!0,size:"small",children:[e.jsx(w.Header,{children:"Manage Subscription"}),e.jsxs("p",{style:{marginTop:"8px",fontSize:"13px"},children:["To modify or cancel your subscription, contact"," ",e.jsx("strong",{children:V})]})]})})]})})}),d&&e.jsx(se,{isOpen:d,handleCloseFeedback:()=>this.setState({showContactModal:!1}),currentPage:"custom pricing",subject:"Premium Plan Inquiry"})]})}}function le({userSession:a}){return{userSession:a}}const Ce=I(le)(re);export{Ce 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.