import{r as a,u as e,w as o,p as s,o as t,c as n,d as l,e as i,n as d,l as r,F as v,f as u,g as c,h as p,t as m,T as w,j as f,G as D,D as g}from"./index.1699270951405.js";import{$ as x}from"./jquery.1699270951405.js";const M=["onDragenter","onDragleave","onClick"],h=["onDragleave","onDragenter"],y={class:"item"},G={class:"itemBox hover"},k=["src"],z={__name:"iconGroup",props:{data:{type:Object,default:()=>({size:"1x1"})}},setup(z){var C;const j=z,B={"1x1":4,"2x2":9,"2x4":8},T=a(!1),_=a(j.data),b=e(),L=a(b.getters.findChildren(j.data.id)||[]),R=a(j.data.size);let Z=!1,$=null,q=null;const F=()=>{q=setTimeout((()=>{0==window.MoveData.canMove&&(window.MoveData.canMove=!0)}),300)},O=()=>{clearTimeout(q),window.MoveData.canMove=!1},P=a=>{"component"!==window.MoveData.type&&(T.value=!0,x(`.${_.value.id}`).parent().parent().addClass("selBoxsss"),"icon"===window.MoveData.type&&(Z=!0,window.MoveData.canMove="lock","number"==typeof $&&clearTimeout($),$=setTimeout((()=>{Z&&H()}),1e3)))},A=()=>{x(`.${_.value.id}`).parent().parent().removeClass("selBoxsss"),T.value=!1,window.MoveData.canMove=!1,Z=!1},E=()=>{s.emit("addGroupBox",{type:"show",pid:j.data.id})},H=()=>{s.emit("addGroupBox",{type:"add",pid:j.data.id})};(null==(C=j.data)?void 0:C.id)&&o(j.data,(a=>{var e;e=a,_.value=e,R.value=e.size}));const I=()=>{L.value=g({},b.getters.findChildren(j.data.id))};return s.on("RefreshLink",I),t((()=>{s.off("RefreshLink",I)})),(a,e)=>(n(),l("div",{class:d(["w-full h-full hover",_.value.id]),onDragenter:r(F,["stop"]),onDragleave:r(O,["stop"]),onClick:r(E,["stop"])},[i("div",{class:d("1x1"===R.value?"iconGroupzzz":"iconGroupZZ"),onDragleave:r(A,["stop"]),onDragenter:r(P,["stop"])},null,42,h),i("div",{class:d(["iconGP pointer-events-none","f"+R.value])},[(n(!0),l(v,null,u(f(D)(L.value).slice(0,B[R.value]),(a=>(n(),c(w,{key:a.id},{default:p((()=>[i("div",y,[i("div",G,[i("img",{class:"icon",src:a.src,alt:""},null,8,k),i("div",null,m(a.name),1)])])])),_:2},1024)))),128))],2)],42,M))}};export{z as default};
