import{aj as t,ac as o,E as e}from"./vendor-element-plus.js?ver=3.1.0";import{r as s,c,o as a,b as r,P as i,a as n,w as p,d as m}from"./vendor.js?ver=3.1.0";import{_ as d}from"./fc-bits-ui.js?ver=3.1.0";const l={class:"fcrm_item_copier_wrapper"},u={class:"fcrm_smart_url_box"},y={class:"fcrm_smart_url_text"};const _=d({name:"ItemCopier",components:{CopyDocument:o,Check:t},props:["text","showViewButton"],data:()=>({copy_success:!1}),methods:{copyItem(){this.copy_success=!1;const t=this.text;let o=!1;if(window.clipboardData&&window.clipboardData.setData)window.clipboardData.clipboardData.setData("Text",t),o=!0;else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){const s=document.createElement("textarea");s.textContent=t,s.style.position="fixed",document.body.appendChild(s),s.select();try{document.execCommand("copy"),o=!0}catch(e){console.warn("Copy to clipboard failed.",e),o=!1}finally{document.body.removeChild(s)}}o?(this.copy_success=!0,this.$notify({message:this.$t("Copied to your clipboard"),position:"bottom-right",customClass:"bottom_right",type:"success"}),setTimeout(()=>{this.copy_success=!1},2e3)):this.$notify({message:this.$t("Your Browser does not support JS copy. Please copy manually"),position:"bottom-right",customClass:"bottom_right",type:"error"})},openUrl(){this.text&&window.open(this.text,"_blank")}}},[["render",function(t,o,d,_,h,f){const b=s("CopyDocument"),C=e,w=s("Check");return a(),c("div",l,[r("div",u,[r("span",y,i(d.text),1),r("button",{class:"fcrm_copy_btn",onClick:o[0]||(o[0]=(...t)=>f.copyItem&&f.copyItem(...t)),type:"button"},[h.copy_success?(a(),n(C,{key:1,class:"fcrm_check_icon"},{default:p(()=>[m(w)],void 0),_:1})):(a(),n(C,{key:0,class:"fcrm_copy_icon"},{default:p(()=>[m(b)],void 0),_:1}))])])])}]]);export{_ as I};
