import{u as s,r as e,a7 as l,p as o,o as a,c as t,d as n,l as u,m as i,e as m,x as v}from"./index.1696777084030.js";import{_ as c}from"./edit.1696777084030.js";import{C as d,a as p}from"./href.1696777084030.js";const r=["onClick"],k=[m("img",{src:"/dist/assets/open.1696777084030.svg"},null,-1),m("span",null,"新标签打开",-1)],x={key:1,class:"mouseItem"},C=[m("img",{src:"/dist/assets/layout.1696777084030.svg"},null,-1),m("span",null,"布局",-1)],f={key:2,class:"layoutSet"},y=[m("img",{src:c,alt:""},null,-1),m("span",null,"编辑",-1)],g=["onClick"],h=[m("img",{src:c},null,-1),m("span",null,"批量编辑",-1)],w=["onClick"],I=[m("img",{src:"/dist/assets/del.1696777084030.svg"},null,-1),m("span",null,"删除",-1)],L={__name:"mouseMenu",setup(c){const L=s(),j=e(!1),M=e(""),S=e(0);let _={},E=e({});const P=l({top:"0px",left:"0px"}),b=()=>{L.commit("delLink",E.id),j.value=!1,(null==_?void 0:_.call)&&(null==_||_.call())},z=()=>{d["tab://addicon"]({data:E}),j.value=!1},q=()=>{L.state.editStatus=!0,j.value=!1},A=s=>{E.size=s,L.commit("setLink",E),o.emit("hotSearch",E),j.value=!1},B=()=>{p(E.url,!0),j.value=!1},D=s=>{P.top=s.top+"px",P.left=s.left+"px",E=s.data,_=s,M.value=E.type,j.value=!0;const{app:e=0}=E;S.value=e},F=s=>{j.value&&(j.value=!1)};return window.addEventListener("mousedown",F),o.on("mousePs",D),a((()=>{window.removeEventListener("mousedown",F),o.off("mousePs",D)})),(s,e)=>j.value?(t(),n("div",{key:0,class:"mouseMenu",style:v(P),onMousedown:e[3]||(e[3]=u((()=>{}),["stop"])),onContextmenu:e[4]||(e[4]=u((()=>{}),["prevent"]))},["icon"===M.value?(t(),n("div",{key:0,class:"mouseItem mhover",onClick:u(B,["stop"])},k,8,r)):i("",!0),"component"===M.value?(t(),n("div",x,C)):i("",!0),"component"===M.value?(t(),n("div",f,[m("div",{onClick:e[0]||(e[0]=s=>A("2x4"))},"2x4"),m("div",{onClick:e[1]||(e[1]=s=>A("2x2"))},"2x2"),m("div",{onClick:e[2]||(e[2]=s=>A("1x1"))},"1x1")])):i("",!0),"icon"===M.value&&0==S.value?(t(),n("div",{key:3,class:"mouseItem mhover",onClick:z},y)):i("",!0),m("div",{onClick:u(q,["stop"]),class:"mouseItem mhover"},h,8,g),m("div",{class:"mouseItem mhover",onClick:u(b,["stop"])},I,8,w)],36)):i("",!0)}};export{L as default};
