import{_ as R,C as U,r as _,o as r,b as o,p as n,l as v,F as k,v as c,q as f,x as A,e as T,a as y,w as N,I as O,L as M,ap as G,k as j,Y as q,n as p,u as S,Z as Y,G as z}from"./main-DtyiNRRn.js";import{F as Q}from"./FacetsMenuFi-Bipy54DJ.js";import{_ as W}from"./shoppingcartMixin-BwPtJIar.js";import{g as H}from"./AssetService-SVtDjug-.js";const V={BusinessTypes:"retail-Connect-Cart.Checkout.Labels.Trade-Label",IsB2B:"product-Catalog.Retail.Trade.B2B",IsB2C:"product-Catalog.Retail.Trade.B2C",DeliveryTypes:"retail-Connect-Cart.Checkout.Labels.Delivery-Type",IsDeliveryToConstruction:"product-Catalog.Retail.Delivery.Delivery-on-site",IsExpress:"product-Catalog.Retail.Delivery.Express-shipping",IsNormal:"product-Catalog.Retail.Delivery.Standard-Shipping",IsPickup:"product-Catalog.Retail.Delivery.Pick-up",PaymentTypes:"retail-Connect-Cart.Checkout.Labels.Payment-Type",IsCash:"product-Catalog.Retail.Payment.Cash-payment",IsCreditCard:"product-Catalog.Retail.Payment.Credit-card",IsDebitTransfer:"product-Catalog.Retail.Payment.Transfer",IsEcCard:"product-Catalog.Retail.Payment.EC-Card",IsIdeal:"product-Catalog.Retail.Payment.Ideal",IsInvoice:"product-Catalog.Retail.Payment.Bill",IsMobilePayment:"product-Catalog.Retail.Payment.Mobile-Payment",IsPaymentInAdvance:"product-Catalog.Retail.Payment.Prepayment",IsPaypal:"product-Catalog.Retail.Payment.PayPal",IsDirectDebit:"product-Catalog.Retail.Payment.Direct-debit"};Object.keys(V).sort();function P(i,a){const e=V[i];return e?a.get(e):(console.log("Unknown facet",i),i)}const K={name:"RetailConnectUnavailableProductFi",components:{CloudImageFi:U},props:{product:{type:Object,default:()=>({})}},data(){return{isExpanded:!1,placeholderImage:H("/img/products/placeholder.svg")}},computed:{isExpandable(){return this.products.length>4},visibleProducts(){return[...this.products].slice(0,4)},hiddenProducts(){return[...this.products].splice(4)}}},Z={class:"retail-connect-unavailable-products-fi__product"},J={class:"retail-connect-unavailable-products-fi__image"},X={class:"retail-connect-unavailable-products-fi__data"},$={class:"retail-connect-unavailable-products-fi__name"},ee={class:"retail-connect-unavailable-products-fi__articleNo"},ie={key:1,class:"retail-connect-unavailable-products-fi__error"};function te(i,a,e,l,s,t){var u,d;const m=_("cloud-image-fi");return r(),o("div",Z,[n("div",J,[v(m,{class:"retail-connect-cart-products-fi__product__img",width:"94",height:"94",params:"func=fit",src:(u=e.product.catalogData)!=null&&u.image?e.product.catalogData.image:s.placeholderImage},null,8,["src"])]),n("div",X,[e.product.catalogData?(r(),o(k,{key:0},[n("div",$,c(e.product.catalogData.nameLong),1),n("div",ee,c(i.$dict.get("checkout.Cart.Article-Number"))+" "+c(e.product.catalogData.id),1)],64)):(d=e.product.error)!=null&&d.message?(r(),o("div",ie,c(e.product.error.message),1)):f("",!0)])])}const ae=R(K,[["render",te],["__scopeId","data-v-10bcee99"]]),ne={name:"RetailConnectUnavailableProductsFi",components:{SlideUpDown:A,RetailConnectUnavailableProductFi:ae},props:{products:{type:Array,default:()=>[]}},data(){return{isExpanded:!1,visibileItems:4}},computed:{isExpandable(){return this.products.length>this.visibileItems},visibleProducts(){return[...this.products].slice(0,this.visibileItems)},hiddenProducts(){return[...this.products].splice(this.visibileItems)}}},le={key:0,class:"retail-connect-unavailable-products-fi"},se={class:"retail-connect-unavailable-products-fi__expand"};function re(i,a,e,l,s,t){const m=_("retail-connect-unavailable-product-fi"),u=_("slide-up-down");return e.products?(r(),o("div",le,[(r(!0),o(k,null,T(t.visibleProducts,(d,h)=>(r(),y(m,{key:h,product:d,class:"retail-connect-unavailable-products-fi__product"},null,8,["product"]))),128)),t.isExpandable?(r(),o(k,{key:0},[v(u,{"model-value":s.isExpanded,duration:700,class:"retail-connect-unavailable-products-fi__expanded-products"},{default:N(()=>[(r(!0),o(k,null,T(t.hiddenProducts,(d,h)=>(r(),y(m,{key:h,product:d,class:"retail-connect-unavailable-products-fi__product"},null,8,["product"]))),128))]),_:1},8,["model-value"]),n("div",se,[n("span",{class:"retail-connect-unavailable-products-fi__expand-text",onClick:a[0]||(a[0]=d=>s.isExpanded=!s.isExpanded)},c(s.isExpanded?i.$dict.get("product-Catalog.Retail.Availability.Reduce-Text"):i.$dict.get("product-Catalog.Retail.Availability.Expand-Text",[t.hiddenProducts.length])),1)])],64)):f("",!0)])):f("",!0)}const ce=R(ne,[["render",re],["__scopeId","data-v-56ed17bf"]]),oe={name:"RetailConnectOnlineRetailerFi",components:{IconFi:O,LinkFi:M,RetailConnectUnavailableProductsFi:ce,SlideUpDown:A,SsrCloudImageFi:G},mixins:[j,W,q],props:{retailer:{type:Object,default:()=>({})},variant:{type:String,default:null},cartId:{type:String,default:null}},data(){return{isLoading:!0,showDetails:!1}},computed:{unavailableProducts(){return this.retailer.Products.filter(i=>i.stock==="EMPTY"||i.stock===null)},isProductRetailers(){return this.variant==="product-retailers"}},methods:{toCloudimage(i){return i.includes("www.nexmart.com/media/customer")?i.replace(/^https:\/\/www\.nexmart\.com\/media\/customer/,"_retail-connect_"):null},dict(i){return P(i,this.$dict)},activeTypes(i){const a=[];return Object.entries(i||{}).forEach(([e,l])=>{e!=="__typename"&&l&&a.push(P(e,this.$dict))}),a.join(", ")},async trackEvent(){var i;{const a=(i=this.retailer)==null?void 0:i.Products.map(e=>{var l;return{productId:(l=e==null?void 0:e.catalogData)==null?void 0:l.id,available:!!(e.stock&&e.stock!=="EMPTY")}});this.sendEvent("retail_connect_online",{retailerName:this.retailer.Name,items:a,cartId:this.cartId}),await this.getCart(),this.trackOnlineRetailerClicked(this.cart,this.retailer.Name)}}}},de={class:"retail-connect-online-retailer-fi__top"},ue={class:"retail-connect-online-retailer-fi__image"},me=["src"],_e={class:"retail-connect-online-retailer-fi__top__left"},ve={class:"retail-connect-online-retailer-fi__image--mobile"},fe=["src"],he={class:"retail-connect-online-retailer-fi__name","data-test":"retail-connect-retailer-name"},ge={class:"retail-connect-online-retailer-fi__top__right"},ke={key:0,class:"retail-connect-online-retailer-fi__status retail-connect-online-retailer-fi__status--available"},pe={key:1,class:"retail-connect-online-retailer-fi__status retail-connect-online-retailer-fi__status--unavailable"},ye={class:"retail-connect-online-retailer-fi__content"},be={class:"retail-connect-online-retailer-fi__data"},Ce={class:"retail-connect-online-retailer-fi__data__row"},Ie={class:"retail-connect-online-retailer-fi__data__label"},Ne={class:"retail-connect-online-retailer-fi__data__value"},Pe={class:"retail-connect-online-retailer-fi__data__row"},Re={class:"retail-connect-online-retailer-fi__data__label"},Fe={class:"retail-connect-online-retailer-fi__data__value"},Se={class:"retail-connect-online-retailer-fi__data__row"},Te={class:"retail-connect-online-retailer-fi__data__label"},De={class:"retail-connect-online-retailer-fi__data__value"},we={key:0,class:"retail-connect-online-retailer-fi__unavailable-products"};function Be(i,a,e,l,s,t){var g;const m=_("ssr-cloud-image-fi"),u=_("icon-fi"),d=_("link-fi"),h=_("slide-up-down"),b=_("retail-connect-unavailable-products-fi");return r(),o("div",{class:p(["retail-connect-online-retailer-fi",e.variant?`retail-connect-online-retailer-fi--${e.variant}`:null]),"data-test":"retail-connect-retailer"},[n("div",de,[n("div",ue,[t.toCloudimage(e.retailer.LogoUrl)?(r(),y(m,{key:0,class:"retail-connect-online-retailer-fi__img",src:t.toCloudimage(e.retailer.LogoUrl),breakpoints:[{mediaWidth:1023,imageWidth:60}],unlimited:85,trim:"",params:"func=fit"},null,8,["src"])):(r(),o("img",{key:1,class:"retail-connect-online-retailer-fi__img",src:e.retailer.LogoUrl},null,8,me))]),n("div",_e,[n("div",ve,[t.toCloudimage(e.retailer.LogoUrl)?(r(),y(m,{key:0,class:"retail-connect-online-retailer-fi__img",src:t.toCloudimage(e.retailer.LogoUrl),breakpoints:[],unlimited:60,trim:"",params:"func=fit"},null,8,["src"])):(r(),o("img",{key:1,class:"retail-connect-online-retailer-fi__img",src:e.retailer.LogoUrl},null,8,fe)),n("div",{class:p({"retail-connect-online-retailer-fi__toggle-details retail-connect-online-retailer-fi__toggle-details--mobile":!0,"retail-connect-online-retailer-fi__toggle-details--active":s.showDetails}),onClick:a[0]||(a[0]=C=>s.showDetails=!s.showDetails)},[S(c(s.showDetails?i.$dict.get("retail-Connect-Cart.Checkout.Labels.Close-Details"):i.$dict.get("retail-Connect-Cart.Checkout.Labels.Details"))+" ",1),v(u,{class:"retail-connect-online-retailer-fi__toggle-details__icon",icon:"chevron-down"})],2)]),n("div",he,c(e.retailer.Name),1),v(d,{class:"retail-connect-online-retailer-fi__shop-link",href:(g=e.retailer.ShopLink)==null?void 0:g[0],target:"_blank",rel:"noopener","data-test":"retail-connect-retailer-shop-link",onClickCapture:t.trackEvent,onMouseup:Y(t.trackEvent,["middle"])},{default:N(()=>[S(c(i.$dict.get("product-Catalog.Retail.Buttons.To-Online-Shop")),1)]),_:1},8,["href","onClickCapture","onMouseup"])]),n("div",ge,[n("div",{class:p({"retail-connect-online-retailer-fi__toggle-details":!0,"retail-connect-online-retailer-fi__toggle-details--active":s.showDetails}),onClick:a[1]||(a[1]=C=>s.showDetails=!s.showDetails)},[S(c(s.showDetails?i.$dict.get("retail-Connect-Cart.Checkout.Labels.Close-Details"):i.$dict.get("retail-Connect-Cart.Checkout.Labels.Details"))+" ",1),v(u,{class:"retail-connect-online-retailer-fi__toggle-details__icon",icon:"chevron-down"})],2),t.unavailableProducts.length===0&&!t.isProductRetailers?(r(),o("div",ke,c(i.$dict.get("product-Catalog.Retail.Availability.Available")),1)):f("",!0),t.unavailableProducts.length!==0&&!t.isProductRetailers?(r(),o("div",pe,c(t.unavailableProducts.length===1?i.$dict.get("product-Catalog.Retail.Availability.Partially-Unavailable-Singular"):i.$dict.get("product-Catalog.Retail.Availability.Partially-Unavailable",[t.unavailableProducts.length])),1)):f("",!0)])]),n("div",ye,[v(h,{"model-value":s.showDetails},{default:N(()=>[n("div",be,[n("div",Ce,[n("div",Ie,c(t.dict("BusinessTypes")),1),n("div",Ne,c(t.activeTypes(e.retailer.BusinessTypes)),1)]),n("div",Pe,[n("div",Re,c(t.dict("DeliveryTypes")),1),n("div",Fe,c(t.activeTypes(e.retailer.DeliveryTypes)),1)]),n("div",Se,[n("div",Te,c(t.dict("PaymentTypes")),1),n("div",De,c(t.activeTypes(e.retailer.PaymentTypes)),1)])])]),_:1},8,["model-value"]),t.unavailableProducts.length!==0?(r(),o("div",we,[v(b,{products:t.unavailableProducts},null,8,["products"])])):f("",!0)])],2)}const Ee=R(oe,[["render",Be],["__scopeId","data-v-b9692815"]]),xe={name:"OnlineRetailersListFi",components:{IconFi:O,GridContainerFi:z,RetailConnectOnlineRetailerFi:Ee,FacetsMenuFi:Q},inject:["fields"],props:{retailers:{type:Array,default:null},retailerFacets:{type:Array,default:null},variant:{type:String,default:null},cartId:{type:String,default:null}},data(){return{filteredRetailers:null,filtredFacets:null,activeFilters:[]}},computed:{onlineRetailers(){return this.filteredRetailers?this.filteredRetailers:this.retailers},facets(){return this.filtredFacets?this.filtredFacets:this.retailerFacets},isProductRetailers(){return this.variant==="product-retailers"}},methods:{updateFacets(){const i=[...this.facets];i.forEach(a=>{a.elements.forEach(e=>{let l=0;this.filteredRetailers.forEach(s=>{var t;(t=s[e.facetType])!=null&&t[e.facetName]&&(l+=1)}),e.selected=this.activeFilters.indexOf(e)>=0,e.count=l,e.disabled=l===0})}),this.filtredFacets=i},facetChanged(i){const a=[];if(i.value)this.activeFilters.push(i.element);else{const e=this.activeFilters.indexOf(i.element);this.activeFilters.splice(e,1)}this.retailers.forEach(e=>{let l=!1;this.activeFilters.forEach(s=>{e[s.facetType][s.facetName]||(l=!0)}),l||a.push(e)}),this.filteredRetailers=a,this.updateFacets()},clearAllFacets(){this.filteredRetailers=[...this.retailers],this.activeFilters=[],this.updateFacets()}}},Le={class:"online-retailers-list-fi__facets"},Ae={class:"online-retailers-list-fi__retailers"},Oe={class:"online-retailers-list-fi__retailers__counter"},Ve={key:0,class:"online-retailers-list-fi__notices"},Ue={key:0,class:"online-retailers-list-fi__notice"},Me={class:"online-retailers-list-fi__notice__text"},Ge={key:1,class:"online-retailers-list-fi__notice"},je={class:"online-retailers-list-fi__notice__text"},qe={key:2,class:"online-retailers-list-fi__notice"},Ye={class:"online-retailers-list-fi__notice__text"};function ze(i,a,e,l,s,t){const m=_("facets-menu-fi"),u=_("retail-connect-online-retailer-fi"),d=_("icon-fi"),h=_("grid-container-fi");return t.onlineRetailers?(r(),o("div",{key:0,class:p(["online-retailers-list-fi",e.variant?`online-retailers-list-fi--${e.variant}`:null])},[n("div",Le,[v(m,{facets:e.retailerFacets,centered:!t.isProductRetailers,"columns-max":t.isProductRetailers?3:6,onChange:t.facetChanged,onClearAllFacets:t.clearAllFacets},null,8,["facets","centered","columns-max","onChange","onClearAllFacets"])]),n("div",Ae,[v(h,null,{default:N(()=>{var b,g,C,w,B,E;return[n("div",{class:p({"fi-col-start-1 md:fi-col-start-2 lg:fi-col-start-3 fi-col-end-13 md:fi-col-end-12 lg:fi-col-end-11":!e.variant,"fi-col-start-1 fi-col-end-13":t.isProductRetailers})},[n("div",Oe,c(i.$dict.get("retail-Connect-Cart.Checkout.Labels.Results-Counter",[t.onlineRetailers.length])),1),(r(!0),o(k,null,T(t.onlineRetailers,x=>(r(),y(u,{key:x.Id,retailer:x,variant:e.variant,"cart-id":e.cartId},null,8,["retailer","variant","cart-id"]))),128))],2),(b=t.fields.onlineRetailersNotice1)!=null&&b.value||(g=t.fields.onlineRetailersNotice2)!=null&&g.value||(C=t.fields.onlineRetailersNotice3)!=null&&C.value?(r(),o("div",Ve,[(w=t.fields.onlineRetailersNotice1)!=null&&w.value?(r(),o("div",Ue,[v(d,{icon:"info",class:"online-retailers-list-fi__notice__icon"}),n("span",Me,c(t.fields.onlineRetailersNotice1.value),1)])):f("",!0),(B=t.fields.onlineRetailersNotice2)!=null&&B.value?(r(),o("div",Ge,[v(d,{icon:"info",class:"online-retailers-list-fi__notice__icon"}),n("span",je,c(t.fields.onlineRetailersNotice2.value),1)])):f("",!0),(E=t.fields.onlineRetailersNotice3)!=null&&E.value?(r(),o("div",qe,[v(d,{icon:"info",class:"online-retailers-list-fi__notice__icon"}),n("span",Ye,c(t.fields.onlineRetailersNotice3.value),1)])):f("",!0)])):f("",!0)]}),_:1})])],2)):f("",!0)}const Je=R(xe,[["render",ze],["__scopeId","data-v-fac989e0"]]);var F={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getOnlineRetailersByProductIds"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"baseSiteId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BaseSiteId"}}},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:"serviceType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"products"}},type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"useGtins"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getOnlineRetailersByProductIds"},arguments:[{kind:"Argument",name:{kind:"Name",value:"baseSiteId"},value:{kind:"Variable",name:{kind:"Name",value:"baseSiteId"}}},{kind:"Argument",name:{kind:"Name",value:"serviceType"},value:{kind:"Variable",name:{kind:"Name",value:"serviceType"}}},{kind:"Argument",name:{kind:"Name",value:"products"},value:{kind:"Variable",name:{kind:"Name",value:"products"}}},{kind:"Argument",name:{kind:"Name",value:"useGtins"},value:{kind:"Variable",name:{kind:"Name",value:"useGtins"}}}],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:"LogoUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"RetailerTypes"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"Availability"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsB2B"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsB2C"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ShopLink"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"DeliveryTypes"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"IsDeliveryToConstruction"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsExpress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsNormal"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsPickup"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"PaymentTypes"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"IsCash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsCreditCard"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsDebitTransfer"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsEcCard"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsIdeal"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsInvoice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsMobilePayment"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsPaymentInAdvance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"IsPaypal"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"Products"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expired"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"stock"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"supplierPid"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"catalogData"},arguments:[{kind:"Argument",name:{kind:"Name",value:"baseSiteId"},value:{kind:"Variable",name:{kind:"Name",value:"baseSiteId"}}},{kind:"Argument",name:{kind:"Name",value:"language"},value:{kind:"Variable",name:{kind:"Name",value:"language"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nameLong"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"image"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:926}};F.loc.source={body:`query getOnlineRetailersByProductIds( $baseSiteId: BaseSiteId! $language: String! $serviceType: String! $products: [String] $useGtins: Boolean ) { getOnlineRetailersByProductIds( baseSiteId: $baseSiteId serviceType: $serviceType products: $products useGtins: $useGtins ) { Id Name LogoUrl RetailerTypes Availability IsB2B IsB2C ShopLink DeliveryTypes { IsDeliveryToConstruction IsExpress IsNormal IsPickup } PaymentTypes { IsCash IsCreditCard IsDebitTransfer IsEcCard IsIdeal IsInvoice IsMobilePayment IsPaymentInAdvance IsPaypal } Products { expired stock supplierPid catalogData(baseSiteId: $baseSiteId, language: $language) { id nameLong image } error { code message } } } } `,name:"GraphQL request",locationOffset:{line:1,column:1}};function I(i,a){if(i.kind==="FragmentSpread")a.add(i.name.value);else if(i.kind==="VariableDefinition"){var e=i.type;e.kind==="NamedType"&&a.add(e.name.value)}i.selectionSet&&i.selectionSet.selections.forEach(function(l){I(l,a)}),i.variableDefinitions&&i.variableDefinitions.forEach(function(l){I(l,a)}),i.definitions&&i.definitions.forEach(function(l){I(l,a)})}var D={};(function(){F.definitions.forEach(function(a){if(a.name){var e=new Set;I(a,e),D[a.name.value]=e}})})();function L(i,a){for(var e=0;e<i.definitions.length;e++){var l=i.definitions[e];if(l.name&&l.name.value==a)return l}}function Qe(i,a){var e={kind:i.kind,definitions:[L(i,a)]};i.hasOwnProperty("loc")&&(e.loc=i.loc);var l=D[a]||new Set,s=new Set,t=new Set;for(l.forEach(function(u){t.add(u)});t.size>0;){var m=t;t=new Set,m.forEach(function(u){if(!s.has(u)){s.add(u);var d=D[u]||new Set;d.forEach(function(h){t.add(h)})}})}return s.forEach(function(u){var d=L(i,u);d&&e.definitions.push(d)}),e}Qe(F,"getOnlineRetailersByProductIds");const Xe={data(){return{retailers:null,retailerFacets:null,retailerServiceType:null,facetsSelection:{BusinessTypes:{IsB2B:!1,IsB2C:!1},DeliveryTypes:{IsExpress:!1,IsPickup:!1,IsNormal:!1,IsDeliveryToConstruction:!1},PaymentTypes:{IsCash:!1,IsCreditCard:!1,IsDebitTransfer:!1,IsEcCard:!1,IsIdeal:!1,IsInvoice:!1,IsMobilePayment:!1,IsPaymentInAdvance:!1,IsPaypal:!1}}}},apollo:{getOnlineRetailersByProductIds:{query:F,errorPolicy:"all",variables(){return{baseSiteId:this.$fischer.baseSiteId(),language:this.$fischer.siteLanguage(),serviceType:this.serviceType,products:this.productIds,useGtins:this.$fischer.useGtins()}},result(i){var a;this.retailers=((a=i==null?void 0:i.data)==null?void 0:a.getOnlineRetailersByProductIds)||[],this.retailers=this.retailers.map(e=>({...e,BusinessTypes:{IsB2B:e.IsB2B,IsB2C:e.IsB2C}})),this.setFacets()},skip(){return!this.productIds||!(this.isRetailConnect||this.isRetailConnectCart)},error(){this.error=!0}}},computed:{isRetailConnect(){return this.$fischer.shop.isRetailConnect()},isRetailConnectCart(){return this.$fischer.shop.isRetailConnectCart()},serviceType(){return this.retailerServiceType?this.retailerServiceType:this.productIds&&this.productIds.length>1?"cart":"online"}},methods:{setFacets(){const i=[];Object.keys(this.facetsSelection).forEach(a=>{const e={multiselect:!0,name:P(a,this.$dict),elements:[]};Object.keys(this.facetsSelection[a]).forEach(l=>{let s=0;if(this.retailers.forEach(t=>{var m;(m=t[a])!=null&&m[l]&&(s+=1)}),s>0){const t={facetType:a,facetName:l,name:P(l,this.$dict),count:s,selected:!1};e.elements.push(t)}}),i.push(e)}),this.retailerFacets=i}}};export{Je as O,Xe as _};