1import V from"./BpG0IlsN.js";import{z as W,r as f,w as D,c as l,u as P,l as I,A as v,V as C,B as j,a as c,b as i,n as q,t as _,F,g as H,D as z,o as m,f as M,d as k,_ as G}from"#entry";import{d as R,h as U}from"./BUuZjhqo.js";import{g as O}from"./QreC5D3m.js";import{W as T}from"./DNZsKzZC.js";import{o as J}from"./BdmSeYdY.js";import"./MOgB9R2V.js";import"./DkkuzaFX.js";import"./uCmhvQh3.js";import"./Chx3igEn.js";const K={class:"brand-page page"},Q={class:"sr-only"},X={class:"simple-grid"},Y=["onClick","onMouseenter"],Z={class:"project-item--cover"},ee=["data-image-url"],te=["src","alt"],ae={class:"project-item--infos"},se={class:"h3"},oe={key:0,class:"h3"},re=W({__name:"[slug]",async setup(ne){let d,h;const $=z(),u=f(null),w=f(null),o=f(new Map),[b,x]=([d,h]=D(()=>Promise.all([R(),U()])),d=await d,h(),d),p=l(()=>$.params.slug),g=l(()=>x.find(e=>e.title.toLowerCase().replace(/\s+/g,"-")===p.value)),r=l(()=>g.value?.title||"");P({title:`${r.value} â Commercials by Chris Macari | Director`,link:[{rel:"canonical",href:`https://chrismacarifilms.com/commercials/brands/${p.value}`}]}),P({meta:[{name:"description",content:`Watch commercial videos and brand films for ${r.value}, directed by Chris Macari. Creative direction, production, and visual storytelling.`},{property:"og:title",content:`${r.value} â Commercials by Chris Macari`},{property:"og:description",content:`Watch commercial videos and brand films for ${r.value}, directed by Chris Macari.`},{property:"og:url",content:`https://chrismacarifilms.com/commercials/brands/${p.value}`},{property:"og:image",content:"https://chrismacarifilms.com/meta.jpg"},{name:"twitter:title",content:`${r.value} â Commercials by Chris Macari`},{name:"twitter:description",content:`Watch commercial videos and brand films for ${r.value}, directed by Chris Macari.`},{name:"twitter:image",content:"https://chrismacarifilms.com/meta.jpg"}]});const A=l(()=>{const e=(b.grid||[]).filter(s=>s.type==="commercial"),a=(b.list||[]).filter(s=>s.type==="commercial");return[...e,...a]}),y=l(()=>g.value?A.value.filter(e=>Array.isArray(e.brand)&&e.brand.some(a=>a._id===g.value._id)):[]),E=(e,a)=>{const s=a?._id;if(s)if(e){const t=e.querySelector(".project-img");t&&o.value.set(s,t)}else o.value.delete(s)},L=async()=>{if(C.isMobile)return;await v();const e=window.webglPlanes;if(!e)return;e.setLayout("archives"),e.setAcceptNewPlanes(!0),e.clearAll(),e.restartIntro(50,.6,6),await v();const a=[];o.value.forEach(s=>{const t=s.querySelector("img");t&&!t.complete&&a.push(new Promise(n=>{t.onload=()=>n(),t.onerror=()=>n()}))}),await Promise.all(a),o.value.forEach((s,t)=>{y.value.find(S=>S._id===t)?.thumbnail?.asset?.url&&s&&e.createPlane(s)}),e.recalcBounds()},B=e=>{w.value=e;const a=o.value.get(e);a&&window.webglPlanes&&window.webglPlanes.setPlaneHover(a,!0)},N=()=>{const e=w.value;if(w.value=null,e){const a=o.value.get(e);a&&window.webglPlanes&&window.webglPlanes.setPlaneHover(a,!1)}};return I(async()=>{if(await v(),C.isMobile){window.webglPlanes?.destroy(),window.webglPlanes=null;return}u.value&&(window.webglPlanes?.destroy(),window.webglPlanes=new T(u.value),window.webglPlanes.setLayout("archives"),window.webglPlanes.setAcceptNewPlanes(!0));const e=[];o.value.forEach(a=>{const s=a.querySelector("img");s&&!s.complete&&e.push(new Promise(t=>{s.onload=()=>t()}
1))}),await Promise.all(e),await L()}),j(()=>{o.value.forEach(e=>{window.webglPlanes?.removePlane(e)}),o.value.clear(),window.webglPlanes?.destroy(),window.webglPlanes=null}),(e,a)=>{const s=V;return m(),c("div",K,[i("h1",Q,_(r.value)+" â Commercials by Chris Macari",1),i("div",X,[(m(!0),c(F,null,H(y.value,t=>(m(),c("div",{class:"project-item",key:t._id,ref_for:!0,ref:n=>E(n,t),onClick:n=>M(J)(t.url),onMouseenter:n=>B(t._id),onMouseleave:N},[i("div",Z,[i("div",{class:"project-img","data-image-url":t.thumbnail?.asset?.url},[t.thumbnail?.asset?.url?(m(),c("img",{key:0,src:M(O)(t.thumbnail.asset,900,80),alt:t.title,crossorigin:"anonymous"},null,8,te)):k("",!0)],8,ee)]),i("div",ae,[i("h3",se,_(t.title),1),t.date?(m(),c("span",oe,"©"+_(t.date),1)):k("",!0)])],40,Y))),128))]),i("div",{class:"plane-imgs",ref_key:"canvas",ref:u},null,512),q(s)])}}}),ve=G(re,[["__scopeId","data-v-9bfe649e"]]);export{ve 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.