const e=require("../StyleContext.js"),t=require("./useHMR.js");let n=require("vue");function r(r,i,a,o){let s=e.useStyleInject(),c=(0,n.shallowRef)(``),l=(0,n.shallowRef)();(0,n.watchEffect)(()=>{c.value=[r,...i.value].join(`%`)}),t.default();let u=e=>{s.value.cache.update(e,e=>{let[t=0,n]=e||[];return t-1==0?(o?.(n,!1),null):[t-1,n]})};return(0,n.watch)(c,(e,t)=>{t&&u(t),s.value.cache.update(e,e=>{let[t=0,n]=e||[],r=n||a();return[t+1,r]}),l.value=s.value.cache.get(c.value)[1]},{immediate:!0}),(0,n.onBeforeUnmount)(()=>{u(c.value)}),l}exports.default=r;