1import{j as e}from"./index-DwGmt-_R.js";import{r as n,L as v}from"./vendor-react-I_DTfklX.js";import{s as u}from"./supabase-BDJ9O_S8.js";import{h as S}from"./hero-bg-vlhiGEsG.js";import{l as z}from"./logo-ciab-jwEJOy5l.js";import{P as f,C as E,a as V}from"./play-I6d5QFX_.js";import{X as q}from"./x-AMXJtmQa.js";import"./vendor-supabase-DZxFKcQQ.js";import"./createLucideIcon-CzSHqTo6.js";const w=(l,d)=>u.storage.from("ciab-gallery").getPublicUrl(l,{transform:{width:d,resize:"contain",quality:70}}).data.publicUrl,P=[400,600,900],$=l=>P.map(d=>`${w(l,d)} ${d}w`).join(", "),L=l=>u.storage.from("ciab-gallery").getPublicUrl(l,{transform:{width:1600,height:1400,resize:"contain",quality:78}}).data.publicUrl,N=l=>`https://player-vz-31944560-347.tv.pandavideo.com.br/embed/?v=${l}&autoplay=1`,A=[{day:1,date:"27 de agosto",videoId:"79b9eaf8-32fc-455a-8092-9aff296e9b52",cover:"/trailer-dia-1.webp"},{day:2,date:"28 de agosto",videoId:"8e8ea07b-3e21-40af-9093-6c7ea97a8315",cover:"/trailer-dia-2.webp"},{day:3,date:"29 de agosto",videoId:"15b77bfe-7d31-40c5-97d7-d8e66be1023f",cover:"/trailer-dia-3.webp"}],[b,...T]=A,F=["h","h","v","h","h","h","v","h","h","v","h","h"],C=l=>l===1?"1 foto":`${l} fotos`;function X(){const[l,d]=n.useState([]),[p,I]=n.useState(!0),[m,k]=n.useState(!1),[h,t]=n.useState(null),[c,D]=n.useState("all"),[x,y]=n.useState(null);n.useEffect(()=>{let a=!0;async function s(){const{data:r,error:o}=await u.schema("ciab").from("gallery_images").select("id, storage_path, alt_text, width, height, event_day").eq("is_published",!0).order("sort_order",{ascending:!0}).order("created_at",{ascending:!1});if(a){if(I(!1),o){console.error("Não foi possÃvel carregar a galer
1ia do 9º CIAB",o),k(!0);return}d(r??[])}}return s(),()=>{a=!1}},[]);const i=n.useMemo(()=>c==="all"?l:l.filter(a=>a.event_day===c),[l,c]);n.useEffect(()=>{if(h===null)return;const a=document.body.style.overflow;document.body.style.overflow="hidden";const s=r=>{r.key==="Escape"&&t(null),r.key==="ArrowLeft"&&t(o=>o===null?null:(o-1+i.length)%i.length),r.key==="ArrowRight"&&t(o=>o===null?null:(o+1)%i.length)};return window.addEventListener("keydown",s),()=>{document.body.style.overflow=a,window.removeEventListener("keydown",s)}},[h,i.length]);const g=h===null?null:i[h],_=()=>t(a=>a===null?null:(a-1+i.length)%i.length),B=()=>t(a=>a===null?null:(a+1)%i.length),j=a=>{t(null),D(a)};return e.jsxs("div",{className:"ciab-gallery-page",children:[e.jsxs("header",{className:"ciab-gallery-header",children:[e.jsx(v,{to:"/",className:"ciab-gallery-brand","aria-label":"Voltar ao site do 9º CIAB",children:e.jsx("img",{src:z,alt:"9º Congresso Internacional de Arqueologia BÃblica"})}),e.jsx(v,{to:"/",className:"ciab-gallery-back",children:"Congresso"})]}),e.jsxs("main",{children:[e.jsxs("section",{className:"ciab-gallery-hero",children:[e.jsx("img",{className:"ciab-gallery-hero-image",src:S,alt:"","aria-hidden":"true"}),e.jsxs("div",{className:"ciab-gallery-hero-copy",children:[e.jsx("p",{className:"ciab-gallery-kicker",children:"Memória em construção"}),e.jsxs("h1",{children:["Galeria do",e.jsx("br",{}),e.jsx("em",{children:"9º CIAB"})]}),e.jsx("p",{className:"ciab-gallery-intro",children:"Os encontros, descobertas e pessoas que fizeram parte desta edição."}),e.jsx("p",{className:"ciab-gallery-date",children:"27â29 de agosto · São Paulo"})]})]}),e.jsxs("section",{className:"ciab-gallery-trailer","aria-label":"VÃdeo principal do Dia 1 do 9º CIAB",children:[e.jsxs("div",{className:"ciab-gallery-trailer-copy",children:[e.jsx("p",{className:"ciab-gallery-kicker",children:"Dia 1 · vÃdeo principal"}),e.jsxs("h2",{children:["A abertura do",e.jsx("br",{}),e.jsx("em",{children:"9º CIAB na Ãntegra."})]}),e.jsx("p",{children:"O primeiro dia do congresso, do inÃcio ao fim, para reviver quantas vezes quiser."})]}),e.jsx("div",{className:"ciab-gallery-trailer-player is-widescreen",children:x===b.videoId?e.jsx("iframe",{src:N(b.videoId),title:"VÃdeo principal do Dia 1 do 9º CIAB",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):e.jsxs("button",{type:"button",onClick:()=>y(b.videoId),"aria-label":"Reproduzir o vÃdeo principal do Dia 1 do 9º CIAB",children:[e.jsx("img",{src:b.cover,alt:"VÃdeo principal do Dia 1 do 9º Congresso Internacional de Arqueologia BÃblica",loading:"lazy"}),e.jsxs("span",{children:[e.jsx(f,{size:25,fill:"currentColor"})," Assistir Dia 1"]})]})})]}),e.jsxs("section",{className:"ciab-gallery-videos","aria-label":"VÃdeos dos dias 2 e 3 do 9º CIAB",children:[e.jsx("p",{className:"ciab-gallery-kicker",children:"Dias 2 e 3 · vÃdeos completos"}),e.jsx("div",{className:"ciab-gallery-videos-grid",children:T.map(({day:a,date:s,videoId:r,cover:o})=>e.jsxs("article",{className:"ciab-gallery-video",children:[e.jsx("div",{className:"ciab-gallery-trailer-player is-widescreen",children:x===r?e.jsx("iframe",{src:N(r),title:`VÃdeo principal do Dia ${a} do 9º CIAB`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):e.jsxs("button",{type:"button",onClick:()=>y(r),"aria-label":`Reproduzir o vÃdeo do Dia ${a} do 9º CIAB`,children:[e.jsx("img",{src:o,alt:`VÃdeo principal do Dia ${a} do 9º Congresso Internacional de Arqueologia BÃblica`,loading:"lazy"}),e.jsxs("span",{children:[e.jsx(f,{size:22,fill:"currentColor"})," Assistir Dia ",a]})]})}),e.jsxs("div",{className:"ciab-gallery-video-copy",children:[e.jsxs("strong",{children:["Dia ",a]}),e.jsxs("span",{children:[s," · na Ãntegra"]})]})]},a))})]}),!p&&!m&&l.length>0&&e.jsxs("nav",{className:"ciab-gallery-days","aria-label":"Filtrar fotos por dia",children:[e.jsx("p",{className:"ciab-gallery-days-label",children:"Veja as fotos por dia do congresso"}),e.jsxs("div",{className:"ciab-gallery-days-options",children:[e.jsxs("button",{type:"button",className:c==="all"?"is-active":"","aria-pressed":c==="all",onClick:()=>j("all"),children:[e.jsx("strong",{children:"Todos os dias"}),e.jsx("span",{children:C(l.length)})]}),A.map(({day:a,date:s})=>{const r=l.filter(o=>o.event_day===a).length;return e.jsxs("button",{type:"button",className:c===a?"is-active":"","aria-pressed":c===a,disabled:r===0,onClick:()=>j(a),children:[e.jsxs("strong",{children:["Dia ",a]}),e.jsxs("span",{children:[s," · ",r===0?"em breve":C(r)]})]},a)})]})]}),p&&e.jsxs("section",{className:"ciab-gallery-grid",role:"status",children:[e.jsx("p",{className:"ciab-gallery-sr-only",children:"Carregando as fotos do 9º CIAB"}),F.map((a,s)=>e.jsx("div",{className:a==="v"?"ciab-gallery-skeleton is-tall":"ciab-gallery-skeleton"},s))]}),!p&&m&&e.jsx("div",{className:"ciab-gallery-status",children:"A galeria está sendo preparada. Tente novamente em instantes."}),!p&&!m&&i.length===0&&e.jsxs("section",{className:"ciab-gallery-empty",children:[e.jsx("span",{children:"Em breve"}),e.jsx("h2",{children:c==="all"?"As primeiras fotos chegam logo após o congresso.":`As fotos do Dia ${c} chegam em breve.`}
1),e.jsx("p",{children:"Volte em breve para reviver cada momento do 9º CIAB."})]}),i.length>0&&e.jsx("section",{className:"ciab-gallery-grid","aria-label":"Fotos do 9º CIAB",children:i.map((a,s)=>e.jsxs("button",{className:"ciab-gallery-card",type:"button",onClick:()=>t(s),"aria-label":`Ampliar: ${a.alt_text||`foto ${s+1}`}`,children:[e.jsx("img",{src:w(a.storage_path,600),srcSet:$(a.storage_path),sizes:"(max-width: 700px) 45vw, (max-width: 1440px) 31vw, 440px",alt:a.alt_text,loading:"lazy",decoding:"async",width:a.width??void 0,height:a.height??void 0}),a.alt_text&&e.jsx("span",{children:a.alt_text})]},a.id))})]}),e.jsx("footer",{className:"ciab-gallery-footer",children:"9º Congresso Internacional de Arqueologia BÃblica · 2026"}),g&&h!==null&&e.jsxs("div",{className:"ciab-lightbox",role:"dialog","aria-modal":"true","aria-label":"Visualizador de fotos",onClick:()=>t(null),children:[e.jsx("button",{type:"button",className:"ciab-lightbox-close",onClick:()=>t(null),"aria-label":"Fechar foto",children:e.jsx(q,{size:23})}),e.jsx("button",{type:"button",className:"ciab-lightbox-nav ciab-lightbox-prev",onClick:a=>{a.stopPropagation(),_()},"aria-label":"Foto anterior",children:e.jsx(E,{size:28})}),e.jsxs("figure",{onClick:a=>a.stopPropagation(),children:[e.jsx("img",{src:L(g.storage_path),alt:g.alt_text}),e.jsxs("figcaption",{children:[g.alt_text||"9º Congresso Internacional de Arqueologia BÃblica",e.jsxs("small",{children:[h+1," / ",i.length]})]})]}),e.jsx("button",{type:"button",className:"ciab-lightbox-nav ciab-lightbox-next",onClick:a=>{a.stopPropagation(),B()},"aria-label":"Próxima foto",children:e.jsx(V,{size:28})})]})]})}export{X 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.