terser 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.gitignore +44 -0
- data/.gitmodules +9 -0
- data/.rspec +1 -0
- data/.rubocop.yml +72 -0
- data/.travis.yml +26 -0
- data/.yardopts +4 -0
- data/CHANGELOG.md +13 -0
- data/CONTRIBUTING.md +47 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +93 -0
- data/README.md +177 -0
- data/Rakefile +126 -0
- data/lib/es5.js +321 -0
- data/lib/source-map.js +2 -0
- data/lib/split.js +117 -0
- data/lib/terser.js +2 -0
- data/lib/terser.rb +493 -0
- data/lib/terser/compressor.rb +50 -0
- data/lib/terser/version.rb +6 -0
- data/lib/terser_wrapper.js +51 -0
- data/terser.gemspec +38 -0
- metadata +146 -0
data/Rakefile
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
require 'bundler/gem_tasks'
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
8
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
9
|
+
end
|
10
|
+
|
11
|
+
def version
|
12
|
+
ENV.fetch('VERSION')
|
13
|
+
end
|
14
|
+
|
15
|
+
HEADER = "## next"
|
16
|
+
|
17
|
+
def changelog_tail
|
18
|
+
changelog = File.read("CHANGELOG.md")
|
19
|
+
if changelog.start_with?(HEADER)
|
20
|
+
changelog[HEADER.length + 2..-1]
|
21
|
+
else
|
22
|
+
"\n" + changelog
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def compare_url(from, to)
|
27
|
+
"https://github.com/terser/terser/compare/#{from}...#{to}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def previous_version
|
31
|
+
match = File.read("CHANGELOG.md").scan(/- update Terser to \[(.*)\]\(/)
|
32
|
+
match ? match[0][0].chomp : nil
|
33
|
+
end
|
34
|
+
|
35
|
+
def git_commit(files, message)
|
36
|
+
`git add #{files.join(' ')}`
|
37
|
+
`git commit -S -m "#{message.gsub('"', "\\\"")}"`
|
38
|
+
end
|
39
|
+
|
40
|
+
# rubocop:disable Metrics/BlockLength
|
41
|
+
namespace :terser do
|
42
|
+
desc "Update Terser source to version specified in VERSION environment variable"
|
43
|
+
task :update do
|
44
|
+
cd 'vendor/terser' do
|
45
|
+
`git fetch && git checkout v#{version}`
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "Rebuild lib/terser*.js"
|
50
|
+
task :build do
|
51
|
+
cd 'vendor/source-map/' do
|
52
|
+
`npm install --no-package-lock --no-save`
|
53
|
+
end
|
54
|
+
|
55
|
+
cd 'vendor/terser/' do
|
56
|
+
FileUtils.rm_rf("package-lock.json")
|
57
|
+
`npm install --no-package-lock --no-save`
|
58
|
+
end
|
59
|
+
|
60
|
+
FileUtils.cp("vendor/source-map/dist/source-map.min.js", "lib/source-map.js")
|
61
|
+
FileUtils.cp("vendor/terser/dist/bundle.min.js", "lib/terser.js")
|
62
|
+
|
63
|
+
FileUtils.cp("vendor/split/split.js", "lib/split.js")
|
64
|
+
`patch -p1 -i patches/es5-string-split.patch`
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Add Terser version bump to changelog"
|
68
|
+
task :changelog do
|
69
|
+
url = compare_url("v#{previous_version}", "v#{version}")
|
70
|
+
item = "- update Terser to [#{version}](#{url})"
|
71
|
+
changelog = "#{HEADER}\n\n#{item}\n#{changelog_tail}"
|
72
|
+
File.write("CHANGELOG.md", changelog)
|
73
|
+
end
|
74
|
+
|
75
|
+
desc "Commit changes from Terser version bump"
|
76
|
+
task :commit do
|
77
|
+
files = [
|
78
|
+
'CHANGELOG.md',
|
79
|
+
'lib/terser.js',
|
80
|
+
'vendor/terser'
|
81
|
+
]
|
82
|
+
git_commit(files, "Update Terser to #{version}")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
# rubocop:enable Metrics/BlockLength
|
86
|
+
|
87
|
+
desc "Update Terser to version specified in VERSION environment variable"
|
88
|
+
task :terser => ['terser:update', 'terser:build', 'terser:changelog', 'terser:commit']
|
89
|
+
|
90
|
+
namespace :version do
|
91
|
+
desc "Write version to CHANGELOG.md"
|
92
|
+
task :changelog do
|
93
|
+
content = File.read("CHANGELOG.md")
|
94
|
+
date = Time.now.strftime("%d %B %Y")
|
95
|
+
File.write("CHANGELOG.md", content.gsub("## next", "## #{version} (#{date})"))
|
96
|
+
end
|
97
|
+
|
98
|
+
desc "Write version"
|
99
|
+
task :ruby do
|
100
|
+
file = "lib/terser/version.rb"
|
101
|
+
content = File.read("lib/terser/version.rb")
|
102
|
+
File.write(file, content.gsub(/VERSION = "(.*)"/, "VERSION = \"#{version}\""))
|
103
|
+
end
|
104
|
+
|
105
|
+
desc "Commit changes from Terser version bump"
|
106
|
+
task :commit do
|
107
|
+
files = ["CHANGELOG.md", "lib/terser/version.rb"]
|
108
|
+
git_commit(files, "Bump version to #{version}")
|
109
|
+
end
|
110
|
+
|
111
|
+
desc "Create git tag for version"
|
112
|
+
task :tag do
|
113
|
+
`git tag -s -m "Version #{version}" v#{version}`
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
desc "Update Terser to version specified in VERSION environment variable"
|
118
|
+
task :version => ['version:changelog', 'version:ruby', 'version:commit', 'version:tag']
|
119
|
+
|
120
|
+
begin
|
121
|
+
require 'rubocop/rake_task'
|
122
|
+
RuboCop::RakeTask.new(:rubocop)
|
123
|
+
task :default => [:rubocop, :spec]
|
124
|
+
rescue LoadError
|
125
|
+
task :default => [:spec]
|
126
|
+
end
|
data/lib/es5.js
ADDED
@@ -0,0 +1,321 @@
|
|
1
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/global_objects/array/foreach
|
2
|
+
|
3
|
+
if (!Array.prototype.forEach)
|
4
|
+
{
|
5
|
+
Array.prototype.forEach = function(fun /*, thisp */)
|
6
|
+
{
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
if (this === void 0 || this === null)
|
10
|
+
throw new TypeError();
|
11
|
+
|
12
|
+
var t = Object(this);
|
13
|
+
var len = t.length >>> 0;
|
14
|
+
if (typeof fun !== "function")
|
15
|
+
throw new TypeError();
|
16
|
+
|
17
|
+
var thisp = arguments[1];
|
18
|
+
for (var i = 0; i < len; i++)
|
19
|
+
{
|
20
|
+
if (i in t)
|
21
|
+
fun.call(thisp, t[i], i, t);
|
22
|
+
}
|
23
|
+
};
|
24
|
+
}
|
25
|
+
|
26
|
+
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
|
27
|
+
// Production steps of ECMA-262, Edition 5, 15.4.4.19
|
28
|
+
// Reference: http://es5.github.com/#x15.4.4.19
|
29
|
+
if (!Array.prototype.map) {
|
30
|
+
Array.prototype.map = function(callback, thisArg) {
|
31
|
+
|
32
|
+
var T, A, k;
|
33
|
+
|
34
|
+
if (this == null) {
|
35
|
+
throw new TypeError(" this is null or not defined");
|
36
|
+
}
|
37
|
+
|
38
|
+
// 1. Let O be the result of calling ToObject passing the |this| value as the argument.
|
39
|
+
var O = Object(this);
|
40
|
+
|
41
|
+
// 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
|
42
|
+
// 3. Let len be ToUint32(lenValue).
|
43
|
+
var len = O.length >>> 0;
|
44
|
+
|
45
|
+
// 4. If IsCallable(callback) is false, throw a TypeError exception.
|
46
|
+
// See: http://es5.github.com/#x9.11
|
47
|
+
if ({}.toString.call(callback) != "[object Function]") {
|
48
|
+
throw new TypeError(callback + " is not a function");
|
49
|
+
}
|
50
|
+
|
51
|
+
// 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
52
|
+
if (thisArg) {
|
53
|
+
T = thisArg;
|
54
|
+
}
|
55
|
+
|
56
|
+
// 6. Let A be a new array created as if by the expression new Array(len) where Array is
|
57
|
+
// the standard built-in constructor with that name and len is the value of len.
|
58
|
+
A = new Array(len);
|
59
|
+
|
60
|
+
// 7. Let k be 0
|
61
|
+
k = 0;
|
62
|
+
|
63
|
+
// 8. Repeat, while k < len
|
64
|
+
while(k < len) {
|
65
|
+
|
66
|
+
var kValue, mappedValue;
|
67
|
+
|
68
|
+
// a. Let Pk be ToString(k).
|
69
|
+
// This is implicit for LHS operands of the in operator
|
70
|
+
// b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
|
71
|
+
// This step can be combined with c
|
72
|
+
// c. If kPresent is true, then
|
73
|
+
if (k in O) {
|
74
|
+
|
75
|
+
// i. Let kValue be the result of calling the Get internal method of O with argument Pk.
|
76
|
+
kValue = O[ k ];
|
77
|
+
|
78
|
+
// ii. Let mappedValue be the result of calling the Call internal method of callback
|
79
|
+
// with T as the this value and argument list containing kValue, k, and O.
|
80
|
+
mappedValue = callback.call(T, kValue, k, O);
|
81
|
+
|
82
|
+
// iii. Call the DefineOwnProperty internal method of A with arguments
|
83
|
+
// Pk, Property Descriptor {Value: mappedValue, Writable: true, Enumerable: true, Configurable: true},
|
84
|
+
// and false.
|
85
|
+
|
86
|
+
// In browsers that support Object.defineProperty, use the following:
|
87
|
+
// Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true });
|
88
|
+
|
89
|
+
// For best browser support, use the following:
|
90
|
+
A[ k ] = mappedValue;
|
91
|
+
}
|
92
|
+
// d. Increase k by 1.
|
93
|
+
k++;
|
94
|
+
}
|
95
|
+
|
96
|
+
// 9. return A
|
97
|
+
return A;
|
98
|
+
};
|
99
|
+
}
|
100
|
+
|
101
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/Reduce
|
102
|
+
|
103
|
+
if (!Array.prototype.reduce)
|
104
|
+
{
|
105
|
+
Array.prototype.reduce = function(fun /*, initialValue */)
|
106
|
+
{
|
107
|
+
"use strict";
|
108
|
+
|
109
|
+
if (this === void 0 || this === null)
|
110
|
+
throw new TypeError();
|
111
|
+
|
112
|
+
var t = Object(this);
|
113
|
+
var len = t.length >>> 0;
|
114
|
+
if (typeof fun !== "function")
|
115
|
+
throw new TypeError();
|
116
|
+
|
117
|
+
// no value to return if no initial value and an empty array
|
118
|
+
if (len == 0 && arguments.length == 1)
|
119
|
+
throw new TypeError();
|
120
|
+
|
121
|
+
var k = 0;
|
122
|
+
var accumulator;
|
123
|
+
if (arguments.length >= 2)
|
124
|
+
{
|
125
|
+
accumulator = arguments[1];
|
126
|
+
}
|
127
|
+
else
|
128
|
+
{
|
129
|
+
do
|
130
|
+
{
|
131
|
+
if (k in t)
|
132
|
+
{
|
133
|
+
accumulator = t[k++];
|
134
|
+
break;
|
135
|
+
}
|
136
|
+
|
137
|
+
// if array contains no values, no initial value to return
|
138
|
+
if (++k >= len)
|
139
|
+
throw new TypeError();
|
140
|
+
}
|
141
|
+
while (true);
|
142
|
+
}
|
143
|
+
|
144
|
+
while (k < len)
|
145
|
+
{
|
146
|
+
if (k in t)
|
147
|
+
accumulator = fun.call(undefined, accumulator, t[k], k, t);
|
148
|
+
k++;
|
149
|
+
}
|
150
|
+
|
151
|
+
return accumulator;
|
152
|
+
};
|
153
|
+
}
|
154
|
+
|
155
|
+
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
|
156
|
+
if (!Array.prototype.indexOf) {
|
157
|
+
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
|
158
|
+
"use strict";
|
159
|
+
if (this === void 0 || this === null) {
|
160
|
+
throw new TypeError();
|
161
|
+
}
|
162
|
+
var t = Object(this);
|
163
|
+
var len = t.length >>> 0;
|
164
|
+
if (len === 0) {
|
165
|
+
return -1;
|
166
|
+
}
|
167
|
+
var n = 0;
|
168
|
+
if (arguments.length > 0) {
|
169
|
+
n = Number(arguments[1]);
|
170
|
+
if (n !== n) { // shortcut for verifying if it's NaN
|
171
|
+
n = 0;
|
172
|
+
} else if (n !== 0 && n !== Infinity && n !== -Infinity) {
|
173
|
+
n = (n > 0 || -1) * Math.floor(Math.abs(n));
|
174
|
+
}
|
175
|
+
}
|
176
|
+
if (n >= len) {
|
177
|
+
return -1;
|
178
|
+
}
|
179
|
+
var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
|
180
|
+
for (; k < len; k++) {
|
181
|
+
if (k in t && t[k] === searchElement) {
|
182
|
+
return k;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
return -1;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
// https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/Object/keys
|
190
|
+
if (!Object.keys) {
|
191
|
+
Object.keys = (function () {
|
192
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
193
|
+
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
|
194
|
+
dontEnums = [
|
195
|
+
'toString',
|
196
|
+
'toLocaleString',
|
197
|
+
'valueOf',
|
198
|
+
'hasOwnProperty',
|
199
|
+
'isPrototypeOf',
|
200
|
+
'propertyIsEnumerable',
|
201
|
+
'constructor'
|
202
|
+
],
|
203
|
+
dontEnumsLength = dontEnums.length;
|
204
|
+
|
205
|
+
return function (obj) {
|
206
|
+
if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object');
|
207
|
+
|
208
|
+
var result = [];
|
209
|
+
|
210
|
+
for (var prop in obj) {
|
211
|
+
if (hasOwnProperty.call(obj, prop)) result.push(prop);
|
212
|
+
}
|
213
|
+
|
214
|
+
if (hasDontEnumBug) {
|
215
|
+
for (var i=0; i < dontEnumsLength; i++) {
|
216
|
+
if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i]);
|
217
|
+
}
|
218
|
+
}
|
219
|
+
return result;
|
220
|
+
}
|
221
|
+
})()
|
222
|
+
};
|
223
|
+
|
224
|
+
// https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/Object/create
|
225
|
+
if (!Object.create) {
|
226
|
+
Object.create = function (o) {
|
227
|
+
if (arguments.length > 1) {
|
228
|
+
throw new Error('Object.create implementation only accepts the first parameter.');
|
229
|
+
}
|
230
|
+
function F() {}
|
231
|
+
F.prototype = o;
|
232
|
+
return new F();
|
233
|
+
};
|
234
|
+
}
|
235
|
+
|
236
|
+
// https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/Array/filter
|
237
|
+
if (!Array.prototype.filter)
|
238
|
+
{
|
239
|
+
Array.prototype.filter = function(fun /*, thisp*/)
|
240
|
+
{
|
241
|
+
"use strict";
|
242
|
+
|
243
|
+
if (this == null)
|
244
|
+
throw new TypeError();
|
245
|
+
|
246
|
+
var t = Object(this);
|
247
|
+
var len = t.length >>> 0;
|
248
|
+
if (typeof fun != "function")
|
249
|
+
throw new TypeError();
|
250
|
+
|
251
|
+
var res = [];
|
252
|
+
var thisp = arguments[1];
|
253
|
+
for (var i = 0; i < len; i++)
|
254
|
+
{
|
255
|
+
if (i in t)
|
256
|
+
{
|
257
|
+
var val = t[i]; // in case fun mutates this
|
258
|
+
if (fun.call(thisp, val, i, t))
|
259
|
+
res.push(val);
|
260
|
+
}
|
261
|
+
}
|
262
|
+
|
263
|
+
return res;
|
264
|
+
};
|
265
|
+
}
|
266
|
+
|
267
|
+
// https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/Function/bind
|
268
|
+
if (!Function.prototype.bind) {
|
269
|
+
Function.prototype.bind = function (oThis) {
|
270
|
+
if (typeof this !== "function") {
|
271
|
+
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
272
|
+
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
273
|
+
}
|
274
|
+
|
275
|
+
var aArgs = Array.prototype.slice.call(arguments, 1),
|
276
|
+
fToBind = this,
|
277
|
+
fNOP = function () {},
|
278
|
+
fBound = function () {
|
279
|
+
return fToBind.apply(this instanceof fNOP && oThis
|
280
|
+
? this
|
281
|
+
: oThis,
|
282
|
+
aArgs.concat(Array.prototype.slice.call(arguments)));
|
283
|
+
};
|
284
|
+
|
285
|
+
fNOP.prototype = this.prototype;
|
286
|
+
fBound.prototype = new fNOP();
|
287
|
+
|
288
|
+
return fBound;
|
289
|
+
};
|
290
|
+
}
|
291
|
+
|
292
|
+
// https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/Array/isArray
|
293
|
+
if(!Array.isArray) {
|
294
|
+
Array.isArray = function (vArg) {
|
295
|
+
return Object.prototype.toString.call(vArg) === "[object Array]";
|
296
|
+
};
|
297
|
+
}
|
298
|
+
|
299
|
+
// https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/String/trim
|
300
|
+
if(!String.prototype.trim) {
|
301
|
+
String.prototype.trim = function () {
|
302
|
+
return this.replace(/^\s+|\s+$/g,'');
|
303
|
+
};
|
304
|
+
}
|
305
|
+
|
306
|
+
|
307
|
+
function definePropertyWorks() {
|
308
|
+
try {
|
309
|
+
Object.defineProperty({}, "property", {});
|
310
|
+
return true;
|
311
|
+
} catch (exception) {
|
312
|
+
return false;
|
313
|
+
}
|
314
|
+
}
|
315
|
+
|
316
|
+
if (!definePropertyWorks()) {
|
317
|
+
Object.defineProperty = function defineProperty(object) {
|
318
|
+
// fail silently
|
319
|
+
return object;
|
320
|
+
}
|
321
|
+
}
|
data/lib/source-map.js
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var o=t;null!==n&&(o=i.relative(n,t)),r._sources.has(o)||r._sources.add(o);var s=e.sourceContentFor(t);null!=s&&r.setSourceContent(t,s)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f<d;f++){if(n=h[f],e="",n.generatedLine!==a)for(s=0;n.generatedLine!==a;)e+=";",a++;else if(f>0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<<s,u=a-1,l=a;n.encode=function(e){var n,r="",o=t(e);do n=o&u,o>>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<<p,p+=s}while(t);r.value=o(g),r.rest=n}},function(e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){var n=65,r=90,t=97,o=122,i=48,s=57,a=43,u=47,l=26,c=52;return n<=e&&e<=r?e-n:t<=e&&e<=o?e-t+l:i<=e&&e<=s?e-i+c:e==a?62:e==u?63:-1}},function(e,n){function r(e,n,r){if(n in e)return e[n];if(3===arguments.length)return r;throw new Error('"'+n+'" is a required argument.')}function t(e){var n=e.match(v);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function i(e){var r=e,i=t(e);if(i){if(!i.path)return e;r=i.path}for(var s,a=n.isAbsolute(r),u=r.split(/\/+/),l=0,c=u.length-1;c>=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(y))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=f(e.source,n.source);return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:f(e.name,n.name)))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=f(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:f(e.name,n.name)))))}function f(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}function m(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function _(e,n,r){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),r){var a=t(r);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var u=a.path.lastIndexOf("/");u>=0&&(a.path=a.path.substring(0,u+1))}n=s(o(a),n)}return i(n)}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,y=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||v.test(e)},n.relative=a;var C=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=C?u:l,n.fromSetString=C?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d,n.parseSourceMapInput=m,n.computeSourceURL=_},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o<i;o++)r.add(e[o],n);return r},t.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},t.prototype.add=function(e,n){var r=s?e:o.toSetString(e),t=s?this.has(e):i.call(this._set,r),a=this._array.length;t&&!n||this._array.push(e),t||(s?this._set.set(e,a):this._set[r]=a)},t.prototype.has=function(e){if(s)return this._set.has(e);var n=o.toSetString(e);return i.call(this._set,n)},t.prototype.indexOf=function(e){if(s){var n=this._set.get(e);if(n>=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},t.prototype.toArray=function(){return this._array.slice()},n.ArraySet=t},function(e,n,r){function t(e,n){var r=e.generatedLine,t=n.generatedLine,o=e.generatedColumn,s=n.generatedColumn;return t>r||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e,n){var r=e;return"string"==typeof e&&(r=a.parseSourceMapInput(e)),null!=r.sections?new s(r,n):new o(r,n)}function o(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var t=a.getArg(r,"version"),o=a.getArg(r,"sources"),i=a.getArg(r,"names",[]),s=a.getArg(r,"sourceRoot",null),u=a.getArg(r,"sourcesContent",null),c=a.getArg(r,"mappings"),g=a.getArg(r,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);s&&(s=a.normalize(s)),o=o.map(String).map(a.normalize).map(function(e){return s&&a.isAbsolute(s)&&a.isAbsolute(e)?a.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return a.computeSourceURL(s,e,n)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=n,this.file=g}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var o=a.getArg(r,"version"),i=a.getArg(r,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=a.getArg(e,"offset"),o=a.getArg(r,"line"),i=a.getArg(r,"column");if(o<s.line||o===s.line&&i<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=r,{generatedOffset:{generatedLine:o+1,generatedColumn:i+1},consumer:new t(a.getArg(e,"map"),n)}})}var a=r(4),u=r(8),l=r(5).ArraySet,c=r(2),g=r(9).quickSort;t.fromSourceMap=function(e,n){return o.fromSourceMap(e,n)},t.prototype._version=3,t.prototype.__generatedMappings=null,Object.defineProperty(t.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),t.prototype.__originalMappings=null,Object.defineProperty(t.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),t.prototype._charIsMappingSeparator=function(e,n){var r=e.charAt(n);return";"===r||","===r},t.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")},t.GENERATED_ORDER=1,t.ORIGINAL_ORDER=2,t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.prototype.eachMapping=function(e,n,r){var o,i=n||null,s=r||t.GENERATED_ORDER;switch(s){case t.GENERATED_ORDER:o=this._generatedMappings;break;case t.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;o.map(function(e){var n=null===e.source?null:this._sources.at(e.source);return n=a.computeSourceURL(u,n,this._sourceMapURL),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,i)},t.prototype.allGeneratedPositionsFor=function(e){var n=a.getArg(e,"line"),r={source:a.getArg(e,"source"),originalLine:n,originalColumn:a.getArg(e,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var t=[],o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(e){var n=e;if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1},o.fromSourceMap=function(e,n){var r=Object.create(o.prototype),t=r._names=l.fromArray(e._names.toArray(),!0),s=r._sources=l.fromArray(e._sources.toArray(),!0);r.sourceRoot=e._sourceRoot,r.sourcesContent=e._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=e._file,r._sourceMapURL=n,r._absoluteSources=r._sources.toArray().map(function(e){return a.computeSourceURL(r.sourceRoot,e,n)});for(var u=e._mappings.toArray().slice(),c=r.__generatedMappings=[],p=r.__originalMappings=[],h=0,f=u.length;h<f;h++){var d=u[h],m=new i;m.generatedLine=d.generatedLine,m.generatedColumn=d.generatedColumn,d.source&&(m.source=s.indexOf(d.source),m.originalLine=d.originalLine,m.originalColumn=d.originalColumn,d.name&&(m.name=t.indexOf(d.name)),p.push(m)),c.push(m)}return g(r.__originalMappings,a.compareByOriginalPositions),r},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),o.prototype._parseMappings=function(e,n){for(var r,t,o,s,u,l=1,p=0,h=0,f=0,d=0,m=0,_=e.length,v=0,y={},C={},S=[],A=[];v<_;)if(";"===e.charAt(v))l++,v++,p=0;else if(","===e.charAt(v))v++;else{for(r=new i,r.generatedLine=l,s=v;s<_&&!this._charIsMappingSeparator(e,s);s++);if(t=e.slice(v,s),o=y[t])v+=t.length;else{for(o=[];v<s;)c.decode(e,v,C),u=C.value,v=C.rest,o.push(u);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");y[t]=o}r.generatedColumn=p+o[0],p=r.generatedColumn,o.length>1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),A.push(r),"number"==typeof r.originalLine&&S.push(r)}g(A,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,g(S,a.compareByOriginalPositions),this.__originalMappings=S},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(n.generatedLine===r.generatedLine){n.lastGeneratedColumn=r.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},r=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",a.compareByGeneratedPositionsDeflated,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=a.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var t=e;null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t));var o;if(null!=this.sourceRoot&&(o=a.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!o.path||"/"==o.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(n)return null;throw new Error('"'+t+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n<this._sections.length;n++)for(var r=0;r<this._sections[n].consumer.sources.length;r++)e.push(this._sections[n].consumer.sources[r]);return e}}),s.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},r=u.search(n,this._sections,function(e,n){var r=e.generatedLine-n.generatedOffset.generatedLine;return r?r:e.generatedColumn-n.generatedOffset.generatedColumn}),t=this._sections[r];return t?t.consumer.originalPositionFor({line:n.generatedLine-(t.generatedOffset.generatedLine-1),column:n.generatedColumn-(t.generatedOffset.generatedLine===n.generatedLine?t.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},s.prototype.sourceContentFor=function(e,n){for(var r=0;r<this._sections.length;r++){var t=this._sections[r],o=t.consumer.sourceContentFor(e,!0);if(o)return o}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},s.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var r=this._sections[n];if(r.consumer._findSourceIndex(a.getArg(e,"source"))!==-1){var t=r.consumer.generatedPositionFor(e);if(t){var o={line:t.line+(r.generatedOffset.generatedLine-1),column:t.column+(r.generatedOffset.generatedLine===t.line?r.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},s.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var t=this._sections[r],o=t.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],u=t.consumer._sources.at(s.source);u=a.computeSourceURL(t.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;s.name&&(l=t.consumer._names.at(s.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:s.generatedLine+(t.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(t.generatedOffset.generatedLine===s.generatedLine?t.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}g(this.__generatedMappings,a.compareByGeneratedPositionsDeflated),g(this.__originalMappings,a.compareByOriginalPositions)},n.IndexedSourceMapConsumer=s},function(e,n){function r(e,t,o,i,s,a){var u=Math.floor((t-e)/2)+e,l=s(o,i[u],!0);return 0===l?u:l>0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t<i.length?t:-1:u:u-e>1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i<s){var a=t(i,s),u=i-1;r(e,a,s);for(var l=e[s],c=i;c<s;c++)n(e[c],l)<=0&&(u+=1,r(e,u,c));r(e,u+1,c);var g=u+1;o(e,n,i,g-1),o(e,n,g+1,s)}}n.quickSort=function(e,n){o(e,n,0,e.length-1)}},function(e,n,r){function t(e,n,r,t,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==r?null:r,this.name=null==o?null:o,this[u]=!0,null!=t&&this.add(t)}var o=r(1).SourceMapGenerator,i=r(4),s=/(\r?\n)/,a=10,u="$$$isSourceNode$$$";t.fromStringWithSourceMap=function(e,n,r){function o(e,n){if(null===e||void 0===e.source)a.add(n);else{var o=r?i.join(r,e.source):e.source;a.add(new t(e.originalLine,e.originalColumn,o,n,e.name))}}var a=new t,u=e.split(s),l=0,c=function(){function e(){return l<u.length?u[l++]:void 0}var n=e(),r=e()||"";return n+r},g=1,p=0,h=null;return n.eachMapping(function(e){if(null!==h){if(!(g<e.generatedLine)){var n=u[l]||"",r=n.substr(0,e.generatedColumn-p);return u[l]=n.substr(e.generatedColumn-p),p=e.generatedColumn,o(h,r),void(h=e)}o(h,c()),g++,p=0}for(;g<e.generatedLine;)a.add(c()),g++;if(p<e.generatedColumn){var n=u[l]||"";a.add(n.substr(0,e.generatedColumn)),u[l]=n.substr(e.generatedColumn),p=e.generatedColumn}h=e},this),l<u.length&&(h&&o(h,c()),a.add(u.splice(l).join(""))),n.sources.forEach(function(e){var t=n.sourceContentFor(e);null!=t&&(null!=r&&(e=i.join(r,e)),a.setSourceContent(e,t))}),a},t.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},t.prototype.prepend=function(e){if(Array.isArray(e))for(var n=e.length-1;n>=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r<t;r++)n=this.children[r],n[u]?n.walk(e):""!==n&&e(n,{source:this.source,line:this.line,column:this.column,name:this.name})},t.prototype.join=function(e){var n,r,t=this.children.length;if(t>0){for(n=[],r=0;r<t-1;r++)n.push(this.children[r]),n.push(e);n.push(this.children[r]),this.children=n}return this},t.prototype.replaceRight=function(e,n){var r=this.children[this.children.length-1];return r[u]?r.replaceRight(e,n):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,n):this.children.push("".replace(e,n)),this},t.prototype.setSourceContent=function(e,n){this.sourceContents[i.toSetString(e)]=n},t.prototype.walkSourceContents=function(e){for(var n=0,r=this.children.length;n<r;n++)this.children[n][u]&&this.children[n].walkSourceContents(e);for(var t=Object.keys(this.sourceContents),n=0,r=t.length;n<r;n++)e(i.fromSetString(t[n]),this.sourceContents[t[n]])},t.prototype.toString=function(){var e="";return this.walk(function(n){e+=n}),e},t.prototype.toStringWithSourceMap=function(e){var n={code:"",line:1,column:0},r=new o(e),t=!1,i=null,s=null,u=null,l=null;return this.walk(function(e,o){n.code+=e,null!==o.source&&null!==o.line&&null!==o.column?(i===o.source&&s===o.line&&u===o.column&&l===o.name||r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:n.line,column:n.column},name:o.name}),i=o.source,s=o.line,u=o.column,l=o.name,t=!0):t&&(r.addMapping({generated:{line:n.line,column:n.column}}),i=null,t=!1);for(var c=0,g=e.length;c<g;c++)e.charCodeAt(c)===a?(n.line++,n.column=0,c+1===g?(i=null,t=!1):t&&r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:n.line,column:n.column},name:o.name})):n.column++}),this.walkSourceContents(function(e,n){r.setSourceContent(e,n)}),{code:n.code,map:r}},n.SourceNode=t}])});
|
2
|
+
//# sourceMappingURL=source-map.min.js.map
|