1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1846],{14277:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(51092),n=a(1198),s=a(11297),l=a(27183),o=a(74521),i=a(45780);async function c(e){if(!e)return"";try{var t,a;let c=[],u=0,d=e.replace(/<ul class="galeria">([\s\S]*?)<\/ul>/gi,e=>{let t="GALLERY_PLACEHOLDER_".concat(u);return c.push({placeholder:t,content:e}),u++,t}),p=[],g=0,m=d.replace(/<iframe[\s\S]*?<\/iframe>/gi,e=>{let t="IFRAME_PLACEHOLDER_".concat(g);return p.push({placeholder:t,content:e}),g++,t}),h=await (0,r.V)().use(s.A).use(n.A,{sanitize:!1}).process(m),f={...o.j,tagNames:[...o.j.tagNames||[],"iframe","div","ul","li"],attributes:{...o.j.attributes,ul:[...(null==(t=o.j.attributes)?void 0:t.ul)||[],"class"],iframe:["src","width","height","frameborder","allowfullscreen","allow","loading","class","style"],div:[...(null==(a=o.j.attributes)?void 0:a.div)||[],"class"]}},b=(await (0,l.S)().use(i.A,f).process(h.toString())).toString();return p.forEach(e=>{b=b.replace(e.placeholder,e.content)}),c.forEach(e=>{b=b.replace(e.placeholder,e.content)}),b}catch(t){return console.error("Error procesando Markdown:",t),e}}},21313:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(66162),n=a(44922);let s=e=>{let{isOpen:t,onClose:a,images:s,currentIndex:l,setCurrentIndex:o}=e,[i,c]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),p=(0,n.useRef)(null);(0,n.useEffect)(()=>(t?(document.body.style.overflow="hidden",setTimeout(()=>{d(!0)},10),document.addEventListener("keydown",g)):(d(!1),setTimeout(()=>{document.body.style.overflow=""},300),document.removeEventListener("keydown",g)),()=>{document.body.style.overflow="",document.removeEventListener("keydown",g)}),[t]);let g=e=>{"Escape"===e.key?a():"ArrowRight"===e.key?m():"ArrowLeft"===e.key&&h()},m=()=>{c(!1),o(e=>e===s.length-1?0:e+1)},h=()=>{c(!1),o(e=>0===e?s.length-1:e-1)};return t?(0,r.jsxs)("div",{ref:p,onClick:e=>{e.target===p.current&&a()},className:"fixed inset-0 z-50 bg-black flex items-center justify-center p-4 md:p-8 transition-all duration-300 ease-in-out ".concat(u?"bg-opacity-90":"bg-opacity-0"),children:[(0,r.jsx)("button",{onClick:a,className:"absolute top-4 right-4 text-white text-3xl hover:text-gray-300 z-10","aria-label":"Close lightbox",children:"\xd7"}),(0,r.jsx)("button",{onClick:h,className:"absolute left-2 md:left-8 text-white text-4xl opacity-70 hover:opacity-100 z-10 focus:outline-none","aria-label":"Previous image",children:"â¹"}),(0,r.jsx)("button",{onClick:m,className:"absolute right-2 md:right-8 text-white text-4xl opacity-70 hover:opacity-100 z-10 focus:outline-none","aria-label":"Next image",children:"âº"}),(0,r.jsxs)("div",{className:"relative max-w-full max-h-full transition-transform duration-300 ".concat(u?"scale-100 opacity-100":"scale-95 opacity-0"),children:[!i&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-white"})}),(0,r.jsx)("img",{src:s[l],alt:"Gallery image ".concat(l+1),className:"max-h-[90vh] max-w-full object-contain transition-opacity duration-300 ".concat(i?"opacity-100":"opacity-0"),onLoad:()=>c(!0)}),(0,r.jsxs)("div",{className:"absolute bottom-2 left-0 right-0 text-center text-white text-sm",children:[l+1," / ",s.length]})]})]}):null}},34333:(e,t,a)=>{a.d(t,{N7:()=>u,Or:()=>c});var r=a(92806);let n="https://cms.ezstreetasphalt.com",s="bd7ac1108bc55a9be9c40e402c0f0d266467807303243cafea51173c831997476cc7e6ac439297fd68b02d056cabd6f170e79f29ef3859e7fc8abea1e2af7f253992b76559c736a5ef308aa0700b2af4c96f895b9038cf71f39fc6f36161253bac815b4faba9c9277bd668c4b0ed9ff0b8a3b740c5c6813ceb6bbaec5138aeb0";function l(e){return e?e.startsWith("http")||e.startsWith("//")?e:"".concat(n).concat(e.startsWith("/")?e:"/".concat(e)):"/placeholder.jpg"}function o(e){var t,a,r,n,s,o,i,c;let u=null;if(e.featured&&e.featured.url)u=l(e.featured.url);else if(e.attributes&&e.attributes.featured&&e.attributes.featured.data){let t=e.attributes.featured.data;t&&t.attributes&&t.attributes.url&&(u=l(t.attributes.url))}let d=[];return e.categories?d=e.categories:e.attributes&&e.attributes.categories&&e.attributes.categories.data&&(d=e.attributes.categories.data.map(e=>({id:e.id,name:e.attributes.name,slug:e.attributes.slug}
1))),{id:e.id,title:e.title||(null==(t=e.attributes)?void 0:t.title)||"Sin t\xedtulo",slug:e.slug||(null==(a=e.attributes)?void 0:a.slug)||"post-".concat(e.id),content:e.content||(null==(r=e.attributes)?void 0:r.content)||"",date:e.date||(null==(n=e.attributes)?void 0:n.date)||null,featuredImage:u,categories:d,excerpt:(e.content||(null==(s=e.attributes)?void 0:s.content)||"").substring(0,150)+"...",createdAt:e.createdAt||(null==(o=e.attributes)?void 0:o.createdAt),updatedAt:e.updatedAt||(null==(i=e.attributes)?void 0:i.updatedAt),site:e.site||(null==(c=e.attributes)?void 0:c.site)||null}}async function i(){try{let e=await r.A.get("".concat(n,"/api/posts"),{headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"},params:{populate:"*","filters[site][$eq]":"us","pagination[pageSize]":100,"pagination[page]":1}});if(!e.data||!e.data.data)return console.warn("No se encontraron datos en la respuesta de la API"),[];return e.data.data.map(o)}catch(e){return console.error("Error al obtener todos los posts:",e),e.response&&(console.error("Estado HTTP:",e.response.status),console.error("Datos del error:",e.response.data)),[]}}async function c(e){try{if(!e)return await i();let t=await r.A.get("".concat(n,"/api/posts"),{headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"},params:{populate:"*","filters[site][$eq]":"us","filters[categories][name][$eq]":e,"pagination[pageSize]":100,"pagination[page]":1}});if(!t.data||!t.data.data)return console.warn('No se encontraron posts en la categor\xeda "'.concat(e,'"')),[];let a=t.data.data.map(o);return console.log("Se encontraron ".concat(a.length,' posts en "').concat(e,'" para sitio "').concat("us",'"')),a}catch(t){return console.error('Error al obtener posts de categor\xeda "'.concat(e,'":'),t),[]}}async function u(e){try{let t=await r.A.get("".concat(n,"/api/posts"),{headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"},params:{populate:"*","filters[site][$eq]":"us","filters[slug][$eq]":e,"pagination[pageSize]":1}});if(!t.data||!t.data.data||0===t.data.data.length)return console.warn('No se encontr\xf3 post con slug "'.concat(e,'" en sitio "').concat("us",'"')),null;return o(t.data.data[0])}catch(t){return console.error('Error al buscar post con slug "'.concat(e,'":'),t),null}}},51846:(e,t,a)=>{a.d(t,{A:()=>p});var r=a(66162),n=a(44922),s=a(66833),l=a(84009),o=a(34333),i=a(14277),c=a(14376),u=a.n(c),d=a(21313);let p=()=>{let e=(0,s.useRouter)();e.asPath;let t=e.asPath.split("/")[1],{slug:a}=e.query,[c,p]=(0,n.useState)(null),[g,m]=(0,n.useState)(""),[h,f]=(0,n.useState)(!0),[b,x]=(0,n.useState)(null),[y,v]=(0,n.use
1State)(!1),[j,w]=(0,n.useState)([]),[N,A]=(0,n.useState)(0),E=(0,n.useRef)(null);return((0,n.useEffect)(()=>{(async()=>{if(a){f(!0);try{let e=await (0,o.N7)(a);if(e){p(e);let t=await (0,i.A)(e.content);m((e=>{if(!e)return"";let t=e.replace(/http:\/\/64\.227\.12\.126:1337\/uploads\//g,"https://cms.ezstreetasphalt.com/uploads/");return t=(t=(t=t.replace(/<iframe(.*?)src="(.*?youtube\.com\/embed\/.*?)"(.*?)><\/iframe>/gi,'<div class="video-container"><iframe$1src="$2"$3 frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>')).replace(/<ul class="galeria">([\s\S]*?)<\/ul>/gi,(e,t)=>{let a,r=[],n=/<li><img src="([^"]+)"[^>]*><\/li>/gi;for(;null!==(a=n.exec(t));)r.push(a[1]);if(0===r.length)return e;let s="gallery-".concat(Math.random().toString(36).substr(2,9));return'\n <div class="image-gallery" id="'.concat(s,'">\n ').concat(r.map((e,t)=>'\n <div class="gallery-item">\n <img \n src="'.concat(e,'" \n alt="Gallery image ').concat(t+1,'" \n data-gallery="').concat(s,'" \n data-index="').concat(t,'"\n loading="lazy"\n class="cursor-pointer hover:opacity-90 transition-opacity"\n />\n </div>\n ')).join(""),"\n </div>\n ")})).replace(/<ul class="">([\s\S]*?)<\/ul>/gi,(e,t)=>{let a=t.match(/<li>[\s\S]*?<\/li>/gi)||[],r=t.match(/<li><img[^>]*><\/li>/gi)||[];if(a.length>0&&a.length===r.length){let a,r=[],n=/<li><img src="([^"]+)"[^>]*><\/li>/gi;for(;null!==(a=n.exec(t));)r.push(a[1]);if(0===r.length)return e;let s="gallery-".concat(Math.random().toString(36).substr(2,9));return'\n <div class="image-gallery" id="'.concat(s,'">\n ').concat(r.map((e,t)=>'\n <div class="gallery-item">\n <img \n src="'.concat(e,'" \n alt="Gallery image ').concat(t+1,'" \n data-gallery="').concat(s,'" \n data-index="').concat(t,'"\n loading="lazy"\n class="cursor-pointer hover:opacity-90 transition-opacity"\n />\n </div>\n ')).join(""),"\n </div>\n ")}return e})})(t))}else x("Post no encontrado")}catch(e){console.error("Error al cargar el post:",e),x("Error al cargar el post")}finally{f(!1)}}})()},[a]),(0,n.useEffect)(()=>{!h&&E.current&&(()=>{let e={};document.querySelectorAll("[data-gallery]").forEach(t=>{let a=t.getAttribute("data-gallery"),r=parseInt(t.getAttribute("data-index"),10);e[a]||(e[a]=[]),e[a][r]=t.getAttribute("src"),t.addEventListener("click",()=>{w(e[a]),A(r),v(!0)})})})()},[h,g]),h)?(0,r.jsx)("div",{className:"bg-white",children:(0,r.jsx)(l.A,{children:(0,r.jsx)("div",{className:"mx-auto px-4 py-8 elsuperior",children:(0,r.jsx)("div",{className:"flex justify-center items-center py-12",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500"})})})})}):b||!c?(0,r.jsx)(l.A,{title:"Error",children:(0,r.jsx)("div",{className:"container mx-auto px-4 py-8",children:(0,r.jsxs)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:[(0,r.jsx)("p",{children:b||"Not found"}),(0,r.jsx)("button",{onClick:()=>{console.log("Navegando a:",window.location.pathname),e.push("/".concat(t))},className:"mt-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Back"})]})})}):(0,r.jsx)("div",{className:"bg-white",children:(0,r.jsxs)(l.A,{title:c.title,children:[(0,r.jsxs)("div",{className:"container mx-auto max-w-3xl px-4 py-8 pt-36 md:pt-52 bg-white",children:[(0,r.jsxs)("article",{className:"unpost mx-auto",children:[c.categories&&c.categories.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:c.categories.map((e,a)=>(0,r.jsxs)("span",{children:[(0,r.jsx)(u(),{href:"/".concat(t,"/").concat(e.slug),legacyBehavior:!0,children:(0,r.jsx)("a",{className:"font-semibold text-stone-500 hover:text-stone-700 transition-colors",children:e.name})}),a<c.categories.length-1&&(0,r.jsx)("span",{className:"mx-1",children:"â¢"})]},e.id))}),(0,r.jsx)("h1",{className:"font-poppins font-semibold text-2xl md:text-4xl mb-8 text-ez-blue",children:c.title}),c.featuredImage&&(0,r.jsx)("div",{className:"limitafeatured",children:(0,r.jsx)("img",{src:c.featuredImage,alt:c.title,className:"w-full h-auto rounded-lg mb-6"})}),(0,r.jsx)("div",{ref:E,className:"content",dangerouslySetInnerHTML:{__html:g}})]}),c.categories&&c.categories.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-2 justify-end mb-24",children:c.categories.map((e,a)=>(0,r.jsxs)("span",{children:[(0,r.jsx)(u(),{href:"/".concat(t,"/").concat(e.slug),legacyBehavior:!0,children:(0,r.jsxs)("a",{className:"underline text-stone-500 hover:text-stone-700 transition-colors",children:["Back to ",e.name]})}),a<c.categories.length-1&&(0,r.jsx)("span",{className:"mx-1",children:"â¢"})]},e.id))})]}),(0,r.jsx)(d.A,{isOpen:y,onClose:()=>v(!1),images:j,currentIndex:N,setCurrentIndex:A})]})})}}}]);
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.