{i(),Oi(this)},{checked:t!==!1});return}else i()}const l=this.parent;!l||l.level===0||o||Oi(l)}getChildren(t=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const o=this.store.props;let s="children";return o&&(s=o.children||"children"),n[s]===void 0&&(n[s]=null),t&&!n[s]&&(n[s]=[]),n[s]}updateChildren(){const t=this.getChildren()||[],n=this.childNodes.map(l=>l.data),o={},s=[];t.forEach((l,r)=>{const a=l[Rl];!!a&&n.findIndex(u=>u[Rl]===a)>=0?o[a]={index:r,data:l}:s.push({index:r,data:l})}),this.store.lazy||n.forEach(l=>{o[l[Rl]]||this.removeChildByData(l)}),s.forEach(({index:l,data:r})=>{this.insertChild({data:r},l)}),this.updateLeafState()}loadData(t,n={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(n).length)){this.loading=!0;const o=s=>{this.loaded=!0,this.loading=!1,this.childNodes=[],this.doCreateChildren(s,n),this.updateLeafState(),t&&t.call(this,s)};this.store.load(this,o)}else t&&t.call(this)}}class aZ{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const n in t)rt(t,n)&&(this[n]=t[n]);this.nodesMap={}}initialize(){this.root=new Xs({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load?this.load(this.root,n=>{this.root.doCreateChildren(n),this._initDefaultCheckedNodes()}):this._initDefaultCheckedNodes()}filter(t){const n=this.filterNodeMethod,o=this.lazy,s=function(l){const r=l.root?l.root.childNodes:l.childNodes;if(r.forEach(a=>{a.visible=n.call(a,t,a.data,a),s(a)}),!l.visible&&r.length){let a=!0;a=!r.some(i=>i.visible),l.root?l.root.visible=a===!1:l.visible=a===!1}!t||l.visible&&!l.isLeaf&&!o&&l.expand()};s(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof Xs)return t;const n=typeof t!="object"?t:Rp(this.key,t);return this.nodesMap[n]||null}insertBefore(t,n){const o=this.getNode(n);o.parent.insertBefore({data:t},o)}insertAfter(t,n){const o=this.getNode(n);o.parent.insertAfter({data:t},o)}remove(t){const n=this.getNode(t);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(t,n){const o=n?this.getNode(n):this.root;o&&o.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],n=this.nodesMap;t.forEach(o=>{const s=n[o];s&&s.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const n=this.key;!t||!t.data||(n?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){!this.key||!t||!t.data||(t.childNodes.forEach(o=>{this.deregisterNode(o)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,n=!1){const o=[],s=function(l){(l.root?l.root.childNodes:l.childNodes).forEach(a=>{(a.checked||n&&a.indeterminate)&&(!t||t&&a.isLeaf)&&o.push(a.data),s(a)})};return s(this),o}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const t=[],n=function(o){(o.root?o.root.childNodes:o.childNodes).forEach(l=>{l.indeterminate&&t.push(l.data),n(l)})};return n(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],n=this.nodesMap;for(const o in n)rt(n,o)&&t.push(n[o]);return t}updateChildren(t,n){const o=this.nodesMap[t];if(!o)return;const s=o.childNodes;for(let l=s.length-1;l>=0;l--){const r=s[l];this.remove(r.data)}for(let l=0,r=n.length;l