1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8165],{8165:(e,t,r)=>{r.d(t,{A:()=>p});var s=r(95155),i=r(58079),a=r(36745),l=r(44882),n=r(65056),o=r(14547),d=r(12115),c=r(45505),x=r(6251),h=r(88397),u=r(475);let m=[{id:"free",name:"Free",price:"$0",priceId:"",credits:5,description:"Good for testing the tool and exploring features.",isFree:!0,features:["1 Live Website","Free LandingHero Hosting","Community Support"]},{id:"personal",name:"Personal",price:"$9",priceId:"pri_01kbg3t9wjf5b21b1brhp8cb4q",credits:50,description:"For your portfolio, business, or special event.",features:["3 Live Websites","Export Code","Custom Domain"]},{id:"growth",name:"Growth",price:"$29",priceId:"pri_01kbg3ts241n9nm8v0wj3j5dn3",credits:200,description:"For freelancers, agencies, and power users.",popular:!0,features:["10 Live Websites","Export Code","Custom Domain"]},{id:"enterprise",name:"Enterprise",price:"$99",priceId:r(82402).env.NEXT_PUBLIC_ENTERPRISE_PRICE_ID_PRODUCTION,credits:1e3,description:"For high-volume teams and agencies.",features:["Unlimited Websites","Export Code (HTML)","Priority Support"]}];function p({isOpen:e,onClose:t,customTitle:r,customDescription:b}){var w;let[g,f]=(0,d.useState)(null),[N,j]=(0,d.useState)(!0),[y,v]=(0,d.useState)(!1),[C,k]=(0,d.useState)(!1),[E,P]=(0,d.useState)(null),[_,I]=(0,d.useState)("NONE"),[A,S]=(0,d.useState)([]),[T,O]=(0,d.useState)(""),{user:F,refreshBillingPlan:L}=(0,h.A)();(0,d.useEffect)(()=>{let t=async()=>{if(!F||!e)return void j(!1);j(!0);try{let e=await (0,x.xu)();f(e)}catch(e){console.error("Failed to fetch billing data:",e)}finally{j(!1)}};e&&t()},[F,e]);let U=(w=g?.plan)?w:"free",$=async()=>{if(!F)return void P({type:"error",text:"Please sign in to manage your plan"});k(!0),P(null);try{let e=await F.getIdToken(),t=await fetch(`${u.C}/api/billing/customer-portal`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),r=await t.json();t.ok&&r.success&&r.portal_url?window.open(r.portal_url,"_blank"):P({type:"error",text:r.message||r.error||"Failed to open customer portal"})}catch(e){console.error("Error opening customer portal:",e),P({type:"error",text:"An error occurred while opening the customer portal. Please try again."})}finally{k(!1)}},D=()=>{I("SURVEY"),P(null)},R=async()=>{if(!F)return void P({type:"error",text:"Please sign in to cancel your subscription"});v(!0),P(null);try{let e=await F.getIdToken(),t=await fetch(`${u.C}/api/billing/cancel-subscription`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({reasons:A.map(e=>"Other"===e?T:e).filter(e=>""!==e)})}),r=await t.json();if(t.ok&&r.success){P({type:"success",text:r.message||"Subscription canceled successfully"});let e=await (0,x.xu)();f(e),I("NONE")}else P({type:"error",text:r.message||r.error||"Failed to cancel subscription"})}catch(e){console.error("Error canceling subscription:",e),P({type:"error",text:"An error occurred while canceling your subscription. Please try again."})}finally{v(!1)}};return e?(0,s.jsx)("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"bg-[#0f0e0d] border border-white/10 rounded-2xl shadow-2xl p-8 max-w-6xl w-full relative max-h-[90vh] overflow-y-auto",children:[(0,s.jsx)("button",{onClick:()=>{L(),I("NONE"),t()},className:"absolute top-6 right-6 w-10 h-10 rounded-lg hover:bg-white/5 flex items-center justify-center transition-colors group",children:(0,s.jsx)(i.A,{className:"w-5 h-5 text-white/40 group-hover:text-white/60 transition-colors"})}),(0,s.jsxs)("div",{className:"text-center mb-10",children:[(0,s.jsx)("h2",{className:"font-primary text-3xl md:text-4xl font-medium text-white mb-3 tracking-tight",children:r||"Choose Your Plan"}),(0,s.jsx)("p",{className:"text-white/60 font-secondary text-base",children:b||"Purchase credits to generate websites and make AI edits."}),E&&(0,s.jsx)("div",{className:`mt-6 p-4 rounded-xl ${"success"===E.type?"bg-green-500/10 text-green-400 border border-green-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:E.text})]}),"NONE"===_?(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:m.map(e=>{let t=e.id===U;return(0,s.jsxs)("div",{className:`relative rounded-2xl p-8 flex flex-col border transition-all duration-300 ${e.popular?"bg-gradient-to-br from-[#EC4899]/10 to-pink-500/10 border-[#
1EC4899]/30 shadow-lg":"bg-white/[0.02] border-white/10 hover:border-white/20"}`,children:[e.popular&&(0,s.jsx)("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:(0,s.jsx)("span",{className:"px-4 py-1.5 text-xs font-bold uppercase tracking-widest rounded-full bg-[#EC4899] text-white shadow-lg",children:"Popular"})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-primary text-xl font-medium text-white mb-2 tracking-tight",children:e.name}),(0,s.jsx)("p",{className:"text-white/60 text-sm font-secondary mb-6 leading-relaxed min-h-[40px]",children:e.description}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-1 mb-1",children:[(0,s.jsx)("span",{className:"text-4xl font-medium text-white tracking-tight",children:e.price}),!e.isFree&&(0,s.jsx)("span",{className:"text-sm text-white/50 font-secondary",children:"/month"})]}),(0,s.jsxs)("div",{className:"text-[#EC4899] text-base font-bold tracking-tight mt-1",children:[e.credits," Credits"]})]}),(0,s.jsxs)("div",{className:"mb-5 border border-white/10 rounded-xl bg-white/[0.02] p-3.5",children:[(0,s.jsxs)("div",{className:"mb-2.5 flex items-center gap-2",children:[(0,s.jsx)(a.A,{className:"h-3 w-3 text-[#EC4899]"}),(0,s.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-[0.2em] text-white/40",children:"Shared Credit Pool"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#EC4899]"}),(0,s.jsx)("span",{className:"text-xs text-white/80",children:"AI Edits"})]}),(0,s.jsxs)("span",{className:"text-xs font-medium text-white/40",children:["up to ",e.credits]})]}),(0,s.jsx)("div",{className:"h-px bg-white/5"}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.A,{className:"h-3.5 w-3.5 text-[#EC4899]"}),(0,s.jsx)("span",{className:"text-xs text-white/80",children:"Voice Conversations"})]}),(0,s.jsxs)("span",{className:"text-xs font-medium text-white/40",children:["up to ",e.credits]})]})]})]}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-white/90 mb-4 tracking-tight",children:"Also includes"}),(0,s.jsx)("ul",{className:"space-y-3",children:e.features.map((e,t)=>(0,s.jsxs)("li",{className:"flex items-start gap-3",children:[(0,s.jsx)(o.A,{className:"w-5 h-5 text-green-400 flex-shrink-0 mt-0.5"}),(0,s.jsx)("span",{className:"text-sm text-white/70 font-secondary leading-relaxed",children:e})]},t))})]})]}),t?e.isFree?(0,s.jsx)("button",{disabled:!0,className:"w-full bg-white/5 text-white/40 font-medium py-3 px-6 rounded-xl cursor-not-allowed text-sm border border-white/10",children:"Current Plan"}):(0,s.jsx)("button",{onClick:$,disabled:C,className:"w-full bg-white hover:bg-white/90 text-black font-medium py-3 px-6 rounded-xl transition-colors disabled:bg-white/20 disabled:text-white/40 disabled:cursor-not-allowed text-sm",children:C?"Opening Portal...":"Manage Plan"}):e.isFree?"free"!==U?(0,s.jsx)("button",{onClick:D,disabled:y,className:"w-full bg-white/10 hover:bg-white/20 text-white/70 font-medium py-3 px-6 rounded-xl transition-colors disabled:bg-white/5 disabled:text-white/40 disabled:cursor-not-allowed text-sm border border-white/10",children:y?"Canceling...":"Cancel & Downgrade to Free"}):(0,s.jsx)("button",{disabled:!0,className:"w-full bg-white/5 text-white/40 font-medium py-3 px-6 rounded-xl cursor-not-allowed text-sm border border-white/10",children:"Current Plan"}):(0,s.jsx)(c.A,{priceId:e.priceId,productId:e.productId||"",redirectURI:`${window.location.origin}/`,className:"w-full bg-white hover:bg-white/90 text-black font-medium py-3 px-6 rounded-xl transition-colors text-sm",children:"free"===U?"Upgrade Now":"Switch To This Plan"})]},e.id)})}):"SURVEY"===_?(0,s.jsxs)("div",{className:"max-w-2xl mx-auto bg-white/[0.02] border border-white/10 rounded-2xl p-8",children:[(0,s.jsx)("h3",{className:"text-2xl font-medium text-white mb-2 text-center",children:"We're sorry to see you go"}),(0,s.jsx)("p",{className:"text-white/60 mb-8 text-center text-sm",children:"Help us improve LandingHero by telling us why you're canceling."}),(0,s.jsx)("div",{className:"space-y-4 mb-8",children:["The price is too high","I don't need these features anymore","Quality of generated landing pages isn't what I expected","Found a better alternative","I'm only using it for one project","It's too difficult to use","Other"].map(e=>(0,s.jsxs)("label",{className:`flex items-center gap-3 p-4 rounded-xl border cursor-pointer transition-all ${A.includes(e)?"bg-white/10 border-white/20":"bg-white/[0.02] border-white/5 hover:bg-white/5"}`,children:[(0,s.jsx)("input",{type:"checkbox",name:"reason",value:e,checked:A.includes(e),onChange:()=>{S(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:"sr-only"}),(0,s.jsx)("div",{className:`w-5 h-5 rounded border flex items-center justify-center transition-colors ${A.includes(e)?"border-[#
1EC4899] bg-[#EC4899]":"border-white/20"}`,children:A.includes(e)&&(0,s.jsx)(o.A,{className:"w-3.5 h-3.5 text-white"})}),(0,s.jsx)("span",{className:"text-white/80",children:e})]},e))}),A.includes("Other")&&(0,s.jsx)("textarea",{placeholder:"Please tell us more...",className:"w-full bg-white/[0.02] border border-white/10 rounded-xl p-4 text-white text-sm mb-8 focus:outline-none focus:border-[#EC4899]/50 transition-colors h-32",value:T,onChange:e=>O(e.target.value)}),(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("button",{onClick:()=>I("NONE"),className:"flex-1 px-6 py-3 rounded-xl border border-white/10 text-white/60 hover:text-white hover:bg-white/5 transition-all",children:"Back"}),(0,s.jsx)("button",{onClick:()=>I("CONFIRM"),disabled:0===A.length||A.includes("Other")&&!T.trim(),className:"flex-1 px-6 py-3 rounded-xl bg-white text-black font-medium hover:bg-white/90 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:"Continue"})]})]}):(0,s.jsxs)("div",{className:"max-w-xl mx-auto bg-white/[0.02] border border-white/10 rounded-2xl p-8 text-center",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-red-500/10 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,s.jsx)(i.A,{className:"w-8 h-8 text-red-500"})}),(0,s.jsx)("h3",{className:"text-2xl font-medium text-white mb-4",children:"Are you sure?"}),(0,s.jsx)("p",{className:"text-white/60 mb-8 text-sm leading-relaxed",children:"If you cancel, you'll lose access to premium features like custom domains, code export, and higher AI credit limits at the end of your current billing period."}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("button",{onClick:()=>I("NONE"),disabled:y,className:"w-full px-6 py-4 rounded-xl bg-white text-black font-medium hover:bg-white/90 transition-all",children:"Changed my mind, keep my plan"}),(0,s.jsx)("button",{onClick:()=>I("SURVEY"),disabled:y,className:"w-full px-6 py-4 rounded-xl bg-white/5 text-white/60 hover:text-white hover:bg-white/10 transition-all font-medium",children:"Back to survey"}),(0,s.jsx)("button",{onClick:R,disabled:y,className:"mt-4 w-full px-6 py-4 rounded-xl border border-white/10 text-white/40 hover:text-red-400 hover:border-red-400/30 transition-all flex items-center justify-center gap-2 text-sm",children:y?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"w-4 h-4 border-2 border-white/20 border-t-white rounded-full animate-spin"}),"Canceling..."]}):"Confirm Cancellation"})]})]})]})}):null}},45505:(e,t,r)=>{r.d(t,{A:()=>d});var s=r(95155),i=r(60736),a=r(12115),l=r(88397),n=r(42601),o=r(6251);function d({priceId:e,productId:t,redirectURI:r,useCheckoutContext:c=!1,className:x="",children:h}){let[u,m]=(0,a.useState)(null),[p,b]=(0,a.useState)(!1),{user:w,loading:g,signInWithGoogle:f}=(0,l.A)();(0,a.useEffect)(()=>{let e="live_a712619cbaeee1cdf97b9017c1e";e?(0,i.Pm)({environment:"production",token:e,eventCallback(e){switch(e.name){case"checkout.closed":console.log("Checkout closed"),b(!1);break;case"checkout.completed":console.log("Checkout completed"),b(!1)}}}).then(e=>{e&&(m(e),console.log("Paddle initialized successfully."))}).catch(e=>{console.error("Error initializing Paddle:",e)}):console.error("Paddle token is not configured. Please check your environment variables: NEXT_PUBLIC_PADDLE_CLIENT_TOKEN_PRODUCTION or NEXT_PUBLIC_PADDLE_CLIENT_TOKEN_STAGING")},[]);let N=async()=>{let t=w;if(!t)try{t=await f()}catch(e){console.error("Sign-in failed:",e);return}if(!u)return void console.error("Paddle is not initialized.");if(!t)return void console.error("User is not available after sign-in.");if(b(!0),!c)return void u.Checkout.open({items:[{priceId:e,quantity:1}],customer:{email:t.email||""},customData:{userId:t.uid,userEmail:t.email||""},settings:{successUrl:r}});try{let t=await (0,o.SB)(),s=t.paddle_customer?.id?{id:t.paddle_customer.id}:t.paddle_customer?.email?{email:t.paddle_customer.email}:void 0;u.Checkout.open({items:[{priceId:e,quantity:1}],...s?{customer:s}:{},customData:t.custom_data,settings:{successUrl:r}})}catch(e){console.error("Failed to prepare Paddle checkout:",e),b(!1)}};return g?(0,s.jsxs)("button",{type:"button",disabled:!0,className:x,children:[(0,s.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):(0,s.jsx)("button",{type:"button",onClick:()=>{N()},disabled:p,className:x,children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):h})}}}]);
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.