1import{l as it,P as Ie}from"../chunks/BacfQgKf.js";import{S as at,i as lt,d as R,s as st,a as rt,_ as we,$ as se,a0 as re,b as G,e as N,m as O,t as k,f as y,g as T,h as M,X as Pe,j as q,k as E,a1 as ce,K as De,L as Ce,l as h,n as x,o as ee,U as Se,y as B,z as V,A as I,C as g,B as z,E as P,V as ct,I as je,J as Ge,p as ft,R as Ne,a9 as Ee}from"../chunks/Ch9ldKUt.js";import"../chunks/DfbTn-pQ.js";import{C as Oe}from"../chunks/C0RxYuEi.js";import{H as Te}from"../chunks/Dohdi_TN.js";import{T as He}from"../chunks/DDuFiBzg.js";import{r as Re,t as Be,g as de}from"../chunks/D6DARBUR.js";import{m as ge,e as oe,g as ie,j as Ue}from"../chunks/DnDLC_DT.js";import{B as he}from"../chunks/Nig3RflF.js";import{F as te}from"../chunks/CnwvKa0s.js";import{h as Ve,R as ze}from"../chunks/DfWf4KHT.js";import{b as Ae,i as fe}from"../chunks/CwfxU4hd.js";import{S as Je}from"../chunks/BbtvlLQj.js";async function ut({parent:n}){await n();const e=10,{videos:t,total:l,search:o,page:a}=await it("video","list_all","videos",e,!0);return{videos:t||[],totalPages:Math.ceil((l||0)/e),currentPage:a,search:o,total:l||0}}const jt=Object.freeze(Object.defineProperty({__proto__:null,load:ut},Symbol.toStringTag,{value:"Module"})),A="src/routes/admin/(protected)/video/+page.svelte";function Le(n,e,t){const l=n.slice();return l[18]=e[t],l}function Me(n){let e,t;e=new he({props:{href:"/admin/video/add",class:"float-right",$$slots:{default:[qe]},$$scope:{ctx:n}},$$inline:!0});const l={c:function(){G(e.$$.fragment)},l:function(a){N(e.$$.fragment,a)},m:function(a,i){O(e,a,i),t=!0},i:function(a){t||(k(e.$$.fragment,a),t=!0)},o:function(a){y(e.$$.fragment,a),t=!1},d:function(a){T(e,a)}};return R("SvelteRegisterBlock",{block:l,id:Me.name,type:"if",source:"(60:1) {#if hasGalleryAuth}",ctx:n}),l}function qe(n){let e;const t={c:function(){e=x("Ãj videó hozzáadása")},l:function(o){e=ee(o,"Ãj videó hozzáadása")},m:function(o,a){E(o,e,a)},d:function(o){o&&h(e)}};return R("SvelteRegisterBlock",{block:t,id:qe.name,type:"slot",source:'(61:2) <Button href=\\"/admin/video/add\\" class=\\"float-right\\">',ctx:n}),t}function Fe(n){let e;const t={c:function(){e=x("Videók")},l:function(o){e=ee(o,"Videók")},m:function(o,a){E(o,e,a)},d:function(o){o&&h(e)}};return R("SvelteRegisterBlock",{block:t,id:Fe.name,type:"slot",source:"(63:1) <Headline>",ctx:n}),t}function Ke(n){let e,t,l,o,a=Se(n[1]),i=[];for(let c=0;c<a.length;c+=1)i[c]=_e(Le(n,a,c));const r=c=>y(i[c],1,1,()=>{i[c]=null});l=new Ie({props:{reloadCallback:n[7],totalPages:n[2],currentPage:n[3]},$$inline:!0});const _={c:function(){e=B("div");for(let f=0;f<i.length;f+=1)i[f].c();t=M(),G(l.$$.fragment),this.h()},l:function(f){e=V(f,"DIV",{class:!0});var u=I(e);for(let m=0;m<i.length;m+=1)i[m].l(u);t=q(u),N(l.$$.fragment,u),u.forEach(h),this.h()},h:function(){g(e,"class","videos"),z(e,A,70,2,1982)},m:function(f,u){E(f,e,u);for(let m=0;m<i.length;m+=1)i[m]&&i[m].m(e,null);P(e,t),O(l,e,null),o=!0},p:function(f,u){if(u&834){a=Se(f[1]);let p;for(p=0;p<a.length;p+=1){const v=Le(f,a,p);i[p]?(i[p].p(v,u),k(i[p],1)):(i[p]=_e(v),i[p].c(),k(i[p],1),i[p].m(e,t))}for(De(),p=a.length;p<i.length;p+=1)r(p);Ce()}const m={};u&4&&(m.totalPages=f[2]),u&8&&(m.currentPage=f[3]),l.$set(m)},i:function(f){if(!o){for(let u=0;u<a.length;u+=1)k(i[u]);k(l.$$.fragment,f),o=!0}}
1,o:function(f){i=i.filter(Boolean);for(let u=0;u<i.length;u+=1)y(i[u]);y(l.$$.fragment,f),o=!1},d:function(f){f&&h(e),ct(i,f),T(l)}};return R("SvelteRegisterBlock",{block:_,id:Ke.name,type:"else",source:"(70:1) {:else}",ctx:n}),_}function We(n){let e,t,l,o;e=new He({props:{bold:!0,class:"mb-1",$$slots:{default:[et]},$$scope:{ctx:n}},$$inline:!0}),l=new he({props:{href:"/admin/video/add",label:"Hozzáadom az elsŠvideót"},$$inline:!0});const a={c:function(){G(e.$$.fragment),t=M(),G(l.$$.fragment)},l:function(r){N(e.$$.fragment,r),t=q(r),N(l.$$.fragment,r)},m:function(r,_){O(e,r,_),E(r,t,_),O(l,r,_),o=!0},p:function(r,_){const c={};_&2097152&&(c.$$scope={dirty:_,ctx:r}),e.$set(c)},i:function(r){o||(k(e.$$.fragment,r),k(l.$$.fragment,r),o=!0)},o:function(r){y(e.$$.fragment,r),y(l.$$.fragment,r),o=!1},d:function(r){r&&h(t),T(e,r),T(l,r)}};return R("SvelteRegisterBlock",{block:a,id:We.name,type:"if",source:"(67:1) {#if !videos.length}",ctx:n}),a}function Xe(n){let e;const t={c:function(){e=x("-")},l:function(o){e=ee(o,"-")},m:function(o,a){E(o,e,a)},p:Ne,d:function(o){o&&h(e)}};return R("SvelteRegisterBlock",{block:t,id:Xe.name,type:"else",source:"(87:6) {:else}",ctx:n}),t}function Ye(n){let e,t,l;const o={c:function(){e=B("img"),this.h()},l:function(i){e=V(i,"IMG",{src:!0,alt:!0,class:!0}),this.h()},h:function(){Ee(e.src,t=de(n[18].image_url))||g(e,"src",t),g(e,"alt",l=n[18].title),g(e,"class","svelte-80joo2"),z(e,A,85,7,2500)},m:function(i,r){E(i,e,r)},p:function(i,r){r&2&&!Ee(e.src,t=de(i[18].image_url))&&g(e,"src",t),r&2&&l!==(l=i[18].title)&&g(e,"alt",l)},d:function(i){i&&h(e)}};return R("SvelteRegisterBlock",{block:o,id:Ye.name,type:"if",source:"(85:6) {#if video.image_url}",ctx:n}),o}function Qe(n){let e,t,l;t=new te({props:{icon:ge},$$inline:!0});const o={c:function(){e=B("div"),G(t.$$.fragment),this.h()},l:function(i){e=V(i,"DIV",{class:!0,title:!0});var r=I(e);N(t.$$.fragment,r),r.forEach(h),this.h()},h:function(){g(e,"class","edit off svelte-80joo2"),g(e,"title","A szerkesztés nem engedélyezett!"),z(e,A,95,6,2786)},m:function(i,r){E(i,e,r),O(t,e,null),l=!0},p:Ne,i:function(i){l||(k(t.$$.fragment,i),l=!0)},o:function(i){y(t.$$.fragment,i),l=!1},d:function(i){i&&h(e),T(t)}};return R("SvelteRegisterBlock",{block:o,id:Qe.name,type:"else",source:"(95:5) {:else}",ctx:n}),o}function Ze(n){let e,t,l,o;t=new te({props:{icon:ge},$$inline:!0});const a={c:function(){e=B("a"),G(t.$$.fragment),this.h()},l:function(r){e=V(r,"A",{class:!0,href:!0,title:!0});var _=I(e);N(t.$$.fragment,_),_.forEach(h),this.h()},h:function(){g(e,"class","edit svelte-80joo2"),g(e,"href",l="/admin/video/"+n[18].video_id),g(e,"title","Videó szerkesztése"),z(e,A,91,6,2644)},m:function(r,_){E(r,e,_),O(t,e,null),o=!0},p:function(r,_){(!o||_&2&&l!==(l="/admin/video/"+r[18].video_id))&&g(e,"href",l)},i:function(r){o||(k(t.$$.fragment,r),o=!0)},o:function(r){y(t.$$.fragment,r),o=!1},d:function(r){r&&h(e),T(t)}};return R("SvelteRegisterBlock",{block:a,id:Ze.name,type:"if",source:"(91:5) {#if hasGalleryAuth}",ctx:n}),a}function xe(n){let e,t,l,o,a;t=new te({props:{icon:Ue},$$inline:!0});function i(){return n[16](n[18])}const r={c:function(){e=B("a"),G(t.$$.fragment),this.h()},l:function(c){e=V(c,"A",{role:!0,title:!0,class:!0});var f=I(e);N(t.$$.fragment,f),f.forEach(h),this.h()},h:function(){g(e,"role","button"),g(e,"title","Videó törlése"),g(e,"class","svelte-80joo2"),z(e,A,106,7,3159)},m:function(c,f){E(c,e,f),O(t,e,null),l=!0,o||(a=Ge(e,"click",i,!1,!1,!1,!1),o=!0)},p:function(c,f){n=c},i:function(c){l||(k(t.$$.fragment,c),l=!0)},o:function(c){y(t.$$.fragment,c),l=!1},d:function(c){c&&h(e),T(t),o=!1,a()}};return R("SvelteRegisterBlock",{block:r,id:xe.name,type:"if",source:"(106:6) {#if hasGalleryAuth}",ctx:n}),r}function _e(n){let e,t,l,o,a,i,r,_,c,f,u,m,p,v,L,D=n[18].title+"",F,Q,w,K,S,W,C,s,d,b;o=new te({props:{size:"lg",icon:n[18].deleted_at?ie:oe},$$inline:!0}),r=new te({props:{size:"lg",icon:n[18].deleted_at?oe:ie},$$inline:!0});function ae(){return n[15](n[18])}function X(J,j){return J[18].image_url?Ye:Xe}let Y=X(n),H=Y(n);const nt=[Ze,Qe],ue=[];function ot(J,j){return J[6]?0:1}u=ot(n),m=ue[u]=nt[u](n);let U=n[6]&&xe(n);const pe={c:function(){e=B("div"),t=B("a"),l=B("span"),G(o.$$.fragment),a=M(),i=B("span"),G(r.$$.fragment),_=M(),c=B("div"),H.c(),f=M(),m.c(),p=M(),v=B("div"),L=B("div"),F=x(D),Q=M(),w=B("a"),K=x("Videó megnyitása"),W=M(),C=B("div"),U&&U.c(),this.h()},l:function(j){e=V(j,"DIV",{class:!0});var $=I(e);t=V($,"A",{class:!0,role:!0,title:!0});var Z=I(t);l=V(Z,"SPAN",{class:!0});var ne=I(l);N(o.$$.fragment,ne),ne.forEach(h),a=q(Z),i=V(Z,"SPAN",{class:!0});var ve=I(i);N(r.$$.fragment,ve),ve.forEach(h),Z.forEach(h),_=q($),c=V($,"DIV",{class:!0});var $e=I(c);H.l($e),$e.forEach(h),f=q($),m.l($),p=q($),v=V($,"DIV",{class:!0});var le=I(v);L=V(le,"DIV",{class:!0});var be=I(L);F=ee(be,D),be.forEach(h),Q=q(le),w=V(le,"A",{href:!0,target:!0,class:!0});var ke=I(w);K=ee(ke,"Videó megnyitása"),ke.forEach(h),le.forEach(h),W=q($),C=V($,"DIV",{class:!0});var ye=I(C);U&&U.l(ye),ye.forEach(h),$.forEach(h),this.h()},h:function(){g(l,"class","on svelte-80joo2"),z(l,A,78,7,2230),g(i,"class","nope svelte-80joo2"),z(i,A,80,6,2333),g(t,"class","eye svelte-80joo2"),g(t,"role","button"),g(t,"title","Videó (in)aktiválása"),z(t,A,73,5,2095),g(c,"class","img svelte-80joo2"),z(c,A,83,5,2447),g(L,"class","title bold"),z(L,A,100,6,2932),g(w,"href",S="https://www.youtube.com/watch?v="+n[18].video_url),g(w,"target","_blank"),g(w,"class","svelte-80joo2"),z(w,A,101,6,2982),g(v,"class","name svelte-80joo2"),z(v,A,99,5,2907),g(C,"class","action svelte-80joo2"),z(C,A,104,5,3104),g(e,"class","video svelte-80joo2"),je(e,"inactive",!!n[18].deleted_at),z(e,A,72,4,2034)},m:function(j,$){E(j,e,$),P(e,t),P(t,l),O(o,l,null),P(t,a),P(t,i),O(r,i,null),P(e,_),P(e,c),H.m(c,null),P(e,f),ue[u].m(e,null),P(e,p),P(e,v),P(v,L),P(L,F),P(v,Q),P(v,w),P(w,K),P(e,W),P(e,C),U&&U.m(C,null),s=!0,d||(b=Ge(t,"click",ae,!1,!1,!1,!1),d=!0)},p:function(j,$){n=j;const Z={};$&2&&(Z.icon=n[18].deleted_at?ie:oe),o.$set(Z);const ne={};$&2&&(ne.icon=n[18].deleted_at?oe:ie),r.$set(ne),Y===(Y=X(n))&&H?H.p(n,$):(H.d(1),H=Y(n),H&&(H.c(),H.m(c,null))),m.p(n,$),(!s||$&2)&&D!==(D=n[18].title+"")&&ft(F,D),(!s||$&2&&S!==(S="https://www.youtube.com/watch?v="+n[18].video_url))&&g(w,"href",S),n[6]&&U.p(n,$),(!s||$&2)&&je(e,"inactive",!!n[18].deleted_at)},i:function(j){s||(k(o.$$.fragment,j),k(r.$$.fragment,j),k(m),k(U),s=!0)},o:function(j){y(o.$$.fragment,j),y(r.$$.fragment,j),y(m),y(U),s=!1},d:function(j){j&&h(e),T(o),T(r),H.d(),ue[u].d(),U&&U.d(),d=!1,b()}};return R("SvelteRegisterBlock",{block:pe,id:_e.name,type:"each",source:"(72:3) {#each videos as video}",ctx:n}),pe}function et(n){let e;const t={c:function(){e=x("Jelenleg nincs feltöltött videó!")},l:function(o){e=ee(o,"Jelenleg nincs feltöltött videó!")},m:function(o,a){E(o,e,a)},d:function(o){o&&h(e)}};return R("SvelteRegisterBlock",{block:t,id:et.name,type:"slot",source:'(68:2) <Text bold class=\\"mb
1-1\\">',ctx:n}),t}function tt(n){let e,t,l,o,a,i,r,_,c,f,u,m,p,v=n[6]&&Me(n);t=new Te({props:{$$slots:{default:[Fe]},$$scope:{ctx:n}},$$inline:!0});function L(s){n[11](s)}function D(s){n[12](s)}function F(s){n[13](s)}function Q(s){n[14](s)}let w={reload:n[7]};n[5]!==void 0&&(w.search=n[5]),n[0]!==void 0&&(w.isLoading=n[0]),n[4]!==void 0&&(w.total=n[4]),n[1]!==void 0&&(w.items=n[1]),o=new Je({props:w,$$inline:!0}),se.push(()=>re(o,"search",L)),se.push(()=>re(o,"isLoading",D)),se.push(()=>re(o,"total",F)),se.push(()=>re(o,"items",Q));const K=[We,Ke],S=[];function W(s,d){return s[1].length?1:0}f=W(n),u=S[f]=K[f](n);const C={c:function(){v&&v.c(),e=M(),G(t.$$.fragment),l=M(),G(o.$$.fragment),c=M(),u.c(),m=Pe()},l:function(d){v&&v.l(d),e=q(d),N(t.$$.fragment,d),l=q(d),N(o.$$.fragment,d),c=q(d),u.l(d),m=Pe()},m:function(d,b){v&&v.m(d,b),E(d,e,b),O(t,d,b),E(d,l,b),O(o,d,b),E(d,c,b),S[f].m(d,b),E(d,m,b),p=!0},p:function(d,b){const ae={};b&2097152&&(ae.$$scope={dirty:b,ctx:d}),t.$set(ae);const X={};!a&&b&32&&(a=!0,X.search=d[5],ce(()=>a=!1)),!i&&b&1&&(i=!0,X.isLoading=d[0],ce(()=>i=!1)),!r&&b&16&&(r=!0,X.total=d[4],ce(()=>r=!1)),!_&&b&2&&(_=!0,X.items=d[1],ce(()=>_=!1)),o.$set(X);let Y=f;f=W(d),f===Y?S[f].p(d,b):(De(),y(S[Y],1,1,()=>{S[Y]=null}),Ce(),u=S[f],u?u.p(d,b):(u=S[f]=K[f](d),u.c()),k(u,1),u.m(m.parentNode,m))},i:function(d){p||(k(v),k(t.$$.fragment,d),k(o.$$.fragment,d),k(u),p=!0)},o:function(d){y(v),y(t.$$.fragment,d),y(o.$$.fragment,d),y(u),p=!1},d:function(d){d&&(h(e),h(l),h(c),h(m)),v&&v.d(d),T(t,d),T(o,d),S[f].d(d)}};return R("SvelteRegisterBlock",{block:C,id:tt.name,type:"slot",source:"(59:0) <Container width={8}>",ctx:n}),C}function me(n){let e,t;e=new Oe({props:{width:8,$$slots:{default:[tt]},$$scope:{ctx:n}},$$inline:!0});const l={c:function(){G(e.$$.fragment)},l:function(a){N(e.$$.fragment,a)},m:function(a,i){O(e,a,i),t=!0},p:function(a,[i]){const r={};i&2097215&&(r.$$scope={dirty:i,ctx:a}),e.$set(r)},i:function(a){t||(k(e.$$.fragment,a),t=!0)},o:function(a){y(e.$$.fragment,a),t=!1},d:function(a){T(e,a)}};return R("SvelteRegisterBlock",{block:l,id:me.name,type:"component",source:"",ctx:n}),l}function dt(n,e,t){let{$$slots:l={},$$scope:o}=e;rt("Page",l,[]);let{data:a}=e,i=!1;const r=Ve(ze.GALLERY);let{videos:_,totalPages:c,currentPage:f,total:u,search:m}=a;const p=async()=>{await fe(),t(1,_=a.videos),t(2,c=a.totalPages),t(3,f=a.currentPage),t(4,u=a.total)},v=async s=>{r&&(await Be("video",s),await fe(),t(1,_=a.videos))},L=async s=>{await Re("video",s,"/admin/video"),await fe(),t(1,_=a.videos)};let D="";Ae(({to:s})=>{s&&(D=s.url.pathname)}),we(()=>{D.startsWith("/admin/video/")||localStorage.removeItem("video-list_all-a")}),n.$$.on_mount.push(function(){a===void 0&&!("data"in e||n.$$.bound[n.$$.props.data])&&console.warn("<Page> was created without expected prop 'data'")});const F=["data"];Object.keys(e).forEach(s=>{!~F.indexOf(s)&&s.slice(0,2)!=="$$"&&s!=="slot"&&console.warn(`<Page> was created with unknown prop '${s}'`)});function Q(s){m=s,t(5,m)}
1function w(s){i=s,t(0,i)}function K(s){u=s,t(4,u)}function S(s){_=s,t(1,_)}const W=s=>v(s.video_id),C=s=>L(s.video_id);return n.$$set=s=>{"data"in s&&t(10,a=s.data)},n.$capture_state=()=>({Container:Oe,Headline:Te,Text:He,remove:Re,toggle:Be,faEdit:ge,faEye:oe,faEyeSlash:ie,faTrash:Ue,Button:he,Fa:te,getPublicApiSrc:de,hasRole:Ve,ROLES:ze,beforeNavigate:Ae,invalidateAll:fe,onDestroy:we,Pagination:Ie,Search:Je,data:a,isLoading:i,hasGalleryAuth:r,videos:_,totalPages:c,currentPage:f,total:u,search:m,reload:p,toggleVideo:v,removeVideo:L,newUrl:D}),n.$inject_state=s=>{"data"in s&&t(10,a=s.data),"isLoading"in s&&t(0,i=s.isLoading),"videos"in s&&t(1,_=s.videos),"totalPages"in s&&t(2,c=s.totalPages),"currentPage"in s&&t(3,f=s.currentPage),"total"in s&&t(4,u=s.total),"search"in s&&t(5,m=s.search),"newUrl"in s&&(D=s.newUrl)},e&&"$$inject"in e&&n.$inject_state(e.$$inject),[i,_,c,f,u,m,r,p,v,L,a,Q,w,K,S,W,C]}class Et extends at{constructor(e){super(e),lt(this,e,dt,me,st,{data:10}),R("SvelteRegisterComponent",{component:this,tagName:"Page",options:e,id:me.name})}get data(){throw new Error("<Page>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'")}set data(e){throw new Error("<Page>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'")}}export{Et as component,jt as universal};
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.