vscode-css-languageservice 6.3.10 → 7.0.0-next.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 (74) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/esm/beautify/beautify-css.js +1437 -1606
  3. package/lib/esm/cssLanguageService.d.ts +2 -2
  4. package/lib/esm/cssLanguageService.js +18 -18
  5. package/lib/esm/languageFacts/colors.js +1 -1
  6. package/lib/esm/languageFacts/dataManager.js +3 -3
  7. package/lib/esm/languageFacts/entry.js +1 -1
  8. package/lib/esm/languageFacts/facts.js +3 -3
  9. package/lib/esm/parser/cssNodes.js +1 -1
  10. package/lib/esm/parser/cssParser.js +5 -5
  11. package/lib/esm/parser/cssSymbolScope.js +2 -2
  12. package/lib/esm/parser/lessParser.js +5 -5
  13. package/lib/esm/parser/lessScanner.js +1 -1
  14. package/lib/esm/parser/scssParser.js +6 -6
  15. package/lib/esm/parser/scssScanner.js +1 -1
  16. package/lib/esm/services/cssCodeActions.js +4 -4
  17. package/lib/esm/services/cssCompletion.js +7 -7
  18. package/lib/esm/services/cssFolding.js +3 -3
  19. package/lib/esm/services/cssFormatter.js +3 -3
  20. package/lib/esm/services/cssHover.js +6 -6
  21. package/lib/esm/services/cssNavigation.js +6 -6
  22. package/lib/esm/services/cssSelectionRange.js +2 -2
  23. package/lib/esm/services/cssValidation.js +4 -4
  24. package/lib/esm/services/lessCompletion.js +2 -2
  25. package/lib/esm/services/lint.js +5 -5
  26. package/lib/esm/services/lintRules.js +1 -1
  27. package/lib/esm/services/lintUtil.js +1 -1
  28. package/lib/esm/services/pathCompletion.js +3 -3
  29. package/lib/esm/services/scssCompletion.js +3 -3
  30. package/lib/esm/services/scssNavigation.js +4 -4
  31. package/lib/esm/services/selectorPrinting.js +3 -3
  32. package/package.json +15 -15
  33. package/lib/umd/beautify/beautify-css.js +0 -1695
  34. package/lib/umd/cssLanguageService.d.ts +0 -39
  35. package/lib/umd/cssLanguageService.js +0 -105
  36. package/lib/umd/cssLanguageTypes.d.ts +0 -267
  37. package/lib/umd/cssLanguageTypes.js +0 -89
  38. package/lib/umd/data/webCustomData.js +0 -44613
  39. package/lib/umd/languageFacts/builtinData.js +0 -155
  40. package/lib/umd/languageFacts/colors.js +0 -949
  41. package/lib/umd/languageFacts/dataManager.js +0 -101
  42. package/lib/umd/languageFacts/dataProvider.js +0 -86
  43. package/lib/umd/languageFacts/entry.js +0 -217
  44. package/lib/umd/languageFacts/facts.js +0 -33
  45. package/lib/umd/parser/cssErrors.js +0 -61
  46. package/lib/umd/parser/cssNodes.js +0 -1676
  47. package/lib/umd/parser/cssParser.js +0 -2035
  48. package/lib/umd/parser/cssScanner.js +0 -619
  49. package/lib/umd/parser/cssSymbolScope.js +0 -328
  50. package/lib/umd/parser/lessParser.js +0 -732
  51. package/lib/umd/parser/lessScanner.js +0 -70
  52. package/lib/umd/parser/scssErrors.js +0 -30
  53. package/lib/umd/parser/scssParser.js +0 -874
  54. package/lib/umd/parser/scssScanner.js +0 -108
  55. package/lib/umd/services/cssCodeActions.js +0 -89
  56. package/lib/umd/services/cssCompletion.js +0 -1109
  57. package/lib/umd/services/cssFolding.js +0 -202
  58. package/lib/umd/services/cssFormatter.js +0 -149
  59. package/lib/umd/services/cssHover.js +0 -174
  60. package/lib/umd/services/cssNavigation.js +0 -539
  61. package/lib/umd/services/cssSelectionRange.js +0 -59
  62. package/lib/umd/services/cssValidation.js +0 -54
  63. package/lib/umd/services/lessCompletion.js +0 -390
  64. package/lib/umd/services/lint.js +0 -577
  65. package/lib/umd/services/lintRules.js +0 -90
  66. package/lib/umd/services/lintUtil.js +0 -210
  67. package/lib/umd/services/pathCompletion.js +0 -171
  68. package/lib/umd/services/scssCompletion.js +0 -367
  69. package/lib/umd/services/scssNavigation.js +0 -169
  70. package/lib/umd/services/selectorPrinting.js +0 -575
  71. package/lib/umd/utils/arrays.js +0 -54
  72. package/lib/umd/utils/objects.js +0 -24
  73. package/lib/umd/utils/resources.js +0 -25
  74. package/lib/umd/utils/strings.js +0 -123
@@ -60,1613 +60,1444 @@
60
60
  'space_around_selector_separator': true
61
61
  });
62
62
  */
63
-
64
63
  // http://www.w3.org/TR/CSS21/syndata.html#tokenization
65
64
  // http://www.w3.org/TR/css3-syntax/
66
-
67
65
  var legacy_beautify_css;
68
- /******/ (function() { // webpackBootstrap
69
- /******/ "use strict";
70
- /******/ var __webpack_modules__ = ([
71
- /* 0 */,
72
- /* 1 */,
73
- /* 2 */
74
- /***/ (function(module) {
75
-
76
- /*jshint node:true */
77
- /*
78
- The MIT License (MIT)
79
-
80
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
81
-
82
- Permission is hereby granted, free of charge, to any person
83
- obtaining a copy of this software and associated documentation files
84
- (the "Software"), to deal in the Software without restriction,
85
- including without limitation the rights to use, copy, modify, merge,
86
- publish, distribute, sublicense, and/or sell copies of the Software,
87
- and to permit persons to whom the Software is furnished to do so,
88
- subject to the following conditions:
89
-
90
- The above copyright notice and this permission notice shall be
91
- included in all copies or substantial portions of the Software.
92
-
93
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
94
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
95
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
96
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
97
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
98
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
99
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
100
- SOFTWARE.
101
- */
102
-
103
-
104
-
105
- function OutputLine(parent) {
106
- this.__parent = parent;
107
- this.__character_count = 0;
108
- // use indent_count as a marker for this.__lines that have preserved indentation
109
- this.__indent_count = -1;
110
- this.__alignment_count = 0;
111
- this.__wrap_point_index = 0;
112
- this.__wrap_point_character_count = 0;
113
- this.__wrap_point_indent_count = -1;
114
- this.__wrap_point_alignment_count = 0;
115
-
116
- this.__items = [];
117
- }
118
-
119
- OutputLine.prototype.clone_empty = function() {
120
- var line = new OutputLine(this.__parent);
121
- line.set_indent(this.__indent_count, this.__alignment_count);
122
- return line;
123
- };
124
-
125
- OutputLine.prototype.item = function(index) {
126
- if (index < 0) {
127
- return this.__items[this.__items.length + index];
128
- } else {
129
- return this.__items[index];
130
- }
131
- };
132
-
133
- OutputLine.prototype.has_match = function(pattern) {
134
- for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
135
- if (this.__items[lastCheckedOutput].match(pattern)) {
136
- return true;
137
- }
138
- }
139
- return false;
140
- };
141
-
142
- OutputLine.prototype.set_indent = function(indent, alignment) {
143
- if (this.is_empty()) {
144
- this.__indent_count = indent || 0;
145
- this.__alignment_count = alignment || 0;
146
- this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);
147
- }
148
- };
149
-
150
- OutputLine.prototype._set_wrap_point = function() {
151
- if (this.__parent.wrap_line_length) {
152
- this.__wrap_point_index = this.__items.length;
153
- this.__wrap_point_character_count = this.__character_count;
154
- this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;
155
- this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;
156
- }
157
- };
158
-
159
- OutputLine.prototype._should_wrap = function() {
160
- return this.__wrap_point_index &&
161
- this.__character_count > this.__parent.wrap_line_length &&
162
- this.__wrap_point_character_count > this.__parent.next_line.__character_count;
163
- };
164
-
165
- OutputLine.prototype._allow_wrap = function() {
166
- if (this._should_wrap()) {
167
- this.__parent.add_new_line();
168
- var next = this.__parent.current_line;
169
- next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);
170
- next.__items = this.__items.slice(this.__wrap_point_index);
171
- this.__items = this.__items.slice(0, this.__wrap_point_index);
172
-
173
- next.__character_count += this.__character_count - this.__wrap_point_character_count;
174
- this.__character_count = this.__wrap_point_character_count;
175
-
176
- if (next.__items[0] === " ") {
177
- next.__items.splice(0, 1);
178
- next.__character_count -= 1;
179
- }
180
- return true;
181
- }
182
- return false;
183
- };
184
-
185
- OutputLine.prototype.is_empty = function() {
186
- return this.__items.length === 0;
187
- };
188
-
189
- OutputLine.prototype.last = function() {
190
- if (!this.is_empty()) {
191
- return this.__items[this.__items.length - 1];
192
- } else {
193
- return null;
194
- }
195
- };
196
-
197
- OutputLine.prototype.push = function(item) {
198
- this.__items.push(item);
199
- var last_newline_index = item.lastIndexOf('\n');
200
- if (last_newline_index !== -1) {
201
- this.__character_count = item.length - last_newline_index;
202
- } else {
203
- this.__character_count += item.length;
204
- }
205
- };
206
-
207
- OutputLine.prototype.pop = function() {
208
- var item = null;
209
- if (!this.is_empty()) {
210
- item = this.__items.pop();
211
- this.__character_count -= item.length;
212
- }
213
- return item;
214
- };
215
-
216
-
217
- OutputLine.prototype._remove_indent = function() {
218
- if (this.__indent_count > 0) {
219
- this.__indent_count -= 1;
220
- this.__character_count -= this.__parent.indent_size;
221
- }
222
- };
223
-
224
- OutputLine.prototype._remove_wrap_indent = function() {
225
- if (this.__wrap_point_indent_count > 0) {
226
- this.__wrap_point_indent_count -= 1;
227
- }
228
- };
229
- OutputLine.prototype.trim = function() {
230
- while (this.last() === ' ') {
231
- this.__items.pop();
232
- this.__character_count -= 1;
233
- }
234
- };
235
-
236
- OutputLine.prototype.toString = function() {
237
- var result = '';
238
- if (this.is_empty()) {
239
- if (this.__parent.indent_empty_lines) {
240
- result = this.__parent.get_indent_string(this.__indent_count);
241
- }
242
- } else {
243
- result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);
244
- result += this.__items.join('');
245
- }
246
- return result;
247
- };
248
-
249
- function IndentStringCache(options, baseIndentString) {
250
- this.__cache = [''];
251
- this.__indent_size = options.indent_size;
252
- this.__indent_string = options.indent_char;
253
- if (!options.indent_with_tabs) {
254
- this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);
255
- }
256
-
257
- // Set to null to continue support for auto detection of base indent
258
- baseIndentString = baseIndentString || '';
259
- if (options.indent_level > 0) {
260
- baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);
261
- }
262
-
263
- this.__base_string = baseIndentString;
264
- this.__base_string_length = baseIndentString.length;
265
- }
266
-
267
- IndentStringCache.prototype.get_indent_size = function(indent, column) {
268
- var result = this.__base_string_length;
269
- column = column || 0;
270
- if (indent < 0) {
271
- result = 0;
272
- }
273
- result += indent * this.__indent_size;
274
- result += column;
275
- return result;
276
- };
277
-
278
- IndentStringCache.prototype.get_indent_string = function(indent_level, column) {
279
- var result = this.__base_string;
280
- column = column || 0;
281
- if (indent_level < 0) {
282
- indent_level = 0;
283
- result = '';
284
- }
285
- column += indent_level * this.__indent_size;
286
- this.__ensure_cache(column);
287
- result += this.__cache[column];
288
- return result;
289
- };
290
-
291
- IndentStringCache.prototype.__ensure_cache = function(column) {
292
- while (column >= this.__cache.length) {
293
- this.__add_column();
294
- }
295
- };
296
-
297
- IndentStringCache.prototype.__add_column = function() {
298
- var column = this.__cache.length;
299
- var indent = 0;
300
- var result = '';
301
- if (this.__indent_size && column >= this.__indent_size) {
302
- indent = Math.floor(column / this.__indent_size);
303
- column -= indent * this.__indent_size;
304
- result = new Array(indent + 1).join(this.__indent_string);
305
- }
306
- if (column) {
307
- result += new Array(column + 1).join(' ');
308
- }
309
-
310
- this.__cache.push(result);
311
- };
312
-
313
- function Output(options, baseIndentString) {
314
- this.__indent_cache = new IndentStringCache(options, baseIndentString);
315
- this.raw = false;
316
- this._end_with_newline = options.end_with_newline;
317
- this.indent_size = options.indent_size;
318
- this.wrap_line_length = options.wrap_line_length;
319
- this.indent_empty_lines = options.indent_empty_lines;
320
- this.__lines = [];
321
- this.previous_line = null;
322
- this.current_line = null;
323
- this.next_line = new OutputLine(this);
324
- this.space_before_token = false;
325
- this.non_breaking_space = false;
326
- this.previous_token_wrapped = false;
327
- // initialize
328
- this.__add_outputline();
329
- }
330
-
331
- Output.prototype.__add_outputline = function() {
332
- this.previous_line = this.current_line;
333
- this.current_line = this.next_line.clone_empty();
334
- this.__lines.push(this.current_line);
335
- };
336
-
337
- Output.prototype.get_line_number = function() {
338
- return this.__lines.length;
339
- };
340
-
341
- Output.prototype.get_indent_string = function(indent, column) {
342
- return this.__indent_cache.get_indent_string(indent, column);
343
- };
344
-
345
- Output.prototype.get_indent_size = function(indent, column) {
346
- return this.__indent_cache.get_indent_size(indent, column);
347
- };
348
-
349
- Output.prototype.is_empty = function() {
350
- return !this.previous_line && this.current_line.is_empty();
351
- };
352
-
353
- Output.prototype.add_new_line = function(force_newline) {
354
- // never newline at the start of file
355
- // otherwise, newline only if we didn't just add one or we're forced
356
- if (this.is_empty() ||
357
- (!force_newline && this.just_added_newline())) {
358
- return false;
359
- }
360
-
361
- // if raw output is enabled, don't print additional newlines,
362
- // but still return True as though you had
363
- if (!this.raw) {
364
- this.__add_outputline();
365
- }
366
- return true;
367
- };
368
-
369
- Output.prototype.get_code = function(eol) {
370
- this.trim(true);
371
-
372
- // handle some edge cases where the last tokens
373
- // has text that ends with newline(s)
374
- var last_item = this.current_line.pop();
375
- if (last_item) {
376
- if (last_item[last_item.length - 1] === '\n') {
377
- last_item = last_item.replace(/\n+$/g, '');
378
- }
379
- this.current_line.push(last_item);
380
- }
381
-
382
- if (this._end_with_newline) {
383
- this.__add_outputline();
384
- }
385
-
386
- var sweet_code = this.__lines.join('\n');
387
-
388
- if (eol !== '\n') {
389
- sweet_code = sweet_code.replace(/[\n]/g, eol);
390
- }
391
- return sweet_code;
392
- };
393
-
394
- Output.prototype.set_wrap_point = function() {
395
- this.current_line._set_wrap_point();
396
- };
397
-
398
- Output.prototype.set_indent = function(indent, alignment) {
399
- indent = indent || 0;
400
- alignment = alignment || 0;
401
-
402
- // Next line stores alignment values
403
- this.next_line.set_indent(indent, alignment);
404
-
405
- // Never indent your first output indent at the start of the file
406
- if (this.__lines.length > 1) {
407
- this.current_line.set_indent(indent, alignment);
408
- return true;
409
- }
410
-
411
- this.current_line.set_indent();
412
- return false;
413
- };
414
-
415
- Output.prototype.add_raw_token = function(token) {
416
- for (var x = 0; x < token.newlines; x++) {
417
- this.__add_outputline();
418
- }
419
- this.current_line.set_indent(-1);
420
- this.current_line.push(token.whitespace_before);
421
- this.current_line.push(token.text);
422
- this.space_before_token = false;
423
- this.non_breaking_space = false;
424
- this.previous_token_wrapped = false;
425
- };
426
-
427
- Output.prototype.add_token = function(printable_token) {
428
- this.__add_space_before_token();
429
- this.current_line.push(printable_token);
430
- this.space_before_token = false;
431
- this.non_breaking_space = false;
432
- this.previous_token_wrapped = this.current_line._allow_wrap();
433
- };
434
-
435
- Output.prototype.__add_space_before_token = function() {
436
- if (this.space_before_token && !this.just_added_newline()) {
437
- if (!this.non_breaking_space) {
438
- this.set_wrap_point();
439
- }
440
- this.current_line.push(' ');
441
- }
442
- };
443
-
444
- Output.prototype.remove_indent = function(index) {
445
- var output_length = this.__lines.length;
446
- while (index < output_length) {
447
- this.__lines[index]._remove_indent();
448
- index++;
449
- }
450
- this.current_line._remove_wrap_indent();
451
- };
452
-
453
- Output.prototype.trim = function(eat_newlines) {
454
- eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;
455
-
456
- this.current_line.trim();
457
-
458
- while (eat_newlines && this.__lines.length > 1 &&
459
- this.current_line.is_empty()) {
460
- this.__lines.pop();
461
- this.current_line = this.__lines[this.__lines.length - 1];
462
- this.current_line.trim();
463
- }
464
-
465
- this.previous_line = this.__lines.length > 1 ?
466
- this.__lines[this.__lines.length - 2] : null;
467
- };
468
-
469
- Output.prototype.just_added_newline = function() {
470
- return this.current_line.is_empty();
471
- };
472
-
473
- Output.prototype.just_added_blankline = function() {
474
- return this.is_empty() ||
475
- (this.current_line.is_empty() && this.previous_line.is_empty());
476
- };
477
-
478
- Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) {
479
- var index = this.__lines.length - 2;
480
- while (index >= 0) {
481
- var potentialEmptyLine = this.__lines[index];
482
- if (potentialEmptyLine.is_empty()) {
483
- break;
484
- } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&
485
- potentialEmptyLine.item(-1) !== ends_with) {
486
- this.__lines.splice(index + 1, 0, new OutputLine(this));
487
- this.previous_line = this.__lines[this.__lines.length - 2];
488
- break;
489
- }
490
- index--;
491
- }
492
- };
493
-
494
- module.exports.Output = Output;
495
-
496
-
497
- /***/ }),
498
- /* 3 */,
499
- /* 4 */,
500
- /* 5 */,
501
- /* 6 */
502
- /***/ (function(module) {
503
-
504
- /*jshint node:true */
505
- /*
506
-
507
- The MIT License (MIT)
508
-
509
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
510
-
511
- Permission is hereby granted, free of charge, to any person
512
- obtaining a copy of this software and associated documentation files
513
- (the "Software"), to deal in the Software without restriction,
514
- including without limitation the rights to use, copy, modify, merge,
515
- publish, distribute, sublicense, and/or sell copies of the Software,
516
- and to permit persons to whom the Software is furnished to do so,
517
- subject to the following conditions:
518
-
519
- The above copyright notice and this permission notice shall be
520
- included in all copies or substantial portions of the Software.
521
-
522
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
523
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
524
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
525
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
526
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
527
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
528
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
529
- SOFTWARE.
530
- */
531
-
532
-
533
-
534
- function Options(options, merge_child_field) {
535
- this.raw_options = _mergeOpts(options, merge_child_field);
536
-
537
- // Support passing the source text back with no change
538
- this.disabled = this._get_boolean('disabled');
539
-
540
- this.eol = this._get_characters('eol', 'auto');
541
- this.end_with_newline = this._get_boolean('end_with_newline');
542
- this.indent_size = this._get_number('indent_size', 4);
543
- this.indent_char = this._get_characters('indent_char', ' ');
544
- this.indent_level = this._get_number('indent_level');
545
-
546
- this.preserve_newlines = this._get_boolean('preserve_newlines', true);
547
- this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);
548
- if (!this.preserve_newlines) {
549
- this.max_preserve_newlines = 0;
550
- }
551
-
552
- this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t');
553
- if (this.indent_with_tabs) {
554
- this.indent_char = '\t';
555
-
556
- // indent_size behavior changed after 1.8.6
557
- // It used to be that indent_size would be
558
- // set to 1 for indent_with_tabs. That is no longer needed and
559
- // actually doesn't make sense - why not use spaces? Further,
560
- // that might produce unexpected behavior - tabs being used
561
- // for single-column alignment. So, when indent_with_tabs is true
562
- // and indent_size is 1, reset indent_size to 4.
563
- if (this.indent_size === 1) {
564
- this.indent_size = 4;
565
- }
566
- }
567
-
568
- // Backwards compat with 1.3.x
569
- this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));
570
-
571
- this.indent_empty_lines = this._get_boolean('indent_empty_lines');
572
-
573
- // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
574
- // For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
575
- // other values ignored
576
- this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
577
- }
578
-
579
- Options.prototype._get_array = function(name, default_value) {
580
- var option_value = this.raw_options[name];
581
- var result = default_value || [];
582
- if (typeof option_value === 'object') {
583
- if (option_value !== null && typeof option_value.concat === 'function') {
584
- result = option_value.concat();
585
- }
586
- } else if (typeof option_value === 'string') {
587
- result = option_value.split(/[^a-zA-Z0-9_\/\-]+/);
588
- }
589
- return result;
590
- };
591
-
592
- Options.prototype._get_boolean = function(name, default_value) {
593
- var option_value = this.raw_options[name];
594
- var result = option_value === undefined ? !!default_value : !!option_value;
595
- return result;
596
- };
597
-
598
- Options.prototype._get_characters = function(name, default_value) {
599
- var option_value = this.raw_options[name];
600
- var result = default_value || '';
601
- if (typeof option_value === 'string') {
602
- result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t');
603
- }
604
- return result;
605
- };
606
-
607
- Options.prototype._get_number = function(name, default_value) {
608
- var option_value = this.raw_options[name];
609
- default_value = parseInt(default_value, 10);
610
- if (isNaN(default_value)) {
611
- default_value = 0;
612
- }
613
- var result = parseInt(option_value, 10);
614
- if (isNaN(result)) {
615
- result = default_value;
616
- }
617
- return result;
618
- };
619
-
620
- Options.prototype._get_selection = function(name, selection_list, default_value) {
621
- var result = this._get_selection_list(name, selection_list, default_value);
622
- if (result.length !== 1) {
623
- throw new Error(
624
- "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" +
625
- selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
626
- }
627
-
628
- return result[0];
629
- };
630
-
631
-
632
- Options.prototype._get_selection_list = function(name, selection_list, default_value) {
633
- if (!selection_list || selection_list.length === 0) {
634
- throw new Error("Selection list cannot be empty.");
635
- }
636
-
637
- default_value = default_value || [selection_list[0]];
638
- if (!this._is_valid_selection(default_value, selection_list)) {
639
- throw new Error("Invalid Default Value!");
640
- }
641
-
642
- var result = this._get_array(name, default_value);
643
- if (!this._is_valid_selection(result, selection_list)) {
644
- throw new Error(
645
- "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" +
646
- selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
647
- }
648
-
649
- return result;
650
- };
651
-
652
- Options.prototype._is_valid_selection = function(result, selection_list) {
653
- return result.length && selection_list.length &&
654
- !result.some(function(item) { return selection_list.indexOf(item) === -1; });
655
- };
656
-
657
-
658
- // merges child options up with the parent options object
659
- // Example: obj = {a: 1, b: {a: 2}}
660
- // mergeOpts(obj, 'b')
661
- //
662
- // Returns: {a: 2}
663
- function _mergeOpts(allOptions, childFieldName) {
664
- var finalOpts = {};
665
- allOptions = _normalizeOpts(allOptions);
666
- var name;
667
-
668
- for (name in allOptions) {
669
- if (name !== childFieldName) {
670
- finalOpts[name] = allOptions[name];
671
- }
672
- }
673
-
674
- //merge in the per type settings for the childFieldName
675
- if (childFieldName && allOptions[childFieldName]) {
676
- for (name in allOptions[childFieldName]) {
677
- finalOpts[name] = allOptions[childFieldName][name];
678
- }
679
- }
680
- return finalOpts;
681
- }
682
-
683
- function _normalizeOpts(options) {
684
- var convertedOpts = {};
685
- var key;
686
-
687
- for (key in options) {
688
- var newKey = key.replace(/-/g, "_");
689
- convertedOpts[newKey] = options[key];
690
- }
691
- return convertedOpts;
692
- }
693
-
694
- module.exports.Options = Options;
695
- module.exports.normalizeOpts = _normalizeOpts;
696
- module.exports.mergeOpts = _mergeOpts;
697
-
698
-
699
- /***/ }),
700
- /* 7 */,
701
- /* 8 */
702
- /***/ (function(module) {
703
-
704
- /*jshint node:true */
705
- /*
706
-
707
- The MIT License (MIT)
708
-
709
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
710
-
711
- Permission is hereby granted, free of charge, to any person
712
- obtaining a copy of this software and associated documentation files
713
- (the "Software"), to deal in the Software without restriction,
714
- including without limitation the rights to use, copy, modify, merge,
715
- publish, distribute, sublicense, and/or sell copies of the Software,
716
- and to permit persons to whom the Software is furnished to do so,
717
- subject to the following conditions:
718
-
719
- The above copyright notice and this permission notice shall be
720
- included in all copies or substantial portions of the Software.
721
-
722
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
723
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
724
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
725
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
726
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
727
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
728
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
729
- SOFTWARE.
730
- */
731
-
732
-
733
-
734
- var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky');
735
-
736
- function InputScanner(input_string) {
737
- this.__input = input_string || '';
738
- this.__input_length = this.__input.length;
739
- this.__position = 0;
740
- }
741
-
742
- InputScanner.prototype.restart = function() {
743
- this.__position = 0;
744
- };
745
-
746
- InputScanner.prototype.back = function() {
747
- if (this.__position > 0) {
748
- this.__position -= 1;
749
- }
750
- };
751
-
752
- InputScanner.prototype.hasNext = function() {
753
- return this.__position < this.__input_length;
754
- };
755
-
756
- InputScanner.prototype.next = function() {
757
- var val = null;
758
- if (this.hasNext()) {
759
- val = this.__input.charAt(this.__position);
760
- this.__position += 1;
761
- }
762
- return val;
763
- };
764
-
765
- InputScanner.prototype.peek = function(index) {
766
- var val = null;
767
- index = index || 0;
768
- index += this.__position;
769
- if (index >= 0 && index < this.__input_length) {
770
- val = this.__input.charAt(index);
771
- }
772
- return val;
773
- };
774
-
775
- // This is a JavaScript only helper function (not in python)
776
- // Javascript doesn't have a match method
777
- // and not all implementation support "sticky" flag.
778
- // If they do not support sticky then both this.match() and this.test() method
779
- // must get the match and check the index of the match.
780
- // If sticky is supported and set, this method will use it.
781
- // Otherwise it will check that global is set, and fall back to the slower method.
782
- InputScanner.prototype.__match = function(pattern, index) {
783
- pattern.lastIndex = index;
784
- var pattern_match = pattern.exec(this.__input);
785
-
786
- if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {
787
- if (pattern_match.index !== index) {
788
- pattern_match = null;
789
- }
790
- }
791
-
792
- return pattern_match;
793
- };
794
-
795
- InputScanner.prototype.test = function(pattern, index) {
796
- index = index || 0;
797
- index += this.__position;
798
-
799
- if (index >= 0 && index < this.__input_length) {
800
- return !!this.__match(pattern, index);
801
- } else {
802
- return false;
803
- }
804
- };
805
-
806
- InputScanner.prototype.testChar = function(pattern, index) {
807
- // test one character regex match
808
- var val = this.peek(index);
809
- pattern.lastIndex = 0;
810
- return val !== null && pattern.test(val);
811
- };
812
-
813
- InputScanner.prototype.match = function(pattern) {
814
- var pattern_match = this.__match(pattern, this.__position);
815
- if (pattern_match) {
816
- this.__position += pattern_match[0].length;
817
- } else {
818
- pattern_match = null;
819
- }
820
- return pattern_match;
821
- };
822
-
823
- InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) {
824
- var val = '';
825
- var match;
826
- if (starting_pattern) {
827
- match = this.match(starting_pattern);
828
- if (match) {
829
- val += match[0];
830
- }
831
- }
832
- if (until_pattern && (match || !starting_pattern)) {
833
- val += this.readUntil(until_pattern, until_after);
834
- }
835
- return val;
836
- };
837
-
838
- InputScanner.prototype.readUntil = function(pattern, until_after) {
839
- var val = '';
840
- var match_index = this.__position;
841
- pattern.lastIndex = this.__position;
842
- var pattern_match = pattern.exec(this.__input);
843
- if (pattern_match) {
844
- match_index = pattern_match.index;
845
- if (until_after) {
846
- match_index += pattern_match[0].length;
847
- }
848
- } else {
849
- match_index = this.__input_length;
850
- }
851
-
852
- val = this.__input.substring(this.__position, match_index);
853
- this.__position = match_index;
854
- return val;
855
- };
856
-
857
- InputScanner.prototype.readUntilAfter = function(pattern) {
858
- return this.readUntil(pattern, true);
859
- };
860
-
861
- InputScanner.prototype.get_regexp = function(pattern, match_from) {
862
- var result = null;
863
- var flags = 'g';
864
- if (match_from && regexp_has_sticky) {
865
- flags = 'y';
866
- }
867
- // strings are converted to regexp
868
- if (typeof pattern === "string" && pattern !== '') {
869
- // result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags);
870
- result = new RegExp(pattern, flags);
871
- } else if (pattern) {
872
- result = new RegExp(pattern.source, flags);
873
- }
874
- return result;
875
- };
876
-
877
- InputScanner.prototype.get_literal_regexp = function(literal_string) {
878
- return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
879
- };
880
-
881
- /* css beautifier legacy helpers */
882
- InputScanner.prototype.peekUntilAfter = function(pattern) {
883
- var start = this.__position;
884
- var val = this.readUntilAfter(pattern);
885
- this.__position = start;
886
- return val;
887
- };
888
-
889
- InputScanner.prototype.lookBack = function(testVal) {
890
- var start = this.__position - 1;
891
- return start >= testVal.length && this.__input.substring(start - testVal.length, start)
892
- .toLowerCase() === testVal;
893
- };
894
-
895
- module.exports.InputScanner = InputScanner;
896
-
897
-
898
- /***/ }),
899
- /* 9 */,
900
- /* 10 */,
901
- /* 11 */,
902
- /* 12 */,
903
- /* 13 */
904
- /***/ (function(module) {
905
-
906
- /*jshint node:true */
907
- /*
908
-
909
- The MIT License (MIT)
910
-
911
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
912
-
913
- Permission is hereby granted, free of charge, to any person
914
- obtaining a copy of this software and associated documentation files
915
- (the "Software"), to deal in the Software without restriction,
916
- including without limitation the rights to use, copy, modify, merge,
917
- publish, distribute, sublicense, and/or sell copies of the Software,
918
- and to permit persons to whom the Software is furnished to do so,
919
- subject to the following conditions:
920
-
921
- The above copyright notice and this permission notice shall be
922
- included in all copies or substantial portions of the Software.
923
-
924
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
925
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
926
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
927
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
928
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
929
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
930
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
931
- SOFTWARE.
932
- */
933
-
934
-
935
-
936
- function Directives(start_block_pattern, end_block_pattern) {
937
- start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;
938
- end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;
939
- this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g');
940
- this.__directive_pattern = / (\w+)[:](\w+)/g;
941
-
942
- this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g');
943
- }
944
-
945
- Directives.prototype.get_directives = function(text) {
946
- if (!text.match(this.__directives_block_pattern)) {
947
- return null;
948
- }
949
-
950
- var directives = {};
951
- this.__directive_pattern.lastIndex = 0;
952
- var directive_match = this.__directive_pattern.exec(text);
953
-
954
- while (directive_match) {
955
- directives[directive_match[1]] = directive_match[2];
956
- directive_match = this.__directive_pattern.exec(text);
957
- }
958
-
959
- return directives;
960
- };
961
-
962
- Directives.prototype.readIgnored = function(input) {
963
- return input.readUntilAfter(this.__directives_end_ignore_pattern);
964
- };
965
-
966
-
967
- module.exports.Directives = Directives;
968
-
969
-
970
- /***/ }),
971
- /* 14 */,
972
- /* 15 */
973
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
974
-
975
- /*jshint node:true */
976
- /*
977
-
978
- The MIT License (MIT)
979
-
980
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
981
-
982
- Permission is hereby granted, free of charge, to any person
983
- obtaining a copy of this software and associated documentation files
984
- (the "Software"), to deal in the Software without restriction,
985
- including without limitation the rights to use, copy, modify, merge,
986
- publish, distribute, sublicense, and/or sell copies of the Software,
987
- and to permit persons to whom the Software is furnished to do so,
988
- subject to the following conditions:
989
-
990
- The above copyright notice and this permission notice shall be
991
- included in all copies or substantial portions of the Software.
992
-
993
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
994
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
995
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
996
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
997
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
998
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
999
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1000
- SOFTWARE.
1001
- */
1002
-
1003
-
1004
-
1005
- var Beautifier = (__webpack_require__(16).Beautifier),
1006
- Options = (__webpack_require__(17).Options);
1007
-
1008
- function css_beautify(source_text, options) {
1009
- var beautifier = new Beautifier(source_text, options);
1010
- return beautifier.beautify();
1011
- }
1012
-
1013
- module.exports = css_beautify;
1014
- module.exports.defaultOptions = function() {
1015
- return new Options();
1016
- };
1017
-
1018
-
1019
- /***/ }),
1020
- /* 16 */
1021
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1022
-
1023
- /*jshint node:true */
1024
- /*
1025
-
1026
- The MIT License (MIT)
1027
-
1028
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
1029
-
1030
- Permission is hereby granted, free of charge, to any person
1031
- obtaining a copy of this software and associated documentation files
1032
- (the "Software"), to deal in the Software without restriction,
1033
- including without limitation the rights to use, copy, modify, merge,
1034
- publish, distribute, sublicense, and/or sell copies of the Software,
1035
- and to permit persons to whom the Software is furnished to do so,
1036
- subject to the following conditions:
1037
-
1038
- The above copyright notice and this permission notice shall be
1039
- included in all copies or substantial portions of the Software.
1040
-
1041
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1042
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1043
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1044
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
1045
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1046
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1047
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1048
- SOFTWARE.
1049
- */
1050
-
1051
-
1052
-
1053
- var Options = (__webpack_require__(17).Options);
1054
- var Output = (__webpack_require__(2).Output);
1055
- var InputScanner = (__webpack_require__(8).InputScanner);
1056
- var Directives = (__webpack_require__(13).Directives);
1057
-
1058
- var directives_core = new Directives(/\/\*/, /\*\//);
1059
-
1060
- var lineBreak = /\r\n|[\r\n]/;
1061
- var allLineBreaks = /\r\n|[\r\n]/g;
1062
-
1063
- // tokenizer
1064
- var whitespaceChar = /\s/;
1065
- var whitespacePattern = /(?:\s|\n)+/g;
1066
- var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g;
1067
- var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g;
1068
-
1069
- function Beautifier(source_text, options) {
1070
- this._source_text = source_text || '';
1071
- // Allow the setting of language/file-type specific options
1072
- // with inheritance of overall settings
1073
- this._options = new Options(options);
1074
- this._ch = null;
1075
- this._input = null;
1076
-
1077
- // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule
1078
- this.NESTED_AT_RULE = {
1079
- "page": true,
1080
- "font-face": true,
1081
- "keyframes": true,
1082
- // also in CONDITIONAL_GROUP_RULE below
1083
- "media": true,
1084
- "supports": true,
1085
- "document": true
1086
- };
1087
- this.CONDITIONAL_GROUP_RULE = {
1088
- "media": true,
1089
- "supports": true,
1090
- "document": true
1091
- };
1092
- this.NON_SEMICOLON_NEWLINE_PROPERTY = [
1093
- "grid-template-areas",
1094
- "grid-template"
1095
- ];
1096
-
1097
- }
1098
-
1099
- Beautifier.prototype.eatString = function(endChars) {
1100
- var result = '';
1101
- this._ch = this._input.next();
1102
- while (this._ch) {
1103
- result += this._ch;
1104
- if (this._ch === "\\") {
1105
- result += this._input.next();
1106
- } else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") {
1107
- break;
1108
- }
1109
- this._ch = this._input.next();
1110
- }
1111
- return result;
1112
- };
1113
-
1114
- // Skips any white space in the source text from the current position.
1115
- // When allowAtLeastOneNewLine is true, will output new lines for each
1116
- // newline character found; if the user has preserve_newlines off, only
1117
- // the first newline will be output
1118
- Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {
1119
- var result = whitespaceChar.test(this._input.peek());
1120
- var newline_count = 0;
1121
- while (whitespaceChar.test(this._input.peek())) {
1122
- this._ch = this._input.next();
1123
- if (allowAtLeastOneNewLine && this._ch === '\n') {
1124
- if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {
1125
- newline_count++;
1126
- this._output.add_new_line(true);
1127
- }
1128
- }
1129
- }
1130
- return result;
1131
- };
1132
-
1133
- // Nested pseudo-class if we are insideRule
1134
- // and the next special character found opens
1135
- // a new block
1136
- Beautifier.prototype.foundNestedPseudoClass = function() {
1137
- var openParen = 0;
1138
- var i = 1;
1139
- var ch = this._input.peek(i);
1140
- while (ch) {
1141
- if (ch === "{") {
1142
- return true;
1143
- } else if (ch === '(') {
1144
- // pseudoclasses can contain ()
1145
- openParen += 1;
1146
- } else if (ch === ')') {
1147
- if (openParen === 0) {
1148
- return false;
1149
- }
1150
- openParen -= 1;
1151
- } else if (ch === ";" || ch === "}") {
1152
- return false;
1153
- }
1154
- i++;
1155
- ch = this._input.peek(i);
1156
- }
1157
- return false;
1158
- };
1159
-
1160
- Beautifier.prototype.print_string = function(output_string) {
1161
- this._output.set_indent(this._indentLevel);
1162
- this._output.non_breaking_space = true;
1163
- this._output.add_token(output_string);
1164
- };
1165
-
1166
- Beautifier.prototype.preserveSingleSpace = function(isAfterSpace) {
1167
- if (isAfterSpace) {
1168
- this._output.space_before_token = true;
1169
- }
1170
- };
1171
-
1172
- Beautifier.prototype.indent = function() {
1173
- this._indentLevel++;
1174
- };
1175
-
1176
- Beautifier.prototype.outdent = function() {
1177
- if (this._indentLevel > 0) {
1178
- this._indentLevel--;
1179
- }
1180
- };
1181
-
1182
- /*_____________________--------------------_____________________*/
1183
-
1184
- Beautifier.prototype.beautify = function() {
1185
- if (this._options.disabled) {
1186
- return this._source_text;
1187
- }
1188
-
1189
- var source_text = this._source_text;
1190
- var eol = this._options.eol;
1191
- if (eol === 'auto') {
1192
- eol = '\n';
1193
- if (source_text && lineBreak.test(source_text || '')) {
1194
- eol = source_text.match(lineBreak)[0];
1195
- }
1196
- }
1197
-
1198
-
1199
- // HACK: newline parsing inconsistent. This brute force normalizes the this._input.
1200
- source_text = source_text.replace(allLineBreaks, '\n');
1201
-
1202
- // reset
1203
- var baseIndentString = source_text.match(/^[\t ]*/)[0];
1204
-
1205
- this._output = new Output(this._options, baseIndentString);
1206
- this._input = new InputScanner(source_text);
1207
- this._indentLevel = 0;
1208
- this._nestedLevel = 0;
1209
-
1210
- this._ch = null;
1211
- var parenLevel = 0;
1212
-
1213
- var insideRule = false;
1214
- // This is the value side of a property value pair (blue in the following ex)
1215
- // label { content: blue }
1216
- var insidePropertyValue = false;
1217
- var enteringConditionalGroup = false;
1218
- var insideNonNestedAtRule = false;
1219
- var insideScssMap = false;
1220
- var topCharacter = this._ch;
1221
- var insideNonSemiColonValues = false;
1222
- var whitespace;
1223
- var isAfterSpace;
1224
- var previous_ch;
1225
-
1226
- while (true) {
1227
- whitespace = this._input.read(whitespacePattern);
1228
- isAfterSpace = whitespace !== '';
1229
- previous_ch = topCharacter;
1230
- this._ch = this._input.next();
1231
- if (this._ch === '\\' && this._input.hasNext()) {
1232
- this._ch += this._input.next();
1233
- }
1234
- topCharacter = this._ch;
1235
-
1236
- if (!this._ch) {
1237
- break;
1238
- } else if (this._ch === '/' && this._input.peek() === '*') {
1239
- // /* css comment */
1240
- // Always start block comments on a new line.
1241
- // This handles scenarios where a block comment immediately
1242
- // follows a property definition on the same line or where
1243
- // minified code is being beautified.
1244
- this._output.add_new_line();
1245
- this._input.back();
1246
-
1247
- var comment = this._input.read(block_comment_pattern);
1248
-
1249
- // Handle ignore directive
1250
- var directives = directives_core.get_directives(comment);
1251
- if (directives && directives.ignore === 'start') {
1252
- comment += directives_core.readIgnored(this._input);
1253
- }
1254
-
1255
- this.print_string(comment);
1256
-
1257
- // Ensures any new lines following the comment are preserved
1258
- this.eatWhitespace(true);
1259
-
1260
- // Block comments are followed by a new line so they don't
1261
- // share a line with other properties
1262
- this._output.add_new_line();
1263
- } else if (this._ch === '/' && this._input.peek() === '/') {
1264
- // // single line comment
1265
- // Preserves the space before a comment
1266
- // on the same line as a rule
1267
- this._output.space_before_token = true;
1268
- this._input.back();
1269
- this.print_string(this._input.read(comment_pattern));
1270
-
1271
- // Ensures any new lines following the comment are preserved
1272
- this.eatWhitespace(true);
1273
- } else if (this._ch === '$') {
1274
- this.preserveSingleSpace(isAfterSpace);
1275
-
1276
- this.print_string(this._ch);
1277
-
1278
- // strip trailing space, if present, for hash property checks
1279
- var variable = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
1280
-
1281
- if (variable.match(/[ :]$/)) {
1282
- // we have a variable or pseudo-class, add it and insert one space before continuing
1283
- variable = this.eatString(": ").replace(/\s+$/, '');
1284
- this.print_string(variable);
1285
- this._output.space_before_token = true;
1286
- }
1287
-
1288
- // might be sass variable
1289
- if (parenLevel === 0 && variable.indexOf(':') !== -1) {
1290
- insidePropertyValue = true;
1291
- this.indent();
1292
- }
1293
- } else if (this._ch === '@') {
1294
- this.preserveSingleSpace(isAfterSpace);
1295
-
1296
- // deal with less property mixins @{...}
1297
- if (this._input.peek() === '{') {
1298
- this.print_string(this._ch + this.eatString('}'));
1299
- } else {
1300
- this.print_string(this._ch);
1301
-
1302
- // strip trailing space, if present, for hash property checks
1303
- var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
1304
-
1305
- if (variableOrRule.match(/[ :]$/)) {
1306
- // we have a variable or pseudo-class, add it and insert one space before continuing
1307
- variableOrRule = this.eatString(": ").replace(/\s+$/, '');
1308
- this.print_string(variableOrRule);
1309
- this._output.space_before_token = true;
1310
- }
1311
-
1312
- // might be less variable
1313
- if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {
1314
- insidePropertyValue = true;
1315
- this.indent();
1316
-
1317
- // might be a nesting at-rule
1318
- } else if (variableOrRule in this.NESTED_AT_RULE) {
1319
- this._nestedLevel += 1;
1320
- if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {
1321
- enteringConditionalGroup = true;
1322
- }
1323
-
1324
- // might be a non-nested at-rule
1325
- } else if (parenLevel === 0 && !insidePropertyValue) {
1326
- insideNonNestedAtRule = true;
1327
- }
1328
- }
1329
- } else if (this._ch === '#' && this._input.peek() === '{') {
1330
- this.preserveSingleSpace(isAfterSpace);
1331
- this.print_string(this._ch + this.eatString('}'));
1332
- } else if (this._ch === '{') {
1333
- if (insidePropertyValue) {
1334
- insidePropertyValue = false;
1335
- this.outdent();
1336
- }
1337
-
1338
- // non nested at rule becomes nested
1339
- insideNonNestedAtRule = false;
1340
-
1341
- // when entering conditional groups, only rulesets are allowed
1342
- if (enteringConditionalGroup) {
1343
- enteringConditionalGroup = false;
1344
- insideRule = (this._indentLevel >= this._nestedLevel);
1345
- } else {
1346
- // otherwise, declarations are also allowed
1347
- insideRule = (this._indentLevel >= this._nestedLevel - 1);
1348
- }
1349
- if (this._options.newline_between_rules && insideRule) {
1350
- if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {
1351
- this._output.ensure_empty_line_above('/', ',');
1352
- }
1353
- }
1354
-
1355
- this._output.space_before_token = true;
1356
-
1357
- // The difference in print_string and indent order is necessary to indent the '{' correctly
1358
- if (this._options.brace_style === 'expand') {
1359
- this._output.add_new_line();
1360
- this.print_string(this._ch);
1361
- this.indent();
1362
- this._output.set_indent(this._indentLevel);
1363
- } else {
1364
- // inside mixin and first param is object
1365
- if (previous_ch === '(') {
1366
- this._output.space_before_token = false;
1367
- } else if (previous_ch !== ',') {
1368
- this.indent();
1369
- }
1370
- this.print_string(this._ch);
1371
- }
1372
-
1373
- this.eatWhitespace(true);
1374
- this._output.add_new_line();
1375
- } else if (this._ch === '}') {
1376
- this.outdent();
1377
- this._output.add_new_line();
1378
- if (previous_ch === '{') {
1379
- this._output.trim(true);
1380
- }
1381
-
1382
- if (insidePropertyValue) {
1383
- this.outdent();
1384
- insidePropertyValue = false;
1385
- }
1386
- this.print_string(this._ch);
1387
- insideRule = false;
1388
- if (this._nestedLevel) {
1389
- this._nestedLevel--;
1390
- }
1391
-
1392
- this.eatWhitespace(true);
1393
- this._output.add_new_line();
1394
-
1395
- if (this._options.newline_between_rules && !this._output.just_added_blankline()) {
1396
- if (this._input.peek() !== '}') {
1397
- this._output.add_new_line(true);
1398
- }
1399
- }
1400
- if (this._input.peek() === ')') {
1401
- this._output.trim(true);
1402
- if (this._options.brace_style === "expand") {
1403
- this._output.add_new_line(true);
1404
- }
1405
- }
1406
- } else if (this._ch === ":") {
1407
-
1408
- for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) {
1409
- if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) {
1410
- insideNonSemiColonValues = true;
1411
- break;
1412
- }
1413
- }
1414
-
1415
- if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideNonNestedAtRule && parenLevel === 0) {
1416
- // 'property: value' delimiter
1417
- // which could be in a conditional group query
1418
-
1419
- this.print_string(':');
1420
- if (!insidePropertyValue) {
1421
- insidePropertyValue = true;
1422
- this._output.space_before_token = true;
1423
- this.eatWhitespace(true);
1424
- this.indent();
1425
- }
1426
- } else {
1427
- // sass/less parent reference don't use a space
1428
- // sass nested pseudo-class don't use a space
1429
-
1430
- // preserve space before pseudoclasses/pseudoelements, as it means "in any child"
1431
- if (this._input.lookBack(" ")) {
1432
- this._output.space_before_token = true;
1433
- }
1434
- if (this._input.peek() === ":") {
1435
- // pseudo-element
1436
- this._ch = this._input.next();
1437
- this.print_string("::");
1438
- } else {
1439
- // pseudo-class
1440
- this.print_string(':');
1441
- }
1442
- }
1443
- } else if (this._ch === '"' || this._ch === '\'') {
1444
- var preserveQuoteSpace = previous_ch === '"' || previous_ch === '\'';
1445
- this.preserveSingleSpace(preserveQuoteSpace || isAfterSpace);
1446
- this.print_string(this._ch + this.eatString(this._ch));
1447
- this.eatWhitespace(true);
1448
- } else if (this._ch === ';') {
1449
- insideNonSemiColonValues = false;
1450
- if (parenLevel === 0) {
1451
- if (insidePropertyValue) {
1452
- this.outdent();
1453
- insidePropertyValue = false;
1454
- }
1455
- insideNonNestedAtRule = false;
1456
- this.print_string(this._ch);
1457
- this.eatWhitespace(true);
1458
-
1459
- // This maintains single line comments on the same
1460
- // line. Block comments are also affected, but
1461
- // a new line is always output before one inside
1462
- // that section
1463
- if (this._input.peek() !== '/') {
1464
- this._output.add_new_line();
1465
- }
1466
- } else {
1467
- this.print_string(this._ch);
1468
- this.eatWhitespace(true);
1469
- this._output.space_before_token = true;
1470
- }
1471
- } else if (this._ch === '(') { // may be a url
1472
- if (this._input.lookBack("url")) {
1473
- this.print_string(this._ch);
1474
- this.eatWhitespace();
1475
- parenLevel++;
1476
- this.indent();
1477
- this._ch = this._input.next();
1478
- if (this._ch === ')' || this._ch === '"' || this._ch === '\'') {
1479
- this._input.back();
1480
- } else if (this._ch) {
1481
- this.print_string(this._ch + this.eatString(')'));
1482
- if (parenLevel) {
1483
- parenLevel--;
1484
- this.outdent();
1485
- }
1486
- }
1487
- } else {
1488
- var space_needed = false;
1489
- if (this._input.lookBack("with")) {
1490
- // look back is not an accurate solution, we need tokens to confirm without whitespaces
1491
- space_needed = true;
1492
- }
1493
- this.preserveSingleSpace(isAfterSpace || space_needed);
1494
- this.print_string(this._ch);
1495
-
1496
- // handle scss/sass map
1497
- if (insidePropertyValue && previous_ch === "$" && this._options.selector_separator_newline) {
1498
- this._output.add_new_line();
1499
- insideScssMap = true;
1500
- } else {
1501
- this.eatWhitespace();
1502
- parenLevel++;
1503
- this.indent();
1504
- }
1505
- }
1506
- } else if (this._ch === ')') {
1507
- if (parenLevel) {
1508
- parenLevel--;
1509
- this.outdent();
1510
- }
1511
- if (insideScssMap && this._input.peek() === ";" && this._options.selector_separator_newline) {
1512
- insideScssMap = false;
1513
- this.outdent();
1514
- this._output.add_new_line();
1515
- }
1516
- this.print_string(this._ch);
1517
- } else if (this._ch === ',') {
1518
- this.print_string(this._ch);
1519
- this.eatWhitespace(true);
1520
- if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideNonNestedAtRule) {
1521
- this._output.add_new_line();
1522
- } else {
1523
- this._output.space_before_token = true;
1524
- }
1525
- } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel === 0) {
1526
- //handle combinator spacing
1527
- if (this._options.space_around_combinator) {
1528
- this._output.space_before_token = true;
1529
- this.print_string(this._ch);
1530
- this._output.space_before_token = true;
1531
- } else {
1532
- this.print_string(this._ch);
1533
- this.eatWhitespace();
1534
- // squash extra whitespace
1535
- if (this._ch && whitespaceChar.test(this._ch)) {
1536
- this._ch = '';
1537
- }
1538
- }
1539
- } else if (this._ch === ']') {
1540
- this.print_string(this._ch);
1541
- } else if (this._ch === '[') {
1542
- this.preserveSingleSpace(isAfterSpace);
1543
- this.print_string(this._ch);
1544
- } else if (this._ch === '=') { // no whitespace before or after
1545
- this.eatWhitespace();
1546
- this.print_string('=');
1547
- if (whitespaceChar.test(this._ch)) {
1548
- this._ch = '';
1549
- }
1550
- } else if (this._ch === '!' && !this._input.lookBack("\\")) { // !important
1551
- this._output.space_before_token = true;
1552
- this.print_string(this._ch);
1553
- } else {
1554
- var preserveAfterSpace = previous_ch === '"' || previous_ch === '\'';
1555
- this.preserveSingleSpace(preserveAfterSpace || isAfterSpace);
1556
- this.print_string(this._ch);
1557
-
1558
- if (!this._output.just_added_newline() && this._input.peek() === '\n' && insideNonSemiColonValues) {
1559
- this._output.add_new_line();
1560
- }
66
+ /******/ (function () {
67
+ /******/ "use strict";
68
+ /******/ var __webpack_modules__ = ([
69
+ /* 0 */ ,
70
+ /* 1 */ ,
71
+ /* 2 */
72
+ /***/ (function (module) {
73
+ /*jshint node:true */
74
+ /*
75
+ The MIT License (MIT)
76
+
77
+ Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
78
+
79
+ Permission is hereby granted, free of charge, to any person
80
+ obtaining a copy of this software and associated documentation files
81
+ (the "Software"), to deal in the Software without restriction,
82
+ including without limitation the rights to use, copy, modify, merge,
83
+ publish, distribute, sublicense, and/or sell copies of the Software,
84
+ and to permit persons to whom the Software is furnished to do so,
85
+ subject to the following conditions:
86
+
87
+ The above copyright notice and this permission notice shall be
88
+ included in all copies or substantial portions of the Software.
89
+
90
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
91
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
92
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
93
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
94
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
95
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
96
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
97
+ SOFTWARE.
98
+ */
99
+ function OutputLine(parent) {
100
+ this.__parent = parent;
101
+ this.__character_count = 0;
102
+ // use indent_count as a marker for this.__lines that have preserved indentation
103
+ this.__indent_count = -1;
104
+ this.__alignment_count = 0;
105
+ this.__wrap_point_index = 0;
106
+ this.__wrap_point_character_count = 0;
107
+ this.__wrap_point_indent_count = -1;
108
+ this.__wrap_point_alignment_count = 0;
109
+ this.__items = [];
110
+ }
111
+ OutputLine.prototype.clone_empty = function () {
112
+ var line = new OutputLine(this.__parent);
113
+ line.set_indent(this.__indent_count, this.__alignment_count);
114
+ return line;
115
+ };
116
+ OutputLine.prototype.item = function (index) {
117
+ if (index < 0) {
118
+ return this.__items[this.__items.length + index];
119
+ }
120
+ else {
121
+ return this.__items[index];
122
+ }
123
+ };
124
+ OutputLine.prototype.has_match = function (pattern) {
125
+ for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
126
+ if (this.__items[lastCheckedOutput].match(pattern)) {
127
+ return true;
128
+ }
129
+ }
130
+ return false;
131
+ };
132
+ OutputLine.prototype.set_indent = function (indent, alignment) {
133
+ if (this.is_empty()) {
134
+ this.__indent_count = indent || 0;
135
+ this.__alignment_count = alignment || 0;
136
+ this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);
137
+ }
138
+ };
139
+ OutputLine.prototype._set_wrap_point = function () {
140
+ if (this.__parent.wrap_line_length) {
141
+ this.__wrap_point_index = this.__items.length;
142
+ this.__wrap_point_character_count = this.__character_count;
143
+ this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;
144
+ this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;
145
+ }
146
+ };
147
+ OutputLine.prototype._should_wrap = function () {
148
+ return this.__wrap_point_index &&
149
+ this.__character_count > this.__parent.wrap_line_length &&
150
+ this.__wrap_point_character_count > this.__parent.next_line.__character_count;
151
+ };
152
+ OutputLine.prototype._allow_wrap = function () {
153
+ if (this._should_wrap()) {
154
+ this.__parent.add_new_line();
155
+ var next = this.__parent.current_line;
156
+ next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);
157
+ next.__items = this.__items.slice(this.__wrap_point_index);
158
+ this.__items = this.__items.slice(0, this.__wrap_point_index);
159
+ next.__character_count += this.__character_count - this.__wrap_point_character_count;
160
+ this.__character_count = this.__wrap_point_character_count;
161
+ if (next.__items[0] === " ") {
162
+ next.__items.splice(0, 1);
163
+ next.__character_count -= 1;
164
+ }
165
+ return true;
166
+ }
167
+ return false;
168
+ };
169
+ OutputLine.prototype.is_empty = function () {
170
+ return this.__items.length === 0;
171
+ };
172
+ OutputLine.prototype.last = function () {
173
+ if (!this.is_empty()) {
174
+ return this.__items[this.__items.length - 1];
175
+ }
176
+ else {
177
+ return null;
178
+ }
179
+ };
180
+ OutputLine.prototype.push = function (item) {
181
+ this.__items.push(item);
182
+ var last_newline_index = item.lastIndexOf('\n');
183
+ if (last_newline_index !== -1) {
184
+ this.__character_count = item.length - last_newline_index;
185
+ }
186
+ else {
187
+ this.__character_count += item.length;
188
+ }
189
+ };
190
+ OutputLine.prototype.pop = function () {
191
+ var item = null;
192
+ if (!this.is_empty()) {
193
+ item = this.__items.pop();
194
+ this.__character_count -= item.length;
195
+ }
196
+ return item;
197
+ };
198
+ OutputLine.prototype._remove_indent = function () {
199
+ if (this.__indent_count > 0) {
200
+ this.__indent_count -= 1;
201
+ this.__character_count -= this.__parent.indent_size;
202
+ }
203
+ };
204
+ OutputLine.prototype._remove_wrap_indent = function () {
205
+ if (this.__wrap_point_indent_count > 0) {
206
+ this.__wrap_point_indent_count -= 1;
207
+ }
208
+ };
209
+ OutputLine.prototype.trim = function () {
210
+ while (this.last() === ' ') {
211
+ this.__items.pop();
212
+ this.__character_count -= 1;
213
+ }
214
+ };
215
+ OutputLine.prototype.toString = function () {
216
+ var result = '';
217
+ if (this.is_empty()) {
218
+ if (this.__parent.indent_empty_lines) {
219
+ result = this.__parent.get_indent_string(this.__indent_count);
220
+ }
221
+ }
222
+ else {
223
+ result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);
224
+ result += this.__items.join('');
225
+ }
226
+ return result;
227
+ };
228
+ function IndentStringCache(options, baseIndentString) {
229
+ this.__cache = [''];
230
+ this.__indent_size = options.indent_size;
231
+ this.__indent_string = options.indent_char;
232
+ if (!options.indent_with_tabs) {
233
+ this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);
234
+ }
235
+ // Set to null to continue support for auto detection of base indent
236
+ baseIndentString = baseIndentString || '';
237
+ if (options.indent_level > 0) {
238
+ baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);
239
+ }
240
+ this.__base_string = baseIndentString;
241
+ this.__base_string_length = baseIndentString.length;
242
+ }
243
+ IndentStringCache.prototype.get_indent_size = function (indent, column) {
244
+ var result = this.__base_string_length;
245
+ column = column || 0;
246
+ if (indent < 0) {
247
+ result = 0;
248
+ }
249
+ result += indent * this.__indent_size;
250
+ result += column;
251
+ return result;
252
+ };
253
+ IndentStringCache.prototype.get_indent_string = function (indent_level, column) {
254
+ var result = this.__base_string;
255
+ column = column || 0;
256
+ if (indent_level < 0) {
257
+ indent_level = 0;
258
+ result = '';
259
+ }
260
+ column += indent_level * this.__indent_size;
261
+ this.__ensure_cache(column);
262
+ result += this.__cache[column];
263
+ return result;
264
+ };
265
+ IndentStringCache.prototype.__ensure_cache = function (column) {
266
+ while (column >= this.__cache.length) {
267
+ this.__add_column();
268
+ }
269
+ };
270
+ IndentStringCache.prototype.__add_column = function () {
271
+ var column = this.__cache.length;
272
+ var indent = 0;
273
+ var result = '';
274
+ if (this.__indent_size && column >= this.__indent_size) {
275
+ indent = Math.floor(column / this.__indent_size);
276
+ column -= indent * this.__indent_size;
277
+ result = new Array(indent + 1).join(this.__indent_string);
278
+ }
279
+ if (column) {
280
+ result += new Array(column + 1).join(' ');
281
+ }
282
+ this.__cache.push(result);
283
+ };
284
+ function Output(options, baseIndentString) {
285
+ this.__indent_cache = new IndentStringCache(options, baseIndentString);
286
+ this.raw = false;
287
+ this._end_with_newline = options.end_with_newline;
288
+ this.indent_size = options.indent_size;
289
+ this.wrap_line_length = options.wrap_line_length;
290
+ this.indent_empty_lines = options.indent_empty_lines;
291
+ this.__lines = [];
292
+ this.previous_line = null;
293
+ this.current_line = null;
294
+ this.next_line = new OutputLine(this);
295
+ this.space_before_token = false;
296
+ this.non_breaking_space = false;
297
+ this.previous_token_wrapped = false;
298
+ // initialize
299
+ this.__add_outputline();
300
+ }
301
+ Output.prototype.__add_outputline = function () {
302
+ this.previous_line = this.current_line;
303
+ this.current_line = this.next_line.clone_empty();
304
+ this.__lines.push(this.current_line);
305
+ };
306
+ Output.prototype.get_line_number = function () {
307
+ return this.__lines.length;
308
+ };
309
+ Output.prototype.get_indent_string = function (indent, column) {
310
+ return this.__indent_cache.get_indent_string(indent, column);
311
+ };
312
+ Output.prototype.get_indent_size = function (indent, column) {
313
+ return this.__indent_cache.get_indent_size(indent, column);
314
+ };
315
+ Output.prototype.is_empty = function () {
316
+ return !this.previous_line && this.current_line.is_empty();
317
+ };
318
+ Output.prototype.add_new_line = function (force_newline) {
319
+ // never newline at the start of file
320
+ // otherwise, newline only if we didn't just add one or we're forced
321
+ if (this.is_empty() ||
322
+ (!force_newline && this.just_added_newline())) {
323
+ return false;
324
+ }
325
+ // if raw output is enabled, don't print additional newlines,
326
+ // but still return True as though you had
327
+ if (!this.raw) {
328
+ this.__add_outputline();
329
+ }
330
+ return true;
331
+ };
332
+ Output.prototype.get_code = function (eol) {
333
+ this.trim(true);
334
+ // handle some edge cases where the last tokens
335
+ // has text that ends with newline(s)
336
+ var last_item = this.current_line.pop();
337
+ if (last_item) {
338
+ if (last_item[last_item.length - 1] === '\n') {
339
+ last_item = last_item.replace(/\n+$/g, '');
340
+ }
341
+ this.current_line.push(last_item);
342
+ }
343
+ if (this._end_with_newline) {
344
+ this.__add_outputline();
345
+ }
346
+ var sweet_code = this.__lines.join('\n');
347
+ if (eol !== '\n') {
348
+ sweet_code = sweet_code.replace(/[\n]/g, eol);
349
+ }
350
+ return sweet_code;
351
+ };
352
+ Output.prototype.set_wrap_point = function () {
353
+ this.current_line._set_wrap_point();
354
+ };
355
+ Output.prototype.set_indent = function (indent, alignment) {
356
+ indent = indent || 0;
357
+ alignment = alignment || 0;
358
+ // Next line stores alignment values
359
+ this.next_line.set_indent(indent, alignment);
360
+ // Never indent your first output indent at the start of the file
361
+ if (this.__lines.length > 1) {
362
+ this.current_line.set_indent(indent, alignment);
363
+ return true;
364
+ }
365
+ this.current_line.set_indent();
366
+ return false;
367
+ };
368
+ Output.prototype.add_raw_token = function (token) {
369
+ for (var x = 0; x < token.newlines; x++) {
370
+ this.__add_outputline();
371
+ }
372
+ this.current_line.set_indent(-1);
373
+ this.current_line.push(token.whitespace_before);
374
+ this.current_line.push(token.text);
375
+ this.space_before_token = false;
376
+ this.non_breaking_space = false;
377
+ this.previous_token_wrapped = false;
378
+ };
379
+ Output.prototype.add_token = function (printable_token) {
380
+ this.__add_space_before_token();
381
+ this.current_line.push(printable_token);
382
+ this.space_before_token = false;
383
+ this.non_breaking_space = false;
384
+ this.previous_token_wrapped = this.current_line._allow_wrap();
385
+ };
386
+ Output.prototype.__add_space_before_token = function () {
387
+ if (this.space_before_token && !this.just_added_newline()) {
388
+ if (!this.non_breaking_space) {
389
+ this.set_wrap_point();
390
+ }
391
+ this.current_line.push(' ');
392
+ }
393
+ };
394
+ Output.prototype.remove_indent = function (index) {
395
+ var output_length = this.__lines.length;
396
+ while (index < output_length) {
397
+ this.__lines[index]._remove_indent();
398
+ index++;
399
+ }
400
+ this.current_line._remove_wrap_indent();
401
+ };
402
+ Output.prototype.trim = function (eat_newlines) {
403
+ eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;
404
+ this.current_line.trim();
405
+ while (eat_newlines && this.__lines.length > 1 &&
406
+ this.current_line.is_empty()) {
407
+ this.__lines.pop();
408
+ this.current_line = this.__lines[this.__lines.length - 1];
409
+ this.current_line.trim();
410
+ }
411
+ this.previous_line = this.__lines.length > 1 ?
412
+ this.__lines[this.__lines.length - 2] : null;
413
+ };
414
+ Output.prototype.just_added_newline = function () {
415
+ return this.current_line.is_empty();
416
+ };
417
+ Output.prototype.just_added_blankline = function () {
418
+ return this.is_empty() ||
419
+ (this.current_line.is_empty() && this.previous_line.is_empty());
420
+ };
421
+ Output.prototype.ensure_empty_line_above = function (starts_with, ends_with) {
422
+ var index = this.__lines.length - 2;
423
+ while (index >= 0) {
424
+ var potentialEmptyLine = this.__lines[index];
425
+ if (potentialEmptyLine.is_empty()) {
426
+ break;
427
+ }
428
+ else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&
429
+ potentialEmptyLine.item(-1) !== ends_with) {
430
+ this.__lines.splice(index + 1, 0, new OutputLine(this));
431
+ this.previous_line = this.__lines[this.__lines.length - 2];
432
+ break;
433
+ }
434
+ index--;
435
+ }
436
+ };
437
+ module.exports.Output = Output;
438
+ /***/
439
+ }),
440
+ /* 3 */ ,
441
+ /* 4 */ ,
442
+ /* 5 */ ,
443
+ /* 6 */
444
+ /***/ (function (module) {
445
+ /*jshint node:true */
446
+ /*
447
+
448
+ The MIT License (MIT)
449
+
450
+ Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
451
+
452
+ Permission is hereby granted, free of charge, to any person
453
+ obtaining a copy of this software and associated documentation files
454
+ (the "Software"), to deal in the Software without restriction,
455
+ including without limitation the rights to use, copy, modify, merge,
456
+ publish, distribute, sublicense, and/or sell copies of the Software,
457
+ and to permit persons to whom the Software is furnished to do so,
458
+ subject to the following conditions:
459
+
460
+ The above copyright notice and this permission notice shall be
461
+ included in all copies or substantial portions of the Software.
462
+
463
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
464
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
465
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
466
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
467
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
468
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
469
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
470
+ SOFTWARE.
471
+ */
472
+ function Options(options, merge_child_field) {
473
+ this.raw_options = _mergeOpts(options, merge_child_field);
474
+ // Support passing the source text back with no change
475
+ this.disabled = this._get_boolean('disabled');
476
+ this.eol = this._get_characters('eol', 'auto');
477
+ this.end_with_newline = this._get_boolean('end_with_newline');
478
+ this.indent_size = this._get_number('indent_size', 4);
479
+ this.indent_char = this._get_characters('indent_char', ' ');
480
+ this.indent_level = this._get_number('indent_level');
481
+ this.preserve_newlines = this._get_boolean('preserve_newlines', true);
482
+ this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);
483
+ if (!this.preserve_newlines) {
484
+ this.max_preserve_newlines = 0;
485
+ }
486
+ this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t');
487
+ if (this.indent_with_tabs) {
488
+ this.indent_char = '\t';
489
+ // indent_size behavior changed after 1.8.6
490
+ // It used to be that indent_size would be
491
+ // set to 1 for indent_with_tabs. That is no longer needed and
492
+ // actually doesn't make sense - why not use spaces? Further,
493
+ // that might produce unexpected behavior - tabs being used
494
+ // for single-column alignment. So, when indent_with_tabs is true
495
+ // and indent_size is 1, reset indent_size to 4.
496
+ if (this.indent_size === 1) {
497
+ this.indent_size = 4;
498
+ }
499
+ }
500
+ // Backwards compat with 1.3.x
501
+ this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));
502
+ this.indent_empty_lines = this._get_boolean('indent_empty_lines');
503
+ // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
504
+ // For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
505
+ // other values ignored
506
+ this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
507
+ }
508
+ Options.prototype._get_array = function (name, default_value) {
509
+ var option_value = this.raw_options[name];
510
+ var result = default_value || [];
511
+ if (typeof option_value === 'object') {
512
+ if (option_value !== null && typeof option_value.concat === 'function') {
513
+ result = option_value.concat();
514
+ }
515
+ }
516
+ else if (typeof option_value === 'string') {
517
+ result = option_value.split(/[^a-zA-Z0-9_\/\-]+/);
518
+ }
519
+ return result;
520
+ };
521
+ Options.prototype._get_boolean = function (name, default_value) {
522
+ var option_value = this.raw_options[name];
523
+ var result = option_value === undefined ? !!default_value : !!option_value;
524
+ return result;
525
+ };
526
+ Options.prototype._get_characters = function (name, default_value) {
527
+ var option_value = this.raw_options[name];
528
+ var result = default_value || '';
529
+ if (typeof option_value === 'string') {
530
+ result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t');
531
+ }
532
+ return result;
533
+ };
534
+ Options.prototype._get_number = function (name, default_value) {
535
+ var option_value = this.raw_options[name];
536
+ default_value = parseInt(default_value, 10);
537
+ if (isNaN(default_value)) {
538
+ default_value = 0;
539
+ }
540
+ var result = parseInt(option_value, 10);
541
+ if (isNaN(result)) {
542
+ result = default_value;
543
+ }
544
+ return result;
545
+ };
546
+ Options.prototype._get_selection = function (name, selection_list, default_value) {
547
+ var result = this._get_selection_list(name, selection_list, default_value);
548
+ if (result.length !== 1) {
549
+ throw new Error("Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" +
550
+ selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
551
+ }
552
+ return result[0];
553
+ };
554
+ Options.prototype._get_selection_list = function (name, selection_list, default_value) {
555
+ if (!selection_list || selection_list.length === 0) {
556
+ throw new Error("Selection list cannot be empty.");
557
+ }
558
+ default_value = default_value || [selection_list[0]];
559
+ if (!this._is_valid_selection(default_value, selection_list)) {
560
+ throw new Error("Invalid Default Value!");
561
+ }
562
+ var result = this._get_array(name, default_value);
563
+ if (!this._is_valid_selection(result, selection_list)) {
564
+ throw new Error("Invalid Option Value: The option '" + name + "' can contain only the following values:\n" +
565
+ selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
566
+ }
567
+ return result;
568
+ };
569
+ Options.prototype._is_valid_selection = function (result, selection_list) {
570
+ return result.length && selection_list.length &&
571
+ !result.some(function (item) { return selection_list.indexOf(item) === -1; });
572
+ };
573
+ // merges child options up with the parent options object
574
+ // Example: obj = {a: 1, b: {a: 2}}
575
+ // mergeOpts(obj, 'b')
576
+ //
577
+ // Returns: {a: 2}
578
+ function _mergeOpts(allOptions, childFieldName) {
579
+ var finalOpts = {};
580
+ allOptions = _normalizeOpts(allOptions);
581
+ var name;
582
+ for (name in allOptions) {
583
+ if (name !== childFieldName) {
584
+ finalOpts[name] = allOptions[name];
585
+ }
586
+ }
587
+ //merge in the per type settings for the childFieldName
588
+ if (childFieldName && allOptions[childFieldName]) {
589
+ for (name in allOptions[childFieldName]) {
590
+ finalOpts[name] = allOptions[childFieldName][name];
591
+ }
592
+ }
593
+ return finalOpts;
594
+ }
595
+ function _normalizeOpts(options) {
596
+ var convertedOpts = {};
597
+ var key;
598
+ for (key in options) {
599
+ var newKey = key.replace(/-/g, "_");
600
+ convertedOpts[newKey] = options[key];
601
+ }
602
+ return convertedOpts;
603
+ }
604
+ module.exports.Options = Options;
605
+ module.exports.normalizeOpts = _normalizeOpts;
606
+ module.exports.mergeOpts = _mergeOpts;
607
+ /***/
608
+ }),
609
+ /* 7 */ ,
610
+ /* 8 */
611
+ /***/ (function (module) {
612
+ /*jshint node:true */
613
+ /*
614
+
615
+ The MIT License (MIT)
616
+
617
+ Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
618
+
619
+ Permission is hereby granted, free of charge, to any person
620
+ obtaining a copy of this software and associated documentation files
621
+ (the "Software"), to deal in the Software without restriction,
622
+ including without limitation the rights to use, copy, modify, merge,
623
+ publish, distribute, sublicense, and/or sell copies of the Software,
624
+ and to permit persons to whom the Software is furnished to do so,
625
+ subject to the following conditions:
626
+
627
+ The above copyright notice and this permission notice shall be
628
+ included in all copies or substantial portions of the Software.
629
+
630
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
631
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
632
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
633
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
634
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
635
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
636
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
637
+ SOFTWARE.
638
+ */
639
+ var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky');
640
+ function InputScanner(input_string) {
641
+ this.__input = input_string || '';
642
+ this.__input_length = this.__input.length;
643
+ this.__position = 0;
644
+ }
645
+ InputScanner.prototype.restart = function () {
646
+ this.__position = 0;
647
+ };
648
+ InputScanner.prototype.back = function () {
649
+ if (this.__position > 0) {
650
+ this.__position -= 1;
651
+ }
652
+ };
653
+ InputScanner.prototype.hasNext = function () {
654
+ return this.__position < this.__input_length;
655
+ };
656
+ InputScanner.prototype.next = function () {
657
+ var val = null;
658
+ if (this.hasNext()) {
659
+ val = this.__input.charAt(this.__position);
660
+ this.__position += 1;
661
+ }
662
+ return val;
663
+ };
664
+ InputScanner.prototype.peek = function (index) {
665
+ var val = null;
666
+ index = index || 0;
667
+ index += this.__position;
668
+ if (index >= 0 && index < this.__input_length) {
669
+ val = this.__input.charAt(index);
670
+ }
671
+ return val;
672
+ };
673
+ // This is a JavaScript only helper function (not in python)
674
+ // Javascript doesn't have a match method
675
+ // and not all implementation support "sticky" flag.
676
+ // If they do not support sticky then both this.match() and this.test() method
677
+ // must get the match and check the index of the match.
678
+ // If sticky is supported and set, this method will use it.
679
+ // Otherwise it will check that global is set, and fall back to the slower method.
680
+ InputScanner.prototype.__match = function (pattern, index) {
681
+ pattern.lastIndex = index;
682
+ var pattern_match = pattern.exec(this.__input);
683
+ if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {
684
+ if (pattern_match.index !== index) {
685
+ pattern_match = null;
686
+ }
687
+ }
688
+ return pattern_match;
689
+ };
690
+ InputScanner.prototype.test = function (pattern, index) {
691
+ index = index || 0;
692
+ index += this.__position;
693
+ if (index >= 0 && index < this.__input_length) {
694
+ return !!this.__match(pattern, index);
695
+ }
696
+ else {
697
+ return false;
698
+ }
699
+ };
700
+ InputScanner.prototype.testChar = function (pattern, index) {
701
+ // test one character regex match
702
+ var val = this.peek(index);
703
+ pattern.lastIndex = 0;
704
+ return val !== null && pattern.test(val);
705
+ };
706
+ InputScanner.prototype.match = function (pattern) {
707
+ var pattern_match = this.__match(pattern, this.__position);
708
+ if (pattern_match) {
709
+ this.__position += pattern_match[0].length;
710
+ }
711
+ else {
712
+ pattern_match = null;
713
+ }
714
+ return pattern_match;
715
+ };
716
+ InputScanner.prototype.read = function (starting_pattern, until_pattern, until_after) {
717
+ var val = '';
718
+ var match;
719
+ if (starting_pattern) {
720
+ match = this.match(starting_pattern);
721
+ if (match) {
722
+ val += match[0];
723
+ }
724
+ }
725
+ if (until_pattern && (match || !starting_pattern)) {
726
+ val += this.readUntil(until_pattern, until_after);
727
+ }
728
+ return val;
729
+ };
730
+ InputScanner.prototype.readUntil = function (pattern, until_after) {
731
+ var val = '';
732
+ var match_index = this.__position;
733
+ pattern.lastIndex = this.__position;
734
+ var pattern_match = pattern.exec(this.__input);
735
+ if (pattern_match) {
736
+ match_index = pattern_match.index;
737
+ if (until_after) {
738
+ match_index += pattern_match[0].length;
739
+ }
740
+ }
741
+ else {
742
+ match_index = this.__input_length;
743
+ }
744
+ val = this.__input.substring(this.__position, match_index);
745
+ this.__position = match_index;
746
+ return val;
747
+ };
748
+ InputScanner.prototype.readUntilAfter = function (pattern) {
749
+ return this.readUntil(pattern, true);
750
+ };
751
+ InputScanner.prototype.get_regexp = function (pattern, match_from) {
752
+ var result = null;
753
+ var flags = 'g';
754
+ if (match_from && regexp_has_sticky) {
755
+ flags = 'y';
756
+ }
757
+ // strings are converted to regexp
758
+ if (typeof pattern === "string" && pattern !== '') {
759
+ // result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags);
760
+ result = new RegExp(pattern, flags);
761
+ }
762
+ else if (pattern) {
763
+ result = new RegExp(pattern.source, flags);
764
+ }
765
+ return result;
766
+ };
767
+ InputScanner.prototype.get_literal_regexp = function (literal_string) {
768
+ return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
769
+ };
770
+ /* css beautifier legacy helpers */
771
+ InputScanner.prototype.peekUntilAfter = function (pattern) {
772
+ var start = this.__position;
773
+ var val = this.readUntilAfter(pattern);
774
+ this.__position = start;
775
+ return val;
776
+ };
777
+ InputScanner.prototype.lookBack = function (testVal) {
778
+ var start = this.__position - 1;
779
+ return start >= testVal.length && this.__input.substring(start - testVal.length, start)
780
+ .toLowerCase() === testVal;
781
+ };
782
+ module.exports.InputScanner = InputScanner;
783
+ /***/
784
+ }),
785
+ /* 9 */ ,
786
+ /* 10 */ ,
787
+ /* 11 */ ,
788
+ /* 12 */ ,
789
+ /* 13 */
790
+ /***/ (function (module) {
791
+ /*jshint node:true */
792
+ /*
793
+
794
+ The MIT License (MIT)
795
+
796
+ Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
797
+
798
+ Permission is hereby granted, free of charge, to any person
799
+ obtaining a copy of this software and associated documentation files
800
+ (the "Software"), to deal in the Software without restriction,
801
+ including without limitation the rights to use, copy, modify, merge,
802
+ publish, distribute, sublicense, and/or sell copies of the Software,
803
+ and to permit persons to whom the Software is furnished to do so,
804
+ subject to the following conditions:
805
+
806
+ The above copyright notice and this permission notice shall be
807
+ included in all copies or substantial portions of the Software.
808
+
809
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
810
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
811
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
812
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
813
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
814
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
815
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
816
+ SOFTWARE.
817
+ */
818
+ function Directives(start_block_pattern, end_block_pattern) {
819
+ start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;
820
+ end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;
821
+ this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g');
822
+ this.__directive_pattern = / (\w+)[:](\w+)/g;
823
+ this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g');
824
+ }
825
+ Directives.prototype.get_directives = function (text) {
826
+ if (!text.match(this.__directives_block_pattern)) {
827
+ return null;
828
+ }
829
+ var directives = {};
830
+ this.__directive_pattern.lastIndex = 0;
831
+ var directive_match = this.__directive_pattern.exec(text);
832
+ while (directive_match) {
833
+ directives[directive_match[1]] = directive_match[2];
834
+ directive_match = this.__directive_pattern.exec(text);
835
+ }
836
+ return directives;
837
+ };
838
+ Directives.prototype.readIgnored = function (input) {
839
+ return input.readUntilAfter(this.__directives_end_ignore_pattern);
840
+ };
841
+ module.exports.Directives = Directives;
842
+ /***/
843
+ }),
844
+ /* 14 */ ,
845
+ /* 15 */
846
+ /***/ (function (module, __unused_webpack_exports, __webpack_require__) {
847
+ /*jshint node:true */
848
+ /*
849
+
850
+ The MIT License (MIT)
851
+
852
+ Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
853
+
854
+ Permission is hereby granted, free of charge, to any person
855
+ obtaining a copy of this software and associated documentation files
856
+ (the "Software"), to deal in the Software without restriction,
857
+ including without limitation the rights to use, copy, modify, merge,
858
+ publish, distribute, sublicense, and/or sell copies of the Software,
859
+ and to permit persons to whom the Software is furnished to do so,
860
+ subject to the following conditions:
861
+
862
+ The above copyright notice and this permission notice shall be
863
+ included in all copies or substantial portions of the Software.
864
+
865
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
866
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
867
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
868
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
869
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
870
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
871
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
872
+ SOFTWARE.
873
+ */
874
+ var Beautifier = (__webpack_require__(16).Beautifier), Options = (__webpack_require__(17).Options);
875
+ function css_beautify(source_text, options) {
876
+ var beautifier = new Beautifier(source_text, options);
877
+ return beautifier.beautify();
878
+ }
879
+ module.exports = css_beautify;
880
+ module.exports.defaultOptions = function () {
881
+ return new Options();
882
+ };
883
+ /***/
884
+ }),
885
+ /* 16 */
886
+ /***/ (function (module, __unused_webpack_exports, __webpack_require__) {
887
+ /*jshint node:true */
888
+ /*
889
+
890
+ The MIT License (MIT)
891
+
892
+ Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
893
+
894
+ Permission is hereby granted, free of charge, to any person
895
+ obtaining a copy of this software and associated documentation files
896
+ (the "Software"), to deal in the Software without restriction,
897
+ including without limitation the rights to use, copy, modify, merge,
898
+ publish, distribute, sublicense, and/or sell copies of the Software,
899
+ and to permit persons to whom the Software is furnished to do so,
900
+ subject to the following conditions:
901
+
902
+ The above copyright notice and this permission notice shall be
903
+ included in all copies or substantial portions of the Software.
904
+
905
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
906
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
907
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
908
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
909
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
910
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
911
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
912
+ SOFTWARE.
913
+ */
914
+ var Options = (__webpack_require__(17).Options);
915
+ var Output = (__webpack_require__(2).Output);
916
+ var InputScanner = (__webpack_require__(8).InputScanner);
917
+ var Directives = (__webpack_require__(13).Directives);
918
+ var directives_core = new Directives(/\/\*/, /\*\//);
919
+ var lineBreak = /\r\n|[\r\n]/;
920
+ var allLineBreaks = /\r\n|[\r\n]/g;
921
+ // tokenizer
922
+ var whitespaceChar = /\s/;
923
+ var whitespacePattern = /(?:\s|\n)+/g;
924
+ var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g;
925
+ var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g;
926
+ function Beautifier(source_text, options) {
927
+ this._source_text = source_text || '';
928
+ // Allow the setting of language/file-type specific options
929
+ // with inheritance of overall settings
930
+ this._options = new Options(options);
931
+ this._ch = null;
932
+ this._input = null;
933
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule
934
+ this.NESTED_AT_RULE = {
935
+ "page": true,
936
+ "font-face": true,
937
+ "keyframes": true,
938
+ // also in CONDITIONAL_GROUP_RULE below
939
+ "media": true,
940
+ "supports": true,
941
+ "document": true
942
+ };
943
+ this.CONDITIONAL_GROUP_RULE = {
944
+ "media": true,
945
+ "supports": true,
946
+ "document": true
947
+ };
948
+ this.NON_SEMICOLON_NEWLINE_PROPERTY = [
949
+ "grid-template-areas",
950
+ "grid-template"
951
+ ];
952
+ }
953
+ Beautifier.prototype.eatString = function (endChars) {
954
+ var result = '';
955
+ this._ch = this._input.next();
956
+ while (this._ch) {
957
+ result += this._ch;
958
+ if (this._ch === "\\") {
959
+ result += this._input.next();
960
+ }
961
+ else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") {
962
+ break;
963
+ }
964
+ this._ch = this._input.next();
965
+ }
966
+ return result;
967
+ };
968
+ // Skips any white space in the source text from the current position.
969
+ // When allowAtLeastOneNewLine is true, will output new lines for each
970
+ // newline character found; if the user has preserve_newlines off, only
971
+ // the first newline will be output
972
+ Beautifier.prototype.eatWhitespace = function (allowAtLeastOneNewLine) {
973
+ var result = whitespaceChar.test(this._input.peek());
974
+ var newline_count = 0;
975
+ while (whitespaceChar.test(this._input.peek())) {
976
+ this._ch = this._input.next();
977
+ if (allowAtLeastOneNewLine && this._ch === '\n') {
978
+ if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {
979
+ newline_count++;
980
+ this._output.add_new_line(true);
981
+ }
982
+ }
983
+ }
984
+ return result;
985
+ };
986
+ // Nested pseudo-class if we are insideRule
987
+ // and the next special character found opens
988
+ // a new block
989
+ Beautifier.prototype.foundNestedPseudoClass = function () {
990
+ var openParen = 0;
991
+ var i = 1;
992
+ var ch = this._input.peek(i);
993
+ while (ch) {
994
+ if (ch === "{") {
995
+ return true;
996
+ }
997
+ else if (ch === '(') {
998
+ // pseudoclasses can contain ()
999
+ openParen += 1;
1000
+ }
1001
+ else if (ch === ')') {
1002
+ if (openParen === 0) {
1003
+ return false;
1004
+ }
1005
+ openParen -= 1;
1006
+ }
1007
+ else if (ch === ";" || ch === "}") {
1008
+ return false;
1009
+ }
1010
+ i++;
1011
+ ch = this._input.peek(i);
1012
+ }
1013
+ return false;
1014
+ };
1015
+ Beautifier.prototype.print_string = function (output_string) {
1016
+ this._output.set_indent(this._indentLevel);
1017
+ this._output.non_breaking_space = true;
1018
+ this._output.add_token(output_string);
1019
+ };
1020
+ Beautifier.prototype.preserveSingleSpace = function (isAfterSpace) {
1021
+ if (isAfterSpace) {
1022
+ this._output.space_before_token = true;
1023
+ }
1024
+ };
1025
+ Beautifier.prototype.indent = function () {
1026
+ this._indentLevel++;
1027
+ };
1028
+ Beautifier.prototype.outdent = function () {
1029
+ if (this._indentLevel > 0) {
1030
+ this._indentLevel--;
1031
+ }
1032
+ };
1033
+ /*_____________________--------------------_____________________*/
1034
+ Beautifier.prototype.beautify = function () {
1035
+ if (this._options.disabled) {
1036
+ return this._source_text;
1037
+ }
1038
+ var source_text = this._source_text;
1039
+ var eol = this._options.eol;
1040
+ if (eol === 'auto') {
1041
+ eol = '\n';
1042
+ if (source_text && lineBreak.test(source_text || '')) {
1043
+ eol = source_text.match(lineBreak)[0];
1044
+ }
1045
+ }
1046
+ // HACK: newline parsing inconsistent. This brute force normalizes the this._input.
1047
+ source_text = source_text.replace(allLineBreaks, '\n');
1048
+ // reset
1049
+ var baseIndentString = source_text.match(/^[\t ]*/)[0];
1050
+ this._output = new Output(this._options, baseIndentString);
1051
+ this._input = new InputScanner(source_text);
1052
+ this._indentLevel = 0;
1053
+ this._nestedLevel = 0;
1054
+ this._ch = null;
1055
+ var parenLevel = 0;
1056
+ var insideRule = false;
1057
+ // This is the value side of a property value pair (blue in the following ex)
1058
+ // label { content: blue }
1059
+ var insidePropertyValue = false;
1060
+ var enteringConditionalGroup = false;
1061
+ var insideNonNestedAtRule = false;
1062
+ var insideScssMap = false;
1063
+ var topCharacter = this._ch;
1064
+ var insideNonSemiColonValues = false;
1065
+ var whitespace;
1066
+ var isAfterSpace;
1067
+ var previous_ch;
1068
+ while (true) {
1069
+ whitespace = this._input.read(whitespacePattern);
1070
+ isAfterSpace = whitespace !== '';
1071
+ previous_ch = topCharacter;
1072
+ this._ch = this._input.next();
1073
+ if (this._ch === '\\' && this._input.hasNext()) {
1074
+ this._ch += this._input.next();
1075
+ }
1076
+ topCharacter = this._ch;
1077
+ if (!this._ch) {
1078
+ break;
1079
+ }
1080
+ else if (this._ch === '/' && this._input.peek() === '*') {
1081
+ // /* css comment */
1082
+ // Always start block comments on a new line.
1083
+ // This handles scenarios where a block comment immediately
1084
+ // follows a property definition on the same line or where
1085
+ // minified code is being beautified.
1086
+ this._output.add_new_line();
1087
+ this._input.back();
1088
+ var comment = this._input.read(block_comment_pattern);
1089
+ // Handle ignore directive
1090
+ var directives = directives_core.get_directives(comment);
1091
+ if (directives && directives.ignore === 'start') {
1092
+ comment += directives_core.readIgnored(this._input);
1093
+ }
1094
+ this.print_string(comment);
1095
+ // Ensures any new lines following the comment are preserved
1096
+ this.eatWhitespace(true);
1097
+ // Block comments are followed by a new line so they don't
1098
+ // share a line with other properties
1099
+ this._output.add_new_line();
1100
+ }
1101
+ else if (this._ch === '/' && this._input.peek() === '/') {
1102
+ // // single line comment
1103
+ // Preserves the space before a comment
1104
+ // on the same line as a rule
1105
+ this._output.space_before_token = true;
1106
+ this._input.back();
1107
+ this.print_string(this._input.read(comment_pattern));
1108
+ // Ensures any new lines following the comment are preserved
1109
+ this.eatWhitespace(true);
1110
+ }
1111
+ else if (this._ch === '$') {
1112
+ this.preserveSingleSpace(isAfterSpace);
1113
+ this.print_string(this._ch);
1114
+ // strip trailing space, if present, for hash property checks
1115
+ var variable = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
1116
+ if (variable.match(/[ :]$/)) {
1117
+ // we have a variable or pseudo-class, add it and insert one space before continuing
1118
+ variable = this.eatString(": ").replace(/\s+$/, '');
1119
+ this.print_string(variable);
1120
+ this._output.space_before_token = true;
1121
+ }
1122
+ // might be sass variable
1123
+ if (parenLevel === 0 && variable.indexOf(':') !== -1) {
1124
+ insidePropertyValue = true;
1125
+ this.indent();
1126
+ }
1127
+ }
1128
+ else if (this._ch === '@') {
1129
+ this.preserveSingleSpace(isAfterSpace);
1130
+ // deal with less property mixins @{...}
1131
+ if (this._input.peek() === '{') {
1132
+ this.print_string(this._ch + this.eatString('}'));
1133
+ }
1134
+ else {
1135
+ this.print_string(this._ch);
1136
+ // strip trailing space, if present, for hash property checks
1137
+ var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
1138
+ if (variableOrRule.match(/[ :]$/)) {
1139
+ // we have a variable or pseudo-class, add it and insert one space before continuing
1140
+ variableOrRule = this.eatString(": ").replace(/\s+$/, '');
1141
+ this.print_string(variableOrRule);
1142
+ this._output.space_before_token = true;
1143
+ }
1144
+ // might be less variable
1145
+ if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {
1146
+ insidePropertyValue = true;
1147
+ this.indent();
1148
+ // might be a nesting at-rule
1149
+ }
1150
+ else if (variableOrRule in this.NESTED_AT_RULE) {
1151
+ this._nestedLevel += 1;
1152
+ if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {
1153
+ enteringConditionalGroup = true;
1154
+ }
1155
+ // might be a non-nested at-rule
1156
+ }
1157
+ else if (parenLevel === 0 && !insidePropertyValue) {
1158
+ insideNonNestedAtRule = true;
1159
+ }
1160
+ }
1161
+ }
1162
+ else if (this._ch === '#' && this._input.peek() === '{') {
1163
+ this.preserveSingleSpace(isAfterSpace);
1164
+ this.print_string(this._ch + this.eatString('}'));
1165
+ }
1166
+ else if (this._ch === '{') {
1167
+ if (insidePropertyValue) {
1168
+ insidePropertyValue = false;
1169
+ this.outdent();
1170
+ }
1171
+ // non nested at rule becomes nested
1172
+ insideNonNestedAtRule = false;
1173
+ // when entering conditional groups, only rulesets are allowed
1174
+ if (enteringConditionalGroup) {
1175
+ enteringConditionalGroup = false;
1176
+ insideRule = (this._indentLevel >= this._nestedLevel);
1177
+ }
1178
+ else {
1179
+ // otherwise, declarations are also allowed
1180
+ insideRule = (this._indentLevel >= this._nestedLevel - 1);
1181
+ }
1182
+ if (this._options.newline_between_rules && insideRule) {
1183
+ if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {
1184
+ this._output.ensure_empty_line_above('/', ',');
1185
+ }
1186
+ }
1187
+ this._output.space_before_token = true;
1188
+ // The difference in print_string and indent order is necessary to indent the '{' correctly
1189
+ if (this._options.brace_style === 'expand') {
1190
+ this._output.add_new_line();
1191
+ this.print_string(this._ch);
1192
+ this.indent();
1193
+ this._output.set_indent(this._indentLevel);
1194
+ }
1195
+ else {
1196
+ // inside mixin and first param is object
1197
+ if (previous_ch === '(') {
1198
+ this._output.space_before_token = false;
1199
+ }
1200
+ else if (previous_ch !== ',') {
1201
+ this.indent();
1202
+ }
1203
+ this.print_string(this._ch);
1204
+ }
1205
+ this.eatWhitespace(true);
1206
+ this._output.add_new_line();
1207
+ }
1208
+ else if (this._ch === '}') {
1209
+ this.outdent();
1210
+ this._output.add_new_line();
1211
+ if (previous_ch === '{') {
1212
+ this._output.trim(true);
1213
+ }
1214
+ if (insidePropertyValue) {
1215
+ this.outdent();
1216
+ insidePropertyValue = false;
1217
+ }
1218
+ this.print_string(this._ch);
1219
+ insideRule = false;
1220
+ if (this._nestedLevel) {
1221
+ this._nestedLevel--;
1222
+ }
1223
+ this.eatWhitespace(true);
1224
+ this._output.add_new_line();
1225
+ if (this._options.newline_between_rules && !this._output.just_added_blankline()) {
1226
+ if (this._input.peek() !== '}') {
1227
+ this._output.add_new_line(true);
1228
+ }
1229
+ }
1230
+ if (this._input.peek() === ')') {
1231
+ this._output.trim(true);
1232
+ if (this._options.brace_style === "expand") {
1233
+ this._output.add_new_line(true);
1234
+ }
1235
+ }
1236
+ }
1237
+ else if (this._ch === ":") {
1238
+ for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) {
1239
+ if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) {
1240
+ insideNonSemiColonValues = true;
1241
+ break;
1242
+ }
1243
+ }
1244
+ if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideNonNestedAtRule && parenLevel === 0) {
1245
+ // 'property: value' delimiter
1246
+ // which could be in a conditional group query
1247
+ this.print_string(':');
1248
+ if (!insidePropertyValue) {
1249
+ insidePropertyValue = true;
1250
+ this._output.space_before_token = true;
1251
+ this.eatWhitespace(true);
1252
+ this.indent();
1253
+ }
1254
+ }
1255
+ else {
1256
+ // sass/less parent reference don't use a space
1257
+ // sass nested pseudo-class don't use a space
1258
+ // preserve space before pseudoclasses/pseudoelements, as it means "in any child"
1259
+ if (this._input.lookBack(" ")) {
1260
+ this._output.space_before_token = true;
1261
+ }
1262
+ if (this._input.peek() === ":") {
1263
+ // pseudo-element
1264
+ this._ch = this._input.next();
1265
+ this.print_string("::");
1266
+ }
1267
+ else {
1268
+ // pseudo-class
1269
+ this.print_string(':');
1270
+ }
1271
+ }
1272
+ }
1273
+ else if (this._ch === '"' || this._ch === '\'') {
1274
+ var preserveQuoteSpace = previous_ch === '"' || previous_ch === '\'';
1275
+ this.preserveSingleSpace(preserveQuoteSpace || isAfterSpace);
1276
+ this.print_string(this._ch + this.eatString(this._ch));
1277
+ this.eatWhitespace(true);
1278
+ }
1279
+ else if (this._ch === ';') {
1280
+ insideNonSemiColonValues = false;
1281
+ if (parenLevel === 0) {
1282
+ if (insidePropertyValue) {
1283
+ this.outdent();
1284
+ insidePropertyValue = false;
1285
+ }
1286
+ insideNonNestedAtRule = false;
1287
+ this.print_string(this._ch);
1288
+ this.eatWhitespace(true);
1289
+ // This maintains single line comments on the same
1290
+ // line. Block comments are also affected, but
1291
+ // a new line is always output before one inside
1292
+ // that section
1293
+ if (this._input.peek() !== '/') {
1294
+ this._output.add_new_line();
1295
+ }
1296
+ }
1297
+ else {
1298
+ this.print_string(this._ch);
1299
+ this.eatWhitespace(true);
1300
+ this._output.space_before_token = true;
1301
+ }
1302
+ }
1303
+ else if (this._ch === '(') { // may be a url
1304
+ if (this._input.lookBack("url")) {
1305
+ this.print_string(this._ch);
1306
+ this.eatWhitespace();
1307
+ parenLevel++;
1308
+ this.indent();
1309
+ this._ch = this._input.next();
1310
+ if (this._ch === ')' || this._ch === '"' || this._ch === '\'') {
1311
+ this._input.back();
1312
+ }
1313
+ else if (this._ch) {
1314
+ this.print_string(this._ch + this.eatString(')'));
1315
+ if (parenLevel) {
1316
+ parenLevel--;
1317
+ this.outdent();
1318
+ }
1319
+ }
1320
+ }
1321
+ else {
1322
+ var space_needed = false;
1323
+ if (this._input.lookBack("with")) {
1324
+ // look back is not an accurate solution, we need tokens to confirm without whitespaces
1325
+ space_needed = true;
1326
+ }
1327
+ this.preserveSingleSpace(isAfterSpace || space_needed);
1328
+ this.print_string(this._ch);
1329
+ // handle scss/sass map
1330
+ if (insidePropertyValue && previous_ch === "$" && this._options.selector_separator_newline) {
1331
+ this._output.add_new_line();
1332
+ insideScssMap = true;
1333
+ }
1334
+ else {
1335
+ this.eatWhitespace();
1336
+ parenLevel++;
1337
+ this.indent();
1338
+ }
1339
+ }
1340
+ }
1341
+ else if (this._ch === ')') {
1342
+ if (parenLevel) {
1343
+ parenLevel--;
1344
+ this.outdent();
1345
+ }
1346
+ if (insideScssMap && this._input.peek() === ";" && this._options.selector_separator_newline) {
1347
+ insideScssMap = false;
1348
+ this.outdent();
1349
+ this._output.add_new_line();
1350
+ }
1351
+ this.print_string(this._ch);
1352
+ }
1353
+ else if (this._ch === ',') {
1354
+ this.print_string(this._ch);
1355
+ this.eatWhitespace(true);
1356
+ if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideNonNestedAtRule) {
1357
+ this._output.add_new_line();
1358
+ }
1359
+ else {
1360
+ this._output.space_before_token = true;
1361
+ }
1362
+ }
1363
+ else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel === 0) {
1364
+ //handle combinator spacing
1365
+ if (this._options.space_around_combinator) {
1366
+ this._output.space_before_token = true;
1367
+ this.print_string(this._ch);
1368
+ this._output.space_before_token = true;
1369
+ }
1370
+ else {
1371
+ this.print_string(this._ch);
1372
+ this.eatWhitespace();
1373
+ // squash extra whitespace
1374
+ if (this._ch && whitespaceChar.test(this._ch)) {
1375
+ this._ch = '';
1376
+ }
1377
+ }
1378
+ }
1379
+ else if (this._ch === ']') {
1380
+ this.print_string(this._ch);
1381
+ }
1382
+ else if (this._ch === '[') {
1383
+ this.preserveSingleSpace(isAfterSpace);
1384
+ this.print_string(this._ch);
1385
+ }
1386
+ else if (this._ch === '=') { // no whitespace before or after
1387
+ this.eatWhitespace();
1388
+ this.print_string('=');
1389
+ if (whitespaceChar.test(this._ch)) {
1390
+ this._ch = '';
1391
+ }
1392
+ }
1393
+ else if (this._ch === '!' && !this._input.lookBack("\\")) { // !important
1394
+ this._output.space_before_token = true;
1395
+ this.print_string(this._ch);
1396
+ }
1397
+ else {
1398
+ var preserveAfterSpace = previous_ch === '"' || previous_ch === '\'';
1399
+ this.preserveSingleSpace(preserveAfterSpace || isAfterSpace);
1400
+ this.print_string(this._ch);
1401
+ if (!this._output.just_added_newline() && this._input.peek() === '\n' && insideNonSemiColonValues) {
1402
+ this._output.add_new_line();
1403
+ }
1404
+ }
1405
+ }
1406
+ var sweetCode = this._output.get_code(eol);
1407
+ return sweetCode;
1408
+ };
1409
+ module.exports.Beautifier = Beautifier;
1410
+ /***/
1411
+ }),
1412
+ /* 17 */
1413
+ /***/ (function (module, __unused_webpack_exports, __webpack_require__) {
1414
+ /*jshint node:true */
1415
+ /*
1416
+
1417
+ The MIT License (MIT)
1418
+
1419
+ Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
1420
+
1421
+ Permission is hereby granted, free of charge, to any person
1422
+ obtaining a copy of this software and associated documentation files
1423
+ (the "Software"), to deal in the Software without restriction,
1424
+ including without limitation the rights to use, copy, modify, merge,
1425
+ publish, distribute, sublicense, and/or sell copies of the Software,
1426
+ and to permit persons to whom the Software is furnished to do so,
1427
+ subject to the following conditions:
1428
+
1429
+ The above copyright notice and this permission notice shall be
1430
+ included in all copies or substantial portions of the Software.
1431
+
1432
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1433
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1434
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1435
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
1436
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1437
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1438
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1439
+ SOFTWARE.
1440
+ */
1441
+ var BaseOptions = (__webpack_require__(6).Options);
1442
+ function Options(options) {
1443
+ BaseOptions.call(this, options, 'css');
1444
+ this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);
1445
+ this.newline_between_rules = this._get_boolean('newline_between_rules', true);
1446
+ var space_around_selector_separator = this._get_boolean('space_around_selector_separator');
1447
+ this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;
1448
+ var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);
1449
+ this.brace_style = 'collapse';
1450
+ for (var bs = 0; bs < brace_style_split.length; bs++) {
1451
+ if (brace_style_split[bs] !== 'expand') {
1452
+ // default to collapse, as only collapse|expand is implemented for now
1453
+ this.brace_style = 'collapse';
1454
+ }
1455
+ else {
1456
+ this.brace_style = brace_style_split[bs];
1457
+ }
1458
+ }
1459
+ }
1460
+ Options.prototype = new BaseOptions();
1461
+ module.exports.Options = Options;
1462
+ /***/
1463
+ })
1464
+ /******/
1465
+ ]);
1466
+ /************************************************************************/
1467
+ /******/ // The module cache
1468
+ /******/ var __webpack_module_cache__ = {};
1469
+ /******/
1470
+ /******/ // The require function
1471
+ /******/ function __webpack_require__(moduleId) {
1472
+ /******/ // Check if module is in cache
1473
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
1474
+ /******/ if (cachedModule !== undefined) {
1475
+ /******/ return cachedModule.exports;
1476
+ /******/ }
1477
+ /******/ // Create a new module (and put it into the cache)
1478
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1479
+ /******/ // no module.id needed
1480
+ /******/ // no module.loaded needed
1481
+ /******/ exports: {}
1482
+ /******/
1483
+ };
1484
+ /******/
1485
+ /******/ // Execute the module function
1486
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1487
+ /******/
1488
+ /******/ // Return the exports of the module
1489
+ /******/ return module.exports;
1490
+ /******/
1561
1491
  }
1562
- }
1563
-
1564
- var sweetCode = this._output.get_code(eol);
1565
-
1566
- return sweetCode;
1567
- };
1568
-
1569
- module.exports.Beautifier = Beautifier;
1570
-
1571
-
1572
- /***/ }),
1573
- /* 17 */
1574
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1575
-
1576
- /*jshint node:true */
1577
- /*
1578
-
1579
- The MIT License (MIT)
1580
-
1581
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
1582
-
1583
- Permission is hereby granted, free of charge, to any person
1584
- obtaining a copy of this software and associated documentation files
1585
- (the "Software"), to deal in the Software without restriction,
1586
- including without limitation the rights to use, copy, modify, merge,
1587
- publish, distribute, sublicense, and/or sell copies of the Software,
1588
- and to permit persons to whom the Software is furnished to do so,
1589
- subject to the following conditions:
1590
-
1591
- The above copyright notice and this permission notice shall be
1592
- included in all copies or substantial portions of the Software.
1593
-
1594
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1595
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1596
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1597
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
1598
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1599
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1600
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1601
- SOFTWARE.
1602
- */
1603
-
1604
-
1605
-
1606
- var BaseOptions = (__webpack_require__(6).Options);
1607
-
1608
- function Options(options) {
1609
- BaseOptions.call(this, options, 'css');
1610
-
1611
- this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);
1612
- this.newline_between_rules = this._get_boolean('newline_between_rules', true);
1613
- var space_around_selector_separator = this._get_boolean('space_around_selector_separator');
1614
- this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;
1615
-
1616
- var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);
1617
- this.brace_style = 'collapse';
1618
- for (var bs = 0; bs < brace_style_split.length; bs++) {
1619
- if (brace_style_split[bs] !== 'expand') {
1620
- // default to collapse, as only collapse|expand is implemented for now
1621
- this.brace_style = 'collapse';
1622
- } else {
1623
- this.brace_style = brace_style_split[bs];
1624
- }
1625
- }
1626
- }
1627
- Options.prototype = new BaseOptions();
1628
-
1629
-
1630
-
1631
- module.exports.Options = Options;
1632
-
1633
-
1634
- /***/ })
1635
- /******/ ]);
1636
- /************************************************************************/
1637
- /******/ // The module cache
1638
- /******/ var __webpack_module_cache__ = {};
1639
- /******/
1640
- /******/ // The require function
1641
- /******/ function __webpack_require__(moduleId) {
1642
- /******/ // Check if module is in cache
1643
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
1644
- /******/ if (cachedModule !== undefined) {
1645
- /******/ return cachedModule.exports;
1646
- /******/ }
1647
- /******/ // Create a new module (and put it into the cache)
1648
- /******/ var module = __webpack_module_cache__[moduleId] = {
1649
- /******/ // no module.id needed
1650
- /******/ // no module.loaded needed
1651
- /******/ exports: {}
1652
- /******/ };
1653
- /******/
1654
- /******/ // Execute the module function
1655
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1656
- /******/
1657
- /******/ // Return the exports of the module
1658
- /******/ return module.exports;
1659
- /******/ }
1660
- /******/
1661
- /************************************************************************/
1662
- /******/
1663
- /******/ // startup
1664
- /******/ // Load entry module and return exports
1665
- /******/ // This entry module is referenced by other modules so it can't be inlined
1666
- /******/ var __webpack_exports__ = __webpack_require__(15);
1667
- /******/ legacy_beautify_css = __webpack_exports__;
1668
- /******/
1669
- /******/ })()
1670
- ;
1671
-
1672
- export var css_beautify = legacy_beautify_css;
1492
+ /******/
1493
+ /************************************************************************/
1494
+ /******/
1495
+ /******/ // startup
1496
+ /******/ // Load entry module and return exports
1497
+ /******/ // This entry module is referenced by other modules so it can't be inlined
1498
+ /******/ var __webpack_exports__ = __webpack_require__(15);
1499
+ /******/ legacy_beautify_css = __webpack_exports__;
1500
+ /******/
1501
+ /******/
1502
+ })();
1503
+ export var css_beautify = legacy_beautify_css;