1 line
No EOL
10 KiB
JavaScript
1 line
No EOL
10 KiB
JavaScript
(()=>{var e={};e.id=9934,e.ids=[9934],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21024:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>i.a,__next_app__:()=>f,pages:()=>c,routeModule:()=>u,tree:()=>l});var s=r(65239),a=r(48088),d=r(88170),i=r.n(d),n=r(30893),o={};for(let e in n)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>n[e]);r.d(t,o);let l={children:["",{children:["buying-guide",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,39701)),"/app/app/buying-guide/page.tsx"]}]},{layout:[()=>Promise.resolve().then(r.bind(r,38830)),"/app/app/buying-guide/layout.tsx"]}]},{layout:[()=>Promise.resolve().then(r.bind(r,58014)),"/app/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(r.t.bind(r,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(r.t.bind(r,65284,23)),"next/dist/client/components/unauthorized-error"]}]}.children,c=["/app/app/buying-guide/page.tsx"],f={require:r,loadChunk:()=>Promise.resolve()},u=new s.AppPageRouteModule({definition:{kind:a.RouteKind.APP_PAGE,page:"/buying-guide/page",pathname:"/buying-guide",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:l}})},21607:(e,t,r)=>{Promise.resolve().then(r.bind(r,39701))},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},38830:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var s=r(37413),a=r(61120);function d({children:e}){return(0,s.jsx)(a.Suspense,{fallback:null,children:e})}},39701:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});let s=(0,r(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/app/app/buying-guide/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/app/app/buying-guide/page.tsx","default")},51871:(e,t,r)=>{Promise.resolve().then(r.bind(r,71839))},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71839:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>f});var s=r(60687),a=r(76180),d=r.n(a),i=r(43210),n=r(16189),o=r(85814),l=r.n(o),c=r(30474);function f(){let e=(0,n.useSearchParams)().get("query")||"",[t,r]=(0,i.useState)(e),[a,o]=(0,i.useState)(e),[f,u]=(0,i.useState)([]),[x,m]=(0,i.useState)([]),[p,h]=(0,i.useState)([]),[g,b]=(0,i.useState)(""),[j,v]=(0,i.useState)(""),[y,N]=(0,i.useState)(!0),w=e=>e?.toLowerCase().replace(/[_\s]/g,""),_=(0,i.useMemo)(()=>{let e=w(a);return f.filter(t=>{let r=!g||t.bg_entry_cat===parseInt(g),s=!j||t.bg_entry_sub_cat===parseInt(j),a=!e||[t.product_make,t.product_model,t.review_overview_text].some(t=>w(t||"").includes(e));return r&&s&&a})},[f,a,g,j]),k=(0,i.useMemo)(()=>g?p.filter(e=>e.bg_entry_cat===parseInt(g)):p,[p,g]),P=(0,i.useMemo)(()=>{if(!f.length)return null;let e=Math.floor(Math.random()*f.length);return f[e]},[f]),S=(0,i.useMemo)(()=>{if(f.length<2)return null;let e=Math.floor(Math.random()*f.length);for(;f[e].id===P?.id;)e=Math.floor(Math.random()*f.length);return f[e]},[f,P]);return(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 p-6 max-w-7xl mx-auto",children:[(0,s.jsx)(d(),{id:"f771d209fcff5a05",children:"mark{background:#ffde59;color:#242424;padding:0 2px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(500px,1fr));gap:1rem}.entry-card{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;background-color:#242424;color:var(--card-foreground);border:1px solid var(--border);-webkit-border-radius:.5rem;-moz-border-radius:.5rem;border-radius:.5rem;overflow:hidden;height:150px}.entry-image{width:150px;height:150px;-o-object-fit:cover;object-fit:cover}.entry-content{padding:.75rem;-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.truncate-title{white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}"}),(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 mb-6",children:[(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 card bg-card text-card-foreground p-4",children:[(0,s.jsx)("h1",{className:"jsx-f771d209fcff5a05 text-2xl font-bold mb-2",children:"Buying Guide"}),(0,s.jsxs)("select",{value:g,onChange:e=>{b(e.target.value),v("")},className:"jsx-f771d209fcff5a05 w-full border rounded px-3 py-2 mb-2",children:[(0,s.jsx)("option",{value:"",className:"jsx-f771d209fcff5a05",children:"All Categories"}),x.map(e=>(0,s.jsx)("option",{value:e.id.toString(),className:"jsx-f771d209fcff5a05",children:e.name},e.id))]}),(0,s.jsxs)("select",{value:j,onChange:e=>v(e.target.value),className:"jsx-f771d209fcff5a05 w-full border rounded px-3 py-2 mb-2",children:[(0,s.jsx)("option",{value:"",className:"jsx-f771d209fcff5a05",children:"All Subcategories"}),k.map(e=>(0,s.jsx)("option",{value:e.id.toString(),className:"jsx-f771d209fcff5a05",children:e.name},e.id))]}),(0,s.jsx)("input",{type:"search",value:t,onChange:e=>r(e.target.value),placeholder:"Search products by make, model, etc...",className:"jsx-f771d209fcff5a05 w-full mb-4 dark:bg-background border border-border rounded-md p-2"}),(0,s.jsx)("p",{className:"jsx-f771d209fcff5a05 text-sm text-muted-foreground mb-2",children:"Discover reviewed laser products and accessories."}),(0,s.jsx)("a",{href:"/",className:"jsx-f771d209fcff5a05 inline-block mt-2 px-4 py-2 bg-accent text-background rounded-md text-sm",children:"← Back to Main Menu"})]}),[P,S].map((e,t)=>e&&(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 card bg-card text-card-foreground p-4",children:[(0,s.jsx)("h2",{className:"jsx-f771d209fcff5a05 text-md font-semibold mb-2",children:"Featured Product"}),e.header?.filename_disk?(0,s.jsx)(c.default,{src:`https://forms.lasereverything.net/assets/${e.header.filename_disk}`,alt:"Header image",width:800,height:100,className:"w-full h-[100px] object-cover mb-2 rounded-md",unoptimized:!0}):(0,s.jsx)("div",{className:"jsx-f771d209fcff5a05 w-full h-[100px] bg-zinc-800 flex items-center justify-center text-zinc-400 text-sm rounded-md mb-2",children:"No Header"}),(0,s.jsxs)(l(),{href:`/buying-guide/product/${e.id}`,className:"text-accent font-semibold text-lg hover:underline",children:[e.product_make," ",e.product_model]}),e.product_price&&(0,s.jsxs)("p",{className:"jsx-f771d209fcff5a05 text-sm text-white",children:["Starting at ",e.product_price]}),(0,s.jsxs)("p",{className:"jsx-f771d209fcff5a05 text-sm text-muted-foreground mt-1",children:[e.review_overview_text?.slice(0,140),"..."]})]},t)),(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 card bg-card text-card-foreground p-4",children:[(0,s.jsx)("h2",{className:"jsx-f771d209fcff5a05 text-md font-semibold mb-2",children:"Popular Categories"}),(0,s.jsx)("ul",{className:"jsx-f771d209fcff5a05 text-sm space-y-1",children:x.slice(0,5).map(e=>(0,s.jsx)("li",{className:"jsx-f771d209fcff5a05",children:(0,s.jsx)("button",{onClick:()=>{b(e.id.toString()),v("")},className:"jsx-f771d209fcff5a05 text-accent hover:underline",children:e.name})},e.id))})]}),(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 card bg-card text-card-foreground p-4",children:[(0,s.jsx)("h2",{className:"jsx-f771d209fcff5a05 text-md font-semibold mb-2",children:"Recently Added"}),(0,s.jsx)("ul",{className:"jsx-f771d209fcff5a05 text-sm space-y-1",children:f.slice(0,3).map(e=>(0,s.jsx)("li",{className:"jsx-f771d209fcff5a05",children:(0,s.jsxs)(l(),{href:`/buying-guide/product/${e.id}`,className:"text-accent hover:underline",children:[e.product_make," ",e.product_model]})},e.id))})]}),(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 card bg-card text-card-foreground p-4",children:[(0,s.jsx)("h2",{className:"jsx-f771d209fcff5a05 text-md font-semibold mb-2",children:"What Is This?"}),(0,s.jsx)("p",{className:"jsx-f771d209fcff5a05 text-sm text-muted-foreground",children:"This Buying Guide helps you compare laser-related gear with hands-on reviews, scores, and recommendations. Use the filters and search to find what you’re looking for!"})]})]}),(0,s.jsx)("hr",{className:"jsx-f771d209fcff5a05 my-8 border-border"}),y?(0,s.jsx)("p",{className:"jsx-f771d209fcff5a05 text-muted",children:"Loading entries..."}):0===_.length?(0,s.jsx)("p",{className:"jsx-f771d209fcff5a05 text-muted",children:"No entries found."}):(0,s.jsx)("div",{className:"jsx-f771d209fcff5a05 card-grid",children:_.map(e=>{let t=e.index?.filename_disk;return(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05 entry-card",children:[t?(0,s.jsx)(c.default,{src:`https://forms.lasereverything.net/assets/${t}`,alt:`${e.product_make} ${e.product_model}`,width:150,height:150,className:"entry-image",unoptimized:!0}):(0,s.jsx)("div",{className:"jsx-f771d209fcff5a05 entry-image bg-zinc-800 flex items-center justify-center text-zinc-400",children:"No Image"}),(0,s.jsx)("div",{className:"jsx-f771d209fcff5a05 entry-content",children:(0,s.jsxs)("div",{className:"jsx-f771d209fcff5a05",children:[(0,s.jsx)("p",{className:"jsx-f771d209fcff5a05 text-sm font-medium text-muted-foreground truncate-title",children:e.product_make}),(0,s.jsx)(l(),{href:`/buying-guide/product/${e.id}`,className:"text-lg font-semibold text-accent underline truncate-title",title:e.product_model,children:e.product_model}),void 0!==e.product_price&&(0,s.jsxs)("p",{className:"jsx-f771d209fcff5a05 text-sm text-foreground mt-1 font-medium",children:["Starting at ",e.product_price]}),(0,s.jsxs)("p",{className:"jsx-f771d209fcff5a05 text-xs text-muted-foreground mt-1",children:[e.review_overview_text?.slice(0,120),"..."]})]})})]},e.id)})})]})}}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[7719,4825,5814,598,1661],()=>r(21024));module.exports=s})(); |