import{S as e}from"./p-15c07fa9.js";const t=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const n=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(n=t))||n.isConnected);var n}));e.set(t,n)}})(...t)}),2e3)}})(),n=e.forceUpdate,o=e.getRenderingRef,r=(e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},s=(()=>{const e=((e,t=((e,t)=>e!==t))=>{const n=()=>{return("function"==typeof(t=e)?t():t)??{};var t},o=n();let s=new Map(Object.entries(o));const c="undefined"!=typeof Proxy,i=c?null:{},f={dispose:[],get:[],set:[],reset:[]},u=new Map,a=()=>{s=new Map(Object.entries(n())),c||w(),f.reset.forEach((e=>e()))},p=e=>(f.get.forEach((t=>t(e))),s.get(e)),l=(e,n)=>{const o=s.get(e);t(n,o,e)&&(s.set(e,n),c||b(e),f.set.forEach((t=>t(e,n,o))))},d=c?new Proxy(o,{get:(e,t)=>p(t),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>s.has(t),set:(e,t,n)=>(l(t,n),!0)}):(w(),i),g=(e,t)=>(f[e].push(t),()=>{r(f[e],t)});function b(e){!c&&i&&(Object.prototype.hasOwnProperty.call(i,e)||Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:()=>p(e),set(t){l(e,t)}}))}function w(){if(c||!i)return;const e=new Set(s.keys());for(const t of Object.keys(i))e.has(t)||delete i[t];for(const t of e)b(t)}return{state:d,get:p,set:l,on:g,onChange:(e,t)=>{const o=(n,o)=>{n===e&&t(o)},r=()=>{const o=n();t(o[e])},s=g("set",o),c=g("reset",r);return u.set(t,{setHandler:o,resetHandler:r,propName:e}),()=>{s(),c(),u.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(g("set",t.set)),t.get&&e.push(g("get",t.get)),t.reset&&e.push(g("reset",t.reset)),t.dispose&&e.push(g("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{f.dispose.forEach((e=>e())),a()},reset:a,forceUpdate:e=>{const t=s.get(e);f.set.forEach((n=>n(e,t,t)))},removeListener:(e,t)=>{const n=u.get(t);n&&n.propName===e&&(r(f.set,n.setHandler),r(f.reset,n.resetHandler),u.delete(t))}}})({exporterProviders:{},filterFieldsDataSource:void 0},void 0);return e.use((()=>{if("function"!=typeof o||"function"!=typeof n)return{};const e=n,r=o,s=new Map;return{dispose:()=>s.clear(),get:e=>{const t=r();t&&((e,t,n)=>{let o=e.get(t);o||(o=[],e.set(t,o)),o.some((e=>e.deref()===n))||o.push(new WeakRef(n))})(s,e,t)},set:n=>{const o=s.get(n);if(o){const t=o.filter((t=>{const n=t.deref();return!!n&&e(n)}));s.set(n,t)}t(s)},reset:()=>{s.forEach((t=>{t.forEach((t=>{const n=t.deref();n&&e(n)}))})),t(s)}}})()),e})();export{s}