1import{j as e}from"./index-CxB_Ni1Z-v2.2.0.js";import{T as r,X as x,e as d,bn as m}from"./vendor-lucide-C66To_pL-v2.2.0.js";import"./vendor-react-CXpudY0x-v2.2.0.js";const j=({isOpen:c,onClose:t,error:s,onSwitchToFluxPro:a,onTryAgain:i})=>{if(!c||!s)return null;const n=s.message.includes("Copyrighted content detected")||s.message.includes("content policy")||s.message.includes("blocked this operation"),o=s.message.includes("API Key invalid")||s.message.includes("not found"),l=s.message.includes("Edit produced no output")||s.message.includes("Variation produced no output");return e.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-slate-900 border border-slate-700 rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[e.jsxs("div",{className:"flex items-start justify-between p-6 border-b border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:e.jsx(r,{className:"text-red-400",size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-white",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-slate-400 mt-0.5",children:n?"Content Policy Restriction":"Something went wrong"})]})]}),e.jsx("button",{onClick:t,className:"text-slate-400 hover:text-white transition-colors p-2 hover:bg-slate-800 rounded-lg",children:e.jsx(x,{size:20})})]}),e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsx("div",{className:"bg-green-900/20 border border-green-700/50 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(d,{className:"text-green-400 flex-shrink-0 mt-0.5",size:18}),e.jsxs("div",{children:[e.jsx("p",{className:"text-green-300 font-medium text-sm",children:"No Tokens Charged"}),e.jsx("p",{className:"text-green-400/80 text-xs mt-1",children:"Since the generation failed, you haven't been charged any tokens. Your balance remains unchanged."})]})]})}),n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-white font-semibold mb-2 flex items-center gap-2",children:[e.jsx(r,{size:16,className:"text-amber-400"}),"What Happened"]}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:l?e.jsxs(e.Fragment,{children:["The AI blocked this edit/variation because it detected potentially copyrighted content in the image.",e.jsx("strong",{className:"block mt-2 text-amber-300",children:"Note: Edit and Variation operations currently only use Nano Banana, which has strict content policies."})]}):e.jsx(e.Fragment,{children:"The AI detected potentially copyrighted content (brand names, character names, etc.) in your prompt and blocked the generation to comply with intellectual property protections."})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-white font-semibold flex items-center gap-2",children:[e.jsx(m,{size:16,className:"text-[#6A9DBD]"}),"Recommended Solutions"]}),l?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"bg-amber-900/20 border border-amber-700/50 rounded-lg p-4",children:[e.jsx("h4",{className:"text-amber-300 font-medium text-sm mb-2",children:"ð¡ Workaround for Edit/Variation"}),e.jsx("p",{className:"text-slate-300 text-xs leading-relaxed mb-3",children:"Since edit operations are currently limited to Nano Banana, try one of these alternatives:"}),e.jsxs("div",{className:"space-y-2 text-xs text-slate-300",children:[e.jsxs("div",{className:"flex gap-2 items-start",children:[e.jsx("span",{className:"text-[#6A9DBD] flex-shrink-0 mt-0.5",children:"1."}),e.jsxs("div",{children:[e.jsx("strong",{className:"text-white",children:"Regenerate with Changes:"}),` Click the "Reuse" button to load this image's settings, then switch to `,e.jsx("strong",{className:"text-[#B2CDE1]",children:"Flux Pro"})," and regenerate with your desired changes in the prompt."]})]}),e.jsxs("div",{className:"flex gap-2 items-start",children:[e.jsx("span",{className:"text-[#6A9DBD] flex-shrink-0 mt-0.5",children:"2."}),e.jsxs("div",{children:[e.jsx("strong",{className:"text-white",children:"Use as Reference:"})," Upload this image as a reference image and generate with ",e.jsx("strong",{className:"text-[#B2CDE1]",children:"Flux Pro"})," to maintain visual consistency."]})]}),e.jsxs("div",{className:"flex gap-2 items-start",children:[e.jsx("span",{className:"text-[#6A9DBD] flex-shrink-0 mt-0.5",children:"3."}),e.jsxs("div",{children:[e.jsx("strong",{className:"text-white",children:"Exter
1nal Editor:"})," Download this image, edit it in an external tool (Photoshop, GIMP, etc.), and re-upload."]})]})]})]})}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-4 space-y-3",children:[e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-white font-medium text-sm mb-1",children:"⨠Switch to Flux Pro (Recommended)"}),e.jsx("p",{className:"text-slate-400 text-xs leading-relaxed",children:"Flux Pro 1.1 has more permissive content policies and excels at generating characters, including those inspired by copyrighted properties. It's specifically designed for creative professionals."})]})}),a&&e.jsxs("button",{onClick:()=>{a(),t()},className:"w-full bg-[#D4512A] hover:bg-[#E8703E] text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors flex items-center justify-center gap-2",children:[e.jsx(d,{size:14}),"Switch to Flux Pro & Try Again"]})]})}),e.jsxs("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-4",children:[e.jsx("h4",{className:"text-white font-medium text-sm mb-2",children:"ð Rephrase Your Prompt"}),e.jsx("p",{className:"text-slate-400 text-xs mb-3 leading-relaxed",children:"Describe visual characteristics instead of using branded names:"}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-red-400 flex-shrink-0",children:"â"}),e.jsx("span",{className:"text-slate-300",children:'"Spider-Man character turnaround"'})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-green-400 flex-shrink-0",children:"â "}),e.jsx("span",{className:"text-slate-300",children:'"Superhero in red and blue suit with spider web patterns"'})]})]}),e.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-red-400 flex-shrink-0",children:"â"}),e.jsx("span",{className:"text-slate-300",children:'"Into the Spiderverse style"'})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-green-400 flex-shrink-0",children:"â "}),e.jsx("span",{className:"text-slate-300",children:'"Bold comic book style with halftone dots and dynamic angles"'})]})]})]}),e.jsxs("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-4",children:[e.jsx("h4",{className:"text-white font-medium text-sm mb-1",children:"ð¨ Other AI Models"}),e.jsx("p",{className:"text-slate-400 text-xs leading-relaxed",children:'SDXL and Recraft V3 are also available with different content policies. Find them in the "Model & Settings" section of the sidebar.'})]})]})]}):o?e.jsx(e.Fragment,{children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-2",children:"API Connection Issue"}),e.jsx("p",{className:"text-slate-300 text-sm leading-relaxed",children:"Your API key is invalid or not properly connected. Please reconnect your account."})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-semibold mb-2",children:"Error Details"}),e.jsx("div",{className:"bg-slate-800 rounded-lg p-3 text-xs text-slate-300 font-mono max-h-40 overflow-y-auto",children:s.message})]}),i&&e.jsx("button",{onClick:()=>{i(),t()},className:"w-full bg-[#D4512A] hover:bg-[#E8703E] text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors",children:"Try Again"})]})]}),e.jsx("div",{className:"border-t border-slate-800 p-4 bg-slate-900/50",children:e.jsx("button",{onClick:t,className:"w-full px-4 py-2 bg-slate-800 hover:bg-slate-700 text-slate-300 rounded-lg text-sm transition-colors",children:"Close"})})]})})};export{j as GenerationErrorModal}; 2//# sourceMappingURL=GenerationErrorModal-DSJlMjVu-v2.2.0.js.map
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.