1import{a as V,e as Z,r as d,j as t}from"./vendor-react-DgEia5Y0.js";import{d as H,t as p,e as y,p as l}from"./index-LTTGZaNt.js";import{n as K,x as Q,Z as L,m as I,c as J}from"./vendor-icons-J4_e8JZg.js";const ae=()=>{const f=V(),n=H(),[F]=Z(),[i,w]=d.useState("yearly"),[E,v]=d.useState([]),[T,m]=d.useState(null),[$,j]=d.useState(!0),[g,N]=d.useState(null),[P,x]=d.useState(null),C=F.get("promo");d.useEffect(()=>{S(),p("ViewContent",{content_name:"Pricing Plans",content_category:"subscription",content_type:"product_group"})},[]),d.useEffect(()=>{if(!n.currentApiUser){m(null);return}let e=!1;return(async()=>{try{const s=await y.getActiveSubscriptions();e||m(s||[])}catch(s){console.error("Failed to load active subscriptions:",s),e||m([])}})(),()=>{e=!0}},[n.currentApiUser]);const S=async()=>{try{j(!0),x(null);const e=await y.getSubscriptionPlans();v(e||[])}catch(e){console.error("Failed to load subscription plans:",e),x("Failed to load subscription plans. Please try again."),v([])}finally{j(!1)}},R=async e=>{var s;try{N(e.name),x(null);const r=e.tier.toLowerCase(),a=n.currentApiUser?n.currentApiUser.subscription_tier:void 0,o=n.currentApiUser?a?a.toLowerCase():"none":"guest";if(l("SubscriptionPlanAttempt",{planId:e.id,planTier:r,billingCycle:i,userStatus:o}),p("ViewContent",{content_name:e.name,content_category:"subscription",content_type:"product",value:i==="yearly"&&e.price_yearly?e.price_yearly/12:e.price_monthly,currency:"USD"}),n.currentApiUser){let c=T;if(c===null)try{c=await y.getActiveSubscriptions(),m(c||[])}catch(u){console.error("Failed to load active subscriptions during checkout:",u),c=[],m([])}if(e.tier.toLowerCase()==="free"){l("SubscriptionPlanActivateFree",{planId:e.id,planTier:r,userTier:a?a.toLowerCase():null}),p("Lead",{content_name:e.name,content_category:"subscription",value:0,currency:"USD"}),f("/workstation");return}const h=String(e.tier||"FREE").toUpperCase(),Y=i;if((c||[]).some(u=>{const q=String(u.tier||"FREE").toUpperCase(),z=u.yearly?"yearly":"monthly";return q===h&&z===Y})){l("SubscriptionPlanAlreadyActive",{planId:e.id,planTier:r,userTier:h.toLowerCase(),billingCycle:i}),f("/workstation");return}const b=((s=(c||[])[0])==null?void 0:s.tier)||n.currentApiUser.subscription_tier||"free";if((c||[]).some(u=>String(u.tier||"").toUpperCase()!=="FREE")&&e.tier.toLowerCase()!=="free"){l("SubscriptionPlanChangeAttempt",{planId:e.id,fromTier:b.toLowerCase(),toTier:r,billingCycle:i}),await k(e);return}if(e.tier.toLowerCase()!=="free"){l("SubscriptionPlanUpgradeAttempt",{planId:e.id,planTier:r,fromTier:b?b.toLowerCase():"free",billingCycle:i}),await k(e);return}}l("SubscriptionPlanSignupRequired",{planId:e.id,planTier:r,billingCycle:i}),n.openRegisterModal();return}catch(r){console.error("Checkout failed:",r),x(r instanceof Error?r.message:"Checkout failed. Please try again.")}finally{N(null)}},k=async e=>{const s=`${window.location.origin}/payment/success?session_id={CHECKOUT_SESSION_ID}`,r=`${window.location.origin}/payment/cancel`,a={plan_id:e.id,billing_cycle:i,success_url:s,cancel_url:r};
1l("SubscriptionCheckoutStart",{planId:e.id,planTier:e.tier.toLowerCase(),billingCycle:i}),p("InitiateCheckout",{content_name:e.name,content_category:"subscription",value:i==="yearly"&&e.price_yearly?e.price_yearly/12:e.price_monthly,currency:"USD",num_items:1});try{const o=await y.createCheckoutSession(a);if(o.checkout_url)l("SubscriptionCheckoutRedirect",{planId:e.id,checkoutUrlReceived:!0}),window.location.href=o.checkout_url;else throw l("SubscriptionCheckoutError",{planId:e.id,reason:"missing_checkout_url"}),new Error("No checkout URL received")}catch(o){throw l("SubscriptionCheckoutError",{planId:e.id,reason:o instanceof Error?o.message:"unknown_error"}),o}},D=e=>{switch(e.toLowerCase()){case"free":return t.jsx(L,{className:"w-6 h-6"});case"basic":return t.jsx(J,{className:"w-6 h-6"});case"premium":return t.jsx(I,{className:"w-6 h-6"});case"enterprise":return t.jsx(I,{className:"w-6 h-6"});default:return t.jsx(L,{className:"w-6 h-6"})}},B=e=>{switch(e.toLowerCase()){case"free":return"Perfect for getting started";case"basic":return"Ideal for individuals and small projects";case"premium":return"Perfect for growing businesses and teams";case"enterprise":return"For large teams and organizations";default:return"Choose your plan"}},A=(E||[]).filter(e=>e.tier.toLowerCase()!=="free").map(e=>{let s=Array.isArray(e.features)?[...e.features]:[];const r=e.tier.toLowerCase();return(r==="basic"||r==="pro"||r==="premium"||r==="enterprise"||r==="ultimate")&&(s.push("Support batch generation"),s.push("Advanced video generation")),(r==="premium"||r==="enterprise"||r==="ultimate")&&s.push("All Premium templates"),s.push("Powered by Nano Banana & Sora 2 Pro"),{name:e.name,icon:D(e.tier),description:B(e.tier),monthlyPrice:e.price_monthly,yearlyPrice:e.price_yearly||null,features:s,popular:e.tier.toLowerCase()==="premium",backendPlan:e}}),_=e=>i==="yearly"&&e.yearlyPrice?(e.yearlyPrice/12).toFixed(2):e.monthlyPrice.toFixed(2),W=e=>e.monthlyPrice.toFixed(2),G=e=>{if(!e.yearlyPrice)return 0;const s=e.monthlyPrice*12,r=e.yearlyPrice,a=s-r;return Math.round(a)},M=e=>{var r,a,o,c,h;if(((a=(r=e.backendPlan)==null?void 0:r.tier)==null?void 0:a.toLowerCase())==="free"||!n.currentApiUser)return"Get Started";const s=n.currentApiUser.subscription_tier;return s===((o=e.backendPlan)==null?void 0:o.tier)?"Subscribed":s&&s.toLowerCase()!=="free"&&((h=(c=e.backendPlan)==null?void 0:c.tier)==null?void 0:h.toLowerCase())!=="free"?"Change Plan":"Get Started"},O=e=>{var r,a,o,c;if(((a=(r=e.backendPlan)==null?void 0:r.tier)==null?void 0:a.toLowerCase())==="free")return"bg-gray-900 text-white hover:bg-gray-800";if(!n.currentApiUser)return e.popular?"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-lg":"bg-gray-900 text-white hover:bg-gray-800";const s=n.currentApiUser.subscription_tier;return s===((o=e.backendPlan)==null?void 0:o.tier)?"bg-green-600 text-white cursor-default":(s&&s.toLowerCase()!=="free"&&((c=e.backendPlan)==null?void 0:c.tier).toLowerCase()!=="free",e.popular?"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-lg":"bg-gray-900 text-white hover:bg-gray-800")},U=e=>{var r,a,o;return((a=(r=e.backendPlan)==null?void 0:r.tier)==null?void 0:a.toLowerCase())==="free"||!n.currentApiUser?!e.backendPlan||g===e.name:n.currentApiUser.subscription_tier===((o=e.backendPlan)==null?void 0:o.tier)?!0:!e.backendPlan||g===e.name};return t.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 pt-32 pb-12 px-4 sm:px-6 lg:px-8",children:t.jsxs("div",{className:"max-w-7xl mx-auto",children:[C&&t.jsxs("div",{className:"mb-8 text-white text-center py-4 px-6 rounded-xl shadow-lg bg-gradient-to-r from-green-500 to-emerald-600",children:[t.jsx("p",{className:"text-2xl font-extrabold mb-2",children:"ð Special Offer Activated!"}),t.jsxs("p",{className:"text-base opacity-95",children:["Get ",t.jsx("span",{className:"font-bold",children:"100 bonus credits"})," with code ",t.jsx("span",{className:"bg-white/20 px-2 py-0.5 rounded font-mono",children:C})]})]}),t.jsxs("div",{className:"text-center mb-16",children:[t.jsx("h1",{className:"text-4xl font-black italic uppercase mb-4",style:{fontFamily:"Montserrat, system-ui, -apple-system, sans-serif"},children:t.jsx("span",{className:"bg-gradient-to-r from-purple-600 via-pink-500 to-red-500 bg-clip-text text-transparent",children:"Choose Your Perfect Plan"})}),t.jsxs("p",{className:"text-lg text-gray-600 mb-8",children:["Powered by the highest ",t.jsx("span",{className:"text-lg font-bold text-white bg-gradient-to-r from-blue-600 to-purple-600 px-3 py-1 rounded-lg shadow-md",children:"Google/OpenAI/Bytedance Pro"})," models, FashionFlow delivers studio-grade photoreal try-ons and cinematic video at a fraction of the usual cost."]}),t.jsx("div",{className:"flex items-center justify-center mb-8",children:t.jsxs("div",{className:"bg-white rounded-lg p-1 shadow-md",children:[t.jsx("button",{onClick:()=>w("monthly"),className:`px-6 py-2 rounded-md text-sm font-medium transition-all duration-200 ${i==="monthly"?"bg-blue-600 text-white shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:"Monthly"}),t.jsxs("button",{onClick:()=>w("yearly"),className:`px-6 py-2 rounded-md text-sm font-medium transition-all duration-200 ${i==="yearly"?"bg-blue-600 text-white shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:["Yearly",t.jsx("span",{className:"ml-2 text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full",children:"Save 20%"})]})]})})]}),P&&t.jsx("div",{className:"max-w-5xl mx-auto mb-8",children:t.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-xl text-center",children:P})}),$?t.jsx("div",{className:"max-w-7xl mx-auto",children:t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 ga
1p-6",children:[1,2,3,4,5].map(e=>t.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-6 animate-pulse",children:[t.jsx("div",{className:"h-6 bg-gray-200 rounded w-1/2 mb-3"}),t.jsx("div",{className:"h-3 bg-gray-200 rounded w-3/4 mb-4"}),t.jsx("div",{className:"h-10 bg-gray-200 rounded w-2/3 mb-4"}),t.jsx("div",{className:"space-y-2",children:[1,2,3].map(s=>t.jsx("div",{className:"h-3 bg-gray-200 rounded"},s))})]},e))})}):A.length>0?t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-6 max-w-7xl mx-auto",children:A.map((e,s)=>t.jsxs("div",{className:`relative bg-white rounded-2xl shadow-xl overflow-hidden transform transition-all duration-300 hover:scale-105 ${e.popular?"ring-2 ring-blue-500 ring-opacity-50":""}`,children:[e.popular&&t.jsx("div",{className:"absolute top-0 left-0 right-0 bg-gradient-to-r from-blue-500 to-purple-600 text-white text-center py-2 text-sm font-semibold",children:"Most Popular"}),t.jsxs("div",{className:`p-6 ${e.popular?"pt-14":"pt-6"}`,children:[t.jsxs("div",{className:"text-center mb-6",children:[t.jsx("div",{className:"flex items-center justify-center mb-3",children:t.jsx("div",{className:`p-2 rounded-full ${e.popular?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-600"}`,children:t.jsx("div",{className:"w-5 h-5",children:e.icon})})}),t.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-1",children:e.name}),t.jsx("p",{className:"text-sm text-gray-600 mb-4",children:e.description}),t.jsxs("div",{className:"mb-5",children:[t.jsxs("div",{className:"flex flex-col items-center mb-2",children:[i==="yearly"?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-lg text-gray-400 line-through mb-1",children:["$",W(e)]}),t.jsxs("span",{className:"text-3xl font-bold text-gray-900",children:["$",_(e)]})]}):t.jsxs("span",{className:"text-3xl font-bold text-gray-900",children:["$",_(e)]}),t.jsx("span",{className:"text-sm text-gray-600 mt-1",children:"/month"})]}),i==="monthly"&&t.jsx("div",{className:"text-xs text-orange-600 font-medium mt-1",children:"Limited promotional prices"}),i==="yearly"&&t.jsxs("div",{className:"text-green-600 font-semibold text-xs",children:["Billed yearly ⢠Save $",G(e)," per year"]})]})]}),t.jsx("div",{className:"space-y-2 mb-6",children:e.features.map((r,a)=>t.jsxs("div",{className:"flex items-start",children:[t.jsx(K,{className:"w-4 h-4 text-green-500 mr-2 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm text-gray-700",children:r})]},a))}),t.jsx("button",{onClick:()=>e.backendPlan&&R(e.backendPlan),disabled:U(e),className:`w-full py-2.5 px-4 rounded-lg font-semibold text-sm transition-all duration-200 flex items-center justify-center ${O(e)} ${U(e)?"opacity-50 cursor-not-allowed":""}`,children:g===e.name?t.jsxs(t.Fragment,{children:[t.jsx(Q,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):M(e)})]})]},e.name))}):t.jsx("div",{className:"max-w-7xl mx-auto",children:t.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-12 text-center",children:[t.jsx("h3",{className:"text-2xl font-bold text-gray-900 mb-4",children:"No Subscription Plans Available"}),t.jsx("p",{className:"text-gray-600 mb-6",children:"We're currently setting up our subscription plans. Please check back later or contact support."}),t.jsx("button",{onClick:S,className:"bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-blue-700 transition-colors",children:"Refresh Plans"})]})}),t.jsxs("div",{className:"mt-20 max-w-3xl mx-auto",children:[t.jsx("h2",{className:"text-3xl font-bold text-center text-gray-900 mb-12",children:"Frequently Asked Questions"}),t.jsxs("div",{className:"space-y-8",children:[t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Can I change my plan anytime?"}),t.jsx("p",{className:"text-gray-600",children:"Yes, you can upgrade or downgrade your plan at any time. Changes will be reflected in your next billing cycle."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"What happens if I exceed my generation limit?"}),t.jsx("p",{className:"text-gray-600",children:"You'll be notified when you're approaching your limit. You can either upgrade your plan or wait for the next billing cycle to reset your generations."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Do you offer free credits/images for new users?"}),t.jsx("p",{className:"text-gray-600",children:"Yes, we provide every new account with 10 free credits/images to generate ten amazing product and model images to grow your business. No credit card required to get started."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"ð§ What models are included in my plan?"}),t.jsx("p",{className:"text-gray-600",children:"All plans are powered by the latest Google Nano Banana and Sora 2 Pro models, ensuring studio-grade photoreal try-ons and cinematic video generation at unmatched value."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"ð¦ What's included in batch generation?"}),t.jsx("p",{className:"text-gray-600",children:"Batch generation allows you to upload multiple garments or models at once and generate large sets of visuals or videos in one go â perfect for catalogs, lookbooks, and bulk campaigns."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"ð§¾ Will I lose my previous results when switching plans?"}),t.jsx("p",{className:"text-gray-600",children:"No. All your previously generated images and videos remain safely stored in your workspace. Upgrading only expands your available credits and access to premium features."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"â¡ Do unused credits roll over?"}),t.jsx("p",{className:"text-gray-600",children:"Credits refresh automatically at the start of each new billing period. Unused credits do not roll over to the next month, so make sure to use them before your renewal date."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Do you offer a free trial?"}),t.jsxs("p",{className:"text-gray-600",children:["Every new account receives ",t.jsx("strong",{children:"10 free credits"})," to explore all features â no credit card required. Use them on any model including GPT Image 2, Seedance 2.0, and Seedream. When you're ready for more, choose a plan that fits your workflow. ",t.jsx("em",{children:"Note: A 7-day trial program was available May 1 â May 26, 2026. That program has ended; the 10 free credits above apply to all new accounts going forward."})]})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"What is your Acceptable Use Policy?"}),t.jsx("p",{className:"text-gray-600",children:"FashionFlow is designed for product photography, fashion, and commercial creative use. Accounts that generate explicit / NSFW content, attempt to bypass safety filters, create images of identifiable real people without consent, or operate multiple accounts to bypass plan limits will be terminated immediately. Credits will be revoked and, where consumption has occurred, charged against the selected plan."})]}),t.jsxs("div",{className:"bg-white rounded-lg p-6 shadow-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Do you guarantee perfect results for every product?"}),t.jsx("p",{className:"text-gray-600",children:"While we provide industry-leading, high-fidelity image generation, no AI modelâincluding those from Google or OpenAIâcan guarantee perfect results for 100% of products. Results often improve with prompt refinement and iteration. For this reason, generation outcomes are not guaranteed, and refunds are not provided based on subjective quality expectations."})]})]})]})]})})};export{ae 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.