const e=require("../utils/legacyUtil.js");let t=require("vue");function n(n,r,i){let a=(0,t.shallowRef)(),o=(0,t.shallowRef)(),s=(0,t.shallowRef)(),c=(0,t.shallowRef)([]);return(0,t.watch)([n,r],()=>{n.value?c.value=(0,t.toRaw)(n.value).slice():c.value=e.convertChildrenToData(r.value)},{immediate:!0,deep:!0}),(0,t.watchEffect)(()=>{let e=c.value,t=new Map,n=new Map,r=i.value;function l(e,i=!1){for(let a=0;a<e.length;a+=1){let o=e[a];!o[r.options]||i?(t.set(o[r.value],o),n.set(o[r.label],o)):l(o[r.options],!0)}}l(e),a.value=e,o.value=t,s.value=n}),{options:a,valueOptions:o,labelOptions:s}}exports.default=n;