{"ast":null,"code":"import * as React from 'react';\nimport { styleSingleton } from 'react-style-singleton';\nimport { fullWidthClassName, zeroRightClassName, noScrollbarsClassName, removedBarSizeVariable } from './constants';\nimport { getGapWidth } from './utils';\nvar Style = styleSingleton();\nexport var lockAttribute = 'data-scroll-locked';\n// important tip - once we measure scrollBar width and remove them\n// we could not repeat this operation\n// thus we are using style-singleton - only the first \"yet correct\" style will be applied.\nvar getStyles = function getStyles(_a, allowRelative, gapMode, important) {\n  var left = _a.left,\n    top = _a.top,\n    right = _a.right,\n    gap = _a.gap;\n  if (gapMode === void 0) {\n    gapMode = 'margin';\n  }\n  return \"\\n  .\".concat(noScrollbarsClassName, \" {\\n   overflow: hidden \").concat(important, \";\\n   padding-right: \").concat(gap, \"px \").concat(important, \";\\n  }\\n  body[\").concat(lockAttribute, \"] {\\n    overflow: hidden \").concat(important, \";\\n    overscroll-behavior: contain;\\n    \").concat([allowRelative && \"position: relative \".concat(important, \";\"), gapMode === 'margin' && \"\\n    padding-left: \".concat(left, \"px;\\n    padding-top: \").concat(top, \"px;\\n    padding-right: \").concat(right, \"px;\\n    margin-left:0;\\n    margin-top:0;\\n    margin-right: \").concat(gap, \"px \").concat(important, \";\\n    \"), gapMode === 'padding' && \"padding-right: \".concat(gap, \"px \").concat(important, \";\")].filter(Boolean).join(''), \"\\n  }\\n  \\n  .\").concat(zeroRightClassName, \" {\\n    right: \").concat(gap, \"px \").concat(important, \";\\n  }\\n  \\n  .\").concat(fullWidthClassName, \" {\\n    margin-right: \").concat(gap, \"px \").concat(important, \";\\n  }\\n  \\n  .\").concat(zeroRightClassName, \" .\").concat(zeroRightClassName, \" {\\n    right: 0 \").concat(important, \";\\n  }\\n  \\n  .\").concat(fullWidthClassName, \" .\").concat(fullWidthClassName, \" {\\n    margin-right: 0 \").concat(important, \";\\n  }\\n  \\n  body[\").concat(lockAttribute, \"] {\\n    \").concat(removedBarSizeVariable, \": \").concat(gap, \"px;\\n  }\\n\");\n};\nvar getCurrentUseCounter = function getCurrentUseCounter() {\n  var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);\n  return isFinite(counter) ? counter : 0;\n};\nexport var useLockAttribute = function useLockAttribute() {\n  React.useEffect(function () {\n    document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());\n    return function () {\n      var newCounter = getCurrentUseCounter() - 1;\n      if (newCounter <= 0) {\n        document.body.removeAttribute(lockAttribute);\n      } else {\n        document.body.setAttribute(lockAttribute, newCounter.toString());\n      }\n    };\n  }, []);\n};\n/**\n * Removes page scrollbar and blocks page scroll when mounted\n */\nexport var RemoveScrollBar = function RemoveScrollBar(_a) {\n  var noRelative = _a.noRelative,\n    noImportant = _a.noImportant,\n    _b = _a.gapMode,\n    gapMode = _b === void 0 ? 'margin' : _b;\n  useLockAttribute();\n  /*\n   gap will be measured on every component mount\n   however it will be used only by the \"first\" invocation\n   due to singleton nature of <Style\n   */\n  var gap = React.useMemo(function () {\n    return getGapWidth(gapMode);\n  }, [gapMode]);\n  return React.createElement(Style, {\n    styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '')\n  });\n};","map":{"version":3,"names":["React","styleSingleton","fullWidthClassName","zeroRightClassName","noScrollbarsClassName","removedBarSizeVariable","getGapWidth","Style","lockAttribute","getStyles","_a","allowRelative","gapMode","important","left","top","right","gap","concat","filter","Boolean","join","getCurrentUseCounter","counter","parseInt","document","body","getAttribute","isFinite","useLockAttribute","useEffect","setAttribute","toString","newCounter","removeAttribute","RemoveScrollBar","noRelative","noImportant","_b","useMemo","createElement","styles"],"sources":["C:/ldt/LDT/management/node_modules/react-remove-scroll-bar/dist/es2015/component.js"],"sourcesContent":["import * as React from 'react';\nimport { styleSingleton } from 'react-style-singleton';\nimport { fullWidthClassName, zeroRightClassName, noScrollbarsClassName, removedBarSizeVariable } from './constants';\nimport { getGapWidth } from './utils';\nvar Style = styleSingleton();\nexport var lockAttribute = 'data-scroll-locked';\n// important tip - once we measure scrollBar width and remove them\n// we could not repeat this operation\n// thus we are using style-singleton - only the first \"yet correct\" style will be applied.\nvar getStyles = function (_a, allowRelative, gapMode, important) {\n    var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;\n    if (gapMode === void 0) { gapMode = 'margin'; }\n    return \"\\n  .\".concat(noScrollbarsClassName, \" {\\n   overflow: hidden \").concat(important, \";\\n   padding-right: \").concat(gap, \"px \").concat(important, \";\\n  }\\n  body[\").concat(lockAttribute, \"] {\\n    overflow: hidden \").concat(important, \";\\n    overscroll-behavior: contain;\\n    \").concat([\n        allowRelative && \"position: relative \".concat(important, \";\"),\n        gapMode === 'margin' &&\n            \"\\n    padding-left: \".concat(left, \"px;\\n    padding-top: \").concat(top, \"px;\\n    padding-right: \").concat(right, \"px;\\n    margin-left:0;\\n    margin-top:0;\\n    margin-right: \").concat(gap, \"px \").concat(important, \";\\n    \"),\n        gapMode === 'padding' && \"padding-right: \".concat(gap, \"px \").concat(important, \";\"),\n    ]\n        .filter(Boolean)\n        .join(''), \"\\n  }\\n  \\n  .\").concat(zeroRightClassName, \" {\\n    right: \").concat(gap, \"px \").concat(important, \";\\n  }\\n  \\n  .\").concat(fullWidthClassName, \" {\\n    margin-right: \").concat(gap, \"px \").concat(important, \";\\n  }\\n  \\n  .\").concat(zeroRightClassName, \" .\").concat(zeroRightClassName, \" {\\n    right: 0 \").concat(important, \";\\n  }\\n  \\n  .\").concat(fullWidthClassName, \" .\").concat(fullWidthClassName, \" {\\n    margin-right: 0 \").concat(important, \";\\n  }\\n  \\n  body[\").concat(lockAttribute, \"] {\\n    \").concat(removedBarSizeVariable, \": \").concat(gap, \"px;\\n  }\\n\");\n};\nvar getCurrentUseCounter = function () {\n    var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);\n    return isFinite(counter) ? counter : 0;\n};\nexport var useLockAttribute = function () {\n    React.useEffect(function () {\n        document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());\n        return function () {\n            var newCounter = getCurrentUseCounter() - 1;\n            if (newCounter <= 0) {\n                document.body.removeAttribute(lockAttribute);\n            }\n            else {\n                document.body.setAttribute(lockAttribute, newCounter.toString());\n            }\n        };\n    }, []);\n};\n/**\n * Removes page scrollbar and blocks page scroll when mounted\n */\nexport var RemoveScrollBar = function (_a) {\n    var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b;\n    useLockAttribute();\n    /*\n     gap will be measured on every component mount\n     however it will be used only by the \"first\" invocation\n     due to singleton nature of <Style\n     */\n    var gap = React.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);\n    return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,kBAAkB,EAAEC,kBAAkB,EAAEC,qBAAqB,EAAEC,sBAAsB,QAAQ,aAAa;AACnH,SAASC,WAAW,QAAQ,SAAS;AACrC,IAAIC,KAAK,GAAGN,cAAc,CAAC,CAAC;AAC5B,OAAO,IAAIO,aAAa,GAAG,oBAAoB;AAC/C;AACA;AACA;AACA,IAAIC,SAAS,GAAG,SAAZA,SAASA,CAAaC,EAAE,EAAEC,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAE;EAC7D,IAAIC,IAAI,GAAGJ,EAAE,CAACI,IAAI;IAAEC,GAAG,GAAGL,EAAE,CAACK,GAAG;IAAEC,KAAK,GAAGN,EAAE,CAACM,KAAK;IAAEC,GAAG,GAAGP,EAAE,CAACO,GAAG;EAChE,IAAIL,OAAO,KAAK,KAAK,CAAC,EAAE;IAAEA,OAAO,GAAG,QAAQ;EAAE;EAC9C,OAAO,OAAO,CAACM,MAAM,CAACd,qBAAqB,EAAE,0BAA0B,CAAC,CAACc,MAAM,CAACL,SAAS,EAAE,uBAAuB,CAAC,CAACK,MAAM,CAACD,GAAG,EAAE,KAAK,CAAC,CAACC,MAAM,CAACL,S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