PageSourceSearch

https://vivaors.com.br/assets/AuthorPage-DMn70udJ.js

js vivaors.com.br collected 2026-10-06 05:31:19 UTC 8,635 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B5OGvPOn.js","assets/query-pTPNpZtY.js","assets/react-vendor-DXQsCdhI.js","assets/supabase-C6OG0I2D.js","assets/charts-IsTpienw.js","assets/carousel-CtlbL2Hu.js","assets/tiptap-DaxmquCz.js","assets/index-CbM7aKe4.css"])))=>i.map(i=>d[i]);
2import{u as O,y as H,a9 as V,aE as E,i as J,j as Q,P as Y,H as P,V as q,S as z,ak as G,al as W,am as X,h as I,Y as $,af as Z,a8 as ee,ay as te,s as u,c_ as ae}from"./index-B5OGvPOn.js";import{u as T,j as t}from"./query-pTPNpZtY.js";import{u as ie,i as re,r as U}from"./react-vendor-DXQsCdhI.js";import{f as se}from"./fetchCollectionBrands-DLT1pJEm.js";import{M as oe}from"./mail-IBcqRYN5.js";import{T as le}from"./twitter-Cn7WDk_L.js";import"./supabase-C6OG0I2D.js";import"./charts-IsTpienw.js";import"./carousel-CtlbL2Hu.js";import"./tiptap-DaxmquCz.js";const A=`id, title, slug, kind, city, images, summary, terroir, type, perfect_for,
3  highlight_media_url, is_navigation_disabled, external_url, instagram, reserve_url, description, is_published`;function L(a){return{id:a.id,title:a.title,slug:a.slug,kind:a.kind,city:a.city,images:a.images||[],summary:a.summary,terroir:a.terroir,type:a.type,perfectFor:a.perfect_for||[],highlightMediaUrl:a.highlight_media_url,isNavigationDisabled:a.is_navigation_disabled,externalUrl:a.external_url,instagram:a.instagram,reserveUrl:a.reserve_url,description:a.description}}function F(a,c){return!c||Object.keys(c).length===0?a:{...a,title:c.title||a.title,summary:c.summary||a.summary,description:c.description||a.description}}function fe(){const{authorSlug:a}=ie(),c=re(),{t:_}=O(),{isPt:g}=H(),p=a?/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(a):!1,{data:s,isLoading:S}=T({queryKey:["author-page",a],queryFn:async()=>{const i=p?"id":"slug",{data:l,error:o}=await u.from("authors").select("id, name, public_title, slug, role, bio, avatar_url, email, instagram, twitter").eq(i,a).maybeSingle();if(o)throw o;if(l)return l;if(!p){const{slugify:d}=await ae(async()=>{const{slugify:m}=await import("./index-B5OGvPOn.js").then(j=>j.dN);return{slugify:m}},__vite__mapDeps([0,1,2,3,4,5,6,7])),{data:x,error:f}=await u.from("authors").select("id, name, public_title, slug, role, bio, avatar_url, email, instagram, twitter").eq("is_active",!0);if(f)throw f;const h=(x||[]).find(m=>d(m.name)===a);if(h)return h}return null},enabled:!!a});U.useEffect(()=>{p&&(s!=null&&s.slug)&&c(`/autores/${s.slug}`,{replace:!0})},[p,s,c]);const n=s==null?void 0:s.id,b=V("author",n),M=E("collection"),C=E("place_item"),e=s&&{...s,name:!g&&b.name||s.name,role:!g&&b.role||s.role,bio:!g&&b.bio||s.bio},{data:B}=T({queryKey:["author-collections-full",n],queryFn:async()=>{const{data:i,error:l}=await u.from("collection_authors").select("collection_id").eq("author_id",n);if(l)throw l;if(!i||i.length===0)return[];const o=i.map(r=>r.collection_id),{data:d,error:x}=await u.from("collections").select("id, title, subtitle, slug, card_image_url, cover_image_url, cover_image_mobile_url, cover_image_desktop_url, type, region, subcategory, is_navigation_disabled").in("id",o).eq("is_published",!0).eq("is_active",!0);if(x)throw x;const{data:f,error:h}=await u.from("collection_items").select(`collection_id, order_index, title_override, summary_override, place_items:place_item_id(${A})`).in("collection_id",o).order("order_index",{ascending:!0});if(h)throw h;const m={};for(const r of f||[]){const w=r.place_items;if(!w||w.is_published===!1)continue;const N=r.collection_id;m[N]||(m[N]=[]);const k=L(w);r.title_override&&(k.title=r.title_override),r.summary_override&&(k.summary=r.summary_override),m[N].push(k)}const j=await se(o);return(d||[]).map(r=>({id:r.id,slug:r.slug,title:r.title,subtitle:r.subtitle,coverImageUrl:r.cover_image_url,cardImageUrl:r.card_image_url,coverImageMobileUrl:r.cover_image_mobile_url,coverImageDesktopUrl:r.cover_image_desktop_url,subcategory:r.subcategory,region:r.region,isNavigationDisabled:r.is_navigation_disabled,items:m[r.id]||[],brands:j.get(r.id)||[]}))},enabled:!!n});U.useEffect(()=>{n&&J(`/autor/${n}`),Q(s==null?void 0:s.avatar_url)},[n,s]);const{data:D}=T({queryKey:["author-places",n],queryFn:async()=>{const{data:i,error:l}=await u.from("place_item_authors").select(`place_item_id, place_items:place_item_id(${A})`).eq("author_id",n);if(l)throw l;return(i||[]).map(o=>o.place_items).filter(o=>o!=null&&o.is_published===!0).map(L)},enabled:!!n});if(S)return t.jsx(Y,{});if(!e)return t.jsxs("div",{className:"min-h-screen bg-background",children:[t.jsx(P,{}),t.jsx("div",{className:"flex items-center justify-center py-32",children:t.jsx("p",{className:"text-muted-foreground",children:_("author.not_found","Autor não encontrado.")})}),t.jsx(q,{})]});const R=e.name.split(" ").map(i=>i[0]).join("").slice(0,2).toUpperCase(),y=(B||[]).map(i=>{const l=M[i.id]||{},o=i.items.map(d=>F(d,C[d.id]||{}));return{...i,title:!g&&l.title||i.title,subtitle:!g&&l.subtitle||i.subtitle,items:o}}),v=(D||[]).map(i=>F(i,C[i.id]||{})),K=y.length>0||v.length>0;return t.jsxs("div",{className:"min-h-screen bg-background",children:[t.jsx(P,{}),t.jsx(z,{data:{"@context":"https://schema.org","@type":"Person",name:e.name,jobTitle:e.public_title||e.role||void 0,description:e.bio||void 0,image:e.avatar_url||void 0,email:e.email||void 0,sameAs:[e.instagram?`https://instagram.com/${String(e.instagram).replace(/^@/,"")}`:null,e.twitter?`https://twitter.com/${String(e.twitter).replace(/^@/,"")}
3`:null].filter(Boolean),url:typeof window<"u"?`${window.location.origin}/autores/${a}`:void 0}}),t.jsx("section",{className:"border-b border-border/40",children:t.jsx("div",{className:"container py-12 md:py-16",children:t.jsxs("div",{className:"flex flex-col items-center gap-8 md:flex-row md:items-start md:gap-12",children:[t.jsx("div",{className:"shrink-0",children:t.jsxs(G,{className:"h-40 w-40 md:h-52 md:w-52 ring-4 ring-primary/10",children:[t.jsx(W,{src:e.avatar_url||void 0,alt:e.name,className:"object-cover"}),t.jsx(X,{className:"text-4xl md:text-5xl font-semibold",children:R})]})}),t.jsxs("div",{className:"flex flex-col items-center text-center md:items-start md:text-left",children:[t.jsx("h1",{className:"text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl",children:e.public_title||e.name}),e.public_title&&t.jsx("p",{className:"mt-1 text-base text-muted-foreground",children:e.name}),e.role&&t.jsx("p",{className:"mt-2 text-lg text-primary font-medium",children:e.role}),(e.email||e.instagram||e.twitter)&&t.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[e.email&&t.jsx("a",{href:`mailto:${e.email}`,onClick:()=>I({label:e.email,action:"external_cta",position:"detail_hero",itemId:e.id,itemType:"author"}),className:"text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(oe,{className:"h-5 w-5"})}),e.instagram&&t.jsx("a",{href:$(`https://instagram.com/${e.instagram.replace("@","")}`,{action:"instagram",position:"detail_hero",itemId:e.id,itemType:"author",label:e.instagram}),target:"_blank",rel:"noopener noreferrer",onClick:()=>I({label:e.instagram,action:"instagram",position:"detail_hero",itemId:e.id,itemType:"author"}),className:"text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(Z,{className:"h-5 w-5"})}),e.twitter&&t.jsx("a",{href:$(`https://x.com/${e.twitter.replace("@","")}`,{action:"external_cta",position:"detail_hero",itemId:e.id,itemType:"author",label:e.twitter}),target:"_blank",rel:"noopener noreferrer",onClick:()=>I({label:e.twitter,action:"external_cta",position:"detail_hero",itemId:e.id,itemType:"author"}),className:"text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(le,{className:"h-5 w-5"})})]}),e.bio&&t.jsx("p",{className:"mt-6 max-w-2xl text-base leading-relaxed text-muted-foreground",children:e.bio})]})]})})}),y.length>0&&t.jsxs("section",{className:"container py-10 md:py-14 space-y-8",children:[t.jsx("h2",{className:"text-xl font-bold tracking-tight md:text-2xl",children:_("author.collections","Roteiros e Listas")}),y.map(i=>t.jsx(ee,{collection:i},i.id))]}),v.length>0&&t.jsxs("section",{className:"container py-10 md:py-14",children:[t.jsx("h2",{className:"mb-8 text-xl font-bold tracking-tight md:text-2xl",children:_("author.places","Lugares")}),t.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",children:v.map(i=>t.jsx(te,{place:i},i.id))})]}),!K&&t.jsx("section",{className:"container py-16 text-center",children:t.jsx("p",{className:"text-muted-foreground",children:_("author.no_content","Nenhum conteúdo vinculado a este autor.")})}),t.jsx(q,{})]})}export{fe 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.