import{r as e,d as i,B as o,h as t}from"./p-846bd001.js";import{C as r}from"./p-957842f3.js";import"./p-ae2fb9dc.js";const s=class{constructor(o){e(this,o),this.fireenjinShareClose=i(this,"fireenjinShareClose",7),this.facebookAppId=void 0,this.url=void 0,this.text=void 0,this.subject=void 0,this.lines=void 0}openPopup(e,i){let o;if(e.preventDefault(),"facebook"===i)o=`https://www.facebook.com/dialog/share?app_id=${this.facebookAppId}&display=popup&href=${this.url}`;else if("google"===i)o=`https://plus.google.com/share?url=${this.url}`;else{if("twitter"!==i)return!1;o=`https://twitter.com/intent/tweet?url=${this.url}&text=${this.text}`}this.fireenjinShareClose.emit({event:e,type:i}),window.open(o,"Share","google"===i?"height=600,width=400":"height=400,width=600")}componentDidLoad(){(null==o?void 0:o.isBrowser)&&new r(this.copyItemEl)}render(){return t("ion-list",null,t("ion-item",{lines:this.lines,class:"share-twitter",onClick:e=>this.openPopup(e,"twitter")},t("ion-icon",{slot:"end",name:"logo-twitter"}),"Share on Twitter"),t("ion-item",{lines:this.lines,class:"share-facebook",onClick:e=>this.openPopup(e,"facebook")},t("ion-icon",{slot:"end",name:"logo-facebook"}),"Share on Facebook"),t("ion-item",{lines:this.lines,ref:e=>this.copyItemEl=e,class:"share-clipboard","data-clipboard-text":this.url},t("ion-icon",{slot:"end",name:"clipboard"}),"Copy to Clipboard"))}};s.style="fireenjin-share ion-item:hover{cursor:pointer}fireenjin-share .share-twitter ion-icon{color:#1da1f3}fireenjin-share .share-twitter ion-icon svg{fill:#1da1f3}fireenjin-share .share-twitter:hover .item{color:#1da1f3}fireenjin-share .share-facebook ion-icon{color:#3b5998}fireenjin-share .share-facebook ion-icon svg{fill:#3b5998}fireenjin-share .share-facebook:hover .item{color:#3b5998}fireenjin-share .share-google ion-icon{color:#dd4b38}fireenjin-share .share-google ion-icon svg{fill:#dd4b38}fireenjin-share .share-google:hover .item{color:#dd4b38}";export{s as fireenjin_share}