var CSS_OBJECT_STRINGIFIED_ERROR = "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
var transformExpressionWithStyles = function transformExpressionWithStyles(_ref) {
throw new Error("You have specified that '" + importSource + "' re-exports '" + reexported + "' from '@emotion/react' but it doesn't also re-export 'css' from '@emotion/react', 'css' is necessary for certain optimisations, please re-export it from '" + importSource + "'");
}
return cssExport;
};
var webStyledMacro = createStyledMacro({
importSource: '@emotion/styled/base',
originalImportSource: '@emotion/styled',
isWeb: true
});
var nativeStyledMacro = createStyledMacro({
importSource: '@emotion/native',
originalImportSource: '@emotion/native',
isWeb: false
});
var primitivesStyledMacro = createStyledMacro({
importSource: '@emotion/primitives',
originalImportSource: '@emotion/primitives',
isWeb: false
});
var vanillaEmotionMacro = createEmotionMacro('@emotion/css');
var AUTO_LABEL_VALUES = ['dev-only', 'never', 'always'];
function index (babel, options) {
if (options.autoLabel !== undefined && !AUTO_LABEL_VALUES.includes(options.autoLabel)) {
throw new Error("The 'autoLabel' option must be undefined, or one of the following: " + AUTO_LABEL_VALUES.map(function (s) {
return "\"" + s + "\"";
}).join(', '));
}
var t = babel.types;
return {
name: '@emotion',
inherits: syntaxJsx,
visitor: {
ImportDeclaration: function ImportDeclaration(path, state) {
var macro = state.pluginMacros[path.node.source.value]; // most of this is from https://github.com/kentcdodds/babel-plugin-macros/blob/main/src/index.js
if (macro === undefined) {
return;
}
if (t.isImportNamespaceSpecifier(path.node.specifiers[0])) {
return;
}
var imports = path.node.specifiers.map(function (s) {