(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4941],{32377:function(e,t,a){Promise.resolve().then(a.bind(a,91418))},91418:function(e,t,a){"use strict";a.d(t,{default:function(){return x}});var r=a(57437),n=a(38472),i=a(13481),l=a(46682),s=a(2265),o=a(63872),d=a(88726);let c=[{id:1,title:"A sunset over the ocean with a golden sky and a sailboat in the distance"},{id:2,title:"A cityscape at night with neon lights, skyscrapers, and a bustling street"},{id:3,title:"A mountain landscape with a snow-capped peak, verdant trees, and a sun rising"},{id:4,title:"A vibrant street art mural with bold colors and abstract shapes"},{id:5,title:"A still life arrangement of fruit, flowers, and porcelain vase"},{id:6,title:"A close-up of a delicate flower with intricate details and petals"},{id:7,title:"A majestic lion standing tall and proud in a desert landscape"},{id:8,title:"A colorful abstract composition featuring swirling shapes and patterns"},{id:9,title:"A portrait of a smiling person with warm and expressive eyes"},{id:10,title:"A castle, ancient, towering, perched precariously on a rugged cliff, with waves crashing"}];var m=a(45734),u=a(41516),h=a(16463);let p=()=>{let e=(0,h.useSearchParams)(),[t,a]=(0,s.useState)("Enter your prompt to generate a Cartoon Image."),[u,p]=(0,s.useState)(""),[x,g]=(0,s.useState)(!1),[f,v]=(0,s.useState)(!1),[w,b]=(0,s.useState)(""),{executeRecaptcha:j}=(0,m.xX)();(0,s.useEffect)(()=>{let t=e.get("ref"),r=e.get("input"),n=e.get("output");if("recents"===t&&r&&n)try{let e=JSON.parse(r),t=JSON.parse(n);if(e.data){let t=JSON.parse(e.data);t.input&&p(t.input)}if(200===t.status&&t.content){let e=t.content.imageUrl||t.content;e?(b(e),g(!0),a("Here's your recent generation!")):d.ZP.error("Error loading the generated image")}}catch(e){d.ZP.error("Error loading recent generation")}},[e]);let N=async e=>{window.scrollTo(0,0),g(!0),a("Generating Image..."),v(!0);try{let t=await n.Z.post("/api/image-tools/generate-image/",{input:u,prompt_type:"anime_prompt",token:e});b(t.data.image),v(!1),a("Here we go! \uD83C\uDFA8, you can use the edit options to further customize the generated Image.")}catch(e){d.ZP.error("Error generating image, try again later"),v(!1)}},y=()=>{var e,t,r,n;p(""),a("Generating Prompt...");let i=Math.floor(Math.random()*c.length);for(let t=0;t<(null!==(r=null===(e=c[i])||void 0===e?void 0:e.title.length)&&void 0!==r?r:0);t++)setTimeout(()=>{p(e=>{var a;return e+(null===(a=c[i])||void 0===a?void 0:a.title[t])})},20*t);setTimeout(()=>{a("Prompt Generated! \uD83C\uDFA8")},20*(null!==(n=null===(t=c[i])||void 0===t?void 0:t.title.length)&&void 0!==n?n:0))};return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"mb-[10vh] w-full p-4 sm:mb-0 md:flex",children:[(0,r.jsxs)("div",{className:"".concat(x?"hidden":"block"," mt-8 md:m-0 md:block md:h-[85vh] md:w-[350px] md:rounded-l-lg md:bg-[#1C1C1C] md:p-5"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"relative rounded-full",children:[(0,r.jsx)(i.Z,{src:"/avatar.webp",className:"m-0 animate-none rounded-full p-0",width:50,height:50,alt:"text-to-image"}),f||"Generating Prompt..."===t?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"absolute left-[0px] top-[0px] h-[90%] w-full animate-pulse rounded-full border-[6px] border-[#4a8ad3]"}),(0,r.jsx)("div",{className:"absolute left-[0px] top-[0px] h-[90%] w-full animate-pulse rounded-full border-[4px] border-[#534ad3]"}),(0,r.jsx)("div",{className:"absolute left-[0px] top-[0px] h-[90%] w-full animate-pulse rounded-full border-[2px] border-[#9a4ad3]"})]}):null]}),(0,r.jsxs)("div",{className:"text-sm text-white",children:[t," "]})]}),(0,r.jsxs)("div",{className:"relative mt-5",children:[(0,r.jsx)("textarea",{className:"mt-4 w-[100%] rounded-2xl border-[1px] border-[#5C2781] bg-black p-4 text-white",placeholder:"Type here...",rows:6,value:u,onChange:e=>p(e.target.value)}),u.length>0&&(0,r.jsxs)("div",{className:"absolute bottom-0 right-0 rounded-bl-2xl rounded-tr-2xl bg-[#5C2781] p-1 text-xs text-white",children:[u.length,"/200"]}),(0,r.jsxs)("button",{className:"absolute bottom-6 left-4",onClick:()=>{"Generating Prompt..."!==t&&y()},children:["\uD83D\uDCA1",(0,r.jsx)("span",{className:"text-[#9F58FF] underline",children:"Try our Prompt"})]})]}),(0,r.jsx)(l.ZP,{block:!0,size:"large",className:"mt-7 w-full bg-primary",onClick:function(e){e.preventDefault(),j&&j("KaiRecaptcha0911").then(e=>{N(e)})},loading:f,children:"Generate Image"})]}),(0,r.jsx)("div",{className:"".concat(x?"md:bg-tranparent":"bg-gradient-to-b from-[#4D0059] to-[#1A001E]"," mt-10 rounded-r-lg md:mt-0 md:block md:w-[75%] md:p-5"),children:x?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"".concat(f&&x?"block":"hidden"),children:[(0,r.jsx)("div",{className:"flex h-[300px] items-center justify-center",children:(0,r.jsx)("div",{className:"h-32 w-32 animate-spin rounded-full border-b-2 border-t-2 border-[#9F58FF]"})}),(0,r.jsx)("p",{className:"text-center text-white",children:"Generating Image..."})]}),(0,r.jsxs)("div",{className:"".concat(x&&!f?"block":"hidden"," relative"),children:[(0,r.jsx)(o.x_l,{className:"absolute -top-[5vh] bottom-0 left-0 mr-5 text-2xl text-white md:hidden",onClick:()=>g(!1)}),(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)(i.Z,{preview:!1,src:w,width:window.innerWidth<640?"100%":"50%",height:window.innerWidth<640?"100%":"50%",alt:"castle",className:"rounded-2xl"})}),(0,r.jsxs)("div",{className:"m-auto mb-16 mt-5 md:flex md:w-[50%] md:justify-around",children:[(0,r.jsx)(l.ZP,{size:"large",className:"mt-5 w-full md:w-auto",onClick:()=>(0,d.ZP)("Coming Soon!"),loading:f,block:!0,children:"Edit"}),(0,r.jsx)(l.ZP,{type:"link",size:"large",className:"mt-5 w-full bg-primary text-white md:ml-2 md:w-auto",href:w,loading:f,block:!0,children:"Download"})]})]})]}):(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-start justify-start gap-10 rounded-2xl px-10 py-4 text-center lg:h-[542px] lg:w-[730px] lg:p-20 lg:py-8",children:[(0,r.jsx)("h3",{className:"text-center text-5xl font-semibold text-white",children:"Welcome to Anime Generator \uD83D\uDC4B"}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsx)("p",{className:"text-center font-thin text-white",children:"Bring your anime-inspired ideas to life with our Anime Generator. Perfect for creating unique anime characters, scenes, or adding an anime-style twist to your concepts."}),(0,r.jsx)("p",{className:"text-center font-thin text-white",children:"To start, enter your prompt in the left sidebar. Describe the anime scene or character you envision, and let our AI transform your ideas into stunning anime-style artwork!"})]})]})})})]})})};var x=()=>(0,r.jsx)(u.default,{children:(0,r.jsx)(p,{})})},41516:function(e,t,a){"use strict";a.d(t,{default:function(){return l}});var r=a(57437),n=a(45734);a(2265);var i=a(25566);function l(e){var t;let{children:a}=e,l=null==i?void 0:null===(t=i.env)||void 0===t?void 0:"6LcbXhwqAAAAALtAvmTckeDVBQqz2zLDryUXaK-X";return(0,r.jsx)(n.pm,{reCaptchaKey:null!=l?l:"NOT DEFINED",scriptProps:{async:!1,defer:!1,appendTo:"head",nonce:void 0},children:a})}}},function(e){e.O(0,[7240,3223,6682,9349,8726,9109,8472,6616,3481,489,2971,7023,1744],function(){return e(e.s=32377)}),_N_E=e.O()}]);