@angelscmf/front 1.0.31 → 1.0.32

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.
@@ -1,9 +1,28 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
7
26
  var __async = (__this, __arguments, generator) => {
8
27
  return new Promise((resolve, reject) => {
9
28
  var fulfilled = (value) => {
@@ -25,6 +44,4248 @@ var __async = (__this, __arguments, generator) => {
25
44
  });
26
45
  };
27
46
 
47
+ // node_modules/js-beautify/js/src/core/output.js
48
+ var require_output = __commonJS({
49
+ "node_modules/js-beautify/js/src/core/output.js"(exports, module) {
50
+ "use strict";
51
+ function OutputLine(parent) {
52
+ this.__parent = parent;
53
+ this.__character_count = 0;
54
+ this.__indent_count = -1;
55
+ this.__alignment_count = 0;
56
+ this.__wrap_point_index = 0;
57
+ this.__wrap_point_character_count = 0;
58
+ this.__wrap_point_indent_count = -1;
59
+ this.__wrap_point_alignment_count = 0;
60
+ this.__items = [];
61
+ }
62
+ OutputLine.prototype.clone_empty = function() {
63
+ var line = new OutputLine(this.__parent);
64
+ line.set_indent(this.__indent_count, this.__alignment_count);
65
+ return line;
66
+ };
67
+ OutputLine.prototype.item = function(index) {
68
+ if (index < 0) {
69
+ return this.__items[this.__items.length + index];
70
+ } else {
71
+ return this.__items[index];
72
+ }
73
+ };
74
+ OutputLine.prototype.has_match = function(pattern) {
75
+ for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
76
+ if (this.__items[lastCheckedOutput].match(pattern)) {
77
+ return true;
78
+ }
79
+ }
80
+ return false;
81
+ };
82
+ OutputLine.prototype.set_indent = function(indent, alignment) {
83
+ if (this.is_empty()) {
84
+ this.__indent_count = indent || 0;
85
+ this.__alignment_count = alignment || 0;
86
+ this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);
87
+ }
88
+ };
89
+ OutputLine.prototype._set_wrap_point = function() {
90
+ if (this.__parent.wrap_line_length) {
91
+ this.__wrap_point_index = this.__items.length;
92
+ this.__wrap_point_character_count = this.__character_count;
93
+ this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;
94
+ this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;
95
+ }
96
+ };
97
+ OutputLine.prototype._should_wrap = function() {
98
+ return this.__wrap_point_index && this.__character_count > this.__parent.wrap_line_length && this.__wrap_point_character_count > this.__parent.next_line.__character_count;
99
+ };
100
+ OutputLine.prototype._allow_wrap = function() {
101
+ if (this._should_wrap()) {
102
+ this.__parent.add_new_line();
103
+ var next = this.__parent.current_line;
104
+ next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);
105
+ next.__items = this.__items.slice(this.__wrap_point_index);
106
+ this.__items = this.__items.slice(0, this.__wrap_point_index);
107
+ next.__character_count += this.__character_count - this.__wrap_point_character_count;
108
+ this.__character_count = this.__wrap_point_character_count;
109
+ if (next.__items[0] === " ") {
110
+ next.__items.splice(0, 1);
111
+ next.__character_count -= 1;
112
+ }
113
+ return true;
114
+ }
115
+ return false;
116
+ };
117
+ OutputLine.prototype.is_empty = function() {
118
+ return this.__items.length === 0;
119
+ };
120
+ OutputLine.prototype.last = function() {
121
+ if (!this.is_empty()) {
122
+ return this.__items[this.__items.length - 1];
123
+ } else {
124
+ return null;
125
+ }
126
+ };
127
+ OutputLine.prototype.push = function(item) {
128
+ this.__items.push(item);
129
+ var last_newline_index = item.lastIndexOf("\n");
130
+ if (last_newline_index !== -1) {
131
+ this.__character_count = item.length - last_newline_index;
132
+ } else {
133
+ this.__character_count += item.length;
134
+ }
135
+ };
136
+ OutputLine.prototype.pop = function() {
137
+ var item = null;
138
+ if (!this.is_empty()) {
139
+ item = this.__items.pop();
140
+ this.__character_count -= item.length;
141
+ }
142
+ return item;
143
+ };
144
+ OutputLine.prototype._remove_indent = function() {
145
+ if (this.__indent_count > 0) {
146
+ this.__indent_count -= 1;
147
+ this.__character_count -= this.__parent.indent_size;
148
+ }
149
+ };
150
+ OutputLine.prototype._remove_wrap_indent = function() {
151
+ if (this.__wrap_point_indent_count > 0) {
152
+ this.__wrap_point_indent_count -= 1;
153
+ }
154
+ };
155
+ OutputLine.prototype.trim = function() {
156
+ while (this.last() === " ") {
157
+ this.__items.pop();
158
+ this.__character_count -= 1;
159
+ }
160
+ };
161
+ OutputLine.prototype.toString = function() {
162
+ var result = "";
163
+ if (this.is_empty()) {
164
+ if (this.__parent.indent_empty_lines) {
165
+ result = this.__parent.get_indent_string(this.__indent_count);
166
+ }
167
+ } else {
168
+ result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);
169
+ result += this.__items.join("");
170
+ }
171
+ return result;
172
+ };
173
+ function IndentStringCache(options, baseIndentString) {
174
+ this.__cache = [""];
175
+ this.__indent_size = options.indent_size;
176
+ this.__indent_string = options.indent_char;
177
+ if (!options.indent_with_tabs) {
178
+ this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);
179
+ }
180
+ baseIndentString = baseIndentString || "";
181
+ if (options.indent_level > 0) {
182
+ baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);
183
+ }
184
+ this.__base_string = baseIndentString;
185
+ this.__base_string_length = baseIndentString.length;
186
+ }
187
+ IndentStringCache.prototype.get_indent_size = function(indent, column) {
188
+ var result = this.__base_string_length;
189
+ column = column || 0;
190
+ if (indent < 0) {
191
+ result = 0;
192
+ }
193
+ result += indent * this.__indent_size;
194
+ result += column;
195
+ return result;
196
+ };
197
+ IndentStringCache.prototype.get_indent_string = function(indent_level, column) {
198
+ var result = this.__base_string;
199
+ column = column || 0;
200
+ if (indent_level < 0) {
201
+ indent_level = 0;
202
+ result = "";
203
+ }
204
+ column += indent_level * this.__indent_size;
205
+ this.__ensure_cache(column);
206
+ result += this.__cache[column];
207
+ return result;
208
+ };
209
+ IndentStringCache.prototype.__ensure_cache = function(column) {
210
+ while (column >= this.__cache.length) {
211
+ this.__add_column();
212
+ }
213
+ };
214
+ IndentStringCache.prototype.__add_column = function() {
215
+ var column = this.__cache.length;
216
+ var indent = 0;
217
+ var result = "";
218
+ if (this.__indent_size && column >= this.__indent_size) {
219
+ indent = Math.floor(column / this.__indent_size);
220
+ column -= indent * this.__indent_size;
221
+ result = new Array(indent + 1).join(this.__indent_string);
222
+ }
223
+ if (column) {
224
+ result += new Array(column + 1).join(" ");
225
+ }
226
+ this.__cache.push(result);
227
+ };
228
+ function Output(options, baseIndentString) {
229
+ this.__indent_cache = new IndentStringCache(options, baseIndentString);
230
+ this.raw = false;
231
+ this._end_with_newline = options.end_with_newline;
232
+ this.indent_size = options.indent_size;
233
+ this.wrap_line_length = options.wrap_line_length;
234
+ this.indent_empty_lines = options.indent_empty_lines;
235
+ this.__lines = [];
236
+ this.previous_line = null;
237
+ this.current_line = null;
238
+ this.next_line = new OutputLine(this);
239
+ this.space_before_token = false;
240
+ this.non_breaking_space = false;
241
+ this.previous_token_wrapped = false;
242
+ this.__add_outputline();
243
+ }
244
+ Output.prototype.__add_outputline = function() {
245
+ this.previous_line = this.current_line;
246
+ this.current_line = this.next_line.clone_empty();
247
+ this.__lines.push(this.current_line);
248
+ };
249
+ Output.prototype.get_line_number = function() {
250
+ return this.__lines.length;
251
+ };
252
+ Output.prototype.get_indent_string = function(indent, column) {
253
+ return this.__indent_cache.get_indent_string(indent, column);
254
+ };
255
+ Output.prototype.get_indent_size = function(indent, column) {
256
+ return this.__indent_cache.get_indent_size(indent, column);
257
+ };
258
+ Output.prototype.is_empty = function() {
259
+ return !this.previous_line && this.current_line.is_empty();
260
+ };
261
+ Output.prototype.add_new_line = function(force_newline) {
262
+ if (this.is_empty() || !force_newline && this.just_added_newline()) {
263
+ return false;
264
+ }
265
+ if (!this.raw) {
266
+ this.__add_outputline();
267
+ }
268
+ return true;
269
+ };
270
+ Output.prototype.get_code = function(eol) {
271
+ this.trim(true);
272
+ var last_item = this.current_line.pop();
273
+ if (last_item) {
274
+ if (last_item[last_item.length - 1] === "\n") {
275
+ last_item = last_item.replace(/\n+$/g, "");
276
+ }
277
+ this.current_line.push(last_item);
278
+ }
279
+ if (this._end_with_newline) {
280
+ this.__add_outputline();
281
+ }
282
+ var sweet_code = this.__lines.join("\n");
283
+ if (eol !== "\n") {
284
+ sweet_code = sweet_code.replace(/[\n]/g, eol);
285
+ }
286
+ return sweet_code;
287
+ };
288
+ Output.prototype.set_wrap_point = function() {
289
+ this.current_line._set_wrap_point();
290
+ };
291
+ Output.prototype.set_indent = function(indent, alignment) {
292
+ indent = indent || 0;
293
+ alignment = alignment || 0;
294
+ this.next_line.set_indent(indent, alignment);
295
+ if (this.__lines.length > 1) {
296
+ this.current_line.set_indent(indent, alignment);
297
+ return true;
298
+ }
299
+ this.current_line.set_indent();
300
+ return false;
301
+ };
302
+ Output.prototype.add_raw_token = function(token) {
303
+ for (var x = 0; x < token.newlines; x++) {
304
+ this.__add_outputline();
305
+ }
306
+ this.current_line.set_indent(-1);
307
+ this.current_line.push(token.whitespace_before);
308
+ this.current_line.push(token.text);
309
+ this.space_before_token = false;
310
+ this.non_breaking_space = false;
311
+ this.previous_token_wrapped = false;
312
+ };
313
+ Output.prototype.add_token = function(printable_token) {
314
+ this.__add_space_before_token();
315
+ this.current_line.push(printable_token);
316
+ this.space_before_token = false;
317
+ this.non_breaking_space = false;
318
+ this.previous_token_wrapped = this.current_line._allow_wrap();
319
+ };
320
+ Output.prototype.__add_space_before_token = function() {
321
+ if (this.space_before_token && !this.just_added_newline()) {
322
+ if (!this.non_breaking_space) {
323
+ this.set_wrap_point();
324
+ }
325
+ this.current_line.push(" ");
326
+ }
327
+ };
328
+ Output.prototype.remove_indent = function(index) {
329
+ var output_length = this.__lines.length;
330
+ while (index < output_length) {
331
+ this.__lines[index]._remove_indent();
332
+ index++;
333
+ }
334
+ this.current_line._remove_wrap_indent();
335
+ };
336
+ Output.prototype.trim = function(eat_newlines) {
337
+ eat_newlines = eat_newlines === void 0 ? false : eat_newlines;
338
+ this.current_line.trim();
339
+ while (eat_newlines && this.__lines.length > 1 && this.current_line.is_empty()) {
340
+ this.__lines.pop();
341
+ this.current_line = this.__lines[this.__lines.length - 1];
342
+ this.current_line.trim();
343
+ }
344
+ this.previous_line = this.__lines.length > 1 ? this.__lines[this.__lines.length - 2] : null;
345
+ };
346
+ Output.prototype.just_added_newline = function() {
347
+ return this.current_line.is_empty();
348
+ };
349
+ Output.prototype.just_added_blankline = function() {
350
+ return this.is_empty() || this.current_line.is_empty() && this.previous_line.is_empty();
351
+ };
352
+ Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) {
353
+ var index = this.__lines.length - 2;
354
+ while (index >= 0) {
355
+ var potentialEmptyLine = this.__lines[index];
356
+ if (potentialEmptyLine.is_empty()) {
357
+ break;
358
+ } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 && potentialEmptyLine.item(-1) !== ends_with) {
359
+ this.__lines.splice(index + 1, 0, new OutputLine(this));
360
+ this.previous_line = this.__lines[this.__lines.length - 2];
361
+ break;
362
+ }
363
+ index--;
364
+ }
365
+ };
366
+ module.exports.Output = Output;
367
+ }
368
+ });
369
+
370
+ // node_modules/js-beautify/js/src/core/token.js
371
+ var require_token = __commonJS({
372
+ "node_modules/js-beautify/js/src/core/token.js"(exports, module) {
373
+ "use strict";
374
+ function Token(type, text, newlines, whitespace_before) {
375
+ this.type = type;
376
+ this.text = text;
377
+ this.comments_before = null;
378
+ this.newlines = newlines || 0;
379
+ this.whitespace_before = whitespace_before || "";
380
+ this.parent = null;
381
+ this.next = null;
382
+ this.previous = null;
383
+ this.opened = null;
384
+ this.closed = null;
385
+ this.directives = null;
386
+ }
387
+ module.exports.Token = Token;
388
+ }
389
+ });
390
+
391
+ // node_modules/js-beautify/js/src/javascript/acorn.js
392
+ var require_acorn = __commonJS({
393
+ "node_modules/js-beautify/js/src/javascript/acorn.js"(exports) {
394
+ "use strict";
395
+ var baseASCIIidentifierStartChars = "\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a";
396
+ var baseASCIIidentifierChars = "\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a";
397
+ var nonASCIIidentifierStartChars = "\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc";
398
+ var nonASCIIidentifierChars = "\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f";
399
+ var unicodeEscapeOrCodePoint = "\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}";
400
+ var identifierStart = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])";
401
+ var identifierChars = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*";
402
+ exports.identifier = new RegExp(identifierStart + identifierChars, "g");
403
+ exports.identifierStart = new RegExp(identifierStart);
404
+ exports.identifierMatch = new RegExp("(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+");
405
+ exports.newline = /[\n\r\u2028\u2029]/;
406
+ exports.lineBreak = new RegExp("\r\n|" + exports.newline.source);
407
+ exports.allLineBreaks = new RegExp(exports.lineBreak.source, "g");
408
+ }
409
+ });
410
+
411
+ // node_modules/js-beautify/js/src/core/options.js
412
+ var require_options = __commonJS({
413
+ "node_modules/js-beautify/js/src/core/options.js"(exports, module) {
414
+ "use strict";
415
+ function Options(options, merge_child_field) {
416
+ this.raw_options = _mergeOpts(options, merge_child_field);
417
+ this.disabled = this._get_boolean("disabled");
418
+ this.eol = this._get_characters("eol", "auto");
419
+ this.end_with_newline = this._get_boolean("end_with_newline");
420
+ this.indent_size = this._get_number("indent_size", 4);
421
+ this.indent_char = this._get_characters("indent_char", " ");
422
+ this.indent_level = this._get_number("indent_level");
423
+ this.preserve_newlines = this._get_boolean("preserve_newlines", true);
424
+ this.max_preserve_newlines = this._get_number("max_preserve_newlines", 32786);
425
+ if (!this.preserve_newlines) {
426
+ this.max_preserve_newlines = 0;
427
+ }
428
+ this.indent_with_tabs = this._get_boolean("indent_with_tabs", this.indent_char === " ");
429
+ if (this.indent_with_tabs) {
430
+ this.indent_char = " ";
431
+ if (this.indent_size === 1) {
432
+ this.indent_size = 4;
433
+ }
434
+ }
435
+ this.wrap_line_length = this._get_number("wrap_line_length", this._get_number("max_char"));
436
+ this.indent_empty_lines = this._get_boolean("indent_empty_lines");
437
+ this.templating = this._get_selection_list("templating", ["auto", "none", "angular", "django", "erb", "handlebars", "php", "smarty"], ["auto"]);
438
+ }
439
+ Options.prototype._get_array = function(name, default_value) {
440
+ var option_value = this.raw_options[name];
441
+ var result = default_value || [];
442
+ if (typeof option_value === "object") {
443
+ if (option_value !== null && typeof option_value.concat === "function") {
444
+ result = option_value.concat();
445
+ }
446
+ } else if (typeof option_value === "string") {
447
+ result = option_value.split(/[^a-zA-Z0-9_\/\-]+/);
448
+ }
449
+ return result;
450
+ };
451
+ Options.prototype._get_boolean = function(name, default_value) {
452
+ var option_value = this.raw_options[name];
453
+ var result = option_value === void 0 ? !!default_value : !!option_value;
454
+ return result;
455
+ };
456
+ Options.prototype._get_characters = function(name, default_value) {
457
+ var option_value = this.raw_options[name];
458
+ var result = default_value || "";
459
+ if (typeof option_value === "string") {
460
+ result = option_value.replace(/\\r/, "\r").replace(/\\n/, "\n").replace(/\\t/, " ");
461
+ }
462
+ return result;
463
+ };
464
+ Options.prototype._get_number = function(name, default_value) {
465
+ var option_value = this.raw_options[name];
466
+ default_value = parseInt(default_value, 10);
467
+ if (isNaN(default_value)) {
468
+ default_value = 0;
469
+ }
470
+ var result = parseInt(option_value, 10);
471
+ if (isNaN(result)) {
472
+ result = default_value;
473
+ }
474
+ return result;
475
+ };
476
+ Options.prototype._get_selection = function(name, selection_list, default_value) {
477
+ var result = this._get_selection_list(name, selection_list, default_value);
478
+ if (result.length !== 1) {
479
+ throw new Error(
480
+ "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"
481
+ );
482
+ }
483
+ return result[0];
484
+ };
485
+ Options.prototype._get_selection_list = function(name, selection_list, default_value) {
486
+ if (!selection_list || selection_list.length === 0) {
487
+ throw new Error("Selection list cannot be empty.");
488
+ }
489
+ default_value = default_value || [selection_list[0]];
490
+ if (!this._is_valid_selection(default_value, selection_list)) {
491
+ throw new Error("Invalid Default Value!");
492
+ }
493
+ var result = this._get_array(name, default_value);
494
+ if (!this._is_valid_selection(result, selection_list)) {
495
+ throw new Error(
496
+ "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"
497
+ );
498
+ }
499
+ return result;
500
+ };
501
+ Options.prototype._is_valid_selection = function(result, selection_list) {
502
+ return result.length && selection_list.length && !result.some(function(item) {
503
+ return selection_list.indexOf(item) === -1;
504
+ });
505
+ };
506
+ function _mergeOpts(allOptions, childFieldName) {
507
+ var finalOpts = {};
508
+ allOptions = _normalizeOpts(allOptions);
509
+ var name;
510
+ for (name in allOptions) {
511
+ if (name !== childFieldName) {
512
+ finalOpts[name] = allOptions[name];
513
+ }
514
+ }
515
+ if (childFieldName && allOptions[childFieldName]) {
516
+ for (name in allOptions[childFieldName]) {
517
+ finalOpts[name] = allOptions[childFieldName][name];
518
+ }
519
+ }
520
+ return finalOpts;
521
+ }
522
+ function _normalizeOpts(options) {
523
+ var convertedOpts = {};
524
+ var key;
525
+ for (key in options) {
526
+ var newKey = key.replace(/-/g, "_");
527
+ convertedOpts[newKey] = options[key];
528
+ }
529
+ return convertedOpts;
530
+ }
531
+ module.exports.Options = Options;
532
+ module.exports.normalizeOpts = _normalizeOpts;
533
+ module.exports.mergeOpts = _mergeOpts;
534
+ }
535
+ });
536
+
537
+ // node_modules/js-beautify/js/src/javascript/options.js
538
+ var require_options2 = __commonJS({
539
+ "node_modules/js-beautify/js/src/javascript/options.js"(exports, module) {
540
+ "use strict";
541
+ var BaseOptions = require_options().Options;
542
+ var validPositionValues = ["before-newline", "after-newline", "preserve-newline"];
543
+ function Options(options) {
544
+ BaseOptions.call(this, options, "js");
545
+ var raw_brace_style = this.raw_options.brace_style || null;
546
+ if (raw_brace_style === "expand-strict") {
547
+ this.raw_options.brace_style = "expand";
548
+ } else if (raw_brace_style === "collapse-preserve-inline") {
549
+ this.raw_options.brace_style = "collapse,preserve-inline";
550
+ } else if (this.raw_options.braces_on_own_line !== void 0) {
551
+ this.raw_options.brace_style = this.raw_options.braces_on_own_line ? "expand" : "collapse";
552
+ }
553
+ var brace_style_split = this._get_selection_list("brace_style", ["collapse", "expand", "end-expand", "none", "preserve-inline"]);
554
+ this.brace_preserve_inline = false;
555
+ this.brace_style = "collapse";
556
+ for (var bs = 0; bs < brace_style_split.length; bs++) {
557
+ if (brace_style_split[bs] === "preserve-inline") {
558
+ this.brace_preserve_inline = true;
559
+ } else {
560
+ this.brace_style = brace_style_split[bs];
561
+ }
562
+ }
563
+ this.unindent_chained_methods = this._get_boolean("unindent_chained_methods");
564
+ this.break_chained_methods = this._get_boolean("break_chained_methods");
565
+ this.space_in_paren = this._get_boolean("space_in_paren");
566
+ this.space_in_empty_paren = this._get_boolean("space_in_empty_paren");
567
+ this.jslint_happy = this._get_boolean("jslint_happy");
568
+ this.space_after_anon_function = this._get_boolean("space_after_anon_function");
569
+ this.space_after_named_function = this._get_boolean("space_after_named_function");
570
+ this.keep_array_indentation = this._get_boolean("keep_array_indentation");
571
+ this.space_before_conditional = this._get_boolean("space_before_conditional", true);
572
+ this.unescape_strings = this._get_boolean("unescape_strings");
573
+ this.e4x = this._get_boolean("e4x");
574
+ this.comma_first = this._get_boolean("comma_first");
575
+ this.operator_position = this._get_selection("operator_position", validPositionValues);
576
+ this.test_output_raw = this._get_boolean("test_output_raw");
577
+ if (this.jslint_happy) {
578
+ this.space_after_anon_function = true;
579
+ }
580
+ }
581
+ Options.prototype = new BaseOptions();
582
+ module.exports.Options = Options;
583
+ }
584
+ });
585
+
586
+ // node_modules/js-beautify/js/src/core/inputscanner.js
587
+ var require_inputscanner = __commonJS({
588
+ "node_modules/js-beautify/js/src/core/inputscanner.js"(exports, module) {
589
+ "use strict";
590
+ var regexp_has_sticky = RegExp.prototype.hasOwnProperty("sticky");
591
+ function InputScanner(input_string) {
592
+ this.__input = input_string || "";
593
+ this.__input_length = this.__input.length;
594
+ this.__position = 0;
595
+ }
596
+ InputScanner.prototype.restart = function() {
597
+ this.__position = 0;
598
+ };
599
+ InputScanner.prototype.back = function() {
600
+ if (this.__position > 0) {
601
+ this.__position -= 1;
602
+ }
603
+ };
604
+ InputScanner.prototype.hasNext = function() {
605
+ return this.__position < this.__input_length;
606
+ };
607
+ InputScanner.prototype.next = function() {
608
+ var val = null;
609
+ if (this.hasNext()) {
610
+ val = this.__input.charAt(this.__position);
611
+ this.__position += 1;
612
+ }
613
+ return val;
614
+ };
615
+ InputScanner.prototype.peek = function(index) {
616
+ var val = null;
617
+ index = index || 0;
618
+ index += this.__position;
619
+ if (index >= 0 && index < this.__input_length) {
620
+ val = this.__input.charAt(index);
621
+ }
622
+ return val;
623
+ };
624
+ InputScanner.prototype.__match = function(pattern, index) {
625
+ pattern.lastIndex = index;
626
+ var pattern_match = pattern.exec(this.__input);
627
+ if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {
628
+ if (pattern_match.index !== index) {
629
+ pattern_match = null;
630
+ }
631
+ }
632
+ return pattern_match;
633
+ };
634
+ InputScanner.prototype.test = function(pattern, index) {
635
+ index = index || 0;
636
+ index += this.__position;
637
+ if (index >= 0 && index < this.__input_length) {
638
+ return !!this.__match(pattern, index);
639
+ } else {
640
+ return false;
641
+ }
642
+ };
643
+ InputScanner.prototype.testChar = function(pattern, index) {
644
+ var val = this.peek(index);
645
+ pattern.lastIndex = 0;
646
+ return val !== null && pattern.test(val);
647
+ };
648
+ InputScanner.prototype.match = function(pattern) {
649
+ var pattern_match = this.__match(pattern, this.__position);
650
+ if (pattern_match) {
651
+ this.__position += pattern_match[0].length;
652
+ } else {
653
+ pattern_match = null;
654
+ }
655
+ return pattern_match;
656
+ };
657
+ InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) {
658
+ var val = "";
659
+ var match;
660
+ if (starting_pattern) {
661
+ match = this.match(starting_pattern);
662
+ if (match) {
663
+ val += match[0];
664
+ }
665
+ }
666
+ if (until_pattern && (match || !starting_pattern)) {
667
+ val += this.readUntil(until_pattern, until_after);
668
+ }
669
+ return val;
670
+ };
671
+ InputScanner.prototype.readUntil = function(pattern, until_after) {
672
+ var val = "";
673
+ var match_index = this.__position;
674
+ pattern.lastIndex = this.__position;
675
+ var pattern_match = pattern.exec(this.__input);
676
+ if (pattern_match) {
677
+ match_index = pattern_match.index;
678
+ if (until_after) {
679
+ match_index += pattern_match[0].length;
680
+ }
681
+ } else {
682
+ match_index = this.__input_length;
683
+ }
684
+ val = this.__input.substring(this.__position, match_index);
685
+ this.__position = match_index;
686
+ return val;
687
+ };
688
+ InputScanner.prototype.readUntilAfter = function(pattern) {
689
+ return this.readUntil(pattern, true);
690
+ };
691
+ InputScanner.prototype.get_regexp = function(pattern, match_from) {
692
+ var result = null;
693
+ var flags = "g";
694
+ if (match_from && regexp_has_sticky) {
695
+ flags = "y";
696
+ }
697
+ if (typeof pattern === "string" && pattern !== "") {
698
+ result = new RegExp(pattern, flags);
699
+ } else if (pattern) {
700
+ result = new RegExp(pattern.source, flags);
701
+ }
702
+ return result;
703
+ };
704
+ InputScanner.prototype.get_literal_regexp = function(literal_string) {
705
+ return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
706
+ };
707
+ InputScanner.prototype.peekUntilAfter = function(pattern) {
708
+ var start = this.__position;
709
+ var val = this.readUntilAfter(pattern);
710
+ this.__position = start;
711
+ return val;
712
+ };
713
+ InputScanner.prototype.lookBack = function(testVal) {
714
+ var start = this.__position - 1;
715
+ return start >= testVal.length && this.__input.substring(start - testVal.length, start).toLowerCase() === testVal;
716
+ };
717
+ module.exports.InputScanner = InputScanner;
718
+ }
719
+ });
720
+
721
+ // node_modules/js-beautify/js/src/core/tokenstream.js
722
+ var require_tokenstream = __commonJS({
723
+ "node_modules/js-beautify/js/src/core/tokenstream.js"(exports, module) {
724
+ "use strict";
725
+ function TokenStream(parent_token) {
726
+ this.__tokens = [];
727
+ this.__tokens_length = this.__tokens.length;
728
+ this.__position = 0;
729
+ this.__parent_token = parent_token;
730
+ }
731
+ TokenStream.prototype.restart = function() {
732
+ this.__position = 0;
733
+ };
734
+ TokenStream.prototype.isEmpty = function() {
735
+ return this.__tokens_length === 0;
736
+ };
737
+ TokenStream.prototype.hasNext = function() {
738
+ return this.__position < this.__tokens_length;
739
+ };
740
+ TokenStream.prototype.next = function() {
741
+ var val = null;
742
+ if (this.hasNext()) {
743
+ val = this.__tokens[this.__position];
744
+ this.__position += 1;
745
+ }
746
+ return val;
747
+ };
748
+ TokenStream.prototype.peek = function(index) {
749
+ var val = null;
750
+ index = index || 0;
751
+ index += this.__position;
752
+ if (index >= 0 && index < this.__tokens_length) {
753
+ val = this.__tokens[index];
754
+ }
755
+ return val;
756
+ };
757
+ TokenStream.prototype.add = function(token) {
758
+ if (this.__parent_token) {
759
+ token.parent = this.__parent_token;
760
+ }
761
+ this.__tokens.push(token);
762
+ this.__tokens_length += 1;
763
+ };
764
+ module.exports.TokenStream = TokenStream;
765
+ }
766
+ });
767
+
768
+ // node_modules/js-beautify/js/src/core/pattern.js
769
+ var require_pattern = __commonJS({
770
+ "node_modules/js-beautify/js/src/core/pattern.js"(exports, module) {
771
+ "use strict";
772
+ function Pattern(input_scanner, parent) {
773
+ this._input = input_scanner;
774
+ this._starting_pattern = null;
775
+ this._match_pattern = null;
776
+ this._until_pattern = null;
777
+ this._until_after = false;
778
+ if (parent) {
779
+ this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true);
780
+ this._match_pattern = this._input.get_regexp(parent._match_pattern, true);
781
+ this._until_pattern = this._input.get_regexp(parent._until_pattern);
782
+ this._until_after = parent._until_after;
783
+ }
784
+ }
785
+ Pattern.prototype.read = function() {
786
+ var result = this._input.read(this._starting_pattern);
787
+ if (!this._starting_pattern || result) {
788
+ result += this._input.read(this._match_pattern, this._until_pattern, this._until_after);
789
+ }
790
+ return result;
791
+ };
792
+ Pattern.prototype.read_match = function() {
793
+ return this._input.match(this._match_pattern);
794
+ };
795
+ Pattern.prototype.until_after = function(pattern) {
796
+ var result = this._create();
797
+ result._until_after = true;
798
+ result._until_pattern = this._input.get_regexp(pattern);
799
+ result._update();
800
+ return result;
801
+ };
802
+ Pattern.prototype.until = function(pattern) {
803
+ var result = this._create();
804
+ result._until_after = false;
805
+ result._until_pattern = this._input.get_regexp(pattern);
806
+ result._update();
807
+ return result;
808
+ };
809
+ Pattern.prototype.starting_with = function(pattern) {
810
+ var result = this._create();
811
+ result._starting_pattern = this._input.get_regexp(pattern, true);
812
+ result._update();
813
+ return result;
814
+ };
815
+ Pattern.prototype.matching = function(pattern) {
816
+ var result = this._create();
817
+ result._match_pattern = this._input.get_regexp(pattern, true);
818
+ result._update();
819
+ return result;
820
+ };
821
+ Pattern.prototype._create = function() {
822
+ return new Pattern(this._input, this);
823
+ };
824
+ Pattern.prototype._update = function() {
825
+ };
826
+ module.exports.Pattern = Pattern;
827
+ }
828
+ });
829
+
830
+ // node_modules/js-beautify/js/src/core/whitespacepattern.js
831
+ var require_whitespacepattern = __commonJS({
832
+ "node_modules/js-beautify/js/src/core/whitespacepattern.js"(exports, module) {
833
+ "use strict";
834
+ var Pattern = require_pattern().Pattern;
835
+ function WhitespacePattern(input_scanner, parent) {
836
+ Pattern.call(this, input_scanner, parent);
837
+ if (parent) {
838
+ this._line_regexp = this._input.get_regexp(parent._line_regexp);
839
+ } else {
840
+ this.__set_whitespace_patterns("", "");
841
+ }
842
+ this.newline_count = 0;
843
+ this.whitespace_before_token = "";
844
+ }
845
+ WhitespacePattern.prototype = new Pattern();
846
+ WhitespacePattern.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) {
847
+ whitespace_chars += "\\t ";
848
+ newline_chars += "\\n\\r";
849
+ this._match_pattern = this._input.get_regexp(
850
+ "[" + whitespace_chars + newline_chars + "]+",
851
+ true
852
+ );
853
+ this._newline_regexp = this._input.get_regexp(
854
+ "\\r\\n|[" + newline_chars + "]"
855
+ );
856
+ };
857
+ WhitespacePattern.prototype.read = function() {
858
+ this.newline_count = 0;
859
+ this.whitespace_before_token = "";
860
+ var resulting_string = this._input.read(this._match_pattern);
861
+ if (resulting_string === " ") {
862
+ this.whitespace_before_token = " ";
863
+ } else if (resulting_string) {
864
+ var matches = this.__split(this._newline_regexp, resulting_string);
865
+ this.newline_count = matches.length - 1;
866
+ this.whitespace_before_token = matches[this.newline_count];
867
+ }
868
+ return resulting_string;
869
+ };
870
+ WhitespacePattern.prototype.matching = function(whitespace_chars, newline_chars) {
871
+ var result = this._create();
872
+ result.__set_whitespace_patterns(whitespace_chars, newline_chars);
873
+ result._update();
874
+ return result;
875
+ };
876
+ WhitespacePattern.prototype._create = function() {
877
+ return new WhitespacePattern(this._input, this);
878
+ };
879
+ WhitespacePattern.prototype.__split = function(regexp, input_string) {
880
+ regexp.lastIndex = 0;
881
+ var start_index = 0;
882
+ var result = [];
883
+ var next_match = regexp.exec(input_string);
884
+ while (next_match) {
885
+ result.push(input_string.substring(start_index, next_match.index));
886
+ start_index = next_match.index + next_match[0].length;
887
+ next_match = regexp.exec(input_string);
888
+ }
889
+ if (start_index < input_string.length) {
890
+ result.push(input_string.substring(start_index, input_string.length));
891
+ } else {
892
+ result.push("");
893
+ }
894
+ return result;
895
+ };
896
+ module.exports.WhitespacePattern = WhitespacePattern;
897
+ }
898
+ });
899
+
900
+ // node_modules/js-beautify/js/src/core/tokenizer.js
901
+ var require_tokenizer = __commonJS({
902
+ "node_modules/js-beautify/js/src/core/tokenizer.js"(exports, module) {
903
+ "use strict";
904
+ var InputScanner = require_inputscanner().InputScanner;
905
+ var Token = require_token().Token;
906
+ var TokenStream = require_tokenstream().TokenStream;
907
+ var WhitespacePattern = require_whitespacepattern().WhitespacePattern;
908
+ var TOKEN = {
909
+ START: "TK_START",
910
+ RAW: "TK_RAW",
911
+ EOF: "TK_EOF"
912
+ };
913
+ var Tokenizer = function(input_string, options) {
914
+ this._input = new InputScanner(input_string);
915
+ this._options = options || {};
916
+ this.__tokens = null;
917
+ this._patterns = {};
918
+ this._patterns.whitespace = new WhitespacePattern(this._input);
919
+ };
920
+ Tokenizer.prototype.tokenize = function() {
921
+ this._input.restart();
922
+ this.__tokens = new TokenStream();
923
+ this._reset();
924
+ var current;
925
+ var previous = new Token(TOKEN.START, "");
926
+ var open_token = null;
927
+ var open_stack = [];
928
+ var comments = new TokenStream();
929
+ while (previous.type !== TOKEN.EOF) {
930
+ current = this._get_next_token(previous, open_token);
931
+ while (this._is_comment(current)) {
932
+ comments.add(current);
933
+ current = this._get_next_token(previous, open_token);
934
+ }
935
+ if (!comments.isEmpty()) {
936
+ current.comments_before = comments;
937
+ comments = new TokenStream();
938
+ }
939
+ current.parent = open_token;
940
+ if (this._is_opening(current)) {
941
+ open_stack.push(open_token);
942
+ open_token = current;
943
+ } else if (open_token && this._is_closing(current, open_token)) {
944
+ current.opened = open_token;
945
+ open_token.closed = current;
946
+ open_token = open_stack.pop();
947
+ current.parent = open_token;
948
+ }
949
+ current.previous = previous;
950
+ previous.next = current;
951
+ this.__tokens.add(current);
952
+ previous = current;
953
+ }
954
+ return this.__tokens;
955
+ };
956
+ Tokenizer.prototype._is_first_token = function() {
957
+ return this.__tokens.isEmpty();
958
+ };
959
+ Tokenizer.prototype._reset = function() {
960
+ };
961
+ Tokenizer.prototype._get_next_token = function(previous_token, open_token) {
962
+ this._readWhitespace();
963
+ var resulting_string = this._input.read(/.+/g);
964
+ if (resulting_string) {
965
+ return this._create_token(TOKEN.RAW, resulting_string);
966
+ } else {
967
+ return this._create_token(TOKEN.EOF, "");
968
+ }
969
+ };
970
+ Tokenizer.prototype._is_comment = function(current_token) {
971
+ return false;
972
+ };
973
+ Tokenizer.prototype._is_opening = function(current_token) {
974
+ return false;
975
+ };
976
+ Tokenizer.prototype._is_closing = function(current_token, open_token) {
977
+ return false;
978
+ };
979
+ Tokenizer.prototype._create_token = function(type, text) {
980
+ var token = new Token(
981
+ type,
982
+ text,
983
+ this._patterns.whitespace.newline_count,
984
+ this._patterns.whitespace.whitespace_before_token
985
+ );
986
+ return token;
987
+ };
988
+ Tokenizer.prototype._readWhitespace = function() {
989
+ return this._patterns.whitespace.read();
990
+ };
991
+ module.exports.Tokenizer = Tokenizer;
992
+ module.exports.TOKEN = TOKEN;
993
+ }
994
+ });
995
+
996
+ // node_modules/js-beautify/js/src/core/directives.js
997
+ var require_directives = __commonJS({
998
+ "node_modules/js-beautify/js/src/core/directives.js"(exports, module) {
999
+ "use strict";
1000
+ function Directives(start_block_pattern, end_block_pattern) {
1001
+ start_block_pattern = typeof start_block_pattern === "string" ? start_block_pattern : start_block_pattern.source;
1002
+ end_block_pattern = typeof end_block_pattern === "string" ? end_block_pattern : end_block_pattern.source;
1003
+ this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, "g");
1004
+ this.__directive_pattern = / (\w+)[:](\w+)/g;
1005
+ this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, "g");
1006
+ }
1007
+ Directives.prototype.get_directives = function(text) {
1008
+ if (!text.match(this.__directives_block_pattern)) {
1009
+ return null;
1010
+ }
1011
+ var directives = {};
1012
+ this.__directive_pattern.lastIndex = 0;
1013
+ var directive_match = this.__directive_pattern.exec(text);
1014
+ while (directive_match) {
1015
+ directives[directive_match[1]] = directive_match[2];
1016
+ directive_match = this.__directive_pattern.exec(text);
1017
+ }
1018
+ return directives;
1019
+ };
1020
+ Directives.prototype.readIgnored = function(input) {
1021
+ return input.readUntilAfter(this.__directives_end_ignore_pattern);
1022
+ };
1023
+ module.exports.Directives = Directives;
1024
+ }
1025
+ });
1026
+
1027
+ // node_modules/js-beautify/js/src/core/templatablepattern.js
1028
+ var require_templatablepattern = __commonJS({
1029
+ "node_modules/js-beautify/js/src/core/templatablepattern.js"(exports, module) {
1030
+ "use strict";
1031
+ var Pattern = require_pattern().Pattern;
1032
+ var template_names = {
1033
+ django: false,
1034
+ erb: false,
1035
+ handlebars: false,
1036
+ php: false,
1037
+ smarty: false,
1038
+ angular: false
1039
+ };
1040
+ function TemplatablePattern(input_scanner, parent) {
1041
+ Pattern.call(this, input_scanner, parent);
1042
+ this.__template_pattern = null;
1043
+ this._disabled = Object.assign({}, template_names);
1044
+ this._excluded = Object.assign({}, template_names);
1045
+ if (parent) {
1046
+ this.__template_pattern = this._input.get_regexp(parent.__template_pattern);
1047
+ this._excluded = Object.assign(this._excluded, parent._excluded);
1048
+ this._disabled = Object.assign(this._disabled, parent._disabled);
1049
+ }
1050
+ var pattern = new Pattern(input_scanner);
1051
+ this.__patterns = {
1052
+ handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
1053
+ handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
1054
+ handlebars: pattern.starting_with(/{{/).until_after(/}}/),
1055
+ php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
1056
+ erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
1057
+ // django coflicts with handlebars a bit.
1058
+ django: pattern.starting_with(/{%/).until_after(/%}/),
1059
+ django_value: pattern.starting_with(/{{/).until_after(/}}/),
1060
+ django_comment: pattern.starting_with(/{#/).until_after(/#}/),
1061
+ smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
1062
+ smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
1063
+ smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
1064
+ };
1065
+ }
1066
+ TemplatablePattern.prototype = new Pattern();
1067
+ TemplatablePattern.prototype._create = function() {
1068
+ return new TemplatablePattern(this._input, this);
1069
+ };
1070
+ TemplatablePattern.prototype._update = function() {
1071
+ this.__set_templated_pattern();
1072
+ };
1073
+ TemplatablePattern.prototype.disable = function(language) {
1074
+ var result = this._create();
1075
+ result._disabled[language] = true;
1076
+ result._update();
1077
+ return result;
1078
+ };
1079
+ TemplatablePattern.prototype.read_options = function(options) {
1080
+ var result = this._create();
1081
+ for (var language in template_names) {
1082
+ result._disabled[language] = options.templating.indexOf(language) === -1;
1083
+ }
1084
+ result._update();
1085
+ return result;
1086
+ };
1087
+ TemplatablePattern.prototype.exclude = function(language) {
1088
+ var result = this._create();
1089
+ result._excluded[language] = true;
1090
+ result._update();
1091
+ return result;
1092
+ };
1093
+ TemplatablePattern.prototype.read = function() {
1094
+ var result = "";
1095
+ if (this._match_pattern) {
1096
+ result = this._input.read(this._starting_pattern);
1097
+ } else {
1098
+ result = this._input.read(this._starting_pattern, this.__template_pattern);
1099
+ }
1100
+ var next = this._read_template();
1101
+ while (next) {
1102
+ if (this._match_pattern) {
1103
+ next += this._input.read(this._match_pattern);
1104
+ } else {
1105
+ next += this._input.readUntil(this.__template_pattern);
1106
+ }
1107
+ result += next;
1108
+ next = this._read_template();
1109
+ }
1110
+ if (this._until_after) {
1111
+ result += this._input.readUntilAfter(this._until_pattern);
1112
+ }
1113
+ return result;
1114
+ };
1115
+ TemplatablePattern.prototype.__set_templated_pattern = function() {
1116
+ var items = [];
1117
+ if (!this._disabled.php) {
1118
+ items.push(this.__patterns.php._starting_pattern.source);
1119
+ }
1120
+ if (!this._disabled.handlebars) {
1121
+ items.push(this.__patterns.handlebars._starting_pattern.source);
1122
+ }
1123
+ if (!this._disabled.angular) {
1124
+ items.push(this.__patterns.handlebars._starting_pattern.source);
1125
+ }
1126
+ if (!this._disabled.erb) {
1127
+ items.push(this.__patterns.erb._starting_pattern.source);
1128
+ }
1129
+ if (!this._disabled.django) {
1130
+ items.push(this.__patterns.django._starting_pattern.source);
1131
+ items.push(this.__patterns.django_value._starting_pattern.source);
1132
+ items.push(this.__patterns.django_comment._starting_pattern.source);
1133
+ }
1134
+ if (!this._disabled.smarty) {
1135
+ items.push(this.__patterns.smarty._starting_pattern.source);
1136
+ }
1137
+ if (this._until_pattern) {
1138
+ items.push(this._until_pattern.source);
1139
+ }
1140
+ this.__template_pattern = this._input.get_regexp("(?:" + items.join("|") + ")");
1141
+ };
1142
+ TemplatablePattern.prototype._read_template = function() {
1143
+ var resulting_string = "";
1144
+ var c = this._input.peek();
1145
+ if (c === "<") {
1146
+ var peek1 = this._input.peek(1);
1147
+ if (!this._disabled.php && !this._excluded.php && peek1 === "?") {
1148
+ resulting_string = resulting_string || this.__patterns.php.read();
1149
+ }
1150
+ if (!this._disabled.erb && !this._excluded.erb && peek1 === "%") {
1151
+ resulting_string = resulting_string || this.__patterns.erb.read();
1152
+ }
1153
+ } else if (c === "{") {
1154
+ if (!this._disabled.handlebars && !this._excluded.handlebars) {
1155
+ resulting_string = resulting_string || this.__patterns.handlebars_comment.read();
1156
+ resulting_string = resulting_string || this.__patterns.handlebars_unescaped.read();
1157
+ resulting_string = resulting_string || this.__patterns.handlebars.read();
1158
+ }
1159
+ if (!this._disabled.django) {
1160
+ if (!this._excluded.django && !this._excluded.handlebars) {
1161
+ resulting_string = resulting_string || this.__patterns.django_value.read();
1162
+ }
1163
+ if (!this._excluded.django) {
1164
+ resulting_string = resulting_string || this.__patterns.django_comment.read();
1165
+ resulting_string = resulting_string || this.__patterns.django.read();
1166
+ }
1167
+ }
1168
+ if (!this._disabled.smarty) {
1169
+ if (this._disabled.django && this._disabled.handlebars) {
1170
+ resulting_string = resulting_string || this.__patterns.smarty_comment.read();
1171
+ resulting_string = resulting_string || this.__patterns.smarty_literal.read();
1172
+ resulting_string = resulting_string || this.__patterns.smarty.read();
1173
+ }
1174
+ }
1175
+ }
1176
+ return resulting_string;
1177
+ };
1178
+ module.exports.TemplatablePattern = TemplatablePattern;
1179
+ }
1180
+ });
1181
+
1182
+ // node_modules/js-beautify/js/src/javascript/tokenizer.js
1183
+ var require_tokenizer2 = __commonJS({
1184
+ "node_modules/js-beautify/js/src/javascript/tokenizer.js"(exports, module) {
1185
+ "use strict";
1186
+ var InputScanner = require_inputscanner().InputScanner;
1187
+ var BaseTokenizer = require_tokenizer().Tokenizer;
1188
+ var BASETOKEN = require_tokenizer().TOKEN;
1189
+ var Directives = require_directives().Directives;
1190
+ var acorn = require_acorn();
1191
+ var Pattern = require_pattern().Pattern;
1192
+ var TemplatablePattern = require_templatablepattern().TemplatablePattern;
1193
+ function in_array(what, arr) {
1194
+ return arr.indexOf(what) !== -1;
1195
+ }
1196
+ var TOKEN = {
1197
+ START_EXPR: "TK_START_EXPR",
1198
+ END_EXPR: "TK_END_EXPR",
1199
+ START_BLOCK: "TK_START_BLOCK",
1200
+ END_BLOCK: "TK_END_BLOCK",
1201
+ WORD: "TK_WORD",
1202
+ RESERVED: "TK_RESERVED",
1203
+ SEMICOLON: "TK_SEMICOLON",
1204
+ STRING: "TK_STRING",
1205
+ EQUALS: "TK_EQUALS",
1206
+ OPERATOR: "TK_OPERATOR",
1207
+ COMMA: "TK_COMMA",
1208
+ BLOCK_COMMENT: "TK_BLOCK_COMMENT",
1209
+ COMMENT: "TK_COMMENT",
1210
+ DOT: "TK_DOT",
1211
+ UNKNOWN: "TK_UNKNOWN",
1212
+ START: BASETOKEN.START,
1213
+ RAW: BASETOKEN.RAW,
1214
+ EOF: BASETOKEN.EOF
1215
+ };
1216
+ var directives_core = new Directives(/\/\*/, /\*\//);
1217
+ var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
1218
+ var digit = /[0-9]/;
1219
+ var dot_pattern = /[^\d\.]/;
1220
+ var positionable_operators = ">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" ");
1221
+ var punct = ">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";
1222
+ punct = punct.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&");
1223
+ punct = "\\?\\.(?!\\d) " + punct;
1224
+ punct = punct.replace(/ /g, "|");
1225
+ var punct_pattern = new RegExp(punct);
1226
+ var line_starters = "continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");
1227
+ var reserved_words = line_starters.concat(["do", "in", "of", "else", "get", "set", "new", "catch", "finally", "typeof", "yield", "async", "await", "from", "as", "class", "extends"]);
1228
+ var reserved_word_pattern = new RegExp("^(?:" + reserved_words.join("|") + ")$");
1229
+ var in_html_comment;
1230
+ var Tokenizer = function(input_string, options) {
1231
+ BaseTokenizer.call(this, input_string, options);
1232
+ this._patterns.whitespace = this._patterns.whitespace.matching(
1233
+ /\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,
1234
+ /\u2028\u2029/.source
1235
+ );
1236
+ var pattern_reader = new Pattern(this._input);
1237
+ var templatable = new TemplatablePattern(this._input).read_options(this._options);
1238
+ this.__patterns = {
1239
+ template: templatable,
1240
+ identifier: templatable.starting_with(acorn.identifier).matching(acorn.identifierMatch),
1241
+ number: pattern_reader.matching(number_pattern),
1242
+ punct: pattern_reader.matching(punct_pattern),
1243
+ // comment ends just before nearest linefeed or end of file
1244
+ comment: pattern_reader.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),
1245
+ // /* ... */ comment ends with nearest */ or end of file
1246
+ block_comment: pattern_reader.starting_with(/\/\*/).until_after(/\*\//),
1247
+ html_comment_start: pattern_reader.matching(/<!--/),
1248
+ html_comment_end: pattern_reader.matching(/-->/),
1249
+ include: pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),
1250
+ shebang: pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),
1251
+ xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),
1252
+ single_quote: templatable.until(/['\\\n\r\u2028\u2029]/),
1253
+ double_quote: templatable.until(/["\\\n\r\u2028\u2029]/),
1254
+ template_text: templatable.until(/[`\\$]/),
1255
+ template_expression: templatable.until(/[`}\\]/)
1256
+ };
1257
+ };
1258
+ Tokenizer.prototype = new BaseTokenizer();
1259
+ Tokenizer.prototype._is_comment = function(current_token) {
1260
+ return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;
1261
+ };
1262
+ Tokenizer.prototype._is_opening = function(current_token) {
1263
+ return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;
1264
+ };
1265
+ Tokenizer.prototype._is_closing = function(current_token, open_token) {
1266
+ return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) && (open_token && (current_token.text === "]" && open_token.text === "[" || current_token.text === ")" && open_token.text === "(" || current_token.text === "}" && open_token.text === "{"));
1267
+ };
1268
+ Tokenizer.prototype._reset = function() {
1269
+ in_html_comment = false;
1270
+ };
1271
+ Tokenizer.prototype._get_next_token = function(previous_token, open_token) {
1272
+ var token = null;
1273
+ this._readWhitespace();
1274
+ var c = this._input.peek();
1275
+ if (c === null) {
1276
+ return this._create_token(TOKEN.EOF, "");
1277
+ }
1278
+ token = token || this._read_non_javascript(c);
1279
+ token = token || this._read_string(c);
1280
+ token = token || this._read_pair(c, this._input.peek(1));
1281
+ token = token || this._read_word(previous_token);
1282
+ token = token || this._read_singles(c);
1283
+ token = token || this._read_comment(c);
1284
+ token = token || this._read_regexp(c, previous_token);
1285
+ token = token || this._read_xml(c, previous_token);
1286
+ token = token || this._read_punctuation();
1287
+ token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());
1288
+ return token;
1289
+ };
1290
+ Tokenizer.prototype._read_word = function(previous_token) {
1291
+ var resulting_string;
1292
+ resulting_string = this.__patterns.identifier.read();
1293
+ if (resulting_string !== "") {
1294
+ resulting_string = resulting_string.replace(acorn.allLineBreaks, "\n");
1295
+ if (!(previous_token.type === TOKEN.DOT || previous_token.type === TOKEN.RESERVED && (previous_token.text === "set" || previous_token.text === "get")) && reserved_word_pattern.test(resulting_string)) {
1296
+ if ((resulting_string === "in" || resulting_string === "of") && (previous_token.type === TOKEN.WORD || previous_token.type === TOKEN.STRING)) {
1297
+ return this._create_token(TOKEN.OPERATOR, resulting_string);
1298
+ }
1299
+ return this._create_token(TOKEN.RESERVED, resulting_string);
1300
+ }
1301
+ return this._create_token(TOKEN.WORD, resulting_string);
1302
+ }
1303
+ resulting_string = this.__patterns.number.read();
1304
+ if (resulting_string !== "") {
1305
+ return this._create_token(TOKEN.WORD, resulting_string);
1306
+ }
1307
+ };
1308
+ Tokenizer.prototype._read_singles = function(c) {
1309
+ var token = null;
1310
+ if (c === "(" || c === "[") {
1311
+ token = this._create_token(TOKEN.START_EXPR, c);
1312
+ } else if (c === ")" || c === "]") {
1313
+ token = this._create_token(TOKEN.END_EXPR, c);
1314
+ } else if (c === "{") {
1315
+ token = this._create_token(TOKEN.START_BLOCK, c);
1316
+ } else if (c === "}") {
1317
+ token = this._create_token(TOKEN.END_BLOCK, c);
1318
+ } else if (c === ";") {
1319
+ token = this._create_token(TOKEN.SEMICOLON, c);
1320
+ } else if (c === "." && dot_pattern.test(this._input.peek(1))) {
1321
+ token = this._create_token(TOKEN.DOT, c);
1322
+ } else if (c === ",") {
1323
+ token = this._create_token(TOKEN.COMMA, c);
1324
+ }
1325
+ if (token) {
1326
+ this._input.next();
1327
+ }
1328
+ return token;
1329
+ };
1330
+ Tokenizer.prototype._read_pair = function(c, d) {
1331
+ var token = null;
1332
+ if (c === "#" && d === "{") {
1333
+ token = this._create_token(TOKEN.START_BLOCK, c + d);
1334
+ }
1335
+ if (token) {
1336
+ this._input.next();
1337
+ this._input.next();
1338
+ }
1339
+ return token;
1340
+ };
1341
+ Tokenizer.prototype._read_punctuation = function() {
1342
+ var resulting_string = this.__patterns.punct.read();
1343
+ if (resulting_string !== "") {
1344
+ if (resulting_string === "=") {
1345
+ return this._create_token(TOKEN.EQUALS, resulting_string);
1346
+ } else if (resulting_string === "?.") {
1347
+ return this._create_token(TOKEN.DOT, resulting_string);
1348
+ } else {
1349
+ return this._create_token(TOKEN.OPERATOR, resulting_string);
1350
+ }
1351
+ }
1352
+ };
1353
+ Tokenizer.prototype._read_non_javascript = function(c) {
1354
+ var resulting_string = "";
1355
+ if (c === "#") {
1356
+ if (this._is_first_token()) {
1357
+ resulting_string = this.__patterns.shebang.read();
1358
+ if (resulting_string) {
1359
+ return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + "\n");
1360
+ }
1361
+ }
1362
+ resulting_string = this.__patterns.include.read();
1363
+ if (resulting_string) {
1364
+ return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + "\n");
1365
+ }
1366
+ c = this._input.next();
1367
+ var sharp = "#";
1368
+ if (this._input.hasNext() && this._input.testChar(digit)) {
1369
+ do {
1370
+ c = this._input.next();
1371
+ sharp += c;
1372
+ } while (this._input.hasNext() && c !== "#" && c !== "=");
1373
+ if (c === "#") {
1374
+ } else if (this._input.peek() === "[" && this._input.peek(1) === "]") {
1375
+ sharp += "[]";
1376
+ this._input.next();
1377
+ this._input.next();
1378
+ } else if (this._input.peek() === "{" && this._input.peek(1) === "}") {
1379
+ sharp += "{}";
1380
+ this._input.next();
1381
+ this._input.next();
1382
+ }
1383
+ return this._create_token(TOKEN.WORD, sharp);
1384
+ }
1385
+ this._input.back();
1386
+ } else if (c === "<" && this._is_first_token()) {
1387
+ resulting_string = this.__patterns.html_comment_start.read();
1388
+ if (resulting_string) {
1389
+ while (this._input.hasNext() && !this._input.testChar(acorn.newline)) {
1390
+ resulting_string += this._input.next();
1391
+ }
1392
+ in_html_comment = true;
1393
+ return this._create_token(TOKEN.COMMENT, resulting_string);
1394
+ }
1395
+ } else if (in_html_comment && c === "-") {
1396
+ resulting_string = this.__patterns.html_comment_end.read();
1397
+ if (resulting_string) {
1398
+ in_html_comment = false;
1399
+ return this._create_token(TOKEN.COMMENT, resulting_string);
1400
+ }
1401
+ }
1402
+ return null;
1403
+ };
1404
+ Tokenizer.prototype._read_comment = function(c) {
1405
+ var token = null;
1406
+ if (c === "/") {
1407
+ var comment = "";
1408
+ if (this._input.peek(1) === "*") {
1409
+ comment = this.__patterns.block_comment.read();
1410
+ var directives = directives_core.get_directives(comment);
1411
+ if (directives && directives.ignore === "start") {
1412
+ comment += directives_core.readIgnored(this._input);
1413
+ }
1414
+ comment = comment.replace(acorn.allLineBreaks, "\n");
1415
+ token = this._create_token(TOKEN.BLOCK_COMMENT, comment);
1416
+ token.directives = directives;
1417
+ } else if (this._input.peek(1) === "/") {
1418
+ comment = this.__patterns.comment.read();
1419
+ token = this._create_token(TOKEN.COMMENT, comment);
1420
+ }
1421
+ }
1422
+ return token;
1423
+ };
1424
+ Tokenizer.prototype._read_string = function(c) {
1425
+ if (c === "`" || c === "'" || c === '"') {
1426
+ var resulting_string = this._input.next();
1427
+ this.has_char_escapes = false;
1428
+ if (c === "`") {
1429
+ resulting_string += this._read_string_recursive("`", true, "${");
1430
+ } else {
1431
+ resulting_string += this._read_string_recursive(c);
1432
+ }
1433
+ if (this.has_char_escapes && this._options.unescape_strings) {
1434
+ resulting_string = unescape_string(resulting_string);
1435
+ }
1436
+ if (this._input.peek() === c) {
1437
+ resulting_string += this._input.next();
1438
+ }
1439
+ resulting_string = resulting_string.replace(acorn.allLineBreaks, "\n");
1440
+ return this._create_token(TOKEN.STRING, resulting_string);
1441
+ }
1442
+ return null;
1443
+ };
1444
+ Tokenizer.prototype._allow_regexp_or_xml = function(previous_token) {
1445
+ return previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ["return", "case", "throw", "else", "do", "typeof", "yield"]) || previous_token.type === TOKEN.END_EXPR && previous_token.text === ")" && previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ["if", "while", "for"]) || in_array(previous_token.type, [
1446
+ TOKEN.COMMENT,
1447
+ TOKEN.START_EXPR,
1448
+ TOKEN.START_BLOCK,
1449
+ TOKEN.START,
1450
+ TOKEN.END_BLOCK,
1451
+ TOKEN.OPERATOR,
1452
+ TOKEN.EQUALS,
1453
+ TOKEN.EOF,
1454
+ TOKEN.SEMICOLON,
1455
+ TOKEN.COMMA
1456
+ ]);
1457
+ };
1458
+ Tokenizer.prototype._read_regexp = function(c, previous_token) {
1459
+ if (c === "/" && this._allow_regexp_or_xml(previous_token)) {
1460
+ var resulting_string = this._input.next();
1461
+ var esc = false;
1462
+ var in_char_class = false;
1463
+ while (this._input.hasNext() && ((esc || in_char_class || this._input.peek() !== c) && !this._input.testChar(acorn.newline))) {
1464
+ resulting_string += this._input.peek();
1465
+ if (!esc) {
1466
+ esc = this._input.peek() === "\\";
1467
+ if (this._input.peek() === "[") {
1468
+ in_char_class = true;
1469
+ } else if (this._input.peek() === "]") {
1470
+ in_char_class = false;
1471
+ }
1472
+ } else {
1473
+ esc = false;
1474
+ }
1475
+ this._input.next();
1476
+ }
1477
+ if (this._input.peek() === c) {
1478
+ resulting_string += this._input.next();
1479
+ resulting_string += this._input.read(acorn.identifier);
1480
+ }
1481
+ return this._create_token(TOKEN.STRING, resulting_string);
1482
+ }
1483
+ return null;
1484
+ };
1485
+ Tokenizer.prototype._read_xml = function(c, previous_token) {
1486
+ if (this._options.e4x && c === "<" && this._allow_regexp_or_xml(previous_token)) {
1487
+ var xmlStr = "";
1488
+ var match = this.__patterns.xml.read_match();
1489
+ if (match) {
1490
+ var rootTag = match[2].replace(/^{\s+/, "{").replace(/\s+}$/, "}");
1491
+ var isCurlyRoot = rootTag.indexOf("{") === 0;
1492
+ var depth = 0;
1493
+ while (match) {
1494
+ var isEndTag = !!match[1];
1495
+ var tagName = match[2];
1496
+ var isSingletonTag = !!match[match.length - 1] || tagName.slice(0, 8) === "![CDATA[";
1497
+ if (!isSingletonTag && (tagName === rootTag || isCurlyRoot && tagName.replace(/^{\s+/, "{").replace(/\s+}$/, "}"))) {
1498
+ if (isEndTag) {
1499
+ --depth;
1500
+ } else {
1501
+ ++depth;
1502
+ }
1503
+ }
1504
+ xmlStr += match[0];
1505
+ if (depth <= 0) {
1506
+ break;
1507
+ }
1508
+ match = this.__patterns.xml.read_match();
1509
+ }
1510
+ if (!match) {
1511
+ xmlStr += this._input.match(/[\s\S]*/g)[0];
1512
+ }
1513
+ xmlStr = xmlStr.replace(acorn.allLineBreaks, "\n");
1514
+ return this._create_token(TOKEN.STRING, xmlStr);
1515
+ }
1516
+ }
1517
+ return null;
1518
+ };
1519
+ function unescape_string(s) {
1520
+ var out = "", escaped = 0;
1521
+ var input_scan = new InputScanner(s);
1522
+ var matched = null;
1523
+ while (input_scan.hasNext()) {
1524
+ matched = input_scan.match(/([\s]|[^\\]|\\\\)+/g);
1525
+ if (matched) {
1526
+ out += matched[0];
1527
+ }
1528
+ if (input_scan.peek() === "\\") {
1529
+ input_scan.next();
1530
+ if (input_scan.peek() === "x") {
1531
+ matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);
1532
+ } else if (input_scan.peek() === "u") {
1533
+ matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);
1534
+ if (!matched) {
1535
+ matched = input_scan.match(/u\{([0-9A-Fa-f]+)\}/g);
1536
+ }
1537
+ } else {
1538
+ out += "\\";
1539
+ if (input_scan.hasNext()) {
1540
+ out += input_scan.next();
1541
+ }
1542
+ continue;
1543
+ }
1544
+ if (!matched) {
1545
+ return s;
1546
+ }
1547
+ escaped = parseInt(matched[1], 16);
1548
+ if (escaped > 126 && escaped <= 255 && matched[0].indexOf("x") === 0) {
1549
+ return s;
1550
+ } else if (escaped >= 0 && escaped < 32) {
1551
+ out += "\\" + matched[0];
1552
+ } else if (escaped > 1114111) {
1553
+ out += "\\" + matched[0];
1554
+ } else if (escaped === 34 || escaped === 39 || escaped === 92) {
1555
+ out += "\\" + String.fromCharCode(escaped);
1556
+ } else {
1557
+ out += String.fromCharCode(escaped);
1558
+ }
1559
+ }
1560
+ }
1561
+ return out;
1562
+ }
1563
+ Tokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {
1564
+ var current_char;
1565
+ var pattern;
1566
+ if (delimiter === "'") {
1567
+ pattern = this.__patterns.single_quote;
1568
+ } else if (delimiter === '"') {
1569
+ pattern = this.__patterns.double_quote;
1570
+ } else if (delimiter === "`") {
1571
+ pattern = this.__patterns.template_text;
1572
+ } else if (delimiter === "}") {
1573
+ pattern = this.__patterns.template_expression;
1574
+ }
1575
+ var resulting_string = pattern.read();
1576
+ var next = "";
1577
+ while (this._input.hasNext()) {
1578
+ next = this._input.next();
1579
+ if (next === delimiter || !allow_unescaped_newlines && acorn.newline.test(next)) {
1580
+ this._input.back();
1581
+ break;
1582
+ } else if (next === "\\" && this._input.hasNext()) {
1583
+ current_char = this._input.peek();
1584
+ if (current_char === "x" || current_char === "u") {
1585
+ this.has_char_escapes = true;
1586
+ } else if (current_char === "\r" && this._input.peek(1) === "\n") {
1587
+ this._input.next();
1588
+ }
1589
+ next += this._input.next();
1590
+ } else if (start_sub) {
1591
+ if (start_sub === "${" && next === "$" && this._input.peek() === "{") {
1592
+ next += this._input.next();
1593
+ }
1594
+ if (start_sub === next) {
1595
+ if (delimiter === "`") {
1596
+ next += this._read_string_recursive("}", allow_unescaped_newlines, "`");
1597
+ } else {
1598
+ next += this._read_string_recursive("`", allow_unescaped_newlines, "${");
1599
+ }
1600
+ if (this._input.hasNext()) {
1601
+ next += this._input.next();
1602
+ }
1603
+ }
1604
+ }
1605
+ next += pattern.read();
1606
+ resulting_string += next;
1607
+ }
1608
+ return resulting_string;
1609
+ };
1610
+ module.exports.Tokenizer = Tokenizer;
1611
+ module.exports.TOKEN = TOKEN;
1612
+ module.exports.positionable_operators = positionable_operators.slice();
1613
+ module.exports.line_starters = line_starters.slice();
1614
+ }
1615
+ });
1616
+
1617
+ // node_modules/js-beautify/js/src/javascript/beautifier.js
1618
+ var require_beautifier = __commonJS({
1619
+ "node_modules/js-beautify/js/src/javascript/beautifier.js"(exports, module) {
1620
+ "use strict";
1621
+ var Output = require_output().Output;
1622
+ var Token = require_token().Token;
1623
+ var acorn = require_acorn();
1624
+ var Options = require_options2().Options;
1625
+ var Tokenizer = require_tokenizer2().Tokenizer;
1626
+ var line_starters = require_tokenizer2().line_starters;
1627
+ var positionable_operators = require_tokenizer2().positionable_operators;
1628
+ var TOKEN = require_tokenizer2().TOKEN;
1629
+ function in_array(what, arr) {
1630
+ return arr.indexOf(what) !== -1;
1631
+ }
1632
+ function ltrim(s) {
1633
+ return s.replace(/^\s+/g, "");
1634
+ }
1635
+ function generateMapFromStrings(list) {
1636
+ var result = {};
1637
+ for (var x = 0; x < list.length; x++) {
1638
+ result[list[x].replace(/-/g, "_")] = list[x];
1639
+ }
1640
+ return result;
1641
+ }
1642
+ function reserved_word(token, word) {
1643
+ return token && token.type === TOKEN.RESERVED && token.text === word;
1644
+ }
1645
+ function reserved_array(token, words) {
1646
+ return token && token.type === TOKEN.RESERVED && in_array(token.text, words);
1647
+ }
1648
+ var special_words = ["case", "return", "do", "if", "throw", "else", "await", "break", "continue", "async"];
1649
+ var validPositionValues = ["before-newline", "after-newline", "preserve-newline"];
1650
+ var OPERATOR_POSITION = generateMapFromStrings(validPositionValues);
1651
+ var OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];
1652
+ var MODE = {
1653
+ BlockStatement: "BlockStatement",
1654
+ // 'BLOCK'
1655
+ Statement: "Statement",
1656
+ // 'STATEMENT'
1657
+ ObjectLiteral: "ObjectLiteral",
1658
+ // 'OBJECT',
1659
+ ArrayLiteral: "ArrayLiteral",
1660
+ //'[EXPRESSION]',
1661
+ ForInitializer: "ForInitializer",
1662
+ //'(FOR-EXPRESSION)',
1663
+ Conditional: "Conditional",
1664
+ //'(COND-EXPRESSION)',
1665
+ Expression: "Expression"
1666
+ //'(EXPRESSION)'
1667
+ };
1668
+ function remove_redundant_indentation(output, frame) {
1669
+ if (frame.multiline_frame || frame.mode === MODE.ForInitializer || frame.mode === MODE.Conditional) {
1670
+ return;
1671
+ }
1672
+ output.remove_indent(frame.start_line_index);
1673
+ }
1674
+ function split_linebreaks(s) {
1675
+ s = s.replace(acorn.allLineBreaks, "\n");
1676
+ var out = [], idx = s.indexOf("\n");
1677
+ while (idx !== -1) {
1678
+ out.push(s.substring(0, idx));
1679
+ s = s.substring(idx + 1);
1680
+ idx = s.indexOf("\n");
1681
+ }
1682
+ if (s.length) {
1683
+ out.push(s);
1684
+ }
1685
+ return out;
1686
+ }
1687
+ function is_array(mode) {
1688
+ return mode === MODE.ArrayLiteral;
1689
+ }
1690
+ function is_expression(mode) {
1691
+ return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);
1692
+ }
1693
+ function all_lines_start_with(lines, c) {
1694
+ for (var i = 0; i < lines.length; i++) {
1695
+ var line = lines[i].trim();
1696
+ if (line.charAt(0) !== c) {
1697
+ return false;
1698
+ }
1699
+ }
1700
+ return true;
1701
+ }
1702
+ function each_line_matches_indent(lines, indent) {
1703
+ var i = 0, len = lines.length, line;
1704
+ for (; i < len; i++) {
1705
+ line = lines[i];
1706
+ if (line && line.indexOf(indent) !== 0) {
1707
+ return false;
1708
+ }
1709
+ }
1710
+ return true;
1711
+ }
1712
+ function Beautifier(source_text, options) {
1713
+ options = options || {};
1714
+ this._source_text = source_text || "";
1715
+ this._output = null;
1716
+ this._tokens = null;
1717
+ this._last_last_text = null;
1718
+ this._flags = null;
1719
+ this._previous_flags = null;
1720
+ this._flag_store = null;
1721
+ this._options = new Options(options);
1722
+ }
1723
+ Beautifier.prototype.create_flags = function(flags_base, mode) {
1724
+ var next_indent_level = 0;
1725
+ if (flags_base) {
1726
+ next_indent_level = flags_base.indentation_level;
1727
+ if (!this._output.just_added_newline() && flags_base.line_indent_level > next_indent_level) {
1728
+ next_indent_level = flags_base.line_indent_level;
1729
+ }
1730
+ }
1731
+ var next_flags = {
1732
+ mode,
1733
+ parent: flags_base,
1734
+ last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ""),
1735
+ // last token text
1736
+ last_word: flags_base ? flags_base.last_word : "",
1737
+ // last TOKEN.WORD passed
1738
+ declaration_statement: false,
1739
+ declaration_assignment: false,
1740
+ multiline_frame: false,
1741
+ inline_frame: false,
1742
+ if_block: false,
1743
+ else_block: false,
1744
+ class_start_block: false,
1745
+ // class A { INSIDE HERE } or class B extends C { INSIDE HERE }
1746
+ do_block: false,
1747
+ do_while: false,
1748
+ import_block: false,
1749
+ in_case_statement: false,
1750
+ // switch(..){ INSIDE HERE }
1751
+ in_case: false,
1752
+ // we're on the exact line with "case 0:"
1753
+ case_body: false,
1754
+ // the indented case-action block
1755
+ case_block: false,
1756
+ // the indented case-action block is wrapped with {}
1757
+ indentation_level: next_indent_level,
1758
+ alignment: 0,
1759
+ line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,
1760
+ start_line_index: this._output.get_line_number(),
1761
+ ternary_depth: 0
1762
+ };
1763
+ return next_flags;
1764
+ };
1765
+ Beautifier.prototype._reset = function(source_text) {
1766
+ var baseIndentString = source_text.match(/^[\t ]*/)[0];
1767
+ this._last_last_text = "";
1768
+ this._output = new Output(this._options, baseIndentString);
1769
+ this._output.raw = this._options.test_output_raw;
1770
+ this._flag_store = [];
1771
+ this.set_mode(MODE.BlockStatement);
1772
+ var tokenizer = new Tokenizer(source_text, this._options);
1773
+ this._tokens = tokenizer.tokenize();
1774
+ return source_text;
1775
+ };
1776
+ Beautifier.prototype.beautify = function() {
1777
+ if (this._options.disabled) {
1778
+ return this._source_text;
1779
+ }
1780
+ var sweet_code;
1781
+ var source_text = this._reset(this._source_text);
1782
+ var eol = this._options.eol;
1783
+ if (this._options.eol === "auto") {
1784
+ eol = "\n";
1785
+ if (source_text && acorn.lineBreak.test(source_text || "")) {
1786
+ eol = source_text.match(acorn.lineBreak)[0];
1787
+ }
1788
+ }
1789
+ var current_token = this._tokens.next();
1790
+ while (current_token) {
1791
+ this.handle_token(current_token);
1792
+ this._last_last_text = this._flags.last_token.text;
1793
+ this._flags.last_token = current_token;
1794
+ current_token = this._tokens.next();
1795
+ }
1796
+ sweet_code = this._output.get_code(eol);
1797
+ return sweet_code;
1798
+ };
1799
+ Beautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {
1800
+ if (current_token.type === TOKEN.START_EXPR) {
1801
+ this.handle_start_expr(current_token);
1802
+ } else if (current_token.type === TOKEN.END_EXPR) {
1803
+ this.handle_end_expr(current_token);
1804
+ } else if (current_token.type === TOKEN.START_BLOCK) {
1805
+ this.handle_start_block(current_token);
1806
+ } else if (current_token.type === TOKEN.END_BLOCK) {
1807
+ this.handle_end_block(current_token);
1808
+ } else if (current_token.type === TOKEN.WORD) {
1809
+ this.handle_word(current_token);
1810
+ } else if (current_token.type === TOKEN.RESERVED) {
1811
+ this.handle_word(current_token);
1812
+ } else if (current_token.type === TOKEN.SEMICOLON) {
1813
+ this.handle_semicolon(current_token);
1814
+ } else if (current_token.type === TOKEN.STRING) {
1815
+ this.handle_string(current_token);
1816
+ } else if (current_token.type === TOKEN.EQUALS) {
1817
+ this.handle_equals(current_token);
1818
+ } else if (current_token.type === TOKEN.OPERATOR) {
1819
+ this.handle_operator(current_token);
1820
+ } else if (current_token.type === TOKEN.COMMA) {
1821
+ this.handle_comma(current_token);
1822
+ } else if (current_token.type === TOKEN.BLOCK_COMMENT) {
1823
+ this.handle_block_comment(current_token, preserve_statement_flags);
1824
+ } else if (current_token.type === TOKEN.COMMENT) {
1825
+ this.handle_comment(current_token, preserve_statement_flags);
1826
+ } else if (current_token.type === TOKEN.DOT) {
1827
+ this.handle_dot(current_token);
1828
+ } else if (current_token.type === TOKEN.EOF) {
1829
+ this.handle_eof(current_token);
1830
+ } else if (current_token.type === TOKEN.UNKNOWN) {
1831
+ this.handle_unknown(current_token, preserve_statement_flags);
1832
+ } else {
1833
+ this.handle_unknown(current_token, preserve_statement_flags);
1834
+ }
1835
+ };
1836
+ Beautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {
1837
+ var newlines = current_token.newlines;
1838
+ var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);
1839
+ if (current_token.comments_before) {
1840
+ var comment_token = current_token.comments_before.next();
1841
+ while (comment_token) {
1842
+ this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);
1843
+ this.handle_token(comment_token, preserve_statement_flags);
1844
+ comment_token = current_token.comments_before.next();
1845
+ }
1846
+ }
1847
+ if (keep_whitespace) {
1848
+ for (var i = 0; i < newlines; i += 1) {
1849
+ this.print_newline(i > 0, preserve_statement_flags);
1850
+ }
1851
+ } else {
1852
+ if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {
1853
+ newlines = this._options.max_preserve_newlines;
1854
+ }
1855
+ if (this._options.preserve_newlines) {
1856
+ if (newlines > 1) {
1857
+ this.print_newline(false, preserve_statement_flags);
1858
+ for (var j = 1; j < newlines; j += 1) {
1859
+ this.print_newline(true, preserve_statement_flags);
1860
+ }
1861
+ }
1862
+ }
1863
+ }
1864
+ };
1865
+ var newline_restricted_tokens = ["async", "break", "continue", "return", "throw", "yield"];
1866
+ Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {
1867
+ force_linewrap = force_linewrap === void 0 ? false : force_linewrap;
1868
+ if (this._output.just_added_newline()) {
1869
+ return;
1870
+ }
1871
+ var shouldPreserveOrForce = this._options.preserve_newlines && current_token.newlines || force_linewrap;
1872
+ var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) || in_array(current_token.text, positionable_operators);
1873
+ if (operatorLogicApplies) {
1874
+ var shouldPrintOperatorNewline = in_array(this._flags.last_token.text, positionable_operators) && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE) || in_array(current_token.text, positionable_operators);
1875
+ shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;
1876
+ }
1877
+ if (shouldPreserveOrForce) {
1878
+ this.print_newline(false, true);
1879
+ } else if (this._options.wrap_line_length) {
1880
+ if (reserved_array(this._flags.last_token, newline_restricted_tokens)) {
1881
+ return;
1882
+ }
1883
+ this._output.set_wrap_point();
1884
+ }
1885
+ };
1886
+ Beautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {
1887
+ if (!preserve_statement_flags) {
1888
+ if (this._flags.last_token.text !== ";" && this._flags.last_token.text !== "," && this._flags.last_token.text !== "=" && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === "--" || this._flags.last_token.text === "++")) {
1889
+ var next_token = this._tokens.peek();
1890
+ while (this._flags.mode === MODE.Statement && !(this._flags.if_block && reserved_word(next_token, "else")) && !this._flags.do_block) {
1891
+ this.restore_mode();
1892
+ }
1893
+ }
1894
+ }
1895
+ if (this._output.add_new_line(force_newline)) {
1896
+ this._flags.multiline_frame = true;
1897
+ }
1898
+ };
1899
+ Beautifier.prototype.print_token_line_indentation = function(current_token) {
1900
+ if (this._output.just_added_newline()) {
1901
+ if (this._options.keep_array_indentation && current_token.newlines && (current_token.text === "[" || is_array(this._flags.mode))) {
1902
+ this._output.current_line.set_indent(-1);
1903
+ this._output.current_line.push(current_token.whitespace_before);
1904
+ this._output.space_before_token = false;
1905
+ } else if (this._output.set_indent(this._flags.indentation_level, this._flags.alignment)) {
1906
+ this._flags.line_indent_level = this._flags.indentation_level;
1907
+ }
1908
+ }
1909
+ };
1910
+ Beautifier.prototype.print_token = function(current_token) {
1911
+ if (this._output.raw) {
1912
+ this._output.add_raw_token(current_token);
1913
+ return;
1914
+ }
1915
+ if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA && this._output.just_added_newline()) {
1916
+ if (this._output.previous_line.last() === ",") {
1917
+ var popped = this._output.previous_line.pop();
1918
+ if (this._output.previous_line.is_empty()) {
1919
+ this._output.previous_line.push(popped);
1920
+ this._output.trim(true);
1921
+ this._output.current_line.pop();
1922
+ this._output.trim();
1923
+ }
1924
+ this.print_token_line_indentation(current_token);
1925
+ this._output.add_token(",");
1926
+ this._output.space_before_token = true;
1927
+ }
1928
+ }
1929
+ this.print_token_line_indentation(current_token);
1930
+ this._output.non_breaking_space = true;
1931
+ this._output.add_token(current_token.text);
1932
+ if (this._output.previous_token_wrapped) {
1933
+ this._flags.multiline_frame = true;
1934
+ }
1935
+ };
1936
+ Beautifier.prototype.indent = function() {
1937
+ this._flags.indentation_level += 1;
1938
+ this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
1939
+ };
1940
+ Beautifier.prototype.deindent = function() {
1941
+ if (this._flags.indentation_level > 0 && (!this._flags.parent || this._flags.indentation_level > this._flags.parent.indentation_level)) {
1942
+ this._flags.indentation_level -= 1;
1943
+ this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
1944
+ }
1945
+ };
1946
+ Beautifier.prototype.set_mode = function(mode) {
1947
+ if (this._flags) {
1948
+ this._flag_store.push(this._flags);
1949
+ this._previous_flags = this._flags;
1950
+ } else {
1951
+ this._previous_flags = this.create_flags(null, mode);
1952
+ }
1953
+ this._flags = this.create_flags(this._previous_flags, mode);
1954
+ this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
1955
+ };
1956
+ Beautifier.prototype.restore_mode = function() {
1957
+ if (this._flag_store.length > 0) {
1958
+ this._previous_flags = this._flags;
1959
+ this._flags = this._flag_store.pop();
1960
+ if (this._previous_flags.mode === MODE.Statement) {
1961
+ remove_redundant_indentation(this._output, this._previous_flags);
1962
+ }
1963
+ this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
1964
+ }
1965
+ };
1966
+ Beautifier.prototype.start_of_object_property = function() {
1967
+ return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (this._flags.last_token.text === ":" && this._flags.ternary_depth === 0 || reserved_array(this._flags.last_token, ["get", "set"]));
1968
+ };
1969
+ Beautifier.prototype.start_of_statement = function(current_token) {
1970
+ var start = false;
1971
+ start = start || reserved_array(this._flags.last_token, ["var", "let", "const"]) && current_token.type === TOKEN.WORD;
1972
+ start = start || reserved_word(this._flags.last_token, "do");
1973
+ start = start || !(this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement) && reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines;
1974
+ start = start || reserved_word(this._flags.last_token, "else") && !(reserved_word(current_token, "if") && !current_token.comments_before);
1975
+ start = start || this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional);
1976
+ start = start || this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement && !this._flags.in_case && !(current_token.text === "--" || current_token.text === "++") && this._last_last_text !== "function" && current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED;
1977
+ start = start || this._flags.mode === MODE.ObjectLiteral && (this._flags.last_token.text === ":" && this._flags.ternary_depth === 0 || reserved_array(this._flags.last_token, ["get", "set"]));
1978
+ if (start) {
1979
+ this.set_mode(MODE.Statement);
1980
+ this.indent();
1981
+ this.handle_whitespace_and_comments(current_token, true);
1982
+ if (!this.start_of_object_property()) {
1983
+ this.allow_wrap_or_preserved_newline(
1984
+ current_token,
1985
+ reserved_array(current_token, ["do", "for", "if", "while"])
1986
+ );
1987
+ }
1988
+ return true;
1989
+ }
1990
+ return false;
1991
+ };
1992
+ Beautifier.prototype.handle_start_expr = function(current_token) {
1993
+ if (!this.start_of_statement(current_token)) {
1994
+ this.handle_whitespace_and_comments(current_token);
1995
+ }
1996
+ var next_mode = MODE.Expression;
1997
+ if (current_token.text === "[") {
1998
+ if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ")") {
1999
+ if (reserved_array(this._flags.last_token, line_starters)) {
2000
+ this._output.space_before_token = true;
2001
+ }
2002
+ this.print_token(current_token);
2003
+ this.set_mode(next_mode);
2004
+ this.indent();
2005
+ if (this._options.space_in_paren) {
2006
+ this._output.space_before_token = true;
2007
+ }
2008
+ return;
2009
+ }
2010
+ next_mode = MODE.ArrayLiteral;
2011
+ if (is_array(this._flags.mode)) {
2012
+ if (this._flags.last_token.text === "[" || this._flags.last_token.text === "," && (this._last_last_text === "]" || this._last_last_text === "}")) {
2013
+ if (!this._options.keep_array_indentation) {
2014
+ this.print_newline();
2015
+ }
2016
+ }
2017
+ }
2018
+ if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {
2019
+ this._output.space_before_token = true;
2020
+ }
2021
+ } else {
2022
+ if (this._flags.last_token.type === TOKEN.RESERVED) {
2023
+ if (this._flags.last_token.text === "for") {
2024
+ this._output.space_before_token = this._options.space_before_conditional;
2025
+ next_mode = MODE.ForInitializer;
2026
+ } else if (in_array(this._flags.last_token.text, ["if", "while", "switch"])) {
2027
+ this._output.space_before_token = this._options.space_before_conditional;
2028
+ next_mode = MODE.Conditional;
2029
+ } else if (in_array(this._flags.last_word, ["await", "async"])) {
2030
+ this._output.space_before_token = true;
2031
+ } else if (this._flags.last_token.text === "import" && current_token.whitespace_before === "") {
2032
+ this._output.space_before_token = false;
2033
+ } else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === "catch") {
2034
+ this._output.space_before_token = true;
2035
+ }
2036
+ } else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
2037
+ if (!this.start_of_object_property()) {
2038
+ this.allow_wrap_or_preserved_newline(current_token);
2039
+ }
2040
+ } else if (this._flags.last_token.type === TOKEN.WORD) {
2041
+ this._output.space_before_token = false;
2042
+ var peek_back_two = this._tokens.peek(-3);
2043
+ if (this._options.space_after_named_function && peek_back_two) {
2044
+ var peek_back_three = this._tokens.peek(-4);
2045
+ if (reserved_array(peek_back_two, ["async", "function"]) || peek_back_two.text === "*" && reserved_array(peek_back_three, ["async", "function"])) {
2046
+ this._output.space_before_token = true;
2047
+ } else if (this._flags.mode === MODE.ObjectLiteral) {
2048
+ if (peek_back_two.text === "{" || peek_back_two.text === "," || peek_back_two.text === "*" && (peek_back_three.text === "{" || peek_back_three.text === ",")) {
2049
+ this._output.space_before_token = true;
2050
+ }
2051
+ } else if (this._flags.parent && this._flags.parent.class_start_block) {
2052
+ this._output.space_before_token = true;
2053
+ }
2054
+ }
2055
+ } else {
2056
+ this.allow_wrap_or_preserved_newline(current_token);
2057
+ }
2058
+ if (this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === "function" || this._flags.last_word === "typeof") || this._flags.last_token.text === "*" && (in_array(this._last_last_text, ["function", "yield"]) || this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ["{", ","]))) {
2059
+ this._output.space_before_token = this._options.space_after_anon_function;
2060
+ }
2061
+ }
2062
+ if (this._flags.last_token.text === ";" || this._flags.last_token.type === TOKEN.START_BLOCK) {
2063
+ this.print_newline();
2064
+ } else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === "." || this._flags.last_token.type === TOKEN.COMMA) {
2065
+ this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);
2066
+ }
2067
+ this.print_token(current_token);
2068
+ this.set_mode(next_mode);
2069
+ if (this._options.space_in_paren) {
2070
+ this._output.space_before_token = true;
2071
+ }
2072
+ this.indent();
2073
+ };
2074
+ Beautifier.prototype.handle_end_expr = function(current_token) {
2075
+ while (this._flags.mode === MODE.Statement) {
2076
+ this.restore_mode();
2077
+ }
2078
+ this.handle_whitespace_and_comments(current_token);
2079
+ if (this._flags.multiline_frame) {
2080
+ this.allow_wrap_or_preserved_newline(
2081
+ current_token,
2082
+ current_token.text === "]" && is_array(this._flags.mode) && !this._options.keep_array_indentation
2083
+ );
2084
+ }
2085
+ if (this._options.space_in_paren) {
2086
+ if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {
2087
+ this._output.trim();
2088
+ this._output.space_before_token = false;
2089
+ } else {
2090
+ this._output.space_before_token = true;
2091
+ }
2092
+ }
2093
+ this.deindent();
2094
+ this.print_token(current_token);
2095
+ this.restore_mode();
2096
+ remove_redundant_indentation(this._output, this._previous_flags);
2097
+ if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {
2098
+ this._previous_flags.mode = MODE.Expression;
2099
+ this._flags.do_block = false;
2100
+ this._flags.do_while = false;
2101
+ }
2102
+ };
2103
+ Beautifier.prototype.handle_start_block = function(current_token) {
2104
+ this.handle_whitespace_and_comments(current_token);
2105
+ var next_token = this._tokens.peek();
2106
+ var second_token = this._tokens.peek(1);
2107
+ if (this._flags.last_word === "switch" && this._flags.last_token.type === TOKEN.END_EXPR) {
2108
+ this.set_mode(MODE.BlockStatement);
2109
+ this._flags.in_case_statement = true;
2110
+ } else if (this._flags.case_body) {
2111
+ this.set_mode(MODE.BlockStatement);
2112
+ } else if (second_token && (in_array(second_token.text, [":", ","]) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED]) || in_array(next_token.text, ["get", "set", "..."]) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))) {
2113
+ if (in_array(this._last_last_text, ["class", "interface"]) && !in_array(second_token.text, [":", ","])) {
2114
+ this.set_mode(MODE.BlockStatement);
2115
+ } else {
2116
+ this.set_mode(MODE.ObjectLiteral);
2117
+ }
2118
+ } else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === "=>") {
2119
+ this.set_mode(MODE.BlockStatement);
2120
+ } else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) || reserved_array(this._flags.last_token, ["return", "throw", "import", "default"])) {
2121
+ this.set_mode(MODE.ObjectLiteral);
2122
+ } else {
2123
+ this.set_mode(MODE.BlockStatement);
2124
+ }
2125
+ if (this._flags.last_token) {
2126
+ if (reserved_array(this._flags.last_token.previous, ["class", "extends"])) {
2127
+ this._flags.class_start_block = true;
2128
+ }
2129
+ }
2130
+ var empty_braces = !next_token.comments_before && next_token.text === "}";
2131
+ var empty_anonymous_function = empty_braces && this._flags.last_word === "function" && this._flags.last_token.type === TOKEN.END_EXPR;
2132
+ if (this._options.brace_preserve_inline) {
2133
+ var index = 0;
2134
+ var check_token = null;
2135
+ this._flags.inline_frame = true;
2136
+ do {
2137
+ index += 1;
2138
+ check_token = this._tokens.peek(index - 1);
2139
+ if (check_token.newlines) {
2140
+ this._flags.inline_frame = false;
2141
+ break;
2142
+ }
2143
+ } while (check_token.type !== TOKEN.EOF && !(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));
2144
+ }
2145
+ if ((this._options.brace_style === "expand" || this._options.brace_style === "none" && current_token.newlines) && !this._flags.inline_frame) {
2146
+ if (this._flags.last_token.type !== TOKEN.OPERATOR && (empty_anonymous_function || this._flags.last_token.type === TOKEN.EQUALS || reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== "else")) {
2147
+ this._output.space_before_token = true;
2148
+ } else {
2149
+ this.print_newline(false, true);
2150
+ }
2151
+ } else {
2152
+ if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) {
2153
+ if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) {
2154
+ this._output.space_before_token = true;
2155
+ }
2156
+ if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame) {
2157
+ this.allow_wrap_or_preserved_newline(current_token);
2158
+ this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;
2159
+ this._flags.multiline_frame = false;
2160
+ }
2161
+ }
2162
+ if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) {
2163
+ if (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.SEMICOLON]) && !this._flags.inline_frame) {
2164
+ this.print_newline();
2165
+ } else {
2166
+ this._output.space_before_token = true;
2167
+ }
2168
+ }
2169
+ }
2170
+ this.print_token(current_token);
2171
+ this.indent();
2172
+ if (!empty_braces && !(this._options.brace_preserve_inline && this._flags.inline_frame)) {
2173
+ this.print_newline();
2174
+ }
2175
+ };
2176
+ Beautifier.prototype.handle_end_block = function(current_token) {
2177
+ this.handle_whitespace_and_comments(current_token);
2178
+ while (this._flags.mode === MODE.Statement) {
2179
+ this.restore_mode();
2180
+ }
2181
+ var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK;
2182
+ if (this._flags.inline_frame && !empty_braces) {
2183
+ this._output.space_before_token = true;
2184
+ } else if (this._options.brace_style === "expand") {
2185
+ if (!empty_braces) {
2186
+ this.print_newline();
2187
+ }
2188
+ } else {
2189
+ if (!empty_braces) {
2190
+ if (is_array(this._flags.mode) && this._options.keep_array_indentation) {
2191
+ this._options.keep_array_indentation = false;
2192
+ this.print_newline();
2193
+ this._options.keep_array_indentation = true;
2194
+ } else {
2195
+ this.print_newline();
2196
+ }
2197
+ }
2198
+ }
2199
+ this.restore_mode();
2200
+ this.print_token(current_token);
2201
+ };
2202
+ Beautifier.prototype.handle_word = function(current_token) {
2203
+ if (current_token.type === TOKEN.RESERVED) {
2204
+ if (in_array(current_token.text, ["set", "get"]) && this._flags.mode !== MODE.ObjectLiteral) {
2205
+ current_token.type = TOKEN.WORD;
2206
+ } else if (current_token.text === "import" && in_array(this._tokens.peek().text, ["(", "."])) {
2207
+ current_token.type = TOKEN.WORD;
2208
+ } else if (in_array(current_token.text, ["as", "from"]) && !this._flags.import_block) {
2209
+ current_token.type = TOKEN.WORD;
2210
+ } else if (this._flags.mode === MODE.ObjectLiteral) {
2211
+ var next_token = this._tokens.peek();
2212
+ if (next_token.text === ":") {
2213
+ current_token.type = TOKEN.WORD;
2214
+ }
2215
+ }
2216
+ }
2217
+ if (this.start_of_statement(current_token)) {
2218
+ if (reserved_array(this._flags.last_token, ["var", "let", "const"]) && current_token.type === TOKEN.WORD) {
2219
+ this._flags.declaration_statement = true;
2220
+ }
2221
+ } else if (current_token.newlines && !is_expression(this._flags.mode) && (this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === "--" || this._flags.last_token.text === "++")) && this._flags.last_token.type !== TOKEN.EQUALS && (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ["var", "let", "const", "set", "get"]))) {
2222
+ this.handle_whitespace_and_comments(current_token);
2223
+ this.print_newline();
2224
+ } else {
2225
+ this.handle_whitespace_and_comments(current_token);
2226
+ }
2227
+ if (this._flags.do_block && !this._flags.do_while) {
2228
+ if (reserved_word(current_token, "while")) {
2229
+ this._output.space_before_token = true;
2230
+ this.print_token(current_token);
2231
+ this._output.space_before_token = true;
2232
+ this._flags.do_while = true;
2233
+ return;
2234
+ } else {
2235
+ this.print_newline();
2236
+ this._flags.do_block = false;
2237
+ }
2238
+ }
2239
+ if (this._flags.if_block) {
2240
+ if (!this._flags.else_block && reserved_word(current_token, "else")) {
2241
+ this._flags.else_block = true;
2242
+ } else {
2243
+ while (this._flags.mode === MODE.Statement) {
2244
+ this.restore_mode();
2245
+ }
2246
+ this._flags.if_block = false;
2247
+ this._flags.else_block = false;
2248
+ }
2249
+ }
2250
+ if (this._flags.in_case_statement && reserved_array(current_token, ["case", "default"])) {
2251
+ this.print_newline();
2252
+ if (!this._flags.case_block && (this._flags.case_body || this._options.jslint_happy)) {
2253
+ this.deindent();
2254
+ }
2255
+ this._flags.case_body = false;
2256
+ this.print_token(current_token);
2257
+ this._flags.in_case = true;
2258
+ return;
2259
+ }
2260
+ if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
2261
+ if (!this.start_of_object_property() && !// start of object property is different for numeric values with +/- prefix operators
2262
+ (in_array(this._flags.last_token.text, ["+", "-"]) && this._last_last_text === ":" && this._flags.parent.mode === MODE.ObjectLiteral)) {
2263
+ this.allow_wrap_or_preserved_newline(current_token);
2264
+ }
2265
+ }
2266
+ if (reserved_word(current_token, "function")) {
2267
+ if (in_array(this._flags.last_token.text, ["}", ";"]) || this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ["(", "[", "{", ":", "=", ","]) || this._flags.last_token.type === TOKEN.OPERATOR)) {
2268
+ if (!this._output.just_added_blankline() && !current_token.comments_before) {
2269
+ this.print_newline();
2270
+ this.print_newline(true);
2271
+ }
2272
+ }
2273
+ if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) {
2274
+ if (reserved_array(this._flags.last_token, ["get", "set", "new", "export"]) || reserved_array(this._flags.last_token, newline_restricted_tokens)) {
2275
+ this._output.space_before_token = true;
2276
+ } else if (reserved_word(this._flags.last_token, "default") && this._last_last_text === "export") {
2277
+ this._output.space_before_token = true;
2278
+ } else if (this._flags.last_token.text === "declare") {
2279
+ this._output.space_before_token = true;
2280
+ } else {
2281
+ this.print_newline();
2282
+ }
2283
+ } else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === "=") {
2284
+ this._output.space_before_token = true;
2285
+ } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {
2286
+ } else {
2287
+ this.print_newline();
2288
+ }
2289
+ this.print_token(current_token);
2290
+ this._flags.last_word = current_token.text;
2291
+ return;
2292
+ }
2293
+ var prefix = "NONE";
2294
+ if (this._flags.last_token.type === TOKEN.END_BLOCK) {
2295
+ if (this._previous_flags.inline_frame) {
2296
+ prefix = "SPACE";
2297
+ } else if (!reserved_array(current_token, ["else", "catch", "finally", "from"])) {
2298
+ prefix = "NEWLINE";
2299
+ } else {
2300
+ if (this._options.brace_style === "expand" || this._options.brace_style === "end-expand" || this._options.brace_style === "none" && current_token.newlines) {
2301
+ prefix = "NEWLINE";
2302
+ } else {
2303
+ prefix = "SPACE";
2304
+ this._output.space_before_token = true;
2305
+ }
2306
+ }
2307
+ } else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {
2308
+ prefix = "NEWLINE";
2309
+ } else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {
2310
+ prefix = "SPACE";
2311
+ } else if (this._flags.last_token.type === TOKEN.STRING) {
2312
+ prefix = "NEWLINE";
2313
+ } else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === "*" && (in_array(this._last_last_text, ["function", "yield"]) || this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ["{", ","]))) {
2314
+ prefix = "SPACE";
2315
+ } else if (this._flags.last_token.type === TOKEN.START_BLOCK) {
2316
+ if (this._flags.inline_frame) {
2317
+ prefix = "SPACE";
2318
+ } else {
2319
+ prefix = "NEWLINE";
2320
+ }
2321
+ } else if (this._flags.last_token.type === TOKEN.END_EXPR) {
2322
+ this._output.space_before_token = true;
2323
+ prefix = "NEWLINE";
2324
+ }
2325
+ if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ")") {
2326
+ if (this._flags.inline_frame || this._flags.last_token.text === "else" || this._flags.last_token.text === "export") {
2327
+ prefix = "SPACE";
2328
+ } else {
2329
+ prefix = "NEWLINE";
2330
+ }
2331
+ }
2332
+ if (reserved_array(current_token, ["else", "catch", "finally"])) {
2333
+ if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) || this._options.brace_style === "expand" || this._options.brace_style === "end-expand" || this._options.brace_style === "none" && current_token.newlines) && !this._flags.inline_frame) {
2334
+ this.print_newline();
2335
+ } else {
2336
+ this._output.trim(true);
2337
+ var line = this._output.current_line;
2338
+ if (line.last() !== "}") {
2339
+ this.print_newline();
2340
+ }
2341
+ this._output.space_before_token = true;
2342
+ }
2343
+ } else if (prefix === "NEWLINE") {
2344
+ if (reserved_array(this._flags.last_token, special_words)) {
2345
+ this._output.space_before_token = true;
2346
+ } else if (this._flags.last_token.text === "declare" && reserved_array(current_token, ["var", "let", "const"])) {
2347
+ this._output.space_before_token = true;
2348
+ } else if (this._flags.last_token.type !== TOKEN.END_EXPR) {
2349
+ if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ["var", "let", "const"])) && this._flags.last_token.text !== ":") {
2350
+ if (reserved_word(current_token, "if") && reserved_word(current_token.previous, "else")) {
2351
+ this._output.space_before_token = true;
2352
+ } else {
2353
+ this.print_newline();
2354
+ }
2355
+ }
2356
+ } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ")") {
2357
+ this.print_newline();
2358
+ }
2359
+ } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === "," && this._last_last_text === "}") {
2360
+ this.print_newline();
2361
+ } else if (prefix === "SPACE") {
2362
+ this._output.space_before_token = true;
2363
+ }
2364
+ if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) {
2365
+ this._output.space_before_token = true;
2366
+ }
2367
+ this.print_token(current_token);
2368
+ this._flags.last_word = current_token.text;
2369
+ if (current_token.type === TOKEN.RESERVED) {
2370
+ if (current_token.text === "do") {
2371
+ this._flags.do_block = true;
2372
+ } else if (current_token.text === "if") {
2373
+ this._flags.if_block = true;
2374
+ } else if (current_token.text === "import") {
2375
+ this._flags.import_block = true;
2376
+ } else if (this._flags.import_block && reserved_word(current_token, "from")) {
2377
+ this._flags.import_block = false;
2378
+ }
2379
+ }
2380
+ };
2381
+ Beautifier.prototype.handle_semicolon = function(current_token) {
2382
+ if (this.start_of_statement(current_token)) {
2383
+ this._output.space_before_token = false;
2384
+ } else {
2385
+ this.handle_whitespace_and_comments(current_token);
2386
+ }
2387
+ var next_token = this._tokens.peek();
2388
+ while (this._flags.mode === MODE.Statement && !(this._flags.if_block && reserved_word(next_token, "else")) && !this._flags.do_block) {
2389
+ this.restore_mode();
2390
+ }
2391
+ if (this._flags.import_block) {
2392
+ this._flags.import_block = false;
2393
+ }
2394
+ this.print_token(current_token);
2395
+ };
2396
+ Beautifier.prototype.handle_string = function(current_token) {
2397
+ if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === "" && (current_token.previous.text === ")" || this._flags.last_token.type === TOKEN.WORD)) {
2398
+ } else if (this.start_of_statement(current_token)) {
2399
+ this._output.space_before_token = true;
2400
+ } else {
2401
+ this.handle_whitespace_and_comments(current_token);
2402
+ if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) {
2403
+ this._output.space_before_token = true;
2404
+ } else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
2405
+ if (!this.start_of_object_property()) {
2406
+ this.allow_wrap_or_preserved_newline(current_token);
2407
+ }
2408
+ } else if (current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN.END_EXPR && (current_token.previous.text === "]" || current_token.previous.text === ")") && current_token.newlines === 0) {
2409
+ this._output.space_before_token = true;
2410
+ } else {
2411
+ this.print_newline();
2412
+ }
2413
+ }
2414
+ this.print_token(current_token);
2415
+ };
2416
+ Beautifier.prototype.handle_equals = function(current_token) {
2417
+ if (this.start_of_statement(current_token)) {
2418
+ } else {
2419
+ this.handle_whitespace_and_comments(current_token);
2420
+ }
2421
+ if (this._flags.declaration_statement) {
2422
+ this._flags.declaration_assignment = true;
2423
+ }
2424
+ this._output.space_before_token = true;
2425
+ this.print_token(current_token);
2426
+ this._output.space_before_token = true;
2427
+ };
2428
+ Beautifier.prototype.handle_comma = function(current_token) {
2429
+ this.handle_whitespace_and_comments(current_token, true);
2430
+ this.print_token(current_token);
2431
+ this._output.space_before_token = true;
2432
+ if (this._flags.declaration_statement) {
2433
+ if (is_expression(this._flags.parent.mode)) {
2434
+ this._flags.declaration_assignment = false;
2435
+ }
2436
+ if (this._flags.declaration_assignment) {
2437
+ this._flags.declaration_assignment = false;
2438
+ this.print_newline(false, true);
2439
+ } else if (this._options.comma_first) {
2440
+ this.allow_wrap_or_preserved_newline(current_token);
2441
+ }
2442
+ } else if (this._flags.mode === MODE.ObjectLiteral || this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral) {
2443
+ if (this._flags.mode === MODE.Statement) {
2444
+ this.restore_mode();
2445
+ }
2446
+ if (!this._flags.inline_frame) {
2447
+ this.print_newline();
2448
+ }
2449
+ } else if (this._options.comma_first) {
2450
+ this.allow_wrap_or_preserved_newline(current_token);
2451
+ }
2452
+ };
2453
+ Beautifier.prototype.handle_operator = function(current_token) {
2454
+ var isGeneratorAsterisk = current_token.text === "*" && (reserved_array(this._flags.last_token, ["function", "yield"]) || in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]));
2455
+ var isUnary = in_array(current_token.text, ["-", "+"]) && (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) || in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === ",");
2456
+ if (this.start_of_statement(current_token)) {
2457
+ } else {
2458
+ var preserve_statement_flags = !isGeneratorAsterisk;
2459
+ this.handle_whitespace_and_comments(current_token, preserve_statement_flags);
2460
+ }
2461
+ if (current_token.text === "*" && this._flags.last_token.type === TOKEN.DOT) {
2462
+ this.print_token(current_token);
2463
+ return;
2464
+ }
2465
+ if (current_token.text === "::") {
2466
+ this.print_token(current_token);
2467
+ return;
2468
+ }
2469
+ if (in_array(current_token.text, ["-", "+"]) && this.start_of_object_property()) {
2470
+ this.print_token(current_token);
2471
+ return;
2472
+ }
2473
+ if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {
2474
+ this.allow_wrap_or_preserved_newline(current_token);
2475
+ }
2476
+ if (current_token.text === ":" && this._flags.in_case) {
2477
+ this.print_token(current_token);
2478
+ this._flags.in_case = false;
2479
+ this._flags.case_body = true;
2480
+ if (this._tokens.peek().type !== TOKEN.START_BLOCK) {
2481
+ this.indent();
2482
+ this.print_newline();
2483
+ this._flags.case_block = false;
2484
+ } else {
2485
+ this._flags.case_block = true;
2486
+ this._output.space_before_token = true;
2487
+ }
2488
+ return;
2489
+ }
2490
+ var space_before = true;
2491
+ var space_after = true;
2492
+ var in_ternary = false;
2493
+ if (current_token.text === ":") {
2494
+ if (this._flags.ternary_depth === 0) {
2495
+ space_before = false;
2496
+ } else {
2497
+ this._flags.ternary_depth -= 1;
2498
+ in_ternary = true;
2499
+ }
2500
+ } else if (current_token.text === "?") {
2501
+ this._flags.ternary_depth += 1;
2502
+ }
2503
+ if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {
2504
+ var isColon = current_token.text === ":";
2505
+ var isTernaryColon = isColon && in_ternary;
2506
+ var isOtherColon = isColon && !in_ternary;
2507
+ switch (this._options.operator_position) {
2508
+ case OPERATOR_POSITION.before_newline:
2509
+ this._output.space_before_token = !isOtherColon;
2510
+ this.print_token(current_token);
2511
+ if (!isColon || isTernaryColon) {
2512
+ this.allow_wrap_or_preserved_newline(current_token);
2513
+ }
2514
+ this._output.space_before_token = true;
2515
+ return;
2516
+ case OPERATOR_POSITION.after_newline:
2517
+ this._output.space_before_token = true;
2518
+ if (!isColon || isTernaryColon) {
2519
+ if (this._tokens.peek().newlines) {
2520
+ this.print_newline(false, true);
2521
+ } else {
2522
+ this.allow_wrap_or_preserved_newline(current_token);
2523
+ }
2524
+ } else {
2525
+ this._output.space_before_token = false;
2526
+ }
2527
+ this.print_token(current_token);
2528
+ this._output.space_before_token = true;
2529
+ return;
2530
+ case OPERATOR_POSITION.preserve_newline:
2531
+ if (!isOtherColon) {
2532
+ this.allow_wrap_or_preserved_newline(current_token);
2533
+ }
2534
+ space_before = !(this._output.just_added_newline() || isOtherColon);
2535
+ this._output.space_before_token = space_before;
2536
+ this.print_token(current_token);
2537
+ this._output.space_before_token = true;
2538
+ return;
2539
+ }
2540
+ }
2541
+ if (isGeneratorAsterisk) {
2542
+ this.allow_wrap_or_preserved_newline(current_token);
2543
+ space_before = false;
2544
+ var next_token = this._tokens.peek();
2545
+ space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);
2546
+ } else if (current_token.text === "...") {
2547
+ this.allow_wrap_or_preserved_newline(current_token);
2548
+ space_before = this._flags.last_token.type === TOKEN.START_BLOCK;
2549
+ space_after = false;
2550
+ } else if (in_array(current_token.text, ["--", "++", "!", "~"]) || isUnary) {
2551
+ if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) {
2552
+ this.allow_wrap_or_preserved_newline(current_token);
2553
+ }
2554
+ space_before = false;
2555
+ space_after = false;
2556
+ if (current_token.newlines && (current_token.text === "--" || current_token.text === "++" || current_token.text === "~")) {
2557
+ var new_line_needed = reserved_array(this._flags.last_token, special_words) && current_token.newlines;
2558
+ if (new_line_needed && (this._previous_flags.if_block || this._previous_flags.else_block)) {
2559
+ this.restore_mode();
2560
+ }
2561
+ this.print_newline(new_line_needed, true);
2562
+ }
2563
+ if (this._flags.last_token.text === ";" && is_expression(this._flags.mode)) {
2564
+ space_before = true;
2565
+ }
2566
+ if (this._flags.last_token.type === TOKEN.RESERVED) {
2567
+ space_before = true;
2568
+ } else if (this._flags.last_token.type === TOKEN.END_EXPR) {
2569
+ space_before = !(this._flags.last_token.text === "]" && (current_token.text === "--" || current_token.text === "++"));
2570
+ } else if (this._flags.last_token.type === TOKEN.OPERATOR) {
2571
+ space_before = in_array(current_token.text, ["--", "-", "++", "+"]) && in_array(this._flags.last_token.text, ["--", "-", "++", "+"]);
2572
+ if (in_array(current_token.text, ["+", "-"]) && in_array(this._flags.last_token.text, ["--", "++"])) {
2573
+ space_after = true;
2574
+ }
2575
+ }
2576
+ if ((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame || this._flags.mode === MODE.Statement) && (this._flags.last_token.text === "{" || this._flags.last_token.text === ";")) {
2577
+ this.print_newline();
2578
+ }
2579
+ }
2580
+ this._output.space_before_token = this._output.space_before_token || space_before;
2581
+ this.print_token(current_token);
2582
+ this._output.space_before_token = space_after;
2583
+ };
2584
+ Beautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {
2585
+ if (this._output.raw) {
2586
+ this._output.add_raw_token(current_token);
2587
+ if (current_token.directives && current_token.directives.preserve === "end") {
2588
+ this._output.raw = this._options.test_output_raw;
2589
+ }
2590
+ return;
2591
+ }
2592
+ if (current_token.directives) {
2593
+ this.print_newline(false, preserve_statement_flags);
2594
+ this.print_token(current_token);
2595
+ if (current_token.directives.preserve === "start") {
2596
+ this._output.raw = true;
2597
+ }
2598
+ this.print_newline(false, true);
2599
+ return;
2600
+ }
2601
+ if (!acorn.newline.test(current_token.text) && !current_token.newlines) {
2602
+ this._output.space_before_token = true;
2603
+ this.print_token(current_token);
2604
+ this._output.space_before_token = true;
2605
+ return;
2606
+ } else {
2607
+ this.print_block_commment(current_token, preserve_statement_flags);
2608
+ }
2609
+ };
2610
+ Beautifier.prototype.print_block_commment = function(current_token, preserve_statement_flags) {
2611
+ var lines = split_linebreaks(current_token.text);
2612
+ var j;
2613
+ var javadoc = false;
2614
+ var starless = false;
2615
+ var lastIndent = current_token.whitespace_before;
2616
+ var lastIndentLength = lastIndent.length;
2617
+ this.print_newline(false, preserve_statement_flags);
2618
+ this.print_token_line_indentation(current_token);
2619
+ this._output.add_token(lines[0]);
2620
+ this.print_newline(false, preserve_statement_flags);
2621
+ if (lines.length > 1) {
2622
+ lines = lines.slice(1);
2623
+ javadoc = all_lines_start_with(lines, "*");
2624
+ starless = each_line_matches_indent(lines, lastIndent);
2625
+ if (javadoc) {
2626
+ this._flags.alignment = 1;
2627
+ }
2628
+ for (j = 0; j < lines.length; j++) {
2629
+ if (javadoc) {
2630
+ this.print_token_line_indentation(current_token);
2631
+ this._output.add_token(ltrim(lines[j]));
2632
+ } else if (starless && lines[j]) {
2633
+ this.print_token_line_indentation(current_token);
2634
+ this._output.add_token(lines[j].substring(lastIndentLength));
2635
+ } else {
2636
+ this._output.current_line.set_indent(-1);
2637
+ this._output.add_token(lines[j]);
2638
+ }
2639
+ this.print_newline(false, preserve_statement_flags);
2640
+ }
2641
+ this._flags.alignment = 0;
2642
+ }
2643
+ };
2644
+ Beautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {
2645
+ if (current_token.newlines) {
2646
+ this.print_newline(false, preserve_statement_flags);
2647
+ } else {
2648
+ this._output.trim(true);
2649
+ }
2650
+ this._output.space_before_token = true;
2651
+ this.print_token(current_token);
2652
+ this.print_newline(false, preserve_statement_flags);
2653
+ };
2654
+ Beautifier.prototype.handle_dot = function(current_token) {
2655
+ if (this.start_of_statement(current_token)) {
2656
+ } else {
2657
+ this.handle_whitespace_and_comments(current_token, true);
2658
+ }
2659
+ if (this._flags.last_token.text.match("^[0-9]+$")) {
2660
+ this._output.space_before_token = true;
2661
+ }
2662
+ if (reserved_array(this._flags.last_token, special_words)) {
2663
+ this._output.space_before_token = false;
2664
+ } else {
2665
+ this.allow_wrap_or_preserved_newline(
2666
+ current_token,
2667
+ this._flags.last_token.text === ")" && this._options.break_chained_methods
2668
+ );
2669
+ }
2670
+ if (this._options.unindent_chained_methods && this._output.just_added_newline()) {
2671
+ this.deindent();
2672
+ }
2673
+ this.print_token(current_token);
2674
+ };
2675
+ Beautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {
2676
+ this.print_token(current_token);
2677
+ if (current_token.text[current_token.text.length - 1] === "\n") {
2678
+ this.print_newline(false, preserve_statement_flags);
2679
+ }
2680
+ };
2681
+ Beautifier.prototype.handle_eof = function(current_token) {
2682
+ while (this._flags.mode === MODE.Statement) {
2683
+ this.restore_mode();
2684
+ }
2685
+ this.handle_whitespace_and_comments(current_token);
2686
+ };
2687
+ module.exports.Beautifier = Beautifier;
2688
+ }
2689
+ });
2690
+
2691
+ // node_modules/js-beautify/js/src/javascript/index.js
2692
+ var require_javascript = __commonJS({
2693
+ "node_modules/js-beautify/js/src/javascript/index.js"(exports, module) {
2694
+ "use strict";
2695
+ var Beautifier = require_beautifier().Beautifier;
2696
+ var Options = require_options2().Options;
2697
+ function js_beautify(js_source_text, options) {
2698
+ var beautifier = new Beautifier(js_source_text, options);
2699
+ return beautifier.beautify();
2700
+ }
2701
+ module.exports = js_beautify;
2702
+ module.exports.defaultOptions = function() {
2703
+ return new Options();
2704
+ };
2705
+ }
2706
+ });
2707
+
2708
+ // node_modules/js-beautify/js/src/css/options.js
2709
+ var require_options3 = __commonJS({
2710
+ "node_modules/js-beautify/js/src/css/options.js"(exports, module) {
2711
+ "use strict";
2712
+ var BaseOptions = require_options().Options;
2713
+ function Options(options) {
2714
+ BaseOptions.call(this, options, "css");
2715
+ this.selector_separator_newline = this._get_boolean("selector_separator_newline", true);
2716
+ this.newline_between_rules = this._get_boolean("newline_between_rules", true);
2717
+ var space_around_selector_separator = this._get_boolean("space_around_selector_separator");
2718
+ this.space_around_combinator = this._get_boolean("space_around_combinator") || space_around_selector_separator;
2719
+ var brace_style_split = this._get_selection_list("brace_style", ["collapse", "expand", "end-expand", "none", "preserve-inline"]);
2720
+ this.brace_style = "collapse";
2721
+ for (var bs = 0; bs < brace_style_split.length; bs++) {
2722
+ if (brace_style_split[bs] !== "expand") {
2723
+ this.brace_style = "collapse";
2724
+ } else {
2725
+ this.brace_style = brace_style_split[bs];
2726
+ }
2727
+ }
2728
+ }
2729
+ Options.prototype = new BaseOptions();
2730
+ module.exports.Options = Options;
2731
+ }
2732
+ });
2733
+
2734
+ // node_modules/js-beautify/js/src/css/beautifier.js
2735
+ var require_beautifier2 = __commonJS({
2736
+ "node_modules/js-beautify/js/src/css/beautifier.js"(exports, module) {
2737
+ "use strict";
2738
+ var Options = require_options3().Options;
2739
+ var Output = require_output().Output;
2740
+ var InputScanner = require_inputscanner().InputScanner;
2741
+ var Directives = require_directives().Directives;
2742
+ var directives_core = new Directives(/\/\*/, /\*\//);
2743
+ var lineBreak = /\r\n|[\r\n]/;
2744
+ var allLineBreaks = /\r\n|[\r\n]/g;
2745
+ var whitespaceChar = /\s/;
2746
+ var whitespacePattern = /(?:\s|\n)+/g;
2747
+ var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g;
2748
+ var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g;
2749
+ function Beautifier(source_text, options) {
2750
+ this._source_text = source_text || "";
2751
+ this._options = new Options(options);
2752
+ this._ch = null;
2753
+ this._input = null;
2754
+ this.NESTED_AT_RULE = {
2755
+ "page": true,
2756
+ "font-face": true,
2757
+ "keyframes": true,
2758
+ // also in CONDITIONAL_GROUP_RULE below
2759
+ "media": true,
2760
+ "supports": true,
2761
+ "document": true
2762
+ };
2763
+ this.CONDITIONAL_GROUP_RULE = {
2764
+ "media": true,
2765
+ "supports": true,
2766
+ "document": true
2767
+ };
2768
+ this.NON_SEMICOLON_NEWLINE_PROPERTY = [
2769
+ "grid-template-areas",
2770
+ "grid-template"
2771
+ ];
2772
+ }
2773
+ Beautifier.prototype.eatString = function(endChars) {
2774
+ var result = "";
2775
+ this._ch = this._input.next();
2776
+ while (this._ch) {
2777
+ result += this._ch;
2778
+ if (this._ch === "\\") {
2779
+ result += this._input.next();
2780
+ } else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") {
2781
+ break;
2782
+ }
2783
+ this._ch = this._input.next();
2784
+ }
2785
+ return result;
2786
+ };
2787
+ Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {
2788
+ var result = whitespaceChar.test(this._input.peek());
2789
+ var newline_count = 0;
2790
+ while (whitespaceChar.test(this._input.peek())) {
2791
+ this._ch = this._input.next();
2792
+ if (allowAtLeastOneNewLine && this._ch === "\n") {
2793
+ if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {
2794
+ newline_count++;
2795
+ this._output.add_new_line(true);
2796
+ }
2797
+ }
2798
+ }
2799
+ return result;
2800
+ };
2801
+ Beautifier.prototype.foundNestedPseudoClass = function() {
2802
+ var openParen = 0;
2803
+ var i = 1;
2804
+ var ch = this._input.peek(i);
2805
+ while (ch) {
2806
+ if (ch === "{") {
2807
+ return true;
2808
+ } else if (ch === "(") {
2809
+ openParen += 1;
2810
+ } else if (ch === ")") {
2811
+ if (openParen === 0) {
2812
+ return false;
2813
+ }
2814
+ openParen -= 1;
2815
+ } else if (ch === ";" || ch === "}") {
2816
+ return false;
2817
+ }
2818
+ i++;
2819
+ ch = this._input.peek(i);
2820
+ }
2821
+ return false;
2822
+ };
2823
+ Beautifier.prototype.print_string = function(output_string) {
2824
+ this._output.set_indent(this._indentLevel);
2825
+ this._output.non_breaking_space = true;
2826
+ this._output.add_token(output_string);
2827
+ };
2828
+ Beautifier.prototype.preserveSingleSpace = function(isAfterSpace) {
2829
+ if (isAfterSpace) {
2830
+ this._output.space_before_token = true;
2831
+ }
2832
+ };
2833
+ Beautifier.prototype.indent = function() {
2834
+ this._indentLevel++;
2835
+ };
2836
+ Beautifier.prototype.outdent = function() {
2837
+ if (this._indentLevel > 0) {
2838
+ this._indentLevel--;
2839
+ }
2840
+ };
2841
+ Beautifier.prototype.beautify = function() {
2842
+ if (this._options.disabled) {
2843
+ return this._source_text;
2844
+ }
2845
+ var source_text = this._source_text;
2846
+ var eol = this._options.eol;
2847
+ if (eol === "auto") {
2848
+ eol = "\n";
2849
+ if (source_text && lineBreak.test(source_text || "")) {
2850
+ eol = source_text.match(lineBreak)[0];
2851
+ }
2852
+ }
2853
+ source_text = source_text.replace(allLineBreaks, "\n");
2854
+ var baseIndentString = source_text.match(/^[\t ]*/)[0];
2855
+ this._output = new Output(this._options, baseIndentString);
2856
+ this._input = new InputScanner(source_text);
2857
+ this._indentLevel = 0;
2858
+ this._nestedLevel = 0;
2859
+ this._ch = null;
2860
+ var parenLevel = 0;
2861
+ var insideRule = false;
2862
+ var insidePropertyValue = false;
2863
+ var enteringConditionalGroup = false;
2864
+ var insideNonNestedAtRule = false;
2865
+ var insideScssMap = false;
2866
+ var topCharacter = this._ch;
2867
+ var insideNonSemiColonValues = false;
2868
+ var whitespace;
2869
+ var isAfterSpace;
2870
+ var previous_ch;
2871
+ while (true) {
2872
+ whitespace = this._input.read(whitespacePattern);
2873
+ isAfterSpace = whitespace !== "";
2874
+ previous_ch = topCharacter;
2875
+ this._ch = this._input.next();
2876
+ if (this._ch === "\\" && this._input.hasNext()) {
2877
+ this._ch += this._input.next();
2878
+ }
2879
+ topCharacter = this._ch;
2880
+ if (!this._ch) {
2881
+ break;
2882
+ } else if (this._ch === "/" && this._input.peek() === "*") {
2883
+ this._output.add_new_line();
2884
+ this._input.back();
2885
+ var comment = this._input.read(block_comment_pattern);
2886
+ var directives = directives_core.get_directives(comment);
2887
+ if (directives && directives.ignore === "start") {
2888
+ comment += directives_core.readIgnored(this._input);
2889
+ }
2890
+ this.print_string(comment);
2891
+ this.eatWhitespace(true);
2892
+ this._output.add_new_line();
2893
+ } else if (this._ch === "/" && this._input.peek() === "/") {
2894
+ this._output.space_before_token = true;
2895
+ this._input.back();
2896
+ this.print_string(this._input.read(comment_pattern));
2897
+ this.eatWhitespace(true);
2898
+ } else if (this._ch === "$") {
2899
+ this.preserveSingleSpace(isAfterSpace);
2900
+ this.print_string(this._ch);
2901
+ var variable = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
2902
+ if (variable.match(/[ :]$/)) {
2903
+ variable = this.eatString(": ").replace(/\s+$/, "");
2904
+ this.print_string(variable);
2905
+ this._output.space_before_token = true;
2906
+ }
2907
+ if (parenLevel === 0 && variable.indexOf(":") !== -1) {
2908
+ insidePropertyValue = true;
2909
+ this.indent();
2910
+ }
2911
+ } else if (this._ch === "@") {
2912
+ this.preserveSingleSpace(isAfterSpace);
2913
+ if (this._input.peek() === "{") {
2914
+ this.print_string(this._ch + this.eatString("}"));
2915
+ } else {
2916
+ this.print_string(this._ch);
2917
+ var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
2918
+ if (variableOrRule.match(/[ :]$/)) {
2919
+ variableOrRule = this.eatString(": ").replace(/\s+$/, "");
2920
+ this.print_string(variableOrRule);
2921
+ this._output.space_before_token = true;
2922
+ }
2923
+ if (parenLevel === 0 && variableOrRule.indexOf(":") !== -1) {
2924
+ insidePropertyValue = true;
2925
+ this.indent();
2926
+ } else if (variableOrRule in this.NESTED_AT_RULE) {
2927
+ this._nestedLevel += 1;
2928
+ if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {
2929
+ enteringConditionalGroup = true;
2930
+ }
2931
+ } else if (parenLevel === 0 && !insidePropertyValue) {
2932
+ insideNonNestedAtRule = true;
2933
+ }
2934
+ }
2935
+ } else if (this._ch === "#" && this._input.peek() === "{") {
2936
+ this.preserveSingleSpace(isAfterSpace);
2937
+ this.print_string(this._ch + this.eatString("}"));
2938
+ } else if (this._ch === "{") {
2939
+ if (insidePropertyValue) {
2940
+ insidePropertyValue = false;
2941
+ this.outdent();
2942
+ }
2943
+ insideNonNestedAtRule = false;
2944
+ if (enteringConditionalGroup) {
2945
+ enteringConditionalGroup = false;
2946
+ insideRule = this._indentLevel >= this._nestedLevel;
2947
+ } else {
2948
+ insideRule = this._indentLevel >= this._nestedLevel - 1;
2949
+ }
2950
+ if (this._options.newline_between_rules && insideRule) {
2951
+ if (this._output.previous_line && this._output.previous_line.item(-1) !== "{") {
2952
+ this._output.ensure_empty_line_above("/", ",");
2953
+ }
2954
+ }
2955
+ this._output.space_before_token = true;
2956
+ if (this._options.brace_style === "expand") {
2957
+ this._output.add_new_line();
2958
+ this.print_string(this._ch);
2959
+ this.indent();
2960
+ this._output.set_indent(this._indentLevel);
2961
+ } else {
2962
+ if (previous_ch === "(") {
2963
+ this._output.space_before_token = false;
2964
+ } else if (previous_ch !== ",") {
2965
+ this.indent();
2966
+ }
2967
+ this.print_string(this._ch);
2968
+ }
2969
+ this.eatWhitespace(true);
2970
+ this._output.add_new_line();
2971
+ } else if (this._ch === "}") {
2972
+ this.outdent();
2973
+ this._output.add_new_line();
2974
+ if (previous_ch === "{") {
2975
+ this._output.trim(true);
2976
+ }
2977
+ if (insidePropertyValue) {
2978
+ this.outdent();
2979
+ insidePropertyValue = false;
2980
+ }
2981
+ this.print_string(this._ch);
2982
+ insideRule = false;
2983
+ if (this._nestedLevel) {
2984
+ this._nestedLevel--;
2985
+ }
2986
+ this.eatWhitespace(true);
2987
+ this._output.add_new_line();
2988
+ if (this._options.newline_between_rules && !this._output.just_added_blankline()) {
2989
+ if (this._input.peek() !== "}") {
2990
+ this._output.add_new_line(true);
2991
+ }
2992
+ }
2993
+ if (this._input.peek() === ")") {
2994
+ this._output.trim(true);
2995
+ if (this._options.brace_style === "expand") {
2996
+ this._output.add_new_line(true);
2997
+ }
2998
+ }
2999
+ } else if (this._ch === ":") {
3000
+ for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) {
3001
+ if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) {
3002
+ insideNonSemiColonValues = true;
3003
+ break;
3004
+ }
3005
+ }
3006
+ if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideNonNestedAtRule && parenLevel === 0) {
3007
+ this.print_string(":");
3008
+ if (!insidePropertyValue) {
3009
+ insidePropertyValue = true;
3010
+ this._output.space_before_token = true;
3011
+ this.eatWhitespace(true);
3012
+ this.indent();
3013
+ }
3014
+ } else {
3015
+ if (this._input.lookBack(" ")) {
3016
+ this._output.space_before_token = true;
3017
+ }
3018
+ if (this._input.peek() === ":") {
3019
+ this._ch = this._input.next();
3020
+ this.print_string("::");
3021
+ } else {
3022
+ this.print_string(":");
3023
+ }
3024
+ }
3025
+ } else if (this._ch === '"' || this._ch === "'") {
3026
+ var preserveQuoteSpace = previous_ch === '"' || previous_ch === "'";
3027
+ this.preserveSingleSpace(preserveQuoteSpace || isAfterSpace);
3028
+ this.print_string(this._ch + this.eatString(this._ch));
3029
+ this.eatWhitespace(true);
3030
+ } else if (this._ch === ";") {
3031
+ insideNonSemiColonValues = false;
3032
+ if (parenLevel === 0) {
3033
+ if (insidePropertyValue) {
3034
+ this.outdent();
3035
+ insidePropertyValue = false;
3036
+ }
3037
+ insideNonNestedAtRule = false;
3038
+ this.print_string(this._ch);
3039
+ this.eatWhitespace(true);
3040
+ if (this._input.peek() !== "/") {
3041
+ this._output.add_new_line();
3042
+ }
3043
+ } else {
3044
+ this.print_string(this._ch);
3045
+ this.eatWhitespace(true);
3046
+ this._output.space_before_token = true;
3047
+ }
3048
+ } else if (this._ch === "(") {
3049
+ if (this._input.lookBack("url")) {
3050
+ this.print_string(this._ch);
3051
+ this.eatWhitespace();
3052
+ parenLevel++;
3053
+ this.indent();
3054
+ this._ch = this._input.next();
3055
+ if (this._ch === ")" || this._ch === '"' || this._ch === "'") {
3056
+ this._input.back();
3057
+ } else if (this._ch) {
3058
+ this.print_string(this._ch + this.eatString(")"));
3059
+ if (parenLevel) {
3060
+ parenLevel--;
3061
+ this.outdent();
3062
+ }
3063
+ }
3064
+ } else {
3065
+ var space_needed = false;
3066
+ if (this._input.lookBack("with")) {
3067
+ space_needed = true;
3068
+ }
3069
+ this.preserveSingleSpace(isAfterSpace || space_needed);
3070
+ this.print_string(this._ch);
3071
+ if (insidePropertyValue && previous_ch === "$" && this._options.selector_separator_newline) {
3072
+ this._output.add_new_line();
3073
+ insideScssMap = true;
3074
+ } else {
3075
+ this.eatWhitespace();
3076
+ parenLevel++;
3077
+ this.indent();
3078
+ }
3079
+ }
3080
+ } else if (this._ch === ")") {
3081
+ if (parenLevel) {
3082
+ parenLevel--;
3083
+ this.outdent();
3084
+ }
3085
+ if (insideScssMap && this._input.peek() === ";" && this._options.selector_separator_newline) {
3086
+ insideScssMap = false;
3087
+ this.outdent();
3088
+ this._output.add_new_line();
3089
+ }
3090
+ this.print_string(this._ch);
3091
+ } else if (this._ch === ",") {
3092
+ this.print_string(this._ch);
3093
+ this.eatWhitespace(true);
3094
+ if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideNonNestedAtRule) {
3095
+ this._output.add_new_line();
3096
+ } else {
3097
+ this._output.space_before_token = true;
3098
+ }
3099
+ } else if ((this._ch === ">" || this._ch === "+" || this._ch === "~") && !insidePropertyValue && parenLevel === 0) {
3100
+ if (this._options.space_around_combinator) {
3101
+ this._output.space_before_token = true;
3102
+ this.print_string(this._ch);
3103
+ this._output.space_before_token = true;
3104
+ } else {
3105
+ this.print_string(this._ch);
3106
+ this.eatWhitespace();
3107
+ if (this._ch && whitespaceChar.test(this._ch)) {
3108
+ this._ch = "";
3109
+ }
3110
+ }
3111
+ } else if (this._ch === "]") {
3112
+ this.print_string(this._ch);
3113
+ } else if (this._ch === "[") {
3114
+ this.preserveSingleSpace(isAfterSpace);
3115
+ this.print_string(this._ch);
3116
+ } else if (this._ch === "=") {
3117
+ this.eatWhitespace();
3118
+ this.print_string("=");
3119
+ if (whitespaceChar.test(this._ch)) {
3120
+ this._ch = "";
3121
+ }
3122
+ } else if (this._ch === "!" && !this._input.lookBack("\\")) {
3123
+ this._output.space_before_token = true;
3124
+ this.print_string(this._ch);
3125
+ } else {
3126
+ var preserveAfterSpace = previous_ch === '"' || previous_ch === "'";
3127
+ this.preserveSingleSpace(preserveAfterSpace || isAfterSpace);
3128
+ this.print_string(this._ch);
3129
+ if (!this._output.just_added_newline() && this._input.peek() === "\n" && insideNonSemiColonValues) {
3130
+ this._output.add_new_line();
3131
+ }
3132
+ }
3133
+ }
3134
+ var sweetCode = this._output.get_code(eol);
3135
+ return sweetCode;
3136
+ };
3137
+ module.exports.Beautifier = Beautifier;
3138
+ }
3139
+ });
3140
+
3141
+ // node_modules/js-beautify/js/src/css/index.js
3142
+ var require_css = __commonJS({
3143
+ "node_modules/js-beautify/js/src/css/index.js"(exports, module) {
3144
+ "use strict";
3145
+ var Beautifier = require_beautifier2().Beautifier;
3146
+ var Options = require_options3().Options;
3147
+ function css_beautify(source_text, options) {
3148
+ var beautifier = new Beautifier(source_text, options);
3149
+ return beautifier.beautify();
3150
+ }
3151
+ module.exports = css_beautify;
3152
+ module.exports.defaultOptions = function() {
3153
+ return new Options();
3154
+ };
3155
+ }
3156
+ });
3157
+
3158
+ // node_modules/js-beautify/js/src/html/options.js
3159
+ var require_options4 = __commonJS({
3160
+ "node_modules/js-beautify/js/src/html/options.js"(exports, module) {
3161
+ "use strict";
3162
+ var BaseOptions = require_options().Options;
3163
+ function Options(options) {
3164
+ BaseOptions.call(this, options, "html");
3165
+ if (this.templating.length === 1 && this.templating[0] === "auto") {
3166
+ this.templating = ["django", "erb", "handlebars", "php"];
3167
+ }
3168
+ this.indent_inner_html = this._get_boolean("indent_inner_html");
3169
+ this.indent_body_inner_html = this._get_boolean("indent_body_inner_html", true);
3170
+ this.indent_head_inner_html = this._get_boolean("indent_head_inner_html", true);
3171
+ this.indent_handlebars = this._get_boolean("indent_handlebars", true);
3172
+ this.wrap_attributes = this._get_selection(
3173
+ "wrap_attributes",
3174
+ ["auto", "force", "force-aligned", "force-expand-multiline", "aligned-multiple", "preserve", "preserve-aligned"]
3175
+ );
3176
+ this.wrap_attributes_min_attrs = this._get_number("wrap_attributes_min_attrs", 2);
3177
+ this.wrap_attributes_indent_size = this._get_number("wrap_attributes_indent_size", this.indent_size);
3178
+ this.extra_liners = this._get_array("extra_liners", ["head", "body", "/html"]);
3179
+ this.inline = this._get_array("inline", [
3180
+ "a",
3181
+ "abbr",
3182
+ "area",
3183
+ "audio",
3184
+ "b",
3185
+ "bdi",
3186
+ "bdo",
3187
+ "br",
3188
+ "button",
3189
+ "canvas",
3190
+ "cite",
3191
+ "code",
3192
+ "data",
3193
+ "datalist",
3194
+ "del",
3195
+ "dfn",
3196
+ "em",
3197
+ "embed",
3198
+ "i",
3199
+ "iframe",
3200
+ "img",
3201
+ "input",
3202
+ "ins",
3203
+ "kbd",
3204
+ "keygen",
3205
+ "label",
3206
+ "map",
3207
+ "mark",
3208
+ "math",
3209
+ "meter",
3210
+ "noscript",
3211
+ "object",
3212
+ "output",
3213
+ "progress",
3214
+ "q",
3215
+ "ruby",
3216
+ "s",
3217
+ "samp",
3218
+ /* 'script', */
3219
+ "select",
3220
+ "small",
3221
+ "span",
3222
+ "strong",
3223
+ "sub",
3224
+ "sup",
3225
+ "svg",
3226
+ "template",
3227
+ "textarea",
3228
+ "time",
3229
+ "u",
3230
+ "var",
3231
+ "video",
3232
+ "wbr",
3233
+ "text",
3234
+ // obsolete inline tags
3235
+ "acronym",
3236
+ "big",
3237
+ "strike",
3238
+ "tt"
3239
+ ]);
3240
+ this.inline_custom_elements = this._get_boolean("inline_custom_elements", true);
3241
+ this.void_elements = this._get_array("void_elements", [
3242
+ // HTLM void elements - aka self-closing tags - aka singletons
3243
+ // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
3244
+ "area",
3245
+ "base",
3246
+ "br",
3247
+ "col",
3248
+ "embed",
3249
+ "hr",
3250
+ "img",
3251
+ "input",
3252
+ "keygen",
3253
+ "link",
3254
+ "menuitem",
3255
+ "meta",
3256
+ "param",
3257
+ "source",
3258
+ "track",
3259
+ "wbr",
3260
+ // NOTE: Optional tags are too complex for a simple list
3261
+ // they are hard coded in _do_optional_end_element
3262
+ // Doctype and xml elements
3263
+ "!doctype",
3264
+ "?xml",
3265
+ // obsolete tags
3266
+ // basefont: https://www.computerhope.com/jargon/h/html-basefont-tag.htm
3267
+ // isndex: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex
3268
+ "basefont",
3269
+ "isindex"
3270
+ ]);
3271
+ this.unformatted = this._get_array("unformatted", []);
3272
+ this.content_unformatted = this._get_array("content_unformatted", [
3273
+ "pre",
3274
+ "textarea"
3275
+ ]);
3276
+ this.unformatted_content_delimiter = this._get_characters("unformatted_content_delimiter");
3277
+ this.indent_scripts = this._get_selection("indent_scripts", ["normal", "keep", "separate"]);
3278
+ }
3279
+ Options.prototype = new BaseOptions();
3280
+ module.exports.Options = Options;
3281
+ }
3282
+ });
3283
+
3284
+ // node_modules/js-beautify/js/src/html/tokenizer.js
3285
+ var require_tokenizer3 = __commonJS({
3286
+ "node_modules/js-beautify/js/src/html/tokenizer.js"(exports, module) {
3287
+ "use strict";
3288
+ var BaseTokenizer = require_tokenizer().Tokenizer;
3289
+ var BASETOKEN = require_tokenizer().TOKEN;
3290
+ var Directives = require_directives().Directives;
3291
+ var TemplatablePattern = require_templatablepattern().TemplatablePattern;
3292
+ var Pattern = require_pattern().Pattern;
3293
+ var TOKEN = {
3294
+ TAG_OPEN: "TK_TAG_OPEN",
3295
+ TAG_CLOSE: "TK_TAG_CLOSE",
3296
+ CONTROL_FLOW_OPEN: "TK_CONTROL_FLOW_OPEN",
3297
+ CONTROL_FLOW_CLOSE: "TK_CONTROL_FLOW_CLOSE",
3298
+ ATTRIBUTE: "TK_ATTRIBUTE",
3299
+ EQUALS: "TK_EQUALS",
3300
+ VALUE: "TK_VALUE",
3301
+ COMMENT: "TK_COMMENT",
3302
+ TEXT: "TK_TEXT",
3303
+ UNKNOWN: "TK_UNKNOWN",
3304
+ START: BASETOKEN.START,
3305
+ RAW: BASETOKEN.RAW,
3306
+ EOF: BASETOKEN.EOF
3307
+ };
3308
+ var directives_core = new Directives(/<\!--/, /-->/);
3309
+ var Tokenizer = function(input_string, options) {
3310
+ BaseTokenizer.call(this, input_string, options);
3311
+ this._current_tag_name = "";
3312
+ var templatable_reader = new TemplatablePattern(this._input).read_options(this._options);
3313
+ var pattern_reader = new Pattern(this._input);
3314
+ this.__patterns = {
3315
+ word: templatable_reader.until(/[\n\r\t <]/),
3316
+ word_control_flow_close_excluded: templatable_reader.until(/[\n\r\t <}]/),
3317
+ single_quote: templatable_reader.until_after(/'/),
3318
+ double_quote: templatable_reader.until_after(/"/),
3319
+ attribute: templatable_reader.until(/[\n\r\t =>]|\/>/),
3320
+ element_name: templatable_reader.until(/[\n\r\t >\/]/),
3321
+ angular_control_flow_start: pattern_reader.matching(/\@[a-zA-Z]+[^({]*[({]/),
3322
+ handlebars_comment: pattern_reader.starting_with(/{{!--/).until_after(/--}}/),
3323
+ handlebars: pattern_reader.starting_with(/{{/).until_after(/}}/),
3324
+ handlebars_open: pattern_reader.until(/[\n\r\t }]/),
3325
+ handlebars_raw_close: pattern_reader.until(/}}/),
3326
+ comment: pattern_reader.starting_with(/<!--/).until_after(/-->/),
3327
+ cdata: pattern_reader.starting_with(/<!\[CDATA\[/).until_after(/]]>/),
3328
+ // https://en.wikipedia.org/wiki/Conditional_comment
3329
+ conditional_comment: pattern_reader.starting_with(/<!\[/).until_after(/]>/),
3330
+ processing: pattern_reader.starting_with(/<\?/).until_after(/\?>/)
3331
+ };
3332
+ if (this._options.indent_handlebars) {
3333
+ this.__patterns.word = this.__patterns.word.exclude("handlebars");
3334
+ this.__patterns.word_control_flow_close_excluded = this.__patterns.word_control_flow_close_excluded.exclude("handlebars");
3335
+ }
3336
+ this._unformatted_content_delimiter = null;
3337
+ if (this._options.unformatted_content_delimiter) {
3338
+ var literal_regexp = this._input.get_literal_regexp(this._options.unformatted_content_delimiter);
3339
+ this.__patterns.unformatted_content_delimiter = pattern_reader.matching(literal_regexp).until_after(literal_regexp);
3340
+ }
3341
+ };
3342
+ Tokenizer.prototype = new BaseTokenizer();
3343
+ Tokenizer.prototype._is_comment = function(current_token) {
3344
+ return false;
3345
+ };
3346
+ Tokenizer.prototype._is_opening = function(current_token) {
3347
+ return current_token.type === TOKEN.TAG_OPEN || current_token.type === TOKEN.CONTROL_FLOW_OPEN;
3348
+ };
3349
+ Tokenizer.prototype._is_closing = function(current_token, open_token) {
3350
+ return current_token.type === TOKEN.TAG_CLOSE && (open_token && ((current_token.text === ">" || current_token.text === "/>") && open_token.text[0] === "<" || current_token.text === "}}" && open_token.text[0] === "{" && open_token.text[1] === "{")) || current_token.type === TOKEN.CONTROL_FLOW_CLOSE && (current_token.text === "}" && open_token.text.endsWith("{"));
3351
+ };
3352
+ Tokenizer.prototype._reset = function() {
3353
+ this._current_tag_name = "";
3354
+ };
3355
+ Tokenizer.prototype._get_next_token = function(previous_token, open_token) {
3356
+ var token = null;
3357
+ this._readWhitespace();
3358
+ var c = this._input.peek();
3359
+ if (c === null) {
3360
+ return this._create_token(TOKEN.EOF, "");
3361
+ }
3362
+ token = token || this._read_open_handlebars(c, open_token);
3363
+ token = token || this._read_attribute(c, previous_token, open_token);
3364
+ token = token || this._read_close(c, open_token);
3365
+ token = token || this._read_script_and_style(c, previous_token);
3366
+ token = token || this._read_control_flows(c, open_token);
3367
+ token = token || this._read_raw_content(c, previous_token, open_token);
3368
+ token = token || this._read_content_word(c, open_token);
3369
+ token = token || this._read_comment_or_cdata(c);
3370
+ token = token || this._read_processing(c);
3371
+ token = token || this._read_open(c, open_token);
3372
+ token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());
3373
+ return token;
3374
+ };
3375
+ Tokenizer.prototype._read_comment_or_cdata = function(c) {
3376
+ var token = null;
3377
+ var resulting_string = null;
3378
+ var directives = null;
3379
+ if (c === "<") {
3380
+ var peek1 = this._input.peek(1);
3381
+ if (peek1 === "!") {
3382
+ resulting_string = this.__patterns.comment.read();
3383
+ if (resulting_string) {
3384
+ directives = directives_core.get_directives(resulting_string);
3385
+ if (directives && directives.ignore === "start") {
3386
+ resulting_string += directives_core.readIgnored(this._input);
3387
+ }
3388
+ } else {
3389
+ resulting_string = this.__patterns.cdata.read();
3390
+ }
3391
+ }
3392
+ if (resulting_string) {
3393
+ token = this._create_token(TOKEN.COMMENT, resulting_string);
3394
+ token.directives = directives;
3395
+ }
3396
+ }
3397
+ return token;
3398
+ };
3399
+ Tokenizer.prototype._read_processing = function(c) {
3400
+ var token = null;
3401
+ var resulting_string = null;
3402
+ var directives = null;
3403
+ if (c === "<") {
3404
+ var peek1 = this._input.peek(1);
3405
+ if (peek1 === "!" || peek1 === "?") {
3406
+ resulting_string = this.__patterns.conditional_comment.read();
3407
+ resulting_string = resulting_string || this.__patterns.processing.read();
3408
+ }
3409
+ if (resulting_string) {
3410
+ token = this._create_token(TOKEN.COMMENT, resulting_string);
3411
+ token.directives = directives;
3412
+ }
3413
+ }
3414
+ return token;
3415
+ };
3416
+ Tokenizer.prototype._read_open = function(c, open_token) {
3417
+ var resulting_string = null;
3418
+ var token = null;
3419
+ if (!open_token || open_token.type === TOKEN.CONTROL_FLOW_OPEN) {
3420
+ if (c === "<") {
3421
+ resulting_string = this._input.next();
3422
+ if (this._input.peek() === "/") {
3423
+ resulting_string += this._input.next();
3424
+ }
3425
+ resulting_string += this.__patterns.element_name.read();
3426
+ token = this._create_token(TOKEN.TAG_OPEN, resulting_string);
3427
+ }
3428
+ }
3429
+ return token;
3430
+ };
3431
+ Tokenizer.prototype._read_open_handlebars = function(c, open_token) {
3432
+ var resulting_string = null;
3433
+ var token = null;
3434
+ if (!open_token || open_token.type === TOKEN.CONTROL_FLOW_OPEN) {
3435
+ if ((this._options.templating.includes("angular") || this._options.indent_handlebars) && c === "{" && this._input.peek(1) === "{") {
3436
+ if (this._options.indent_handlebars && this._input.peek(2) === "!") {
3437
+ resulting_string = this.__patterns.handlebars_comment.read();
3438
+ resulting_string = resulting_string || this.__patterns.handlebars.read();
3439
+ token = this._create_token(TOKEN.COMMENT, resulting_string);
3440
+ } else {
3441
+ resulting_string = this.__patterns.handlebars_open.read();
3442
+ token = this._create_token(TOKEN.TAG_OPEN, resulting_string);
3443
+ }
3444
+ }
3445
+ }
3446
+ return token;
3447
+ };
3448
+ Tokenizer.prototype._read_control_flows = function(c, open_token) {
3449
+ var resulting_string = "";
3450
+ var token = null;
3451
+ if (!this._options.templating.includes("angular")) {
3452
+ return token;
3453
+ }
3454
+ if (c === "@") {
3455
+ resulting_string = this.__patterns.angular_control_flow_start.read();
3456
+ if (resulting_string === "") {
3457
+ return token;
3458
+ }
3459
+ var opening_parentheses_count = resulting_string.endsWith("(") ? 1 : 0;
3460
+ var closing_parentheses_count = 0;
3461
+ while (!(resulting_string.endsWith("{") && opening_parentheses_count === closing_parentheses_count)) {
3462
+ var next_char = this._input.next();
3463
+ if (next_char === null) {
3464
+ break;
3465
+ } else if (next_char === "(") {
3466
+ opening_parentheses_count++;
3467
+ } else if (next_char === ")") {
3468
+ closing_parentheses_count++;
3469
+ }
3470
+ resulting_string += next_char;
3471
+ }
3472
+ token = this._create_token(TOKEN.CONTROL_FLOW_OPEN, resulting_string);
3473
+ } else if (c === "}" && open_token && open_token.type === TOKEN.CONTROL_FLOW_OPEN) {
3474
+ resulting_string = this._input.next();
3475
+ token = this._create_token(TOKEN.CONTROL_FLOW_CLOSE, resulting_string);
3476
+ }
3477
+ return token;
3478
+ };
3479
+ Tokenizer.prototype._read_close = function(c, open_token) {
3480
+ var resulting_string = null;
3481
+ var token = null;
3482
+ if (open_token && open_token.type === TOKEN.TAG_OPEN) {
3483
+ if (open_token.text[0] === "<" && (c === ">" || c === "/" && this._input.peek(1) === ">")) {
3484
+ resulting_string = this._input.next();
3485
+ if (c === "/") {
3486
+ resulting_string += this._input.next();
3487
+ }
3488
+ token = this._create_token(TOKEN.TAG_CLOSE, resulting_string);
3489
+ } else if (open_token.text[0] === "{" && c === "}" && this._input.peek(1) === "}") {
3490
+ this._input.next();
3491
+ this._input.next();
3492
+ token = this._create_token(TOKEN.TAG_CLOSE, "}}");
3493
+ }
3494
+ }
3495
+ return token;
3496
+ };
3497
+ Tokenizer.prototype._read_attribute = function(c, previous_token, open_token) {
3498
+ var token = null;
3499
+ var resulting_string = "";
3500
+ if (open_token && open_token.text[0] === "<") {
3501
+ if (c === "=") {
3502
+ token = this._create_token(TOKEN.EQUALS, this._input.next());
3503
+ } else if (c === '"' || c === "'") {
3504
+ var content = this._input.next();
3505
+ if (c === '"') {
3506
+ content += this.__patterns.double_quote.read();
3507
+ } else {
3508
+ content += this.__patterns.single_quote.read();
3509
+ }
3510
+ token = this._create_token(TOKEN.VALUE, content);
3511
+ } else {
3512
+ resulting_string = this.__patterns.attribute.read();
3513
+ if (resulting_string) {
3514
+ if (previous_token.type === TOKEN.EQUALS) {
3515
+ token = this._create_token(TOKEN.VALUE, resulting_string);
3516
+ } else {
3517
+ token = this._create_token(TOKEN.ATTRIBUTE, resulting_string);
3518
+ }
3519
+ }
3520
+ }
3521
+ }
3522
+ return token;
3523
+ };
3524
+ Tokenizer.prototype._is_content_unformatted = function(tag_name) {
3525
+ return this._options.void_elements.indexOf(tag_name) === -1 && (this._options.content_unformatted.indexOf(tag_name) !== -1 || this._options.unformatted.indexOf(tag_name) !== -1);
3526
+ };
3527
+ Tokenizer.prototype._read_raw_content = function(c, previous_token, open_token) {
3528
+ var resulting_string = "";
3529
+ if (open_token && open_token.text[0] === "{") {
3530
+ resulting_string = this.__patterns.handlebars_raw_close.read();
3531
+ } else if (previous_token.type === TOKEN.TAG_CLOSE && previous_token.opened.text[0] === "<" && previous_token.text[0] !== "/") {
3532
+ var tag_name = previous_token.opened.text.substr(1).toLowerCase();
3533
+ if (this._is_content_unformatted(tag_name)) {
3534
+ resulting_string = this._input.readUntil(new RegExp("</" + tag_name + "[\\n\\r\\t ]*?>", "ig"));
3535
+ }
3536
+ }
3537
+ if (resulting_string) {
3538
+ return this._create_token(TOKEN.TEXT, resulting_string);
3539
+ }
3540
+ return null;
3541
+ };
3542
+ Tokenizer.prototype._read_script_and_style = function(c, previous_token) {
3543
+ if (previous_token.type === TOKEN.TAG_CLOSE && previous_token.opened.text[0] === "<" && previous_token.text[0] !== "/") {
3544
+ var tag_name = previous_token.opened.text.substr(1).toLowerCase();
3545
+ if (tag_name === "script" || tag_name === "style") {
3546
+ var token = this._read_comment_or_cdata(c);
3547
+ if (token) {
3548
+ token.type = TOKEN.TEXT;
3549
+ return token;
3550
+ }
3551
+ var resulting_string = this._input.readUntil(new RegExp("</" + tag_name + "[\\n\\r\\t ]*?>", "ig"));
3552
+ if (resulting_string) {
3553
+ return this._create_token(TOKEN.TEXT, resulting_string);
3554
+ }
3555
+ }
3556
+ }
3557
+ return null;
3558
+ };
3559
+ Tokenizer.prototype._read_content_word = function(c, open_token) {
3560
+ var resulting_string = "";
3561
+ if (this._options.unformatted_content_delimiter) {
3562
+ if (c === this._options.unformatted_content_delimiter[0]) {
3563
+ resulting_string = this.__patterns.unformatted_content_delimiter.read();
3564
+ }
3565
+ }
3566
+ if (!resulting_string) {
3567
+ resulting_string = open_token && open_token.type === TOKEN.CONTROL_FLOW_OPEN ? this.__patterns.word_control_flow_close_excluded.read() : this.__patterns.word.read();
3568
+ }
3569
+ if (resulting_string) {
3570
+ return this._create_token(TOKEN.TEXT, resulting_string);
3571
+ }
3572
+ return null;
3573
+ };
3574
+ module.exports.Tokenizer = Tokenizer;
3575
+ module.exports.TOKEN = TOKEN;
3576
+ }
3577
+ });
3578
+
3579
+ // node_modules/js-beautify/js/src/html/beautifier.js
3580
+ var require_beautifier3 = __commonJS({
3581
+ "node_modules/js-beautify/js/src/html/beautifier.js"(exports, module) {
3582
+ "use strict";
3583
+ var Options = require_options4().Options;
3584
+ var Output = require_output().Output;
3585
+ var Tokenizer = require_tokenizer3().Tokenizer;
3586
+ var TOKEN = require_tokenizer3().TOKEN;
3587
+ var lineBreak = /\r\n|[\r\n]/;
3588
+ var allLineBreaks = /\r\n|[\r\n]/g;
3589
+ var Printer = function(options, base_indent_string) {
3590
+ this.indent_level = 0;
3591
+ this.alignment_size = 0;
3592
+ this.max_preserve_newlines = options.max_preserve_newlines;
3593
+ this.preserve_newlines = options.preserve_newlines;
3594
+ this._output = new Output(options, base_indent_string);
3595
+ };
3596
+ Printer.prototype.current_line_has_match = function(pattern) {
3597
+ return this._output.current_line.has_match(pattern);
3598
+ };
3599
+ Printer.prototype.set_space_before_token = function(value, non_breaking) {
3600
+ this._output.space_before_token = value;
3601
+ this._output.non_breaking_space = non_breaking;
3602
+ };
3603
+ Printer.prototype.set_wrap_point = function() {
3604
+ this._output.set_indent(this.indent_level, this.alignment_size);
3605
+ this._output.set_wrap_point();
3606
+ };
3607
+ Printer.prototype.add_raw_token = function(token) {
3608
+ this._output.add_raw_token(token);
3609
+ };
3610
+ Printer.prototype.print_preserved_newlines = function(raw_token) {
3611
+ var newlines = 0;
3612
+ if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) {
3613
+ newlines = raw_token.newlines ? 1 : 0;
3614
+ }
3615
+ if (this.preserve_newlines) {
3616
+ newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1;
3617
+ }
3618
+ for (var n = 0; n < newlines; n++) {
3619
+ this.print_newline(n > 0);
3620
+ }
3621
+ return newlines !== 0;
3622
+ };
3623
+ Printer.prototype.traverse_whitespace = function(raw_token) {
3624
+ if (raw_token.whitespace_before || raw_token.newlines) {
3625
+ if (!this.print_preserved_newlines(raw_token)) {
3626
+ this._output.space_before_token = true;
3627
+ }
3628
+ return true;
3629
+ }
3630
+ return false;
3631
+ };
3632
+ Printer.prototype.previous_token_wrapped = function() {
3633
+ return this._output.previous_token_wrapped;
3634
+ };
3635
+ Printer.prototype.print_newline = function(force) {
3636
+ this._output.add_new_line(force);
3637
+ };
3638
+ Printer.prototype.print_token = function(token) {
3639
+ if (token.text) {
3640
+ this._output.set_indent(this.indent_level, this.alignment_size);
3641
+ this._output.add_token(token.text);
3642
+ }
3643
+ };
3644
+ Printer.prototype.indent = function() {
3645
+ this.indent_level++;
3646
+ };
3647
+ Printer.prototype.deindent = function() {
3648
+ if (this.indent_level > 0) {
3649
+ this.indent_level--;
3650
+ this._output.set_indent(this.indent_level, this.alignment_size);
3651
+ }
3652
+ };
3653
+ Printer.prototype.get_full_indent = function(level) {
3654
+ level = this.indent_level + (level || 0);
3655
+ if (level < 1) {
3656
+ return "";
3657
+ }
3658
+ return this._output.get_indent_string(level);
3659
+ };
3660
+ var get_type_attribute = function(start_token) {
3661
+ var result = null;
3662
+ var raw_token = start_token.next;
3663
+ while (raw_token.type !== TOKEN.EOF && start_token.closed !== raw_token) {
3664
+ if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === "type") {
3665
+ if (raw_token.next && raw_token.next.type === TOKEN.EQUALS && raw_token.next.next && raw_token.next.next.type === TOKEN.VALUE) {
3666
+ result = raw_token.next.next.text;
3667
+ }
3668
+ break;
3669
+ }
3670
+ raw_token = raw_token.next;
3671
+ }
3672
+ return result;
3673
+ };
3674
+ var get_custom_beautifier_name = function(tag_check, raw_token) {
3675
+ var typeAttribute = null;
3676
+ var result = null;
3677
+ if (!raw_token.closed) {
3678
+ return null;
3679
+ }
3680
+ if (tag_check === "script") {
3681
+ typeAttribute = "text/javascript";
3682
+ } else if (tag_check === "style") {
3683
+ typeAttribute = "text/css";
3684
+ }
3685
+ typeAttribute = get_type_attribute(raw_token) || typeAttribute;
3686
+ if (typeAttribute.search("text/css") > -1) {
3687
+ result = "css";
3688
+ } else if (typeAttribute.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/) > -1) {
3689
+ result = "javascript";
3690
+ } else if (typeAttribute.search(/(text|application|dojo)\/(x-)?(html)/) > -1) {
3691
+ result = "html";
3692
+ } else if (typeAttribute.search(/test\/null/) > -1) {
3693
+ result = "null";
3694
+ }
3695
+ return result;
3696
+ };
3697
+ function in_array(what, arr) {
3698
+ return arr.indexOf(what) !== -1;
3699
+ }
3700
+ function TagFrame(parent, parser_token, indent_level) {
3701
+ this.parent = parent || null;
3702
+ this.tag = parser_token ? parser_token.tag_name : "";
3703
+ this.indent_level = indent_level || 0;
3704
+ this.parser_token = parser_token || null;
3705
+ }
3706
+ function TagStack(printer) {
3707
+ this._printer = printer;
3708
+ this._current_frame = null;
3709
+ }
3710
+ TagStack.prototype.get_parser_token = function() {
3711
+ return this._current_frame ? this._current_frame.parser_token : null;
3712
+ };
3713
+ TagStack.prototype.record_tag = function(parser_token) {
3714
+ var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);
3715
+ this._current_frame = new_frame;
3716
+ };
3717
+ TagStack.prototype._try_pop_frame = function(frame) {
3718
+ var parser_token = null;
3719
+ if (frame) {
3720
+ parser_token = frame.parser_token;
3721
+ this._printer.indent_level = frame.indent_level;
3722
+ this._current_frame = frame.parent;
3723
+ }
3724
+ return parser_token;
3725
+ };
3726
+ TagStack.prototype._get_frame = function(tag_list, stop_list) {
3727
+ var frame = this._current_frame;
3728
+ while (frame) {
3729
+ if (tag_list.indexOf(frame.tag) !== -1) {
3730
+ break;
3731
+ } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) {
3732
+ frame = null;
3733
+ break;
3734
+ }
3735
+ frame = frame.parent;
3736
+ }
3737
+ return frame;
3738
+ };
3739
+ TagStack.prototype.try_pop = function(tag, stop_list) {
3740
+ var frame = this._get_frame([tag], stop_list);
3741
+ return this._try_pop_frame(frame);
3742
+ };
3743
+ TagStack.prototype.indent_to_tag = function(tag_list) {
3744
+ var frame = this._get_frame(tag_list);
3745
+ if (frame) {
3746
+ this._printer.indent_level = frame.indent_level;
3747
+ }
3748
+ };
3749
+ function Beautifier(source_text, options, js_beautify, css_beautify) {
3750
+ this._source_text = source_text || "";
3751
+ options = options || {};
3752
+ this._js_beautify = js_beautify;
3753
+ this._css_beautify = css_beautify;
3754
+ this._tag_stack = null;
3755
+ var optionHtml = new Options(options, "html");
3756
+ this._options = optionHtml;
3757
+ this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, "force".length) === "force";
3758
+ this._is_wrap_attributes_force_expand_multiline = this._options.wrap_attributes === "force-expand-multiline";
3759
+ this._is_wrap_attributes_force_aligned = this._options.wrap_attributes === "force-aligned";
3760
+ this._is_wrap_attributes_aligned_multiple = this._options.wrap_attributes === "aligned-multiple";
3761
+ this._is_wrap_attributes_preserve = this._options.wrap_attributes.substr(0, "preserve".length) === "preserve";
3762
+ this._is_wrap_attributes_preserve_aligned = this._options.wrap_attributes === "preserve-aligned";
3763
+ }
3764
+ Beautifier.prototype.beautify = function() {
3765
+ if (this._options.disabled) {
3766
+ return this._source_text;
3767
+ }
3768
+ var source_text = this._source_text;
3769
+ var eol = this._options.eol;
3770
+ if (this._options.eol === "auto") {
3771
+ eol = "\n";
3772
+ if (source_text && lineBreak.test(source_text)) {
3773
+ eol = source_text.match(lineBreak)[0];
3774
+ }
3775
+ }
3776
+ source_text = source_text.replace(allLineBreaks, "\n");
3777
+ var baseIndentString = source_text.match(/^[\t ]*/)[0];
3778
+ var last_token = {
3779
+ text: "",
3780
+ type: ""
3781
+ };
3782
+ var last_tag_token = new TagOpenParserToken(this._options);
3783
+ var printer = new Printer(this._options, baseIndentString);
3784
+ var tokens = new Tokenizer(source_text, this._options).tokenize();
3785
+ this._tag_stack = new TagStack(printer);
3786
+ var parser_token = null;
3787
+ var raw_token = tokens.next();
3788
+ while (raw_token.type !== TOKEN.EOF) {
3789
+ if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) {
3790
+ parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token, tokens);
3791
+ last_tag_token = parser_token;
3792
+ } else if (raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE || raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete) {
3793
+ parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, last_token);
3794
+ } else if (raw_token.type === TOKEN.TAG_CLOSE) {
3795
+ parser_token = this._handle_tag_close(printer, raw_token, last_tag_token);
3796
+ } else if (raw_token.type === TOKEN.TEXT) {
3797
+ parser_token = this._handle_text(printer, raw_token, last_tag_token);
3798
+ } else if (raw_token.type === TOKEN.CONTROL_FLOW_OPEN) {
3799
+ parser_token = this._handle_control_flow_open(printer, raw_token);
3800
+ } else if (raw_token.type === TOKEN.CONTROL_FLOW_CLOSE) {
3801
+ parser_token = this._handle_control_flow_close(printer, raw_token);
3802
+ } else {
3803
+ printer.add_raw_token(raw_token);
3804
+ }
3805
+ last_token = parser_token;
3806
+ raw_token = tokens.next();
3807
+ }
3808
+ var sweet_code = printer._output.get_code(eol);
3809
+ return sweet_code;
3810
+ };
3811
+ Beautifier.prototype._handle_control_flow_open = function(printer, raw_token) {
3812
+ var parser_token = {
3813
+ text: raw_token.text,
3814
+ type: raw_token.type
3815
+ };
3816
+ printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== "", true);
3817
+ if (raw_token.newlines) {
3818
+ printer.print_preserved_newlines(raw_token);
3819
+ } else {
3820
+ printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== "", true);
3821
+ }
3822
+ printer.print_token(raw_token);
3823
+ printer.indent();
3824
+ return parser_token;
3825
+ };
3826
+ Beautifier.prototype._handle_control_flow_close = function(printer, raw_token) {
3827
+ var parser_token = {
3828
+ text: raw_token.text,
3829
+ type: raw_token.type
3830
+ };
3831
+ printer.deindent();
3832
+ if (raw_token.newlines) {
3833
+ printer.print_preserved_newlines(raw_token);
3834
+ } else {
3835
+ printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== "", true);
3836
+ }
3837
+ printer.print_token(raw_token);
3838
+ return parser_token;
3839
+ };
3840
+ Beautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) {
3841
+ var parser_token = {
3842
+ text: raw_token.text,
3843
+ type: raw_token.type
3844
+ };
3845
+ printer.alignment_size = 0;
3846
+ last_tag_token.tag_complete = true;
3847
+ printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== "", true);
3848
+ if (last_tag_token.is_unformatted) {
3849
+ printer.add_raw_token(raw_token);
3850
+ } else {
3851
+ if (last_tag_token.tag_start_char === "<") {
3852
+ printer.set_space_before_token(raw_token.text[0] === "/", true);
3853
+ if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) {
3854
+ printer.print_newline(false);
3855
+ }
3856
+ }
3857
+ printer.print_token(raw_token);
3858
+ }
3859
+ if (last_tag_token.indent_content && !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {
3860
+ printer.indent();
3861
+ last_tag_token.indent_content = false;
3862
+ }
3863
+ if (!last_tag_token.is_inline_element && !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {
3864
+ printer.set_wrap_point();
3865
+ }
3866
+ return parser_token;
3867
+ };
3868
+ Beautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, last_token) {
3869
+ var wrapped = last_tag_token.has_wrapped_attrs;
3870
+ var parser_token = {
3871
+ text: raw_token.text,
3872
+ type: raw_token.type
3873
+ };
3874
+ printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== "", true);
3875
+ if (last_tag_token.is_unformatted) {
3876
+ printer.add_raw_token(raw_token);
3877
+ } else if (last_tag_token.tag_start_char === "{" && raw_token.type === TOKEN.TEXT) {
3878
+ if (printer.print_preserved_newlines(raw_token)) {
3879
+ raw_token.newlines = 0;
3880
+ printer.add_raw_token(raw_token);
3881
+ } else {
3882
+ printer.print_token(raw_token);
3883
+ }
3884
+ } else {
3885
+ if (raw_token.type === TOKEN.ATTRIBUTE) {
3886
+ printer.set_space_before_token(true);
3887
+ } else if (raw_token.type === TOKEN.EQUALS) {
3888
+ printer.set_space_before_token(false);
3889
+ } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) {
3890
+ printer.set_space_before_token(false);
3891
+ }
3892
+ if (raw_token.type === TOKEN.ATTRIBUTE && last_tag_token.tag_start_char === "<") {
3893
+ if (this._is_wrap_attributes_preserve || this._is_wrap_attributes_preserve_aligned) {
3894
+ printer.traverse_whitespace(raw_token);
3895
+ wrapped = wrapped || raw_token.newlines !== 0;
3896
+ }
3897
+ if (this._is_wrap_attributes_force && last_tag_token.attr_count >= this._options.wrap_attributes_min_attrs && (last_token.type !== TOKEN.TAG_OPEN || // ie. second attribute and beyond
3898
+ this._is_wrap_attributes_force_expand_multiline)) {
3899
+ printer.print_newline(false);
3900
+ wrapped = true;
3901
+ }
3902
+ }
3903
+ printer.print_token(raw_token);
3904
+ wrapped = wrapped || printer.previous_token_wrapped();
3905
+ last_tag_token.has_wrapped_attrs = wrapped;
3906
+ }
3907
+ return parser_token;
3908
+ };
3909
+ Beautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) {
3910
+ var parser_token = {
3911
+ text: raw_token.text,
3912
+ type: "TK_CONTENT"
3913
+ };
3914
+ if (last_tag_token.custom_beautifier_name) {
3915
+ this._print_custom_beatifier_text(printer, raw_token, last_tag_token);
3916
+ } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) {
3917
+ printer.add_raw_token(raw_token);
3918
+ } else {
3919
+ printer.traverse_whitespace(raw_token);
3920
+ printer.print_token(raw_token);
3921
+ }
3922
+ return parser_token;
3923
+ };
3924
+ Beautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) {
3925
+ var local = this;
3926
+ if (raw_token.text !== "") {
3927
+ var text = raw_token.text, _beautifier, script_indent_level = 1, pre = "", post = "";
3928
+ if (last_tag_token.custom_beautifier_name === "javascript" && typeof this._js_beautify === "function") {
3929
+ _beautifier = this._js_beautify;
3930
+ } else if (last_tag_token.custom_beautifier_name === "css" && typeof this._css_beautify === "function") {
3931
+ _beautifier = this._css_beautify;
3932
+ } else if (last_tag_token.custom_beautifier_name === "html") {
3933
+ _beautifier = function(html_source, options) {
3934
+ var beautifier = new Beautifier(html_source, options, local._js_beautify, local._css_beautify);
3935
+ return beautifier.beautify();
3936
+ };
3937
+ }
3938
+ if (this._options.indent_scripts === "keep") {
3939
+ script_indent_level = 0;
3940
+ } else if (this._options.indent_scripts === "separate") {
3941
+ script_indent_level = -printer.indent_level;
3942
+ }
3943
+ var indentation = printer.get_full_indent(script_indent_level);
3944
+ text = text.replace(/\n[ \t]*$/, "");
3945
+ if (last_tag_token.custom_beautifier_name !== "html" && text[0] === "<" && text.match(/^(<!--|<!\[CDATA\[)/)) {
3946
+ var matched = /^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(text);
3947
+ if (!matched) {
3948
+ printer.add_raw_token(raw_token);
3949
+ return;
3950
+ }
3951
+ pre = indentation + matched[1] + "\n";
3952
+ text = matched[4];
3953
+ if (matched[5]) {
3954
+ post = indentation + matched[5];
3955
+ }
3956
+ text = text.replace(/\n[ \t]*$/, "");
3957
+ if (matched[2] || matched[3].indexOf("\n") !== -1) {
3958
+ matched = matched[3].match(/[ \t]+$/);
3959
+ if (matched) {
3960
+ raw_token.whitespace_before = matched[0];
3961
+ }
3962
+ }
3963
+ }
3964
+ if (text) {
3965
+ if (_beautifier) {
3966
+ var Child_options = function() {
3967
+ this.eol = "\n";
3968
+ };
3969
+ Child_options.prototype = this._options.raw_options;
3970
+ var child_options = new Child_options();
3971
+ text = _beautifier(indentation + text, child_options);
3972
+ } else {
3973
+ var white = raw_token.whitespace_before;
3974
+ if (white) {
3975
+ text = text.replace(new RegExp("\n(" + white + ")?", "g"), "\n");
3976
+ }
3977
+ text = indentation + text.replace(/\n/g, "\n" + indentation);
3978
+ }
3979
+ }
3980
+ if (pre) {
3981
+ if (!text) {
3982
+ text = pre + post;
3983
+ } else {
3984
+ text = pre + text + "\n" + post;
3985
+ }
3986
+ }
3987
+ printer.print_newline(false);
3988
+ if (text) {
3989
+ raw_token.text = text;
3990
+ raw_token.whitespace_before = "";
3991
+ raw_token.newlines = 0;
3992
+ printer.add_raw_token(raw_token);
3993
+ printer.print_newline(true);
3994
+ }
3995
+ }
3996
+ };
3997
+ Beautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token, tokens) {
3998
+ var parser_token = this._get_tag_open_token(raw_token);
3999
+ if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) && !last_tag_token.is_empty_element && raw_token.type === TOKEN.TAG_OPEN && !parser_token.is_start_tag) {
4000
+ printer.add_raw_token(raw_token);
4001
+ parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name);
4002
+ } else {
4003
+ printer.traverse_whitespace(raw_token);
4004
+ this._set_tag_position(printer, raw_token, parser_token, last_tag_token, last_token);
4005
+ if (!parser_token.is_inline_element) {
4006
+ printer.set_wrap_point();
4007
+ }
4008
+ printer.print_token(raw_token);
4009
+ }
4010
+ if (parser_token.is_start_tag && this._is_wrap_attributes_force) {
4011
+ var peek_index = 0;
4012
+ var peek_token;
4013
+ do {
4014
+ peek_token = tokens.peek(peek_index);
4015
+ if (peek_token.type === TOKEN.ATTRIBUTE) {
4016
+ parser_token.attr_count += 1;
4017
+ }
4018
+ peek_index += 1;
4019
+ } while (peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE);
4020
+ }
4021
+ if (this._is_wrap_attributes_force_aligned || this._is_wrap_attributes_aligned_multiple || this._is_wrap_attributes_preserve_aligned) {
4022
+ parser_token.alignment_size = raw_token.text.length + 1;
4023
+ }
4024
+ if (!parser_token.tag_complete && !parser_token.is_unformatted) {
4025
+ printer.alignment_size = parser_token.alignment_size;
4026
+ }
4027
+ return parser_token;
4028
+ };
4029
+ var TagOpenParserToken = function(options, parent, raw_token) {
4030
+ this.parent = parent || null;
4031
+ this.text = "";
4032
+ this.type = "TK_TAG_OPEN";
4033
+ this.tag_name = "";
4034
+ this.is_inline_element = false;
4035
+ this.is_unformatted = false;
4036
+ this.is_content_unformatted = false;
4037
+ this.is_empty_element = false;
4038
+ this.is_start_tag = false;
4039
+ this.is_end_tag = false;
4040
+ this.indent_content = false;
4041
+ this.multiline_content = false;
4042
+ this.custom_beautifier_name = null;
4043
+ this.start_tag_token = null;
4044
+ this.attr_count = 0;
4045
+ this.has_wrapped_attrs = false;
4046
+ this.alignment_size = 0;
4047
+ this.tag_complete = false;
4048
+ this.tag_start_char = "";
4049
+ this.tag_check = "";
4050
+ if (!raw_token) {
4051
+ this.tag_complete = true;
4052
+ } else {
4053
+ var tag_check_match;
4054
+ this.tag_start_char = raw_token.text[0];
4055
+ this.text = raw_token.text;
4056
+ if (this.tag_start_char === "<") {
4057
+ tag_check_match = raw_token.text.match(/^<([^\s>]*)/);
4058
+ this.tag_check = tag_check_match ? tag_check_match[1] : "";
4059
+ } else {
4060
+ tag_check_match = raw_token.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/);
4061
+ this.tag_check = tag_check_match ? tag_check_match[1] : "";
4062
+ if ((raw_token.text.startsWith("{{#>") || raw_token.text.startsWith("{{~#>")) && this.tag_check[0] === ">") {
4063
+ if (this.tag_check === ">" && raw_token.next !== null) {
4064
+ this.tag_check = raw_token.next.text.split(" ")[0];
4065
+ } else {
4066
+ this.tag_check = raw_token.text.split(">")[1];
4067
+ }
4068
+ }
4069
+ }
4070
+ this.tag_check = this.tag_check.toLowerCase();
4071
+ if (raw_token.type === TOKEN.COMMENT) {
4072
+ this.tag_complete = true;
4073
+ }
4074
+ this.is_start_tag = this.tag_check.charAt(0) !== "/";
4075
+ this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check;
4076
+ this.is_end_tag = !this.is_start_tag || raw_token.closed && raw_token.closed.text === "/>";
4077
+ var handlebar_starts = 2;
4078
+ if (this.tag_start_char === "{" && this.text.length >= 3) {
4079
+ if (this.text.charAt(2) === "~") {
4080
+ handlebar_starts = 3;
4081
+ }
4082
+ }
4083
+ this.is_end_tag = this.is_end_tag || this.tag_start_char === "{" && (!options.indent_handlebars || this.text.length < 3 || /[^#\^]/.test(this.text.charAt(handlebar_starts)));
4084
+ }
4085
+ };
4086
+ Beautifier.prototype._get_tag_open_token = function(raw_token) {
4087
+ var parser_token = new TagOpenParserToken(this._options, this._tag_stack.get_parser_token(), raw_token);
4088
+ parser_token.alignment_size = this._options.wrap_attributes_indent_size;
4089
+ parser_token.is_end_tag = parser_token.is_end_tag || in_array(parser_token.tag_check, this._options.void_elements);
4090
+ parser_token.is_empty_element = parser_token.tag_complete || parser_token.is_start_tag && parser_token.is_end_tag;
4091
+ parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted);
4092
+ parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted);
4093
+ parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || this._options.inline_custom_elements && parser_token.tag_name.includes("-") || parser_token.tag_start_char === "{";
4094
+ return parser_token;
4095
+ };
4096
+ Beautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) {
4097
+ if (!parser_token.is_empty_element) {
4098
+ if (parser_token.is_end_tag) {
4099
+ parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name);
4100
+ } else {
4101
+ if (this._do_optional_end_element(parser_token)) {
4102
+ if (!parser_token.is_inline_element) {
4103
+ printer.print_newline(false);
4104
+ }
4105
+ }
4106
+ this._tag_stack.record_tag(parser_token);
4107
+ if ((parser_token.tag_name === "script" || parser_token.tag_name === "style") && !(parser_token.is_unformatted || parser_token.is_content_unformatted)) {
4108
+ parser_token.custom_beautifier_name = get_custom_beautifier_name(parser_token.tag_check, raw_token);
4109
+ }
4110
+ }
4111
+ }
4112
+ if (in_array(parser_token.tag_check, this._options.extra_liners)) {
4113
+ printer.print_newline(false);
4114
+ if (!printer._output.just_added_blankline()) {
4115
+ printer.print_newline(true);
4116
+ }
4117
+ }
4118
+ if (parser_token.is_empty_element) {
4119
+ if (parser_token.tag_start_char === "{" && parser_token.tag_check === "else") {
4120
+ this._tag_stack.indent_to_tag(["if", "unless", "each"]);
4121
+ parser_token.indent_content = true;
4122
+ var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/);
4123
+ if (!foundIfOnCurrentLine) {
4124
+ printer.print_newline(false);
4125
+ }
4126
+ }
4127
+ if (parser_token.tag_name === "!--" && last_token.type === TOKEN.TAG_CLOSE && last_tag_token.is_end_tag && parser_token.text.indexOf("\n") === -1) {
4128
+ } else {
4129
+ if (!(parser_token.is_inline_element || parser_token.is_unformatted)) {
4130
+ printer.print_newline(false);
4131
+ }
4132
+ this._calcluate_parent_multiline(printer, parser_token);
4133
+ }
4134
+ } else if (parser_token.is_end_tag) {
4135
+ var do_end_expand = false;
4136
+ do_end_expand = parser_token.start_tag_token && parser_token.start_tag_token.multiline_content;
4137
+ do_end_expand = do_end_expand || !parser_token.is_inline_element && !(last_tag_token.is_inline_element || last_tag_token.is_unformatted) && !(last_token.type === TOKEN.TAG_CLOSE && parser_token.start_tag_token === last_tag_token) && last_token.type !== "TK_CONTENT";
4138
+ if (parser_token.is_content_unformatted || parser_token.is_unformatted) {
4139
+ do_end_expand = false;
4140
+ }
4141
+ if (do_end_expand) {
4142
+ printer.print_newline(false);
4143
+ }
4144
+ } else {
4145
+ parser_token.indent_content = !parser_token.custom_beautifier_name;
4146
+ if (parser_token.tag_start_char === "<") {
4147
+ if (parser_token.tag_name === "html") {
4148
+ parser_token.indent_content = this._options.indent_inner_html;
4149
+ } else if (parser_token.tag_name === "head") {
4150
+ parser_token.indent_content = this._options.indent_head_inner_html;
4151
+ } else if (parser_token.tag_name === "body") {
4152
+ parser_token.indent_content = this._options.indent_body_inner_html;
4153
+ }
4154
+ }
4155
+ if (!(parser_token.is_inline_element || parser_token.is_unformatted) && (last_token.type !== "TK_CONTENT" || parser_token.is_content_unformatted)) {
4156
+ printer.print_newline(false);
4157
+ }
4158
+ this._calcluate_parent_multiline(printer, parser_token);
4159
+ }
4160
+ };
4161
+ Beautifier.prototype._calcluate_parent_multiline = function(printer, parser_token) {
4162
+ if (parser_token.parent && printer._output.just_added_newline() && !((parser_token.is_inline_element || parser_token.is_unformatted) && parser_token.parent.is_inline_element)) {
4163
+ parser_token.parent.multiline_content = true;
4164
+ }
4165
+ };
4166
+ var p_closers = ["address", "article", "aside", "blockquote", "details", "div", "dl", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hr", "main", "menu", "nav", "ol", "p", "pre", "section", "table", "ul"];
4167
+ var p_parent_excludes = ["a", "audio", "del", "ins", "map", "noscript", "video"];
4168
+ Beautifier.prototype._do_optional_end_element = function(parser_token) {
4169
+ var result = null;
4170
+ if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {
4171
+ return;
4172
+ }
4173
+ if (parser_token.tag_name === "body") {
4174
+ result = result || this._tag_stack.try_pop("head");
4175
+ } else if (parser_token.tag_name === "li") {
4176
+ result = result || this._tag_stack.try_pop("li", ["ol", "ul", "menu"]);
4177
+ } else if (parser_token.tag_name === "dd" || parser_token.tag_name === "dt") {
4178
+ result = result || this._tag_stack.try_pop("dt", ["dl"]);
4179
+ result = result || this._tag_stack.try_pop("dd", ["dl"]);
4180
+ } else if (parser_token.parent.tag_name === "p" && p_closers.indexOf(parser_token.tag_name) !== -1) {
4181
+ var p_parent = parser_token.parent.parent;
4182
+ if (!p_parent || p_parent_excludes.indexOf(p_parent.tag_name) === -1) {
4183
+ result = result || this._tag_stack.try_pop("p");
4184
+ }
4185
+ } else if (parser_token.tag_name === "rp" || parser_token.tag_name === "rt") {
4186
+ result = result || this._tag_stack.try_pop("rt", ["ruby", "rtc"]);
4187
+ result = result || this._tag_stack.try_pop("rp", ["ruby", "rtc"]);
4188
+ } else if (parser_token.tag_name === "optgroup") {
4189
+ result = result || this._tag_stack.try_pop("optgroup", ["select"]);
4190
+ } else if (parser_token.tag_name === "option") {
4191
+ result = result || this._tag_stack.try_pop("option", ["select", "datalist", "optgroup"]);
4192
+ } else if (parser_token.tag_name === "colgroup") {
4193
+ result = result || this._tag_stack.try_pop("caption", ["table"]);
4194
+ } else if (parser_token.tag_name === "thead") {
4195
+ result = result || this._tag_stack.try_pop("caption", ["table"]);
4196
+ result = result || this._tag_stack.try_pop("colgroup", ["table"]);
4197
+ } else if (parser_token.tag_name === "tbody" || parser_token.tag_name === "tfoot") {
4198
+ result = result || this._tag_stack.try_pop("caption", ["table"]);
4199
+ result = result || this._tag_stack.try_pop("colgroup", ["table"]);
4200
+ result = result || this._tag_stack.try_pop("thead", ["table"]);
4201
+ result = result || this._tag_stack.try_pop("tbody", ["table"]);
4202
+ } else if (parser_token.tag_name === "tr") {
4203
+ result = result || this._tag_stack.try_pop("caption", ["table"]);
4204
+ result = result || this._tag_stack.try_pop("colgroup", ["table"]);
4205
+ result = result || this._tag_stack.try_pop("tr", ["table", "thead", "tbody", "tfoot"]);
4206
+ } else if (parser_token.tag_name === "th" || parser_token.tag_name === "td") {
4207
+ result = result || this._tag_stack.try_pop("td", ["table", "thead", "tbody", "tfoot", "tr"]);
4208
+ result = result || this._tag_stack.try_pop("th", ["table", "thead", "tbody", "tfoot", "tr"]);
4209
+ }
4210
+ parser_token.parent = this._tag_stack.get_parser_token();
4211
+ return result;
4212
+ };
4213
+ module.exports.Beautifier = Beautifier;
4214
+ }
4215
+ });
4216
+
4217
+ // node_modules/js-beautify/js/src/html/index.js
4218
+ var require_html = __commonJS({
4219
+ "node_modules/js-beautify/js/src/html/index.js"(exports, module) {
4220
+ "use strict";
4221
+ var Beautifier = require_beautifier3().Beautifier;
4222
+ var Options = require_options4().Options;
4223
+ function style_html(html_source, options, js_beautify, css_beautify) {
4224
+ var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify);
4225
+ return beautifier.beautify();
4226
+ }
4227
+ module.exports = style_html;
4228
+ module.exports.defaultOptions = function() {
4229
+ return new Options();
4230
+ };
4231
+ }
4232
+ });
4233
+
4234
+ // node_modules/js-beautify/js/src/index.js
4235
+ var require_src = __commonJS({
4236
+ "node_modules/js-beautify/js/src/index.js"(exports, module) {
4237
+ "use strict";
4238
+ var js_beautify = require_javascript();
4239
+ var css_beautify = require_css();
4240
+ var html_beautify = require_html();
4241
+ function style_html(html_source, options, js, css) {
4242
+ js = js || js_beautify;
4243
+ css = css || css_beautify;
4244
+ return html_beautify(html_source, options, js, css);
4245
+ }
4246
+ style_html.defaultOptions = html_beautify.defaultOptions;
4247
+ module.exports.js = js_beautify;
4248
+ module.exports.css = css_beautify;
4249
+ module.exports.html = style_html;
4250
+ }
4251
+ });
4252
+
4253
+ // node_modules/js-beautify/js/index.js
4254
+ var require_js = __commonJS({
4255
+ "node_modules/js-beautify/js/index.js"(exports, module) {
4256
+ "use strict";
4257
+ function get_beautify(js_beautify, css_beautify, html_beautify) {
4258
+ var beautify2 = function(src, config) {
4259
+ return js_beautify.js_beautify(src, config);
4260
+ };
4261
+ beautify2.js = js_beautify.js_beautify;
4262
+ beautify2.css = css_beautify.css_beautify;
4263
+ beautify2.html = html_beautify.html_beautify;
4264
+ beautify2.js_beautify = js_beautify.js_beautify;
4265
+ beautify2.css_beautify = css_beautify.css_beautify;
4266
+ beautify2.html_beautify = html_beautify.html_beautify;
4267
+ return beautify2;
4268
+ }
4269
+ if (typeof define === "function" && define.amd) {
4270
+ define([
4271
+ "./lib/beautify",
4272
+ "./lib/beautify-css",
4273
+ "./lib/beautify-html"
4274
+ ], function(js_beautify, css_beautify, html_beautify) {
4275
+ return get_beautify(js_beautify, css_beautify, html_beautify);
4276
+ });
4277
+ } else {
4278
+ (function(mod) {
4279
+ var beautifier = require_src();
4280
+ beautifier.js_beautify = beautifier.js;
4281
+ beautifier.css_beautify = beautifier.css;
4282
+ beautifier.html_beautify = beautifier.html;
4283
+ mod.exports = get_beautify(beautifier, beautifier, beautifier);
4284
+ })(module);
4285
+ }
4286
+ }
4287
+ });
4288
+
28
4289
  // src/AngelsFrontElement.ts
29
4290
  var AngelsFrontElementClass = class _AngelsFrontElementClass {
30
4291
  constructor(element) {
@@ -624,7 +4885,7 @@ function angelsStateDefine() {
624
4885
  }
625
4886
 
626
4887
  // src/AngelsFrontWebComponents/AngelsFrontDemoWebComponent.ts
627
- var pretty = __require("pretty");
4888
+ var import_js_beautify = __toESM(require_js());
628
4889
  var AngelsFrontDemoWebComponent = class extends HTMLElement {
629
4890
  constructor() {
630
4891
  super();
@@ -642,8 +4903,7 @@ var AngelsFrontDemoWebComponent = class extends HTMLElement {
642
4903
  const resultSlot = this.awcRoot.querySelector('[part="a-demo-result"] slot');
643
4904
  const codePart = this.awcRoot.querySelector('[part="a-demo-code"]');
644
4905
  let code = resultSlot.assignedNodes({ flatten: true }).map((n) => n.outerHTML || n.textContent).join("");
645
- code = pretty(code, { ocd: true });
646
- console.log("code", code);
4906
+ code = import_js_beautify.default.html(code, {});
647
4907
  codePart.textContent = code.trim();
648
4908
  }
649
4909
  awcTemplate() {