1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8183],{37650:(e,i,l)=>{l.d(i,{A:()=>x});var o=l(6029),a=l(26500),t=l(50016),s=l(73641),n=l(73509),r=l(82108),d=l(55729),c=l(59861),u=l(8126),m=l(61704);l(23545);var p=l(59854);l(18813);let g=e=>{let{close:i}=e;return(0,o.jsx)(a.M,{radius:15,color:"dark",size:"xl",variant:"filled",onClick:i,sx:{position:"relative"},children:(0,o.jsx)(t.raE,{})})},x=e=>{let{prediction_images:i,maximizedImage:l,setMaximizedImage:a}=e,[t,x]=(0,d.useMemo)(()=>{let e=i.findIndex(e=>e.id===(null==l?void 0:l.id));return[i[e],e]},[i,l]),h=(0,d.useMemo)(()=>{var e;return(null==t?void 0:t.base_encoded)?null==t?void 0:t.base_encoded:(0,r.lv)({url:null!=(e=null==t?void 0:t.image)?e:"",width:1536,imaginaryHost:"imaginary.aieasypic.com"})},[t]);return(0,o.jsx)(c.Ay,{slides:i.map(e=>({src:(null==e?void 0:e.image)||(null==e?void 0:e.base_encoded)||"",alt:e.prompt})),plugins:[u.A,p.A,m.A],toolbar:{buttons:[(0,o.jsx)(s.A,{image:h,withText:!1},"download-button"),(0,o.jsx)(n.A,{image:t},"favorite-button"),(0,o.jsx)(g,{close:e=>{e.stopPropagation(),a(null)}},"close-button")]},open:!!l,close:()=>a(null),animation:{fade:0},controller:{closeOnPullDown:!0,closeOnBackdropClick:!0},index:x,on:{click:e=>{let l=i.find(l=>i.indexOf(l)===e.index);l&&a(l)},view:e=>{let l=i.find(l=>i.indexOf(l)===e.index);l&&a(l)}},styles:{toolbar:{gap:10}}})}},73509:(e,i,l)=>{l.d(i,{A:()=>u});var o=l(6029),a=l(26500),t=l(18090),s=l(50016),n=l(34417),r=l(1751),d=l(37514),c=l(93258);let u=e=>{let{image:i}=e,{mutate:l}=(0,r.vJV)(),u=(0,c.jE)(),{data:m}=(0,n.P)();return(0,o.jsxs)(a.M,{radius:15,color:"dark",size:"xl",variant:"filled",onClick:e=>{if(e.stopPropagation(),!(null==m?void 0:m.email))return void(0,t.Ds)({title:"Please login to favorite images",message:"You can favorite images after logging in",color:"red"});l({id:i.id,data:{favorited:!i.favorited}},{onSuccess:()=>{u.invalidateQueries((0,r.BxK)())},onError:e=>{(0,d.A)(e)}})},sx:{position:"relative"},children:[(0,o.jsx)(s.C31,{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",transition:"opacity 0.5s ease-in-out, visibility 1s",visibility:(null==i?void 0:i.favorited)?"visible":"hidden",opacity:+(null!=i&&!!i.favorited)}}),(0,o.jsx)(s.C3E,{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",transition:"opacity 0.5s ease-in-out, visibility 1s",visibility:(null==i?void 0:i.favorited)?"hidden":"visible",opacity:+(null==i||!i.favorited)}})]})}},73641:(e,i,l)=>{l.d(i,{A:()=>d,m:()=>r});var o=l(6029),a=l(99690),t=l(26500),s=l(37948),n=l(50016);let r=async e=>{if(e)try{if(e.startsWith("data:image")){let i=((e,i)=>{let l=atob(e),o=null==l?void 0:l.length,a=new Uint8Array(o);for(let e=0;e<o;e++)a[e]=l.charCodeAt(e);return new Blob([a],{type:i})})(e.split(",")[1],e.split(";")[0].split(":")[1]),l=window.URL.createObjectURL(i),o=document.createElement("a");o.href=l,o.download="image.png",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(l),document.body.removeChild(o)}else{let i=await fetch(e),l=await i.blob(),o=window.URL.createObjectURL(l),a=document.createElement("a");a.href=o,a.download="image.png",document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(o),document.body.removeChild(a)}}catch(e){console.error("Error downloading image:",e)}},d=e=>{let{image:i,withText:l=!0}=e;return(0,o.jsxs)(a.Y,{onClick:e=>{e.stopPropagation(),r(i)},children:[(0,o.jsx)(t.M,{variant:"filled",color:"blue",children:(0,o.jsx)(n.s3U,{})}),l&&(0,o.jsx)(s.E,{children:"Download"})]})}},95468:(e,i,l)=>{l.d(i,{A:()=>R});var o=l(6029),a=l(50433),t=l(13692),s=l(99690),n=l(13445),r=l(84335),d=l(26500),c=l(34029),u=l(37948),m=l(74422),p=l(50016),g=l(34417),x=l(55729),h=l(94822),v=l(18090),j=l(80340),f=l(1751),b=l(37514),y=l(78138),k=l(93258),C=l(81278);let w=e=>{let{image:i,prompt:l,imageUrl:a}=e,[t,n]=(0,x.useState)(!1),{mutate:c,isLoading:m}=(0,f.gAi)(),w=(0,k.jE)(),P=(0,C.useRouter)(),E=(0,j.Pj)(e=>e.setIsVideoGenerating),{data:_}=(0,g.P)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.M,{radius:15,color:"blue",size:"xl",variant:"filled",onClick:e=>{if(e.stopPropagation(),!(null==_?void 0:_.email))return void(0,v.Ds)({title:"Please login to animate images",message:"You can animate images after logging in",color:"red"});c({id:i.id},{onSuccess:e=>{E(!0),w.invalidateQueries((0,f.ev4)()),n(!0)},onError:e=>{(0,b.A)(e)}})},loading:m,sx:{position:"relative"},children:(0,o.jsx)(p.npA,{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}})}),(0,o.jsxs)(h.a,{opened:t,onClose:()=>n(!1),title:"Video Generation Started",centered:!0,children:[(0,o.jsx)(u.E,{size:"md",mb:20,children:"Video is being generated. Do you want to go view your video now?"}),(0,o.jsxs)(s.Y,{position:"right",children:[(0,o.jsx)(r.$,{variant:"outline",onClick:()=>n(!1),children:"No, Stay Here"}),(0,o.jsx)(r.$,{onClick:()=>{n(!1),P.push(y.J.aieasypic.toolsTextToVideo)},children:"Yes, Go to Videos"})]})]})]})},P=e=>{let{image_id:i}=e,{mutate:l}=(0,f.nCj)(),a=(0,k.jE)();return(0,o.jsxs)(s.Y,{onClick:e=>{e.stopPropagation(),l({id:i},{onSuccess:()=>{a.invalidateQueries((0,f.BxK)())}})},children:[(0,o.jsx)(d.M,{variant:"filled",color:"orange",children:(0,o.jsx)(p.MKb,{})}),(0,o.jsx)(u.E,{children:"Ban"})]})},E=e=>{let{image:i}=e;return(0,o.jsxs)(s.Y,{children:[(0,o.jsx)(d.M,{variant:"filled",color:"red",children:(0,o.jsx)(p.ucK,{})}),(0,o.jsx)(u.E,{children:"Delete"})]})};var _=l(73641),I=l(73509),A=l(52482);let U=e=>{let{image:i}=e,{data:l}=(0,g.P)();return(0,o.jsxs)(s.Y,{sx:{opacity:(null==l?void 0:l.email)?1:.7},children:[(0,o.jsx)(d.M,{variant:"filled",color:"cyan",children:(0,o.jsx)(p.Aon,{})}
1),(0,o.jsx)(u.E,{children:"Remove Background"}),!(null==l?void 0:l.email)&&(0,o.jsx)(A.E,{sx:{color:"white",backgroundColor:"red"},children:"Login"})]})},D=e=>{let{image:i}=e;return(0,o.jsxs)(s.Y,{children:[(0,o.jsx)(d.M,{variant:"filled",color:"purple",children:(0,o.jsx)(p.dAw,{transform:"scale(1.3)"})}),(0,o.jsx)(u.E,{children:"Create Similar"})]})},L=e=>{var i;let{image:l}=e,{data:a}=(0,g.P)();return(0,o.jsxs)(s.Y,{sx:{opacity:(null==a?void 0:a.email)?1:.7},children:[(0,o.jsx)(d.M,{radius:15,disabled:l.is_upscaled,children:(0,o.jsx)(p.Bak,{transform:"scale(1.3)"})}),(0,o.jsxs)(u.E,{children:[l.is_upscaled?"Already Upscaled":"Upscale"," "]}),!(null==a?void 0:a.email)&&(0,o.jsx)(A.E,{sx:{color:"white",backgroundColor:"red"},children:"Login"}),(null==a||null==(i=a.plan)?void 0:i.name)==="free"&&(0,o.jsx)(A.E,{sx:{color:"white",backgroundColor:"red"},children:"Pro Only"})]})},M=e=>{let{image:i}=e,{data:l}=(0,g.P)();return(0,o.jsxs)(s.Y,{sx:{opacity:(null==l?void 0:l.email)?1:.9},children:[(0,o.jsxs)(d.M,{radius:15,disabled:i.is_upscaled,children:[(0,o.jsx)(p.Bak,{transform:"scale(1.3)"}),(0,o.jsx)(p.xZp,{transform:"scale(1.1)"})]}),(0,o.jsxs)(u.E,{children:[i.is_upscaled?"Already Upscaled":"Upscale Pro"," "]}),(0,o.jsx)(A.E,{sx:{color:"white",backgroundColor:"blue"},children:"Pro Only"}),!(null==l?void 0:l.email)&&(0,o.jsx)(A.E,{sx:{color:"white",backgroundColor:"red"},children:"Login"})]})},R=e=>{let{image:i,setMaximizedImage:l,features:h=["improve_section","basic_actions"],showLikeButton:A=!0,isPublic:R=!1,showCreateVideo:Y=!1}=e,[O,W]=(0,x.useState)(!0),[B,S]=(0,x.useState)(!1),z=(0,m.U)("(min-width: 768px)"),{data:T}=(0,g.P)(),{upscaleClick:G}=(e=>{let{mutate:i}=(0,f.jnp)(),l=(0,j.Pj)(e=>e.setIsGenerating),{data:o}=(0,g.P)();return{upscaleClick:a=>{var t;if(a.stopPropagation(),!e.is_upscaled){if(!(null==o?void 0:o.email))return void(0,v.Ds)({title:"Not Available",message:"Login to upscale",color:"red",autoClose:3e3});if((!(null==o?void 0:o.credits)||(null==o||null==(t=o.plan)?void 0:t.name)==="free")&&!(null==o?void 0:o.is_staff))return void(0,v.Ds)({title:"Only avaialble for Pro users",message:"You need to subscribe to a plan to use this feature",color:"red",autoClose:3e3});i({id:e.id}),(0,v.Ds)({title:"Upscaling Image",message:"This may take a while...",color:"cyan",autoClose:3e3}),l(!0)}}}})(i),{upscaleProClick:N}=(e=>{let{mutate:i}=(0,f.jnp)(),l=(0,j.Pj)(e=>e.setIsGenerating),{data:o}=(0,g.P)();return{upscaleProClick:a=>{var t;if(a.stopPropagation(),!e.is_upscaled){if((!(null==o?void 0:o.credits)||(null==o||null==(t=o.plan)?void 0:t.name)==="free")&&!(null==o?void 0:o.is_staff))return void(0,v.Ds)({title:"Only avaialble for Pro users",message:"You need to subscribe to a plan to use this feature",color:"red",autoClose:3e3});if(!(null==o?void 0:o.email))return void(0,v.Ds)({title:"Not Available",message:"Login to upscale",color:"red",autoClose:3e3});i({id:e.id,params:{use_pro_upscale:!0}}),(0,v.Ds)({title:"Upscaling Image",message:"This may take a while...",color:"cyan",autoClose:3e3}),l(!0)}}}})(i),{reuseParamsClick:V}=(e=>{let{refetch:i}=(0,f.fbm)(e.id,{query:{enabled:!1}}),l=(0,C.useRouter)();return{reuseParamsClick:e=>{e.stopPropagation(),i().then(e=>{if(e.data){var i,o;delete e.data.seed;let a=null==(i=l.asPath.split("?"))?void 0:i[0],t="".concat(a,"?").concat(null==(o=Object.entries(e.data))?void 0:o.filter(e=>("string"==typeof e[1]||"number"==typeof e[1]||"boolean"==typeof e[1])&&("lora_models"===e[0]||"batch_size"!==e[0])).map(e=>{let[i,l]=e;return"".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(l))}).join("&"));l.push(t),(0,v.Ds)({title:"Parameters reused",message:"The image will look the similar to the original image"})}})}}})(i),{sendToImageEditor:F}=(e=>{(0,C.useRouter)();let{data:i,refetch:l}=(0,f.DqQ)(e.id,{query:{enabled:!1}});return{sendToImageEditor:e=>{e.stopPropagation(),l().then(e=>{let{data:i}=e;(null==i?void 0:i.image)&&window.open("".concat(y.J.aieasypic.toolsImgEditor,"?imageUrl=").concat(i.image),"_self")})}}})(i),{removeBackgroundImageClick:K}=(e=>{let{mutate:i}=(0,f.mI3)(),l=(0,j.Pj)(e=>e.setIsGenerating),{data:o}=(0,g.P)();
1return{removeBackgroundImageClick:a=>{if(a.stopPropagation(),!(null==o?void 0:o.email))return void(0,v.Ds)({title:"Not Available",message:"Login to remove background",color:"red",autoClose:3e3});i({id:e.id}),(0,v.Ds)({title:"Remove Image Background",message:"This may take a while...",color:"cyan",autoClose:3e3}),l(!0)}}})(i),{deleteImageClick:Q}=(e=>{let{mutate:i}=(0,f.nmj)(),l=(0,k.jE)();return{deleteImageClick:o=>{o.stopPropagation(),i({id:e.id},{onSuccess:()=>{l.invalidateQueries((0,f.BxK)()),(0,v.Ds)({title:"Image deleted",message:"Image deleted successfully"})},onError:e=>{(0,b.A)(e)}})}}})(i);return(0,o.jsx)(a.a,{children:(0,o.jsxs)(a.a,{sx:{position:"relative",":hover":{filter:"brightness(0.7)"}},onMouseEnter:()=>{W(!1)},children:[(0,o.jsx)(t._,{height:z?"320px":"250px",withPlaceholder:!0,alt:"",src:i.image||i.base_encoded||"",radius:"md",imageProps:{loading:"lazy",style:{cursor:"pointer"}},onClick:R?V:()=>{l(i)}}),(0,o.jsxs)(s.Y,{position:"apart",px:20,py:10,sx:{position:"absolute",top:0,left:0,pointerEvents:"none"},w:"100%",align:"flex-start",children:[(0,o.jsxs)(n.B,{sx:{pointerEvents:"auto"},children:[A?(0,o.jsx)(I.A,{image:i}):(0,o.jsx)(r.$,{onClick:V,color:"blue",children:"Create Similar"}),Y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{image:i,imageUrl:i.image}),(0,o.jsx)(d.M,{component:"a",href:"https://bestphoto.ai/tools/image-to-image",target:"_blank",radius:15,color:"grape",size:"xl",variant:"filled",children:(0,o.jsx)(p.xfq,{})})]})]}),(null==h?void 0:h.length)>0&&(0,o.jsx)(a.a,{sx:{pointerEvents:"auto"},children:(0,o.jsxs)(c.W,{withinPortal:!0,opened:B,onClose:()=>{S(!1)},zIndex:1e3,children:[(0,o.jsx)(c.W.Target,{children:(0,o.jsx)(d.M,{radius:15,color:"dark",size:"xl",variant:"filled",onClick:e=>{e.stopPropagation(),S(!0)},children:(0,o.jsx)(p.Oer,{transform:"scale(1.3)"})})}),(0,o.jsxs)(c.W.Dropdown,{children:[h.includes("improve_section")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.W.Label,{children:"Improve Image"}),!(null==i?void 0:i.is_upscaled)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.W.Item,{onClick:G,p:5,children:(0,o.jsx)(L,{image:i||""})}),(0,o.jsx)(c.W.Item,{onClick:N,sx:e=>({backgroundColor:e.colors.blue[2]}),p:5,children:(0,o.jsx)(M,{image:i||""})})]}),(0,o.jsx)(c.W.Item,{onClick:V,p:5,children:(0,o.jsx)(D,{image:i||""})}),(0,o.jsx)(c.W.Item,{onClick:K,p:5,children:(0,o.jsx)(U,{image:i||""})}),(0,o.jsx)(c.W.Item,{component:"a",href:"https://bestphoto.ai/tools/image-to-image",target:"_blank",p:5,children:(0,o.jsxs)(s.Y,{children:[(0,o.jsx)(d.M,{variant:"filled",color:"violet",children:(0,o.jsx)(p.j2g,{})}),(0,o.jsx)(u.E,{children:"Edit Image"})]})})]}),h.includes("basic_actions")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.W.Label,{children:"Basic Actions"}),(0,o.jsx)(c.W.Item,{onClick:Q,p:5,children:(0,o.jsx)(E,{image:i})}),(0,o.jsx)(c.W.Item,{p:5,children:(0,o.jsx)(_.A,{image:(null==i?void 0:i.image)||(null==i?void 0:i.base_encoded)||""})}),(null==T?void 0:T.is_staff)&&(0,o.jsx)(c.W.Item,{p:5,children:(0,o.jsx)(P,{image_id:i.id})})]})]})]})})]})]})})}}}]);
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.