import{u as d,_ as m,o as p,c as f,d as u,w as h,a as i,k as _,f as S,aZ as b}from"./entry.DPwc-EV0.js";import{_ as g}from"./Modal-vfqh0pGA.mjs";async function y(e,s,t,o){const{$gql:n,$ss:r}=d(),c={source:r.general.siteName,section:e,eventType:s,resourceLink:t,searchTerm:""};["partNumber","searchTerm","manufacturerId","distributorId"].map(a=>{typeof o[a]<"u"&&(c[a]=o[a])}),n.query("trackSourceesbEvent",{...c})}const w={props:{dataSheetUrl:{type:String,require:!0},partNumber:{type:String,require:!0},searchPartNumber:{type:String,require:!0},manufacturer:{type:Number,required:!0},searchManufacturer:{type:String,required:!0},distributor:{type:Number,required:!0},mode:{type:String,default:"hollow"},page:{type:Object},searchTerm:{type:String,default:""},source:{type:String,default:""},action:{type:String,default:"modal"}},data(){return{showDataSheet:!1,isLoadingFrame:!1}},computed:{iframeSrc(){const e=`part_number=${this.partNumber}`,s=`manufacturer=${this.searchManufacturer}`,t=`data_sheet_url=${encodeURI(this.dataSheetUrl)}`;return`/data-sheet?${e}&${s}&${t}&includeShell=false&fullHeight=false&fullWidth=true`}},methods:{toggleDataSheet(){if(!this.showDataSheet||this.action==="tab"){const e={partNumber:this.partNumber,manufacturerId:this.manufacturer,distributorId:this.distributor};this.searchTerm&&(e.searchTerm=this.searchTerm),y(this.source,"Data Sheet",encodeURI(this.dataSheetUrl),e,this.page)}this.action==="modal"?this.showDataSheet=!this.showDataSheet:window.open(this.dataSheetUrl)}}},N={class:"contents"},$={class:"data-sheet"},x=["src"];function D(e,s,t,o,n,r){const c=S,l=b,a=g;return p(),f("div",null,[u(l,{class:"ebm-source-esb-data-sheet-button sesb-button",mode:t.mode,color:e.$ss.baseStyles.primaryColor,onOnClick:r.toggleDataSheet},{default:h(()=>[i("div",N,[u(c,{icon:"mdi:file-pdf-box","icon-color":t.mode==="hollow"?e.$ss.baseStyles.primaryColor:"white",width:20},null,8,["icon-color"]),_(" Data Sheet ")])]),_:1},8,["mode","color","onOnClick"]),u(a,{show:n.showDataSheet,"max-width":"90%",height:"80vh","allow-close":!0,"on-close":r.toggleDataSheet,"overflow-y":"auto"},{default:h(()=>[i("div",$,[i("iframe",{ref:"frame",src:r.iframeSrc},null,8,x)])]),_:1},8,["show","on-close"])])}const q=m(w,[["render",D],["__scopeId","data-v-c8a0d379"]]);export{q as _,y as u};