1import{u as J,r as s,j as e,H as G,L as M,b as g}from"./app-DP13319Q.js";import{F as o,f as j,ax as Q,aU as ee,aH as te,a as L,k as C}from"./index-CtyZ6W6U.js";import{D as se}from"./DraggableMenu-Bk7Spryo.js";import{E as ae,l as ne,u as oe,a as ie,P as le}from"./react-stripe.esm-D6Ettci4.js";import{M as re}from"./react-tooltip.min-DW3XhwOj.js";/* empty css */import"./index-DQkUn08L.js";const ce=ne("pk_live_51IyCo8Dpr0bpQPac24tix9UpShzoMw1uWsW3JvzcMrKVFnvUsXAnvBknJSPYucZCYSLT4Z0UVBeKx49jlYakdjIw00coa3YVdn"),de=({points:k,price:I,email:S,clientSecret:i,onSuccess:d,onBack:h,onError:b})=>{const y=oe(),m=ie(),[w,B]=s.useState(!1),[x,t]=s.useState(""),[u,p]=s.useState(!1),$=async v=>{if(v.preventDefault(),t(""),!y||!m){t("Payment system not ready. Please try again.");return}B(!0);try{const{error:r}=await m.submit();if(r){t(r.message||"Payment form validation failed");return}const{error:f,paymentIntent:N}=await y.confirmPayment({elements:m,confirmParams:{return_url:`${window.location.origin}/payment-success`,receipt_email:S,payment_method_data:{billing_details:{email:S}}},clientSecret:i,redirect:"if_required"});f?t(f.message||"Payment failed"):(N==null?void 0:N.status)==="succeeded"&&d()}catch(r){const f=r instanceof Error?r.message:"Payment processing failed. Please try again.";t(f)}finally{B(!1)}};return e.jsxs("form",{onSubmit:$,children:[x&&e.jsxs("div",{className:"mb-4 p-3 bg-red-500/90 text-white rounded-lg flex items-center gap-2",children:[e.jsx(o,{icon:L}),x]}),e.jsxs("div",{className:"mt-4 text-sm text-gray-300",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{children:"Email:"}),e.jsx("span",{className:"text-yellow-400",children:S})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{children:"Amount:"}),e.jsxs("span",{className:"text-yellow-400",children:["US$",I.toFixed(2)]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Points:"}),e.jsxs("span",{className:"text-yellow-400",children:["EZ$",k.toFixed(2)]})]})]}),e.jsx("div",{className:"mt-6 space-y-4",children:e.jsx(le,{options:{layout:"tabs",fields:{billingDetails:{email:"auto"}}},onReady:()=>p(!0)})}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{type:"submit",disabled:w||!y||!u,className:`w-full bg-yellow-400 text-black font-bold py-3 px-4 rounded-full hover:bg-yellow-500 transition-colors ${w||!y||!u?"opacity-70 cursor-not-allowed":""}`,"data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Complete the purchase using the selected payment method.",children:w?e.jsxs(e.Fragment,{children:[e.jsx(o,{icon:C,className:"animate-spin mr-2"}),"Processing..."]}):`Pay US$${I.toFixed(2)}`})}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("button",{type:"button",onClick:h,className:"text-sm text-yellow-400 hover:underline","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Go back to change your email address.",children:"Back to email"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Your payment information is securely handled by Stripe and is not stored on our servers.",children:"Payment secured by STRIPE. You'll be redirected after payment."})]})]})};function fe(){var _;const{auth:k,template:I,tokenInfo:S}=J().props,[i,d]=s.useState(1),[h,b]=s.useState(1),[y,m]=s.useState(0),[w,B]=s.useState(!0),[x,t]=s.useState(""),[u,p]=s.useState(""),[$,v]=s.useState(!1),[r,f]=s.useState(((_=k.user)==null?void 0:_.email)||""),[N,E]=s.useState(1),[A,T]=s.useState(""),[P,F]=s.useState(!1),[D,Z]=s.useState(""),[z,R]=s.useState(0);s.useRef(null),s.useRef(null),s.useEffect(()=>{(async()=>{var l,c;try{const n=await g.get("/buy-bee/balance");m(Number(n.data.balance)||0)}catch(n){console.error("Failed to fetch balance:",n),m(0),g.isAxiosError(n)?t(((c=(l=n.response)==null?void 0:l.data)==null?void 0:c.message)||"Failed to fetch balance"):t("Failed to fetch balance")}})()},[]);const U=()=>{const a=i+1;d(a),b(a)},Y=()=>{if(i>1){const a=i-1;d(a),b(a)}},V=a=>{const l=a.target.value;if(/^\d*$/.test(l)){const c=l===""?0:parseInt(l,10);d(c),b(c)}},q=()=>
1{i<1&&(d(1),b(1))},W=()=>{v(!0),E(1),t(""),p("")},H=()=>{d(1),b(1),p("Items cleared successfully!"),setTimeout(()=>p(""),3e3)},K=async()=>{var a,l,c;if(!r){t("Please enter your email address");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)){t("Please enter a valid email address");return}t(""),F(!0);try{const n=await g.post("/buy-bee/initiate",{points:i,price:h,email:r},{headers:{"X-CSRF-TOKEN":((a=document.querySelector('meta[name="csrf-token"]'))==null?void 0:a.getAttribute("content"))||""}});T(n.data.clientSecret),Z(n.data.payment_intent_id),R(n.data.point_purchase_id),E(2)}catch(n){g.isAxiosError(n)?t(((c=(l=n.response)==null?void 0:l.data)==null?void 0:c.error)||"Failed to initialize payment"):t("Failed to connect to payment service")}finally{F(!1)}},O=async()=>{var a,l,c;F(!0),t("");try{const n=await g.post("/buy-bee/success",{payment_intent_id:D,point_purchase_id:z},{headers:{"X-CSRF-TOKEN":((a=document.querySelector('meta[name="csrf-token"]'))==null?void 0:a.getAttribute("content"))||""}});p(`Purchase successful! EZ$${i.toFixed(2)} added to your account.`),m(X=>X+i),v(!1)}catch(n){g.isAxiosError(n)?t(((c=(l=n.response)==null?void 0:l.data)==null?void 0:c.error)||"Payment verification failed"):t("Failed to verify payment. Please contact support.")}finally{F(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(G,{children:[e.jsx("title",{children:"Buy Bee Points - EZ3D"}),e.jsx("meta",{name:"description",content:"Purchase Bee Points to create tags, slidgets, and widgets"})]}),e.jsx(re,{id:"buybee-tooltip"}),e.jsx("style",{children:` 2 .react-tooltip { 3 z-index: 99999 !important; 4 opacity: 1 !important; 5 font-size: 12px; 6 padding: 4px 8px; 7 } 8 `}),e.jsx(se,{auth:k}),e.jsxs("main",{className:"relative flex justify-center items-center min-h-screen p-4 overflow-hidden",children:[w&&e.jsxs("div",{className:"relative mt-4 mx-auto bottom-4 z-50 backdrop-blur-sm p-6 rounded-xl border border-white-700 overflow-y-auto shadow-2xl max-w-4xl w-full",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-center text-yellow-400 mb-6","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"EZ$ are used to unlock premium features and create content on the platform.",children:"Buy EZ$ for Ai Use and Domains."}),u&&e.jsxs("div",{className:"bg-green-500/90 text-white p-3 mb-2 rounded-lg flex items-center gap-2",children:[e.jsx(o,{icon:j}),u]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-yellow-400 mb-2",children:"EZ$"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{className:"bg-green-600 text-white font-bold text-xl px-4 py-2 rounded-l-md hover:bg-green-700 transition-colors focus:outline-none",onClick:Y,"data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Decrease the number of points to buy",children:"-"}),e.jsx("input",{type:"text",inputMode:"numeric",value:i===0?"":i,onChange:V,onBlur:q,className:"w-full bg-white text-gray-800 text-center font-bold text-lg py-2.5 border-none focus:outline-none","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"The number of points you wish to purchase. You can type a number manually."}),e.jsx("button",{className:"bg-green-600 text-white font-bold text-xl px-4 py-2 rounded-r-md hover:bg-green-700 transition-colors focus:outline-none",onClick:U,"data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Increase the number of points to buy",children:"+"})]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("label",{className:"block text-sm font-bold text-yellow-400 mb-2",children:"Amount to Pay"}),e.jsxs("div",{className:"inline-block bg-green-600 text-white font-bold px-8 py-3 rounded-full text-lg shadow-md","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"The total cost in US Dollars. The price is $1.00 per point.",children:["US$",h.toFixed(2)]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("label",{className:"block text-sm font-bold text-yellow-400 mb-2 uppercase",children:"Payment Method"}),e.jsx("div",{className:"text-5xl font-extrabold text-indigo-500
8italic","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"We use Stripe for secure payment processing.",children:"stripe"})]})]})}),e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-6",children:[e.jsxs("div",{className:"bg-purple-800/80 text-white p-4 rounded-lg text-center border border-purple-600","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"This is your current balance of EZ$.",children:[e.jsxs("div",{className:"text-sm text-purple-300 flex items-center justify-center gap-2",children:[e.jsx("span",{children:"AVAILABLE EZ$"}),e.jsx(o,{icon:Q,className:"text-purple-300","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Your current point balance"})]}),e.jsxs("div",{className:"text-3xl font-bold mt-1",children:["EZ$",y.toFixed(2)]})]}),e.jsxs("div",{className:"text-center bg-gray-700/50 p-4 rounded-lg border border-dashed border-gray-600","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Using EZ$ unlocks powerful tools to enhance your online presence.",children:[e.jsx("h3",{className:"text-yellow-400 font-semibold mb-3 text-lg",children:"Points Benefits:"}),e.jsxs("ul",{className:"text-gray-300 text-sm space-y-2 text-left",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(o,{icon:j,className:"text-green-400 mt-1"}),e.jsx("span",{children:"Create unlimited tags and widgets"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(o,{icon:j,className:"text-green-400 mt-1"}),e.jsx("span",{children:"Access premium features"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(o,{icon:j,className:"text-green-400 mt-1"}),e.jsx("span",{children:"Enhance your marketing tools"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(o,{icon:j,className:"text-green-400 mt-1"}),e.jsx("span",{children:"Boost engagement and conversions"})]})]})]})]})]}),e.jsxs("div",{className:"mt-6 flex justify-center items-center gap-4",children:[e.jsxs("button",{onClick:H,className:"bg-red-600/90 text-white font-bold py-2.5 px-6 md:px-8 rounded-md hover:bg-red-700 transition-colors flex items-center gap-2","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Reset the purchase quantity to 1",children:[e.jsx(o,{icon:ee}),e.jsx("span",{children:"Clear"})]}),e.jsxs("button",{onClick:W,className:"bg-yellow-400 text-black font-bold py-2.5 px-6 md:px-8 rounded-md flex items-center gap-3 hover:bg-yellow-500 transition-colors","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Proceed to checkout to complete your purchase",children:[e.jsx(o,{icon:te}),e.jsx("span",{children:"Buy Now"})]})]})]}),$&&e.jsx("div",{className:"fixed inset-0 bg-black/70 min-h-screen flex items-center justify-center z-[100] p-4 overflow-y-auto",children:e.jsxs("div",{className:"bg-[#235A72] border border-[#3a7a94] text-white p-8 rounded-lg shadow-lg max-w-sm w-full relative max-h-[90vh] overflow-y-auto",children:[e.jsx("button",{onClick:()=>{v(!1),E(1),t(""),p("")},className:"sticky top-0 right-0 ml-auto text-white/70 hover:text-white transition-colors z-10",disabled:P,"data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Cancel purchase and close this window",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("div",{className:"space-y-6",children:[u&&e.jsxs("div",{className:"bg-green-500/90 text-white p-3 rounded-lg flex items-center gap-2",children:[e.jsx(o,{icon:j}),u]}),x&&e.jsxs("div",{className:"bg-red-500/90 text-white p-3 rounded-lg flex items-center gap-2",children:[e.jsx(o,{icon:L}),x]}),P&&e.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center rounded-lg",children:e.jsx(o,{icon:C,className:"animate-spin text-4xl text-white"})}),N===1?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-full backdrop-blur-md flex items-center justify-center overflow-hidden border border-white/20 bg-gradient-to-br from-white/15 to-transparent shadow-lg mx-auto",children:e.jsx("img",{src:"https://ez.wiki/logo.gif",className:"w-10 h-10 rounded-full object-cover",alt:"ez.wiki Logo"})}),e.jsxs("h2",{className:"text-xl font-bold mt-4 text-white",children:["Buy EZ$",i.toFixed(2)]}),e.jsxs("p",{className:"text-[#a8d0e6]",children:["You'll be charged US$",h.toFixed(2)]})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"flex items-center bg-white rounded-md",children:[e.jsx("div",{className:"p-3 bg-[#4CAF50] rounded-l-md",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-white",f
8ill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("input",{type:"email",value:r,onChange:a=>f(a.target.value),className:"w-full p-3 bg-white text-gray-800 outline-none rounded-r-md",placeholder:"Email",required:!0,disabled:P,"data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Your payment receipt will be sent to this email address."})]}),x&&e.jsx("div",{className:"mt-2 text-[#ff6b6b] text-sm",children:x})]}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{onClick:K,disabled:P,className:"w-full bg-[#FFD700] text-gray-900 font-bold py-3 px-4 rounded-full hover:bg-[#FFC000] transition-colors disabled:opacity-70 disabled:cursor-not-allowed","data-tooltip-id":"buybee-tooltip","data-tooltip-content":"Verify your email and proceed to the payment form.",children:P?e.jsxs(e.Fragment,{children:[e.jsx(o,{icon:C,className:"animate-spin mr-2"}),"Processing..."]}):"Continue to Payment"})}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"text-xs text-[#a8d0e6]",children:"Payment secured by STRIPE. You'll be taken to a thank you page after the payment."}),e.jsxs("p",{className:"mt-1 text-xs text-[#a8d0e6]",children:[e.jsx(M,{href:"/terms",className:"hover:underline text-white",children:"Terms"})," and"," ",e.jsx(M,{href:"/privacy",className:"hover:underline text-white",children:"Privacy"}),"."]})]})]}):e.jsx(ae,{stripe:ce,options:{clientSecret:A,appearance:{theme:"night",variables:{colorPrimary:"#FFD700",colorBackground:"#235A72",colorText:"white",colorDanger:"#ff6b6b",fontFamily:"Inter, system-ui, sans-serif"}}},children:A?e.jsx(de,{points:i,price:h,email:r,clientSecret:A,onSuccess:O,onBack:()=>E(1),onError:t}):e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(o,{icon:C,className:"animate-spin text-2xl"})})})]})]})})]})]})}export{fe 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.