import{_ as N}from"./Image.e40f281f.js";import{_ as L}from"./nuxt-link.0da3f327.js";import{o as t,c as o,a as e,q as $,v as S,x as w,y as C,g as r,F as p,h,d as y,b as B,w as A,t as b,i as k,a8 as P,z as R,C as I,B as M,r as V,j as E,R as q,D as z}from"./entry.e017eb4f.js";import{r as T}from"./ShoppingBagIcon.938b35df.js";function D(n,x){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"})])}function O(n,x){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})])}const F=["onClick"],U=["onClick"],Z={key:2,"aria-live":"assertive",class:"pointer-events-none fixed z-50 inset-x-0 bottom-0 flex items-end px-4 py-6 sm:items-start sm:p-6"},H={class:"flex w-full flex-col items-center space-y-4 sm:items-end"},J={key:0,class:"pointer-events-auto flex w-full max-w-md divide-x divide-gray-200 rounded-lg bg-white shadow-lg ring-4 ring-sd-blue ring-opacity-10"},K={class:"flex w-0 flex-1 items-center p-4"},W={class:"w-full"},G=e("p",{class:"text-sm font-medium text-gray-900"}," Erfolgreich hinzugefügt ",-1),Q={key:0,class:"mt-1 text-sm text-gray-500"},X={class:"flex"},Y={class:"flex flex-col divide-y divide-gray-200"},ee={class:"flex h-0 flex-1"},te={class:"flex h-0 flex-1"},se=["onClick"],oe={__name:"CartButton",props:{product:{type:Object,required:!0},isAccessory:{type:Boolean,default:!1},isList:{type:Boolean,default:!1},isConfigurator:{type:Boolean,default:!1},specs:{type:Object,default:()=>({})}},emits:["refresh"],setup(n,{emit:x}){const g=n,l=$(!1),_=$(!1),u=S("cart",()=>[]),m=w(()=>{var a;return(a=u.value)==null?void 0:a.length}),v=w(()=>(g.isAccessory?"accessory-":"")+g.product.id),i=w(()=>{var a;return!!((a=u.value)!=null&&a.find(f=>f.id===v.value))});function c(){var a,f;if(i.value){const s=(a=u.value)==null?void 0:a.findIndex(j=>j.id===v.value);(f=u.value)==null||f.splice(s,1)}else u.value.push({id:v.value,quantity:1,specs:g.specs}),l.value=!0,setTimeout(()=>{_.value=!0},50);localStorage.setItem("cart",JSON.stringify(u.value)),x("refresh",g.product)}function d(){_.value=!1,setTimeout(()=>{l.value=!1},800)}return(a,f)=>{const s=L;return t(),o(p,null,[n.isList?(t(),o("button",{key:0,type:"button",class:"flex items-center justify-center rounded-md bg-white border border-gray-300 px-3 py-2 text-sm font-regular text-gray-700 shadow-sm hover:bg-sd-blue-light hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-600",onClick:C(c,["prevent"])},[r(i)?(t(),o(p,{key:0},[n.isConfigurator?(t(),h(r(O),{key:0,class:"h-4"})):(t(),h(r(D),{key:1,class:"h-4"}))],64)):(t(),h(r(T),{key:1,class:"h-4"}))],8,F)):(t(),o("button",{key:1,type:"submit",class:"flex max-w-xs flex-1 items-center justify-center rounded-md border border-transparent bg-sd-blue py-3 px-8 text-base font-medium text-white hover:bg-sd-blue-light focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-50 sm:w-full",onClick:C(c,["prevent"])},[r(i)?(t(),o(p,{key:0},[y(" Aus Angebotskorb entfernen ")],64)):(t(),o(p,{key:1},[y(" In den Angebotskorb ")],64))],8,U)),r(l)?(t(),o("div",Z,[e("div",H,[B(P,{"enter-active-class":"transform ease-out duration-300 transition","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:A(()=>[r(_)?(t(),o("div",J,[e("div",K,[e("div",W,[G,r(m)?(t(),o("p",Q," Sie haben nun "+b(r(m))+" "+b(r(m)===1?"Produkt":"Produkte")+" in Ihrem Angebotskorb ",1)):k("",!0)])]),e("div",X,[e("div",Y,[e("div",ee,[B(s,{to:"/konfigurator",class:"flex w-full items-center justify-center rounded-none rounded-tr-lg border border-transparent px-4 py-3 text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:z-10 focus:outline-none focus:ring-2 focus:ring-indigo-500",onClick:d},{default:A(()=>[y(" Zum Angebotskorb ")]),_:1})]),e("div",te,[e("button",{type:"button",class:"flex w-full items-center justify-center rounded-none rounded-br-lg border border-transparent px-4 py-3 text-sm font-medium text-gray-700 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500",onClick:C(d,["prevent"])}," Weiter einkaufen ",8,se)])])])])):k("",!0)]),_:1})])])):k("",!0)],64)}}},ne=oe,ie={key:0,class:"flex justify-end -mt-2 mb-4"},re={class:"flex space-x-2 items-center"},ae=e("label",{for:"sort",class:"block text-sm font-medium leading-6 text-gray-900"},"Sortierung",-1),le=e("option",{value:"popular"}," Am beliebtesten ",-1),ce=e("option",{value:"price_asc"}," Preis aufsteigend ",-1),ue=e("option",{value:"price_desc"}," Preis absteigend ",-1),de=[le,ce,ue],fe={class:"aspect-w-[800] aspect-h-[533] w-full overflow-hidden rounded-lg bg-[#ECECEC] group-hover:opacity-75"},ge={key:1,class:"h-full w-full flex items-center justify-center"},me=e("span",{class:"text-gray-300 text-2xl"},"Kein Bild vorhanden",-1),pe=[me],he={class:"lg:flex lg:justify-between pt-4"},ye={class:"text-lg text-gray-900"},xe={class:"mt-2 font-medium text-gray-900"},_e=e("span",{class:"text-xs text-gray-500"},"exkl. MwSt.",-1),ve={class:"text-xs tracking-tight text-gray-700 mt-1"},be=e("span",{class:"text-xs text-gray-500"},"inkl. MwSt.",-1),ke={class:"lg:pl-8 flex flex-col space-y-2"},we=["onClick"],Ce=e("span",null,"Zubehör auswählen",-1),$e=[Ce],Be={__name:"List",props:{products:{type:Array,required:!0},isAccessory:{type:Boolean,default:!1},isConfigurator:{type:Boolean,default:!1},bigger:{type:Boolean,default:!1},sortable:{type:Boolean,default:!1}},emits:["refresh"],setup(n,{emit:x}){const g=n,l=$("popular"),_=w(()=>{const i=[...g.products];return l.value==="price_asc"?i.sort((c,d)=>c.price_net-d.price_net):l.value==="price_desc"?i.sort((c,d)=>d.price_net-c.price_net):i});function u(){z().push("/versand-und-bereitstellungskosten")}function m(i){x("refresh",i)}function v(i){z().push({path:"/produkt/"+i.slug,hash:"#zubehoer"})}return(i,c)=>{const d=N,a=ne,f=L;return t(),o("div",null,[n.sortable?(t(),o("div",ie,[e("div",re,[ae,R(e("select",{id:"sort","onUpdate:modelValue":c[0]||(c[0]=s=>M(l)?l.value=s:null),name:"sort",class:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6"},de,512),[[I,r(l)]])])])):k("",!0),e("div",{class:q("grid grid-cols-1 gap-y-10 gap-x-6 lg:gap-x-8 "+(n.bigger?" md:grid-cols-2 ":" sm:grid-cols-2 lg:grid-cols-3 "))},[(t(!0),o(p,null,V(r(_),s=>(t(),h(f,{key:r(l)+"-"+s.id,to:(n.isAccessory?"/zubehoer":"")+"/produkt/"+s.slug,class:"group text-sm"},{default:A(()=>[e("div",fe,[s.image?(t(),h(d,{key:0,src:("useRuntimeConfig"in i?i.useRuntimeConfig:r(E))().public.API_URL+"/storage/"+s.image,alt:s.name,class:"h-full w-full object-contain object-center",lazy:""},null,8,["src","alt"])):(t(),o("div",ge,pe))]),e("div",he,[e("div",null,[e("h3",ye,b(s.name),1),e("p",xe,[y(b(i.$currency(s.price_net))+" ",1),_e]),e("p",ve,[y(b(i.$currency(s.price_net*1.19))+" ",1),be]),e("p",{class:"text-xs tracking-tight text-gray-700 mt-0.5"},[y(" zzgl. "),e("span",{class:"cursor-pointer select-none text-blue",onClick:u}," Versand- und Bereitstellungskosten ")])]),e("div",ke,[n.isConfigurator?(t(),o(p,{key:0},[n.isAccessory?k("",!0):(t(),o("button",{key:0,type:"button",class:"flex text-center justify-center items-center rounded-md bg-sd-blue px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sd-blue-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-600",onClick:C(j=>v(s),["prevent"])},$e,8,we)),B(a,{product:s,"is-list":"","is-accessory":n.isAccessory,"is-configurator":n.isConfigurator,onRefresh:m},null,8,["product","is-accessory","is-configurator"])],64)):(t(),h(a,{key:1,product:s,"is-list":"","is-accessory":n.isAccessory,"is-configurator":n.isConfigurator,onRefresh:m},null,8,["product","is-accessory","is-configurator"]))])])]),_:2},1032,["to"]))),128))],2)])}}},Ne=Be;export{Ne as _,ne as a};