PageSourceSearch

https://app.qeen.ai/_nuxt/CoQ56m00.js

js qeen.ai collected 2026-10-01 12:06:54 UTC 9,155 bytes, 1 lines download raw bytes

1import{g as Q,m as ae,B as ne,G as re,A as x,r as _,ag as de,H as U,o as n,c as r,a as l,F as D,N as S,s as H,w,E as ce,d as ue,t as c,k as e,D as A,b as d,q as j,M as J,C as K,x as ve}from"./CSYtTi5R.js";import{u as pe}from"./CYJ813Qi.js";import{T as me}from"./Co3eY0Dg.js";import{s as _e}from"./rRFHb9cQ.js";import{s as fe}from"./BhIzAn6-.js";import{u as ye}from"./Vfa1HrGJ.js";import{u as be}from"./eZNxoPjA.js";import"./BCzwK444.js";import"./5Bn8sfOl.js";import"./C3nCNyvD.js";import"./2i_eZDti.js";import"./DoyLntpQ.js";const ge={class:"flex items-center justify-between mb-6"},he={class:"flex gap-2"},xe={class:"flex items-center gap-3"},we={key:0,class:"text-sm text-gray-500"},ke={key:0,class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4"},Ce={key:1,class:"flex flex-col items-center justify-center py-20"},$e={class:"text-gray-500 text-lg font-medium mb-1"},Me={class:"text-gray-400 text-sm"},je={key:2},De={ref:"scrollContainer",class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4"},Te=["onClick"],Ee=["src","alt"],Ie={key:1,class:"w-full h-full relative bg-gray-900"},Le=["src"],Se={class:"absolute inset-0 bg-black/0 group-hover:bg-black/30 transition-all duration-200 flex items-end"},qe={class:"w-full p-3 translate-y-full group-hover:translate-y-0 transition-transform duration-200"},ze={class:"flex items-center justify-between"},Be={class:"text-white text-xs"},Pe={class:"flex gap-1"},Re={class:"absolute top-2 left-2"},Ue={class:"px-2 py-0.5 rounded-full text-xs font-medium bg-black/50 text-white"},Ae={key:2,class:"absolute inset-0 bg-black/50 flex items-center justify-center z-20"},Fe={key:3,class:"flex justify-center mt-8"},Ge={class:"flex items-center gap-2"},Ne={class:"flex items-center gap-3"},Ve={class:"text-lg font-semibold"},Oe={key:0,class:"text-sm text-gray-500"},We={key:0,class:"flex flex-col items-center p-6"},He=["src"],Je=["src"],Ke={class:"flex justify-end items-center w-full"},Qe={class:"flex gap-2"},Xe={class:"text-gray-600"},Ye={class:"flex justify-end gap-2"},F=20,Ze={__name:"MediaLibraryBrowser",setup(X){const{t:i}=Q(),y=ae(),q=ne(),G=re(),b=ye(),Y=be(),g=x(()=>{var s;return(s=G.selectedWebsite)==null?void 0:s.website}),T=x(()=>Y.userEmail||""),k=_("all"),C=_("desc"),v=_(!1),u=_(null),h=_(!1),$=_(null),z=_(!1),B=_(null),{media:P,isLoading:M,isLoadingMore:it,hasMore:Z,totalCount:E}=de(b),f=x(()=>{var s;return((s=b.pagination)==null?void 0:s.page)||1}),N=x(()=>Math.ceil(E.value/F)||1),ee=x(()=>{const s=N.value,o=f.value,a=[],p=Math.max(1,o-2),m=Math.min(s,o+2);for(let t=p;t<=m;t++)a.push(t);return a}),te=x(()=>[{value:"all",label:i("all"),icon:"pi pi-th-large"},{value:"IMAGE",label:i("images"),icon:"pi pi-image"},{value:"VIDEO",label:i("videos"),icon:"pi pi-video"}]),I=(s=1)=>{if(!g.value||!T.value)return;const o=k.value==="all"?void 0:k.value;b.fetchMedia(g.value,T.value,s,F,{type:o,sort:C.value})},se=s=>{k.value=s,I()},le=()=>{C.value=C.value==="desc"?"asc":"desc",I()},V=s=>s?new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):"",oe=s=>{u.value=s,v.value=!0,q.replace({query:{...y.query,preview:s.media_id}})};U(v,s=>{if(!s&&y.query.preview){const{preview:o,...a}=y.query;q.replace({query:a})}}),U(P,s=>{const o=y.query.preview;if(o&&s.length>0&&!v.value){const a=s.find(p=>p.media_id===o);a&&(u.value=a,v.value=!0)}},{immediate:!0});const O=async s=>{if(s)try{const a=await(await fetch(s.url)).blob(),p=s.type==="IMAGE"?"png":"mp4",m=URL.createObjectURL(a),t=document.createElement("a");t.href=m,t.download=`media-${s.media_id}.${p}`,document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(m)}catch(o){console.error("Download failed:",o)}},W=s=>{$.value=s,h.value=!0},ie=async()=>{if(!(!$.value||!g.value||!T.value)){z.value=!0,B.value=$.value.media_id,h.value=!1;try{await b.deleteMedia($.value.media_id,g.value,T.value),$.value=null}catch(s){console.error("Delete failed:",s)}finally{z.value=!1,B.value=null}}},R=s=>{!g.value||s<1||s>N.value||(window.scrollTo({top:0,behavior:"smooth"}),I(s))};return U(g,s=>{s&&I()},{immediate:!0}),(s,o)=>{const a=fe,p=_e,m=me;return n(),r("div",null,[l("div",ge,[l("div",he,[(n(!0),r(D,null,S(e(te),t=>(n(),H(a,{key:t.value,severity:e(k)===t.value?"primary":"secondary",outlined:e(k)!==t.value,size:"small",onClick:L=>se(t.value)},{default:w(()=>[l("i",{class:ce([t.icon,"mr-2"])},null,2),ue(" "+c(t.label),1)]),_:2}
1,1032,["severity","outlined","onClick"]))),128))]),l("div",xe,[A(d(a,{icon:e(C)==="desc"?"pi pi-sort-amount-down":"pi pi-sort-amount-up",label:e(C)==="desc"?e(i)("newest_first"):e(i)("oldest_first"),size:"small",text:"",severity:"secondary",onClick:le},null,8,["icon","label"]),[[m,e(i)("sort_by_date"),void 0,{top:!0}]]),e(M)?j("",!0):(n(),r("span",we,c(e(E))+" "+c(e(E)===1?e(i)("item"):e(i)("items")),1))])]),e(M)?(n(),r("div",ke,[(n(),r(D,null,S(10,t=>l("div",{key:t,class:"aspect-square rounded-xl bg-gray-200 animate-pulse"})),64))])):e(P).length===0?(n(),r("div",Ce,[o[7]||(o[7]=l("div",{class:"w-20 h-20 mx-auto mb-4 rounded-full bg-gray-100 flex items-center justify-center"},[l("i",{class:"pi pi-images text-3xl text-gray-400"})],-1)),l("p",$e,c(e(i)("library_empty_title")),1),l("p",Me,c(e(i)("library_empty_subtitle")),1)])):(n(),r("div",je,[l("div",De,[(n(!0),r(D,null,S(e(P),t=>(n(),r("div",{key:t.media_id,class:"group relative aspect-square rounded-xl overflow-hidden border border-gray-200 hover:border-[#289E2B] transition-all duration-200 cursor-pointer hover:shadow-lg",onClick:L=>oe(t)},[t.type==="IMAGE"?(n(),r("img",{key:0,src:t.url,alt:"Media "+t.media_id,class:"w-full h-full object-cover",loading:"lazy"},null,8,Ee)):(n(),r("div",Ie,[l("video",{src:t.url+"#t=0.5",preload:"metadata",muted:"",class:"w-full h-full object-cover"},null,8,Le),o[8]||(o[8]=l("div",{class:"absolute inset-0 flex items-center justify-center pointer-events-none"},[l("div",{class:"w-10 h-10 rounded-full bg-black/60 flex items-center justify-center"},[l("i",{class:"pi pi-play text-white text-lg ml-0.5"})])],-1))])),l("div",Se,[l("div",qe,[l("div",ze,[l("span",Be,c(V(t.created_at)),1),l("div",Pe,[A(d(a,{icon:"pi pi-download",size:"small",rounded:"",severity:"secondary",class:"!w-8 !h-8",onClick:J(L=>O(t),["stop"])},null,8,["onClick"]),[[m,e(i)("download"),void 0,{top:!0}]]),A(d(a,{icon:"pi pi-trash",size:"small",rounded:"",severity:"danger",class:"!w-8 !h-8",onClick:J(L=>W(t),["stop"])},null,8,["onClick"]),[[m,e(i)("delete"),void 0,{top:!0}]])])])])]),l("div",Re,[l("span",Ue,c(t.type),1)]),e(B)===t.media_id?(n(),r("div",Ae,o[9]||(o[9]=[l("i",{class:"pi pi-spin pi-spinner text-2xl text-white"},null,-1)]))):j("",!0)],8,Te))),128))],512)])),e(E)>F?(n(),r("div",Fe,[l("div",Ge,[d(a,{icon:"pi pi-angle-left",text:"",rounded:"",severity:"secondary",disabled:e(f)===1||e(M),onClick:o[0]||(o[0]=t=>R(e(f)-1))},null,8,["disabled"]),(n(!0),r(D,null,S(e(ee),t=>(n(),H(a,{key:t,label:String(t),severity:t===e(f)?"primary":"secondary",outlined:t!==e(f),text:t!==e(f),rounded:"",class:"!w-9 !h-9",disabled:e(M),onClick:L=>R(t)},null,8,["label","severity","outlined","text","disabled","onClick"]))),128)),d(a,{icon:"pi pi-angle-right",text:"",rounded:"",severity:"secondary",disabled:!e(Z)||e(M),onClick:o[1]||(o[1]=t=>R(e(f)+1))},null,8,["disabled"])])])):j("",!0),d(p,{visible:e(v),"onUpdate:visible":o[4]||(o[4]=t=>K(v)?v.value=t:null),modal:"",dismissableMask:!0,class:"w-[90vw] max-w-4xl",pt:{content:{class:"p-0"}}},{header:w(()=>[l("div",Ne,[l("span",Ve,c(e(i)("media_preview")),1),e(u)?(n(),r("span",Oe,c(V(e(u).created_at)),1)):j("",!0)])]),footer:w(()=>[l("div",Ke,[l("div",Qe,[d(a,{icon:"pi pi-download",label:e(i)("download"),outlined:"",onClick:o[2]||(o[2]=t=>O(e(u)))},null,8,["label"]),d(a,{icon:"pi pi-trash",label:e(i)("delete"),severity:"danger",outlined:"",onClick:o[3]||(o[3]=t=>{W(e(u)),v.value=!1})},null,8,["label"])])])]),default:w(()=>[e(u)?(n(),r("div",We,[e(u).type==="IMAGE"?(n(),r("img",{key:0,src:e(u).url,alt:"Preview",class:"max-w-full max-h-[70vh] object-contain rounded-lg"},null,8,He)):(n(),r("video",{key:1,src:e(u).url,controls:"",class:"max-w-full max-h-[70vh] rounded-lg"},null,8,Je))])):j("",!0)]),_:1},8,["visible"]),d(p,{visible:e(h),"onUpdate:visible":o[6]||(o[6]=t=>K(h)?h.value=t:null),modal:"",header:e(i)("confirm_delete"),style:{width:"400px"}},{footer:w(()=>[l("div",Ye,[d(a,{label:e(i)("cancel"),severity:"secondary",outlined:"",onClick:o[5]||(o[5]=t=>h.value=!1)},null,8,["label"]),d(a,{label:e(i)("delete"),severity:"danger",loading:e(z),onClick:ie},null,8,["label","loading"])])]),default:w(()=>[l("p",Xe,c(e(i)("delete_media_confirm")),1)]),_:1},8,["visible","header"])])}}},et={class:"flex flex-col h-full bg-gray-50 overflow-y-auto"},tt={class:"px-8 py-8 w-full"},st={class:"mb-8"},lt={class:"text-3xl font-bold text-gray-900"},ot={class:"text-gray-600 mt-1"},bt={__name:"media-library",setup(X){const{t:i}=Q(),{setTitle:y}=pe();return y(i("media_library")),(q,G)=>
1{const b=ve;return n(),r(D,null,[d(b),l("div",et,[l("div",tt,[l("div",st,[l("h1",lt,c(e(i)("media_library")),1),l("p",ot,c(e(i)("media_library_subtitle")),1)]),d(Ze)])])],64)}}};export{bt 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.