1import{j as e}from"./query-3IOBAC-m.js";import{a as r,L as S}from"./router-CzJ8lCzW.js";import{u as L,a as B,L as M,S as A,N as I}from"./index-Ca0T0s8L.js";import{G as R}from"./GradientCTA-B0i28S8l.js";import{C as T}from"./CaseCard-Ce2BfhRP.js";import{g as F}from"./index-DA-r0TSJ.js";import"./react-vendor-BYlTuIJE.js";import"./helmet-C9nhsWlx.js";const K=()=>{const{lang:n,t}=L(),[d,j]=r.useState(""),[p,f]=r.useState(t("casesPage.all")),[m,w]=r.useState(t("casesPage.all")),[g,b]=r.useState("all"),[h,y]=r.useState("newest"),x=B(),c=r.useMemo(()=>F(n),[n]),l=t("casesPage.all"),C=r.useMemo(()=>[l,...Array.from(new Set(c.flatMap(a=>(a.category||"").split(",").map(o=>o.trim())).filter(Boolean)))],[c,l]),P=r.useMemo(()=>[l,...Array.from(new Set(c.map(a=>a.industry).filter(Boolean)))],[c,l]);r.useEffect(()=>{f(l),w(l)},[l]);const u=r.useMemo(()=>{if(g==="all")return null;const a=parseInt(g,10),o=new Date;return o.setDate(o.getDate()-a),o.toISOString().slice(0,10)},[g]),v=r.useMemo(()=>{const o=[...c.filter(s=>{const i=!d||s.title.toLowerCase().includes(d.toLowerCase())||s.description.toLowerCase().includes(d.toLowerCase()),N=p===l||(s.category||"").split(",").map(E=>E.trim()).includes(p),k=m===l||s.industry===m,D=!u||s.rawDate&&s.rawDate>=u;return i&&N&&k&&D})];return o.sort((s,i)=>{switch(h){case"oldest":return!s.rawDate&&!i.rawDate?0:s.rawDate?i.rawDate?s.rawDate.localeCompare(i.rawDate):-1:1;case"title-asc":return s.title.localeCompare(i.title,n);case"title-desc":return i.title.localeCompare(s.title,n);default:return!s.rawDate&&!i.rawDate?0:s.rawDate?i.rawDate?i.rawDate.localeCompare(s.rawDate):-1:1}}),o},[c,d,p,m,l,u,h,n]);return e.jsxs(M,{children:[e.jsx(A,{title:t("casesPage.title"),description:t("casesPage.subtitle"),keywords:"cases de sucesso, projetos, transformação digital, inteligência artificial, visão computacional, MadeinWeb",jsonLd:{"@context":"https://schema.org","@type":"CollectionPage",name:`${t("casesPage.title")} - MadeinWeb`,description:t("casesPage.subtitle"),publisher:{"@type":"Organization",name:"MadeinWeb"}}}),e.jsx(I,{variant:"dark"}),e.jsxs("main",{id:"main-content",children:[e.jsx("nav",{"aria-label":"Breadcrumb",ref:x,className:"w-full max-w-[1440px] mx-auto px-7 md:px-8 min-[1480px]:px-0 mt-[100px] md:mt-[110px]",children:e.jsxs("ol",{className:"flex items-center font-light text-body text-sm [&>li:not(:last-child)]:after:content-['-'] [&>li:not(:last-child)]:after:mx-2",children:[e.jsx("li",{children:e.jsx(S,{href:"/",children:e.jsx("span",{className:"hover:text-heading cursor-pointer transition-colors",children:t("breadcrumb.home")})})}),e.jsx("li",{"aria-current":"page",className:"text-heading",children:t("casesPage.breadcrumb")})]})}),e.jsx("div",{ref:x,className:"w-full max-w-[1440px] mx-auto px-7 md:px-8 min-[1480px]:px-0 mt-6 md:mt-8",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-6 md:gap-16",children:[e.jsx("h1",{className:"heading-1 max-w-[500px]",children:t("casesPage.heading")}),e.jsx("p",{className:"body-base max-w-[420px] md:pt-2",children:t("casesPage.subtext")})]})}),e.jsx("div",{ref:x,className:"w-full max-w-[1440px] mx-auto px-7 md:px-8 min-[1480px]:px-0 mt-10 md:mt-14",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx("span",{className:"font-normal text-heading text-lg md:text-xl",children:t("casesPage.filterBy")}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"cases-search",className:"font-light text-body text-xs uppercase tracking-[0.5px]",children:t("casesPage.search")}),e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-body opacity-60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8",strokeWidth:"2"}),e.jsx("path",{d:"m21 21-4.3-4.3",strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("input",{id:"cases-search",type:"search",placeholder:t("casesPage.searchPlaceholder"),value:d,onChange:a=>j(a.target.value),className:"input-base pl-10","data-testid":"input-cases-search"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"cases-category",className:"font-light text-body text-xs uppercase tracking-[0.5px]",children:t("casesPage.category")}),e.jsx("select",{id:"cases-category",value:p,onChange:a=>f(a.target.value),className:"input-base appearance-none cursor-pointer",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636363' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 14px center"},"data-testid":"select-cases-category",children:C.map(a=>e.jsx("option",{value:a,children:a},a))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"cases-industry",className:"font-light text-body text-xs uppercase tracking-[0.5px]",children:t("casesPage.industry")}),e.jsx("select",{id:"cases-industry",value:m,onChange:a=>w(a.target.value),className:"input-base appearance-none cursor-pointer",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636363' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 14px center"},"data-testid":"select-cases-industry",children:P.map(a=>e.jsx("option",{value:a,children:a},a))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"cases-period",className:"font-light text-body text-xs uppercase tracking-[0.5px]",children:t("casesPage.period")}),e.jsxs("select",{id:"cases-period",value:g,onChange:a=>b(a.target.value),className:"input-base appearance-none cursor-pointer",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636363' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 14px center"},"data-testid":"select-cases-period",children:[e.jsx("option",{value:"all",children:t("casesPage.periodAll")}),e.jsx("option",{value:"30",children:t("casesPage.period30")}),e.jsx("option",{value:"90",children:t("casesPage.period90")}),e.jsx("option",{value:"180",children:t("casesPage.period180")}),e.jsx("option",{value:"365",children:t("casesPage.period365")})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"cases-sort",className:"font-light text-body text-xs uppercase tracking-[0.5px]",children:t("casesPage.sortBy")}),e.jsxs("select",{id:"cases-sort",value:h,onChange:a=>y(a.target.value),className:"input-base appearance-none cursor-pointer",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636363' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 14px center"},"data-testid":"select-cases-sort",children:[e.jsx("option",{value:"newest",children:t("casesPage.sortNewest")}
1),e.jsx("option",{value:"oldest",children:t("casesPage.sortOldest")}),e.jsx("option",{value:"title-asc",children:t("casesPage.sortTitleAsc")}),e.jsx("option",{value:"title-desc",children:t("casesPage.sortTitleDesc")})]})]})]}),e.jsxs("span",{className:"font-light text-body text-sm mt-1","aria-live":"polite",role:"status",children:[v.length," ",t("casesPage.results")]})]})}),e.jsx("div",{className:"w-full max-w-[1440px] mx-auto px-7 md:px-8 min-[1480px]:px-0 mt-8 md:mt-10",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 md:gap-8 lg:gap-[40px]",children:v.map(a=>e.jsx(T,{slug:a.slug,title:a.title,description:a.description,category:a.category,date:a.date,image:a.image,imageAlt:a.imageAlt,animateRef:x,headingLevel:"h2"},a.id))})}),e.jsx("div",{ref:x,className:"w-full max-w-[1440px] mx-auto px-7 md:px-8 min-[1480px]:px-0 mt-16 md:mt-20",children:e.jsx(R,{title:t("casesPage.ctaTitle"),text:t("casesPage.ctaText"),buttonText:t("casesPage.ctaCta")})})]})]})};export{K as Cases};
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.