import{computed as d,watchEffect as m}from"vue";import u from"../canUseDom.mjs";import f from"../getScrollBarSize.mjs";import{updateCSS as s,removeCSS as t}from"../../vc-util/Dom/dynamicCSS.mjs";const a=`vc-util-locker-${Date.now()}`;let i=0;function h(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}function g(e){const r=d(()=>!!e&&!!e.value);i+=1;const o=`${a}_${i}`;m(n=>{if(u()){if(r.value){const c=f(),l=h();s(`
html body {
  overflow-y: hidden;
  ${l?`width: calc(100% - ${c}px);`:""}
}`,o)}else t(o);n(()=>{t(o)})}},{flush:"post"})}export{g as default,h as isBodyOverflowing};
