1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5980],{39883:(e,s,t)=>{t.d(s,{default:()=>C});var a=t(934),l=t(39793),r=t(37734),n=t(45858),i=t(43348),o=t(61506),c=t(35200),d=t(6635),x=t(6895),m=t(27207),p=t(73529),h=t(48665),u=t(74285),j=t(59229),b=t(27257),g=t(78219),f=t(94081),w=t.n(f),N=t(61569);let v={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},y={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},$=e=>e.metadata||{},k=e=>(0,g.tR)(e,$(e)),I=e=>e.prompt||($(e).input||{}).prompt||"",A=e=>{if("string"!=typeof e)return!1;let s=e.trim();return!(!s||/\s/.test(s))&&(s.startsWith("http://")||s.startsWith("https://")||s.startsWith("/")||s.startsWith("blob:")||s.startsWith("data:image/"))};function C({infiniteScroll:e=!1,userEmail:s}){let t=(0,n.usePathname)(),f=(0,r.useRef)((0,l.createClientComponentClient)());(0,o.useTranslations)("Home.Explore");let C=t.includes("/explore"),S=(0,r.useRef)(null),[z,T]=(0,r.useState)(null),[U,_]=(0,r.useState)(null),[R,V]=(0,r.useState)(!0),{items:D,loading:O,hasMore:P,loadMore:W,toggleFeatured:F,isViewingAll:H}=(0,u.y)({type:"images",supabase:f.current,userEmail:s,infiniteScroll:e});if((0,r.useEffect)(()=>{D.length>0&&R&&V(!1)},[D]),(0,r.useEffect)(()=>{console.log("Images count:",D.length),console.log("Infinite scroll:",e),console.log("Has more:",P)},[D,e,P]),(0,r.useEffect)(()=>{if(!e||!P)return;let s=new IntersectionObserver(e=>{e[0].isIntersecting&&P&&!O&&W()},{root:null,rootMargin:"100px",threshold:.1});return S.current&&s.observe(S.current),()=>{S.current&&s.unobserve(S.current)}},[P,O,e]),O&&R)return(0,a.jsx)(E,{});let J=(0,b.Y$)(s);return(0,a.jsxs)("div",{className:`min-h-screen ${d.w.colors.background.primary} p-2 sm:p-0 md:p-2`,children:[U&&(e=>{if(!e)return null;try{var s;let t;return(0,a.jsx)("div",{className:` 2 fixed inset-0 z-50 flex items-center justify-center 3 bg-black bg-opacity-70 4 `,children:(0,a.jsxs)("div",{className:` 5 relative w-full max-w-3xl max-h-[80vh] overflow-y-auto m-4 6 ${d.w.components.card.content} 7 border border-gray-800 8 p-6 rounded-lg 9 shadow-xl 10 `,children:[(0,a.jsx)("button",{onClick:()=>_(null),className:`absolute top-3 right-3 p-1 rounded-full ${d.w.colors.brand.bg} ${d.w.colors.overlay.light} text-white`,children:(0,a.jsx)(x.A,{size:18})}),(0,a.jsx)("h3",{className:`text-xl font-bold ${d.w.colors.text.primary} mb-4`,children:"å¾ç详ç»ä¿¡æ¯"}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:`text-sm font-semibold ${d.w.colors.text.brand} mb-2`,children:"åºæ¬ä¿¡æ¯"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"Task ID:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.taskId})]}),e.id&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"æ°æ®åº ID:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.id})]}),e.userId&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"ç¨æ· ID:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.userId})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"ç¨æ·é®ç®±:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.email||"Anonymous"})]}),e.model&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"模å:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.model})]}),e.type&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"ç±»å:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.type})]}),void 0!==e.status&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"ç¶æ:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:(s=e.status,t=(0,g.xz)(s),"pending"===t?"çå¾ ä¸":"processing"===t?"å¤çä¸":"done"===t?"已宿":"failed"===t?"失败":String(s??"unknown"))})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:`text-sm font-semibold ${d.w.colors.text.brand} mb-2`,children:"æ¶é´ä¸ç¶æ"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"å建æ¶é´:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.createdAt})]}),e.updatedAt&&e.updatedAt!==e.createdAt&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"æ´æ°æ¶é´:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.updatedAt})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"ç¹è²:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.isFeatured?"æ¯":"å¦"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"ä»è´¹å 容:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:e.isVipTask?"æ¯":"å¦"})]})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:`text-sm font-semibold ${d.w.colors.text.brand} mb-2`,children:"å å®¹æ°æ®"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"æç¤ºè¯:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary}`,children:I(e)||"æªæä¾"})]}),k(e)?.images&&k(e).images.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"å¾çURL:"}),(0,a.jsx)("span",{className:`ml-2 ${d.w.colors.text.secondary} break-all`,children:k(e).images[0]})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:`text-sm font-semibold ${d.w.colors.text.brand} mb-2`,children:"è¯¦ç»æ°æ®"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"宿´æ°æ®:"}),(0,a.jsx)("pre",{className:`mt-1 p-2 ${d.w.colors.background.secondary} rounded overflow-x-auto max-h-[180px]`,children:JSON.stringify($(e),null,2)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:`font-semibold ${d.w.colors.text.brand}`,children:"åå§å¯¹è±¡:"}),(0,a.jsx)("pre",{className:`mt-1 p-2 ${d.w.colors.background.secondary} rounded overflow-x-auto max-h-[180px]`,children:JSON.stringify(e,(e,s)=>"metadata"===e?"...":s,2)})]})]})]})]})]})})}catch(s){return console.error("è§£æå¾çæ°æ®æ¶åºé",s),(0,a.jsx)("div",{className:` 11 fixed inset-0 z-50 flex items-center justify-center 12 bg-black bg-opacity-70 13 `,children:(0,a.jsxs)("div",{className:` 14 relative w-full max-w-lg 15 ${d.w.components.card.content} 16 border border-gray-800 17 p-6 rounded-lg 18 shadow-xl 19 `,children:[(0,a.jsx)("button",{onClick:()=>_(null),className:`absolute top-3 right-3 p-1 rounded-full ${d.w.colors.brand.bg} ${d.w.colors.overlay.light} text-white`,children:(0,a.jsx)(x.A,{size:18})}),(0,a.jsx)("p",{className:"text-red-500 text-lg mb-4",children:"æ æ³
19è§£æå¾çæ°æ®"}),(0,a.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(e,null,2)})]})})}})(U),(0,a.jsx)("div",{className:"relative z-10",children:(0,a.jsxs)("div",{className:"mx-auto px-2 sm:px-0 lg:px-8",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-12",children:[(0,a.jsx)(c.P.h2,{className:`text-4xl font-bold ${d.w.colors.text.primary}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},children:(0,a.jsx)("span",{className:"relative",children:(0,a.jsx)("span",{className:`absolute -bottom-2 left-0 right-0 h-[2px] ${d.w.colors.brand.bg} opacity-30`})})}),!C&&D.length>6&&(0,a.jsxs)(w(),{href:"/explore",className:` 20 ${d.w.components.button.secondary} 21 group 22 `,children:["View All",(0,a.jsx)(m.A,{className:"w-4 h-4 ml-1 group-hover:translate-x-1 transition-transform"})]})]}),(0,a.jsx)(c.P.div,{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 sm:gap-3 lg:gap-4",variants:v,initial:"hidden",animate:"show",children:D.map(e=>{let t,l,r=(t=k(e),l=$(e).output||{},((...e)=>{for(let s of e){if(A(s))return s.trim();if(s&&"object"==typeof s){let e=s.url||s.imageUrl||s.image_url||s.src||s.path||"";if(A(e))return e.trim()}}return""})(t?.images?.[0],t?.urls?.[0],t?.image,t?.url,t?.imageUrl,t?.image_url,l?.images?.[0],l?.urls?.[0],l?.image,l?.url,l?.imageUrl,l?.image_url)),n=I(e);return(0,a.jsxs)(c.P.div,{variants:y,className:"group relative",children:[!!e.isVipTask&&(0,b.Y$)(s)&&(0,a.jsx)("div",{className:` 23 absolute top-2 left-2 z-10 24 px-2 py-1 rounded-full 25 bg-gradient-to-r from-purple-500 to-pink-500 26 text-[10px] font-medium text-white 27 shadow-lg 28 `,children:"PRO"}),J&&(0,a.jsx)(j.A,{isFeatured:!!e.isFeatured,onToggle:s=>{s.preventDefault(),F(e)}}),(0,a.jsx)("div",{className:` 29 ${d.w.components.card.gradient} 30 h-full 31 `,children:(0,a.jsxs)("div",{className:` 32 ${d.w.components.card.content} 33 ${d.w.components.card.hover} 34 ${d.w.components.card.glow} 35 h-full flex flex-col 36 `,children:[(0,a.jsxs)("div",{className:"relative aspect-square overflow-hidden",children:[r?(0,a.jsx)(N.default,{src:r,alt:n,fill:!0,className:` 37 object-cover 38 ${d.w.animations.scale} 39 group-hover:scale-[1.01] 40 `}):(0,a.jsx)("div",{className:` 41 w-full h-full flex items-center justify-center 42 bg-black/40 text-gray-400 text-xs sm:text-sm 43 `,children:"No preview"}),J&&(0,a.jsx)("button",{onClick:()=>_(e),className:` 44 absolute bottom-2 right-2 z-10 45 p-1.5 rounded-full 46 bg-black bg-opacity-60 hover:bg-opacity-80 47 text-white 48 transition-all duration-200 49 opacity-0 group-hover:opacity-100 50 `,children:(0,a.jsx)(p.A,{size:16})})]}),(0,a.jsxs)("div",{className:"p-2 sm:p-3 h-[80px] sm:h-[90px]",children:[(0,a.jsx)("p",{className:` 51 text-xs sm:text-sm ${d.w.colors.text.secondary} 52 line-clamp-2 mb-1 sm:mb-2 53 `,children:n}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:` 54 w-5 h-5 sm:w-6 sm:h-6 rounded-full 55 ${d.w.colors.brand.bg} 56 ${d.w.colors.overlay.light} 57 flex items-center justify-center 58 ${d.w.colors.text.brand} 59 text-[10px] sm:text-xs font-bold 60 `,children:e.email?e.email[0].toUpperCase():"?"}),(0,a.jsx)("div",{children:(0,b.Y$)(s)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:`text-[8px] sm:text-[10px] ${d.w.colors.text.tertiary}`,children:e.email||"Anonymous"}),(0,a.jsxs)("div",{className:"flex items-center space-x-1 mt-0.5",children:[e.type&&(0,a.jsx)("span",{className:`text-[7px] sm:text-[9px] px-1 py-0.5 rounded ${d.w.colors.brand.bg} ${d.w.colors.overlay.light} ${d.w.colors.text.brand}`,children:"texttoimage"===e.type?"T2I":"imagetoimage"===e.type?"I2I":e.type}),e.model&&(0,a.jsx)("span",{className:"text-[7px] sm:text-[9px] px-1 py-0.5 rounded bg-gray-800 text-gray-200",children:e.model})]}),(0,a.jsx)("p",{className:`text-[8px] sm:text-[10px] ${d.w.colors.text.tertiary} mt-0.5`,children:(0,i.M)(e.createdAt)}),(0,a.jsxs)("p",{className:`text-[8px] sm:text-[10px] ${d.w.colors.text.tertiary} mt-0.5`,children:["ID: ",e.taskId]})]}):(0,a.jsx)("p",{className:`text-[8px] sm:text-[10px] ${d.w.colors.text.tertiary}`,children:(0,i.M)(e.createdAt)})})]})]})]})})]},e.taskId)})}),e&&(0,a.jsxs)("div",{ref:S,className:"flex justify-center items-center py-8",children:[O&&P&&(0,a.jsx)(h.A,{className:"w-6 h-6 animate-spin"}),!P&&(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"No more items to load"})]})]})})]})}function E(){return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-[50vh]",children:[(0,a.jsx)("div",{className:` 61 w-16 h-16 rounded-full 62 ${d.w.colors.brand.bg} 63 ${d.w.colors.overlay.light} 64 animate-pulse mb-4 65 `}),(0,a.jsx)("p",{className:`text-lg font-semibold ${d.w.colors.text.brand}`,children:"Loading..."})]})}},65980:(e,s,t)=>{t.d(s,{default:()=>d});var a=t(934),l=t(37734),r=t(73681),n=t(89505),i=t(39883),o=t(61506),c=t(46862);function d({infiniteScroll:e=!1}){let[s,t]=(0,l.useState)("videos");(0,o.useTranslations)("Home.Explore");let{user:d}=(0,l.useContext)(c.Rs);return(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-b from-background to-background/95 pt-16",children:(0,a.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,a.jsx)("div",{className:"text-center mb-10",children:(0,a.jsx)("h2",{className:"text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary/90 to-primary mb-4",children:"Explore User Creations"})}),(0,a.jsx)("div",{className:"flex justify-center w-full mb-12",children:(0,a.jsx)(r.tU,{defaultValue:"videos",className:"w-full max-w-[480px]",onValueChange:t,children:(0,a.jsxs)(r.j7,{className:"grid w-full grid-cols-2 p-2 bg-card border-2 border-border/20 rounded-2xl h-16",children:[(0,a.jsx)(r.Xi,{value:"videos",className:"text-base sm:text-lg py-3 rounded-xl data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg transition-all duration-300 hover:text-primary",children:"Videos"}),(0,a.jsx)(r.Xi,{value:"images",className:"text-base sm:text-lg py-3 rounded-xl data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg transition-all duration-300 hover:text-primary",children:"Images"})]})})}),(0,a.jsx)("div",{className:"space-y-8 sm:space-y-12",children:"videos"===s?(0,a.jsx)(n.default,{infiniteScroll:e,userEmail:d?.email,className:"animate-in fade-in duration-500"}):(0,a.jsx)(i.default,{infiniteScroll:e,userEmail:d?.email,className:"animate-in fade-in duration-500"})})]})})}}}]);
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.