import{_ as p,c as r,o as n,a as o,l as d,p as m,d as a,e as k,F as y,y as b,z as f,v as S,ch as I}from"./BfF8i_OD.js";import{_ as N}from"./WebShareLink-BgvWY97L.mjs";const W={props:{contentId:{type:Number,required:!0},title:{type:String,required:!0},description:{type:String},iconWidth:{type:Number,default:40},useEmail:{type:Boolean,default:!0},path:{type:String,required:!0}},emits:["social-share-click"],data(){return{shareNetworks:["facebook","linkedin","twitter","pinterest"],fullURL:"",showAllIcons:!1,SocialNetworks:I}},computed:{filterShareNetworks(){return this.showAllIcons?this.shareNetworks:this.shareNetworks.slice(0,4)},iconElementWidth(){return 3/5*this.iconWidth},iconWrapperStyle(){return{padding:`${this.iconWidth/5}px`}},mailToLink(){return`mailto:?subject=${this.title}&body=${this.fullURL}%0D%0A${this.description??""}`}},mounted(){var s;this.fullURL=window.location.hostname+this.path;const e=(s=this.$ss.contentStyle)==null?void 0:s.socialShareLinks;if(e!==void 0){this.shareNetworks=[];for(let i=0;i<(e==null?void 0:e.length);i++){const u=e[i];this.shareNetworks.push(u)}}},methods:{showAll(){this.showAllIcons=!this.showAllIcons},getIcon(e){return e==="flipboard"?"simple-icons:flipboard":e==="twitter"?"fa6-brands:x-twitter":`mdi:${e==null?void 0:e.toLowerCase()}`},socialShareInfo(e,s,i=""){return console.log("network",s),{listPosition:e,socialNetwork:s,to:i}}}},g={class:"ebm-share-wrapper"},E={key:0,class:"ebm-share-item printer-icon"},L=["href"],x={key:1,class:"ebm-share-item email-icon"},A=["href"],C={key:2,class:"ebm-plus-icon"};function v(e,s,i,u,c,t){const h=k,w=N;return n(),r("div",g,[o("ul",{class:f(["ebm-share-list",c.showAllIcons?"expanded":"collapsed"])},[i.contentId?(n(),r("li",E,[o("a",{href:`/print/content/${i.contentId}`,target:"_blank"},[o("div",{style:m(t.iconWrapperStyle)},[a(h,{icon:"mdi:printer","icon-color":"white",width:t.iconElementWidth},null,8,["width"])],4)],8,L)])):d("",!0),i.useEmail?(n(),r("li",x,[o("a",{href:t.mailToLink,onClick:s[0]||(s[0]=l=>e.$emit("social-share-click",t.socialShareInfo(2,c.SocialNetworks.Email,t.mailToLink)))},[o("div",{style:m(t.iconWrapperStyle)},[a(h,{icon:"mdi:email","icon-color":"white",width:t.iconElementWidth},null,8,["width"])],4)],8,A)])):d("",!0),(n(!0),r(y,null,b(t.filterShareNetworks,(l,_)=>(n(),r("li",{key:l,class:f(`ebm-share-item ${l}-icon`)},[a(w,{network:l,url:c.fullURL,title:i.title,description:i.description,onClick:B=>e.$emit("social-share-click",t.socialShareInfo(i.useEmail?_+3:_+2,l))},{default:S(()=>[o("div",{style:m(t.iconWrapperStyle)},[a(h,{icon:t.getIcon(l),"icon-color":"white",width:t.iconElementWidth},null,8,["icon","width"])],4)]),_:2},1032,["network","url","title","description","onClick"])],2))),128)),c.shareNetworks.length>4?(n(),r("li",C,[a(h,{icon:c.showAllIcons?"bxs:left-arrow":"bxs:right-arrow",width:t.iconElementWidth,onClick:t.showAll},null,8,["icon","width","onClick"])])):d("",!0)],2)])}const q=p(W,[["render",v],["__scopeId","data-v-06a67383"]]);export{q as _};