1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9632],{99632:function(e,t,r){r.d(t,{default:function(){return T}});var a=r(45481),s=r(22964),l=r(63646),n=r(67908),o=r(38072),i=r(57956),c=r(97667),d=r(21488),m=r(38443),u=r(62779);function f(e){let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,u.cn)("animate-spin",t),...r,children:(0,a.jsxs)("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})}var x=r(59416),h=r(90515),p=r(33483),g=r(64891),b=r(72931),j=r(79807),v=r(68249),w=r(66931),N=r(88667),k=r(7266),y=r(23910),C=r(21476),A=r(5538),z=r(45446),I=r(37460);let R=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(I.fC,{className:(0,u.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",r),...s,ref:t,children:(0,a.jsx)(I.bU,{className:(0,u.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});R.displayName=I.fC.displayName;var S=r(8957);function T(){let e=(0,l.useTranslations)("GPT4OGenerator"),{user:t,setShowSignModal:r}=(0,z.b)(),[u,y]=(0,s.useState)(!1),[I,T]=(0,s.useState)([{file:void 0,preview:"/imgs/gallery/8.png",base64:""}]),[U,D]=(0,s.useState)("Create image. Create a toy of the person in the photo. Let it be an action figure. Next to the figure, there should be the toy's equipment, each in its individual blisters. 1) a book called 'Tecnoforma'. 2) A 3-headed dog with a tag that says 'Troika' and a bone at its feet with word 'austerity' written on it. 3) a three-headed Hydra with with a tag called 'Geringon\xe7a'. 4) a book titled 'D. Sebasti\xe3o'. Don't repeat the equipment under any circumstance. The card holding the blister should be strong orange. Also, on top of the box, write 'Pedro Passos Coelho' and underneath it, 'PSD action figure'. The figure and equipment must all be inside blisters. Visualize this in a realistic way."),[E,L]=(0,s.useState)(""),[P,O]=(0,s.useState)("1:1"),[F,V]=(0,s.useState)([]),[_,G]=(0,s.useState)(null),q=(0,s.useRef)(null),[J,H]=(0,s.useState)(null),[B,K]=(0,s.useState)(!1),Y=(0,s.useRef)({taskIds:new Set,lastPollTimes:{},pollCounts:{}}),[M,W]=(0,s.useState)(null),[$,Q]=(0,s.useState)(!1),[X,ee]=(0,s.useState)(!1);(0,s.useEffect)(()=>{W(new Date().toLocaleString())},[]);let et=(0,s.useCallback)(e=>new Promise((t,r)=>{let a=new FileReader;a.onload=()=>{t(a.result.split(",")[1])},a.onerror=r,a.readAsDataURL(e)}),[]),er=async t=>{let r=Array.from(t.target.files||[]);if(I.length+r.length>5){n.Am.error(e("errors.maxFiles"));return}for(let t of r){if(t.size>5242880){n.Am.error(e("errors.fileTooLarge"));continue}try{let e=URL.createObjectURL(t),r=await et(t);T(a=>[...a,{file:t,preview:e,base64:r}])}catch(t){console.error("File conversion error:",t),n.Am.error(e("errors.processingFailed"))}}},ea=async t=>{t.preventDefault();let r=Array.from(t.dataTransfer.files);if(I.length+r.length>5){n.Am.error(e("errors.maxFiles"));return}for(let t of r){if(t.size>5242880){n.Am.error(e("errors.fileTooLarge"));continue}try{let e=URL.createObjectURL(t),r=await et(t);T(a=>[...a,{file:t,preview:e,base64:r}])}catch(t){console.error("File conversion error:",t),n.Am.error(e("errors.processingFailed"))}}},es=e=>{T(t=>{let r=[...t];return URL.revokeObjectURL(r[e].preview),r.splice(e,1),r})},el=(0,s.useCallback)(async t=>{if(!Y.current.taskIds.has(t)){console.log("ä»»å¡ ".concat(t," å·²ä¸å轮询å表ä¸"));return}let r=Date.now(),a=r-(Y.current.lastPollTimes[t]||0);if(a<5e3){setTimeout(()=>el(t),5e3-a);return}if(Y.current.lastPollTimes[t]=r,Y.current.pollCounts[t]=(Y.current.pollCounts[t]||0)+1,Y.current.pollCounts[t]>500){console.log("ä»»å¡ ".concat(t," å·²è¾¾å°æå¤§è½®è¯¢æ¬¡æ°ï¼åæ¢è½®è¯¢")),Y.current.taskIds.delete(t),V(e=>e.map(e=>e.taskId===t?{...e,status:"failed",ratio:e.ratio}:e));return}try{console.log("æ£å¨æ¥è¯¢ä»»å¡ç¶æ: ".concat(t));let r=new Headers;r.append("Accept","application/json");let a=await fetch("/api/gpt4o-image?taskId=".concat(t),{method:"GET",headers:r,redirect:"follow"}),s=await a.json();if(200!==s.code){let r=s.error||"unknown";n.Am.error(e("errors.".concat(r))),V(e=>e.map(e=>e.taskId===t?{...e,status:"failed",ratio:e.ratio}:e)),Y.current.taskIds.delete(t);return}let l=s.error||"unknown";"SUCCESS"===l?(Y.current.taskIds.delete(t),V(e=>e.map(e=>{if(e.taskId===t){let t=e.prompt,r="1:1";try{if(s.data.paramJson){let a=JSON.parse(s.data.paramJson),l="string"==typeof a?JSON.parse(a):a;t=l.prompt||e.prompt,r=l.size||"1:1"}}catch(e){}return{...e,status:"completed",prompt:t,ratio:r,images:s.data.images||[]}}return e}))):"GENERATING"===l?(setTimeout(()=>el(t),5e3),V(e=>e.map(e=>e.taskId===t?{...e,status:"pending"}:e))):(n.Am.error(e("errors.".concat(l))),V(e=>e.map(e=>e.taskId===t?{...e,status:"failed",ratio:e.ratio}:e)),Y.current.taskIds.delete(t))}catch(e){console.error("è½®è¯¢ä»»å¡æ¶åºé:",e),setTimeout(()=>el(t),1e4)}},[]),en=(0,s.useCallback)(e=>{!e||Y.current.taskIds.has(e)||(Y.current.taskIds.add(e),el(e))},[el]),eo=async()=>{try{if(!(null==t?void 0:t.uuid)){r(!0);return}if(!U&&(!I||0===I.length)){n.Am.error(e("errors.emptyPrompt"));return}if(!J){K(!0);return}y(!0);let i=[];I&&I.length>0&&(i=I.map(e=>e.base64));let c=new Headers;c.append("Content-Type","application/json"),c.append("Accept","application/json");let d=JSON.stringify({base64Images:i.length>0?i:void 0,prompt:U||void 0,size:P,turnstileToken:J,private:$?1:0}),m=await fetch("/api/gpt4o-image",{method:"POST",headers:c,body:d,redirect:"follow"}).then(e=>e.text()).catch(t=>{throw console.error("Generation error:",t),Error(e("generateError"))}),u=JSON.parse(m);
1if(200!==u.code){let t=u.error||"unknown";switch(u.code){case 401:t="INVALID_TOKEN"===t?"invalidToken":"unauthorized",n.Am.error(e("errors.".concat(t)));break;case 402:var a,s,l,o;n.Am.error(e("errors.insufficientCredits",{left:null===(s=u.data)||void 0===s?void 0:null===(a=s.credits)||void 0===a?void 0:a.left,required:null===(o=u.data)||void 0===o?void 0:null===(l=o.credits)||void 0===l?void 0:l.required})),ec();break;case 422:n.Am.error(e("errors.".concat(t)));break;case 429:n.Am.error(e("errors.rateLimitExceeded"));break;case 455:n.Am.error(e("errors.serviceUnavailable"));break;case 505:n.Am.error(e("errors.featureDisabled"));break;case 404:n.Am.error(e("errors.notFound"));break;case 500:n.Am.error(e("errors.internalError"));break;default:n.Am.error(e("errors.unknown"))}return}let f=u.data.taskId,x={id:Date.now().toString(),timestamp:new Date().toLocaleString(),prompt:U,ratio:P,taskId:f,status:"pending",credits:u.data.credits};V(e=>[x,...e]),en(f),100===u.code?n.Am.success(e("taskCreated")):200===u.code&&n.Am.success(e("generateSuccess"))}catch(t){console.error("Generation error:",t),n.Am.error(e("generateError"))}finally{y(!1)}};function ei(e,t){let r=encodeURIComponent("Barbie Style"),a="";switch(e){case"facebook":a="https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(t));break;case"twitter":a="https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(t),"&text=").concat(r);break;case"linkedin":a="https://www.linkedin.com/sharing/share-offsite/?url=".concat(encodeURIComponent(t));break;case"telegram":a="https://t.me/share/url?url=".concat(encodeURIComponent(t),"&text=").concat(r);break;case"email":a="mailto:?subject=".concat(r,"&body=").concat(encodeURIComponent("".concat(r,"\n").concat(t)));break;default:return}window.open(a,"_blank","noopener,noreferrer")}(0,s.useEffect)(()=>{let t=t=>{let{prompt:r,aspectRatio:a,title:s}=t.detail;if(r){D(r),a&&("1:1"===a||"2:3"===a||"3:2"===a)&&O(a),s&&(document.title="".concat(s," - ").concat(e("generate")));let t=document.getElementById("gpt4o-generator");t&&t.scrollIntoView({behavior:"smooth"}),n.Am.success(e("remix.success"))}};return window.addEventListener("remixImage",t),()=>{window.removeEventListener("remixImage",t)}},[e]);let ec=()=>{window.location.href="/pricing"},ed=async t=>{if(!t){Q(!1);return}ee(!0);try{let t=await fetch("/api/credit/user-credits");(await t.json()).is_recharged?Q(!0):(n.Am.info(e("privateTip")),window.location.hash="pricing")}catch(t){console.error("Failed to check user credits:",t),n.Am.error(e("userLoading"))}finally{ee(!1)}};return(0,a.jsxs)("div",{className:"relative",id:"gpt4o-generator",children:[(0,a.jsx)("div",{className:"w-full max-w-[1400px] mx-auto px-6 py-6",children:(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-6",children:[(0,a.jsx)("div",{className:"w-full md:w-[560px] md:flex-shrink-0 bg-card/50 backdrop-blur-sm border border-border rounded-xl",children:(0,a.jsxs)("div",{className:"p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("p",{className:"text-base font-semibold",children:e("prompt")}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[U.length,"/1000"]})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(c.g,{value:U,onChange:e=>D(e.target.value),placeholder:e("promptPlaceholder"),className:"min-h-[180px] resize-none bg-card/50 backdrop-blur-sm border-muted p-4",maxLength:1e3}),(0,a.jsx)("div",{className:"absolute bottom-3 right-3 flex items-center gap-2",children:(0,a.jsx)(o.z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2 hover:bg-primary/10",onClick:()=>D(""),disabled:!U})})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("p",{className:"text-base font-semibold",children:e("uploadImages")}),(0,a.jsxs)("span",{className:"text-sm text-muted-foreground",children:[I.length,"/5"]})]}),(0,a.jsxs)("div",{onClick:()=>{var e;null===(e=q.current)||void 0===e||e.click()},onDrop:ea,onDragOver:e=>{e.preventDefault()},className:"border-2 border-dashed rounded-lg p-4 transition-colors cursor-pointer ".concat(I.length>0?"border-primary":"border-border hover:border-primary/50"),children:[I.length>0?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[I.map((t,r)=>(0,a.jsxs)("div",{className:"relative aspect-square",children:[(0,a.jsx)("img",{src:t.preview,alt:e("referenceImage"),className:"rounded-lg object-cover w-full h-full"}),(0,a.jsx)(o.z,{variant:"outline",size:"icon",className:"absolute top-2 right-2 h-7 w-7 rounded-full bg-background/95 hover:bg-red-500/10 border-none ring-1 ring-border/50 hover:ring-red-500/50 transition-all group",onClick:e=>{e.stopPropagation(),es(r)}
1,children:(0,a.jsx)(C.Z,{className:"h-4 w-4 text-foreground/70 group-hover:text-red-500 transition-colors"})})]},r)),I.length<5&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center border-2 border-dashed border-border rounded-lg aspect-square",children:[(0,a.jsx)(x.Z,{className:"h-8 w-8 text-muted-foreground mb-2"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:e("addMoreImages")})]})]}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-6",children:[(0,a.jsx)(x.Z,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center",children:e("dropzoneText")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:e("dropzoneTip")})]}),(0,a.jsx)(i.I,{type:"file",ref:q,className:"hidden",accept:"image/*",onChange:er,multiple:!0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-base font-semibold",children:"Ratio"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(o.z,{type:"button",onClick:()=>O("3:2"),variant:"3:2"===P?"default":"outline",className:"flex-1 items-center gap-2 ".concat("3:2"===P?"border-2 border-primary":""),children:[(0,a.jsx)(x.Z,{className:"h-4 w-4"})," 3:2"]}),(0,a.jsxs)(o.z,{type:"button",onClick:()=>O("2:3"),variant:"2:3"===P?"default":"outline",className:"flex-1 items-center gap-2 ".concat("2:3"===P?"border-2 border-primary":""),children:[(0,a.jsx)(x.Z,{className:"h-4 w-4 rotate-90"})," 2:3"]}),(0,a.jsxs)(o.z,{type:"button",onClick:()=>O("1:1"),variant:"1:1"===P?"default":"outline",className:"flex-1 items-center gap-2 ".concat("1:1"===P?"border-2 border-primary":""),children:[(0,a.jsx)("div",{className:"h-4 w-4 border border-current rounded-sm"})," 1:1"]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-4 mb-2",children:[(0,a.jsx)(R,{checked:$,disabled:X,onCheckedChange:ed,id:"private-switch"}),(0,a.jsx)("label",{htmlFor:"private-switch",className:"text-base font-medium text-foreground select-none cursor-pointer",children:e("private")}),(0,a.jsx)(S.pn,{children:(0,a.jsxs)(S.u,{children:[(0,a.jsx)(S.aJ,{asChild:!0,children:(0,a.jsx)(h.Z,{className:"w-4 h-4 text-muted-foreground cursor-pointer"})}),(0,a.jsx)(S._v,{side:"top",children:e("privateTip")})]})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)(o.z,{onClick:eo,disabled:u||!U,className:"w-full h-12 text-base font-medium",size:"lg",children:[u?(0,a.jsx)(f,{className:"mr-2"}):(0,a.jsx)(p.Z,{className:"mr-2 h-5 w-5"}),e("generate")]}),(0,a.jsx)("div",{className:"flex items-center justify-center mt-1",children:(0,a.jsxs)(o.z,{variant:"outline",size:"sm",className:"w-full text-xs flex justify-between items-center",onClick:ec,children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(g.Z,{className:"w-3.5 h-3.5 mr-1.5"}),(0,a.jsx)("span",{children:e("recharge.standard")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.C,{variant:"secondary",className:"font-normal",children:e("recharge.credits")}),(0,a.jsx)("span",{className:"font-semibold text-primary",children:e("recharge.price")})]})]})})]})]})}),(0,a.jsx)("div",{className:"w-full md:flex-1 bg-card/50 backdrop-blur-sm border border-border rounded-xl overflow-hidden",children:(0,a.jsx)("div",{className:"h-full flex flex-col",children:F.length>0?(()=>{let t=F[0],r=t.images&&t.images.length>0?t.images[0]:void 0;return(0,a.jsxs)("div",{className:"flex flex-col h-full relative",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 space-x-3",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(d.C,{variant:"outline",className:"text-xs font-semibold",children:"GPT4O"}),(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:M||""})]}),(0,a.jsx)("div",{children:(0,a.jsx)(d.C,{variant:"failed"===t.status?"destructive":"completed"===t.status?"default":"secondary",className:"rounded-full px-3 py-0.5 font-medium",children:"completed"===t.status?e("statuses.completed",{fallback:"Completed"}):"failed"===t.status?e("statuses.failed",{fallback:"Failed"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f,{className:"w-3 h-3 mr-1"})," ",e("statuses.processing",{fallback:"Processing..."})]})})})]}),(0,a.jsx)("div",{className:"flex-1 flex flex-col px-4 pb-4",children:"pending"===t.status?(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center min-h-[400px]",children:(0,a.jsx)(f,{className:"w-12 h-12"})}):"failed"===t.status?(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center min-h-[400px]",children:(0,a.jsx)("p",{className:"text-destructive",children:e("errors.generationFailed")})}):t.images&&t.images.length>0?(0,a.jsxs)("div",{className:"flex flex-col space-y-3",children:[(0,a.jsx)("div",{className:"relative cursor-pointer flex-1 flex items-center justify-center overflow-hidden rounded-lg",onClick:()=>t.images&&G({url:t.images[0],index:0}),children:(0,a.jsx)("img",{src:t.images[0],alt:"Generated image",className:"max-w-full max-h-[500px] object-contain rounded-lg"})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 justify-end mt-2",children:r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>(function(t){fetch(t).then(e=>e.blob()).then(t=>{let r=URL.createObjectURL(t),a=document.createElement("a");a.href=r,a.download="barbie-style-".concat(Date.now(),".png"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r),n.Am.success(e("share.downloadSuccess"))}).catch(()=>{n.Am.info(e("share.downloadCrossOriginFailed",{fallback:"该å¾çå è·¨åéå¶æ æ³èªå¨ä¸è½½ï¼è¯·å³é®å¾çå¦å为"}))})})(r),children:(0,a.jsx)(b.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("facebook",r),children:(0,a.jsx)(j.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("twitter",r),children:(0,a.jsx)(v.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("linkedin",r),children:(0,a.jsx)(w.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("telegram",r),children:(0,a.jsx)(N.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("email",r),children:(0,a.jsx)(k.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>(function(t){D(t);let r=document.getElementById("gpt4o-generator");r&&r.scrollIntoView({behavior:"smooth"}),n.Am.success(e("remix.success"))})(t.prompt),children:(0,a.jsx)(p.Z,{className:"w-4 h-4"})})]})}),(0,a.jsx)("div",{className:"mt-4 border-t border-border pt-3",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("p",{className:"text-sm font-medium mb-1",children:[e("prompt",{fallback:"Prompt"}),":"]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground break-words",children:t.prompt})]})})]}):(0,a.jsxs)("div",{className:"flex-1 flex items-center justify-center min-h-[400px]",children:[(0,a.jsx)("img",{src:"/imgs/gallery/8-result.webp",alt:"Default result",className:"max-w-full max-h-[400px] object-contain rounded-lg mb-4"}),(0,a.jsx)("p",{className:"text-muted-foreground text-center text-sm",children:U})]})})]},t.id)})():(0,a.jsxs)("div",{className:"flex flex-col h-full relative",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 space-x-3",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(d.C,{variant:"outline",className:"text-xs font-semibold",children:"GPT4O"}),(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:M||""})]}),(0,a.jsx)("div",{children:(0,a.jsx)(d.C,{variant:"default",className:"rounded-full px-3 py-0.5 font-medium",children:"Completed"})})]}),(0,a.jsx)("div",{className:"flex-1 flex flex-col px-4 pb-4",children:(0,a.jsxs)("div",{className:"flex flex-col space-y-3",children:[(0,a.jsx)("div",{className:"relative cursor-pointer flex-1 flex items-center justify-center overflow-hidden rounded-lg",children:(0,a.jsx)("img",{src:"/imgs/gallery/8-result.webp",alt:"Default result",className:"max-w-full max-h-[500px] object-contain rounded-lg"})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end mt-2",children:[(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("facebook","/imgs/gallery/8-result.webp"),children:(0,a.jsx)(j.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("twitter","/imgs/gallery/8-result.webp"),children:(0,a.jsx)(v.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("linkedin","/imgs/gallery/8-result.webp"),children:(0,a.jsx)(w.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("telegram","/imgs/gallery/8-result.webp"),children:(0,a.jsx)(N.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",className:"rounded-full w-9 h-9 p-0",onClick:()=>ei("email","/imgs/gallery/8-result.webp"),children:(0,a.jsx)(k.Z,{className:"w-4 h-4"})})]}),(0,a.jsx)("div",{className:"mt-4 border-t border-border pt-3",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("p",{className:"text-sm font-medium mb-1",children:[e("prompt",{fallback:"Prompt"}),":"]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground break-words",children:U})]})})]})})]},"default")})})]})}),B&&(0,a.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-[2px]",onClick:()=>K(!1)}),(0,a.jsx)("div",{className:"relative w-fit bg-background/95 shadow-lg rounded-lg overflow-hidden",children:(0,a.jsxs)("div",{className:"p-4 flex flex-col items-center",children:[(0,a.jsx)("p",{className:"text-sm text-center text-muted-foreground mb-2",children:e("verification.required",{fallback:"Please verify that you are human"})}),(0,a.jsx)("div",{className:"flex justify-center -mt-1 scale-[0.92] transform-origin-center",children:(0,a.jsx)(A.N,{sitekey:"0x4AAAAAAA_JMCy8DKHwYHKj",onVerify:e=>{H(e),K(!1),eo()},onError:()=>{n.Am.error(e("verification.failed")),K(!1)}})})]})})]}),(0,a.jsx)(m.Vq,{open:!!_,onOpenChange:()=>G(null),children:(0,a.jsx)(m.cZ,{className:"max-w-[90%] w-[1400px] h-[90vh] p-0",children:_&&(0,a.jsx)(Z,{imageUrl:_.url,prompt:U})})})]})}function Z(e){let{imageUrl:t,prompt:r}
1=e,i=(0,l.useTranslations)("Gallery"),[c,d]=(0,s.useState)(1),[m,u]=(0,s.useState)(!1),[f,x]=(0,s.useState)({x:0,y:0}),[h,p]=(0,s.useState)(!1);(0,s.useRef)(null);let g=async()=>{try{let e=document.createElement("a");e.href=t,e.download="barbie-style-".concat(Date.now(),".png"),document.body.appendChild(e),e.click(),document.body.removeChild(e),n.Am.success(i("share.downloadSuccess"))}catch(e){n.Am.error(i("share.downloadFailed"))}},C=e=>{let t=window.location.href,r=encodeURIComponent("Barbie Style"),a="";switch(e){case"facebook":a="https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(t));break;case"twitter":a="https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(t),"&text=").concat(r);break;case"linkedin":a="https://www.linkedin.com/sharing/share-offsite/?url=".concat(encodeURIComponent(t));break;case"telegram":a="https://t.me/share/url?url=".concat(encodeURIComponent(t),"&text=").concat(r);break;case"email":a="mailto:?subject=".concat(r,"&body=").concat(encodeURIComponent("".concat(r,"\n").concat(t)));break;default:return}window.open(a,"_blank","noopener,noreferrer")};return(0,a.jsxs)("div",{className:"flex flex-col md:flex-row h-full",children:[(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center bg-black min-h-[50vh] md:min-h-0",children:(0,a.jsx)("img",{src:t,alt:"detail",className:"max-w-full max-h-[50vh] md:max-h-[80vh] object-contain mx-auto"})}),(0,a.jsx)("div",{className:"w-full md:w-[320px] bg-background p-4 flex flex-col overflow-y-auto max-h-[40vh] md:max-h-[90vh]",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:"text-base font-semibold text-foreground",children:i("prompt",{fallback:"Prompt"})}),(0,a.jsx)(o.z,{variant:"ghost",size:"icon",className:"ml-2",onClick:()=>{navigator.clipboard.writeText(r),n.Am.success(i("share.linkCopied",{fallback:"å·²å¤å¶æç¤ºè¯"}))},title:i("share.linkCopied",{fallback:"å¤å¶æç¤ºè¯"}),children:(0,a.jsx)(y.Z,{className:"w-4 h-4 text-muted-foreground hover:text-primary"})})]}),(0,a.jsx)("div",{className:"space-y-2",children:(0,a.jsx)("div",{className:"rounded bg-muted px-3 py-2 text-sm text-muted-foreground break-words whitespace-pre-line border border-border",children:r})}),(0,a.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,a.jsxs)(o.z,{variant:"default",onClick:g,className:"w-full relative overflow-hidden group transition-all duration-300 hover:shadow-lg hover:scale-[1.02]",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/0 via-primary/30 to-primary/0 group-hover:opacity-100 opacity-0 animate-shimmer"}),(0,a.jsx)(b.Z,{className:"w-4 h-4 mr-2"}),i("share.download")]}),(0,a.jsxs)("div",{className:"grid grid-cols-5 gap-2",children:[(0,a.jsx)(o.z,{variant:"outline",onClick:()=>C("facebook"),className:"",children:(0,a.jsx)(j.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",onClick:()=>C("twitter"),className:"",children:(0,a.jsx)(v.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",onClick:()=>C("linkedin"),className:"",children:(0,a.jsx)(w.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",onClick:()=>C("telegram"),className:"",children:(0,a.jsx)(N.Z,{className:"w-4 h-4"})}),(0,a.jsx)(o.z,{variant:"outline",onClick:()=>C("email"),className:"",children:(0,a.jsx)(k.Z,{className:"w-4 h-4"})})]})]})]})})]})}},38443:function(e,t,r){r.d(t,{$N:function(){return f},Be:function(){return x},Vq:function(){return i},cZ:function(){return m},fK:function(){return u}});var a=r(45481),s=r(22964),l=r(86590),n=r(49778),o=r(62779);let i=l.fC;l.xz;let c=l.h_;l.x8;let d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(l.aV,{ref:t,className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...s})});d.displayName=l.aV.displayName;let m=s.forwardRef((e,t)=>{let{className:r,children:s,...i}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(d,{}),(0,a.jsxs)(l.VY,{ref:t,className:(0,o.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
1nded-lg",r),...i,children:[s,(0,a.jsxs)(l.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});m.displayName=l.VY.displayName;let u=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};u.displayName="DialogHeader";let f=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(l.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold leading-none tracking-tight",r),...s})});f.displayName=l.Dx.displayName;let x=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(l.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",r),...s})});x.displayName=l.dk.displayName},57956:function(e,t,r){r.d(t,{I:function(){return n}});var a=r(45481),s=r(22964),l=r(62779);let n=s.forwardRef((e,t)=>{let{className:r,type:s,...n}=e;return(0,a.jsx)("input",{type:s,className:(0,l.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t,...n})});n.displayName="Input"},97667:function(e,t,r){r.d(t,{g:function(){return n}});var a=r(45481),s=r(22964),l=r(62779);let n=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t,...s})});n.displayName="Textarea"},8957:function(e,t,r){r.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return o},u:function(){return i}});var a=r(45481),s=r(22964),l=r(93111),n=r(62779);let o=l.zt,i=l.fC,c=l.xz,d=s.forwardRef((e,t)=>{let{className:r,sideOffset:s=4,...o}=e;return(0,a.jsx)(l.VY,{ref:t,sideOffset:s,className:(0,n.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...o})});d.displayName=l.VY.displayName},5538:function(e,t,r){r.d(t,{N:function(){return l}});var a=r(45481),s=r(22964);function l(e){let{sitekey:t="0x4AAAAAAA_JMCy8DKHwYHKj",onVerify:r,onError:l,onExpire:n,className:o}=e,i=(0,s.useRef)(null),c=(0,s.useRef)(),d=(0,s.useCallback)(()=>{if(c.current){var e;null===(e=window.turnstile)||void 0===e||e.reset(c.current)}},[]);return(0,s.useEffect)(()=>{let e=document.createElement("script");return e.src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback",e.async=!0,e.defer=!0,window.onloadTurnstileCallback=()=>{i.current&&(c.current=window.turnstile.render(i.current,{sitekey:t,callback:e=>{r(e)},"error-callback":()=>{null==l||l("Turnstile encountered an error")},"expired-callback":()=>{null==n||n(),d()}}))},document.body.appendChild(e),()=>{if(c.current){var t;null===(t=window.turnstile)||void 0===t||t.remove(c.current)}document.body.removeChild(e),delete window.onloadTurnstileCallback}},[t,r,l,n,d]),(0,a.jsx)("div",{ref:i,className:o,"data-theme":"light"})}}}]);
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.