import{d as n,e as g,l as w,m as y,n as k,q as N}from"/build/_shared/chunk-WRTB4GZ2.js";import{a as h}from"/build/_shared/chunk-ZUBD5LGO.js";import{a as P}from"/build/_shared/chunk-ZXLMDTT4.js";import{d}from"/build/_shared/chunk-G5WX4PPA.js";var t=d(h(),1);function S({categories:p,services:c,filtersType:l,filters:s,setFiltersType:m,setFilters:f,projectIndex:o}){let i=(e,r)=>{let a=e.currentTarget.querySelector(".filter-name"),x=e.currentTarget,b=e.currentTarget.querySelector(".filter-count");r.includes(a.innerText)?f(r.filter(L=>L!==a.innerText)):f([...r,a.innerText]),a.classList.contains("text-light")?a.classList.remove("text-light"):a.classList.add("text-light"),b.classList.contains("text-light")?b.classList.remove("text-light"):b.classList.add("text-light"),x.classList.contains("bg-dark")?x.classList.remove("bg-dark"):x.classList.add("bg-dark")};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"fostr-grid pt-16",children:[!o&&(0,t.jsxs)("div",{className:"col-span-full flex w-full justify-between gap-8 gap-x-8 lg:col-start-2 lg:col-end-7 lg:items-start lg:justify-start",children:[(0,t.jsx)("p",{children:"Filter Projects"}),(0,t.jsxs)("div",{className:"flex gap-x-8",children:[(0,t.jsxs)("button",{onClick:e=>m(e.currentTarget.innerText.toLowerCase().replace(" ","-")),type:"button",className:`group relative overflow-hidden transition-all duration-150 hover:text-light ${l=="by-vertical"?"text-light":""}`,children:["By Vertical",(0,t.jsx)("span",{className:` absolute left-0 z-[-1] h-full w-full bg-dark transition-all duration-150 ease-in-out group-hover:top-0 ${l=="by-vertical"?"top-0":"top-[calc(100%-1px)]"}`})]}),(0,t.jsxs)("button",{onClick:e=>m(e.currentTarget.innerText.toLowerCase().replace(" ","-")),type:"button",className:`group relative overflow-hidden transition-all duration-150 hover:text-light ${l=="by-service"?"text-light":""}`,children:["By Service",(0,t.jsx)("span",{className:` absolute left-0 z-[-1] h-full w-full bg-dark transition-all duration-150 ease-in-out group-hover:top-0 ${l=="by-service"?"top-0":"top-[calc(100%-1px)]"}`})]})]})]}),(0,t.jsx)(g,{initial:!1,mode:"popLayout",children:l=="by-vertical"&&(0,t.jsx)(n.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.3,delay:.3}},exit:{opacity:0,transition:{duration:.3}},className:`${o?"col-span-full":"hidden"} w-full lg:col-start-7 lg:col-end-13 lg:block `,children:(0,t.jsx)("ul",{className:` ${o?"grid grid-cols-2 gap-x-0 gap-y-8 lg:gap-x-8 lg:gap-y-8":"flex flex-wrap gap-8"}`,children:p.map((e,r)=>e.count==0?null:(0,t.jsx)(n.li,{children:(0,t.jsxs)("div",{onClick:a=>i(a,s),className:`after:content=[''] group relative flex h-25 w-fit cursor-pointer items-end overflow-hidden pr-12 after:absolute after:left-0 after:top-full after:z-[-1] after:h-full after:w-full after:bg-dark after:transition-all after:duration-150 lg:hover:text-light lg:hover:after:top-0 ${o?"lg:h-45":""}`,children:[(0,t.jsx)("button",{type:"button",className:`filter-name cursor-pointer whitespace-nowrap transition-all duration-150 lg:group-hover:text-light ${o?"text-2xl lg:text-4xl":"text-xl"}`,children:e.title}),(0,t.jsxs)("span",{className:"filter-count group absolute right-0 top-0 text-xs lg:group-hover:text-light",children:["(",e.count,")"]})]})},e._id))})},"by-vertical")}),(0,t.jsx)(g,{initial:!1,mode:"popLayout",children:l=="by-service"&&(0,t.jsx)(n.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.3,delay:.3}},exit:{opacity:0,transition:{duration:.3}},className:"hidden lg:col-start-7 lg:col-end-13 lg:block ",children:(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-8 gap-y-2",children:c.map((e,r)=>e.count==0?null:(0,t.jsx)("li",{onClick:a=>setFilter(a.currentTarget.querySelector(".filter-name").innerText),children:(0,t.jsxs)("div",{onClick:a=>i(a,s),className:"after:content=[''] group relative flex h-23 w-fit cursor-pointer items-end overflow-hidden pr-12 text-xl after:absolute after:left-0 after:top-full after:z-[-1] after:h-full after:w-full after:bg-dark after:transition-all after:duration-150 lg:hover:text-light lg:hover:after:top-0",children:[(0,t.jsx)("button",{type:"button",className:"filter-name cursor-pointer whitespace-nowrap text-lg transition-all duration-150 lg:group-hover:text-light",children:e.title}),(0,t.jsxs)("span",{className:"filter-count absolute right-0 top-0 text-xs lg:group-hover:text-light",children:["(",e.count,")"]})]})},e._id))})},"by-service")})]}),(0,t.jsx)("div",{className:`col-span-full pl-8 pt-16 lg:hidden ${o?"hidden":""} ${l=="by-vertical"?"":"hidden lg:hidden"}`,children:(0,t.jsx)(w,{slidesPerView:"auto",spaceBetween:16,children:p.map((e,r)=>e.count==0?null:(0,t.jsx)(y,{style:{width:"fit-content"},children:(0,t.jsxs)("div",{onClick:a=>i(a,s),className:"after:content=[''] group relative flex h-25 w-fit cursor-pointer items-end overflow-hidden pr-12 text-lg after:absolute after:left-0 after:top-full after:z-[-1] after:h-full after:w-full after:bg-dark after:transition-all after:duration-150 lg:text-xl lg:hover:text-light lg:hover:after:top-0",children:[(0,t.jsx)("button",{type:"button",className:"filter-name cursor-pointer whitespace-nowrap transition-all duration-150 lg:group-hover:text-light",children:e.title}),(0,t.jsxs)("span",{className:"filter-count absolute right-0 top-0 text-xs lg:group-hover:text-light",children:["(",e.count,")"]})]})},e._id))})}),(0,t.jsx)("div",{className:`col-span-full pl-8 pt-16 lg:hidden ${l=="by-service"?"":"hidden lg:hidden"}`,children:(0,t.jsx)(w,{spaceBetween:16,slidesPerView:"auto",children:c.map((e,r)=>e.count==0?null:(0,t.jsx)(y,{style:{width:"fit-content"},children:(0,t.jsxs)("div",{onClick:a=>i(a,s),className:"after:content=[''] group relative flex h-25 w-fit cursor-pointer items-end overflow-hidden pr-12 text-lg after:absolute after:left-0 after:top-full after:z-[-1] after:h-full after:w-full after:bg-dark after:transition-all after:duration-150 lg:text-xl lg:hover:text-light lg:hover:after:top-0",children:[(0,t.jsx)("button",{type:"button",className:"filter-name cursor-pointer whitespace-nowrap transition-all duration-150 lg:group-hover:text-light",children:e.title}),(0,t.jsxs)("span",{className:"filter-count absolute right-0 top-0 text-xs lg:group-hover:text-light",children:["(",e.count,")"]})]})},e._id))})})]})}var _=S;var v=d(P(),1);var u=d(h(),1);function $({currImage:p=null,filteredWork:c,showFloatingImage:l=!1,mousePositionX:s,mousePositionY:m}){let[f,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let{width:i}=N();o(i)},[]),(0,u.jsx)(n.div,{className:`pointer-events-none fixed z-50 hidden h-[25vw] w-[25vw] overflow-hidden bg-light lg:block ${l?"opacity-100":"opacity-0"}`,animate:{left:s-f*.125,top:m-f*.25-40},transition:{top:{duration:.2,transition:{ease:"easeIn"}},left:{duration:.2,transition:{ease:"easeIn"}}},children:c.length>0?c.map((i,e)=>i?.mainImage?.asset?._ref?(0,u.jsx)("div",{children:(0,u.jsx)(g,{children:p!==null&&p?.asset?._ref==i?.mainImage.asset?._ref&&(0,u.jsx)(n.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.5}},exit:{opacity:0,transition:{duration:.5}},children:(0,u.jsx)(k,{alt:i?.mainImage.alt,crop:i?.mainImage.crop,hotspot:i?.mainImage.hotspot,layout:"responsive",sizes:["30vw"],src:i?.mainImage?.asset?._ref,className:"lg:col-star-10 pointer-events-none absolute inset-0 hidden aspect-square h-auto w-full object-cover md:col-end-8 lg:col-end-12 lg:block"})})})},i?.mainImage?.asset?._ref):null):null})}var A=$;export{_ as a,A as b};