{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport { deepmerge } from '@material-ui/utils';\nimport noopTheme from './noopTheme';\nexport default function getStylesCreator(stylesOrCreator) {\n var themingEnabled = typeof stylesOrCreator === 'function';\n\n if (process.env.NODE_ENV !== 'production') {\n if (_typeof(stylesOrCreator) !== 'object' && !themingEnabled) {\n console.error(['Material-UI: The `styles` argument provided is invalid.', 'You need to provide a function generating the styles or a styles object.'].join('\\n'));\n }\n }\n\n return {\n create: function create(theme, name) {\n var styles;\n\n try {\n styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n if (themingEnabled === true && theme === noopTheme) {\n // TODO: prepend error message/name instead\n console.error(['Material-UI: The `styles` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n }\n }\n\n throw err;\n }\n\n if (!name || !theme.overrides || !theme.overrides[name]) {\n return styles;\n }\n\n var overrides = theme.overrides[name];\n\n var stylesWithOverrides = _extends({}, styles);\n\n Object.keys(overrides).forEach(function (key) {\n if (process.env.NODE_ENV !== 'production') {\n if (!stylesWithOverrides[key]) {\n console.warn(['Material-UI: You are trying to override a style that does not exist.', \"Fix the `\".concat(key, \"` key of `theme.overrides.\").concat(name, \"`.\")].join('\\n'));\n }\n }\n\n stylesWithOverrides[key] = deepmerge(stylesWithOverrides[key], overrides[key]);\n });\n return stylesWithOverrides;\n },\n options: {}\n };\n}","map":{"version":3,"sources":["/app/node_modules/@material-ui/styles/esm/getStylesCreator/getStylesCreator.js"],"names":["_extends","_typeof","deepmerge","noopTheme","getStylesCreator","stylesOrCreator","themingEnabled","process","env","NODE_ENV","console","error","join","create","theme","name","styles","err","overrides","stylesWithOverrides","Object","keys","forEach","key","warn","concat","options"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,OAAP,M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,EAAKgB,MAAL,CAAlC;;AAEAI,MAAAA,MAAM,CAACC,IAAP,CAAYH,SAAZ,EAAuBI,OAAvB,CAA+B,UAAUC,GAAV,EAAe;AAC5C,YAAIhB,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;AACzC,cAAI,CAACU,mBAAmB,CAACI,GAAD,CAAxB,EAA+B;AAC7Bb,YAAAA,OAAO,CAACc,IAAR,CAAa,CAAC,sEAAD,EAAyE,YAAYC,MAAZ,CAAmBF,GAAnB,EAAwB,4BAAxB,EAAsDE,MAAtD,CAA6DV,IAA7D,EAAmE,IAAnE,CAAzE,EAAmJH,IAAnJ,CAAwJ,IAAxJ,CAAb;AACD;AACF;;AAEDO,QAAAA,mBAAmB,CAACI,GAAD,CAAnB,GAA2BrB,SAAS,CAACiB,mBAAmB,CAACI,GAAD,CAApB,EAA2BL,SAAS,CAACK,GAAD,CAApC,CAApC;AACD,OARD;AASA,aAAOJ,mBAAP;AACD,KAnCI;AAoCLO,IAAAA,OAAO,EAAE;AApCJ,GAAP;AAsCD","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport { deepmerge } from '@material-ui/utils';\nimport noopTheme from './noopTheme';\nexport default function getStylesCreator(stylesOrCreator) {\n var themingEnabled = typeof stylesOrCreator === 'function';\n\n if (process.env.NODE_ENV !== 'production') {\n if (_typeof(stylesOrCreator) !== 'object' && !themingEnabled) {\n console.error(['Material-UI: The `styles` argument provided is invalid.', 'You need to provide a function generating the styles or a styles object.'].join('\\n'));\n }\n }\n\n return {\n create: function create(theme, name) {\n var styles;\n\n try {\n styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n if (themingEnabled === true && theme === noopTheme) {\n // TODO: prepend error message/name instead\n console.error(['Material-UI: The `styles` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n }\n }\n\n throw err;\n }\n\n if (!name || !theme.overrides || !theme.overrides[name]) {\n return styles;\n }\n\n var overrides = theme.overrides[name];\n\n var stylesWithOverrides = _extends({}, styles);\n\n Object.keys(overrides).forEach(function (key) {\n if (process.env.NODE_ENV !== 'production') {\n if (!stylesWithOverrides[key]) {\n console.warn(['Material-UI: You are trying to override a style that does not exist.', \"Fix the `\".concat(key, \"` key of `theme.overrides.\").concat(name, \"`.\")].join('\\n'));\n }\n }\n\n stylesWithOverrides[key] = deepmerge(stylesWithOverrides[key], overrides[key]);\n });\n return stylesWithOverrides;\n },\n options: {}\n };\n}"]},"metadata":{},"sourceType":"module"}