1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1672],{1672:function(e,l,n){n.r(l),n.d(l,{default:function(){return v}});var i=n(9268),o=n(6006),t=n(639),d=n(1091),s=n(4160),a=n(9872),r=n(8419),m=n(3393);let u=()=>(0,i.jsxs)("div",{className:"flex items-center p-3 bg-[#fa4616] gap-x-2",children:[(0,i.jsx)(m.YFh,{className:"text-xl text-white text-opacity-75 cursor-pointer",onClick:()=>window.location.reload()}),(0,i.jsx)("span",{className:"flex items-center gap-x-1 text-white text-base font-semibold font-[Inter]",children:"Pay with Whop"})]}),c=e=>{var l,n,m,c,v;let{accessToken:x,orderDetails:p,router:h,selectedCurrency:f,mangoData:b,userData:j,billingFields:w}=e,[y,g]=(0,o.useState)(null),N=null==p?void 0:null===(l=p.whopOrder)||void 0===l?void 0:l.sessionId,k=null==p?void 0:null===(n=p.whopOrder)||void 0===n?void 0:n.planId,C=null==p?void 0:null===(m=p.whopOrder)||void 0===m?void 0:m.environment,_=(null==p?void 0:p.mango)||(null==b?void 0:b._id),I=(0,o.useMemo)(()=>(0,r.Ss)(null==p?void 0:p._id),[null==p?void 0:p._id]),P=(0,o.useMemo)(()=>(null==j?void 0:j.email)||(null==w?void 0:w.email)?{email:(null==j?void 0:j.email)||(null==w?void 0:w.email)}:void 0,[null==w?void 0:w.email,null==j?void 0:j.email]),E="".concat((0,t.jK)(f||"")).concat(null==p?void 0:null===(c=p.afterConvenienceAmount)||void 0===c?void 0:null===(v=c.toFixed)||void 0===v?void 0:v.call(c,2)),F=(0,o.useMemo)(()=>({buttonText:"Proceed to pay ".concat(E)}),[E]),A=(0,o.useCallback)(()=>{g(null),h.push((0,r.XL)({mangoId:_,orderId:null==p?void 0:p._id,accessToken:x,mangoTitle:null==b?void 0:b.title,amount:null==p?void 0:p.afterConvenienceAmount,customFields:null==p?void 0:p.customFields,email:null==j?void 0:j.email,name:null==j?void 0:j.name}))},[x,null==b?void 0:b.title,_,null==p?void 0:p._id,null==p?void 0:p.afterConvenienceAmount,null==p?void 0:p.customFields,h,null==j?void 0:j.email,null==j?void 0:j.name]),O=(0,o.useCallback)(e=>{let l=(null==e?void 0:e.message)||"Payment failed, please try again";g(l),(0,d.Eo)(l)},[]),T=(0,o.useCallback)(e=>{let l=(null==e?void 0:e.error_message)||"Please check your billing address";g(l),(0,d.Eo)(l)},[]);return N&&k?(0,i.jsxs)("div",{className:"bg-white border-[0.5px] border-[#e6e9f2] md:rounded-md shadow-sm overflow-hidden pb-3",children:[(0,i.jsx)(u,{}),(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 pt-4 text-sm text-[#32325d] font-[Inter]",children:[(0,i.jsx)("span",{children:"Total payable"}),(0,i.jsx)("span",{className:"font-semibold",children:E})]}),(0,i.jsx)("div",{className:"whopPaymentForm min-h-[480px] px-1 py-2",children:(0,i.jsx)(s.IT,{sessionId:N,planId:k,environment:C,returnUrl:I,skipRedirect:!0,hidePrice:!0,theme:"light",themeOptions:F,prefill:P,onComplete:A,onAddressValidationError:T,onPaymentError:O,fallback:(0,i.jsx)("div",{className:"flex justify-center py-10",children:(0,i.jsx)(a.Z,{})})},N)}),y&&(0,i.jsx)("div",{id:"whop-payment-message",className:"px-3 pt-2 text-sm text-[#fa755a] text-center",children:y}),(0,i.jsxs)("div",{className:"flex items-center text-[10px] text-[#656565] justify-center",children:["Powered by\xa0",(0,i.jsx)("span",{className:"font-semibold",children:"Whop"})]})]}):(0,i.jsxs)("div",{className:"bg-white border-[0.5px] border-[#e6e9f2] md:rounded-md shadow-sm overflow-hidden",children:[(0,i.jsx)(u,{}),(0,i.jsx)("div",{className:"px-3 py-6 text-sm text-[#fa755a] text-center font-[Inter]",children:"Payment session could not be created, please refresh the page and try again."})]})};var v=c}}]);
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.