PageSourceSearch

https://egelectronics.com/_nuxt/BLGD6cWD.js

js egelectronics.com collected 2026-10-07 04:01:33 UTC 9,497 bytes, 25 lines download raw bytes

1import{T as ce,M as le,L as ie,H as ue}from"./BhHv0gPh.js";import{d as de,e as pe,f as ge,g as X,b as me,c as fe,a as ye,h as _e,_ as he}from"./B0NON1Bn.js";import{u as ve}from"./D_nnvyoI.js";import{d as xe}from"./CQ5VkhDK.js";import{P as we}from"./CzBZAs6Y.js";import{k as Ne,b,l as p,X as Ce,c as Y,z as r,A as l,u as t,H as C,I as P,N as y,J as M,L as _,M as D,E as i,F as G,G as O,a1 as $e}from"./DgFB7NWf.js";const ke={class:"container mx-auto px-4 md:px-4 py-4 md:py-10 min-h-[60vh]"},be={class:"flex flex-col-reverse md:flex-row gap-8 mb-8 md:mb-16 items-center"},Pe={class:"w-full md:w-3/5"},Te={class:"text-xl md:text-4xl font-bold"},Ee=["innerHTML"],Se=["src","alt"],De={key:1,class:"w-full md:w-2/5 right-corner object-cover h-screen flex items-center justify-center",style:{"background-color":"var(--black)","max-height":"500px"}},Ie={key:2,class:"py-10 text-center text-gray-500"},Ae={key:3,class:"py-10 text-center text-red-600"},Le={key:4,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mt-8"},Me=["src","alt"],Ge={key:1,class:"w-full aspect-[2/3] flex items-center justify-center",style:{"background-color":"var(--black)"}},Oe={class:"absolute inset-0 bg-gradient-to-t from-black/70 to-black/0 flex flex-col justify-end p-6",style:{height:"50%",bottom:"0",top:"auto"}},je={class:"text-xl font-extrabold text-white mb-2"},Be=["innerHTML"],Fe={key:5,class:"w-full"},Ue={class:"container mx-auto py-8"},He={class:"text-gray-600 mb-4"},Je={class:"font-bold"},Re={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"},qe={key:0,class:"text-center mt-8"},ze=["disabled"],Ve={key:6,class:"py-10 text-center text-gray-500"},Qe=24,We="https://egelectronics.com",Z="EG Electronics",Ke=Ne({__name:"[...slug]",async setup(Xe){let T,j;const ee=_e(),B=de(),{getComponent:F}=ve(),{lang:w}=pe(),{t:g}=ge(),$=b(!1),N=b([]),E=b(!1),I=b(""),U=b([]),A=p(()=>B.params.slug||[]),te=p(()=>`/product-category/${A.value.join("/")}/`),H=p(()=>A.value.join("__")),{data:J,pending:oe,error:R,refresh:se}=([T,j]=Ce(()=>me(()=>`/api/category/${A.value.join("/")}`,{key:`category-${H.value}-${w.value}`,params:p(()=>({lang:w.value})),watch:[H,w],getCachedData(e){return fe(e).data.value}},"$ATQRZ3jCPk")),T=await T,j(),T),v=p(()=>J.value||{}),x=p(()=>{var e;return((e=v.value)==null?void 0:e.name)||""}),q=p(()=>{var e;return((e=v.value)==null?void 0:e.description)||""}),L=p(()=>{var e,o;return((o=(e=v.value)==null?void 0:e.image)==null?void 0:o.sourceUrl)||""}),z=p(()=>{var e,o;return((o=(e=v.value)==null?void 0:e.children)==null?void 0:o.nodes)||[]}),V=p(()=>{var h,m;const e=((h=v.value)==null?void 0:h._resolvedUri)||((m=v.value)==null?void 0:m.uri)||"";if(!e)return"";const a=`/category/${e.replace(/^https?:\/\/[^/]+/i,"").replace(/^\/+|\/+$/g,"").replace(/^product-category\//,"").replace(/^category\//,"")}/`,u=w.value==="sv"?"/sv":"";return`${We}${u}${a}`}),Q=p(()=>{var c,s;const e=((s=(c=v.value)==null?void 0:c.yoastSeo)==null?void 0:s.title)||"",o=e.startsWith(`${x.value} Archives`);return e&&!o?e:x.value?`${x.value} - ${Z}`:Z}),W=p(()=>{var s,a;const e=((a=(s=v.value)==null?void 0:s.yoastSeo)==null?void 0:a.metaDesc)||"";if(e)return e;const c=(q.value||"").replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").replace(/\s+/g," ").trim();return c?c.substring(0,160)+(c.length>160?"...":""):`${g("categoryDefaultDescription")}`}),ae=e=>{if(!e)return w.value==="sv"?"/sv/category":"/category";const a=`/category/${e.replace(/^https?:\/\/[^/]+/i,"").replace(/^\/+|\/+$/g,"").replace(/^product-category\//,"").replace(/^category\//,"")}`;return w.value==="sv"?`/sv${a}`:a};Y(()=>J.value,e=>{var c,s,a,u,h,m;if(!e)return;N.value=((c=e.products)==null?void 0:c.nodes)||[],E.value=!!((a=(s=e.products)==null?void 0:s.pageInfo)!=null&&a.hasNextPage),I.value=((h=(u=e.products)==null?void 0:u.pageInfo)==null?void 0:h.endCursor)||"";const o=((m=e.categoryContent)==null?void 0:m.categoryContentBlocks)||[];U.value=o.map(d=>{try{const n=ne(d);if(n)return n;if(d.attributesJSON){const f=JSON.parse(d.attributesJSON||"{}"),k=`acf/${(f.acf_fc_layout||"").replace(/_/g,"-")}`;return{fieldGroupName:d.fieldGroupName,name:k,attributes:f,data:f,attributesJSON:d.attributesJSON}}return null}catch(n){return console.error("Error processing block:",n,d),null}}
1).filter(Boolean)},{immediate:!0});function ne(e){const o=(e==null?void 0:e.fieldGroupName)||"",c=a=>Array.isArray(a)?a[0]:a,s=(a,u)=>({fieldGroupName:o,name:a,attributes:u,data:u});return o.includes("AiQAndA")?s("acf/ai-q-and-a",{headline_size:c(e.headlineSize),title:e.title,ingress:e.ingress,question_and_answers:e.questionAndAnswers||[]}):o.includes("ArticleBlock")?s("acf/article-block",{full_width:e.fullWidth,article:e.article}):o.includes("ContactBlock")?s("acf/contact-block",{headline_size:c(e.headlineSize),title:e.title,ingress:e.ingress,contacts:e.contacts,cta:e.cta}):o.includes("FiftyFiftyBlock")?s("acf/fifty-fifty-block",{add_fifty_fifty:(e.addFiftyFifty||[]).map(a=>({content:a.content,image:a.image,video:a.video,cta:a.cta}))}):null}const re=async()=>{var e,o,c,s,a,u,h,m,d,n,f;if(!($.value||!E.value)){$.value=!0;try{const k=await $fetch(ee.public.wordpressUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:`
2          query GetMoreProducts($uri: ID!, $after: String) {
3            productCategory(id: $uri, idType: URI) {
4              products(first: ${Qe}, after: $after) {
5                pageInfo {
6                  hasNextPage
7                  endCursor
8                }
9                nodes {
10                  id
11                  name
12                  slug
13                  excerpt
14                  onSale
15                  dateOnSaleFrom
16                  dateOnSaleTo
17                  image {
18                    sourceUrl
19                    altText
20                  }
21                }
22              }
23            }
24          }
25        `,variables:{uri:te.value,after:I.value||null}})}),K=((c=(o=(e=k.data)==null?void 0:e.productCategory)==null?void 0:o.products)==null?void 0:c.nodes)||[];K.forEach(S=>{S&&typeof S.name=="string"&&(S.name=xe(S.name))}),N.value=[...N.value,...K],E.value=!!((h=(u=(a=(s=k.data)==null?void 0:s.productCategory)==null?void 0:a.products)==null?void 0:u.pageInfo)!=null&&h.hasNextPage),I.value=((f=(n=(d=(m=k.data)==null?void 0:m.productCategory)==null?void 0:d.products)==null?void 0:n.pageInfo)==null?void 0:f.endCursor)||""}finally{$.value=!1}}};return Y(()=>B.fullPath,async()=>{await se()}),(e,o)=>{var m,d;const c=ce,s=le,a=ie,u=ue,h=ye;return r(),l("div",ke,[t(x)?(r(),C(u,{key:0},{default:P(()=>[y(c,null,{default:P(()=>[M(_(t(Q)),1)]),_:1}),y(s,{name:"description",content:t(W)},null,8,["content"]),y(s,{property:"og:title",content:t(Q)},null,8,["content"]),y(s,{property:"og:description",content:t(W)},null,8,["content"]),y(s,{property:"og:image",content:t(L)||""},null,8,["content"]),y(s,{property:"og:type",content:"website"}),t(V)?(r(),C(a,{key:0,rel:"canonical",href:t(V)},null,8,["href"])):D("",!0)]),_:1})):(r(),C(u,{key:1},{default:P(()=>[y(c,null,{default:P(()=>[M("EG Electronics | "+_(t(g)("productCategories")),1)]),_:1}),y(s,{name:"description",content:t(g)("categoryDefaultDescription")},null,8,["content"]),y(s,{property:"og:title",content:`EG Electronics | ${t(g)("productCategories")}`},null,8,["content"]),y(s,{property:"og:description",content:t(g)("categoryDefaultDescription")},null,8,["content"]),y(s,{property:"og:type",content:"website"})]),_:1})),i("div",be,[i("div",Pe,[i("h1",Te,_(t(x)),1),i("div",{class:"text-md md:text-xl text-gray-600 category-description",innerHTML:t(q)},null,8,Ee)]),t(L)?(r(),l("img",{key:0,class:"w-full md:w-2/5 right-corner object-cover",src:t(L),alt:t(x),style:{"max-height":"500px"}},null,8,Se)):(r(),l("div",De,o[0]||(o[0]=[i("img",{class:"py-2 w-[120px] md:w-[300px]",src:X,alt:"EG Electronics Logo",width:"300px"},null,-1)])))]),t(oe)?(r(),l("div",Ie,_(t(g)("loading")),1)):t(R)?(r(),l("div",Ae,_(((m=t(R))==null?void 0:m.message)||"Failed to load category"),1)):(d=t(z))!=null&&d.length?(r(),l("div",Le,[(r(!0),l(G,null,O(t(z),n=>(r(),C(h,{key:n.id,to:ae(n.uri),class:"group relative overflow-hidden"},{default:P(()=>{var f;return[(f=n.image)!=null&&f.sourceUrl?(r(),l("img",{key:0,src:n.image.sourceUrl,alt:n.name,class:"w-full h-full aspect-[2/3] object-cover"},null,8,Me)):(r(),l("div",Ge,o[1]||(o[1]=[i("img",{class:"py-2 w-[120px] md:w-[240px]",src:X,alt:"EG Electronics Logo",width:"300px"},null,-1)]))),i("div",Oe,[i("h3",je,_(n.name),1),i("div",{class:"text-white line-clamp-2 category-card-ingress",innerHTML:n.description},null,8,Be)])]}),_:2},1032,["to"]))),128))])):t(N).length>0?(r(),l("div",Fe,[o[2]||(o[2]=i("div",{class:"w-full",style:{height:"1px",background:"#e6e6e6"}},null,-1)),i("div",Ue,[i("p",He,[i("span",Je,_(t(g)("showing")),1),M(" "+_(t(N).length)+" "+_(t(g)("productsCount")),1)]),i("div",Re,[(r(!0),l(G,null,O(t(N),n=>(r(),C(we,{key:n.id,product:n},null,8,["product"]))),128))]),t(E)?(r(),l("div",qe,[i("button",{onClick:re,disabled:t($),class:"px-6 py-3 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors disabled:opacity-50"},_(t($)?t(g)("loading"):t(g)("loadMoreProducts")),9,ze)])):D("",!0)])])):t(x)?(r(),l("div",Ve,_(t(g)("noProductsInCategory")),1)):D("",!0),(r(!0),l(G,null,O(t(U),(n,f)=>(r(),l("div",{key:f,class:"mb-12"},[t(F)(n.name)?(r(),C($e(t(F)(n.name)),{key:0,attributes:n},null,8,["attributes"])):D("",!0)]))),128))])}}}),at=he(Ke,[["__scopeId","data-v-e512f2d2"]]);export{at as default};

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.