1import{am as H,b as t,c as m,I as $,L as y,v as S,h as K,aQ as q,aR as Q,av as A,aS as Y,S as M,aK as j,aT as G,aU as z,aV as J,aW as F,Q as W,ag as X,aX as Z,K as o,aY as ee,aZ as te,a_ as ae,k as D,B as re,a$ as ie,b0 as le,b1 as ne,b2 as oe,b3 as w,b4 as se,f as B,T as ce}from"./chunk-B4Ec8uus.js";import{a as de,M as me}from"./chunk-DFYZ4Q0p.js";import"./chunk-CgNRPQuy.js";import"./chunk-D60WeaoM.js";import"./chunk-DpL4rtn9.js";const pe=({label:s,description:e,validTo:r,className:n})=>{const a=H(r);return t("div",{className:m("relative flex items-center gap-3 rounded-xl border border-blue-30 bg-blue-10 p-3",n),children:[t($,{name:"Tag",size:"m",className:"flex-none self-start fill-blue-60"}),t("div",{className:"flex-1 pr-2 text-sm/snug text-blue-100",children:[t("p",{className:"mb-0.5 font-semibold",children:s}),e&&t("p",{children:e}),t("p",{className:"mt-0.5",children:`Platnost vypršà ${a}`})]})]})},R=({months:s,amount:e,discounted:r,useCurrency2:n=!1})=>{const a=s,d=n&&y?y(e??0):S(e??0);return t("div",{className:m(r&&"text-red-80","w-full text-sm font-semibold"),children:`nebo ${a} Äasy ${d}`})},U=s=>{var b,l,g;const{variant:e}=s,{pagePropsClient:r,project:n,activeSeason:a,requestData:d,user:p}=K(),h=q(),c=Q()<=((h==null?void 0:h.getFeatureValue("filter-delivery-before-christmas-days",0))??0),u={variant:e,clickSource:e.clickSource??A.ClickSource.SOURCE_DETAIL},{active:N,detailLinkAttributes:i}=Y(u),k=!!((a==null?void 0:a.type)===M.BlackFriday&&(a!=null&&a.tagEshopIds.includes(e.eshop.id))),f=(a==null?void 0:a.type)===M.BlackFriday&&e.voucher||k&&e.discount,C=e.inStock||e.freeShipping||c||!!e.deliveryPrice||!!e.coolingOffPeriod||!!e.deliveryInDays||f,x=j(n.domain,e.id,e.clickSource??A.ClickSource.SOURCE_DETAIL,{...r.clickDataParameters,ri:d.requestId,position:2});return t("div",{className:m(le,"rounded-xl bg-white"),children:[t(G,{id:e.id,clickSource:e.clickSource??0,categoryId:((b=e.category)==null?void 0:b.id)??null,dataLayer:e.dataLayer}),(p==null?void 0:p.adminModeEnabled)&&t(z,{componentName:"VariantAdminMode",className:"p-2",children:t(J,{variantId:e.id,eshopName:e.eshop.name,clickSource:e.clickSource??A.ClickSource.SOURCE_DETAIL,variantDetailHref:i.href,adminModeData:e.adminMode})}),t("div",{className:"relative border-b border-gray-30 p-2",children:[t("div",{className:"flex items-center gap-2",children:[t("h3",{className:"text-base font-semibold leading-tight text-gray-100",children:t("a",{href:x,target:"_blank",className:F,children:e.eshop.name})}),e.eshopScore&&t("a",{href:W("frontend@star_eshop_reviews",{slug:e.eshop.slug}),children:t(X,{size:"small",rating:((l=e.eshopScore.scores.total)==null?void 0:l.value)??((g=e.eshopScore.scores.general)==null?void 0:g.value)??void 0})}),e.hasDeliveries&&t("button",{className:m(Z,"order-3 ml-auto flex cursor-pointer items-center gap-1 self-start","text-sm font-medium leading-tight text-gray-80"),"data-modal-open-props":JSON.stringify([e.id]),title:"VÃce informacÃ",children:["VÃce informacÃ",t($,{name:"Info",className:"size-5 fill-current"})]})]}),C&&t("div",{className:m("mt-1 flex flex-wrap items-center gap-y-1",'*:after:mx-1.5 *:after:content-["·"] last-of-type:*:after:content-none only-of-type:*:after:content-none'),children:[f&&t(o,{label:"Black Friday",color:"text-only",tagSize:"text-only"}),c?t(o,{label:"DoruÄenà do Vánoc",color:"text-only",tagSize:"text-only"}):e.inStock&&t(o,{label:"Skladem",color:"text-only",tagSize:"text-only"}),e.freeShipping&&t(o,{label:"Doprava zdarma",color:"text-only",tagSize:"text-only"}),!e.freeShipping&&!!e.deliveryPrice&&t(o,{label:ee(e.deliveryPrice,e.hasDeliveries),color:"text-only",tagSize:"text-only"}),!!e.deliveryInDays&&t(o,{label:te(e.deliveryInDays),color:"text-only",tagSize:"text-only"}),!!e.coolingOffPeriod&&t(o,{label:ae(e.coolingOffPeriod),color:"text-only",tagSize:"text-only"})]})]}),t("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 p-2",children:[t("div",{className:"mr-auto",children:[!!e.discount&&t(o,{color:"red",tagSize:18,label:`-${Math.floor(e.discount.discount)} %`,className:"mb-1"}),t("div",{className:"flex items-center gap-2",children:[t("span",{className:m("text-lg font-semibold leading-tight",e.discount?"text-red-80":"text-gray-100"),children:S(e.price.price)}),e.price.priceBeforeDiscount&&t("span",{className:"text-sm font-medium leading-tight text-gray-80 line-through",children:S(e.price.priceBeforeDiscount)})]}),!!e.price.installmentAmount&&!!e.price.installmentMonths&&t(R,{months:e.price.installmentMonths,amount:e.price.installmentAmount,discounted:!!e.discount&&!!e.price.priceBeforeDiscount}
1),y&&t(D,{children:[t("div",{className:"flex items-center gap-2",children:[t("span",{className:m("text-lg font-semibold leading-tight",e.discount?"text-red-80":"text-gray-100"),children:y(e.price.price)}),e.price.priceBeforeDiscount&&t("span",{className:"text-sm font-medium leading-tight text-gray-80 line-through",children:y(e.price.priceBeforeDiscount)})]}),!!e.price.installmentAmount&&!!e.price.installmentMonths&&t(R,{months:e.price.installmentMonths,amount:e.price.installmentAmount,discounted:!!e.discount&&!!e.price.priceBeforeDiscount,useCurrency2:!0})]})]}),t(re,{as:"a",href:x,target:"_blank",buttonSize:"m",buttonType:"primary",className:m(F,"lg:min-w-min lg:max-w-[40%] lg:flex-1"),children:"Do obchodu"}),e.voucher&&N&&t(z,{componentName:"VoucherCodeCard",className:"w-full flex-none",children:t(ie,{className:"w-full",type:"variantCard",promotion:e.voucher})}),e.promoAction&&t(pe,{label:e.promoAction.name,description:e.promoAction.description,validTo:e.promoAction.validTo,className:"w-full flex-none"})]})]})},xe=s=>{const{aggregateOffer:e,alternativeVariants:r,onClose:n}=s,a=S(e.lowPrice),d=S(e.highPrice),p=a===d?ne(a,e.offerCount):oe(a,d,e.offerCount),h=w.value,c=()=>{w.value=!1,n==null||n()};return t(me,{id:se,title:`NabÃdky (${r.length})`,open:h,onClose:c,modalSize:de.Small,children:[e&&t("p",{className:"mb-3 mt-4 font-medium leading-tight text-gray-100",children:[p,":"]}),t(he,{alternativeVariants:r})]})},he=s=>{const{alternativeVariants:e}=s,[r,n]=B(!1),[a,d]=B(!1),p=r||a,{allVariants:h,inStockVariants:c,freeDeliveryVariants:u}=ce(()=>{const i=l=>{l.sort(function(g,v){var E,I,V,T,P,_,O,L;return g.price.price===v.price.price?(((I=(E=v.eshopScore)==null?void 0:E.scores.total)==null?void 0:I.value)??((T=(V=v.eshopScore)==null?void 0:V.scores.general)==null?void 0:T.value)??0)-(((_=(P=g.eshopScore)==null?void 0:P.scores.total)==null?void 0:_.value)??((L=(O=g.eshopScore)==null?void 0:O.scores.general)==null?void 0:L.value)??0):g.price.price-v.price.price})},[k,...f]=e;i(f);const C=[k,...f],x=e.filter(l=>!a&&l.inStock||a&&l.freeShipping&&l.inStock),b=e.filter(l=>!r&&l.freeShipping||r&&l.inStock&&l.freeShipping);return{allVariants:C,inStockVariants:x,freeDeliveryVariants:b}},[e,r,a]),N=h.filter(i=>(!r||i.inStock)&&(!a||i.freeShipping));return t(D,{children:[(!!c.length||!!u.length)&&t("div",{className:"my-3 flex gap-2",children:[t(o,{color:r?"brown":"brown-10",close:r,tagSize:32,label:t(D,{children:["Skladem","Â (",c.length,")"]}),as:"button",disabled:!c.length,onClick:()=>!!c.length&&n(i=>!i)}),t(o,{color:a?"brown":"brown-10",close:a,tagSize:32,label:t(D,{children:["Doprava zdarma","Â (",u.length,")"]}),as:"button",disabled:!u.length,onClick:()=>!!u.length&&d(i=>!i)})]}),t("div",{className:"mb-4 flex flex-col gap-2 rounded-2xl bg-gray-20 p-2",children:p?N.map(i=>t(U,{variant:i},i.id)):e.map(i=>t(U,{variant:i},i.id))})]})};export{xe as DetailOffersModal};
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.