import{_ as v,a3 as S,k as b,r as g,o as r,a as h,w as y,l as p,p as m,n as d,b as f,v as _,q as D,h as T}from"./main-DHoZdmBw.js";const x={name:"AvailabilityStatus",components:{TooltipFi:S},mixins:[b],props:{deliverySpeed:{type:String,default:"NODELIVERY"},disableTooltip:{type:Boolean,default:!1},customTooltipClass:{type:String,default:""},id:{type:String,default:""},theme:{type:String,default:""},tag:{type:String,default:""},showStatusText:{type:Boolean,default:!1},showSmallIndicatorDot:{type:Boolean,default:!1},stockLevels:{type:Array,default:null}},data(){return{allowedTags:["div","span"]}},computed:{statusTag(){let a="div";return this.allowedTags.includes(this.tag)&&(a=this.tag),a},getAvailabilityStatus(){var u;const a=(u=this.stockLevels)==null?void 0:u.find(({warehouse:o})=>o==null?void 0:o.code),l=a==null?void 0:a.warehouse.code,t=l&&this.$dict.get(`online-Shop.Product.Warehouse.${l}-${this.deliverySpeed}-Speed`,null,{noDevFallback:!0})||this.deliverySpeed,c=l&&this.$dict.get(`online-Shop.Product.Warehouse.${l}-${this.deliverySpeed}`,null,{noDevFallback:!0}),n=t==="FASTDELIVERY",e=!t||t==="SLOWDELIVERY";let i=this.$dict.get("online-Shop.Product.No-Delivery"),s="availability-status--no-delivery";return n?(i=this.$dict.get("online-Shop.Product.Fast-Delivery"),s="availability-status--fast-delivery"):e&&(i=this.$dict.get("online-Shop.Product.Slow-Delivery"),s="availability-status--slow-delivery"),{class:s,text:c||i,speed:t}}}},A=["data-test-2"];function k(a,l,t,c,n,e){const i=g("tooltip-fi");return r(),h(T(e.statusTag),{class:d(["availability-status",e.getAvailabilityStatus.class,t.theme?`availability-status--${t.theme}`:null,t.showSmallIndicatorDot?"availability-status--small-indicator-dot":null])},{default:y(()=>[p(i,{class:d(["availability-status__tooltip",t.customTooltipClass]),tooltip:e.getAvailabilityStatus.text,"custom-class":e.getAvailabilityStatus.class,disabled:t.disableTooltip||a.isLG},{trigger:y(()=>[m("span",{class:d(["availability-status__trigger",e.getAvailabilityStatus.class])},null,2)]),_:1},8,["class","tooltip","custom-class","disabled"]),a.isLG||t.theme==="buy-box"||t.theme==="checkout"||t.showStatusText?(r(),f("div",{key:0,class:"availability-status__text","data-test":"availability-status","data-test-2":e.getAvailabilityStatus.speed},_(e.getAvailabilityStatus.text),9,A)):D("",!0)]),_:1},8,["class"])}const L=v(x,[["render",k],["__scopeId","data-v-409e33b8"]]);export{L as A};