require("../../vc-util/warning.js");function e(e,t){let n=new Set;return e.forEach(e=>{t.has(e)||n.add(e)}),n}function t(e){let{disabled:t,disableCheckbox:n,checkable:r}=e||{};return!!(t||n)||r===!1}function n(t,n,r,i){let a=new Set(t),o=new Set;for(let e=0;e<=r;e+=1)(n.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:r=[]}=e;a.has(t)&&!i(n)&&r.filter(e=>!i(e.node)).forEach(e=>{a.add(e.key)})});let s=new Set;for(let e=r;e>=0;--e)(n.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(i(n)||!e.parent||s.has(e.parent.key))return;if(i(e.parent.node)){s.add(t.key);return}let r=!0,c=!1;(t.children||[]).filter(e=>!i(e.node)).forEach(({key:e})=>{let t=a.has(e);r&&!t&&(r=!1),!c&&(t||o.has(e))&&(c=!0)}),r&&a.add(t.key),c&&o.add(t.key),s.add(t.key)});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(e(o,a))}}function r(t,n,r,i,a){let o=new Set(t),s=new Set(n);for(let e=0;e<=i;e+=1)(r.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:r=[]}=e;!o.has(t)&&!s.has(t)&&!a(n)&&r.filter(e=>!a(e.node)).forEach(e=>{o.delete(e.key)})});s=new Set;let c=new Set;for(let e=i;e>=0;--e)(r.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(a(n)||!e.parent||c.has(e.parent.key))return;if(a(e.parent.node)){c.add(t.key);return}let r=!0,i=!1;(t.children||[]).filter(e=>!a(e.node)).forEach(({key:e})=>{let t=o.has(e);r&&!t&&(r=!1),!i&&(t||s.has(e))&&(i=!0)}),r||o.delete(t.key),i&&s.add(t.key),c.add(t.key)});return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(e(s,o))}}function i(e,i,a,o,s,c){let l=[],u;u=c||t;let d=new Set(e.filter(e=>{let t=!!a[e];return t||l.push(e),t}));l.length,`${l.slice(0,100).map(e=>`'${e}'`).join(`, `)}`;let f;return f=i===!0?n(d,s,o,u):r(d,i.halfCheckedKeys,s,o,u),f}exports.conductCheck=i,exports.isCheckDisabled=t;