import{t as e}from"./got-BBDj7u1e.mjs";import{jsx as t}from"hono/jsx/jsx-runtime";import{load as n}from"cheerio";import{renderToString as r}from"hono/jsx/dom/server";const i={path:`/new-arrivals/:query?`,categories:[`shopping`],example:`/zagg/new-arrivals/brand=164&cat=3038,3041`,parameters:{query:`query, search page querystring`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`New Arrivals`,maintainers:[`EthanWng97`],handler:a,description:"For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3041`, the query is `brand=164&cat=3038%2C3041`"};async function a(i){let a=i.req.param(`query`),o=new URLSearchParams(a),s=o.get(`brand`),c=await e({headers:{"X-Requested-With":`XMLHttpRequest`},method:`post`,url:`https://www.zagg.com/en_us/new-arrivals`,searchParams:{cat:o.get(`cat`),brand:s}}),l=c.data.products,u=n(l),d=u(`.item.product.product-item`).toArray().map(e=>{let n={},i=u(e).find(`.product.details-box`).html();n.link=u(e).find(`.product-item-link`).eq(0).attr(`href`),n.title=u(e).find(`.product-item-link`).text();let a=u(e).find(`img`).eq(0).attr(`data-src`).match(/(https.*?)\?/)[1];return n.description=i+r(t(`div`,{children:t(`img`,{src:a})})),n});return{title:`Zagg - New Arrivals`,link:c.url,description:`Zagg - New Arrivals`,item:d.map(e=>({title:e.title,description:e.description,link:e.link}))}}export{i as route};