"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.sublimeDarkStyle = exports.sublime = exports.defaultSettingsSublime = void 0;
exports.sublimeInit = sublimeInit;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _highlight = require("@lezer/highlight");
var _codemirrorThemes = require("@uiw/codemirror-themes");
var defaultSettingsSublime = exports.defaultSettingsSublime = {
  background: '#303841',
  foreground: '#FFFFFF',
  caret: '#FBAC52',
  selection: '#4C5964',
  selectionMatch: '#3A546E',
  gutterBackground: '#303841',
  gutterForeground: '#FFFFFF70',
  lineHighlight: '#00000059'
};
var sublimeDarkStyle = exports.sublimeDarkStyle = [{
  tag: [_highlight.tags.meta, _highlight.tags.comment],
  color: '#A2A9B5'
}, {
  tag: [_highlight.tags.attributeName, _highlight.tags.keyword],
  color: '#B78FBA'
}, {
  tag: _highlight.tags["function"](_highlight.tags.variableName),
  color: '#5AB0B0'
}, {
  tag: [_highlight.tags.string, _highlight.tags.regexp, _highlight.tags.attributeValue],
  color: '#99C592'
}, {
  tag: _highlight.tags.operator,
  color: '#f47954'
},
// { tag: t.moduleKeyword, color: 'red' },
{
  tag: [_highlight.tags.tagName, _highlight.tags.modifier],
  color: '#E35F63'
}, {
  tag: [_highlight.tags.number, _highlight.tags.definition(_highlight.tags.tagName), _highlight.tags.className, _highlight.tags.definition(_highlight.tags.variableName)],
  color: '#fbac52'
}, {
  tag: [_highlight.tags.atom, _highlight.tags.bool, _highlight.tags.special(_highlight.tags.variableName)],
  color: '#E35F63'
}, {
  tag: _highlight.tags.variableName,
  color: '#539ac4'
}, {
  tag: [_highlight.tags.propertyName, _highlight.tags.typeName],
  color: '#629ccd'
}, {
  tag: _highlight.tags.propertyName,
  color: '#36b7b5'
}];
function sublimeInit(options) {
  var _ref = options || {},
    _ref$theme = _ref.theme,
    theme = _ref$theme === void 0 ? 'dark' : _ref$theme,
    _ref$settings = _ref.settings,
    settings = _ref$settings === void 0 ? {} : _ref$settings,
    _ref$styles = _ref.styles,
    styles = _ref$styles === void 0 ? [] : _ref$styles;
  return (0, _codemirrorThemes.createTheme)({
    theme: theme,
    settings: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defaultSettingsSublime), settings),
    styles: [].concat(sublimeDarkStyle, (0, _toConsumableArray2["default"])(styles))
  });
}
var sublime = exports.sublime = sublimeInit();