PageSourceSearch

https://cdn.wisgate.ai/wisgate/_nuxt/4t1VRk1v.js

js wisgate.ai collected 2026-10-04 13:25:59 UTC 18,305 bytes, 1 lines download raw bytes

1import{d as xt,u as bt,h as _t,a as D,r as m,v as wt,a5 as gt,bn as yt,bb as kt,w as H,b1 as St,g as Tt,j as d,o as c,l as e,k as T,F as V,x as $t,m as u,K as A,J as Ct,ae as N,p as r,q as v,c as O,E as $,al as jt,s as C,n as Pt,y as Et,aM as Mt,W as zt}from"./DZ7mik94.js";import{_ as Rt}from"./BDcM2FMb.js";import{b as Lt}from"./CWaiZ3M9.js";import{u as qt}from"./D_TQQ2rA.js";import{g as j}from"./DXDH8whQ.js";const Dt={class:"gallery-detail-page absolute inset-0 z-50 flex bg-black"},Vt=["data-item-id"],At=["src","alt","onTouchstart","onTouchmove","onTouchend"],Nt=["src","poster","onTimeupdate","onClick","onPlay","onPause","onTouchstart","onTouchmove","onTouchend"],Xt={key:2,class:"absolute inset-0 flex items-center justify-center pointer-events-none bg-black/20 backdrop-blur-[1px] z-10"},Ut={class:"w-16 h-16 rounded-full bg-white/20 backdrop-blur-md flex items-center justify-center border border-white/20 shadow-lg animate-pulse"},Bt={key:3,class:"absolute bottom-0 left-0 right-0 h-1 bg-white/20 z-20 pointer-events-none"},Ft={class:"absolute right-4 bottom-10 flex flex-col gap-6 z-20 items-center"},Wt={class:"flex flex-col items-center gap-1"},Yt=["src"],Zt={key:1,class:"w-10 h-10 rounded-full bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center text-white font-bold text-xs ring-2 ring-white/20"},Gt=["onClick"],Ht={class:"text-xs text-white font-medium drop-shadow-md"},Ot=["onClick"],Jt=["onClick"],Kt=["onClick"],Qt={class:"absolute bottom-0 left-0 right-16 p-4 pb-4 z-10 pointer-events-none text-left"},It={class:"pointer-events-auto"},te={class:"flex items-center flex-wrap gap-x-2 mb-2"},ee={class:"text-white font-bold text-base shadow-black drop-shadow-md"},se={class:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-white/20 backdrop-blur-md border border-white/10 text-[10px] text-white/90 shadow-sm"},oe={class:"font-medium tracking-wide"},ie={class:"text-white/90 text-sm line-clamp-3 leading-relaxed shadow-black drop-shadow-md brightness-110"},le={class:"mt-2 text-xs text-white/60 flex items-center gap-2"},ae={class:"mt-3"},ne=["onClick"],re={key:0,class:"hidden lg:flex w-full h-full flex-row"},ce={key:0,class:"flex-1 flex items-center justify-center"},de=["src","alt"],ue={key:1,class:"flex flex-col items-center justify-center text-white/50"},pe={class:"text-sm font-bold uppercase tracking-wider"},fe=["src"],he={key:2,class:"flex flex-col items-center justify-center text-white/50"},me={class:"text-sm"},ve={class:"w-[400px] bg-white flex flex-col h-full border-l border-slate-100"},xe={class:"p-6 space-y-6 overflow-y-auto flex-1"},be={class:"flex items-center gap-3"},_e=["src"],we={key:1,class:"w-10 h-10 rounded-full bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center text-white font-bold text-sm shadow-sm"},ge={class:"flex-1 min-w-0"},ye={class:"font-semibold text-slate-900 truncate"},ke={key:0},Se={key:1},Te={class:"text-xs text-slate-500"},$e={class:"flex items-center justify-between py-4 border-y border-slate-100"},Ce={class:"flex items-center gap-2 text-slate-500"},je={class:"font-bold text-slate-700"},Pe={class:"text-xs uppercase tracking-wider font-semibold"},Ee={class:"text-xs uppercase tracking-wider font-semibold text-slate-500"},Me={class:"flex items-center justify-between mb-2"},ze={class:"text-xs font-bold text-slate-500 uppercase tracking-wider"},Re={class:"bg-slate-50 p-4 rounded-xl border border-slate-100 max-h-[300px] overflow-y-auto custom-scrollbar"},Le={class:"text-sm text-slate-700 leading-relaxed font-mono whitespace-pre-wrap"},qe={class:"flex items-center gap-3 flex-wrap"},De={class:"flex items-center gap-2 px-3 py-1.5 bg-slate-100 rounded-lg border border-slate-200"},Ve={class:"text-xs font-bold text-slate-600 uppercase"},Ae={class:"flex items-center gap-2 px-3 py-1.5 bg-slate-100 rounded-lg border border-slate-200"},Ne={key:1,class:"pi pi-box text-slate-500 text-sm"},Xe=["title"],Ue={class:"p-6 border-t border-slate-100 space-y-3 bg-white"},Be=["disabled"],Fe={key:2,class:"flex-1 flex items-center justify-center"},We={class:"text-center"},Ye={class:"text-white/50 font-medium mb-4"},Ze={class:"px-4 py-2 bg-white/10 text-white rounded-lg font-medium hover:bg-white/20 transition-colors"},Ge=xt({__name:"[id]",setup(He){const{t:f}=bt(),k=Mt(),P=jt(),h=qt(),X=_t(),E=D(()=>k.params.id),a=D(()=>h.selectedItem),J=D(()=>h.isLoadingDetail),_=m(!1),M=m(!1),x=m(null);let w=null;const z=m(null),K=s=>{if(!x.value)return;x.value.querySelectorAll("video").forEach(o=>{const l=o.closest("[data-item-id]");l&&l.dataset.itemId!==s&&(o.pause(),o.currentTime=0)})};wt(async()=>{w=new IntersectionObserver(tt,{threshold:.7}
1),h.items.length===0&&await h.fetchItems(),E.value&&(await h.selectItem(E.value),gt(()=>{Q(E.value)}))}),yt(()=>{w&&(w.disconnect(),w=null)});const Q=s=>{if(!x.value)return;const t=x.value.querySelector(`[data-item-id="${s}"]`);t&&t.scrollIntoView({behavior:"auto",block:"start"})},I=kt(s=>{h.selectItem(s);try{const t=P.resolve({name:k.name||"studio-gallery-id",params:{...k.params,id:s},query:k.query});window.history.replaceState(window.history.state,"",t.href)}catch(t){console.error("Failed to update URL state",t)}},300),tt=s=>{let t=null,o=0;for(const l of s)l.isIntersecting&&l.intersectionRatio>o&&(o=l.intersectionRatio,t=l.target);if(t){const l=t.dataset.itemId;if(l&&l!==z.value){z.value=l,K(l);const p=t.querySelector("video");p&&setTimeout(()=>{z.value===l&&(async()=>{try{await p.play()}catch(q){console.debug("Autoplay with sound failed, trying muted",q),p.muted=!0;try{await p.play()}catch(g){console.debug("Autoplay failed completely",g)}}})()},50),I(l);const i=h.items.findIndex(n=>n.id===l);i!==-1&&i>=h.items.length-3&&h.loadMore()}}for(const l of s)if(!l.isIntersecting){const p=l.target.querySelector("video");p&&p.pause()}},et=s=>{w&&w.observe(s)};H(a,()=>{M.value=!1});const U=s=>{s&&(P.replace(`/studio/gallery/${s}`),h.selectItem(s))},B=m(null),{direction:st,isSwiping:ot}=Lt(B);H(ot,(s,t)=>{if(!(window.innerWidth<1024)&&t===!0&&s===!1){const o=st.value;o==="UP"?U(h.nextItemId):o==="DOWN"&&U(h.prevItemId)}});const F=async s=>{const t=s||a.value?.prompts;if(t)try{await navigator.clipboard.writeText(t),_.value=!0,setTimeout(()=>{_.value=!1},2e3)}catch(o){console.error("Failed to copy text: ",o)}},W=s=>{const t=s||a.value;if(!t?.output_url)return;const o=document.createElement("a");o.href=t.output_url,o.target="_blank",o.download=`gallery-${t.id}.${t.task_type==="image"?"png":"mp4"}`,document.body.appendChild(o),o.click(),document.body.removeChild(o)},it=async s=>{const t=s||a.value;if(!t)return;const o=`${window.location.origin}/studio/gallery/${t.id}`;if(navigator.share)try{await navigator.share({title:"WisGate Notification",text:`Check out this ${t.task_type} created by @${t.author_name||t.user_id}`,url:o})}catch(l){console.error("Error sharing:",l)}else try{await navigator.clipboard.writeText(o),alert(f("studio.gallery.link_copied"))}catch(l){console.error("Failed to copy link:",l)}},Y=m(!1),R=async s=>{const t=s||a.value?.id;if(t){if(!X.isLogin){X.login();return}try{await h.likeItem(t)}catch(o){console.error(o)}}},lt=St(),at=Tt(),Z=s=>{const t=s||a.value;if(!t)return;const o=t.task_type==="video"?"/studio/video":"/studio/image";P.push({path:at(o),query:{prompt:t.prompts,model:t.model}})},G=s=>s?new Date(typeof s=="number"&&s<1e10?s*1e3:s).toLocaleString(lt.code.value):"",L=m({}),b=m({}),S=m({}),nt=s=>{b.value[s]||(b.value[s]={paused:!1}),b.value[s].paused=!1},rt=s=>{b.value[s]||(b.value[s]={paused:!0}),b.value[s].paused=!0},ct=(s,t)=>{if(S.value[t]?.isScrubbing)return;const o=s.target;o.duration&&(L.value[t]=o.currentTime/o.duration*100)},dt=(s,t)=>{const o=s.target;if(!o.duration)return;const l=s.touches[0];l&&(S.value[t]={startX:l.clientX,startTime:o.currentTime,isScrubbing:!0,wasPaused:o.paused},o.pause())},ut=(s,t)=>{const o=S.value[t];if(!o||!o.isScrubbing)return;const l=s.target,p=s.touches[0];if(!p)return;const i=p.clientX-o.startX,n=l.getBoundingClientRect();if(n.width===0)return;const q=i/n.width*l.duration;let g=o.startTime+q;g=Math.max(0,Math.min(g,l.duration)),l.currentTime=g,L.value[t]=g/l.duration*100},pt=(s,t)=>{const o=S.value[t];if(!o)return;o.isScrubbing=!1;const l=s.target;o.wasPaused||l.play()},ft=s=>{if(!x.value)return;const o=x.value.querySelector(`[data-item-id="${s}"]`)?.querySelector("video");o&&(o.paused?o.play():o.pause())},y=m({}),ht=(s,t)=>{if(s.touches.length===2){const o=s.touches[0],l=s.touches[1];if(!o||!l)return;const p=Math.hypot(o.clientX-l.clientX,o.clientY-l.clientY),i=y.value[t]?.scale||1;y.value[t]={scale:i,startDist:p,startScale:i}}},mt=(s,t)=>{if(s.touches.length===2){const o=y.value[t];if(!o)return;const l=s.touches[0],p=s.touches[1];if(!l||!p)return;const i=Math.hypot(l.clientX-p.clientX,l.clientY-p.clientY);let n=o.startScale*(i/o.startDist);n=Math.max(1,Math.min(n,5)),o.scale=n,s.cancelable&&s.preventDefault()}},vt=(s,t)=>{const o=y.value[t];o&&s.touches.length<2&&o.scale<1&&(o.scale=1)};return(s,t)=>{const o=Pt,l=Rt,p=Ct;return c(),d("div",Dt,[e("div",{ref_key:"mobileContainerRef",ref:x,class:"lg:hidden w-full h-full overflow-y-scroll snap-y snap-mandatory scrollbar-hide bg-black"},[(c(!0),d(V,null,$t(u(h).items,i=>(c(),d("div",{key:i.id,ref_for:!0,ref:n=>{n&&et(n)},"data-item-id":i.id,class:"w-full h-full snap-center snap-always relative flex items-center justify-center bg-black overflow-hidden"},[i.task_type==="image"&&i.output_url?(c(),d("img",{key:0,src:i.output_url,class:"max-w-full max-h-full object-contain select-none transition-transform duration-75 ease-linear origin-center",style:N({transform:`scale(${y.value[i.id]?.scale||1})`}),alt:i.prompts,loading:"lazy",onTouchstart:n=>ht(n,i.id),onTouchmove:n=>mt(n,i.id),onTouchend:n=>vt(n,i.id)},null,44,At)):i.task_type==="video"&&i.output_url?(c(),d("video",{key:1,src:i.output_url,class:"max-w-full max-h-full object-contain",playsinline:"",loop:"",poster:i.output_url+"?vframe/jpg/offset/1",preload:"metadata",onTimeupdate:n=>ct(n,i.id),onClick:n=>ft(i.id),onPlay:n=>nt(i.id),onPause:n=>rt(i.id),onTouchstart:n=>dt(n,i.id),onTouchmove:n=>ut(n,i.id),onTouchend:n=>pt(n,i.id)},null,40,Nt)):C("",!0),i.task_type==="video"&&b.value[i.id]?.paused?(c(),d("div",Xt,[e("div",Ut,[T(o,{name:"lucide:play",class:"text-white/75",size:"24"})])])):C("",!0),i.task_type==="video"?(c(),d("div",Bt,[e("div",{class:"h-full bg-white transition-all duration-100 ease-linear",style:N({width:`${L.value[i.id]||0}%`})},null,4)])):C("",!0),t[10]||(t[10]=e("div",{class:"absolute inset-0 pointer-events-none bg-gradient-to-b from-black/20 via-trans
1parent to-black/60"},null,-1)),e("div",Ft,[e("div",Wt,[i.author_avatar?(c(),d("img",{key:0,src:i.author_avatar,class:"w-10 h-10 rounded-full border-2 border-white/20"},null,8,Yt)):(c(),d("div",Zt,r((i.author_name||i.user_id||"A").toString().charAt(0).toUpperCase()),1))]),e("button",{class:"flex flex-col items-center gap-1",onClick:n=>R(i.id)},[e("i",{class:v(["pi text-3xl drop-shadow-md transition-transform active:scale-75",i.is_liked?"pi-heart-fill text-red-500":"pi-heart text-white"])},null,2),e("span",Ht,r(i.like_count||0),1)],8,Gt),e("button",{class:"flex flex-col items-center gap-1",onClick:n=>W(i)},[...t[6]||(t[6]=[e("i",{class:"pi pi-download text-3xl text-white drop-shadow-md"},null,-1),e("span",{class:"text-xs text-white font-medium drop-shadow-md"},"Save",-1)])],8,Ot),e("button",{class:"flex flex-col items-center gap-1",onClick:n=>F(i.prompts)},[e("i",{class:v(["pi text-3xl text-white drop-shadow-md transition-all duration-300",_.value?"pi-check text-green-400 scale-110":"pi-clone"])},null,2),e("span",{class:v(["text-xs text-white font-medium drop-shadow-md",_.value?"text-green-400":""])},"Prompt",2)],8,Jt),e("button",{class:"flex flex-col items-center gap-1",onClick:n=>it(i)},[...t[7]||(t[7]=[e("i",{class:"pi pi-share-alt text-3xl text-white drop-shadow-md"},null,-1),e("span",{class:"text-xs text-white font-medium drop-shadow-md"},"Share",-1)])],8,Kt)]),e("div",Qt,[e("div",It,[e("div",te,[e("h3",ee," @"+r(i.author_name||i.user_id),1),e("div",se,[u(j)(i.model)?.svg?(c(),O(l,{key:0,name:`${u(j)(i.model)?.svg}`,class:"w-3 h-3"},null,8,["name"])):C("",!0),e("span",oe,r(i.model),1)])]),e("p",ie,r(i.prompts||u(f)("studio.history.no_prompt")),1),e("div",le,[e("span",null,r(G(i.submit_time)),1),t[8]||(t[8]=e("span",{class:"w-0.5 h-0.5 rounded-full bg-white/60"},null,-1)),e("span",null,r(u(f)("studio.gallery.generated_by_ai")),1
1)]),e("div",ae,[e("button",{onClick:Et(n=>Z(i),["stop"]),class:"w-full py-2.5 bg-white/10 hover:bg-white/20 active:bg-white/30 backdrop-blur-md rounded-lg text-sm font-bold text-white flex items-center justify-center gap-2 transition-colors border border-white/10 shadow-sm pointer-events-auto"},[t[9]||(t[9]=e("i",{class:"pi pi-sparkles text-xs"},null,-1)),$(" "+r(u(f)("studio.gallery.remix")),1)],8,ne)])])])],8,Vt))),128)),T(p,{to:s.$localePath("/studio/gallery"),class:"fixed top-16 left-16 z-50"},{default:A(()=>[...t[11]||(t[11]=[e("button",{class:"w-10 h-10 rounded-full bg-black/20 backdrop-blur-sm flex items-center justify-center text-white"},[e("i",{class:"pi pi-chevron-left text-xl"})],-1)])]),_:1},8,["to"])],512),(c(),d("div",re,[J.value?(c(),d("div",ce,[...t[12]||(t[12]=[e("i",{class:"pi pi-spin pi-spinner text-3xl text-white/50"},null,-1)])])):a.value?(c(),d(V,{key:1},[e("div",{ref_key:"containerRef",ref:B,class:"flex-1 relative flex items-center justify-center p-8 bg-slate-900 border-r border-slate-800"},[T(p,{to:s.$localePath("/studio/gallery")},{default:A(()=>[...t[13]||(t[13]=[e("button",{class:"absolute top-4 right-4 z-20 w-10 h-10 rounded-full bg-black/50 hover:bg-black/70 backdrop-blur-sm flex items-center justify-center transition-colors"},[e("i",{class:"pi pi-times text-white text-lg"})],-1)])]),_:1},8,["to"]),a.value.task_type==="image"&&a.value.output_url?(c(),d(V,{key:0},[M.value?(c(),d("div",ue,[t[14]||(t[14]=e("i",{class:"pi pi-eye-slash text-5xl mb-3 opacity-50"},null,-1)),e("span",pe,r(u(f)("studio.gallery.image_lost")),1)])):(c(),d("img",{key:0,src:a.value.output_url,alt:a.value.prompts,class:"max-w-full max-h-full object-contain rounded-xl shadow-2xl",onError:t[0]||(t[0]=i=>M.value=!0),style:N({viewTransitionName:`gallery-image-${a.value.id}`})},null,44,de))],64)):a.value.task_type==="video"&&a.value.output_url?(c(),d("video",{key:1,src:a.value.output_url,controls:"",class:"max-w-full max-h-full rounded-xl shadow-2xl"},null,8,fe)):(c(),d("div",he,[t[15]||(t[15]=e("i",{class:"pi pi-image text-5xl mb-3"},null,-1)),e("span",me,r(u(f)("studio.inspiration.no_preview")),1)]))],512),e("div",ve,[e("div",xe,[e("div",be,[a.value.author_avatar?(c(),d("img",{key:0,src:a.value.author_avatar,class:"w-10 h-10 rounded-full object-cover shadow-sm bg-slate-100"},null,8,_e)):(c(),d("div",we,r((a.value.author_name||a.value.user_id||"A").toString().charAt(0).toUpperCase()),1)),e("div",ge,[e("p",ye,[a.value.author_name?(c(),d("span",ke,r(a.value.author_name),1)):(c(),d("span",Se,r(u(f)("studio.gallery.author"))+" #"+r(a.value.user_id),1))]),e("p",Te,r(G(a.value.submit_time)),1)])]),e("div",$e,[e("div",Ce,[t[16]||(t[16]=e("i",{class:"pi pi-eye text-lg"},null,-1)),e("span",je,r(a.value.view_count||0),1),e("span",Pe,r(u(f)("studio.gallery.views")),1)]),e("div",{class:"flex items-center gap-2 cursor-pointer group",onClick:t[1]||(t[1]=i=>R())},[e("i",{class:v([a.value.is_liked?"pi pi-heart-fill text-red-500":"pi pi-heart text-slate-400 group-hover:text-red-400","text-lg transition-colors"])},null,2),e("span",{class:v(["font-bold",a.value.is_liked?"text-red-500":"text-slate-700"])},r(a.value.like_count||0),3),e("span",Ee,r(u(f)("studio.gallery.likes")),1)])]),e("div",null,[e("div",Me,[e("label",ze,r(u(f)("studio.inspiration.prompt")),1),e("button",{class:v(["text-xs font-bold flex items-center gap-1 transition-all duration-200 px-2 py-1 rounded hover:bg-slate-100",_.value?"text-green-600":"text-slate-600"]),onClick:t[2]||(t[2]=i=>F())},[e("i",{class:v(["pi",_.value?"pi-check":"pi-clone"])},null,2)],2)]),e("div",Re,[e("p",Le,r(a.value.prompts||u(f)("studio.history.no_prompt")),1)])]),e("div",qe,[e("div",De,[e("i",{class:v([a.value.task_type==="video"?"pi pi-video":"pi pi-image","text-slate-500 text-sm"])},null,2),e("span",Ve,r(u(f)("common.categories."+a.value.task_type)),1)]),e("div",Ae,[u(j)(a.value.model)?.svg?(c(),O(l,{key:0,name:`${u(j)(a.value.model)?.svg}`,class:"w-4 h-4 text-slate-600"},null,8,["name"])):(c(),d("i",Ne)),e("span",{class:"text-xs font-bold text-slate-600 truncate max-w-[150px]",title:a.value.model},r(a.value.model),9,Xe)])])]),e("div",Ue,[e("button",{class:v(["w-full py-3.5 rounded-xl font-bold transition-all duration-200 flex items-center justify-center gap-2 transform active:scale-[0.98]",a.value.is_liked?"bg-red-50 text-red-600 hover:bg-red-100 border border-red-100":"bg-white border border-slate-200 text-slate-700 hover:bg-slate-50 hover:border-slate-300"]),disabled:Y.value,onClick:t[3]||(t[3]=i=>R())},[e("i",{class:v(Y.value?"pi pi-spin pi-spinner":a.value.is_liked?"pi pi-heart-fill":"pi pi-heart")},null,2),$(" "+r(a.value.is_liked?u(f)("studio.gallery.liked"):u(f)("studio.gallery.like")),1)],10,Be),e("button",{class:"w-full py-3.5 bg-gradient-to-r from-violet-600 to-purple-600 text-white rounded-xl font-bold hover:shadow-lg hover:shadow-
1purple-500/30 transition-all duration-200 flex items-center justify-center gap-2 transform active:scale-[0.98]",onClick:t[4]||(t[4]=i=>Z(a.value))},[t[17]||(t[17]=e("i",{class:"pi pi-sparkles"},null,-1)),$(" "+r(u(f)("studio.gallery.remix")),1)]),e("button",{class:"w-full py-3.5 bg-slate-900 text-white rounded-xl font-bold hover:bg-slate-800 transition-all duration-200 flex items-center justify-center gap-2 shadow-lg shadow-slate-900/20 transform active:scale-[0.98]",onClick:t[5]||(t[5]=i=>W())},[t[18]||(t[18]=e("i",{class:"pi pi-download"},null,-1)),$(" "+r(u(f)("studio.gallery.download")),1)])])])],64)):(c(),d("div",Fe,[e("div",We,[t[19]||(t[19]=e("i",{class:"pi pi-exclamation-circle text-5xl text-white/30 mb-3"},null,-1)),e("p",Ye,r(u(f)("studio.gallery.not_found")),1),T(p,{to:s.$localePath("/studio/gallery")},{default:A(()=>[e("button",Ze,r(u(f)("studio.gallery.back_to_gallery")),1)]),_:1},8,["to"])])]))]))])}}}),ts=zt(Ge,[["__scopeId","data-v-b8229747"]]);export{ts as default};

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.