const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/getBestPrice-BCuLTYaE.js","assets/bestPriceFragment-C1AoXVUX.js","assets/getMultipleBestPrices-D92KLkiC.js"])))=>i.map(i=>d[i]);
import{_ as G,A as U,ap as J,k as Q,r as c,o as n,a as m,w as g,p as o,q as l,b as u,v as f,n as I,l as y,F as T,Z as P,h as j,C as x,I as X,u as q,J as H,a7 as Y,a8 as Z,i as K,G as $,R as ee,a9 as C,N as te,O as ie,e as ae}from"./main-DHoZdmBw.js";import{C as ne}from"./CarouselSliderControlsFi-CRt14S0y.js";import{A as re}from"./AvailabilityStatus-CtiMbHse.js";import{L as se}from"./LoadingIndicatorWrapper-pVDcX3Dw.js";import{P as de}from"./PriceSavingsFi-CSqgoGfk.js";import{P as oe}from"./ProductPackageSizeFi-DOooYNnt.js";import{Q as ce}from"./QuantityModificationHintFi-BBSdjnBX.js";import{Q as le}from"./QuantityStepsUpdater-DQDhvizf.js";import{_ as ue}from"./priceCurrencyMixin-CKEVFsHP.js";import{_ as me}from"./shoppingcartMixin-DGdiTU0m.js";import{_ as fe}from"./userMixin-DTZNvHsb.js";import{d as he}from"./getRetailerAvailabilityForIds-DHQoPBVB.js";import{_ as ge}from"./trackingMixin.vue_vue_type_script_lang-Dme3gIa8.js";import"./PriceSavingsInPercentFi-CaRG3hZo.js";import"./QuantitySteps-C4blGfD3.js";import"./sellingUnitMixin-BqI7WVPQ.js";import"./login-cg-p-qv7.js";const _e={name:"ProductCategoryTileFi",components:{ArrowIcon:U,SsrCloudImageFi:J},mixins:[Q],props:{category:{type:Object,default:()=>({})},isGuidedRecommandation:{type:Boolean,default:!1}},emits:["tile-clicked"],data(){return{breakpoints:[{mediaWidth:480,imageWidth:331},{mediaWidth:767,imageWidth:404},{mediaWidth:768,imageWidth:256},{mediaWidth:1023,imageWidth:361},{mediaWidth:1440,imageWidth:300},{mediaWidth:1920,imageWidth:300}],unlimited:300}},computed:{containerTag(){return this.category.Slug&&!this.isEditMode?"a":"div"},categoryHref(){return this.category.Slug&&!this.isEditMode?this.$fischer.pages.products().url+this.category.Slug:null}},methods:{goToCategory(){if(this.$emit("tile-clicked"),this.isGuidedRecommandation)try{localStorage.setItem("recommendationClick",JSON.stringify({refererId:this.$fischer.catalogId(),guided:!0}))}catch(e){console.debug("failed to store recommendation click",e)}window.location=this.categoryHref}}},pe={class:"product-category-tile-fi__image"},ye={class:"product-category-tile-fi__info"},ve={key:0,class:"product-category-tile-fi__name"},ke={key:1,class:"product-category-tile-fi__claim"},be={class:"product-category-tile-fi__title"},Se={key:0,class:"product-category-tile-fi__badge"};function Pe(e,i,t,r,s,a){const _=c("ssr-cloud-image-fi"),d=c("arrow-icon");return n(),m(j(a.containerTag),{class:I({"product-category-tile-fi":!0,"product-category-tile-fi--teaser":t.category.Slug,"product-category-tile-fi--is-family-page-variant":t.isGuidedRecommandation,"product-category-tile-fi--has-badge":t.isGuidedRecommandation&&t.category.familyProductCount}),href:a.categoryHref,onClick:P(a.goToCategory,["stop","prevent"])},{default:g(()=>[o("div",pe,[t.category.image?(n(),m(_,{key:0,class:"product-category-tile-fi__img",src:t.category.image,alt:t.category.name,breakpoints:s.breakpoints,unlimited:s.unlimited,"aspect-ratio":16/9,trim:"",params:"func=fit"},null,8,["src","alt","breakpoints","unlimited"])):l("",!0)]),t.isGuidedRecommandation?(n(),u(T,{key:1},[o("div",be,f(t.category.name),1),t.category.familyProductCount?(n(),u("div",Se,f(e.$dict.get(t.category.familyProductCount==="1"?"search.Variants-Singular":"search.Variants-Plural",[t.category.familyProductCount])),1)):l("",!0)],64)):(n(),u(T,{key:0},[o("div",ye,[t.category.name?(n(),u("div",ve,f(t.category.name),1)):l("",!0),t.category.marketingClaim?(n(),u("div",ke,f(t.category.marketingClaim),1)):l("",!0)]),t.category.Slug?(n(),u("div",{key:0,class:I({"fi-text-21":!e.isLG,"fi-text-24":e.isLG,"product-category-tile-fi__arrow ":!0,"fi-semibold":!0})},[y(d,{class:"product-category-tile-fi__arrow-icon"})],2)):l("",!0)],64))]),_:1},8,["class","href","onClick"])}const Ce=G(_e,[["render",Pe],["__scopeId","data-v-4e6b9e87"]]),Ie=()=>H(()=>import("./getBestPrice-BCuLTYaE.js"),__vite__mapDeps([0,1])),Te={name:"ProductTileFi",components:{CloudImageFi:x,IconFi:X,LoadingIndicatorWrapper:se,PriceSavingsFi:de,AvailabilityStatus:re,QuantityStepsUpdater:le,QuantityModificationHintFi:ce,ProductPackageSizeFi:oe},mixins:[Q,me,fe,ue],inject:["fields"],props:{product:{type:Object,required:!0},outOfStock:{type:Boolean,default:!1},bestPrice:{type:Object,default:null},bestPriceLoading:{type:Boolean,default:!0},isRecommendation:{type:Boolean,default:!1},isGuidedRecommandation:{type:Boolean,default:!1}},emits:["product-added","tile-clicked"],data(){return{loading:!1,getProductListById:null,newBestPrice:null,quantityIncreasedMessage:null,quantityDataTest2:null}},computed:{isRetailConnect(){return this.$fischer.shop.isRetailConnect()},isRetailConnectCart(){return this.$fischer.shop.isRetailConnectCart()},isShop(){return(this.$fischer.shop.isClosedShop()||this.$fischer.shop.isOnlineShop())&&!this.isEditMode},productInCart(){var i;let e=!1;return(i=this.cart)!=null&&i.products&&(e=this.cart.products.some(t=>t.articleNo===this.product.id)),e},currentBestPrice(){return this.newBestPrice?this.newBestPrice:this.bestPrice},productHref(){return this.$fischer.pages.products().url+this.product.Slug},productPrice(){var e,i,t;return(e=this.product.price)!=null&&e.priceValue&&((t=(i=this.product)==null?void 0:i.price)!=null&&t.priceCurrency)?this.formatPrice(this.product.price.priceValue,this.product.price.priceCurrency):null}},created(){var e;this.$fischer.cartId()&&this.$fischer.shop.isRetailConnectCart()&&!((e=this.cart)!=null&&e.products)&&this.getCart(!1,!0)},methods:{async addProduct(e){if(await this.addProductToCart(this.isRecommendation||this.isGuidedRecommandation?{...e,disableTracking:!0}:e),this.$emit("product-added",e),!this.isRecommendation&&!this.isGuidedRecommandation&&!this.isFite)return;const i=this.$refs[`quantityStepper-${e.productID}`];let t;i&&(t=i.internalRequestedQuantity?i.internalRequestedQuantity:i.item.initialQuantity),this.sendEvent(this.isRecommendation?"recommendation_cart":"guided_recommendation_cart",{url:window?window.location.href:"",productId:e.productID,refererId:this.$fischer.catalogId(),itemQuantity:t})},async updateBestPrice(e,i){try{const t=(await Ie()).default,{data:r,error:s}=await this.$apollo.query({query:t,errorPolicy:"all",fetchPolicy:"no-cache",variables:{baseSiteId:this.$fischer.baseSiteId(),accessToken:this.$fischer.user.accessToken(),productCode:e,qty:i,language:this.$fischer.siteLanguage(),userId:this.$fischer.user.id()}});if(s)throw this.logoutIfTokenInvalid(s),new Error(s);this.newBestPrice=r.getBestPrice,this.loading=!1}catch(t){this.logoutIfTokenInvalid(t),console.error(t),this.loading=!1}},onQuantityInput(){this.loading=!0},onValueRounded(e,i){this.quantityIncreasedMessage=e,this.quantityDataTest2=i},goToProduct(e){if(this.$emit("tile-clicked"),!this.isFite&&(this.isRecommendation||this.isGuidedRecommandation)){const i=this.$refs[`quantityStepper-${e}`];let t;i&&(t=i.internalRequestedQuantity?i.internalRequestedQuantity:i.item.initialQuantity),localStorage.setItem("recommendationClick",JSON.stringify({refererId:this.$fischer.catalogId(),itemQuantity:t,guided:this.isGuidedRecommandation}))}window.location=this.productHref}}},Ne={class:"product-tile-fi__image"},we={class:"product-tile-fi__artnr"},Re={class:"product-tile-fi__name"},Fe={class:"product-tile-fi__action"},Le={key:0,class:"product-tile-fi__product-facts"},Be={class:"product-tile-fi__details"},Ee={class:"product-tile-fi__details__top"},De={class:"product-tile-fi__price-and-delivery-details"},Ve={class:"product-tile-fi__vac"},qe={class:"product-tile-fi__availability-status-container"},Me={key:0,class:"product-tile-fi__add-to-cart"},Oe={class:"product-tile-fi__quantity-stepper"},Ge={key:0,class:"product-tile-fi__add-to-cart"},Qe={key:0,class:"product-tile-fi__uvp-price"},Ae={class:"product-tile-fi__uvp-price__value","data-test":"product-price"},We={class:"product-tile-fi__uvp-price__vat"};function je(e,i,t,r,s,a){const _=c("cloud-image-fi"),d=c("price-savings-fi"),h=c("availability-status"),v=c("icon-fi"),b=c("button-fi"),L=c("quantity-steps-updater"),B=c("product-package-size-fi"),E=c("quantity-modification-hint-fi"),D=c("loading-indicator-wrapper");return n(),m(j(t.product.Slug?"a":"div"),{class:"product-tile-fi",href:a.productHref,onClick:i[5]||(i[5]=P(k=>a.goToProduct(t.product.id),["stop","prevent"]))},{default:g(()=>[o("div",Ne,[t.product.image?(n(),m(_,{key:0,src:t.product.image,alt:t.product.name,"aspect-ratio":1,trim:"",params:"func=fit",class:"product-tile-fi__img","do-not-replace-url":""},null,8,["src","alt"])):l("",!0)]),o("div",we,f(e.$dict.get("construction-Projects.Global-Labels.Article-Number",[t.product.id])),1),o("div",Re,f(t.product.name),1),o("div",Fe,[e.isFite?(n(),u(T,{key:1},[a.productPrice?(n(),u("div",Qe,[o("div",Ae,f(e.$dict.get("online-Shop.Product.UVP-Price-Prefix"))+" "+f(a.productPrice),1),o("div",We,f(e.$dict.get("online-Shop.Product.Vat-included")),1)])):l("",!0)],64)):(n(),u(T,{key:0},[a.isShop?(n(),u("div",Le,[y(D,{class:"product-tile-fi__loading-indicator",loading:t.bestPriceLoading||s.loading,onClick:i[3]||(i[3]=P(()=>{},["stop","prevent"]))},{default:g(()=>{var k;return[o("div",Be,[o("div",Ee,[o("div",De,[y(d,{class:"product-tile-fi__price","best-price":a.currentBestPrice,theme:"product-list-view","hide-savings-in-percent":"","stroke-price-absolute":""},null,8,["best-price"]),o("div",Ve,f(e.$dict.get("online-Shop.Product.Vat-excluded")),1),o("div",qe,[t.bestPriceLoading?l("",!0):(n(),m(h,{key:0,class:I({"product-tile-fi__availability-status":!0,"fi-mt-9":!a.currentBestPrice}),"delivery-speed":a.currentBestPrice?a.currentBestPrice.deliverySpeed:"NODELIVERY","stock-levels":((k=a.currentBestPrice)==null?void 0:k.stockLevels)||null,theme:"product-list-view","show-status-text":"","disable-tooltip":""},null,8,["class","delivery-speed","stock-levels"]))])]),!t.bestPriceLoading&&e.isSM?(n(),u("div",Me,[y(b,{"data-productid":t.product?t.product.id:null,"data-productname":t.product?`${t.product.id} - ${t.product.name}`:null,disabled:!t.bestPrice||e.isAddingItemToCart[t.product.id]||t.outOfStock,type:"button",class:"button-fi__primary button-fi__icon product-tile-fi__action-button product-tile-fi__action-button--onlineShop","data-test":"product-tile-add-to-cart","data-test-2":!t.bestPrice||e.isAddingItemToCart[t.product.id]||t.outOfStock?"product-tile-add-to-cart-disabled":null,onClick:i[0]||(i[0]=P(S=>a.addProduct({productID:t.product.id,productRequestedQuantity:a.currentBestPrice.requestedQuantity}),["stop","prevent"]))},{default:g(()=>[y(v,{class:"product-tile-fi__action-button__icon",icon:"shopping-cart",color:"white"})]),_:1},8,["data-productid","data-productname","disabled","data-test-2"])])):l("",!0)]),o("div",Oe,[a.currentBestPrice?(n(),m(L,{ref:`quantityStepper-${t.product.id}`,key:t.product.id,item:a.currentBestPrice,"requested-quantity":0,"auto-width":"",onUpdateQuantity:i[1]||(i[1]=S=>a.updateBestPrice(t.product.id,S)),onQuantityInput:a.onQuantityInput,onValueRounded:a.onValueRounded},null,8,["item","onQuantityInput","onValueRounded"])):l("",!0),y(B,{class:"product-tile-fi__base-price",item:a.currentBestPrice,"align-right":""},null,8,["item"]),s.quantityIncreasedMessage?(n(),m(E,{key:1,class:"product-tile-fi__quantity-modification-hint",hint:s.quantityIncreasedMessage,"data-test-2":s.quantityDataTest2,icon:"info",theme:"product-tile-fi"},null,8,["hint","data-test-2"])):l("",!0)])]),!t.bestPriceLoading&&!e.isSM?(n(),u("div",Ge,[y(b,{"data-productid":t.product?t.product.id:null,"data-productname":t.product?`${t.product.id} - ${t.product.name}`:null,disabled:!t.bestPrice||e.isAddingItemToCart[t.product.id]||t.outOfStock,type:"button",class:"button-fi__primary button-fi--stretched product-tile-fi__action-button product-tile-fi__action-button--onlineShop","data-test":"product-tile-add-to-cart",onClick:i[2]||(i[2]=P(S=>a.addProduct({productID:t.product.id,productRequestedQuantity:a.currentBestPrice.requestedQuantity}),["stop","prevent"]))},{default:g(()=>[q(f(e.$dict.get("online-Shop.Product-Teaser.Button-Add-To-Cart")),1)]),_:1},8,["data-productid","data-productname","disabled"])])):l("",!0)]}),_:1},8,["loading"])])):a.isRetailConnectCart?(n(),m(b,{key:1,"data-productid":t.product?t.product.id:null,"data-productname":t.product?`${t.product.id} - ${t.product.name}`:null,disabled:a.productInCart||e.isAddingItemToCart[t.product.id]||t.outOfStock,"data-test":"product-tile-add-to-cart",type:"button",class:"button-fi__primary button-fi--stretched product-tile-fi__action-button product-tile-fi__action-button--retailConnectCart",onClick:i[4]||(i[4]=P(k=>a.addProduct({productID:t.product.id}),["stop","prevent"]))},{default:g(()=>[q(f(e.$dict.get("online-Shop.Product-Teaser.Button-Add-To-Cart")),1)]),_:1},8,["data-productid","data-productname","disabled"])):(n(),m(b,{key:2,"data-productid":t.product?t.product.id:null,"data-productname":t.product?`${t.product.id} - ${t.product.name}`:null,"data-test":"product-tile-to-cart",type:"button",class:"button-fi__primary button-fi--stretched product-tile-fi__action-button product-tile-fi__action-button--retailConnect"},{default:g(()=>[q(f(e.$dict.get("online-Shop.Product-Teaser.Button-Product-Text")),1)]),_:1},8,["data-productid","data-productname"]))],64))])]),_:1},8,["href"])}const He=G(Te,[["render",je],["__scopeId","data-v-1e81d275"]]);var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getProductCategoryListById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"channel"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CatalogChannel"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"language"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ids"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getProductCategoryListById"},arguments:[{kind:"Argument",name:{kind:"Name",value:"channel"},value:{kind:"Variable",name:{kind:"Name",value:"channel"}}},{kind:"Argument",name:{kind:"Name",value:"language"},value:{kind:"Variable",name:{kind:"Name",value:"language"}}},{kind:"Argument",name:{kind:"Name",value:"ids"},value:{kind:"Variable",name:{kind:"Name",value:"ids"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"marketingClaim"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Slug"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"familyProductCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"CategoryRole"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"CategoryDisplayNamePath"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:305}};R.loc.source={body:`query getProductCategoryListById($channel: CatalogChannel!, $language: String!, $ids: String!){
  getProductCategoryListById(channel: $channel, language: $language, ids: $ids){
    id
    name
    image
    marketingClaim
    Slug
    familyProductCount
    CategoryRole
    CategoryDisplayNamePath
  }
}
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function N(e,i){if(e.kind==="FragmentSpread")i.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&i.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(r){N(r,i)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(r){N(r,i)}),e.definitions&&e.definitions.forEach(function(r){N(r,i)})}var M={};(function(){R.definitions.forEach(function(i){if(i.name){var t=new Set;N(i,t),M[i.name.value]=t}})})();function A(e,i){for(var t=0;t<e.definitions.length;t++){var r=e.definitions[t];if(r.name&&r.name.value==i)return r}}function ze(e,i){var t={kind:e.kind,definitions:[A(e,i)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var r=M[i]||new Set,s=new Set,a=new Set;for(r.forEach(function(d){a.add(d)});a.size>0;){var _=a;a=new Set,_.forEach(function(d){if(!s.has(d)){s.add(d);var h=M[d]||new Set;h.forEach(function(v){a.add(v)})}})}return s.forEach(function(d){var h=A(e,d);h&&t.definitions.push(h)}),t}ze(R,"getProductCategoryListById");var F={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getProductListById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"channel"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CatalogChannel"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"language"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ids"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getProductListById"},arguments:[{kind:"Argument",name:{kind:"Name",value:"channel"},value:{kind:"Variable",name:{kind:"Name",value:"channel"}}},{kind:"Argument",name:{kind:"Name",value:"language"},value:{kind:"Variable",name:{kind:"Name",value:"language"}}},{kind:"Argument",name:{kind:"Name",value:"ids"},value:{kind:"Variable",name:{kind:"Name",value:"ids"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"marketingClaim"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Slug"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"CategoryDisplayNamePath"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"price"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"priceValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"priceCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"priceString"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:322}};F.loc.source={body:`query getProductListById($channel: CatalogChannel!, $language: String!, $ids: String!){
  getProductListById(channel: $channel, language: $language, ids: $ids){
    id
    name
    image
    marketingClaim
    Slug
    CategoryDisplayNamePath
    price {
      priceValue
      priceCurrency
      priceString
    }
  }
}
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function w(e,i){if(e.kind==="FragmentSpread")i.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&i.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(r){w(r,i)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(r){w(r,i)}),e.definitions&&e.definitions.forEach(function(r){w(r,i)})}var O={};(function(){F.definitions.forEach(function(i){if(i.name){var t=new Set;w(i,t),O[i.name.value]=t}})})();function W(e,i){for(var t=0;t<e.definitions.length;t++){var r=e.definitions[t];if(r.name&&r.name.value==i)return r}}function Ue(e,i){var t={kind:e.kind,definitions:[W(e,i)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var r=O[i]||new Set,s=new Set,a=new Set;for(r.forEach(function(d){a.add(d)});a.size>0;){var _=a;a=new Set,_.forEach(function(d){if(!s.has(d)){s.add(d);var h=O[d]||new Set;h.forEach(function(v){a.add(v)})}})}return s.forEach(function(d){var h=W(e,d);h&&t.definitions.push(h)}),t}Ue(F,"getProductListById");const Je=()=>H(()=>import("./getMultipleBestPrices-D92KLkiC.js"),__vite__mapDeps([2,1])),xe={name:"ProductTeasersFi",components:{CarouselFi:Y,CarouselSlideFi:Z,CarouselSliderControlsFi:ne,ComponentWrapper:K,GridContainerFi:$,RichtextFi:ee,ProductTileFi:He,ProductCategoryTileFi:Ce},mixins:[Q,ge],inject:["fields"],props:{customFields:{type:Object,default:()=>({})},light:{type:Boolean,default:!1},isRecommendation:{type:Boolean,default:!1},isGuidedRecommandation:{type:Boolean,default:!1},showVariantsCount:{type:Boolean,default:!1}},emits:["product-added"],data(){return{getProductListById:null,bestPrices:{},bestPriceLoading:!0,changesCount:0,catalogData:null,GET_MULTIPLE_BEST_PRICES:null,isMounted:!1,carouselRef:null}},computed:{isVariant(){return this.currentFields.productList},isStandaloneVariant(){return Object.keys(this.customFields).length===0},currentFields(){return this.isStandaloneVariant?this.fields:this.customFields},productIds(){var e,i;return((i=(e=this.currentFields.productList)==null?void 0:e.value)==null?void 0:i.split("|"))||[]},familyIds(){var e;return((e=this.currentFields.familyList)==null?void 0:e.value)&&this.currentFields.familyList.value.split("|")||[]},productQuery(){return this.productIds.map(e=>({qty:0,productCode:e}))},showContent(){var e,i;return this.isRecommendation||(e=this.currentFields.hideContent)!=null&&e.value?!1:((i=this.currentFields.content)==null?void 0:i.value)||this.isEditMode},sliderSettings(){return{rewind:!1,pagination:!1,perPage:1,perMove:1,destroy:!1,gap:24,noDrag:"input, .no-drag",breakpoints:{[C.xs]:{perPage:1,destroy:!1},[C.sm]:{perPage:2,destroy:!1},[C.md]:{perPage:3,destroy:!1},[C.lg]:{perPage:this.showContent?2:4,destroy:!1},[C.xl]:{perPage:this.showContent?3:5,destroy:!1}}}},visibleSlidesCount(){return this.isXL?this.showContent?3:5:this.isLG?this.showContent?2:4:this.isMD?3:this.isSM?2:1},isSlider(){var e;return this.isMounted?((e=this.catalogData)==null?void 0:e.length)>this.visibleSlidesCount:!1},isRetailConnectCart(){return this.$fischer.shop.isRetailConnectCart()},isShop(){return this.$fischer.shop.isClosedShop()||this.$fischer.shop.isOnlineShop()},retailerOutOfStock(){return(this.getRetailerAvailabilityForIds||[]).map(e=>e?e.stock==="empty"||e.stock===null:!1)}},watch:{catalogData(){this.changesCount+=1}},mounted(){this.isMounted=!0,Je().then(e=>{this.GET_MULTIPLE_BEST_PRICES=e.default})},apollo:{getProductCategoryListById:{query:R,errorPolicy:"all",variables(){return{language:this.$fischer.catalogLocale(),ids:this.familyIds.join(","),channel:this.$fischer.brandId()}},skip(){var e;return!((e=this.familyIds)!=null&&e.length)},result({data:e}){e!=null&&e.getProductCategoryListById&&(this.catalogData=e.getProductCategoryListById)},error(){this.error=!0}},getProductListById:{query:F,errorPolicy:"all",variables(){return{baseSiteId:this.$fischer.baseSiteId(),channel:this.$fischer.brandId(),language:this.$fischer.catalogLocale(),accessToken:this.$fischer.user.accessToken(),userId:this.$fischer.user.id(),ids:this.productIds.join(",")}},skip(){var e;return!((e=this.productIds)!=null&&e.length)},result({data:e}){e!=null&&e.getProductListById&&(this.catalogData=e.getProductListById)},error(){this.error=!0}},getMultipleBestPrices:{query(){return this.GET_MULTIPLE_BEST_PRICES},errorPolicy:"all",variables(){return{baseSiteId:this.$fischer.baseSiteId(),language:this.$fischer.siteLanguage(),userId:this.$fischer.user.id(),accessToken:this.$fischer.user.accessToken(),queries:this.productQuery}},result({data:e}){if(!(e!=null&&e.getMultipleBestPrices)){console.error("Did not receive best prices");return}e.getMultipleBestPrices.forEach(i=>{i&&(this.bestPrices[i.productCode]=i)}),this.bestPriceLoading=!1},skip(){return!this.GET_MULTIPLE_BEST_PRICES||!this.getProductListById||!this.isShop||this.isFite||this.isEditMode},error(){this.error=!0,this.bestPriceLoading=!1}},getRetailerAvailabilityForIds:{query:he,variables(){return{baseSiteId:this.$fischer.baseSiteId(),productIds:this.productIds,useGtins:this.$fischer.useGtins()}},skip(){return!this.isRetailConnectCart||this.productIds.length===0}}},methods:{onIntersect(){this.trackViewItemList(this.catalogData)}}},Xe={class:"product-teasers-fi__products"},Ye={class:"product-teasers-fi__products-wrapper"},Ze={key:0,class:"product-teasers-fi__products__head"},Ke={key:0,class:"product-teasers-fi__products__headline","data-test":"product-teasers-headline"},$e=["innerHTML"],et={class:"product-teasers-fi__slider-controls"},tt={class:"product-teasers-fi__slide"},it={key:0,class:"product-teasers-fi__content"},at={class:"product-teasers-fi__content-container"};function nt(e,i,t,r,s,a){const _=c("carousel-slider-controls-fi"),d=c("product-tile-fi"),h=c("product-category-tile-fi"),v=c("carousel-slide-fi"),b=c("carousel-fi"),L=c("richtext-fi"),B=c("grid-container-fi"),E=c("component-wrapper"),D=te("intersect");return n(),m(E,{class:I({"product-teasers-fi":!0,"product-teasers-fi--light":t.light,"product-teasers-fi--content":a.showContent})},{default:g(()=>[y(B,{"grid-class":"fi-gap-zero md:fi-gap-zero lg:fi-gap-large"},{default:g(()=>{var k,S;return[o("div",Xe,[o("div",Ye,[a.isSlider||(k=a.currentFields.headline)!=null&&k.value||e.isEditMode?(n(),u("div",Ze,[e.isEditMode?l("",!0):(n(),u("div",Ke,f(a.currentFields.headline.value),1)),e.isEditMode?(n(),u("div",{key:1,class:"product-teasers-fi__products__headline",innerHTML:a.currentFields.headline.editable},null,8,$e)):l("",!0),o("div",et,[a.isSlider?(n(),m(_,{key:0,carousel:s.carouselRef},null,8,["carousel"])):l("",!0)])])):l("",!0),(S=s.catalogData)!=null&&S.length?ie((n(),m(b,{key:s.changesCount,ref:p=>s.carouselRef=p,class:I({"product-teasers-fi__slider":!0,"product-teaser-fi__slider--no-slider":!a.isSlider,"product-teaser-fi__slider--with-content":a.showContent}),settings:a.sliderSettings,theme:"product-teasers","no-arrows":"","clipped-right":""},{default:g(()=>[(n(!0),u(T,null,ae(s.catalogData,(p,z)=>(n(),m(v,{key:p.id,theme:"product-teasers"},{default:g(()=>[o("div",tt,[a.isVariant?(n(),m(d,{key:0,product:p,"best-price":s.bestPrices[p.id],"best-price-loading":s.bestPriceLoading,"out-of-stock":a.retailerOutOfStock[z],"is-recommendation":t.isRecommendation,"is-guided-recommandation":t.isGuidedRecommandation,onProductAdded:i[0]||(i[0]=V=>e.$emit("product-added",V)),onTileClicked:V=>e.trackSelectItem(p,!a.isStandaloneVariant)},null,8,["product","best-price","best-price-loading","out-of-stock","is-recommendation","is-guided-recommandation","onTileClicked"])):(n(),m(h,{key:1,category:p,"is-guided-recommandation":t.isGuidedRecommandation,onTileClicked:V=>e.trackSelectItem(p)},null,8,["category","is-guided-recommandation","onTileClicked"]))])]),_:2},1024))),128))]),_:1},8,["class","settings"])),[[D,a.onIntersect,void 0,{once:!0}]]):l("",!0)])]),a.showContent?(n(),u("div",it,[o("div",at,[a.currentFields.content?(n(),m(L,{key:0,class:"product-teasers-fi__text","is-theme-light":"","html-content":a.currentFields.content},null,8,["html-content"])):l("",!0)])])):l("",!0)]}),_:1})]),_:1},8,["class"])}const St=G(xe,[["render",nt],["__scopeId","data-v-345c1e10"]]);export{St as default};