import{hp as D,h as I,i as P}from"./index-BTglIPU2.js?v=1773287522785";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{ab as N,ac as O,ad as S}from"./mail-COTHIXbY.js?v=1773287522785";import{a1 as V,au as j,a6 as E,b as R,B as T}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as Z,R as q,e as A,r as v,$ as F,Z as G,_ as c,a0 as e,a9 as a,aa as l,S as i,j as m}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const H={class:"px-20px pt-24px pb-8px"},J={class:"mb-20px"},K={class:"mb-20px text-desc"},L={class:"mb-6px"},Q={class:"leading-18px"},W={class:"w-260px"},at=Z({__name:"unsubscribe",emits:["close"],setup(X,{expose:x,emit:M}){const d=M,{t:f}=q(),s=A({http:"https://",url:""}),p=v(""),g=v([{label:"http://",value:"http://"},{label:"https://",value:"https://"}]),C=t=>{const{clipboardData:n}=t;if(n){const o=n.getData("text");if(o)if(o.indexOf("://")===-1)console.log(1),s.url=o;else{const _=o.split("://")[0]+"://";s.http=_,s.url=o.replace(_,"")}}t.preventDefault()},$=async()=>{I({title:f("Mail.Mass.index_59"),content:f("Mail.Mass.index_60"),onConfirm:async()=>{await N(),b()}})},b=async()=>{const{message:t}=await O();if(P(t)){if(p.value=t.panel_url,p.value){const n=p.value.split("://")[0]+"://";s.http=n}if(t.url){const n=t.url.split("://")[0]+"://";s.http=n,s.url=t.url.replace(n,"")}}},y=()=>{d("close")},h=async()=>{await S({url:s.http+s.url}),d("close")};return b(),x({onConfirm:h}),(t,n)=>{const o=E,_=R,w=j,B=V,k=z,u=T,U=D;return F(),G("div",null,[c("div",H,[e(k,{model:i(s),"label-width":"auto"},{default:a(()=>[c("div",J,l(t.$t("Mail.Mass.index_55"))+l(i(p)||"--"),1),c("div",K,[c("div",L,l(t.$t("Mail.Mass.index_56")),1),c("div",Q,l(t.$t("Mail.Mass.index_57")),1)]),e(B,{label:t.$t("Mail.Mass.index_58"),path:"url"},{default:a(()=>[c("div",W,[e(w,null,{default:a(()=>[e(o,{value:i(s).http,"onUpdate:value":n[0]||(n[0]=r=>i(s).http=r),style:{width:"90px"},options:i(g)},null,8,["value","options"]),e(_,{value:i(s).url,"onUpdate:value":n[1]||(n[1]=r=>i(s).url=r),class:"flex-1",placeholder:"",onPaste:C},null,8,["value"])]),_:1})])]),_:1},8,["label"])]),_:1},8,["model"])]),e(U,null,{default:a(()=>[e(u,{size:"small",onClick:$},{default:a(()=>[m(l(t.$t("Mail.Mass.index_59")),1)]),_:1}),e(u,{class:"cancel-btn",size:"small",color:"#cbcbcb",onClick:y},{default:a(()=>[m(l(t.$t("Public.Btn.Cancel")),1)]),_:1}),e(u,{type:"primary",size:"small",onClick:h},{default:a(()=>[m(l(t.$t("Public.Btn.Confirm")),1)]),_:1})]),_:1})])}}});export{at as default};
