import{_ as N}from"./Dhz_wZge.js";import{_ as $}from"./BqrdUtXd.js";import{_ as C}from"./Dt4Jnt4K.js";import{_ as V}from"./C7-9Um7p.js";import{g as I,u as S}from"./D78zyg7Q.js";import{k as q,e as D,m as F,u as j,c as d,a,F as A,r as E,f as _,h as H,o as c,g as M,w as r,b as l,d as g,t as v}from"./BbaMV9vv.js";import"./Cpj98o6Y.js";const O={class:"bg-green-light -mt-20"},P={class:"container lg:px-40 px-5 lg:py-40 py-24"},Q={class:"flex justify-center"},Y={__name:"index",async setup(R){var x;let i,p;const y=I`
  {
    "entries": *[_type == "post"] | order(publishDate desc)
  }
  `;let u=q(5);const{data:o}=([i,p]=D(()=>S(y)),i=await i,p(),i),h=()=>{var n,e;if(!(u.value>((e=(n=o.value)==null?void 0:n.entries)==null?void 0:e.length)))return u.value=u.value+3},f=F(()=>{var n,e;return(e=(n=o==null?void 0:o.value)==null?void 0:n.entries)==null?void 0:e.slice(0,u.value)}),b=n=>!(n%2),k=j();return(x=window==null?void 0:window.dataLayer)==null||x.push({event:"pv",pUrl:k.fullPath,pTitle:"Tips og råd",userId:""}),(n,e)=>{const L=N,m=$,w=C,T=V;return c(),d("main",O,[a("div",P,[e[1]||(e[1]=a("h1",{class:"text-2xl lg:text-4xl font-medium"},"Tips og råd",-1)),e[2]||(e[2]=a("div",{class:"grid grid-cols-12 my-4"},[a("p",{class:"text-sm lg:text-base col-span-12 lg:col-span-7"},"Litt om Tips og råd.")],-1)),a("div",null,[a("div",null,[(c(!0),d(A,null,E(_(f),(t,B)=>(c(),M(T,{reversed:b(B),key:t.title},{image:r(()=>{var s;return[l(m,{to:`/tips/${(s=t.slug)==null?void 0:s.current}`,"aria-label":t.title},{default:r(()=>[l(L,{image:t.image,class:"rounded-xl bg-green",alt:t.title},null,8,["image","alt"])]),_:2},1032,["to","aria-label"])]}),title:r(()=>{var s;return[l(m,{to:`/tips/${(s=t.slug)==null?void 0:s.current}`},{default:r(()=>[g(v(t.title),1)]),_:2},1032,["to"])]}),text:r(()=>[g(v(t.subHeading),1)]),button:r(()=>[l(w,null,{default:r(()=>{var s;return[l(m,{to:`/tips/${(s=t.slug)==null?void 0:s.current}`},{default:r(()=>e[0]||(e[0]=[g("Les mer")])),_:2},1032,["to"])]}),_:2},1024)]),_:2},1032,["reversed"]))),128))]),a("div",Q,[_(f).length<_(o).entries.length?(c(),d("button",{key:0,onClick:h,class:"text-green-dark underline hover:no-underline mt-5"}," Last inn flere ")):H("",!0)])])])])}}};export{Y as default};
