require("../vc-util/warning.js"),require("vue");function e(e,t){if(!e)return[];let n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function t(e,t){let n=(e||[]).slice();return n.includes(t)||n.push(t),n}function n(e){return e.split(`-`)}function r(e,t){return`${e}-${t}`}function i(e){return e&&e.type&&e.type.isTreeNode}function a(e,t){let n=[],r=t[e];function i(e=[]){e.forEach(({key:e,children:t})=>{n.push(e),i(t)})}return i(r.children),n}function o(e){if(e.parent){let t=n(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function s(e){let t=n(e.pos);return Number(t[t.length-1])===0}function c(e,t,n,r,i,a,c,l,u,d){let{clientX:f,clientY:p}=e,{top:m,height:h}=e.target.getBoundingClientRect(),g=((d===`rtl`?-1:1)*((i?.x||0)-f)-12)/r,_=l[n.eventKey];if(p<m+h/2){let e=c.findIndex(e=>e.key===_.key);_=l[c[e<=0?0:e-1].key]}let v=_.key,y=_,b=_.key,x=0,S=0;if(!u.has(v))for(let e=0;e<g&&o(_);e+=1)_=_.parent,S+=1;let C=t.eventData,w=_.node,T=!0;return s(_)&&_.level===0&&p<m+h/2&&a({dragNode:C,dropNode:w,dropPosition:-1})&&_.key===n.eventKey?x=-1:(y.children||[]).length&&u.has(b)?a({dragNode:C,dropNode:w,dropPosition:0})?x=0:T=!1:S===0?g>-1.5?a({dragNode:C,dropNode:w,dropPosition:1})?x=1:T=!1:a({dragNode:C,dropNode:w,dropPosition:0})?x=0:a({dragNode:C,dropNode:w,dropPosition:1})?x=1:T=!1:a({dragNode:C,dropNode:w,dropPosition:1})?x=1:T=!1,{dropPosition:x,dropLevelOffset:S,dropTargetKey:_.key,dropTargetPos:_.pos,dragOverNodeKey:b,dropContainerKey:x===0?null:_.parent?.key||null,dropAllowed:T}}function l(e,t){if(!e)return;let{multiple:n}=t;return n?e.slice():e.length?[e[0]]:e}function u(e){if(!e)return null;let t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(typeof e==`object`)t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return null;return t}function d(e,t){let n=new Set;function r(e){if(n.has(e))return;let i=t[e];if(!i)return;n.add(e);let{parent:a,node:o}=i;o.disabled||a&&r(a.key)}return(e||[]).forEach(e=>{r(e)}),[...n]}exports.arrAdd=t,exports.arrDel=e,exports.calcDropPosition=c,exports.calcSelectedKeys=l,exports.conductExpandParent=d,exports.getDragChildrenKeys=a,exports.getPosition=r,exports.isFirstChild=s,exports.isLastChild=o,exports.isTreeNode=i,exports.parseCheckedKeys=u,exports.posToArr=n;