import{o as C}from"./primevue-9Ou1e4kv.js";import{u as F}from"./useUtils-C1CRgzon.js";import{_ as N}from"./index-nRP36lCh.js";import{a0 as p,h as i,f as t,j as a,C as A,s as _,d as x,v as z,e as n,t as o,F as D,a2 as s,x as d,A as f,B as b}from"./vendor-CI64q2To.js";const R={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P(e,r){return t(),i("svg",R,[...r[0]||(r[0]=[a("path",{fill:"currentColor",d:"M15 13h1.5v2.82l2.44 1.41l-.75 1.3L15 16.69zm4-5H5v11h4.67c-.43-.91-.67-1.93-.67-3a7 7 0 0 1 7-7c1.07 0 2.09.24 3 .67zM5 21a2 2 0 0 1-2-2V5c0-1.11.89-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2v6.1c1.24 1.26 2 2.99 2 4.9a7 7 0 0 1-7 7c-1.91 0-3.64-.76-4.9-2zm11-9.85A4.85 4.85 0 0 0 11.15 16c0 2.68 2.17 4.85 4.85 4.85A4.85 4.85 0 0 0 20.85 16c0-2.68-2.17-4.85-4.85-4.85"},null,-1)])])}const M=p({name:"mdi-calendar-clock",render:P}),Y={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T(e,r){return t(),i("svg",Y,[...r[0]||(r[0]=[a("path",{fill:"currentColor",d:"M12 16a3 3 0 0 1-3-3c0-1.12.61-2.1 1.5-2.61l9.71-5.62l-5.53 9.58c-.5.98-1.51 1.65-2.68 1.65m0-13c1.81 0 3.5.5 4.97 1.32l-2.1 1.21C14 5.19 13 5 12 5a8 8 0 0 0-8 8c0 2.21.89 4.21 2.34 5.65h.01c.39.39.39 1.02 0 1.41s-1.03.39-1.42.01A9.97 9.97 0 0 1 2 13A10 10 0 0 1 12 3m10 10c0 2.76-1.12 5.26-2.93 7.07c-.39.38-1.02.38-1.41-.01a.996.996 0 0 1 0-1.41A7.95 7.95 0 0 0 20 13c0-1-.19-2-.54-2.9L20.67 8C21.5 9.5 22 11.18 22 13"},null,-1)])])}const V=p({name:"mdi-speedometer",render:T}),U={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O(e,r){return t(),i("svg",U,[...r[0]||(r[0]=[a("path",{fill:"currentColor",d:"M12 11.5A2.5 2.5 0 0 1 9.5 9A2.5 2.5 0 0 1 12 6.5A2.5 2.5 0 0 1 14.5 9a2.5 2.5 0 0 1-2.5 2.5M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7"},null,-1)])])}const E=p({name:"mdi-map-marker",render:O}),H={class:"bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-lg transition-all h-full flex flex-col"},q={class:"relative"},G={key:0,class:"absolute top-3 left-3 bg-red-600 text-white px-2 py-1 text-xs font-bold rounded z-10"},J={class:"aspect-[4/3] relative overflow-hidden bg-gray-100"},K=["src","alt"],Q=["src","alt"],W=["alt"],X={key:2,class:"absolute bottom-3 right-3 w-10 h-10 rounded-full overflow-hidden border-2 border-white shadow-md"},Z=["src","alt"],ee={class:"p-4 pb-5 grow flex flex-col"},te={class:"flex items-start justify-between gap-2 mb-2"},ie={class:"font-bold text-gray-900 line-clamp-2 group-hover:text-primary transition-colors"},ae={class:"shrink-0 text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded font-mono"},se={class:"flex items-center flex-wrap gap-2 text-xs text-gray-500 mb-2"},oe={key:0,class:"inline-flex items-center gap-1 bg-gray-100 px-2 py-0.5 rounded"},ne={key:1,class:"bg-gray-100 px-2 py-0.5 rounded"},le={key:2,class:"inline-flex items-center gap-1 bg-gray-100 px-2 py-0.5 rounded"},re={key:1,class:"mb-2"},de={class:"mt-auto"},me={key:0,class:"pt-3 border-t border-gray-100"},ce={class:"text-xs text-gray-500 uppercase mb-1"},he={key:1,class:"pt-3 border-t border-gray-100"},ge={class:"font-medium"},ue={class:"ml-1"},xe={key:3,class:"mt-3"},ye={__name:"Box",props:{item:{type:[Object,Number],default:()=>({id:0})},isLoading:Boolean,hideCurrentBid:{type:Boolean,default:!1}},setup(e){const r=e,{mediaPathResized:y,errorImage:c,getAgentImageUrl:w,categoriesProps:h,getFormattedDateTime:v,formatNumber:k,generateItemSlug:$}=F(),B=A(()=>$(r.item.id,r.item.title));return(l,g)=>{const m=C,L=E,S=V,I=M,j=_("router-link");return t(),x(j,{to:e.isLoading?"#":{name:"Item",params:{item:B.value}},class:"block text-inherit hover:no-underline group","aria-label":e.item.title?`Se auksjon ${e.item.id}: ${e.item.title}`:void 0},{default:z(()=>[a("article",H,[a("div",q,[e.item.readyForSaleDate>0?(t(),i("div",G,o(l.$t("home.widget.box.readyForSale")),1)):n("",!0),a("div",J,[e.isLoading?(t(),x(m,{key:1,width:"100%",height:"100%",class:"absolute inset-0"})):(t(),i(D,{key:0},[e.item.thumbnail?.url?(t(),i("img",{key:0,onError:g[0]||(g[0]=(...u)=>s(c)&&s(c)(...u)),src:s(y)(e.item.thumbnail.url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",fetchpriority:"high"},null,40,K)):e.item.images?.[0]?(t(),i("img",{key:1,onError:g[1]||(g[1]=(...u)=>s(c)&&s(c)(...u)),src:s(y)(e.item.images[0].url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",fetchpriority:"high"},null,40,Q)):(t(),i("img",{key:2,src:"https://media.stadssalg.no/404.png",alt:l.$t("home.widget.box.noImage"),class:"w-full h-full object-cover",width:"400",height:"300",fetchpriority:"high"},null,8,W))],64)),e.item.exclusive&&e.item.agent?(t(),i("div",X,[a("img",{src:s(w)(e.item.agent),alt:e.item.agent,class:"w-full h-full object-cover",width:"40",height:"40",loading:"lazy"},null,8,Z)])):n("",!0)])]),a("div",ee,[e.isLoading?(t(),i("div",re,[d(m,{width:"90%",height:"1.25rem",class:"mb-2"}),d(m,{width:"40%",height:"1rem"})])):(t(),i(D,{key:0},[a("div",te,[a("h3",ie,o(e.item.title||l.$t("home.widget.box.noName")),1),a("span",ae,o(e.item.id),1)]),a("div",se,[e.item.location?(t(),i("span",oe,[d(L,{class:"text-gray-500 text-sm","aria-hidden":"true"}),f(" "+o(e.item.location),1)])):n("",!0),s(h)(e.item,1)?(t(),i("span",ne,o(s(h)(e.item,1)),1)):n("",!0),s(h)(e.item,2)?(t(),i("span",le,[e.item.mileage?(t(),x(S,{key:0,class:"text-gray-500 text-sm","aria-hidden":"true"})):n("",!0),f(" "+o(s(h)(e.item,2)),1)])):n("",!0)])],64)),a("div",de,[!e.isLoading&&!e.hideCurrentBid?(t(),i("div",me,[a("div",ce,o(l.$t("home.widget.box.highestBid")),1),a("div",{class:b(["text-lg font-bold",e.item.currentBid>0?"text-primary":"text-gray-300"])},o(e.item.currentBid>0?s(k)(e.item.currentBid)+" kr":"—"),3)])):e.isLoading?(t(),i("div",he,[d(m,{width:"100%",height:"2.5rem"})])):n("",!0),e.isLoading?e.isLoading?(t(),i("div",xe,[d(m,{width:"100%",height:"2rem",borderRadius:"8px"})])):n("",!0):(t(),i("div",{key:2,class:b(["mt-3 p-2 rounded-lg text-xs flex items-center gap-2",e.item.readyForSaleDate>0?"bg-red-50 text-red-700":"bg-gray-50 text-gray-500"])},[d(I,{class:"text-sm shrink-0","aria-hidden":"true"}),a("div",null,[a("span",ge,o(l.$t("home.widget.box.auctionDay"))+":",1),a("span",ue,o(e.item.readyForSaleDate>0?s(v)(e.item.readyForSaleDate,"LL"):"Ikke fastsatt"),1)])],2))])])])]),_:1},8,["to","aria-label"])}}},Ke=N(ye,[["__scopeId","data-v-b9f0fa99"]]),fe={class:"bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-lg transition-all flex h-[145px] sm:h-[165px]"},be={class:"relative shrink-0 w-32 sm:w-44 lg:w-48 h-full overflow-hidden bg-gray-100"},we={key:0,class:"absolute top-3 left-3 bg-red-600 text-white px-2 py-1 text-xs font-bold rounded z-10"},ve=["src","alt"],ke=["src","alt"],$e=["alt"],Be={key:3,class:"absolute bottom-3 right-3 w-10 h-10 rounded-full overflow-hidden border-2 border-white shadow-md"},Le=["src","alt"],Se={class:"grow min-w-0 p-3 sm:p-4 flex flex-col justify-between overflow-hidden"},Ie={key:0},je={class:"flex items-start justify-between gap-2 mb-1"},De={class:"font-bold text-gray-900 text-xs sm:text-base truncate group-hover:text-primary transition-colors leading-tight"},pe={class:"hidden md:block shrink-0 text-[10px] text-gray-500 bg-gray-100 px-1.5 py-0.5 rounded font-mono"},Ce={class:"flex items-center flex-wrap gap-1 sm:gap-2 text-[10px] sm:text-xs text-gray-500 mb-2"},Fe={key:0,class:"inline-flex items-center gap-1 bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap"},Ne={key:1,class:"bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap"},Ae={key:2,class:"inline-flex items-center gap-1 bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap"},_e={key:1},ze={class:"space-y-2"},Me={key:0,class:"pt-2 border-t border-gray-100"},Ve={class:"flex flex-col items-start"},Ee={class:"text-[9px] sm:text-[10px] text-gray-500 uppercase font-bold tracking-wider"},Re={key:1,class:"pt-2 border-t border-gray-100"},Pe={class:"truncate"},Ye={class:"font-bold"},Te={class:"font-semibold ml-1"},Ue={key:3},Oe={__name:"List",props:{item:{type:[Object,Number],default:()=>({id:0})},isLoading:Boolean,hideCurrentBid:{type:Boolean,default:!1}},setup(e){const r=e,{mediaPathResized:y,errorImage:c,getAgentImageUrl:w,categoriesProps:h,getFormattedDateTime:v,formatNumber:k,generateItemSlug:$}=F(),B=A(()=>$(r.item.id,r.item.title));return(l,g)=>{const m=C,L=E,S=V,I=M,j=_("router-link");return t(),x(j,{to:e.isLoading?"#":{name:"Item",params:{item:B.value}},class:"block text-inherit hover:no-underline group","aria-label":e.item.title?`Se auksjon ${e.item.id}: ${e.item.title}`:void 0},{default:z(()=>[a("article",fe,[a("div",be,[e.item.readyForSaleDate>0?(t(),i("div",we,o(l.$t("home.widget.box.readyForSale")),1)):n("",!0),e.isLoading?(t(),x(m,{key:2,width:"100%",height:"100%",class:"absolute inset-0"})):(t(),i(D,{key:1},[e.item.thumbnail?.url?(t(),i("img",{key:0,onError:g[0]||(g[0]=(...u)=>s(c)&&s(c)(...u)),src:s(y)(e.item.thumbnail.url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",fetchpriority:"high"},null,40,ve)):e.item.images?.[0]?(t(),i("img",{key:1,onError:g[1]||(g[1]=(...u)=>s(c)&&s(c)(...u)),src:s(y)(e.item.images[0].url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",fetchpriority:"high"},null,40,ke)):(t(),i("img",{key:2,src:"https://media.stadssalg.no/404.png",alt:l.$t("home.widget.box.noImage"),class:"w-full h-full object-cover",width:"400",height:"300",fetchpriority:"high"},null,8,$e))],64)),e.item.exclusive&&e.item.agent?(t(),i("div",Be,[a("img",{src:s(w)(e.item.agent),alt:e.item.agent,class:"w-full h-full object-cover",width:"40",height:"40",loading:"lazy"},null,8,Le)])):n("",!0)]),a("div",Se,[e.isLoading?(t(),i("div",_e,[d(m,{width:"80%",height:"1.25rem",class:"mb-2"}),d(m,{width:"30%",height:"0.75rem"})])):(t(),i("div",Ie,[a("div",je,[a("h3",De,o(e.item.title||l.$t("home.widget.box.noName")),1),a("span",pe,o(e.item.id),1)]),a("div",Ce,[e.item.location?(t(),i("span",Fe,[d(L,{class:"text-gray-500 text-sm","aria-hidden":"true"}),f(" "+o(e.item.location),1)])):n("",!0),s(h)(e.item,1)?(t(),i("span",Ne,o(s(h)(e.item,1)),1)):n("",!0),s(h)(e.item,2)?(t(),i("span",Ae,[e.item.mileage?(t(),x(S,{key:0,class:"text-gray-500 text-sm","aria-hidden":"true"})):n("",!0),f(" "+o(s(h)(e.item,2)),1)])):n("",!0)])])),a("div",ze,[!e.isLoading&&!e.hideCurrentBid?(t(),i("div",Me,[a("div",Ve,[a("span",Ee,o(l.$t("home.widget.box.highestBid")),1),a("span",{class:b(["text-base sm:text-xl font-black leading-tight",e.item.currentBid>0?"text-primary":"text-gray-300"])},o(e.item.currentBid>0?s(k)(e.item.currentBid)+" kr":"—"),3)])])):e.isLoading?(t(),i("div",Re,[d(m,{width:"100%",height:"2rem"})])):n("",!0),e.isLoading?e.isLoading?(t(),i("div",Ue,[d(m,{width:"100%",height:"1.5rem",borderRadius:"8px"})])):n("",!0):(t(),i("div",{key:2,class:b(["p-1.5 sm:p-2 rounded-lg sm:rounded-xl text-[9px] sm:text-[10px] flex items-center gap-1.5 sm:gap-2",e.item.readyForSaleDate>0?"bg-red-50 text-red-700":"bg-gray-50 text-gray-500"])},[d(I,{class:"text-xs sm:text-sm shrink-0","aria-hidden":"true"}),a("div",Pe,[a("span",Ye,o(l.$t("home.widget.box.auctionDay"))+":",1),a("span",Te,o(e.item.readyForSaleDate>0?s(v)(e.item.readyForSaleDate,"DD.MM.YYYY"):"Ikke fastsatt"),1)])],2))])])])]),_:1},8,["to","aria-label"])}}},Qe=N(Oe,[["__scopeId","data-v-ba1ebf99"]]);export{Ke as I,Qe as a};