@vue/compiler-sfc 2.7.14 → 2.7.16-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/compiler-sfc.js +221 -982
  2. package/package.json +6 -3
@@ -138,9 +138,16 @@ function toString$2(val) {
138
138
  return val == null
139
139
  ? ''
140
140
  : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
141
- ? JSON.stringify(val, null, 2)
141
+ ? JSON.stringify(val, replacer, 2)
142
142
  : String(val);
143
143
  }
144
+ function replacer(_key, val) {
145
+ // avoid circular deps from v3
146
+ if (val && val.__v_isRef) {
147
+ return val.value;
148
+ }
149
+ return val;
150
+ }
144
151
  /**
145
152
  * Convert an input value to a number for persistence.
146
153
  * If the conversion fails, return original string.
@@ -248,9 +255,7 @@ const identity = (_) => _;
248
255
  */
249
256
  function genStaticKeys$1(modules) {
250
257
  return modules
251
- .reduce((keys, m) => {
252
- return keys.concat(m.staticKeys || []);
253
- }, [])
258
+ .reduce((keys, m) => keys.concat(m.staticKeys || []), [])
254
259
  .join(',');
255
260
  }
256
261
  /**
@@ -413,7 +418,7 @@ function parseHTML(html, options) {
413
418
  continue;
414
419
  }
415
420
  }
416
- // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
421
+ // https://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
417
422
  if (conditionalComment.test(html)) {
418
423
  const conditionalEnd = html.indexOf(']>');
419
424
  if (conditionalEnd >= 0) {
@@ -3644,7 +3649,7 @@ methodsToPatch.forEach(function (method) {
3644
3649
  });
3645
3650
 
3646
3651
  const arrayKeys = Object.getOwnPropertyNames(arrayMethods);
3647
- const NO_INIITIAL_VALUE = {};
3652
+ const NO_INITIAL_VALUE = {};
3648
3653
  /**
3649
3654
  * In some cases we may want to disable observation inside a component's
3650
3655
  * update computation.
@@ -3701,7 +3706,7 @@ class Observer {
3701
3706
  const keys = Object.keys(value);
3702
3707
  for (let i = 0; i < keys.length; i++) {
3703
3708
  const key = keys[i];
3704
- defineReactive(value, key, NO_INIITIAL_VALUE, undefined, shallow, mock);
3709
+ defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
3705
3710
  }
3706
3711
  }
3707
3712
  }
@@ -3737,7 +3742,7 @@ function observe(value, shallow, ssrMockReactivity) {
3737
3742
  /**
3738
3743
  * Define a reactive property on an Object.
3739
3744
  */
3740
- function defineReactive(obj, key, val, customSetter, shallow, mock) {
3745
+ function defineReactive(obj, key, val, customSetter, shallow, mock, observeEvenIfShallow = false) {
3741
3746
  const dep = new Dep();
3742
3747
  const property = Object.getOwnPropertyDescriptor(obj, key);
3743
3748
  if (property && property.configurable === false) {
@@ -3747,10 +3752,10 @@ function defineReactive(obj, key, val, customSetter, shallow, mock) {
3747
3752
  const getter = property && property.get;
3748
3753
  const setter = property && property.set;
3749
3754
  if ((!getter || setter) &&
3750
- (val === NO_INIITIAL_VALUE || arguments.length === 2)) {
3755
+ (val === NO_INITIAL_VALUE || arguments.length === 2)) {
3751
3756
  val = obj[key];
3752
3757
  }
3753
- let childOb = !shallow && observe(val, false, mock);
3758
+ let childOb = shallow ? val && val.__ob__ : observe(val, false, mock);
3754
3759
  Object.defineProperty(obj, key, {
3755
3760
  enumerable: true,
3756
3761
  configurable: true,
@@ -3798,7 +3803,7 @@ function defineReactive(obj, key, val, customSetter, shallow, mock) {
3798
3803
  else {
3799
3804
  val = newVal;
3800
3805
  }
3801
- childOb = !shallow && observe(newVal, false, mock);
3806
+ childOb = shallow ? newVal && newVal.__ob__ : observe(newVal, false, mock);
3802
3807
  if (process.env.NODE_ENV !== 'production') {
3803
3808
  dep.notify({
3804
3809
  type: "set" /* TriggerOpTypes.SET */,
@@ -4786,7 +4791,7 @@ function deactivateChildComponent(vm, direct) {
4786
4791
  function callHook(vm, hook, args, setContext = true) {
4787
4792
  // #7573 disable dep collection when invoking lifecycle hooks
4788
4793
  pushTarget();
4789
- const prev = currentInstance;
4794
+ const prevInst = currentInstance;
4790
4795
  setContext && setCurrentInstance(vm);
4791
4796
  const handlers = vm.$options[hook];
4792
4797
  const info = `${hook} hook`;
@@ -4798,7 +4803,9 @@ function callHook(vm, hook, args, setContext = true) {
4798
4803
  if (vm._hasHookEvent) {
4799
4804
  vm.$emit('hook:' + hook);
4800
4805
  }
4801
- setContext && setCurrentInstance(prev);
4806
+ if (setContext) {
4807
+ setCurrentInstance(prevInst);
4808
+ }
4802
4809
  popTarget();
4803
4810
  }
4804
4811
 
@@ -8189,8 +8196,11 @@ function rewriteDefault(input, as, parserPlugins) {
8189
8196
  }).program.body;
8190
8197
  ast.forEach(node => {
8191
8198
  if (node.type === 'ExportDefaultDeclaration') {
8192
- if (node.declaration.type === 'ClassDeclaration') {
8193
- s.overwrite(node.start, node.declaration.id.start, `class `);
8199
+ if (node.declaration.type === 'ClassDeclaration' && node.declaration.id) {
8200
+ let start = node.declaration.decorators && node.declaration.decorators.length > 0
8201
+ ? node.declaration.decorators[node.declaration.decorators.length - 1].end
8202
+ : node.start;
8203
+ s.overwrite(start, node.declaration.id.start, ` class `);
8194
8204
  s.append(`\nconst ${as} = ${node.declaration.id.name}`);
8195
8205
  }
8196
8206
  else {
@@ -8468,7 +8478,10 @@ function compileScript(sfc, options = { id: '' }) {
8468
8478
  }
8469
8479
  }
8470
8480
  if (declId) {
8471
- emitIdentifier = scriptSetup.content.slice(declId.start, declId.end);
8481
+ emitIdentifier =
8482
+ declId.type === 'Identifier'
8483
+ ? declId.name
8484
+ : scriptSetup.content.slice(declId.start, declId.end);
8472
8485
  }
8473
8486
  return true;
8474
8487
  }
@@ -8845,12 +8858,12 @@ function compileScript(sfc, options = { id: '' }) {
8845
8858
  else {
8846
8859
  let start = decl.start + startOffset;
8847
8860
  let end = decl.end + startOffset;
8848
- if (i < total - 1) {
8849
- // not the last one, locate the start of the next
8861
+ if (i === 0) {
8862
+ // first one, locate the start of the next
8850
8863
  end = node.declarations[i + 1].start + startOffset;
8851
8864
  }
8852
8865
  else {
8853
- // last one, locate the end of the prev
8866
+ // not first one, locate the end of the prev
8854
8867
  start = node.declarations[i - 1].end + startOffset;
8855
8868
  }
8856
8869
  s.remove(start, end);
@@ -9024,7 +9037,7 @@ function compileScript(sfc, options = { id: '' }) {
9024
9037
  // we use a default __props so that template expressions referencing props
9025
9038
  // can use it directly
9026
9039
  if (propsIdentifier) {
9027
- s.prependLeft(startOffset, `\nconst ${propsIdentifier} = __props${propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : ``}\n`);
9040
+ s.prependLeft(startOffset, `\nconst ${propsIdentifier} = __props${propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : ``};\n`);
9028
9041
  }
9029
9042
  const destructureElements = hasDefineExposeCall ? [`expose`] : [];
9030
9043
  if (emitIdentifier) {
@@ -9559,6 +9572,9 @@ function resolveTemplateUsageCheckString(sfc, isTS) {
9559
9572
  code += `,${processExp(value, isTS, baseName)}`;
9560
9573
  }
9561
9574
  }
9575
+ else if (name === 'ref') {
9576
+ code += `,${value}`;
9577
+ }
9562
9578
  }
9563
9579
  },
9564
9580
  chars(text) {
@@ -9578,7 +9594,7 @@ function processExp(exp, isTS, dir) {
9578
9594
  exp = `(${exp})=>{}`;
9579
9595
  }
9580
9596
  else if (dir === 'on') {
9581
- exp = `()=>{${exp}}`;
9597
+ exp = `()=>{return ${exp}}`;
9582
9598
  }
9583
9599
  else if (dir === 'for') {
9584
9600
  const inMatch = exp.match(forAliasRE);
@@ -13361,7 +13377,6 @@ var unesc = {exports: {}};
13361
13377
 
13362
13378
  exports.__esModule = true;
13363
13379
  exports["default"] = unesc;
13364
-
13365
13380
  // Many thanks for this post which made this migration much easier.
13366
13381
  // https://mathiasbynens.be/notes/css-escapes
13367
13382
 
@@ -13374,81 +13389,65 @@ var unesc = {exports: {}};
13374
13389
  var lower = str.toLowerCase();
13375
13390
  var hex = '';
13376
13391
  var spaceTerminated = false;
13377
-
13378
13392
  for (var i = 0; i < 6 && lower[i] !== undefined; i++) {
13379
- var code = lower.charCodeAt(i); // check to see if we are dealing with a valid hex char [a-f|0-9]
13380
-
13381
- var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point
13382
-
13393
+ var code = lower.charCodeAt(i);
13394
+ // check to see if we are dealing with a valid hex char [a-f|0-9]
13395
+ var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57;
13396
+ // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point
13383
13397
  spaceTerminated = code === 32;
13384
-
13385
13398
  if (!valid) {
13386
13399
  break;
13387
13400
  }
13388
-
13389
13401
  hex += lower[i];
13390
13402
  }
13391
-
13392
13403
  if (hex.length === 0) {
13393
13404
  return undefined;
13394
13405
  }
13395
-
13396
13406
  var codePoint = parseInt(hex, 16);
13397
- var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; // Add special case for
13407
+ var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF;
13408
+ // Add special case for
13398
13409
  // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point"
13399
13410
  // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point
13400
-
13401
13411
  if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) {
13402
13412
  return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)];
13403
13413
  }
13404
-
13405
13414
  return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
13406
13415
  }
13407
-
13408
13416
  var CONTAINS_ESCAPE = /\\/;
13409
-
13410
13417
  function unesc(str) {
13411
13418
  var needToProcess = CONTAINS_ESCAPE.test(str);
13412
-
13413
13419
  if (!needToProcess) {
13414
13420
  return str;
13415
13421
  }
13416
-
13417
13422
  var ret = "";
13418
-
13419
13423
  for (var i = 0; i < str.length; i++) {
13420
13424
  if (str[i] === "\\") {
13421
13425
  var gobbled = gobbleHex(str.slice(i + 1, i + 7));
13422
-
13423
13426
  if (gobbled !== undefined) {
13424
13427
  ret += gobbled[0];
13425
13428
  i += gobbled[1];
13426
13429
  continue;
13427
- } // Retain a pair of \\ if double escaped `\\\\`
13428
- // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e
13429
-
13430
+ }
13430
13431
 
13432
+ // Retain a pair of \\ if double escaped `\\\\`
13433
+ // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e
13431
13434
  if (str[i + 1] === "\\") {
13432
13435
  ret += "\\";
13433
13436
  i++;
13434
13437
  continue;
13435
- } // if \\ is at the end of the string retain it
13436
- // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb
13437
-
13438
+ }
13438
13439
 
13440
+ // if \\ is at the end of the string retain it
13441
+ // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb
13439
13442
  if (str.length === i + 1) {
13440
13443
  ret += str[i];
13441
13444
  }
13442
-
13443
13445
  continue;
13444
13446
  }
13445
-
13446
13447
  ret += str[i];
13447
13448
  }
13448
-
13449
13449
  return ret;
13450
13450
  }
13451
-
13452
13451
  module.exports = exports.default;
13453
13452
  } (unesc, unesc.exports));
13454
13453
 
@@ -13458,25 +13457,19 @@ var getProp = {exports: {}};
13458
13457
 
13459
13458
  exports.__esModule = true;
13460
13459
  exports["default"] = getProp;
13461
-
13462
13460
  function getProp(obj) {
13463
13461
  for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
13464
13462
  props[_key - 1] = arguments[_key];
13465
13463
  }
13466
-
13467
13464
  while (props.length > 0) {
13468
13465
  var prop = props.shift();
13469
-
13470
13466
  if (!obj[prop]) {
13471
13467
  return undefined;
13472
13468
  }
13473
-
13474
13469
  obj = obj[prop];
13475
13470
  }
13476
-
13477
13471
  return obj;
13478
13472
  }
13479
-
13480
13473
  module.exports = exports.default;
13481
13474
  } (getProp, getProp.exports));
13482
13475
 
@@ -13486,23 +13479,18 @@ var ensureObject = {exports: {}};
13486
13479
 
13487
13480
  exports.__esModule = true;
13488
13481
  exports["default"] = ensureObject;
13489
-
13490
13482
  function ensureObject(obj) {
13491
13483
  for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
13492
13484
  props[_key - 1] = arguments[_key];
13493
13485
  }
13494
-
13495
13486
  while (props.length > 0) {
13496
13487
  var prop = props.shift();
13497
-
13498
13488
  if (!obj[prop]) {
13499
13489
  obj[prop] = {};
13500
13490
  }
13501
-
13502
13491
  obj = obj[prop];
13503
13492
  }
13504
13493
  }
13505
-
13506
13494
  module.exports = exports.default;
13507
13495
  } (ensureObject, ensureObject.exports));
13508
13496
 
@@ -13512,78 +13500,55 @@ var stripComments = {exports: {}};
13512
13500
 
13513
13501
  exports.__esModule = true;
13514
13502
  exports["default"] = stripComments;
13515
-
13516
13503
  function stripComments(str) {
13517
13504
  var s = "";
13518
13505
  var commentStart = str.indexOf("/*");
13519
13506
  var lastEnd = 0;
13520
-
13521
13507
  while (commentStart >= 0) {
13522
13508
  s = s + str.slice(lastEnd, commentStart);
13523
13509
  var commentEnd = str.indexOf("*/", commentStart + 2);
13524
-
13525
13510
  if (commentEnd < 0) {
13526
13511
  return s;
13527
13512
  }
13528
-
13529
13513
  lastEnd = commentEnd + 2;
13530
13514
  commentStart = str.indexOf("/*", lastEnd);
13531
13515
  }
13532
-
13533
13516
  s = s + str.slice(lastEnd);
13534
13517
  return s;
13535
13518
  }
13536
-
13537
13519
  module.exports = exports.default;
13538
13520
  } (stripComments, stripComments.exports));
13539
13521
 
13540
13522
  util.__esModule = true;
13541
- util.stripComments = util.ensureObject = util.getProp = util.unesc = void 0;
13542
-
13523
+ util.unesc = util.stripComments = util.getProp = util.ensureObject = void 0;
13543
13524
  var _unesc = _interopRequireDefault$1(unesc.exports);
13544
-
13545
13525
  util.unesc = _unesc["default"];
13546
-
13547
13526
  var _getProp = _interopRequireDefault$1(getProp.exports);
13548
-
13549
13527
  util.getProp = _getProp["default"];
13550
-
13551
13528
  var _ensureObject = _interopRequireDefault$1(ensureObject.exports);
13552
-
13553
13529
  util.ensureObject = _ensureObject["default"];
13554
-
13555
13530
  var _stripComments = _interopRequireDefault$1(stripComments.exports);
13556
-
13557
13531
  util.stripComments = _stripComments["default"];
13558
-
13559
13532
  function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13560
13533
 
13561
13534
  (function (module, exports) {
13562
13535
 
13563
13536
  exports.__esModule = true;
13564
13537
  exports["default"] = void 0;
13565
-
13566
13538
  var _util = util;
13567
-
13568
13539
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
13569
-
13570
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
13571
-
13540
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13572
13541
  var cloneNode = function cloneNode(obj, parent) {
13573
13542
  if (typeof obj !== 'object' || obj === null) {
13574
13543
  return obj;
13575
13544
  }
13576
-
13577
13545
  var cloned = new obj.constructor();
13578
-
13579
13546
  for (var i in obj) {
13580
13547
  if (!obj.hasOwnProperty(i)) {
13581
13548
  continue;
13582
13549
  }
13583
-
13584
13550
  var value = obj[i];
13585
13551
  var type = typeof value;
13586
-
13587
13552
  if (i === 'parent' && type === 'object') {
13588
13553
  if (parent) {
13589
13554
  cloned[i] = parent;
@@ -13596,66 +13561,52 @@ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : {
13596
13561
  cloned[i] = cloneNode(value, cloned);
13597
13562
  }
13598
13563
  }
13599
-
13600
13564
  return cloned;
13601
13565
  };
13602
-
13603
13566
  var Node = /*#__PURE__*/function () {
13604
13567
  function Node(opts) {
13605
13568
  if (opts === void 0) {
13606
13569
  opts = {};
13607
13570
  }
13608
-
13609
13571
  Object.assign(this, opts);
13610
13572
  this.spaces = this.spaces || {};
13611
13573
  this.spaces.before = this.spaces.before || '';
13612
13574
  this.spaces.after = this.spaces.after || '';
13613
13575
  }
13614
-
13615
13576
  var _proto = Node.prototype;
13616
-
13617
13577
  _proto.remove = function remove() {
13618
13578
  if (this.parent) {
13619
13579
  this.parent.removeChild(this);
13620
13580
  }
13621
-
13622
13581
  this.parent = undefined;
13623
13582
  return this;
13624
13583
  };
13625
-
13626
13584
  _proto.replaceWith = function replaceWith() {
13627
13585
  if (this.parent) {
13628
13586
  for (var index in arguments) {
13629
13587
  this.parent.insertBefore(this, arguments[index]);
13630
13588
  }
13631
-
13632
13589
  this.remove();
13633
13590
  }
13634
-
13635
13591
  return this;
13636
13592
  };
13637
-
13638
13593
  _proto.next = function next() {
13639
13594
  return this.parent.at(this.parent.index(this) + 1);
13640
13595
  };
13641
-
13642
13596
  _proto.prev = function prev() {
13643
13597
  return this.parent.at(this.parent.index(this) - 1);
13644
13598
  };
13645
-
13646
13599
  _proto.clone = function clone(overrides) {
13647
13600
  if (overrides === void 0) {
13648
13601
  overrides = {};
13649
13602
  }
13650
-
13651
13603
  var cloned = cloneNode(this);
13652
-
13653
13604
  for (var name in overrides) {
13654
13605
  cloned[name] = overrides[name];
13655
13606
  }
13656
-
13657
13607
  return cloned;
13658
13608
  }
13609
+
13659
13610
  /**
13660
13611
  * Some non-standard syntax doesn't follow normal escaping rules for css.
13661
13612
  * This allows non standard syntax to be appended to an existing property
@@ -13664,24 +13615,21 @@ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : {
13664
13615
  * @param {string} name the property to set
13665
13616
  * @param {any} value the unescaped value of the property
13666
13617
  * @param {string} valueEscaped optional. the escaped value of the property.
13667
- */
13668
- ;
13669
-
13618
+ */;
13670
13619
  _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {
13671
13620
  if (!this.raws) {
13672
13621
  this.raws = {};
13673
13622
  }
13674
-
13675
13623
  var originalValue = this[name];
13676
13624
  var originalEscaped = this.raws[name];
13677
13625
  this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.
13678
-
13679
13626
  if (originalEscaped || valueEscaped !== value) {
13680
13627
  this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
13681
13628
  } else {
13682
13629
  delete this.raws[name]; // delete any escaped value that was created by the setter.
13683
13630
  }
13684
13631
  }
13632
+
13685
13633
  /**
13686
13634
  * Some non-standard syntax doesn't follow normal escaping rules for css.
13687
13635
  * This allows the escaped value to be specified directly, allowing illegal
@@ -13689,86 +13637,68 @@ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : {
13689
13637
  * @param {string} name the property to set
13690
13638
  * @param {any} value the unescaped value of the property
13691
13639
  * @param {string} valueEscaped the escaped value of the property.
13692
- */
13693
- ;
13694
-
13640
+ */;
13695
13641
  _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {
13696
13642
  if (!this.raws) {
13697
13643
  this.raws = {};
13698
13644
  }
13699
-
13700
13645
  this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
13701
-
13702
13646
  this.raws[name] = valueEscaped;
13703
13647
  }
13648
+
13704
13649
  /**
13705
13650
  * When you want a value to passed through to CSS directly. This method
13706
13651
  * deletes the corresponding raw value causing the stringifier to fallback
13707
13652
  * to the unescaped value.
13708
13653
  * @param {string} name the property to set.
13709
13654
  * @param {any} value The value that is both escaped and unescaped.
13710
- */
13711
- ;
13712
-
13655
+ */;
13713
13656
  _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {
13714
13657
  this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
13715
-
13716
13658
  if (this.raws) {
13717
13659
  delete this.raws[name];
13718
13660
  }
13719
13661
  }
13662
+
13720
13663
  /**
13721
13664
  *
13722
13665
  * @param {number} line The number (starting with 1)
13723
13666
  * @param {number} column The column number (starting with 1)
13724
- */
13725
- ;
13726
-
13667
+ */;
13727
13668
  _proto.isAtPosition = function isAtPosition(line, column) {
13728
13669
  if (this.source && this.source.start && this.source.end) {
13729
13670
  if (this.source.start.line > line) {
13730
13671
  return false;
13731
13672
  }
13732
-
13733
13673
  if (this.source.end.line < line) {
13734
13674
  return false;
13735
13675
  }
13736
-
13737
13676
  if (this.source.start.line === line && this.source.start.column > column) {
13738
13677
  return false;
13739
13678
  }
13740
-
13741
13679
  if (this.source.end.line === line && this.source.end.column < column) {
13742
13680
  return false;
13743
13681
  }
13744
-
13745
13682
  return true;
13746
13683
  }
13747
-
13748
13684
  return undefined;
13749
13685
  };
13750
-
13751
13686
  _proto.stringifyProperty = function stringifyProperty(name) {
13752
13687
  return this.raws && this.raws[name] || this[name];
13753
13688
  };
13754
-
13755
13689
  _proto.valueToString = function valueToString() {
13756
13690
  return String(this.stringifyProperty("value"));
13757
13691
  };
13758
-
13759
13692
  _proto.toString = function toString() {
13760
13693
  return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join('');
13761
13694
  };
13762
-
13763
13695
  _createClass(Node, [{
13764
13696
  key: "rawSpaceBefore",
13765
13697
  get: function get() {
13766
13698
  var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
13767
-
13768
13699
  if (rawSpace === undefined) {
13769
13700
  rawSpace = this.spaces && this.spaces.before;
13770
13701
  }
13771
-
13772
13702
  return rawSpace || "";
13773
13703
  },
13774
13704
  set: function set(raw) {
@@ -13779,11 +13709,9 @@ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : {
13779
13709
  key: "rawSpaceAfter",
13780
13710
  get: function get() {
13781
13711
  var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
13782
-
13783
13712
  if (rawSpace === undefined) {
13784
13713
  rawSpace = this.spaces.after;
13785
13714
  }
13786
-
13787
13715
  return rawSpace || "";
13788
13716
  },
13789
13717
  set: function set(raw) {
@@ -13791,10 +13719,8 @@ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : {
13791
13719
  this.raws.spaces.after = raw;
13792
13720
  }
13793
13721
  }]);
13794
-
13795
13722
  return Node;
13796
13723
  }();
13797
-
13798
13724
  exports["default"] = Node;
13799
13725
  module.exports = exports.default;
13800
13726
  } (node$1, node$1.exports));
@@ -13802,7 +13728,7 @@ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : {
13802
13728
  var types = {};
13803
13729
 
13804
13730
  types.__esModule = true;
13805
- types.UNIVERSAL = types.ATTRIBUTE = types.CLASS = types.COMBINATOR = types.COMMENT = types.ID = types.NESTING = types.PSEUDO = types.ROOT = types.SELECTOR = types.STRING = types.TAG = void 0;
13731
+ types.UNIVERSAL = types.TAG = types.STRING = types.SELECTOR = types.ROOT = types.PSEUDO = types.NESTING = types.ID = types.COMMENT = types.COMBINATOR = types.CLASS = types.ATTRIBUTE = void 0;
13806
13732
  var TAG = 'tag';
13807
13733
  types.TAG = TAG;
13808
13734
  var STRING = 'string';
@@ -13832,145 +13758,105 @@ types.UNIVERSAL = UNIVERSAL;
13832
13758
 
13833
13759
  exports.__esModule = true;
13834
13760
  exports["default"] = void 0;
13835
-
13836
13761
  var _node = _interopRequireDefault(node$1.exports);
13837
-
13838
13762
  var types$1 = _interopRequireWildcard(types);
13839
-
13840
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
13841
-
13842
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13843
-
13763
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13764
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13844
13765
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13845
-
13846
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
13847
-
13766
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13848
13767
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13849
-
13850
13768
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13851
-
13852
13769
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
13853
-
13854
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
13855
-
13770
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13856
13771
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
13857
-
13858
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
13859
-
13772
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
13860
13773
  var Container = /*#__PURE__*/function (_Node) {
13861
13774
  _inheritsLoose(Container, _Node);
13862
-
13863
13775
  function Container(opts) {
13864
13776
  var _this;
13865
-
13866
13777
  _this = _Node.call(this, opts) || this;
13867
-
13868
13778
  if (!_this.nodes) {
13869
13779
  _this.nodes = [];
13870
13780
  }
13871
-
13872
13781
  return _this;
13873
13782
  }
13874
-
13875
13783
  var _proto = Container.prototype;
13876
-
13877
13784
  _proto.append = function append(selector) {
13878
13785
  selector.parent = this;
13879
13786
  this.nodes.push(selector);
13880
13787
  return this;
13881
13788
  };
13882
-
13883
13789
  _proto.prepend = function prepend(selector) {
13884
13790
  selector.parent = this;
13885
13791
  this.nodes.unshift(selector);
13886
13792
  return this;
13887
13793
  };
13888
-
13889
13794
  _proto.at = function at(index) {
13890
13795
  return this.nodes[index];
13891
13796
  };
13892
-
13893
13797
  _proto.index = function index(child) {
13894
13798
  if (typeof child === 'number') {
13895
13799
  return child;
13896
13800
  }
13897
-
13898
13801
  return this.nodes.indexOf(child);
13899
13802
  };
13900
-
13901
13803
  _proto.removeChild = function removeChild(child) {
13902
13804
  child = this.index(child);
13903
13805
  this.at(child).parent = undefined;
13904
13806
  this.nodes.splice(child, 1);
13905
13807
  var index;
13906
-
13907
13808
  for (var id in this.indexes) {
13908
13809
  index = this.indexes[id];
13909
-
13910
13810
  if (index >= child) {
13911
13811
  this.indexes[id] = index - 1;
13912
13812
  }
13913
13813
  }
13914
-
13915
13814
  return this;
13916
13815
  };
13917
-
13918
13816
  _proto.removeAll = function removeAll() {
13919
13817
  for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) {
13920
13818
  var node = _step.value;
13921
13819
  node.parent = undefined;
13922
13820
  }
13923
-
13924
13821
  this.nodes = [];
13925
13822
  return this;
13926
13823
  };
13927
-
13928
13824
  _proto.empty = function empty() {
13929
13825
  return this.removeAll();
13930
13826
  };
13931
-
13932
13827
  _proto.insertAfter = function insertAfter(oldNode, newNode) {
13933
13828
  newNode.parent = this;
13934
13829
  var oldIndex = this.index(oldNode);
13935
13830
  this.nodes.splice(oldIndex + 1, 0, newNode);
13936
13831
  newNode.parent = this;
13937
13832
  var index;
13938
-
13939
13833
  for (var id in this.indexes) {
13940
13834
  index = this.indexes[id];
13941
-
13942
13835
  if (oldIndex <= index) {
13943
13836
  this.indexes[id] = index + 1;
13944
13837
  }
13945
13838
  }
13946
-
13947
13839
  return this;
13948
13840
  };
13949
-
13950
13841
  _proto.insertBefore = function insertBefore(oldNode, newNode) {
13951
13842
  newNode.parent = this;
13952
13843
  var oldIndex = this.index(oldNode);
13953
13844
  this.nodes.splice(oldIndex, 0, newNode);
13954
13845
  newNode.parent = this;
13955
13846
  var index;
13956
-
13957
13847
  for (var id in this.indexes) {
13958
13848
  index = this.indexes[id];
13959
-
13960
13849
  if (index <= oldIndex) {
13961
13850
  this.indexes[id] = index + 1;
13962
13851
  }
13963
13852
  }
13964
-
13965
13853
  return this;
13966
13854
  };
13967
-
13968
13855
  _proto._findChildAtPosition = function _findChildAtPosition(line, col) {
13969
13856
  var found = undefined;
13970
13857
  this.each(function (node) {
13971
13858
  if (node.atPosition) {
13972
13859
  var foundChild = node.atPosition(line, col);
13973
-
13974
13860
  if (foundChild) {
13975
13861
  found = foundChild;
13976
13862
  return false;
@@ -13982,6 +13868,7 @@ types.UNIVERSAL = UNIVERSAL;
13982
13868
  });
13983
13869
  return found;
13984
13870
  }
13871
+
13985
13872
  /**
13986
13873
  * Return the most specific node at the line and column number given.
13987
13874
  * The source location is based on the original parsed location, locations aren't
@@ -13994,9 +13881,7 @@ types.UNIVERSAL = UNIVERSAL;
13994
13881
  * If not found, returns undefined.
13995
13882
  * @param {number} line The line number of the node to find. (1-based index)
13996
13883
  * @param {number} col The column number of the node to find. (1-based index)
13997
- */
13998
- ;
13999
-
13884
+ */;
14000
13885
  _proto.atPosition = function atPosition(line, col) {
14001
13886
  if (this.isAtPosition(line, col)) {
14002
13887
  return this._findChildAtPosition(line, col) || this;
@@ -14004,7 +13889,6 @@ types.UNIVERSAL = UNIVERSAL;
14004
13889
  return undefined;
14005
13890
  }
14006
13891
  };
14007
-
14008
13892
  _proto._inferEndPosition = function _inferEndPosition() {
14009
13893
  if (this.last && this.last.source && this.last.source.end) {
14010
13894
  this.source = this.source || {};
@@ -14012,195 +13896,152 @@ types.UNIVERSAL = UNIVERSAL;
14012
13896
  Object.assign(this.source.end, this.last.source.end);
14013
13897
  }
14014
13898
  };
14015
-
14016
13899
  _proto.each = function each(callback) {
14017
13900
  if (!this.lastEach) {
14018
13901
  this.lastEach = 0;
14019
13902
  }
14020
-
14021
13903
  if (!this.indexes) {
14022
13904
  this.indexes = {};
14023
13905
  }
14024
-
14025
13906
  this.lastEach++;
14026
13907
  var id = this.lastEach;
14027
13908
  this.indexes[id] = 0;
14028
-
14029
13909
  if (!this.length) {
14030
13910
  return undefined;
14031
13911
  }
14032
-
14033
13912
  var index, result;
14034
-
14035
13913
  while (this.indexes[id] < this.length) {
14036
13914
  index = this.indexes[id];
14037
13915
  result = callback(this.at(index), index);
14038
-
14039
13916
  if (result === false) {
14040
13917
  break;
14041
13918
  }
14042
-
14043
13919
  this.indexes[id] += 1;
14044
13920
  }
14045
-
14046
13921
  delete this.indexes[id];
14047
-
14048
13922
  if (result === false) {
14049
13923
  return false;
14050
13924
  }
14051
13925
  };
14052
-
14053
13926
  _proto.walk = function walk(callback) {
14054
13927
  return this.each(function (node, i) {
14055
13928
  var result = callback(node, i);
14056
-
14057
13929
  if (result !== false && node.length) {
14058
13930
  result = node.walk(callback);
14059
13931
  }
14060
-
14061
13932
  if (result === false) {
14062
13933
  return false;
14063
13934
  }
14064
13935
  });
14065
13936
  };
14066
-
14067
13937
  _proto.walkAttributes = function walkAttributes(callback) {
14068
13938
  var _this2 = this;
14069
-
14070
13939
  return this.walk(function (selector) {
14071
13940
  if (selector.type === types$1.ATTRIBUTE) {
14072
13941
  return callback.call(_this2, selector);
14073
13942
  }
14074
13943
  });
14075
13944
  };
14076
-
14077
13945
  _proto.walkClasses = function walkClasses(callback) {
14078
13946
  var _this3 = this;
14079
-
14080
13947
  return this.walk(function (selector) {
14081
13948
  if (selector.type === types$1.CLASS) {
14082
13949
  return callback.call(_this3, selector);
14083
13950
  }
14084
13951
  });
14085
13952
  };
14086
-
14087
13953
  _proto.walkCombinators = function walkCombinators(callback) {
14088
13954
  var _this4 = this;
14089
-
14090
13955
  return this.walk(function (selector) {
14091
13956
  if (selector.type === types$1.COMBINATOR) {
14092
13957
  return callback.call(_this4, selector);
14093
13958
  }
14094
13959
  });
14095
13960
  };
14096
-
14097
13961
  _proto.walkComments = function walkComments(callback) {
14098
13962
  var _this5 = this;
14099
-
14100
13963
  return this.walk(function (selector) {
14101
13964
  if (selector.type === types$1.COMMENT) {
14102
13965
  return callback.call(_this5, selector);
14103
13966
  }
14104
13967
  });
14105
13968
  };
14106
-
14107
13969
  _proto.walkIds = function walkIds(callback) {
14108
13970
  var _this6 = this;
14109
-
14110
13971
  return this.walk(function (selector) {
14111
13972
  if (selector.type === types$1.ID) {
14112
13973
  return callback.call(_this6, selector);
14113
13974
  }
14114
13975
  });
14115
13976
  };
14116
-
14117
13977
  _proto.walkNesting = function walkNesting(callback) {
14118
13978
  var _this7 = this;
14119
-
14120
13979
  return this.walk(function (selector) {
14121
13980
  if (selector.type === types$1.NESTING) {
14122
13981
  return callback.call(_this7, selector);
14123
13982
  }
14124
13983
  });
14125
13984
  };
14126
-
14127
13985
  _proto.walkPseudos = function walkPseudos(callback) {
14128
13986
  var _this8 = this;
14129
-
14130
13987
  return this.walk(function (selector) {
14131
13988
  if (selector.type === types$1.PSEUDO) {
14132
13989
  return callback.call(_this8, selector);
14133
13990
  }
14134
13991
  });
14135
13992
  };
14136
-
14137
13993
  _proto.walkTags = function walkTags(callback) {
14138
13994
  var _this9 = this;
14139
-
14140
13995
  return this.walk(function (selector) {
14141
13996
  if (selector.type === types$1.TAG) {
14142
13997
  return callback.call(_this9, selector);
14143
13998
  }
14144
13999
  });
14145
14000
  };
14146
-
14147
14001
  _proto.walkUniversals = function walkUniversals(callback) {
14148
14002
  var _this10 = this;
14149
-
14150
14003
  return this.walk(function (selector) {
14151
14004
  if (selector.type === types$1.UNIVERSAL) {
14152
14005
  return callback.call(_this10, selector);
14153
14006
  }
14154
14007
  });
14155
14008
  };
14156
-
14157
14009
  _proto.split = function split(callback) {
14158
14010
  var _this11 = this;
14159
-
14160
14011
  var current = [];
14161
14012
  return this.reduce(function (memo, node, index) {
14162
14013
  var split = callback.call(_this11, node);
14163
14014
  current.push(node);
14164
-
14165
14015
  if (split) {
14166
14016
  memo.push(current);
14167
14017
  current = [];
14168
14018
  } else if (index === _this11.length - 1) {
14169
14019
  memo.push(current);
14170
14020
  }
14171
-
14172
14021
  return memo;
14173
14022
  }, []);
14174
14023
  };
14175
-
14176
14024
  _proto.map = function map(callback) {
14177
14025
  return this.nodes.map(callback);
14178
14026
  };
14179
-
14180
14027
  _proto.reduce = function reduce(callback, memo) {
14181
14028
  return this.nodes.reduce(callback, memo);
14182
14029
  };
14183
-
14184
14030
  _proto.every = function every(callback) {
14185
14031
  return this.nodes.every(callback);
14186
14032
  };
14187
-
14188
14033
  _proto.some = function some(callback) {
14189
14034
  return this.nodes.some(callback);
14190
14035
  };
14191
-
14192
14036
  _proto.filter = function filter(callback) {
14193
14037
  return this.nodes.filter(callback);
14194
14038
  };
14195
-
14196
14039
  _proto.sort = function sort(callback) {
14197
14040
  return this.nodes.sort(callback);
14198
14041
  };
14199
-
14200
14042
  _proto.toString = function toString() {
14201
14043
  return this.map(String).join('');
14202
14044
  };
14203
-
14204
14045
  _createClass(Container, [{
14205
14046
  key: "first",
14206
14047
  get: function get() {
@@ -14217,10 +14058,8 @@ types.UNIVERSAL = UNIVERSAL;
14217
14058
  return this.nodes.length;
14218
14059
  }
14219
14060
  }]);
14220
-
14221
14061
  return Container;
14222
14062
  }(_node["default"]);
14223
-
14224
14063
  exports["default"] = Container;
14225
14064
  module.exports = exports.default;
14226
14065
  } (container, container.exports));
@@ -14229,34 +14068,22 @@ types.UNIVERSAL = UNIVERSAL;
14229
14068
 
14230
14069
  exports.__esModule = true;
14231
14070
  exports["default"] = void 0;
14232
-
14233
14071
  var _container = _interopRequireDefault(container.exports);
14234
-
14235
14072
  var _types = types;
14236
-
14237
14073
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14238
-
14239
14074
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
14240
-
14241
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
14242
-
14075
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14243
14076
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14244
-
14245
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14246
-
14077
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14247
14078
  var Root = /*#__PURE__*/function (_Container) {
14248
14079
  _inheritsLoose(Root, _Container);
14249
-
14250
14080
  function Root(opts) {
14251
14081
  var _this;
14252
-
14253
14082
  _this = _Container.call(this, opts) || this;
14254
14083
  _this.type = _types.ROOT;
14255
14084
  return _this;
14256
14085
  }
14257
-
14258
14086
  var _proto = Root.prototype;
14259
-
14260
14087
  _proto.toString = function toString() {
14261
14088
  var str = this.reduce(function (memo, selector) {
14262
14089
  memo.push(String(selector));
@@ -14264,7 +14091,6 @@ types.UNIVERSAL = UNIVERSAL;
14264
14091
  }, []).join(',');
14265
14092
  return this.trailingComma ? str + ',' : str;
14266
14093
  };
14267
-
14268
14094
  _proto.error = function error(message, options) {
14269
14095
  if (this._error) {
14270
14096
  return this._error(message, options);
@@ -14272,17 +14098,14 @@ types.UNIVERSAL = UNIVERSAL;
14272
14098
  return new Error(message);
14273
14099
  }
14274
14100
  };
14275
-
14276
14101
  _createClass(Root, [{
14277
14102
  key: "errorGenerator",
14278
14103
  set: function set(handler) {
14279
14104
  this._error = handler;
14280
14105
  }
14281
14106
  }]);
14282
-
14283
14107
  return Root;
14284
14108
  }(_container["default"]);
14285
-
14286
14109
  exports["default"] = Root;
14287
14110
  module.exports = exports.default;
14288
14111
  } (root$1, root$1.exports));
@@ -14293,31 +14116,21 @@ var selector$1 = {exports: {}};
14293
14116
 
14294
14117
  exports.__esModule = true;
14295
14118
  exports["default"] = void 0;
14296
-
14297
14119
  var _container = _interopRequireDefault(container.exports);
14298
-
14299
14120
  var _types = types;
14300
-
14301
14121
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14302
-
14303
14122
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14304
-
14305
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14306
-
14123
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14307
14124
  var Selector = /*#__PURE__*/function (_Container) {
14308
14125
  _inheritsLoose(Selector, _Container);
14309
-
14310
14126
  function Selector(opts) {
14311
14127
  var _this;
14312
-
14313
14128
  _this = _Container.call(this, opts) || this;
14314
14129
  _this.type = _types.SELECTOR;
14315
14130
  return _this;
14316
14131
  }
14317
-
14318
14132
  return Selector;
14319
14133
  }(_container["default"]);
14320
-
14321
14134
  exports["default"] = Selector;
14322
14135
  module.exports = exports.default;
14323
14136
  } (selector$1, selector$1.exports));
@@ -14437,43 +14250,28 @@ var cssesc_1 = cssesc;
14437
14250
 
14438
14251
  exports.__esModule = true;
14439
14252
  exports["default"] = void 0;
14440
-
14441
14253
  var _cssesc = _interopRequireDefault(cssesc_1);
14442
-
14443
14254
  var _util = util;
14444
-
14445
14255
  var _node = _interopRequireDefault(node$1.exports);
14446
-
14447
14256
  var _types = types;
14448
-
14449
14257
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14450
-
14451
14258
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
14452
-
14453
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
14454
-
14259
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14455
14260
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14456
-
14457
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14458
-
14261
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14459
14262
  var ClassName = /*#__PURE__*/function (_Node) {
14460
14263
  _inheritsLoose(ClassName, _Node);
14461
-
14462
14264
  function ClassName(opts) {
14463
14265
  var _this;
14464
-
14465
14266
  _this = _Node.call(this, opts) || this;
14466
14267
  _this.type = _types.CLASS;
14467
14268
  _this._constructed = true;
14468
14269
  return _this;
14469
14270
  }
14470
-
14471
14271
  var _proto = ClassName.prototype;
14472
-
14473
14272
  _proto.valueToString = function valueToString() {
14474
14273
  return '.' + _Node.prototype.valueToString.call(this);
14475
14274
  };
14476
-
14477
14275
  _createClass(ClassName, [{
14478
14276
  key: "value",
14479
14277
  get: function get() {
@@ -14484,7 +14282,6 @@ var cssesc_1 = cssesc;
14484
14282
  var escaped = (0, _cssesc["default"])(v, {
14485
14283
  isIdentifier: true
14486
14284
  });
14487
-
14488
14285
  if (escaped !== v) {
14489
14286
  (0, _util.ensureObject)(this, "raws");
14490
14287
  this.raws.value = escaped;
@@ -14492,14 +14289,11 @@ var cssesc_1 = cssesc;
14492
14289
  delete this.raws.value;
14493
14290
  }
14494
14291
  }
14495
-
14496
14292
  this._value = v;
14497
14293
  }
14498
14294
  }]);
14499
-
14500
14295
  return ClassName;
14501
14296
  }(_node["default"]);
14502
-
14503
14297
  exports["default"] = ClassName;
14504
14298
  module.exports = exports.default;
14505
14299
  } (className$1, className$1.exports));
@@ -14510,31 +14304,21 @@ var comment$2 = {exports: {}};
14510
14304
 
14511
14305
  exports.__esModule = true;
14512
14306
  exports["default"] = void 0;
14513
-
14514
14307
  var _node = _interopRequireDefault(node$1.exports);
14515
-
14516
14308
  var _types = types;
14517
-
14518
14309
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14519
-
14520
14310
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14521
-
14522
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14523
-
14311
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14524
14312
  var Comment = /*#__PURE__*/function (_Node) {
14525
14313
  _inheritsLoose(Comment, _Node);
14526
-
14527
14314
  function Comment(opts) {
14528
14315
  var _this;
14529
-
14530
14316
  _this = _Node.call(this, opts) || this;
14531
14317
  _this.type = _types.COMMENT;
14532
14318
  return _this;
14533
14319
  }
14534
-
14535
14320
  return Comment;
14536
14321
  }(_node["default"]);
14537
-
14538
14322
  exports["default"] = Comment;
14539
14323
  module.exports = exports.default;
14540
14324
  } (comment$2, comment$2.exports));
@@ -14545,37 +14329,25 @@ var id$1 = {exports: {}};
14545
14329
 
14546
14330
  exports.__esModule = true;
14547
14331
  exports["default"] = void 0;
14548
-
14549
14332
  var _node = _interopRequireDefault(node$1.exports);
14550
-
14551
14333
  var _types = types;
14552
-
14553
14334
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14554
-
14555
14335
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14556
-
14557
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14558
-
14336
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14559
14337
  var ID = /*#__PURE__*/function (_Node) {
14560
14338
  _inheritsLoose(ID, _Node);
14561
-
14562
14339
  function ID(opts) {
14563
14340
  var _this;
14564
-
14565
14341
  _this = _Node.call(this, opts) || this;
14566
14342
  _this.type = _types.ID;
14567
14343
  return _this;
14568
14344
  }
14569
-
14570
14345
  var _proto = ID.prototype;
14571
-
14572
14346
  _proto.valueToString = function valueToString() {
14573
14347
  return '#' + _Node.prototype.valueToString.call(this);
14574
14348
  };
14575
-
14576
14349
  return ID;
14577
14350
  }(_node["default"]);
14578
-
14579
14351
  exports["default"] = ID;
14580
14352
  module.exports = exports.default;
14581
14353
  } (id$1, id$1.exports));
@@ -14588,32 +14360,20 @@ var namespace = {exports: {}};
14588
14360
 
14589
14361
  exports.__esModule = true;
14590
14362
  exports["default"] = void 0;
14591
-
14592
14363
  var _cssesc = _interopRequireDefault(cssesc_1);
14593
-
14594
14364
  var _util = util;
14595
-
14596
14365
  var _node = _interopRequireDefault(node$1.exports);
14597
-
14598
14366
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14599
-
14600
14367
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
14601
-
14602
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
14603
-
14368
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14604
14369
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14605
-
14606
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14607
-
14370
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14608
14371
  var Namespace = /*#__PURE__*/function (_Node) {
14609
14372
  _inheritsLoose(Namespace, _Node);
14610
-
14611
14373
  function Namespace() {
14612
14374
  return _Node.apply(this, arguments) || this;
14613
14375
  }
14614
-
14615
14376
  var _proto = Namespace.prototype;
14616
-
14617
14377
  _proto.qualifiedName = function qualifiedName(value) {
14618
14378
  if (this.namespace) {
14619
14379
  return this.namespaceString + "|" + value;
@@ -14621,11 +14381,9 @@ var namespace = {exports: {}};
14621
14381
  return value;
14622
14382
  }
14623
14383
  };
14624
-
14625
14384
  _proto.valueToString = function valueToString() {
14626
14385
  return this.qualifiedName(_Node.prototype.valueToString.call(this));
14627
14386
  };
14628
-
14629
14387
  _createClass(Namespace, [{
14630
14388
  key: "namespace",
14631
14389
  get: function get() {
@@ -14634,19 +14392,15 @@ var namespace = {exports: {}};
14634
14392
  set: function set(namespace) {
14635
14393
  if (namespace === true || namespace === "*" || namespace === "&") {
14636
14394
  this._namespace = namespace;
14637
-
14638
14395
  if (this.raws) {
14639
14396
  delete this.raws.namespace;
14640
14397
  }
14641
-
14642
14398
  return;
14643
14399
  }
14644
-
14645
14400
  var escaped = (0, _cssesc["default"])(namespace, {
14646
14401
  isIdentifier: true
14647
14402
  });
14648
14403
  this._namespace = namespace;
14649
-
14650
14404
  if (escaped !== namespace) {
14651
14405
  (0, _util.ensureObject)(this, "raws");
14652
14406
  this.raws.namespace = escaped;
@@ -14667,7 +14421,6 @@ var namespace = {exports: {}};
14667
14421
  get: function get() {
14668
14422
  if (this.namespace) {
14669
14423
  var ns = this.stringifyProperty("namespace");
14670
-
14671
14424
  if (ns === true) {
14672
14425
  return '';
14673
14426
  } else {
@@ -14678,10 +14431,8 @@ var namespace = {exports: {}};
14678
14431
  }
14679
14432
  }
14680
14433
  }]);
14681
-
14682
14434
  return Namespace;
14683
14435
  }(_node["default"]);
14684
-
14685
14436
  exports["default"] = Namespace;
14686
14437
  module.exports = exports.default;
14687
14438
  } (namespace, namespace.exports));
@@ -14690,31 +14441,21 @@ var namespace = {exports: {}};
14690
14441
 
14691
14442
  exports.__esModule = true;
14692
14443
  exports["default"] = void 0;
14693
-
14694
14444
  var _namespace = _interopRequireDefault(namespace.exports);
14695
-
14696
14445
  var _types = types;
14697
-
14698
14446
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14699
-
14700
14447
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14701
-
14702
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14703
-
14448
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14704
14449
  var Tag = /*#__PURE__*/function (_Namespace) {
14705
14450
  _inheritsLoose(Tag, _Namespace);
14706
-
14707
14451
  function Tag(opts) {
14708
14452
  var _this;
14709
-
14710
14453
  _this = _Namespace.call(this, opts) || this;
14711
14454
  _this.type = _types.TAG;
14712
14455
  return _this;
14713
14456
  }
14714
-
14715
14457
  return Tag;
14716
14458
  }(_namespace["default"]);
14717
-
14718
14459
  exports["default"] = Tag;
14719
14460
  module.exports = exports.default;
14720
14461
  } (tag$1, tag$1.exports));
@@ -14725,31 +14466,21 @@ var string$1 = {exports: {}};
14725
14466
 
14726
14467
  exports.__esModule = true;
14727
14468
  exports["default"] = void 0;
14728
-
14729
14469
  var _node = _interopRequireDefault(node$1.exports);
14730
-
14731
14470
  var _types = types;
14732
-
14733
14471
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14734
-
14735
14472
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14736
-
14737
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14738
-
14473
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14739
14474
  var String = /*#__PURE__*/function (_Node) {
14740
14475
  _inheritsLoose(String, _Node);
14741
-
14742
14476
  function String(opts) {
14743
14477
  var _this;
14744
-
14745
14478
  _this = _Node.call(this, opts) || this;
14746
14479
  _this.type = _types.STRING;
14747
14480
  return _this;
14748
14481
  }
14749
-
14750
14482
  return String;
14751
14483
  }(_node["default"]);
14752
-
14753
14484
  exports["default"] = String;
14754
14485
  module.exports = exports.default;
14755
14486
  } (string$1, string$1.exports));
@@ -14760,38 +14491,26 @@ var pseudo$1 = {exports: {}};
14760
14491
 
14761
14492
  exports.__esModule = true;
14762
14493
  exports["default"] = void 0;
14763
-
14764
14494
  var _container = _interopRequireDefault(container.exports);
14765
-
14766
14495
  var _types = types;
14767
-
14768
14496
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14769
-
14770
14497
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14771
-
14772
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14773
-
14498
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14774
14499
  var Pseudo = /*#__PURE__*/function (_Container) {
14775
14500
  _inheritsLoose(Pseudo, _Container);
14776
-
14777
14501
  function Pseudo(opts) {
14778
14502
  var _this;
14779
-
14780
14503
  _this = _Container.call(this, opts) || this;
14781
14504
  _this.type = _types.PSEUDO;
14782
14505
  return _this;
14783
14506
  }
14784
-
14785
14507
  var _proto = Pseudo.prototype;
14786
-
14787
14508
  _proto.toString = function toString() {
14788
14509
  var params = this.length ? '(' + this.map(String).join(',') + ')' : '';
14789
14510
  return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join('');
14790
14511
  };
14791
-
14792
14512
  return Pseudo;
14793
14513
  }(_container["default"]);
14794
-
14795
14514
  exports["default"] = Pseudo;
14796
14515
  module.exports = exports.default;
14797
14516
  } (pseudo$1, pseudo$1.exports));
@@ -14807,98 +14526,70 @@ var node = require$$2__default["default"].deprecate;
14807
14526
  (function (exports) {
14808
14527
 
14809
14528
  exports.__esModule = true;
14810
- exports.unescapeValue = unescapeValue;
14811
14529
  exports["default"] = void 0;
14812
-
14530
+ exports.unescapeValue = unescapeValue;
14813
14531
  var _cssesc = _interopRequireDefault(cssesc_1);
14814
-
14815
14532
  var _unesc = _interopRequireDefault(unesc.exports);
14816
-
14817
14533
  var _namespace = _interopRequireDefault(namespace.exports);
14818
-
14819
14534
  var _types = types;
14820
-
14821
14535
  var _CSSESC_QUOTE_OPTIONS;
14822
-
14823
14536
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14824
-
14825
14537
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
14826
-
14827
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
14828
-
14538
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14829
14539
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
14830
-
14831
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14832
-
14540
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14833
14541
  var deprecate = node;
14834
-
14835
14542
  var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;
14836
14543
  var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead.");
14837
14544
  var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
14838
14545
  var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");
14839
-
14840
14546
  function unescapeValue(value) {
14841
14547
  var deprecatedUsage = false;
14842
14548
  var quoteMark = null;
14843
14549
  var unescaped = value;
14844
14550
  var m = unescaped.match(WRAPPED_IN_QUOTES);
14845
-
14846
14551
  if (m) {
14847
14552
  quoteMark = m[1];
14848
14553
  unescaped = m[2];
14849
14554
  }
14850
-
14851
14555
  unescaped = (0, _unesc["default"])(unescaped);
14852
-
14853
14556
  if (unescaped !== value) {
14854
14557
  deprecatedUsage = true;
14855
14558
  }
14856
-
14857
14559
  return {
14858
14560
  deprecatedUsage: deprecatedUsage,
14859
14561
  unescaped: unescaped,
14860
14562
  quoteMark: quoteMark
14861
14563
  };
14862
14564
  }
14863
-
14864
14565
  function handleDeprecatedContructorOpts(opts) {
14865
14566
  if (opts.quoteMark !== undefined) {
14866
14567
  return opts;
14867
14568
  }
14868
-
14869
14569
  if (opts.value === undefined) {
14870
14570
  return opts;
14871
14571
  }
14872
-
14873
14572
  warnOfDeprecatedConstructor();
14874
-
14875
14573
  var _unescapeValue = unescapeValue(opts.value),
14876
- quoteMark = _unescapeValue.quoteMark,
14877
- unescaped = _unescapeValue.unescaped;
14878
-
14574
+ quoteMark = _unescapeValue.quoteMark,
14575
+ unescaped = _unescapeValue.unescaped;
14879
14576
  if (!opts.raws) {
14880
14577
  opts.raws = {};
14881
14578
  }
14882
-
14883
14579
  if (opts.raws.value === undefined) {
14884
14580
  opts.raws.value = opts.value;
14885
14581
  }
14886
-
14887
14582
  opts.value = unescaped;
14888
14583
  opts.quoteMark = quoteMark;
14889
14584
  return opts;
14890
14585
  }
14891
-
14892
14586
  var Attribute = /*#__PURE__*/function (_Namespace) {
14893
14587
  _inheritsLoose(Attribute, _Namespace);
14894
-
14895
14588
  function Attribute(opts) {
14896
14589
  var _this;
14897
-
14898
14590
  if (opts === void 0) {
14899
14591
  opts = {};
14900
14592
  }
14901
-
14902
14593
  _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this;
14903
14594
  _this.type = _types.ATTRIBUTE;
14904
14595
  _this.raws = _this.raws || {};
@@ -14913,6 +14604,7 @@ var node = require$$2__default["default"].deprecate;
14913
14604
  _this._constructed = true;
14914
14605
  return _this;
14915
14606
  }
14607
+
14916
14608
  /**
14917
14609
  * Returns the Attribute's value quoted such that it would be legal to use
14918
14610
  * in the value of a css file. The original value's quotation setting
@@ -14934,42 +14626,34 @@ var node = require$$2__default["default"].deprecate;
14934
14626
  * and the other options specified here. See the `smartQuoteMark()`
14935
14627
  * method.
14936
14628
  **/
14937
-
14938
-
14939
14629
  var _proto = Attribute.prototype;
14940
-
14941
14630
  _proto.getQuotedValue = function getQuotedValue(options) {
14942
14631
  if (options === void 0) {
14943
14632
  options = {};
14944
14633
  }
14945
-
14946
14634
  var quoteMark = this._determineQuoteMark(options);
14947
-
14948
14635
  var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];
14949
14636
  var escaped = (0, _cssesc["default"])(this._value, cssescopts);
14950
14637
  return escaped;
14951
14638
  };
14952
-
14953
14639
  _proto._determineQuoteMark = function _determineQuoteMark(options) {
14954
14640
  return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);
14955
14641
  }
14642
+
14956
14643
  /**
14957
14644
  * Set the unescaped value with the specified quotation options. The value
14958
14645
  * provided must not include any wrapping quote marks -- those quotes will
14959
14646
  * be interpreted as part of the value and escaped accordingly.
14960
- */
14961
- ;
14962
-
14647
+ */;
14963
14648
  _proto.setValue = function setValue(value, options) {
14964
14649
  if (options === void 0) {
14965
14650
  options = {};
14966
14651
  }
14967
-
14968
14652
  this._value = value;
14969
14653
  this._quoteMark = this._determineQuoteMark(options);
14970
-
14971
14654
  this._syncRawValue();
14972
14655
  }
14656
+
14973
14657
  /**
14974
14658
  * Intelligently select a quoteMark value based on the value's contents. If
14975
14659
  * the value is a legal CSS ident, it will not be quoted. Otherwise a quote
@@ -14981,35 +14665,28 @@ var node = require$$2__default["default"].deprecate;
14981
14665
  *
14982
14666
  * @param options This takes the quoteMark and preferCurrentQuoteMark options
14983
14667
  * from the quoteValue method.
14984
- */
14985
- ;
14986
-
14668
+ */;
14987
14669
  _proto.smartQuoteMark = function smartQuoteMark(options) {
14988
14670
  var v = this.value;
14989
14671
  var numSingleQuotes = v.replace(/[^']/g, '').length;
14990
14672
  var numDoubleQuotes = v.replace(/[^"]/g, '').length;
14991
-
14992
14673
  if (numSingleQuotes + numDoubleQuotes === 0) {
14993
14674
  var escaped = (0, _cssesc["default"])(v, {
14994
14675
  isIdentifier: true
14995
14676
  });
14996
-
14997
14677
  if (escaped === v) {
14998
14678
  return Attribute.NO_QUOTE;
14999
14679
  } else {
15000
14680
  var pref = this.preferredQuoteMark(options);
15001
-
15002
14681
  if (pref === Attribute.NO_QUOTE) {
15003
14682
  // pick a quote mark that isn't none and see if it's smaller
15004
14683
  var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE;
15005
14684
  var opts = CSSESC_QUOTE_OPTIONS[quote];
15006
14685
  var quoteValue = (0, _cssesc["default"])(v, opts);
15007
-
15008
14686
  if (quoteValue.length < escaped.length) {
15009
14687
  return quote;
15010
14688
  }
15011
14689
  }
15012
-
15013
14690
  return pref;
15014
14691
  }
15015
14692
  } else if (numDoubleQuotes === numSingleQuotes) {
@@ -15020,30 +14697,24 @@ var node = require$$2__default["default"].deprecate;
15020
14697
  return Attribute.SINGLE_QUOTE;
15021
14698
  }
15022
14699
  }
14700
+
15023
14701
  /**
15024
14702
  * Selects the preferred quote mark based on the options and the current quote mark value.
15025
14703
  * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
15026
14704
  * instead.
15027
- */
15028
- ;
15029
-
14705
+ */;
15030
14706
  _proto.preferredQuoteMark = function preferredQuoteMark(options) {
15031
14707
  var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;
15032
-
15033
14708
  if (quoteMark === undefined) {
15034
14709
  quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;
15035
14710
  }
15036
-
15037
14711
  if (quoteMark === undefined) {
15038
14712
  quoteMark = Attribute.DOUBLE_QUOTE;
15039
14713
  }
15040
-
15041
14714
  return quoteMark;
15042
14715
  };
15043
-
15044
14716
  _proto._syncRawValue = function _syncRawValue() {
15045
14717
  var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);
15046
-
15047
14718
  if (rawValue === this._value) {
15048
14719
  if (this.raws) {
15049
14720
  delete this.raws.value;
@@ -15052,13 +14723,11 @@ var node = require$$2__default["default"].deprecate;
15052
14723
  this.raws.value = rawValue;
15053
14724
  }
15054
14725
  };
15055
-
15056
14726
  _proto._handleEscapes = function _handleEscapes(prop, value) {
15057
14727
  if (this._constructed) {
15058
14728
  var escaped = (0, _cssesc["default"])(value, {
15059
14729
  isIdentifier: true
15060
14730
  });
15061
-
15062
14731
  if (escaped !== value) {
15063
14732
  this.raws[prop] = escaped;
15064
14733
  } else {
@@ -15066,7 +14735,6 @@ var node = require$$2__default["default"].deprecate;
15066
14735
  }
15067
14736
  }
15068
14737
  };
15069
-
15070
14738
  _proto._spacesFor = function _spacesFor(name) {
15071
14739
  var attrSpaces = {
15072
14740
  before: '',
@@ -15076,20 +14744,17 @@ var node = require$$2__default["default"].deprecate;
15076
14744
  var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {};
15077
14745
  return Object.assign(attrSpaces, spaces, rawSpaces);
15078
14746
  };
15079
-
15080
14747
  _proto._stringFor = function _stringFor(name, spaceName, concat) {
15081
14748
  if (spaceName === void 0) {
15082
14749
  spaceName = name;
15083
14750
  }
15084
-
15085
14751
  if (concat === void 0) {
15086
14752
  concat = defaultAttrConcat;
15087
14753
  }
15088
-
15089
14754
  var attrSpaces = this._spacesFor(spaceName);
15090
-
15091
14755
  return concat(this.stringifyProperty(name), attrSpaces);
15092
14756
  }
14757
+
15093
14758
  /**
15094
14759
  * returns the offset of the attribute part specified relative to the
15095
14760
  * start of the node of the output string.
@@ -15103,78 +14768,53 @@ var node = require$$2__default["default"].deprecate;
15103
14768
  * * "insensitive" - the case insensitivity flag;
15104
14769
  * @param part One of the possible values inside an attribute.
15105
14770
  * @returns -1 if the name is invalid or the value doesn't exist in this attribute.
15106
- */
15107
- ;
15108
-
14771
+ */;
15109
14772
  _proto.offsetOf = function offsetOf(name) {
15110
14773
  var count = 1;
15111
-
15112
14774
  var attributeSpaces = this._spacesFor("attribute");
15113
-
15114
14775
  count += attributeSpaces.before.length;
15115
-
15116
14776
  if (name === "namespace" || name === "ns") {
15117
14777
  return this.namespace ? count : -1;
15118
14778
  }
15119
-
15120
14779
  if (name === "attributeNS") {
15121
14780
  return count;
15122
14781
  }
15123
-
15124
14782
  count += this.namespaceString.length;
15125
-
15126
14783
  if (this.namespace) {
15127
14784
  count += 1;
15128
14785
  }
15129
-
15130
14786
  if (name === "attribute") {
15131
14787
  return count;
15132
14788
  }
15133
-
15134
14789
  count += this.stringifyProperty("attribute").length;
15135
14790
  count += attributeSpaces.after.length;
15136
-
15137
14791
  var operatorSpaces = this._spacesFor("operator");
15138
-
15139
14792
  count += operatorSpaces.before.length;
15140
14793
  var operator = this.stringifyProperty("operator");
15141
-
15142
14794
  if (name === "operator") {
15143
14795
  return operator ? count : -1;
15144
14796
  }
15145
-
15146
14797
  count += operator.length;
15147
14798
  count += operatorSpaces.after.length;
15148
-
15149
14799
  var valueSpaces = this._spacesFor("value");
15150
-
15151
14800
  count += valueSpaces.before.length;
15152
14801
  var value = this.stringifyProperty("value");
15153
-
15154
14802
  if (name === "value") {
15155
14803
  return value ? count : -1;
15156
14804
  }
15157
-
15158
14805
  count += value.length;
15159
14806
  count += valueSpaces.after.length;
15160
-
15161
14807
  var insensitiveSpaces = this._spacesFor("insensitive");
15162
-
15163
14808
  count += insensitiveSpaces.before.length;
15164
-
15165
14809
  if (name === "insensitive") {
15166
14810
  return this.insensitive ? count : -1;
15167
14811
  }
15168
-
15169
14812
  return -1;
15170
14813
  };
15171
-
15172
14814
  _proto.toString = function toString() {
15173
14815
  var _this2 = this;
15174
-
15175
14816
  var selector = [this.rawSpaceBefore, '['];
15176
14817
  selector.push(this._stringFor('qualifiedAttribute', 'attribute'));
15177
-
15178
14818
  if (this.operator && (this.value || this.value === '')) {
15179
14819
  selector.push(this._stringFor('operator'));
15180
14820
  selector.push(this._stringFor('value'));
@@ -15182,16 +14822,13 @@ var node = require$$2__default["default"].deprecate;
15182
14822
  if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) {
15183
14823
  attrSpaces.before = " ";
15184
14824
  }
15185
-
15186
14825
  return defaultAttrConcat(attrValue, attrSpaces);
15187
14826
  }));
15188
14827
  }
15189
-
15190
14828
  selector.push(']');
15191
14829
  selector.push(this.rawSpaceAfter);
15192
14830
  return selector.join('');
15193
14831
  };
15194
-
15195
14832
  _createClass(Attribute, [{
15196
14833
  key: "quoted",
15197
14834
  get: function get() {
@@ -15201,35 +14838,33 @@ var node = require$$2__default["default"].deprecate;
15201
14838
  set: function set(value) {
15202
14839
  warnOfDeprecatedQuotedAssignment();
15203
14840
  }
14841
+
15204
14842
  /**
15205
14843
  * returns a single (`'`) or double (`"`) quote character if the value is quoted.
15206
14844
  * returns `null` if the value is not quoted.
15207
14845
  * returns `undefined` if the quotation state is unknown (this can happen when
15208
14846
  * the attribute is constructed without specifying a quote mark.)
15209
14847
  */
15210
-
15211
14848
  }, {
15212
14849
  key: "quoteMark",
15213
14850
  get: function get() {
15214
14851
  return this._quoteMark;
15215
14852
  }
14853
+
15216
14854
  /**
15217
14855
  * Set the quote mark to be used by this attribute's value.
15218
14856
  * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute
15219
14857
  * value is updated accordingly.
15220
14858
  *
15221
14859
  * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted.
15222
- */
15223
- ,
14860
+ */,
15224
14861
  set: function set(quoteMark) {
15225
14862
  if (!this._constructed) {
15226
14863
  this._quoteMark = quoteMark;
15227
14864
  return;
15228
14865
  }
15229
-
15230
14866
  if (this._quoteMark !== quoteMark) {
15231
14867
  this._quoteMark = quoteMark;
15232
-
15233
14868
  this._syncRawValue();
15234
14869
  }
15235
14870
  }
@@ -15247,7 +14882,8 @@ var node = require$$2__default["default"].deprecate;
15247
14882
  key: "value",
15248
14883
  get: function get() {
15249
14884
  return this._value;
15250
- }
14885
+ },
14886
+ set:
15251
14887
  /**
15252
14888
  * Before 3.0, the value had to be set to an escaped value including any wrapped
15253
14889
  * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value
@@ -15260,30 +14896,50 @@ var node = require$$2__default["default"].deprecate;
15260
14896
  * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe
15261
14897
  * how the new value is quoted.
15262
14898
  */
15263
- ,
15264
- set: function set(v) {
14899
+ function set(v) {
15265
14900
  if (this._constructed) {
15266
14901
  var _unescapeValue2 = unescapeValue(v),
15267
- deprecatedUsage = _unescapeValue2.deprecatedUsage,
15268
- unescaped = _unescapeValue2.unescaped,
15269
- quoteMark = _unescapeValue2.quoteMark;
15270
-
14902
+ deprecatedUsage = _unescapeValue2.deprecatedUsage,
14903
+ unescaped = _unescapeValue2.unescaped,
14904
+ quoteMark = _unescapeValue2.quoteMark;
15271
14905
  if (deprecatedUsage) {
15272
14906
  warnOfDeprecatedValueAssignment();
15273
14907
  }
15274
-
15275
14908
  if (unescaped === this._value && quoteMark === this._quoteMark) {
15276
14909
  return;
15277
14910
  }
15278
-
15279
14911
  this._value = unescaped;
15280
14912
  this._quoteMark = quoteMark;
15281
-
15282
14913
  this._syncRawValue();
15283
14914
  } else {
15284
14915
  this._value = v;
15285
14916
  }
15286
14917
  }
14918
+ }, {
14919
+ key: "insensitive",
14920
+ get: function get() {
14921
+ return this._insensitive;
14922
+ }
14923
+
14924
+ /**
14925
+ * Set the case insensitive flag.
14926
+ * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag`
14927
+ * of the attribute is updated accordingly.
14928
+ *
14929
+ * @param {true | false} insensitive true if the attribute should match case-insensitively.
14930
+ */,
14931
+ set: function set(insensitive) {
14932
+ if (!insensitive) {
14933
+ this._insensitive = false;
14934
+
14935
+ // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation.
14936
+ // When setting `attr.insensitive = false` both should be erased to ensure correct serialization.
14937
+ if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) {
14938
+ this.raws.insensitiveFlag = undefined;
14939
+ }
14940
+ }
14941
+ this._insensitive = insensitive;
14942
+ }
15287
14943
  }, {
15288
14944
  key: "attribute",
15289
14945
  get: function get() {
@@ -15291,14 +14947,11 @@ var node = require$$2__default["default"].deprecate;
15291
14947
  },
15292
14948
  set: function set(name) {
15293
14949
  this._handleEscapes("attribute", name);
15294
-
15295
14950
  this._attribute = name;
15296
14951
  }
15297
14952
  }]);
15298
-
15299
14953
  return Attribute;
15300
14954
  }(_namespace["default"]);
15301
-
15302
14955
  exports["default"] = Attribute;
15303
14956
  Attribute.NO_QUOTE = null;
15304
14957
  Attribute.SINGLE_QUOTE = "'";
@@ -15315,7 +14968,6 @@ var node = require$$2__default["default"].deprecate;
15315
14968
  }, _CSSESC_QUOTE_OPTIONS[null] = {
15316
14969
  isIdentifier: true
15317
14970
  }, _CSSESC_QUOTE_OPTIONS);
15318
-
15319
14971
  function defaultAttrConcat(attrValue, attrSpaces) {
15320
14972
  return "" + attrSpaces.before + attrValue + attrSpaces.after;
15321
14973
  }
@@ -15327,32 +14979,22 @@ var universal$1 = {exports: {}};
15327
14979
 
15328
14980
  exports.__esModule = true;
15329
14981
  exports["default"] = void 0;
15330
-
15331
14982
  var _namespace = _interopRequireDefault(namespace.exports);
15332
-
15333
14983
  var _types = types;
15334
-
15335
14984
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15336
-
15337
14985
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
15338
-
15339
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15340
-
14986
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15341
14987
  var Universal = /*#__PURE__*/function (_Namespace) {
15342
14988
  _inheritsLoose(Universal, _Namespace);
15343
-
15344
14989
  function Universal(opts) {
15345
14990
  var _this;
15346
-
15347
14991
  _this = _Namespace.call(this, opts) || this;
15348
14992
  _this.type = _types.UNIVERSAL;
15349
14993
  _this.value = '*';
15350
14994
  return _this;
15351
14995
  }
15352
-
15353
14996
  return Universal;
15354
14997
  }(_namespace["default"]);
15355
-
15356
14998
  exports["default"] = Universal;
15357
14999
  module.exports = exports.default;
15358
15000
  } (universal$1, universal$1.exports));
@@ -15363,31 +15005,21 @@ var combinator$2 = {exports: {}};
15363
15005
 
15364
15006
  exports.__esModule = true;
15365
15007
  exports["default"] = void 0;
15366
-
15367
15008
  var _node = _interopRequireDefault(node$1.exports);
15368
-
15369
15009
  var _types = types;
15370
-
15371
15010
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15372
-
15373
15011
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
15374
-
15375
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15376
-
15012
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15377
15013
  var Combinator = /*#__PURE__*/function (_Node) {
15378
15014
  _inheritsLoose(Combinator, _Node);
15379
-
15380
15015
  function Combinator(opts) {
15381
15016
  var _this;
15382
-
15383
15017
  _this = _Node.call(this, opts) || this;
15384
15018
  _this.type = _types.COMBINATOR;
15385
15019
  return _this;
15386
15020
  }
15387
-
15388
15021
  return Combinator;
15389
15022
  }(_node["default"]);
15390
-
15391
15023
  exports["default"] = Combinator;
15392
15024
  module.exports = exports.default;
15393
15025
  } (combinator$2, combinator$2.exports));
@@ -15398,32 +15030,22 @@ var nesting$1 = {exports: {}};
15398
15030
 
15399
15031
  exports.__esModule = true;
15400
15032
  exports["default"] = void 0;
15401
-
15402
15033
  var _node = _interopRequireDefault(node$1.exports);
15403
-
15404
15034
  var _types = types;
15405
-
15406
15035
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15407
-
15408
15036
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
15409
-
15410
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15411
-
15037
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15412
15038
  var Nesting = /*#__PURE__*/function (_Node) {
15413
15039
  _inheritsLoose(Nesting, _Node);
15414
-
15415
15040
  function Nesting(opts) {
15416
15041
  var _this;
15417
-
15418
15042
  _this = _Node.call(this, opts) || this;
15419
15043
  _this.type = _types.NESTING;
15420
15044
  _this.value = '&';
15421
15045
  return _this;
15422
15046
  }
15423
-
15424
15047
  return Nesting;
15425
15048
  }(_node["default"]);
15426
-
15427
15049
  exports["default"] = Nesting;
15428
15050
  module.exports = exports.default;
15429
15051
  } (nesting$1, nesting$1.exports));
@@ -15434,7 +15056,6 @@ var sortAscending = {exports: {}};
15434
15056
 
15435
15057
  exports.__esModule = true;
15436
15058
  exports["default"] = sortAscending;
15437
-
15438
15059
  function sortAscending(list) {
15439
15060
  return list.sort(function (a, b) {
15440
15061
  return a - b;
@@ -15448,91 +15069,66 @@ var tokenize = {};
15448
15069
  var tokenTypes = {};
15449
15070
 
15450
15071
  tokenTypes.__esModule = true;
15451
- tokenTypes.combinator = tokenTypes.word = tokenTypes.comment = tokenTypes.str = tokenTypes.tab = tokenTypes.newline = tokenTypes.feed = tokenTypes.cr = tokenTypes.backslash = tokenTypes.bang = tokenTypes.slash = tokenTypes.doubleQuote = tokenTypes.singleQuote = tokenTypes.space = tokenTypes.greaterThan = tokenTypes.pipe = tokenTypes.equals = tokenTypes.plus = tokenTypes.caret = tokenTypes.tilde = tokenTypes.dollar = tokenTypes.closeSquare = tokenTypes.openSquare = tokenTypes.closeParenthesis = tokenTypes.openParenthesis = tokenTypes.semicolon = tokenTypes.colon = tokenTypes.comma = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0;
15072
+ tokenTypes.word = tokenTypes.tilde = tokenTypes.tab = tokenTypes.str = tokenTypes.space = tokenTypes.slash = tokenTypes.singleQuote = tokenTypes.semicolon = tokenTypes.plus = tokenTypes.pipe = tokenTypes.openSquare = tokenTypes.openParenthesis = tokenTypes.newline = tokenTypes.greaterThan = tokenTypes.feed = tokenTypes.equals = tokenTypes.doubleQuote = tokenTypes.dollar = tokenTypes.cr = tokenTypes.comment = tokenTypes.comma = tokenTypes.combinator = tokenTypes.colon = tokenTypes.closeSquare = tokenTypes.closeParenthesis = tokenTypes.caret = tokenTypes.bang = tokenTypes.backslash = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0;
15452
15073
  var ampersand = 38; // `&`.charCodeAt(0);
15453
-
15454
15074
  tokenTypes.ampersand = ampersand;
15455
15075
  var asterisk = 42; // `*`.charCodeAt(0);
15456
-
15457
15076
  tokenTypes.asterisk = asterisk;
15458
15077
  var at = 64; // `@`.charCodeAt(0);
15459
-
15460
15078
  tokenTypes.at = at;
15461
15079
  var comma = 44; // `,`.charCodeAt(0);
15462
-
15463
15080
  tokenTypes.comma = comma;
15464
15081
  var colon = 58; // `:`.charCodeAt(0);
15465
-
15466
15082
  tokenTypes.colon = colon;
15467
15083
  var semicolon = 59; // `;`.charCodeAt(0);
15468
-
15469
15084
  tokenTypes.semicolon = semicolon;
15470
15085
  var openParenthesis = 40; // `(`.charCodeAt(0);
15471
-
15472
15086
  tokenTypes.openParenthesis = openParenthesis;
15473
15087
  var closeParenthesis = 41; // `)`.charCodeAt(0);
15474
-
15475
15088
  tokenTypes.closeParenthesis = closeParenthesis;
15476
15089
  var openSquare = 91; // `[`.charCodeAt(0);
15477
-
15478
15090
  tokenTypes.openSquare = openSquare;
15479
15091
  var closeSquare = 93; // `]`.charCodeAt(0);
15480
-
15481
15092
  tokenTypes.closeSquare = closeSquare;
15482
15093
  var dollar = 36; // `$`.charCodeAt(0);
15483
-
15484
15094
  tokenTypes.dollar = dollar;
15485
15095
  var tilde = 126; // `~`.charCodeAt(0);
15486
-
15487
15096
  tokenTypes.tilde = tilde;
15488
15097
  var caret = 94; // `^`.charCodeAt(0);
15489
-
15490
15098
  tokenTypes.caret = caret;
15491
15099
  var plus = 43; // `+`.charCodeAt(0);
15492
-
15493
15100
  tokenTypes.plus = plus;
15494
15101
  var equals = 61; // `=`.charCodeAt(0);
15495
-
15496
15102
  tokenTypes.equals = equals;
15497
15103
  var pipe = 124; // `|`.charCodeAt(0);
15498
-
15499
15104
  tokenTypes.pipe = pipe;
15500
15105
  var greaterThan = 62; // `>`.charCodeAt(0);
15501
-
15502
15106
  tokenTypes.greaterThan = greaterThan;
15503
15107
  var space = 32; // ` `.charCodeAt(0);
15504
-
15505
15108
  tokenTypes.space = space;
15506
15109
  var singleQuote = 39; // `'`.charCodeAt(0);
15507
-
15508
15110
  tokenTypes.singleQuote = singleQuote;
15509
15111
  var doubleQuote = 34; // `"`.charCodeAt(0);
15510
-
15511
15112
  tokenTypes.doubleQuote = doubleQuote;
15512
15113
  var slash = 47; // `/`.charCodeAt(0);
15513
-
15514
15114
  tokenTypes.slash = slash;
15515
15115
  var bang = 33; // `!`.charCodeAt(0);
15516
-
15517
15116
  tokenTypes.bang = bang;
15518
15117
  var backslash = 92; // '\\'.charCodeAt(0);
15519
-
15520
15118
  tokenTypes.backslash = backslash;
15521
15119
  var cr = 13; // '\r'.charCodeAt(0);
15522
-
15523
15120
  tokenTypes.cr = cr;
15524
15121
  var feed = 12; // '\f'.charCodeAt(0);
15525
-
15526
15122
  tokenTypes.feed = feed;
15527
15123
  var newline = 10; // '\n'.charCodeAt(0);
15528
-
15529
15124
  tokenTypes.newline = newline;
15530
15125
  var tab = 9; // '\t'.charCodeAt(0);
15531
- // Expose aliases primarily for readability.
15532
15126
 
15127
+ // Expose aliases primarily for readability.
15533
15128
  tokenTypes.tab = tab;
15534
- var str = singleQuote; // No good single character representation!
15129
+ var str = singleQuote;
15535
15130
 
15131
+ // No good single character representation!
15536
15132
  tokenTypes.str = str;
15537
15133
  var comment$1 = -1;
15538
15134
  tokenTypes.comment = comment$1;
@@ -15544,39 +15140,30 @@ tokenTypes.combinator = combinator$1;
15544
15140
  (function (exports) {
15545
15141
 
15546
15142
  exports.__esModule = true;
15547
- exports["default"] = tokenize;
15548
15143
  exports.FIELDS = void 0;
15549
-
15144
+ exports["default"] = tokenize;
15550
15145
  var t = _interopRequireWildcard(tokenTypes);
15551
-
15552
15146
  var _unescapable, _wordDelimiters;
15553
-
15554
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15555
-
15556
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15557
-
15147
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15148
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15558
15149
  var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable);
15559
15150
  var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters);
15560
15151
  var hex = {};
15561
15152
  var hexChars = "0123456789abcdefABCDEF";
15562
-
15563
15153
  for (var i = 0; i < hexChars.length; i++) {
15564
15154
  hex[hexChars.charCodeAt(i)] = true;
15565
15155
  }
15156
+
15566
15157
  /**
15567
15158
  * Returns the last index of the bar css word
15568
15159
  * @param {string} css The string in which the word begins
15569
15160
  * @param {number} start The index into the string where word's first letter occurs
15570
15161
  */
15571
-
15572
-
15573
15162
  function consumeWord(css, start) {
15574
15163
  var next = start;
15575
15164
  var code;
15576
-
15577
15165
  do {
15578
15166
  code = css.charCodeAt(next);
15579
-
15580
15167
  if (wordDelimiters[code]) {
15581
15168
  return next - 1;
15582
15169
  } else if (code === t.backslash) {
@@ -15586,30 +15173,26 @@ tokenTypes.combinator = combinator$1;
15586
15173
  next++;
15587
15174
  }
15588
15175
  } while (next < css.length);
15589
-
15590
15176
  return next - 1;
15591
15177
  }
15178
+
15592
15179
  /**
15593
15180
  * Returns the last index of the escape sequence
15594
15181
  * @param {string} css The string in which the sequence begins
15595
15182
  * @param {number} start The index into the string where escape character (`\`) occurs.
15596
15183
  */
15597
-
15598
-
15599
15184
  function consumeEscape(css, start) {
15600
15185
  var next = start;
15601
15186
  var code = css.charCodeAt(next + 1);
15602
-
15603
15187
  if (unescapable[code]) ; else if (hex[code]) {
15604
- var hexDigits = 0; // consume up to 6 hex chars
15605
-
15188
+ var hexDigits = 0;
15189
+ // consume up to 6 hex chars
15606
15190
  do {
15607
15191
  next++;
15608
15192
  hexDigits++;
15609
15193
  code = css.charCodeAt(next + 1);
15610
- } while (hex[code] && hexDigits < 6); // if fewer than 6 hex chars, a trailing space ends the escape
15611
-
15612
-
15194
+ } while (hex[code] && hexDigits < 6);
15195
+ // if fewer than 6 hex chars, a trailing space ends the escape
15613
15196
  if (hexDigits < 6 && code === t.space) {
15614
15197
  next++;
15615
15198
  }
@@ -15617,10 +15200,8 @@ tokenTypes.combinator = combinator$1;
15617
15200
  // the next char is part of the current word
15618
15201
  next++;
15619
15202
  }
15620
-
15621
15203
  return next;
15622
15204
  }
15623
-
15624
15205
  var FIELDS = {
15625
15206
  TYPE: 0,
15626
15207
  START_LINE: 1,
@@ -15631,18 +15212,16 @@ tokenTypes.combinator = combinator$1;
15631
15212
  END_POS: 6
15632
15213
  };
15633
15214
  exports.FIELDS = FIELDS;
15634
-
15635
15215
  function tokenize(input) {
15636
15216
  var tokens = [];
15637
15217
  var css = input.css.valueOf();
15638
15218
  var _css = css,
15639
- length = _css.length;
15219
+ length = _css.length;
15640
15220
  var offset = -1;
15641
15221
  var line = 1;
15642
15222
  var start = 0;
15643
15223
  var end = 0;
15644
15224
  var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;
15645
-
15646
15225
  function unclosed(what, fix) {
15647
15226
  if (input.safe) {
15648
15227
  // fyi: this is never set to true.
@@ -15652,15 +15231,12 @@ tokenTypes.combinator = combinator$1;
15652
15231
  throw input.error('Unclosed ' + what, line, start - offset, start);
15653
15232
  }
15654
15233
  }
15655
-
15656
15234
  while (start < length) {
15657
15235
  code = css.charCodeAt(start);
15658
-
15659
15236
  if (code === t.newline) {
15660
15237
  offset = start;
15661
15238
  line += 1;
15662
15239
  }
15663
-
15664
15240
  switch (code) {
15665
15241
  case t.space:
15666
15242
  case t.tab:
@@ -15668,41 +15244,35 @@ tokenTypes.combinator = combinator$1;
15668
15244
  case t.cr:
15669
15245
  case t.feed:
15670
15246
  next = start;
15671
-
15672
15247
  do {
15673
15248
  next += 1;
15674
15249
  code = css.charCodeAt(next);
15675
-
15676
15250
  if (code === t.newline) {
15677
15251
  offset = next;
15678
15252
  line += 1;
15679
15253
  }
15680
15254
  } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);
15681
-
15682
15255
  tokenType = t.space;
15683
15256
  endLine = line;
15684
15257
  endColumn = next - offset - 1;
15685
15258
  end = next;
15686
15259
  break;
15687
-
15688
15260
  case t.plus:
15689
15261
  case t.greaterThan:
15690
15262
  case t.tilde:
15691
15263
  case t.pipe:
15692
15264
  next = start;
15693
-
15694
15265
  do {
15695
15266
  next += 1;
15696
15267
  code = css.charCodeAt(next);
15697
15268
  } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
15698
-
15699
15269
  tokenType = t.combinator;
15700
15270
  endLine = line;
15701
15271
  endColumn = start - offset;
15702
15272
  end = next;
15703
15273
  break;
15704
- // Consume these characters as single tokens.
15705
15274
 
15275
+ // Consume these characters as single tokens.
15706
15276
  case t.asterisk:
15707
15277
  case t.ampersand:
15708
15278
  case t.bang:
@@ -15722,46 +15292,36 @@ tokenTypes.combinator = combinator$1;
15722
15292
  endColumn = start - offset;
15723
15293
  end = next + 1;
15724
15294
  break;
15725
-
15726
15295
  case t.singleQuote:
15727
15296
  case t.doubleQuote:
15728
15297
  quote = code === t.singleQuote ? "'" : '"';
15729
15298
  next = start;
15730
-
15731
15299
  do {
15732
15300
  escaped = false;
15733
15301
  next = css.indexOf(quote, next + 1);
15734
-
15735
15302
  if (next === -1) {
15736
15303
  unclosed('quote', quote);
15737
15304
  }
15738
-
15739
15305
  escapePos = next;
15740
-
15741
15306
  while (css.charCodeAt(escapePos - 1) === t.backslash) {
15742
15307
  escapePos -= 1;
15743
15308
  escaped = !escaped;
15744
15309
  }
15745
15310
  } while (escaped);
15746
-
15747
15311
  tokenType = t.str;
15748
15312
  endLine = line;
15749
15313
  endColumn = start - offset;
15750
15314
  end = next + 1;
15751
15315
  break;
15752
-
15753
15316
  default:
15754
15317
  if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {
15755
15318
  next = css.indexOf('*/', start + 2) + 1;
15756
-
15757
15319
  if (next === 0) {
15758
15320
  unclosed('comment', '*/');
15759
15321
  }
15760
-
15761
15322
  content = css.slice(start, next + 1);
15762
15323
  lines = content.split('\n');
15763
15324
  last = lines.length - 1;
15764
-
15765
15325
  if (last > 0) {
15766
15326
  nextLine = line + last;
15767
15327
  nextOffset = next - lines[last].length;
@@ -15769,7 +15329,6 @@ tokenTypes.combinator = combinator$1;
15769
15329
  nextLine = line;
15770
15330
  nextOffset = offset;
15771
15331
  }
15772
-
15773
15332
  tokenType = t.comment;
15774
15333
  line = nextLine;
15775
15334
  endLine = nextLine;
@@ -15786,29 +15345,33 @@ tokenTypes.combinator = combinator$1;
15786
15345
  endLine = line;
15787
15346
  endColumn = next - offset;
15788
15347
  }
15789
-
15790
15348
  end = next + 1;
15791
15349
  break;
15792
- } // Ensure that the token structure remains consistent
15793
-
15350
+ }
15794
15351
 
15795
- tokens.push([tokenType, // [0] Token type
15796
- line, // [1] Starting line
15797
- start - offset, // [2] Starting column
15798
- endLine, // [3] Ending line
15799
- endColumn, // [4] Ending column
15800
- start, // [5] Start position / Source index
15352
+ // Ensure that the token structure remains consistent
15353
+ tokens.push([tokenType,
15354
+ // [0] Token type
15355
+ line,
15356
+ // [1] Starting line
15357
+ start - offset,
15358
+ // [2] Starting column
15359
+ endLine,
15360
+ // [3] Ending line
15361
+ endColumn,
15362
+ // [4] Ending column
15363
+ start,
15364
+ // [5] Start position / Source index
15801
15365
  end // [6] End position
15802
- ]); // Reset offset for the next token
15366
+ ]);
15803
15367
 
15368
+ // Reset offset for the next token
15804
15369
  if (nextOffset) {
15805
15370
  offset = nextOffset;
15806
15371
  nextOffset = null;
15807
15372
  }
15808
-
15809
15373
  start = end;
15810
15374
  }
15811
-
15812
15375
  return tokens;
15813
15376
  }
15814
15377
  } (tokenize));
@@ -15817,70 +15380,43 @@ tokenTypes.combinator = combinator$1;
15817
15380
 
15818
15381
  exports.__esModule = true;
15819
15382
  exports["default"] = void 0;
15820
-
15821
15383
  var _root = _interopRequireDefault(root$1.exports);
15822
-
15823
15384
  var _selector = _interopRequireDefault(selector$1.exports);
15824
-
15825
15385
  var _className = _interopRequireDefault(className$1.exports);
15826
-
15827
15386
  var _comment = _interopRequireDefault(comment$2.exports);
15828
-
15829
15387
  var _id = _interopRequireDefault(id$1.exports);
15830
-
15831
15388
  var _tag = _interopRequireDefault(tag$1.exports);
15832
-
15833
15389
  var _string = _interopRequireDefault(string$1.exports);
15834
-
15835
15390
  var _pseudo = _interopRequireDefault(pseudo$1.exports);
15836
-
15837
15391
  var _attribute = _interopRequireWildcard(attribute$1);
15838
-
15839
15392
  var _universal = _interopRequireDefault(universal$1.exports);
15840
-
15841
15393
  var _combinator = _interopRequireDefault(combinator$2.exports);
15842
-
15843
15394
  var _nesting = _interopRequireDefault(nesting$1.exports);
15844
-
15845
15395
  var _sortAscending = _interopRequireDefault(sortAscending.exports);
15846
-
15847
15396
  var _tokenize = _interopRequireWildcard(tokenize);
15848
-
15849
15397
  var tokens = _interopRequireWildcard(tokenTypes);
15850
-
15851
15398
  var types$1 = _interopRequireWildcard(types);
15852
-
15853
15399
  var _util = util;
15854
-
15855
15400
  var _WHITESPACE_TOKENS, _Object$assign;
15856
-
15857
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15858
-
15859
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15860
-
15401
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15402
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15861
15403
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15862
-
15863
15404
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
15864
-
15865
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
15866
-
15405
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15867
15406
  var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS);
15868
15407
  var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign));
15869
-
15870
15408
  function tokenStart(token) {
15871
15409
  return {
15872
15410
  line: token[_tokenize.FIELDS.START_LINE],
15873
15411
  column: token[_tokenize.FIELDS.START_COL]
15874
15412
  };
15875
15413
  }
15876
-
15877
15414
  function tokenEnd(token) {
15878
15415
  return {
15879
15416
  line: token[_tokenize.FIELDS.END_LINE],
15880
15417
  column: token[_tokenize.FIELDS.END_COL]
15881
15418
  };
15882
15419
  }
15883
-
15884
15420
  function getSource(startLine, startColumn, endLine, endColumn) {
15885
15421
  return {
15886
15422
  start: {
@@ -15893,62 +15429,48 @@ tokenTypes.combinator = combinator$1;
15893
15429
  }
15894
15430
  };
15895
15431
  }
15896
-
15897
15432
  function getTokenSource(token) {
15898
15433
  return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]);
15899
15434
  }
15900
-
15901
15435
  function getTokenSourceSpan(startToken, endToken) {
15902
15436
  if (!startToken) {
15903
15437
  return undefined;
15904
15438
  }
15905
-
15906
15439
  return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]);
15907
15440
  }
15908
-
15909
15441
  function unescapeProp(node, prop) {
15910
15442
  var value = node[prop];
15911
-
15912
15443
  if (typeof value !== "string") {
15913
15444
  return;
15914
15445
  }
15915
-
15916
15446
  if (value.indexOf("\\") !== -1) {
15917
15447
  (0, _util.ensureObject)(node, 'raws');
15918
15448
  node[prop] = (0, _util.unesc)(value);
15919
-
15920
15449
  if (node.raws[prop] === undefined) {
15921
15450
  node.raws[prop] = value;
15922
15451
  }
15923
15452
  }
15924
-
15925
15453
  return node;
15926
15454
  }
15927
-
15928
15455
  function indexesOf(array, item) {
15929
15456
  var i = -1;
15930
15457
  var indexes = [];
15931
-
15932
15458
  while ((i = array.indexOf(item, i + 1)) !== -1) {
15933
15459
  indexes.push(i);
15934
15460
  }
15935
-
15936
15461
  return indexes;
15937
15462
  }
15938
-
15939
15463
  function uniqs() {
15940
15464
  var list = Array.prototype.concat.apply([], arguments);
15941
15465
  return list.filter(function (item, i) {
15942
15466
  return i === list.indexOf(item);
15943
15467
  });
15944
15468
  }
15945
-
15946
15469
  var Parser = /*#__PURE__*/function () {
15947
15470
  function Parser(rule, options) {
15948
15471
  if (options === void 0) {
15949
15472
  options = {};
15950
15473
  }
15951
-
15952
15474
  this.rule = rule;
15953
15475
  this.options = Object.assign({
15954
15476
  lossy: false,
@@ -15978,56 +15500,44 @@ tokenTypes.combinator = combinator$1;
15978
15500
  this.current = selector;
15979
15501
  this.loop();
15980
15502
  }
15981
-
15982
15503
  var _proto = Parser.prototype;
15983
-
15984
15504
  _proto._errorGenerator = function _errorGenerator() {
15985
15505
  var _this = this;
15986
-
15987
15506
  return function (message, errorOptions) {
15988
15507
  if (typeof _this.rule === 'string') {
15989
15508
  return new Error(message);
15990
15509
  }
15991
-
15992
15510
  return _this.rule.error(message, errorOptions);
15993
15511
  };
15994
15512
  };
15995
-
15996
15513
  _proto.attribute = function attribute() {
15997
15514
  var attr = [];
15998
15515
  var startingToken = this.currToken;
15999
15516
  this.position++;
16000
-
16001
15517
  while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
16002
15518
  attr.push(this.currToken);
16003
15519
  this.position++;
16004
15520
  }
16005
-
16006
15521
  if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
16007
15522
  return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]);
16008
15523
  }
16009
-
16010
15524
  var len = attr.length;
16011
15525
  var node = {
16012
15526
  source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),
16013
15527
  sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
16014
15528
  };
16015
-
16016
15529
  if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) {
16017
15530
  return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]);
16018
15531
  }
16019
-
16020
15532
  var pos = 0;
16021
15533
  var spaceBefore = '';
16022
15534
  var commentBefore = '';
16023
15535
  var lastAdded = null;
16024
15536
  var spaceAfterMeaningfulToken = false;
16025
-
16026
15537
  while (pos < len) {
16027
15538
  var token = attr[pos];
16028
15539
  var content = this.content(token);
16029
15540
  var next = attr[pos + 1];
16030
-
16031
15541
  switch (token[_tokenize.FIELDS.TYPE]) {
16032
15542
  case tokens.space:
16033
15543
  // if (
@@ -16037,17 +15547,14 @@ tokenTypes.combinator = combinator$1;
16037
15547
  // return this.expected('attribute', token[TOKEN.START_POS], content);
16038
15548
  // }
16039
15549
  spaceAfterMeaningfulToken = true;
16040
-
16041
15550
  if (this.options.lossy) {
16042
15551
  break;
16043
15552
  }
16044
-
16045
15553
  if (lastAdded) {
16046
15554
  (0, _util.ensureObject)(node, 'spaces', lastAdded);
16047
15555
  var prevContent = node.spaces[lastAdded].after || '';
16048
15556
  node.spaces[lastAdded].after = prevContent + content;
16049
15557
  var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null;
16050
-
16051
15558
  if (existingComment) {
16052
15559
  node.raws.spaces[lastAdded].after = existingComment + content;
16053
15560
  }
@@ -16055,9 +15562,7 @@ tokenTypes.combinator = combinator$1;
16055
15562
  spaceBefore = spaceBefore + content;
16056
15563
  commentBefore = commentBefore + content;
16057
15564
  }
16058
-
16059
15565
  break;
16060
-
16061
15566
  case tokens.asterisk:
16062
15567
  if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
16063
15568
  node.operator = content;
@@ -16068,72 +15573,57 @@ tokenTypes.combinator = combinator$1;
16068
15573
  node.spaces.attribute.before = spaceBefore;
16069
15574
  spaceBefore = '';
16070
15575
  }
16071
-
16072
15576
  if (commentBefore) {
16073
15577
  (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');
16074
15578
  node.raws.spaces.attribute.before = spaceBefore;
16075
15579
  commentBefore = '';
16076
15580
  }
16077
-
16078
15581
  node.namespace = (node.namespace || "") + content;
16079
15582
  var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null;
16080
-
16081
15583
  if (rawValue) {
16082
15584
  node.raws.namespace += content;
16083
15585
  }
16084
-
16085
15586
  lastAdded = 'namespace';
16086
15587
  }
16087
-
16088
15588
  spaceAfterMeaningfulToken = false;
16089
15589
  break;
16090
-
16091
15590
  case tokens.dollar:
16092
15591
  if (lastAdded === "value") {
16093
15592
  var oldRawValue = (0, _util.getProp)(node, 'raws', 'value');
16094
15593
  node.value += "$";
16095
-
16096
15594
  if (oldRawValue) {
16097
15595
  node.raws.value = oldRawValue + "$";
16098
15596
  }
16099
-
16100
15597
  break;
16101
15598
  }
16102
-
16103
15599
  // Falls through
16104
-
16105
15600
  case tokens.caret:
16106
15601
  if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
16107
15602
  node.operator = content;
16108
15603
  lastAdded = 'operator';
16109
15604
  }
16110
-
16111
15605
  spaceAfterMeaningfulToken = false;
16112
15606
  break;
16113
-
16114
15607
  case tokens.combinator:
16115
15608
  if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) {
16116
15609
  node.operator = content;
16117
15610
  lastAdded = 'operator';
16118
15611
  }
16119
-
16120
15612
  if (content !== '|') {
16121
15613
  spaceAfterMeaningfulToken = false;
16122
15614
  break;
16123
15615
  }
16124
-
16125
15616
  if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
16126
15617
  node.operator = content;
16127
15618
  lastAdded = 'operator';
16128
15619
  } else if (!node.namespace && !node.attribute) {
16129
15620
  node.namespace = true;
16130
15621
  }
16131
-
16132
15622
  spaceAfterMeaningfulToken = false;
16133
15623
  break;
16134
-
16135
15624
  case tokens.word:
16136
- if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved.
15625
+ if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals &&
15626
+ // this look-ahead probably fails with comment nodes involved.
16137
15627
  !node.operator && !node.namespace) {
16138
15628
  node.namespace = content;
16139
15629
  lastAdded = 'namespace';
@@ -16143,56 +15633,42 @@ tokenTypes.combinator = combinator$1;
16143
15633
  node.spaces.attribute.before = spaceBefore;
16144
15634
  spaceBefore = '';
16145
15635
  }
16146
-
16147
15636
  if (commentBefore) {
16148
15637
  (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');
16149
15638
  node.raws.spaces.attribute.before = commentBefore;
16150
15639
  commentBefore = '';
16151
15640
  }
16152
-
16153
15641
  node.attribute = (node.attribute || "") + content;
16154
-
16155
15642
  var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null;
16156
-
16157
15643
  if (_rawValue) {
16158
15644
  node.raws.attribute += content;
16159
15645
  }
16160
-
16161
15646
  lastAdded = 'attribute';
16162
- } else if (!node.value && node.value !== "" || lastAdded === "value" && !spaceAfterMeaningfulToken) {
15647
+ } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) {
16163
15648
  var _unescaped = (0, _util.unesc)(content);
16164
-
16165
15649
  var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || '';
16166
-
16167
15650
  var oldValue = node.value || '';
16168
15651
  node.value = oldValue + _unescaped;
16169
15652
  node.quoteMark = null;
16170
-
16171
15653
  if (_unescaped !== content || _oldRawValue) {
16172
15654
  (0, _util.ensureObject)(node, 'raws');
16173
15655
  node.raws.value = (_oldRawValue || oldValue) + content;
16174
15656
  }
16175
-
16176
15657
  lastAdded = 'value';
16177
15658
  } else {
16178
15659
  var insensitive = content === 'i' || content === "I";
16179
-
16180
15660
  if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) {
16181
15661
  node.insensitive = insensitive;
16182
-
16183
15662
  if (!insensitive || content === "I") {
16184
15663
  (0, _util.ensureObject)(node, 'raws');
16185
15664
  node.raws.insensitiveFlag = content;
16186
15665
  }
16187
-
16188
15666
  lastAdded = 'insensitive';
16189
-
16190
15667
  if (spaceBefore) {
16191
15668
  (0, _util.ensureObject)(node, 'spaces', 'insensitive');
16192
15669
  node.spaces.insensitive.before = spaceBefore;
16193
15670
  spaceBefore = '';
16194
15671
  }
16195
-
16196
15672
  if (commentBefore) {
16197
15673
  (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive');
16198
15674
  node.raws.spaces.insensitive.before = commentBefore;
@@ -16201,27 +15677,22 @@ tokenTypes.combinator = combinator$1;
16201
15677
  } else if (node.value || node.value === '') {
16202
15678
  lastAdded = 'value';
16203
15679
  node.value += content;
16204
-
16205
15680
  if (node.raws.value) {
16206
15681
  node.raws.value += content;
16207
15682
  }
16208
15683
  }
16209
15684
  }
16210
-
16211
15685
  spaceAfterMeaningfulToken = false;
16212
15686
  break;
16213
-
16214
15687
  case tokens.str:
16215
15688
  if (!node.attribute || !node.operator) {
16216
15689
  return this.error("Expected an attribute followed by an operator preceding the string.", {
16217
15690
  index: token[_tokenize.FIELDS.START_POS]
16218
15691
  });
16219
15692
  }
16220
-
16221
15693
  var _unescapeValue = (0, _attribute.unescapeValue)(content),
16222
- unescaped = _unescapeValue.unescaped,
16223
- quoteMark = _unescapeValue.quoteMark;
16224
-
15694
+ unescaped = _unescapeValue.unescaped,
15695
+ quoteMark = _unescapeValue.quoteMark;
16225
15696
  node.value = unescaped;
16226
15697
  node.quoteMark = quoteMark;
16227
15698
  lastAdded = 'value';
@@ -16229,23 +15700,19 @@ tokenTypes.combinator = combinator$1;
16229
15700
  node.raws.value = content;
16230
15701
  spaceAfterMeaningfulToken = false;
16231
15702
  break;
16232
-
16233
15703
  case tokens.equals:
16234
15704
  if (!node.attribute) {
16235
15705
  return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content);
16236
15706
  }
16237
-
16238
15707
  if (node.value) {
16239
15708
  return this.error('Unexpected "=" found; an operator was already defined.', {
16240
15709
  index: token[_tokenize.FIELDS.START_POS]
16241
15710
  });
16242
15711
  }
16243
-
16244
15712
  node.operator = node.operator ? node.operator + content : content;
16245
15713
  lastAdded = 'operator';
16246
15714
  spaceAfterMeaningfulToken = false;
16247
15715
  break;
16248
-
16249
15716
  case tokens.comment:
16250
15717
  if (lastAdded) {
16251
15718
  if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') {
@@ -16262,23 +15729,20 @@ tokenTypes.combinator = combinator$1;
16262
15729
  } else {
16263
15730
  commentBefore = commentBefore + content;
16264
15731
  }
16265
-
16266
15732
  break;
16267
-
16268
15733
  default:
16269
15734
  return this.error("Unexpected \"" + content + "\" found.", {
16270
15735
  index: token[_tokenize.FIELDS.START_POS]
16271
15736
  });
16272
15737
  }
16273
-
16274
15738
  pos++;
16275
15739
  }
16276
-
16277
15740
  unescapeProp(node, "attribute");
16278
15741
  unescapeProp(node, "namespace");
16279
15742
  this.newNode(new _attribute["default"](node));
16280
15743
  this.position++;
16281
15744
  }
15745
+
16282
15746
  /**
16283
15747
  * return a node containing meaningless garbage up to (but not including) the specified token position.
16284
15748
  * if the token position is negative, all remaining tokens are consumed.
@@ -16290,19 +15754,15 @@ tokenTypes.combinator = combinator$1;
16290
15754
  * a previous node's space metadata.
16291
15755
  *
16292
15756
  * In lossy mode, this returns only comments.
16293
- */
16294
- ;
16295
-
15757
+ */;
16296
15758
  _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) {
16297
15759
  if (stopPosition < 0) {
16298
15760
  stopPosition = this.tokens.length;
16299
15761
  }
16300
-
16301
15762
  var startPosition = this.position;
16302
15763
  var nodes = [];
16303
15764
  var space = "";
16304
15765
  var lastComment = undefined;
16305
-
16306
15766
  do {
16307
15767
  if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {
16308
15768
  if (!this.options.lossy) {
@@ -16310,12 +15770,10 @@ tokenTypes.combinator = combinator$1;
16310
15770
  }
16311
15771
  } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) {
16312
15772
  var spaces = {};
16313
-
16314
15773
  if (space) {
16315
15774
  spaces.before = space;
16316
15775
  space = "";
16317
15776
  }
16318
-
16319
15777
  lastComment = new _comment["default"]({
16320
15778
  value: this.content(),
16321
15779
  source: getTokenSource(this.currToken),
@@ -16325,7 +15783,6 @@ tokenTypes.combinator = combinator$1;
16325
15783
  nodes.push(lastComment);
16326
15784
  }
16327
15785
  } while (++this.position < stopPosition);
16328
-
16329
15786
  if (space) {
16330
15787
  if (lastComment) {
16331
15788
  lastComment.spaces.after = space;
@@ -16343,62 +15800,49 @@ tokenTypes.combinator = combinator$1;
16343
15800
  }));
16344
15801
  }
16345
15802
  }
15803
+ return nodes;
15804
+ }
16346
15805
 
16347
- return nodes;
16348
- }
16349
- /**
16350
- *
16351
- * @param {*} nodes
16352
- */
16353
- ;
16354
-
15806
+ /**
15807
+ *
15808
+ * @param {*} nodes
15809
+ */;
16355
15810
  _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) {
16356
15811
  var _this2 = this;
16357
-
16358
15812
  if (requiredSpace === void 0) {
16359
15813
  requiredSpace = false;
16360
15814
  }
16361
-
16362
15815
  var space = "";
16363
15816
  var rawSpace = "";
16364
15817
  nodes.forEach(function (n) {
16365
15818
  var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace);
16366
-
16367
15819
  var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace);
16368
-
16369
15820
  space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);
16370
15821
  rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);
16371
15822
  });
16372
-
16373
15823
  if (rawSpace === space) {
16374
15824
  rawSpace = undefined;
16375
15825
  }
16376
-
16377
15826
  var result = {
16378
15827
  space: space,
16379
15828
  rawSpace: rawSpace
16380
15829
  };
16381
15830
  return result;
16382
15831
  };
16383
-
16384
15832
  _proto.isNamedCombinator = function isNamedCombinator(position) {
16385
15833
  if (position === void 0) {
16386
15834
  position = this.position;
16387
15835
  }
16388
-
16389
15836
  return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash;
16390
15837
  };
16391
-
16392
15838
  _proto.namedCombinator = function namedCombinator() {
16393
15839
  if (this.isNamedCombinator()) {
16394
15840
  var nameRaw = this.content(this.tokens[this.position + 1]);
16395
15841
  var name = (0, _util.unesc)(nameRaw).toLowerCase();
16396
15842
  var raws = {};
16397
-
16398
15843
  if (name !== nameRaw) {
16399
15844
  raws.value = "/" + nameRaw + "/";
16400
15845
  }
16401
-
16402
15846
  var node = new _combinator["default"]({
16403
15847
  value: "/" + name + "/",
16404
15848
  source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]),
@@ -16411,32 +15855,24 @@ tokenTypes.combinator = combinator$1;
16411
15855
  this.unexpected();
16412
15856
  }
16413
15857
  };
16414
-
16415
15858
  _proto.combinator = function combinator() {
16416
15859
  var _this3 = this;
16417
-
16418
15860
  if (this.content() === '|') {
16419
15861
  return this.namespace();
16420
- } // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector.
16421
-
16422
-
15862
+ }
15863
+ // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector.
16423
15864
  var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);
16424
-
16425
15865
  if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) {
16426
15866
  var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
16427
-
16428
15867
  if (nodes.length > 0) {
16429
15868
  var last = this.current.last;
16430
-
16431
15869
  if (last) {
16432
15870
  var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes),
16433
- space = _this$convertWhitespa.space,
16434
- rawSpace = _this$convertWhitespa.rawSpace;
16435
-
15871
+ space = _this$convertWhitespa.space,
15872
+ rawSpace = _this$convertWhitespa.rawSpace;
16436
15873
  if (rawSpace !== undefined) {
16437
15874
  last.rawSpaceAfter += rawSpace;
16438
15875
  }
16439
-
16440
15876
  last.spaces.after += space;
16441
15877
  } else {
16442
15878
  nodes.forEach(function (n) {
@@ -16444,19 +15880,14 @@ tokenTypes.combinator = combinator$1;
16444
15880
  });
16445
15881
  }
16446
15882
  }
16447
-
16448
15883
  return;
16449
15884
  }
16450
-
16451
15885
  var firstToken = this.currToken;
16452
15886
  var spaceOrDescendantSelectorNodes = undefined;
16453
-
16454
15887
  if (nextSigTokenPos > this.position) {
16455
15888
  spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
16456
15889
  }
16457
-
16458
15890
  var node;
16459
-
16460
15891
  if (this.isNamedCombinator()) {
16461
15892
  node = this.namedCombinator();
16462
15893
  } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) {
@@ -16469,31 +15900,26 @@ tokenTypes.combinator = combinator$1;
16469
15900
  } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) ; else if (!spaceOrDescendantSelectorNodes) {
16470
15901
  this.unexpected();
16471
15902
  }
16472
-
16473
15903
  if (node) {
16474
15904
  if (spaceOrDescendantSelectorNodes) {
16475
15905
  var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes),
16476
- _space = _this$convertWhitespa2.space,
16477
- _rawSpace = _this$convertWhitespa2.rawSpace;
16478
-
15906
+ _space = _this$convertWhitespa2.space,
15907
+ _rawSpace = _this$convertWhitespa2.rawSpace;
16479
15908
  node.spaces.before = _space;
16480
15909
  node.rawSpaceBefore = _rawSpace;
16481
15910
  }
16482
15911
  } else {
16483
15912
  // descendant combinator
16484
15913
  var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true),
16485
- _space2 = _this$convertWhitespa3.space,
16486
- _rawSpace2 = _this$convertWhitespa3.rawSpace;
16487
-
15914
+ _space2 = _this$convertWhitespa3.space,
15915
+ _rawSpace2 = _this$convertWhitespa3.rawSpace;
16488
15916
  if (!_rawSpace2) {
16489
15917
  _rawSpace2 = _space2;
16490
15918
  }
16491
-
16492
15919
  var spaces = {};
16493
15920
  var raws = {
16494
15921
  spaces: {}
16495
15922
  };
16496
-
16497
15923
  if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) {
16498
15924
  spaces.before = _space2.slice(0, _space2.length - 1);
16499
15925
  raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1);
@@ -16503,7 +15929,6 @@ tokenTypes.combinator = combinator$1;
16503
15929
  } else {
16504
15930
  raws.value = _rawSpace2;
16505
15931
  }
16506
-
16507
15932
  node = new _combinator["default"]({
16508
15933
  value: ' ',
16509
15934
  source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),
@@ -16512,24 +15937,19 @@ tokenTypes.combinator = combinator$1;
16512
15937
  raws: raws
16513
15938
  });
16514
15939
  }
16515
-
16516
15940
  if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) {
16517
15941
  node.spaces.after = this.optionalSpace(this.content());
16518
15942
  this.position++;
16519
15943
  }
16520
-
16521
15944
  return this.newNode(node);
16522
15945
  };
16523
-
16524
15946
  _proto.comma = function comma() {
16525
15947
  if (this.position === this.tokens.length - 1) {
16526
15948
  this.root.trailingComma = true;
16527
15949
  this.position++;
16528
15950
  return;
16529
15951
  }
16530
-
16531
15952
  this.current._inferEndPosition();
16532
-
16533
15953
  var selector = new _selector["default"]({
16534
15954
  source: {
16535
15955
  start: tokenStart(this.tokens[this.position + 1])
@@ -16539,7 +15959,6 @@ tokenTypes.combinator = combinator$1;
16539
15959
  this.current = selector;
16540
15960
  this.position++;
16541
15961
  };
16542
-
16543
15962
  _proto.comment = function comment() {
16544
15963
  var current = this.currToken;
16545
15964
  this.newNode(new _comment["default"]({
@@ -16549,32 +15968,28 @@ tokenTypes.combinator = combinator$1;
16549
15968
  }));
16550
15969
  this.position++;
16551
15970
  };
16552
-
16553
15971
  _proto.error = function error(message, opts) {
16554
15972
  throw this.root.error(message, opts);
16555
15973
  };
16556
-
16557
15974
  _proto.missingBackslash = function missingBackslash() {
16558
15975
  return this.error('Expected a backslash preceding the semicolon.', {
16559
15976
  index: this.currToken[_tokenize.FIELDS.START_POS]
16560
15977
  });
16561
15978
  };
16562
-
16563
15979
  _proto.missingParenthesis = function missingParenthesis() {
16564
15980
  return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);
16565
15981
  };
16566
-
16567
15982
  _proto.missingSquareBracket = function missingSquareBracket() {
16568
15983
  return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]);
16569
15984
  };
16570
-
16571
15985
  _proto.unexpected = function unexpected() {
16572
15986
  return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]);
16573
15987
  };
16574
-
15988
+ _proto.unexpectedPipe = function unexpectedPipe() {
15989
+ return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]);
15990
+ };
16575
15991
  _proto.namespace = function namespace() {
16576
15992
  var before = this.prevToken && this.content(this.prevToken) || true;
16577
-
16578
15993
  if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) {
16579
15994
  this.position++;
16580
15995
  return this.word(before);
@@ -16582,18 +15997,16 @@ tokenTypes.combinator = combinator$1;
16582
15997
  this.position++;
16583
15998
  return this.universal(before);
16584
15999
  }
16000
+ this.unexpectedPipe();
16585
16001
  };
16586
-
16587
16002
  _proto.nesting = function nesting() {
16588
16003
  if (this.nextToken) {
16589
16004
  var nextContent = this.content(this.nextToken);
16590
-
16591
16005
  if (nextContent === "|") {
16592
16006
  this.position++;
16593
16007
  return;
16594
16008
  }
16595
16009
  }
16596
-
16597
16010
  var current = this.currToken;
16598
16011
  this.newNode(new _nesting["default"]({
16599
16012
  value: this.content(),
@@ -16602,12 +16015,10 @@ tokenTypes.combinator = combinator$1;
16602
16015
  }));
16603
16016
  this.position++;
16604
16017
  };
16605
-
16606
16018
  _proto.parentheses = function parentheses() {
16607
16019
  var last = this.current.last;
16608
16020
  var unbalanced = 1;
16609
16021
  this.position++;
16610
-
16611
16022
  if (last && last.type === types$1.PSEUDO) {
16612
16023
  var selector = new _selector["default"]({
16613
16024
  source: {
@@ -16617,16 +16028,13 @@ tokenTypes.combinator = combinator$1;
16617
16028
  var cache = this.current;
16618
16029
  last.append(selector);
16619
16030
  this.current = selector;
16620
-
16621
16031
  while (this.position < this.tokens.length && unbalanced) {
16622
16032
  if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
16623
16033
  unbalanced++;
16624
16034
  }
16625
-
16626
16035
  if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
16627
16036
  unbalanced--;
16628
16037
  }
16629
-
16630
16038
  if (unbalanced) {
16631
16039
  this.parse();
16632
16040
  } else {
@@ -16635,7 +16043,6 @@ tokenTypes.combinator = combinator$1;
16635
16043
  this.position++;
16636
16044
  }
16637
16045
  }
16638
-
16639
16046
  this.current = cache;
16640
16047
  } else {
16641
16048
  // I think this case should be an error. It's used to implement a basic parse of media queries
@@ -16643,21 +16050,17 @@ tokenTypes.combinator = combinator$1;
16643
16050
  var parenStart = this.currToken;
16644
16051
  var parenValue = "(";
16645
16052
  var parenEnd;
16646
-
16647
16053
  while (this.position < this.tokens.length && unbalanced) {
16648
16054
  if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
16649
16055
  unbalanced++;
16650
16056
  }
16651
-
16652
16057
  if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
16653
16058
  unbalanced--;
16654
16059
  }
16655
-
16656
16060
  parenEnd = this.currToken;
16657
16061
  parenValue += this.parseParenthesisToken(this.currToken);
16658
16062
  this.position++;
16659
16063
  }
16660
-
16661
16064
  if (last) {
16662
16065
  last.appendToPropertyAndEscape("value", parenValue, parenValue);
16663
16066
  } else {
@@ -16668,37 +16071,29 @@ tokenTypes.combinator = combinator$1;
16668
16071
  }));
16669
16072
  }
16670
16073
  }
16671
-
16672
16074
  if (unbalanced) {
16673
16075
  return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);
16674
16076
  }
16675
16077
  };
16676
-
16677
16078
  _proto.pseudo = function pseudo() {
16678
16079
  var _this4 = this;
16679
-
16680
16080
  var pseudoStr = '';
16681
16081
  var startingToken = this.currToken;
16682
-
16683
16082
  while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) {
16684
16083
  pseudoStr += this.content();
16685
16084
  this.position++;
16686
16085
  }
16687
-
16688
16086
  if (!this.currToken) {
16689
16087
  return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1);
16690
16088
  }
16691
-
16692
16089
  if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) {
16693
16090
  this.splitWord(false, function (first, length) {
16694
16091
  pseudoStr += first;
16695
-
16696
16092
  _this4.newNode(new _pseudo["default"]({
16697
16093
  value: pseudoStr,
16698
16094
  source: getTokenSourceSpan(startingToken, _this4.currToken),
16699
16095
  sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
16700
16096
  }));
16701
-
16702
16097
  if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
16703
16098
  _this4.error('Misplaced parenthesis.', {
16704
16099
  index: _this4.nextToken[_tokenize.FIELDS.START_POS]
@@ -16709,10 +16104,9 @@ tokenTypes.combinator = combinator$1;
16709
16104
  return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]);
16710
16105
  }
16711
16106
  };
16712
-
16713
16107
  _proto.space = function space() {
16714
- var content = this.content(); // Handle space before and after the selector
16715
-
16108
+ var content = this.content();
16109
+ // Handle space before and after the selector
16716
16110
  if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) {
16717
16111
  return node.type === 'comment';
16718
16112
  })) {
@@ -16725,7 +16119,6 @@ tokenTypes.combinator = combinator$1;
16725
16119
  this.combinator();
16726
16120
  }
16727
16121
  };
16728
-
16729
16122
  _proto.string = function string() {
16730
16123
  var current = this.currToken;
16731
16124
  this.newNode(new _string["default"]({
@@ -16735,15 +16128,12 @@ tokenTypes.combinator = combinator$1;
16735
16128
  }));
16736
16129
  this.position++;
16737
16130
  };
16738
-
16739
16131
  _proto.universal = function universal(namespace) {
16740
16132
  var nextToken = this.nextToken;
16741
-
16742
16133
  if (nextToken && this.content(nextToken) === '|') {
16743
16134
  this.position++;
16744
16135
  return this.namespace();
16745
16136
  }
16746
-
16747
16137
  var current = this.currToken;
16748
16138
  this.newNode(new _universal["default"]({
16749
16139
  value: this.content(),
@@ -16752,63 +16142,51 @@ tokenTypes.combinator = combinator$1;
16752
16142
  }), namespace);
16753
16143
  this.position++;
16754
16144
  };
16755
-
16756
16145
  _proto.splitWord = function splitWord(namespace, firstCallback) {
16757
16146
  var _this5 = this;
16758
-
16759
16147
  var nextToken = this.nextToken;
16760
16148
  var word = this.content();
16761
-
16762
16149
  while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) {
16763
16150
  this.position++;
16764
16151
  var current = this.content();
16765
16152
  word += current;
16766
-
16767
16153
  if (current.lastIndexOf('\\') === current.length - 1) {
16768
16154
  var next = this.nextToken;
16769
-
16770
16155
  if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) {
16771
16156
  word += this.requiredSpace(this.content(next));
16772
16157
  this.position++;
16773
16158
  }
16774
16159
  }
16775
-
16776
16160
  nextToken = this.nextToken;
16777
16161
  }
16778
-
16779
16162
  var hasClass = indexesOf(word, '.').filter(function (i) {
16780
16163
  // Allow escaped dot within class name
16781
- var escapedDot = word[i - 1] === '\\'; // Allow decimal numbers percent in @keyframes
16782
-
16164
+ var escapedDot = word[i - 1] === '\\';
16165
+ // Allow decimal numbers percent in @keyframes
16783
16166
  var isKeyframesPercent = /^\d+\.\d+%$/.test(word);
16784
16167
  return !escapedDot && !isKeyframesPercent;
16785
16168
  });
16786
16169
  var hasId = indexesOf(word, '#').filter(function (i) {
16787
16170
  return word[i - 1] !== '\\';
16788
- }); // Eliminate Sass interpolations from the list of id indexes
16789
-
16171
+ });
16172
+ // Eliminate Sass interpolations from the list of id indexes
16790
16173
  var interpolations = indexesOf(word, '#{');
16791
-
16792
16174
  if (interpolations.length) {
16793
16175
  hasId = hasId.filter(function (hashIndex) {
16794
16176
  return !~interpolations.indexOf(hashIndex);
16795
16177
  });
16796
16178
  }
16797
-
16798
16179
  var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId)));
16799
16180
  indices.forEach(function (ind, i) {
16800
16181
  var index = indices[i + 1] || word.length;
16801
16182
  var value = word.slice(ind, index);
16802
-
16803
16183
  if (i === 0 && firstCallback) {
16804
16184
  return firstCallback.call(_this5, value, indices.length);
16805
16185
  }
16806
-
16807
16186
  var node;
16808
16187
  var current = _this5.currToken;
16809
16188
  var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i];
16810
16189
  var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));
16811
-
16812
16190
  if (~hasClass.indexOf(ind)) {
16813
16191
  var classNameOpts = {
16814
16192
  value: value.slice(1),
@@ -16832,136 +16210,105 @@ tokenTypes.combinator = combinator$1;
16832
16210
  unescapeProp(tagOpts, "value");
16833
16211
  node = new _tag["default"](tagOpts);
16834
16212
  }
16835
-
16836
- _this5.newNode(node, namespace); // Ensure that the namespace is used only once
16837
-
16838
-
16213
+ _this5.newNode(node, namespace);
16214
+ // Ensure that the namespace is used only once
16839
16215
  namespace = null;
16840
16216
  });
16841
16217
  this.position++;
16842
16218
  };
16843
-
16844
16219
  _proto.word = function word(namespace) {
16845
16220
  var nextToken = this.nextToken;
16846
-
16847
16221
  if (nextToken && this.content(nextToken) === '|') {
16848
16222
  this.position++;
16849
16223
  return this.namespace();
16850
16224
  }
16851
-
16852
16225
  return this.splitWord(namespace);
16853
16226
  };
16854
-
16855
16227
  _proto.loop = function loop() {
16856
16228
  while (this.position < this.tokens.length) {
16857
16229
  this.parse(true);
16858
16230
  }
16859
-
16860
16231
  this.current._inferEndPosition();
16861
-
16862
16232
  return this.root;
16863
16233
  };
16864
-
16865
16234
  _proto.parse = function parse(throwOnParenthesis) {
16866
16235
  switch (this.currToken[_tokenize.FIELDS.TYPE]) {
16867
16236
  case tokens.space:
16868
16237
  this.space();
16869
16238
  break;
16870
-
16871
16239
  case tokens.comment:
16872
16240
  this.comment();
16873
16241
  break;
16874
-
16875
16242
  case tokens.openParenthesis:
16876
16243
  this.parentheses();
16877
16244
  break;
16878
-
16879
16245
  case tokens.closeParenthesis:
16880
16246
  if (throwOnParenthesis) {
16881
16247
  this.missingParenthesis();
16882
16248
  }
16883
-
16884
16249
  break;
16885
-
16886
16250
  case tokens.openSquare:
16887
16251
  this.attribute();
16888
16252
  break;
16889
-
16890
16253
  case tokens.dollar:
16891
16254
  case tokens.caret:
16892
16255
  case tokens.equals:
16893
16256
  case tokens.word:
16894
16257
  this.word();
16895
16258
  break;
16896
-
16897
16259
  case tokens.colon:
16898
16260
  this.pseudo();
16899
16261
  break;
16900
-
16901
16262
  case tokens.comma:
16902
16263
  this.comma();
16903
16264
  break;
16904
-
16905
16265
  case tokens.asterisk:
16906
16266
  this.universal();
16907
16267
  break;
16908
-
16909
16268
  case tokens.ampersand:
16910
16269
  this.nesting();
16911
16270
  break;
16912
-
16913
16271
  case tokens.slash:
16914
16272
  case tokens.combinator:
16915
16273
  this.combinator();
16916
16274
  break;
16917
-
16918
16275
  case tokens.str:
16919
16276
  this.string();
16920
16277
  break;
16921
16278
  // These cases throw; no break needed.
16922
-
16923
16279
  case tokens.closeSquare:
16924
16280
  this.missingSquareBracket();
16925
-
16926
16281
  case tokens.semicolon:
16927
16282
  this.missingBackslash();
16928
-
16929
16283
  default:
16930
16284
  this.unexpected();
16931
16285
  }
16932
16286
  }
16287
+
16933
16288
  /**
16934
16289
  * Helpers
16935
- */
16936
- ;
16937
-
16290
+ */;
16938
16291
  _proto.expected = function expected(description, index, found) {
16939
16292
  if (Array.isArray(description)) {
16940
16293
  var last = description.pop();
16941
16294
  description = description.join(', ') + " or " + last;
16942
16295
  }
16943
-
16944
16296
  var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a';
16945
-
16946
16297
  if (!found) {
16947
16298
  return this.error("Expected " + an + " " + description + ".", {
16948
16299
  index: index
16949
16300
  });
16950
16301
  }
16951
-
16952
16302
  return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", {
16953
16303
  index: index
16954
16304
  });
16955
16305
  };
16956
-
16957
16306
  _proto.requiredSpace = function requiredSpace(space) {
16958
16307
  return this.options.lossy ? ' ' : space;
16959
16308
  };
16960
-
16961
16309
  _proto.optionalSpace = function optionalSpace(space) {
16962
16310
  return this.options.lossy ? '' : space;
16963
16311
  };
16964
-
16965
16312
  _proto.lossySpace = function lossySpace(space, required) {
16966
16313
  if (this.options.lossy) {
16967
16314
  return required ? ' ' : '';
@@ -16969,47 +16316,37 @@ tokenTypes.combinator = combinator$1;
16969
16316
  return space;
16970
16317
  }
16971
16318
  };
16972
-
16973
16319
  _proto.parseParenthesisToken = function parseParenthesisToken(token) {
16974
16320
  var content = this.content(token);
16975
-
16976
16321
  if (token[_tokenize.FIELDS.TYPE] === tokens.space) {
16977
16322
  return this.requiredSpace(content);
16978
16323
  } else {
16979
16324
  return content;
16980
16325
  }
16981
16326
  };
16982
-
16983
16327
  _proto.newNode = function newNode(node, namespace) {
16984
16328
  if (namespace) {
16985
16329
  if (/^ +$/.test(namespace)) {
16986
16330
  if (!this.options.lossy) {
16987
16331
  this.spaces = (this.spaces || '') + namespace;
16988
16332
  }
16989
-
16990
16333
  namespace = true;
16991
16334
  }
16992
-
16993
16335
  node.namespace = namespace;
16994
16336
  unescapeProp(node, "namespace");
16995
16337
  }
16996
-
16997
16338
  if (this.spaces) {
16998
16339
  node.spaces.before = this.spaces;
16999
16340
  this.spaces = '';
17000
16341
  }
17001
-
17002
16342
  return this.current.append(node);
17003
16343
  };
17004
-
17005
16344
  _proto.content = function content(token) {
17006
16345
  if (token === void 0) {
17007
16346
  token = this.currToken;
17008
16347
  }
17009
-
17010
16348
  return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]);
17011
16349
  };
17012
-
17013
16350
  /**
17014
16351
  * returns the index of the next non-whitespace, non-comment token.
17015
16352
  * returns -1 if no meaningful token is found.
@@ -17018,9 +16355,7 @@ tokenTypes.combinator = combinator$1;
17018
16355
  if (startPosition === void 0) {
17019
16356
  startPosition = this.position + 1;
17020
16357
  }
17021
-
17022
16358
  var searchPosition = startPosition;
17023
-
17024
16359
  while (searchPosition < this.tokens.length) {
17025
16360
  if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) {
17026
16361
  searchPosition++;
@@ -17029,10 +16364,8 @@ tokenTypes.combinator = combinator$1;
17029
16364
  return searchPosition;
17030
16365
  }
17031
16366
  }
17032
-
17033
16367
  return -1;
17034
16368
  };
17035
-
17036
16369
  _createClass(Parser, [{
17037
16370
  key: "currToken",
17038
16371
  get: function get() {
@@ -17049,10 +16382,8 @@ tokenTypes.combinator = combinator$1;
17049
16382
  return this.tokens[this.position - 1];
17050
16383
  }
17051
16384
  }]);
17052
-
17053
16385
  return Parser;
17054
16386
  }();
17055
-
17056
16387
  exports["default"] = Parser;
17057
16388
  module.exports = exports.default;
17058
16389
  } (parser, parser.exports));
@@ -17061,83 +16392,63 @@ tokenTypes.combinator = combinator$1;
17061
16392
 
17062
16393
  exports.__esModule = true;
17063
16394
  exports["default"] = void 0;
17064
-
17065
16395
  var _parser = _interopRequireDefault(parser.exports);
17066
-
17067
16396
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17068
-
17069
16397
  var Processor = /*#__PURE__*/function () {
17070
16398
  function Processor(func, options) {
17071
16399
  this.func = func || function noop() {};
17072
-
17073
16400
  this.funcRes = null;
17074
16401
  this.options = options;
17075
16402
  }
17076
-
17077
16403
  var _proto = Processor.prototype;
17078
-
17079
16404
  _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) {
17080
16405
  if (options === void 0) {
17081
16406
  options = {};
17082
16407
  }
17083
-
17084
16408
  var merged = Object.assign({}, this.options, options);
17085
-
17086
16409
  if (merged.updateSelector === false) {
17087
16410
  return false;
17088
16411
  } else {
17089
16412
  return typeof rule !== "string";
17090
16413
  }
17091
16414
  };
17092
-
17093
16415
  _proto._isLossy = function _isLossy(options) {
17094
16416
  if (options === void 0) {
17095
16417
  options = {};
17096
16418
  }
17097
-
17098
16419
  var merged = Object.assign({}, this.options, options);
17099
-
17100
16420
  if (merged.lossless === false) {
17101
16421
  return true;
17102
16422
  } else {
17103
16423
  return false;
17104
16424
  }
17105
16425
  };
17106
-
17107
16426
  _proto._root = function _root(rule, options) {
17108
16427
  if (options === void 0) {
17109
16428
  options = {};
17110
16429
  }
17111
-
17112
16430
  var parser = new _parser["default"](rule, this._parseOptions(options));
17113
16431
  return parser.root;
17114
16432
  };
17115
-
17116
16433
  _proto._parseOptions = function _parseOptions(options) {
17117
16434
  return {
17118
16435
  lossy: this._isLossy(options)
17119
16436
  };
17120
16437
  };
17121
-
17122
16438
  _proto._run = function _run(rule, options) {
17123
16439
  var _this = this;
17124
-
17125
16440
  if (options === void 0) {
17126
16441
  options = {};
17127
16442
  }
17128
-
17129
16443
  return new Promise(function (resolve, reject) {
17130
16444
  try {
17131
16445
  var root = _this._root(rule, options);
17132
-
17133
16446
  Promise.resolve(_this.func(root)).then(function (transform) {
17134
16447
  var string = undefined;
17135
-
17136
16448
  if (_this._shouldUpdateSelector(rule, options)) {
17137
16449
  string = root.toString();
17138
16450
  rule.selector = string;
17139
16451
  }
17140
-
17141
16452
  return {
17142
16453
  transform: transform,
17143
16454
  root: root,
@@ -17150,117 +16461,101 @@ tokenTypes.combinator = combinator$1;
17150
16461
  }
17151
16462
  });
17152
16463
  };
17153
-
17154
16464
  _proto._runSync = function _runSync(rule, options) {
17155
16465
  if (options === void 0) {
17156
16466
  options = {};
17157
16467
  }
17158
-
17159
16468
  var root = this._root(rule, options);
17160
-
17161
16469
  var transform = this.func(root);
17162
-
17163
16470
  if (transform && typeof transform.then === "function") {
17164
16471
  throw new Error("Selector processor returned a promise to a synchronous call.");
17165
16472
  }
17166
-
17167
16473
  var string = undefined;
17168
-
17169
16474
  if (options.updateSelector && typeof rule !== "string") {
17170
16475
  string = root.toString();
17171
16476
  rule.selector = string;
17172
16477
  }
17173
-
17174
16478
  return {
17175
16479
  transform: transform,
17176
16480
  root: root,
17177
16481
  string: string
17178
16482
  };
17179
16483
  }
16484
+
17180
16485
  /**
17181
16486
  * Process rule into a selector AST.
17182
16487
  *
17183
16488
  * @param rule {postcss.Rule | string} The css selector to be processed
17184
16489
  * @param options The options for processing
17185
16490
  * @returns {Promise<parser.Root>} The AST of the selector after processing it.
17186
- */
17187
- ;
17188
-
16491
+ */;
17189
16492
  _proto.ast = function ast(rule, options) {
17190
16493
  return this._run(rule, options).then(function (result) {
17191
16494
  return result.root;
17192
16495
  });
17193
16496
  }
16497
+
17194
16498
  /**
17195
16499
  * Process rule into a selector AST synchronously.
17196
16500
  *
17197
16501
  * @param rule {postcss.Rule | string} The css selector to be processed
17198
16502
  * @param options The options for processing
17199
16503
  * @returns {parser.Root} The AST of the selector after processing it.
17200
- */
17201
- ;
17202
-
16504
+ */;
17203
16505
  _proto.astSync = function astSync(rule, options) {
17204
16506
  return this._runSync(rule, options).root;
17205
16507
  }
16508
+
17206
16509
  /**
17207
16510
  * Process a selector into a transformed value asynchronously
17208
16511
  *
17209
16512
  * @param rule {postcss.Rule | string} The css selector to be processed
17210
16513
  * @param options The options for processing
17211
16514
  * @returns {Promise<any>} The value returned by the processor.
17212
- */
17213
- ;
17214
-
16515
+ */;
17215
16516
  _proto.transform = function transform(rule, options) {
17216
16517
  return this._run(rule, options).then(function (result) {
17217
16518
  return result.transform;
17218
16519
  });
17219
16520
  }
16521
+
17220
16522
  /**
17221
16523
  * Process a selector into a transformed value synchronously.
17222
16524
  *
17223
16525
  * @param rule {postcss.Rule | string} The css selector to be processed
17224
16526
  * @param options The options for processing
17225
16527
  * @returns {any} The value returned by the processor.
17226
- */
17227
- ;
17228
-
16528
+ */;
17229
16529
  _proto.transformSync = function transformSync(rule, options) {
17230
16530
  return this._runSync(rule, options).transform;
17231
16531
  }
16532
+
17232
16533
  /**
17233
16534
  * Process a selector into a new selector string asynchronously.
17234
16535
  *
17235
16536
  * @param rule {postcss.Rule | string} The css selector to be processed
17236
16537
  * @param options The options for processing
17237
16538
  * @returns {string} the selector after processing.
17238
- */
17239
- ;
17240
-
16539
+ */;
17241
16540
  _proto.process = function process(rule, options) {
17242
16541
  return this._run(rule, options).then(function (result) {
17243
16542
  return result.string || result.root.toString();
17244
16543
  });
17245
16544
  }
16545
+
17246
16546
  /**
17247
16547
  * Process a selector into a new selector string synchronously.
17248
16548
  *
17249
16549
  * @param rule {postcss.Rule | string} The css selector to be processed
17250
16550
  * @param options The options for processing
17251
16551
  * @returns {string} the selector after processing.
17252
- */
17253
- ;
17254
-
16552
+ */;
17255
16553
  _proto.processSync = function processSync(rule, options) {
17256
16554
  var result = this._runSync(rule, options);
17257
-
17258
16555
  return result.string || result.root.toString();
17259
16556
  };
17260
-
17261
16557
  return Processor;
17262
16558
  }();
17263
-
17264
16559
  exports["default"] = Processor;
17265
16560
  module.exports = exports.default;
17266
16561
  } (processor, processor.exports));
@@ -17271,129 +16566,90 @@ var constructors = {};
17271
16566
 
17272
16567
  constructors.__esModule = true;
17273
16568
  constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = void 0;
17274
-
17275
16569
  var _attribute = _interopRequireDefault(attribute$1);
17276
-
17277
16570
  var _className = _interopRequireDefault(className$1.exports);
17278
-
17279
16571
  var _combinator = _interopRequireDefault(combinator$2.exports);
17280
-
17281
16572
  var _comment = _interopRequireDefault(comment$2.exports);
17282
-
17283
16573
  var _id = _interopRequireDefault(id$1.exports);
17284
-
17285
16574
  var _nesting = _interopRequireDefault(nesting$1.exports);
17286
-
17287
16575
  var _pseudo = _interopRequireDefault(pseudo$1.exports);
17288
-
17289
16576
  var _root = _interopRequireDefault(root$1.exports);
17290
-
17291
16577
  var _selector = _interopRequireDefault(selector$1.exports);
17292
-
17293
16578
  var _string = _interopRequireDefault(string$1.exports);
17294
-
17295
16579
  var _tag = _interopRequireDefault(tag$1.exports);
17296
-
17297
16580
  var _universal = _interopRequireDefault(universal$1.exports);
17298
-
17299
16581
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17300
-
17301
16582
  var attribute = function attribute(opts) {
17302
16583
  return new _attribute["default"](opts);
17303
16584
  };
17304
-
17305
16585
  constructors.attribute = attribute;
17306
-
17307
16586
  var className = function className(opts) {
17308
16587
  return new _className["default"](opts);
17309
16588
  };
17310
-
17311
16589
  constructors.className = className;
17312
-
17313
16590
  var combinator = function combinator(opts) {
17314
16591
  return new _combinator["default"](opts);
17315
16592
  };
17316
-
17317
16593
  constructors.combinator = combinator;
17318
-
17319
16594
  var comment = function comment(opts) {
17320
16595
  return new _comment["default"](opts);
17321
16596
  };
17322
-
17323
16597
  constructors.comment = comment;
17324
-
17325
16598
  var id = function id(opts) {
17326
16599
  return new _id["default"](opts);
17327
16600
  };
17328
-
17329
16601
  constructors.id = id;
17330
-
17331
16602
  var nesting = function nesting(opts) {
17332
16603
  return new _nesting["default"](opts);
17333
16604
  };
17334
-
17335
16605
  constructors.nesting = nesting;
17336
-
17337
16606
  var pseudo = function pseudo(opts) {
17338
16607
  return new _pseudo["default"](opts);
17339
16608
  };
17340
-
17341
16609
  constructors.pseudo = pseudo;
17342
-
17343
16610
  var root = function root(opts) {
17344
16611
  return new _root["default"](opts);
17345
16612
  };
17346
-
17347
16613
  constructors.root = root;
17348
-
17349
16614
  var selector = function selector(opts) {
17350
16615
  return new _selector["default"](opts);
17351
16616
  };
17352
-
17353
16617
  constructors.selector = selector;
17354
-
17355
16618
  var string = function string(opts) {
17356
16619
  return new _string["default"](opts);
17357
16620
  };
17358
-
17359
16621
  constructors.string = string;
17360
-
17361
16622
  var tag = function tag(opts) {
17362
16623
  return new _tag["default"](opts);
17363
16624
  };
17364
-
17365
16625
  constructors.tag = tag;
17366
-
17367
16626
  var universal = function universal(opts) {
17368
16627
  return new _universal["default"](opts);
17369
16628
  };
17370
-
17371
16629
  constructors.universal = universal;
17372
16630
 
17373
16631
  var guards = {};
17374
16632
 
17375
16633
  guards.__esModule = true;
17376
- guards.isNode = isNode;
17377
- guards.isPseudoElement = isPseudoElement;
17378
- guards.isPseudoClass = isPseudoClass;
16634
+ guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0;
17379
16635
  guards.isContainer = isContainer;
16636
+ guards.isIdentifier = void 0;
17380
16637
  guards.isNamespace = isNamespace;
17381
- guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = guards.isPseudo = guards.isNesting = guards.isIdentifier = guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0;
17382
-
16638
+ guards.isNesting = void 0;
16639
+ guards.isNode = isNode;
16640
+ guards.isPseudo = void 0;
16641
+ guards.isPseudoClass = isPseudoClass;
16642
+ guards.isPseudoElement = isPseudoElement;
16643
+ guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = void 0;
17383
16644
  var _types = types;
17384
-
17385
16645
  var _IS_TYPE;
17386
-
17387
16646
  var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE);
17388
-
17389
16647
  function isNode(node) {
17390
16648
  return typeof node === "object" && IS_TYPE[node.type];
17391
16649
  }
17392
-
17393
16650
  function isNodeType(type, node) {
17394
16651
  return isNode(node) && node.type === type;
17395
16652
  }
17396
-
17397
16653
  var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE);
17398
16654
  guards.isAttribute = isAttribute;
17399
16655
  var isClassName = isNodeType.bind(null, _types.CLASS);
@@ -17418,19 +16674,15 @@ var isTag = isNodeType.bind(null, _types.TAG);
17418
16674
  guards.isTag = isTag;
17419
16675
  var isUniversal = isNodeType.bind(null, _types.UNIVERSAL);
17420
16676
  guards.isUniversal = isUniversal;
17421
-
17422
16677
  function isPseudoElement(node) {
17423
16678
  return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line");
17424
16679
  }
17425
-
17426
16680
  function isPseudoClass(node) {
17427
16681
  return isPseudo(node) && !isPseudoElement(node);
17428
16682
  }
17429
-
17430
16683
  function isContainer(node) {
17431
16684
  return !!(isNode(node) && node.walk);
17432
16685
  }
17433
-
17434
16686
  function isNamespace(node) {
17435
16687
  return isAttribute(node) || isTag(node);
17436
16688
  }
@@ -17438,25 +16690,19 @@ function isNamespace(node) {
17438
16690
  (function (exports) {
17439
16691
 
17440
16692
  exports.__esModule = true;
17441
-
17442
16693
  var _types = types;
17443
-
17444
16694
  Object.keys(_types).forEach(function (key) {
17445
16695
  if (key === "default" || key === "__esModule") return;
17446
16696
  if (key in exports && exports[key] === _types[key]) return;
17447
16697
  exports[key] = _types[key];
17448
16698
  });
17449
-
17450
16699
  var _constructors = constructors;
17451
-
17452
16700
  Object.keys(_constructors).forEach(function (key) {
17453
16701
  if (key === "default" || key === "__esModule") return;
17454
16702
  if (key in exports && exports[key] === _constructors[key]) return;
17455
16703
  exports[key] = _constructors[key];
17456
16704
  });
17457
-
17458
16705
  var _guards = guards;
17459
-
17460
16706
  Object.keys(_guards).forEach(function (key) {
17461
16707
  if (key === "default" || key === "__esModule") return;
17462
16708
  if (key in exports && exports[key] === _guards[key]) return;
@@ -17468,21 +16714,14 @@ function isNamespace(node) {
17468
16714
 
17469
16715
  exports.__esModule = true;
17470
16716
  exports["default"] = void 0;
17471
-
17472
16717
  var _processor = _interopRequireDefault(processor.exports);
17473
-
17474
16718
  var selectors$1 = _interopRequireWildcard(selectors);
17475
-
17476
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
17477
-
17478
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17479
-
16719
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16720
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17480
16721
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17481
-
17482
16722
  var parser = function parser(processor) {
17483
16723
  return new _processor["default"](processor);
17484
16724
  };
17485
-
17486
16725
  Object.assign(parser, selectors$1);
17487
16726
  delete parser.__esModule;
17488
16727
  var _default = parser;