{"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();\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,\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 {\\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 {\\n    \").concat(removedBarSizeVariable, \": \").concat(gap, \"px;\\n  }\\n\");\n};\n/**\n * Removes page scrollbar and blocks page scroll when mounted\n */\nexport var RemoveScrollBar = function (props) {\n  var noRelative = props.noRelative,\n    noImportant = props.noImportant,\n    _a = props.gapMode,\n    gapMode = _a === void 0 ? 'margin' : _a;\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","getStyles","_a","allowRelative","gapMode","important","left","top","right","gap","concat","filter","Boolean","join","RemoveScrollBar","props","noRelative","noImportant","useMemo","createElement","styles"],"sources":["C:/Users/user/Desktop/000newport/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();\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 {\\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 {\\n    \").concat(removedBarSizeVariable, \": \").concat(gap, \"px;\\n  }\\n\");\n};\n/**\n * Removes page scrollbar and blocks page scroll when mounted\n */\nexport var RemoveScrollBar = function (props) {\n    var noRelative = props.noRelative, noImportant = props.noImportant, _a = props.gapMode, gapMode = _a === void 0 ? 'margin' : _a;\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;AACA;AACA;AACA,IAAIO,SAAS,GAAG,SAAAA,CAAUC,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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