import{u as m,d as u}from"./BZ0BXH4m.js";import{s as j}from"./B9BLuPDP.js";function k(i,l,e,r,f,p,a,s=!1){m(()=>{i(),u(()=>{if(!l()){s&&console.log("No selected solution, skipping");return}s&&console.log("Options changed",j(i()));const n=r(),o=i();if(n!==null){if(o.length){const c=n.map(t=>o[t]).filter(t=>t!==void 0);s&&console.log("Set selection from URL params",n,c,n,o),f(c)}s&&console.log("Reset URL params",n,l()),a(null)}else e()!==o.join(",")&&(s&&console.log("Reset selection to all options",l(),e(),o.join(",")),f(o));p(o.join(","))})})}export{k as u};
