2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{d as G,u as re,o as le,a as te,b as t,c as l,e as a,n as R,F as q,r as H,f as F,g as b,h as z,i as M,_ as T,t as E,j as ce,k as ue,l as de,w as _e,m as e,p as ve,q as d,I as B,s as me,v as ie,x as ge,y as he,z as pe,K as se,A as fe,B as x,C as ye,D as ae,E as ke,G as j,L as Q,H as be}from"./index-VWrANxEJ.js";import{R as we}from"./RateStrip-6D9PMAmS.js";import{S as ne}from"./SectionHead-J7ahFDqv.js";import{u as Ce}from"./filtersStore-UBudUsQ5.js";import{u as Se}from"./useReveal-Bux4blM-.js";import{u as Ie}from"./catalogStore-BoknsQzW.js";import{P as $e}from"./index-aiEWOmRt.js";import"./filters-BJnbPXdW.js";const Pe={key:0,class:"showcase"},xe=["onClick"],Re=["src"],ze={key:0,class:"showcase__dots"},Ae=["aria-label","onClick"],oe=.18,De=6,Be=G({__name:"ShowcaseSlider",props:{slides:{}},emits:["select"],setup(r,{emit:g}){const h=r,A=g,c=z(0);let u;const f=re();function P(o){c.value=o,$()}function $(){u&&clearInterval(u),h.slides.length>1&&!f.isReducedMotion&&(u=setInterval(()=>{c.value=(c.value+1)%h.slides.length},6e3))}le($),te(()=>{u&&clearInterval(u)});const y=z(null),k=z(!1),v=z(0);let m=null,w=0,L=0,D=0,I=!1;function Y(o){var p;if(h.slides.length<2||m!==null)return;const _=y.value;_&&(m=o.pointerId,w=o.clientX,L=o.clientY,D=_.getBoundingClientRect().width||1,v.value=0,k.value=!0,I=!1,(p=_.setPointerCapture)==null||p.call(_,o.pointerId))}function O(o){if(!k.value||o.pointerId!==m)return;const _=o.clientX-w,p=o.clientY-L;!I&&Math.abs(_)>Math.abs(p)&&Math.abs(_)>De&&(I=!0),I&&(v.value=_)}function N(){if(!k.value)return;const _=v.value/D;k.value=!1,m=null,v.value=0,_<=-oe&&c.value<h.slides.length-1?c.value++:_>=oe&&c.value>0&&c.value--,I&&$(),I=!1}function K(o){o.pointerId===m&&N()}function X(o){o.pointerId===m&&(k.value=!1,m=null,v.value=0,I=!1)}function W(o){I||A("select",o)}const J=M(()=>{const o=-c.value*100,_=D?v.value/D*100:0;return{transform:`translate3d(${o+_}%, 0, 0)`,transition:k.value?"none":void 0}});return te(()=>{if(m!==null&&y.value)try{y.value.releasePointerCapture(m)}catch{}}),(o,_)=>r.slides.length?(t(),l("section",Pe,[a("div",{ref_key:"root",ref:y,class:F(["showcase__frame",{"is-dragging":k.value}]),onPointerdown:Y,onPointermove:O,onPointerup:K,onPointercancel:X},[a("div",{class:"showcase__track",style:R(J.value)},[(t(!0),l(q,null,H(r.slides,(p,V)=>(t(),l("article",{key:p.key,class:F(["showcase__slide",{"is-active":V===c.value}]),onClick:U=>W(p)},[p.image?(t(),l("img",{key:0,src:p.image,alt:"",class:"showcase__art",draggable:"false"},null,8,Re)):b("",!0)],10,xe))),128))],4)],34),r.slides.length>1?(t(),l("div",ze,[(t(!0),l(q,null,H(r.slides,(p,V)=>(t(),l("button",{key:p.key,type:"button",class:F(["showcase__dot",{"is-active":V===c.value}]),"aria-label":p.title,onClick:U=>P(V)},null,10,Ae))),128))])):b("",!0)])):b("",!0)}}),Me=T(Be,[["__scopeId","data-v-90ab1328"]]),Fe={class:"rail no-scrollbar"},Le=["onClick"],Oe={class:"rail__mark","aria-hidden":"true"},Ve=["src"],Ee={class:"rail__title"},Xe=G({__name:"CategoryRail",props:{categories:{},activeId:{}},emits:["select"],setup(r,{emit:g}){const h=g;return(A,c)=>(t(),l("div",Fe,[(t(!0),l(q,null,H(r.categories,u=>{var f;return t(),l("button",{key:u.id,type:"button",class:F(["rail__chip",{"is-active":u.id===r.activeId}]),onClick:P=>h("select",u)},[a("span",Oe,[(f=u.icon)!=null&&f.image?(t(),l("img",{key:0,src:u.icon.image,alt:""},null,8,Ve)):b("",!0)]),a("span",Ee,E(u.title),1)],10,Le)}),128))]))}}),qe=T(Xe,[["__scopeId","data-v-b38bbeb0"]]),He={class:"card__art"},Ye=["alt"],Ne={key:0,class:"card__badge"},Ue={class:"card__body"},je={class:"card__title"},Ge={class:"card__meta"},Te={class:"card__weight"},Ke={key:0,class:"card__wage"},We=G({__name:"ShowcaseCard",props:{value:{},wide:{type:Boolean},badge:{}},emits:["open"],setup(r,{emit:g}){const h=r,A=g,c=ce(),{image:u,id:f,title:P,min_gram:$,wage:y}=ue(h.value),k=M(()=>{const v=y.value;return v==null?"":v%1===0?String(v):v.toFixed(2)});return(v,m)=>{const w=de("lazy");return t(),l("article",{class:F(["card",{"card--wide":r.wide}]),"data-product-origin":"",onClick:m[1]||(m[1]=L=>A("open",r.value))},[a("di
|