{"version":3,"file":"B22L87Dp.js","sources":["../../../../src/composables/preventBodyScroll.ts"],"sourcesContent":["import StoreIds from '~/stores/storeIds';\nimport { defineStore } from 'pinia';\n\nconst useStore = defineStore(StoreIds.PREVENT_SCROLL, {\n state: () => ({\n sources: 0,\n }),\n actions: {\n preventScroll() {\n this.sources++;\n this.check();\n },\n allowScroll() {\n if (this.sources > 0) this.sources--;\n this.check();\n },\n check() {\n if (this.sources) {\n document.querySelector('html').classList.add('prevent-scroll');\n } else {\n document.querySelector('html').classList.remove('prevent-scroll');\n }\n },\n },\n});\n\nexport function usePreventBodyScroll(preventScroll: boolean) {\n const s = useStore();\n if (import.meta.client) {\n if (preventScroll) {\n s.preventScroll();\n } else {\n s.allowScroll();\n }\n }\n}\n"],"names":["useStore","defineStore","StoreIds","usePreventBodyScroll","preventScroll","s"],"mappings":"2CAGA,MAAMA,EAAWC,EAAYC,EAAS,eAAgB,CACpD,MAAO,KAAO,CACZ,QAAS,CAAA,GAEX,QAAS,CACP,eAAgB,CACT,KAAA,UACL,KAAK,MAAM,CACb,EACA,aAAc,CACR,KAAK,QAAU,GAAQ,KAAA,UAC3B,KAAK,MAAM,CACb,EACA,OAAQ,CACF,KAAK,QACP,SAAS,cAAc,MAAM,EAAE,UAAU,IAAI,gBAAgB,EAE7D,SAAS,cAAc,MAAM,EAAE,UAAU,OAAO,gBAAgB,CAEpE,CACF,CACF,CAAC,EAEM,SAASC,EAAqBC,EAAwB,CAC3D,MAAMC,EAAIL,IAEJI,EACFC,EAAE,cAAc,EAEhBA,EAAE,YAAY,CAGpB"}