1 | (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, (function(modules) {
|
2 |
|
3 | var installedModules = {};
|
4 |
|
5 |
|
6 | function __webpack_require__(moduleId) {
|
7 |
|
8 |
|
9 | if(installedModules[moduleId]) {
|
10 | return installedModules[moduleId].exports;
|
11 | }
|
12 |
|
13 | var module = installedModules[moduleId] = {
|
14 | i: moduleId,
|
15 | l: false,
|
16 | exports: {}
|
17 | };
|
18 |
|
19 |
|
20 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
|
22 |
|
23 | module.l = true;
|
24 |
|
25 |
|
26 | return module.exports;
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 | __webpack_require__.m = modules;
|
32 |
|
33 |
|
34 | __webpack_require__.c = installedModules;
|
35 |
|
36 |
|
37 | __webpack_require__.d = function(exports, name, getter) {
|
38 | if(!__webpack_require__.o(exports, name)) {
|
39 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
40 | }
|
41 | };
|
42 |
|
43 |
|
44 | __webpack_require__.r = function(exports) {
|
45 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
46 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47 | }
|
48 | Object.defineProperty(exports, '__esModule', { value: true });
|
49 | };
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | __webpack_require__.t = function(value, mode) {
|
57 | if(mode & 1) value = __webpack_require__(value);
|
58 | if(mode & 8) return value;
|
59 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
60 | var ns = Object.create(null);
|
61 | __webpack_require__.r(ns);
|
62 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
63 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
64 | return ns;
|
65 | };
|
66 |
|
67 |
|
68 | __webpack_require__.n = function(module) {
|
69 | var getter = module && module.__esModule ?
|
70 | function getDefault() { return module['default']; } :
|
71 | function getModuleExports() { return module; };
|
72 | __webpack_require__.d(getter, 'a', getter);
|
73 | return getter;
|
74 | };
|
75 |
|
76 |
|
77 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
78 |
|
79 |
|
80 | __webpack_require__.p = "";
|
81 |
|
82 |
|
83 |
|
84 | return __webpack_require__(__webpack_require__.s = 349);
|
85 | })
|
86 |
|
87 | ([
|
88 | ,
|
89 | ,
|
90 |
|
91 | (function(module, exports, __webpack_require__) {
|
92 |
|
93 | "use strict";
|
94 |
|
95 | Object.defineProperty(exports, "__esModule", { value: true });
|
96 | exports.sortTexts = {
|
97 | one: "00001",
|
98 | two: "00002",
|
99 | three: "00003",
|
100 | four: "00004",
|
101 | };
|
102 | exports.projectRootPatterns = [".git", "autoload", "plugin"];
|
103 |
|
104 |
|
105 | }),
|
106 | ,
|
107 |
|
108 | (function(module, exports, __webpack_require__) {
|
109 |
|
110 | "use strict";
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 | function __export(m) {
|
118 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
119 | }
|
120 | Object.defineProperty(exports, "__esModule", { value: true });
|
121 | const vscode_languageserver_protocol_1 = __webpack_require__(5);
|
122 | exports.Event = vscode_languageserver_protocol_1.Event;
|
123 | const configuration_1 = __webpack_require__(30);
|
124 | const workspaceFolders_1 = __webpack_require__(32);
|
125 | const Is = __webpack_require__(31);
|
126 | const UUID = __webpack_require__(33);
|
127 |
|
128 | __export(__webpack_require__(5));
|
129 | const fm = __webpack_require__(34);
|
130 | var Files;
|
131 | (function (Files) {
|
132 | Files.uriToFilePath = fm.uriToFilePath;
|
133 | Files.resolveGlobalNodePath = fm.resolveGlobalNodePath;
|
134 | Files.resolveGlobalYarnPath = fm.resolveGlobalYarnPath;
|
135 | Files.resolve = fm.resolve;
|
136 | Files.resolveModule = fm.resolveModule;
|
137 | Files.resolveModule2 = fm.resolveModule2;
|
138 | Files.resolveModulePath = fm.resolveModulePath;
|
139 | })(Files = exports.Files || (exports.Files = {}));
|
140 | let shutdownReceived = false;
|
141 | let exitTimer = undefined;
|
142 | function setupExitTimer() {
|
143 | const argName = '--clientProcessId';
|
144 | function runTimer(value) {
|
145 | try {
|
146 | let processId = parseInt(value);
|
147 | if (!isNaN(processId)) {
|
148 | exitTimer = setInterval(() => {
|
149 | try {
|
150 | process.kill(processId, 0);
|
151 | }
|
152 | catch (ex) {
|
153 |
|
154 | process.exit(shutdownReceived ? 0 : 1);
|
155 | }
|
156 | }, 3000);
|
157 | }
|
158 | }
|
159 | catch (e) {
|
160 |
|
161 | }
|
162 | }
|
163 | for (let i = 2; i < process.argv.length; i++) {
|
164 | let arg = process.argv[i];
|
165 | if (arg === argName && i + 1 < process.argv.length) {
|
166 | runTimer(process.argv[i + 1]);
|
167 | return;
|
168 | }
|
169 | else {
|
170 | let args = arg.split('=');
|
171 | if (args[0] === argName) {
|
172 | runTimer(args[1]);
|
173 | }
|
174 | }
|
175 | }
|
176 | }
|
177 | setupExitTimer();
|
178 | function null2Undefined(value) {
|
179 | if (value === null) {
|
180 | return void 0;
|
181 | }
|
182 | return value;
|
183 | }
|
184 |
|
185 |
|
186 |
|
187 | class TextDocuments {
|
188 | |
189 |
|
190 |
|
191 | constructor() {
|
192 | this._documents = Object.create(null);
|
193 | this._onDidChangeContent = new vscode_languageserver_protocol_1.Emitter();
|
194 | this._onDidOpen = new vscode_languageserver_protocol_1.Emitter();
|
195 | this._onDidClose = new vscode_languageserver_protocol_1.Emitter();
|
196 | this._onDidSave = new vscode_languageserver_protocol_1.Emitter();
|
197 | this._onWillSave = new vscode_languageserver_protocol_1.Emitter();
|
198 | }
|
199 | |
200 |
|
201 |
|
202 |
|
203 | get syncKind() {
|
204 | return vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;
|
205 | }
|
206 | |
207 |
|
208 |
|
209 |
|
210 | get onDidChangeContent() {
|
211 | return this._onDidChangeContent.event;
|
212 | }
|
213 | |
214 |
|
215 |
|
216 |
|
217 | get onDidOpen() {
|
218 | return this._onDidOpen.event;
|
219 | }
|
220 | |
221 |
|
222 |
|
223 |
|
224 | get onWillSave() {
|
225 | return this._onWillSave.event;
|
226 | }
|
227 | |
228 |
|
229 |
|
230 |
|
231 | onWillSaveWaitUntil(handler) {
|
232 | this._willSaveWaitUntil = handler;
|
233 | }
|
234 | |
235 |
|
236 |
|
237 |
|
238 | get onDidSave() {
|
239 | return this._onDidSave.event;
|
240 | }
|
241 | |
242 |
|
243 |
|
244 |
|
245 | get onDidClose() {
|
246 | return this._onDidClose.event;
|
247 | }
|
248 | |
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 | get(uri) {
|
256 | return this._documents[uri];
|
257 | }
|
258 | |
259 |
|
260 |
|
261 |
|
262 |
|
263 | all() {
|
264 | return Object.keys(this._documents).map(key => this._documents[key]);
|
265 | }
|
266 | |
267 |
|
268 |
|
269 |
|
270 |
|
271 | keys() {
|
272 | return Object.keys(this._documents);
|
273 | }
|
274 | |
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 | listen(connection) {
|
281 | function isUpdateableDocument(value) {
|
282 | return Is.func(value.update);
|
283 | }
|
284 | connection.__textDocumentSync = vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;
|
285 | connection.onDidOpenTextDocument((event) => {
|
286 | let td = event.textDocument;
|
287 | let document = vscode_languageserver_protocol_1.TextDocument.create(td.uri, td.languageId, td.version, td.text);
|
288 | this._documents[td.uri] = document;
|
289 | let toFire = Object.freeze({ document });
|
290 | this._onDidOpen.fire(toFire);
|
291 | this._onDidChangeContent.fire(toFire);
|
292 | });
|
293 | connection.onDidChangeTextDocument((event) => {
|
294 | let td = event.textDocument;
|
295 | let changes = event.contentChanges;
|
296 | let last = changes.length > 0 ? changes[changes.length - 1] : undefined;
|
297 | if (last) {
|
298 | let document = this._documents[td.uri];
|
299 | if (document && isUpdateableDocument(document)) {
|
300 | if (td.version === null || td.version === void 0) {
|
301 | throw new Error(`Received document change event for ${td.uri} without valid version identifier`);
|
302 | }
|
303 | document.update(last, td.version);
|
304 | this._onDidChangeContent.fire(Object.freeze({ document }));
|
305 | }
|
306 | }
|
307 | });
|
308 | connection.onDidCloseTextDocument((event) => {
|
309 | let document = this._documents[event.textDocument.uri];
|
310 | if (document) {
|
311 | delete this._documents[event.textDocument.uri];
|
312 | this._onDidClose.fire(Object.freeze({ document }));
|
313 | }
|
314 | });
|
315 | connection.onWillSaveTextDocument((event) => {
|
316 | let document = this._documents[event.textDocument.uri];
|
317 | if (document) {
|
318 | this._onWillSave.fire(Object.freeze({ document, reason: event.reason }));
|
319 | }
|
320 | });
|
321 | connection.onWillSaveTextDocumentWaitUntil((event, token) => {
|
322 | let document = this._documents[event.textDocument.uri];
|
323 | if (document && this._willSaveWaitUntil) {
|
324 | return this._willSaveWaitUntil(Object.freeze({ document, reason: event.reason }), token);
|
325 | }
|
326 | else {
|
327 | return [];
|
328 | }
|
329 | });
|
330 | connection.onDidSaveTextDocument((event) => {
|
331 | let document = this._documents[event.textDocument.uri];
|
332 | if (document) {
|
333 | this._onDidSave.fire(Object.freeze({ document }));
|
334 | }
|
335 | });
|
336 | }
|
337 | }
|
338 | exports.TextDocuments = TextDocuments;
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 | class ErrorMessageTracker {
|
346 | constructor() {
|
347 | this._messages = Object.create(null);
|
348 | }
|
349 | |
350 |
|
351 |
|
352 |
|
353 |
|
354 | add(message) {
|
355 | let count = this._messages[message];
|
356 | if (!count) {
|
357 | count = 0;
|
358 | }
|
359 | count++;
|
360 | this._messages[message] = count;
|
361 | }
|
362 | |
363 |
|
364 |
|
365 |
|
366 |
|
367 | sendErrors(connection) {
|
368 | Object.keys(this._messages).forEach(message => {
|
369 | connection.window.showErrorMessage(message);
|
370 | });
|
371 | }
|
372 | }
|
373 | exports.ErrorMessageTracker = ErrorMessageTracker;
|
374 | var BulkRegistration;
|
375 | (function (BulkRegistration) {
|
376 | |
377 |
|
378 |
|
379 |
|
380 | function create() {
|
381 | return new BulkRegistrationImpl();
|
382 | }
|
383 | BulkRegistration.create = create;
|
384 | })(BulkRegistration = exports.BulkRegistration || (exports.BulkRegistration = {}));
|
385 | class BulkRegistrationImpl {
|
386 | constructor() {
|
387 | this._registrations = [];
|
388 | this._registered = new Set();
|
389 | }
|
390 | add(type, registerOptions) {
|
391 | const method = Is.string(type) ? type : type.method;
|
392 | if (this._registered.has(method)) {
|
393 | throw new Error(`${method} is already added to this registration`);
|
394 | }
|
395 | const id = UUID.generateUuid();
|
396 | this._registrations.push({
|
397 | id: id,
|
398 | method: method,
|
399 | registerOptions: registerOptions || {}
|
400 | });
|
401 | this._registered.add(method);
|
402 | }
|
403 | asRegistrationParams() {
|
404 | return {
|
405 | registrations: this._registrations
|
406 | };
|
407 | }
|
408 | }
|
409 | var BulkUnregistration;
|
410 | (function (BulkUnregistration) {
|
411 | function create() {
|
412 | return new BulkUnregistrationImpl(undefined, []);
|
413 | }
|
414 | BulkUnregistration.create = create;
|
415 | })(BulkUnregistration = exports.BulkUnregistration || (exports.BulkUnregistration = {}));
|
416 | class BulkUnregistrationImpl {
|
417 | constructor(_connection, unregistrations) {
|
418 | this._connection = _connection;
|
419 | this._unregistrations = new Map();
|
420 | unregistrations.forEach(unregistration => {
|
421 | this._unregistrations.set(unregistration.method, unregistration);
|
422 | });
|
423 | }
|
424 | get isAttached() {
|
425 | return !!this._connection;
|
426 | }
|
427 | attach(connection) {
|
428 | this._connection = connection;
|
429 | }
|
430 | add(unregistration) {
|
431 | this._unregistrations.set(unregistration.method, unregistration);
|
432 | }
|
433 | dispose() {
|
434 | let unregistrations = [];
|
435 | for (let unregistration of this._unregistrations.values()) {
|
436 | unregistrations.push(unregistration);
|
437 | }
|
438 | let params = {
|
439 | unregisterations: unregistrations
|
440 | };
|
441 | this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => {
|
442 | this._connection.console.info(`Bulk unregistration failed.`);
|
443 | });
|
444 | }
|
445 | disposeSingle(arg) {
|
446 | const method = Is.string(arg) ? arg : arg.method;
|
447 | const unregistration = this._unregistrations.get(method);
|
448 | if (!unregistration) {
|
449 | return false;
|
450 | }
|
451 | let params = {
|
452 | unregisterations: [unregistration]
|
453 | };
|
454 | this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(() => {
|
455 | this._unregistrations.delete(method);
|
456 | }, (_error) => {
|
457 | this._connection.console.info(`Unregistering request handler for ${unregistration.id} failed.`);
|
458 | });
|
459 | return true;
|
460 | }
|
461 | }
|
462 | class ConnectionLogger {
|
463 | constructor() {
|
464 | }
|
465 | rawAttach(connection) {
|
466 | this._rawConnection = connection;
|
467 | }
|
468 | attach(connection) {
|
469 | this._connection = connection;
|
470 | }
|
471 | get connection() {
|
472 | if (!this._connection) {
|
473 | throw new Error('Remote is not attached to a connection yet.');
|
474 | }
|
475 | return this._connection;
|
476 | }
|
477 | fillServerCapabilities(_capabilities) {
|
478 | }
|
479 | initialize(_capabilities) {
|
480 | }
|
481 | error(message) {
|
482 | this.send(vscode_languageserver_protocol_1.MessageType.Error, message);
|
483 | }
|
484 | warn(message) {
|
485 | this.send(vscode_languageserver_protocol_1.MessageType.Warning, message);
|
486 | }
|
487 | info(message) {
|
488 | this.send(vscode_languageserver_protocol_1.MessageType.Info, message);
|
489 | }
|
490 | log(message) {
|
491 | this.send(vscode_languageserver_protocol_1.MessageType.Log, message);
|
492 | }
|
493 | send(type, message) {
|
494 | if (this._rawConnection) {
|
495 | this._rawConnection.sendNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, { type, message });
|
496 | }
|
497 | }
|
498 | }
|
499 | class RemoteWindowImpl {
|
500 | constructor() {
|
501 | }
|
502 | attach(connection) {
|
503 | this._connection = connection;
|
504 | }
|
505 | get connection() {
|
506 | if (!this._connection) {
|
507 | throw new Error('Remote is not attached to a connection yet.');
|
508 | }
|
509 | return this._connection;
|
510 | }
|
511 | initialize(_capabilities) {
|
512 | }
|
513 | fillServerCapabilities(_capabilities) {
|
514 | }
|
515 | showErrorMessage(message, ...actions) {
|
516 | let params = { type: vscode_languageserver_protocol_1.MessageType.Error, message, actions };
|
517 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
|
518 | }
|
519 | showWarningMessage(message, ...actions) {
|
520 | let params = { type: vscode_languageserver_protocol_1.MessageType.Warning, message, actions };
|
521 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
|
522 | }
|
523 | showInformationMessage(message, ...actions) {
|
524 | let params = { type: vscode_languageserver_protocol_1.MessageType.Info, message, actions };
|
525 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
|
526 | }
|
527 | }
|
528 | class RemoteClientImpl {
|
529 | attach(connection) {
|
530 | this._connection = connection;
|
531 | }
|
532 | get connection() {
|
533 | if (!this._connection) {
|
534 | throw new Error('Remote is not attached to a connection yet.');
|
535 | }
|
536 | return this._connection;
|
537 | }
|
538 | initialize(_capabilities) {
|
539 | }
|
540 | fillServerCapabilities(_capabilities) {
|
541 | }
|
542 | register(typeOrRegistrations, registerOptionsOrType, registerOptions) {
|
543 | if (typeOrRegistrations instanceof BulkRegistrationImpl) {
|
544 | return this.registerMany(typeOrRegistrations);
|
545 | }
|
546 | else if (typeOrRegistrations instanceof BulkUnregistrationImpl) {
|
547 | return this.registerSingle1(typeOrRegistrations, registerOptionsOrType, registerOptions);
|
548 | }
|
549 | else {
|
550 | return this.registerSingle2(typeOrRegistrations, registerOptionsOrType);
|
551 | }
|
552 | }
|
553 | registerSingle1(unregistration, type, registerOptions) {
|
554 | const method = Is.string(type) ? type : type.method;
|
555 | const id = UUID.generateUuid();
|
556 | let params = {
|
557 | registrations: [{ id, method, registerOptions: registerOptions || {} }]
|
558 | };
|
559 | if (!unregistration.isAttached) {
|
560 | unregistration.attach(this._connection);
|
561 | }
|
562 | return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {
|
563 | unregistration.add({ id: id, method: method });
|
564 | return unregistration;
|
565 | }, (_error) => {
|
566 | this.connection.console.info(`Registering request handler for ${method} failed.`);
|
567 | return Promise.reject(_error);
|
568 | });
|
569 | }
|
570 | registerSingle2(type, registerOptions) {
|
571 | const method = Is.string(type) ? type : type.method;
|
572 | const id = UUID.generateUuid();
|
573 | let params = {
|
574 | registrations: [{ id, method, registerOptions: registerOptions || {} }]
|
575 | };
|
576 | return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {
|
577 | return vscode_languageserver_protocol_1.Disposable.create(() => {
|
578 | this.unregisterSingle(id, method);
|
579 | });
|
580 | }, (_error) => {
|
581 | this.connection.console.info(`Registering request handler for ${method} failed.`);
|
582 | return Promise.reject(_error);
|
583 | });
|
584 | }
|
585 | unregisterSingle(id, method) {
|
586 | let params = {
|
587 | unregisterations: [{ id, method }]
|
588 | };
|
589 | return this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => {
|
590 | this.connection.console.info(`Unregistering request handler for ${id} failed.`);
|
591 | });
|
592 | }
|
593 | registerMany(registrations) {
|
594 | let params = registrations.asRegistrationParams();
|
595 | return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then(() => {
|
596 | return new BulkUnregistrationImpl(this._connection, params.registrations.map(registration => { return { id: registration.id, method: registration.method }; }));
|
597 | }, (_error) => {
|
598 | this.connection.console.info(`Bulk registration failed.`);
|
599 | return Promise.reject(_error);
|
600 | });
|
601 | }
|
602 | }
|
603 | class _RemoteWorkspaceImpl {
|
604 | constructor() {
|
605 | }
|
606 | attach(connection) {
|
607 | this._connection = connection;
|
608 | }
|
609 | get connection() {
|
610 | if (!this._connection) {
|
611 | throw new Error('Remote is not attached to a connection yet.');
|
612 | }
|
613 | return this._connection;
|
614 | }
|
615 | initialize(_capabilities) {
|
616 | }
|
617 | fillServerCapabilities(_capabilities) {
|
618 | }
|
619 | applyEdit(paramOrEdit) {
|
620 | function isApplyWorkspaceEditParams(value) {
|
621 | return value && !!value.edit;
|
622 | }
|
623 | let params = isApplyWorkspaceEditParams(paramOrEdit) ? paramOrEdit : { edit: paramOrEdit };
|
624 | return this._connection.sendRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, params);
|
625 | }
|
626 | }
|
627 | const RemoteWorkspaceImpl = workspaceFolders_1.WorkspaceFoldersFeature(configuration_1.ConfigurationFeature(_RemoteWorkspaceImpl));
|
628 | class TracerImpl {
|
629 | constructor() {
|
630 | this._trace = vscode_languageserver_protocol_1.Trace.Off;
|
631 | }
|
632 | attach(connection) {
|
633 | this._connection = connection;
|
634 | }
|
635 | get connection() {
|
636 | if (!this._connection) {
|
637 | throw new Error('Remote is not attached to a connection yet.');
|
638 | }
|
639 | return this._connection;
|
640 | }
|
641 | initialize(_capabilities) {
|
642 | }
|
643 | fillServerCapabilities(_capabilities) {
|
644 | }
|
645 | set trace(value) {
|
646 | this._trace = value;
|
647 | }
|
648 | log(message, verbose) {
|
649 | if (this._trace === vscode_languageserver_protocol_1.Trace.Off) {
|
650 | return;
|
651 | }
|
652 | this._connection.sendNotification(vscode_languageserver_protocol_1.LogTraceNotification.type, {
|
653 | message: message,
|
654 | verbose: this._trace === vscode_languageserver_protocol_1.Trace.Verbose ? verbose : undefined
|
655 | });
|
656 | }
|
657 | }
|
658 | class TelemetryImpl {
|
659 | constructor() {
|
660 | }
|
661 | attach(connection) {
|
662 | this._connection = connection;
|
663 | }
|
664 | get connection() {
|
665 | if (!this._connection) {
|
666 | throw new Error('Remote is not attached to a connection yet.');
|
667 | }
|
668 | return this._connection;
|
669 | }
|
670 | initialize(_capabilities) {
|
671 | }
|
672 | fillServerCapabilities(_capabilities) {
|
673 | }
|
674 | logEvent(data) {
|
675 | this._connection.sendNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, data);
|
676 | }
|
677 | }
|
678 | function combineConsoleFeatures(one, two) {
|
679 | return function (Base) {
|
680 | return two(one(Base));
|
681 | };
|
682 | }
|
683 | exports.combineConsoleFeatures = combineConsoleFeatures;
|
684 | function combineTelemetryFeatures(one, two) {
|
685 | return function (Base) {
|
686 | return two(one(Base));
|
687 | };
|
688 | }
|
689 | exports.combineTelemetryFeatures = combineTelemetryFeatures;
|
690 | function combineTracerFeatures(one, two) {
|
691 | return function (Base) {
|
692 | return two(one(Base));
|
693 | };
|
694 | }
|
695 | exports.combineTracerFeatures = combineTracerFeatures;
|
696 | function combineClientFeatures(one, two) {
|
697 | return function (Base) {
|
698 | return two(one(Base));
|
699 | };
|
700 | }
|
701 | exports.combineClientFeatures = combineClientFeatures;
|
702 | function combineWindowFeatures(one, two) {
|
703 | return function (Base) {
|
704 | return two(one(Base));
|
705 | };
|
706 | }
|
707 | exports.combineWindowFeatures = combineWindowFeatures;
|
708 | function combineWorkspaceFeatures(one, two) {
|
709 | return function (Base) {
|
710 | return two(one(Base));
|
711 | };
|
712 | }
|
713 | exports.combineWorkspaceFeatures = combineWorkspaceFeatures;
|
714 | function combineFeatures(one, two) {
|
715 | function combine(one, two, func) {
|
716 | if (one && two) {
|
717 | return func(one, two);
|
718 | }
|
719 | else if (one) {
|
720 | return one;
|
721 | }
|
722 | else {
|
723 | return two;
|
724 | }
|
725 | }
|
726 | let result = {
|
727 | __brand: 'features',
|
728 | console: combine(one.console, two.console, combineConsoleFeatures),
|
729 | tracer: combine(one.tracer, two.tracer, combineTracerFeatures),
|
730 | telemetry: combine(one.telemetry, two.telemetry, combineTelemetryFeatures),
|
731 | client: combine(one.client, two.client, combineClientFeatures),
|
732 | window: combine(one.window, two.window, combineWindowFeatures),
|
733 | workspace: combine(one.workspace, two.workspace, combineWorkspaceFeatures)
|
734 | };
|
735 | return result;
|
736 | }
|
737 | exports.combineFeatures = combineFeatures;
|
738 | function createConnection(arg1, arg2, arg3, arg4) {
|
739 | let factories;
|
740 | let input;
|
741 | let output;
|
742 | let strategy;
|
743 | if (arg1 !== void 0 && arg1.__brand === 'features') {
|
744 | factories = arg1;
|
745 | arg1 = arg2;
|
746 | arg2 = arg3;
|
747 | arg3 = arg4;
|
748 | }
|
749 | if (vscode_languageserver_protocol_1.ConnectionStrategy.is(arg1)) {
|
750 | strategy = arg1;
|
751 | }
|
752 | else {
|
753 | input = arg1;
|
754 | output = arg2;
|
755 | strategy = arg3;
|
756 | }
|
757 | return _createConnection(input, output, strategy, factories);
|
758 | }
|
759 | exports.createConnection = createConnection;
|
760 | function _createConnection(input, output, strategy, factories) {
|
761 | if (!input && !output && process.argv.length > 2) {
|
762 | let port = void 0;
|
763 | let pipeName = void 0;
|
764 | let argv = process.argv.slice(2);
|
765 | for (let i = 0; i < argv.length; i++) {
|
766 | let arg = argv[i];
|
767 | if (arg === '--node-ipc') {
|
768 | input = new vscode_languageserver_protocol_1.IPCMessageReader(process);
|
769 | output = new vscode_languageserver_protocol_1.IPCMessageWriter(process);
|
770 | break;
|
771 | }
|
772 | else if (arg === '--stdio') {
|
773 | input = process.stdin;
|
774 | output = process.stdout;
|
775 | break;
|
776 | }
|
777 | else if (arg === '--socket') {
|
778 | port = parseInt(argv[i + 1]);
|
779 | break;
|
780 | }
|
781 | else if (arg === '--pipe') {
|
782 | pipeName = argv[i + 1];
|
783 | break;
|
784 | }
|
785 | else {
|
786 | var args = arg.split('=');
|
787 | if (args[0] === '--socket') {
|
788 | port = parseInt(args[1]);
|
789 | break;
|
790 | }
|
791 | else if (args[0] === '--pipe') {
|
792 | pipeName = args[1];
|
793 | break;
|
794 | }
|
795 | }
|
796 | }
|
797 | if (port) {
|
798 | let transport = vscode_languageserver_protocol_1.createServerSocketTransport(port);
|
799 | input = transport[0];
|
800 | output = transport[1];
|
801 | }
|
802 | else if (pipeName) {
|
803 | let transport = vscode_languageserver_protocol_1.createServerPipeTransport(pipeName);
|
804 | input = transport[0];
|
805 | output = transport[1];
|
806 | }
|
807 | }
|
808 | var commandLineMessage = "Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";
|
809 | if (!input) {
|
810 | throw new Error("Connection input stream is not set. " + commandLineMessage);
|
811 | }
|
812 | if (!output) {
|
813 | throw new Error("Connection output stream is not set. " + commandLineMessage);
|
814 | }
|
815 |
|
816 | if (Is.func(input.read) && Is.func(input.on)) {
|
817 | let inputStream = input;
|
818 | inputStream.on('end', () => {
|
819 | process.exit(shutdownReceived ? 0 : 1);
|
820 | });
|
821 | inputStream.on('close', () => {
|
822 | process.exit(shutdownReceived ? 0 : 1);
|
823 | });
|
824 | }
|
825 | const logger = (factories && factories.console ? new (factories.console(ConnectionLogger))() : new ConnectionLogger());
|
826 | const connection = vscode_languageserver_protocol_1.createProtocolConnection(input, output, logger, strategy);
|
827 | logger.rawAttach(connection);
|
828 | const tracer = (factories && factories.tracer ? new (factories.tracer(TracerImpl))() : new TracerImpl());
|
829 | const telemetry = (factories && factories.telemetry ? new (factories.telemetry(TelemetryImpl))() : new TelemetryImpl());
|
830 | const client = (factories && factories.client ? new (factories.client(RemoteClientImpl))() : new RemoteClientImpl());
|
831 | const remoteWindow = (factories && factories.window ? new (factories.window(RemoteWindowImpl))() : new RemoteWindowImpl());
|
832 | const workspace = (factories && factories.workspace ? new (factories.workspace(RemoteWorkspaceImpl))() : new RemoteWorkspaceImpl());
|
833 | const allRemotes = [logger, tracer, telemetry, client, remoteWindow, workspace];
|
834 | function asThenable(value) {
|
835 | if (Is.thenable(value)) {
|
836 | return value;
|
837 | }
|
838 | else {
|
839 | return Promise.resolve(value);
|
840 | }
|
841 | }
|
842 | let shutdownHandler = undefined;
|
843 | let initializeHandler = undefined;
|
844 | let exitHandler = undefined;
|
845 | let protocolConnection = {
|
846 | listen: () => connection.listen(),
|
847 | sendRequest: (type, ...params) => connection.sendRequest(Is.string(type) ? type : type.method, ...params),
|
848 | onRequest: (type, handler) => connection.onRequest(type, handler),
|
849 | sendNotification: (type, param) => {
|
850 | const method = Is.string(type) ? type : type.method;
|
851 | if (arguments.length === 1) {
|
852 | connection.sendNotification(method);
|
853 | }
|
854 | else {
|
855 | connection.sendNotification(method, param);
|
856 | }
|
857 | },
|
858 | onNotification: (type, handler) => connection.onNotification(type, handler),
|
859 | onInitialize: (handler) => initializeHandler = handler,
|
860 | onInitialized: (handler) => connection.onNotification(vscode_languageserver_protocol_1.InitializedNotification.type, handler),
|
861 | onShutdown: (handler) => shutdownHandler = handler,
|
862 | onExit: (handler) => exitHandler = handler,
|
863 | get console() { return logger; },
|
864 | get telemetry() { return telemetry; },
|
865 | get tracer() { return tracer; },
|
866 | get client() { return client; },
|
867 | get window() { return remoteWindow; },
|
868 | get workspace() { return workspace; },
|
869 | onDidChangeConfiguration: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, handler),
|
870 | onDidChangeWatchedFiles: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, handler),
|
871 | __textDocumentSync: undefined,
|
872 | onDidOpenTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, handler),
|
873 | onDidChangeTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, handler),
|
874 | onDidCloseTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, handler),
|
875 | onWillSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, handler),
|
876 | onWillSaveTextDocumentWaitUntil: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type, handler),
|
877 | onDidSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, handler),
|
878 | sendDiagnostics: (params) => connection.sendNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, params),
|
879 | onHover: (handler) => connection.onRequest(vscode_languageserver_protocol_1.HoverRequest.type, handler),
|
880 | onCompletion: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionRequest.type, handler),
|
881 | onCompletionResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, handler),
|
882 | onSignatureHelp: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, handler),
|
883 | onDeclaration: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, handler),
|
884 | onDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, handler),
|
885 | onTypeDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, handler),
|
886 | onImplementation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, handler),
|
887 | onReferences: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, handler),
|
888 | onDocumentHighlight: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, handler),
|
889 | onDocumentSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, handler),
|
890 | onWorkspaceSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, handler),
|
891 | onCodeAction: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, handler),
|
892 | onCodeLens: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, handler),
|
893 | onCodeLensResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, handler),
|
894 | onDocumentFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, handler),
|
895 | onDocumentRangeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, handler),
|
896 | onDocumentOnTypeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, handler),
|
897 | onRenameRequest: (handler) => connection.onRequest(vscode_languageserver_protocol_1.RenameRequest.type, handler),
|
898 | onPrepareRename: (handler) => connection.onRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, handler),
|
899 | onDocumentLinks: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, handler),
|
900 | onDocumentLinkResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, handler),
|
901 | onDocumentColor: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, handler),
|
902 | onColorPresentation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, handler),
|
903 | onFoldingRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, handler),
|
904 | onExecuteCommand: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, handler),
|
905 | dispose: () => connection.dispose()
|
906 | };
|
907 | for (let remote of allRemotes) {
|
908 | remote.attach(protocolConnection);
|
909 | }
|
910 | connection.onRequest(vscode_languageserver_protocol_1.InitializeRequest.type, (params) => {
|
911 | const processId = params.processId;
|
912 | if (Is.number(processId) && exitTimer === void 0) {
|
913 |
|
914 |
|
915 | setInterval(() => {
|
916 | try {
|
917 | process.kill(processId, 0);
|
918 | }
|
919 | catch (ex) {
|
920 |
|
921 | process.exit(shutdownReceived ? 0 : 1);
|
922 | }
|
923 | }, 3000);
|
924 | }
|
925 | if (Is.string(params.trace)) {
|
926 | tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.trace);
|
927 | }
|
928 | for (let remote of allRemotes) {
|
929 | remote.initialize(params.capabilities);
|
930 | }
|
931 | if (initializeHandler) {
|
932 | let result = initializeHandler(params, new vscode_languageserver_protocol_1.CancellationTokenSource().token);
|
933 | return asThenable(result).then((value) => {
|
934 | if (value instanceof vscode_languageserver_protocol_1.ResponseError) {
|
935 | return value;
|
936 | }
|
937 | let result = value;
|
938 | if (!result) {
|
939 | result = { capabilities: {} };
|
940 | }
|
941 | let capabilities = result.capabilities;
|
942 | if (!capabilities) {
|
943 | capabilities = {};
|
944 | result.capabilities = capabilities;
|
945 | }
|
946 | if (capabilities.textDocumentSync === void 0 || capabilities.textDocumentSync === null) {
|
947 | capabilities.textDocumentSync = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;
|
948 | }
|
949 | else if (!Is.number(capabilities.textDocumentSync) && !Is.number(capabilities.textDocumentSync.change)) {
|
950 | capabilities.textDocumentSync.change = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;
|
951 | }
|
952 | for (let remote of allRemotes) {
|
953 | remote.fillServerCapabilities(capabilities);
|
954 | }
|
955 | return result;
|
956 | });
|
957 | }
|
958 | else {
|
959 | let result = { capabilities: { textDocumentSync: vscode_languageserver_protocol_1.TextDocumentSyncKind.None } };
|
960 | for (let remote of allRemotes) {
|
961 | remote.fillServerCapabilities(result.capabilities);
|
962 | }
|
963 | return result;
|
964 | }
|
965 | });
|
966 | connection.onRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, () => {
|
967 | shutdownReceived = true;
|
968 | if (shutdownHandler) {
|
969 | return shutdownHandler(new vscode_languageserver_protocol_1.CancellationTokenSource().token);
|
970 | }
|
971 | else {
|
972 | return undefined;
|
973 | }
|
974 | });
|
975 | connection.onNotification(vscode_languageserver_protocol_1.ExitNotification.type, () => {
|
976 | try {
|
977 | if (exitHandler) {
|
978 | exitHandler();
|
979 | }
|
980 | }
|
981 | finally {
|
982 | if (shutdownReceived) {
|
983 | process.exit(0);
|
984 | }
|
985 | else {
|
986 | process.exit(1);
|
987 | }
|
988 | }
|
989 | });
|
990 | connection.onNotification(vscode_languageserver_protocol_1.SetTraceNotification.type, (params) => {
|
991 | tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.value);
|
992 | });
|
993 | return protocolConnection;
|
994 | }
|
995 |
|
996 | var ProposedFeatures;
|
997 | (function (ProposedFeatures) {
|
998 | ProposedFeatures.all = {
|
999 | __brand: 'features',
|
1000 | };
|
1001 | })(ProposedFeatures = exports.ProposedFeatures || (exports.ProposedFeatures = {}));
|
1002 |
|
1003 |
|
1004 | }),
|
1005 |
|
1006 | (function(module, exports, __webpack_require__) {
|
1007 |
|
1008 | "use strict";
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 | function __export(m) {
|
1015 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
1016 | }
|
1017 | Object.defineProperty(exports, "__esModule", { value: true });
|
1018 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
1019 | exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes;
|
1020 | exports.ResponseError = vscode_jsonrpc_1.ResponseError;
|
1021 | exports.CancellationToken = vscode_jsonrpc_1.CancellationToken;
|
1022 | exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource;
|
1023 | exports.Disposable = vscode_jsonrpc_1.Disposable;
|
1024 | exports.Event = vscode_jsonrpc_1.Event;
|
1025 | exports.Emitter = vscode_jsonrpc_1.Emitter;
|
1026 | exports.Trace = vscode_jsonrpc_1.Trace;
|
1027 | exports.TraceFormat = vscode_jsonrpc_1.TraceFormat;
|
1028 | exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification;
|
1029 | exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification;
|
1030 | exports.RequestType = vscode_jsonrpc_1.RequestType;
|
1031 | exports.RequestType0 = vscode_jsonrpc_1.RequestType0;
|
1032 | exports.NotificationType = vscode_jsonrpc_1.NotificationType;
|
1033 | exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0;
|
1034 | exports.MessageReader = vscode_jsonrpc_1.MessageReader;
|
1035 | exports.MessageWriter = vscode_jsonrpc_1.MessageWriter;
|
1036 | exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy;
|
1037 | exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader;
|
1038 | exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter;
|
1039 | exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader;
|
1040 | exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter;
|
1041 | exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport;
|
1042 | exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport;
|
1043 | exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName;
|
1044 | exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport;
|
1045 | exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport;
|
1046 | __export(__webpack_require__(20));
|
1047 | __export(__webpack_require__(21));
|
1048 | function createProtocolConnection(reader, writer, logger, strategy) {
|
1049 | return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy);
|
1050 | }
|
1051 | exports.createProtocolConnection = createProtocolConnection;
|
1052 |
|
1053 |
|
1054 | }),
|
1055 |
|
1056 | (function(module, exports, __webpack_require__) {
|
1057 |
|
1058 | "use strict";
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 | function __export(m) {
|
1066 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
1067 | }
|
1068 | Object.defineProperty(exports, "__esModule", { value: true });
|
1069 | const Is = __webpack_require__(7);
|
1070 | const messages_1 = __webpack_require__(8);
|
1071 | exports.RequestType = messages_1.RequestType;
|
1072 | exports.RequestType0 = messages_1.RequestType0;
|
1073 | exports.RequestType1 = messages_1.RequestType1;
|
1074 | exports.RequestType2 = messages_1.RequestType2;
|
1075 | exports.RequestType3 = messages_1.RequestType3;
|
1076 | exports.RequestType4 = messages_1.RequestType4;
|
1077 | exports.RequestType5 = messages_1.RequestType5;
|
1078 | exports.RequestType6 = messages_1.RequestType6;
|
1079 | exports.RequestType7 = messages_1.RequestType7;
|
1080 | exports.RequestType8 = messages_1.RequestType8;
|
1081 | exports.RequestType9 = messages_1.RequestType9;
|
1082 | exports.ResponseError = messages_1.ResponseError;
|
1083 | exports.ErrorCodes = messages_1.ErrorCodes;
|
1084 | exports.NotificationType = messages_1.NotificationType;
|
1085 | exports.NotificationType0 = messages_1.NotificationType0;
|
1086 | exports.NotificationType1 = messages_1.NotificationType1;
|
1087 | exports.NotificationType2 = messages_1.NotificationType2;
|
1088 | exports.NotificationType3 = messages_1.NotificationType3;
|
1089 | exports.NotificationType4 = messages_1.NotificationType4;
|
1090 | exports.NotificationType5 = messages_1.NotificationType5;
|
1091 | exports.NotificationType6 = messages_1.NotificationType6;
|
1092 | exports.NotificationType7 = messages_1.NotificationType7;
|
1093 | exports.NotificationType8 = messages_1.NotificationType8;
|
1094 | exports.NotificationType9 = messages_1.NotificationType9;
|
1095 | const messageReader_1 = __webpack_require__(9);
|
1096 | exports.MessageReader = messageReader_1.MessageReader;
|
1097 | exports.StreamMessageReader = messageReader_1.StreamMessageReader;
|
1098 | exports.IPCMessageReader = messageReader_1.IPCMessageReader;
|
1099 | exports.SocketMessageReader = messageReader_1.SocketMessageReader;
|
1100 | const messageWriter_1 = __webpack_require__(11);
|
1101 | exports.MessageWriter = messageWriter_1.MessageWriter;
|
1102 | exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter;
|
1103 | exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter;
|
1104 | exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter;
|
1105 | const events_1 = __webpack_require__(10);
|
1106 | exports.Disposable = events_1.Disposable;
|
1107 | exports.Event = events_1.Event;
|
1108 | exports.Emitter = events_1.Emitter;
|
1109 | const cancellation_1 = __webpack_require__(12);
|
1110 | exports.CancellationTokenSource = cancellation_1.CancellationTokenSource;
|
1111 | exports.CancellationToken = cancellation_1.CancellationToken;
|
1112 | const linkedMap_1 = __webpack_require__(13);
|
1113 | __export(__webpack_require__(14));
|
1114 | __export(__webpack_require__(19));
|
1115 | var CancelNotification;
|
1116 | (function (CancelNotification) {
|
1117 | CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');
|
1118 | })(CancelNotification || (CancelNotification = {}));
|
1119 | exports.NullLogger = Object.freeze({
|
1120 | error: () => { },
|
1121 | warn: () => { },
|
1122 | info: () => { },
|
1123 | log: () => { }
|
1124 | });
|
1125 | var Trace;
|
1126 | (function (Trace) {
|
1127 | Trace[Trace["Off"] = 0] = "Off";
|
1128 | Trace[Trace["Messages"] = 1] = "Messages";
|
1129 | Trace[Trace["Verbose"] = 2] = "Verbose";
|
1130 | })(Trace = exports.Trace || (exports.Trace = {}));
|
1131 | (function (Trace) {
|
1132 | function fromString(value) {
|
1133 | value = value.toLowerCase();
|
1134 | switch (value) {
|
1135 | case 'off':
|
1136 | return Trace.Off;
|
1137 | case 'messages':
|
1138 | return Trace.Messages;
|
1139 | case 'verbose':
|
1140 | return Trace.Verbose;
|
1141 | default:
|
1142 | return Trace.Off;
|
1143 | }
|
1144 | }
|
1145 | Trace.fromString = fromString;
|
1146 | function toString(value) {
|
1147 | switch (value) {
|
1148 | case Trace.Off:
|
1149 | return 'off';
|
1150 | case Trace.Messages:
|
1151 | return 'messages';
|
1152 | case Trace.Verbose:
|
1153 | return 'verbose';
|
1154 | default:
|
1155 | return 'off';
|
1156 | }
|
1157 | }
|
1158 | Trace.toString = toString;
|
1159 | })(Trace = exports.Trace || (exports.Trace = {}));
|
1160 | var TraceFormat;
|
1161 | (function (TraceFormat) {
|
1162 | TraceFormat["Text"] = "text";
|
1163 | TraceFormat["JSON"] = "json";
|
1164 | })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));
|
1165 | (function (TraceFormat) {
|
1166 | function fromString(value) {
|
1167 | value = value.toLowerCase();
|
1168 | if (value === 'json') {
|
1169 | return TraceFormat.JSON;
|
1170 | }
|
1171 | else {
|
1172 | return TraceFormat.Text;
|
1173 | }
|
1174 | }
|
1175 | TraceFormat.fromString = fromString;
|
1176 | })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));
|
1177 | var SetTraceNotification;
|
1178 | (function (SetTraceNotification) {
|
1179 | SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification');
|
1180 | })(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {}));
|
1181 | var LogTraceNotification;
|
1182 | (function (LogTraceNotification) {
|
1183 | LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification');
|
1184 | })(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {}));
|
1185 | var ConnectionErrors;
|
1186 | (function (ConnectionErrors) {
|
1187 | |
1188 |
|
1189 |
|
1190 | ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed";
|
1191 | |
1192 |
|
1193 |
|
1194 | ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed";
|
1195 | |
1196 |
|
1197 |
|
1198 | ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening";
|
1199 | })(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {}));
|
1200 | class ConnectionError extends Error {
|
1201 | constructor(code, message) {
|
1202 | super(message);
|
1203 | this.code = code;
|
1204 | Object.setPrototypeOf(this, ConnectionError.prototype);
|
1205 | }
|
1206 | }
|
1207 | exports.ConnectionError = ConnectionError;
|
1208 | var ConnectionStrategy;
|
1209 | (function (ConnectionStrategy) {
|
1210 | function is(value) {
|
1211 | let candidate = value;
|
1212 | return candidate && Is.func(candidate.cancelUndispatched);
|
1213 | }
|
1214 | ConnectionStrategy.is = is;
|
1215 | })(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {}));
|
1216 | var ConnectionState;
|
1217 | (function (ConnectionState) {
|
1218 | ConnectionState[ConnectionState["New"] = 1] = "New";
|
1219 | ConnectionState[ConnectionState["Listening"] = 2] = "Listening";
|
1220 | ConnectionState[ConnectionState["Closed"] = 3] = "Closed";
|
1221 | ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed";
|
1222 | })(ConnectionState || (ConnectionState = {}));
|
1223 | function _createMessageConnection(messageReader, messageWriter, logger, strategy) {
|
1224 | let sequenceNumber = 0;
|
1225 | let notificationSquenceNumber = 0;
|
1226 | let unknownResponseSquenceNumber = 0;
|
1227 | const version = '2.0';
|
1228 | let starRequestHandler = undefined;
|
1229 | let requestHandlers = Object.create(null);
|
1230 | let starNotificationHandler = undefined;
|
1231 | let notificationHandlers = Object.create(null);
|
1232 | let timer;
|
1233 | let messageQueue = new linkedMap_1.LinkedMap();
|
1234 | let responsePromises = Object.create(null);
|
1235 | let requestTokens = Object.create(null);
|
1236 | let trace = Trace.Off;
|
1237 | let traceFormat = TraceFormat.Text;
|
1238 | let tracer;
|
1239 | let state = ConnectionState.New;
|
1240 | let errorEmitter = new events_1.Emitter();
|
1241 | let closeEmitter = new events_1.Emitter();
|
1242 | let unhandledNotificationEmitter = new events_1.Emitter();
|
1243 | let disposeEmitter = new events_1.Emitter();
|
1244 | function createRequestQueueKey(id) {
|
1245 | return 'req-' + id.toString();
|
1246 | }
|
1247 | function createResponseQueueKey(id) {
|
1248 | if (id === null) {
|
1249 | return 'res-unknown-' + (++unknownResponseSquenceNumber).toString();
|
1250 | }
|
1251 | else {
|
1252 | return 'res-' + id.toString();
|
1253 | }
|
1254 | }
|
1255 | function createNotificationQueueKey() {
|
1256 | return 'not-' + (++notificationSquenceNumber).toString();
|
1257 | }
|
1258 | function addMessageToQueue(queue, message) {
|
1259 | if (messages_1.isRequestMessage(message)) {
|
1260 | queue.set(createRequestQueueKey(message.id), message);
|
1261 | }
|
1262 | else if (messages_1.isResponseMessage(message)) {
|
1263 | queue.set(createResponseQueueKey(message.id), message);
|
1264 | }
|
1265 | else {
|
1266 | queue.set(createNotificationQueueKey(), message);
|
1267 | }
|
1268 | }
|
1269 | function cancelUndispatched(_message) {
|
1270 | return undefined;
|
1271 | }
|
1272 | function isListening() {
|
1273 | return state === ConnectionState.Listening;
|
1274 | }
|
1275 | function isClosed() {
|
1276 | return state === ConnectionState.Closed;
|
1277 | }
|
1278 | function isDisposed() {
|
1279 | return state === ConnectionState.Disposed;
|
1280 | }
|
1281 | function closeHandler() {
|
1282 | if (state === ConnectionState.New || state === ConnectionState.Listening) {
|
1283 | state = ConnectionState.Closed;
|
1284 | closeEmitter.fire(undefined);
|
1285 | }
|
1286 |
|
1287 | }
|
1288 | ;
|
1289 | function readErrorHandler(error) {
|
1290 | errorEmitter.fire([error, undefined, undefined]);
|
1291 | }
|
1292 | function writeErrorHandler(data) {
|
1293 | errorEmitter.fire(data);
|
1294 | }
|
1295 | messageReader.onClose(closeHandler);
|
1296 | messageReader.onError(readErrorHandler);
|
1297 | messageWriter.onClose(closeHandler);
|
1298 | messageWriter.onError(writeErrorHandler);
|
1299 | function triggerMessageQueue() {
|
1300 | if (timer || messageQueue.size === 0) {
|
1301 | return;
|
1302 | }
|
1303 | timer = setImmediate(() => {
|
1304 | timer = undefined;
|
1305 | processMessageQueue();
|
1306 | });
|
1307 | }
|
1308 | function processMessageQueue() {
|
1309 | if (messageQueue.size === 0) {
|
1310 | return;
|
1311 | }
|
1312 | let message = messageQueue.shift();
|
1313 | try {
|
1314 | if (messages_1.isRequestMessage(message)) {
|
1315 | handleRequest(message);
|
1316 | }
|
1317 | else if (messages_1.isNotificationMessage(message)) {
|
1318 | handleNotification(message);
|
1319 | }
|
1320 | else if (messages_1.isResponseMessage(message)) {
|
1321 | handleResponse(message);
|
1322 | }
|
1323 | else {
|
1324 | handleInvalidMessage(message);
|
1325 | }
|
1326 | }
|
1327 | finally {
|
1328 | triggerMessageQueue();
|
1329 | }
|
1330 | }
|
1331 | let callback = (message) => {
|
1332 | try {
|
1333 |
|
1334 |
|
1335 | if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {
|
1336 | let key = createRequestQueueKey(message.params.id);
|
1337 | let toCancel = messageQueue.get(key);
|
1338 | if (messages_1.isRequestMessage(toCancel)) {
|
1339 | let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);
|
1340 | if (response && (response.error !== void 0 || response.result !== void 0)) {
|
1341 | messageQueue.delete(key);
|
1342 | response.id = toCancel.id;
|
1343 | traceSendingResponse(response, message.method, Date.now());
|
1344 | messageWriter.write(response);
|
1345 | return;
|
1346 | }
|
1347 | }
|
1348 | }
|
1349 | addMessageToQueue(messageQueue, message);
|
1350 | }
|
1351 | finally {
|
1352 | triggerMessageQueue();
|
1353 | }
|
1354 | };
|
1355 | function handleRequest(requestMessage) {
|
1356 | if (isDisposed()) {
|
1357 |
|
1358 |
|
1359 | return;
|
1360 | }
|
1361 | function reply(resultOrError, method, startTime) {
|
1362 | let message = {
|
1363 | jsonrpc: version,
|
1364 | id: requestMessage.id
|
1365 | };
|
1366 | if (resultOrError instanceof messages_1.ResponseError) {
|
1367 | message.error = resultOrError.toJson();
|
1368 | }
|
1369 | else {
|
1370 | message.result = resultOrError === void 0 ? null : resultOrError;
|
1371 | }
|
1372 | traceSendingResponse(message, method, startTime);
|
1373 | messageWriter.write(message);
|
1374 | }
|
1375 | function replyError(error, method, startTime) {
|
1376 | let message = {
|
1377 | jsonrpc: version,
|
1378 | id: requestMessage.id,
|
1379 | error: error.toJson()
|
1380 | };
|
1381 | traceSendingResponse(message, method, startTime);
|
1382 | messageWriter.write(message);
|
1383 | }
|
1384 | function replySuccess(result, method, startTime) {
|
1385 |
|
1386 |
|
1387 | if (result === void 0) {
|
1388 | result = null;
|
1389 | }
|
1390 | let message = {
|
1391 | jsonrpc: version,
|
1392 | id: requestMessage.id,
|
1393 | result: result
|
1394 | };
|
1395 | traceSendingResponse(message, method, startTime);
|
1396 | messageWriter.write(message);
|
1397 | }
|
1398 | traceReceivedRequest(requestMessage);
|
1399 | let element = requestHandlers[requestMessage.method];
|
1400 | let type;
|
1401 | let requestHandler;
|
1402 | if (element) {
|
1403 | type = element.type;
|
1404 | requestHandler = element.handler;
|
1405 | }
|
1406 | let startTime = Date.now();
|
1407 | if (requestHandler || starRequestHandler) {
|
1408 | let cancellationSource = new cancellation_1.CancellationTokenSource();
|
1409 | let tokenKey = String(requestMessage.id);
|
1410 | requestTokens[tokenKey] = cancellationSource;
|
1411 | try {
|
1412 | let handlerResult;
|
1413 | if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {
|
1414 | handlerResult = requestHandler
|
1415 | ? requestHandler(cancellationSource.token)
|
1416 | : starRequestHandler(requestMessage.method, cancellationSource.token);
|
1417 | }
|
1418 | else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) {
|
1419 | handlerResult = requestHandler
|
1420 | ? requestHandler(...requestMessage.params, cancellationSource.token)
|
1421 | : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token);
|
1422 | }
|
1423 | else {
|
1424 | handlerResult = requestHandler
|
1425 | ? requestHandler(requestMessage.params, cancellationSource.token)
|
1426 | : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);
|
1427 | }
|
1428 | let promise = handlerResult;
|
1429 | if (!handlerResult) {
|
1430 | delete requestTokens[tokenKey];
|
1431 | replySuccess(handlerResult, requestMessage.method, startTime);
|
1432 | }
|
1433 | else if (promise.then) {
|
1434 | promise.then((resultOrError) => {
|
1435 | delete requestTokens[tokenKey];
|
1436 | reply(resultOrError, requestMessage.method, startTime);
|
1437 | }, error => {
|
1438 | delete requestTokens[tokenKey];
|
1439 | if (error instanceof messages_1.ResponseError) {
|
1440 | replyError(error, requestMessage.method, startTime);
|
1441 | }
|
1442 | else if (error && Is.string(error.message)) {
|
1443 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
|
1444 | }
|
1445 | else {
|
1446 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
|
1447 | }
|
1448 | });
|
1449 | }
|
1450 | else {
|
1451 | delete requestTokens[tokenKey];
|
1452 | reply(handlerResult, requestMessage.method, startTime);
|
1453 | }
|
1454 | }
|
1455 | catch (error) {
|
1456 | delete requestTokens[tokenKey];
|
1457 | if (error instanceof messages_1.ResponseError) {
|
1458 | reply(error, requestMessage.method, startTime);
|
1459 | }
|
1460 | else if (error && Is.string(error.message)) {
|
1461 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
|
1462 | }
|
1463 | else {
|
1464 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
|
1465 | }
|
1466 | }
|
1467 | }
|
1468 | else {
|
1469 | replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);
|
1470 | }
|
1471 | }
|
1472 | function handleResponse(responseMessage) {
|
1473 | if (isDisposed()) {
|
1474 |
|
1475 | return;
|
1476 | }
|
1477 | if (responseMessage.id === null) {
|
1478 | if (responseMessage.error) {
|
1479 | logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`);
|
1480 | }
|
1481 | else {
|
1482 | logger.error(`Received response message without id. No further error information provided.`);
|
1483 | }
|
1484 | }
|
1485 | else {
|
1486 | let key = String(responseMessage.id);
|
1487 | let responsePromise = responsePromises[key];
|
1488 | traceReceivedResponse(responseMessage, responsePromise);
|
1489 | if (responsePromise) {
|
1490 | delete responsePromises[key];
|
1491 | try {
|
1492 | if (responseMessage.error) {
|
1493 | let error = responseMessage.error;
|
1494 | responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
|
1495 | }
|
1496 | else if (responseMessage.result !== void 0) {
|
1497 | responsePromise.resolve(responseMessage.result);
|
1498 | }
|
1499 | else {
|
1500 | throw new Error('Should never happen.');
|
1501 | }
|
1502 | }
|
1503 | catch (error) {
|
1504 | if (error.message) {
|
1505 | logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);
|
1506 | }
|
1507 | else {
|
1508 | logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
|
1509 | }
|
1510 | }
|
1511 | }
|
1512 | }
|
1513 | }
|
1514 | function handleNotification(message) {
|
1515 | if (isDisposed()) {
|
1516 |
|
1517 | return;
|
1518 | }
|
1519 | let type = undefined;
|
1520 | let notificationHandler;
|
1521 | if (message.method === CancelNotification.type.method) {
|
1522 | notificationHandler = (params) => {
|
1523 | let id = params.id;
|
1524 | let source = requestTokens[String(id)];
|
1525 | if (source) {
|
1526 | source.cancel();
|
1527 | }
|
1528 | };
|
1529 | }
|
1530 | else {
|
1531 | let element = notificationHandlers[message.method];
|
1532 | if (element) {
|
1533 | notificationHandler = element.handler;
|
1534 | type = element.type;
|
1535 | }
|
1536 | }
|
1537 | if (notificationHandler || starNotificationHandler) {
|
1538 | try {
|
1539 | traceReceivedNotification(message);
|
1540 | if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {
|
1541 | notificationHandler ? notificationHandler() : starNotificationHandler(message.method);
|
1542 | }
|
1543 | else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) {
|
1544 | notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params);
|
1545 | }
|
1546 | else {
|
1547 | notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params);
|
1548 | }
|
1549 | }
|
1550 | catch (error) {
|
1551 | if (error.message) {
|
1552 | logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);
|
1553 | }
|
1554 | else {
|
1555 | logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
|
1556 | }
|
1557 | }
|
1558 | }
|
1559 | else {
|
1560 | unhandledNotificationEmitter.fire(message);
|
1561 | }
|
1562 | }
|
1563 | function handleInvalidMessage(message) {
|
1564 | if (!message) {
|
1565 | logger.error('Received empty message.');
|
1566 | return;
|
1567 | }
|
1568 | logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`);
|
1569 |
|
1570 | let responseMessage = message;
|
1571 | if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {
|
1572 | let key = String(responseMessage.id);
|
1573 | let responseHandler = responsePromises[key];
|
1574 | if (responseHandler) {
|
1575 | responseHandler.reject(new Error('The received response has neither a result nor an error property.'));
|
1576 | }
|
1577 | }
|
1578 | }
|
1579 | function traceSendingRequest(message) {
|
1580 | if (trace === Trace.Off || !tracer) {
|
1581 | return;
|
1582 | }
|
1583 | if (traceFormat === TraceFormat.Text) {
|
1584 | let data = undefined;
|
1585 | if (trace === Trace.Verbose && message.params) {
|
1586 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1587 | }
|
1588 | tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);
|
1589 | }
|
1590 | else {
|
1591 | logLSPMessage('send-request', message);
|
1592 | }
|
1593 | }
|
1594 | function traceSendingNotification(message) {
|
1595 | if (trace === Trace.Off || !tracer) {
|
1596 | return;
|
1597 | }
|
1598 | if (traceFormat === TraceFormat.Text) {
|
1599 | let data = undefined;
|
1600 | if (trace === Trace.Verbose) {
|
1601 | if (message.params) {
|
1602 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1603 | }
|
1604 | else {
|
1605 | data = 'No parameters provided.\n\n';
|
1606 | }
|
1607 | }
|
1608 | tracer.log(`Sending notification '${message.method}'.`, data);
|
1609 | }
|
1610 | else {
|
1611 | logLSPMessage('send-notification', message);
|
1612 | }
|
1613 | }
|
1614 | function traceSendingResponse(message, method, startTime) {
|
1615 | if (trace === Trace.Off || !tracer) {
|
1616 | return;
|
1617 | }
|
1618 | if (traceFormat === TraceFormat.Text) {
|
1619 | let data = undefined;
|
1620 | if (trace === Trace.Verbose) {
|
1621 | if (message.error && message.error.data) {
|
1622 | data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;
|
1623 | }
|
1624 | else {
|
1625 | if (message.result) {
|
1626 | data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;
|
1627 | }
|
1628 | else if (message.error === void 0) {
|
1629 | data = 'No result returned.\n\n';
|
1630 | }
|
1631 | }
|
1632 | }
|
1633 | tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);
|
1634 | }
|
1635 | else {
|
1636 | logLSPMessage('send-response', message);
|
1637 | }
|
1638 | }
|
1639 | function traceReceivedRequest(message) {
|
1640 | if (trace === Trace.Off || !tracer) {
|
1641 | return;
|
1642 | }
|
1643 | if (traceFormat === TraceFormat.Text) {
|
1644 | let data = undefined;
|
1645 | if (trace === Trace.Verbose && message.params) {
|
1646 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1647 | }
|
1648 | tracer.log(`Received request '${message.method} - (${message.id})'.`, data);
|
1649 | }
|
1650 | else {
|
1651 | logLSPMessage('receive-request', message);
|
1652 | }
|
1653 | }
|
1654 | function traceReceivedNotification(message) {
|
1655 | if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {
|
1656 | return;
|
1657 | }
|
1658 | if (traceFormat === TraceFormat.Text) {
|
1659 | let data = undefined;
|
1660 | if (trace === Trace.Verbose) {
|
1661 | if (message.params) {
|
1662 | data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
|
1663 | }
|
1664 | else {
|
1665 | data = 'No parameters provided.\n\n';
|
1666 | }
|
1667 | }
|
1668 | tracer.log(`Received notification '${message.method}'.`, data);
|
1669 | }
|
1670 | else {
|
1671 | logLSPMessage('receive-notification', message);
|
1672 | }
|
1673 | }
|
1674 | function traceReceivedResponse(message, responsePromise) {
|
1675 | if (trace === Trace.Off || !tracer) {
|
1676 | return;
|
1677 | }
|
1678 | if (traceFormat === TraceFormat.Text) {
|
1679 | let data = undefined;
|
1680 | if (trace === Trace.Verbose) {
|
1681 | if (message.error && message.error.data) {
|
1682 | data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;
|
1683 | }
|
1684 | else {
|
1685 | if (message.result) {
|
1686 | data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;
|
1687 | }
|
1688 | else if (message.error === void 0) {
|
1689 | data = 'No result returned.\n\n';
|
1690 | }
|
1691 | }
|
1692 | }
|
1693 | if (responsePromise) {
|
1694 | let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';
|
1695 | tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);
|
1696 | }
|
1697 | else {
|
1698 | tracer.log(`Received response ${message.id} without active response promise.`, data);
|
1699 | }
|
1700 | }
|
1701 | else {
|
1702 | logLSPMessage('receive-response', message);
|
1703 | }
|
1704 | }
|
1705 | function logLSPMessage(type, message) {
|
1706 | if (!tracer || trace === Trace.Off) {
|
1707 | return;
|
1708 | }
|
1709 | const lspMessage = {
|
1710 | isLSPMessage: true,
|
1711 | type,
|
1712 | message,
|
1713 | timestamp: Date.now()
|
1714 | };
|
1715 | tracer.log(lspMessage);
|
1716 | }
|
1717 | function throwIfClosedOrDisposed() {
|
1718 | if (isClosed()) {
|
1719 | throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');
|
1720 | }
|
1721 | if (isDisposed()) {
|
1722 | throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');
|
1723 | }
|
1724 | }
|
1725 | function throwIfListening() {
|
1726 | if (isListening()) {
|
1727 | throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');
|
1728 | }
|
1729 | }
|
1730 | function throwIfNotListening() {
|
1731 | if (!isListening()) {
|
1732 | throw new Error('Call listen() first.');
|
1733 | }
|
1734 | }
|
1735 | function undefinedToNull(param) {
|
1736 | if (param === void 0) {
|
1737 | return null;
|
1738 | }
|
1739 | else {
|
1740 | return param;
|
1741 | }
|
1742 | }
|
1743 | function computeMessageParams(type, params) {
|
1744 | let result;
|
1745 | let numberOfParams = type.numberOfParams;
|
1746 | switch (numberOfParams) {
|
1747 | case 0:
|
1748 | result = null;
|
1749 | break;
|
1750 | case 1:
|
1751 | result = undefinedToNull(params[0]);
|
1752 | break;
|
1753 | default:
|
1754 | result = [];
|
1755 | for (let i = 0; i < params.length && i < numberOfParams; i++) {
|
1756 | result.push(undefinedToNull(params[i]));
|
1757 | }
|
1758 | if (params.length < numberOfParams) {
|
1759 | for (let i = params.length; i < numberOfParams; i++) {
|
1760 | result.push(null);
|
1761 | }
|
1762 | }
|
1763 | break;
|
1764 | }
|
1765 | return result;
|
1766 | }
|
1767 | let connection = {
|
1768 | sendNotification: (type, ...params) => {
|
1769 | throwIfClosedOrDisposed();
|
1770 | let method;
|
1771 | let messageParams;
|
1772 | if (Is.string(type)) {
|
1773 | method = type;
|
1774 | switch (params.length) {
|
1775 | case 0:
|
1776 | messageParams = null;
|
1777 | break;
|
1778 | case 1:
|
1779 | messageParams = params[0];
|
1780 | break;
|
1781 | default:
|
1782 | messageParams = params;
|
1783 | break;
|
1784 | }
|
1785 | }
|
1786 | else {
|
1787 | method = type.method;
|
1788 | messageParams = computeMessageParams(type, params);
|
1789 | }
|
1790 | let notificationMessage = {
|
1791 | jsonrpc: version,
|
1792 | method: method,
|
1793 | params: messageParams
|
1794 | };
|
1795 | traceSendingNotification(notificationMessage);
|
1796 | messageWriter.write(notificationMessage);
|
1797 | },
|
1798 | onNotification: (type, handler) => {
|
1799 | throwIfClosedOrDisposed();
|
1800 | if (Is.func(type)) {
|
1801 | starNotificationHandler = type;
|
1802 | }
|
1803 | else if (handler) {
|
1804 | if (Is.string(type)) {
|
1805 | notificationHandlers[type] = { type: undefined, handler };
|
1806 | }
|
1807 | else {
|
1808 | notificationHandlers[type.method] = { type, handler };
|
1809 | }
|
1810 | }
|
1811 | },
|
1812 | sendRequest: (type, ...params) => {
|
1813 | throwIfClosedOrDisposed();
|
1814 | throwIfNotListening();
|
1815 | let method;
|
1816 | let messageParams;
|
1817 | let token = undefined;
|
1818 | if (Is.string(type)) {
|
1819 | method = type;
|
1820 | switch (params.length) {
|
1821 | case 0:
|
1822 | messageParams = null;
|
1823 | break;
|
1824 | case 1:
|
1825 |
|
1826 | if (cancellation_1.CancellationToken.is(params[0])) {
|
1827 | messageParams = null;
|
1828 | token = params[0];
|
1829 | }
|
1830 | else {
|
1831 | messageParams = undefinedToNull(params[0]);
|
1832 | }
|
1833 | break;
|
1834 | default:
|
1835 | const last = params.length - 1;
|
1836 | if (cancellation_1.CancellationToken.is(params[last])) {
|
1837 | token = params[last];
|
1838 | if (params.length === 2) {
|
1839 | messageParams = undefinedToNull(params[0]);
|
1840 | }
|
1841 | else {
|
1842 | messageParams = params.slice(0, last).map(value => undefinedToNull(value));
|
1843 | }
|
1844 | }
|
1845 | else {
|
1846 | messageParams = params.map(value => undefinedToNull(value));
|
1847 | }
|
1848 | break;
|
1849 | }
|
1850 | }
|
1851 | else {
|
1852 | method = type.method;
|
1853 | messageParams = computeMessageParams(type, params);
|
1854 | let numberOfParams = type.numberOfParams;
|
1855 | token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;
|
1856 | }
|
1857 | let id = sequenceNumber++;
|
1858 | let result = new Promise((resolve, reject) => {
|
1859 | let requestMessage = {
|
1860 | jsonrpc: version,
|
1861 | id: id,
|
1862 | method: method,
|
1863 | params: messageParams
|
1864 | };
|
1865 | let responsePromise = { method: method, timerStart: Date.now(), resolve, reject };
|
1866 | traceSendingRequest(requestMessage);
|
1867 | try {
|
1868 | messageWriter.write(requestMessage);
|
1869 | }
|
1870 | catch (e) {
|
1871 |
|
1872 | responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason'));
|
1873 | responsePromise = null;
|
1874 | }
|
1875 | if (responsePromise) {
|
1876 | responsePromises[String(id)] = responsePromise;
|
1877 | }
|
1878 | });
|
1879 | if (token) {
|
1880 | token.onCancellationRequested(() => {
|
1881 | connection.sendNotification(CancelNotification.type, { id });
|
1882 | });
|
1883 | }
|
1884 | return result;
|
1885 | },
|
1886 | onRequest: (type, handler) => {
|
1887 | throwIfClosedOrDisposed();
|
1888 | if (Is.func(type)) {
|
1889 | starRequestHandler = type;
|
1890 | }
|
1891 | else if (handler) {
|
1892 | if (Is.string(type)) {
|
1893 | requestHandlers[type] = { type: undefined, handler };
|
1894 | }
|
1895 | else {
|
1896 | requestHandlers[type.method] = { type, handler };
|
1897 | }
|
1898 | }
|
1899 | },
|
1900 | trace: (_value, _tracer, sendNotificationOrTraceOptions) => {
|
1901 | let _sendNotification = false;
|
1902 | let _traceFormat = TraceFormat.Text;
|
1903 | if (sendNotificationOrTraceOptions !== void 0) {
|
1904 | if (Is.boolean(sendNotificationOrTraceOptions)) {
|
1905 | _sendNotification = sendNotificationOrTraceOptions;
|
1906 | }
|
1907 | else {
|
1908 | _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;
|
1909 | _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;
|
1910 | }
|
1911 | }
|
1912 | trace = _value;
|
1913 | traceFormat = _traceFormat;
|
1914 | if (trace === Trace.Off) {
|
1915 | tracer = undefined;
|
1916 | }
|
1917 | else {
|
1918 | tracer = _tracer;
|
1919 | }
|
1920 | if (_sendNotification && !isClosed() && !isDisposed()) {
|
1921 | connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });
|
1922 | }
|
1923 | },
|
1924 | onError: errorEmitter.event,
|
1925 | onClose: closeEmitter.event,
|
1926 | onUnhandledNotification: unhandledNotificationEmitter.event,
|
1927 | onDispose: disposeEmitter.event,
|
1928 | dispose: () => {
|
1929 | if (isDisposed()) {
|
1930 | return;
|
1931 | }
|
1932 | state = ConnectionState.Disposed;
|
1933 | disposeEmitter.fire(undefined);
|
1934 | let error = new Error('Connection got disposed.');
|
1935 | Object.keys(responsePromises).forEach((key) => {
|
1936 | responsePromises[key].reject(error);
|
1937 | });
|
1938 | responsePromises = Object.create(null);
|
1939 | requestTokens = Object.create(null);
|
1940 | messageQueue = new linkedMap_1.LinkedMap();
|
1941 |
|
1942 | if (Is.func(messageWriter.dispose)) {
|
1943 | messageWriter.dispose();
|
1944 | }
|
1945 | if (Is.func(messageReader.dispose)) {
|
1946 | messageReader.dispose();
|
1947 | }
|
1948 | },
|
1949 | listen: () => {
|
1950 | throwIfClosedOrDisposed();
|
1951 | throwIfListening();
|
1952 | state = ConnectionState.Listening;
|
1953 | messageReader.listen(callback);
|
1954 | },
|
1955 | inspect: () => {
|
1956 | console.log("inspect");
|
1957 | }
|
1958 | };
|
1959 | connection.onNotification(LogTraceNotification.type, (params) => {
|
1960 | if (trace === Trace.Off || !tracer) {
|
1961 | return;
|
1962 | }
|
1963 | tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined);
|
1964 | });
|
1965 | return connection;
|
1966 | }
|
1967 | function isMessageReader(value) {
|
1968 | return value.listen !== void 0 && value.read === void 0;
|
1969 | }
|
1970 | function isMessageWriter(value) {
|
1971 | return value.write !== void 0 && value.end === void 0;
|
1972 | }
|
1973 | function createMessageConnection(input, output, logger, strategy) {
|
1974 | if (!logger) {
|
1975 | logger = exports.NullLogger;
|
1976 | }
|
1977 | let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input);
|
1978 | let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output);
|
1979 | return _createMessageConnection(reader, writer, logger, strategy);
|
1980 | }
|
1981 | exports.createMessageConnection = createMessageConnection;
|
1982 |
|
1983 |
|
1984 | }),
|
1985 |
|
1986 | (function(module, exports, __webpack_require__) {
|
1987 |
|
1988 | "use strict";
|
1989 |
|
1990 |
|
1991 |
|
1992 |
|
1993 |
|
1994 | Object.defineProperty(exports, "__esModule", { value: true });
|
1995 | function boolean(value) {
|
1996 | return value === true || value === false;
|
1997 | }
|
1998 | exports.boolean = boolean;
|
1999 | function string(value) {
|
2000 | return typeof value === 'string' || value instanceof String;
|
2001 | }
|
2002 | exports.string = string;
|
2003 | function number(value) {
|
2004 | return typeof value === 'number' || value instanceof Number;
|
2005 | }
|
2006 | exports.number = number;
|
2007 | function error(value) {
|
2008 | return value instanceof Error;
|
2009 | }
|
2010 | exports.error = error;
|
2011 | function func(value) {
|
2012 | return typeof value === 'function';
|
2013 | }
|
2014 | exports.func = func;
|
2015 | function array(value) {
|
2016 | return Array.isArray(value);
|
2017 | }
|
2018 | exports.array = array;
|
2019 | function stringArray(value) {
|
2020 | return array(value) && value.every(elem => string(elem));
|
2021 | }
|
2022 | exports.stringArray = stringArray;
|
2023 |
|
2024 |
|
2025 | }),
|
2026 |
|
2027 | (function(module, exports, __webpack_require__) {
|
2028 |
|
2029 | "use strict";
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 | Object.defineProperty(exports, "__esModule", { value: true });
|
2036 | const is = __webpack_require__(7);
|
2037 |
|
2038 |
|
2039 |
|
2040 | var ErrorCodes;
|
2041 | (function (ErrorCodes) {
|
2042 |
|
2043 | ErrorCodes.ParseError = -32700;
|
2044 | ErrorCodes.InvalidRequest = -32600;
|
2045 | ErrorCodes.MethodNotFound = -32601;
|
2046 | ErrorCodes.InvalidParams = -32602;
|
2047 | ErrorCodes.InternalError = -32603;
|
2048 | ErrorCodes.serverErrorStart = -32099;
|
2049 | ErrorCodes.serverErrorEnd = -32000;
|
2050 | ErrorCodes.ServerNotInitialized = -32002;
|
2051 | ErrorCodes.UnknownErrorCode = -32001;
|
2052 |
|
2053 | ErrorCodes.RequestCancelled = -32800;
|
2054 |
|
2055 | ErrorCodes.MessageWriteError = 1;
|
2056 | ErrorCodes.MessageReadError = 2;
|
2057 | })(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 | class ResponseError extends Error {
|
2063 | constructor(code, message, data) {
|
2064 | super(message);
|
2065 | this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
|
2066 | this.data = data;
|
2067 | Object.setPrototypeOf(this, ResponseError.prototype);
|
2068 | }
|
2069 | toJson() {
|
2070 | return {
|
2071 | code: this.code,
|
2072 | message: this.message,
|
2073 | data: this.data,
|
2074 | };
|
2075 | }
|
2076 | }
|
2077 | exports.ResponseError = ResponseError;
|
2078 |
|
2079 |
|
2080 |
|
2081 | class AbstractMessageType {
|
2082 | constructor(_method, _numberOfParams) {
|
2083 | this._method = _method;
|
2084 | this._numberOfParams = _numberOfParams;
|
2085 | }
|
2086 | get method() {
|
2087 | return this._method;
|
2088 | }
|
2089 | get numberOfParams() {
|
2090 | return this._numberOfParams;
|
2091 | }
|
2092 | }
|
2093 | exports.AbstractMessageType = AbstractMessageType;
|
2094 |
|
2095 |
|
2096 |
|
2097 | class RequestType0 extends AbstractMessageType {
|
2098 | constructor(method) {
|
2099 | super(method, 0);
|
2100 | this._ = undefined;
|
2101 | }
|
2102 | }
|
2103 | exports.RequestType0 = RequestType0;
|
2104 | class RequestType extends AbstractMessageType {
|
2105 | constructor(method) {
|
2106 | super(method, 1);
|
2107 | this._ = undefined;
|
2108 | }
|
2109 | }
|
2110 | exports.RequestType = RequestType;
|
2111 | class RequestType1 extends AbstractMessageType {
|
2112 | constructor(method) {
|
2113 | super(method, 1);
|
2114 | this._ = undefined;
|
2115 | }
|
2116 | }
|
2117 | exports.RequestType1 = RequestType1;
|
2118 | class RequestType2 extends AbstractMessageType {
|
2119 | constructor(method) {
|
2120 | super(method, 2);
|
2121 | this._ = undefined;
|
2122 | }
|
2123 | }
|
2124 | exports.RequestType2 = RequestType2;
|
2125 | class RequestType3 extends AbstractMessageType {
|
2126 | constructor(method) {
|
2127 | super(method, 3);
|
2128 | this._ = undefined;
|
2129 | }
|
2130 | }
|
2131 | exports.RequestType3 = RequestType3;
|
2132 | class RequestType4 extends AbstractMessageType {
|
2133 | constructor(method) {
|
2134 | super(method, 4);
|
2135 | this._ = undefined;
|
2136 | }
|
2137 | }
|
2138 | exports.RequestType4 = RequestType4;
|
2139 | class RequestType5 extends AbstractMessageType {
|
2140 | constructor(method) {
|
2141 | super(method, 5);
|
2142 | this._ = undefined;
|
2143 | }
|
2144 | }
|
2145 | exports.RequestType5 = RequestType5;
|
2146 | class RequestType6 extends AbstractMessageType {
|
2147 | constructor(method) {
|
2148 | super(method, 6);
|
2149 | this._ = undefined;
|
2150 | }
|
2151 | }
|
2152 | exports.RequestType6 = RequestType6;
|
2153 | class RequestType7 extends AbstractMessageType {
|
2154 | constructor(method) {
|
2155 | super(method, 7);
|
2156 | this._ = undefined;
|
2157 | }
|
2158 | }
|
2159 | exports.RequestType7 = RequestType7;
|
2160 | class RequestType8 extends AbstractMessageType {
|
2161 | constructor(method) {
|
2162 | super(method, 8);
|
2163 | this._ = undefined;
|
2164 | }
|
2165 | }
|
2166 | exports.RequestType8 = RequestType8;
|
2167 | class RequestType9 extends AbstractMessageType {
|
2168 | constructor(method) {
|
2169 | super(method, 9);
|
2170 | this._ = undefined;
|
2171 | }
|
2172 | }
|
2173 | exports.RequestType9 = RequestType9;
|
2174 | class NotificationType extends AbstractMessageType {
|
2175 | constructor(method) {
|
2176 | super(method, 1);
|
2177 | this._ = undefined;
|
2178 | }
|
2179 | }
|
2180 | exports.NotificationType = NotificationType;
|
2181 | class NotificationType0 extends AbstractMessageType {
|
2182 | constructor(method) {
|
2183 | super(method, 0);
|
2184 | this._ = undefined;
|
2185 | }
|
2186 | }
|
2187 | exports.NotificationType0 = NotificationType0;
|
2188 | class NotificationType1 extends AbstractMessageType {
|
2189 | constructor(method) {
|
2190 | super(method, 1);
|
2191 | this._ = undefined;
|
2192 | }
|
2193 | }
|
2194 | exports.NotificationType1 = NotificationType1;
|
2195 | class NotificationType2 extends AbstractMessageType {
|
2196 | constructor(method) {
|
2197 | super(method, 2);
|
2198 | this._ = undefined;
|
2199 | }
|
2200 | }
|
2201 | exports.NotificationType2 = NotificationType2;
|
2202 | class NotificationType3 extends AbstractMessageType {
|
2203 | constructor(method) {
|
2204 | super(method, 3);
|
2205 | this._ = undefined;
|
2206 | }
|
2207 | }
|
2208 | exports.NotificationType3 = NotificationType3;
|
2209 | class NotificationType4 extends AbstractMessageType {
|
2210 | constructor(method) {
|
2211 | super(method, 4);
|
2212 | this._ = undefined;
|
2213 | }
|
2214 | }
|
2215 | exports.NotificationType4 = NotificationType4;
|
2216 | class NotificationType5 extends AbstractMessageType {
|
2217 | constructor(method) {
|
2218 | super(method, 5);
|
2219 | this._ = undefined;
|
2220 | }
|
2221 | }
|
2222 | exports.NotificationType5 = NotificationType5;
|
2223 | class NotificationType6 extends AbstractMessageType {
|
2224 | constructor(method) {
|
2225 | super(method, 6);
|
2226 | this._ = undefined;
|
2227 | }
|
2228 | }
|
2229 | exports.NotificationType6 = NotificationType6;
|
2230 | class NotificationType7 extends AbstractMessageType {
|
2231 | constructor(method) {
|
2232 | super(method, 7);
|
2233 | this._ = undefined;
|
2234 | }
|
2235 | }
|
2236 | exports.NotificationType7 = NotificationType7;
|
2237 | class NotificationType8 extends AbstractMessageType {
|
2238 | constructor(method) {
|
2239 | super(method, 8);
|
2240 | this._ = undefined;
|
2241 | }
|
2242 | }
|
2243 | exports.NotificationType8 = NotificationType8;
|
2244 | class NotificationType9 extends AbstractMessageType {
|
2245 | constructor(method) {
|
2246 | super(method, 9);
|
2247 | this._ = undefined;
|
2248 | }
|
2249 | }
|
2250 | exports.NotificationType9 = NotificationType9;
|
2251 |
|
2252 |
|
2253 |
|
2254 | function isRequestMessage(message) {
|
2255 | let candidate = message;
|
2256 | return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
|
2257 | }
|
2258 | exports.isRequestMessage = isRequestMessage;
|
2259 |
|
2260 |
|
2261 |
|
2262 | function isNotificationMessage(message) {
|
2263 | let candidate = message;
|
2264 | return candidate && is.string(candidate.method) && message.id === void 0;
|
2265 | }
|
2266 | exports.isNotificationMessage = isNotificationMessage;
|
2267 |
|
2268 |
|
2269 |
|
2270 | function isResponseMessage(message) {
|
2271 | let candidate = message;
|
2272 | return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
|
2273 | }
|
2274 | exports.isResponseMessage = isResponseMessage;
|
2275 |
|
2276 |
|
2277 | }),
|
2278 |
|
2279 | (function(module, exports, __webpack_require__) {
|
2280 |
|
2281 | "use strict";
|
2282 |
|
2283 |
|
2284 |
|
2285 |
|
2286 |
|
2287 | Object.defineProperty(exports, "__esModule", { value: true });
|
2288 | const events_1 = __webpack_require__(10);
|
2289 | const Is = __webpack_require__(7);
|
2290 | let DefaultSize = 8192;
|
2291 | let CR = Buffer.from('\r', 'ascii')[0];
|
2292 | let LF = Buffer.from('\n', 'ascii')[0];
|
2293 | let CRLF = '\r\n';
|
2294 | class MessageBuffer {
|
2295 | constructor(encoding = 'utf8') {
|
2296 | this.encoding = encoding;
|
2297 | this.index = 0;
|
2298 | this.buffer = Buffer.allocUnsafe(DefaultSize);
|
2299 | }
|
2300 | append(chunk) {
|
2301 | var toAppend = chunk;
|
2302 | if (typeof (chunk) === 'string') {
|
2303 | var str = chunk;
|
2304 | var bufferLen = Buffer.byteLength(str, this.encoding);
|
2305 | toAppend = Buffer.allocUnsafe(bufferLen);
|
2306 | toAppend.write(str, 0, bufferLen, this.encoding);
|
2307 | }
|
2308 | if (this.buffer.length - this.index >= toAppend.length) {
|
2309 | toAppend.copy(this.buffer, this.index, 0, toAppend.length);
|
2310 | }
|
2311 | else {
|
2312 | var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize;
|
2313 | if (this.index === 0) {
|
2314 | this.buffer = Buffer.allocUnsafe(newSize);
|
2315 | toAppend.copy(this.buffer, 0, 0, toAppend.length);
|
2316 | }
|
2317 | else {
|
2318 | this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize);
|
2319 | }
|
2320 | }
|
2321 | this.index += toAppend.length;
|
2322 | }
|
2323 | tryReadHeaders() {
|
2324 | let result = undefined;
|
2325 | let current = 0;
|
2326 | while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) {
|
2327 | current++;
|
2328 | }
|
2329 |
|
2330 | if (current + 3 >= this.index) {
|
2331 | return result;
|
2332 | }
|
2333 | result = Object.create(null);
|
2334 | let headers = this.buffer.toString('ascii', 0, current).split(CRLF);
|
2335 | headers.forEach((header) => {
|
2336 | let index = header.indexOf(':');
|
2337 | if (index === -1) {
|
2338 | throw new Error('Message header must separate key and value using :');
|
2339 | }
|
2340 | let key = header.substr(0, index);
|
2341 | let value = header.substr(index + 1).trim();
|
2342 | result[key] = value;
|
2343 | });
|
2344 | let nextStart = current + 4;
|
2345 | this.buffer = this.buffer.slice(nextStart);
|
2346 | this.index = this.index - nextStart;
|
2347 | return result;
|
2348 | }
|
2349 | tryReadContent(length) {
|
2350 | if (this.index < length) {
|
2351 | return null;
|
2352 | }
|
2353 | let result = this.buffer.toString(this.encoding, 0, length);
|
2354 | let nextStart = length;
|
2355 | this.buffer.copy(this.buffer, 0, nextStart);
|
2356 | this.index = this.index - nextStart;
|
2357 | return result;
|
2358 | }
|
2359 | get numberOfBytes() {
|
2360 | return this.index;
|
2361 | }
|
2362 | }
|
2363 | var MessageReader;
|
2364 | (function (MessageReader) {
|
2365 | function is(value) {
|
2366 | let candidate = value;
|
2367 | return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&
|
2368 | Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
|
2369 | }
|
2370 | MessageReader.is = is;
|
2371 | })(MessageReader = exports.MessageReader || (exports.MessageReader = {}));
|
2372 | class AbstractMessageReader {
|
2373 | constructor() {
|
2374 | this.errorEmitter = new events_1.Emitter();
|
2375 | this.closeEmitter = new events_1.Emitter();
|
2376 | this.partialMessageEmitter = new events_1.Emitter();
|
2377 | }
|
2378 | dispose() {
|
2379 | this.errorEmitter.dispose();
|
2380 | this.closeEmitter.dispose();
|
2381 | }
|
2382 | get onError() {
|
2383 | return this.errorEmitter.event;
|
2384 | }
|
2385 | fireError(error) {
|
2386 | this.errorEmitter.fire(this.asError(error));
|
2387 | }
|
2388 | get onClose() {
|
2389 | return this.closeEmitter.event;
|
2390 | }
|
2391 | fireClose() {
|
2392 | this.closeEmitter.fire(undefined);
|
2393 | }
|
2394 | get onPartialMessage() {
|
2395 | return this.partialMessageEmitter.event;
|
2396 | }
|
2397 | firePartialMessage(info) {
|
2398 | this.partialMessageEmitter.fire(info);
|
2399 | }
|
2400 | asError(error) {
|
2401 | if (error instanceof Error) {
|
2402 | return error;
|
2403 | }
|
2404 | else {
|
2405 | return new Error(`Reader recevied error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
|
2406 | }
|
2407 | }
|
2408 | }
|
2409 | exports.AbstractMessageReader = AbstractMessageReader;
|
2410 | class StreamMessageReader extends AbstractMessageReader {
|
2411 | constructor(readable, encoding = 'utf8') {
|
2412 | super();
|
2413 | this.readable = readable;
|
2414 | this.buffer = new MessageBuffer(encoding);
|
2415 | this._partialMessageTimeout = 10000;
|
2416 | }
|
2417 | set partialMessageTimeout(timeout) {
|
2418 | this._partialMessageTimeout = timeout;
|
2419 | }
|
2420 | get partialMessageTimeout() {
|
2421 | return this._partialMessageTimeout;
|
2422 | }
|
2423 | listen(callback) {
|
2424 | this.nextMessageLength = -1;
|
2425 | this.messageToken = 0;
|
2426 | this.partialMessageTimer = undefined;
|
2427 | this.callback = callback;
|
2428 | this.readable.on('data', (data) => {
|
2429 | this.onData(data);
|
2430 | });
|
2431 | this.readable.on('error', (error) => this.fireError(error));
|
2432 | this.readable.on('close', () => this.fireClose());
|
2433 | }
|
2434 | onData(data) {
|
2435 | this.buffer.append(data);
|
2436 | while (true) {
|
2437 | if (this.nextMessageLength === -1) {
|
2438 | let headers = this.buffer.tryReadHeaders();
|
2439 | if (!headers) {
|
2440 | return;
|
2441 | }
|
2442 | let contentLength = headers['Content-Length'];
|
2443 | if (!contentLength) {
|
2444 | throw new Error('Header must provide a Content-Length property.');
|
2445 | }
|
2446 | let length = parseInt(contentLength);
|
2447 | if (isNaN(length)) {
|
2448 | throw new Error('Content-Length value must be a number.');
|
2449 | }
|
2450 | this.nextMessageLength = length;
|
2451 |
|
2452 |
|
2453 | }
|
2454 | var msg = this.buffer.tryReadContent(this.nextMessageLength);
|
2455 | if (msg === null) {
|
2456 |
|
2457 | this.setPartialMessageTimer();
|
2458 | return;
|
2459 | }
|
2460 | this.clearPartialMessageTimer();
|
2461 | this.nextMessageLength = -1;
|
2462 | this.messageToken++;
|
2463 | var json = JSON.parse(msg);
|
2464 | this.callback(json);
|
2465 | }
|
2466 | }
|
2467 | clearPartialMessageTimer() {
|
2468 | if (this.partialMessageTimer) {
|
2469 | clearTimeout(this.partialMessageTimer);
|
2470 | this.partialMessageTimer = undefined;
|
2471 | }
|
2472 | }
|
2473 | setPartialMessageTimer() {
|
2474 | this.clearPartialMessageTimer();
|
2475 | if (this._partialMessageTimeout <= 0) {
|
2476 | return;
|
2477 | }
|
2478 | this.partialMessageTimer = setTimeout((token, timeout) => {
|
2479 | this.partialMessageTimer = undefined;
|
2480 | if (token === this.messageToken) {
|
2481 | this.firePartialMessage({ messageToken: token, waitingTime: timeout });
|
2482 | this.setPartialMessageTimer();
|
2483 | }
|
2484 | }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
|
2485 | }
|
2486 | }
|
2487 | exports.StreamMessageReader = StreamMessageReader;
|
2488 | class IPCMessageReader extends AbstractMessageReader {
|
2489 | constructor(process) {
|
2490 | super();
|
2491 | this.process = process;
|
2492 | let eventEmitter = this.process;
|
2493 | eventEmitter.on('error', (error) => this.fireError(error));
|
2494 | eventEmitter.on('close', () => this.fireClose());
|
2495 | }
|
2496 | listen(callback) {
|
2497 | this.process.on('message', callback);
|
2498 | }
|
2499 | }
|
2500 | exports.IPCMessageReader = IPCMessageReader;
|
2501 | class SocketMessageReader extends StreamMessageReader {
|
2502 | constructor(socket, encoding = 'utf-8') {
|
2503 | super(socket, encoding);
|
2504 | }
|
2505 | }
|
2506 | exports.SocketMessageReader = SocketMessageReader;
|
2507 |
|
2508 |
|
2509 | }),
|
2510 |
|
2511 | (function(module, exports, __webpack_require__) {
|
2512 |
|
2513 | "use strict";
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 | Object.defineProperty(exports, "__esModule", { value: true });
|
2520 | var Disposable;
|
2521 | (function (Disposable) {
|
2522 | function create(func) {
|
2523 | return {
|
2524 | dispose: func
|
2525 | };
|
2526 | }
|
2527 | Disposable.create = create;
|
2528 | })(Disposable = exports.Disposable || (exports.Disposable = {}));
|
2529 | var Event;
|
2530 | (function (Event) {
|
2531 | const _disposable = { dispose() { } };
|
2532 | Event.None = function () { return _disposable; };
|
2533 | })(Event = exports.Event || (exports.Event = {}));
|
2534 | class CallbackList {
|
2535 | add(callback, context = null, bucket) {
|
2536 | if (!this._callbacks) {
|
2537 | this._callbacks = [];
|
2538 | this._contexts = [];
|
2539 | }
|
2540 | this._callbacks.push(callback);
|
2541 | this._contexts.push(context);
|
2542 | if (Array.isArray(bucket)) {
|
2543 | bucket.push({ dispose: () => this.remove(callback, context) });
|
2544 | }
|
2545 | }
|
2546 | remove(callback, context = null) {
|
2547 | if (!this._callbacks) {
|
2548 | return;
|
2549 | }
|
2550 | var foundCallbackWithDifferentContext = false;
|
2551 | for (var i = 0, len = this._callbacks.length; i < len; i++) {
|
2552 | if (this._callbacks[i] === callback) {
|
2553 | if (this._contexts[i] === context) {
|
2554 |
|
2555 | this._callbacks.splice(i, 1);
|
2556 | this._contexts.splice(i, 1);
|
2557 | return;
|
2558 | }
|
2559 | else {
|
2560 | foundCallbackWithDifferentContext = true;
|
2561 | }
|
2562 | }
|
2563 | }
|
2564 | if (foundCallbackWithDifferentContext) {
|
2565 | throw new Error('When adding a listener with a context, you should remove it with the same context');
|
2566 | }
|
2567 | }
|
2568 | invoke(...args) {
|
2569 | if (!this._callbacks) {
|
2570 | return [];
|
2571 | }
|
2572 | var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);
|
2573 | for (var i = 0, len = callbacks.length; i < len; i++) {
|
2574 | try {
|
2575 | ret.push(callbacks[i].apply(contexts[i], args));
|
2576 | }
|
2577 | catch (e) {
|
2578 | console.error(e);
|
2579 | }
|
2580 | }
|
2581 | return ret;
|
2582 | }
|
2583 | isEmpty() {
|
2584 | return !this._callbacks || this._callbacks.length === 0;
|
2585 | }
|
2586 | dispose() {
|
2587 | this._callbacks = undefined;
|
2588 | this._contexts = undefined;
|
2589 | }
|
2590 | }
|
2591 | class Emitter {
|
2592 | constructor(_options) {
|
2593 | this._options = _options;
|
2594 | }
|
2595 | |
2596 |
|
2597 |
|
2598 |
|
2599 | get event() {
|
2600 | if (!this._event) {
|
2601 | this._event = (listener, thisArgs, disposables) => {
|
2602 | if (!this._callbacks) {
|
2603 | this._callbacks = new CallbackList();
|
2604 | }
|
2605 | if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
|
2606 | this._options.onFirstListenerAdd(this);
|
2607 | }
|
2608 | this._callbacks.add(listener, thisArgs);
|
2609 | let result;
|
2610 | result = {
|
2611 | dispose: () => {
|
2612 | this._callbacks.remove(listener, thisArgs);
|
2613 | result.dispose = Emitter._noop;
|
2614 | if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
|
2615 | this._options.onLastListenerRemove(this);
|
2616 | }
|
2617 | }
|
2618 | };
|
2619 | if (Array.isArray(disposables)) {
|
2620 | disposables.push(result);
|
2621 | }
|
2622 | return result;
|
2623 | };
|
2624 | }
|
2625 | return this._event;
|
2626 | }
|
2627 | |
2628 |
|
2629 |
|
2630 |
|
2631 | fire(event) {
|
2632 | if (this._callbacks) {
|
2633 | this._callbacks.invoke.call(this._callbacks, event);
|
2634 | }
|
2635 | }
|
2636 | dispose() {
|
2637 | if (this._callbacks) {
|
2638 | this._callbacks.dispose();
|
2639 | this._callbacks = undefined;
|
2640 | }
|
2641 | }
|
2642 | }
|
2643 | Emitter._noop = function () { };
|
2644 | exports.Emitter = Emitter;
|
2645 |
|
2646 |
|
2647 | }),
|
2648 |
|
2649 | (function(module, exports, __webpack_require__) {
|
2650 |
|
2651 | "use strict";
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 | Object.defineProperty(exports, "__esModule", { value: true });
|
2658 | const events_1 = __webpack_require__(10);
|
2659 | const Is = __webpack_require__(7);
|
2660 | let ContentLength = 'Content-Length: ';
|
2661 | let CRLF = '\r\n';
|
2662 | var MessageWriter;
|
2663 | (function (MessageWriter) {
|
2664 | function is(value) {
|
2665 | let candidate = value;
|
2666 | return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&
|
2667 | Is.func(candidate.onError) && Is.func(candidate.write);
|
2668 | }
|
2669 | MessageWriter.is = is;
|
2670 | })(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {}));
|
2671 | class AbstractMessageWriter {
|
2672 | constructor() {
|
2673 | this.errorEmitter = new events_1.Emitter();
|
2674 | this.closeEmitter = new events_1.Emitter();
|
2675 | }
|
2676 | dispose() {
|
2677 | this.errorEmitter.dispose();
|
2678 | this.closeEmitter.dispose();
|
2679 | }
|
2680 | get onError() {
|
2681 | return this.errorEmitter.event;
|
2682 | }
|
2683 | fireError(error, message, count) {
|
2684 | this.errorEmitter.fire([this.asError(error), message, count]);
|
2685 | }
|
2686 | get onClose() {
|
2687 | return this.closeEmitter.event;
|
2688 | }
|
2689 | fireClose() {
|
2690 | this.closeEmitter.fire(undefined);
|
2691 | }
|
2692 | asError(error) {
|
2693 | if (error instanceof Error) {
|
2694 | return error;
|
2695 | }
|
2696 | else {
|
2697 | return new Error(`Writer recevied error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
|
2698 | }
|
2699 | }
|
2700 | }
|
2701 | exports.AbstractMessageWriter = AbstractMessageWriter;
|
2702 | class StreamMessageWriter extends AbstractMessageWriter {
|
2703 | constructor(writable, encoding = 'utf8') {
|
2704 | super();
|
2705 | this.writable = writable;
|
2706 | this.encoding = encoding;
|
2707 | this.errorCount = 0;
|
2708 | this.writable.on('error', (error) => this.fireError(error));
|
2709 | this.writable.on('close', () => this.fireClose());
|
2710 | }
|
2711 | write(msg) {
|
2712 | let json = JSON.stringify(msg);
|
2713 | let contentLength = Buffer.byteLength(json, this.encoding);
|
2714 | let headers = [
|
2715 | ContentLength, contentLength.toString(), CRLF,
|
2716 | CRLF
|
2717 | ];
|
2718 | try {
|
2719 |
|
2720 | this.writable.write(headers.join(''), 'ascii');
|
2721 |
|
2722 | this.writable.write(json, this.encoding);
|
2723 | this.errorCount = 0;
|
2724 | }
|
2725 | catch (error) {
|
2726 | this.errorCount++;
|
2727 | this.fireError(error, msg, this.errorCount);
|
2728 | }
|
2729 | }
|
2730 | }
|
2731 | exports.StreamMessageWriter = StreamMessageWriter;
|
2732 | class IPCMessageWriter extends AbstractMessageWriter {
|
2733 | constructor(process) {
|
2734 | super();
|
2735 | this.process = process;
|
2736 | this.errorCount = 0;
|
2737 | this.queue = [];
|
2738 | this.sending = false;
|
2739 | let eventEmitter = this.process;
|
2740 | eventEmitter.on('error', (error) => this.fireError(error));
|
2741 | eventEmitter.on('close', () => this.fireClose);
|
2742 | }
|
2743 | write(msg) {
|
2744 | if (!this.sending && this.queue.length === 0) {
|
2745 |
|
2746 | this.doWriteMessage(msg);
|
2747 | }
|
2748 | else {
|
2749 | this.queue.push(msg);
|
2750 | }
|
2751 | }
|
2752 | doWriteMessage(msg) {
|
2753 | try {
|
2754 | if (this.process.send) {
|
2755 | this.sending = true;
|
2756 | this.process.send(msg, undefined, undefined, (error) => {
|
2757 | this.sending = false;
|
2758 | if (error) {
|
2759 | this.errorCount++;
|
2760 | this.fireError(error, msg, this.errorCount);
|
2761 | }
|
2762 | else {
|
2763 | this.errorCount = 0;
|
2764 | }
|
2765 | if (this.queue.length > 0) {
|
2766 | this.doWriteMessage(this.queue.shift());
|
2767 | }
|
2768 | });
|
2769 | }
|
2770 | }
|
2771 | catch (error) {
|
2772 | this.errorCount++;
|
2773 | this.fireError(error, msg, this.errorCount);
|
2774 | }
|
2775 | }
|
2776 | }
|
2777 | exports.IPCMessageWriter = IPCMessageWriter;
|
2778 | class SocketMessageWriter extends AbstractMessageWriter {
|
2779 | constructor(socket, encoding = 'utf8') {
|
2780 | super();
|
2781 | this.socket = socket;
|
2782 | this.queue = [];
|
2783 | this.sending = false;
|
2784 | this.encoding = encoding;
|
2785 | this.errorCount = 0;
|
2786 | this.socket.on('error', (error) => this.fireError(error));
|
2787 | this.socket.on('close', () => this.fireClose());
|
2788 | }
|
2789 | write(msg) {
|
2790 | if (!this.sending && this.queue.length === 0) {
|
2791 |
|
2792 | this.doWriteMessage(msg);
|
2793 | }
|
2794 | else {
|
2795 | this.queue.push(msg);
|
2796 | }
|
2797 | }
|
2798 | doWriteMessage(msg) {
|
2799 | let json = JSON.stringify(msg);
|
2800 | let contentLength = Buffer.byteLength(json, this.encoding);
|
2801 | let headers = [
|
2802 | ContentLength, contentLength.toString(), CRLF,
|
2803 | CRLF
|
2804 | ];
|
2805 | try {
|
2806 |
|
2807 | this.sending = true;
|
2808 | this.socket.write(headers.join(''), 'ascii', (error) => {
|
2809 | if (error) {
|
2810 | this.handleError(error, msg);
|
2811 | }
|
2812 | try {
|
2813 |
|
2814 | this.socket.write(json, this.encoding, (error) => {
|
2815 | this.sending = false;
|
2816 | if (error) {
|
2817 | this.handleError(error, msg);
|
2818 | }
|
2819 | else {
|
2820 | this.errorCount = 0;
|
2821 | }
|
2822 | if (this.queue.length > 0) {
|
2823 | this.doWriteMessage(this.queue.shift());
|
2824 | }
|
2825 | });
|
2826 | }
|
2827 | catch (error) {
|
2828 | this.handleError(error, msg);
|
2829 | }
|
2830 | });
|
2831 | }
|
2832 | catch (error) {
|
2833 | this.handleError(error, msg);
|
2834 | }
|
2835 | }
|
2836 | handleError(error, msg) {
|
2837 | this.errorCount++;
|
2838 | this.fireError(error, msg, this.errorCount);
|
2839 | }
|
2840 | }
|
2841 | exports.SocketMessageWriter = SocketMessageWriter;
|
2842 |
|
2843 |
|
2844 | }),
|
2845 |
|
2846 | (function(module, exports, __webpack_require__) {
|
2847 |
|
2848 | "use strict";
|
2849 |
|
2850 |
|
2851 |
|
2852 |
|
2853 |
|
2854 | Object.defineProperty(exports, "__esModule", { value: true });
|
2855 | const events_1 = __webpack_require__(10);
|
2856 | const Is = __webpack_require__(7);
|
2857 | var CancellationToken;
|
2858 | (function (CancellationToken) {
|
2859 | CancellationToken.None = Object.freeze({
|
2860 | isCancellationRequested: false,
|
2861 | onCancellationRequested: events_1.Event.None
|
2862 | });
|
2863 | CancellationToken.Cancelled = Object.freeze({
|
2864 | isCancellationRequested: true,
|
2865 | onCancellationRequested: events_1.Event.None
|
2866 | });
|
2867 | function is(value) {
|
2868 | let candidate = value;
|
2869 | return candidate && (candidate === CancellationToken.None
|
2870 | || candidate === CancellationToken.Cancelled
|
2871 | || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));
|
2872 | }
|
2873 | CancellationToken.is = is;
|
2874 | })(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {}));
|
2875 | const shortcutEvent = Object.freeze(function (callback, context) {
|
2876 | let handle = setTimeout(callback.bind(context), 0);
|
2877 | return { dispose() { clearTimeout(handle); } };
|
2878 | });
|
2879 | class MutableToken {
|
2880 | constructor() {
|
2881 | this._isCancelled = false;
|
2882 | }
|
2883 | cancel() {
|
2884 | if (!this._isCancelled) {
|
2885 | this._isCancelled = true;
|
2886 | if (this._emitter) {
|
2887 | this._emitter.fire(undefined);
|
2888 | this._emitter = undefined;
|
2889 | }
|
2890 | }
|
2891 | }
|
2892 | get isCancellationRequested() {
|
2893 | return this._isCancelled;
|
2894 | }
|
2895 | get onCancellationRequested() {
|
2896 | if (this._isCancelled) {
|
2897 | return shortcutEvent;
|
2898 | }
|
2899 | if (!this._emitter) {
|
2900 | this._emitter = new events_1.Emitter();
|
2901 | }
|
2902 | return this._emitter.event;
|
2903 | }
|
2904 | }
|
2905 | class CancellationTokenSource {
|
2906 | get token() {
|
2907 | if (!this._token) {
|
2908 |
|
2909 |
|
2910 | this._token = new MutableToken();
|
2911 | }
|
2912 | return this._token;
|
2913 | }
|
2914 | cancel() {
|
2915 | if (!this._token) {
|
2916 |
|
2917 |
|
2918 |
|
2919 | this._token = CancellationToken.Cancelled;
|
2920 | }
|
2921 | else {
|
2922 | this._token.cancel();
|
2923 | }
|
2924 | }
|
2925 | dispose() {
|
2926 | this.cancel();
|
2927 | }
|
2928 | }
|
2929 | exports.CancellationTokenSource = CancellationTokenSource;
|
2930 |
|
2931 |
|
2932 | }),
|
2933 |
|
2934 | (function(module, exports, __webpack_require__) {
|
2935 |
|
2936 | "use strict";
|
2937 |
|
2938 |
|
2939 |
|
2940 |
|
2941 |
|
2942 | Object.defineProperty(exports, "__esModule", { value: true });
|
2943 | var Touch;
|
2944 | (function (Touch) {
|
2945 | Touch.None = 0;
|
2946 | Touch.First = 1;
|
2947 | Touch.Last = 2;
|
2948 | })(Touch = exports.Touch || (exports.Touch = {}));
|
2949 | class LinkedMap {
|
2950 | constructor() {
|
2951 | this._map = new Map();
|
2952 | this._head = undefined;
|
2953 | this._tail = undefined;
|
2954 | this._size = 0;
|
2955 | }
|
2956 | clear() {
|
2957 | this._map.clear();
|
2958 | this._head = undefined;
|
2959 | this._tail = undefined;
|
2960 | this._size = 0;
|
2961 | }
|
2962 | isEmpty() {
|
2963 | return !this._head && !this._tail;
|
2964 | }
|
2965 | get size() {
|
2966 | return this._size;
|
2967 | }
|
2968 | has(key) {
|
2969 | return this._map.has(key);
|
2970 | }
|
2971 | get(key) {
|
2972 | const item = this._map.get(key);
|
2973 | if (!item) {
|
2974 | return undefined;
|
2975 | }
|
2976 | return item.value;
|
2977 | }
|
2978 | set(key, value, touch = Touch.None) {
|
2979 | let item = this._map.get(key);
|
2980 | if (item) {
|
2981 | item.value = value;
|
2982 | if (touch !== Touch.None) {
|
2983 | this.touch(item, touch);
|
2984 | }
|
2985 | }
|
2986 | else {
|
2987 | item = { key, value, next: undefined, previous: undefined };
|
2988 | switch (touch) {
|
2989 | case Touch.None:
|
2990 | this.addItemLast(item);
|
2991 | break;
|
2992 | case Touch.First:
|
2993 | this.addItemFirst(item);
|
2994 | break;
|
2995 | case Touch.Last:
|
2996 | this.addItemLast(item);
|
2997 | break;
|
2998 | default:
|
2999 | this.addItemLast(item);
|
3000 | break;
|
3001 | }
|
3002 | this._map.set(key, item);
|
3003 | this._size++;
|
3004 | }
|
3005 | }
|
3006 | delete(key) {
|
3007 | const item = this._map.get(key);
|
3008 | if (!item) {
|
3009 | return false;
|
3010 | }
|
3011 | this._map.delete(key);
|
3012 | this.removeItem(item);
|
3013 | this._size--;
|
3014 | return true;
|
3015 | }
|
3016 | shift() {
|
3017 | if (!this._head && !this._tail) {
|
3018 | return undefined;
|
3019 | }
|
3020 | if (!this._head || !this._tail) {
|
3021 | throw new Error('Invalid list');
|
3022 | }
|
3023 | const item = this._head;
|
3024 | this._map.delete(item.key);
|
3025 | this.removeItem(item);
|
3026 | this._size--;
|
3027 | return item.value;
|
3028 | }
|
3029 | forEach(callbackfn, thisArg) {
|
3030 | let current = this._head;
|
3031 | while (current) {
|
3032 | if (thisArg) {
|
3033 | callbackfn.bind(thisArg)(current.value, current.key, this);
|
3034 | }
|
3035 | else {
|
3036 | callbackfn(current.value, current.key, this);
|
3037 | }
|
3038 | current = current.next;
|
3039 | }
|
3040 | }
|
3041 | forEachReverse(callbackfn, thisArg) {
|
3042 | let current = this._tail;
|
3043 | while (current) {
|
3044 | if (thisArg) {
|
3045 | callbackfn.bind(thisArg)(current.value, current.key, this);
|
3046 | }
|
3047 | else {
|
3048 | callbackfn(current.value, current.key, this);
|
3049 | }
|
3050 | current = current.previous;
|
3051 | }
|
3052 | }
|
3053 | values() {
|
3054 | let result = [];
|
3055 | let current = this._head;
|
3056 | while (current) {
|
3057 | result.push(current.value);
|
3058 | current = current.next;
|
3059 | }
|
3060 | return result;
|
3061 | }
|
3062 | keys() {
|
3063 | let result = [];
|
3064 | let current = this._head;
|
3065 | while (current) {
|
3066 | result.push(current.key);
|
3067 | current = current.next;
|
3068 | }
|
3069 | return result;
|
3070 | }
|
3071 | |
3072 |
|
3073 |
|
3074 |
|
3075 |
|
3076 |
|
3077 |
|
3078 |
|
3079 |
|
3080 |
|
3081 |
|
3082 |
|
3083 |
|
3084 |
|
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 |
|
3090 |
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 |
|
3098 |
|
3099 |
|
3100 |
|
3101 |
|
3102 |
|
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 | addItemFirst(item) {
|
3111 |
|
3112 | if (!this._head && !this._tail) {
|
3113 | this._tail = item;
|
3114 | }
|
3115 | else if (!this._head) {
|
3116 | throw new Error('Invalid list');
|
3117 | }
|
3118 | else {
|
3119 | item.next = this._head;
|
3120 | this._head.previous = item;
|
3121 | }
|
3122 | this._head = item;
|
3123 | }
|
3124 | addItemLast(item) {
|
3125 |
|
3126 | if (!this._head && !this._tail) {
|
3127 | this._head = item;
|
3128 | }
|
3129 | else if (!this._tail) {
|
3130 | throw new Error('Invalid list');
|
3131 | }
|
3132 | else {
|
3133 | item.previous = this._tail;
|
3134 | this._tail.next = item;
|
3135 | }
|
3136 | this._tail = item;
|
3137 | }
|
3138 | removeItem(item) {
|
3139 | if (item === this._head && item === this._tail) {
|
3140 | this._head = undefined;
|
3141 | this._tail = undefined;
|
3142 | }
|
3143 | else if (item === this._head) {
|
3144 | this._head = item.next;
|
3145 | }
|
3146 | else if (item === this._tail) {
|
3147 | this._tail = item.previous;
|
3148 | }
|
3149 | else {
|
3150 | const next = item.next;
|
3151 | const previous = item.previous;
|
3152 | if (!next || !previous) {
|
3153 | throw new Error('Invalid list');
|
3154 | }
|
3155 | next.previous = previous;
|
3156 | previous.next = next;
|
3157 | }
|
3158 | }
|
3159 | touch(item, touch) {
|
3160 | if (!this._head || !this._tail) {
|
3161 | throw new Error('Invalid list');
|
3162 | }
|
3163 | if ((touch !== Touch.First && touch !== Touch.Last)) {
|
3164 | return;
|
3165 | }
|
3166 | if (touch === Touch.First) {
|
3167 | if (item === this._head) {
|
3168 | return;
|
3169 | }
|
3170 | const next = item.next;
|
3171 | const previous = item.previous;
|
3172 |
|
3173 | if (item === this._tail) {
|
3174 |
|
3175 |
|
3176 | previous.next = undefined;
|
3177 | this._tail = previous;
|
3178 | }
|
3179 | else {
|
3180 |
|
3181 | next.previous = previous;
|
3182 | previous.next = next;
|
3183 | }
|
3184 |
|
3185 | item.previous = undefined;
|
3186 | item.next = this._head;
|
3187 | this._head.previous = item;
|
3188 | this._head = item;
|
3189 | }
|
3190 | else if (touch === Touch.Last) {
|
3191 | if (item === this._tail) {
|
3192 | return;
|
3193 | }
|
3194 | const next = item.next;
|
3195 | const previous = item.previous;
|
3196 |
|
3197 | if (item === this._head) {
|
3198 |
|
3199 |
|
3200 | next.previous = undefined;
|
3201 | this._head = next;
|
3202 | }
|
3203 | else {
|
3204 |
|
3205 | next.previous = previous;
|
3206 | previous.next = next;
|
3207 | }
|
3208 | item.next = undefined;
|
3209 | item.previous = this._tail;
|
3210 | this._tail.next = item;
|
3211 | this._tail = item;
|
3212 | }
|
3213 | }
|
3214 | }
|
3215 | exports.LinkedMap = LinkedMap;
|
3216 |
|
3217 |
|
3218 | }),
|
3219 |
|
3220 | (function(module, exports, __webpack_require__) {
|
3221 |
|
3222 | "use strict";
|
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 | Object.defineProperty(exports, "__esModule", { value: true });
|
3229 | const path_1 = __webpack_require__(15);
|
3230 | const os_1 = __webpack_require__(16);
|
3231 | const crypto_1 = __webpack_require__(17);
|
3232 | const net_1 = __webpack_require__(18);
|
3233 | const messageReader_1 = __webpack_require__(9);
|
3234 | const messageWriter_1 = __webpack_require__(11);
|
3235 | function generateRandomPipeName() {
|
3236 | const randomSuffix = crypto_1.randomBytes(21).toString('hex');
|
3237 | if (process.platform === 'win32') {
|
3238 | return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
|
3239 | }
|
3240 | else {
|
3241 |
|
3242 | return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`);
|
3243 | }
|
3244 | }
|
3245 | exports.generateRandomPipeName = generateRandomPipeName;
|
3246 | function createClientPipeTransport(pipeName, encoding = 'utf-8') {
|
3247 | let connectResolve;
|
3248 | let connected = new Promise((resolve, _reject) => {
|
3249 | connectResolve = resolve;
|
3250 | });
|
3251 | return new Promise((resolve, reject) => {
|
3252 | let server = net_1.createServer((socket) => {
|
3253 | server.close();
|
3254 | connectResolve([
|
3255 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3256 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3257 | ]);
|
3258 | });
|
3259 | server.on('error', reject);
|
3260 | server.listen(pipeName, () => {
|
3261 | server.removeListener('error', reject);
|
3262 | resolve({
|
3263 | onConnected: () => { return connected; }
|
3264 | });
|
3265 | });
|
3266 | });
|
3267 | }
|
3268 | exports.createClientPipeTransport = createClientPipeTransport;
|
3269 | function createServerPipeTransport(pipeName, encoding = 'utf-8') {
|
3270 | const socket = net_1.createConnection(pipeName);
|
3271 | return [
|
3272 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3273 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3274 | ];
|
3275 | }
|
3276 | exports.createServerPipeTransport = createServerPipeTransport;
|
3277 |
|
3278 |
|
3279 | }),
|
3280 |
|
3281 | (function(module, exports) {
|
3282 |
|
3283 | module.exports = require("path");
|
3284 |
|
3285 | }),
|
3286 |
|
3287 | (function(module, exports) {
|
3288 |
|
3289 | module.exports = require("os");
|
3290 |
|
3291 | }),
|
3292 |
|
3293 | (function(module, exports) {
|
3294 |
|
3295 | module.exports = require("crypto");
|
3296 |
|
3297 | }),
|
3298 |
|
3299 | (function(module, exports) {
|
3300 |
|
3301 | module.exports = require("net");
|
3302 |
|
3303 | }),
|
3304 |
|
3305 | (function(module, exports, __webpack_require__) {
|
3306 |
|
3307 | "use strict";
|
3308 |
|
3309 |
|
3310 |
|
3311 |
|
3312 |
|
3313 | Object.defineProperty(exports, "__esModule", { value: true });
|
3314 | const net_1 = __webpack_require__(18);
|
3315 | const messageReader_1 = __webpack_require__(9);
|
3316 | const messageWriter_1 = __webpack_require__(11);
|
3317 | function createClientSocketTransport(port, encoding = 'utf-8') {
|
3318 | let connectResolve;
|
3319 | let connected = new Promise((resolve, _reject) => {
|
3320 | connectResolve = resolve;
|
3321 | });
|
3322 | return new Promise((resolve, reject) => {
|
3323 | let server = net_1.createServer((socket) => {
|
3324 | server.close();
|
3325 | connectResolve([
|
3326 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3327 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3328 | ]);
|
3329 | });
|
3330 | server.on('error', reject);
|
3331 | server.listen(port, '127.0.0.1', () => {
|
3332 | server.removeListener('error', reject);
|
3333 | resolve({
|
3334 | onConnected: () => { return connected; }
|
3335 | });
|
3336 | });
|
3337 | });
|
3338 | }
|
3339 | exports.createClientSocketTransport = createClientSocketTransport;
|
3340 | function createServerSocketTransport(port, encoding = 'utf-8') {
|
3341 | const socket = net_1.createConnection(port, '127.0.0.1');
|
3342 | return [
|
3343 | new messageReader_1.SocketMessageReader(socket, encoding),
|
3344 | new messageWriter_1.SocketMessageWriter(socket, encoding)
|
3345 | ];
|
3346 | }
|
3347 | exports.createServerSocketTransport = createServerSocketTransport;
|
3348 |
|
3349 |
|
3350 | }),
|
3351 |
|
3352 | (function(module, __webpack_exports__, __webpack_require__) {
|
3353 |
|
3354 | "use strict";
|
3355 | __webpack_require__.r(__webpack_exports__);
|
3356 | __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
|
3357 | __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; });
|
3358 | __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; });
|
3359 | __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; });
|
3360 | __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
|
3361 | __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; });
|
3362 | __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; });
|
3363 | __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; });
|
3364 | __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; });
|
3365 | __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; });
|
3366 | __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; });
|
3367 | __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; });
|
3368 | __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
|
3369 | __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; });
|
3370 | __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; });
|
3371 | __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; });
|
3372 | __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; });
|
3373 | __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; });
|
3374 | __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; });
|
3375 | __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; });
|
3376 | __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; });
|
3377 | __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; });
|
3378 | __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; });
|
3379 | __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; });
|
3380 | __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; });
|
3381 | __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; });
|
3382 | __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; });
|
3383 | __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; });
|
3384 | __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; });
|
3385 | __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; });
|
3386 | __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; });
|
3387 | __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; });
|
3388 | __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; });
|
3389 | __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; });
|
3390 | __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; });
|
3391 | __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; });
|
3392 | __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; });
|
3393 | __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; });
|
3394 | __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; });
|
3395 | __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; });
|
3396 | __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; });
|
3397 | __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; });
|
3398 | __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; });
|
3399 | __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; });
|
3400 | __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; });
|
3401 | __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; });
|
3402 | __webpack_require__.d(__webpack_exports__, "TextDocumentSaveReason", function() { return TextDocumentSaveReason; });
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 |
|
3411 |
|
3412 | var Position;
|
3413 | (function (Position) {
|
3414 | |
3415 |
|
3416 |
|
3417 |
|
3418 |
|
3419 | function create(line, character) {
|
3420 | return { line: line, character: character };
|
3421 | }
|
3422 | Position.create = create;
|
3423 | |
3424 |
|
3425 |
|
3426 | function is(value) {
|
3427 | var candidate = value;
|
3428 | return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);
|
3429 | }
|
3430 | Position.is = is;
|
3431 | })(Position || (Position = {}));
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 | var Range;
|
3437 | (function (Range) {
|
3438 | function create(one, two, three, four) {
|
3439 | if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {
|
3440 | return { start: Position.create(one, two), end: Position.create(three, four) };
|
3441 | }
|
3442 | else if (Position.is(one) && Position.is(two)) {
|
3443 | return { start: one, end: two };
|
3444 | }
|
3445 | else {
|
3446 | throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
|
3447 | }
|
3448 | }
|
3449 | Range.create = create;
|
3450 | |
3451 |
|
3452 |
|
3453 | function is(value) {
|
3454 | var candidate = value;
|
3455 | return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
|
3456 | }
|
3457 | Range.is = is;
|
3458 | })(Range || (Range = {}));
|
3459 |
|
3460 |
|
3461 |
|
3462 |
|
3463 | var Location;
|
3464 | (function (Location) {
|
3465 | |
3466 |
|
3467 |
|
3468 |
|
3469 |
|
3470 | function create(uri, range) {
|
3471 | return { uri: uri, range: range };
|
3472 | }
|
3473 | Location.create = create;
|
3474 | |
3475 |
|
3476 |
|
3477 | function is(value) {
|
3478 | var candidate = value;
|
3479 | return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
3480 | }
|
3481 | Location.is = is;
|
3482 | })(Location || (Location = {}));
|
3483 |
|
3484 |
|
3485 |
|
3486 |
|
3487 | var LocationLink;
|
3488 | (function (LocationLink) {
|
3489 | |
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 |
|
3495 |
|
3496 | function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
3497 | return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
|
3498 | }
|
3499 | LocationLink.create = create;
|
3500 | |
3501 |
|
3502 |
|
3503 | function is(value) {
|
3504 | var candidate = value;
|
3505 | return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
|
3506 | && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
|
3507 | && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
3508 | }
|
3509 | LocationLink.is = is;
|
3510 | })(LocationLink || (LocationLink = {}));
|
3511 |
|
3512 |
|
3513 |
|
3514 |
|
3515 | var Color;
|
3516 | (function (Color) {
|
3517 | |
3518 |
|
3519 |
|
3520 | function create(red, green, blue, alpha) {
|
3521 | return {
|
3522 | red: red,
|
3523 | green: green,
|
3524 | blue: blue,
|
3525 | alpha: alpha,
|
3526 | };
|
3527 | }
|
3528 | Color.create = create;
|
3529 | |
3530 |
|
3531 |
|
3532 | function is(value) {
|
3533 | var candidate = value;
|
3534 | return Is.number(candidate.red)
|
3535 | && Is.number(candidate.green)
|
3536 | && Is.number(candidate.blue)
|
3537 | && Is.number(candidate.alpha);
|
3538 | }
|
3539 | Color.is = is;
|
3540 | })(Color || (Color = {}));
|
3541 |
|
3542 |
|
3543 |
|
3544 |
|
3545 | var ColorInformation;
|
3546 | (function (ColorInformation) {
|
3547 | |
3548 |
|
3549 |
|
3550 | function create(range, color) {
|
3551 | return {
|
3552 | range: range,
|
3553 | color: color,
|
3554 | };
|
3555 | }
|
3556 | ColorInformation.create = create;
|
3557 | |
3558 |
|
3559 |
|
3560 | function is(value) {
|
3561 | var candidate = value;
|
3562 | return Range.is(candidate.range) && Color.is(candidate.color);
|
3563 | }
|
3564 | ColorInformation.is = is;
|
3565 | })(ColorInformation || (ColorInformation = {}));
|
3566 |
|
3567 |
|
3568 |
|
3569 |
|
3570 | var ColorPresentation;
|
3571 | (function (ColorPresentation) {
|
3572 | |
3573 |
|
3574 |
|
3575 | function create(label, textEdit, additionalTextEdits) {
|
3576 | return {
|
3577 | label: label,
|
3578 | textEdit: textEdit,
|
3579 | additionalTextEdits: additionalTextEdits,
|
3580 | };
|
3581 | }
|
3582 | ColorPresentation.create = create;
|
3583 | |
3584 |
|
3585 |
|
3586 | function is(value) {
|
3587 | var candidate = value;
|
3588 | return Is.string(candidate.label)
|
3589 | && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
|
3590 | && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
3591 | }
|
3592 | ColorPresentation.is = is;
|
3593 | })(ColorPresentation || (ColorPresentation = {}));
|
3594 |
|
3595 |
|
3596 |
|
3597 | var FoldingRangeKind;
|
3598 | (function (FoldingRangeKind) {
|
3599 | |
3600 |
|
3601 |
|
3602 | FoldingRangeKind["Comment"] = "comment";
|
3603 | |
3604 |
|
3605 |
|
3606 | FoldingRangeKind["Imports"] = "imports";
|
3607 | |
3608 |
|
3609 |
|
3610 | FoldingRangeKind["Region"] = "region";
|
3611 | })(FoldingRangeKind || (FoldingRangeKind = {}));
|
3612 |
|
3613 |
|
3614 |
|
3615 |
|
3616 | var FoldingRange;
|
3617 | (function (FoldingRange) {
|
3618 | |
3619 |
|
3620 |
|
3621 | function create(startLine, endLine, startCharacter, endCharacter, kind) {
|
3622 | var result = {
|
3623 | startLine: startLine,
|
3624 | endLine: endLine
|
3625 | };
|
3626 | if (Is.defined(startCharacter)) {
|
3627 | result.startCharacter = startCharacter;
|
3628 | }
|
3629 | if (Is.defined(endCharacter)) {
|
3630 | result.endCharacter = endCharacter;
|
3631 | }
|
3632 | if (Is.defined(kind)) {
|
3633 | result.kind = kind;
|
3634 | }
|
3635 | return result;
|
3636 | }
|
3637 | FoldingRange.create = create;
|
3638 | |
3639 |
|
3640 |
|
3641 | function is(value) {
|
3642 | var candidate = value;
|
3643 | return Is.number(candidate.startLine) && Is.number(candidate.startLine)
|
3644 | && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))
|
3645 | && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))
|
3646 | && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
|
3647 | }
|
3648 | FoldingRange.is = is;
|
3649 | })(FoldingRange || (FoldingRange = {}));
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 | var DiagnosticRelatedInformation;
|
3655 | (function (DiagnosticRelatedInformation) {
|
3656 | |
3657 |
|
3658 |
|
3659 | function create(location, message) {
|
3660 | return {
|
3661 | location: location,
|
3662 | message: message
|
3663 | };
|
3664 | }
|
3665 | DiagnosticRelatedInformation.create = create;
|
3666 | |
3667 |
|
3668 |
|
3669 | function is(value) {
|
3670 | var candidate = value;
|
3671 | return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
3672 | }
|
3673 | DiagnosticRelatedInformation.is = is;
|
3674 | })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
|
3675 |
|
3676 |
|
3677 |
|
3678 | var DiagnosticSeverity;
|
3679 | (function (DiagnosticSeverity) {
|
3680 | |
3681 |
|
3682 |
|
3683 | DiagnosticSeverity.Error = 1;
|
3684 | |
3685 |
|
3686 |
|
3687 | DiagnosticSeverity.Warning = 2;
|
3688 | |
3689 |
|
3690 |
|
3691 | DiagnosticSeverity.Information = 3;
|
3692 | |
3693 |
|
3694 |
|
3695 | DiagnosticSeverity.Hint = 4;
|
3696 | })(DiagnosticSeverity || (DiagnosticSeverity = {}));
|
3697 |
|
3698 |
|
3699 |
|
3700 |
|
3701 | var Diagnostic;
|
3702 | (function (Diagnostic) {
|
3703 | |
3704 |
|
3705 |
|
3706 | function create(range, message, severity, code, source, relatedInformation) {
|
3707 | var result = { range: range, message: message };
|
3708 | if (Is.defined(severity)) {
|
3709 | result.severity = severity;
|
3710 | }
|
3711 | if (Is.defined(code)) {
|
3712 | result.code = code;
|
3713 | }
|
3714 | if (Is.defined(source)) {
|
3715 | result.source = source;
|
3716 | }
|
3717 | if (Is.defined(relatedInformation)) {
|
3718 | result.relatedInformation = relatedInformation;
|
3719 | }
|
3720 | return result;
|
3721 | }
|
3722 | Diagnostic.create = create;
|
3723 | |
3724 |
|
3725 |
|
3726 | function is(value) {
|
3727 | var candidate = value;
|
3728 | return Is.defined(candidate)
|
3729 | && Range.is(candidate.range)
|
3730 | && Is.string(candidate.message)
|
3731 | && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
|
3732 | && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
|
3733 | && (Is.string(candidate.source) || Is.undefined(candidate.source))
|
3734 | && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
|
3735 | }
|
3736 | Diagnostic.is = is;
|
3737 | })(Diagnostic || (Diagnostic = {}));
|
3738 |
|
3739 |
|
3740 |
|
3741 |
|
3742 | var Command;
|
3743 | (function (Command) {
|
3744 | |
3745 |
|
3746 |
|
3747 | function create(title, command) {
|
3748 | var args = [];
|
3749 | for (var _i = 2; _i < arguments.length; _i++) {
|
3750 | args[_i - 2] = arguments[_i];
|
3751 | }
|
3752 | var result = { title: title, command: command };
|
3753 | if (Is.defined(args) && args.length > 0) {
|
3754 | result.arguments = args;
|
3755 | }
|
3756 | return result;
|
3757 | }
|
3758 | Command.create = create;
|
3759 | |
3760 |
|
3761 |
|
3762 | function is(value) {
|
3763 | var candidate = value;
|
3764 | return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
|
3765 | }
|
3766 | Command.is = is;
|
3767 | })(Command || (Command = {}));
|
3768 |
|
3769 |
|
3770 |
|
3771 |
|
3772 | var TextEdit;
|
3773 | (function (TextEdit) {
|
3774 | |
3775 |
|
3776 |
|
3777 |
|
3778 |
|
3779 | function replace(range, newText) {
|
3780 | return { range: range, newText: newText };
|
3781 | }
|
3782 | TextEdit.replace = replace;
|
3783 | |
3784 |
|
3785 |
|
3786 |
|
3787 |
|
3788 | function insert(position, newText) {
|
3789 | return { range: { start: position, end: position }, newText: newText };
|
3790 | }
|
3791 | TextEdit.insert = insert;
|
3792 | |
3793 |
|
3794 |
|
3795 |
|
3796 | function del(range) {
|
3797 | return { range: range, newText: '' };
|
3798 | }
|
3799 | TextEdit.del = del;
|
3800 | function is(value) {
|
3801 | var candidate = value;
|
3802 | return Is.objectLiteral(candidate)
|
3803 | && Is.string(candidate.newText)
|
3804 | && Range.is(candidate.range);
|
3805 | }
|
3806 | TextEdit.is = is;
|
3807 | })(TextEdit || (TextEdit = {}));
|
3808 |
|
3809 |
|
3810 |
|
3811 |
|
3812 | var TextDocumentEdit;
|
3813 | (function (TextDocumentEdit) {
|
3814 | |
3815 |
|
3816 |
|
3817 | function create(textDocument, edits) {
|
3818 | return { textDocument: textDocument, edits: edits };
|
3819 | }
|
3820 | TextDocumentEdit.create = create;
|
3821 | function is(value) {
|
3822 | var candidate = value;
|
3823 | return Is.defined(candidate)
|
3824 | && VersionedTextDocumentIdentifier.is(candidate.textDocument)
|
3825 | && Array.isArray(candidate.edits);
|
3826 | }
|
3827 | TextDocumentEdit.is = is;
|
3828 | })(TextDocumentEdit || (TextDocumentEdit = {}));
|
3829 | var CreateFile;
|
3830 | (function (CreateFile) {
|
3831 | function create(uri, options) {
|
3832 | var result = {
|
3833 | kind: 'create',
|
3834 | uri: uri
|
3835 | };
|
3836 | if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
|
3837 | result.options = options;
|
3838 | }
|
3839 | return result;
|
3840 | }
|
3841 | CreateFile.create = create;
|
3842 | function is(value) {
|
3843 | var candidate = value;
|
3844 | return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&
|
3845 | (candidate.options === void 0 ||
|
3846 | ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
|
3847 | }
|
3848 | CreateFile.is = is;
|
3849 | })(CreateFile || (CreateFile = {}));
|
3850 | var RenameFile;
|
3851 | (function (RenameFile) {
|
3852 | function create(oldUri, newUri, options) {
|
3853 | var result = {
|
3854 | kind: 'rename',
|
3855 | oldUri: oldUri,
|
3856 | newUri: newUri
|
3857 | };
|
3858 | if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
|
3859 | result.options = options;
|
3860 | }
|
3861 | return result;
|
3862 | }
|
3863 | RenameFile.create = create;
|
3864 | function is(value) {
|
3865 | var candidate = value;
|
3866 | return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&
|
3867 | (candidate.options === void 0 ||
|
3868 | ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
|
3869 | }
|
3870 | RenameFile.is = is;
|
3871 | })(RenameFile || (RenameFile = {}));
|
3872 | var DeleteFile;
|
3873 | (function (DeleteFile) {
|
3874 | function create(uri, options) {
|
3875 | var result = {
|
3876 | kind: 'delete',
|
3877 | uri: uri
|
3878 | };
|
3879 | if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
|
3880 | result.options = options;
|
3881 | }
|
3882 | return result;
|
3883 | }
|
3884 | DeleteFile.create = create;
|
3885 | function is(value) {
|
3886 | var candidate = value;
|
3887 | return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&
|
3888 | (candidate.options === void 0 ||
|
3889 | ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));
|
3890 | }
|
3891 | DeleteFile.is = is;
|
3892 | })(DeleteFile || (DeleteFile = {}));
|
3893 | var WorkspaceEdit;
|
3894 | (function (WorkspaceEdit) {
|
3895 | function is(value) {
|
3896 | var candidate = value;
|
3897 | return candidate &&
|
3898 | (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&
|
3899 | (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {
|
3900 | if (Is.string(change.kind)) {
|
3901 | return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
3902 | }
|
3903 | else {
|
3904 | return TextDocumentEdit.is(change);
|
3905 | }
|
3906 | }));
|
3907 | }
|
3908 | WorkspaceEdit.is = is;
|
3909 | })(WorkspaceEdit || (WorkspaceEdit = {}));
|
3910 | var TextEditChangeImpl = (function () {
|
3911 | function TextEditChangeImpl(edits) {
|
3912 | this.edits = edits;
|
3913 | }
|
3914 | TextEditChangeImpl.prototype.insert = function (position, newText) {
|
3915 | this.edits.push(TextEdit.insert(position, newText));
|
3916 | };
|
3917 | TextEditChangeImpl.prototype.replace = function (range, newText) {
|
3918 | this.edits.push(TextEdit.replace(range, newText));
|
3919 | };
|
3920 | TextEditChangeImpl.prototype.delete = function (range) {
|
3921 | this.edits.push(TextEdit.del(range));
|
3922 | };
|
3923 | TextEditChangeImpl.prototype.add = function (edit) {
|
3924 | this.edits.push(edit);
|
3925 | };
|
3926 | TextEditChangeImpl.prototype.all = function () {
|
3927 | return this.edits;
|
3928 | };
|
3929 | TextEditChangeImpl.prototype.clear = function () {
|
3930 | this.edits.splice(0, this.edits.length);
|
3931 | };
|
3932 | return TextEditChangeImpl;
|
3933 | }());
|
3934 |
|
3935 |
|
3936 |
|
3937 | var WorkspaceChange = (function () {
|
3938 | function WorkspaceChange(workspaceEdit) {
|
3939 | var _this = this;
|
3940 | this._textEditChanges = Object.create(null);
|
3941 | if (workspaceEdit) {
|
3942 | this._workspaceEdit = workspaceEdit;
|
3943 | if (workspaceEdit.documentChanges) {
|
3944 | workspaceEdit.documentChanges.forEach(function (change) {
|
3945 | if (TextDocumentEdit.is(change)) {
|
3946 | var textEditChange = new TextEditChangeImpl(change.edits);
|
3947 | _this._textEditChanges[change.textDocument.uri] = textEditChange;
|
3948 | }
|
3949 | });
|
3950 | }
|
3951 | else if (workspaceEdit.changes) {
|
3952 | Object.keys(workspaceEdit.changes).forEach(function (key) {
|
3953 | var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
|
3954 | _this._textEditChanges[key] = textEditChange;
|
3955 | });
|
3956 | }
|
3957 | }
|
3958 | }
|
3959 | Object.defineProperty(WorkspaceChange.prototype, "edit", {
|
3960 | |
3961 |
|
3962 |
|
3963 |
|
3964 | get: function () {
|
3965 | return this._workspaceEdit;
|
3966 | },
|
3967 | enumerable: true,
|
3968 | configurable: true
|
3969 | });
|
3970 | WorkspaceChange.prototype.getTextEditChange = function (key) {
|
3971 | if (VersionedTextDocumentIdentifier.is(key)) {
|
3972 | if (!this._workspaceEdit) {
|
3973 | this._workspaceEdit = {
|
3974 | documentChanges: []
|
3975 | };
|
3976 | }
|
3977 | if (!this._workspaceEdit.documentChanges) {
|
3978 | throw new Error('Workspace edit is not configured for document changes.');
|
3979 | }
|
3980 | var textDocument = key;
|
3981 | var result = this._textEditChanges[textDocument.uri];
|
3982 | if (!result) {
|
3983 | var edits = [];
|
3984 | var textDocumentEdit = {
|
3985 | textDocument: textDocument,
|
3986 | edits: edits
|
3987 | };
|
3988 | this._workspaceEdit.documentChanges.push(textDocumentEdit);
|
3989 | result = new TextEditChangeImpl(edits);
|
3990 | this._textEditChanges[textDocument.uri] = result;
|
3991 | }
|
3992 | return result;
|
3993 | }
|
3994 | else {
|
3995 | if (!this._workspaceEdit) {
|
3996 | this._workspaceEdit = {
|
3997 | changes: Object.create(null)
|
3998 | };
|
3999 | }
|
4000 | if (!this._workspaceEdit.changes) {
|
4001 | throw new Error('Workspace edit is not configured for normal text edit changes.');
|
4002 | }
|
4003 | var result = this._textEditChanges[key];
|
4004 | if (!result) {
|
4005 | var edits = [];
|
4006 | this._workspaceEdit.changes[key] = edits;
|
4007 | result = new TextEditChangeImpl(edits);
|
4008 | this._textEditChanges[key] = result;
|
4009 | }
|
4010 | return result;
|
4011 | }
|
4012 | };
|
4013 | WorkspaceChange.prototype.createFile = function (uri, options) {
|
4014 | this.checkDocumentChanges();
|
4015 | this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));
|
4016 | };
|
4017 | WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {
|
4018 | this.checkDocumentChanges();
|
4019 | this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));
|
4020 | };
|
4021 | WorkspaceChange.prototype.deleteFile = function (uri, options) {
|
4022 | this.checkDocumentChanges();
|
4023 | this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));
|
4024 | };
|
4025 | WorkspaceChange.prototype.checkDocumentChanges = function () {
|
4026 | if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {
|
4027 | throw new Error('Workspace edit is not configured for document changes.');
|
4028 | }
|
4029 | };
|
4030 | return WorkspaceChange;
|
4031 | }());
|
4032 |
|
4033 |
|
4034 |
|
4035 |
|
4036 |
|
4037 | var TextDocumentIdentifier;
|
4038 | (function (TextDocumentIdentifier) {
|
4039 | |
4040 |
|
4041 |
|
4042 |
|
4043 | function create(uri) {
|
4044 | return { uri: uri };
|
4045 | }
|
4046 | TextDocumentIdentifier.create = create;
|
4047 | |
4048 |
|
4049 |
|
4050 | function is(value) {
|
4051 | var candidate = value;
|
4052 | return Is.defined(candidate) && Is.string(candidate.uri);
|
4053 | }
|
4054 | TextDocumentIdentifier.is = is;
|
4055 | })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
|
4056 |
|
4057 |
|
4058 |
|
4059 |
|
4060 | var VersionedTextDocumentIdentifier;
|
4061 | (function (VersionedTextDocumentIdentifier) {
|
4062 | |
4063 |
|
4064 |
|
4065 |
|
4066 |
|
4067 | function create(uri, version) {
|
4068 | return { uri: uri, version: version };
|
4069 | }
|
4070 | VersionedTextDocumentIdentifier.create = create;
|
4071 | |
4072 |
|
4073 |
|
4074 | function is(value) {
|
4075 | var candidate = value;
|
4076 | return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));
|
4077 | }
|
4078 | VersionedTextDocumentIdentifier.is = is;
|
4079 | })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
|
4080 |
|
4081 |
|
4082 |
|
4083 |
|
4084 | var TextDocumentItem;
|
4085 | (function (TextDocumentItem) {
|
4086 | |
4087 |
|
4088 |
|
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 | function create(uri, languageId, version, text) {
|
4094 | return { uri: uri, languageId: languageId, version: version, text: text };
|
4095 | }
|
4096 | TextDocumentItem.create = create;
|
4097 | |
4098 |
|
4099 |
|
4100 | function is(value) {
|
4101 | var candidate = value;
|
4102 | return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);
|
4103 | }
|
4104 | TextDocumentItem.is = is;
|
4105 | })(TextDocumentItem || (TextDocumentItem = {}));
|
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 |
|
4111 |
|
4112 |
|
4113 | var MarkupKind;
|
4114 | (function (MarkupKind) {
|
4115 | |
4116 |
|
4117 |
|
4118 | MarkupKind.PlainText = 'plaintext';
|
4119 | |
4120 |
|
4121 |
|
4122 | MarkupKind.Markdown = 'markdown';
|
4123 | })(MarkupKind || (MarkupKind = {}));
|
4124 | (function (MarkupKind) {
|
4125 | |
4126 |
|
4127 |
|
4128 | function is(value) {
|
4129 | var candidate = value;
|
4130 | return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
|
4131 | }
|
4132 | MarkupKind.is = is;
|
4133 | })(MarkupKind || (MarkupKind = {}));
|
4134 | var MarkupContent;
|
4135 | (function (MarkupContent) {
|
4136 | |
4137 |
|
4138 |
|
4139 | function is(value) {
|
4140 | var candidate = value;
|
4141 | return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
4142 | }
|
4143 | MarkupContent.is = is;
|
4144 | })(MarkupContent || (MarkupContent = {}));
|
4145 |
|
4146 |
|
4147 |
|
4148 | var CompletionItemKind;
|
4149 | (function (CompletionItemKind) {
|
4150 | CompletionItemKind.Text = 1;
|
4151 | CompletionItemKind.Method = 2;
|
4152 | CompletionItemKind.Function = 3;
|
4153 | CompletionItemKind.Constructor = 4;
|
4154 | CompletionItemKind.Field = 5;
|
4155 | CompletionItemKind.Variable = 6;
|
4156 | CompletionItemKind.Class = 7;
|
4157 | CompletionItemKind.Interface = 8;
|
4158 | CompletionItemKind.Module = 9;
|
4159 | CompletionItemKind.Property = 10;
|
4160 | CompletionItemKind.Unit = 11;
|
4161 | CompletionItemKind.Value = 12;
|
4162 | CompletionItemKind.Enum = 13;
|
4163 | CompletionItemKind.Keyword = 14;
|
4164 | CompletionItemKind.Snippet = 15;
|
4165 | CompletionItemKind.Color = 16;
|
4166 | CompletionItemKind.File = 17;
|
4167 | CompletionItemKind.Reference = 18;
|
4168 | CompletionItemKind.Folder = 19;
|
4169 | CompletionItemKind.EnumMember = 20;
|
4170 | CompletionItemKind.Constant = 21;
|
4171 | CompletionItemKind.Struct = 22;
|
4172 | CompletionItemKind.Event = 23;
|
4173 | CompletionItemKind.Operator = 24;
|
4174 | CompletionItemKind.TypeParameter = 25;
|
4175 | })(CompletionItemKind || (CompletionItemKind = {}));
|
4176 |
|
4177 |
|
4178 |
|
4179 |
|
4180 | var InsertTextFormat;
|
4181 | (function (InsertTextFormat) {
|
4182 | |
4183 |
|
4184 |
|
4185 | InsertTextFormat.PlainText = 1;
|
4186 | |
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 |
|
4192 |
|
4193 |
|
4194 |
|
4195 |
|
4196 | InsertTextFormat.Snippet = 2;
|
4197 | })(InsertTextFormat || (InsertTextFormat = {}));
|
4198 |
|
4199 |
|
4200 |
|
4201 |
|
4202 | var CompletionItem;
|
4203 | (function (CompletionItem) {
|
4204 | |
4205 |
|
4206 |
|
4207 |
|
4208 | function create(label) {
|
4209 | return { label: label };
|
4210 | }
|
4211 | CompletionItem.create = create;
|
4212 | })(CompletionItem || (CompletionItem = {}));
|
4213 |
|
4214 |
|
4215 |
|
4216 |
|
4217 | var CompletionList;
|
4218 | (function (CompletionList) {
|
4219 | |
4220 |
|
4221 |
|
4222 |
|
4223 |
|
4224 |
|
4225 | function create(items, isIncomplete) {
|
4226 | return { items: items ? items : [], isIncomplete: !!isIncomplete };
|
4227 | }
|
4228 | CompletionList.create = create;
|
4229 | })(CompletionList || (CompletionList = {}));
|
4230 | var MarkedString;
|
4231 | (function (MarkedString) {
|
4232 | |
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 | function fromPlainText(plainText) {
|
4238 | return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
|
4239 | }
|
4240 | MarkedString.fromPlainText = fromPlainText;
|
4241 | |
4242 |
|
4243 |
|
4244 | function is(value) {
|
4245 | var candidate = value;
|
4246 | return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
|
4247 | }
|
4248 | MarkedString.is = is;
|
4249 | })(MarkedString || (MarkedString = {}));
|
4250 | var Hover;
|
4251 | (function (Hover) {
|
4252 | |
4253 |
|
4254 |
|
4255 | function is(value) {
|
4256 | var candidate = value;
|
4257 | return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
|
4258 | MarkedString.is(candidate.contents) ||
|
4259 | Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
|
4260 | }
|
4261 | Hover.is = is;
|
4262 | })(Hover || (Hover = {}));
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 | var ParameterInformation;
|
4268 | (function (ParameterInformation) {
|
4269 | |
4270 |
|
4271 |
|
4272 |
|
4273 |
|
4274 |
|
4275 | function create(label, documentation) {
|
4276 | return documentation ? { label: label, documentation: documentation } : { label: label };
|
4277 | }
|
4278 | ParameterInformation.create = create;
|
4279 | ;
|
4280 | })(ParameterInformation || (ParameterInformation = {}));
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 | var SignatureInformation;
|
4286 | (function (SignatureInformation) {
|
4287 | function create(label, documentation) {
|
4288 | var parameters = [];
|
4289 | for (var _i = 2; _i < arguments.length; _i++) {
|
4290 | parameters[_i - 2] = arguments[_i];
|
4291 | }
|
4292 | var result = { label: label };
|
4293 | if (Is.defined(documentation)) {
|
4294 | result.documentation = documentation;
|
4295 | }
|
4296 | if (Is.defined(parameters)) {
|
4297 | result.parameters = parameters;
|
4298 | }
|
4299 | else {
|
4300 | result.parameters = [];
|
4301 | }
|
4302 | return result;
|
4303 | }
|
4304 | SignatureInformation.create = create;
|
4305 | })(SignatureInformation || (SignatureInformation = {}));
|
4306 |
|
4307 |
|
4308 |
|
4309 | var DocumentHighlightKind;
|
4310 | (function (DocumentHighlightKind) {
|
4311 | |
4312 |
|
4313 |
|
4314 | DocumentHighlightKind.Text = 1;
|
4315 | |
4316 |
|
4317 |
|
4318 | DocumentHighlightKind.Read = 2;
|
4319 | |
4320 |
|
4321 |
|
4322 | DocumentHighlightKind.Write = 3;
|
4323 | })(DocumentHighlightKind || (DocumentHighlightKind = {}));
|
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 | var DocumentHighlight;
|
4329 | (function (DocumentHighlight) {
|
4330 | |
4331 |
|
4332 |
|
4333 |
|
4334 | function create(range, kind) {
|
4335 | var result = { range: range };
|
4336 | if (Is.number(kind)) {
|
4337 | result.kind = kind;
|
4338 | }
|
4339 | return result;
|
4340 | }
|
4341 | DocumentHighlight.create = create;
|
4342 | })(DocumentHighlight || (DocumentHighlight = {}));
|
4343 |
|
4344 |
|
4345 |
|
4346 | var SymbolKind;
|
4347 | (function (SymbolKind) {
|
4348 | SymbolKind.File = 1;
|
4349 | SymbolKind.Module = 2;
|
4350 | SymbolKind.Namespace = 3;
|
4351 | SymbolKind.Package = 4;
|
4352 | SymbolKind.Class = 5;
|
4353 | SymbolKind.Method = 6;
|
4354 | SymbolKind.Property = 7;
|
4355 | SymbolKind.Field = 8;
|
4356 | SymbolKind.Constructor = 9;
|
4357 | SymbolKind.Enum = 10;
|
4358 | SymbolKind.Interface = 11;
|
4359 | SymbolKind.Function = 12;
|
4360 | SymbolKind.Variable = 13;
|
4361 | SymbolKind.Constant = 14;
|
4362 | SymbolKind.String = 15;
|
4363 | SymbolKind.Number = 16;
|
4364 | SymbolKind.Boolean = 17;
|
4365 | SymbolKind.Array = 18;
|
4366 | SymbolKind.Object = 19;
|
4367 | SymbolKind.Key = 20;
|
4368 | SymbolKind.Null = 21;
|
4369 | SymbolKind.EnumMember = 22;
|
4370 | SymbolKind.Struct = 23;
|
4371 | SymbolKind.Event = 24;
|
4372 | SymbolKind.Operator = 25;
|
4373 | SymbolKind.TypeParameter = 26;
|
4374 | })(SymbolKind || (SymbolKind = {}));
|
4375 | var SymbolInformation;
|
4376 | (function (SymbolInformation) {
|
4377 | |
4378 |
|
4379 |
|
4380 |
|
4381 |
|
4382 |
|
4383 |
|
4384 |
|
4385 |
|
4386 | function create(name, kind, range, uri, containerName) {
|
4387 | var result = {
|
4388 | name: name,
|
4389 | kind: kind,
|
4390 | location: { uri: uri, range: range }
|
4391 | };
|
4392 | if (containerName) {
|
4393 | result.containerName = containerName;
|
4394 | }
|
4395 | return result;
|
4396 | }
|
4397 | SymbolInformation.create = create;
|
4398 | })(SymbolInformation || (SymbolInformation = {}));
|
4399 |
|
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 |
|
4405 | var DocumentSymbol = (function () {
|
4406 | function DocumentSymbol() {
|
4407 | }
|
4408 | return DocumentSymbol;
|
4409 | }());
|
4410 |
|
4411 | (function (DocumentSymbol) {
|
4412 | |
4413 |
|
4414 |
|
4415 |
|
4416 |
|
4417 |
|
4418 |
|
4419 |
|
4420 |
|
4421 |
|
4422 | function create(name, detail, kind, range, selectionRange, children) {
|
4423 | var result = {
|
4424 | name: name,
|
4425 | detail: detail,
|
4426 | kind: kind,
|
4427 | range: range,
|
4428 | selectionRange: selectionRange
|
4429 | };
|
4430 | if (children !== void 0) {
|
4431 | result.children = children;
|
4432 | }
|
4433 | return result;
|
4434 | }
|
4435 | DocumentSymbol.create = create;
|
4436 | |
4437 |
|
4438 |
|
4439 | function is(value) {
|
4440 | var candidate = value;
|
4441 | return candidate &&
|
4442 | Is.string(candidate.name) && Is.number(candidate.kind) &&
|
4443 | Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
|
4444 | (candidate.detail === void 0 || Is.string(candidate.detail)) &&
|
4445 | (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&
|
4446 | (candidate.children === void 0 || Array.isArray(candidate.children));
|
4447 | }
|
4448 | DocumentSymbol.is = is;
|
4449 | })(DocumentSymbol || (DocumentSymbol = {}));
|
4450 |
|
4451 |
|
4452 |
|
4453 | var CodeActionKind;
|
4454 | (function (CodeActionKind) {
|
4455 | |
4456 |
|
4457 |
|
4458 | CodeActionKind.QuickFix = 'quickfix';
|
4459 | |
4460 |
|
4461 |
|
4462 | CodeActionKind.Refactor = 'refactor';
|
4463 | |
4464 |
|
4465 |
|
4466 |
|
4467 |
|
4468 |
|
4469 |
|
4470 |
|
4471 |
|
4472 |
|
4473 |
|
4474 | CodeActionKind.RefactorExtract = 'refactor.extract';
|
4475 | |
4476 |
|
4477 |
|
4478 |
|
4479 |
|
4480 |
|
4481 |
|
4482 |
|
4483 |
|
4484 |
|
4485 | CodeActionKind.RefactorInline = 'refactor.inline';
|
4486 | |
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 |
|
4495 |
|
4496 |
|
4497 |
|
4498 | CodeActionKind.RefactorRewrite = 'refactor.rewrite';
|
4499 | |
4500 |
|
4501 |
|
4502 |
|
4503 |
|
4504 | CodeActionKind.Source = 'source';
|
4505 | |
4506 |
|
4507 |
|
4508 | CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
|
4509 | })(CodeActionKind || (CodeActionKind = {}));
|
4510 |
|
4511 |
|
4512 |
|
4513 |
|
4514 | var CodeActionContext;
|
4515 | (function (CodeActionContext) {
|
4516 | |
4517 |
|
4518 |
|
4519 | function create(diagnostics, only) {
|
4520 | var result = { diagnostics: diagnostics };
|
4521 | if (only !== void 0 && only !== null) {
|
4522 | result.only = only;
|
4523 | }
|
4524 | return result;
|
4525 | }
|
4526 | CodeActionContext.create = create;
|
4527 | |
4528 |
|
4529 |
|
4530 | function is(value) {
|
4531 | var candidate = value;
|
4532 | return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
|
4533 | }
|
4534 | CodeActionContext.is = is;
|
4535 | })(CodeActionContext || (CodeActionContext = {}));
|
4536 | var CodeAction;
|
4537 | (function (CodeAction) {
|
4538 | function create(title, commandOrEdit, kind) {
|
4539 | var result = { title: title };
|
4540 | if (Command.is(commandOrEdit)) {
|
4541 | result.command = commandOrEdit;
|
4542 | }
|
4543 | else {
|
4544 | result.edit = commandOrEdit;
|
4545 | }
|
4546 | if (kind !== void null) {
|
4547 | result.kind = kind;
|
4548 | }
|
4549 | return result;
|
4550 | }
|
4551 | CodeAction.create = create;
|
4552 | function is(value) {
|
4553 | var candidate = value;
|
4554 | return candidate && Is.string(candidate.title) &&
|
4555 | (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
|
4556 | (candidate.kind === void 0 || Is.string(candidate.kind)) &&
|
4557 | (candidate.edit !== void 0 || candidate.command !== void 0) &&
|
4558 | (candidate.command === void 0 || Command.is(candidate.command)) &&
|
4559 | (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
|
4560 | }
|
4561 | CodeAction.is = is;
|
4562 | })(CodeAction || (CodeAction = {}));
|
4563 |
|
4564 |
|
4565 |
|
4566 |
|
4567 | var CodeLens;
|
4568 | (function (CodeLens) {
|
4569 | |
4570 |
|
4571 |
|
4572 | function create(range, data) {
|
4573 | var result = { range: range };
|
4574 | if (Is.defined(data))
|
4575 | result.data = data;
|
4576 | return result;
|
4577 | }
|
4578 | CodeLens.create = create;
|
4579 | |
4580 |
|
4581 |
|
4582 | function is(value) {
|
4583 | var candidate = value;
|
4584 | return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
4585 | }
|
4586 | CodeLens.is = is;
|
4587 | })(CodeLens || (CodeLens = {}));
|
4588 |
|
4589 |
|
4590 |
|
4591 |
|
4592 | var FormattingOptions;
|
4593 | (function (FormattingOptions) {
|
4594 | |
4595 |
|
4596 |
|
4597 | function create(tabSize, insertSpaces) {
|
4598 | return { tabSize: tabSize, insertSpaces: insertSpaces };
|
4599 | }
|
4600 | FormattingOptions.create = create;
|
4601 | |
4602 |
|
4603 |
|
4604 | function is(value) {
|
4605 | var candidate = value;
|
4606 | return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
4607 | }
|
4608 | FormattingOptions.is = is;
|
4609 | })(FormattingOptions || (FormattingOptions = {}));
|
4610 |
|
4611 |
|
4612 |
|
4613 |
|
4614 | var DocumentLink = (function () {
|
4615 | function DocumentLink() {
|
4616 | }
|
4617 | return DocumentLink;
|
4618 | }());
|
4619 |
|
4620 |
|
4621 |
|
4622 |
|
4623 |
|
4624 | (function (DocumentLink) {
|
4625 | |
4626 |
|
4627 |
|
4628 | function create(range, target, data) {
|
4629 | return { range: range, target: target, data: data };
|
4630 | }
|
4631 | DocumentLink.create = create;
|
4632 | |
4633 |
|
4634 |
|
4635 | function is(value) {
|
4636 | var candidate = value;
|
4637 | return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
4638 | }
|
4639 | DocumentLink.is = is;
|
4640 | })(DocumentLink || (DocumentLink = {}));
|
4641 | var EOL = ['\n', '\r\n', '\r'];
|
4642 | var TextDocument;
|
4643 | (function (TextDocument) {
|
4644 | |
4645 |
|
4646 |
|
4647 |
|
4648 |
|
4649 |
|
4650 | function create(uri, languageId, version, content) {
|
4651 | return new FullTextDocument(uri, languageId, version, content);
|
4652 | }
|
4653 | TextDocument.create = create;
|
4654 | |
4655 |
|
4656 |
|
4657 | function is(value) {
|
4658 | var candidate = value;
|
4659 | return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)
|
4660 | && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
|
4661 | }
|
4662 | TextDocument.is = is;
|
4663 | function applyEdits(document, edits) {
|
4664 | var text = document.getText();
|
4665 | var sortedEdits = mergeSort(edits, function (a, b) {
|
4666 | var diff = a.range.start.line - b.range.start.line;
|
4667 | if (diff === 0) {
|
4668 | return a.range.start.character - b.range.start.character;
|
4669 | }
|
4670 | return diff;
|
4671 | });
|
4672 | var lastModifiedOffset = text.length;
|
4673 | for (var i = sortedEdits.length - 1; i >= 0; i--) {
|
4674 | var e = sortedEdits[i];
|
4675 | var startOffset = document.offsetAt(e.range.start);
|
4676 | var endOffset = document.offsetAt(e.range.end);
|
4677 | if (endOffset <= lastModifiedOffset) {
|
4678 | text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
4679 | }
|
4680 | else {
|
4681 | throw new Error('Overlapping edit');
|
4682 | }
|
4683 | lastModifiedOffset = startOffset;
|
4684 | }
|
4685 | return text;
|
4686 | }
|
4687 | TextDocument.applyEdits = applyEdits;
|
4688 | function mergeSort(data, compare) {
|
4689 | if (data.length <= 1) {
|
4690 |
|
4691 | return data;
|
4692 | }
|
4693 | var p = (data.length / 2) | 0;
|
4694 | var left = data.slice(0, p);
|
4695 | var right = data.slice(p);
|
4696 | mergeSort(left, compare);
|
4697 | mergeSort(right, compare);
|
4698 | var leftIdx = 0;
|
4699 | var rightIdx = 0;
|
4700 | var i = 0;
|
4701 | while (leftIdx < left.length && rightIdx < right.length) {
|
4702 | var ret = compare(left[leftIdx], right[rightIdx]);
|
4703 | if (ret <= 0) {
|
4704 |
|
4705 | data[i++] = left[leftIdx++];
|
4706 | }
|
4707 | else {
|
4708 |
|
4709 | data[i++] = right[rightIdx++];
|
4710 | }
|
4711 | }
|
4712 | while (leftIdx < left.length) {
|
4713 | data[i++] = left[leftIdx++];
|
4714 | }
|
4715 | while (rightIdx < right.length) {
|
4716 | data[i++] = right[rightIdx++];
|
4717 | }
|
4718 | return data;
|
4719 | }
|
4720 | })(TextDocument || (TextDocument = {}));
|
4721 |
|
4722 |
|
4723 |
|
4724 | var TextDocumentSaveReason;
|
4725 | (function (TextDocumentSaveReason) {
|
4726 | |
4727 |
|
4728 |
|
4729 |
|
4730 | TextDocumentSaveReason.Manual = 1;
|
4731 | |
4732 |
|
4733 |
|
4734 | TextDocumentSaveReason.AfterDelay = 2;
|
4735 | |
4736 |
|
4737 |
|
4738 | TextDocumentSaveReason.FocusOut = 3;
|
4739 | })(TextDocumentSaveReason || (TextDocumentSaveReason = {}));
|
4740 | var FullTextDocument = (function () {
|
4741 | function FullTextDocument(uri, languageId, version, content) {
|
4742 | this._uri = uri;
|
4743 | this._languageId = languageId;
|
4744 | this._version = version;
|
4745 | this._content = content;
|
4746 | this._lineOffsets = null;
|
4747 | }
|
4748 | Object.defineProperty(FullTextDocument.prototype, "uri", {
|
4749 | get: function () {
|
4750 | return this._uri;
|
4751 | },
|
4752 | enumerable: true,
|
4753 | configurable: true
|
4754 | });
|
4755 | Object.defineProperty(FullTextDocument.prototype, "languageId", {
|
4756 | get: function () {
|
4757 | return this._languageId;
|
4758 | },
|
4759 | enumerable: true,
|
4760 | configurable: true
|
4761 | });
|
4762 | Object.defineProperty(FullTextDocument.prototype, "version", {
|
4763 | get: function () {
|
4764 | return this._version;
|
4765 | },
|
4766 | enumerable: true,
|
4767 | configurable: true
|
4768 | });
|
4769 | FullTextDocument.prototype.getText = function (range) {
|
4770 | if (range) {
|
4771 | var start = this.offsetAt(range.start);
|
4772 | var end = this.offsetAt(range.end);
|
4773 | return this._content.substring(start, end);
|
4774 | }
|
4775 | return this._content;
|
4776 | };
|
4777 | FullTextDocument.prototype.update = function (event, version) {
|
4778 | this._content = event.text;
|
4779 | this._version = version;
|
4780 | this._lineOffsets = null;
|
4781 | };
|
4782 | FullTextDocument.prototype.getLineOffsets = function () {
|
4783 | if (this._lineOffsets === null) {
|
4784 | var lineOffsets = [];
|
4785 | var text = this._content;
|
4786 | var isLineStart = true;
|
4787 | for (var i = 0; i < text.length; i++) {
|
4788 | if (isLineStart) {
|
4789 | lineOffsets.push(i);
|
4790 | isLineStart = false;
|
4791 | }
|
4792 | var ch = text.charAt(i);
|
4793 | isLineStart = (ch === '\r' || ch === '\n');
|
4794 | if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
|
4795 | i++;
|
4796 | }
|
4797 | }
|
4798 | if (isLineStart && text.length > 0) {
|
4799 | lineOffsets.push(text.length);
|
4800 | }
|
4801 | this._lineOffsets = lineOffsets;
|
4802 | }
|
4803 | return this._lineOffsets;
|
4804 | };
|
4805 | FullTextDocument.prototype.positionAt = function (offset) {
|
4806 | offset = Math.max(Math.min(offset, this._content.length), 0);
|
4807 | var lineOffsets = this.getLineOffsets();
|
4808 | var low = 0, high = lineOffsets.length;
|
4809 | if (high === 0) {
|
4810 | return Position.create(0, offset);
|
4811 | }
|
4812 | while (low < high) {
|
4813 | var mid = Math.floor((low + high) / 2);
|
4814 | if (lineOffsets[mid] > offset) {
|
4815 | high = mid;
|
4816 | }
|
4817 | else {
|
4818 | low = mid + 1;
|
4819 | }
|
4820 | }
|
4821 |
|
4822 |
|
4823 | var line = low - 1;
|
4824 | return Position.create(line, offset - lineOffsets[line]);
|
4825 | };
|
4826 | FullTextDocument.prototype.offsetAt = function (position) {
|
4827 | var lineOffsets = this.getLineOffsets();
|
4828 | if (position.line >= lineOffsets.length) {
|
4829 | return this._content.length;
|
4830 | }
|
4831 | else if (position.line < 0) {
|
4832 | return 0;
|
4833 | }
|
4834 | var lineOffset = lineOffsets[position.line];
|
4835 | var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
|
4836 | return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
|
4837 | };
|
4838 | Object.defineProperty(FullTextDocument.prototype, "lineCount", {
|
4839 | get: function () {
|
4840 | return this.getLineOffsets().length;
|
4841 | },
|
4842 | enumerable: true,
|
4843 | configurable: true
|
4844 | });
|
4845 | return FullTextDocument;
|
4846 | }());
|
4847 | var Is;
|
4848 | (function (Is) {
|
4849 | var toString = Object.prototype.toString;
|
4850 | function defined(value) {
|
4851 | return typeof value !== 'undefined';
|
4852 | }
|
4853 | Is.defined = defined;
|
4854 | function undefined(value) {
|
4855 | return typeof value === 'undefined';
|
4856 | }
|
4857 | Is.undefined = undefined;
|
4858 | function boolean(value) {
|
4859 | return value === true || value === false;
|
4860 | }
|
4861 | Is.boolean = boolean;
|
4862 | function string(value) {
|
4863 | return toString.call(value) === '[object String]';
|
4864 | }
|
4865 | Is.string = string;
|
4866 | function number(value) {
|
4867 | return toString.call(value) === '[object Number]';
|
4868 | }
|
4869 | Is.number = number;
|
4870 | function func(value) {
|
4871 | return toString.call(value) === '[object Function]';
|
4872 | }
|
4873 | Is.func = func;
|
4874 | function objectLiteral(value) {
|
4875 |
|
4876 |
|
4877 |
|
4878 | return value !== null && typeof value === 'object';
|
4879 | }
|
4880 | Is.objectLiteral = objectLiteral;
|
4881 | function typedArray(value, check) {
|
4882 | return Array.isArray(value) && value.every(check);
|
4883 | }
|
4884 | Is.typedArray = typedArray;
|
4885 | })(Is || (Is = {}));
|
4886 |
|
4887 |
|
4888 | }),
|
4889 |
|
4890 | (function(module, exports, __webpack_require__) {
|
4891 |
|
4892 | "use strict";
|
4893 |
|
4894 |
|
4895 |
|
4896 |
|
4897 |
|
4898 | Object.defineProperty(exports, "__esModule", { value: true });
|
4899 | const Is = __webpack_require__(22);
|
4900 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
4901 | const protocol_implementation_1 = __webpack_require__(23);
|
4902 | exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest;
|
4903 | const protocol_typeDefinition_1 = __webpack_require__(24);
|
4904 | exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest;
|
4905 | const protocol_workspaceFolders_1 = __webpack_require__(25);
|
4906 | exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest;
|
4907 | exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;
|
4908 | const protocol_configuration_1 = __webpack_require__(26);
|
4909 | exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest;
|
4910 | const protocol_colorProvider_1 = __webpack_require__(27);
|
4911 | exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest;
|
4912 | exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest;
|
4913 | const protocol_foldingRange_1 = __webpack_require__(28);
|
4914 | exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest;
|
4915 | const protocol_declaration_1 = __webpack_require__(29);
|
4916 | exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest;
|
4917 |
|
4918 | let __noDynamicImport;
|
4919 | var DocumentFilter;
|
4920 | (function (DocumentFilter) {
|
4921 | function is(value) {
|
4922 | let candidate = value;
|
4923 | return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);
|
4924 | }
|
4925 | DocumentFilter.is = is;
|
4926 | })(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {}));
|
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 | var RegistrationRequest;
|
4932 | (function (RegistrationRequest) {
|
4933 | RegistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/registerCapability');
|
4934 | })(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {}));
|
4935 |
|
4936 |
|
4937 |
|
4938 |
|
4939 | var UnregistrationRequest;
|
4940 | (function (UnregistrationRequest) {
|
4941 | UnregistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/unregisterCapability');
|
4942 | })(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));
|
4943 | var ResourceOperationKind;
|
4944 | (function (ResourceOperationKind) {
|
4945 | |
4946 |
|
4947 |
|
4948 | ResourceOperationKind.Create = 'create';
|
4949 | |
4950 |
|
4951 |
|
4952 | ResourceOperationKind.Rename = 'rename';
|
4953 | |
4954 |
|
4955 |
|
4956 | ResourceOperationKind.Delete = 'delete';
|
4957 | })(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));
|
4958 | var FailureHandlingKind;
|
4959 | (function (FailureHandlingKind) {
|
4960 | |
4961 |
|
4962 |
|
4963 |
|
4964 | FailureHandlingKind.Abort = 'abort';
|
4965 | |
4966 |
|
4967 |
|
4968 |
|
4969 | FailureHandlingKind.Transactional = 'transactional';
|
4970 | |
4971 |
|
4972 |
|
4973 |
|
4974 |
|
4975 | FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';
|
4976 | |
4977 |
|
4978 |
|
4979 |
|
4980 | FailureHandlingKind.Undo = 'undo';
|
4981 | })(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));
|
4982 |
|
4983 |
|
4984 |
|
4985 |
|
4986 | var TextDocumentSyncKind;
|
4987 | (function (TextDocumentSyncKind) {
|
4988 | |
4989 |
|
4990 |
|
4991 | TextDocumentSyncKind.None = 0;
|
4992 | |
4993 |
|
4994 |
|
4995 |
|
4996 | TextDocumentSyncKind.Full = 1;
|
4997 | |
4998 |
|
4999 |
|
5000 |
|
5001 |
|
5002 | TextDocumentSyncKind.Incremental = 2;
|
5003 | })(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {}));
|
5004 |
|
5005 |
|
5006 |
|
5007 |
|
5008 |
|
5009 |
|
5010 |
|
5011 | var InitializeRequest;
|
5012 | (function (InitializeRequest) {
|
5013 | InitializeRequest.type = new vscode_jsonrpc_1.RequestType('initialize');
|
5014 | })(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {}));
|
5015 |
|
5016 |
|
5017 |
|
5018 | var InitializeError;
|
5019 | (function (InitializeError) {
|
5020 | |
5021 |
|
5022 |
|
5023 |
|
5024 |
|
5025 | InitializeError.unknownProtocolVersion = 1;
|
5026 | })(InitializeError = exports.InitializeError || (exports.InitializeError = {}));
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 |
|
5032 | var InitializedNotification;
|
5033 | (function (InitializedNotification) {
|
5034 | InitializedNotification.type = new vscode_jsonrpc_1.NotificationType('initialized');
|
5035 | })(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {}));
|
5036 |
|
5037 |
|
5038 |
|
5039 |
|
5040 |
|
5041 |
|
5042 |
|
5043 | var ShutdownRequest;
|
5044 | (function (ShutdownRequest) {
|
5045 | ShutdownRequest.type = new vscode_jsonrpc_1.RequestType0('shutdown');
|
5046 | })(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));
|
5047 |
|
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 | var ExitNotification;
|
5053 | (function (ExitNotification) {
|
5054 | ExitNotification.type = new vscode_jsonrpc_1.NotificationType0('exit');
|
5055 | })(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {}));
|
5056 |
|
5057 |
|
5058 |
|
5059 |
|
5060 |
|
5061 |
|
5062 | var DidChangeConfigurationNotification;
|
5063 | (function (DidChangeConfigurationNotification) {
|
5064 | DidChangeConfigurationNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeConfiguration');
|
5065 | })(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {}));
|
5066 |
|
5067 |
|
5068 |
|
5069 |
|
5070 | var MessageType;
|
5071 | (function (MessageType) {
|
5072 | |
5073 |
|
5074 |
|
5075 | MessageType.Error = 1;
|
5076 | |
5077 |
|
5078 |
|
5079 | MessageType.Warning = 2;
|
5080 | |
5081 |
|
5082 |
|
5083 | MessageType.Info = 3;
|
5084 | |
5085 |
|
5086 |
|
5087 | MessageType.Log = 4;
|
5088 | })(MessageType = exports.MessageType || (exports.MessageType = {}));
|
5089 |
|
5090 |
|
5091 |
|
5092 |
|
5093 | var ShowMessageNotification;
|
5094 | (function (ShowMessageNotification) {
|
5095 | ShowMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/showMessage');
|
5096 | })(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {}));
|
5097 |
|
5098 |
|
5099 |
|
5100 |
|
5101 | var ShowMessageRequest;
|
5102 | (function (ShowMessageRequest) {
|
5103 | ShowMessageRequest.type = new vscode_jsonrpc_1.RequestType('window/showMessageRequest');
|
5104 | })(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {}));
|
5105 |
|
5106 |
|
5107 |
|
5108 |
|
5109 | var LogMessageNotification;
|
5110 | (function (LogMessageNotification) {
|
5111 | LogMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/logMessage');
|
5112 | })(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {}));
|
5113 |
|
5114 |
|
5115 |
|
5116 |
|
5117 |
|
5118 | var TelemetryEventNotification;
|
5119 | (function (TelemetryEventNotification) {
|
5120 | TelemetryEventNotification.type = new vscode_jsonrpc_1.NotificationType('telemetry/event');
|
5121 | })(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {}));
|
5122 |
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 | var DidOpenTextDocumentNotification;
|
5133 | (function (DidOpenTextDocumentNotification) {
|
5134 | DidOpenTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didOpen');
|
5135 | })(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {}));
|
5136 |
|
5137 |
|
5138 |
|
5139 |
|
5140 | var DidChangeTextDocumentNotification;
|
5141 | (function (DidChangeTextDocumentNotification) {
|
5142 | DidChangeTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didChange');
|
5143 | })(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {}));
|
5144 |
|
5145 |
|
5146 |
|
5147 |
|
5148 |
|
5149 |
|
5150 |
|
5151 |
|
5152 |
|
5153 | var DidCloseTextDocumentNotification;
|
5154 | (function (DidCloseTextDocumentNotification) {
|
5155 | DidCloseTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didClose');
|
5156 | })(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {}));
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 | var DidSaveTextDocumentNotification;
|
5162 | (function (DidSaveTextDocumentNotification) {
|
5163 | DidSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didSave');
|
5164 | })(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {}));
|
5165 |
|
5166 |
|
5167 |
|
5168 |
|
5169 | var WillSaveTextDocumentNotification;
|
5170 | (function (WillSaveTextDocumentNotification) {
|
5171 | WillSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/willSave');
|
5172 | })(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {}));
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 |
|
5178 |
|
5179 |
|
5180 |
|
5181 | var WillSaveTextDocumentWaitUntilRequest;
|
5182 | (function (WillSaveTextDocumentWaitUntilRequest) {
|
5183 | WillSaveTextDocumentWaitUntilRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/willSaveWaitUntil');
|
5184 | })(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {}));
|
5185 |
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 | var DidChangeWatchedFilesNotification;
|
5191 | (function (DidChangeWatchedFilesNotification) {
|
5192 | DidChangeWatchedFilesNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWatchedFiles');
|
5193 | })(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {}));
|
5194 |
|
5195 |
|
5196 |
|
5197 | var FileChangeType;
|
5198 | (function (FileChangeType) {
|
5199 | |
5200 |
|
5201 |
|
5202 | FileChangeType.Created = 1;
|
5203 | |
5204 |
|
5205 |
|
5206 | FileChangeType.Changed = 2;
|
5207 | |
5208 |
|
5209 |
|
5210 | FileChangeType.Deleted = 3;
|
5211 | })(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {}));
|
5212 | var WatchKind;
|
5213 | (function (WatchKind) {
|
5214 | |
5215 |
|
5216 |
|
5217 | WatchKind.Create = 1;
|
5218 | |
5219 |
|
5220 |
|
5221 | WatchKind.Change = 2;
|
5222 | |
5223 |
|
5224 |
|
5225 | WatchKind.Delete = 4;
|
5226 | })(WatchKind = exports.WatchKind || (exports.WatchKind = {}));
|
5227 |
|
5228 |
|
5229 |
|
5230 |
|
5231 |
|
5232 | var PublishDiagnosticsNotification;
|
5233 | (function (PublishDiagnosticsNotification) {
|
5234 | PublishDiagnosticsNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/publishDiagnostics');
|
5235 | })(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {}));
|
5236 |
|
5237 |
|
5238 |
|
5239 | var CompletionTriggerKind;
|
5240 | (function (CompletionTriggerKind) {
|
5241 | |
5242 |
|
5243 |
|
5244 |
|
5245 | CompletionTriggerKind.Invoked = 1;
|
5246 | |
5247 |
|
5248 |
|
5249 |
|
5250 | CompletionTriggerKind.TriggerCharacter = 2;
|
5251 | |
5252 |
|
5253 |
|
5254 | CompletionTriggerKind.TriggerForIncompleteCompletions = 3;
|
5255 | })(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {}));
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 | var CompletionRequest;
|
5268 | (function (CompletionRequest) {
|
5269 | CompletionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/completion');
|
5270 | })(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 | var CompletionResolveRequest;
|
5277 | (function (CompletionResolveRequest) {
|
5278 | CompletionResolveRequest.type = new vscode_jsonrpc_1.RequestType('completionItem/resolve');
|
5279 | })(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));
|
5280 |
|
5281 |
|
5282 |
|
5283 |
|
5284 |
|
5285 |
|
5286 | var HoverRequest;
|
5287 | (function (HoverRequest) {
|
5288 | HoverRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/hover');
|
5289 | })(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));
|
5290 | var SignatureHelpRequest;
|
5291 | (function (SignatureHelpRequest) {
|
5292 | SignatureHelpRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/signatureHelp');
|
5293 | })(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));
|
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 |
|
5299 |
|
5300 |
|
5301 |
|
5302 | var DefinitionRequest;
|
5303 | (function (DefinitionRequest) {
|
5304 | DefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/definition');
|
5305 | })(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));
|
5306 |
|
5307 |
|
5308 |
|
5309 |
|
5310 |
|
5311 |
|
5312 | var ReferencesRequest;
|
5313 | (function (ReferencesRequest) {
|
5314 | ReferencesRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/references');
|
5315 | })(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {}));
|
5316 |
|
5317 |
|
5318 |
|
5319 |
|
5320 |
|
5321 |
|
5322 |
|
5323 | var DocumentHighlightRequest;
|
5324 | (function (DocumentHighlightRequest) {
|
5325 | DocumentHighlightRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentHighlight');
|
5326 | })(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {}));
|
5327 |
|
5328 |
|
5329 |
|
5330 |
|
5331 |
|
5332 |
|
5333 |
|
5334 | var DocumentSymbolRequest;
|
5335 | (function (DocumentSymbolRequest) {
|
5336 | DocumentSymbolRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentSymbol');
|
5337 | })(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));
|
5338 |
|
5339 |
|
5340 |
|
5341 |
|
5342 |
|
5343 |
|
5344 |
|
5345 | var WorkspaceSymbolRequest;
|
5346 | (function (WorkspaceSymbolRequest) {
|
5347 | WorkspaceSymbolRequest.type = new vscode_jsonrpc_1.RequestType('workspace/symbol');
|
5348 | })(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {}));
|
5349 |
|
5350 |
|
5351 |
|
5352 | var CodeActionRequest;
|
5353 | (function (CodeActionRequest) {
|
5354 | CodeActionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeAction');
|
5355 | })(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {}));
|
5356 |
|
5357 |
|
5358 |
|
5359 | var CodeLensRequest;
|
5360 | (function (CodeLensRequest) {
|
5361 | CodeLensRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeLens');
|
5362 | })(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {}));
|
5363 |
|
5364 |
|
5365 |
|
5366 | var CodeLensResolveRequest;
|
5367 | (function (CodeLensResolveRequest) {
|
5368 | CodeLensResolveRequest.type = new vscode_jsonrpc_1.RequestType('codeLens/resolve');
|
5369 | })(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {}));
|
5370 |
|
5371 |
|
5372 |
|
5373 | var DocumentFormattingRequest;
|
5374 | (function (DocumentFormattingRequest) {
|
5375 | DocumentFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/formatting');
|
5376 | })(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {}));
|
5377 |
|
5378 |
|
5379 |
|
5380 | var DocumentRangeFormattingRequest;
|
5381 | (function (DocumentRangeFormattingRequest) {
|
5382 | DocumentRangeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rangeFormatting');
|
5383 | })(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {}));
|
5384 |
|
5385 |
|
5386 |
|
5387 | var DocumentOnTypeFormattingRequest;
|
5388 | (function (DocumentOnTypeFormattingRequest) {
|
5389 | DocumentOnTypeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/onTypeFormatting');
|
5390 | })(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {}));
|
5391 |
|
5392 |
|
5393 |
|
5394 | var RenameRequest;
|
5395 | (function (RenameRequest) {
|
5396 | RenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rename');
|
5397 | })(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {}));
|
5398 |
|
5399 |
|
5400 |
|
5401 | var PrepareRenameRequest;
|
5402 | (function (PrepareRenameRequest) {
|
5403 | PrepareRenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/prepareRename');
|
5404 | })(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {}));
|
5405 |
|
5406 |
|
5407 |
|
5408 | var DocumentLinkRequest;
|
5409 | (function (DocumentLinkRequest) {
|
5410 | DocumentLinkRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentLink');
|
5411 | })(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {}));
|
5412 |
|
5413 |
|
5414 |
|
5415 |
|
5416 |
|
5417 | var DocumentLinkResolveRequest;
|
5418 | (function (DocumentLinkResolveRequest) {
|
5419 | DocumentLinkResolveRequest.type = new vscode_jsonrpc_1.RequestType('documentLink/resolve');
|
5420 | })(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {}));
|
5421 |
|
5422 |
|
5423 |
|
5424 |
|
5425 | var ExecuteCommandRequest;
|
5426 | (function (ExecuteCommandRequest) {
|
5427 | ExecuteCommandRequest.type = new vscode_jsonrpc_1.RequestType('workspace/executeCommand');
|
5428 | })(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {}));
|
5429 |
|
5430 |
|
5431 |
|
5432 | var ApplyWorkspaceEditRequest;
|
5433 | (function (ApplyWorkspaceEditRequest) {
|
5434 | ApplyWorkspaceEditRequest.type = new vscode_jsonrpc_1.RequestType('workspace/applyEdit');
|
5435 | })(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {}));
|
5436 |
|
5437 |
|
5438 | }),
|
5439 |
|
5440 | (function(module, exports, __webpack_require__) {
|
5441 |
|
5442 | "use strict";
|
5443 |
|
5444 |
|
5445 |
|
5446 |
|
5447 |
|
5448 | Object.defineProperty(exports, "__esModule", { value: true });
|
5449 | function boolean(value) {
|
5450 | return value === true || value === false;
|
5451 | }
|
5452 | exports.boolean = boolean;
|
5453 | function string(value) {
|
5454 | return typeof value === 'string' || value instanceof String;
|
5455 | }
|
5456 | exports.string = string;
|
5457 | function number(value) {
|
5458 | return typeof value === 'number' || value instanceof Number;
|
5459 | }
|
5460 | exports.number = number;
|
5461 | function error(value) {
|
5462 | return value instanceof Error;
|
5463 | }
|
5464 | exports.error = error;
|
5465 | function func(value) {
|
5466 | return typeof value === 'function';
|
5467 | }
|
5468 | exports.func = func;
|
5469 | function array(value) {
|
5470 | return Array.isArray(value);
|
5471 | }
|
5472 | exports.array = array;
|
5473 | function stringArray(value) {
|
5474 | return array(value) && value.every(elem => string(elem));
|
5475 | }
|
5476 | exports.stringArray = stringArray;
|
5477 | function typedArray(value, check) {
|
5478 | return Array.isArray(value) && value.every(check);
|
5479 | }
|
5480 | exports.typedArray = typedArray;
|
5481 | function thenable(value) {
|
5482 | return value && func(value.then);
|
5483 | }
|
5484 | exports.thenable = thenable;
|
5485 |
|
5486 |
|
5487 | }),
|
5488 |
|
5489 | (function(module, exports, __webpack_require__) {
|
5490 |
|
5491 | "use strict";
|
5492 |
|
5493 |
|
5494 |
|
5495 |
|
5496 |
|
5497 | Object.defineProperty(exports, "__esModule", { value: true });
|
5498 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
5499 |
|
5500 | let __noDynamicImport;
|
5501 |
|
5502 |
|
5503 |
|
5504 |
|
5505 |
|
5506 |
|
5507 | var ImplementationRequest;
|
5508 | (function (ImplementationRequest) {
|
5509 | ImplementationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/implementation');
|
5510 | })(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {}));
|
5511 |
|
5512 |
|
5513 | }),
|
5514 |
|
5515 | (function(module, exports, __webpack_require__) {
|
5516 |
|
5517 | "use strict";
|
5518 |
|
5519 |
|
5520 |
|
5521 |
|
5522 |
|
5523 | Object.defineProperty(exports, "__esModule", { value: true });
|
5524 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
5525 |
|
5526 | let __noDynamicImport;
|
5527 |
|
5528 |
|
5529 |
|
5530 |
|
5531 |
|
5532 |
|
5533 | var TypeDefinitionRequest;
|
5534 | (function (TypeDefinitionRequest) {
|
5535 | TypeDefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/typeDefinition');
|
5536 | })(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));
|
5537 |
|
5538 |
|
5539 | }),
|
5540 |
|
5541 | (function(module, exports, __webpack_require__) {
|
5542 |
|
5543 | "use strict";
|
5544 |
|
5545 |
|
5546 |
|
5547 |
|
5548 |
|
5549 | Object.defineProperty(exports, "__esModule", { value: true });
|
5550 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
5551 |
|
5552 |
|
5553 |
|
5554 | var WorkspaceFoldersRequest;
|
5555 | (function (WorkspaceFoldersRequest) {
|
5556 | WorkspaceFoldersRequest.type = new vscode_jsonrpc_1.RequestType0('workspace/workspaceFolders');
|
5557 | })(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {}));
|
5558 |
|
5559 |
|
5560 |
|
5561 |
|
5562 | var DidChangeWorkspaceFoldersNotification;
|
5563 | (function (DidChangeWorkspaceFoldersNotification) {
|
5564 | DidChangeWorkspaceFoldersNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWorkspaceFolders');
|
5565 | })(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {}));
|
5566 |
|
5567 |
|
5568 | }),
|
5569 |
|
5570 | (function(module, exports, __webpack_require__) {
|
5571 |
|
5572 | "use strict";
|
5573 |
|
5574 |
|
5575 |
|
5576 |
|
5577 |
|
5578 | Object.defineProperty(exports, "__esModule", { value: true });
|
5579 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
5580 |
|
5581 |
|
5582 |
|
5583 |
|
5584 |
|
5585 |
|
5586 |
|
5587 |
|
5588 |
|
5589 | var ConfigurationRequest;
|
5590 | (function (ConfigurationRequest) {
|
5591 | ConfigurationRequest.type = new vscode_jsonrpc_1.RequestType('workspace/configuration');
|
5592 | })(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {}));
|
5593 |
|
5594 |
|
5595 | }),
|
5596 |
|
5597 | (function(module, exports, __webpack_require__) {
|
5598 |
|
5599 | "use strict";
|
5600 |
|
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 | Object.defineProperty(exports, "__esModule", { value: true });
|
5606 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
5607 |
|
5608 |
|
5609 |
|
5610 |
|
5611 |
|
5612 |
|
5613 | var DocumentColorRequest;
|
5614 | (function (DocumentColorRequest) {
|
5615 | DocumentColorRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentColor');
|
5616 | })(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {}));
|
5617 |
|
5618 |
|
5619 |
|
5620 |
|
5621 |
|
5622 |
|
5623 | var ColorPresentationRequest;
|
5624 | (function (ColorPresentationRequest) {
|
5625 | ColorPresentationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/colorPresentation');
|
5626 | })(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {}));
|
5627 |
|
5628 |
|
5629 | }),
|
5630 |
|
5631 | (function(module, exports, __webpack_require__) {
|
5632 |
|
5633 | "use strict";
|
5634 |
|
5635 |
|
5636 |
|
5637 |
|
5638 |
|
5639 | Object.defineProperty(exports, "__esModule", { value: true });
|
5640 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
5641 |
|
5642 |
|
5643 |
|
5644 | var FoldingRangeKind;
|
5645 | (function (FoldingRangeKind) {
|
5646 | |
5647 |
|
5648 |
|
5649 | FoldingRangeKind["Comment"] = "comment";
|
5650 | |
5651 |
|
5652 |
|
5653 | FoldingRangeKind["Imports"] = "imports";
|
5654 | |
5655 |
|
5656 |
|
5657 | FoldingRangeKind["Region"] = "region";
|
5658 | })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
|
5659 |
|
5660 |
|
5661 |
|
5662 |
|
5663 |
|
5664 |
|
5665 | var FoldingRangeRequest;
|
5666 | (function (FoldingRangeRequest) {
|
5667 | FoldingRangeRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/foldingRange');
|
5668 | })(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {}));
|
5669 |
|
5670 |
|
5671 | }),
|
5672 |
|
5673 | (function(module, exports, __webpack_require__) {
|
5674 |
|
5675 | "use strict";
|
5676 |
|
5677 |
|
5678 |
|
5679 |
|
5680 |
|
5681 | Object.defineProperty(exports, "__esModule", { value: true });
|
5682 | const vscode_jsonrpc_1 = __webpack_require__(6);
|
5683 |
|
5684 | let __noDynamicImport;
|
5685 |
|
5686 |
|
5687 |
|
5688 |
|
5689 |
|
5690 |
|
5691 |
|
5692 | var DeclarationRequest;
|
5693 | (function (DeclarationRequest) {
|
5694 | DeclarationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/declaration');
|
5695 | })(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {}));
|
5696 |
|
5697 |
|
5698 | }),
|
5699 |
|
5700 | (function(module, exports, __webpack_require__) {
|
5701 |
|
5702 | "use strict";
|
5703 |
|
5704 |
|
5705 |
|
5706 |
|
5707 |
|
5708 | Object.defineProperty(exports, "__esModule", { value: true });
|
5709 | const vscode_languageserver_protocol_1 = __webpack_require__(5);
|
5710 | const Is = __webpack_require__(31);
|
5711 | exports.ConfigurationFeature = (Base) => {
|
5712 | return class extends Base {
|
5713 | getConfiguration(arg) {
|
5714 | if (!arg) {
|
5715 | return this._getConfiguration({});
|
5716 | }
|
5717 | else if (Is.string(arg)) {
|
5718 | return this._getConfiguration({ section: arg });
|
5719 | }
|
5720 | else {
|
5721 | return this._getConfiguration(arg);
|
5722 | }
|
5723 | }
|
5724 | _getConfiguration(arg) {
|
5725 | let params = {
|
5726 | items: Array.isArray(arg) ? arg : [arg]
|
5727 | };
|
5728 | return this.connection.sendRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, params).then((result) => {
|
5729 | return Array.isArray(arg) ? result : result[0];
|
5730 | });
|
5731 | }
|
5732 | };
|
5733 | };
|
5734 |
|
5735 |
|
5736 | }),
|
5737 |
|
5738 | (function(module, exports, __webpack_require__) {
|
5739 |
|
5740 | "use strict";
|
5741 |
|
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 | Object.defineProperty(exports, "__esModule", { value: true });
|
5747 | function boolean(value) {
|
5748 | return value === true || value === false;
|
5749 | }
|
5750 | exports.boolean = boolean;
|
5751 | function string(value) {
|
5752 | return typeof value === 'string' || value instanceof String;
|
5753 | }
|
5754 | exports.string = string;
|
5755 | function number(value) {
|
5756 | return typeof value === 'number' || value instanceof Number;
|
5757 | }
|
5758 | exports.number = number;
|
5759 | function error(value) {
|
5760 | return value instanceof Error;
|
5761 | }
|
5762 | exports.error = error;
|
5763 | function func(value) {
|
5764 | return typeof value === 'function';
|
5765 | }
|
5766 | exports.func = func;
|
5767 | function array(value) {
|
5768 | return Array.isArray(value);
|
5769 | }
|
5770 | exports.array = array;
|
5771 | function stringArray(value) {
|
5772 | return array(value) && value.every(elem => string(elem));
|
5773 | }
|
5774 | exports.stringArray = stringArray;
|
5775 | function typedArray(value, check) {
|
5776 | return Array.isArray(value) && value.every(check);
|
5777 | }
|
5778 | exports.typedArray = typedArray;
|
5779 | function thenable(value) {
|
5780 | return value && func(value.then);
|
5781 | }
|
5782 | exports.thenable = thenable;
|
5783 |
|
5784 |
|
5785 | }),
|
5786 |
|
5787 | (function(module, exports, __webpack_require__) {
|
5788 |
|
5789 | "use strict";
|
5790 |
|
5791 |
|
5792 |
|
5793 |
|
5794 |
|
5795 | Object.defineProperty(exports, "__esModule", { value: true });
|
5796 | const vscode_languageserver_protocol_1 = __webpack_require__(5);
|
5797 | exports.WorkspaceFoldersFeature = (Base) => {
|
5798 | return class extends Base {
|
5799 | initialize(capabilities) {
|
5800 | let workspaceCapabilities = capabilities.workspace;
|
5801 | if (workspaceCapabilities && workspaceCapabilities.workspaceFolders) {
|
5802 | this._onDidChangeWorkspaceFolders = new vscode_languageserver_protocol_1.Emitter();
|
5803 | this.connection.onNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, (params) => {
|
5804 | this._onDidChangeWorkspaceFolders.fire(params.event);
|
5805 | });
|
5806 | }
|
5807 | }
|
5808 | getWorkspaceFolders() {
|
5809 | return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type);
|
5810 | }
|
5811 | get onDidChangeWorkspaceFolders() {
|
5812 | if (!this._onDidChangeWorkspaceFolders) {
|
5813 | throw new Error('Client doesn\'t support sending workspace folder change events.');
|
5814 | }
|
5815 | if (!this._unregistration) {
|
5816 | this._unregistration = this.connection.client.register(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type);
|
5817 | }
|
5818 | return this._onDidChangeWorkspaceFolders.event;
|
5819 | }
|
5820 | };
|
5821 | };
|
5822 |
|
5823 |
|
5824 | }),
|
5825 |
|
5826 | (function(module, exports, __webpack_require__) {
|
5827 |
|
5828 | "use strict";
|
5829 |
|
5830 |
|
5831 |
|
5832 |
|
5833 |
|
5834 | Object.defineProperty(exports, "__esModule", { value: true });
|
5835 | class ValueUUID {
|
5836 | constructor(_value) {
|
5837 | this._value = _value;
|
5838 |
|
5839 | }
|
5840 | asHex() {
|
5841 | return this._value;
|
5842 | }
|
5843 | equals(other) {
|
5844 | return this.asHex() === other.asHex();
|
5845 | }
|
5846 | }
|
5847 | class V4UUID extends ValueUUID {
|
5848 | constructor() {
|
5849 | super([
|
5850 | V4UUID._randomHex(),
|
5851 | V4UUID._randomHex(),
|
5852 | V4UUID._randomHex(),
|
5853 | V4UUID._randomHex(),
|
5854 | V4UUID._randomHex(),
|
5855 | V4UUID._randomHex(),
|
5856 | V4UUID._randomHex(),
|
5857 | V4UUID._randomHex(),
|
5858 | '-',
|
5859 | V4UUID._randomHex(),
|
5860 | V4UUID._randomHex(),
|
5861 | V4UUID._randomHex(),
|
5862 | V4UUID._randomHex(),
|
5863 | '-',
|
5864 | '4',
|
5865 | V4UUID._randomHex(),
|
5866 | V4UUID._randomHex(),
|
5867 | V4UUID._randomHex(),
|
5868 | '-',
|
5869 | V4UUID._oneOf(V4UUID._timeHighBits),
|
5870 | V4UUID._randomHex(),
|
5871 | V4UUID._randomHex(),
|
5872 | V4UUID._randomHex(),
|
5873 | '-',
|
5874 | V4UUID._randomHex(),
|
5875 | V4UUID._randomHex(),
|
5876 | V4UUID._randomHex(),
|
5877 | V4UUID._randomHex(),
|
5878 | V4UUID._randomHex(),
|
5879 | V4UUID._randomHex(),
|
5880 | V4UUID._randomHex(),
|
5881 | V4UUID._randomHex(),
|
5882 | V4UUID._randomHex(),
|
5883 | V4UUID._randomHex(),
|
5884 | V4UUID._randomHex(),
|
5885 | V4UUID._randomHex(),
|
5886 | ].join(''));
|
5887 | }
|
5888 | static _oneOf(array) {
|
5889 | return array[Math.floor(array.length * Math.random())];
|
5890 | }
|
5891 | static _randomHex() {
|
5892 | return V4UUID._oneOf(V4UUID._chars);
|
5893 | }
|
5894 | }
|
5895 | V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
|
5896 | V4UUID._timeHighBits = ['8', '9', 'a', 'b'];
|
5897 |
|
5898 |
|
5899 |
|
5900 | exports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000');
|
5901 | function v4() {
|
5902 | return new V4UUID();
|
5903 | }
|
5904 | exports.v4 = v4;
|
5905 | const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
5906 | function isUUID(value) {
|
5907 | return _UUIDPattern.test(value);
|
5908 | }
|
5909 | exports.isUUID = isUUID;
|
5910 |
|
5911 |
|
5912 |
|
5913 |
|
5914 | function parse(value) {
|
5915 | if (!isUUID(value)) {
|
5916 | throw new Error('invalid uuid');
|
5917 | }
|
5918 | return new ValueUUID(value);
|
5919 | }
|
5920 | exports.parse = parse;
|
5921 | function generateUuid() {
|
5922 | return v4().asHex();
|
5923 | }
|
5924 | exports.generateUuid = generateUuid;
|
5925 |
|
5926 |
|
5927 | }),
|
5928 |
|
5929 | (function(module, exports, __webpack_require__) {
|
5930 |
|
5931 | "use strict";
|
5932 |
|
5933 |
|
5934 |
|
5935 |
|
5936 |
|
5937 | Object.defineProperty(exports, "__esModule", { value: true });
|
5938 | const url = __webpack_require__(35);
|
5939 | const path = __webpack_require__(15);
|
5940 | const fs = __webpack_require__(36);
|
5941 | const child_process_1 = __webpack_require__(37);
|
5942 |
|
5943 |
|
5944 |
|
5945 |
|
5946 | function uriToFilePath(uri) {
|
5947 | let parsed = url.parse(uri);
|
5948 | if (parsed.protocol !== 'file:' || !parsed.path) {
|
5949 | return undefined;
|
5950 | }
|
5951 | let segments = parsed.path.split('/');
|
5952 | for (var i = 0, len = segments.length; i < len; i++) {
|
5953 | segments[i] = decodeURIComponent(segments[i]);
|
5954 | }
|
5955 | if (process.platform === 'win32' && segments.length > 1) {
|
5956 | let first = segments[0];
|
5957 | let second = segments[1];
|
5958 |
|
5959 |
|
5960 | if (first.length === 0 && second.length > 1 && second[1] === ':') {
|
5961 |
|
5962 | segments.shift();
|
5963 | }
|
5964 | }
|
5965 | return path.normalize(segments.join('/'));
|
5966 | }
|
5967 | exports.uriToFilePath = uriToFilePath;
|
5968 | function isWindows() {
|
5969 | return process.platform === 'win32';
|
5970 | }
|
5971 | function resolveModule(workspaceRoot, moduleName) {
|
5972 | let nodePathKey = 'NODE_PATH';
|
5973 | return new Promise((resolve, reject) => {
|
5974 | let nodePath = [];
|
5975 | if (workspaceRoot) {
|
5976 | nodePath.push(path.join(workspaceRoot, 'node_modules'));
|
5977 | }
|
5978 | child_process_1.exec('npm config get prefix', (error, stdout, _stderr) => {
|
5979 | if (!error) {
|
5980 | let globalPath = stdout.replace(/[\s\r\n]+$/, '');
|
5981 | if (globalPath.length > 0) {
|
5982 | if (isWindows()) {
|
5983 | nodePath.push(path.join(globalPath, 'node_modules'));
|
5984 | }
|
5985 | else {
|
5986 | nodePath.push(path.join(globalPath, 'lib', 'node_modules'));
|
5987 | }
|
5988 | }
|
5989 | }
|
5990 | let separator = isWindows() ? ';' : ':';
|
5991 | let env = process.env;
|
5992 | let newEnv = Object.create(null);
|
5993 | Object.keys(env).forEach(key => newEnv[key] = env[key]);
|
5994 | if (newEnv[nodePathKey]) {
|
5995 | newEnv[nodePathKey] = nodePath.join(separator) + separator + newEnv[nodePathKey];
|
5996 | }
|
5997 | else {
|
5998 | newEnv[nodePathKey] = nodePath.join(separator);
|
5999 | }
|
6000 | newEnv['ELECTRON_RUN_AS_NODE'] = '1';
|
6001 | try {
|
6002 | let cp = child_process_1.fork(path.join(__dirname, 'resolve.js'), [], { env: newEnv, execArgv: [] });
|
6003 | if (cp.pid === void 0) {
|
6004 | reject(new Error(`Starting process to resolve node module ${moduleName} failed`));
|
6005 | return;
|
6006 | }
|
6007 | cp.on('message', (message) => {
|
6008 | if (message.command === 'resolve') {
|
6009 | let toRequire = moduleName;
|
6010 | if (message.success) {
|
6011 | toRequire = message.result;
|
6012 | }
|
6013 | cp.send({ command: 'exit' });
|
6014 | try {
|
6015 | resolve(__webpack_require__(38)(toRequire));
|
6016 | }
|
6017 | catch (error) {
|
6018 | reject(error);
|
6019 | }
|
6020 | }
|
6021 | });
|
6022 | let message = {
|
6023 | command: 'resolve',
|
6024 | args: moduleName
|
6025 | };
|
6026 | cp.send(message);
|
6027 | }
|
6028 | catch (error) {
|
6029 | reject(error);
|
6030 | }
|
6031 | });
|
6032 | });
|
6033 | }
|
6034 | exports.resolveModule = resolveModule;
|
6035 | function resolve(moduleName, nodePath, cwd, tracer) {
|
6036 | const nodePathKey = 'NODE_PATH';
|
6037 | const app = [
|
6038 | "var p = process;",
|
6039 | "p.on('message',function(m){",
|
6040 | "if(m.c==='e'){",
|
6041 | "p.exit(0);",
|
6042 | "}",
|
6043 | "else if(m.c==='rs'){",
|
6044 | "try{",
|
6045 | "var r=require.resolve(m.a);",
|
6046 | "p.send({c:'r',s:true,r:r});",
|
6047 | "}",
|
6048 | "catch(err){",
|
6049 | "p.send({c:'r',s:false});",
|
6050 | "}",
|
6051 | "}",
|
6052 | "});"
|
6053 | ].join('');
|
6054 | return new Promise((resolve, reject) => {
|
6055 | let env = process.env;
|
6056 | let newEnv = Object.create(null);
|
6057 | Object.keys(env).forEach(key => newEnv[key] = env[key]);
|
6058 | if (nodePath) {
|
6059 | if (newEnv[nodePathKey]) {
|
6060 | newEnv[nodePathKey] = nodePath + path.delimiter + newEnv[nodePathKey];
|
6061 | }
|
6062 | else {
|
6063 | newEnv[nodePathKey] = nodePath;
|
6064 | }
|
6065 | if (tracer) {
|
6066 | tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`);
|
6067 | }
|
6068 | }
|
6069 | newEnv['ELECTRON_RUN_AS_NODE'] = '1';
|
6070 | try {
|
6071 | let cp = child_process_1.fork('', [], {
|
6072 | cwd: cwd,
|
6073 | env: newEnv,
|
6074 | execArgv: ['-e', app]
|
6075 | });
|
6076 | if (cp.pid === void 0) {
|
6077 | reject(new Error(`Starting process to resolve node module ${moduleName} failed`));
|
6078 | return;
|
6079 | }
|
6080 | cp.on('error', (error) => {
|
6081 | reject(error);
|
6082 | });
|
6083 | cp.on('message', (message) => {
|
6084 | if (message.c === 'r') {
|
6085 | cp.send({ c: 'e' });
|
6086 | if (message.s) {
|
6087 | resolve(message.r);
|
6088 | }
|
6089 | else {
|
6090 | reject(new Error(`Failed to resolve module: ${moduleName}`));
|
6091 | }
|
6092 | }
|
6093 | });
|
6094 | let message = {
|
6095 | c: 'rs',
|
6096 | a: moduleName
|
6097 | };
|
6098 | cp.send(message);
|
6099 | }
|
6100 | catch (error) {
|
6101 | reject(error);
|
6102 | }
|
6103 | });
|
6104 | }
|
6105 | exports.resolve = resolve;
|
6106 | function resolveGlobalNodePath(tracer) {
|
6107 | let npmCommand = 'npm';
|
6108 | let options = {
|
6109 | encoding: 'utf8'
|
6110 | };
|
6111 | if (isWindows()) {
|
6112 | npmCommand = 'npm.cmd';
|
6113 | options.shell = true;
|
6114 | }
|
6115 | let handler = () => { };
|
6116 | try {
|
6117 | process.on('SIGPIPE', handler);
|
6118 | let stdout = child_process_1.spawnSync(npmCommand, ['config', 'get', 'prefix'], options).stdout;
|
6119 | if (!stdout) {
|
6120 | if (tracer) {
|
6121 | tracer(`'npm config get prefix' didn't return a value.`);
|
6122 | }
|
6123 | return undefined;
|
6124 | }
|
6125 | let prefix = stdout.trim();
|
6126 | if (tracer) {
|
6127 | tracer(`'npm config get prefix' value is: ${prefix}`);
|
6128 | }
|
6129 | if (prefix.length > 0) {
|
6130 | if (isWindows()) {
|
6131 | return path.join(prefix, 'node_modules');
|
6132 | }
|
6133 | else {
|
6134 | return path.join(prefix, 'lib', 'node_modules');
|
6135 | }
|
6136 | }
|
6137 | return undefined;
|
6138 | }
|
6139 | catch (err) {
|
6140 | return undefined;
|
6141 | }
|
6142 | finally {
|
6143 | process.removeListener('SIGPIPE', handler);
|
6144 | }
|
6145 | }
|
6146 | exports.resolveGlobalNodePath = resolveGlobalNodePath;
|
6147 | function resolveGlobalYarnPath(tracer) {
|
6148 | let yarnCommand = 'yarn';
|
6149 | let options = {
|
6150 | encoding: 'utf8'
|
6151 | };
|
6152 | if (isWindows()) {
|
6153 | yarnCommand = 'yarn.cmd';
|
6154 | options.shell = true;
|
6155 | }
|
6156 | let handler = () => { };
|
6157 | try {
|
6158 | process.on('SIGPIPE', handler);
|
6159 | let results = child_process_1.spawnSync(yarnCommand, ['global', 'dir', '--json'], options);
|
6160 | let stdout = results.stdout;
|
6161 | if (!stdout) {
|
6162 | if (tracer) {
|
6163 | tracer(`'yarn global dir' didn't return a value.`);
|
6164 | if (results.stderr) {
|
6165 | tracer(results.stderr);
|
6166 | }
|
6167 | }
|
6168 | return undefined;
|
6169 | }
|
6170 | let lines = stdout.trim().split(/\r?\n/);
|
6171 | for (let line of lines) {
|
6172 | try {
|
6173 | let yarn = JSON.parse(line);
|
6174 | if (yarn.type === 'log') {
|
6175 | return path.join(yarn.data, 'node_modules');
|
6176 | }
|
6177 | }
|
6178 | catch (e) {
|
6179 |
|
6180 | }
|
6181 | }
|
6182 | return undefined;
|
6183 | }
|
6184 | catch (err) {
|
6185 | return undefined;
|
6186 | }
|
6187 | finally {
|
6188 | process.removeListener('SIGPIPE', handler);
|
6189 | }
|
6190 | }
|
6191 | exports.resolveGlobalYarnPath = resolveGlobalYarnPath;
|
6192 | var FileSystem;
|
6193 | (function (FileSystem) {
|
6194 | let _isCaseSensitive = undefined;
|
6195 | function isCaseSensitive() {
|
6196 | if (_isCaseSensitive !== void 0) {
|
6197 | return _isCaseSensitive;
|
6198 | }
|
6199 | if (process.platform === 'win32') {
|
6200 | _isCaseSensitive = false;
|
6201 | }
|
6202 | else {
|
6203 |
|
6204 |
|
6205 | _isCaseSensitive = !fs.existsSync(__filename.toUpperCase()) || !fs.existsSync(__filename.toLowerCase());
|
6206 | }
|
6207 | return _isCaseSensitive;
|
6208 | }
|
6209 | FileSystem.isCaseSensitive = isCaseSensitive;
|
6210 | function isParent(parent, child) {
|
6211 | if (isCaseSensitive()) {
|
6212 | return path.normalize(child).indexOf(path.normalize(parent)) === 0;
|
6213 | }
|
6214 | else {
|
6215 | return path.normalize(child).toLowerCase().indexOf(path.normalize(parent).toLowerCase()) == 0;
|
6216 | }
|
6217 | }
|
6218 | FileSystem.isParent = isParent;
|
6219 | })(FileSystem = exports.FileSystem || (exports.FileSystem = {}));
|
6220 | function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {
|
6221 | if (nodePath) {
|
6222 | if (!path.isAbsolute(nodePath)) {
|
6223 | nodePath = path.join(workspaceRoot, nodePath);
|
6224 | }
|
6225 | return resolve(moduleName, nodePath, nodePath, tracer).then((value) => {
|
6226 | if (FileSystem.isParent(nodePath, value)) {
|
6227 | return value;
|
6228 | }
|
6229 | else {
|
6230 | return Promise.reject(new Error(`Failed to load ${moduleName} from node path location.`));
|
6231 | }
|
6232 | }).then(undefined, (_error) => {
|
6233 | return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);
|
6234 | });
|
6235 | }
|
6236 | else {
|
6237 | return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);
|
6238 | }
|
6239 | }
|
6240 | exports.resolveModulePath = resolveModulePath;
|
6241 |
|
6242 |
|
6243 |
|
6244 |
|
6245 | function resolveModule2(workspaceRoot, moduleName, nodePath, tracer) {
|
6246 | return resolveModulePath(workspaceRoot, moduleName, nodePath, tracer).then((path) => {
|
6247 | if (tracer) {
|
6248 | tracer(`Module ${moduleName} got resolved to ${path}`);
|
6249 | }
|
6250 | return __webpack_require__(38)(path);
|
6251 | });
|
6252 | }
|
6253 | exports.resolveModule2 = resolveModule2;
|
6254 |
|
6255 |
|
6256 | }),
|
6257 |
|
6258 | (function(module, exports) {
|
6259 |
|
6260 | module.exports = require("url");
|
6261 |
|
6262 | }),
|
6263 |
|
6264 | (function(module, exports) {
|
6265 |
|
6266 | module.exports = require("fs");
|
6267 |
|
6268 | }),
|
6269 |
|
6270 | (function(module, exports) {
|
6271 |
|
6272 | module.exports = require("child_process");
|
6273 |
|
6274 | }),
|
6275 |
|
6276 | (function(module, exports) {
|
6277 |
|
6278 | function webpackEmptyContext(req) {
|
6279 | var e = new Error("Cannot find module '" + req + "'");
|
6280 | e.code = 'MODULE_NOT_FOUND';
|
6281 | throw e;
|
6282 | }
|
6283 | webpackEmptyContext.keys = function() { return []; };
|
6284 | webpackEmptyContext.resolve = webpackEmptyContext;
|
6285 | module.exports = webpackEmptyContext;
|
6286 | webpackEmptyContext.id = 38;
|
6287 |
|
6288 | }),
|
6289 | ,
|
6290 |
|
6291 | (function(module, exports, __webpack_require__) {
|
6292 |
|
6293 | "use strict";
|
6294 |
|
6295 | var __assign = (this && this.__assign) || function () {
|
6296 | __assign = Object.assign || function(t) {
|
6297 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
6298 | s = arguments[i];
|
6299 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6300 | t[p] = s[p];
|
6301 | }
|
6302 | return t;
|
6303 | };
|
6304 | return __assign.apply(this, arguments);
|
6305 | };
|
6306 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
6307 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
6308 | return new (P || (P = Promise))(function (resolve, reject) {
|
6309 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6310 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6311 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
6312 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
6313 | });
|
6314 | };
|
6315 | var __generator = (this && this.__generator) || function (thisArg, body) {
|
6316 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
6317 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
6318 | function verb(n) { return function (v) { return step([n, v]); }; }
|
6319 | function step(op) {
|
6320 | if (f) throw new TypeError("Generator is already executing.");
|
6321 | while (_) try {
|
6322 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
6323 | if (y = 0, t) op = [op[0] & 2, t.value];
|
6324 | switch (op[0]) {
|
6325 | case 0: case 1: t = op; break;
|
6326 | case 4: _.label++; return { value: op[1], done: false };
|
6327 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
6328 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
6329 | default:
|
6330 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
6331 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
6332 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
6333 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
6334 | if (t[2]) _.ops.pop();
|
6335 | _.trys.pop(); continue;
|
6336 | }
|
6337 | op = body.call(thisArg, _);
|
6338 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
6339 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
6340 | }
|
6341 | };
|
6342 | var __spreadArrays = (this && this.__spreadArrays) || function () {
|
6343 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
6344 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
6345 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
6346 | r[k] = a[j];
|
6347 | return r;
|
6348 | };
|
6349 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
6350 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
6351 | };
|
6352 | Object.defineProperty(exports, "__esModule", { value: true });
|
6353 | var child_process_1 = __webpack_require__(37);
|
6354 | var findup_1 = __importDefault(__webpack_require__(41));
|
6355 | var fs_1 = __importDefault(__webpack_require__(36));
|
6356 | var path_1 = __importDefault(__webpack_require__(15));
|
6357 | var vscode_languageserver_1 = __webpack_require__(4);
|
6358 | var vimparser_1 = __webpack_require__(46);
|
6359 | var patterns_1 = __webpack_require__(48);
|
6360 | function isSomeMatchPattern(patterns, line) {
|
6361 | return patterns.some(function (p) { return p.test(line); });
|
6362 | }
|
6363 | exports.isSomeMatchPattern = isSomeMatchPattern;
|
6364 | function executeFile(input, command, args, option) {
|
6365 | return new Promise(function (resolve, reject) {
|
6366 | var stdout = "";
|
6367 | var stderr = "";
|
6368 | var error;
|
6369 | var isPassAsText = false;
|
6370 | args = (args || []).map(function (arg) {
|
6371 | if (/%text/.test(arg)) {
|
6372 | isPassAsText = true;
|
6373 | return arg.replace(/%text/g, input.toString());
|
6374 | }
|
6375 | return arg;
|
6376 | });
|
6377 | var cp = child_process_1.spawn(command, args, option);
|
6378 | cp.stdout.on("data", function (data) {
|
6379 | stdout += data;
|
6380 | });
|
6381 | cp.stderr.on("data", function (data) {
|
6382 | stderr += data;
|
6383 | });
|
6384 | cp.on("error", function (err) {
|
6385 | error = err;
|
6386 | reject(error);
|
6387 | });
|
6388 | cp.on("close", function (code) {
|
6389 | if (!error) {
|
6390 | resolve({ code: code, stdout: stdout, stderr: stderr });
|
6391 | }
|
6392 | });
|
6393 |
|
6394 | if (!isPassAsText) {
|
6395 | input.pipe(cp.stdin).on("error", function () { return; });
|
6396 | }
|
6397 | });
|
6398 | }
|
6399 | exports.executeFile = executeFile;
|
6400 |
|
6401 | function pcb(cb) {
|
6402 | return function () {
|
6403 | var args = [];
|
6404 | for (var _i = 0; _i < arguments.length; _i++) {
|
6405 | args[_i] = arguments[_i];
|
6406 | }
|
6407 | return new Promise(function (resolve) {
|
6408 | cb.apply(void 0, __spreadArrays(args, [function () {
|
6409 | var params = [];
|
6410 | for (var _i = 0; _i < arguments.length; _i++) {
|
6411 | params[_i] = arguments[_i];
|
6412 | }
|
6413 | resolve(params);
|
6414 | }]));
|
6415 | });
|
6416 | };
|
6417 | }
|
6418 | exports.pcb = pcb;
|
6419 |
|
6420 | function findProjectRoot(filePath, rootPatterns) {
|
6421 | return __awaiter(this, void 0, void 0, function () {
|
6422 | var dirname, patterns, dirCandidate, _i, patterns_2, pattern, _a, err, dir;
|
6423 | return __generator(this, function (_b) {
|
6424 | switch (_b.label) {
|
6425 | case 0:
|
6426 | dirname = path_1.default.dirname(filePath);
|
6427 | patterns = [].concat(rootPatterns);
|
6428 | dirCandidate = "";
|
6429 | _i = 0, patterns_2 = patterns;
|
6430 | _b.label = 1;
|
6431 | case 1:
|
6432 | if (!(_i < patterns_2.length)) return [3 , 4];
|
6433 | pattern = patterns_2[_i];
|
6434 | return [4 , pcb(findup_1.default)(dirname, pattern)];
|
6435 | case 2:
|
6436 | _a = _b.sent(), err = _a[0], dir = _a[1];
|
6437 | if (!err && dir && dir !== "/" && dir.length > dirCandidate.length) {
|
6438 | dirCandidate = dir;
|
6439 | }
|
6440 | _b.label = 3;
|
6441 | case 3:
|
6442 | _i++;
|
6443 | return [3 , 1];
|
6444 | case 4:
|
6445 | if (dirCandidate.length) {
|
6446 | return [2 , dirCandidate];
|
6447 | }
|
6448 | return [2 , dirname];
|
6449 | }
|
6450 | });
|
6451 | });
|
6452 | }
|
6453 | exports.findProjectRoot = findProjectRoot;
|
6454 | function markupSnippets(snippets) {
|
6455 | return [
|
6456 | "```vim",
|
6457 | snippets.replace(/\$\{[0-9]+(:([^}]+))?\}/g, "$2"),
|
6458 | "```",
|
6459 | ].join("\n");
|
6460 | }
|
6461 | exports.markupSnippets = markupSnippets;
|
6462 | function getWordFromPosition(doc, position) {
|
6463 | if (!doc) {
|
6464 | return;
|
6465 | }
|
6466 | var character = doc.getText(vscode_languageserver_1.Range.create(vscode_languageserver_1.Position.create(position.line, position.character), vscode_languageserver_1.Position.create(position.line, position.character + 1)));
|
6467 |
|
6468 | if (!character || !patterns_1.keywordPattern.test(character)) {
|
6469 | return;
|
6470 | }
|
6471 | var currentLine = doc.getText(vscode_languageserver_1.Range.create(vscode_languageserver_1.Position.create(position.line, 0), vscode_languageserver_1.Position.create(position.line + 1, 0)));
|
6472 |
|
6473 | if (patterns_1.commentPattern.test(currentLine)) {
|
6474 | return;
|
6475 | }
|
6476 | var preSegment = currentLine.slice(0, position.character);
|
6477 | var nextSegment = currentLine.slice(position.character);
|
6478 | var wordLeft = preSegment.match(patterns_1.wordPrePattern);
|
6479 | var wordRight = nextSegment.match(patterns_1.wordNextPattern);
|
6480 | var word = "" + (wordLeft && wordLeft[1] || "") + (wordRight && wordRight[1] || "");
|
6481 | return {
|
6482 | word: word,
|
6483 | left: wordLeft && wordLeft[1] || "",
|
6484 | right: wordRight && wordRight[1] || "",
|
6485 | wordLeft: wordLeft && wordLeft[1]
|
6486 | ? preSegment.replace(new RegExp(wordLeft[1] + "$"), word)
|
6487 | : "" + preSegment + word,
|
6488 | wordRight: wordRight && wordRight[1]
|
6489 | ? nextSegment.replace(new RegExp("^" + wordRight[1]), word)
|
6490 | : "" + word + nextSegment,
|
6491 | };
|
6492 | }
|
6493 | exports.getWordFromPosition = getWordFromPosition;
|
6494 |
|
6495 | function handleParse(textDoc) {
|
6496 | return __awaiter(this, void 0, void 0, function () {
|
6497 | var text, tokens, node;
|
6498 | return __generator(this, function (_a) {
|
6499 | text = textDoc instanceof Object ? textDoc.getText() : textDoc;
|
6500 | tokens = new vimparser_1.StringReader(text.split(/\r\n|\r|\n/));
|
6501 | try {
|
6502 | node = new vimparser_1.VimLParser(true).parse(tokens);
|
6503 | return [2 , [node, ""]];
|
6504 | }
|
6505 | catch (error) {
|
6506 | return [2 , [null, error]];
|
6507 | }
|
6508 | return [2 ];
|
6509 | });
|
6510 | });
|
6511 | }
|
6512 | exports.handleParse = handleParse;
|
6513 |
|
6514 | function removeSnippets(completionItems) {
|
6515 | if (completionItems === void 0) { completionItems = []; }
|
6516 | return completionItems.map(function (item) {
|
6517 | if (item.insertTextFormat === vscode_languageserver_1.InsertTextFormat.Snippet) {
|
6518 | return __assign(__assign({}, item), { insertText: item.label, insertTextFormat: vscode_languageserver_1.InsertTextFormat.PlainText });
|
6519 | }
|
6520 | return item;
|
6521 | });
|
6522 | }
|
6523 | exports.removeSnippets = removeSnippets;
|
6524 | exports.isSymbolLink = function (filePath) { return __awaiter(void 0, void 0, void 0, function () {
|
6525 | return __generator(this, function (_a) {
|
6526 | return [2 , new Promise(function (resolve) {
|
6527 | fs_1.default.lstat(filePath, function (err, stats) {
|
6528 | resolve({
|
6529 | err: err,
|
6530 | stats: stats && stats.isSymbolicLink(),
|
6531 | });
|
6532 | });
|
6533 | })];
|
6534 | });
|
6535 | }); };
|
6536 | exports.getRealPath = function (filePath) { return __awaiter(void 0, void 0, void 0, function () {
|
6537 | var _a, err, stats;
|
6538 | return __generator(this, function (_b) {
|
6539 | switch (_b.label) {
|
6540 | case 0: return [4 , exports.isSymbolLink(filePath)];
|
6541 | case 1:
|
6542 | _a = _b.sent(), err = _a.err, stats = _a.stats;
|
6543 | if (!err && stats) {
|
6544 | return [2 , new Promise(function (resolve) {
|
6545 | fs_1.default.realpath(filePath, function (error, realPath) {
|
6546 | if (error) {
|
6547 | return resolve(filePath);
|
6548 | }
|
6549 | resolve(realPath);
|
6550 | });
|
6551 | })];
|
6552 | }
|
6553 | return [2 , filePath];
|
6554 | }
|
6555 | });
|
6556 | }); };
|
6557 |
|
6558 |
|
6559 | }),
|
6560 |
|
6561 | (function(module, exports, __webpack_require__) {
|
6562 |
|
6563 | var fs = __webpack_require__(36),
|
6564 | Path = __webpack_require__(15),
|
6565 | util = __webpack_require__(42),
|
6566 | colors = __webpack_require__(43),
|
6567 | EE = __webpack_require__(45).EventEmitter,
|
6568 | fsExists = fs.exists ? fs.exists : Path.exists,
|
6569 | fsExistsSync = fs.existsSync ? fs.existsSync : Path.existsSync;
|
6570 |
|
6571 | module.exports = function(dir, iterator, options, callback){
|
6572 | return FindUp(dir, iterator, options, callback);
|
6573 | };
|
6574 |
|
6575 | function FindUp(dir, iterator, options, callback){
|
6576 | if (!(this instanceof FindUp)) {
|
6577 | return new FindUp(dir, iterator, options, callback);
|
6578 | }
|
6579 | if(typeof options === 'function'){
|
6580 | callback = options;
|
6581 | options = {};
|
6582 | }
|
6583 | options = options || {};
|
6584 |
|
6585 | EE.call(this);
|
6586 | this.found = false;
|
6587 | this.stopPlease = false;
|
6588 | var self = this;
|
6589 |
|
6590 | if(typeof iterator === 'string'){
|
6591 | var file = iterator;
|
6592 | iterator = function(dir, cb){
|
6593 | return fsExists(Path.join(dir, file), cb);
|
6594 | };
|
6595 | }
|
6596 |
|
6597 | if(callback) {
|
6598 | this.on('found', function(dir){
|
6599 | if(options.verbose) console.log(('found '+ dir ).green);
|
6600 | callback(null, dir);
|
6601 | self.stop();
|
6602 | });
|
6603 |
|
6604 | this.on('end', function(){
|
6605 | if(options.verbose) console.log('end'.grey);
|
6606 | if(!self.found) callback(new Error('not found'));
|
6607 | });
|
6608 |
|
6609 | this.on('error', function(err){
|
6610 | if(options.verbose) console.log('error'.red, err);
|
6611 | callback(err);
|
6612 | });
|
6613 | }
|
6614 |
|
6615 | this._find(dir, iterator, options, callback);
|
6616 | }
|
6617 | util.inherits(FindUp, EE);
|
6618 |
|
6619 | FindUp.prototype._find = function(dir, iterator, options, callback){
|
6620 | var self = this;
|
6621 |
|
6622 | iterator(dir, function(exists){
|
6623 | if(options.verbose) console.log(('traverse '+ dir).grey);
|
6624 | if(exists) {
|
6625 | self.found = true;
|
6626 | self.emit('found', dir);
|
6627 | }
|
6628 |
|
6629 | var parentDir = Path.join(dir, '..');
|
6630 | if (self.stopPlease) return self.emit('end');
|
6631 | if (dir === parentDir) return self.emit('end');
|
6632 | if(dir.indexOf('../../') !== -1 ) return self.emit('error', new Error(dir + ' is not correct.'));
|
6633 | self._find(parentDir, iterator, options, callback);
|
6634 | });
|
6635 | };
|
6636 |
|
6637 | FindUp.prototype.stop = function(){
|
6638 | this.stopPlease = true;
|
6639 | };
|
6640 |
|
6641 | module.exports.FindUp = FindUp;
|
6642 |
|
6643 | module.exports.sync = function(dir, iteratorSync){
|
6644 | if(typeof iteratorSync === 'string'){
|
6645 | var file = iteratorSync;
|
6646 | iteratorSync = function(dir){
|
6647 | return fsExistsSync(Path.join(dir, file));
|
6648 | };
|
6649 | }
|
6650 | var initialDir = dir;
|
6651 | while(dir !== Path.join(dir, '..')){
|
6652 | if(dir.indexOf('../../') !== -1 ) throw new Error(initialDir + ' is not correct.');
|
6653 | if(iteratorSync(dir)) return dir;
|
6654 | dir = Path.join(dir, '..');
|
6655 | }
|
6656 | throw new Error('not found');
|
6657 | };
|
6658 |
|
6659 |
|
6660 | }),
|
6661 |
|
6662 | (function(module, exports) {
|
6663 |
|
6664 | module.exports = require("util");
|
6665 |
|
6666 | }),
|
6667 |
|
6668 | (function(module, exports, __webpack_require__) {
|
6669 |
|
6670 |
|
6671 |
|
6672 |
|
6673 |
|
6674 |
|
6675 |
|
6676 |
|
6677 |
|
6678 |
|
6679 |
|
6680 |
|
6681 |
|
6682 |
|
6683 |
|
6684 |
|
6685 |
|
6686 |
|
6687 |
|
6688 |
|
6689 |
|
6690 |
|
6691 |
|
6692 |
|
6693 |
|
6694 |
|
6695 |
|
6696 |
|
6697 |
|
6698 | var isHeadless = false;
|
6699 |
|
6700 | if (typeof module !== 'undefined') {
|
6701 | isHeadless = true;
|
6702 | }
|
6703 |
|
6704 | if (!isHeadless) {
|
6705 | var exports = {};
|
6706 | var module = {};
|
6707 | var colors = exports;
|
6708 | exports.mode = "browser";
|
6709 | } else {
|
6710 | exports.mode = "console";
|
6711 | }
|
6712 |
|
6713 |
|
6714 |
|
6715 |
|
6716 | var addProperty = function (color, func) {
|
6717 | exports[color] = function (str) {
|
6718 | return func.apply(str);
|
6719 | };
|
6720 | String.prototype.__defineGetter__(color, func);
|
6721 | };
|
6722 |
|
6723 | function stylize(str, style) {
|
6724 |
|
6725 | var styles;
|
6726 |
|
6727 | if (exports.mode === 'console') {
|
6728 | styles = {
|
6729 |
|
6730 | 'bold' : ['\x1B[1m', '\x1B[22m'],
|
6731 | 'italic' : ['\x1B[3m', '\x1B[23m'],
|
6732 | 'underline' : ['\x1B[4m', '\x1B[24m'],
|
6733 | 'inverse' : ['\x1B[7m', '\x1B[27m'],
|
6734 | 'strikethrough' : ['\x1B[9m', '\x1B[29m'],
|
6735 |
|
6736 |
|
6737 | 'white' : ['\x1B[37m', '\x1B[39m'],
|
6738 | 'grey' : ['\x1B[90m', '\x1B[39m'],
|
6739 | 'black' : ['\x1B[30m', '\x1B[39m'],
|
6740 |
|
6741 | 'blue' : ['\x1B[34m', '\x1B[39m'],
|
6742 | 'cyan' : ['\x1B[36m', '\x1B[39m'],
|
6743 | 'green' : ['\x1B[32m', '\x1B[39m'],
|
6744 | 'magenta' : ['\x1B[35m', '\x1B[39m'],
|
6745 | 'red' : ['\x1B[31m', '\x1B[39m'],
|
6746 | 'yellow' : ['\x1B[33m', '\x1B[39m'],
|
6747 |
|
6748 |
|
6749 | 'whiteBG' : ['\x1B[47m', '\x1B[49m'],
|
6750 | 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'],
|
6751 | 'blackBG' : ['\x1B[40m', '\x1B[49m'],
|
6752 |
|
6753 | 'blueBG' : ['\x1B[44m', '\x1B[49m'],
|
6754 | 'cyanBG' : ['\x1B[46m', '\x1B[49m'],
|
6755 | 'greenBG' : ['\x1B[42m', '\x1B[49m'],
|
6756 | 'magentaBG' : ['\x1B[45m', '\x1B[49m'],
|
6757 | 'redBG' : ['\x1B[41m', '\x1B[49m'],
|
6758 | 'yellowBG' : ['\x1B[43m', '\x1B[49m']
|
6759 | };
|
6760 | } else if (exports.mode === 'browser') {
|
6761 | styles = {
|
6762 |
|
6763 | 'bold' : ['<b>', '</b>'],
|
6764 | 'italic' : ['<i>', '</i>'],
|
6765 | 'underline' : ['<u>', '</u>'],
|
6766 | 'inverse' : ['<span style="background-color:black;color:white;">', '</span>'],
|
6767 | 'strikethrough' : ['<del>', '</del>'],
|
6768 |
|
6769 |
|
6770 | 'white' : ['<span style="color:white;">', '</span>'],
|
6771 | 'grey' : ['<span style="color:gray;">', '</span>'],
|
6772 | 'black' : ['<span style="color:black;">', '</span>'],
|
6773 |
|
6774 | 'blue' : ['<span style="color:blue;">', '</span>'],
|
6775 | 'cyan' : ['<span style="color:cyan;">', '</span>'],
|
6776 | 'green' : ['<span style="color:green;">', '</span>'],
|
6777 | 'magenta' : ['<span style="color:magenta;">', '</span>'],
|
6778 | 'red' : ['<span style="color:red;">', '</span>'],
|
6779 | 'yellow' : ['<span style="color:yellow;">', '</span>'],
|
6780 |
|
6781 |
|
6782 | 'whiteBG' : ['<span style="background-color:white;">', '</span>'],
|
6783 | 'greyBG' : ['<span style="background-color:gray;">', '</span>'],
|
6784 | 'blackBG' : ['<span style="background-color:black;">', '</span>'],
|
6785 |
|
6786 | 'blueBG' : ['<span style="background-color:blue;">', '</span>'],
|
6787 | 'cyanBG' : ['<span style="background-color:cyan;">', '</span>'],
|
6788 | 'greenBG' : ['<span style="background-color:green;">', '</span>'],
|
6789 | 'magentaBG' : ['<span style="background-color:magenta;">', '</span>'],
|
6790 | 'redBG' : ['<span style="background-color:red;">', '</span>'],
|
6791 | 'yellowBG' : ['<span style="background-color:yellow;">', '</span>']
|
6792 | };
|
6793 | } else if (exports.mode === 'none') {
|
6794 | return str + '';
|
6795 | } else {
|
6796 | console.log('unsupported mode, try "browser", "console" or "none"');
|
6797 | }
|
6798 | return styles[style][0] + str + styles[style][1];
|
6799 | }
|
6800 |
|
6801 | function applyTheme(theme) {
|
6802 |
|
6803 |
|
6804 |
|
6805 |
|
6806 |
|
6807 | var stringPrototypeBlacklist = [
|
6808 | '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor',
|
6809 | 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt',
|
6810 | 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring',
|
6811 | 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight'
|
6812 | ];
|
6813 |
|
6814 | Object.keys(theme).forEach(function (prop) {
|
6815 | if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
|
6816 | console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name');
|
6817 | }
|
6818 | else {
|
6819 | if (typeof(theme[prop]) === 'string') {
|
6820 | addProperty(prop, function () {
|
6821 | return exports[theme[prop]](this);
|
6822 | });
|
6823 | }
|
6824 | else {
|
6825 | addProperty(prop, function () {
|
6826 | var ret = this;
|
6827 | for (var t = 0; t < theme[prop].length; t++) {
|
6828 | ret = exports[theme[prop][t]](ret);
|
6829 | }
|
6830 | return ret;
|
6831 | });
|
6832 | }
|
6833 | }
|
6834 | });
|
6835 | }
|
6836 |
|
6837 |
|
6838 |
|
6839 |
|
6840 |
|
6841 | var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG'];
|
6842 | x.forEach(function (style) {
|
6843 |
|
6844 |
|
6845 |
|
6846 |
|
6847 | addProperty(style, function () {
|
6848 | return stylize(this, style);
|
6849 | });
|
6850 | });
|
6851 |
|
6852 | function sequencer(map) {
|
6853 | return function () {
|
6854 | if (!isHeadless) {
|
6855 | return this.replace(/( )/, '$1');
|
6856 | }
|
6857 | var exploded = this.split(""), i = 0;
|
6858 | exploded = exploded.map(map);
|
6859 | return exploded.join("");
|
6860 | };
|
6861 | }
|
6862 |
|
6863 | var rainbowMap = (function () {
|
6864 | var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
|
6865 | return function (letter, i, exploded) {
|
6866 | if (letter === " ") {
|
6867 | return letter;
|
6868 | } else {
|
6869 | return stylize(letter, rainbowColors[i++ % rainbowColors.length]);
|
6870 | }
|
6871 | };
|
6872 | })();
|
6873 |
|
6874 | exports.themes = {};
|
6875 |
|
6876 | exports.addSequencer = function (name, map) {
|
6877 | addProperty(name, sequencer(map));
|
6878 | };
|
6879 |
|
6880 | exports.addSequencer('rainbow', rainbowMap);
|
6881 | exports.addSequencer('zebra', function (letter, i, exploded) {
|
6882 | return i % 2 === 0 ? letter : letter.inverse;
|
6883 | });
|
6884 |
|
6885 | exports.setTheme = function (theme) {
|
6886 | if (typeof theme === 'string') {
|
6887 | try {
|
6888 | exports.themes[theme] = __webpack_require__(44)(theme);
|
6889 | applyTheme(exports.themes[theme]);
|
6890 | return exports.themes[theme];
|
6891 | } catch (err) {
|
6892 | console.log(err);
|
6893 | return err;
|
6894 | }
|
6895 | } else {
|
6896 | applyTheme(theme);
|
6897 | }
|
6898 | };
|
6899 |
|
6900 |
|
6901 | addProperty('stripColors', function () {
|
6902 | return ("" + this).replace(/\x1B\[\d+m/g, '');
|
6903 | });
|
6904 |
|
6905 |
|
6906 | function zalgo(text, options) {
|
6907 | var soul = {
|
6908 | "up" : [
|
6909 | '̍', '̎', '̄', '̅',
|
6910 | '̿', '̑', '̆', '̐',
|
6911 | '͒', '͗', '͑', '̇',
|
6912 | '̈', '̊', '͂', '̓',
|
6913 | '̈', '͊', '͋', '͌',
|
6914 | '̃', '̂', '̌', '͐',
|
6915 | '̀', '́', '̋', '̏',
|
6916 | '̒', '̓', '̔', '̽',
|
6917 | '̉', 'ͣ', 'ͤ', 'ͥ',
|
6918 | 'ͦ', 'ͧ', 'ͨ', 'ͩ',
|
6919 | 'ͪ', 'ͫ', 'ͬ', 'ͭ',
|
6920 | 'ͮ', 'ͯ', '̾', '͛',
|
6921 | '͆', '̚'
|
6922 | ],
|
6923 | "down" : [
|
6924 | '̖', '̗', '̘', '̙',
|
6925 | '̜', '̝', '̞', '̟',
|
6926 | '̠', '̤', '̥', '̦',
|
6927 | '̩', '̪', '̫', '̬',
|
6928 | '̭', '̮', '̯', '̰',
|
6929 | '̱', '̲', '̳', '̹',
|
6930 | '̺', '̻', '̼', 'ͅ',
|
6931 | '͇', '͈', '͉', '͍',
|
6932 | '͎', '͓', '͔', '͕',
|
6933 | '͖', '͙', '͚', '̣'
|
6934 | ],
|
6935 | "mid" : [
|
6936 | '̕', '̛', '̀', '́',
|
6937 | '͘', '̡', '̢', '̧',
|
6938 | '̨', '̴', '̵', '̶',
|
6939 | '͜', '͝', '͞',
|
6940 | '͟', '͠', '͢', '̸',
|
6941 | '̷', '͡', ' ҉'
|
6942 | ]
|
6943 | },
|
6944 | all = [].concat(soul.up, soul.down, soul.mid),
|
6945 | zalgo = {};
|
6946 |
|
6947 | function randomNumber(range) {
|
6948 | var r = Math.floor(Math.random() * range);
|
6949 | return r;
|
6950 | }
|
6951 |
|
6952 | function is_char(character) {
|
6953 | var bool = false;
|
6954 | all.filter(function (i) {
|
6955 | bool = (i === character);
|
6956 | });
|
6957 | return bool;
|
6958 | }
|
6959 |
|
6960 | function heComes(text, options) {
|
6961 | var result = '', counts, l;
|
6962 | options = options || {};
|
6963 | options["up"] = options["up"] || true;
|
6964 | options["mid"] = options["mid"] || true;
|
6965 | options["down"] = options["down"] || true;
|
6966 | options["size"] = options["size"] || "maxi";
|
6967 | text = text.split('');
|
6968 | for (l in text) {
|
6969 | if (is_char(l)) {
|
6970 | continue;
|
6971 | }
|
6972 | result = result + text[l];
|
6973 | counts = {"up" : 0, "down" : 0, "mid" : 0};
|
6974 | switch (options.size) {
|
6975 | case 'mini':
|
6976 | counts.up = randomNumber(8);
|
6977 | counts.min = randomNumber(2);
|
6978 | counts.down = randomNumber(8);
|
6979 | break;
|
6980 | case 'maxi':
|
6981 | counts.up = randomNumber(16) + 3;
|
6982 | counts.min = randomNumber(4) + 1;
|
6983 | counts.down = randomNumber(64) + 3;
|
6984 | break;
|
6985 | default:
|
6986 | counts.up = randomNumber(8) + 1;
|
6987 | counts.mid = randomNumber(6) / 2;
|
6988 | counts.down = randomNumber(8) + 1;
|
6989 | break;
|
6990 | }
|
6991 |
|
6992 | var arr = ["up", "mid", "down"];
|
6993 | for (var d in arr) {
|
6994 | var index = arr[d];
|
6995 | for (var i = 0 ; i <= counts[index]; i++) {
|
6996 | if (options[index]) {
|
6997 | result = result + soul[index][randomNumber(soul[index].length)];
|
6998 | }
|
6999 | }
|
7000 | }
|
7001 | }
|
7002 | return result;
|
7003 | }
|
7004 | return heComes(text);
|
7005 | }
|
7006 |
|
7007 |
|
7008 |
|
7009 | addProperty('zalgo', function () {
|
7010 | return zalgo(this);
|
7011 | });
|
7012 |
|
7013 |
|
7014 | }),
|
7015 |
|
7016 | (function(module, exports) {
|
7017 |
|
7018 | function webpackEmptyContext(req) {
|
7019 | var e = new Error("Cannot find module '" + req + "'");
|
7020 | e.code = 'MODULE_NOT_FOUND';
|
7021 | throw e;
|
7022 | }
|
7023 | webpackEmptyContext.keys = function() { return []; };
|
7024 | webpackEmptyContext.resolve = webpackEmptyContext;
|
7025 | module.exports = webpackEmptyContext;
|
7026 | webpackEmptyContext.id = 44;
|
7027 |
|
7028 | }),
|
7029 |
|
7030 | (function(module, exports) {
|
7031 |
|
7032 | module.exports = require("events");
|
7033 |
|
7034 | }),
|
7035 |
|
7036 | (function(module, exports, __webpack_require__) {
|
7037 |
|
7038 | (function(module) {
|
7039 |
|
7040 |
|
7041 | var fs = __webpack_require__(36);
|
7042 | var util = __webpack_require__(42);
|
7043 |
|
7044 | function main() {
|
7045 | var neovim = false;
|
7046 | var fpath = ''
|
7047 | var args = process.argv;
|
7048 | if (args.length == 4) {
|
7049 | if (args[2] == '--neovim') {
|
7050 | neovim = true;
|
7051 | }
|
7052 | fpath = args[3];
|
7053 | } else if (args.length == 3) {
|
7054 | neovim = false;
|
7055 | fpath = args[2]
|
7056 | }
|
7057 | var r = new StringReader(viml_readfile(fpath));
|
7058 | var p = new VimLParser(neovim);
|
7059 | var c = new Compiler();
|
7060 | try {
|
7061 | var lines = c.compile(p.parse(r));
|
7062 | for (var i in lines) {
|
7063 | process.stdout.write(lines[i] + "\n");
|
7064 | }
|
7065 | } catch (e) {
|
7066 | process.stdout.write(e + '\n');
|
7067 | }
|
7068 | }
|
7069 |
|
7070 | var pat_vim2js = {
|
7071 | "[0-9a-zA-Z]" : "[0-9a-zA-Z]",
|
7072 | "[@*!=><&~#]" : "[@*!=><&~#]",
|
7073 | "\\<ARGOPT\\>" : "\\bARGOPT\\b",
|
7074 | "\\<BANG\\>" : "\\bBANG\\b",
|
7075 | "\\<EDITCMD\\>" : "\\bEDITCMD\\b",
|
7076 | "\\<NOTRLCOM\\>" : "\\bNOTRLCOM\\b",
|
7077 | "\\<TRLBAR\\>" : "\\bTRLBAR\\b",
|
7078 | "\\<USECTRLV\\>" : "\\bUSECTRLV\\b",
|
7079 | "\\<USERCMD\\>" : "\\bUSERCMD\\b",
|
7080 | "\\<\\(XFILE\\|FILES\\|FILE1\\)\\>" : "\\b(XFILE|FILES|FILE1)\\b",
|
7081 | "\\S" : "\\S",
|
7082 | "\\a" : "[A-Za-z]",
|
7083 | "\\d" : "\\d",
|
7084 | "\\h" : "[A-Za-z_]",
|
7085 | "\\s" : "\\s",
|
7086 | "\\v^d%[elete][lp]$" : "^d(elete|elet|ele|el|e)[lp]$",
|
7087 | "\\v^s%(c[^sr][^i][^p]|g|i[^mlg]|I|r[^e])" : "^s(c[^sr][^i][^p]|g|i[^mlg]|I|r[^e])",
|
7088 | "\\w" : "[0-9A-Za-z_]",
|
7089 | "\\w\\|[:#]" : "[0-9A-Za-z_]|[:#]",
|
7090 | "\\x" : "[0-9A-Fa-f]",
|
7091 | "^++" : "^\+\+",
|
7092 | "^++bad=\\(keep\\|drop\\|.\\)\\>" : "^\\+\\+bad=(keep|drop|.)\\b",
|
7093 | "^++bad=drop" : "^\\+\\+bad=drop",
|
7094 | "^++bad=keep" : "^\\+\\+bad=keep",
|
7095 | "^++bin\\>" : "^\\+\\+bin\\b",
|
7096 | "^++edit\\>" : "^\\+\\+edit\\b",
|
7097 | "^++enc=\\S" : "^\\+\\+enc=\\S",
|
7098 | "^++encoding=\\S" : "^\\+\\+encoding=\\S",
|
7099 | "^++ff=\\(dos\\|unix\\|mac\\)\\>" : "^\\+\\+ff=(dos|unix|mac)\\b",
|
7100 | "^++fileformat=\\(dos\\|unix\\|mac\\)\\>" : "^\\+\\+fileformat=(dos|unix|mac)\\b",
|
7101 | "^++nobin\\>" : "^\\+\\+nobin\\b",
|
7102 | "^[A-Z]" : "^[A-Z]",
|
7103 | "^\\$\\w\\+" : "^\\$[0-9A-Za-z_]+",
|
7104 | "^\\(!\\|global\\|vglobal\\)$" : "^(!|global|vglobal)$",
|
7105 | "^\\(WHILE\\|FOR\\)$" : "^(WHILE|FOR)$",
|
7106 | "^\\(vimgrep\\|vimgrepadd\\|lvimgrep\\|lvimgrepadd\\)$" : "^(vimgrep|vimgrepadd|lvimgrep|lvimgrepadd)$",
|
7107 | "^\\d" : "^\\d",
|
7108 | "^\\h" : "^[A-Za-z_]",
|
7109 | "^\\s" : "^\\s",
|
7110 | "^\\s*\\\\" : "^\\s*\\\\",
|
7111 | "^[ \\t]$" : "^[ \\t]$",
|
7112 | "^[A-Za-z]$" : "^[A-Za-z]$",
|
7113 | "^[0-9A-Za-z]$" : "^[0-9A-Za-z]$",
|
7114 | "^[0-9]$" : "^[0-9]$",
|
7115 | "^[0-9A-Fa-f]$" : "^[0-9A-Fa-f]$",
|
7116 | "^[0-9A-Za-z_]$" : "^[0-9A-Za-z_]$",
|
7117 | "^[A-Za-z_]$" : "^[A-Za-z_]$",
|
7118 | "^[0-9A-Za-z_:#]$" : "^[0-9A-Za-z_:#]$",
|
7119 | "^[A-Za-z_][0-9A-Za-z_]*$" : "^[A-Za-z_][0-9A-Za-z_]*$",
|
7120 | "^[A-Z]$" : "^[A-Z]$",
|
7121 | "^[a-z]$" : "^[a-z]$",
|
7122 | "^[vgslabwt]:$\\|^\\([vgslabwt]:\\)\\?[A-Za-z_][0-9A-Za-z_#]*$" : "^[vgslabwt]:$|^([vgslabwt]:)?[A-Za-z_][0-9A-Za-z_#]*$",
|
7123 | "^[0-7]$" : "^[0-7]$",
|
7124 | "^[0-9A-Fa-f][0-9A-Fa-f]$" : "^[0-9A-Fa-f][0-9A-Fa-f]$",
|
7125 | "^\\.[0-9A-Fa-f]$" : "^\\.[0-9A-Fa-f]$",
|
7126 | "^[0-9A-Fa-f][^0-9A-Fa-f]$" : "^[0-9A-Fa-f][^0-9A-Fa-f]$",
|
7127 | }
|
7128 |
|
7129 | function viml_add(lst, item) {
|
7130 | lst.push(item);
|
7131 | }
|
7132 |
|
7133 | function viml_call(func, args) {
|
7134 | return func.apply(null, args);
|
7135 | }
|
7136 |
|
7137 | function viml_char2nr(c) {
|
7138 | return c.charCodeAt(0);
|
7139 | }
|
7140 |
|
7141 | function viml_empty(obj) {
|
7142 | return obj.length == 0;
|
7143 | }
|
7144 |
|
7145 | function viml_equalci(a, b) {
|
7146 | return a.toLowerCase() == b.toLowerCase();
|
7147 | }
|
7148 |
|
7149 | function viml_eqreg(s, reg) {
|
7150 | var mx = new RegExp(pat_vim2js[reg]);
|
7151 | return mx.exec(s) != null;
|
7152 | }
|
7153 |
|
7154 | function viml_eqregh(s, reg) {
|
7155 | var mx = new RegExp(pat_vim2js[reg]);
|
7156 | return mx.exec(s) != null;
|
7157 | }
|
7158 |
|
7159 | function viml_eqregq(s, reg) {
|
7160 | var mx = new RegExp(pat_vim2js[reg], "i");
|
7161 | return mx.exec(s) != null;
|
7162 | }
|
7163 |
|
7164 | function viml_escape(s, chars) {
|
7165 | var r = '';
|
7166 | for (var i = 0; i < s.length; ++i) {
|
7167 | if (chars.indexOf(s.charAt(i)) != -1) {
|
7168 | r = r + "\\" + s.charAt(i);
|
7169 | } else {
|
7170 | r = r + s.charAt(i);
|
7171 | }
|
7172 | }
|
7173 | return r;
|
7174 | }
|
7175 |
|
7176 | function viml_extend(obj, item) {
|
7177 | obj.push.apply(obj, item);
|
7178 | }
|
7179 |
|
7180 | function viml_insert(lst, item) {
|
7181 | var idx = arguments.length >= 3 ? arguments[2] : 0;
|
7182 | lst.splice(0, 0, item);
|
7183 | }
|
7184 |
|
7185 | function viml_join(lst, sep) {
|
7186 | return lst.join(sep);
|
7187 | }
|
7188 |
|
7189 | function viml_keys(obj) {
|
7190 | return Object.keys(obj);
|
7191 | }
|
7192 |
|
7193 | function viml_len(obj) {
|
7194 | if (typeof obj === 'string') {
|
7195 | var len = 0;
|
7196 | for (var i = 0; i < obj.length; i++) {
|
7197 | var c = obj.charCodeAt(i);
|
7198 | len += c < 128 ? 1 : ((c > 127) && (c < 2048)) ? 2 : 3;
|
7199 | }
|
7200 | return len;
|
7201 | }
|
7202 | return obj.length;
|
7203 | }
|
7204 |
|
7205 | function viml_printf() {
|
7206 | var a000 = Array.prototype.slice.call(arguments, 0);
|
7207 | if (a000.length == 1) {
|
7208 | return a000[0];
|
7209 | } else {
|
7210 | return util.format.apply(null, a000);
|
7211 | }
|
7212 | }
|
7213 |
|
7214 | function viml_range(start) {
|
7215 | var end = arguments.length >= 2 ? arguments[1] : null;
|
7216 | if (end == null) {
|
7217 | var x = [];
|
7218 | for (var i = 0; i < start; ++i) {
|
7219 | x.push(i);
|
7220 | }
|
7221 | return x;
|
7222 | } else {
|
7223 | var x = []
|
7224 | for (var i = start; i <= end; ++i) {
|
7225 | x.push(i);
|
7226 | }
|
7227 | return x;
|
7228 | }
|
7229 | }
|
7230 |
|
7231 | function viml_readfile(path) {
|
7232 |
|
7233 | return fs.readFileSync(path, 'utf-8').split(/\r\n|\r|\n/);
|
7234 | }
|
7235 |
|
7236 | function viml_remove(lst, idx) {
|
7237 | lst.splice(idx, 1);
|
7238 | }
|
7239 |
|
7240 | function viml_split(s, sep) {
|
7241 | if (sep == "\\zs") {
|
7242 | return s.split("");
|
7243 | }
|
7244 | throw "NotImplemented";
|
7245 | }
|
7246 |
|
7247 | function viml_str2nr(s) {
|
7248 | var base = arguments.length >= 2 ? arguments[1] : 10;
|
7249 | return parseInt(s, base);
|
7250 | }
|
7251 |
|
7252 | function viml_string(obj) {
|
7253 | return obj.toString();
|
7254 | }
|
7255 |
|
7256 | function viml_has_key(obj, key) {
|
7257 | return obj[key] !== undefined;
|
7258 | }
|
7259 |
|
7260 | function viml_stridx(a, b) {
|
7261 | return a.indexOf(b);
|
7262 | }
|
7263 |
|
7264 | var NIL = [];
|
7265 | var TRUE = 1;
|
7266 | var FALSE = 0;
|
7267 | var NODE_TOPLEVEL = 1;
|
7268 | var NODE_COMMENT = 2;
|
7269 | var NODE_EXCMD = 3;
|
7270 | var NODE_FUNCTION = 4;
|
7271 | var NODE_ENDFUNCTION = 5;
|
7272 | var NODE_DELFUNCTION = 6;
|
7273 | var NODE_RETURN = 7;
|
7274 | var NODE_EXCALL = 8;
|
7275 | var NODE_LET = 9;
|
7276 | var NODE_UNLET = 10;
|
7277 | var NODE_LOCKVAR = 11;
|
7278 | var NODE_UNLOCKVAR = 12;
|
7279 | var NODE_IF = 13;
|
7280 | var NODE_ELSEIF = 14;
|
7281 | var NODE_ELSE = 15;
|
7282 | var NODE_ENDIF = 16;
|
7283 | var NODE_WHILE = 17;
|
7284 | var NODE_ENDWHILE = 18;
|
7285 | var NODE_FOR = 19;
|
7286 | var NODE_ENDFOR = 20;
|
7287 | var NODE_CONTINUE = 21;
|
7288 | var NODE_BREAK = 22;
|
7289 | var NODE_TRY = 23;
|
7290 | var NODE_CATCH = 24;
|
7291 | var NODE_FINALLY = 25;
|
7292 | var NODE_ENDTRY = 26;
|
7293 | var NODE_THROW = 27;
|
7294 | var NODE_ECHO = 28;
|
7295 | var NODE_ECHON = 29;
|
7296 | var NODE_ECHOHL = 30;
|
7297 | var NODE_ECHOMSG = 31;
|
7298 | var NODE_ECHOERR = 32;
|
7299 | var NODE_EXECUTE = 33;
|
7300 | var NODE_TERNARY = 34;
|
7301 | var NODE_OR = 35;
|
7302 | var NODE_AND = 36;
|
7303 | var NODE_EQUAL = 37;
|
7304 | var NODE_EQUALCI = 38;
|
7305 | var NODE_EQUALCS = 39;
|
7306 | var NODE_NEQUAL = 40;
|
7307 | var NODE_NEQUALCI = 41;
|
7308 | var NODE_NEQUALCS = 42;
|
7309 | var NODE_GREATER = 43;
|
7310 | var NODE_GREATERCI = 44;
|
7311 | var NODE_GREATERCS = 45;
|
7312 | var NODE_GEQUAL = 46;
|
7313 | var NODE_GEQUALCI = 47;
|
7314 | var NODE_GEQUALCS = 48;
|
7315 | var NODE_SMALLER = 49;
|
7316 | var NODE_SMALLERCI = 50;
|
7317 | var NODE_SMALLERCS = 51;
|
7318 | var NODE_SEQUAL = 52;
|
7319 | var NODE_SEQUALCI = 53;
|
7320 | var NODE_SEQUALCS = 54;
|
7321 | var NODE_MATCH = 55;
|
7322 | var NODE_MATCHCI = 56;
|
7323 | var NODE_MATCHCS = 57;
|
7324 | var NODE_NOMATCH = 58;
|
7325 | var NODE_NOMATCHCI = 59;
|
7326 | var NODE_NOMATCHCS = 60;
|
7327 | var NODE_IS = 61;
|
7328 | var NODE_ISCI = 62;
|
7329 | var NODE_ISCS = 63;
|
7330 | var NODE_ISNOT = 64;
|
7331 | var NODE_ISNOTCI = 65;
|
7332 | var NODE_ISNOTCS = 66;
|
7333 | var NODE_ADD = 67;
|
7334 | var NODE_SUBTRACT = 68;
|
7335 | var NODE_CONCAT = 69;
|
7336 | var NODE_MULTIPLY = 70;
|
7337 | var NODE_DIVIDE = 71;
|
7338 | var NODE_REMAINDER = 72;
|
7339 | var NODE_NOT = 73;
|
7340 | var NODE_MINUS = 74;
|
7341 | var NODE_PLUS = 75;
|
7342 | var NODE_SUBSCRIPT = 76;
|
7343 | var NODE_SLICE = 77;
|
7344 | var NODE_CALL = 78;
|
7345 | var NODE_DOT = 79;
|
7346 | var NODE_NUMBER = 80;
|
7347 | var NODE_STRING = 81;
|
7348 | var NODE_LIST = 82;
|
7349 | var NODE_DICT = 83;
|
7350 | var NODE_OPTION = 85;
|
7351 | var NODE_IDENTIFIER = 86;
|
7352 | var NODE_CURLYNAME = 87;
|
7353 | var NODE_ENV = 88;
|
7354 | var NODE_REG = 89;
|
7355 | var NODE_CURLYNAMEPART = 90;
|
7356 | var NODE_CURLYNAMEEXPR = 91;
|
7357 | var NODE_LAMBDA = 92;
|
7358 | var NODE_BLOB = 93;
|
7359 | var NODE_CONST = 94;
|
7360 | var NODE_EVAL = 95;
|
7361 | var NODE_HEREDOC = 96;
|
7362 | var NODE_METHOD = 97;
|
7363 | var TOKEN_EOF = 1;
|
7364 | var TOKEN_EOL = 2;
|
7365 | var TOKEN_SPACE = 3;
|
7366 | var TOKEN_OROR = 4;
|
7367 | var TOKEN_ANDAND = 5;
|
7368 | var TOKEN_EQEQ = 6;
|
7369 | var TOKEN_EQEQCI = 7;
|
7370 | var TOKEN_EQEQCS = 8;
|
7371 | var TOKEN_NEQ = 9;
|
7372 | var TOKEN_NEQCI = 10;
|
7373 | var TOKEN_NEQCS = 11;
|
7374 | var TOKEN_GT = 12;
|
7375 | var TOKEN_GTCI = 13;
|
7376 | var TOKEN_GTCS = 14;
|
7377 | var TOKEN_GTEQ = 15;
|
7378 | var TOKEN_GTEQCI = 16;
|
7379 | var TOKEN_GTEQCS = 17;
|
7380 | var TOKEN_LT = 18;
|
7381 | var TOKEN_LTCI = 19;
|
7382 | var TOKEN_LTCS = 20;
|
7383 | var TOKEN_LTEQ = 21;
|
7384 | var TOKEN_LTEQCI = 22;
|
7385 | var TOKEN_LTEQCS = 23;
|
7386 | var TOKEN_MATCH = 24;
|
7387 | var TOKEN_MATCHCI = 25;
|
7388 | var TOKEN_MATCHCS = 26;
|
7389 | var TOKEN_NOMATCH = 27;
|
7390 | var TOKEN_NOMATCHCI = 28;
|
7391 | var TOKEN_NOMATCHCS = 29;
|
7392 | var TOKEN_IS = 30;
|
7393 | var TOKEN_ISCI = 31;
|
7394 | var TOKEN_ISCS = 32;
|
7395 | var TOKEN_ISNOT = 33;
|
7396 | var TOKEN_ISNOTCI = 34;
|
7397 | var TOKEN_ISNOTCS = 35;
|
7398 | var TOKEN_PLUS = 36;
|
7399 | var TOKEN_MINUS = 37;
|
7400 | var TOKEN_DOT = 38;
|
7401 | var TOKEN_STAR = 39;
|
7402 | var TOKEN_SLASH = 40;
|
7403 | var TOKEN_PERCENT = 41;
|
7404 | var TOKEN_NOT = 42;
|
7405 | var TOKEN_QUESTION = 43;
|
7406 | var TOKEN_COLON = 44;
|
7407 | var TOKEN_POPEN = 45;
|
7408 | var TOKEN_PCLOSE = 46;
|
7409 | var TOKEN_SQOPEN = 47;
|
7410 | var TOKEN_SQCLOSE = 48;
|
7411 | var TOKEN_COPEN = 49;
|
7412 | var TOKEN_CCLOSE = 50;
|
7413 | var TOKEN_COMMA = 51;
|
7414 | var TOKEN_NUMBER = 52;
|
7415 | var TOKEN_SQUOTE = 53;
|
7416 | var TOKEN_DQUOTE = 54;
|
7417 | var TOKEN_OPTION = 55;
|
7418 | var TOKEN_IDENTIFIER = 56;
|
7419 | var TOKEN_ENV = 57;
|
7420 | var TOKEN_REG = 58;
|
7421 | var TOKEN_EQ = 59;
|
7422 | var TOKEN_OR = 60;
|
7423 | var TOKEN_SEMICOLON = 61;
|
7424 | var TOKEN_BACKTICK = 62;
|
7425 | var TOKEN_DOTDOTDOT = 63;
|
7426 | var TOKEN_SHARP = 64;
|
7427 | var TOKEN_ARROW = 65;
|
7428 | var TOKEN_BLOB = 66;
|
7429 | var TOKEN_LITCOPEN = 67;
|
7430 | var TOKEN_DOTDOT = 68;
|
7431 | var TOKEN_HEREDOC = 69;
|
7432 | var MAX_FUNC_ARGS = 20;
|
7433 | function isalpha(c) {
|
7434 | return viml_eqregh(c, "^[A-Za-z]$");
|
7435 | }
|
7436 |
|
7437 | function isalnum(c) {
|
7438 | return viml_eqregh(c, "^[0-9A-Za-z]$");
|
7439 | }
|
7440 |
|
7441 | function isdigit(c) {
|
7442 | return viml_eqregh(c, "^[0-9]$");
|
7443 | }
|
7444 |
|
7445 | function isodigit(c) {
|
7446 | return viml_eqregh(c, "^[0-7]$");
|
7447 | }
|
7448 |
|
7449 | function isxdigit(c) {
|
7450 | return viml_eqregh(c, "^[0-9A-Fa-f]$");
|
7451 | }
|
7452 |
|
7453 | function iswordc(c) {
|
7454 | return viml_eqregh(c, "^[0-9A-Za-z_]$");
|
7455 | }
|
7456 |
|
7457 | function iswordc1(c) {
|
7458 | return viml_eqregh(c, "^[A-Za-z_]$");
|
7459 | }
|
7460 |
|
7461 | function iswhite(c) {
|
7462 | return viml_eqregh(c, "^[ \\t]$");
|
7463 | }
|
7464 |
|
7465 | function isnamec(c) {
|
7466 | return viml_eqregh(c, "^[0-9A-Za-z_:#]$");
|
7467 | }
|
7468 |
|
7469 | function isnamec1(c) {
|
7470 | return viml_eqregh(c, "^[A-Za-z_]$");
|
7471 | }
|
7472 |
|
7473 | function isargname(s) {
|
7474 | return viml_eqregh(s, "^[A-Za-z_][0-9A-Za-z_]*$");
|
7475 | }
|
7476 |
|
7477 | function isvarname(s) {
|
7478 | return viml_eqregh(s, "^[vgslabwt]:$\\|^\\([vgslabwt]:\\)\\?[A-Za-z_][0-9A-Za-z_#]*$");
|
7479 | }
|
7480 |
|
7481 |
|
7482 | function isidc(c) {
|
7483 | return viml_eqregh(c, "^[0-9A-Za-z_]$");
|
7484 | }
|
7485 |
|
7486 | function isupper(c) {
|
7487 | return viml_eqregh(c, "^[A-Z]$");
|
7488 | }
|
7489 |
|
7490 | function islower(c) {
|
7491 | return viml_eqregh(c, "^[a-z]$");
|
7492 | }
|
7493 |
|
7494 | function ExArg() {
|
7495 | var ea = {};
|
7496 | ea.forceit = FALSE;
|
7497 | ea.addr_count = 0;
|
7498 | ea.line1 = 0;
|
7499 | ea.line2 = 0;
|
7500 | ea.flags = 0;
|
7501 | ea.do_ecmd_cmd = "";
|
7502 | ea.do_ecmd_lnum = 0;
|
7503 | ea.append = 0;
|
7504 | ea.usefilter = FALSE;
|
7505 | ea.amount = 0;
|
7506 | ea.regname = 0;
|
7507 | ea.force_bin = 0;
|
7508 | ea.read_edit = 0;
|
7509 | ea.force_ff = 0;
|
7510 | ea.force_enc = 0;
|
7511 | ea.bad_char = 0;
|
7512 | ea.linepos = {};
|
7513 | ea.cmdpos = [];
|
7514 | ea.argpos = [];
|
7515 | ea.cmd = {};
|
7516 | ea.modifiers = [];
|
7517 | ea.range = [];
|
7518 | ea.argopt = {};
|
7519 | ea.argcmd = {};
|
7520 | return ea;
|
7521 | }
|
7522 |
|
7523 |
|
7524 |
|
7525 |
|
7526 |
|
7527 |
|
7528 |
|
7529 |
|
7530 |
|
7531 |
|
7532 |
|
7533 |
|
7534 |
|
7535 |
|
7536 |
|
7537 |
|
7538 |
|
7539 |
|
7540 |
|
7541 |
|
7542 |
|
7543 |
|
7544 |
|
7545 |
|
7546 |
|
7547 |
|
7548 |
|
7549 |
|
7550 |
|
7551 |
|
7552 |
|
7553 |
|
7554 |
|
7555 |
|
7556 |
|
7557 |
|
7558 |
|
7559 |
|
7560 |
|
7561 |
|
7562 |
|
7563 |
|
7564 |
|
7565 |
|
7566 |
|
7567 |
|
7568 |
|
7569 |
|
7570 |
|
7571 |
|
7572 |
|
7573 |
|
7574 |
|
7575 |
|
7576 |
|
7577 |
|
7578 |
|
7579 |
|
7580 |
|
7581 |
|
7582 |
|
7583 |
|
7584 |
|
7585 |
|
7586 |
|
7587 |
|
7588 |
|
7589 |
|
7590 |
|
7591 |
|
7592 |
|
7593 |
|
7594 |
|
7595 |
|
7596 |
|
7597 |
|
7598 |
|
7599 |
|
7600 |
|
7601 |
|
7602 |
|
7603 |
|
7604 |
|
7605 |
|
7606 |
|
7607 |
|
7608 |
|
7609 |
|
7610 |
|
7611 |
|
7612 |
|
7613 |
|
7614 |
|
7615 |
|
7616 |
|
7617 |
|
7618 |
|
7619 |
|
7620 |
|
7621 |
|
7622 |
|
7623 |
|
7624 |
|
7625 |
|
7626 |
|
7627 |
|
7628 |
|
7629 |
|
7630 |
|
7631 |
|
7632 |
|
7633 |
|
7634 |
|
7635 |
|
7636 | function Node(type) {
|
7637 | return {"type":type};
|
7638 | }
|
7639 |
|
7640 | function Err(msg, pos) {
|
7641 | return viml_printf("vimlparser: %s: line %d col %d", msg, pos.lnum, pos.col);
|
7642 | }
|
7643 |
|
7644 | function VimLParser() { this.__init__.apply(this, arguments); }
|
7645 | VimLParser.prototype.__init__ = function() {
|
7646 | var a000 = Array.prototype.slice.call(arguments, 0);
|
7647 | if (viml_len(a000) > 0) {
|
7648 | this.neovim = a000[0];
|
7649 | }
|
7650 | else {
|
7651 | this.neovim = 0;
|
7652 | }
|
7653 | this.find_command_cache = {};
|
7654 | }
|
7655 |
|
7656 | VimLParser.prototype.push_context = function(node) {
|
7657 | viml_insert(this.context, node);
|
7658 | }
|
7659 |
|
7660 | VimLParser.prototype.pop_context = function() {
|
7661 | viml_remove(this.context, 0);
|
7662 | }
|
7663 |
|
7664 | VimLParser.prototype.find_context = function(type) {
|
7665 | var i = 0;
|
7666 | var __c3 = this.context;
|
7667 | for (var __i3 = 0; __i3 < __c3.length; ++__i3) {
|
7668 | var node = __c3[__i3];
|
7669 | if (node.type == type) {
|
7670 | return i;
|
7671 | }
|
7672 | i += 1;
|
7673 | }
|
7674 | return -1;
|
7675 | }
|
7676 |
|
7677 | VimLParser.prototype.add_node = function(node) {
|
7678 | viml_add(this.context[0].body, node);
|
7679 | }
|
7680 |
|
7681 | VimLParser.prototype.check_missing_endfunction = function(ends, pos) {
|
7682 | if (this.context[0].type == NODE_FUNCTION) {
|
7683 | throw Err(viml_printf("E126: Missing :endfunction: %s", ends), pos);
|
7684 | }
|
7685 | }
|
7686 |
|
7687 | VimLParser.prototype.check_missing_endif = function(ends, pos) {
|
7688 | if (this.context[0].type == NODE_IF || this.context[0].type == NODE_ELSEIF || this.context[0].type == NODE_ELSE) {
|
7689 | throw Err(viml_printf("E171: Missing :endif: %s", ends), pos);
|
7690 | }
|
7691 | }
|
7692 |
|
7693 | VimLParser.prototype.check_missing_endtry = function(ends, pos) {
|
7694 | if (this.context[0].type == NODE_TRY || this.context[0].type == NODE_CATCH || this.context[0].type == NODE_FINALLY) {
|
7695 | throw Err(viml_printf("E600: Missing :endtry: %s", ends), pos);
|
7696 | }
|
7697 | }
|
7698 |
|
7699 | VimLParser.prototype.check_missing_endwhile = function(ends, pos) {
|
7700 | if (this.context[0].type == NODE_WHILE) {
|
7701 | throw Err(viml_printf("E170: Missing :endwhile: %s", ends), pos);
|
7702 | }
|
7703 | }
|
7704 |
|
7705 | VimLParser.prototype.check_missing_endfor = function(ends, pos) {
|
7706 | if (this.context[0].type == NODE_FOR) {
|
7707 | throw Err(viml_printf("E170: Missing :endfor: %s", ends), pos);
|
7708 | }
|
7709 | }
|
7710 |
|
7711 | VimLParser.prototype.parse = function(reader) {
|
7712 | this.reader = reader;
|
7713 | this.context = [];
|
7714 | var toplevel = Node(NODE_TOPLEVEL);
|
7715 | toplevel.pos = this.reader.getpos();
|
7716 | toplevel.body = [];
|
7717 | this.push_context(toplevel);
|
7718 | while (this.reader.peek() != "<EOF>") {
|
7719 | this.parse_one_cmd();
|
7720 | }
|
7721 | this.check_missing_endfunction("TOPLEVEL", this.reader.getpos());
|
7722 | this.check_missing_endif("TOPLEVEL", this.reader.getpos());
|
7723 | this.check_missing_endtry("TOPLEVEL", this.reader.getpos());
|
7724 | this.check_missing_endwhile("TOPLEVEL", this.reader.getpos());
|
7725 | this.check_missing_endfor("TOPLEVEL", this.reader.getpos());
|
7726 | this.pop_context();
|
7727 | return toplevel;
|
7728 | }
|
7729 |
|
7730 | VimLParser.prototype.parse_one_cmd = function() {
|
7731 | this.ea = ExArg();
|
7732 | if (this.reader.peekn(2) == "#!") {
|
7733 | this.parse_hashbang();
|
7734 | this.reader.get();
|
7735 | return;
|
7736 | }
|
7737 | this.reader.skip_white_and_colon();
|
7738 | if (this.reader.peekn(1) == "") {
|
7739 | this.reader.get();
|
7740 | return;
|
7741 | }
|
7742 | if (this.reader.peekn(1) == "\"") {
|
7743 | this.parse_comment();
|
7744 | this.reader.get();
|
7745 | return;
|
7746 | }
|
7747 | this.ea.linepos = this.reader.getpos();
|
7748 | this.parse_command_modifiers();
|
7749 | this.parse_range();
|
7750 | this.parse_command();
|
7751 | this.parse_trail();
|
7752 | }
|
7753 |
|
7754 |
|
7755 | VimLParser.prototype.parse_command_modifiers = function() {
|
7756 | var modifiers = [];
|
7757 | while (TRUE) {
|
7758 | var pos = this.reader.tell();
|
7759 | var d = "";
|
7760 | if (isdigit(this.reader.peekn(1))) {
|
7761 | var d = this.reader.read_digit();
|
7762 | this.reader.skip_white();
|
7763 | }
|
7764 | var k = this.reader.read_alpha();
|
7765 | var c = this.reader.peekn(1);
|
7766 | this.reader.skip_white();
|
7767 | if (viml_stridx("aboveleft", k) == 0 && viml_len(k) >= 3) {
|
7768 |
|
7769 | viml_add(modifiers, {"name":"aboveleft"});
|
7770 | }
|
7771 | else if (viml_stridx("belowright", k) == 0 && viml_len(k) >= 3) {
|
7772 |
|
7773 | viml_add(modifiers, {"name":"belowright"});
|
7774 | }
|
7775 | else if (viml_stridx("browse", k) == 0 && viml_len(k) >= 3) {
|
7776 |
|
7777 | viml_add(modifiers, {"name":"browse"});
|
7778 | }
|
7779 | else if (viml_stridx("botright", k) == 0 && viml_len(k) >= 2) {
|
7780 |
|
7781 | viml_add(modifiers, {"name":"botright"});
|
7782 | }
|
7783 | else if (viml_stridx("confirm", k) == 0 && viml_len(k) >= 4) {
|
7784 |
|
7785 | viml_add(modifiers, {"name":"confirm"});
|
7786 | }
|
7787 | else if (viml_stridx("keepmarks", k) == 0 && viml_len(k) >= 3) {
|
7788 |
|
7789 | viml_add(modifiers, {"name":"keepmarks"});
|
7790 | }
|
7791 | else if (viml_stridx("keepalt", k) == 0 && viml_len(k) >= 5) {
|
7792 |
|
7793 | viml_add(modifiers, {"name":"keepalt"});
|
7794 | }
|
7795 | else if (viml_stridx("keepjumps", k) == 0 && viml_len(k) >= 5) {
|
7796 |
|
7797 | viml_add(modifiers, {"name":"keepjumps"});
|
7798 | }
|
7799 | else if (viml_stridx("keeppatterns", k) == 0 && viml_len(k) >= 5) {
|
7800 |
|
7801 | viml_add(modifiers, {"name":"keeppatterns"});
|
7802 | }
|
7803 | else if (viml_stridx("hide", k) == 0 && viml_len(k) >= 3) {
|
7804 |
|
7805 | if (this.ends_excmds(c)) {
|
7806 | break;
|
7807 | }
|
7808 | viml_add(modifiers, {"name":"hide"});
|
7809 | }
|
7810 | else if (viml_stridx("lockmarks", k) == 0 && viml_len(k) >= 3) {
|
7811 |
|
7812 | viml_add(modifiers, {"name":"lockmarks"});
|
7813 | }
|
7814 | else if (viml_stridx("leftabove", k) == 0 && viml_len(k) >= 5) {
|
7815 |
|
7816 | viml_add(modifiers, {"name":"leftabove"});
|
7817 | }
|
7818 | else if (viml_stridx("noautocmd", k) == 0 && viml_len(k) >= 3) {
|
7819 |
|
7820 | viml_add(modifiers, {"name":"noautocmd"});
|
7821 | }
|
7822 | else if (viml_stridx("noswapfile", k) == 0 && viml_len(k) >= 3) {
|
7823 |
|
7824 | viml_add(modifiers, {"name":"noswapfile"});
|
7825 | }
|
7826 | else if (viml_stridx("rightbelow", k) == 0 && viml_len(k) >= 6) {
|
7827 |
|
7828 | viml_add(modifiers, {"name":"rightbelow"});
|
7829 | }
|
7830 | else if (viml_stridx("sandbox", k) == 0 && viml_len(k) >= 3) {
|
7831 |
|
7832 | viml_add(modifiers, {"name":"sandbox"});
|
7833 | }
|
7834 | else if (viml_stridx("silent", k) == 0 && viml_len(k) >= 3) {
|
7835 |
|
7836 | if (c == "!") {
|
7837 | this.reader.get();
|
7838 | viml_add(modifiers, {"name":"silent", "bang":1});
|
7839 | }
|
7840 | else {
|
7841 | viml_add(modifiers, {"name":"silent", "bang":0});
|
7842 | }
|
7843 | }
|
7844 | else if (k == "tab") {
|
7845 |
|
7846 | if (d != "") {
|
7847 | viml_add(modifiers, {"name":"tab", "count":viml_str2nr(d, 10)});
|
7848 | }
|
7849 | else {
|
7850 | viml_add(modifiers, {"name":"tab"});
|
7851 | }
|
7852 | }
|
7853 | else if (viml_stridx("topleft", k) == 0 && viml_len(k) >= 2) {
|
7854 |
|
7855 | viml_add(modifiers, {"name":"topleft"});
|
7856 | }
|
7857 | else if (viml_stridx("unsilent", k) == 0 && viml_len(k) >= 3) {
|
7858 |
|
7859 | viml_add(modifiers, {"name":"unsilent"});
|
7860 | }
|
7861 | else if (viml_stridx("vertical", k) == 0 && viml_len(k) >= 4) {
|
7862 |
|
7863 | viml_add(modifiers, {"name":"vertical"});
|
7864 | }
|
7865 | else if (viml_stridx("verbose", k) == 0 && viml_len(k) >= 4) {
|
7866 |
|
7867 | if (d != "") {
|
7868 | viml_add(modifiers, {"name":"verbose", "count":viml_str2nr(d, 10)});
|
7869 | }
|
7870 | else {
|
7871 | viml_add(modifiers, {"name":"verbose", "count":1});
|
7872 | }
|
7873 | }
|
7874 | else {
|
7875 | this.reader.seek_set(pos);
|
7876 | break;
|
7877 | }
|
7878 | }
|
7879 | this.ea.modifiers = modifiers;
|
7880 | }
|
7881 |
|
7882 |
|
7883 | VimLParser.prototype.parse_range = function() {
|
7884 | var tokens = [];
|
7885 | while (TRUE) {
|
7886 | while (TRUE) {
|
7887 | this.reader.skip_white();
|
7888 | var c = this.reader.peekn(1);
|
7889 | if (c == "") {
|
7890 | break;
|
7891 | }
|
7892 | if (c == ".") {
|
7893 | viml_add(tokens, this.reader.getn(1));
|
7894 | }
|
7895 | else if (c == "$") {
|
7896 | viml_add(tokens, this.reader.getn(1));
|
7897 | }
|
7898 | else if (c == "'") {
|
7899 | this.reader.getn(1);
|
7900 | var m = this.reader.getn(1);
|
7901 | if (m == "") {
|
7902 | break;
|
7903 | }
|
7904 | viml_add(tokens, "'" + m);
|
7905 | }
|
7906 | else if (c == "/") {
|
7907 | this.reader.getn(1);
|
7908 | var __tmp = this.parse_pattern(c);
|
7909 | var pattern = __tmp[0];
|
7910 | var _ = __tmp[1];
|
7911 | viml_add(tokens, pattern);
|
7912 | }
|
7913 | else if (c == "?") {
|
7914 | this.reader.getn(1);
|
7915 | var __tmp = this.parse_pattern(c);
|
7916 | var pattern = __tmp[0];
|
7917 | var _ = __tmp[1];
|
7918 | viml_add(tokens, pattern);
|
7919 | }
|
7920 | else if (c == "\\") {
|
7921 | var m = this.reader.p(1);
|
7922 | if (m == "&" || m == "?" || m == "/") {
|
7923 | this.reader.seek_cur(2);
|
7924 | viml_add(tokens, "\\" + m);
|
7925 | }
|
7926 | else {
|
7927 | throw Err("E10: \\\\ should be followed by /, ? or &", this.reader.getpos());
|
7928 | }
|
7929 | }
|
7930 | else if (isdigit(c)) {
|
7931 | viml_add(tokens, this.reader.read_digit());
|
7932 | }
|
7933 | while (TRUE) {
|
7934 | this.reader.skip_white();
|
7935 | if (this.reader.peekn(1) == "") {
|
7936 | break;
|
7937 | }
|
7938 | var n = this.reader.read_integer();
|
7939 | if (n == "") {
|
7940 | break;
|
7941 | }
|
7942 | viml_add(tokens, n);
|
7943 | }
|
7944 | if (this.reader.p(0) != "/" && this.reader.p(0) != "?") {
|
7945 | break;
|
7946 | }
|
7947 | }
|
7948 | if (this.reader.peekn(1) == "%") {
|
7949 | viml_add(tokens, this.reader.getn(1));
|
7950 | }
|
7951 | else if (this.reader.peekn(1) == "*") {
|
7952 |
|
7953 | viml_add(tokens, this.reader.getn(1));
|
7954 | }
|
7955 | if (this.reader.peekn(1) == ";") {
|
7956 | viml_add(tokens, this.reader.getn(1));
|
7957 | continue;
|
7958 | }
|
7959 | else if (this.reader.peekn(1) == ",") {
|
7960 | viml_add(tokens, this.reader.getn(1));
|
7961 | continue;
|
7962 | }
|
7963 | break;
|
7964 | }
|
7965 | this.ea.range = tokens;
|
7966 | }
|
7967 |
|
7968 |
|
7969 | VimLParser.prototype.parse_pattern = function(delimiter) {
|
7970 | var pattern = "";
|
7971 | var endc = "";
|
7972 | var inbracket = 0;
|
7973 | while (TRUE) {
|
7974 | var c = this.reader.getn(1);
|
7975 | if (c == "") {
|
7976 | break;
|
7977 | }
|
7978 | if (c == delimiter && inbracket == 0) {
|
7979 | var endc = c;
|
7980 | break;
|
7981 | }
|
7982 | pattern += c;
|
7983 | if (c == "\\") {
|
7984 | var c = this.reader.peekn(1);
|
7985 | if (c == "") {
|
7986 | throw Err("E682: Invalid search pattern or delimiter", this.reader.getpos());
|
7987 | }
|
7988 | this.reader.getn(1);
|
7989 | pattern += c;
|
7990 | }
|
7991 | else if (c == "[") {
|
7992 | inbracket += 1;
|
7993 | }
|
7994 | else if (c == "]") {
|
7995 | inbracket -= 1;
|
7996 | }
|
7997 | }
|
7998 | return [pattern, endc];
|
7999 | }
|
8000 |
|
8001 | VimLParser.prototype.parse_command = function() {
|
8002 | this.reader.skip_white_and_colon();
|
8003 | this.ea.cmdpos = this.reader.getpos();
|
8004 | if (this.reader.peekn(1) == "" || this.reader.peekn(1) == "\"") {
|
8005 | if (!viml_empty(this.ea.modifiers) || !viml_empty(this.ea.range)) {
|
8006 | this.parse_cmd_modifier_range();
|
8007 | }
|
8008 | return;
|
8009 | }
|
8010 | this.ea.cmd = this.find_command();
|
8011 | if (this.ea.cmd === NIL) {
|
8012 | this.reader.setpos(this.ea.cmdpos);
|
8013 | throw Err(viml_printf("E492: Not an editor command: %s", this.reader.peekline()), this.ea.cmdpos);
|
8014 | }
|
8015 | if (this.reader.peekn(1) == "!" && this.ea.cmd.name != "substitute" && this.ea.cmd.name != "smagic" && this.ea.cmd.name != "snomagic") {
|
8016 | this.reader.getn(1);
|
8017 | this.ea.forceit = TRUE;
|
8018 | }
|
8019 | else {
|
8020 | this.ea.forceit = FALSE;
|
8021 | }
|
8022 | if (!viml_eqregh(this.ea.cmd.flags, "\\<BANG\\>") && this.ea.forceit && !viml_eqregh(this.ea.cmd.flags, "\\<USERCMD\\>")) {
|
8023 | throw Err("E477: No ! allowed", this.ea.cmdpos);
|
8024 | }
|
8025 | if (this.ea.cmd.name != "!") {
|
8026 | this.reader.skip_white();
|
8027 | }
|
8028 | this.ea.argpos = this.reader.getpos();
|
8029 | if (viml_eqregh(this.ea.cmd.flags, "\\<ARGOPT\\>")) {
|
8030 | this.parse_argopt();
|
8031 | }
|
8032 | if (this.ea.cmd.name == "write" || this.ea.cmd.name == "update") {
|
8033 | if (this.reader.p(0) == ">") {
|
8034 | if (this.reader.p(1) != ">") {
|
8035 | throw Err("E494: Use w or w>>", this.ea.cmdpos);
|
8036 | }
|
8037 | this.reader.seek_cur(2);
|
8038 | this.reader.skip_white();
|
8039 | this.ea.append = 1;
|
8040 | }
|
8041 | else if (this.reader.peekn(1) == "!" && this.ea.cmd.name == "write") {
|
8042 | this.reader.getn(1);
|
8043 | this.ea.usefilter = TRUE;
|
8044 | }
|
8045 | }
|
8046 | if (this.ea.cmd.name == "read") {
|
8047 | if (this.ea.forceit) {
|
8048 | this.ea.usefilter = TRUE;
|
8049 | this.ea.forceit = FALSE;
|
8050 | }
|
8051 | else if (this.reader.peekn(1) == "!") {
|
8052 | this.reader.getn(1);
|
8053 | this.ea.usefilter = TRUE;
|
8054 | }
|
8055 | }
|
8056 | if (this.ea.cmd.name == "<" || this.ea.cmd.name == ">") {
|
8057 | this.ea.amount = 1;
|
8058 | while (this.reader.peekn(1) == this.ea.cmd.name) {
|
8059 | this.reader.getn(1);
|
8060 | this.ea.amount += 1;
|
8061 | }
|
8062 | this.reader.skip_white();
|
8063 | }
|
8064 | if (viml_eqregh(this.ea.cmd.flags, "\\<EDITCMD\\>") && !this.ea.usefilter) {
|
8065 | this.parse_argcmd();
|
8066 | }
|
8067 | this._parse_command(this.ea.cmd.parser);
|
8068 | }
|
8069 |
|
8070 |
|
8071 | VimLParser.prototype._parse_command = function(parser) {
|
8072 | if (parser == "parse_cmd_append") {
|
8073 | this.parse_cmd_append();
|
8074 | }
|
8075 | else if (parser == "parse_cmd_break") {
|
8076 | this.parse_cmd_break();
|
8077 | }
|
8078 | else if (parser == "parse_cmd_call") {
|
8079 | this.parse_cmd_call();
|
8080 | }
|
8081 | else if (parser == "parse_cmd_catch") {
|
8082 | this.parse_cmd_catch();
|
8083 | }
|
8084 | else if (parser == "parse_cmd_common") {
|
8085 | this.parse_cmd_common();
|
8086 | }
|
8087 | else if (parser == "parse_cmd_continue") {
|
8088 | this.parse_cmd_continue();
|
8089 | }
|
8090 | else if (parser == "parse_cmd_delfunction") {
|
8091 | this.parse_cmd_delfunction();
|
8092 | }
|
8093 | else if (parser == "parse_cmd_echo") {
|
8094 | this.parse_cmd_echo();
|
8095 | }
|
8096 | else if (parser == "parse_cmd_echoerr") {
|
8097 | this.parse_cmd_echoerr();
|
8098 | }
|
8099 | else if (parser == "parse_cmd_echohl") {
|
8100 | this.parse_cmd_echohl();
|
8101 | }
|
8102 | else if (parser == "parse_cmd_echomsg") {
|
8103 | this.parse_cmd_echomsg();
|
8104 | }
|
8105 | else if (parser == "parse_cmd_echon") {
|
8106 | this.parse_cmd_echon();
|
8107 | }
|
8108 | else if (parser == "parse_cmd_else") {
|
8109 | this.parse_cmd_else();
|
8110 | }
|
8111 | else if (parser == "parse_cmd_elseif") {
|
8112 | this.parse_cmd_elseif();
|
8113 | }
|
8114 | else if (parser == "parse_cmd_endfor") {
|
8115 | this.parse_cmd_endfor();
|
8116 | }
|
8117 | else if (parser == "parse_cmd_endfunction") {
|
8118 | this.parse_cmd_endfunction();
|
8119 | }
|
8120 | else if (parser == "parse_cmd_endif") {
|
8121 | this.parse_cmd_endif();
|
8122 | }
|
8123 | else if (parser == "parse_cmd_endtry") {
|
8124 | this.parse_cmd_endtry();
|
8125 | }
|
8126 | else if (parser == "parse_cmd_endwhile") {
|
8127 | this.parse_cmd_endwhile();
|
8128 | }
|
8129 | else if (parser == "parse_cmd_execute") {
|
8130 | this.parse_cmd_execute();
|
8131 | }
|
8132 | else if (parser == "parse_cmd_finally") {
|
8133 | this.parse_cmd_finally();
|
8134 | }
|
8135 | else if (parser == "parse_cmd_finish") {
|
8136 | this.parse_cmd_finish();
|
8137 | }
|
8138 | else if (parser == "parse_cmd_for") {
|
8139 | this.parse_cmd_for();
|
8140 | }
|
8141 | else if (parser == "parse_cmd_function") {
|
8142 | this.parse_cmd_function();
|
8143 | }
|
8144 | else if (parser == "parse_cmd_if") {
|
8145 | this.parse_cmd_if();
|
8146 | }
|
8147 | else if (parser == "parse_cmd_insert") {
|
8148 | this.parse_cmd_insert();
|
8149 | }
|
8150 | else if (parser == "parse_cmd_let") {
|
8151 | this.parse_cmd_let();
|
8152 | }
|
8153 | else if (parser == "parse_cmd_const") {
|
8154 | this.parse_cmd_const();
|
8155 | }
|
8156 | else if (parser == "parse_cmd_loadkeymap") {
|
8157 | this.parse_cmd_loadkeymap();
|
8158 | }
|
8159 | else if (parser == "parse_cmd_lockvar") {
|
8160 | this.parse_cmd_lockvar();
|
8161 | }
|
8162 | else if (parser == "parse_cmd_lua") {
|
8163 | this.parse_cmd_lua();
|
8164 | }
|
8165 | else if (parser == "parse_cmd_modifier_range") {
|
8166 | this.parse_cmd_modifier_range();
|
8167 | }
|
8168 | else if (parser == "parse_cmd_mzscheme") {
|
8169 | this.parse_cmd_mzscheme();
|
8170 | }
|
8171 | else if (parser == "parse_cmd_perl") {
|
8172 | this.parse_cmd_perl();
|
8173 | }
|
8174 | else if (parser == "parse_cmd_python") {
|
8175 | this.parse_cmd_python();
|
8176 | }
|
8177 | else if (parser == "parse_cmd_python3") {
|
8178 | this.parse_cmd_python3();
|
8179 | }
|
8180 | else if (parser == "parse_cmd_return") {
|
8181 | this.parse_cmd_return();
|
8182 | }
|
8183 | else if (parser == "parse_cmd_ruby") {
|
8184 | this.parse_cmd_ruby();
|
8185 | }
|
8186 | else if (parser == "parse_cmd_tcl") {
|
8187 | this.parse_cmd_tcl();
|
8188 | }
|
8189 | else if (parser == "parse_cmd_throw") {
|
8190 | this.parse_cmd_throw();
|
8191 | }
|
8192 | else if (parser == "parse_cmd_eval") {
|
8193 | this.parse_cmd_eval();
|
8194 | }
|
8195 | else if (parser == "parse_cmd_try") {
|
8196 | this.parse_cmd_try();
|
8197 | }
|
8198 | else if (parser == "parse_cmd_unlet") {
|
8199 | this.parse_cmd_unlet();
|
8200 | }
|
8201 | else if (parser == "parse_cmd_unlockvar") {
|
8202 | this.parse_cmd_unlockvar();
|
8203 | }
|
8204 | else if (parser == "parse_cmd_usercmd") {
|
8205 | this.parse_cmd_usercmd();
|
8206 | }
|
8207 | else if (parser == "parse_cmd_while") {
|
8208 | this.parse_cmd_while();
|
8209 | }
|
8210 | else if (parser == "parse_wincmd") {
|
8211 | this.parse_wincmd();
|
8212 | }
|
8213 | else if (parser == "parse_cmd_syntax") {
|
8214 | this.parse_cmd_syntax();
|
8215 | }
|
8216 | else {
|
8217 | throw viml_printf("unknown parser: %s", viml_string(parser));
|
8218 | }
|
8219 | }
|
8220 |
|
8221 | VimLParser.prototype.find_command = function() {
|
8222 | var c = this.reader.peekn(1);
|
8223 | var name = "";
|
8224 | if (c == "k") {
|
8225 | this.reader.getn(1);
|
8226 | var name = "k";
|
8227 | }
|
8228 | else if (c == "s" && viml_eqregh(this.reader.peekn(5), "\\v^s%(c[^sr][^i][^p]|g|i[^mlg]|I|r[^e])")) {
|
8229 | this.reader.getn(1);
|
8230 | var name = "substitute";
|
8231 | }
|
8232 | else if (viml_eqregh(c, "[@*!=><&~#]")) {
|
8233 | this.reader.getn(1);
|
8234 | var name = c;
|
8235 | }
|
8236 | else if (this.reader.peekn(2) == "py") {
|
8237 | var name = this.reader.read_alnum();
|
8238 | }
|
8239 | else {
|
8240 | var pos = this.reader.tell();
|
8241 | var name = this.reader.read_alpha();
|
8242 | if (name != "del" && viml_eqregh(name, "\\v^d%[elete][lp]$")) {
|
8243 | this.reader.seek_set(pos);
|
8244 | var name = this.reader.getn(viml_len(name) - 1);
|
8245 | }
|
8246 | }
|
8247 | if (name == "") {
|
8248 | return NIL;
|
8249 | }
|
8250 | if (viml_has_key(this.find_command_cache, name)) {
|
8251 | return this.find_command_cache[name];
|
8252 | }
|
8253 | var cmd = NIL;
|
8254 | var __c4 = this.builtin_commands;
|
8255 | for (var __i4 = 0; __i4 < __c4.length; ++__i4) {
|
8256 | var x = __c4[__i4];
|
8257 | if (viml_stridx(x.name, name) == 0 && viml_len(name) >= x.minlen) {
|
8258 | delete cmd;
|
8259 | var cmd = x;
|
8260 | break;
|
8261 | }
|
8262 | }
|
8263 | if (this.neovim) {
|
8264 | var __c5 = this.neovim_additional_commands;
|
8265 | for (var __i5 = 0; __i5 < __c5.length; ++__i5) {
|
8266 | var x = __c5[__i5];
|
8267 | if (viml_stridx(x.name, name) == 0 && viml_len(name) >= x.minlen) {
|
8268 | delete cmd;
|
8269 | var cmd = x;
|
8270 | break;
|
8271 | }
|
8272 | }
|
8273 | var __c6 = this.neovim_removed_commands;
|
8274 | for (var __i6 = 0; __i6 < __c6.length; ++__i6) {
|
8275 | var x = __c6[__i6];
|
8276 | if (viml_stridx(x.name, name) == 0 && viml_len(name) >= x.minlen) {
|
8277 | delete cmd;
|
8278 | var cmd = NIL;
|
8279 | break;
|
8280 | }
|
8281 | }
|
8282 | }
|
8283 |
|
8284 | if ((cmd === NIL || cmd.name == "Print") && viml_eqregh(name, "^[A-Z]")) {
|
8285 | name += this.reader.read_alnum();
|
8286 | delete cmd;
|
8287 | var cmd = {"name":name, "flags":"USERCMD", "parser":"parse_cmd_usercmd"};
|
8288 | }
|
8289 | this.find_command_cache[name] = cmd;
|
8290 | return cmd;
|
8291 | }
|
8292 |
|
8293 |
|
8294 | VimLParser.prototype.parse_hashbang = function() {
|
8295 | this.reader.getn(-1);
|
8296 | }
|
8297 |
|
8298 |
|
8299 |
|
8300 | VimLParser.prototype.parse_argopt = function() {
|
8301 | while (this.reader.p(0) == "+" && this.reader.p(1) == "+") {
|
8302 | var s = this.reader.peekn(20);
|
8303 | if (viml_eqregh(s, "^++bin\\>")) {
|
8304 | this.reader.getn(5);
|
8305 | this.ea.force_bin = 1;
|
8306 | }
|
8307 | else if (viml_eqregh(s, "^++nobin\\>")) {
|
8308 | this.reader.getn(7);
|
8309 | this.ea.force_bin = 2;
|
8310 | }
|
8311 | else if (viml_eqregh(s, "^++edit\\>")) {
|
8312 | this.reader.getn(6);
|
8313 | this.ea.read_edit = 1;
|
8314 | }
|
8315 | else if (viml_eqregh(s, "^++ff=\\(dos\\|unix\\|mac\\)\\>")) {
|
8316 | this.reader.getn(5);
|
8317 | this.ea.force_ff = this.reader.read_alpha();
|
8318 | }
|
8319 | else if (viml_eqregh(s, "^++fileformat=\\(dos\\|unix\\|mac\\)\\>")) {
|
8320 | this.reader.getn(13);
|
8321 | this.ea.force_ff = this.reader.read_alpha();
|
8322 | }
|
8323 | else if (viml_eqregh(s, "^++enc=\\S")) {
|
8324 | this.reader.getn(6);
|
8325 | this.ea.force_enc = this.reader.read_nonwhite();
|
8326 | }
|
8327 | else if (viml_eqregh(s, "^++encoding=\\S")) {
|
8328 | this.reader.getn(11);
|
8329 | this.ea.force_enc = this.reader.read_nonwhite();
|
8330 | }
|
8331 | else if (viml_eqregh(s, "^++bad=\\(keep\\|drop\\|.\\)\\>")) {
|
8332 | this.reader.getn(6);
|
8333 | if (viml_eqregh(s, "^++bad=keep")) {
|
8334 | this.ea.bad_char = this.reader.getn(4);
|
8335 | }
|
8336 | else if (viml_eqregh(s, "^++bad=drop")) {
|
8337 | this.ea.bad_char = this.reader.getn(4);
|
8338 | }
|
8339 | else {
|
8340 | this.ea.bad_char = this.reader.getn(1);
|
8341 | }
|
8342 | }
|
8343 | else if (viml_eqregh(s, "^++")) {
|
8344 | throw Err("E474: Invalid Argument", this.reader.getpos());
|
8345 | }
|
8346 | else {
|
8347 | break;
|
8348 | }
|
8349 | this.reader.skip_white();
|
8350 | }
|
8351 | }
|
8352 |
|
8353 |
|
8354 |
|
8355 | VimLParser.prototype.parse_argcmd = function() {
|
8356 | if (this.reader.peekn(1) == "+") {
|
8357 | this.reader.getn(1);
|
8358 | if (this.reader.peekn(1) == " ") {
|
8359 | this.ea.do_ecmd_cmd = "$";
|
8360 | }
|
8361 | else {
|
8362 | this.ea.do_ecmd_cmd = this.read_cmdarg();
|
8363 | }
|
8364 | }
|
8365 | }
|
8366 |
|
8367 | VimLParser.prototype.read_cmdarg = function() {
|
8368 | var r = "";
|
8369 | while (TRUE) {
|
8370 | var c = this.reader.peekn(1);
|
8371 | if (c == "" || iswhite(c)) {
|
8372 | break;
|
8373 | }
|
8374 | this.reader.getn(1);
|
8375 | if (c == "\\") {
|
8376 | var c = this.reader.getn(1);
|
8377 | }
|
8378 | r += c;
|
8379 | }
|
8380 | return r;
|
8381 | }
|
8382 |
|
8383 | VimLParser.prototype.parse_comment = function() {
|
8384 | var npos = this.reader.getpos();
|
8385 | var c = this.reader.get();
|
8386 | if (c != "\"") {
|
8387 | throw Err(viml_printf("unexpected character: %s", c), npos);
|
8388 | }
|
8389 | var node = Node(NODE_COMMENT);
|
8390 | node.pos = npos;
|
8391 | node.str = this.reader.getn(-1);
|
8392 | this.add_node(node);
|
8393 | }
|
8394 |
|
8395 | VimLParser.prototype.parse_trail = function() {
|
8396 | this.reader.skip_white();
|
8397 | var c = this.reader.peek();
|
8398 | if (c == "<EOF>") {
|
8399 |
|
8400 | }
|
8401 | else if (c == "<EOL>") {
|
8402 | this.reader.get();
|
8403 | }
|
8404 | else if (c == "|") {
|
8405 | this.reader.get();
|
8406 | }
|
8407 | else if (c == "\"") {
|
8408 | this.parse_comment();
|
8409 | this.reader.get();
|
8410 | }
|
8411 | else {
|
8412 | throw Err(viml_printf("E488: Trailing characters: %s", c), this.reader.getpos());
|
8413 | }
|
8414 | }
|
8415 |
|
8416 |
|
8417 | VimLParser.prototype.parse_cmd_modifier_range = function() {
|
8418 | var node = Node(NODE_EXCMD);
|
8419 | node.pos = this.ea.cmdpos;
|
8420 | node.ea = this.ea;
|
8421 | node.str = this.reader.getstr(this.ea.linepos, this.reader.getpos());
|
8422 | this.add_node(node);
|
8423 | }
|
8424 |
|
8425 |
|
8426 | VimLParser.prototype.parse_cmd_common = function() {
|
8427 | var end = this.reader.getpos();
|
8428 | if (viml_eqregh(this.ea.cmd.flags, "\\<TRLBAR\\>") && !this.ea.usefilter) {
|
8429 | var end = this.separate_nextcmd();
|
8430 | }
|
8431 | else if (this.ea.cmd.name == "!" || this.ea.cmd.name == "global" || this.ea.cmd.name == "vglobal" || this.ea.usefilter) {
|
8432 | while (TRUE) {
|
8433 | var end = this.reader.getpos();
|
8434 | if (this.reader.getn(1) == "") {
|
8435 | break;
|
8436 | }
|
8437 | }
|
8438 | }
|
8439 | else {
|
8440 | while (TRUE) {
|
8441 | var end = this.reader.getpos();
|
8442 | if (this.reader.getn(1) == "") {
|
8443 | break;
|
8444 | }
|
8445 | }
|
8446 | }
|
8447 | var node = Node(NODE_EXCMD);
|
8448 | node.pos = this.ea.cmdpos;
|
8449 | node.ea = this.ea;
|
8450 | node.str = this.reader.getstr(this.ea.linepos, end);
|
8451 | this.add_node(node);
|
8452 | }
|
8453 |
|
8454 | VimLParser.prototype.separate_nextcmd = function() {
|
8455 | if (this.ea.cmd.name == "vimgrep" || this.ea.cmd.name == "vimgrepadd" || this.ea.cmd.name == "lvimgrep" || this.ea.cmd.name == "lvimgrepadd") {
|
8456 | this.skip_vimgrep_pat();
|
8457 | }
|
8458 | var pc = "";
|
8459 | var end = this.reader.getpos();
|
8460 | var nospend = end;
|
8461 | while (TRUE) {
|
8462 | var end = this.reader.getpos();
|
8463 | if (!iswhite(pc)) {
|
8464 | var nospend = end;
|
8465 | }
|
8466 | var c = this.reader.peek();
|
8467 | if (c == "<EOF>" || c == "<EOL>") {
|
8468 | break;
|
8469 | }
|
8470 | else if (c == "\x16") {
|
8471 |
|
8472 | this.reader.get();
|
8473 | var end = this.reader.getpos();
|
8474 | var nospend = this.reader.getpos();
|
8475 | var c = this.reader.peek();
|
8476 | if (c == "<EOF>" || c == "<EOL>") {
|
8477 | break;
|
8478 | }
|
8479 | this.reader.get();
|
8480 | }
|
8481 | else if (this.reader.peekn(2) == "`=" && viml_eqregh(this.ea.cmd.flags, "\\<\\(XFILE\\|FILES\\|FILE1\\)\\>")) {
|
8482 | this.reader.getn(2);
|
8483 | this.parse_expr();
|
8484 | var c = this.reader.peekn(1);
|
8485 | if (c != "`") {
|
8486 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
8487 | }
|
8488 | this.reader.getn(1);
|
8489 | }
|
8490 | else if (c == "|" || c == "\n" || c == "\"" && !viml_eqregh(this.ea.cmd.flags, "\\<NOTRLCOM\\>") && (this.ea.cmd.name != "@" && this.ea.cmd.name != "*" || this.reader.getpos() != this.ea.argpos) && (this.ea.cmd.name != "redir" || this.reader.getpos().i != this.ea.argpos.i + 1 || pc != "@")) {
|
8491 | var has_cpo_bar = FALSE;
|
8492 |
|
8493 | if ((!has_cpo_bar || !viml_eqregh(this.ea.cmd.flags, "\\<USECTRLV\\>")) && pc == "\\") {
|
8494 | this.reader.get();
|
8495 | }
|
8496 | else {
|
8497 | break;
|
8498 | }
|
8499 | }
|
8500 | else {
|
8501 | this.reader.get();
|
8502 | }
|
8503 | var pc = c;
|
8504 | }
|
8505 | if (!viml_eqregh(this.ea.cmd.flags, "\\<NOTRLCOM\\>")) {
|
8506 | var end = nospend;
|
8507 | }
|
8508 | return end;
|
8509 | }
|
8510 |
|
8511 |
|
8512 | VimLParser.prototype.skip_vimgrep_pat = function() {
|
8513 | if (this.reader.peekn(1) == "") {
|
8514 |
|
8515 | }
|
8516 | else if (isidc(this.reader.peekn(1))) {
|
8517 |
|
8518 | this.reader.read_nonwhite();
|
8519 | }
|
8520 | else {
|
8521 |
|
8522 | var c = this.reader.getn(1);
|
8523 | var __tmp = this.parse_pattern(c);
|
8524 | var _ = __tmp[0];
|
8525 | var endc = __tmp[1];
|
8526 | if (c != endc) {
|
8527 | return;
|
8528 | }
|
8529 | while (this.reader.p(0) == "g" || this.reader.p(0) == "j") {
|
8530 | this.reader.getn(1);
|
8531 | }
|
8532 | }
|
8533 | }
|
8534 |
|
8535 | VimLParser.prototype.parse_cmd_append = function() {
|
8536 | this.reader.setpos(this.ea.linepos);
|
8537 | var cmdline = this.reader.readline();
|
8538 | var lines = [cmdline];
|
8539 | var m = ".";
|
8540 | while (TRUE) {
|
8541 | if (this.reader.peek() == "<EOF>") {
|
8542 | break;
|
8543 | }
|
8544 | var line = this.reader.getn(-1);
|
8545 | viml_add(lines, line);
|
8546 | if (line == m) {
|
8547 | break;
|
8548 | }
|
8549 | this.reader.get();
|
8550 | }
|
8551 | var node = Node(NODE_EXCMD);
|
8552 | node.pos = this.ea.cmdpos;
|
8553 | node.ea = this.ea;
|
8554 | node.str = viml_join(lines, "\n");
|
8555 | this.add_node(node);
|
8556 | }
|
8557 |
|
8558 | VimLParser.prototype.parse_cmd_insert = function() {
|
8559 | this.parse_cmd_append();
|
8560 | }
|
8561 |
|
8562 | VimLParser.prototype.parse_cmd_loadkeymap = function() {
|
8563 | this.reader.setpos(this.ea.linepos);
|
8564 | var cmdline = this.reader.readline();
|
8565 | var lines = [cmdline];
|
8566 | while (TRUE) {
|
8567 | if (this.reader.peek() == "<EOF>") {
|
8568 | break;
|
8569 | }
|
8570 | var line = this.reader.readline();
|
8571 | viml_add(lines, line);
|
8572 | }
|
8573 | var node = Node(NODE_EXCMD);
|
8574 | node.pos = this.ea.cmdpos;
|
8575 | node.ea = this.ea;
|
8576 | node.str = viml_join(lines, "\n");
|
8577 | this.add_node(node);
|
8578 | }
|
8579 |
|
8580 | VimLParser.prototype.parse_cmd_lua = function() {
|
8581 | var lines = [];
|
8582 | this.reader.skip_white();
|
8583 | if (this.reader.peekn(2) == "<<") {
|
8584 | this.reader.getn(2);
|
8585 | this.reader.skip_white();
|
8586 | var m = this.reader.readline();
|
8587 | if (m == "") {
|
8588 | var m = ".";
|
8589 | }
|
8590 | this.reader.setpos(this.ea.linepos);
|
8591 | var cmdline = this.reader.getn(-1);
|
8592 | var lines = [cmdline];
|
8593 | this.reader.get();
|
8594 | while (TRUE) {
|
8595 | if (this.reader.peek() == "<EOF>") {
|
8596 | break;
|
8597 | }
|
8598 | var line = this.reader.getn(-1);
|
8599 | viml_add(lines, line);
|
8600 | if (line == m) {
|
8601 | break;
|
8602 | }
|
8603 | this.reader.get();
|
8604 | }
|
8605 | }
|
8606 | else {
|
8607 | this.reader.setpos(this.ea.linepos);
|
8608 | var cmdline = this.reader.getn(-1);
|
8609 | var lines = [cmdline];
|
8610 | }
|
8611 | var node = Node(NODE_EXCMD);
|
8612 | node.pos = this.ea.cmdpos;
|
8613 | node.ea = this.ea;
|
8614 | node.str = viml_join(lines, "\n");
|
8615 | this.add_node(node);
|
8616 | }
|
8617 |
|
8618 | VimLParser.prototype.parse_cmd_mzscheme = function() {
|
8619 | this.parse_cmd_lua();
|
8620 | }
|
8621 |
|
8622 | VimLParser.prototype.parse_cmd_perl = function() {
|
8623 | this.parse_cmd_lua();
|
8624 | }
|
8625 |
|
8626 | VimLParser.prototype.parse_cmd_python = function() {
|
8627 | this.parse_cmd_lua();
|
8628 | }
|
8629 |
|
8630 | VimLParser.prototype.parse_cmd_python3 = function() {
|
8631 | this.parse_cmd_lua();
|
8632 | }
|
8633 |
|
8634 | VimLParser.prototype.parse_cmd_ruby = function() {
|
8635 | this.parse_cmd_lua();
|
8636 | }
|
8637 |
|
8638 | VimLParser.prototype.parse_cmd_tcl = function() {
|
8639 | this.parse_cmd_lua();
|
8640 | }
|
8641 |
|
8642 | VimLParser.prototype.parse_cmd_finish = function() {
|
8643 | this.parse_cmd_common();
|
8644 | if (this.context[0].type == NODE_TOPLEVEL) {
|
8645 | this.reader.seek_end(0);
|
8646 | }
|
8647 | }
|
8648 |
|
8649 |
|
8650 | VimLParser.prototype.parse_cmd_usercmd = function() {
|
8651 | this.parse_cmd_common();
|
8652 | }
|
8653 |
|
8654 | VimLParser.prototype.parse_cmd_function = function() {
|
8655 | var pos = this.reader.tell();
|
8656 | this.reader.skip_white();
|
8657 |
|
8658 | if (this.ends_excmds(this.reader.peek())) {
|
8659 | this.reader.seek_set(pos);
|
8660 | this.parse_cmd_common();
|
8661 | return;
|
8662 | }
|
8663 |
|
8664 | if (this.reader.peekn(1) == "/") {
|
8665 | this.reader.seek_set(pos);
|
8666 | this.parse_cmd_common();
|
8667 | return;
|
8668 | }
|
8669 | var left = this.parse_lvalue_func();
|
8670 | this.reader.skip_white();
|
8671 | if (left.type == NODE_IDENTIFIER) {
|
8672 | var s = left.value;
|
8673 | var ss = viml_split(s, "\\zs");
|
8674 | if (ss[0] != "<" && ss[0] != "_" && !isupper(ss[0]) && viml_stridx(s, ":") == -1 && viml_stridx(s, "#") == -1) {
|
8675 | throw Err(viml_printf("E128: Function name must start with a capital or contain a colon: %s", s), left.pos);
|
8676 | }
|
8677 | }
|
8678 |
|
8679 | if (this.reader.peekn(1) != "(") {
|
8680 | this.reader.seek_set(pos);
|
8681 | this.parse_cmd_common();
|
8682 | return;
|
8683 | }
|
8684 |
|
8685 | var node = Node(NODE_FUNCTION);
|
8686 | node.pos = this.ea.cmdpos;
|
8687 | node.body = [];
|
8688 | node.ea = this.ea;
|
8689 | node.left = left;
|
8690 | node.rlist = [];
|
8691 | node.default_args = [];
|
8692 | node.attr = {"range":0, "abort":0, "dict":0, "closure":0};
|
8693 | node.endfunction = NIL;
|
8694 | this.reader.getn(1);
|
8695 | var tokenizer = new ExprTokenizer(this.reader);
|
8696 | if (tokenizer.peek().type == TOKEN_PCLOSE) {
|
8697 | tokenizer.get();
|
8698 | }
|
8699 | else {
|
8700 | var named = {};
|
8701 | while (TRUE) {
|
8702 | var varnode = Node(NODE_IDENTIFIER);
|
8703 | var token = tokenizer.get();
|
8704 | if (token.type == TOKEN_IDENTIFIER) {
|
8705 | if (!isargname(token.value) || token.value == "firstline" || token.value == "lastline") {
|
8706 | throw Err(viml_printf("E125: Illegal argument: %s", token.value), token.pos);
|
8707 | }
|
8708 | else if (viml_has_key(named, token.value)) {
|
8709 | throw Err(viml_printf("E853: Duplicate argument name: %s", token.value), token.pos);
|
8710 | }
|
8711 | named[token.value] = 1;
|
8712 | varnode.pos = token.pos;
|
8713 | varnode.value = token.value;
|
8714 | viml_add(node.rlist, varnode);
|
8715 | if (tokenizer.peek().type == TOKEN_EQ) {
|
8716 | tokenizer.get();
|
8717 | viml_add(node.default_args, this.parse_expr());
|
8718 | }
|
8719 | else if (viml_len(node.default_args) > 0) {
|
8720 | throw Err("E989: Non-default argument follows default argument", varnode.pos);
|
8721 | }
|
8722 |
|
8723 | if (iswhite(this.reader.p(0)) && tokenizer.peek().type == TOKEN_COMMA) {
|
8724 | throw Err("E475: Invalid argument: White space is not allowed before comma", this.reader.getpos());
|
8725 | }
|
8726 | var token = tokenizer.get();
|
8727 | if (token.type == TOKEN_COMMA) {
|
8728 |
|
8729 | if (tokenizer.peek().type == TOKEN_PCLOSE) {
|
8730 | tokenizer.get();
|
8731 | break;
|
8732 | }
|
8733 | }
|
8734 | else if (token.type == TOKEN_PCLOSE) {
|
8735 | break;
|
8736 | }
|
8737 | else {
|
8738 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
8739 | }
|
8740 | }
|
8741 | else if (token.type == TOKEN_DOTDOTDOT) {
|
8742 | varnode.pos = token.pos;
|
8743 | varnode.value = token.value;
|
8744 | viml_add(node.rlist, varnode);
|
8745 | var token = tokenizer.get();
|
8746 | if (token.type == TOKEN_PCLOSE) {
|
8747 | break;
|
8748 | }
|
8749 | else {
|
8750 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
8751 | }
|
8752 | }
|
8753 | else {
|
8754 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
8755 | }
|
8756 | }
|
8757 | }
|
8758 | while (TRUE) {
|
8759 | this.reader.skip_white();
|
8760 | var epos = this.reader.getpos();
|
8761 | var key = this.reader.read_alpha();
|
8762 | if (key == "") {
|
8763 | break;
|
8764 | }
|
8765 | else if (key == "range") {
|
8766 | node.attr.range = TRUE;
|
8767 | }
|
8768 | else if (key == "abort") {
|
8769 | node.attr.abort = TRUE;
|
8770 | }
|
8771 | else if (key == "dict") {
|
8772 | node.attr.dict = TRUE;
|
8773 | }
|
8774 | else if (key == "closure") {
|
8775 | node.attr.closure = TRUE;
|
8776 | }
|
8777 | else {
|
8778 | throw Err(viml_printf("unexpected token: %s", key), epos);
|
8779 | }
|
8780 | }
|
8781 | this.add_node(node);
|
8782 | this.push_context(node);
|
8783 | }
|
8784 |
|
8785 | VimLParser.prototype.parse_cmd_endfunction = function() {
|
8786 | this.check_missing_endif("ENDFUNCTION", this.ea.cmdpos);
|
8787 | this.check_missing_endtry("ENDFUNCTION", this.ea.cmdpos);
|
8788 | this.check_missing_endwhile("ENDFUNCTION", this.ea.cmdpos);
|
8789 | this.check_missing_endfor("ENDFUNCTION", this.ea.cmdpos);
|
8790 | if (this.context[0].type != NODE_FUNCTION) {
|
8791 | throw Err("E193: :endfunction not inside a function", this.ea.cmdpos);
|
8792 | }
|
8793 | this.reader.getn(-1);
|
8794 | var node = Node(NODE_ENDFUNCTION);
|
8795 | node.pos = this.ea.cmdpos;
|
8796 | node.ea = this.ea;
|
8797 | this.context[0].endfunction = node;
|
8798 | this.pop_context();
|
8799 | }
|
8800 |
|
8801 | VimLParser.prototype.parse_cmd_delfunction = function() {
|
8802 | var node = Node(NODE_DELFUNCTION);
|
8803 | node.pos = this.ea.cmdpos;
|
8804 | node.ea = this.ea;
|
8805 | node.left = this.parse_lvalue_func();
|
8806 | this.add_node(node);
|
8807 | }
|
8808 |
|
8809 | VimLParser.prototype.parse_cmd_return = function() {
|
8810 | if (this.find_context(NODE_FUNCTION) == -1) {
|
8811 | throw Err("E133: :return not inside a function", this.ea.cmdpos);
|
8812 | }
|
8813 | var node = Node(NODE_RETURN);
|
8814 | node.pos = this.ea.cmdpos;
|
8815 | node.ea = this.ea;
|
8816 | node.left = NIL;
|
8817 | this.reader.skip_white();
|
8818 | var c = this.reader.peek();
|
8819 | if (c == "\"" || !this.ends_excmds(c)) {
|
8820 | node.left = this.parse_expr();
|
8821 | }
|
8822 | this.add_node(node);
|
8823 | }
|
8824 |
|
8825 | VimLParser.prototype.parse_cmd_call = function() {
|
8826 | var node = Node(NODE_EXCALL);
|
8827 | node.pos = this.ea.cmdpos;
|
8828 | node.ea = this.ea;
|
8829 | this.reader.skip_white();
|
8830 | var c = this.reader.peek();
|
8831 | if (this.ends_excmds(c)) {
|
8832 | throw Err("E471: Argument required", this.reader.getpos());
|
8833 | }
|
8834 | node.left = this.parse_expr();
|
8835 | if (node.left.type != NODE_CALL) {
|
8836 | throw Err("Not an function call", node.left.pos);
|
8837 | }
|
8838 | this.add_node(node);
|
8839 | }
|
8840 |
|
8841 | VimLParser.prototype.parse_heredoc = function() {
|
8842 | var node = Node(NODE_HEREDOC);
|
8843 | node.pos = this.ea.cmdpos;
|
8844 | node.op = "";
|
8845 | node.rlist = [];
|
8846 | node.body = [];
|
8847 | while (TRUE) {
|
8848 | this.reader.skip_white();
|
8849 | var key = this.reader.read_word();
|
8850 | if (key == "") {
|
8851 | break;
|
8852 | }
|
8853 | if (!islower(key[0])) {
|
8854 | node.op = key;
|
8855 | break;
|
8856 | }
|
8857 | else {
|
8858 | viml_add(node.rlist, key);
|
8859 | }
|
8860 | }
|
8861 | if (node.op == "") {
|
8862 | throw Err("E172: Missing marker", this.reader.getpos());
|
8863 | }
|
8864 | this.parse_trail();
|
8865 | while (TRUE) {
|
8866 | if (this.reader.peek() == "<EOF>") {
|
8867 | break;
|
8868 | }
|
8869 | var line = this.reader.getn(-1);
|
8870 | if (line == node.op) {
|
8871 | return node;
|
8872 | }
|
8873 | viml_add(node.body, line);
|
8874 | this.reader.get();
|
8875 | }
|
8876 | throw Err(viml_printf("E990: Missing end marker '%s'", node.op), this.reader.getpos());
|
8877 | }
|
8878 |
|
8879 | VimLParser.prototype.parse_cmd_let = function() {
|
8880 | var pos = this.reader.tell();
|
8881 | this.reader.skip_white();
|
8882 |
|
8883 | if (this.ends_excmds(this.reader.peek())) {
|
8884 | this.reader.seek_set(pos);
|
8885 | this.parse_cmd_common();
|
8886 | return;
|
8887 | }
|
8888 | var lhs = this.parse_letlhs();
|
8889 | this.reader.skip_white();
|
8890 | var s1 = this.reader.peekn(1);
|
8891 | var s2 = this.reader.peekn(2);
|
8892 |
|
8893 | if (s2 == "..") {
|
8894 | var s2 = this.reader.peekn(3);
|
8895 | }
|
8896 | else if (s2 == "=<") {
|
8897 | var s2 = this.reader.peekn(3);
|
8898 | }
|
8899 |
|
8900 | if (this.ends_excmds(s1) || s2 != "+=" && s2 != "-=" && s2 != ".=" && s2 != "..=" && s2 != "*=" && s2 != "/=" && s2 != "%=" && s2 != "=<<" && s1 != "=") {
|
8901 | this.reader.seek_set(pos);
|
8902 | this.parse_cmd_common();
|
8903 | return;
|
8904 | }
|
8905 |
|
8906 | var node = Node(NODE_LET);
|
8907 | node.pos = this.ea.cmdpos;
|
8908 | node.ea = this.ea;
|
8909 | node.op = "";
|
8910 | node.left = lhs.left;
|
8911 | node.list = lhs.list;
|
8912 | node.rest = lhs.rest;
|
8913 | node.right = NIL;
|
8914 | if (s2 == "+=" || s2 == "-=" || s2 == ".=" || s2 == "..=" || s2 == "*=" || s2 == "/=" || s2 == "%=") {
|
8915 | this.reader.getn(viml_len(s2));
|
8916 | node.op = s2;
|
8917 | }
|
8918 | else if (s2 == "=<<") {
|
8919 | this.reader.getn(viml_len(s2));
|
8920 | this.reader.skip_white();
|
8921 | node.op = s2;
|
8922 | node.right = this.parse_heredoc();
|
8923 | this.add_node(node);
|
8924 | return;
|
8925 | }
|
8926 | else if (s1 == "=") {
|
8927 | this.reader.getn(1);
|
8928 | node.op = s1;
|
8929 | }
|
8930 | else {
|
8931 | throw "NOT REACHED";
|
8932 | }
|
8933 | node.right = this.parse_expr();
|
8934 | this.add_node(node);
|
8935 | }
|
8936 |
|
8937 | VimLParser.prototype.parse_cmd_const = function() {
|
8938 | var pos = this.reader.tell();
|
8939 | this.reader.skip_white();
|
8940 |
|
8941 | if (this.ends_excmds(this.reader.peek())) {
|
8942 | this.reader.seek_set(pos);
|
8943 | this.parse_cmd_common();
|
8944 | return;
|
8945 | }
|
8946 | var lhs = this.parse_constlhs();
|
8947 | this.reader.skip_white();
|
8948 | var s1 = this.reader.peekn(1);
|
8949 |
|
8950 | if (this.ends_excmds(s1) || s1 != "=") {
|
8951 | this.reader.seek_set(pos);
|
8952 | this.parse_cmd_common();
|
8953 | return;
|
8954 | }
|
8955 |
|
8956 | var node = Node(NODE_CONST);
|
8957 | node.pos = this.ea.cmdpos;
|
8958 | node.ea = this.ea;
|
8959 | this.reader.getn(1);
|
8960 | node.op = s1;
|
8961 | node.left = lhs.left;
|
8962 | node.list = lhs.list;
|
8963 | node.rest = lhs.rest;
|
8964 | node.right = this.parse_expr();
|
8965 | this.add_node(node);
|
8966 | }
|
8967 |
|
8968 | VimLParser.prototype.parse_cmd_unlet = function() {
|
8969 | var node = Node(NODE_UNLET);
|
8970 | node.pos = this.ea.cmdpos;
|
8971 | node.ea = this.ea;
|
8972 | node.list = this.parse_lvaluelist();
|
8973 | this.add_node(node);
|
8974 | }
|
8975 |
|
8976 | VimLParser.prototype.parse_cmd_lockvar = function() {
|
8977 | var node = Node(NODE_LOCKVAR);
|
8978 | node.pos = this.ea.cmdpos;
|
8979 | node.ea = this.ea;
|
8980 | node.depth = NIL;
|
8981 | node.list = [];
|
8982 | this.reader.skip_white();
|
8983 | if (isdigit(this.reader.peekn(1))) {
|
8984 | node.depth = viml_str2nr(this.reader.read_digit(), 10);
|
8985 | }
|
8986 | node.list = this.parse_lvaluelist();
|
8987 | this.add_node(node);
|
8988 | }
|
8989 |
|
8990 | VimLParser.prototype.parse_cmd_unlockvar = function() {
|
8991 | var node = Node(NODE_UNLOCKVAR);
|
8992 | node.pos = this.ea.cmdpos;
|
8993 | node.ea = this.ea;
|
8994 | node.depth = NIL;
|
8995 | node.list = [];
|
8996 | this.reader.skip_white();
|
8997 | if (isdigit(this.reader.peekn(1))) {
|
8998 | node.depth = viml_str2nr(this.reader.read_digit(), 10);
|
8999 | }
|
9000 | node.list = this.parse_lvaluelist();
|
9001 | this.add_node(node);
|
9002 | }
|
9003 |
|
9004 | VimLParser.prototype.parse_cmd_if = function() {
|
9005 | var node = Node(NODE_IF);
|
9006 | node.pos = this.ea.cmdpos;
|
9007 | node.body = [];
|
9008 | node.ea = this.ea;
|
9009 | node.cond = this.parse_expr();
|
9010 | node.elseif = [];
|
9011 | node._else = NIL;
|
9012 | node.endif = NIL;
|
9013 | this.add_node(node);
|
9014 | this.push_context(node);
|
9015 | }
|
9016 |
|
9017 | VimLParser.prototype.parse_cmd_elseif = function() {
|
9018 | if (this.context[0].type != NODE_IF && this.context[0].type != NODE_ELSEIF) {
|
9019 | throw Err("E582: :elseif without :if", this.ea.cmdpos);
|
9020 | }
|
9021 | if (this.context[0].type != NODE_IF) {
|
9022 | this.pop_context();
|
9023 | }
|
9024 | var node = Node(NODE_ELSEIF);
|
9025 | node.pos = this.ea.cmdpos;
|
9026 | node.body = [];
|
9027 | node.ea = this.ea;
|
9028 | node.cond = this.parse_expr();
|
9029 | viml_add(this.context[0].elseif, node);
|
9030 | this.push_context(node);
|
9031 | }
|
9032 |
|
9033 | VimLParser.prototype.parse_cmd_else = function() {
|
9034 | if (this.context[0].type != NODE_IF && this.context[0].type != NODE_ELSEIF) {
|
9035 | throw Err("E581: :else without :if", this.ea.cmdpos);
|
9036 | }
|
9037 | if (this.context[0].type != NODE_IF) {
|
9038 | this.pop_context();
|
9039 | }
|
9040 | var node = Node(NODE_ELSE);
|
9041 | node.pos = this.ea.cmdpos;
|
9042 | node.body = [];
|
9043 | node.ea = this.ea;
|
9044 | this.context[0]._else = node;
|
9045 | this.push_context(node);
|
9046 | }
|
9047 |
|
9048 | VimLParser.prototype.parse_cmd_endif = function() {
|
9049 | if (this.context[0].type != NODE_IF && this.context[0].type != NODE_ELSEIF && this.context[0].type != NODE_ELSE) {
|
9050 | throw Err("E580: :endif without :if", this.ea.cmdpos);
|
9051 | }
|
9052 | if (this.context[0].type != NODE_IF) {
|
9053 | this.pop_context();
|
9054 | }
|
9055 | var node = Node(NODE_ENDIF);
|
9056 | node.pos = this.ea.cmdpos;
|
9057 | node.ea = this.ea;
|
9058 | this.context[0].endif = node;
|
9059 | this.pop_context();
|
9060 | }
|
9061 |
|
9062 | VimLParser.prototype.parse_cmd_while = function() {
|
9063 | var node = Node(NODE_WHILE);
|
9064 | node.pos = this.ea.cmdpos;
|
9065 | node.body = [];
|
9066 | node.ea = this.ea;
|
9067 | node.cond = this.parse_expr();
|
9068 | node.endwhile = NIL;
|
9069 | this.add_node(node);
|
9070 | this.push_context(node);
|
9071 | }
|
9072 |
|
9073 | VimLParser.prototype.parse_cmd_endwhile = function() {
|
9074 | if (this.context[0].type != NODE_WHILE) {
|
9075 | throw Err("E588: :endwhile without :while", this.ea.cmdpos);
|
9076 | }
|
9077 | var node = Node(NODE_ENDWHILE);
|
9078 | node.pos = this.ea.cmdpos;
|
9079 | node.ea = this.ea;
|
9080 | this.context[0].endwhile = node;
|
9081 | this.pop_context();
|
9082 | }
|
9083 |
|
9084 | VimLParser.prototype.parse_cmd_for = function() {
|
9085 | var node = Node(NODE_FOR);
|
9086 | node.pos = this.ea.cmdpos;
|
9087 | node.body = [];
|
9088 | node.ea = this.ea;
|
9089 | node.left = NIL;
|
9090 | node.right = NIL;
|
9091 | node.endfor = NIL;
|
9092 | var lhs = this.parse_letlhs();
|
9093 | node.left = lhs.left;
|
9094 | node.list = lhs.list;
|
9095 | node.rest = lhs.rest;
|
9096 | this.reader.skip_white();
|
9097 | var epos = this.reader.getpos();
|
9098 | if (this.reader.read_alpha() != "in") {
|
9099 | throw Err("Missing \"in\" after :for", epos);
|
9100 | }
|
9101 | node.right = this.parse_expr();
|
9102 | this.add_node(node);
|
9103 | this.push_context(node);
|
9104 | }
|
9105 |
|
9106 | VimLParser.prototype.parse_cmd_endfor = function() {
|
9107 | if (this.context[0].type != NODE_FOR) {
|
9108 | throw Err("E588: :endfor without :for", this.ea.cmdpos);
|
9109 | }
|
9110 | var node = Node(NODE_ENDFOR);
|
9111 | node.pos = this.ea.cmdpos;
|
9112 | node.ea = this.ea;
|
9113 | this.context[0].endfor = node;
|
9114 | this.pop_context();
|
9115 | }
|
9116 |
|
9117 | VimLParser.prototype.parse_cmd_continue = function() {
|
9118 | if (this.find_context(NODE_WHILE) == -1 && this.find_context(NODE_FOR) == -1) {
|
9119 | throw Err("E586: :continue without :while or :for", this.ea.cmdpos);
|
9120 | }
|
9121 | var node = Node(NODE_CONTINUE);
|
9122 | node.pos = this.ea.cmdpos;
|
9123 | node.ea = this.ea;
|
9124 | this.add_node(node);
|
9125 | }
|
9126 |
|
9127 | VimLParser.prototype.parse_cmd_break = function() {
|
9128 | if (this.find_context(NODE_WHILE) == -1 && this.find_context(NODE_FOR) == -1) {
|
9129 | throw Err("E587: :break without :while or :for", this.ea.cmdpos);
|
9130 | }
|
9131 | var node = Node(NODE_BREAK);
|
9132 | node.pos = this.ea.cmdpos;
|
9133 | node.ea = this.ea;
|
9134 | this.add_node(node);
|
9135 | }
|
9136 |
|
9137 | VimLParser.prototype.parse_cmd_try = function() {
|
9138 | var node = Node(NODE_TRY);
|
9139 | node.pos = this.ea.cmdpos;
|
9140 | node.body = [];
|
9141 | node.ea = this.ea;
|
9142 | node.catch = [];
|
9143 | node._finally = NIL;
|
9144 | node.endtry = NIL;
|
9145 | this.add_node(node);
|
9146 | this.push_context(node);
|
9147 | }
|
9148 |
|
9149 | VimLParser.prototype.parse_cmd_catch = function() {
|
9150 | if (this.context[0].type == NODE_FINALLY) {
|
9151 | throw Err("E604: :catch after :finally", this.ea.cmdpos);
|
9152 | }
|
9153 | else if (this.context[0].type != NODE_TRY && this.context[0].type != NODE_CATCH) {
|
9154 | throw Err("E603: :catch without :try", this.ea.cmdpos);
|
9155 | }
|
9156 | if (this.context[0].type != NODE_TRY) {
|
9157 | this.pop_context();
|
9158 | }
|
9159 | var node = Node(NODE_CATCH);
|
9160 | node.pos = this.ea.cmdpos;
|
9161 | node.body = [];
|
9162 | node.ea = this.ea;
|
9163 | node.pattern = NIL;
|
9164 | this.reader.skip_white();
|
9165 | if (!this.ends_excmds(this.reader.peek())) {
|
9166 | var __tmp = this.parse_pattern(this.reader.get());
|
9167 | node.pattern = __tmp[0];
|
9168 | var _ = __tmp[1];
|
9169 | }
|
9170 | viml_add(this.context[0].catch, node);
|
9171 | this.push_context(node);
|
9172 | }
|
9173 |
|
9174 | VimLParser.prototype.parse_cmd_finally = function() {
|
9175 | if (this.context[0].type != NODE_TRY && this.context[0].type != NODE_CATCH) {
|
9176 | throw Err("E606: :finally without :try", this.ea.cmdpos);
|
9177 | }
|
9178 | if (this.context[0].type != NODE_TRY) {
|
9179 | this.pop_context();
|
9180 | }
|
9181 | var node = Node(NODE_FINALLY);
|
9182 | node.pos = this.ea.cmdpos;
|
9183 | node.body = [];
|
9184 | node.ea = this.ea;
|
9185 | this.context[0]._finally = node;
|
9186 | this.push_context(node);
|
9187 | }
|
9188 |
|
9189 | VimLParser.prototype.parse_cmd_endtry = function() {
|
9190 | if (this.context[0].type != NODE_TRY && this.context[0].type != NODE_CATCH && this.context[0].type != NODE_FINALLY) {
|
9191 | throw Err("E602: :endtry without :try", this.ea.cmdpos);
|
9192 | }
|
9193 | if (this.context[0].type != NODE_TRY) {
|
9194 | this.pop_context();
|
9195 | }
|
9196 | var node = Node(NODE_ENDTRY);
|
9197 | node.pos = this.ea.cmdpos;
|
9198 | node.ea = this.ea;
|
9199 | this.context[0].endtry = node;
|
9200 | this.pop_context();
|
9201 | }
|
9202 |
|
9203 | VimLParser.prototype.parse_cmd_throw = function() {
|
9204 | var node = Node(NODE_THROW);
|
9205 | node.pos = this.ea.cmdpos;
|
9206 | node.ea = this.ea;
|
9207 | node.left = this.parse_expr();
|
9208 | this.add_node(node);
|
9209 | }
|
9210 |
|
9211 | VimLParser.prototype.parse_cmd_eval = function() {
|
9212 | var node = Node(NODE_EVAL);
|
9213 | node.pos = this.ea.cmdpos;
|
9214 | node.ea = this.ea;
|
9215 | node.left = this.parse_expr();
|
9216 | this.add_node(node);
|
9217 | }
|
9218 |
|
9219 | VimLParser.prototype.parse_cmd_echo = function() {
|
9220 | var node = Node(NODE_ECHO);
|
9221 | node.pos = this.ea.cmdpos;
|
9222 | node.ea = this.ea;
|
9223 | node.list = this.parse_exprlist();
|
9224 | this.add_node(node);
|
9225 | }
|
9226 |
|
9227 | VimLParser.prototype.parse_cmd_echon = function() {
|
9228 | var node = Node(NODE_ECHON);
|
9229 | node.pos = this.ea.cmdpos;
|
9230 | node.ea = this.ea;
|
9231 | node.list = this.parse_exprlist();
|
9232 | this.add_node(node);
|
9233 | }
|
9234 |
|
9235 | VimLParser.prototype.parse_cmd_echohl = function() {
|
9236 | var node = Node(NODE_ECHOHL);
|
9237 | node.pos = this.ea.cmdpos;
|
9238 | node.ea = this.ea;
|
9239 | node.str = "";
|
9240 | while (!this.ends_excmds(this.reader.peek())) {
|
9241 | node.str += this.reader.get();
|
9242 | }
|
9243 | this.add_node(node);
|
9244 | }
|
9245 |
|
9246 | VimLParser.prototype.parse_cmd_echomsg = function() {
|
9247 | var node = Node(NODE_ECHOMSG);
|
9248 | node.pos = this.ea.cmdpos;
|
9249 | node.ea = this.ea;
|
9250 | node.list = this.parse_exprlist();
|
9251 | this.add_node(node);
|
9252 | }
|
9253 |
|
9254 | VimLParser.prototype.parse_cmd_echoerr = function() {
|
9255 | var node = Node(NODE_ECHOERR);
|
9256 | node.pos = this.ea.cmdpos;
|
9257 | node.ea = this.ea;
|
9258 | node.list = this.parse_exprlist();
|
9259 | this.add_node(node);
|
9260 | }
|
9261 |
|
9262 | VimLParser.prototype.parse_cmd_execute = function() {
|
9263 | var node = Node(NODE_EXECUTE);
|
9264 | node.pos = this.ea.cmdpos;
|
9265 | node.ea = this.ea;
|
9266 | node.list = this.parse_exprlist();
|
9267 | this.add_node(node);
|
9268 | }
|
9269 |
|
9270 | VimLParser.prototype.parse_expr = function() {
|
9271 | return new ExprParser(this.reader).parse();
|
9272 | }
|
9273 |
|
9274 | VimLParser.prototype.parse_exprlist = function() {
|
9275 | var list = [];
|
9276 | while (TRUE) {
|
9277 | this.reader.skip_white();
|
9278 | var c = this.reader.peek();
|
9279 | if (c != "\"" && this.ends_excmds(c)) {
|
9280 | break;
|
9281 | }
|
9282 | var node = this.parse_expr();
|
9283 | viml_add(list, node);
|
9284 | }
|
9285 | return list;
|
9286 | }
|
9287 |
|
9288 | VimLParser.prototype.parse_lvalue_func = function() {
|
9289 | var p = new LvalueParser(this.reader);
|
9290 | var node = p.parse();
|
9291 | if (node.type == NODE_IDENTIFIER || node.type == NODE_CURLYNAME || node.type == NODE_SUBSCRIPT || node.type == NODE_DOT || node.type == NODE_OPTION || node.type == NODE_ENV || node.type == NODE_REG) {
|
9292 | return node;
|
9293 | }
|
9294 | throw Err("Invalid Expression", node.pos);
|
9295 | }
|
9296 |
|
9297 |
|
9298 | VimLParser.prototype.parse_lvalue = function() {
|
9299 | var p = new LvalueParser(this.reader);
|
9300 | var node = p.parse();
|
9301 | if (node.type == NODE_IDENTIFIER) {
|
9302 | if (!isvarname(node.value)) {
|
9303 | throw Err(viml_printf("E461: Illegal variable name: %s", node.value), node.pos);
|
9304 | }
|
9305 | }
|
9306 | if (node.type == NODE_IDENTIFIER || node.type == NODE_CURLYNAME || node.type == NODE_SUBSCRIPT || node.type == NODE_SLICE || node.type == NODE_DOT || node.type == NODE_OPTION || node.type == NODE_ENV || node.type == NODE_REG) {
|
9307 | return node;
|
9308 | }
|
9309 | throw Err("Invalid Expression", node.pos);
|
9310 | }
|
9311 |
|
9312 |
|
9313 | VimLParser.prototype.parse_constlvalue = function() {
|
9314 | var p = new LvalueParser(this.reader);
|
9315 | var node = p.parse();
|
9316 | if (node.type == NODE_IDENTIFIER) {
|
9317 | if (!isvarname(node.value)) {
|
9318 | throw Err(viml_printf("E461: Illegal variable name: %s", node.value), node.pos);
|
9319 | }
|
9320 | }
|
9321 | if (node.type == NODE_IDENTIFIER || node.type == NODE_CURLYNAME) {
|
9322 | return node;
|
9323 | }
|
9324 | else if (node.type == NODE_SUBSCRIPT || node.type == NODE_SLICE || node.type == NODE_DOT) {
|
9325 | throw Err("E996: Cannot lock a list or dict", node.pos);
|
9326 | }
|
9327 | else if (node.type == NODE_OPTION) {
|
9328 | throw Err("E996: Cannot lock an option", node.pos);
|
9329 | }
|
9330 | else if (node.type == NODE_ENV) {
|
9331 | throw Err("E996: Cannot lock an environment variable", node.pos);
|
9332 | }
|
9333 | else if (node.type == NODE_REG) {
|
9334 | throw Err("E996: Cannot lock a register", node.pos);
|
9335 | }
|
9336 | throw Err("Invalid Expression", node.pos);
|
9337 | }
|
9338 |
|
9339 | VimLParser.prototype.parse_lvaluelist = function() {
|
9340 | var list = [];
|
9341 | var node = this.parse_expr();
|
9342 | viml_add(list, node);
|
9343 | while (TRUE) {
|
9344 | this.reader.skip_white();
|
9345 | if (this.ends_excmds(this.reader.peek())) {
|
9346 | break;
|
9347 | }
|
9348 | var node = this.parse_lvalue();
|
9349 | viml_add(list, node);
|
9350 | }
|
9351 | return list;
|
9352 | }
|
9353 |
|
9354 |
|
9355 | VimLParser.prototype.parse_letlhs = function() {
|
9356 | var lhs = {"left":NIL, "list":NIL, "rest":NIL};
|
9357 | var tokenizer = new ExprTokenizer(this.reader);
|
9358 | if (tokenizer.peek().type == TOKEN_SQOPEN) {
|
9359 | tokenizer.get();
|
9360 | lhs.list = [];
|
9361 | while (TRUE) {
|
9362 | var node = this.parse_lvalue();
|
9363 | viml_add(lhs.list, node);
|
9364 | var token = tokenizer.get();
|
9365 | if (token.type == TOKEN_SQCLOSE) {
|
9366 | break;
|
9367 | }
|
9368 | else if (token.type == TOKEN_COMMA) {
|
9369 | continue;
|
9370 | }
|
9371 | else if (token.type == TOKEN_SEMICOLON) {
|
9372 | var node = this.parse_lvalue();
|
9373 | lhs.rest = node;
|
9374 | var token = tokenizer.get();
|
9375 | if (token.type == TOKEN_SQCLOSE) {
|
9376 | break;
|
9377 | }
|
9378 | else {
|
9379 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
9380 | }
|
9381 | }
|
9382 | else {
|
9383 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
9384 | }
|
9385 | }
|
9386 | }
|
9387 | else {
|
9388 | lhs.left = this.parse_lvalue();
|
9389 | }
|
9390 | return lhs;
|
9391 | }
|
9392 |
|
9393 |
|
9394 | VimLParser.prototype.parse_constlhs = function() {
|
9395 | var lhs = {"left":NIL, "list":NIL, "rest":NIL};
|
9396 | var tokenizer = new ExprTokenizer(this.reader);
|
9397 | if (tokenizer.peek().type == TOKEN_SQOPEN) {
|
9398 | tokenizer.get();
|
9399 | lhs.list = [];
|
9400 | while (TRUE) {
|
9401 | var node = this.parse_lvalue();
|
9402 | viml_add(lhs.list, node);
|
9403 | var token = tokenizer.get();
|
9404 | if (token.type == TOKEN_SQCLOSE) {
|
9405 | break;
|
9406 | }
|
9407 | else if (token.type == TOKEN_COMMA) {
|
9408 | continue;
|
9409 | }
|
9410 | else if (token.type == TOKEN_SEMICOLON) {
|
9411 | var node = this.parse_lvalue();
|
9412 | lhs.rest = node;
|
9413 | var token = tokenizer.get();
|
9414 | if (token.type == TOKEN_SQCLOSE) {
|
9415 | break;
|
9416 | }
|
9417 | else {
|
9418 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
9419 | }
|
9420 | }
|
9421 | else {
|
9422 | throw Err(viml_printf("E475 Invalid argument: %s", token.value), token.pos);
|
9423 | }
|
9424 | }
|
9425 | }
|
9426 | else {
|
9427 | lhs.left = this.parse_constlvalue();
|
9428 | }
|
9429 | return lhs;
|
9430 | }
|
9431 |
|
9432 | VimLParser.prototype.ends_excmds = function(c) {
|
9433 | return c == "" || c == "|" || c == "\"" || c == "<EOF>" || c == "<EOL>";
|
9434 | }
|
9435 |
|
9436 |
|
9437 | VimLParser.prototype.parse_wincmd = function() {
|
9438 | var c = this.reader.getn(1);
|
9439 | if (c == "") {
|
9440 | throw Err("E471: Argument required", this.reader.getpos());
|
9441 | }
|
9442 | else if (c == "g" || c == "\x07") {
|
9443 |
|
9444 | var c2 = this.reader.getn(1);
|
9445 | if (c2 == "" || iswhite(c2)) {
|
9446 | throw Err("E474: Invalid Argument", this.reader.getpos());
|
9447 | }
|
9448 | }
|
9449 | var end = this.reader.getpos();
|
9450 | this.reader.skip_white();
|
9451 | if (!this.ends_excmds(this.reader.peek())) {
|
9452 | throw Err("E474: Invalid Argument", this.reader.getpos());
|
9453 | }
|
9454 | var node = Node(NODE_EXCMD);
|
9455 | node.pos = this.ea.cmdpos;
|
9456 | node.ea = this.ea;
|
9457 | node.str = this.reader.getstr(this.ea.linepos, end);
|
9458 | this.add_node(node);
|
9459 | }
|
9460 |
|
9461 |
|
9462 | VimLParser.prototype.parse_cmd_syntax = function() {
|
9463 | var end = this.reader.getpos();
|
9464 | while (TRUE) {
|
9465 | var end = this.reader.getpos();
|
9466 | var c = this.reader.peek();
|
9467 | if (c == "/" || c == "'" || c == "\"") {
|
9468 | this.reader.getn(1);
|
9469 | this.parse_pattern(c);
|
9470 | }
|
9471 | else if (c == "=") {
|
9472 | this.reader.getn(1);
|
9473 | this.parse_pattern(" ");
|
9474 | }
|
9475 | else if (this.ends_excmds(c)) {
|
9476 | break;
|
9477 | }
|
9478 | this.reader.getn(1);
|
9479 | }
|
9480 | var node = Node(NODE_EXCMD);
|
9481 | node.pos = this.ea.cmdpos;
|
9482 | node.ea = this.ea;
|
9483 | node.str = this.reader.getstr(this.ea.linepos, end);
|
9484 | this.add_node(node);
|
9485 | }
|
9486 |
|
9487 | VimLParser.prototype.neovim_additional_commands = [{"name":"rshada", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"wshada", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}];
|
9488 | VimLParser.prototype.neovim_removed_commands = [{"name":"Print", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"fixdel", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"helpfind", "minlen":5, "flags":"EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"open", "minlen":1, "flags":"RANGE|BANG|EXTRA", "parser":"parse_cmd_common"}, {"name":"shell", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tearoff", "minlen":2, "flags":"NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"gvim", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}];
|
9489 |
|
9490 |
|
9491 | VimLParser.prototype.builtin_commands = [{"name":"append", "minlen":1, "flags":"BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_append"}, {"name":"abbreviate", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"abclear", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"aboveleft", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"all", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"amenu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"anoremenu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"args", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argadd", "minlen":4, "flags":"BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argdelete", "minlen":4, "flags":"BANG|RANGE|NOTADR|FILES|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argedit", "minlen":4, "flags":"BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argdo", "minlen":5, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"argglobal", "minlen":4, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"arglocal", "minlen":4, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"argument", "minlen":4, "flags":"BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"ascii", "minlen":2, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"autocmd", "minlen":2, "flags":"BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"augroup", "minlen":3, "flags":"BANG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"aunmenu", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"buffer", "minlen":1, "flags":"BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bNext", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"ball", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"badd", "minlen":3, "flags":"NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"bdelete", "minlen":2, "flags":"BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"behave", "minlen":2, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"belowright", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"bfirst", "minlen":2, "flags":"BANG|RANGE|NOTADR|TRLBAR", "parser":"parse_cmd_common"}, {"name":"blast", "minlen":2, "flags":"BANG|RANGE|NOTADR|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bmodified", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bnext", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"botright", "minlen":2, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"bprevious", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"brewind", "minlen":2, "flags":"BANG|RANGE|NOTADR|TRLBAR", "parser":"parse_cmd_common"}, {"name":"break", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_break"}, {"name":"breakadd", "minlen":6, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"breakdel", "minlen":6, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"breaklist", "minlen":6, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"browse", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"bufdo", "minlen":5, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"buffers", "minlen":7, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"bunload", "minlen":3, "flags":"BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"bwipeout", "minlen":2, "flags":"BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"change", "minlen":1, "flags":"BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"cNext", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cNfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cabbrev", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cabclear", "minlen":4, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"caddbuffer", "minlen":3, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"caddexpr", "minlen":5, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"caddfile", "minlen":5, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"call", "minlen":3, "flags":"RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_call"}, {"name":"catch", "minlen":3, "flags":"EXTRA|SBOXOK|CMDWIN", "parser":"parse_cmd_catch"}, {"name":"cbuffer", "minlen":2, "flags":"BANG|RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cc", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cclose", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cd", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"center", "minlen":2, "flags":"TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"cexpr", "minlen":3, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cfile", "minlen":2, "flags":"TRLBAR|FILE1|BANG", "parser":"parse_cmd_common"}, {"name":"cfirst", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cgetbuffer", "minlen":5, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cgetexpr", "minlen":5, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cgetfile", "minlen":2, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"changes", "minlen":7, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"chdir", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"checkpath", "minlen":3, "flags":"TRLBAR|BANG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"checktime", "minlen":6, "flags":"RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"clist", "minlen":2, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"clast", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"close", "minlen":3, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cnext", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cnewer", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cnfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cnoremap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cnoreabbrev", "minlen":6, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"copy", "minlen":2, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"colder", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"colorscheme", "minlen":4, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"command", "minlen":3, "flags":"EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"comclear", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"compiler", "minlen":4, "flags":"BANG|TRLBAR|WORD1|CMDWIN", "parser":"parse_cmd_common"}, {"name":"continue", "minlen":3, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_continue"}, {"name":"confirm", "minlen":4, "flags":"NEEDARG|EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"copen", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"cprevious", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cpfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cquit", "minlen":2, "flags":"TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"crewind", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"cscope", "minlen":2, "flags":"EXTRA|NOTRLCOM|XFILE", "parser":"parse_cmd_common"}, {"name":"cstag", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"cunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cunabbrev", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"cwindow", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"delete", "minlen":1, "flags":"RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"delmarks", "minlen":4, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"debug", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"debuggreedy", "minlen":6, "flags":"RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"delcommand", "minlen":4, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"delfunction", "minlen":4, "flags":"BANG|NEEDARG|WORD1|CMDWIN", "parser":"parse_cmd_delfunction"}, {"name":"diffupdate", "minlen":3, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffget", "minlen":5, "flags":"RANGE|EXTRA|TRLBAR|MODIFY", "parser":"parse_cmd_common"}, {"name":"diffoff", "minlen":5, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffpatch", "minlen":5, "flags":"EXTRA|FILE1|TRLBAR|MODIFY", "parser":"parse_cmd_common"}, {"name":"diffput", "minlen":6, "flags":"RANGE|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffsplit", "minlen":5, "flags":"EXTRA|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"diffthis", "minlen":5, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"digraphs", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"display", "minlen":2, "flags":"EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"djump", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"dlist", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"doautocmd", "minlen":2, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"doautoall", "minlen":7, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"drop", "minlen":2, "flags":"FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"dsearch", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"dsplit", "minlen":3, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"edit", "minlen":1, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"earlier", "minlen":2, "flags":"TRLBAR|EXTRA|NOSPC|CMDWIN", "parser":"parse_cmd_common"}, {"name":"echo", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echo"}, {"name":"echoerr", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echoerr"}, {"name":"echohl", "minlen":5, "flags":"EXTRA|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_echohl"}, {"name":"echomsg", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echomsg"}, {"name":"echon", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_echon"}, {"name":"else", "minlen":2, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_else"}, {"name":"elseif", "minlen":5, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_elseif"}, {"name":"emenu", "minlen":2, "flags":"NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"endif", "minlen":2, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endif"}, {"name":"endfor", "minlen":5, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endfor"}, {"name":"endfunction", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_endfunction"}, {"name":"endtry", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endtry"}, {"name":"endwhile", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_endwhile"}, {"name":"enew", "minlen":3, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"eval", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_eval"}, {"name":"ex", "minlen":2, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"execute", "minlen":3, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_execute"}, {"name":"exit", "minlen":3, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"exusage", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"file", "minlen":1, "flags":"RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"files", "minlen":5, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"filetype", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"find", "minlen":3, "flags":"RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"finally", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_finally"}, {"name":"finish", "minlen":4, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_finish"}, {"name":"first", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"fixdel", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"fold", "minlen":2, "flags":"RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"foldclose", "minlen":5, "flags":"RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"folddoopen", "minlen":5, "flags":"RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"folddoclosed", "minlen":7, "flags":"RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"foldopen", "minlen":5, "flags":"RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"for", "minlen":3, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_for"}, {"name":"function", "minlen":2, "flags":"EXTRA|BANG|CMDWIN", "parser":"parse_cmd_function"}, {"name":"global", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"goto", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"grep", "minlen":2, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"grepadd", "minlen":5, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"gui", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"gvim", "minlen":2, "flags":"BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"hardcopy", "minlen":2, "flags":"RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG", "parser":"parse_cmd_common"}, {"name":"help", "minlen":1, "flags":"BANG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"helpfind", "minlen":5, "flags":"EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"helpgrep", "minlen":5, "flags":"EXTRA|NOTRLCOM|NEEDARG", "parser":"parse_cmd_common"}, {"name":"helptags", "minlen":5, "flags":"NEEDARG|FILES|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"highlight", "minlen":2, "flags":"BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"hide", "minlen":3, "flags":"BANG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"history", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"insert", "minlen":1, "flags":"BANG|RANGE|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_insert"}, {"name":"iabbrev", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"iabclear", "minlen":4, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"if", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_if"}, {"name":"ijump", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"ilist", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"imap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"imapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"imenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"inoremap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"inoreabbrev", "minlen":6, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"inoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"intro", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"isearch", "minlen":2, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"isplit", "minlen":3, "flags":"BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA", "parser":"parse_cmd_common"}, {"name":"iunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"iunabbrev", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"iunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"join", "minlen":1, "flags":"BANG|RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"jumps", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"k", "minlen":1, "flags":"RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"keepalt", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"keepmarks", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"keepjumps", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"keeppatterns", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"lNext", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lNfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"list", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"laddexpr", "minlen":3, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"laddbuffer", "minlen":5, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"laddfile", "minlen":5, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"last", "minlen":2, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"language", "minlen":3, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"later", "minlen":3, "flags":"TRLBAR|EXTRA|NOSPC|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lbuffer", "minlen":2, "flags":"BANG|RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lcd", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lchdir", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lclose", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lcscope", "minlen":3, "flags":"EXTRA|NOTRLCOM|XFILE", "parser":"parse_cmd_common"}, {"name":"left", "minlen":2, "flags":"TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"leftabove", "minlen":5, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"let", "minlen":3, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_let"}, {"name":"const", "minlen":4, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_const"}, {"name":"lexpr", "minlen":3, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lfile", "minlen":2, "flags":"TRLBAR|FILE1|BANG", "parser":"parse_cmd_common"}, {"name":"lfirst", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lgetbuffer", "minlen":5, "flags":"RANGE|NOTADR|WORD1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lgetexpr", "minlen":5, "flags":"NEEDARG|WORD1|NOTRLCOM|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lgetfile", "minlen":2, "flags":"TRLBAR|FILE1", "parser":"parse_cmd_common"}, {"name":"lgrep", "minlen":3, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lgrepadd", "minlen":6, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lhelpgrep", "minlen":2, "flags":"EXTRA|NOTRLCOM|NEEDARG", "parser":"parse_cmd_common"}, {"name":"ll", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"llast", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"list", "minlen":3, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lmake", "minlen":4, "flags":"BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lnext", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lnewer", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lnfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"loadkeymap", "minlen":5, "flags":"CMDWIN", "parser":"parse_cmd_loadkeymap"}, {"name":"loadview", "minlen":2, "flags":"FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lockmarks", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"lockvar", "minlen":5, "flags":"BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_lockvar"}, {"name":"lolder", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lopen", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"lprevious", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lpfile", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"lrewind", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR|BANG", "parser":"parse_cmd_common"}, {"name":"ls", "minlen":2, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ltag", "minlen":2, "flags":"NOTADR|TRLBAR|BANG|WORD1", "parser":"parse_cmd_common"}, {"name":"lunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lua", "minlen":3, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_lua"}, {"name":"luado", "minlen":4, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"luafile", "minlen":4, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"lvimgrep", "minlen":2, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lvimgrepadd", "minlen":9, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"lwindow", "minlen":2, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"move", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"mark", "minlen":2, "flags":"RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"make", "minlen":3, "flags":"BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"map", "minlen":3, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mapclear", "minlen":4, "flags":"EXTRA|BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"marks", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"match", "minlen":3, "flags":"RANGE|NOTADR|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"menu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"menutranslate", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"messages", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mkexrc", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mksession", "minlen":3, "flags":"BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"mkspell", "minlen":4, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"mkvimrc", "minlen":3, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mkview", "minlen":5, "flags":"BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"mode", "minlen":3, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"mzscheme", "minlen":2, "flags":"RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN|SBOXOK", "parser":"parse_cmd_mzscheme"}, {"name":"mzfile", "minlen":3, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nbclose", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nbkey", "minlen":2, "flags":"EXTRA|NOTADR|NEEDARG", "parser":"parse_cmd_common"}, {"name":"nbstart", "minlen":3, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"next", "minlen":1, "flags":"RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"new", "minlen":3, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"nmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"noautocmd", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"noremap", "minlen":2, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nohlsearch", "minlen":3, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"noreabbrev", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"noremenu", "minlen":6, "flags":"RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"normal", "minlen":4, "flags":"RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"number", "minlen":2, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nunmap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"nunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"oldfiles", "minlen":2, "flags":"BANG|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"open", "minlen":1, "flags":"RANGE|BANG|EXTRA", "parser":"parse_cmd_common"}, {"name":"omap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"omapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"omenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"only", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"onoremap", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"onoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"options", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"ounmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ounmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ownsyntax", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"pclose", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"pedit", "minlen":3, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"perl", "minlen":2, "flags":"RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_perl"}, {"name":"print", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"profdel", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"profile", "minlen":4, "flags":"BANG|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"promptfind", "minlen":3, "flags":"EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"promptrepl", "minlen":7, "flags":"EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"perldo", "minlen":5, "flags":"RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"pop", "minlen":2, "flags":"RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"popup", "minlen":4, "flags":"NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"ppop", "minlen":2, "flags":"RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"preserve", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"previous", "minlen":4, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"psearch", "minlen":2, "flags":"BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA", "parser":"parse_cmd_common"}, {"name":"ptag", "minlen":2, "flags":"RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptNext", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptfirst", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptjump", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"ptlast", "minlen":3, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"ptnext", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptprevious", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptrewind", "minlen":3, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"ptselect", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"put", "minlen":2, "flags":"RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"pwd", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"py3", "minlen":3, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_python3"}, {"name":"python3", "minlen":7, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_python3"}, {"name":"py3file", "minlen":4, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"python", "minlen":2, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_python"}, {"name":"pyfile", "minlen":3, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"pydo", "minlen":3, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"py3do", "minlen":4, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"quit", "minlen":1, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"quitall", "minlen":5, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"qall", "minlen":2, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"read", "minlen":1, "flags":"BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"recover", "minlen":3, "flags":"BANG|FILE1|TRLBAR", "parser":"parse_cmd_common"}, {"name":"redo", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"redir", "minlen":4, "flags":"BANG|FILES|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"redraw", "minlen":4, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"redrawstatus", "minlen":7, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"registers", "minlen":3, "flags":"EXTRA|NOTRLCOM|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"resize", "minlen":3, "flags":"RANGE|NOTADR|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"retab", "minlen":3, "flags":"TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"return", "minlen":4, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_return"}, {"name":"rewind", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"right", "minlen":2, "flags":"TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"rightbelow", "minlen":6, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"ruby", "minlen":3, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_ruby"}, {"name":"rubydo", "minlen":5, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"rubyfile", "minlen":5, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"rundo", "minlen":4, "flags":"NEEDARG|FILE1", "parser":"parse_cmd_common"}, {"name":"runtime", "minlen":2, "flags":"BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"rviminfo", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"substitute", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sNext", "minlen":2, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sandbox", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"sargument", "minlen":2, "flags":"BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sall", "minlen":3, "flags":"BANG|RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"saveas", "minlen":3, "flags":"BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbuffer", "minlen":2, "flags":"BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbNext", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sball", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbfirst", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"sblast", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbmodified", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbnext", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbprevious", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sbrewind", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"scriptnames", "minlen":3, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"scriptencoding", "minlen":7, "flags":"WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"scscope", "minlen":3, "flags":"EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"set", "minlen":2, "flags":"TRLBAR|EXTRA|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"setfiletype", "minlen":4, "flags":"TRLBAR|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"setglobal", "minlen":4, "flags":"TRLBAR|EXTRA|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"setlocal", "minlen":4, "flags":"TRLBAR|EXTRA|CMDWIN|SBOXOK", "parser":"parse_cmd_common"}, {"name":"sfind", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sfirst", "minlen":4, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"shell", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"simalt", "minlen":3, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sign", "minlen":3, "flags":"NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"silent", "minlen":3, "flags":"NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sleep", "minlen":2, "flags":"RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"slast", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"smagic", "minlen":2, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"smap", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"smapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"smenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"snext", "minlen":2, "flags":"RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sniff", "minlen":3, "flags":"EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"snomagic", "minlen":3, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN", "parser":"parse_cmd_common"}, {"name":"snoremap", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"snoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sort", "minlen":3, "flags":"RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY", "parser":"parse_cmd_common"}, {"name":"source", "minlen":2, "flags":"BANG|FILE1|TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"spelldump", "minlen":6, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellgood", "minlen":3, "flags":"BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellinfo", "minlen":6, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellrepall", "minlen":6, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellundo", "minlen":6, "flags":"BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"spellwrong", "minlen":6, "flags":"BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR", "parser":"parse_cmd_common"}, {"name":"split", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sprevious", "minlen":3, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"srewind", "minlen":3, "flags":"EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"stop", "minlen":2, "flags":"TRLBAR|BANG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"stag", "minlen":3, "flags":"RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"startinsert", "minlen":4, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"startgreplace", "minlen":6, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"startreplace", "minlen":6, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"stopinsert", "minlen":5, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"stjump", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"stselect", "minlen":3, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"sunhide", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"sunmap", "minlen":4, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"suspend", "minlen":3, "flags":"TRLBAR|BANG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"sview", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"swapname", "minlen":2, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"syntax", "minlen":2, "flags":"EXTRA|NOTRLCOM|CMDWIN", "parser":"parse_cmd_syntax"}, {"name":"syntime", "minlen":5, "flags":"NEEDARG|WORD1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"syncbind", "minlen":4, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"t", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"tNext", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"tabNext", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabclose", "minlen":4, "flags":"RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tabdo", "minlen":4, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"tabedit", "minlen":4, "flags":"BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabfind", "minlen":4, "flags":"BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|NEEDARG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabfirst", "minlen":6, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"tablast", "minlen":4, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabmove", "minlen":4, "flags":"RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabnew", "minlen":6, "flags":"BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabnext", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabonly", "minlen":4, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tabprevious", "minlen":4, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabrewind", "minlen":4, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"tabs", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tab", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"tag", "minlen":2, "flags":"RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"tags", "minlen":4, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tcl", "minlen":2, "flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_tcl"}, {"name":"tcldo", "minlen":4, "flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tclfile", "minlen":4, "flags":"RANGE|FILE1|NEEDARG|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tearoff", "minlen":2, "flags":"NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tfirst", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"throw", "minlen":2, "flags":"EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_throw"}, {"name":"tjump", "minlen":2, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"tlast", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"tmenu", "minlen":2, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"tnext", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"topleft", "minlen":2, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"tprevious", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"trewind", "minlen":2, "flags":"RANGE|NOTADR|BANG|TRLBAR|ZEROR", "parser":"parse_cmd_common"}, {"name":"try", "minlen":3, "flags":"TRLBAR|SBOXOK|CMDWIN", "parser":"parse_cmd_try"}, {"name":"tselect", "minlen":2, "flags":"BANG|TRLBAR|WORD1", "parser":"parse_cmd_common"}, {"name":"tunmenu", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"undo", "minlen":1, "flags":"RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"undojoin", "minlen":5, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"undolist", "minlen":5, "flags":"TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unabbreviate", "minlen":3, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unhide", "minlen":3, "flags":"RANGE|NOTADR|COUNT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"unlet", "minlen":3, "flags":"BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_unlet"}, {"name":"unlockvar", "minlen":4, "flags":"BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN", "parser":"parse_cmd_unlockvar"}, {"name":"unmap", "minlen":3, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unmenu", "minlen":4, "flags":"BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"unsilent", "minlen":3, "flags":"NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"update", "minlen":2, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vglobal", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN", "parser":"parse_cmd_common"}, {"name":"version", "minlen":2, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"verbose", "minlen":4, "flags":"NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vertical", "minlen":4, "flags":"NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"vimgrep", "minlen":3, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"vimgrepadd", "minlen":8, "flags":"RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE", "parser":"parse_cmd_common"}, {"name":"visual", "minlen":2, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"viusage", "minlen":3, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"view", "minlen":3, "flags":"BANG|FILE1|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vnew", "minlen":3, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vsplit", "minlen":2, "flags":"BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"vunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"vunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"windo", "minlen":5, "flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "parser":"parse_cmd_common"}, {"name":"write", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"wNext", "minlen":2, "flags":"RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wall", "minlen":2, "flags":"BANG|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"while", "minlen":2, "flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "parser":"parse_cmd_while"}, {"name":"winsize", "minlen":2, "flags":"EXTRA|NEEDARG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wincmd", "minlen":4, "flags":"NEEDARG|WORD1|RANGE|NOTADR", "parser":"parse_wincmd"}, {"name":"winpos", "minlen":4, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"wnext", "minlen":2, "flags":"RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wprevious", "minlen":2, "flags":"RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wq", "minlen":2, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wqall", "minlen":3, "flags":"BANG|FILE1|ARGOPT|DFLALL|TRLBAR", "parser":"parse_cmd_common"}, {"name":"wsverb", "minlen":2, "flags":"EXTRA|NOTADR|NEEDARG", "parser":"parse_cmd_common"}, {"name":"wundo", "minlen":2, "flags":"BANG|NEEDARG|FILE1", "parser":"parse_cmd_common"}, {"name":"wviminfo", "minlen":2, "flags":"BANG|FILE1|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xit", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xall", "minlen":2, "flags":"BANG|TRLBAR", "parser":"parse_cmd_common"}, {"name":"xmapclear", "minlen":5, "flags":"EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xmenu", "minlen":3, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xnoremap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xnoremenu", "minlen":7, "flags":"RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xunmap", "minlen":2, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"xunmenu", "minlen":5, "flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "parser":"parse_cmd_common"}, {"name":"yank", "minlen":1, "flags":"RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"z", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"!", "minlen":1, "flags":"RANGE|WHOLEFOLD|BANG|FILES|CMDWIN", "parser":"parse_cmd_common"}, {"name":"#", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"&", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"*", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"<", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"=", "minlen":1, "flags":"RANGE|TRLBAR|DFLALL|EXFLAGS|CMDWIN", "parser":"parse_cmd_common"}, {"name":">", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"name":"@", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"Next", "minlen":1, "flags":"EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR", "parser":"parse_cmd_common"}, {"name":"Print", "minlen":1, "flags":"RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN", "parser":"parse_cmd_common"}, {"name":"X", "minlen":1, "flags":"TRLBAR", "parser":"parse_cmd_common"}, {"name":"~", "minlen":1, "flags":"RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"cbottom", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":3, "name":"cdo", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":3, "name":"cfdo", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"chistory", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN", "minlen":3, "name":"clearjumps", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM", "minlen":4, "name":"filter", "parser":"parse_cmd_common"}, {"flags":"RANGE|NOTADR|COUNT|TRLBAR", "minlen":5, "name":"helpclose", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"lbottom", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":2, "name":"ldo", "parser":"parse_cmd_common"}, {"flags":"BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL", "minlen":3, "name":"lfdo", "parser":"parse_cmd_common"}, {"flags":"TRLBAR", "minlen":3, "name":"lhistory", "parser":"parse_cmd_common"}, {"flags":"BANG|EXTRA|TRLBAR|CMDWIN", "minlen":3, "name":"llist", "parser":"parse_cmd_common"}, {"flags":"NEEDARG|EXTRA|NOTRLCOM", "minlen":3, "name":"noswapfile", "parser":"parse_cmd_common"}, {"flags":"BANG|FILE1|NEEDARG|TRLBAR|SBOXOK|CMDWIN", "minlen":2, "name":"packadd", "parser":"parse_cmd_common"}, {"flags":"BANG|TRLBAR|SBOXOK|CMDWIN", "minlen":5, "name":"packloadall", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN|SBOXOK", "minlen":3, "name":"smile", "parser":"parse_cmd_common"}, {"flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "minlen":3, "name":"pyx", "parser":"parse_cmd_common"}, {"flags":"RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN", "minlen":4, "name":"pyxdo", "parser":"parse_cmd_common"}, {"flags":"RANGE|EXTRA|NEEDARG|CMDWIN", "minlen":7, "name":"pythonx", "parser":"parse_cmd_common"}, {"flags":"RANGE|FILE1|NEEDARG|CMDWIN", "minlen":4, "name":"pyxfile", "parser":"parse_cmd_common"}, {"flags":"RANGE|BANG|FILES|CMDWIN", "minlen":3, "name":"terminal", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "minlen":3, "name":"tmap", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|CMDWIN", "minlen":5, "name":"tmapclear", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "minlen":3, "name":"tnoremap", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN", "minlen":5, "name":"tunmap", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":4, "name":"cabove", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"cafter", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"cbefore", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":4, "name":"cbelow", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NOTRLCOM|SBOXOK|CMDWIN", "minlen":4, "name":"const", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"labove", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"lafter", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":3, "name":"lbefore", "parser":"parse_cmd_common"}, {"flags":"RANGE|COUNT|TRLBAR", "minlen":4, "name":"lbelow", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN", "minlen":7, "name":"redrawtabline", "parser":"parse_cmd_common"}, {"flags":"WORD1|TRLBAR|CMDWIN", "minlen":7, "name":"scriptversion", "parser":"parse_cmd_common"}, {"flags":"BANG|FILE1|TRLBAR|CMDWIN", "minlen":2, "name":"tcd", "parser":"parse_cmd_common"}, {"flags":"BANG|FILE1|TRLBAR|CMDWIN", "minlen":3, "name":"tchdir", "parser":"parse_cmd_common"}, {"flags":"RANGE|ZEROR|EXTRA|TRLBAR|NOTRLCOM|CTRLV|CMDWIN", "minlen":3, "name":"tlmenu", "parser":"parse_cmd_common"}, {"flags":"RANGE|ZEROR|EXTRA|TRLBAR|NOTRLCOM|CTRLV|CMDWIN", "minlen":3, "name":"tlnoremenu", "parser":"parse_cmd_common"}, {"flags":"RANGE|ZEROR|EXTRA|TRLBAR|NOTRLCOM|CTRLV|CMDWIN", "minlen":3, "name":"tlunmenu", "parser":"parse_cmd_common"}, {"flags":"EXTRA|TRLBAR|CMDWIN", "minlen":2, "name":"xrestore", "parser":"parse_cmd_common"}, {"flags":"EXTRA|BANG|SBOXOK|CMDWIN", "minlen":3, "name":"def", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NEEDARG|TRLBAR|CMDWIN", "minlen":4, "name":"disassemble", "parser":"parse_cmd_common"}, {"flags":"TRLBAR|CMDWIN", "minlen":4, "name":"enddef", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NOTRLCOM", "minlen":3, "name":"export", "parser":"parse_cmd_common"}, {"flags":"EXTRA|NOTRLCOM", "minlen":3, "name":"import", "parser":"parse_cmd_common"}, {"flags":"BANG|RANGE|NEEDARG|EXTRA|TRLBAR", "minlen":7, "name":"spellrare", "parser":"parse_cmd_common"}, {"flags":"", "minlen":4, "name":"vim9script", "parser":"parse_cmd_common"}];
|
9492 |
|
9493 |
|
9494 | VimLParser.prototype.builtin_functions = [{"name":"abs", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"acos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"add", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"and", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"append", "min_argc":2, "max_argc":2, "argtype":"FEARG_LAST"}, {"name":"appendbufline", "min_argc":3, "max_argc":3, "argtype":"FEARG_LAST"}, {"name":"argc", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"argidx", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"arglistid", "min_argc":0, "max_argc":2, "argtype":"0"}, {"name":"argv", "min_argc":0, "max_argc":2, "argtype":"0"}, {"name":"asin", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"assert_beeps", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"assert_equal", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_equalfile", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"assert_exception", "min_argc":1, "max_argc":2, "argtype":"0"}, {"name":"assert_fails", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"assert_false", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"assert_inrange", "min_argc":3, "max_argc":4, "argtype":"FEARG_3"}, {"name":"assert_match", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_notequal", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_notmatch", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"assert_report", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"assert_true", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"atan", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"atan2", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"balloon_gettext", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"balloon_show", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"balloon_split", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"browse", "min_argc":4, "max_argc":4, "argtype":"0"}, {"name":"browsedir", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"bufadd", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufexists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buffer_exists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buffer_name", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buffer_number", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"buflisted", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufload", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufloaded", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufname", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufnr", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"bufwinid", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"bufwinnr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"byte2line", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"byteidx", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"byteidxcomp", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"call", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ceil", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_canread", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_close", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_close_in", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_evalexpr", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_evalraw", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_getbufnr", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_getjob", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_info", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"ch_log", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_logfile", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_open", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_read", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_readblob", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_readraw", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_sendexpr", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_sendraw", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"ch_setoptions", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"ch_status", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"changenr", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"char2nr", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"chdir", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"cindent", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"clearmatches", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"col", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"complete", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"complete_add", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"complete_check", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"complete_info", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"confirm", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"copy", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"cos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"cosh", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"count", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"cscope_connection", "min_argc":0, "max_argc":3, "argtype":"0"}, {"name":"cursor", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"debugbreak", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"deepcopy", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"delete", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"deletebufline", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"did_filetype", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"diff_filler", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"diff_hlID", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"echoraw", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"empty", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"environ", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"escape", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"eval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"eventhandler", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"executable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"execute", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"exepath", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"exists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"exp", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"expand", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"expandcmd", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"extend", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"feedkeys", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"file_readable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"filereadable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"filewritable", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"filter", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"finddir", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"findfile", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"float2nr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"floor", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"fmod", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"fnameescape", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"fnamemodify", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"foldclosed", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foldclosedend", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foldlevel", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foldtext", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"foldtextresult", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"foreground", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"funcref", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"function", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"garbagecollect", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"get", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getbufinfo", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getbufline", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getbufvar", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getchangelist", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getchar", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getcharmod", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcharsearch", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdline", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdpos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdtype", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcmdwintype", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcompletion", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getcurpos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getcwd", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"getenv", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getfontname", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getfperm", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getfsize", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getftime", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getftype", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getimstatus", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getjumplist", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"getline", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"getloclist", "min_argc":1, "max_argc":2, "argtype":"0"}, {"name":"getmatches", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getmousepos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getpid", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getqflist", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"getreg", "min_argc":0, "max_argc":3, "argtype":"FEARG_1"}, {"name":"getregtype", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"gettabinfo", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"gettabvar", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"gettabwinvar", "min_argc":3, "max_argc":4, "argtype":"FEARG_1"}, {"name":"gettagstack", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getwininfo", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getwinpos", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"getwinposx", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getwinposy", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"getwinvar", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"glob", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"glob2regpat", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"globpath", "min_argc":2, "max_argc":5, "argtype":"FEARG_2"}, {"name":"has", "min_argc":1, "max_argc":1, "argtype":"0"}, {"name":"has_key", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"haslocaldir", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"hasmapto", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"highlightID", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"highlight_exists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"histadd", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"histdel", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"histget", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"histnr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"hlID", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"hlexists", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"hostname", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"iconv", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"indent", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"index", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"input", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"inputdialog", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"inputlist", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"inputrestore", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"inputsave", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"inputsecret", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"insert", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"interrupt", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"invert", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"isdirectory", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"isinf", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"islocked", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"isnan", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"items", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_getchannel", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_info", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_setoptions", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"job_start", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"job_status", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"job_stop", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"join", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"js_decode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"js_encode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"json_decode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"json_encode", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"keys", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"last_buffer_nr", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"len", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"libcall", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"libcallnr", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"line", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"line2byte", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"lispindent", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"list2str", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"listener_add", "min_argc":1, "max_argc":2, "argtype":"FEARG_2"}, {"name":"listener_flush", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"listener_remove", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"localtime", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"log", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"log10", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"luaeval", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"map", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"maparg", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"mapcheck", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"match", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchadd", "min_argc":2, "max_argc":5, "argtype":"FEARG_1"}, {"name":"matchaddpos", "min_argc":2, "max_argc":5, "argtype":"FEARG_1"}, {"name":"matcharg", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"matchdelete", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"matchend", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchlist", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchstr", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"matchstrpos", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"max", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"min", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"mkdir", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"mode", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"mzeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"nextnonblank", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"nr2char", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"or", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"pathshorten", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"perleval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_atcursor", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_beval", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_clear", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"popup_close", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_create", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_dialog", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_filter_menu", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"popup_filter_yesno", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"popup_findinfo", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"popup_findpreview", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"popup_getoptions", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_getpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_hide", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"popup_locate", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"popup_menu", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_move", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_notification", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_setoptions", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_settext", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"popup_show", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pow", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prevnonblank", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"printf", "min_argc":1, "max_argc":19, "argtype":"FEARG_2"}, {"name":"prompt_setcallback", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prompt_setinterrupt", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prompt_setprompt", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_add", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"prop_clear", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"prop_find", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_list", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_remove", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"prop_type_add", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_change", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_delete", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_get", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"prop_type_list", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pum_getpos", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"pumvisible", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"py3eval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pyeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"pyxeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"rand", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"range", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"readdir", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"readfile", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"reg_executing", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"reg_recording", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"reltime", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"reltimefloat", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"reltimestr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"remote_expr", "min_argc":2, "max_argc":4, "argtype":"FEARG_1"}, {"name":"remote_foreground", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"remote_peek", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"remote_read", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"remote_send", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"remote_startserver", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"remove", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"rename", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"repeat", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"resolve", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"reverse", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"round", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"rubyeval", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"screenattr", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"screenchar", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"screenchars", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"screencol", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"screenpos", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"screenrow", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"screenstring", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"search", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"searchdecl", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"searchpair", "min_argc":3, "max_argc":7, "argtype":"0"}, {"name":"searchpairpos", "min_argc":3, "max_argc":7, "argtype":"0"}, {"name":"searchpos", "min_argc":1, "max_argc":4, "argtype":"FEARG_1"}, {"name":"server2client", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"serverlist", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"setbufline", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"setbufvar", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"setcharsearch", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"setcmdpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"setenv", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"setfperm", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"setline", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"setloclist", "min_argc":2, "max_argc":4, "argtype":"FEARG_2"}, {"name":"setmatches", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"setpos", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"setqflist", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"setreg", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"settabvar", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"settabwinvar", "min_argc":4, "max_argc":4, "argtype":"FEARG_4"}, {"name":"settagstack", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"setwinvar", "min_argc":3, "max_argc":3, "argtype":"FEARG_3"}, {"name":"sha256", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"shellescape", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"shiftwidth", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_define", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sign_getdefined", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_getplaced", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sign_jump", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"sign_place", "min_argc":4, "max_argc":5, "argtype":"FEARG_1"}, {"name":"sign_placelist", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_undefine", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sign_unplace", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sign_unplacelist", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"simplify", "min_argc":1, "max_argc":1, "argtype":"0"}, {"name":"sin", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sinh", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"sort", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"sound_clear", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"sound_playevent", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sound_playfile", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"sound_stop", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"soundfold", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"spellbadword", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"spellsuggest", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"split", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"sqrt", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"srand", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"state", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"str2float", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"str2list", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"str2nr", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strcharpart", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strchars", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strdisplaywidth", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strftime", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strgetchar", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"stridx", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"string", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"strlen", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"strpart", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strptime", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"strridx", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"strtrans", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"strwidth", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"submatch", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"substitute", "min_argc":4, "max_argc":4, "argtype":"FEARG_1"}, {"name":"swapinfo", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"swapname", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"synID", "min_argc":3, "max_argc":3, "argtype":"0"}, {"name":"synIDattr", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"synIDtrans", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"synconcealed", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"synstack", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"system", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"systemlist", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"tabpagebuflist", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tabpagenr", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"tabpagewinnr", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"tagfiles", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"taglist", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"tan", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tanh", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tempname", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"term_dumpdiff", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"term_dumpload", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_dumpwrite", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"term_getaltscreen", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getansicolors", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getattr", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_getcursor", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getjob", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getline", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_getscrolled", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getsize", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_getstatus", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_gettitle", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"term_gettty", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_list", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"term_scrape", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_sendkeys", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setansicolors", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setapi", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setkill", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setrestore", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_setsize", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"term_start", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"term_wait", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"test_alloc_fail", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"test_autochdir", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_feedinput", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_garbagecollect_now", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_garbagecollect_soon", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_getvalue", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_ignore_error", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_null_blob", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_channel", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_dict", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_job", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_list", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_partial", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_null_string", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_option_not_set", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_override", "min_argc":2, "max_argc":2, "argtype":"FEARG_2"}, {"name":"test_refcount", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_scrollbar", "min_argc":3, "max_argc":3, "argtype":"FEARG_2"}, {"name":"test_setmouse", "min_argc":2, "max_argc":2, "argtype":"0"}, {"name":"test_settime", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_srand_seed", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"test_unknown", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"test_void", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"timer_info", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"timer_pause", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}, {"name":"timer_start", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"timer_stop", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"timer_stopall", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"tolower", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"toupper", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"tr", "min_argc":3, "max_argc":3, "argtype":"FEARG_1"}, {"name":"trim", "min_argc":1, "max_argc":2, "argtype":"FEARG_1"}, {"name":"trunc", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"type", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"undofile", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"undotree", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"uniq", "min_argc":1, "max_argc":3, "argtype":"FEARG_1"}, {"name":"values", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"virtcol", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"visualmode", "min_argc":0, "max_argc":1, "argtype":"0"}, {"name":"wildmenumode", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"win_execute", "min_argc":2, "max_argc":3, "argtype":"FEARG_2"}, {"name":"win_findbuf", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_getid", "min_argc":0, "max_argc":2, "argtype":"FEARG_1"}, {"name":"win_gettype", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_gotoid", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_id2tabwin", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_id2win", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_screenpos", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"win_splitmove", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"winbufnr", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"wincol", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"windowsversion", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winheight", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winlayout", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winline", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winnr", "min_argc":0, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winrestcmd", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winrestview", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"winsaveview", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"winwidth", "min_argc":1, "max_argc":1, "argtype":"FEARG_1"}, {"name":"wordcount", "min_argc":0, "max_argc":0, "argtype":"0"}, {"name":"writefile", "min_argc":2, "max_argc":3, "argtype":"FEARG_1"}, {"name":"xor", "min_argc":2, "max_argc":2, "argtype":"FEARG_1"}];
|
9495 | function ExprTokenizer() { this.__init__.apply(this, arguments); }
|
9496 | ExprTokenizer.prototype.__init__ = function(reader) {
|
9497 | this.reader = reader;
|
9498 | this.cache = {};
|
9499 | }
|
9500 |
|
9501 | ExprTokenizer.prototype.token = function(type, value, pos) {
|
9502 | return {"type":type, "value":value, "pos":pos};
|
9503 | }
|
9504 |
|
9505 | ExprTokenizer.prototype.peek = function() {
|
9506 | var pos = this.reader.tell();
|
9507 | var r = this.get();
|
9508 | this.reader.seek_set(pos);
|
9509 | return r;
|
9510 | }
|
9511 |
|
9512 | ExprTokenizer.prototype.get = function() {
|
9513 |
|
9514 | if (viml_has_key(this.cache, this.reader.tell())) {
|
9515 | var x = this.cache[this.reader.tell()];
|
9516 | this.reader.seek_set(x[0]);
|
9517 | return x[1];
|
9518 | }
|
9519 | var pos = this.reader.tell();
|
9520 | this.reader.skip_white();
|
9521 | var r = this.get2();
|
9522 | this.cache[pos] = [this.reader.tell(), r];
|
9523 | return r;
|
9524 | }
|
9525 |
|
9526 | ExprTokenizer.prototype.get2 = function() {
|
9527 | var r = this.reader;
|
9528 | var pos = r.getpos();
|
9529 | var c = r.peek();
|
9530 | if (c == "<EOF>") {
|
9531 | return this.token(TOKEN_EOF, c, pos);
|
9532 | }
|
9533 | else if (c == "<EOL>") {
|
9534 | r.seek_cur(1);
|
9535 | return this.token(TOKEN_EOL, c, pos);
|
9536 | }
|
9537 | else if (iswhite(c)) {
|
9538 | var s = r.read_white();
|
9539 | return this.token(TOKEN_SPACE, s, pos);
|
9540 | }
|
9541 | else if (c == "0" && (r.p(1) == "X" || r.p(1) == "x") && isxdigit(r.p(2))) {
|
9542 | var s = r.getn(3);
|
9543 | s += r.read_xdigit();
|
9544 | return this.token(TOKEN_NUMBER, s, pos);
|
9545 | }
|
9546 | else if (c == "0" && (r.p(1) == "B" || r.p(1) == "b") && (r.p(2) == "0" || r.p(2) == "1")) {
|
9547 | var s = r.getn(3);
|
9548 | s += r.read_bdigit();
|
9549 | return this.token(TOKEN_NUMBER, s, pos);
|
9550 | }
|
9551 | else if (c == "0" && (r.p(1) == "Z" || r.p(1) == "z") && r.p(2) != ".") {
|
9552 | var s = r.getn(2);
|
9553 | s += r.read_blob();
|
9554 | return this.token(TOKEN_BLOB, s, pos);
|
9555 | }
|
9556 | else if (isdigit(c)) {
|
9557 | var s = r.read_digit();
|
9558 | if (r.p(0) == "." && isdigit(r.p(1))) {
|
9559 | s += r.getn(1);
|
9560 | s += r.read_digit();
|
9561 | if ((r.p(0) == "E" || r.p(0) == "e") && (isdigit(r.p(1)) || (r.p(1) == "-" || r.p(1) == "+") && isdigit(r.p(2)))) {
|
9562 | s += r.getn(2);
|
9563 | s += r.read_digit();
|
9564 | }
|
9565 | }
|
9566 | return this.token(TOKEN_NUMBER, s, pos);
|
9567 | }
|
9568 | else if (c == "i" && r.p(1) == "s" && !isidc(r.p(2))) {
|
9569 | if (r.p(2) == "?") {
|
9570 | r.seek_cur(3);
|
9571 | return this.token(TOKEN_ISCI, "is?", pos);
|
9572 | }
|
9573 | else if (r.p(2) == "#") {
|
9574 | r.seek_cur(3);
|
9575 | return this.token(TOKEN_ISCS, "is#", pos);
|
9576 | }
|
9577 | else {
|
9578 | r.seek_cur(2);
|
9579 | return this.token(TOKEN_IS, "is", pos);
|
9580 | }
|
9581 | }
|
9582 | else if (c == "i" && r.p(1) == "s" && r.p(2) == "n" && r.p(3) == "o" && r.p(4) == "t" && !isidc(r.p(5))) {
|
9583 | if (r.p(5) == "?") {
|
9584 | r.seek_cur(6);
|
9585 | return this.token(TOKEN_ISNOTCI, "isnot?", pos);
|
9586 | }
|
9587 | else if (r.p(5) == "#") {
|
9588 | r.seek_cur(6);
|
9589 | return this.token(TOKEN_ISNOTCS, "isnot#", pos);
|
9590 | }
|
9591 | else {
|
9592 | r.seek_cur(5);
|
9593 | return this.token(TOKEN_ISNOT, "isnot", pos);
|
9594 | }
|
9595 | }
|
9596 | else if (isnamec1(c)) {
|
9597 | var s = r.read_name();
|
9598 | return this.token(TOKEN_IDENTIFIER, s, pos);
|
9599 | }
|
9600 | else if (c == "|" && r.p(1) == "|") {
|
9601 | r.seek_cur(2);
|
9602 | return this.token(TOKEN_OROR, "||", pos);
|
9603 | }
|
9604 | else if (c == "&" && r.p(1) == "&") {
|
9605 | r.seek_cur(2);
|
9606 | return this.token(TOKEN_ANDAND, "&&", pos);
|
9607 | }
|
9608 | else if (c == "=" && r.p(1) == "=") {
|
9609 | if (r.p(2) == "?") {
|
9610 | r.seek_cur(3);
|
9611 | return this.token(TOKEN_EQEQCI, "==?", pos);
|
9612 | }
|
9613 | else if (r.p(2) == "#") {
|
9614 | r.seek_cur(3);
|
9615 | return this.token(TOKEN_EQEQCS, "==#", pos);
|
9616 | }
|
9617 | else {
|
9618 | r.seek_cur(2);
|
9619 | return this.token(TOKEN_EQEQ, "==", pos);
|
9620 | }
|
9621 | }
|
9622 | else if (c == "!" && r.p(1) == "=") {
|
9623 | if (r.p(2) == "?") {
|
9624 | r.seek_cur(3);
|
9625 | return this.token(TOKEN_NEQCI, "!=?", pos);
|
9626 | }
|
9627 | else if (r.p(2) == "#") {
|
9628 | r.seek_cur(3);
|
9629 | return this.token(TOKEN_NEQCS, "!=#", pos);
|
9630 | }
|
9631 | else {
|
9632 | r.seek_cur(2);
|
9633 | return this.token(TOKEN_NEQ, "!=", pos);
|
9634 | }
|
9635 | }
|
9636 | else if (c == ">" && r.p(1) == "=") {
|
9637 | if (r.p(2) == "?") {
|
9638 | r.seek_cur(3);
|
9639 | return this.token(TOKEN_GTEQCI, ">=?", pos);
|
9640 | }
|
9641 | else if (r.p(2) == "#") {
|
9642 | r.seek_cur(3);
|
9643 | return this.token(TOKEN_GTEQCS, ">=#", pos);
|
9644 | }
|
9645 | else {
|
9646 | r.seek_cur(2);
|
9647 | return this.token(TOKEN_GTEQ, ">=", pos);
|
9648 | }
|
9649 | }
|
9650 | else if (c == "<" && r.p(1) == "=") {
|
9651 | if (r.p(2) == "?") {
|
9652 | r.seek_cur(3);
|
9653 | return this.token(TOKEN_LTEQCI, "<=?", pos);
|
9654 | }
|
9655 | else if (r.p(2) == "#") {
|
9656 | r.seek_cur(3);
|
9657 | return this.token(TOKEN_LTEQCS, "<=#", pos);
|
9658 | }
|
9659 | else {
|
9660 | r.seek_cur(2);
|
9661 | return this.token(TOKEN_LTEQ, "<=", pos);
|
9662 | }
|
9663 | }
|
9664 | else if (c == "=" && r.p(1) == "~") {
|
9665 | if (r.p(2) == "?") {
|
9666 | r.seek_cur(3);
|
9667 | return this.token(TOKEN_MATCHCI, "=~?", pos);
|
9668 | }
|
9669 | else if (r.p(2) == "#") {
|
9670 | r.seek_cur(3);
|
9671 | return this.token(TOKEN_MATCHCS, "=~#", pos);
|
9672 | }
|
9673 | else {
|
9674 | r.seek_cur(2);
|
9675 | return this.token(TOKEN_MATCH, "=~", pos);
|
9676 | }
|
9677 | }
|
9678 | else if (c == "!" && r.p(1) == "~") {
|
9679 | if (r.p(2) == "?") {
|
9680 | r.seek_cur(3);
|
9681 | return this.token(TOKEN_NOMATCHCI, "!~?", pos);
|
9682 | }
|
9683 | else if (r.p(2) == "#") {
|
9684 | r.seek_cur(3);
|
9685 | return this.token(TOKEN_NOMATCHCS, "!~#", pos);
|
9686 | }
|
9687 | else {
|
9688 | r.seek_cur(2);
|
9689 | return this.token(TOKEN_NOMATCH, "!~", pos);
|
9690 | }
|
9691 | }
|
9692 | else if (c == ">") {
|
9693 | if (r.p(1) == "?") {
|
9694 | r.seek_cur(2);
|
9695 | return this.token(TOKEN_GTCI, ">?", pos);
|
9696 | }
|
9697 | else if (r.p(1) == "#") {
|
9698 | r.seek_cur(2);
|
9699 | return this.token(TOKEN_GTCS, ">#", pos);
|
9700 | }
|
9701 | else {
|
9702 | r.seek_cur(1);
|
9703 | return this.token(TOKEN_GT, ">", pos);
|
9704 | }
|
9705 | }
|
9706 | else if (c == "<") {
|
9707 | if (r.p(1) == "?") {
|
9708 | r.seek_cur(2);
|
9709 | return this.token(TOKEN_LTCI, "<?", pos);
|
9710 | }
|
9711 | else if (r.p(1) == "#") {
|
9712 | r.seek_cur(2);
|
9713 | return this.token(TOKEN_LTCS, "<#", pos);
|
9714 | }
|
9715 | else {
|
9716 | r.seek_cur(1);
|
9717 | return this.token(TOKEN_LT, "<", pos);
|
9718 | }
|
9719 | }
|
9720 | else if (c == "+") {
|
9721 | r.seek_cur(1);
|
9722 | return this.token(TOKEN_PLUS, "+", pos);
|
9723 | }
|
9724 | else if (c == "-") {
|
9725 | if (r.p(1) == ">") {
|
9726 | r.seek_cur(2);
|
9727 | return this.token(TOKEN_ARROW, "->", pos);
|
9728 | }
|
9729 | else {
|
9730 | r.seek_cur(1);
|
9731 | return this.token(TOKEN_MINUS, "-", pos);
|
9732 | }
|
9733 | }
|
9734 | else if (c == ".") {
|
9735 | if (r.p(1) == "." && r.p(2) == ".") {
|
9736 | r.seek_cur(3);
|
9737 | return this.token(TOKEN_DOTDOTDOT, "...", pos);
|
9738 | }
|
9739 | else if (r.p(1) == ".") {
|
9740 | r.seek_cur(2);
|
9741 | return this.token(TOKEN_DOTDOT, "..", pos);
|
9742 |
|
9743 | }
|
9744 | else {
|
9745 | r.seek_cur(1);
|
9746 | return this.token(TOKEN_DOT, ".", pos);
|
9747 |
|
9748 | }
|
9749 | }
|
9750 | else if (c == "*") {
|
9751 | r.seek_cur(1);
|
9752 | return this.token(TOKEN_STAR, "*", pos);
|
9753 | }
|
9754 | else if (c == "/") {
|
9755 | r.seek_cur(1);
|
9756 | return this.token(TOKEN_SLASH, "/", pos);
|
9757 | }
|
9758 | else if (c == "%") {
|
9759 | r.seek_cur(1);
|
9760 | return this.token(TOKEN_PERCENT, "%", pos);
|
9761 | }
|
9762 | else if (c == "!") {
|
9763 | r.seek_cur(1);
|
9764 | return this.token(TOKEN_NOT, "!", pos);
|
9765 | }
|
9766 | else if (c == "?") {
|
9767 | r.seek_cur(1);
|
9768 | return this.token(TOKEN_QUESTION, "?", pos);
|
9769 | }
|
9770 | else if (c == ":") {
|
9771 | r.seek_cur(1);
|
9772 | return this.token(TOKEN_COLON, ":", pos);
|
9773 | }
|
9774 | else if (c == "#") {
|
9775 | if (r.p(1) == "{") {
|
9776 | r.seek_cur(2);
|
9777 | return this.token(TOKEN_LITCOPEN, "#{", pos);
|
9778 | }
|
9779 | else {
|
9780 | r.seek_cur(1);
|
9781 | return this.token(TOKEN_SHARP, "#", pos);
|
9782 | }
|
9783 | }
|
9784 | else if (c == "(") {
|
9785 | r.seek_cur(1);
|
9786 | return this.token(TOKEN_POPEN, "(", pos);
|
9787 | }
|
9788 | else if (c == ")") {
|
9789 | r.seek_cur(1);
|
9790 | return this.token(TOKEN_PCLOSE, ")", pos);
|
9791 | }
|
9792 | else if (c == "[") {
|
9793 | r.seek_cur(1);
|
9794 | return this.token(TOKEN_SQOPEN, "[", pos);
|
9795 | }
|
9796 | else if (c == "]") {
|
9797 | r.seek_cur(1);
|
9798 | return this.token(TOKEN_SQCLOSE, "]", pos);
|
9799 | }
|
9800 | else if (c == "{") {
|
9801 | r.seek_cur(1);
|
9802 | return this.token(TOKEN_COPEN, "{", pos);
|
9803 | }
|
9804 | else if (c == "}") {
|
9805 | r.seek_cur(1);
|
9806 | return this.token(TOKEN_CCLOSE, "}", pos);
|
9807 | }
|
9808 | else if (c == ",") {
|
9809 | r.seek_cur(1);
|
9810 | return this.token(TOKEN_COMMA, ",", pos);
|
9811 | }
|
9812 | else if (c == "'") {
|
9813 | r.seek_cur(1);
|
9814 | return this.token(TOKEN_SQUOTE, "'", pos);
|
9815 | }
|
9816 | else if (c == "\"") {
|
9817 | r.seek_cur(1);
|
9818 | return this.token(TOKEN_DQUOTE, "\"", pos);
|
9819 | }
|
9820 | else if (c == "$") {
|
9821 | var s = r.getn(1);
|
9822 | s += r.read_word();
|
9823 | return this.token(TOKEN_ENV, s, pos);
|
9824 | }
|
9825 | else if (c == "@") {
|
9826 |
|
9827 | return this.token(TOKEN_REG, r.getn(2), pos);
|
9828 | }
|
9829 | else if (c == "&") {
|
9830 | var s = "";
|
9831 | if ((r.p(1) == "g" || r.p(1) == "l") && r.p(2) == ":") {
|
9832 | var s = r.getn(3) + r.read_word();
|
9833 | }
|
9834 | else {
|
9835 | var s = r.getn(1) + r.read_word();
|
9836 | }
|
9837 | return this.token(TOKEN_OPTION, s, pos);
|
9838 | }
|
9839 | else if (c == "=") {
|
9840 | r.seek_cur(1);
|
9841 | return this.token(TOKEN_EQ, "=", pos);
|
9842 | }
|
9843 | else if (c == "|") {
|
9844 | r.seek_cur(1);
|
9845 | return this.token(TOKEN_OR, "|", pos);
|
9846 | }
|
9847 | else if (c == ";") {
|
9848 | r.seek_cur(1);
|
9849 | return this.token(TOKEN_SEMICOLON, ";", pos);
|
9850 | }
|
9851 | else if (c == "`") {
|
9852 | r.seek_cur(1);
|
9853 | return this.token(TOKEN_BACKTICK, "`", pos);
|
9854 | }
|
9855 | else {
|
9856 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
9857 | }
|
9858 | }
|
9859 |
|
9860 | ExprTokenizer.prototype.get_sstring = function() {
|
9861 | this.reader.skip_white();
|
9862 | var c = this.reader.p(0);
|
9863 | if (c != "'") {
|
9864 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
9865 | }
|
9866 | this.reader.seek_cur(1);
|
9867 | var s = "";
|
9868 | while (TRUE) {
|
9869 | var c = this.reader.p(0);
|
9870 | if (c == "<EOF>" || c == "<EOL>") {
|
9871 | throw Err("unexpected EOL", this.reader.getpos());
|
9872 | }
|
9873 | else if (c == "'") {
|
9874 | this.reader.seek_cur(1);
|
9875 | if (this.reader.p(0) == "'") {
|
9876 | this.reader.seek_cur(1);
|
9877 | s += "''";
|
9878 | }
|
9879 | else {
|
9880 | break;
|
9881 | }
|
9882 | }
|
9883 | else {
|
9884 | this.reader.seek_cur(1);
|
9885 | s += c;
|
9886 | }
|
9887 | }
|
9888 | return s;
|
9889 | }
|
9890 |
|
9891 | ExprTokenizer.prototype.get_dstring = function() {
|
9892 | this.reader.skip_white();
|
9893 | var c = this.reader.p(0);
|
9894 | if (c != "\"") {
|
9895 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
9896 | }
|
9897 | this.reader.seek_cur(1);
|
9898 | var s = "";
|
9899 | while (TRUE) {
|
9900 | var c = this.reader.p(0);
|
9901 | if (c == "<EOF>" || c == "<EOL>") {
|
9902 | throw Err("unexpectd EOL", this.reader.getpos());
|
9903 | }
|
9904 | else if (c == "\"") {
|
9905 | this.reader.seek_cur(1);
|
9906 | break;
|
9907 | }
|
9908 | else if (c == "\\") {
|
9909 | this.reader.seek_cur(1);
|
9910 | s += c;
|
9911 | var c = this.reader.p(0);
|
9912 | if (c == "<EOF>" || c == "<EOL>") {
|
9913 | throw Err("ExprTokenizer: unexpected EOL", this.reader.getpos());
|
9914 | }
|
9915 | this.reader.seek_cur(1);
|
9916 | s += c;
|
9917 | }
|
9918 | else {
|
9919 | this.reader.seek_cur(1);
|
9920 | s += c;
|
9921 | }
|
9922 | }
|
9923 | return s;
|
9924 | }
|
9925 |
|
9926 | ExprTokenizer.prototype.parse_dict_literal_key = function() {
|
9927 | this.reader.skip_white();
|
9928 | var c = this.reader.peek();
|
9929 | if (!isalnum(c) && c != "_" && c != "-") {
|
9930 | throw Err(viml_printf("unexpected character: %s", c), this.reader.getpos());
|
9931 | }
|
9932 | var node = Node(NODE_STRING);
|
9933 | var s = c;
|
9934 | this.reader.seek_cur(1);
|
9935 | node.pos = this.reader.getpos();
|
9936 | while (TRUE) {
|
9937 | var c = this.reader.p(0);
|
9938 | if (c == "<EOF>" || c == "<EOL>") {
|
9939 | throw Err("unexpectd EOL", this.reader.getpos());
|
9940 | }
|
9941 | if (!isalnum(c) && c != "_" && c != "-") {
|
9942 | break;
|
9943 | }
|
9944 | this.reader.seek_cur(1);
|
9945 | s += c;
|
9946 | }
|
9947 | node.value = "'" + s + "'";
|
9948 | return node;
|
9949 | }
|
9950 |
|
9951 | function ExprParser() { this.__init__.apply(this, arguments); }
|
9952 | ExprParser.prototype.__init__ = function(reader) {
|
9953 | this.reader = reader;
|
9954 | this.tokenizer = new ExprTokenizer(reader);
|
9955 | }
|
9956 |
|
9957 | ExprParser.prototype.parse = function() {
|
9958 | return this.parse_expr1();
|
9959 | }
|
9960 |
|
9961 |
|
9962 | ExprParser.prototype.parse_expr1 = function() {
|
9963 | var left = this.parse_expr2();
|
9964 | var pos = this.reader.tell();
|
9965 | var token = this.tokenizer.get();
|
9966 | if (token.type == TOKEN_QUESTION) {
|
9967 | var node = Node(NODE_TERNARY);
|
9968 | node.pos = token.pos;
|
9969 | node.cond = left;
|
9970 | node.left = this.parse_expr1();
|
9971 | var token = this.tokenizer.get();
|
9972 | if (token.type != TOKEN_COLON) {
|
9973 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
9974 | }
|
9975 | node.right = this.parse_expr1();
|
9976 | var left = node;
|
9977 | }
|
9978 | else {
|
9979 | this.reader.seek_set(pos);
|
9980 | }
|
9981 | return left;
|
9982 | }
|
9983 |
|
9984 |
|
9985 | ExprParser.prototype.parse_expr2 = function() {
|
9986 | var left = this.parse_expr3();
|
9987 | while (TRUE) {
|
9988 | var pos = this.reader.tell();
|
9989 | var token = this.tokenizer.get();
|
9990 | if (token.type == TOKEN_OROR) {
|
9991 | var node = Node(NODE_OR);
|
9992 | node.pos = token.pos;
|
9993 | node.left = left;
|
9994 | node.right = this.parse_expr3();
|
9995 | var left = node;
|
9996 | }
|
9997 | else {
|
9998 | this.reader.seek_set(pos);
|
9999 | break;
|
10000 | }
|
10001 | }
|
10002 | return left;
|
10003 | }
|
10004 |
|
10005 |
|
10006 | ExprParser.prototype.parse_expr3 = function() {
|
10007 | var left = this.parse_expr4();
|
10008 | while (TRUE) {
|
10009 | var pos = this.reader.tell();
|
10010 | var token = this.tokenizer.get();
|
10011 | if (token.type == TOKEN_ANDAND) {
|
10012 | var node = Node(NODE_AND);
|
10013 | node.pos = token.pos;
|
10014 | node.left = left;
|
10015 | node.right = this.parse_expr4();
|
10016 | var left = node;
|
10017 | }
|
10018 | else {
|
10019 | this.reader.seek_set(pos);
|
10020 | break;
|
10021 | }
|
10022 | }
|
10023 | return left;
|
10024 | }
|
10025 |
|
10026 |
|
10027 |
|
10028 |
|
10029 |
|
10030 |
|
10031 |
|
10032 |
|
10033 |
|
10034 |
|
10035 |
|
10036 |
|
10037 |
|
10038 |
|
10039 |
|
10040 |
|
10041 | ExprParser.prototype.parse_expr4 = function() {
|
10042 | var left = this.parse_expr5();
|
10043 | var pos = this.reader.tell();
|
10044 | var token = this.tokenizer.get();
|
10045 | if (token.type == TOKEN_EQEQ) {
|
10046 | var node = Node(NODE_EQUAL);
|
10047 | node.pos = token.pos;
|
10048 | node.left = left;
|
10049 | node.right = this.parse_expr5();
|
10050 | var left = node;
|
10051 | }
|
10052 | else if (token.type == TOKEN_EQEQCI) {
|
10053 | var node = Node(NODE_EQUALCI);
|
10054 | node.pos = token.pos;
|
10055 | node.left = left;
|
10056 | node.right = this.parse_expr5();
|
10057 | var left = node;
|
10058 | }
|
10059 | else if (token.type == TOKEN_EQEQCS) {
|
10060 | var node = Node(NODE_EQUALCS);
|
10061 | node.pos = token.pos;
|
10062 | node.left = left;
|
10063 | node.right = this.parse_expr5();
|
10064 | var left = node;
|
10065 | }
|
10066 | else if (token.type == TOKEN_NEQ) {
|
10067 | var node = Node(NODE_NEQUAL);
|
10068 | node.pos = token.pos;
|
10069 | node.left = left;
|
10070 | node.right = this.parse_expr5();
|
10071 | var left = node;
|
10072 | }
|
10073 | else if (token.type == TOKEN_NEQCI) {
|
10074 | var node = Node(NODE_NEQUALCI);
|
10075 | node.pos = token.pos;
|
10076 | node.left = left;
|
10077 | node.right = this.parse_expr5();
|
10078 | var left = node;
|
10079 | }
|
10080 | else if (token.type == TOKEN_NEQCS) {
|
10081 | var node = Node(NODE_NEQUALCS);
|
10082 | node.pos = token.pos;
|
10083 | node.left = left;
|
10084 | node.right = this.parse_expr5();
|
10085 | var left = node;
|
10086 | }
|
10087 | else if (token.type == TOKEN_GT) {
|
10088 | var node = Node(NODE_GREATER);
|
10089 | node.pos = token.pos;
|
10090 | node.left = left;
|
10091 | node.right = this.parse_expr5();
|
10092 | var left = node;
|
10093 | }
|
10094 | else if (token.type == TOKEN_GTCI) {
|
10095 | var node = Node(NODE_GREATERCI);
|
10096 | node.pos = token.pos;
|
10097 | node.left = left;
|
10098 | node.right = this.parse_expr5();
|
10099 | var left = node;
|
10100 | }
|
10101 | else if (token.type == TOKEN_GTCS) {
|
10102 | var node = Node(NODE_GREATERCS);
|
10103 | node.pos = token.pos;
|
10104 | node.left = left;
|
10105 | node.right = this.parse_expr5();
|
10106 | var left = node;
|
10107 | }
|
10108 | else if (token.type == TOKEN_GTEQ) {
|
10109 | var node = Node(NODE_GEQUAL);
|
10110 | node.pos = token.pos;
|
10111 | node.left = left;
|
10112 | node.right = this.parse_expr5();
|
10113 | var left = node;
|
10114 | }
|
10115 | else if (token.type == TOKEN_GTEQCI) {
|
10116 | var node = Node(NODE_GEQUALCI);
|
10117 | node.pos = token.pos;
|
10118 | node.left = left;
|
10119 | node.right = this.parse_expr5();
|
10120 | var left = node;
|
10121 | }
|
10122 | else if (token.type == TOKEN_GTEQCS) {
|
10123 | var node = Node(NODE_GEQUALCS);
|
10124 | node.pos = token.pos;
|
10125 | node.left = left;
|
10126 | node.right = this.parse_expr5();
|
10127 | var left = node;
|
10128 | }
|
10129 | else if (token.type == TOKEN_LT) {
|
10130 | var node = Node(NODE_SMALLER);
|
10131 | node.pos = token.pos;
|
10132 | node.left = left;
|
10133 | node.right = this.parse_expr5();
|
10134 | var left = node;
|
10135 | }
|
10136 | else if (token.type == TOKEN_LTCI) {
|
10137 | var node = Node(NODE_SMALLERCI);
|
10138 | node.pos = token.pos;
|
10139 | node.left = left;
|
10140 | node.right = this.parse_expr5();
|
10141 | var left = node;
|
10142 | }
|
10143 | else if (token.type == TOKEN_LTCS) {
|
10144 | var node = Node(NODE_SMALLERCS);
|
10145 | node.pos = token.pos;
|
10146 | node.left = left;
|
10147 | node.right = this.parse_expr5();
|
10148 | var left = node;
|
10149 | }
|
10150 | else if (token.type == TOKEN_LTEQ) {
|
10151 | var node = Node(NODE_SEQUAL);
|
10152 | node.pos = token.pos;
|
10153 | node.left = left;
|
10154 | node.right = this.parse_expr5();
|
10155 | var left = node;
|
10156 | }
|
10157 | else if (token.type == TOKEN_LTEQCI) {
|
10158 | var node = Node(NODE_SEQUALCI);
|
10159 | node.pos = token.pos;
|
10160 | node.left = left;
|
10161 | node.right = this.parse_expr5();
|
10162 | var left = node;
|
10163 | }
|
10164 | else if (token.type == TOKEN_LTEQCS) {
|
10165 | var node = Node(NODE_SEQUALCS);
|
10166 | node.pos = token.pos;
|
10167 | node.left = left;
|
10168 | node.right = this.parse_expr5();
|
10169 | var left = node;
|
10170 | }
|
10171 | else if (token.type == TOKEN_MATCH) {
|
10172 | var node = Node(NODE_MATCH);
|
10173 | node.pos = token.pos;
|
10174 | node.left = left;
|
10175 | node.right = this.parse_expr5();
|
10176 | var left = node;
|
10177 | }
|
10178 | else if (token.type == TOKEN_MATCHCI) {
|
10179 | var node = Node(NODE_MATCHCI);
|
10180 | node.pos = token.pos;
|
10181 | node.left = left;
|
10182 | node.right = this.parse_expr5();
|
10183 | var left = node;
|
10184 | }
|
10185 | else if (token.type == TOKEN_MATCHCS) {
|
10186 | var node = Node(NODE_MATCHCS);
|
10187 | node.pos = token.pos;
|
10188 | node.left = left;
|
10189 | node.right = this.parse_expr5();
|
10190 | var left = node;
|
10191 | }
|
10192 | else if (token.type == TOKEN_NOMATCH) {
|
10193 | var node = Node(NODE_NOMATCH);
|
10194 | node.pos = token.pos;
|
10195 | node.left = left;
|
10196 | node.right = this.parse_expr5();
|
10197 | var left = node;
|
10198 | }
|
10199 | else if (token.type == TOKEN_NOMATCHCI) {
|
10200 | var node = Node(NODE_NOMATCHCI);
|
10201 | node.pos = token.pos;
|
10202 | node.left = left;
|
10203 | node.right = this.parse_expr5();
|
10204 | var left = node;
|
10205 | }
|
10206 | else if (token.type == TOKEN_NOMATCHCS) {
|
10207 | var node = Node(NODE_NOMATCHCS);
|
10208 | node.pos = token.pos;
|
10209 | node.left = left;
|
10210 | node.right = this.parse_expr5();
|
10211 | var left = node;
|
10212 | }
|
10213 | else if (token.type == TOKEN_IS) {
|
10214 | var node = Node(NODE_IS);
|
10215 | node.pos = token.pos;
|
10216 | node.left = left;
|
10217 | node.right = this.parse_expr5();
|
10218 | var left = node;
|
10219 | }
|
10220 | else if (token.type == TOKEN_ISCI) {
|
10221 | var node = Node(NODE_ISCI);
|
10222 | node.pos = token.pos;
|
10223 | node.left = left;
|
10224 | node.right = this.parse_expr5();
|
10225 | var left = node;
|
10226 | }
|
10227 | else if (token.type == TOKEN_ISCS) {
|
10228 | var node = Node(NODE_ISCS);
|
10229 | node.pos = token.pos;
|
10230 | node.left = left;
|
10231 | node.right = this.parse_expr5();
|
10232 | var left = node;
|
10233 | }
|
10234 | else if (token.type == TOKEN_ISNOT) {
|
10235 | var node = Node(NODE_ISNOT);
|
10236 | node.pos = token.pos;
|
10237 | node.left = left;
|
10238 | node.right = this.parse_expr5();
|
10239 | var left = node;
|
10240 | }
|
10241 | else if (token.type == TOKEN_ISNOTCI) {
|
10242 | var node = Node(NODE_ISNOTCI);
|
10243 | node.pos = token.pos;
|
10244 | node.left = left;
|
10245 | node.right = this.parse_expr5();
|
10246 | var left = node;
|
10247 | }
|
10248 | else if (token.type == TOKEN_ISNOTCS) {
|
10249 | var node = Node(NODE_ISNOTCS);
|
10250 | node.pos = token.pos;
|
10251 | node.left = left;
|
10252 | node.right = this.parse_expr5();
|
10253 | var left = node;
|
10254 | }
|
10255 | else {
|
10256 | this.reader.seek_set(pos);
|
10257 | }
|
10258 | return left;
|
10259 | }
|
10260 |
|
10261 |
|
10262 |
|
10263 |
|
10264 |
|
10265 | ExprParser.prototype.parse_expr5 = function() {
|
10266 | var left = this.parse_expr6();
|
10267 | while (TRUE) {
|
10268 | var pos = this.reader.tell();
|
10269 | var token = this.tokenizer.get();
|
10270 | if (token.type == TOKEN_PLUS) {
|
10271 | var node = Node(NODE_ADD);
|
10272 | node.pos = token.pos;
|
10273 | node.left = left;
|
10274 | node.right = this.parse_expr6();
|
10275 | var left = node;
|
10276 | }
|
10277 | else if (token.type == TOKEN_MINUS) {
|
10278 | var node = Node(NODE_SUBTRACT);
|
10279 | node.pos = token.pos;
|
10280 | node.left = left;
|
10281 | node.right = this.parse_expr6();
|
10282 | var left = node;
|
10283 | }
|
10284 | else if (token.type == TOKEN_DOTDOT) {
|
10285 |
|
10286 | var node = Node(NODE_CONCAT);
|
10287 | node.pos = token.pos;
|
10288 | node.left = left;
|
10289 | node.right = this.parse_expr6();
|
10290 | var left = node;
|
10291 | }
|
10292 | else if (token.type == TOKEN_DOT) {
|
10293 |
|
10294 | var node = Node(NODE_CONCAT);
|
10295 | node.pos = token.pos;
|
10296 | node.left = left;
|
10297 | node.right = this.parse_expr6();
|
10298 | var left = node;
|
10299 | }
|
10300 | else {
|
10301 | this.reader.seek_set(pos);
|
10302 | break;
|
10303 | }
|
10304 | }
|
10305 | return left;
|
10306 | }
|
10307 |
|
10308 |
|
10309 |
|
10310 |
|
10311 | ExprParser.prototype.parse_expr6 = function() {
|
10312 | var left = this.parse_expr7();
|
10313 | while (TRUE) {
|
10314 | var pos = this.reader.tell();
|
10315 | var token = this.tokenizer.get();
|
10316 | if (token.type == TOKEN_STAR) {
|
10317 | var node = Node(NODE_MULTIPLY);
|
10318 | node.pos = token.pos;
|
10319 | node.left = left;
|
10320 | node.right = this.parse_expr7();
|
10321 | var left = node;
|
10322 | }
|
10323 | else if (token.type == TOKEN_SLASH) {
|
10324 | var node = Node(NODE_DIVIDE);
|
10325 | node.pos = token.pos;
|
10326 | node.left = left;
|
10327 | node.right = this.parse_expr7();
|
10328 | var left = node;
|
10329 | }
|
10330 | else if (token.type == TOKEN_PERCENT) {
|
10331 | var node = Node(NODE_REMAINDER);
|
10332 | node.pos = token.pos;
|
10333 | node.left = left;
|
10334 | node.right = this.parse_expr7();
|
10335 | var left = node;
|
10336 | }
|
10337 | else {
|
10338 | this.reader.seek_set(pos);
|
10339 | break;
|
10340 | }
|
10341 | }
|
10342 | return left;
|
10343 | }
|
10344 |
|
10345 |
|
10346 |
|
10347 |
|
10348 | ExprParser.prototype.parse_expr7 = function() {
|
10349 | var pos = this.reader.tell();
|
10350 | var token = this.tokenizer.get();
|
10351 | if (token.type == TOKEN_NOT) {
|
10352 | var node = Node(NODE_NOT);
|
10353 | node.pos = token.pos;
|
10354 | node.left = this.parse_expr7();
|
10355 | return node;
|
10356 | }
|
10357 | else if (token.type == TOKEN_MINUS) {
|
10358 | var node = Node(NODE_MINUS);
|
10359 | node.pos = token.pos;
|
10360 | node.left = this.parse_expr7();
|
10361 | return node;
|
10362 | }
|
10363 | else if (token.type == TOKEN_PLUS) {
|
10364 | var node = Node(NODE_PLUS);
|
10365 | node.pos = token.pos;
|
10366 | node.left = this.parse_expr7();
|
10367 | return node;
|
10368 | }
|
10369 | else {
|
10370 | this.reader.seek_set(pos);
|
10371 | var node = this.parse_expr8();
|
10372 | return node;
|
10373 | }
|
10374 | }
|
10375 |
|
10376 |
|
10377 |
|
10378 |
|
10379 |
|
10380 |
|
10381 |
|
10382 |
|
10383 | ExprParser.prototype.parse_expr8 = function() {
|
10384 | var left = this.parse_expr9();
|
10385 | while (TRUE) {
|
10386 | var pos = this.reader.tell();
|
10387 | var c = this.reader.peek();
|
10388 | var token = this.tokenizer.get();
|
10389 | if (!iswhite(c) && token.type == TOKEN_SQOPEN) {
|
10390 | var npos = token.pos;
|
10391 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
10392 | this.tokenizer.get();
|
10393 | var node = Node(NODE_SLICE);
|
10394 | node.pos = npos;
|
10395 | node.left = left;
|
10396 | node.rlist = [NIL, NIL];
|
10397 | var token = this.tokenizer.peek();
|
10398 | if (token.type != TOKEN_SQCLOSE) {
|
10399 | node.rlist[1] = this.parse_expr1();
|
10400 | }
|
10401 | var token = this.tokenizer.get();
|
10402 | if (token.type != TOKEN_SQCLOSE) {
|
10403 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10404 | }
|
10405 | var left = node;
|
10406 | }
|
10407 | else {
|
10408 | var right = this.parse_expr1();
|
10409 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
10410 | this.tokenizer.get();
|
10411 | var node = Node(NODE_SLICE);
|
10412 | node.pos = npos;
|
10413 | node.left = left;
|
10414 | node.rlist = [right, NIL];
|
10415 | var token = this.tokenizer.peek();
|
10416 | if (token.type != TOKEN_SQCLOSE) {
|
10417 | node.rlist[1] = this.parse_expr1();
|
10418 | }
|
10419 | var token = this.tokenizer.get();
|
10420 | if (token.type != TOKEN_SQCLOSE) {
|
10421 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10422 | }
|
10423 | var left = node;
|
10424 | }
|
10425 | else {
|
10426 | var node = Node(NODE_SUBSCRIPT);
|
10427 | node.pos = npos;
|
10428 | node.left = left;
|
10429 | node.right = right;
|
10430 | var token = this.tokenizer.get();
|
10431 | if (token.type != TOKEN_SQCLOSE) {
|
10432 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10433 | }
|
10434 | var left = node;
|
10435 | }
|
10436 | }
|
10437 | delete node;
|
10438 | }
|
10439 | else if (token.type == TOKEN_ARROW) {
|
10440 | var funcname_or_lambda = this.parse_expr9();
|
10441 | var token = this.tokenizer.get();
|
10442 | if (token.type != TOKEN_POPEN) {
|
10443 | throw Err("E107: Missing parentheses: lambda", token.pos);
|
10444 | }
|
10445 | var right = Node(NODE_CALL);
|
10446 | right.pos = token.pos;
|
10447 | right.left = funcname_or_lambda;
|
10448 | right.rlist = this.parse_rlist();
|
10449 | var node = Node(NODE_METHOD);
|
10450 | node.pos = token.pos;
|
10451 | node.left = left;
|
10452 | node.right = right;
|
10453 | var left = node;
|
10454 | delete node;
|
10455 | }
|
10456 | else if (token.type == TOKEN_POPEN) {
|
10457 | var node = Node(NODE_CALL);
|
10458 | node.pos = token.pos;
|
10459 | node.left = left;
|
10460 | node.rlist = this.parse_rlist();
|
10461 | var left = node;
|
10462 | delete node;
|
10463 | }
|
10464 | else if (!iswhite(c) && token.type == TOKEN_DOT) {
|
10465 |
|
10466 | var node = this.parse_dot(token, left);
|
10467 | if (node === NIL) {
|
10468 | this.reader.seek_set(pos);
|
10469 | break;
|
10470 | }
|
10471 | var left = node;
|
10472 | delete node;
|
10473 | }
|
10474 | else {
|
10475 | this.reader.seek_set(pos);
|
10476 | break;
|
10477 | }
|
10478 | }
|
10479 | return left;
|
10480 | }
|
10481 |
|
10482 | ExprParser.prototype.parse_rlist = function() {
|
10483 | var rlist = [];
|
10484 | var token = this.tokenizer.peek();
|
10485 | if (this.tokenizer.peek().type == TOKEN_PCLOSE) {
|
10486 | this.tokenizer.get();
|
10487 | }
|
10488 | else {
|
10489 | while (TRUE) {
|
10490 | viml_add(rlist, this.parse_expr1());
|
10491 | var token = this.tokenizer.get();
|
10492 | if (token.type == TOKEN_COMMA) {
|
10493 |
|
10494 | if (this.tokenizer.peek().type == TOKEN_PCLOSE) {
|
10495 | this.tokenizer.get();
|
10496 | break;
|
10497 | }
|
10498 | }
|
10499 | else if (token.type == TOKEN_PCLOSE) {
|
10500 | break;
|
10501 | }
|
10502 | else {
|
10503 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10504 | }
|
10505 | }
|
10506 | }
|
10507 | if (viml_len(rlist) > MAX_FUNC_ARGS) {
|
10508 |
|
10509 | throw Err("E740: Too many arguments for function", token.pos);
|
10510 | }
|
10511 | return rlist;
|
10512 | }
|
10513 |
|
10514 |
|
10515 |
|
10516 |
|
10517 |
|
10518 |
|
10519 |
|
10520 |
|
10521 |
|
10522 |
|
10523 |
|
10524 |
|
10525 |
|
10526 |
|
10527 |
|
10528 |
|
10529 | ExprParser.prototype.parse_expr9 = function() {
|
10530 | var pos = this.reader.tell();
|
10531 | var token = this.tokenizer.get();
|
10532 | var node = Node(-1);
|
10533 | if (token.type == TOKEN_NUMBER) {
|
10534 | var node = Node(NODE_NUMBER);
|
10535 | node.pos = token.pos;
|
10536 | node.value = token.value;
|
10537 | }
|
10538 | else if (token.type == TOKEN_BLOB) {
|
10539 | var node = Node(NODE_BLOB);
|
10540 | node.pos = token.pos;
|
10541 | node.value = token.value;
|
10542 | }
|
10543 | else if (token.type == TOKEN_DQUOTE) {
|
10544 | this.reader.seek_set(pos);
|
10545 | var node = Node(NODE_STRING);
|
10546 | node.pos = token.pos;
|
10547 | node.value = "\"" + this.tokenizer.get_dstring() + "\"";
|
10548 | }
|
10549 | else if (token.type == TOKEN_SQUOTE) {
|
10550 | this.reader.seek_set(pos);
|
10551 | var node = Node(NODE_STRING);
|
10552 | node.pos = token.pos;
|
10553 | node.value = "'" + this.tokenizer.get_sstring() + "'";
|
10554 | }
|
10555 | else if (token.type == TOKEN_SQOPEN) {
|
10556 | var node = Node(NODE_LIST);
|
10557 | node.pos = token.pos;
|
10558 | node.value = [];
|
10559 | var token = this.tokenizer.peek();
|
10560 | if (token.type == TOKEN_SQCLOSE) {
|
10561 | this.tokenizer.get();
|
10562 | }
|
10563 | else {
|
10564 | while (TRUE) {
|
10565 | viml_add(node.value, this.parse_expr1());
|
10566 | var token = this.tokenizer.peek();
|
10567 | if (token.type == TOKEN_COMMA) {
|
10568 | this.tokenizer.get();
|
10569 | if (this.tokenizer.peek().type == TOKEN_SQCLOSE) {
|
10570 | this.tokenizer.get();
|
10571 | break;
|
10572 | }
|
10573 | }
|
10574 | else if (token.type == TOKEN_SQCLOSE) {
|
10575 | this.tokenizer.get();
|
10576 | break;
|
10577 | }
|
10578 | else {
|
10579 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10580 | }
|
10581 | }
|
10582 | }
|
10583 | }
|
10584 | else if (token.type == TOKEN_COPEN || token.type == TOKEN_LITCOPEN) {
|
10585 | var is_litdict = token.type == TOKEN_LITCOPEN;
|
10586 | var savepos = this.reader.tell();
|
10587 | var nodepos = token.pos;
|
10588 | var token = this.tokenizer.get();
|
10589 | var lambda = token.type == TOKEN_ARROW;
|
10590 | if (!lambda && !(token.type == TOKEN_SQUOTE || token.type == TOKEN_DQUOTE)) {
|
10591 |
|
10592 |
|
10593 | var token2 = this.tokenizer.peek();
|
10594 | var lambda = token2.type == TOKEN_ARROW || token2.type == TOKEN_COMMA;
|
10595 | }
|
10596 |
|
10597 | var fallback = FALSE;
|
10598 | if (lambda) {
|
10599 |
|
10600 | var node = Node(NODE_LAMBDA);
|
10601 | node.pos = nodepos;
|
10602 | node.rlist = [];
|
10603 | var named = {};
|
10604 | while (TRUE) {
|
10605 | if (token.type == TOKEN_ARROW) {
|
10606 | break;
|
10607 | }
|
10608 | else if (token.type == TOKEN_IDENTIFIER) {
|
10609 | if (!isargname(token.value)) {
|
10610 | throw Err(viml_printf("E125: Illegal argument: %s", token.value), token.pos);
|
10611 | }
|
10612 | else if (viml_has_key(named, token.value)) {
|
10613 | throw Err(viml_printf("E853: Duplicate argument name: %s", token.value), token.pos);
|
10614 | }
|
10615 | named[token.value] = 1;
|
10616 | var varnode = Node(NODE_IDENTIFIER);
|
10617 | varnode.pos = token.pos;
|
10618 | varnode.value = token.value;
|
10619 |
|
10620 | if (iswhite(this.reader.p(0)) && this.tokenizer.peek().type == TOKEN_COMMA) {
|
10621 | throw Err("E475: Invalid argument: White space is not allowed before comma", this.reader.getpos());
|
10622 | }
|
10623 | var token = this.tokenizer.get();
|
10624 | viml_add(node.rlist, varnode);
|
10625 | if (token.type == TOKEN_COMMA) {
|
10626 |
|
10627 | var token = this.tokenizer.peek();
|
10628 | if (token.type == TOKEN_ARROW) {
|
10629 | this.tokenizer.get();
|
10630 | break;
|
10631 | }
|
10632 | }
|
10633 | else if (token.type == TOKEN_ARROW) {
|
10634 | break;
|
10635 | }
|
10636 | else {
|
10637 | throw Err(viml_printf("unexpected token: %s, type: %d", token.value, token.type), token.pos);
|
10638 | }
|
10639 | }
|
10640 | else if (token.type == TOKEN_DOTDOTDOT) {
|
10641 | var varnode = Node(NODE_IDENTIFIER);
|
10642 | varnode.pos = token.pos;
|
10643 | varnode.value = token.value;
|
10644 | viml_add(node.rlist, varnode);
|
10645 | var token = this.tokenizer.peek();
|
10646 | if (token.type == TOKEN_ARROW) {
|
10647 | this.tokenizer.get();
|
10648 | break;
|
10649 | }
|
10650 | else {
|
10651 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10652 | }
|
10653 | }
|
10654 | else {
|
10655 | var fallback = TRUE;
|
10656 | break;
|
10657 | }
|
10658 | var token = this.tokenizer.get();
|
10659 | }
|
10660 | if (!fallback) {
|
10661 | node.left = this.parse_expr1();
|
10662 | var token = this.tokenizer.get();
|
10663 | if (token.type != TOKEN_CCLOSE) {
|
10664 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10665 | }
|
10666 | return node;
|
10667 | }
|
10668 | }
|
10669 |
|
10670 | var node = Node(NODE_DICT);
|
10671 | node.pos = nodepos;
|
10672 | node.value = [];
|
10673 | this.reader.seek_set(savepos);
|
10674 | var token = this.tokenizer.peek();
|
10675 | if (token.type == TOKEN_CCLOSE) {
|
10676 | this.tokenizer.get();
|
10677 | return node;
|
10678 | }
|
10679 | while (1) {
|
10680 | var key = is_litdict ? this.tokenizer.parse_dict_literal_key() : this.parse_expr1();
|
10681 | var token = this.tokenizer.get();
|
10682 | if (token.type == TOKEN_CCLOSE) {
|
10683 | if (!viml_empty(node.value)) {
|
10684 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10685 | }
|
10686 | this.reader.seek_set(pos);
|
10687 | var node = this.parse_identifier();
|
10688 | break;
|
10689 | }
|
10690 | if (token.type != TOKEN_COLON) {
|
10691 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10692 | }
|
10693 | var val = this.parse_expr1();
|
10694 | viml_add(node.value, [key, val]);
|
10695 | var token = this.tokenizer.get();
|
10696 | if (token.type == TOKEN_COMMA) {
|
10697 | if (this.tokenizer.peek().type == TOKEN_CCLOSE) {
|
10698 | this.tokenizer.get();
|
10699 | break;
|
10700 | }
|
10701 | }
|
10702 | else if (token.type == TOKEN_CCLOSE) {
|
10703 | break;
|
10704 | }
|
10705 | else {
|
10706 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10707 | }
|
10708 | }
|
10709 | return node;
|
10710 | }
|
10711 | else if (token.type == TOKEN_POPEN) {
|
10712 | var node = this.parse_expr1();
|
10713 | var token = this.tokenizer.get();
|
10714 | if (token.type != TOKEN_PCLOSE) {
|
10715 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10716 | }
|
10717 | }
|
10718 | else if (token.type == TOKEN_OPTION) {
|
10719 | var node = Node(NODE_OPTION);
|
10720 | node.pos = token.pos;
|
10721 | node.value = token.value;
|
10722 | }
|
10723 | else if (token.type == TOKEN_IDENTIFIER) {
|
10724 | this.reader.seek_set(pos);
|
10725 | var node = this.parse_identifier();
|
10726 | }
|
10727 | else if (FALSE && (token.type == TOKEN_COLON || token.type == TOKEN_SHARP)) {
|
10728 |
|
10729 | this.reader.seek_set(pos);
|
10730 | var node = this.parse_identifier();
|
10731 | }
|
10732 | else if (token.type == TOKEN_LT && viml_equalci(this.reader.peekn(4), "SID>")) {
|
10733 | this.reader.seek_set(pos);
|
10734 | var node = this.parse_identifier();
|
10735 | }
|
10736 | else if (token.type == TOKEN_IS || token.type == TOKEN_ISCS || token.type == TOKEN_ISNOT || token.type == TOKEN_ISNOTCS) {
|
10737 | this.reader.seek_set(pos);
|
10738 | var node = this.parse_identifier();
|
10739 | }
|
10740 | else if (token.type == TOKEN_ENV) {
|
10741 | var node = Node(NODE_ENV);
|
10742 | node.pos = token.pos;
|
10743 | node.value = token.value;
|
10744 | }
|
10745 | else if (token.type == TOKEN_REG) {
|
10746 | var node = Node(NODE_REG);
|
10747 | node.pos = token.pos;
|
10748 | node.value = token.value;
|
10749 | }
|
10750 | else {
|
10751 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10752 | }
|
10753 | return node;
|
10754 | }
|
10755 |
|
10756 |
|
10757 |
|
10758 |
|
10759 | ExprParser.prototype.parse_dot = function(token, left) {
|
10760 | if (left.type != NODE_IDENTIFIER && left.type != NODE_CURLYNAME && left.type != NODE_DICT && left.type != NODE_SUBSCRIPT && left.type != NODE_CALL && left.type != NODE_DOT) {
|
10761 | return NIL;
|
10762 | }
|
10763 | if (!iswordc(this.reader.p(0))) {
|
10764 | return NIL;
|
10765 | }
|
10766 | var pos = this.reader.getpos();
|
10767 | var name = this.reader.read_word();
|
10768 | if (isnamec(this.reader.p(0))) {
|
10769 |
|
10770 |
|
10771 | return NIL;
|
10772 | }
|
10773 | var node = Node(NODE_DOT);
|
10774 | node.pos = token.pos;
|
10775 | node.left = left;
|
10776 | node.right = Node(NODE_IDENTIFIER);
|
10777 | node.right.pos = pos;
|
10778 | node.right.value = name;
|
10779 | return node;
|
10780 | }
|
10781 |
|
10782 |
|
10783 |
|
10784 | ExprParser.prototype.parse_concat = function(token, left) {
|
10785 | if (left.type != NODE_IDENTIFIER && left.type != NODE_CURLYNAME && left.type != NODE_DICT && left.type != NODE_SUBSCRIPT && left.type != NODE_CALL && left.type != NODE_DOT) {
|
10786 | return NIL;
|
10787 | }
|
10788 | if (!iswordc(this.reader.p(0))) {
|
10789 | return NIL;
|
10790 | }
|
10791 | var pos = this.reader.getpos();
|
10792 | var name = this.reader.read_word();
|
10793 | if (isnamec(this.reader.p(0))) {
|
10794 |
|
10795 |
|
10796 | return NIL;
|
10797 | }
|
10798 | var node = Node(NODE_CONCAT);
|
10799 | node.pos = token.pos;
|
10800 | node.left = left;
|
10801 | node.right = Node(NODE_IDENTIFIER);
|
10802 | node.right.pos = pos;
|
10803 | node.right.value = name;
|
10804 | return node;
|
10805 | }
|
10806 |
|
10807 | ExprParser.prototype.parse_identifier = function() {
|
10808 | this.reader.skip_white();
|
10809 | var npos = this.reader.getpos();
|
10810 | var curly_parts = this.parse_curly_parts();
|
10811 | if (viml_len(curly_parts) == 1 && curly_parts[0].type == NODE_CURLYNAMEPART) {
|
10812 | var node = Node(NODE_IDENTIFIER);
|
10813 | node.pos = npos;
|
10814 | node.value = curly_parts[0].value;
|
10815 | return node;
|
10816 | }
|
10817 | else {
|
10818 | var node = Node(NODE_CURLYNAME);
|
10819 | node.pos = npos;
|
10820 | node.value = curly_parts;
|
10821 | return node;
|
10822 | }
|
10823 | }
|
10824 |
|
10825 | ExprParser.prototype.parse_curly_parts = function() {
|
10826 | var curly_parts = [];
|
10827 | var c = this.reader.peek();
|
10828 | var pos = this.reader.getpos();
|
10829 | if (c == "<" && viml_equalci(this.reader.peekn(5), "<SID>")) {
|
10830 | var name = this.reader.getn(5);
|
10831 | var node = Node(NODE_CURLYNAMEPART);
|
10832 | node.curly = FALSE;
|
10833 |
|
10834 | node.pos = pos;
|
10835 | node.value = name;
|
10836 | viml_add(curly_parts, node);
|
10837 | }
|
10838 | while (TRUE) {
|
10839 | var c = this.reader.peek();
|
10840 | if (isnamec(c)) {
|
10841 | var pos = this.reader.getpos();
|
10842 | var name = this.reader.read_name();
|
10843 | var node = Node(NODE_CURLYNAMEPART);
|
10844 | node.curly = FALSE;
|
10845 |
|
10846 | node.pos = pos;
|
10847 | node.value = name;
|
10848 | viml_add(curly_parts, node);
|
10849 | }
|
10850 | else if (c == "{") {
|
10851 | this.reader.get();
|
10852 | var pos = this.reader.getpos();
|
10853 | var node = Node(NODE_CURLYNAMEEXPR);
|
10854 | node.curly = TRUE;
|
10855 |
|
10856 | node.pos = pos;
|
10857 | node.value = this.parse_expr1();
|
10858 | viml_add(curly_parts, node);
|
10859 | this.reader.skip_white();
|
10860 | var c = this.reader.p(0);
|
10861 | if (c != "}") {
|
10862 | throw Err(viml_printf("unexpected token: %s", c), this.reader.getpos());
|
10863 | }
|
10864 | this.reader.seek_cur(1);
|
10865 | }
|
10866 | else {
|
10867 | break;
|
10868 | }
|
10869 | }
|
10870 | return curly_parts;
|
10871 | }
|
10872 |
|
10873 | function LvalueParser() { ExprParser.apply(this, arguments); this.__init__.apply(this, arguments); }
|
10874 | LvalueParser.prototype = Object.create(ExprParser.prototype);
|
10875 | LvalueParser.prototype.parse = function() {
|
10876 | return this.parse_lv8();
|
10877 | }
|
10878 |
|
10879 |
|
10880 |
|
10881 |
|
10882 | LvalueParser.prototype.parse_lv8 = function() {
|
10883 | var left = this.parse_lv9();
|
10884 | while (TRUE) {
|
10885 | var pos = this.reader.tell();
|
10886 | var c = this.reader.peek();
|
10887 | var token = this.tokenizer.get();
|
10888 | if (!iswhite(c) && token.type == TOKEN_SQOPEN) {
|
10889 | var npos = token.pos;
|
10890 | var node = Node(-1);
|
10891 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
10892 | this.tokenizer.get();
|
10893 | var node = Node(NODE_SLICE);
|
10894 | node.pos = npos;
|
10895 | node.left = left;
|
10896 | node.rlist = [NIL, NIL];
|
10897 | var token = this.tokenizer.peek();
|
10898 | if (token.type != TOKEN_SQCLOSE) {
|
10899 | node.rlist[1] = this.parse_expr1();
|
10900 | }
|
10901 | var token = this.tokenizer.get();
|
10902 | if (token.type != TOKEN_SQCLOSE) {
|
10903 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10904 | }
|
10905 | }
|
10906 | else {
|
10907 | var right = this.parse_expr1();
|
10908 | if (this.tokenizer.peek().type == TOKEN_COLON) {
|
10909 | this.tokenizer.get();
|
10910 | var node = Node(NODE_SLICE);
|
10911 | node.pos = npos;
|
10912 | node.left = left;
|
10913 | node.rlist = [right, NIL];
|
10914 | var token = this.tokenizer.peek();
|
10915 | if (token.type != TOKEN_SQCLOSE) {
|
10916 | node.rlist[1] = this.parse_expr1();
|
10917 | }
|
10918 | var token = this.tokenizer.get();
|
10919 | if (token.type != TOKEN_SQCLOSE) {
|
10920 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10921 | }
|
10922 | }
|
10923 | else {
|
10924 | var node = Node(NODE_SUBSCRIPT);
|
10925 | node.pos = npos;
|
10926 | node.left = left;
|
10927 | node.right = right;
|
10928 | var token = this.tokenizer.get();
|
10929 | if (token.type != TOKEN_SQCLOSE) {
|
10930 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10931 | }
|
10932 | }
|
10933 | }
|
10934 | var left = node;
|
10935 | delete node;
|
10936 | }
|
10937 | else if (!iswhite(c) && token.type == TOKEN_DOT) {
|
10938 | var node = this.parse_dot(token, left);
|
10939 | if (node === NIL) {
|
10940 | this.reader.seek_set(pos);
|
10941 | break;
|
10942 | }
|
10943 | var left = node;
|
10944 | delete node;
|
10945 | }
|
10946 | else {
|
10947 | this.reader.seek_set(pos);
|
10948 | break;
|
10949 | }
|
10950 | }
|
10951 | return left;
|
10952 | }
|
10953 |
|
10954 |
|
10955 |
|
10956 |
|
10957 |
|
10958 |
|
10959 | LvalueParser.prototype.parse_lv9 = function() {
|
10960 | var pos = this.reader.tell();
|
10961 | var token = this.tokenizer.get();
|
10962 | var node = Node(-1);
|
10963 | if (token.type == TOKEN_COPEN) {
|
10964 | this.reader.seek_set(pos);
|
10965 | var node = this.parse_identifier();
|
10966 | }
|
10967 | else if (token.type == TOKEN_OPTION) {
|
10968 | var node = Node(NODE_OPTION);
|
10969 | node.pos = token.pos;
|
10970 | node.value = token.value;
|
10971 | }
|
10972 | else if (token.type == TOKEN_IDENTIFIER) {
|
10973 | this.reader.seek_set(pos);
|
10974 | var node = this.parse_identifier();
|
10975 | }
|
10976 | else if (token.type == TOKEN_LT && viml_equalci(this.reader.peekn(4), "SID>")) {
|
10977 | this.reader.seek_set(pos);
|
10978 | var node = this.parse_identifier();
|
10979 | }
|
10980 | else if (token.type == TOKEN_ENV) {
|
10981 | var node = Node(NODE_ENV);
|
10982 | node.pos = token.pos;
|
10983 | node.value = token.value;
|
10984 | }
|
10985 | else if (token.type == TOKEN_REG) {
|
10986 | var node = Node(NODE_REG);
|
10987 | node.pos = token.pos;
|
10988 | node.pos = token.pos;
|
10989 | node.value = token.value;
|
10990 | }
|
10991 | else {
|
10992 | throw Err(viml_printf("unexpected token: %s", token.value), token.pos);
|
10993 | }
|
10994 | return node;
|
10995 | }
|
10996 |
|
10997 | function StringReader() { this.__init__.apply(this, arguments); }
|
10998 | StringReader.prototype.__init__ = function(lines) {
|
10999 | this.buf = [];
|
11000 | this.pos = [];
|
11001 | var lnum = 0;
|
11002 | var offset = 0;
|
11003 | while (lnum < viml_len(lines)) {
|
11004 | var col = 0;
|
11005 | var __c7 = viml_split(lines[lnum], "\\zs");
|
11006 | for (var __i7 = 0; __i7 < __c7.length; ++__i7) {
|
11007 | var c = __c7[__i7];
|
11008 | viml_add(this.buf, c);
|
11009 | viml_add(this.pos, [lnum + 1, col + 1, offset]);
|
11010 | col += viml_len(c);
|
11011 | offset += viml_len(c);
|
11012 | }
|
11013 | while (lnum + 1 < viml_len(lines) && viml_eqregh(lines[lnum + 1], "^\\s*\\\\")) {
|
11014 | var skip = TRUE;
|
11015 | var col = 0;
|
11016 | var __c8 = viml_split(lines[lnum + 1], "\\zs");
|
11017 | for (var __i8 = 0; __i8 < __c8.length; ++__i8) {
|
11018 | var c = __c8[__i8];
|
11019 | if (skip) {
|
11020 | if (c == "\\") {
|
11021 | var skip = FALSE;
|
11022 | }
|
11023 | }
|
11024 | else {
|
11025 | viml_add(this.buf, c);
|
11026 | viml_add(this.pos, [lnum + 2, col + 1, offset]);
|
11027 | }
|
11028 | col += viml_len(c);
|
11029 | offset += viml_len(c);
|
11030 | }
|
11031 | lnum += 1;
|
11032 | offset += 1;
|
11033 | }
|
11034 | viml_add(this.buf, "<EOL>");
|
11035 | viml_add(this.pos, [lnum + 1, col + 1, offset]);
|
11036 | lnum += 1;
|
11037 | offset += 1;
|
11038 | }
|
11039 |
|
11040 | viml_add(this.pos, [lnum + 1, 0, offset]);
|
11041 | this.i = 0;
|
11042 | }
|
11043 |
|
11044 | StringReader.prototype.eof = function() {
|
11045 | return this.i >= viml_len(this.buf);
|
11046 | }
|
11047 |
|
11048 | StringReader.prototype.tell = function() {
|
11049 | return this.i;
|
11050 | }
|
11051 |
|
11052 | StringReader.prototype.seek_set = function(i) {
|
11053 | this.i = i;
|
11054 | }
|
11055 |
|
11056 | StringReader.prototype.seek_cur = function(i) {
|
11057 | this.i = this.i + i;
|
11058 | }
|
11059 |
|
11060 | StringReader.prototype.seek_end = function(i) {
|
11061 | this.i = viml_len(this.buf) + i;
|
11062 | }
|
11063 |
|
11064 | StringReader.prototype.p = function(i) {
|
11065 | if (this.i >= viml_len(this.buf)) {
|
11066 | return "<EOF>";
|
11067 | }
|
11068 | return this.buf[this.i + i];
|
11069 | }
|
11070 |
|
11071 | StringReader.prototype.peek = function() {
|
11072 | if (this.i >= viml_len(this.buf)) {
|
11073 | return "<EOF>";
|
11074 | }
|
11075 | return this.buf[this.i];
|
11076 | }
|
11077 |
|
11078 | StringReader.prototype.get = function() {
|
11079 | if (this.i >= viml_len(this.buf)) {
|
11080 | return "<EOF>";
|
11081 | }
|
11082 | this.i += 1;
|
11083 | return this.buf[this.i - 1];
|
11084 | }
|
11085 |
|
11086 | StringReader.prototype.peekn = function(n) {
|
11087 | var pos = this.tell();
|
11088 | var r = this.getn(n);
|
11089 | this.seek_set(pos);
|
11090 | return r;
|
11091 | }
|
11092 |
|
11093 | StringReader.prototype.getn = function(n) {
|
11094 | var r = "";
|
11095 | var j = 0;
|
11096 | while (this.i < viml_len(this.buf) && (n < 0 || j < n)) {
|
11097 | var c = this.buf[this.i];
|
11098 | if (c == "<EOL>") {
|
11099 | break;
|
11100 | }
|
11101 | r += c;
|
11102 | this.i += 1;
|
11103 | j += 1;
|
11104 | }
|
11105 | return r;
|
11106 | }
|
11107 |
|
11108 | StringReader.prototype.peekline = function() {
|
11109 | return this.peekn(-1);
|
11110 | }
|
11111 |
|
11112 | StringReader.prototype.readline = function() {
|
11113 | var r = this.getn(-1);
|
11114 | this.get();
|
11115 | return r;
|
11116 | }
|
11117 |
|
11118 | StringReader.prototype.getstr = function(begin, end) {
|
11119 | var r = "";
|
11120 | var __c9 = viml_range(begin.i, end.i - 1);
|
11121 | for (var __i9 = 0; __i9 < __c9.length; ++__i9) {
|
11122 | var i = __c9[__i9];
|
11123 | if (i >= viml_len(this.buf)) {
|
11124 | break;
|
11125 | }
|
11126 | var c = this.buf[i];
|
11127 | if (c == "<EOL>") {
|
11128 | var c = "\n";
|
11129 | }
|
11130 | r += c;
|
11131 | }
|
11132 | return r;
|
11133 | }
|
11134 |
|
11135 | StringReader.prototype.getpos = function() {
|
11136 | var __tmp = this.pos[this.i];
|
11137 | var lnum = __tmp[0];
|
11138 | var col = __tmp[1];
|
11139 | var offset = __tmp[2];
|
11140 | return {"i":this.i, "lnum":lnum, "col":col, "offset":offset};
|
11141 | }
|
11142 |
|
11143 | StringReader.prototype.setpos = function(pos) {
|
11144 | this.i = pos.i;
|
11145 | }
|
11146 |
|
11147 | StringReader.prototype.read_alpha = function() {
|
11148 | var r = "";
|
11149 | while (isalpha(this.peekn(1))) {
|
11150 | r += this.getn(1);
|
11151 | }
|
11152 | return r;
|
11153 | }
|
11154 |
|
11155 | StringReader.prototype.read_alnum = function() {
|
11156 | var r = "";
|
11157 | while (isalnum(this.peekn(1))) {
|
11158 | r += this.getn(1);
|
11159 | }
|
11160 | return r;
|
11161 | }
|
11162 |
|
11163 | StringReader.prototype.read_digit = function() {
|
11164 | var r = "";
|
11165 | while (isdigit(this.peekn(1))) {
|
11166 | r += this.getn(1);
|
11167 | }
|
11168 | return r;
|
11169 | }
|
11170 |
|
11171 | StringReader.prototype.read_odigit = function() {
|
11172 | var r = "";
|
11173 | while (isodigit(this.peekn(1))) {
|
11174 | r += this.getn(1);
|
11175 | }
|
11176 | return r;
|
11177 | }
|
11178 |
|
11179 | StringReader.prototype.read_blob = function() {
|
11180 | var r = "";
|
11181 | while (1) {
|
11182 | var s = this.peekn(2);
|
11183 | if (viml_eqregh(s, "^[0-9A-Fa-f][0-9A-Fa-f]$")) {
|
11184 | r += this.getn(2);
|
11185 | }
|
11186 | else if (viml_eqregh(s, "^\\.[0-9A-Fa-f]$")) {
|
11187 | r += this.getn(1);
|
11188 | }
|
11189 | else if (viml_eqregh(s, "^[0-9A-Fa-f][^0-9A-Fa-f]$")) {
|
11190 | throw Err("E973: Blob literal should have an even number of hex characters:" + s, this.getpos());
|
11191 | }
|
11192 | else {
|
11193 | break;
|
11194 | }
|
11195 | }
|
11196 | return r;
|
11197 | }
|
11198 |
|
11199 | StringReader.prototype.read_xdigit = function() {
|
11200 | var r = "";
|
11201 | while (isxdigit(this.peekn(1))) {
|
11202 | r += this.getn(1);
|
11203 | }
|
11204 | return r;
|
11205 | }
|
11206 |
|
11207 | StringReader.prototype.read_bdigit = function() {
|
11208 | var r = "";
|
11209 | while (this.peekn(1) == "0" || this.peekn(1) == "1") {
|
11210 | r += this.getn(1);
|
11211 | }
|
11212 | return r;
|
11213 | }
|
11214 |
|
11215 | StringReader.prototype.read_integer = function() {
|
11216 | var r = "";
|
11217 | var c = this.peekn(1);
|
11218 | if (c == "-" || c == "+") {
|
11219 | var r = this.getn(1);
|
11220 | }
|
11221 | return r + this.read_digit();
|
11222 | }
|
11223 |
|
11224 | StringReader.prototype.read_word = function() {
|
11225 | var r = "";
|
11226 | while (iswordc(this.peekn(1))) {
|
11227 | r += this.getn(1);
|
11228 | }
|
11229 | return r;
|
11230 | }
|
11231 |
|
11232 | StringReader.prototype.read_white = function() {
|
11233 | var r = "";
|
11234 | while (iswhite(this.peekn(1))) {
|
11235 | r += this.getn(1);
|
11236 | }
|
11237 | return r;
|
11238 | }
|
11239 |
|
11240 | StringReader.prototype.read_nonwhite = function() {
|
11241 | var r = "";
|
11242 | var ch = this.peekn(1);
|
11243 | while (!iswhite(ch) && ch != "") {
|
11244 | r += this.getn(1);
|
11245 | var ch = this.peekn(1);
|
11246 | }
|
11247 | return r;
|
11248 | }
|
11249 |
|
11250 | StringReader.prototype.read_name = function() {
|
11251 | var r = "";
|
11252 | while (isnamec(this.peekn(1))) {
|
11253 | r += this.getn(1);
|
11254 | }
|
11255 | return r;
|
11256 | }
|
11257 |
|
11258 | StringReader.prototype.skip_white = function() {
|
11259 | while (iswhite(this.peekn(1))) {
|
11260 | this.seek_cur(1);
|
11261 | }
|
11262 | }
|
11263 |
|
11264 | StringReader.prototype.skip_white_and_colon = function() {
|
11265 | while (TRUE) {
|
11266 | var c = this.peekn(1);
|
11267 | if (!iswhite(c) && c != ":") {
|
11268 | break;
|
11269 | }
|
11270 | this.seek_cur(1);
|
11271 | }
|
11272 | }
|
11273 |
|
11274 | function Compiler() { this.__init__.apply(this, arguments); }
|
11275 | Compiler.prototype.__init__ = function() {
|
11276 | this.indent = [""];
|
11277 | this.lines = [];
|
11278 | }
|
11279 |
|
11280 | Compiler.prototype.out = function() {
|
11281 | var a000 = Array.prototype.slice.call(arguments, 0);
|
11282 | if (viml_len(a000) == 1) {
|
11283 | if (a000[0][0] == ")") {
|
11284 | this.lines[this.lines.length - 1] += a000[0];
|
11285 | }
|
11286 | else {
|
11287 | viml_add(this.lines, this.indent[0] + a000[0]);
|
11288 | }
|
11289 | }
|
11290 | else {
|
11291 | viml_add(this.lines, this.indent[0] + viml_printf.apply(null, a000));
|
11292 | }
|
11293 | }
|
11294 |
|
11295 | Compiler.prototype.incindent = function(s) {
|
11296 | viml_insert(this.indent, this.indent[0] + s);
|
11297 | }
|
11298 |
|
11299 | Compiler.prototype.decindent = function() {
|
11300 | viml_remove(this.indent, 0);
|
11301 | }
|
11302 |
|
11303 | Compiler.prototype.compile = function(node) {
|
11304 | if (node.type == NODE_TOPLEVEL) {
|
11305 | return this.compile_toplevel(node);
|
11306 | }
|
11307 | else if (node.type == NODE_COMMENT) {
|
11308 | this.compile_comment(node);
|
11309 | return NIL;
|
11310 | }
|
11311 | else if (node.type == NODE_EXCMD) {
|
11312 | this.compile_excmd(node);
|
11313 | return NIL;
|
11314 | }
|
11315 | else if (node.type == NODE_FUNCTION) {
|
11316 | this.compile_function(node);
|
11317 | return NIL;
|
11318 | }
|
11319 | else if (node.type == NODE_DELFUNCTION) {
|
11320 | this.compile_delfunction(node);
|
11321 | return NIL;
|
11322 | }
|
11323 | else if (node.type == NODE_RETURN) {
|
11324 | this.compile_return(node);
|
11325 | return NIL;
|
11326 | }
|
11327 | else if (node.type == NODE_EXCALL) {
|
11328 | this.compile_excall(node);
|
11329 | return NIL;
|
11330 | }
|
11331 | else if (node.type == NODE_EVAL) {
|
11332 | this.compile_eval(node);
|
11333 | return NIL;
|
11334 | }
|
11335 | else if (node.type == NODE_LET) {
|
11336 | this.compile_let(node);
|
11337 | return NIL;
|
11338 | }
|
11339 | else if (node.type == NODE_CONST) {
|
11340 | this.compile_const(node);
|
11341 | return NIL;
|
11342 | }
|
11343 | else if (node.type == NODE_UNLET) {
|
11344 | this.compile_unlet(node);
|
11345 | return NIL;
|
11346 | }
|
11347 | else if (node.type == NODE_LOCKVAR) {
|
11348 | this.compile_lockvar(node);
|
11349 | return NIL;
|
11350 | }
|
11351 | else if (node.type == NODE_UNLOCKVAR) {
|
11352 | this.compile_unlockvar(node);
|
11353 | return NIL;
|
11354 | }
|
11355 | else if (node.type == NODE_IF) {
|
11356 | this.compile_if(node);
|
11357 | return NIL;
|
11358 | }
|
11359 | else if (node.type == NODE_WHILE) {
|
11360 | this.compile_while(node);
|
11361 | return NIL;
|
11362 | }
|
11363 | else if (node.type == NODE_FOR) {
|
11364 | this.compile_for(node);
|
11365 | return NIL;
|
11366 | }
|
11367 | else if (node.type == NODE_CONTINUE) {
|
11368 | this.compile_continue(node);
|
11369 | return NIL;
|
11370 | }
|
11371 | else if (node.type == NODE_BREAK) {
|
11372 | this.compile_break(node);
|
11373 | return NIL;
|
11374 | }
|
11375 | else if (node.type == NODE_TRY) {
|
11376 | this.compile_try(node);
|
11377 | return NIL;
|
11378 | }
|
11379 | else if (node.type == NODE_THROW) {
|
11380 | this.compile_throw(node);
|
11381 | return NIL;
|
11382 | }
|
11383 | else if (node.type == NODE_ECHO) {
|
11384 | this.compile_echo(node);
|
11385 | return NIL;
|
11386 | }
|
11387 | else if (node.type == NODE_ECHON) {
|
11388 | this.compile_echon(node);
|
11389 | return NIL;
|
11390 | }
|
11391 | else if (node.type == NODE_ECHOHL) {
|
11392 | this.compile_echohl(node);
|
11393 | return NIL;
|
11394 | }
|
11395 | else if (node.type == NODE_ECHOMSG) {
|
11396 | this.compile_echomsg(node);
|
11397 | return NIL;
|
11398 | }
|
11399 | else if (node.type == NODE_ECHOERR) {
|
11400 | this.compile_echoerr(node);
|
11401 | return NIL;
|
11402 | }
|
11403 | else if (node.type == NODE_EXECUTE) {
|
11404 | this.compile_execute(node);
|
11405 | return NIL;
|
11406 | }
|
11407 | else if (node.type == NODE_TERNARY) {
|
11408 | return this.compile_ternary(node);
|
11409 | }
|
11410 | else if (node.type == NODE_OR) {
|
11411 | return this.compile_or(node);
|
11412 | }
|
11413 | else if (node.type == NODE_AND) {
|
11414 | return this.compile_and(node);
|
11415 | }
|
11416 | else if (node.type == NODE_EQUAL) {
|
11417 | return this.compile_equal(node);
|
11418 | }
|
11419 | else if (node.type == NODE_EQUALCI) {
|
11420 | return this.compile_equalci(node);
|
11421 | }
|
11422 | else if (node.type == NODE_EQUALCS) {
|
11423 | return this.compile_equalcs(node);
|
11424 | }
|
11425 | else if (node.type == NODE_NEQUAL) {
|
11426 | return this.compile_nequal(node);
|
11427 | }
|
11428 | else if (node.type == NODE_NEQUALCI) {
|
11429 | return this.compile_nequalci(node);
|
11430 | }
|
11431 | else if (node.type == NODE_NEQUALCS) {
|
11432 | return this.compile_nequalcs(node);
|
11433 | }
|
11434 | else if (node.type == NODE_GREATER) {
|
11435 | return this.compile_greater(node);
|
11436 | }
|
11437 | else if (node.type == NODE_GREATERCI) {
|
11438 | return this.compile_greaterci(node);
|
11439 | }
|
11440 | else if (node.type == NODE_GREATERCS) {
|
11441 | return this.compile_greatercs(node);
|
11442 | }
|
11443 | else if (node.type == NODE_GEQUAL) {
|
11444 | return this.compile_gequal(node);
|
11445 | }
|
11446 | else if (node.type == NODE_GEQUALCI) {
|
11447 | return this.compile_gequalci(node);
|
11448 | }
|
11449 | else if (node.type == NODE_GEQUALCS) {
|
11450 | return this.compile_gequalcs(node);
|
11451 | }
|
11452 | else if (node.type == NODE_SMALLER) {
|
11453 | return this.compile_smaller(node);
|
11454 | }
|
11455 | else if (node.type == NODE_SMALLERCI) {
|
11456 | return this.compile_smallerci(node);
|
11457 | }
|
11458 | else if (node.type == NODE_SMALLERCS) {
|
11459 | return this.compile_smallercs(node);
|
11460 | }
|
11461 | else if (node.type == NODE_SEQUAL) {
|
11462 | return this.compile_sequal(node);
|
11463 | }
|
11464 | else if (node.type == NODE_SEQUALCI) {
|
11465 | return this.compile_sequalci(node);
|
11466 | }
|
11467 | else if (node.type == NODE_SEQUALCS) {
|
11468 | return this.compile_sequalcs(node);
|
11469 | }
|
11470 | else if (node.type == NODE_MATCH) {
|
11471 | return this.compile_match(node);
|
11472 | }
|
11473 | else if (node.type == NODE_MATCHCI) {
|
11474 | return this.compile_matchci(node);
|
11475 | }
|
11476 | else if (node.type == NODE_MATCHCS) {
|
11477 | return this.compile_matchcs(node);
|
11478 | }
|
11479 | else if (node.type == NODE_NOMATCH) {
|
11480 | return this.compile_nomatch(node);
|
11481 | }
|
11482 | else if (node.type == NODE_NOMATCHCI) {
|
11483 | return this.compile_nomatchci(node);
|
11484 | }
|
11485 | else if (node.type == NODE_NOMATCHCS) {
|
11486 | return this.compile_nomatchcs(node);
|
11487 | }
|
11488 | else if (node.type == NODE_IS) {
|
11489 | return this.compile_is(node);
|
11490 | }
|
11491 | else if (node.type == NODE_ISCI) {
|
11492 | return this.compile_isci(node);
|
11493 | }
|
11494 | else if (node.type == NODE_ISCS) {
|
11495 | return this.compile_iscs(node);
|
11496 | }
|
11497 | else if (node.type == NODE_ISNOT) {
|
11498 | return this.compile_isnot(node);
|
11499 | }
|
11500 | else if (node.type == NODE_ISNOTCI) {
|
11501 | return this.compile_isnotci(node);
|
11502 | }
|
11503 | else if (node.type == NODE_ISNOTCS) {
|
11504 | return this.compile_isnotcs(node);
|
11505 | }
|
11506 | else if (node.type == NODE_ADD) {
|
11507 | return this.compile_add(node);
|
11508 | }
|
11509 | else if (node.type == NODE_SUBTRACT) {
|
11510 | return this.compile_subtract(node);
|
11511 | }
|
11512 | else if (node.type == NODE_CONCAT) {
|
11513 | return this.compile_concat(node);
|
11514 | }
|
11515 | else if (node.type == NODE_MULTIPLY) {
|
11516 | return this.compile_multiply(node);
|
11517 | }
|
11518 | else if (node.type == NODE_DIVIDE) {
|
11519 | return this.compile_divide(node);
|
11520 | }
|
11521 | else if (node.type == NODE_REMAINDER) {
|
11522 | return this.compile_remainder(node);
|
11523 | }
|
11524 | else if (node.type == NODE_NOT) {
|
11525 | return this.compile_not(node);
|
11526 | }
|
11527 | else if (node.type == NODE_PLUS) {
|
11528 | return this.compile_plus(node);
|
11529 | }
|
11530 | else if (node.type == NODE_MINUS) {
|
11531 | return this.compile_minus(node);
|
11532 | }
|
11533 | else if (node.type == NODE_SUBSCRIPT) {
|
11534 | return this.compile_subscript(node);
|
11535 | }
|
11536 | else if (node.type == NODE_SLICE) {
|
11537 | return this.compile_slice(node);
|
11538 | }
|
11539 | else if (node.type == NODE_DOT) {
|
11540 | return this.compile_dot(node);
|
11541 | }
|
11542 | else if (node.type == NODE_METHOD) {
|
11543 | return this.compile_method(node);
|
11544 | }
|
11545 | else if (node.type == NODE_CALL) {
|
11546 | return this.compile_call(node);
|
11547 | }
|
11548 | else if (node.type == NODE_NUMBER) {
|
11549 | return this.compile_number(node);
|
11550 | }
|
11551 | else if (node.type == NODE_BLOB) {
|
11552 | return this.compile_blob(node);
|
11553 | }
|
11554 | else if (node.type == NODE_STRING) {
|
11555 | return this.compile_string(node);
|
11556 | }
|
11557 | else if (node.type == NODE_LIST) {
|
11558 | return this.compile_list(node);
|
11559 | }
|
11560 | else if (node.type == NODE_DICT) {
|
11561 | return this.compile_dict(node);
|
11562 | }
|
11563 | else if (node.type == NODE_OPTION) {
|
11564 | return this.compile_option(node);
|
11565 | }
|
11566 | else if (node.type == NODE_IDENTIFIER) {
|
11567 | return this.compile_identifier(node);
|
11568 | }
|
11569 | else if (node.type == NODE_CURLYNAME) {
|
11570 | return this.compile_curlyname(node);
|
11571 | }
|
11572 | else if (node.type == NODE_ENV) {
|
11573 | return this.compile_env(node);
|
11574 | }
|
11575 | else if (node.type == NODE_REG) {
|
11576 | return this.compile_reg(node);
|
11577 | }
|
11578 | else if (node.type == NODE_CURLYNAMEPART) {
|
11579 | return this.compile_curlynamepart(node);
|
11580 | }
|
11581 | else if (node.type == NODE_CURLYNAMEEXPR) {
|
11582 | return this.compile_curlynameexpr(node);
|
11583 | }
|
11584 | else if (node.type == NODE_LAMBDA) {
|
11585 | return this.compile_lambda(node);
|
11586 | }
|
11587 | else if (node.type == NODE_HEREDOC) {
|
11588 | return this.compile_heredoc(node);
|
11589 | }
|
11590 | else {
|
11591 | throw viml_printf("Compiler: unknown node: %s", viml_string(node));
|
11592 | }
|
11593 | return NIL;
|
11594 | }
|
11595 |
|
11596 | Compiler.prototype.compile_body = function(body) {
|
11597 | var __c10 = body;
|
11598 | for (var __i10 = 0; __i10 < __c10.length; ++__i10) {
|
11599 | var node = __c10[__i10];
|
11600 | this.compile(node);
|
11601 | }
|
11602 | }
|
11603 |
|
11604 | Compiler.prototype.compile_toplevel = function(node) {
|
11605 | this.compile_body(node.body);
|
11606 | return this.lines;
|
11607 | }
|
11608 |
|
11609 | Compiler.prototype.compile_comment = function(node) {
|
11610 | this.out(";%s", node.str);
|
11611 | }
|
11612 |
|
11613 | Compiler.prototype.compile_excmd = function(node) {
|
11614 | this.out("(excmd \"%s\")", viml_escape(node.str, "\\\""));
|
11615 | }
|
11616 |
|
11617 | Compiler.prototype.compile_function = function(node) {
|
11618 | var left = this.compile(node.left);
|
11619 | var rlist = node.rlist.map((function(vval) { return this.compile(vval); }).bind(this));
|
11620 | var default_args = node.default_args.map((function(vval) { return this.compile(vval); }).bind(this));
|
11621 | if (!viml_empty(rlist)) {
|
11622 | var remaining = FALSE;
|
11623 | if (rlist[rlist.length - 1] == "...") {
|
11624 | viml_remove(rlist, -1);
|
11625 | var remaining = TRUE;
|
11626 | }
|
11627 | var __c11 = viml_range(viml_len(rlist));
|
11628 | for (var __i11 = 0; __i11 < __c11.length; ++__i11) {
|
11629 | var i = __c11[__i11];
|
11630 | if (i < viml_len(rlist) - viml_len(default_args)) {
|
11631 | left += viml_printf(" %s", rlist[i]);
|
11632 | }
|
11633 | else {
|
11634 | left += viml_printf(" (%s %s)", rlist[i], default_args[i + viml_len(default_args) - viml_len(rlist)]);
|
11635 | }
|
11636 | }
|
11637 | if (remaining) {
|
11638 | left += " . ...";
|
11639 | }
|
11640 | }
|
11641 | this.out("(function (%s)", left);
|
11642 | this.incindent(" ");
|
11643 | this.compile_body(node.body);
|
11644 | this.out(")");
|
11645 | this.decindent();
|
11646 | }
|
11647 |
|
11648 | Compiler.prototype.compile_delfunction = function(node) {
|
11649 | this.out("(delfunction %s)", this.compile(node.left));
|
11650 | }
|
11651 |
|
11652 | Compiler.prototype.compile_return = function(node) {
|
11653 | if (node.left === NIL) {
|
11654 | this.out("(return)");
|
11655 | }
|
11656 | else {
|
11657 | this.out("(return %s)", this.compile(node.left));
|
11658 | }
|
11659 | }
|
11660 |
|
11661 | Compiler.prototype.compile_excall = function(node) {
|
11662 | this.out("(call %s)", this.compile(node.left));
|
11663 | }
|
11664 |
|
11665 | Compiler.prototype.compile_eval = function(node) {
|
11666 | this.out("(eval %s)", this.compile(node.left));
|
11667 | }
|
11668 |
|
11669 | Compiler.prototype.compile_let = function(node) {
|
11670 | var left = "";
|
11671 | if (node.left !== NIL) {
|
11672 | var left = this.compile(node.left);
|
11673 | }
|
11674 | else {
|
11675 | var left = viml_join(node.list.map((function(vval) { return this.compile(vval); }).bind(this)), " ");
|
11676 | if (node.rest !== NIL) {
|
11677 | left += " . " + this.compile(node.rest);
|
11678 | }
|
11679 | var left = "(" + left + ")";
|
11680 | }
|
11681 | var right = this.compile(node.right);
|
11682 | this.out("(let %s %s %s)", node.op, left, right);
|
11683 | }
|
11684 |
|
11685 |
|
11686 | Compiler.prototype.compile_const = function(node) {
|
11687 | var left = "";
|
11688 | if (node.left !== NIL) {
|
11689 | var left = this.compile(node.left);
|
11690 | }
|
11691 | else {
|
11692 | var left = viml_join(node.list.map((function(vval) { return this.compile(vval); }).bind(this)), " ");
|
11693 | if (node.rest !== NIL) {
|
11694 | left += " . " + this.compile(node.rest);
|
11695 | }
|
11696 | var left = "(" + left + ")";
|
11697 | }
|
11698 | var right = this.compile(node.right);
|
11699 | this.out("(const %s %s %s)", node.op, left, right);
|
11700 | }
|
11701 |
|
11702 | Compiler.prototype.compile_unlet = function(node) {
|
11703 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11704 | this.out("(unlet %s)", viml_join(list, " "));
|
11705 | }
|
11706 |
|
11707 | Compiler.prototype.compile_lockvar = function(node) {
|
11708 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11709 | if (node.depth === NIL) {
|
11710 | this.out("(lockvar %s)", viml_join(list, " "));
|
11711 | }
|
11712 | else {
|
11713 | this.out("(lockvar %s %s)", node.depth, viml_join(list, " "));
|
11714 | }
|
11715 | }
|
11716 |
|
11717 | Compiler.prototype.compile_unlockvar = function(node) {
|
11718 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11719 | if (node.depth === NIL) {
|
11720 | this.out("(unlockvar %s)", viml_join(list, " "));
|
11721 | }
|
11722 | else {
|
11723 | this.out("(unlockvar %s %s)", node.depth, viml_join(list, " "));
|
11724 | }
|
11725 | }
|
11726 |
|
11727 | Compiler.prototype.compile_if = function(node) {
|
11728 | this.out("(if %s", this.compile(node.cond));
|
11729 | this.incindent(" ");
|
11730 | this.compile_body(node.body);
|
11731 | this.decindent();
|
11732 | var __c12 = node.elseif;
|
11733 | for (var __i12 = 0; __i12 < __c12.length; ++__i12) {
|
11734 | var enode = __c12[__i12];
|
11735 | this.out(" elseif %s", this.compile(enode.cond));
|
11736 | this.incindent(" ");
|
11737 | this.compile_body(enode.body);
|
11738 | this.decindent();
|
11739 | }
|
11740 | if (node._else !== NIL) {
|
11741 | this.out(" else");
|
11742 | this.incindent(" ");
|
11743 | this.compile_body(node._else.body);
|
11744 | this.decindent();
|
11745 | }
|
11746 | this.incindent(" ");
|
11747 | this.out(")");
|
11748 | this.decindent();
|
11749 | }
|
11750 |
|
11751 | Compiler.prototype.compile_while = function(node) {
|
11752 | this.out("(while %s", this.compile(node.cond));
|
11753 | this.incindent(" ");
|
11754 | this.compile_body(node.body);
|
11755 | this.out(")");
|
11756 | this.decindent();
|
11757 | }
|
11758 |
|
11759 | Compiler.prototype.compile_for = function(node) {
|
11760 | var left = "";
|
11761 | if (node.left !== NIL) {
|
11762 | var left = this.compile(node.left);
|
11763 | }
|
11764 | else {
|
11765 | var left = viml_join(node.list.map((function(vval) { return this.compile(vval); }).bind(this)), " ");
|
11766 | if (node.rest !== NIL) {
|
11767 | left += " . " + this.compile(node.rest);
|
11768 | }
|
11769 | var left = "(" + left + ")";
|
11770 | }
|
11771 | var right = this.compile(node.right);
|
11772 | this.out("(for %s %s", left, right);
|
11773 | this.incindent(" ");
|
11774 | this.compile_body(node.body);
|
11775 | this.out(")");
|
11776 | this.decindent();
|
11777 | }
|
11778 |
|
11779 | Compiler.prototype.compile_continue = function(node) {
|
11780 | this.out("(continue)");
|
11781 | }
|
11782 |
|
11783 | Compiler.prototype.compile_break = function(node) {
|
11784 | this.out("(break)");
|
11785 | }
|
11786 |
|
11787 | Compiler.prototype.compile_try = function(node) {
|
11788 | this.out("(try");
|
11789 | this.incindent(" ");
|
11790 | this.compile_body(node.body);
|
11791 | var __c13 = node.catch;
|
11792 | for (var __i13 = 0; __i13 < __c13.length; ++__i13) {
|
11793 | var cnode = __c13[__i13];
|
11794 | if (cnode.pattern !== NIL) {
|
11795 | this.decindent();
|
11796 | this.out(" catch /%s/", cnode.pattern);
|
11797 | this.incindent(" ");
|
11798 | this.compile_body(cnode.body);
|
11799 | }
|
11800 | else {
|
11801 | this.decindent();
|
11802 | this.out(" catch");
|
11803 | this.incindent(" ");
|
11804 | this.compile_body(cnode.body);
|
11805 | }
|
11806 | }
|
11807 | if (node._finally !== NIL) {
|
11808 | this.decindent();
|
11809 | this.out(" finally");
|
11810 | this.incindent(" ");
|
11811 | this.compile_body(node._finally.body);
|
11812 | }
|
11813 | this.out(")");
|
11814 | this.decindent();
|
11815 | }
|
11816 |
|
11817 | Compiler.prototype.compile_throw = function(node) {
|
11818 | this.out("(throw %s)", this.compile(node.left));
|
11819 | }
|
11820 |
|
11821 | Compiler.prototype.compile_echo = function(node) {
|
11822 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11823 | this.out("(echo %s)", viml_join(list, " "));
|
11824 | }
|
11825 |
|
11826 | Compiler.prototype.compile_echon = function(node) {
|
11827 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11828 | this.out("(echon %s)", viml_join(list, " "));
|
11829 | }
|
11830 |
|
11831 | Compiler.prototype.compile_echohl = function(node) {
|
11832 | this.out("(echohl \"%s\")", viml_escape(node.str, "\\\""));
|
11833 | }
|
11834 |
|
11835 | Compiler.prototype.compile_echomsg = function(node) {
|
11836 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11837 | this.out("(echomsg %s)", viml_join(list, " "));
|
11838 | }
|
11839 |
|
11840 | Compiler.prototype.compile_echoerr = function(node) {
|
11841 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11842 | this.out("(echoerr %s)", viml_join(list, " "));
|
11843 | }
|
11844 |
|
11845 | Compiler.prototype.compile_execute = function(node) {
|
11846 | var list = node.list.map((function(vval) { return this.compile(vval); }).bind(this));
|
11847 | this.out("(execute %s)", viml_join(list, " "));
|
11848 | }
|
11849 |
|
11850 | Compiler.prototype.compile_ternary = function(node) {
|
11851 | return viml_printf("(?: %s %s %s)", this.compile(node.cond), this.compile(node.left), this.compile(node.right));
|
11852 | }
|
11853 |
|
11854 | Compiler.prototype.compile_or = function(node) {
|
11855 | return viml_printf("(|| %s %s)", this.compile(node.left), this.compile(node.right));
|
11856 | }
|
11857 |
|
11858 | Compiler.prototype.compile_and = function(node) {
|
11859 | return viml_printf("(&& %s %s)", this.compile(node.left), this.compile(node.right));
|
11860 | }
|
11861 |
|
11862 | Compiler.prototype.compile_equal = function(node) {
|
11863 | return viml_printf("(== %s %s)", this.compile(node.left), this.compile(node.right));
|
11864 | }
|
11865 |
|
11866 | Compiler.prototype.compile_equalci = function(node) {
|
11867 | return viml_printf("(==? %s %s)", this.compile(node.left), this.compile(node.right));
|
11868 | }
|
11869 |
|
11870 | Compiler.prototype.compile_equalcs = function(node) {
|
11871 | return viml_printf("(==# %s %s)", this.compile(node.left), this.compile(node.right));
|
11872 | }
|
11873 |
|
11874 | Compiler.prototype.compile_nequal = function(node) {
|
11875 | return viml_printf("(!= %s %s)", this.compile(node.left), this.compile(node.right));
|
11876 | }
|
11877 |
|
11878 | Compiler.prototype.compile_nequalci = function(node) {
|
11879 | return viml_printf("(!=? %s %s)", this.compile(node.left), this.compile(node.right));
|
11880 | }
|
11881 |
|
11882 | Compiler.prototype.compile_nequalcs = function(node) {
|
11883 | return viml_printf("(!=# %s %s)", this.compile(node.left), this.compile(node.right));
|
11884 | }
|
11885 |
|
11886 | Compiler.prototype.compile_greater = function(node) {
|
11887 | return viml_printf("(> %s %s)", this.compile(node.left), this.compile(node.right));
|
11888 | }
|
11889 |
|
11890 | Compiler.prototype.compile_greaterci = function(node) {
|
11891 | return viml_printf("(>? %s %s)", this.compile(node.left), this.compile(node.right));
|
11892 | }
|
11893 |
|
11894 | Compiler.prototype.compile_greatercs = function(node) {
|
11895 | return viml_printf("(># %s %s)", this.compile(node.left), this.compile(node.right));
|
11896 | }
|
11897 |
|
11898 | Compiler.prototype.compile_gequal = function(node) {
|
11899 | return viml_printf("(>= %s %s)", this.compile(node.left), this.compile(node.right));
|
11900 | }
|
11901 |
|
11902 | Compiler.prototype.compile_gequalci = function(node) {
|
11903 | return viml_printf("(>=? %s %s)", this.compile(node.left), this.compile(node.right));
|
11904 | }
|
11905 |
|
11906 | Compiler.prototype.compile_gequalcs = function(node) {
|
11907 | return viml_printf("(>=# %s %s)", this.compile(node.left), this.compile(node.right));
|
11908 | }
|
11909 |
|
11910 | Compiler.prototype.compile_smaller = function(node) {
|
11911 | return viml_printf("(< %s %s)", this.compile(node.left), this.compile(node.right));
|
11912 | }
|
11913 |
|
11914 | Compiler.prototype.compile_smallerci = function(node) {
|
11915 | return viml_printf("(<? %s %s)", this.compile(node.left), this.compile(node.right));
|
11916 | }
|
11917 |
|
11918 | Compiler.prototype.compile_smallercs = function(node) {
|
11919 | return viml_printf("(<# %s %s)", this.compile(node.left), this.compile(node.right));
|
11920 | }
|
11921 |
|
11922 | Compiler.prototype.compile_sequal = function(node) {
|
11923 | return viml_printf("(<= %s %s)", this.compile(node.left), this.compile(node.right));
|
11924 | }
|
11925 |
|
11926 | Compiler.prototype.compile_sequalci = function(node) {
|
11927 | return viml_printf("(<=? %s %s)", this.compile(node.left), this.compile(node.right));
|
11928 | }
|
11929 |
|
11930 | Compiler.prototype.compile_sequalcs = function(node) {
|
11931 | return viml_printf("(<=# %s %s)", this.compile(node.left), this.compile(node.right));
|
11932 | }
|
11933 |
|
11934 | Compiler.prototype.compile_match = function(node) {
|
11935 | return viml_printf("(=~ %s %s)", this.compile(node.left), this.compile(node.right));
|
11936 | }
|
11937 |
|
11938 | Compiler.prototype.compile_matchci = function(node) {
|
11939 | return viml_printf("(=~? %s %s)", this.compile(node.left), this.compile(node.right));
|
11940 | }
|
11941 |
|
11942 | Compiler.prototype.compile_matchcs = function(node) {
|
11943 | return viml_printf("(=~# %s %s)", this.compile(node.left), this.compile(node.right));
|
11944 | }
|
11945 |
|
11946 | Compiler.prototype.compile_nomatch = function(node) {
|
11947 | return viml_printf("(!~ %s %s)", this.compile(node.left), this.compile(node.right));
|
11948 | }
|
11949 |
|
11950 | Compiler.prototype.compile_nomatchci = function(node) {
|
11951 | return viml_printf("(!~? %s %s)", this.compile(node.left), this.compile(node.right));
|
11952 | }
|
11953 |
|
11954 | Compiler.prototype.compile_nomatchcs = function(node) {
|
11955 | return viml_printf("(!~# %s %s)", this.compile(node.left), this.compile(node.right));
|
11956 | }
|
11957 |
|
11958 | Compiler.prototype.compile_is = function(node) {
|
11959 | return viml_printf("(is %s %s)", this.compile(node.left), this.compile(node.right));
|
11960 | }
|
11961 |
|
11962 | Compiler.prototype.compile_isci = function(node) {
|
11963 | return viml_printf("(is? %s %s)", this.compile(node.left), this.compile(node.right));
|
11964 | }
|
11965 |
|
11966 | Compiler.prototype.compile_iscs = function(node) {
|
11967 | return viml_printf("(is# %s %s)", this.compile(node.left), this.compile(node.right));
|
11968 | }
|
11969 |
|
11970 | Compiler.prototype.compile_isnot = function(node) {
|
11971 | return viml_printf("(isnot %s %s)", this.compile(node.left), this.compile(node.right));
|
11972 | }
|
11973 |
|
11974 | Compiler.prototype.compile_isnotci = function(node) {
|
11975 | return viml_printf("(isnot? %s %s)", this.compile(node.left), this.compile(node.right));
|
11976 | }
|
11977 |
|
11978 | Compiler.prototype.compile_isnotcs = function(node) {
|
11979 | return viml_printf("(isnot# %s %s)", this.compile(node.left), this.compile(node.right));
|
11980 | }
|
11981 |
|
11982 | Compiler.prototype.compile_add = function(node) {
|
11983 | return viml_printf("(+ %s %s)", this.compile(node.left), this.compile(node.right));
|
11984 | }
|
11985 |
|
11986 | Compiler.prototype.compile_subtract = function(node) {
|
11987 | return viml_printf("(- %s %s)", this.compile(node.left), this.compile(node.right));
|
11988 | }
|
11989 |
|
11990 | Compiler.prototype.compile_concat = function(node) {
|
11991 | return viml_printf("(concat %s %s)", this.compile(node.left), this.compile(node.right));
|
11992 | }
|
11993 |
|
11994 | Compiler.prototype.compile_multiply = function(node) {
|
11995 | return viml_printf("(* %s %s)", this.compile(node.left), this.compile(node.right));
|
11996 | }
|
11997 |
|
11998 | Compiler.prototype.compile_divide = function(node) {
|
11999 | return viml_printf("(/ %s %s)", this.compile(node.left), this.compile(node.right));
|
12000 | }
|
12001 |
|
12002 | Compiler.prototype.compile_remainder = function(node) {
|
12003 | return viml_printf("(%% %s %s)", this.compile(node.left), this.compile(node.right));
|
12004 | }
|
12005 |
|
12006 | Compiler.prototype.compile_not = function(node) {
|
12007 | return viml_printf("(! %s)", this.compile(node.left));
|
12008 | }
|
12009 |
|
12010 | Compiler.prototype.compile_plus = function(node) {
|
12011 | return viml_printf("(+ %s)", this.compile(node.left));
|
12012 | }
|
12013 |
|
12014 | Compiler.prototype.compile_minus = function(node) {
|
12015 | return viml_printf("(- %s)", this.compile(node.left));
|
12016 | }
|
12017 |
|
12018 | Compiler.prototype.compile_subscript = function(node) {
|
12019 | return viml_printf("(subscript %s %s)", this.compile(node.left), this.compile(node.right));
|
12020 | }
|
12021 |
|
12022 | Compiler.prototype.compile_slice = function(node) {
|
12023 | var r0 = node.rlist[0] === NIL ? "nil" : this.compile(node.rlist[0]);
|
12024 | var r1 = node.rlist[1] === NIL ? "nil" : this.compile(node.rlist[1]);
|
12025 | return viml_printf("(slice %s %s %s)", this.compile(node.left), r0, r1);
|
12026 | }
|
12027 |
|
12028 | Compiler.prototype.compile_dot = function(node) {
|
12029 | return viml_printf("(dot %s %s)", this.compile(node.left), this.compile(node.right));
|
12030 | }
|
12031 |
|
12032 | Compiler.prototype.compile_method = function(node) {
|
12033 | return viml_printf("(method %s %s)", this.compile(node.left), this.compile(node.right));
|
12034 | }
|
12035 |
|
12036 | Compiler.prototype.compile_call = function(node) {
|
12037 | var rlist = node.rlist.map((function(vval) { return this.compile(vval); }).bind(this));
|
12038 | if (viml_empty(rlist)) {
|
12039 | return viml_printf("(%s)", this.compile(node.left));
|
12040 | }
|
12041 | else {
|
12042 | return viml_printf("(%s %s)", this.compile(node.left), viml_join(rlist, " "));
|
12043 | }
|
12044 | }
|
12045 |
|
12046 | Compiler.prototype.compile_number = function(node) {
|
12047 | return node.value;
|
12048 | }
|
12049 |
|
12050 | Compiler.prototype.compile_blob = function(node) {
|
12051 | return node.value;
|
12052 | }
|
12053 |
|
12054 | Compiler.prototype.compile_string = function(node) {
|
12055 | return node.value;
|
12056 | }
|
12057 |
|
12058 | Compiler.prototype.compile_list = function(node) {
|
12059 | var value = node.value.map((function(vval) { return this.compile(vval); }).bind(this));
|
12060 | if (viml_empty(value)) {
|
12061 | return "(list)";
|
12062 | }
|
12063 | else {
|
12064 | return viml_printf("(list %s)", viml_join(value, " "));
|
12065 | }
|
12066 | }
|
12067 |
|
12068 | Compiler.prototype.compile_dict = function(node) {
|
12069 | var value = node.value.map((function(vval) { return "(" + this.compile(vval[0]) + " " + this.compile(vval[1]) + ")"; }).bind(this));
|
12070 | if (viml_empty(value)) {
|
12071 | return "(dict)";
|
12072 | }
|
12073 | else {
|
12074 | return viml_printf("(dict %s)", viml_join(value, " "));
|
12075 | }
|
12076 | }
|
12077 |
|
12078 | Compiler.prototype.compile_option = function(node) {
|
12079 | return node.value;
|
12080 | }
|
12081 |
|
12082 | Compiler.prototype.compile_identifier = function(node) {
|
12083 | return node.value;
|
12084 | }
|
12085 |
|
12086 | Compiler.prototype.compile_curlyname = function(node) {
|
12087 | return viml_join(node.value.map((function(vval) { return this.compile(vval); }).bind(this)), "");
|
12088 | }
|
12089 |
|
12090 | Compiler.prototype.compile_env = function(node) {
|
12091 | return node.value;
|
12092 | }
|
12093 |
|
12094 | Compiler.prototype.compile_reg = function(node) {
|
12095 | return node.value;
|
12096 | }
|
12097 |
|
12098 | Compiler.prototype.compile_curlynamepart = function(node) {
|
12099 | return node.value;
|
12100 | }
|
12101 |
|
12102 | Compiler.prototype.compile_curlynameexpr = function(node) {
|
12103 | return "{" + this.compile(node.value) + "}";
|
12104 | }
|
12105 |
|
12106 | Compiler.prototype.escape_string = function(str) {
|
12107 | var m = {"\n":"\\n", "\t":"\\t", "\r":"\\r"};
|
12108 | var out = "\"";
|
12109 | var __c14 = viml_range(viml_len(str));
|
12110 | for (var __i14 = 0; __i14 < __c14.length; ++__i14) {
|
12111 | var i = __c14[__i14];
|
12112 | var c = str[i];
|
12113 | if (viml_has_key(m, c)) {
|
12114 | out += m[c];
|
12115 | }
|
12116 | else {
|
12117 | out += c;
|
12118 | }
|
12119 | }
|
12120 | out += "\"";
|
12121 | return out;
|
12122 | }
|
12123 |
|
12124 | Compiler.prototype.compile_lambda = function(node) {
|
12125 | var rlist = node.rlist.map((function(vval) { return this.compile(vval); }).bind(this));
|
12126 | return viml_printf("(lambda (%s) %s)", viml_join(rlist, " "), this.compile(node.left));
|
12127 | }
|
12128 |
|
12129 | Compiler.prototype.compile_heredoc = function(node) {
|
12130 | if (viml_empty(node.rlist)) {
|
12131 | var rlist = "(list)";
|
12132 | }
|
12133 | else {
|
12134 | var rlist = "(list " + viml_join(node.rlist.map((function(vval) { return this.escape_string(vval); }).bind(this)), " ") + ")";
|
12135 | }
|
12136 | if (viml_empty(node.body)) {
|
12137 | var body = "(list)";
|
12138 | }
|
12139 | else {
|
12140 | var body = "(list " + viml_join(node.body.map((function(vval) { return this.escape_string(vval); }).bind(this)), " ") + ")";
|
12141 | }
|
12142 | var op = this.escape_string(node.op);
|
12143 | return viml_printf("(heredoc %s %s %s)", rlist, op, body);
|
12144 | }
|
12145 |
|
12146 |
|
12147 | function RegexpParser() { this.__init__.apply(this, arguments); }
|
12148 | RegexpParser.prototype.RE_VERY_NOMAGIC = 1;
|
12149 | RegexpParser.prototype.RE_NOMAGIC = 2;
|
12150 | RegexpParser.prototype.RE_MAGIC = 3;
|
12151 | RegexpParser.prototype.RE_VERY_MAGIC = 4;
|
12152 | RegexpParser.prototype.__init__ = function(reader, cmd, delim) {
|
12153 | this.reader = reader;
|
12154 | this.cmd = cmd;
|
12155 | this.delim = delim;
|
12156 | this.reg_magic = this.RE_MAGIC;
|
12157 | }
|
12158 |
|
12159 | RegexpParser.prototype.isend = function(c) {
|
12160 | return c == "<EOF>" || c == "<EOL>" || c == this.delim;
|
12161 | }
|
12162 |
|
12163 | RegexpParser.prototype.parse_regexp = function() {
|
12164 | var prevtoken = "";
|
12165 | var ntoken = "";
|
12166 | var ret = [];
|
12167 | if (this.reader.peekn(4) == "\\%#=") {
|
12168 | var epos = this.reader.getpos();
|
12169 | var token = this.reader.getn(5);
|
12170 | if (token != "\\%#=0" && token != "\\%#=1" && token != "\\%#=2") {
|
12171 | throw Err("E864: \\%#= can only be followed by 0, 1, or 2", epos);
|
12172 | }
|
12173 | viml_add(ret, token);
|
12174 | }
|
12175 | while (!this.isend(this.reader.peek())) {
|
12176 | var prevtoken = ntoken;
|
12177 | var __tmp = this.get_token();
|
12178 | var token = __tmp[0];
|
12179 | var ntoken = __tmp[1];
|
12180 | if (ntoken == "\\m") {
|
12181 | this.reg_magic = this.RE_MAGIC;
|
12182 | }
|
12183 | else if (ntoken == "\\M") {
|
12184 | this.reg_magic = this.RE_NOMAGIC;
|
12185 | }
|
12186 | else if (ntoken == "\\v") {
|
12187 | this.reg_magic = this.RE_VERY_MAGIC;
|
12188 | }
|
12189 | else if (ntoken == "\\V") {
|
12190 | this.reg_magic = this.RE_VERY_NOMAGIC;
|
12191 | }
|
12192 | else if (ntoken == "\\*") {
|
12193 |
|
12194 | if (prevtoken == "" || prevtoken == "\\^" || prevtoken == "\\&" || prevtoken == "\\|" || prevtoken == "\\(") {
|
12195 | var ntoken = "*";
|
12196 | }
|
12197 | }
|
12198 | else if (ntoken == "\\^") {
|
12199 |
|
12200 | if (this.reg_magic != this.RE_VERY_MAGIC && prevtoken != "" && prevtoken != "\\&" && prevtoken != "\\|" && prevtoken != "\\n" && prevtoken != "\\(" && prevtoken != "\\%(") {
|
12201 | var ntoken = "^";
|
12202 | }
|
12203 | }
|
12204 | else if (ntoken == "\\$") {
|
12205 |
|
12206 | var pos = this.reader.tell();
|
12207 | if (this.reg_magic != this.RE_VERY_MAGIC) {
|
12208 | while (!this.isend(this.reader.peek())) {
|
12209 | var __tmp = this.get_token();
|
12210 | var t = __tmp[0];
|
12211 | var n = __tmp[1];
|
12212 |
|
12213 | if (n == "\\c" || n == "\\C" || n == "\\m" || n == "\\M" || n == "\\Z") {
|
12214 | continue;
|
12215 | }
|
12216 | if (n != "\\|" && n != "\\&" && n != "\\n" && n != "\\)") {
|
12217 | var ntoken = "$";
|
12218 | }
|
12219 | break;
|
12220 | }
|
12221 | }
|
12222 | this.reader.seek_set(pos);
|
12223 | }
|
12224 | else if (ntoken == "\\?") {
|
12225 |
|
12226 | if (this.cmd == "?") {
|
12227 | var ntoken = "?";
|
12228 | }
|
12229 | }
|
12230 | viml_add(ret, ntoken);
|
12231 | }
|
12232 | return ret;
|
12233 | }
|
12234 |
|
12235 |
|
12236 | RegexpParser.prototype.get_token = function() {
|
12237 | if (this.reg_magic == this.RE_VERY_MAGIC) {
|
12238 | return this.get_token_very_magic();
|
12239 | }
|
12240 | else if (this.reg_magic == this.RE_MAGIC) {
|
12241 | return this.get_token_magic();
|
12242 | }
|
12243 | else if (this.reg_magic == this.RE_NOMAGIC) {
|
12244 | return this.get_token_nomagic();
|
12245 | }
|
12246 | else if (this.reg_magic == this.RE_VERY_NOMAGIC) {
|
12247 | return this.get_token_very_nomagic();
|
12248 | }
|
12249 | }
|
12250 |
|
12251 | RegexpParser.prototype.get_token_very_magic = function() {
|
12252 | if (this.isend(this.reader.peek())) {
|
12253 | return ["<END>", "<END>"];
|
12254 | }
|
12255 | var c = this.reader.get();
|
12256 | if (c == "\\") {
|
12257 | return this.get_token_backslash_common();
|
12258 | }
|
12259 | else if (c == "*") {
|
12260 | return ["*", "\\*"];
|
12261 | }
|
12262 | else if (c == "+") {
|
12263 | return ["+", "\\+"];
|
12264 | }
|
12265 | else if (c == "=") {
|
12266 | return ["=", "\\="];
|
12267 | }
|
12268 | else if (c == "?") {
|
12269 | return ["?", "\\?"];
|
12270 | }
|
12271 | else if (c == "{") {
|
12272 | return this.get_token_brace("{");
|
12273 | }
|
12274 | else if (c == "@") {
|
12275 | return this.get_token_at("@");
|
12276 | }
|
12277 | else if (c == "^") {
|
12278 | return ["^", "\\^"];
|
12279 | }
|
12280 | else if (c == "$") {
|
12281 | return ["$", "\\$"];
|
12282 | }
|
12283 | else if (c == ".") {
|
12284 | return [".", "\\."];
|
12285 | }
|
12286 | else if (c == "<") {
|
12287 | return ["<", "\\<"];
|
12288 | }
|
12289 | else if (c == ">") {
|
12290 | return [">", "\\>"];
|
12291 | }
|
12292 | else if (c == "%") {
|
12293 | return this.get_token_percent("%");
|
12294 | }
|
12295 | else if (c == "[") {
|
12296 | return this.get_token_sq("[");
|
12297 | }
|
12298 | else if (c == "~") {
|
12299 | return ["~", "\\~"];
|
12300 | }
|
12301 | else if (c == "|") {
|
12302 | return ["|", "\\|"];
|
12303 | }
|
12304 | else if (c == "&") {
|
12305 | return ["&", "\\&"];
|
12306 | }
|
12307 | else if (c == "(") {
|
12308 | return ["(", "\\("];
|
12309 | }
|
12310 | else if (c == ")") {
|
12311 | return [")", "\\)"];
|
12312 | }
|
12313 | return [c, c];
|
12314 | }
|
12315 |
|
12316 | RegexpParser.prototype.get_token_magic = function() {
|
12317 | if (this.isend(this.reader.peek())) {
|
12318 | return ["<END>", "<END>"];
|
12319 | }
|
12320 | var c = this.reader.get();
|
12321 | if (c == "\\") {
|
12322 | var pos = this.reader.tell();
|
12323 | var c = this.reader.get();
|
12324 | if (c == "+") {
|
12325 | return ["\\+", "\\+"];
|
12326 | }
|
12327 | else if (c == "=") {
|
12328 | return ["\\=", "\\="];
|
12329 | }
|
12330 | else if (c == "?") {
|
12331 | return ["\\?", "\\?"];
|
12332 | }
|
12333 | else if (c == "{") {
|
12334 | return this.get_token_brace("\\{");
|
12335 | }
|
12336 | else if (c == "@") {
|
12337 | return this.get_token_at("\\@");
|
12338 | }
|
12339 | else if (c == "<") {
|
12340 | return ["\\<", "\\<"];
|
12341 | }
|
12342 | else if (c == ">") {
|
12343 | return ["\\>", "\\>"];
|
12344 | }
|
12345 | else if (c == "%") {
|
12346 | return this.get_token_percent("\\%");
|
12347 | }
|
12348 | else if (c == "|") {
|
12349 | return ["\\|", "\\|"];
|
12350 | }
|
12351 | else if (c == "&") {
|
12352 | return ["\\&", "\\&"];
|
12353 | }
|
12354 | else if (c == "(") {
|
12355 | return ["\\(", "\\("];
|
12356 | }
|
12357 | else if (c == ")") {
|
12358 | return ["\\)", "\\)"];
|
12359 | }
|
12360 | this.reader.seek_set(pos);
|
12361 | return this.get_token_backslash_common();
|
12362 | }
|
12363 | else if (c == "*") {
|
12364 | return ["*", "\\*"];
|
12365 | }
|
12366 | else if (c == "^") {
|
12367 | return ["^", "\\^"];
|
12368 | }
|
12369 | else if (c == "$") {
|
12370 | return ["$", "\\$"];
|
12371 | }
|
12372 | else if (c == ".") {
|
12373 | return [".", "\\."];
|
12374 | }
|
12375 | else if (c == "[") {
|
12376 | return this.get_token_sq("[");
|
12377 | }
|
12378 | else if (c == "~") {
|
12379 | return ["~", "\\~"];
|
12380 | }
|
12381 | return [c, c];
|
12382 | }
|
12383 |
|
12384 | RegexpParser.prototype.get_token_nomagic = function() {
|
12385 | if (this.isend(this.reader.peek())) {
|
12386 | return ["<END>", "<END>"];
|
12387 | }
|
12388 | var c = this.reader.get();
|
12389 | if (c == "\\") {
|
12390 | var pos = this.reader.tell();
|
12391 | var c = this.reader.get();
|
12392 | if (c == "*") {
|
12393 | return ["\\*", "\\*"];
|
12394 | }
|
12395 | else if (c == "+") {
|
12396 | return ["\\+", "\\+"];
|
12397 | }
|
12398 | else if (c == "=") {
|
12399 | return ["\\=", "\\="];
|
12400 | }
|
12401 | else if (c == "?") {
|
12402 | return ["\\?", "\\?"];
|
12403 | }
|
12404 | else if (c == "{") {
|
12405 | return this.get_token_brace("\\{");
|
12406 | }
|
12407 | else if (c == "@") {
|
12408 | return this.get_token_at("\\@");
|
12409 | }
|
12410 | else if (c == ".") {
|
12411 | return ["\\.", "\\."];
|
12412 | }
|
12413 | else if (c == "<") {
|
12414 | return ["\\<", "\\<"];
|
12415 | }
|
12416 | else if (c == ">") {
|
12417 | return ["\\>", "\\>"];
|
12418 | }
|
12419 | else if (c == "%") {
|
12420 | return this.get_token_percent("\\%");
|
12421 | }
|
12422 | else if (c == "~") {
|
12423 | return ["\\~", "\\^"];
|
12424 | }
|
12425 | else if (c == "[") {
|
12426 | return this.get_token_sq("\\[");
|
12427 | }
|
12428 | else if (c == "|") {
|
12429 | return ["\\|", "\\|"];
|
12430 | }
|
12431 | else if (c == "&") {
|
12432 | return ["\\&", "\\&"];
|
12433 | }
|
12434 | else if (c == "(") {
|
12435 | return ["\\(", "\\("];
|
12436 | }
|
12437 | else if (c == ")") {
|
12438 | return ["\\)", "\\)"];
|
12439 | }
|
12440 | this.reader.seek_set(pos);
|
12441 | return this.get_token_backslash_common();
|
12442 | }
|
12443 | else if (c == "^") {
|
12444 | return ["^", "\\^"];
|
12445 | }
|
12446 | else if (c == "$") {
|
12447 | return ["$", "\\$"];
|
12448 | }
|
12449 | return [c, c];
|
12450 | }
|
12451 |
|
12452 | RegexpParser.prototype.get_token_very_nomagic = function() {
|
12453 | if (this.isend(this.reader.peek())) {
|
12454 | return ["<END>", "<END>"];
|
12455 | }
|
12456 | var c = this.reader.get();
|
12457 | if (c == "\\") {
|
12458 | var pos = this.reader.tell();
|
12459 | var c = this.reader.get();
|
12460 | if (c == "*") {
|
12461 | return ["\\*", "\\*"];
|
12462 | }
|
12463 | else if (c == "+") {
|
12464 | return ["\\+", "\\+"];
|
12465 | }
|
12466 | else if (c == "=") {
|
12467 | return ["\\=", "\\="];
|
12468 | }
|
12469 | else if (c == "?") {
|
12470 | return ["\\?", "\\?"];
|
12471 | }
|
12472 | else if (c == "{") {
|
12473 | return this.get_token_brace("\\{");
|
12474 | }
|
12475 | else if (c == "@") {
|
12476 | return this.get_token_at("\\@");
|
12477 | }
|
12478 | else if (c == "^") {
|
12479 | return ["\\^", "\\^"];
|
12480 | }
|
12481 | else if (c == "$") {
|
12482 | return ["\\$", "\\$"];
|
12483 | }
|
12484 | else if (c == "<") {
|
12485 | return ["\\<", "\\<"];
|
12486 | }
|
12487 | else if (c == ">") {
|
12488 | return ["\\>", "\\>"];
|
12489 | }
|
12490 | else if (c == "%") {
|
12491 | return this.get_token_percent("\\%");
|
12492 | }
|
12493 | else if (c == "~") {
|
12494 | return ["\\~", "\\~"];
|
12495 | }
|
12496 | else if (c == "[") {
|
12497 | return this.get_token_sq("\\[");
|
12498 | }
|
12499 | else if (c == "|") {
|
12500 | return ["\\|", "\\|"];
|
12501 | }
|
12502 | else if (c == "&") {
|
12503 | return ["\\&", "\\&"];
|
12504 | }
|
12505 | else if (c == "(") {
|
12506 | return ["\\(", "\\("];
|
12507 | }
|
12508 | else if (c == ")") {
|
12509 | return ["\\)", "\\)"];
|
12510 | }
|
12511 | this.reader.seek_set(pos);
|
12512 | return this.get_token_backslash_common();
|
12513 | }
|
12514 | return [c, c];
|
12515 | }
|
12516 |
|
12517 | RegexpParser.prototype.get_token_backslash_common = function() {
|
12518 | var cclass = "iIkKfFpPsSdDxXoOwWhHaAlLuU";
|
12519 | var c = this.reader.get();
|
12520 | if (c == "\\") {
|
12521 | return ["\\\\", "\\\\"];
|
12522 | }
|
12523 | else if (viml_stridx(cclass, c) != -1) {
|
12524 | return ["\\" + c, "\\" + c];
|
12525 | }
|
12526 | else if (c == "_") {
|
12527 | var epos = this.reader.getpos();
|
12528 | var c = this.reader.get();
|
12529 | if (viml_stridx(cclass, c) != -1) {
|
12530 | return ["\\_" + c, "\\_ . c"];
|
12531 | }
|
12532 | else if (c == "^") {
|
12533 | return ["\\_^", "\\_^"];
|
12534 | }
|
12535 | else if (c == "$") {
|
12536 | return ["\\_$", "\\_$"];
|
12537 | }
|
12538 | else if (c == ".") {
|
12539 | return ["\\_.", "\\_."];
|
12540 | }
|
12541 | else if (c == "[") {
|
12542 | return this.get_token_sq("\\_[");
|
12543 | }
|
12544 | throw Err("E63: invalid use of \\_", epos);
|
12545 | }
|
12546 | else if (viml_stridx("etrb", c) != -1) {
|
12547 | return ["\\" + c, "\\" + c];
|
12548 | }
|
12549 | else if (viml_stridx("123456789", c) != -1) {
|
12550 | return ["\\" + c, "\\" + c];
|
12551 | }
|
12552 | else if (c == "z") {
|
12553 | var epos = this.reader.getpos();
|
12554 | var c = this.reader.get();
|
12555 | if (viml_stridx("123456789", c) != -1) {
|
12556 | return ["\\z" + c, "\\z" + c];
|
12557 | }
|
12558 | else if (c == "s") {
|
12559 | return ["\\zs", "\\zs"];
|
12560 | }
|
12561 | else if (c == "e") {
|
12562 | return ["\\ze", "\\ze"];
|
12563 | }
|
12564 | else if (c == "(") {
|
12565 | return ["\\z(", "\\z("];
|
12566 | }
|
12567 | throw Err("E68: Invalid character after \\z", epos);
|
12568 | }
|
12569 | else if (viml_stridx("cCmMvVZ", c) != -1) {
|
12570 | return ["\\" + c, "\\" + c];
|
12571 | }
|
12572 | else if (c == "%") {
|
12573 | var epos = this.reader.getpos();
|
12574 | var c = this.reader.get();
|
12575 | if (c == "d") {
|
12576 | var r = this.getdecchrs();
|
12577 | if (r != "") {
|
12578 | return ["\\%d" + r, "\\%d" + r];
|
12579 | }
|
12580 | }
|
12581 | else if (c == "o") {
|
12582 | var r = this.getoctchrs();
|
12583 | if (r != "") {
|
12584 | return ["\\%o" + r, "\\%o" + r];
|
12585 | }
|
12586 | }
|
12587 | else if (c == "x") {
|
12588 | var r = this.gethexchrs(2);
|
12589 | if (r != "") {
|
12590 | return ["\\%x" + r, "\\%x" + r];
|
12591 | }
|
12592 | }
|
12593 | else if (c == "u") {
|
12594 | var r = this.gethexchrs(4);
|
12595 | if (r != "") {
|
12596 | return ["\\%u" + r, "\\%u" + r];
|
12597 | }
|
12598 | }
|
12599 | else if (c == "U") {
|
12600 | var r = this.gethexchrs(8);
|
12601 | if (r != "") {
|
12602 | return ["\\%U" + r, "\\%U" + r];
|
12603 | }
|
12604 | }
|
12605 | throw Err("E678: Invalid character after \\%[dxouU]", epos);
|
12606 | }
|
12607 | return ["\\" + c, c];
|
12608 | }
|
12609 |
|
12610 |
|
12611 | RegexpParser.prototype.get_token_brace = function(pre) {
|
12612 | var r = "";
|
12613 | var minus = "";
|
12614 | var comma = "";
|
12615 | var n = "";
|
12616 | var m = "";
|
12617 | if (this.reader.p(0) == "-") {
|
12618 | var minus = this.reader.get();
|
12619 | r += minus;
|
12620 | }
|
12621 | if (isdigit(this.reader.p(0))) {
|
12622 | var n = this.reader.read_digit();
|
12623 | r += n;
|
12624 | }
|
12625 | if (this.reader.p(0) == ",") {
|
12626 | var comma = this.rader.get();
|
12627 | r += comma;
|
12628 | }
|
12629 | if (isdigit(this.reader.p(0))) {
|
12630 | var m = this.reader.read_digit();
|
12631 | r += m;
|
12632 | }
|
12633 | if (this.reader.p(0) == "\\") {
|
12634 | r += this.reader.get();
|
12635 | }
|
12636 | if (this.reader.p(0) != "}") {
|
12637 | throw Err("E554: Syntax error in \\{...}", this.reader.getpos());
|
12638 | }
|
12639 | this.reader.get();
|
12640 | return [pre + r, "\\{" + minus + n + comma + m + "}"];
|
12641 | }
|
12642 |
|
12643 |
|
12644 | RegexpParser.prototype.get_token_sq = function(pre) {
|
12645 | var start = this.reader.tell();
|
12646 | var r = "";
|
12647 |
|
12648 | if (this.reader.p(0) == "^") {
|
12649 | r += this.reader.get();
|
12650 | }
|
12651 |
|
12652 | if (this.reader.p(0) == "]" || this.reader.p(0) == "-") {
|
12653 | r += this.reader.get();
|
12654 | }
|
12655 | while (TRUE) {
|
12656 | var startc = 0;
|
12657 | var c = this.reader.p(0);
|
12658 | if (this.isend(c)) {
|
12659 |
|
12660 | this.reader.seek_set(start);
|
12661 | return [pre, "["];
|
12662 | }
|
12663 | else if (c == "]") {
|
12664 | this.reader.seek_cur(1);
|
12665 | return [pre + r + "]", "\\[" + r + "]"];
|
12666 | }
|
12667 | else if (c == "[") {
|
12668 | var e = this.get_token_sq_char_class();
|
12669 | if (e == "") {
|
12670 | var e = this.get_token_sq_equi_class();
|
12671 | if (e == "") {
|
12672 | var e = this.get_token_sq_coll_element();
|
12673 | if (e == "") {
|
12674 | var __tmp = this.get_token_sq_c();
|
12675 | var e = __tmp[0];
|
12676 | var startc = __tmp[1];
|
12677 | }
|
12678 | }
|
12679 | }
|
12680 | r += e;
|
12681 | }
|
12682 | else {
|
12683 | var __tmp = this.get_token_sq_c();
|
12684 | var e = __tmp[0];
|
12685 | var startc = __tmp[1];
|
12686 | r += e;
|
12687 | }
|
12688 | if (startc != 0 && this.reader.p(0) == "-" && !this.isend(this.reader.p(1)) && !(this.reader.p(1) == "\\" && this.reader.p(2) == "n")) {
|
12689 | this.reader.seek_cur(1);
|
12690 | r += "-";
|
12691 | var c = this.reader.p(0);
|
12692 | if (c == "[") {
|
12693 | var e = this.get_token_sq_coll_element();
|
12694 | if (e != "") {
|
12695 | var endc = viml_char2nr(e[2]);
|
12696 | }
|
12697 | else {
|
12698 | var __tmp = this.get_token_sq_c();
|
12699 | var e = __tmp[0];
|
12700 | var endc = __tmp[1];
|
12701 | }
|
12702 | r += e;
|
12703 | }
|
12704 | else {
|
12705 | var __tmp = this.get_token_sq_c();
|
12706 | var e = __tmp[0];
|
12707 | var endc = __tmp[1];
|
12708 | r += e;
|
12709 | }
|
12710 | if (startc > endc || endc > startc + 256) {
|
12711 | throw Err("E16: Invalid range", this.reader.getpos());
|
12712 | }
|
12713 | }
|
12714 | }
|
12715 | }
|
12716 |
|
12717 |
|
12718 | RegexpParser.prototype.get_token_sq_c = function() {
|
12719 | var c = this.reader.p(0);
|
12720 | if (c == "\\") {
|
12721 | this.reader.seek_cur(1);
|
12722 | var c = this.reader.p(0);
|
12723 | if (c == "n") {
|
12724 | this.reader.seek_cur(1);
|
12725 | return ["\\n", 0];
|
12726 | }
|
12727 | else if (c == "r") {
|
12728 | this.reader.seek_cur(1);
|
12729 | return ["\\r", 13];
|
12730 | }
|
12731 | else if (c == "t") {
|
12732 | this.reader.seek_cur(1);
|
12733 | return ["\\t", 9];
|
12734 | }
|
12735 | else if (c == "e") {
|
12736 | this.reader.seek_cur(1);
|
12737 | return ["\\e", 27];
|
12738 | }
|
12739 | else if (c == "b") {
|
12740 | this.reader.seek_cur(1);
|
12741 | return ["\\b", 8];
|
12742 | }
|
12743 | else if (viml_stridx("]^-\\", c) != -1) {
|
12744 | this.reader.seek_cur(1);
|
12745 | return ["\\" + c, viml_char2nr(c)];
|
12746 | }
|
12747 | else if (viml_stridx("doxuU", c) != -1) {
|
12748 | var __tmp = this.get_token_sq_coll_char();
|
12749 | var c = __tmp[0];
|
12750 | var n = __tmp[1];
|
12751 | return [c, n];
|
12752 | }
|
12753 | else {
|
12754 | return ["\\", viml_char2nr("\\")];
|
12755 | }
|
12756 | }
|
12757 | else if (c == "-") {
|
12758 | this.reader.seek_cur(1);
|
12759 | return ["-", viml_char2nr("-")];
|
12760 | }
|
12761 | else {
|
12762 | this.reader.seek_cur(1);
|
12763 | return [c, viml_char2nr(c)];
|
12764 | }
|
12765 | }
|
12766 |
|
12767 |
|
12768 | RegexpParser.prototype.get_token_sq_coll_char = function() {
|
12769 | var pos = this.reader.tell();
|
12770 | var c = this.reader.get();
|
12771 | if (c == "d") {
|
12772 | var r = this.getdecchrs();
|
12773 | var n = viml_str2nr(r, 10);
|
12774 | }
|
12775 | else if (c == "o") {
|
12776 | var r = this.getoctchrs();
|
12777 | var n = viml_str2nr(r, 8);
|
12778 | }
|
12779 | else if (c == "x") {
|
12780 | var r = this.gethexchrs(2);
|
12781 | var n = viml_str2nr(r, 16);
|
12782 | }
|
12783 | else if (c == "u") {
|
12784 | var r = this.gethexchrs(4);
|
12785 | var n = viml_str2nr(r, 16);
|
12786 | }
|
12787 | else if (c == "U") {
|
12788 | var r = this.gethexchrs(8);
|
12789 | var n = viml_str2nr(r, 16);
|
12790 | }
|
12791 | else {
|
12792 | var r = "";
|
12793 | }
|
12794 | if (r == "") {
|
12795 | this.reader.seek_set(pos);
|
12796 | return "\\";
|
12797 | }
|
12798 | return ["\\" + c + r, n];
|
12799 | }
|
12800 |
|
12801 |
|
12802 | RegexpParser.prototype.get_token_sq_coll_element = function() {
|
12803 | if (this.reader.p(0) == "[" && this.reader.p(1) == "." && !this.isend(this.reader.p(2)) && this.reader.p(3) == "." && this.reader.p(4) == "]") {
|
12804 | return this.reader.getn(5);
|
12805 | }
|
12806 | return "";
|
12807 | }
|
12808 |
|
12809 |
|
12810 | RegexpParser.prototype.get_token_sq_equi_class = function() {
|
12811 | if (this.reader.p(0) == "[" && this.reader.p(1) == "=" && !this.isend(this.reader.p(2)) && this.reader.p(3) == "=" && this.reader.p(4) == "]") {
|
12812 | return this.reader.getn(5);
|
12813 | }
|
12814 | return "";
|
12815 | }
|
12816 |
|
12817 |
|
12818 | RegexpParser.prototype.get_token_sq_char_class = function() {
|
12819 | var class_names = ["alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "xdigit", "tab", "return", "backspace", "escape"];
|
12820 | var pos = this.reader.tell();
|
12821 | if (this.reader.p(0) == "[" && this.reader.p(1) == ":") {
|
12822 | this.reader.seek_cur(2);
|
12823 | var r = this.reader.read_alpha();
|
12824 | if (this.reader.p(0) == ":" && this.reader.p(1) == "]") {
|
12825 | this.reader.seek_cur(2);
|
12826 | var __c15 = class_names;
|
12827 | for (var __i15 = 0; __i15 < __c15.length; ++__i15) {
|
12828 | var name = __c15[__i15];
|
12829 | if (r == name) {
|
12830 | return "[:" + name + ":]";
|
12831 | }
|
12832 | }
|
12833 | }
|
12834 | }
|
12835 | this.reader.seek_set(pos);
|
12836 | return "";
|
12837 | }
|
12838 |
|
12839 |
|
12840 | RegexpParser.prototype.get_token_at = function(pre) {
|
12841 | var epos = this.reader.getpos();
|
12842 | var c = this.reader.get();
|
12843 | if (c == ">") {
|
12844 | return [pre + ">", "\\@>"];
|
12845 | }
|
12846 | else if (c == "=") {
|
12847 | return [pre + "=", "\\@="];
|
12848 | }
|
12849 | else if (c == "!") {
|
12850 | return [pre + "!", "\\@!"];
|
12851 | }
|
12852 | else if (c == "<") {
|
12853 | var c = this.reader.get();
|
12854 | if (c == "=") {
|
12855 | return [pre + "<=", "\\@<="];
|
12856 | }
|
12857 | else if (c == "!") {
|
12858 | return [pre + "<!", "\\@<!"];
|
12859 | }
|
12860 | }
|
12861 | throw Err("E64: @ follows nothing", epos);
|
12862 | }
|
12863 |
|
12864 |
|
12865 | RegexpParser.prototype.get_token_percent = function(pre) {
|
12866 | var c = this.reader.get();
|
12867 | if (c == "^") {
|
12868 | return [pre + "^", "\\%^"];
|
12869 | }
|
12870 | else if (c == "$") {
|
12871 | return [pre + "$", "\\%$"];
|
12872 | }
|
12873 | else if (c == "V") {
|
12874 | return [pre + "V", "\\%V"];
|
12875 | }
|
12876 | else if (c == "#") {
|
12877 | return [pre + "#", "\\%#"];
|
12878 | }
|
12879 | else if (c == "[") {
|
12880 | return this.get_token_percent_sq(pre + "[");
|
12881 | }
|
12882 | else if (c == "(") {
|
12883 | return [pre + "(", "\\%("];
|
12884 | }
|
12885 | else {
|
12886 | return this.get_token_mlcv(pre);
|
12887 | }
|
12888 | }
|
12889 |
|
12890 |
|
12891 | RegexpParser.prototype.get_token_percent_sq = function(pre) {
|
12892 | var r = "";
|
12893 | while (TRUE) {
|
12894 | var c = this.reader.peek();
|
12895 | if (this.isend(c)) {
|
12896 | throw Err("E69: Missing ] after \\%[", this.reader.getpos());
|
12897 | }
|
12898 | else if (c == "]") {
|
12899 | if (r == "") {
|
12900 | throw Err("E70: Empty \\%[", this.reader.getpos());
|
12901 | }
|
12902 | this.reader.seek_cur(1);
|
12903 | break;
|
12904 | }
|
12905 | this.reader.seek_cur(1);
|
12906 | r += c;
|
12907 | }
|
12908 | return [pre + r + "]", "\\%[" + r + "]"];
|
12909 | }
|
12910 |
|
12911 |
|
12912 | RegexpParser.prototype.get_token_mlvc = function(pre) {
|
12913 | var r = "";
|
12914 | var cmp = "";
|
12915 | if (this.reader.p(0) == "<" || this.reader.p(0) == ">") {
|
12916 | var cmp = this.reader.get();
|
12917 | r += cmp;
|
12918 | }
|
12919 | if (this.reader.p(0) == "'") {
|
12920 | r += this.reader.get();
|
12921 | var c = this.reader.p(0);
|
12922 | if (this.isend(c)) {
|
12923 |
|
12924 | var c = "";
|
12925 | }
|
12926 | else {
|
12927 | var c = this.reader.get();
|
12928 | }
|
12929 | return [pre + r + c, "\\%" + cmp + "'" + c];
|
12930 | }
|
12931 | else if (isdigit(this.reader.p(0))) {
|
12932 | var d = this.reader.read_digit();
|
12933 | r += d;
|
12934 | var c = this.reader.p(0);
|
12935 | if (c == "l") {
|
12936 | this.reader.get();
|
12937 | return [pre + r + "l", "\\%" + cmp + d + "l"];
|
12938 | }
|
12939 | else if (c == "c") {
|
12940 | this.reader.get();
|
12941 | return [pre + r + "c", "\\%" + cmp + d + "c"];
|
12942 | }
|
12943 | else if (c == "v") {
|
12944 | this.reader.get();
|
12945 | return [pre + r + "v", "\\%" + cmp + d + "v"];
|
12946 | }
|
12947 | }
|
12948 | throw Err("E71: Invalid character after %", this.reader.getpos());
|
12949 | }
|
12950 |
|
12951 | RegexpParser.prototype.getdecchrs = function() {
|
12952 | return this.reader.read_digit();
|
12953 | }
|
12954 |
|
12955 | RegexpParser.prototype.getoctchrs = function() {
|
12956 | return this.reader.read_odigit();
|
12957 | }
|
12958 |
|
12959 | RegexpParser.prototype.gethexchrs = function(n) {
|
12960 | var r = "";
|
12961 | var __c16 = viml_range(n);
|
12962 | for (var __i16 = 0; __i16 < __c16.length; ++__i16) {
|
12963 | var i = __c16[__i16];
|
12964 | var c = this.reader.peek();
|
12965 | if (!isxdigit(c)) {
|
12966 | break;
|
12967 | }
|
12968 | r += this.reader.get();
|
12969 | }
|
12970 | return r;
|
12971 | }
|
12972 |
|
12973 | if (__webpack_require__.c[__webpack_require__.s] === module) {
|
12974 | main();
|
12975 | }
|
12976 | else {
|
12977 | module.exports = {
|
12978 | VimLParser: VimLParser,
|
12979 | StringReader: StringReader,
|
12980 | Compiler: Compiler
|
12981 | };
|
12982 | }
|
12983 |
|
12984 | }.call(this, __webpack_require__(47)(module)))
|
12985 |
|
12986 | }),
|
12987 |
|
12988 | (function(module, exports) {
|
12989 |
|
12990 | module.exports = function(module) {
|
12991 | if (!module.webpackPolyfill) {
|
12992 | module.deprecate = function() {};
|
12993 | module.paths = [];
|
12994 |
|
12995 | if (!module.children) module.children = [];
|
12996 | Object.defineProperty(module, "loaded", {
|
12997 | enumerable: true,
|
12998 | get: function() {
|
12999 | return module.l;
|
13000 | }
|
13001 | });
|
13002 | Object.defineProperty(module, "id", {
|
13003 | enumerable: true,
|
13004 | get: function() {
|
13005 | return module.i;
|
13006 | }
|
13007 | });
|
13008 | module.webpackPolyfill = 1;
|
13009 | }
|
13010 | return module;
|
13011 | };
|
13012 |
|
13013 |
|
13014 | }),
|
13015 |
|
13016 | (function(module, exports, __webpack_require__) {
|
13017 |
|
13018 | "use strict";
|
13019 |
|
13020 | Object.defineProperty(exports, "__esModule", { value: true });
|
13021 | exports.errorLinePattern = /[^:]+:\s*(.+?):\s*line\s*([0-9]+)\s*col\s*([0-9]+)/;
|
13022 | exports.commentPattern = /^[ \t]*("|')/;
|
13023 | exports.keywordPattern = /[\w#&$<>.:]/;
|
13024 | exports.builtinFunctionPattern = /^((<SID>|\b(v|g|b|s|l|a):)?[\w#&]+)[ \t]*\([^)]*\)/;
|
13025 | exports.wordPrePattern = /^.*?(((<SID>|\b(v|g|b|s|l|a):)?[\w#&$.]+)|(<SID>|<SID|<SI|<S|<|\b(v|g|b|s|l|a):))$/;
|
13026 | exports.wordNextPattern = /^((SID>|ID>|D>|>|<SID>|\b(v|g|b|s|l|a):)?[\w#&$.]+|(:[\w#&$.]+)).*?(\r\n|\r|\n)?$/;
|
13027 | exports.colorschemePattern = /\bcolorscheme[ \t]+\w*$/;
|
13028 | exports.mapCommandPattern = /^([ \t]*(\[ \t]*)?)\w*map[ \t]+/;
|
13029 | exports.highlightLinkPattern = /^[ \t]*(hi|highlight)[ \t]+link([ \t]+[^ \t]+)*[ \t]*$/;
|
13030 | exports.highlightPattern = /^[ \t]*(hi|highlight)([ \t]+[^ \t]+)*[ \t]*$/;
|
13031 | exports.highlightValuePattern = /^[ \t]*(hi|highlight)([ \t]+[^ \t]+)*[ \t]+([^ \t=]+)=[^ \t=]*$/;
|
13032 | exports.autocmdPattern = /^[ \t]*(au|autocmd)!?[ \t]+([^ \t,]+,)*[^ \t,]*$/;
|
13033 | exports.builtinVariablePattern = [
|
13034 | /\bv:\w*$/,
|
13035 | ];
|
13036 | exports.optionPattern = [
|
13037 | /(^|[ \t]+)&\w*$/,
|
13038 | /(^|[ \t]+)set(l|local|g|global)?[ \t]+\w+$/,
|
13039 | ];
|
13040 | exports.notFunctionPattern = [
|
13041 | /^[ \t]*\\$/,
|
13042 | /^[ \t]*\w+$/,
|
13043 | /^[ \t]*"/,
|
13044 | /(let|set|colorscheme)[ \t][^ \t]*$/,
|
13045 | /[^([,\\ \t\w#>]\w*$/,
|
13046 | /^[ \t]*(hi|highlight)([ \t]+link)?([ \t]+[^ \t]+)*[ \t]*$/,
|
13047 | exports.autocmdPattern,
|
13048 | ];
|
13049 | exports.commandPattern = [
|
13050 | /(^|[ \t]):\w+$/,
|
13051 | /^[ \t]*\w+$/,
|
13052 | /:?silent!?[ \t]\w+/,
|
13053 | ];
|
13054 | exports.featurePattern = [
|
13055 | /\bhas\([ \t]*["']\w*/,
|
13056 | ];
|
13057 | exports.expandPattern = [
|
13058 | /\bexpand\(['"]<\w*$/,
|
13059 | /\bexpand\([ \t]*['"]\w*$/,
|
13060 | ];
|
13061 | exports.notIdentifierPattern = [
|
13062 | exports.commentPattern,
|
13063 | /("|'):\w*$/,
|
13064 | /^[ \t]*\\$/,
|
13065 | /^[ \t]*call[ \t]+[^ \t()]*$/,
|
13066 | /('|"|#|&|\$|<)\w*$/,
|
13067 | ];
|
13068 |
|
13069 |
|
13070 | /***/ }),
|
13071 | /* 49 */,
|
13072 | /* 50 */,
|
13073 | /* 51 */,
|
13074 | /* 52 */,
|
13075 | /* 53 */
|
13076 | /***/ (function(module, exports, __webpack_require__) {
|
13077 |
|
13078 | "use strict";
|
13079 |
|
13080 | const taskManager = __webpack_require__(54);
|
13081 | const async_1 = __webpack_require__(84);
|
13082 | const stream_1 = __webpack_require__(117);
|
13083 | const sync_1 = __webpack_require__(118);
|
13084 | const settings_1 = __webpack_require__(120);
|
13085 | const utils = __webpack_require__(55);
|
13086 | function FastGlob(source, options) {
|
13087 | try {
|
13088 | assertPatternsInput(source);
|
13089 | }
|
13090 | catch (error) {
|
13091 | return Promise.reject(error);
|
13092 | }
|
13093 | const works = getWorks(source, async_1.default, options);
|
13094 | return Promise.all(works).then(utils.array.flatten);
|
13095 | }
|
13096 | (function (FastGlob) {
|
13097 | function sync(source, options) {
|
13098 | assertPatternsInput(source);
|
13099 | const works = getWorks(source, sync_1.default, options);
|
13100 | return utils.array.flatten(works);
|
13101 | }
|
13102 | FastGlob.sync = sync;
|
13103 | function stream(source, options) {
|
13104 | assertPatternsInput(source);
|
13105 | const works = getWorks(source, stream_1.default, options);
|
13106 | |
13107 |
|
13108 |
|
13109 |
|
13110 |
|
13111 | return utils.stream.merge(works);
|
13112 | }
|
13113 | FastGlob.stream = stream;
|
13114 | function generateTasks(source, options) {
|
13115 | assertPatternsInput(source);
|
13116 | const patterns = [].concat(source);
|
13117 | const settings = new settings_1.default(options);
|
13118 | return taskManager.generate(patterns, settings);
|
13119 | }
|
13120 | FastGlob.generateTasks = generateTasks;
|
13121 | })(FastGlob || (FastGlob = {}));
|
13122 | function getWorks(source, _Provider, options) {
|
13123 | const patterns = [].concat(source);
|
13124 | const settings = new settings_1.default(options);
|
13125 | const tasks = taskManager.generate(patterns, settings);
|
13126 | const provider = new _Provider(settings);
|
13127 | return tasks.map(provider.read, provider);
|
13128 | }
|
13129 | function assertPatternsInput(source) {
|
13130 | if ([].concat(source).every(isString)) {
|
13131 | return;
|
13132 | }
|
13133 | throw new TypeError('Patterns must be a string or an array of strings');
|
13134 | }
|
13135 | function isString(source) {
|
13136 |
|
13137 | return typeof source === 'string';
|
13138 | }
|
13139 | module.exports = FastGlob;
|
13140 |
|
13141 |
|
13142 | }),
|
13143 |
|
13144 | (function(module, exports, __webpack_require__) {
|
13145 |
|
13146 | "use strict";
|
13147 |
|
13148 | Object.defineProperty(exports, "__esModule", { value: true });
|
13149 | const utils = __webpack_require__(55);
|
13150 | function generate(patterns, settings) {
|
13151 | const positivePatterns = getPositivePatterns(patterns);
|
13152 | const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
13153 | |
13154 |
|
13155 |
|
13156 |
|
13157 | const staticPatterns = !settings.caseSensitiveMatch ? [] : positivePatterns.filter(utils.pattern.isStaticPattern);
|
13158 | const dynamicPatterns = !settings.caseSensitiveMatch ? positivePatterns : positivePatterns.filter(utils.pattern.isDynamicPattern);
|
13159 | const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
|
13160 | const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
|
13161 | return staticTasks.concat(dynamicTasks);
|
13162 | }
|
13163 | exports.generate = generate;
|
13164 | function convertPatternsToTasks(positive, negative, dynamic) {
|
13165 | const positivePatternsGroup = groupPatternsByBaseDirectory(positive);
|
13166 |
|
13167 |
|
13168 | if ('.' in positivePatternsGroup) {
|
13169 | const task = convertPatternGroupToTask('.', positive, negative, dynamic);
|
13170 | return [task];
|
13171 | }
|
13172 | return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic);
|
13173 | }
|
13174 | exports.convertPatternsToTasks = convertPatternsToTasks;
|
13175 | function getPositivePatterns(patterns) {
|
13176 | return utils.pattern.getPositivePatterns(patterns);
|
13177 | }
|
13178 | exports.getPositivePatterns = getPositivePatterns;
|
13179 | function getNegativePatternsAsPositive(patterns, ignore) {
|
13180 | const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
|
13181 | const positive = negative.map(utils.pattern.convertToPositivePattern);
|
13182 | return positive;
|
13183 | }
|
13184 | exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
13185 | function groupPatternsByBaseDirectory(patterns) {
|
13186 | return patterns.reduce((collection, pattern) => {
|
13187 | const base = utils.pattern.getBaseDirectory(pattern);
|
13188 | if (base in collection) {
|
13189 | collection[base].push(pattern);
|
13190 | }
|
13191 | else {
|
13192 | collection[base] = [pattern];
|
13193 | }
|
13194 | return collection;
|
13195 | }, {});
|
13196 | }
|
13197 | exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
13198 | function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
13199 | return Object.keys(positive).map((base) => {
|
13200 | return convertPatternGroupToTask(base, positive[base], negative, dynamic);
|
13201 | });
|
13202 | }
|
13203 | exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
13204 | function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
13205 | return {
|
13206 | dynamic,
|
13207 | positive,
|
13208 | negative,
|
13209 | base,
|
13210 | patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
|
13211 | };
|
13212 | }
|
13213 | exports.convertPatternGroupToTask = convertPatternGroupToTask;
|
13214 |
|
13215 |
|
13216 | }),
|
13217 |
|
13218 | (function(module, exports, __webpack_require__) {
|
13219 |
|
13220 | "use strict";
|
13221 |
|
13222 | Object.defineProperty(exports, "__esModule", { value: true });
|
13223 | const array = __webpack_require__(56);
|
13224 | exports.array = array;
|
13225 | const errno = __webpack_require__(57);
|
13226 | exports.errno = errno;
|
13227 | const fs = __webpack_require__(58);
|
13228 | exports.fs = fs;
|
13229 | const path = __webpack_require__(59);
|
13230 | exports.path = path;
|
13231 | const pattern = __webpack_require__(60);
|
13232 | exports.pattern = pattern;
|
13233 | const stream = __webpack_require__(81);
|
13234 | exports.stream = stream;
|
13235 |
|
13236 |
|
13237 | }),
|
13238 |
|
13239 | (function(module, exports, __webpack_require__) {
|
13240 |
|
13241 | "use strict";
|
13242 |
|
13243 | Object.defineProperty(exports, "__esModule", { value: true });
|
13244 | function flatten(items) {
|
13245 | return items.reduce((collection, item) => [].concat(collection, item), []);
|
13246 | }
|
13247 | exports.flatten = flatten;
|
13248 |
|
13249 |
|
13250 | }),
|
13251 |
|
13252 | (function(module, exports, __webpack_require__) {
|
13253 |
|
13254 | "use strict";
|
13255 |
|
13256 | Object.defineProperty(exports, "__esModule", { value: true });
|
13257 | function isEnoentCodeError(error) {
|
13258 | return error.code === 'ENOENT';
|
13259 | }
|
13260 | exports.isEnoentCodeError = isEnoentCodeError;
|
13261 |
|
13262 |
|
13263 | }),
|
13264 |
|
13265 | (function(module, exports, __webpack_require__) {
|
13266 |
|
13267 | "use strict";
|
13268 |
|
13269 | Object.defineProperty(exports, "__esModule", { value: true });
|
13270 | class DirentFromStats {
|
13271 | constructor(name, stats) {
|
13272 | this.name = name;
|
13273 | this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
13274 | this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
13275 | this.isDirectory = stats.isDirectory.bind(stats);
|
13276 | this.isFIFO = stats.isFIFO.bind(stats);
|
13277 | this.isFile = stats.isFile.bind(stats);
|
13278 | this.isSocket = stats.isSocket.bind(stats);
|
13279 | this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
13280 | }
|
13281 | }
|
13282 | function createDirentFromStats(name, stats) {
|
13283 | return new DirentFromStats(name, stats);
|
13284 | }
|
13285 | exports.createDirentFromStats = createDirentFromStats;
|
13286 |
|
13287 |
|
13288 | }),
|
13289 |
|
13290 | (function(module, exports, __webpack_require__) {
|
13291 |
|
13292 | "use strict";
|
13293 |
|
13294 | Object.defineProperty(exports, "__esModule", { value: true });
|
13295 | const path = __webpack_require__(15);
|
13296 |
|
13297 |
|
13298 |
|
13299 | function unixify(filepath) {
|
13300 | return filepath.replace(/\\/g, '/');
|
13301 | }
|
13302 | exports.unixify = unixify;
|
13303 | function makeAbsolute(cwd, filepath) {
|
13304 | return path.resolve(cwd, filepath);
|
13305 | }
|
13306 | exports.makeAbsolute = makeAbsolute;
|
13307 |
|
13308 |
|
13309 | }),
|
13310 |
|
13311 | (function(module, exports, __webpack_require__) {
|
13312 |
|
13313 | "use strict";
|
13314 |
|
13315 | Object.defineProperty(exports, "__esModule", { value: true });
|
13316 | const path = __webpack_require__(15);
|
13317 | const globParent = __webpack_require__(61);
|
13318 | const isGlob = __webpack_require__(62);
|
13319 | const micromatch = __webpack_require__(64);
|
13320 | const GLOBSTAR = '**';
|
13321 | function isStaticPattern(pattern) {
|
13322 | return !isDynamicPattern(pattern);
|
13323 | }
|
13324 | exports.isStaticPattern = isStaticPattern;
|
13325 | function isDynamicPattern(pattern) {
|
13326 | return isGlob(pattern, { strict: false });
|
13327 | }
|
13328 | exports.isDynamicPattern = isDynamicPattern;
|
13329 | function convertToPositivePattern(pattern) {
|
13330 | return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
13331 | }
|
13332 | exports.convertToPositivePattern = convertToPositivePattern;
|
13333 | function convertToNegativePattern(pattern) {
|
13334 | return '!' + pattern;
|
13335 | }
|
13336 | exports.convertToNegativePattern = convertToNegativePattern;
|
13337 | function isNegativePattern(pattern) {
|
13338 | return pattern.startsWith('!') && pattern[1] !== '(';
|
13339 | }
|
13340 | exports.isNegativePattern = isNegativePattern;
|
13341 | function isPositivePattern(pattern) {
|
13342 | return !isNegativePattern(pattern);
|
13343 | }
|
13344 | exports.isPositivePattern = isPositivePattern;
|
13345 | function getNegativePatterns(patterns) {
|
13346 | return patterns.filter(isNegativePattern);
|
13347 | }
|
13348 | exports.getNegativePatterns = getNegativePatterns;
|
13349 | function getPositivePatterns(patterns) {
|
13350 | return patterns.filter(isPositivePattern);
|
13351 | }
|
13352 | exports.getPositivePatterns = getPositivePatterns;
|
13353 | function getBaseDirectory(pattern) {
|
13354 | return globParent(pattern);
|
13355 | }
|
13356 | exports.getBaseDirectory = getBaseDirectory;
|
13357 | function hasGlobStar(pattern) {
|
13358 | return pattern.indexOf(GLOBSTAR) !== -1;
|
13359 | }
|
13360 | exports.hasGlobStar = hasGlobStar;
|
13361 | function endsWithSlashGlobStar(pattern) {
|
13362 | return pattern.endsWith('/' + GLOBSTAR);
|
13363 | }
|
13364 | exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
13365 | function isAffectDepthOfReadingPattern(pattern) {
|
13366 | const basename = path.basename(pattern);
|
13367 | return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
13368 | }
|
13369 | exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
13370 | function getNaiveDepth(pattern) {
|
13371 | const base = getBaseDirectory(pattern);
|
13372 | const patternDepth = pattern.split('/').length;
|
13373 | const patternBaseDepth = base.split('/').length;
|
13374 | |
13375 |
|
13376 |
|
13377 |
|
13378 |
|
13379 | if (base === '.') {
|
13380 | return patternDepth - patternBaseDepth;
|
13381 | }
|
13382 | return patternDepth - patternBaseDepth - 1;
|
13383 | }
|
13384 | exports.getNaiveDepth = getNaiveDepth;
|
13385 | function getMaxNaivePatternsDepth(patterns) {
|
13386 | return patterns.reduce((max, pattern) => {
|
13387 | const depth = getNaiveDepth(pattern);
|
13388 | return depth > max ? depth : max;
|
13389 | }, 0);
|
13390 | }
|
13391 | exports.getMaxNaivePatternsDepth = getMaxNaivePatternsDepth;
|
13392 | function makeRe(pattern, options) {
|
13393 | return micromatch.makeRe(pattern, options);
|
13394 | }
|
13395 | exports.makeRe = makeRe;
|
13396 | function convertPatternsToRe(patterns, options) {
|
13397 | return patterns.map((pattern) => makeRe(pattern, options));
|
13398 | }
|
13399 | exports.convertPatternsToRe = convertPatternsToRe;
|
13400 | function matchAny(entry, patternsRe) {
|
13401 | const filepath = entry.replace(/^\.[\\\/]/, '');
|
13402 | return patternsRe.some((patternRe) => patternRe.test(filepath));
|
13403 | }
|
13404 | exports.matchAny = matchAny;
|
13405 |
|
13406 |
|
13407 | }),
|
13408 |
|
13409 | (function(module, exports, __webpack_require__) {
|
13410 |
|
13411 | "use strict";
|
13412 |
|
13413 |
|
13414 | var isGlob = __webpack_require__(62);
|
13415 | var pathPosixDirname = __webpack_require__(15).posix.dirname;
|
13416 | var isWin32 = __webpack_require__(16).platform() === 'win32';
|
13417 |
|
13418 | var slash = '/';
|
13419 | var backslash = /\\/g;
|
13420 | var enclosure = /[\{\[].*[\/]*.*[\}\]]$/;
|
13421 | var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
13422 | var escaped = /\\([\*\?\|\[\]\(\)\{\}])/g;
|
13423 |
|
13424 | module.exports = function globParent(str) {
|
13425 |
|
13426 | if (isWin32 && str.indexOf(slash) < 0) {
|
13427 | str = str.replace(backslash, slash);
|
13428 | }
|
13429 |
|
13430 |
|
13431 | if (enclosure.test(str)) {
|
13432 | str += slash;
|
13433 | }
|
13434 |
|
13435 |
|
13436 | str += 'a';
|
13437 |
|
13438 |
|
13439 | do {
|
13440 | str = pathPosixDirname(str);
|
13441 | } while (isGlob(str) || globby.test(str));
|
13442 |
|
13443 |
|
13444 | return str.replace(escaped, '$1');
|
13445 | };
|
13446 |
|
13447 |
|
13448 | }),
|
13449 |
|
13450 | (function(module, exports, __webpack_require__) {
|
13451 |
|
13452 |
|
13453 |
|
13454 |
|
13455 |
|
13456 |
|
13457 |
|
13458 |
|
13459 | var isExtglob = __webpack_require__(63);
|
13460 | var chars = { '{': '}', '(': ')', '[': ']'};
|
13461 | var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
13462 | var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
|
13463 |
|
13464 | module.exports = function isGlob(str, options) {
|
13465 | if (typeof str !== 'string' || str === '') {
|
13466 | return false;
|
13467 | }
|
13468 |
|
13469 | if (isExtglob(str)) {
|
13470 | return true;
|
13471 | }
|
13472 |
|
13473 | var regex = strictRegex;
|
13474 | var match;
|
13475 |
|
13476 |
|
13477 | if (options && options.strict === false) {
|
13478 | regex = relaxedRegex;
|
13479 | }
|
13480 |
|
13481 | while ((match = regex.exec(str))) {
|
13482 | if (match[2]) return true;
|
13483 | var idx = match.index + match[0].length;
|
13484 |
|
13485 |
|
13486 |
|
13487 | var open = match[1];
|
13488 | var close = open ? chars[open] : null;
|
13489 | if (open && close) {
|
13490 | var n = str.indexOf(close, idx);
|
13491 | if (n !== -1) {
|
13492 | idx = n + 1;
|
13493 | }
|
13494 | }
|
13495 |
|
13496 | str = str.slice(idx);
|
13497 | }
|
13498 | return false;
|
13499 | };
|
13500 |
|
13501 |
|
13502 | }),
|
13503 |
|
13504 | (function(module, exports) {
|
13505 |
|
13506 |
|
13507 |
|
13508 |
|
13509 |
|
13510 |
|
13511 |
|
13512 |
|
13513 | module.exports = function isExtglob(str) {
|
13514 | if (typeof str !== 'string' || str === '') {
|
13515 | return false;
|
13516 | }
|
13517 |
|
13518 | var match;
|
13519 | while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
|
13520 | if (match[2]) return true;
|
13521 | str = str.slice(match.index + match[0].length);
|
13522 | }
|
13523 |
|
13524 | return false;
|
13525 | };
|
13526 |
|
13527 |
|
13528 | }),
|
13529 |
|
13530 | (function(module, exports, __webpack_require__) {
|
13531 |
|
13532 | "use strict";
|
13533 |
|
13534 |
|
13535 | const util = __webpack_require__(42);
|
13536 | const braces = __webpack_require__(65);
|
13537 | const picomatch = __webpack_require__(75);
|
13538 | const utils = __webpack_require__(78);
|
13539 | const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
|
13540 |
|
13541 |
|
13542 |
|
13543 |
|
13544 |
|
13545 |
|
13546 |
|
13547 |
|
13548 |
|
13549 |
|
13550 |
|
13551 |
|
13552 |
|
13553 |
|
13554 |
|
13555 |
|
13556 |
|
13557 |
|
13558 |
|
13559 | const micromatch = (list, patterns, options) => {
|
13560 | patterns = [].concat(patterns);
|
13561 | list = [].concat(list);
|
13562 |
|
13563 | let omit = new Set();
|
13564 | let keep = new Set();
|
13565 | let items = new Set();
|
13566 | let negatives = 0;
|
13567 |
|
13568 | let onResult = state => {
|
13569 | items.add(state.output);
|
13570 | if (options && options.onResult) {
|
13571 | options.onResult(state);
|
13572 | }
|
13573 | };
|
13574 |
|
13575 | for (let i = 0; i < patterns.length; i++) {
|
13576 | let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
|
13577 | let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
13578 | if (negated) negatives++;
|
13579 |
|
13580 | for (let item of list) {
|
13581 | let matched = isMatch(item, true);
|
13582 |
|
13583 | let match = negated ? !matched.isMatch : matched.isMatch;
|
13584 | if (!match) continue;
|
13585 |
|
13586 | if (negated) {
|
13587 | omit.add(matched.output);
|
13588 | } else {
|
13589 | omit.delete(matched.output);
|
13590 | keep.add(matched.output);
|
13591 | }
|
13592 | }
|
13593 | }
|
13594 |
|
13595 | let result = negatives === patterns.length ? [...items] : [...keep];
|
13596 | let matches = result.filter(item => !omit.has(item));
|
13597 |
|
13598 | if (options && matches.length === 0) {
|
13599 | if (options.failglob === true) {
|
13600 | throw new Error(`No matches found for "${patterns.join(', ')}"`);
|
13601 | }
|
13602 |
|
13603 | if (options.nonull === true || options.nullglob === true) {
|
13604 | return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
|
13605 | }
|
13606 | }
|
13607 |
|
13608 | return matches;
|
13609 | };
|
13610 |
|
13611 |
|
13612 |
|
13613 |
|
13614 |
|
13615 | micromatch.match = micromatch;
|
13616 |
|
13617 |
|
13618 |
|
13619 |
|
13620 |
|
13621 |
|
13622 |
|
13623 |
|
13624 |
|
13625 |
|
13626 |
|
13627 |
|
13628 |
|
13629 |
|
13630 |
|
13631 |
|
13632 |
|
13633 |
|
13634 |
|
13635 |
|
13636 | micromatch.matcher = (pattern, options) => picomatch(pattern, options);
|
13637 |
|
13638 |
|
13639 |
|
13640 |
|
13641 |
|
13642 |
|
13643 |
|
13644 |
|
13645 |
|
13646 |
|
13647 |
|
13648 |
|
13649 |
|
13650 |
|
13651 |
|
13652 |
|
13653 |
|
13654 |
|
13655 | micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
13656 |
|
13657 |
|
13658 |
|
13659 |
|
13660 |
|
13661 | micromatch.any = micromatch.isMatch;
|
13662 |
|
13663 |
|
13664 |
|
13665 |
|
13666 |
|
13667 |
|
13668 |
|
13669 |
|
13670 |
|
13671 |
|
13672 |
|
13673 |
|
13674 |
|
13675 |
|
13676 |
|
13677 |
|
13678 |
|
13679 |
|
13680 | micromatch.not = (list, patterns, options = {}) => {
|
13681 | patterns = [].concat(patterns).map(String);
|
13682 | let result = new Set();
|
13683 | let items = [];
|
13684 |
|
13685 | let onResult = state => {
|
13686 | if (options.onResult) options.onResult(state);
|
13687 | items.push(state.output);
|
13688 | };
|
13689 |
|
13690 | let matches = micromatch(list, patterns, { ...options, onResult });
|
13691 |
|
13692 | for (let item of items) {
|
13693 | if (!matches.includes(item)) {
|
13694 | result.add(item);
|
13695 | }
|
13696 | }
|
13697 | return [...result];
|
13698 | };
|
13699 |
|
13700 |
|
13701 |
|
13702 |
|
13703 |
|
13704 |
|
13705 |
|
13706 |
|
13707 |
|
13708 |
|
13709 |
|
13710 |
|
13711 |
|
13712 |
|
13713 |
|
13714 |
|
13715 |
|
13716 |
|
13717 |
|
13718 |
|
13719 |
|
13720 | micromatch.contains = (str, pattern, options) => {
|
13721 | if (typeof str !== 'string') {
|
13722 | throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
13723 | }
|
13724 |
|
13725 | if (Array.isArray(pattern)) {
|
13726 | return pattern.some(p => micromatch.contains(str, p, options));
|
13727 | }
|
13728 |
|
13729 | if (typeof pattern === 'string') {
|
13730 | if (isEmptyString(str) || isEmptyString(pattern)) {
|
13731 | return false;
|
13732 | }
|
13733 |
|
13734 | if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) {
|
13735 | return true;
|
13736 | }
|
13737 | }
|
13738 |
|
13739 | return micromatch.isMatch(str, pattern, { ...options, contains: true });
|
13740 | };
|
13741 |
|
13742 |
|
13743 |
|
13744 |
|
13745 |
|
13746 |
|
13747 |
|
13748 |
|
13749 |
|
13750 |
|
13751 |
|
13752 |
|
13753 |
|
13754 |
|
13755 |
|
13756 |
|
13757 |
|
13758 |
|
13759 |
|
13760 |
|
13761 |
|
13762 | micromatch.matchKeys = (obj, patterns, options) => {
|
13763 | if (!utils.isObject(obj)) {
|
13764 | throw new TypeError('Expected the first argument to be an object');
|
13765 | }
|
13766 | let keys = micromatch(Object.keys(obj), patterns, options);
|
13767 | let res = {};
|
13768 | for (let key of keys) res[key] = obj[key];
|
13769 | return res;
|
13770 | };
|
13771 |
|
13772 |
|
13773 |
|
13774 |
|
13775 |
|
13776 |
|
13777 |
|
13778 |
|
13779 |
|
13780 |
|
13781 |
|
13782 |
|
13783 |
|
13784 |
|
13785 |
|
13786 |
|
13787 |
|
13788 |
|
13789 |
|
13790 |
|
13791 | micromatch.some = (list, patterns, options) => {
|
13792 | let items = [].concat(list);
|
13793 |
|
13794 | for (let pattern of [].concat(patterns)) {
|
13795 | let isMatch = picomatch(String(pattern), options);
|
13796 | if (items.some(item => isMatch(item))) {
|
13797 | return true;
|
13798 | }
|
13799 | }
|
13800 | return false;
|
13801 | };
|
13802 |
|
13803 |
|
13804 |
|
13805 |
|
13806 |
|
13807 |
|
13808 |
|
13809 |
|
13810 |
|
13811 |
|
13812 |
|
13813 |
|
13814 |
|
13815 |
|
13816 |
|
13817 |
|
13818 |
|
13819 |
|
13820 |
|
13821 |
|
13822 |
|
13823 |
|
13824 |
|
13825 |
|
13826 |
|
13827 | micromatch.every = (list, patterns, options) => {
|
13828 | let items = [].concat(list);
|
13829 |
|
13830 | for (let pattern of [].concat(patterns)) {
|
13831 | let isMatch = picomatch(String(pattern), options);
|
13832 | if (!items.every(item => isMatch(item))) {
|
13833 | return false;
|
13834 | }
|
13835 | }
|
13836 | return true;
|
13837 | };
|
13838 |
|
13839 |
|
13840 |
|
13841 |
|
13842 |
|
13843 |
|
13844 |
|
13845 |
|
13846 |
|
13847 |
|
13848 |
|
13849 |
|
13850 |
|
13851 |
|
13852 |
|
13853 |
|
13854 |
|
13855 |
|
13856 |
|
13857 |
|
13858 |
|
13859 |
|
13860 |
|
13861 |
|
13862 |
|
13863 |
|
13864 |
|
13865 |
|
13866 | micromatch.all = (str, patterns, options) => {
|
13867 | if (typeof str !== 'string') {
|
13868 | throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
13869 | }
|
13870 |
|
13871 | return [].concat(patterns).every(p => picomatch(p, options)(str));
|
13872 | };
|
13873 |
|
13874 |
|
13875 |
|
13876 |
|
13877 |
|
13878 |
|
13879 |
|
13880 |
|
13881 |
|
13882 |
|
13883 |
|
13884 |
|
13885 |
|
13886 |
|
13887 |
|
13888 |
|
13889 |
|
13890 |
|
13891 |
|
13892 |
|
13893 | micromatch.capture = (glob, input, options) => {
|
13894 | let posix = utils.isWindows(options);
|
13895 | let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
|
13896 | let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
13897 |
|
13898 | if (match) {
|
13899 | return match.slice(1).map(v => v === void 0 ? '' : v);
|
13900 | }
|
13901 | };
|
13902 |
|
13903 |
|
13904 |
|
13905 |
|
13906 |
|
13907 |
|
13908 |
|
13909 |
|
13910 |
|
13911 |
|
13912 |
|
13913 |
|
13914 |
|
13915 |
|
13916 |
|
13917 |
|
13918 |
|
13919 | micromatch.makeRe = (...args) => picomatch.makeRe(...args);
|
13920 |
|
13921 |
|
13922 |
|
13923 |
|
13924 |
|
13925 |
|
13926 |
|
13927 |
|
13928 |
|
13929 |
|
13930 |
|
13931 |
|
13932 |
|
13933 |
|
13934 |
|
13935 | micromatch.scan = (...args) => picomatch.scan(...args);
|
13936 |
|
13937 |
|
13938 |
|
13939 |
|
13940 |
|
13941 |
|
13942 |
|
13943 |
|
13944 |
|
13945 |
|
13946 |
|
13947 |
|
13948 |
|
13949 |
|
13950 |
|
13951 | micromatch.parse = (patterns, options) => {
|
13952 | let res = [];
|
13953 | for (let pattern of [].concat(patterns || [])) {
|
13954 | for (let str of braces(String(pattern), options)) {
|
13955 | res.push(picomatch.parse(str, options));
|
13956 | }
|
13957 | }
|
13958 | return res;
|
13959 | };
|
13960 |
|
13961 |
|
13962 |
|
13963 |
|
13964 |
|
13965 |
|
13966 |
|
13967 |
|
13968 |
|
13969 |
|
13970 |
|
13971 |
|
13972 |
|
13973 |
|
13974 |
|
13975 |
|
13976 |
|
13977 |
|
13978 | micromatch.braces = (pattern, options) => {
|
13979 | if (typeof pattern !== 'string') throw new TypeError('Expected a string');
|
13980 | if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
|
13981 | return [pattern];
|
13982 | }
|
13983 | return braces(pattern, options);
|
13984 | };
|
13985 |
|
13986 |
|
13987 |
|
13988 |
|
13989 |
|
13990 | micromatch.braceExpand = (pattern, options) => {
|
13991 | if (typeof pattern !== 'string') throw new TypeError('Expected a string');
|
13992 | return micromatch.braces(pattern, { ...options, expand: true });
|
13993 | };
|
13994 |
|
13995 |
|
13996 |
|
13997 |
|
13998 |
|
13999 | module.exports = micromatch;
|
14000 |
|
14001 |
|
14002 | }),
|
14003 |
|
14004 | (function(module, exports, __webpack_require__) {
|
14005 |
|
14006 | "use strict";
|
14007 |
|
14008 |
|
14009 | const stringify = __webpack_require__(66);
|
14010 | const compile = __webpack_require__(68);
|
14011 | const expand = __webpack_require__(72);
|
14012 | const parse = __webpack_require__(73);
|
14013 |
|
14014 |
|
14015 |
|
14016 |
|
14017 |
|
14018 |
|
14019 |
|
14020 |
|
14021 |
|
14022 |
|
14023 |
|
14024 |
|
14025 |
|
14026 |
|
14027 |
|
14028 | const braces = (input, options = {}) => {
|
14029 | let output = [];
|
14030 |
|
14031 | if (Array.isArray(input)) {
|
14032 | for (let pattern of input) {
|
14033 | let result = braces.create(pattern, options);
|
14034 | if (Array.isArray(result)) {
|
14035 | output.push(...result);
|
14036 | } else {
|
14037 | output.push(result);
|
14038 | }
|
14039 | }
|
14040 | } else {
|
14041 | output = [].concat(braces.create(input, options));
|
14042 | }
|
14043 |
|
14044 | if (options && options.expand === true && options.nodupes === true) {
|
14045 | output = [...new Set(output)];
|
14046 | }
|
14047 | return output;
|
14048 | };
|
14049 |
|
14050 |
|
14051 |
|
14052 |
|
14053 |
|
14054 |
|
14055 |
|
14056 |
|
14057 |
|
14058 |
|
14059 |
|
14060 |
|
14061 |
|
14062 |
|
14063 |
|
14064 | braces.parse = (input, options = {}) => parse(input, options);
|
14065 |
|
14066 |
|
14067 |
|
14068 |
|
14069 |
|
14070 |
|
14071 |
|
14072 |
|
14073 |
|
14074 |
|
14075 |
|
14076 |
|
14077 |
|
14078 |
|
14079 |
|
14080 | braces.stringify = (input, options = {}) => {
|
14081 | if (typeof input === 'string') {
|
14082 | return stringify(braces.parse(input, options), options);
|
14083 | }
|
14084 | return stringify(input, options);
|
14085 | };
|
14086 |
|
14087 |
|
14088 |
|
14089 |
|
14090 |
|
14091 |
|
14092 |
|
14093 |
|
14094 |
|
14095 |
|
14096 |
|
14097 |
|
14098 |
|
14099 |
|
14100 |
|
14101 |
|
14102 | braces.compile = (input, options = {}) => {
|
14103 | if (typeof input === 'string') {
|
14104 | input = braces.parse(input, options);
|
14105 | }
|
14106 | return compile(input, options);
|
14107 | };
|
14108 |
|
14109 |
|
14110 |
|
14111 |
|
14112 |
|
14113 |
|
14114 |
|
14115 |
|
14116 |
|
14117 |
|
14118 |
|
14119 |
|
14120 |
|
14121 |
|
14122 |
|
14123 |
|
14124 |
|
14125 |
|
14126 | braces.expand = (input, options = {}) => {
|
14127 | if (typeof input === 'string') {
|
14128 | input = braces.parse(input, options);
|
14129 | }
|
14130 |
|
14131 | let result = expand(input, options);
|
14132 |
|
14133 |
|
14134 | if (options.noempty === true) {
|
14135 | result = result.filter(Boolean);
|
14136 | }
|
14137 |
|
14138 |
|
14139 | if (options.nodupes === true) {
|
14140 | result = [...new Set(result)];
|
14141 | }
|
14142 |
|
14143 | return result;
|
14144 | };
|
14145 |
|
14146 |
|
14147 |
|
14148 |
|
14149 |
|
14150 |
|
14151 |
|
14152 |
|
14153 |
|
14154 |
|
14155 |
|
14156 |
|
14157 |
|
14158 |
|
14159 |
|
14160 |
|
14161 |
|
14162 | braces.create = (input, options = {}) => {
|
14163 | if (input === '' || input.length < 3) {
|
14164 | return [input];
|
14165 | }
|
14166 |
|
14167 | return options.expand !== true
|
14168 | ? braces.compile(input, options)
|
14169 | : braces.expand(input, options);
|
14170 | };
|
14171 |
|
14172 |
|
14173 |
|
14174 |
|
14175 |
|
14176 | module.exports = braces;
|
14177 |
|
14178 |
|
14179 | }),
|
14180 |
|
14181 | (function(module, exports, __webpack_require__) {
|
14182 |
|
14183 | "use strict";
|
14184 |
|
14185 |
|
14186 | const utils = __webpack_require__(67);
|
14187 |
|
14188 | module.exports = (ast, options = {}) => {
|
14189 | let stringify = (node, parent = {}) => {
|
14190 | let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
14191 | let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
14192 | let output = '';
|
14193 |
|
14194 | if (node.value) {
|
14195 | if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
14196 | return '\\' + node.value;
|
14197 | }
|
14198 | return node.value;
|
14199 | }
|
14200 |
|
14201 | if (node.value) {
|
14202 | return node.value;
|
14203 | }
|
14204 |
|
14205 | if (node.nodes) {
|
14206 | for (let child of node.nodes) {
|
14207 | output += stringify(child);
|
14208 | }
|
14209 | }
|
14210 | return output;
|
14211 | };
|
14212 |
|
14213 | return stringify(ast);
|
14214 | };
|
14215 |
|
14216 |
|
14217 |
|
14218 | }),
|
14219 |
|
14220 | (function(module, exports, __webpack_require__) {
|
14221 |
|
14222 | "use strict";
|
14223 |
|
14224 |
|
14225 | exports.isInteger = num => {
|
14226 | if (typeof num === 'number') {
|
14227 | return Number.isInteger(num);
|
14228 | }
|
14229 | if (typeof num === 'string' && num.trim() !== '') {
|
14230 | return Number.isInteger(Number(num));
|
14231 | }
|
14232 | return false;
|
14233 | };
|
14234 |
|
14235 |
|
14236 |
|
14237 |
|
14238 |
|
14239 | exports.find = (node, type) => node.nodes.find(node => node.type === type);
|
14240 |
|
14241 |
|
14242 |
|
14243 |
|
14244 |
|
14245 | exports.exceedsLimit = (min, max, step = 1, limit) => {
|
14246 | if (limit === false) return false;
|
14247 | if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
14248 | return ((Number(max) - Number(min)) / Number(step)) >= limit;
|
14249 | };
|
14250 |
|
14251 |
|
14252 |
|
14253 |
|
14254 |
|
14255 | exports.escapeNode = (block, n = 0, type) => {
|
14256 | let node = block.nodes[n];
|
14257 | if (!node) return;
|
14258 |
|
14259 | if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
|
14260 | if (node.escaped !== true) {
|
14261 | node.value = '\\' + node.value;
|
14262 | node.escaped = true;
|
14263 | }
|
14264 | }
|
14265 | };
|
14266 |
|
14267 |
|
14268 |
|
14269 |
|
14270 |
|
14271 | exports.encloseBrace = node => {
|
14272 | if (node.type !== 'brace') return false;
|
14273 | if ((node.commas >> 0 + node.ranges >> 0) === 0) {
|
14274 | node.invalid = true;
|
14275 | return true;
|
14276 | }
|
14277 | return false;
|
14278 | };
|
14279 |
|
14280 |
|
14281 |
|
14282 |
|
14283 |
|
14284 | exports.isInvalidBrace = block => {
|
14285 | if (block.type !== 'brace') return false;
|
14286 | if (block.invalid === true || block.dollar) return true;
|
14287 | if ((block.commas >> 0 + block.ranges >> 0) === 0) {
|
14288 | block.invalid = true;
|
14289 | return true;
|
14290 | }
|
14291 | if (block.open !== true || block.close !== true) {
|
14292 | block.invalid = true;
|
14293 | return true;
|
14294 | }
|
14295 | return false;
|
14296 | };
|
14297 |
|
14298 |
|
14299 |
|
14300 |
|
14301 |
|
14302 | exports.isOpenOrClose = node => {
|
14303 | if (node.type === 'open' || node.type === 'close') {
|
14304 | return true;
|
14305 | }
|
14306 | return node.open === true || node.close === true;
|
14307 | };
|
14308 |
|
14309 |
|
14310 |
|
14311 |
|
14312 |
|
14313 | exports.reduce = nodes => nodes.reduce((acc, node) => {
|
14314 | if (node.type === 'text') acc.push(node.value);
|
14315 | if (node.type === 'range') node.type = 'text';
|
14316 | return acc;
|
14317 | }, []);
|
14318 |
|
14319 |
|
14320 |
|
14321 |
|
14322 |
|
14323 | exports.flatten = (...args) => {
|
14324 | const result = [];
|
14325 | const flat = arr => {
|
14326 | for (let i = 0; i < arr.length; i++) {
|
14327 | let ele = arr[i];
|
14328 | Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
|
14329 | }
|
14330 | return result;
|
14331 | };
|
14332 | flat(args);
|
14333 | return result;
|
14334 | };
|
14335 |
|
14336 |
|
14337 | }),
|
14338 |
|
14339 | (function(module, exports, __webpack_require__) {
|
14340 |
|
14341 | "use strict";
|
14342 |
|
14343 |
|
14344 | const fill = __webpack_require__(69);
|
14345 | const utils = __webpack_require__(67);
|
14346 |
|
14347 | const compile = (ast, options = {}) => {
|
14348 | let walk = (node, parent = {}) => {
|
14349 | let invalidBlock = utils.isInvalidBrace(parent);
|
14350 | let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
14351 | let invalid = invalidBlock === true || invalidNode === true;
|
14352 | let prefix = options.escapeInvalid === true ? '\\' : '';
|
14353 | let output = '';
|
14354 |
|
14355 | if (node.isOpen === true) {
|
14356 | return prefix + node.value;
|
14357 | }
|
14358 | if (node.isClose === true) {
|
14359 | return prefix + node.value;
|
14360 | }
|
14361 |
|
14362 | if (node.type === 'open') {
|
14363 | return invalid ? (prefix + node.value) : '(';
|
14364 | }
|
14365 |
|
14366 | if (node.type === 'close') {
|
14367 | return invalid ? (prefix + node.value) : ')';
|
14368 | }
|
14369 |
|
14370 | if (node.type === 'comma') {
|
14371 | return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
|
14372 | }
|
14373 |
|
14374 | if (node.value) {
|
14375 | return node.value;
|
14376 | }
|
14377 |
|
14378 | if (node.nodes && node.ranges > 0) {
|
14379 | let args = utils.reduce(node.nodes);
|
14380 | let range = fill(...args, { ...options, wrap: false, toRegex: true });
|
14381 |
|
14382 | if (range.length !== 0) {
|
14383 | return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
14384 | }
|
14385 | }
|
14386 |
|
14387 | if (node.nodes) {
|
14388 | for (let child of node.nodes) {
|
14389 | output += walk(child, node);
|
14390 | }
|
14391 | }
|
14392 | return output;
|
14393 | };
|
14394 |
|
14395 | return walk(ast);
|
14396 | };
|
14397 |
|
14398 | module.exports = compile;
|
14399 |
|
14400 |
|
14401 | }),
|
14402 |
|
14403 | (function(module, exports, __webpack_require__) {
|
14404 |
|
14405 | "use strict";
|
14406 |
|
14407 |
|
14408 |
|
14409 |
|
14410 |
|
14411 |
|
14412 |
|
14413 |
|
14414 |
|
14415 | const util = __webpack_require__(42);
|
14416 | const toRegexRange = __webpack_require__(70);
|
14417 |
|
14418 | const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
14419 |
|
14420 | const transform = toNumber => {
|
14421 | return value => toNumber === true ? Number(value) : String(value);
|
14422 | };
|
14423 |
|
14424 | const isValidValue = value => {
|
14425 | return typeof value === 'number' || (typeof value === 'string' && value !== '');
|
14426 | };
|
14427 |
|
14428 | const isNumber = num => Number.isInteger(+num);
|
14429 |
|
14430 | const zeros = input => {
|
14431 | let value = `${input}`;
|
14432 | let index = -1;
|
14433 | if (value[0] === '-') value = value.slice(1);
|
14434 | if (value === '0') return false;
|
14435 | while (value[++index] === '0');
|
14436 | return index > 0;
|
14437 | };
|
14438 |
|
14439 | const stringify = (start, end, options) => {
|
14440 | if (typeof start === 'string' || typeof end === 'string') {
|
14441 | return true;
|
14442 | }
|
14443 | return options.stringify === true;
|
14444 | };
|
14445 |
|
14446 | const pad = (input, maxLength, toNumber) => {
|
14447 | if (maxLength > 0) {
|
14448 | let dash = input[0] === '-' ? '-' : '';
|
14449 | if (dash) input = input.slice(1);
|
14450 | input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0'));
|
14451 | }
|
14452 | if (toNumber === false) {
|
14453 | return String(input);
|
14454 | }
|
14455 | return input;
|
14456 | };
|
14457 |
|
14458 | const toMaxLen = (input, maxLength) => {
|
14459 | let negative = input[0] === '-' ? '-' : '';
|
14460 | if (negative) {
|
14461 | input = input.slice(1);
|
14462 | maxLength--;
|
14463 | }
|
14464 | while (input.length < maxLength) input = '0' + input;
|
14465 | return negative ? ('-' + input) : input;
|
14466 | };
|
14467 |
|
14468 | const toSequence = (parts, options) => {
|
14469 | parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
14470 | parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
14471 |
|
14472 | let prefix = options.capture ? '' : '?:';
|
14473 | let positives = '';
|
14474 | let negatives = '';
|
14475 | let result;
|
14476 |
|
14477 | if (parts.positives.length) {
|
14478 | positives = parts.positives.join('|');
|
14479 | }
|
14480 |
|
14481 | if (parts.negatives.length) {
|
14482 | negatives = `-(${prefix}${parts.negatives.join('|')})`;
|
14483 | }
|
14484 |
|
14485 | if (positives && negatives) {
|
14486 | result = `${positives}|${negatives}`;
|
14487 | } else {
|
14488 | result = positives || negatives;
|
14489 | }
|
14490 |
|
14491 | if (options.wrap) {
|
14492 | return `(${prefix}${result})`;
|
14493 | }
|
14494 |
|
14495 | return result;
|
14496 | };
|
14497 |
|
14498 | const toRange = (a, b, isNumbers, options) => {
|
14499 | if (isNumbers) {
|
14500 | return toRegexRange(a, b, { wrap: false, ...options });
|
14501 | }
|
14502 |
|
14503 | let start = String.fromCharCode(a);
|
14504 | if (a === b) return start;
|
14505 |
|
14506 | let stop = String.fromCharCode(b);
|
14507 | return `[${start}-${stop}]`;
|
14508 | };
|
14509 |
|
14510 | const toRegex = (start, end, options) => {
|
14511 | if (Array.isArray(start)) {
|
14512 | let wrap = options.wrap === true;
|
14513 | let prefix = options.capture ? '' : '?:';
|
14514 | return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
|
14515 | }
|
14516 | return toRegexRange(start, end, options);
|
14517 | };
|
14518 |
|
14519 | const rangeError = (...args) => {
|
14520 | return new RangeError('Invalid range arguments: ' + util.inspect(...args));
|
14521 | };
|
14522 |
|
14523 | const invalidRange = (start, end, options) => {
|
14524 | if (options.strictRanges === true) throw rangeError([start, end]);
|
14525 | return [];
|
14526 | };
|
14527 |
|
14528 | const invalidStep = (step, options) => {
|
14529 | if (options.strictRanges === true) {
|
14530 | throw new TypeError(`Expected step "${step}" to be a number`);
|
14531 | }
|
14532 | return [];
|
14533 | };
|
14534 |
|
14535 | const fillNumbers = (start, end, step = 1, options = {}) => {
|
14536 | let a = Number(start);
|
14537 | let b = Number(end);
|
14538 |
|
14539 | if (!Number.isInteger(a) || !Number.isInteger(b)) {
|
14540 | if (options.strictRanges === true) throw rangeError([start, end]);
|
14541 | return [];
|
14542 | }
|
14543 |
|
14544 |
|
14545 | if (a === 0) a = 0;
|
14546 | if (b === 0) b = 0;
|
14547 |
|
14548 | let descending = a > b;
|
14549 | let startString = String(start);
|
14550 | let endString = String(end);
|
14551 | let stepString = String(step);
|
14552 | step = Math.max(Math.abs(step), 1);
|
14553 |
|
14554 | let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
14555 | let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
14556 | let toNumber = padded === false && stringify(start, end, options) === false;
|
14557 | let format = options.transform || transform(toNumber);
|
14558 |
|
14559 | if (options.toRegex && step === 1) {
|
14560 | return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
14561 | }
|
14562 |
|
14563 | let parts = { negatives: [], positives: [] };
|
14564 | let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num));
|
14565 | let range = [];
|
14566 | let index = 0;
|
14567 |
|
14568 | while (descending ? a >= b : a <= b) {
|
14569 | if (options.toRegex === true && step > 1) {
|
14570 | push(a);
|
14571 | } else {
|
14572 | range.push(pad(format(a, index), maxLen, toNumber));
|
14573 | }
|
14574 | a = descending ? a - step : a + step;
|
14575 | index++;
|
14576 | }
|
14577 |
|
14578 | if (options.toRegex === true) {
|
14579 | return step > 1
|
14580 | ? toSequence(parts, options)
|
14581 | : toRegex(range, null, { wrap: false, ...options });
|
14582 | }
|
14583 |
|
14584 | return range;
|
14585 | };
|
14586 |
|
14587 | const fillLetters = (start, end, step = 1, options = {}) => {
|
14588 | if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) {
|
14589 | return invalidRange(start, end, options);
|
14590 | }
|
14591 |
|
14592 |
|
14593 | let format = options.transform || (val => String.fromCharCode(val));
|
14594 | let a = `${start}`.charCodeAt(0);
|
14595 | let b = `${end}`.charCodeAt(0);
|
14596 |
|
14597 | let descending = a > b;
|
14598 | let min = Math.min(a, b);
|
14599 | let max = Math.max(a, b);
|
14600 |
|
14601 | if (options.toRegex && step === 1) {
|
14602 | return toRange(min, max, false, options);
|
14603 | }
|
14604 |
|
14605 | let range = [];
|
14606 | let index = 0;
|
14607 |
|
14608 | while (descending ? a >= b : a <= b) {
|
14609 | range.push(format(a, index));
|
14610 | a = descending ? a - step : a + step;
|
14611 | index++;
|
14612 | }
|
14613 |
|
14614 | if (options.toRegex === true) {
|
14615 | return toRegex(range, null, { wrap: false, options });
|
14616 | }
|
14617 |
|
14618 | return range;
|
14619 | };
|
14620 |
|
14621 | const fill = (start, end, step, options = {}) => {
|
14622 | if (end == null && isValidValue(start)) {
|
14623 | return [start];
|
14624 | }
|
14625 |
|
14626 | if (!isValidValue(start) || !isValidValue(end)) {
|
14627 | return invalidRange(start, end, options);
|
14628 | }
|
14629 |
|
14630 | if (typeof step === 'function') {
|
14631 | return fill(start, end, 1, { transform: step });
|
14632 | }
|
14633 |
|
14634 | if (isObject(step)) {
|
14635 | return fill(start, end, 0, step);
|
14636 | }
|
14637 |
|
14638 | let opts = { ...options };
|
14639 | if (opts.capture === true) opts.wrap = true;
|
14640 | step = step || opts.step || 1;
|
14641 |
|
14642 | if (!isNumber(step)) {
|
14643 | if (step != null && !isObject(step)) return invalidStep(step, opts);
|
14644 | return fill(start, end, 1, step);
|
14645 | }
|
14646 |
|
14647 | if (isNumber(start) && isNumber(end)) {
|
14648 | return fillNumbers(start, end, step, opts);
|
14649 | }
|
14650 |
|
14651 | return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
14652 | };
|
14653 |
|
14654 | module.exports = fill;
|
14655 |
|
14656 |
|
14657 | }),
|
14658 |
|
14659 | (function(module, exports, __webpack_require__) {
|
14660 |
|
14661 | "use strict";
|
14662 |
|
14663 |
|
14664 |
|
14665 |
|
14666 |
|
14667 |
|
14668 |
|
14669 |
|
14670 |
|
14671 | const isNumber = __webpack_require__(71);
|
14672 |
|
14673 | const toRegexRange = (min, max, options) => {
|
14674 | if (isNumber(min) === false) {
|
14675 | throw new TypeError('toRegexRange: expected the first argument to be a number');
|
14676 | }
|
14677 |
|
14678 | if (max === void 0 || min === max) {
|
14679 | return String(min);
|
14680 | }
|
14681 |
|
14682 | if (isNumber(max) === false) {
|
14683 | throw new TypeError('toRegexRange: expected the second argument to be a number.');
|
14684 | }
|
14685 |
|
14686 | let opts = { relaxZeros: true, ...options };
|
14687 | if (typeof opts.strictZeros === 'boolean') {
|
14688 | opts.relaxZeros = opts.strictZeros === false;
|
14689 | }
|
14690 |
|
14691 | let relax = String(opts.relaxZeros);
|
14692 | let shorthand = String(opts.shorthand);
|
14693 | let capture = String(opts.capture);
|
14694 | let wrap = String(opts.wrap);
|
14695 | let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
|
14696 |
|
14697 | if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
14698 | return toRegexRange.cache[cacheKey].result;
|
14699 | }
|
14700 |
|
14701 | let a = Math.min(min, max);
|
14702 | let b = Math.max(min, max);
|
14703 |
|
14704 | if (Math.abs(a - b) === 1) {
|
14705 | let result = min + '|' + max;
|
14706 | if (opts.capture) {
|
14707 | return `(${result})`;
|
14708 | }
|
14709 | if (opts.wrap === false) {
|
14710 | return result;
|
14711 | }
|
14712 | return `(?:${result})`;
|
14713 | }
|
14714 |
|
14715 | let isPadded = hasPadding(min) || hasPadding(max);
|
14716 | let state = { min, max, a, b };
|
14717 | let positives = [];
|
14718 | let negatives = [];
|
14719 |
|
14720 | if (isPadded) {
|
14721 | state.isPadded = isPadded;
|
14722 | state.maxLen = String(state.max).length;
|
14723 | }
|
14724 |
|
14725 | if (a < 0) {
|
14726 | let newMin = b < 0 ? Math.abs(b) : 1;
|
14727 | negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
|
14728 | a = state.a = 0;
|
14729 | }
|
14730 |
|
14731 | if (b >= 0) {
|
14732 | positives = splitToPatterns(a, b, state, opts);
|
14733 | }
|
14734 |
|
14735 | state.negatives = negatives;
|
14736 | state.positives = positives;
|
14737 | state.result = collatePatterns(negatives, positives, opts);
|
14738 |
|
14739 | if (opts.capture === true) {
|
14740 | state.result = `(${state.result})`;
|
14741 | } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) {
|
14742 | state.result = `(?:${state.result})`;
|
14743 | }
|
14744 |
|
14745 | toRegexRange.cache[cacheKey] = state;
|
14746 | return state.result;
|
14747 | };
|
14748 |
|
14749 | function collatePatterns(neg, pos, options) {
|
14750 | let onlyNegative = filterPatterns(neg, pos, '-', false, options) || [];
|
14751 | let onlyPositive = filterPatterns(pos, neg, '', false, options) || [];
|
14752 | let intersected = filterPatterns(neg, pos, '-?', true, options) || [];
|
14753 | let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
|
14754 | return subpatterns.join('|');
|
14755 | }
|
14756 |
|
14757 | function splitToRanges(min, max) {
|
14758 | let nines = 1;
|
14759 | let zeros = 1;
|
14760 |
|
14761 | let stop = countNines(min, nines);
|
14762 | let stops = new Set([max]);
|
14763 |
|
14764 | while (min <= stop && stop <= max) {
|
14765 | stops.add(stop);
|
14766 | nines += 1;
|
14767 | stop = countNines(min, nines);
|
14768 | }
|
14769 |
|
14770 | stop = countZeros(max + 1, zeros) - 1;
|
14771 |
|
14772 | while (min < stop && stop <= max) {
|
14773 | stops.add(stop);
|
14774 | zeros += 1;
|
14775 | stop = countZeros(max + 1, zeros) - 1;
|
14776 | }
|
14777 |
|
14778 | stops = [...stops];
|
14779 | stops.sort(compare);
|
14780 | return stops;
|
14781 | }
|
14782 |
|
14783 |
|
14784 |
|
14785 |
|
14786 |
|
14787 |
|
14788 |
|
14789 |
|
14790 | function rangeToPattern(start, stop, options) {
|
14791 | if (start === stop) {
|
14792 | return { pattern: start, count: [], digits: 0 };
|
14793 | }
|
14794 |
|
14795 | let zipped = zip(start, stop);
|
14796 | let digits = zipped.length;
|
14797 | let pattern = '';
|
14798 | let count = 0;
|
14799 |
|
14800 | for (let i = 0; i < digits; i++) {
|
14801 | let [startDigit, stopDigit] = zipped[i];
|
14802 |
|
14803 | if (startDigit === stopDigit) {
|
14804 | pattern += startDigit;
|
14805 |
|
14806 | } else if (startDigit !== '0' || stopDigit !== '9') {
|
14807 | pattern += toCharacterClass(startDigit, stopDigit, options);
|
14808 |
|
14809 | } else {
|
14810 | count++;
|
14811 | }
|
14812 | }
|
14813 |
|
14814 | if (count) {
|
14815 | pattern += options.shorthand === true ? '\\d' : '[0-9]';
|
14816 | }
|
14817 |
|
14818 | return { pattern, count: [count], digits };
|
14819 | }
|
14820 |
|
14821 | function splitToPatterns(min, max, tok, options) {
|
14822 | let ranges = splitToRanges(min, max);
|
14823 | let tokens = [];
|
14824 | let start = min;
|
14825 | let prev;
|
14826 |
|
14827 | for (let i = 0; i < ranges.length; i++) {
|
14828 | let max = ranges[i];
|
14829 | let obj = rangeToPattern(String(start), String(max), options);
|
14830 | let zeros = '';
|
14831 |
|
14832 | if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
14833 | if (prev.count.length > 1) {
|
14834 | prev.count.pop();
|
14835 | }
|
14836 |
|
14837 | prev.count.push(obj.count[0]);
|
14838 | prev.string = prev.pattern + toQuantifier(prev.count);
|
14839 | start = max + 1;
|
14840 | continue;
|
14841 | }
|
14842 |
|
14843 | if (tok.isPadded) {
|
14844 | zeros = padZeros(max, tok, options);
|
14845 | }
|
14846 |
|
14847 | obj.string = zeros + obj.pattern + toQuantifier(obj.count);
|
14848 | tokens.push(obj);
|
14849 | start = max + 1;
|
14850 | prev = obj;
|
14851 | }
|
14852 |
|
14853 | return tokens;
|
14854 | }
|
14855 |
|
14856 | function filterPatterns(arr, comparison, prefix, intersection, options) {
|
14857 | let result = [];
|
14858 |
|
14859 | for (let ele of arr) {
|
14860 | let { string } = ele;
|
14861 |
|
14862 |
|
14863 | if (!intersection && !contains(comparison, 'string', string)) {
|
14864 | result.push(prefix + string);
|
14865 | }
|
14866 |
|
14867 |
|
14868 | if (intersection && contains(comparison, 'string', string)) {
|
14869 | result.push(prefix + string);
|
14870 | }
|
14871 | }
|
14872 | return result;
|
14873 | }
|
14874 |
|
14875 |
|
14876 |
|
14877 |
|
14878 |
|
14879 | function zip(a, b) {
|
14880 | let arr = [];
|
14881 | for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
|
14882 | return arr;
|
14883 | }
|
14884 |
|
14885 | function compare(a, b) {
|
14886 | return a > b ? 1 : b > a ? -1 : 0;
|
14887 | }
|
14888 |
|
14889 | function contains(arr, key, val) {
|
14890 | return arr.some(ele => ele[key] === val);
|
14891 | }
|
14892 |
|
14893 | function countNines(min, len) {
|
14894 | return Number(String(min).slice(0, -len) + '9'.repeat(len));
|
14895 | }
|
14896 |
|
14897 | function countZeros(integer, zeros) {
|
14898 | return integer - (integer % Math.pow(10, zeros));
|
14899 | }
|
14900 |
|
14901 | function toQuantifier(digits) {
|
14902 | let [start = 0, stop = ''] = digits;
|
14903 | if (stop || start > 1) {
|
14904 | return `{${start + (stop ? ',' + stop : '')}}`;
|
14905 | }
|
14906 | return '';
|
14907 | }
|
14908 |
|
14909 | function toCharacterClass(a, b, options) {
|
14910 | return `[${a}${(b - a === 1) ? '' : '-'}${b}]`;
|
14911 | }
|
14912 |
|
14913 | function hasPadding(str) {
|
14914 | return /^-?(0+)\d/.test(str);
|
14915 | }
|
14916 |
|
14917 | function padZeros(value, tok, options) {
|
14918 | if (!tok.isPadded) {
|
14919 | return value;
|
14920 | }
|
14921 |
|
14922 | let diff = Math.abs(tok.maxLen - String(value).length);
|
14923 | let relax = options.relaxZeros !== false;
|
14924 |
|
14925 | switch (diff) {
|
14926 | case 0:
|
14927 | return '';
|
14928 | case 1:
|
14929 | return relax ? '0?' : '0';
|
14930 | case 2:
|
14931 | return relax ? '0{0,2}' : '00';
|
14932 | default: {
|
14933 | return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
14934 | }
|
14935 | }
|
14936 | }
|
14937 |
|
14938 |
|
14939 |
|
14940 |
|
14941 |
|
14942 | toRegexRange.cache = {};
|
14943 | toRegexRange.clearCache = () => (toRegexRange.cache = {});
|
14944 |
|
14945 |
|
14946 |
|
14947 |
|
14948 |
|
14949 | module.exports = toRegexRange;
|
14950 |
|
14951 |
|
14952 | }),
|
14953 |
|
14954 | (function(module, exports, __webpack_require__) {
|
14955 |
|
14956 | "use strict";
|
14957 |
|
14958 |
|
14959 |
|
14960 |
|
14961 |
|
14962 |
|
14963 |
|
14964 |
|
14965 |
|
14966 | module.exports = function(num) {
|
14967 | if (typeof num === 'number') {
|
14968 | return num - num === 0;
|
14969 | }
|
14970 | if (typeof num === 'string' && num.trim() !== '') {
|
14971 | return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
14972 | }
|
14973 | return false;
|
14974 | };
|
14975 |
|
14976 |
|
14977 | }),
|
14978 |
|
14979 | (function(module, exports, __webpack_require__) {
|
14980 |
|
14981 | "use strict";
|
14982 |
|
14983 |
|
14984 | const fill = __webpack_require__(69);
|
14985 | const stringify = __webpack_require__(66);
|
14986 | const utils = __webpack_require__(67);
|
14987 |
|
14988 | const append = (queue = '', stash = '', enclose = false) => {
|
14989 | let result = [];
|
14990 |
|
14991 | queue = [].concat(queue);
|
14992 | stash = [].concat(stash);
|
14993 |
|
14994 | if (!stash.length) return queue;
|
14995 | if (!queue.length) {
|
14996 | return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
|
14997 | }
|
14998 |
|
14999 | for (let item of queue) {
|
15000 | if (Array.isArray(item)) {
|
15001 | for (let value of item) {
|
15002 | result.push(append(value, stash, enclose));
|
15003 | }
|
15004 | } else {
|
15005 | for (let ele of stash) {
|
15006 | if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
|
15007 | result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
|
15008 | }
|
15009 | }
|
15010 | }
|
15011 | return utils.flatten(result);
|
15012 | };
|
15013 |
|
15014 | const expand = (ast, options = {}) => {
|
15015 | let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
|
15016 |
|
15017 | let walk = (node, parent = {}) => {
|
15018 | node.queue = [];
|
15019 |
|
15020 | let p = parent;
|
15021 | let q = parent.queue;
|
15022 |
|
15023 | while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
|
15024 | p = p.parent;
|
15025 | q = p.queue;
|
15026 | }
|
15027 |
|
15028 | if (node.invalid || node.dollar) {
|
15029 | q.push(append(q.pop(), stringify(node, options)));
|
15030 | return;
|
15031 | }
|
15032 |
|
15033 | if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
|
15034 | q.push(append(q.pop(), ['{}']));
|
15035 | return;
|
15036 | }
|
15037 |
|
15038 | if (node.nodes && node.ranges > 0) {
|
15039 | let args = utils.reduce(node.nodes);
|
15040 |
|
15041 | if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
15042 | throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
15043 | }
|
15044 |
|
15045 | let range = fill(...args, options);
|
15046 | if (range.length === 0) {
|
15047 | range = stringify(node, options);
|
15048 | }
|
15049 |
|
15050 | q.push(append(q.pop(), range));
|
15051 | node.nodes = [];
|
15052 | return;
|
15053 | }
|
15054 |
|
15055 | let enclose = utils.encloseBrace(node);
|
15056 | let queue = node.queue;
|
15057 | let block = node;
|
15058 |
|
15059 | while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
|
15060 | block = block.parent;
|
15061 | queue = block.queue;
|
15062 | }
|
15063 |
|
15064 | for (let i = 0; i < node.nodes.length; i++) {
|
15065 | let child = node.nodes[i];
|
15066 |
|
15067 | if (child.type === 'comma' && node.type === 'brace') {
|
15068 | if (i === 1) queue.push('');
|
15069 | queue.push('');
|
15070 | continue;
|
15071 | }
|
15072 |
|
15073 | if (child.type === 'close') {
|
15074 | q.push(append(q.pop(), queue, enclose));
|
15075 | continue;
|
15076 | }
|
15077 |
|
15078 | if (child.value && child.type !== 'open') {
|
15079 | queue.push(append(queue.pop(), child.value));
|
15080 | continue;
|
15081 | }
|
15082 |
|
15083 | if (child.nodes) {
|
15084 | walk(child, node);
|
15085 | }
|
15086 | }
|
15087 |
|
15088 | return queue;
|
15089 | };
|
15090 |
|
15091 | return utils.flatten(walk(ast));
|
15092 | };
|
15093 |
|
15094 | module.exports = expand;
|
15095 |
|
15096 |
|
15097 | }),
|
15098 |
|
15099 | (function(module, exports, __webpack_require__) {
|
15100 |
|
15101 | "use strict";
|
15102 |
|
15103 |
|
15104 | const stringify = __webpack_require__(66);
|
15105 |
|
15106 |
|
15107 |
|
15108 |
|
15109 |
|
15110 | const {
|
15111 | MAX_LENGTH,
|
15112 | CHAR_BACKSLASH,
|
15113 | CHAR_BACKTICK,
|
15114 | CHAR_COMMA,
|
15115 | CHAR_DOT,
|
15116 | CHAR_LEFT_PARENTHESES,
|
15117 | CHAR_RIGHT_PARENTHESES,
|
15118 | CHAR_LEFT_CURLY_BRACE,
|
15119 | CHAR_RIGHT_CURLY_BRACE,
|
15120 | CHAR_LEFT_SQUARE_BRACKET,
|
15121 | CHAR_RIGHT_SQUARE_BRACKET,
|
15122 | CHAR_DOUBLE_QUOTE,
|
15123 | CHAR_SINGLE_QUOTE,
|
15124 | CHAR_NO_BREAK_SPACE,
|
15125 | CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
15126 | } = __webpack_require__(74);
|
15127 |
|
15128 |
|
15129 |
|
15130 |
|
15131 |
|
15132 | const parse = (input, options = {}) => {
|
15133 | if (typeof input !== 'string') {
|
15134 | throw new TypeError('Expected a string');
|
15135 | }
|
15136 |
|
15137 | let opts = options || {};
|
15138 | let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
15139 | if (input.length > max) {
|
15140 | throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
15141 | }
|
15142 |
|
15143 | let ast = { type: 'root', input, nodes: [] };
|
15144 | let stack = [ast];
|
15145 | let block = ast;
|
15146 | let prev = ast;
|
15147 | let brackets = 0;
|
15148 | let length = input.length;
|
15149 | let index = 0;
|
15150 | let depth = 0;
|
15151 | let value;
|
15152 | let memo = {};
|
15153 |
|
15154 | |
15155 |
|
15156 |
|
15157 |
|
15158 | const advance = () => input[index++];
|
15159 | const push = node => {
|
15160 | if (node.type === 'text' && prev.type === 'dot') {
|
15161 | prev.type = 'text';
|
15162 | }
|
15163 |
|
15164 | if (prev && prev.type === 'text' && node.type === 'text') {
|
15165 | prev.value += node.value;
|
15166 | return;
|
15167 | }
|
15168 |
|
15169 | block.nodes.push(node);
|
15170 | node.parent = block;
|
15171 | node.prev = prev;
|
15172 | prev = node;
|
15173 | return node;
|
15174 | };
|
15175 |
|
15176 | push({ type: 'bos' });
|
15177 |
|
15178 | while (index < length) {
|
15179 | block = stack[stack.length - 1];
|
15180 | value = advance();
|
15181 |
|
15182 | |
15183 |
|
15184 |
|
15185 |
|
15186 | if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
15187 | continue;
|
15188 | }
|
15189 |
|
15190 | |
15191 |
|
15192 |
|
15193 |
|
15194 | if (value === CHAR_BACKSLASH) {
|
15195 | push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() });
|
15196 | continue;
|
15197 | }
|
15198 |
|
15199 | |
15200 |
|
15201 |
|
15202 |
|
15203 | if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
15204 | push({ type: 'text', value: '\\' + value });
|
15205 | continue;
|
15206 | }
|
15207 |
|
15208 | |
15209 |
|
15210 |
|
15211 |
|
15212 | if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
15213 | brackets++;
|
15214 |
|
15215 | let closed = true;
|
15216 | let next;
|
15217 |
|
15218 | while (index < length && (next = advance())) {
|
15219 | value += next;
|
15220 |
|
15221 | if (next === CHAR_LEFT_SQUARE_BRACKET) {
|
15222 | brackets++;
|
15223 | continue;
|
15224 | }
|
15225 |
|
15226 | if (next === CHAR_BACKSLASH) {
|
15227 | value += advance();
|
15228 | continue;
|
15229 | }
|
15230 |
|
15231 | if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
15232 | brackets--;
|
15233 |
|
15234 | if (brackets === 0) {
|
15235 | break;
|
15236 | }
|
15237 | }
|
15238 | }
|
15239 |
|
15240 | push({ type: 'text', value });
|
15241 | continue;
|
15242 | }
|
15243 |
|
15244 | |
15245 |
|
15246 |
|
15247 |
|
15248 | if (value === CHAR_LEFT_PARENTHESES) {
|
15249 | block = push({ type: 'paren', nodes: [] });
|
15250 | stack.push(block);
|
15251 | push({ type: 'text', value });
|
15252 | continue;
|
15253 | }
|
15254 |
|
15255 | if (value === CHAR_RIGHT_PARENTHESES) {
|
15256 | if (block.type !== 'paren') {
|
15257 | push({ type: 'text', value });
|
15258 | continue;
|
15259 | }
|
15260 | block = stack.pop();
|
15261 | push({ type: 'text', value });
|
15262 | block = stack[stack.length - 1];
|
15263 | continue;
|
15264 | }
|
15265 |
|
15266 | |
15267 |
|
15268 |
|
15269 |
|
15270 | if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
15271 | let open = value;
|
15272 | let next;
|
15273 |
|
15274 | if (options.keepQuotes !== true) {
|
15275 | value = '';
|
15276 | }
|
15277 |
|
15278 | while (index < length && (next = advance())) {
|
15279 | if (next === CHAR_BACKSLASH) {
|
15280 | value += next + advance();
|
15281 | continue;
|
15282 | }
|
15283 |
|
15284 | if (next === open) {
|
15285 | if (options.keepQuotes === true) value += next;
|
15286 | break;
|
15287 | }
|
15288 |
|
15289 | value += next;
|
15290 | }
|
15291 |
|
15292 | push({ type: 'text', value });
|
15293 | continue;
|
15294 | }
|
15295 |
|
15296 | |
15297 |
|
15298 |
|
15299 |
|
15300 | if (value === CHAR_LEFT_CURLY_BRACE) {
|
15301 | depth++;
|
15302 |
|
15303 | let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
15304 | let brace = {
|
15305 | type: 'brace',
|
15306 | open: true,
|
15307 | close: false,
|
15308 | dollar,
|
15309 | depth,
|
15310 | commas: 0,
|
15311 | ranges: 0,
|
15312 | nodes: []
|
15313 | };
|
15314 |
|
15315 | block = push(brace);
|
15316 | stack.push(block);
|
15317 | push({ type: 'open', value });
|
15318 | continue;
|
15319 | }
|
15320 |
|
15321 | |
15322 |
|
15323 |
|
15324 |
|
15325 | if (value === CHAR_RIGHT_CURLY_BRACE) {
|
15326 | if (block.type !== 'brace') {
|
15327 | push({ type: 'text', value });
|
15328 | continue;
|
15329 | }
|
15330 |
|
15331 | let type = 'close';
|
15332 | block = stack.pop();
|
15333 | block.close = true;
|
15334 |
|
15335 | push({ type, value });
|
15336 | depth--;
|
15337 |
|
15338 | block = stack[stack.length - 1];
|
15339 | continue;
|
15340 | }
|
15341 |
|
15342 | |
15343 |
|
15344 |
|
15345 |
|
15346 | if (value === CHAR_COMMA && depth > 0) {
|
15347 | if (block.ranges > 0) {
|
15348 | block.ranges = 0;
|
15349 | let open = block.nodes.shift();
|
15350 | block.nodes = [open, { type: 'text', value: stringify(block) }];
|
15351 | }
|
15352 |
|
15353 | push({ type: 'comma', value });
|
15354 | block.commas++;
|
15355 | continue;
|
15356 | }
|
15357 |
|
15358 | |
15359 |
|
15360 |
|
15361 |
|
15362 | if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
15363 | let siblings = block.nodes;
|
15364 |
|
15365 | if (depth === 0 || siblings.length === 0) {
|
15366 | push({ type: 'text', value });
|
15367 | continue;
|
15368 | }
|
15369 |
|
15370 | if (prev.type === 'dot') {
|
15371 | block.range = [];
|
15372 | prev.value += value;
|
15373 | prev.type = 'range';
|
15374 |
|
15375 | if (block.nodes.length !== 3 && block.nodes.length !== 5) {
|
15376 | block.invalid = true;
|
15377 | block.ranges = 0;
|
15378 | prev.type = 'text';
|
15379 | continue;
|
15380 | }
|
15381 |
|
15382 | block.ranges++;
|
15383 | block.args = [];
|
15384 | continue;
|
15385 | }
|
15386 |
|
15387 | if (prev.type === 'range') {
|
15388 | siblings.pop();
|
15389 |
|
15390 | let before = siblings[siblings.length - 1];
|
15391 | before.value += prev.value + value;
|
15392 | prev = before;
|
15393 | block.ranges--;
|
15394 | continue;
|
15395 | }
|
15396 |
|
15397 | push({ type: 'dot', value });
|
15398 | continue;
|
15399 | }
|
15400 |
|
15401 | |
15402 |
|
15403 |
|
15404 |
|
15405 | push({ type: 'text', value });
|
15406 | }
|
15407 |
|
15408 |
|
15409 | do {
|
15410 | block = stack.pop();
|
15411 |
|
15412 | if (block.type !== 'root') {
|
15413 | block.nodes.forEach(node => {
|
15414 | if (!node.nodes) {
|
15415 | if (node.type === 'open') node.isOpen = true;
|
15416 | if (node.type === 'close') node.isClose = true;
|
15417 | if (!node.nodes) node.type = 'text';
|
15418 | node.invalid = true;
|
15419 | }
|
15420 | });
|
15421 |
|
15422 |
|
15423 | let parent = stack[stack.length - 1];
|
15424 | let index = parent.nodes.indexOf(block);
|
15425 |
|
15426 | parent.nodes.splice(index, 1, ...block.nodes);
|
15427 | }
|
15428 | } while (stack.length > 0);
|
15429 |
|
15430 | push({ type: 'eos' });
|
15431 | return ast;
|
15432 | };
|
15433 |
|
15434 | module.exports = parse;
|
15435 |
|
15436 |
|
15437 | }),
|
15438 |
|
15439 | (function(module, exports, __webpack_require__) {
|
15440 |
|
15441 | "use strict";
|
15442 |
|
15443 |
|
15444 | module.exports = {
|
15445 | MAX_LENGTH: 1024 * 64,
|
15446 |
|
15447 |
|
15448 | CHAR_0: '0',
|
15449 | CHAR_9: '9',
|
15450 |
|
15451 |
|
15452 | CHAR_UPPERCASE_A: 'A',
|
15453 | CHAR_LOWERCASE_A: 'a',
|
15454 | CHAR_UPPERCASE_Z: 'Z',
|
15455 | CHAR_LOWERCASE_Z: 'z',
|
15456 |
|
15457 | CHAR_LEFT_PARENTHESES: '(',
|
15458 | CHAR_RIGHT_PARENTHESES: ')',
|
15459 |
|
15460 | CHAR_ASTERISK: '*',
|
15461 |
|
15462 |
|
15463 | CHAR_AMPERSAND: '&',
|
15464 | CHAR_AT: '@',
|
15465 | CHAR_BACKSLASH: '\\',
|
15466 | CHAR_BACKTICK: '`',
|
15467 | CHAR_CARRIAGE_RETURN: '\r',
|
15468 | CHAR_CIRCUMFLEX_ACCENT: '^',
|
15469 | CHAR_COLON: ':',
|
15470 | CHAR_COMMA: ',',
|
15471 | CHAR_DOLLAR: '$',
|
15472 | CHAR_DOT: '.',
|
15473 | CHAR_DOUBLE_QUOTE: '"',
|
15474 | CHAR_EQUAL: '=',
|
15475 | CHAR_EXCLAMATION_MARK: '!',
|
15476 | CHAR_FORM_FEED: '\f',
|
15477 | CHAR_FORWARD_SLASH: '/',
|
15478 | CHAR_HASH: '#',
|
15479 | CHAR_HYPHEN_MINUS: '-',
|
15480 | CHAR_LEFT_ANGLE_BRACKET: '<',
|
15481 | CHAR_LEFT_CURLY_BRACE: '{',
|
15482 | CHAR_LEFT_SQUARE_BRACKET: '[',
|
15483 | CHAR_LINE_FEED: '\n',
|
15484 | CHAR_NO_BREAK_SPACE: '\u00A0',
|
15485 | CHAR_PERCENT: '%',
|
15486 | CHAR_PLUS: '+',
|
15487 | CHAR_QUESTION_MARK: '?',
|
15488 | CHAR_RIGHT_ANGLE_BRACKET: '>',
|
15489 | CHAR_RIGHT_CURLY_BRACE: '}',
|
15490 | CHAR_RIGHT_SQUARE_BRACKET: ']',
|
15491 | CHAR_SEMICOLON: ';',
|
15492 | CHAR_SINGLE_QUOTE: '\'',
|
15493 | CHAR_SPACE: ' ',
|
15494 | CHAR_TAB: '\t',
|
15495 | CHAR_UNDERSCORE: '_',
|
15496 | CHAR_VERTICAL_LINE: '|',
|
15497 | CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF'
|
15498 | };
|
15499 |
|
15500 |
|
15501 | }),
|
15502 |
|
15503 | (function(module, exports, __webpack_require__) {
|
15504 |
|
15505 | "use strict";
|
15506 |
|
15507 |
|
15508 | module.exports = __webpack_require__(76);
|
15509 |
|
15510 |
|
15511 | }),
|
15512 |
|
15513 | (function(module, exports, __webpack_require__) {
|
15514 |
|
15515 | "use strict";
|
15516 |
|
15517 |
|
15518 | const path = __webpack_require__(15);
|
15519 | const scan = __webpack_require__(77);
|
15520 | const parse = __webpack_require__(80);
|
15521 | const utils = __webpack_require__(78);
|
15522 |
|
15523 |
|
15524 |
|
15525 |
|
15526 |
|
15527 |
|
15528 |
|
15529 |
|
15530 |
|
15531 |
|
15532 |
|
15533 |
|
15534 |
|
15535 |
|
15536 |
|
15537 |
|
15538 |
|
15539 |
|
15540 |
|
15541 |
|
15542 |
|
15543 |
|
15544 |
|
15545 | const picomatch = (glob, options, returnState = false) => {
|
15546 | if (Array.isArray(glob)) {
|
15547 | let fns = glob.map(input => picomatch(input, options, returnState));
|
15548 | return str => {
|
15549 | for (let isMatch of fns) {
|
15550 | let state = isMatch(str);
|
15551 | if (state) return state;
|
15552 | }
|
15553 | return false;
|
15554 | };
|
15555 | }
|
15556 |
|
15557 | if (typeof glob !== 'string' || glob === '') {
|
15558 | throw new TypeError('Expected pattern to be a non-empty string');
|
15559 | }
|
15560 |
|
15561 | let opts = options || {};
|
15562 | let posix = utils.isWindows(options);
|
15563 | let regex = picomatch.makeRe(glob, options, false, true);
|
15564 | let state = regex.state;
|
15565 | delete regex.state;
|
15566 |
|
15567 | let isIgnored = () => false;
|
15568 | if (opts.ignore) {
|
15569 | let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
15570 | isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
15571 | }
|
15572 |
|
15573 | const matcher = (input, returnObject = false) => {
|
15574 | let { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
15575 | let result = { glob, state, regex, posix, input, output, match, isMatch };
|
15576 |
|
15577 | if (typeof opts.onResult === 'function') {
|
15578 | opts.onResult(result);
|
15579 | }
|
15580 |
|
15581 | if (isMatch === false) {
|
15582 | result.isMatch = false;
|
15583 | return returnObject ? result : false;
|
15584 | }
|
15585 |
|
15586 | if (isIgnored(input)) {
|
15587 | if (typeof opts.onIgnore === 'function') {
|
15588 | opts.onIgnore(result);
|
15589 | }
|
15590 | result.isMatch = false;
|
15591 | return returnObject ? result : false;
|
15592 | }
|
15593 |
|
15594 | if (typeof opts.onMatch === 'function') {
|
15595 | opts.onMatch(result);
|
15596 | }
|
15597 | return returnObject ? result : true;
|
15598 | };
|
15599 |
|
15600 | if (returnState) {
|
15601 | matcher.state = state;
|
15602 | }
|
15603 |
|
15604 | return matcher;
|
15605 | };
|
15606 |
|
15607 |
|
15608 |
|
15609 |
|
15610 |
|
15611 |
|
15612 |
|
15613 |
|
15614 |
|
15615 |
|
15616 |
|
15617 |
|
15618 |
|
15619 |
|
15620 |
|
15621 |
|
15622 |
|
15623 |
|
15624 | picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
15625 | if (typeof input !== 'string') {
|
15626 | throw new TypeError('Expected input to be a string');
|
15627 | }
|
15628 |
|
15629 | if (input === '') {
|
15630 | return { isMatch: false, output: '' };
|
15631 | }
|
15632 |
|
15633 | let opts = options || {};
|
15634 | let format = opts.format || (posix ? utils.toPosixSlashes : null);
|
15635 | let match = input === glob;
|
15636 | let output = (match && format) ? format(input) : input;
|
15637 |
|
15638 | if (match === false) {
|
15639 | output = format ? format(input) : input;
|
15640 | match = output === glob;
|
15641 | }
|
15642 |
|
15643 | if (match === false || opts.capture === true) {
|
15644 | if (opts.matchBase === true || opts.basename === true) {
|
15645 | match = picomatch.matchBase(input, regex, options, posix);
|
15646 | } else {
|
15647 | match = regex.exec(output);
|
15648 | }
|
15649 | }
|
15650 |
|
15651 | return { isMatch: !!match, match, output };
|
15652 | };
|
15653 |
|
15654 |
|
15655 |
|
15656 |
|
15657 |
|
15658 |
|
15659 |
|
15660 |
|
15661 |
|
15662 |
|
15663 |
|
15664 |
|
15665 |
|
15666 |
|
15667 |
|
15668 | picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
15669 | let regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
15670 | return regex.test(path.basename(input));
|
15671 | };
|
15672 |
|
15673 |
|
15674 |
|
15675 |
|
15676 |
|
15677 |
|
15678 |
|
15679 |
|
15680 |
|
15681 |
|
15682 |
|
15683 |
|
15684 |
|
15685 |
|
15686 |
|
15687 |
|
15688 |
|
15689 |
|
15690 | picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
15691 |
|
15692 |
|
15693 |
|
15694 |
|
15695 |
|
15696 |
|
15697 |
|
15698 |
|
15699 |
|
15700 |
|
15701 |
|
15702 |
|
15703 |
|
15704 |
|
15705 |
|
15706 | picomatch.parse = (glob, options) => parse(glob, options);
|
15707 |
|
15708 |
|
15709 |
|
15710 |
|
15711 |
|
15712 |
|
15713 |
|
15714 |
|
15715 |
|
15716 |
|
15717 |
|
15718 |
|
15719 |
|
15720 |
|
15721 |
|
15722 |
|
15723 |
|
15724 |
|
15725 |
|
15726 |
|
15727 |
|
15728 |
|
15729 |
|
15730 | picomatch.scan = (input, options) => scan(input, options);
|
15731 |
|
15732 |
|
15733 |
|
15734 |
|
15735 |
|
15736 |
|
15737 |
|
15738 |
|
15739 |
|
15740 |
|
15741 |
|
15742 |
|
15743 |
|
15744 |
|
15745 |
|
15746 |
|
15747 |
|
15748 | picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
15749 | if (!input || typeof input !== 'string') {
|
15750 | throw new TypeError('Expected a non-empty string');
|
15751 | }
|
15752 |
|
15753 | let opts = options || {};
|
15754 | let prepend = opts.contains ? '' : '^';
|
15755 | let append = opts.contains ? '' : '$';
|
15756 | let state = { negated: false, fastpaths: true };
|
15757 | let prefix = '';
|
15758 | let output;
|
15759 |
|
15760 | if (input.startsWith('./')) {
|
15761 | input = input.slice(2);
|
15762 | prefix = state.prefix = './';
|
15763 | }
|
15764 |
|
15765 | if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
15766 | output = parse.fastpaths(input, options);
|
15767 | }
|
15768 |
|
15769 | if (output === void 0) {
|
15770 | state = picomatch.parse(input, options);
|
15771 | state.prefix = prefix + (state.prefix || '');
|
15772 | output = state.output;
|
15773 | }
|
15774 |
|
15775 | if (returnOutput === true) {
|
15776 | return output;
|
15777 | }
|
15778 |
|
15779 | let source = `${prepend}(?:${output})${append}`;
|
15780 | if (state && state.negated === true) {
|
15781 | source = `^(?!${source}).*$`;
|
15782 | }
|
15783 |
|
15784 | let regex = picomatch.toRegex(source, options);
|
15785 | if (returnState === true) {
|
15786 | regex.state = state;
|
15787 | }
|
15788 |
|
15789 | return regex;
|
15790 | };
|
15791 |
|
15792 |
|
15793 |
|
15794 |
|
15795 |
|
15796 |
|
15797 |
|
15798 |
|
15799 |
|
15800 |
|
15801 |
|
15802 |
|
15803 |
|
15804 |
|
15805 |
|
15806 |
|
15807 |
|
15808 |
|
15809 | picomatch.toRegex = (source, options) => {
|
15810 | try {
|
15811 | let opts = options || {};
|
15812 | return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
15813 | } catch (err) {
|
15814 | if (options && options.debug === true) throw err;
|
15815 | return /$^/;
|
15816 | }
|
15817 | };
|
15818 |
|
15819 |
|
15820 |
|
15821 |
|
15822 |
|
15823 |
|
15824 | picomatch.constants = __webpack_require__(79);
|
15825 |
|
15826 |
|
15827 |
|
15828 |
|
15829 |
|
15830 | module.exports = picomatch;
|
15831 |
|
15832 |
|
15833 | }),
|
15834 |
|
15835 | (function(module, exports, __webpack_require__) {
|
15836 |
|
15837 | "use strict";
|
15838 |
|
15839 |
|
15840 | const utils = __webpack_require__(78);
|
15841 |
|
15842 | const {
|
15843 | CHAR_ASTERISK,
|
15844 | CHAR_AT,
|
15845 | CHAR_BACKWARD_SLASH,
|
15846 | CHAR_COMMA,
|
15847 | CHAR_DOT,
|
15848 | CHAR_EXCLAMATION_MARK,
|
15849 | CHAR_FORWARD_SLASH,
|
15850 | CHAR_LEFT_CURLY_BRACE,
|
15851 | CHAR_LEFT_PARENTHESES,
|
15852 | CHAR_LEFT_SQUARE_BRACKET,
|
15853 | CHAR_PLUS,
|
15854 | CHAR_QUESTION_MARK,
|
15855 | CHAR_RIGHT_CURLY_BRACE,
|
15856 | CHAR_RIGHT_PARENTHESES,
|
15857 | CHAR_RIGHT_SQUARE_BRACKET
|
15858 | } = __webpack_require__(79);
|
15859 |
|
15860 | const isPathSeparator = code => {
|
15861 | return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
15862 | };
|
15863 |
|
15864 |
|
15865 |
|
15866 |
|
15867 |
|
15868 |
|
15869 |
|
15870 |
|
15871 |
|
15872 |
|
15873 |
|
15874 |
|
15875 |
|
15876 |
|
15877 |
|
15878 |
|
15879 |
|
15880 | module.exports = (input, options) => {
|
15881 | let opts = options || {};
|
15882 | let length = input.length - 1;
|
15883 | let index = -1;
|
15884 | let start = 0;
|
15885 | let lastIndex = 0;
|
15886 | let isGlob = false;
|
15887 | let backslashes = false;
|
15888 | let negated = false;
|
15889 | let braces = 0;
|
15890 | let prev;
|
15891 | let code;
|
15892 |
|
15893 | let braceEscaped = false;
|
15894 |
|
15895 | let eos = () => index >= length;
|
15896 | let advance = () => {
|
15897 | prev = code;
|
15898 | return input.charCodeAt(++index);
|
15899 | };
|
15900 |
|
15901 | while (index < length) {
|
15902 | code = advance();
|
15903 | let next;
|
15904 |
|
15905 | if (code === CHAR_BACKWARD_SLASH) {
|
15906 | backslashes = true;
|
15907 | next = advance();
|
15908 |
|
15909 | if (next === CHAR_LEFT_CURLY_BRACE) {
|
15910 | braceEscaped = true;
|
15911 | }
|
15912 | continue;
|
15913 | }
|
15914 |
|
15915 | if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
15916 | braces++;
|
15917 |
|
15918 | while (!eos() && (next = advance())) {
|
15919 | if (next === CHAR_BACKWARD_SLASH) {
|
15920 | backslashes = true;
|
15921 | next = advance();
|
15922 | continue;
|
15923 | }
|
15924 |
|
15925 | if (next === CHAR_LEFT_CURLY_BRACE) {
|
15926 | braces++;
|
15927 | continue;
|
15928 | }
|
15929 |
|
15930 | if (!braceEscaped && next === CHAR_DOT && (next = advance()) === CHAR_DOT) {
|
15931 | isGlob = true;
|
15932 | break;
|
15933 | }
|
15934 |
|
15935 | if (!braceEscaped && next === CHAR_COMMA) {
|
15936 | isGlob = true;
|
15937 | break;
|
15938 | }
|
15939 |
|
15940 | if (next === CHAR_RIGHT_CURLY_BRACE) {
|
15941 | braces--;
|
15942 | if (braces === 0) {
|
15943 | braceEscaped = false;
|
15944 | break;
|
15945 | }
|
15946 | }
|
15947 | }
|
15948 | }
|
15949 |
|
15950 | if (code === CHAR_FORWARD_SLASH) {
|
15951 | if (prev === CHAR_DOT && index === (start + 1)) {
|
15952 | start += 2;
|
15953 | continue;
|
15954 | }
|
15955 |
|
15956 | lastIndex = index + 1;
|
15957 | continue;
|
15958 | }
|
15959 |
|
15960 | if (code === CHAR_ASTERISK) {
|
15961 | isGlob = true;
|
15962 | break;
|
15963 | }
|
15964 |
|
15965 | if (code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK) {
|
15966 | isGlob = true;
|
15967 | break;
|
15968 | }
|
15969 |
|
15970 | if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
15971 | while (!eos() && (next = advance())) {
|
15972 | if (next === CHAR_BACKWARD_SLASH) {
|
15973 | backslashes = true;
|
15974 | next = advance();
|
15975 | continue;
|
15976 | }
|
15977 |
|
15978 | if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
15979 | isGlob = true;
|
15980 | break;
|
15981 | }
|
15982 | }
|
15983 | }
|
15984 |
|
15985 | let isExtglobChar = code === CHAR_PLUS
|
15986 | || code === CHAR_AT
|
15987 | || code === CHAR_EXCLAMATION_MARK;
|
15988 |
|
15989 | if (isExtglobChar && input.charCodeAt(index + 1) === CHAR_LEFT_PARENTHESES) {
|
15990 | isGlob = true;
|
15991 | break;
|
15992 | }
|
15993 |
|
15994 | if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
15995 | negated = true;
|
15996 | start++;
|
15997 | continue;
|
15998 | }
|
15999 |
|
16000 | if (code === CHAR_LEFT_PARENTHESES) {
|
16001 | while (!eos() && (next = advance())) {
|
16002 | if (next === CHAR_BACKWARD_SLASH) {
|
16003 | backslashes = true;
|
16004 | next = advance();
|
16005 | continue;
|
16006 | }
|
16007 |
|
16008 | if (next === CHAR_RIGHT_PARENTHESES) {
|
16009 | isGlob = true;
|
16010 | break;
|
16011 | }
|
16012 | }
|
16013 | }
|
16014 |
|
16015 | if (isGlob) {
|
16016 | break;
|
16017 | }
|
16018 | }
|
16019 |
|
16020 | let prefix = '';
|
16021 | let orig = input;
|
16022 | let base = input;
|
16023 | let glob = '';
|
16024 |
|
16025 | if (start > 0) {
|
16026 | prefix = input.slice(0, start);
|
16027 | input = input.slice(start);
|
16028 | lastIndex -= start;
|
16029 | }
|
16030 |
|
16031 | if (base && isGlob === true && lastIndex > 0) {
|
16032 | base = input.slice(0, lastIndex);
|
16033 | glob = input.slice(lastIndex);
|
16034 | } else if (isGlob === true) {
|
16035 | base = '';
|
16036 | glob = input;
|
16037 | } else {
|
16038 | base = input;
|
16039 | }
|
16040 |
|
16041 | if (base && base !== '' && base !== '/' && base !== input) {
|
16042 | if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
16043 | base = base.slice(0, -1);
|
16044 | }
|
16045 | }
|
16046 |
|
16047 | if (opts.unescape === true) {
|
16048 | if (glob) glob = utils.removeBackslashes(glob);
|
16049 |
|
16050 | if (base && backslashes === true) {
|
16051 | base = utils.removeBackslashes(base);
|
16052 | }
|
16053 | }
|
16054 |
|
16055 | return { prefix, input: orig, base, glob, negated, isGlob };
|
16056 | };
|
16057 |
|
16058 |
|
16059 | }),
|
16060 |
|
16061 | (function(module, exports, __webpack_require__) {
|
16062 |
|
16063 | "use strict";
|
16064 |
|
16065 |
|
16066 | const path = __webpack_require__(15);
|
16067 | const win32 = process.platform === 'win32';
|
16068 | const {
|
16069 | REGEX_SPECIAL_CHARS,
|
16070 | REGEX_SPECIAL_CHARS_GLOBAL,
|
16071 | REGEX_REMOVE_BACKSLASH
|
16072 | } = __webpack_require__(79);
|
16073 |
|
16074 | exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
16075 | exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
16076 | exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
|
16077 | exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
16078 | exports.toPosixSlashes = str => str.replace(/\\/g, '/');
|
16079 |
|
16080 | exports.removeBackslashes = str => {
|
16081 | return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
16082 | return match === '\\' ? '' : match;
|
16083 | });
|
16084 | }
|
16085 |
|
16086 | exports.supportsLookbehinds = () => {
|
16087 | let segs = process.version.slice(1).split('.');
|
16088 | if (segs.length === 3 && +segs[0] >= 9 || (+segs[0] === 8 && +segs[1] >= 10)) {
|
16089 | return true;
|
16090 | }
|
16091 | return false;
|
16092 | };
|
16093 |
|
16094 | exports.isWindows = options => {
|
16095 | if (options && typeof options.windows === 'boolean') {
|
16096 | return options.windows;
|
16097 | }
|
16098 | return win32 === true || path.sep === '\\';
|
16099 | };
|
16100 |
|
16101 | exports.escapeLast = (input, char, lastIdx) => {
|
16102 | let idx = input.lastIndexOf(char, lastIdx);
|
16103 | if (idx === -1) return input;
|
16104 | if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
|
16105 | return input.slice(0, idx) + '\\' + input.slice(idx);
|
16106 | };
|
16107 |
|
16108 |
|
16109 | }),
|
16110 |
|
16111 | (function(module, exports, __webpack_require__) {
|
16112 |
|
16113 | "use strict";
|
16114 |
|
16115 |
|
16116 | const path = __webpack_require__(15);
|
16117 | const WIN_SLASH = '\\\\/';
|
16118 | const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
16119 |
|
16120 |
|
16121 |
|
16122 |
|
16123 |
|
16124 | const DOT_LITERAL = '\\.';
|
16125 | const PLUS_LITERAL = '\\+';
|
16126 | const QMARK_LITERAL = '\\?';
|
16127 | const SLASH_LITERAL = '\\/';
|
16128 | const ONE_CHAR = '(?=.)';
|
16129 | const QMARK = '[^/]';
|
16130 | const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
16131 | const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
16132 | const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
16133 | const NO_DOT = `(?!${DOT_LITERAL})`;
|
16134 | const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
16135 | const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
16136 | const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
16137 | const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
16138 | const STAR = `${QMARK}*?`;
|
16139 |
|
16140 | const POSIX_CHARS = {
|
16141 | DOT_LITERAL,
|
16142 | PLUS_LITERAL,
|
16143 | QMARK_LITERAL,
|
16144 | SLASH_LITERAL,
|
16145 | ONE_CHAR,
|
16146 | QMARK,
|
16147 | END_ANCHOR,
|
16148 | DOTS_SLASH,
|
16149 | NO_DOT,
|
16150 | NO_DOTS,
|
16151 | NO_DOT_SLASH,
|
16152 | NO_DOTS_SLASH,
|
16153 | QMARK_NO_DOT,
|
16154 | STAR,
|
16155 | START_ANCHOR
|
16156 | };
|
16157 |
|
16158 |
|
16159 |
|
16160 |
|
16161 |
|
16162 | const WINDOWS_CHARS = {
|
16163 | ...POSIX_CHARS,
|
16164 |
|
16165 | SLASH_LITERAL: `[${WIN_SLASH}]`,
|
16166 | QMARK: WIN_NO_SLASH,
|
16167 | STAR: `${WIN_NO_SLASH}*?`,
|
16168 | DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
16169 | NO_DOT: `(?!${DOT_LITERAL})`,
|
16170 | NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
16171 | NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
16172 | NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
16173 | QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
16174 | START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
16175 | END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
16176 | };
|
16177 |
|
16178 |
|
16179 |
|
16180 |
|
16181 |
|
16182 | const POSIX_REGEX_SOURCE = {
|
16183 | alnum: 'a-zA-Z0-9',
|
16184 | alpha: 'a-zA-Z',
|
16185 | ascii: '\\x00-\\x7F',
|
16186 | blank: ' \\t',
|
16187 | cntrl: '\\x00-\\x1F\\x7F',
|
16188 | digit: '0-9',
|
16189 | graph: '\\x21-\\x7E',
|
16190 | lower: 'a-z',
|
16191 | print: '\\x20-\\x7E ',
|
16192 | punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
16193 | space: ' \\t\\r\\n\\v\\f',
|
16194 | upper: 'A-Z',
|
16195 | word: 'A-Za-z0-9_',
|
16196 | xdigit: 'A-Fa-f0-9'
|
16197 | };
|
16198 |
|
16199 | module.exports = {
|
16200 | MAX_LENGTH: 1024 * 64,
|
16201 | POSIX_REGEX_SOURCE,
|
16202 |
|
16203 |
|
16204 | REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
16205 | REGEX_NON_SPECIAL_CHAR: /^[^@![\].,$*+?^{}()|\\/]+/,
|
16206 | REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
16207 | REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
16208 | REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
16209 | REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
16210 |
|
16211 |
|
16212 | REPLACEMENTS: {
|
16213 | '***': '*',
|
16214 | '**/**': '**',
|
16215 | '**/**/**': '**'
|
16216 | },
|
16217 |
|
16218 |
|
16219 | CHAR_0: 48,
|
16220 | CHAR_9: 57,
|
16221 |
|
16222 |
|
16223 | CHAR_UPPERCASE_A: 65,
|
16224 | CHAR_LOWERCASE_A: 97,
|
16225 | CHAR_UPPERCASE_Z: 90,
|
16226 | CHAR_LOWERCASE_Z: 122,
|
16227 |
|
16228 | CHAR_LEFT_PARENTHESES: 40,
|
16229 | CHAR_RIGHT_PARENTHESES: 41,
|
16230 |
|
16231 | CHAR_ASTERISK: 42,
|
16232 |
|
16233 |
|
16234 | CHAR_AMPERSAND: 38,
|
16235 | CHAR_AT: 64,
|
16236 | CHAR_BACKWARD_SLASH: 92,
|
16237 | CHAR_CARRIAGE_RETURN: 13,
|
16238 | CHAR_CIRCUMFLEX_ACCENT: 94,
|
16239 | CHAR_COLON: 58,
|
16240 | CHAR_COMMA: 44,
|
16241 | CHAR_DOT: 46,
|
16242 | CHAR_DOUBLE_QUOTE: 34,
|
16243 | CHAR_EQUAL: 61,
|
16244 | CHAR_EXCLAMATION_MARK: 33,
|
16245 | CHAR_FORM_FEED: 12,
|
16246 | CHAR_FORWARD_SLASH: 47,
|
16247 | CHAR_GRAVE_ACCENT: 96,
|
16248 | CHAR_HASH: 35,
|
16249 | CHAR_HYPHEN_MINUS: 45,
|
16250 | CHAR_LEFT_ANGLE_BRACKET: 60,
|
16251 | CHAR_LEFT_CURLY_BRACE: 123,
|
16252 | CHAR_LEFT_SQUARE_BRACKET: 91,
|
16253 | CHAR_LINE_FEED: 10,
|
16254 | CHAR_NO_BREAK_SPACE: 160,
|
16255 | CHAR_PERCENT: 37,
|
16256 | CHAR_PLUS: 43,
|
16257 | CHAR_QUESTION_MARK: 63,
|
16258 | CHAR_RIGHT_ANGLE_BRACKET: 62,
|
16259 | CHAR_RIGHT_CURLY_BRACE: 125,
|
16260 | CHAR_RIGHT_SQUARE_BRACKET: 93,
|
16261 | CHAR_SEMICOLON: 59,
|
16262 | CHAR_SINGLE_QUOTE: 39,
|
16263 | CHAR_SPACE: 32,
|
16264 | CHAR_TAB: 9,
|
16265 | CHAR_UNDERSCORE: 95,
|
16266 | CHAR_VERTICAL_LINE: 124,
|
16267 | CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
16268 |
|
16269 | SEP: path.sep,
|
16270 |
|
16271 | |
16272 |
|
16273 |
|
16274 |
|
16275 | extglobChars(chars) {
|
16276 | return {
|
16277 | '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
|
16278 | '?': { type: 'qmark', open: '(?:', close: ')?' },
|
16279 | '+': { type: 'plus', open: '(?:', close: ')+' },
|
16280 | '*': { type: 'star', open: '(?:', close: ')*' },
|
16281 | '@': { type: 'at', open: '(?:', close: ')' }
|
16282 | };
|
16283 | },
|
16284 |
|
16285 | |
16286 |
|
16287 |
|
16288 |
|
16289 | globChars(win32) {
|
16290 | return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
16291 | }
|
16292 | };
|
16293 |
|
16294 |
|
16295 | }),
|
16296 |
|
16297 | (function(module, exports, __webpack_require__) {
|
16298 |
|
16299 | "use strict";
|
16300 |
|
16301 |
|
16302 | const utils = __webpack_require__(78);
|
16303 | const constants = __webpack_require__(79);
|
16304 |
|
16305 |
|
16306 |
|
16307 |
|
16308 |
|
16309 | const {
|
16310 | MAX_LENGTH,
|
16311 | POSIX_REGEX_SOURCE,
|
16312 | REGEX_NON_SPECIAL_CHAR,
|
16313 | REGEX_SPECIAL_CHARS_BACKREF,
|
16314 | REPLACEMENTS
|
16315 | } = constants;
|
16316 |
|
16317 |
|
16318 |
|
16319 |
|
16320 |
|
16321 | const expandRange = (args, options) => {
|
16322 | if (typeof options.expandRange === 'function') {
|
16323 | return options.expandRange(...args, options);
|
16324 | }
|
16325 |
|
16326 | args.sort();
|
16327 | let value = `[${args.join('-')}]`;
|
16328 |
|
16329 | try {
|
16330 |
|
16331 | new RegExp(value);
|
16332 | } catch (ex) {
|
16333 | return args.map(v => utils.escapeRegex(v)).join('..');
|
16334 | }
|
16335 |
|
16336 | return value;
|
16337 | };
|
16338 |
|
16339 | const negate = state => {
|
16340 | let count = 1;
|
16341 |
|
16342 | while (state.peek() === '!' && (state.peek(2) !== '(' || state.peek(3) === '?')) {
|
16343 | state.advance();
|
16344 | state.start++;
|
16345 | count++;
|
16346 | }
|
16347 |
|
16348 | if (count % 2 === 0) {
|
16349 | return false;
|
16350 | }
|
16351 |
|
16352 | state.negated = true;
|
16353 | state.start++;
|
16354 | return true;
|
16355 | };
|
16356 |
|
16357 |
|
16358 |
|
16359 |
|
16360 |
|
16361 | const syntaxError = (type, char) => {
|
16362 | return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
16363 | };
|
16364 |
|
16365 |
|
16366 |
|
16367 |
|
16368 |
|
16369 |
|
16370 |
|
16371 |
|
16372 | const parse = (input, options) => {
|
16373 | if (typeof input !== 'string') {
|
16374 | throw new TypeError('Expected a string');
|
16375 | }
|
16376 |
|
16377 | input = REPLACEMENTS[input] || input;
|
16378 |
|
16379 | let opts = { ...options };
|
16380 | let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
16381 | let len = input.length;
|
16382 | if (len > max) {
|
16383 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
16384 | }
|
16385 |
|
16386 | let bos = { type: 'bos', value: '', output: opts.prepend || '' };
|
16387 | let tokens = [bos];
|
16388 |
|
16389 | let capture = opts.capture ? '' : '?:';
|
16390 | let win32 = utils.isWindows(options);
|
16391 |
|
16392 |
|
16393 | const PLATFORM_CHARS = constants.globChars(win32);
|
16394 | const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
16395 |
|
16396 | const {
|
16397 | DOT_LITERAL,
|
16398 | PLUS_LITERAL,
|
16399 | SLASH_LITERAL,
|
16400 | ONE_CHAR,
|
16401 | DOTS_SLASH,
|
16402 | NO_DOT,
|
16403 | NO_DOT_SLASH,
|
16404 | NO_DOTS_SLASH,
|
16405 | QMARK,
|
16406 | QMARK_NO_DOT,
|
16407 | STAR,
|
16408 | START_ANCHOR
|
16409 | } = PLATFORM_CHARS;
|
16410 |
|
16411 | const globstar = (opts) => {
|
16412 | return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
16413 | };
|
16414 |
|
16415 | let nodot = opts.dot ? '' : NO_DOT;
|
16416 | let star = opts.bash === true ? globstar(opts) : STAR;
|
16417 | let qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
16418 |
|
16419 | if (opts.capture) {
|
16420 | star = `(${star})`;
|
16421 | }
|
16422 |
|
16423 |
|
16424 | if (typeof opts.noext === 'boolean') {
|
16425 | opts.noextglob = opts.noext;
|
16426 | }
|
16427 |
|
16428 | let state = {
|
16429 | index: -1,
|
16430 | start: 0,
|
16431 | consumed: '',
|
16432 | output: '',
|
16433 | backtrack: false,
|
16434 | brackets: 0,
|
16435 | braces: 0,
|
16436 | parens: 0,
|
16437 | quotes: 0,
|
16438 | tokens
|
16439 | };
|
16440 |
|
16441 | let extglobs = [];
|
16442 | let stack = [];
|
16443 | let prev = bos;
|
16444 | let value;
|
16445 |
|
16446 | |
16447 |
|
16448 |
|
16449 |
|
16450 | const eos = () => state.index === len - 1;
|
16451 | const peek = state.peek = (n = 1) => input[state.index + n];
|
16452 | const advance = state.advance = () => input[++state.index];
|
16453 | const append = token => {
|
16454 | state.output += token.output != null ? token.output : token.value;
|
16455 | state.consumed += token.value || '';
|
16456 | };
|
16457 |
|
16458 | const increment = type => {
|
16459 | state[type]++;
|
16460 | stack.push(type);
|
16461 | };
|
16462 |
|
16463 | const decrement = type => {
|
16464 | state[type]--;
|
16465 | stack.pop();
|
16466 | };
|
16467 |
|
16468 | |
16469 |
|
16470 |
|
16471 |
|
16472 |
|
16473 |
|
16474 |
|
16475 |
|
16476 | const push = tok => {
|
16477 | if (prev.type === 'globstar') {
|
16478 | let isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
16479 | let isExtglob = extglobs.length && (tok.type === 'pipe' || tok.type === 'paren');
|
16480 | if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
16481 | state.output = state.output.slice(0, -prev.output.length);
|
16482 | prev.type = 'star';
|
16483 | prev.value = '*';
|
16484 | prev.output = star;
|
16485 | state.output += prev.output;
|
16486 | }
|
16487 | }
|
16488 |
|
16489 | if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) {
|
16490 | extglobs[extglobs.length - 1].inner += tok.value;
|
16491 | }
|
16492 |
|
16493 | if (tok.value || tok.output) append(tok);
|
16494 | if (prev && prev.type === 'text' && tok.type === 'text') {
|
16495 | prev.value += tok.value;
|
16496 | return;
|
16497 | }
|
16498 |
|
16499 | tok.prev = prev;
|
16500 | tokens.push(tok);
|
16501 | prev = tok;
|
16502 | };
|
16503 |
|
16504 | const extglobOpen = (type, value) => {
|
16505 | let token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
|
16506 |
|
16507 | token.prev = prev;
|
16508 | token.parens = state.parens;
|
16509 | token.output = state.output;
|
16510 | let output = (opts.capture ? '(' : '') + token.open;
|
16511 |
|
16512 | push({ type, value, output: state.output ? '' : ONE_CHAR });
|
16513 | push({ type: 'paren', extglob: true, value: advance(), output });
|
16514 | increment('parens');
|
16515 | extglobs.push(token);
|
16516 | };
|
16517 |
|
16518 | const extglobClose = token => {
|
16519 | let output = token.close + (opts.capture ? ')' : '');
|
16520 |
|
16521 | if (token.type === 'negate') {
|
16522 | let extglobStar = star;
|
16523 |
|
16524 | if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
16525 | extglobStar = globstar(opts);
|
16526 | }
|
16527 |
|
16528 | if (extglobStar !== star || eos() || /^\)+$/.test(input.slice(state.index + 1))) {
|
16529 | output = token.close = ')$))' + extglobStar;
|
16530 | }
|
16531 |
|
16532 | if (token.prev.type === 'bos' && eos()) {
|
16533 | state.negatedExtglob = true;
|
16534 | }
|
16535 | }
|
16536 |
|
16537 | push({ type: 'paren', extglob: true, value, output });
|
16538 | decrement('parens');
|
16539 | };
|
16540 |
|
16541 | if (opts.fastpaths !== false && !/(^[*!]|[/{[()\]}"])/.test(input)) {
|
16542 | let backslashes = false;
|
16543 |
|
16544 | let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
16545 | if (first === '\\') {
|
16546 | backslashes = true;
|
16547 | return m;
|
16548 | }
|
16549 |
|
16550 | if (first === '?') {
|
16551 | if (esc) {
|
16552 | return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
16553 | }
|
16554 | if (index === 0) {
|
16555 | return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
16556 | }
|
16557 | return QMARK.repeat(chars.length);
|
16558 | }
|
16559 |
|
16560 | if (first === '.') {
|
16561 | return DOT_LITERAL.repeat(chars.length);
|
16562 | }
|
16563 |
|
16564 | if (first === '*') {
|
16565 | if (esc) {
|
16566 | return esc + first + (rest ? star : '');
|
16567 | }
|
16568 | return star;
|
16569 | }
|
16570 | return esc ? m : '\\' + m;
|
16571 | });
|
16572 |
|
16573 | if (backslashes === true) {
|
16574 | if (opts.unescape === true) {
|
16575 | output = output.replace(/\\/g, '');
|
16576 | } else {
|
16577 | output = output.replace(/\\+/g, m => {
|
16578 | return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
|
16579 | });
|
16580 | }
|
16581 | }
|
16582 |
|
16583 | state.output = output;
|
16584 | return state;
|
16585 | }
|
16586 |
|
16587 | |
16588 |
|
16589 |
|
16590 |
|
16591 | while (!eos()) {
|
16592 | value = advance();
|
16593 |
|
16594 | if (value === '\u0000') {
|
16595 | continue;
|
16596 | }
|
16597 |
|
16598 | |
16599 |
|
16600 |
|
16601 |
|
16602 | if (value === '\\') {
|
16603 | let next = peek();
|
16604 |
|
16605 | if (next === '/' && opts.bash !== true) {
|
16606 | continue;
|
16607 | }
|
16608 |
|
16609 | if (next === '.' || next === ';') {
|
16610 | continue;
|
16611 | }
|
16612 |
|
16613 | if (!next) {
|
16614 | value += '\\';
|
16615 | push({ type: 'text', value });
|
16616 | continue;
|
16617 | }
|
16618 |
|
16619 |
|
16620 | let match = /^\\+/.exec(input.slice(state.index + 1));
|
16621 | let slashes = 0;
|
16622 |
|
16623 | if (match && match[0].length > 2) {
|
16624 | slashes = match[0].length;
|
16625 | state.index += slashes;
|
16626 | if (slashes % 2 !== 0) {
|
16627 | value += '\\';
|
16628 | }
|
16629 | }
|
16630 |
|
16631 | if (opts.unescape === true) {
|
16632 | value = advance() || '';
|
16633 | } else {
|
16634 | value += advance() || '';
|
16635 | }
|
16636 |
|
16637 | if (state.brackets === 0) {
|
16638 | push({ type: 'text', value });
|
16639 | continue;
|
16640 | }
|
16641 | }
|
16642 |
|
16643 | |
16644 |
|
16645 |
|
16646 |
|
16647 |
|
16648 | if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
|
16649 | if (opts.posix !== false && value === ':') {
|
16650 | let inner = prev.value.slice(1);
|
16651 | if (inner.includes('[')) {
|
16652 | prev.posix = true;
|
16653 |
|
16654 | if (inner.includes(':')) {
|
16655 | let idx = prev.value.lastIndexOf('[');
|
16656 | let pre = prev.value.slice(0, idx);
|
16657 | let rest = prev.value.slice(idx + 2);
|
16658 | let posix = POSIX_REGEX_SOURCE[rest];
|
16659 | if (posix) {
|
16660 | prev.value = pre + posix;
|
16661 | state.backtrack = true;
|
16662 | advance();
|
16663 |
|
16664 | if (!bos.output && tokens.indexOf(prev) === 1) {
|
16665 | bos.output = ONE_CHAR;
|
16666 | }
|
16667 | continue;
|
16668 | }
|
16669 | }
|
16670 | }
|
16671 | }
|
16672 |
|
16673 | if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
|
16674 | value = '\\' + value;
|
16675 | }
|
16676 |
|
16677 | if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
|
16678 | value = '\\' + value;
|
16679 | }
|
16680 |
|
16681 | if (opts.posix === true && value === '!' && prev.value === '[') {
|
16682 | value = '^';
|
16683 | }
|
16684 |
|
16685 | prev.value += value;
|
16686 | append({ value });
|
16687 | continue;
|
16688 | }
|
16689 |
|
16690 | |
16691 |
|
16692 |
|
16693 |
|
16694 |
|
16695 | if (state.quotes === 1 && value !== '"') {
|
16696 | value = utils.escapeRegex(value);
|
16697 | prev.value += value;
|
16698 | append({ value });
|
16699 | continue;
|
16700 | }
|
16701 |
|
16702 | |
16703 |
|
16704 |
|
16705 |
|
16706 | if (value === '"') {
|
16707 | state.quotes = state.quotes === 1 ? 0 : 1;
|
16708 | if (opts.keepQuotes === true) {
|
16709 | push({ type: 'text', value });
|
16710 | }
|
16711 | continue;
|
16712 | }
|
16713 |
|
16714 | |
16715 |
|
16716 |
|
16717 |
|
16718 | if (value === '(') {
|
16719 | push({ type: 'paren', value });
|
16720 | increment('parens');
|
16721 | continue;
|
16722 | }
|
16723 |
|
16724 | if (value === ')') {
|
16725 | if (state.parens === 0 && opts.strictBrackets === true) {
|
16726 | throw new SyntaxError(syntaxError('opening', '('));
|
16727 | }
|
16728 |
|
16729 | let extglob = extglobs[extglobs.length - 1];
|
16730 | if (extglob && state.parens === extglob.parens + 1) {
|
16731 | extglobClose(extglobs.pop());
|
16732 | continue;
|
16733 | }
|
16734 |
|
16735 | push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
|
16736 | decrement('parens');
|
16737 | continue;
|
16738 | }
|
16739 |
|
16740 | |
16741 |
|
16742 |
|
16743 |
|
16744 | if (value === '[') {
|
16745 | if (opts.nobracket === true || !input.slice(state.index + 1).includes(']')) {
|
16746 | if (opts.nobracket !== true && opts.strictBrackets === true) {
|
16747 | throw new SyntaxError(syntaxError('closing', ']'));
|
16748 | }
|
16749 |
|
16750 | value = '\\' + value;
|
16751 | } else {
|
16752 | increment('brackets');
|
16753 | }
|
16754 |
|
16755 | push({ type: 'bracket', value });
|
16756 | continue;
|
16757 | }
|
16758 |
|
16759 | if (value === ']') {
|
16760 | if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
|
16761 | push({ type: 'text', value, output: '\\' + value });
|
16762 | continue;
|
16763 | }
|
16764 |
|
16765 | if (state.brackets === 0) {
|
16766 | if (opts.strictBrackets === true) {
|
16767 | throw new SyntaxError(syntaxError('opening', '['));
|
16768 | }
|
16769 |
|
16770 | push({ type: 'text', value, output: '\\' + value });
|
16771 | continue;
|
16772 | }
|
16773 |
|
16774 | decrement('brackets');
|
16775 |
|
16776 | let prevValue = prev.value.slice(1);
|
16777 | if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
16778 | value = '/' + value;
|
16779 | }
|
16780 |
|
16781 | prev.value += value;
|
16782 | append({ value });
|
16783 |
|
16784 |
|
16785 |
|
16786 | if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
16787 | continue;
|
16788 | }
|
16789 |
|
16790 | let escaped = utils.escapeRegex(prev.value);
|
16791 | state.output = state.output.slice(0, -prev.value.length);
|
16792 |
|
16793 |
|
16794 |
|
16795 | if (opts.literalBrackets === true) {
|
16796 | state.output += escaped;
|
16797 | prev.value = escaped;
|
16798 | continue;
|
16799 | }
|
16800 |
|
16801 |
|
16802 | prev.value = `(${capture}${escaped}|${prev.value})`;
|
16803 | state.output += prev.value;
|
16804 | continue;
|
16805 | }
|
16806 |
|
16807 | |
16808 |
|
16809 |
|
16810 |
|
16811 | if (value === '{' && opts.nobrace !== true) {
|
16812 | push({ type: 'brace', value, output: '(' });
|
16813 | increment('braces');
|
16814 | continue;
|
16815 | }
|
16816 |
|
16817 | if (value === '}') {
|
16818 | if (opts.nobrace === true || state.braces === 0) {
|
16819 | push({ type: 'text', value, output: '\\' + value });
|
16820 | continue;
|
16821 | }
|
16822 |
|
16823 | let output = ')';
|
16824 |
|
16825 | if (state.dots === true) {
|
16826 | let arr = tokens.slice();
|
16827 | let range = [];
|
16828 |
|
16829 | for (let i = arr.length - 1; i >= 0; i--) {
|
16830 | tokens.pop();
|
16831 | if (arr[i].type === 'brace') {
|
16832 | break;
|
16833 | }
|
16834 | if (arr[i].type !== 'dots') {
|
16835 | range.unshift(arr[i].value);
|
16836 | }
|
16837 | }
|
16838 |
|
16839 | output = expandRange(range, opts);
|
16840 | state.backtrack = true;
|
16841 | }
|
16842 |
|
16843 | push({ type: 'brace', value, output });
|
16844 | decrement('braces');
|
16845 | continue;
|
16846 | }
|
16847 |
|
16848 | |
16849 |
|
16850 |
|
16851 |
|
16852 | if (value === '|') {
|
16853 | if (extglobs.length > 0) {
|
16854 | extglobs[extglobs.length - 1].conditions++;
|
16855 | }
|
16856 | push({ type: 'text', value });
|
16857 | continue;
|
16858 | }
|
16859 |
|
16860 | |
16861 |
|
16862 |
|
16863 |
|
16864 | if (value === ',') {
|
16865 | let output = value;
|
16866 |
|
16867 | if (state.braces > 0 && stack[stack.length - 1] === 'braces') {
|
16868 | output = '|';
|
16869 | }
|
16870 |
|
16871 | push({ type: 'comma', value, output });
|
16872 | continue;
|
16873 | }
|
16874 |
|
16875 | |
16876 |
|
16877 |
|
16878 |
|
16879 | if (value === '/') {
|
16880 |
|
16881 |
|
16882 |
|
16883 |
|
16884 | if (prev.type === 'dot' && state.index === 1) {
|
16885 | state.start = state.index + 1;
|
16886 | state.consumed = '';
|
16887 | state.output = '';
|
16888 | tokens.pop();
|
16889 | prev = bos;
|
16890 | continue;
|
16891 | }
|
16892 |
|
16893 | push({ type: 'slash', value, output: SLASH_LITERAL });
|
16894 | continue;
|
16895 | }
|
16896 |
|
16897 | |
16898 |
|
16899 |
|
16900 |
|
16901 | if (value === '.') {
|
16902 | if (state.braces > 0 && prev.type === 'dot') {
|
16903 | if (prev.value === '.') prev.output = DOT_LITERAL;
|
16904 | prev.type = 'dots';
|
16905 | prev.output += value;
|
16906 | prev.value += value;
|
16907 | state.dots = true;
|
16908 | continue;
|
16909 | }
|
16910 |
|
16911 | push({ type: 'dot', value, output: DOT_LITERAL });
|
16912 | continue;
|
16913 | }
|
16914 |
|
16915 | |
16916 |
|
16917 |
|
16918 |
|
16919 | if (value === '?') {
|
16920 | if (prev && prev.type === 'paren') {
|
16921 | let next = peek();
|
16922 | let output = value;
|
16923 |
|
16924 | if (next === '<' && !utils.supportsLookbehinds()) {
|
16925 | throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
16926 | }
|
16927 |
|
16928 | if (prev.value === '(' && !/[!=<:]/.test(next) || (next === '<' && !/[!=]/.test(peek(2)))) {
|
16929 | output = '\\' + value;
|
16930 | }
|
16931 |
|
16932 | push({ type: 'text', value, output });
|
16933 | continue;
|
16934 | }
|
16935 |
|
16936 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
16937 | extglobOpen('qmark', value);
|
16938 | continue;
|
16939 | }
|
16940 |
|
16941 | if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
|
16942 | push({ type: 'qmark', value, output: QMARK_NO_DOT });
|
16943 | continue;
|
16944 | }
|
16945 |
|
16946 | push({ type: 'qmark', value, output: QMARK });
|
16947 | continue;
|
16948 | }
|
16949 |
|
16950 | |
16951 |
|
16952 |
|
16953 |
|
16954 | if (value === '!') {
|
16955 | if (opts.noextglob !== true && peek() === '(') {
|
16956 | if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
|
16957 | extglobOpen('negate', value);
|
16958 | continue;
|
16959 | }
|
16960 | }
|
16961 |
|
16962 | if (opts.nonegate !== true && state.index === 0) {
|
16963 | negate(state);
|
16964 | continue;
|
16965 | }
|
16966 | }
|
16967 |
|
16968 | |
16969 |
|
16970 |
|
16971 |
|
16972 | if (value === '+') {
|
16973 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
16974 | extglobOpen('plus', value);
|
16975 | continue;
|
16976 | }
|
16977 |
|
16978 | if (prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) {
|
16979 | let output = prev.extglob === true ? '\\' + value : value;
|
16980 | push({ type: 'plus', value, output });
|
16981 | continue;
|
16982 | }
|
16983 |
|
16984 |
|
16985 | if (state.parens > 0 && opts.regex !== false) {
|
16986 | push({ type: 'plus', value });
|
16987 | continue;
|
16988 | }
|
16989 |
|
16990 | push({ type: 'plus', value: PLUS_LITERAL });
|
16991 | continue;
|
16992 | }
|
16993 |
|
16994 | |
16995 |
|
16996 |
|
16997 |
|
16998 | if (value === '@') {
|
16999 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
17000 | push({ type: 'at', value, output: '' });
|
17001 | continue;
|
17002 | }
|
17003 |
|
17004 | push({ type: 'text', value });
|
17005 | continue;
|
17006 | }
|
17007 |
|
17008 | |
17009 |
|
17010 |
|
17011 |
|
17012 | if (value !== '*') {
|
17013 | if (value === '$' || value === '^') {
|
17014 | value = '\\' + value;
|
17015 | }
|
17016 |
|
17017 | let match = REGEX_NON_SPECIAL_CHAR.exec(input.slice(state.index + 1));
|
17018 | if (match) {
|
17019 | value += match[0];
|
17020 | state.index += match[0].length;
|
17021 | }
|
17022 |
|
17023 | push({ type: 'text', value });
|
17024 | continue;
|
17025 | }
|
17026 |
|
17027 | |
17028 |
|
17029 |
|
17030 |
|
17031 | if (prev && (prev.type === 'globstar' || prev.star === true)) {
|
17032 | prev.type = 'star';
|
17033 | prev.star = true;
|
17034 | prev.value += value;
|
17035 | prev.output = star;
|
17036 | state.backtrack = true;
|
17037 | state.consumed += value;
|
17038 | continue;
|
17039 | }
|
17040 |
|
17041 | if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
17042 | extglobOpen('star', value);
|
17043 | continue;
|
17044 | }
|
17045 |
|
17046 | if (prev.type === 'star') {
|
17047 | if (opts.noglobstar === true) {
|
17048 | state.consumed += value;
|
17049 | continue;
|
17050 | }
|
17051 |
|
17052 | let prior = prev.prev;
|
17053 | let before = prior.prev;
|
17054 | let isStart = prior.type === 'slash' || prior.type === 'bos';
|
17055 | let afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
17056 |
|
17057 | if (opts.bash === true && (!isStart || (!eos() && peek() !== '/'))) {
|
17058 | push({ type: 'star', value, output: '' });
|
17059 | continue;
|
17060 | }
|
17061 |
|
17062 | let isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
17063 | let isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
17064 | if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
17065 | push({ type: 'star', value, output: '' });
|
17066 | continue;
|
17067 | }
|
17068 |
|
17069 |
|
17070 | while (input.slice(state.index + 1, state.index + 4) === '/**') {
|
17071 | let after = input[state.index + 4];
|
17072 | if (after && after !== '/') {
|
17073 | break;
|
17074 | }
|
17075 | state.consumed += '/**';
|
17076 | state.index += 3;
|
17077 | }
|
17078 |
|
17079 | if (prior.type === 'bos' && eos()) {
|
17080 | prev.type = 'globstar';
|
17081 | prev.value += value;
|
17082 | prev.output = globstar(opts);
|
17083 | state.output = prev.output;
|
17084 | state.consumed += value;
|
17085 | continue;
|
17086 | }
|
17087 |
|
17088 | if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
|
17089 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
17090 | prior.output = '(?:' + prior.output;
|
17091 |
|
17092 | prev.type = 'globstar';
|
17093 | prev.output = globstar(opts) + '|$)';
|
17094 | prev.value += value;
|
17095 |
|
17096 | state.output += prior.output + prev.output;
|
17097 | state.consumed += value;
|
17098 | continue;
|
17099 | }
|
17100 |
|
17101 | let next = peek();
|
17102 | if (prior.type === 'slash' && prior.prev.type !== 'bos' && next === '/') {
|
17103 | let end = peek(2) !== void 0 ? '|$' : '';
|
17104 |
|
17105 | state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
17106 | prior.output = '(?:' + prior.output;
|
17107 |
|
17108 | prev.type = 'globstar';
|
17109 | prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
17110 | prev.value += value;
|
17111 |
|
17112 | state.output += prior.output + prev.output;
|
17113 | state.consumed += value + advance();
|
17114 |
|
17115 | push({ type: 'slash', value, output: '' });
|
17116 | continue;
|
17117 | }
|
17118 |
|
17119 | if (prior.type === 'bos' && next === '/') {
|
17120 | prev.type = 'globstar';
|
17121 | prev.value += value;
|
17122 | prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
17123 | state.output = prev.output;
|
17124 | state.consumed += value + advance();
|
17125 | push({ type: 'slash', value, output: '' });
|
17126 | continue;
|
17127 | }
|
17128 |
|
17129 |
|
17130 | state.output = state.output.slice(0, -prev.output.length);
|
17131 |
|
17132 |
|
17133 | prev.type = 'globstar';
|
17134 | prev.output = globstar(opts);
|
17135 | prev.value += value;
|
17136 |
|
17137 |
|
17138 | state.output += prev.output;
|
17139 | state.consumed += value;
|
17140 | continue;
|
17141 | }
|
17142 |
|
17143 | let token = { type: 'star', value, output: star };
|
17144 |
|
17145 | if (opts.bash === true) {
|
17146 | token.output = '.*?';
|
17147 | if (prev.type === 'bos' || prev.type === 'slash') {
|
17148 | token.output = nodot + token.output;
|
17149 | }
|
17150 | push(token);
|
17151 | continue;
|
17152 | }
|
17153 |
|
17154 | if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
|
17155 | token.output = value;
|
17156 | push(token);
|
17157 | continue;
|
17158 | }
|
17159 |
|
17160 | if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
|
17161 | if (prev.type === 'dot') {
|
17162 | state.output += NO_DOT_SLASH;
|
17163 | prev.output += NO_DOT_SLASH;
|
17164 |
|
17165 | } else if (opts.dot === true) {
|
17166 | state.output += NO_DOTS_SLASH;
|
17167 | prev.output += NO_DOTS_SLASH;
|
17168 |
|
17169 | } else {
|
17170 | state.output += nodot;
|
17171 | prev.output += nodot;
|
17172 | }
|
17173 |
|
17174 | if (peek() !== '*') {
|
17175 | state.output += ONE_CHAR;
|
17176 | prev.output += ONE_CHAR;
|
17177 | }
|
17178 | }
|
17179 |
|
17180 | push(token);
|
17181 | }
|
17182 |
|
17183 | while (state.brackets > 0) {
|
17184 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
17185 | state.output = utils.escapeLast(state.output, '[');
|
17186 | decrement('brackets');
|
17187 | }
|
17188 |
|
17189 | while (state.parens > 0) {
|
17190 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
17191 | state.output = utils.escapeLast(state.output, '(');
|
17192 | decrement('parens');
|
17193 | }
|
17194 |
|
17195 | while (state.braces > 0) {
|
17196 | if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
17197 | state.output = utils.escapeLast(state.output, '{');
|
17198 | decrement('braces');
|
17199 | }
|
17200 |
|
17201 | if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
|
17202 | push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
|
17203 | }
|
17204 |
|
17205 |
|
17206 | if (state.backtrack === true) {
|
17207 | state.output = '';
|
17208 |
|
17209 | for (let token of state.tokens) {
|
17210 | state.output += token.output != null ? token.output : token.value;
|
17211 |
|
17212 | if (token.suffix) {
|
17213 | state.output += token.suffix;
|
17214 | }
|
17215 | }
|
17216 | }
|
17217 |
|
17218 | return state;
|
17219 | };
|
17220 |
|
17221 |
|
17222 |
|
17223 |
|
17224 |
|
17225 |
|
17226 |
|
17227 | parse.fastpaths = (input, options) => {
|
17228 | let opts = { ...options };
|
17229 | let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
17230 | let len = input.length;
|
17231 | if (len > max) {
|
17232 | throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
17233 | }
|
17234 |
|
17235 | input = REPLACEMENTS[input] || input;
|
17236 | let win32 = utils.isWindows(options);
|
17237 |
|
17238 |
|
17239 | const {
|
17240 | DOT_LITERAL,
|
17241 | SLASH_LITERAL,
|
17242 | ONE_CHAR,
|
17243 | DOTS_SLASH,
|
17244 | NO_DOT,
|
17245 | NO_DOTS,
|
17246 | NO_DOTS_SLASH,
|
17247 | STAR,
|
17248 | START_ANCHOR
|
17249 | } = constants.globChars(win32);
|
17250 |
|
17251 | let capture = opts.capture ? '' : '?:';
|
17252 | let star = opts.bash === true ? '.*?' : STAR;
|
17253 | let nodot = opts.dot ? NO_DOTS : NO_DOT;
|
17254 | let slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
17255 |
|
17256 | if (opts.capture) {
|
17257 | star = `(${star})`;
|
17258 | }
|
17259 |
|
17260 | const globstar = (opts) => {
|
17261 | return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
17262 | };
|
17263 |
|
17264 | const create = str => {
|
17265 | switch (str) {
|
17266 | case '*':
|
17267 | return `${nodot}${ONE_CHAR}${star}`;
|
17268 |
|
17269 | case '.*':
|
17270 | return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
17271 |
|
17272 | case '*.*':
|
17273 | return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
17274 |
|
17275 | case '*/*':
|
17276 | return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
17277 |
|
17278 | case '**':
|
17279 | return nodot + globstar(opts);
|
17280 |
|
17281 | case '**/*':
|
17282 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
17283 |
|
17284 | case '**/*.*':
|
17285 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
17286 |
|
17287 | case '**/.*':
|
17288 | return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
17289 |
|
17290 | default: {
|
17291 | let match = /^(.*?)\.(\w+)$/.exec(str);
|
17292 | if (!match) return;
|
17293 |
|
17294 | let source = create(match[1], options);
|
17295 | if (!source) return;
|
17296 |
|
17297 | return source + DOT_LITERAL + match[2];
|
17298 | }
|
17299 | }
|
17300 | };
|
17301 |
|
17302 | let output = create(input);
|
17303 | if (output && opts.strictSlashes !== true) {
|
17304 | output += `${SLASH_LITERAL}?`;
|
17305 | }
|
17306 |
|
17307 | return output;
|
17308 | };
|
17309 |
|
17310 | module.exports = parse;
|
17311 |
|
17312 |
|
17313 | }),
|
17314 |
|
17315 | (function(module, exports, __webpack_require__) {
|
17316 |
|
17317 | "use strict";
|
17318 |
|
17319 | Object.defineProperty(exports, "__esModule", { value: true });
|
17320 | const merge2 = __webpack_require__(82);
|
17321 | function merge(streams) {
|
17322 | const mergedStream = merge2(streams);
|
17323 | streams.forEach((stream) => {
|
17324 | stream.once('error', (err) => mergedStream.emit('error', err));
|
17325 | });
|
17326 | return mergedStream;
|
17327 | }
|
17328 | exports.merge = merge;
|
17329 |
|
17330 |
|
17331 | }),
|
17332 |
|
17333 | (function(module, exports, __webpack_require__) {
|
17334 |
|
17335 | "use strict";
|
17336 |
|
17337 |
|
17338 |
|
17339 |
|
17340 |
|
17341 |
|
17342 |
|
17343 |
|
17344 | const Stream = __webpack_require__(83)
|
17345 | const PassThrough = Stream.PassThrough
|
17346 | const slice = Array.prototype.slice
|
17347 |
|
17348 | module.exports = merge2
|
17349 |
|
17350 | function merge2 () {
|
17351 | const streamsQueue = []
|
17352 | let merging = false
|
17353 | const args = slice.call(arguments)
|
17354 | let options = args[args.length - 1]
|
17355 |
|
17356 | if (options && !Array.isArray(options) && options.pipe == null) args.pop()
|
17357 | else options = {}
|
17358 |
|
17359 | const doEnd = options.end !== false
|
17360 | if (options.objectMode == null) options.objectMode = true
|
17361 | if (options.highWaterMark == null) options.highWaterMark = 64 * 1024
|
17362 | const mergedStream = PassThrough(options)
|
17363 |
|
17364 | function addStream () {
|
17365 | for (let i = 0, len = arguments.length; i < len; i++) {
|
17366 | streamsQueue.push(pauseStreams(arguments[i], options))
|
17367 | }
|
17368 | mergeStream()
|
17369 | return this
|
17370 | }
|
17371 |
|
17372 | function mergeStream () {
|
17373 | if (merging) return
|
17374 | merging = true
|
17375 |
|
17376 | let streams = streamsQueue.shift()
|
17377 | if (!streams) {
|
17378 | process.nextTick(endStream)
|
17379 | return
|
17380 | }
|
17381 | if (!Array.isArray(streams)) streams = [streams]
|
17382 |
|
17383 | let pipesCount = streams.length + 1
|
17384 |
|
17385 | function next () {
|
17386 | if (--pipesCount > 0) return
|
17387 | merging = false
|
17388 | mergeStream()
|
17389 | }
|
17390 |
|
17391 | function pipe (stream) {
|
17392 | function onend () {
|
17393 | stream.removeListener('merge2UnpipeEnd', onend)
|
17394 | stream.removeListener('end', onend)
|
17395 | next()
|
17396 | }
|
17397 |
|
17398 | if (stream._readableState.endEmitted) return next()
|
17399 |
|
17400 | stream.on('merge2UnpipeEnd', onend)
|
17401 | stream.on('end', onend)
|
17402 | stream.pipe(mergedStream, { end: false })
|
17403 |
|
17404 | stream.resume()
|
17405 | }
|
17406 |
|
17407 | for (let i = 0; i < streams.length; i++) pipe(streams[i])
|
17408 |
|
17409 | next()
|
17410 | }
|
17411 |
|
17412 | function endStream () {
|
17413 | merging = false
|
17414 |
|
17415 | mergedStream.emit('queueDrain')
|
17416 | return doEnd && mergedStream.end()
|
17417 | }
|
17418 |
|
17419 | mergedStream.setMaxListeners(0)
|
17420 | mergedStream.add = addStream
|
17421 | mergedStream.on('unpipe', function (stream) {
|
17422 | stream.emit('merge2UnpipeEnd')
|
17423 | })
|
17424 |
|
17425 | if (args.length) addStream.apply(null, args)
|
17426 | return mergedStream
|
17427 | }
|
17428 |
|
17429 |
|
17430 | function pauseStreams (streams, options) {
|
17431 | if (!Array.isArray(streams)) {
|
17432 |
|
17433 | if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options))
|
17434 | if (!streams._readableState || !streams.pause || !streams.pipe) {
|
17435 | throw new Error('Only readable stream can be merged.')
|
17436 | }
|
17437 | streams.pause()
|
17438 | } else {
|
17439 | for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options)
|
17440 | }
|
17441 | return streams
|
17442 | }
|
17443 |
|
17444 |
|
17445 | }),
|
17446 |
|
17447 | (function(module, exports) {
|
17448 |
|
17449 | module.exports = require("stream");
|
17450 |
|
17451 | }),
|
17452 |
|
17453 | (function(module, exports, __webpack_require__) {
|
17454 |
|
17455 | "use strict";
|
17456 |
|
17457 | Object.defineProperty(exports, "__esModule", { value: true });
|
17458 | const stream_1 = __webpack_require__(85);
|
17459 | const provider_1 = __webpack_require__(112);
|
17460 | class ProviderAsync extends provider_1.default {
|
17461 | constructor() {
|
17462 | super(...arguments);
|
17463 | this._reader = new stream_1.default(this._settings);
|
17464 | }
|
17465 | read(task) {
|
17466 | const root = this._getRootDirectory(task);
|
17467 | const options = this._getReaderOptions(task);
|
17468 | const entries = [];
|
17469 | return new Promise((resolve, reject) => {
|
17470 | const stream = this.api(root, task, options);
|
17471 | stream.once('error', reject);
|
17472 | stream.on('data', (entry) => entries.push(options.transform(entry)));
|
17473 | stream.once('end', () => resolve(entries));
|
17474 | });
|
17475 | }
|
17476 | api(root, task, options) {
|
17477 | if (task.dynamic) {
|
17478 | return this._reader.dynamic(root, options);
|
17479 | }
|
17480 | return this._reader.static(task.patterns, options);
|
17481 | }
|
17482 | }
|
17483 | exports.default = ProviderAsync;
|
17484 |
|
17485 |
|
17486 | }),
|
17487 |
|
17488 | (function(module, exports, __webpack_require__) {
|
17489 |
|
17490 | "use strict";
|
17491 |
|
17492 | Object.defineProperty(exports, "__esModule", { value: true });
|
17493 | const stream_1 = __webpack_require__(83);
|
17494 | const fsStat = __webpack_require__(86);
|
17495 | const fsWalk = __webpack_require__(91);
|
17496 | const reader_1 = __webpack_require__(111);
|
17497 | class ReaderStream extends reader_1.default {
|
17498 | constructor() {
|
17499 | super(...arguments);
|
17500 | this._walkStream = fsWalk.walkStream;
|
17501 | this._stat = fsStat.stat;
|
17502 | }
|
17503 | dynamic(root, options) {
|
17504 | return this._walkStream(root, options);
|
17505 | }
|
17506 | static(patterns, options) {
|
17507 | const filepaths = patterns.map(this._getFullEntryPath, this);
|
17508 | const stream = new stream_1.PassThrough({ objectMode: true });
|
17509 | stream._write = (index, _enc, done) => {
|
17510 | return this._getEntry(filepaths[index], patterns[index], options)
|
17511 | .then((entry) => {
|
17512 | if (entry !== null && options.entryFilter(entry)) {
|
17513 | stream.push(entry);
|
17514 | }
|
17515 | if (index === filepaths.length - 1) {
|
17516 | stream.end();
|
17517 | }
|
17518 | done();
|
17519 | })
|
17520 | .catch(done);
|
17521 | };
|
17522 | for (let i = 0; i < filepaths.length; i++) {
|
17523 | stream.write(i);
|
17524 | }
|
17525 | return stream;
|
17526 | }
|
17527 | _getEntry(filepath, pattern, options) {
|
17528 | return this._getStat(filepath)
|
17529 | .then((stats) => this._makeEntry(stats, pattern))
|
17530 | .catch((error) => {
|
17531 | if (options.errorFilter(error)) {
|
17532 | return null;
|
17533 | }
|
17534 | throw error;
|
17535 | });
|
17536 | }
|
17537 | _getStat(filepath) {
|
17538 | return new Promise((resolve, reject) => {
|
17539 | this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
17540 | error ? reject(error) : resolve(stats);
|
17541 | });
|
17542 | });
|
17543 | }
|
17544 | }
|
17545 | exports.default = ReaderStream;
|
17546 |
|
17547 |
|
17548 | }),
|
17549 |
|
17550 | (function(module, exports, __webpack_require__) {
|
17551 |
|
17552 | "use strict";
|
17553 |
|
17554 | Object.defineProperty(exports, "__esModule", { value: true });
|
17555 | const async = __webpack_require__(87);
|
17556 | const sync = __webpack_require__(88);
|
17557 | const settings_1 = __webpack_require__(89);
|
17558 | exports.Settings = settings_1.default;
|
17559 | function stat(path, optionsOrSettingsOrCallback, callback) {
|
17560 | if (typeof optionsOrSettingsOrCallback === 'function') {
|
17561 | return async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
17562 | }
|
17563 | async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
17564 | }
|
17565 | exports.stat = stat;
|
17566 | function statSync(path, optionsOrSettings) {
|
17567 | const settings = getSettings(optionsOrSettings);
|
17568 | return sync.read(path, settings);
|
17569 | }
|
17570 | exports.statSync = statSync;
|
17571 | function getSettings(settingsOrOptions = {}) {
|
17572 | if (settingsOrOptions instanceof settings_1.default) {
|
17573 | return settingsOrOptions;
|
17574 | }
|
17575 | return new settings_1.default(settingsOrOptions);
|
17576 | }
|
17577 |
|
17578 |
|
17579 | }),
|
17580 |
|
17581 | (function(module, exports, __webpack_require__) {
|
17582 |
|
17583 | "use strict";
|
17584 |
|
17585 | Object.defineProperty(exports, "__esModule", { value: true });
|
17586 | function read(path, settings, callback) {
|
17587 | settings.fs.lstat(path, (lstatError, lstat) => {
|
17588 | if (lstatError) {
|
17589 | return callFailureCallback(callback, lstatError);
|
17590 | }
|
17591 | if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
17592 | return callSuccessCallback(callback, lstat);
|
17593 | }
|
17594 | settings.fs.stat(path, (statError, stat) => {
|
17595 | if (statError) {
|
17596 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
17597 | return callFailureCallback(callback, statError);
|
17598 | }
|
17599 | return callSuccessCallback(callback, lstat);
|
17600 | }
|
17601 | if (settings.markSymbolicLink) {
|
17602 | stat.isSymbolicLink = () => true;
|
17603 | }
|
17604 | callSuccessCallback(callback, stat);
|
17605 | });
|
17606 | });
|
17607 | }
|
17608 | exports.read = read;
|
17609 | function callFailureCallback(callback, error) {
|
17610 | callback(error);
|
17611 | }
|
17612 | function callSuccessCallback(callback, result) {
|
17613 | callback(null, result);
|
17614 | }
|
17615 |
|
17616 |
|
17617 | }),
|
17618 |
|
17619 | (function(module, exports, __webpack_require__) {
|
17620 |
|
17621 | "use strict";
|
17622 |
|
17623 | Object.defineProperty(exports, "__esModule", { value: true });
|
17624 | function read(path, settings) {
|
17625 | const lstat = settings.fs.lstatSync(path);
|
17626 | if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
17627 | return lstat;
|
17628 | }
|
17629 | try {
|
17630 | const stat = settings.fs.statSync(path);
|
17631 | if (settings.markSymbolicLink) {
|
17632 | stat.isSymbolicLink = () => true;
|
17633 | }
|
17634 | return stat;
|
17635 | }
|
17636 | catch (error) {
|
17637 | if (!settings.throwErrorOnBrokenSymbolicLink) {
|
17638 | return lstat;
|
17639 | }
|
17640 | throw error;
|
17641 | }
|
17642 | }
|
17643 | exports.read = read;
|
17644 |
|
17645 |
|
17646 | }),
|
17647 |
|
17648 | (function(module, exports, __webpack_require__) {
|
17649 |
|
17650 | "use strict";
|
17651 |
|
17652 | Object.defineProperty(exports, "__esModule", { value: true });
|
17653 | const fs = __webpack_require__(90);
|
17654 | class Settings {
|
17655 | constructor(_options = {}) {
|
17656 | this._options = _options;
|
17657 | this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
17658 | this.fs = fs.createFileSystemAdapter(this._options.fs);
|
17659 | this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
17660 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
17661 | }
|
17662 | _getValue(option, value) {
|
17663 | return option === undefined ? value : option;
|
17664 | }
|
17665 | }
|
17666 | exports.default = Settings;
|
17667 |
|
17668 |
|
17669 | }),
|
17670 |
|
17671 | (function(module, exports, __webpack_require__) {
|
17672 |
|
17673 | "use strict";
|
17674 |
|
17675 | Object.defineProperty(exports, "__esModule", { value: true });
|
17676 | const fs = __webpack_require__(36);
|
17677 | exports.FILE_SYSTEM_ADAPTER = {
|
17678 | lstat: fs.lstat,
|
17679 | stat: fs.stat,
|
17680 | lstatSync: fs.lstatSync,
|
17681 | statSync: fs.statSync
|
17682 | };
|
17683 | function createFileSystemAdapter(fsMethods) {
|
17684 | if (!fsMethods) {
|
17685 | return exports.FILE_SYSTEM_ADAPTER;
|
17686 | }
|
17687 | return Object.assign({}, exports.FILE_SYSTEM_ADAPTER, fsMethods);
|
17688 | }
|
17689 | exports.createFileSystemAdapter = createFileSystemAdapter;
|
17690 |
|
17691 |
|
17692 | }),
|
17693 |
|
17694 | (function(module, exports, __webpack_require__) {
|
17695 |
|
17696 | "use strict";
|
17697 |
|
17698 | Object.defineProperty(exports, "__esModule", { value: true });
|
17699 | const async_1 = __webpack_require__(92);
|
17700 | const stream_1 = __webpack_require__(107);
|
17701 | const sync_1 = __webpack_require__(108);
|
17702 | const settings_1 = __webpack_require__(110);
|
17703 | exports.Settings = settings_1.default;
|
17704 | function walk(dir, optionsOrSettingsOrCallback, callback) {
|
17705 | if (typeof optionsOrSettingsOrCallback === 'function') {
|
17706 | return new async_1.default(dir, getSettings()).read(optionsOrSettingsOrCallback);
|
17707 | }
|
17708 | new async_1.default(dir, getSettings(optionsOrSettingsOrCallback)).read(callback);
|
17709 | }
|
17710 | exports.walk = walk;
|
17711 | function walkSync(dir, optionsOrSettings) {
|
17712 | const settings = getSettings(optionsOrSettings);
|
17713 | const provider = new sync_1.default(dir, settings);
|
17714 | return provider.read();
|
17715 | }
|
17716 | exports.walkSync = walkSync;
|
17717 | function walkStream(dir, optionsOrSettings) {
|
17718 | const settings = getSettings(optionsOrSettings);
|
17719 | const provider = new stream_1.default(dir, settings);
|
17720 | return provider.read();
|
17721 | }
|
17722 | exports.walkStream = walkStream;
|
17723 | function getSettings(settingsOrOptions = {}) {
|
17724 | if (settingsOrOptions instanceof settings_1.default) {
|
17725 | return settingsOrOptions;
|
17726 | }
|
17727 | return new settings_1.default(settingsOrOptions);
|
17728 | }
|
17729 |
|
17730 |
|
17731 | }),
|
17732 |
|
17733 | (function(module, exports, __webpack_require__) {
|
17734 |
|
17735 | "use strict";
|
17736 |
|
17737 | Object.defineProperty(exports, "__esModule", { value: true });
|
17738 | const async_1 = __webpack_require__(93);
|
17739 | class AsyncProvider {
|
17740 | constructor(_root, _settings) {
|
17741 | this._root = _root;
|
17742 | this._settings = _settings;
|
17743 | this._reader = new async_1.default(this._root, this._settings);
|
17744 | this._storage = new Set();
|
17745 | }
|
17746 | read(callback) {
|
17747 | this._reader.onError((error) => {
|
17748 | callFailureCallback(callback, error);
|
17749 | });
|
17750 | this._reader.onEntry((entry) => {
|
17751 | this._storage.add(entry);
|
17752 | });
|
17753 | this._reader.onEnd(() => {
|
17754 | callSuccessCallback(callback, Array.from(this._storage));
|
17755 | });
|
17756 | this._reader.read();
|
17757 | }
|
17758 | }
|
17759 | exports.default = AsyncProvider;
|
17760 | function callFailureCallback(callback, error) {
|
17761 | callback(error);
|
17762 | }
|
17763 | function callSuccessCallback(callback, entries) {
|
17764 | callback(null, entries);
|
17765 | }
|
17766 |
|
17767 |
|
17768 | }),
|
17769 |
|
17770 | (function(module, exports, __webpack_require__) {
|
17771 |
|
17772 | "use strict";
|
17773 |
|
17774 | Object.defineProperty(exports, "__esModule", { value: true });
|
17775 | const events_1 = __webpack_require__(45);
|
17776 | const fsScandir = __webpack_require__(94);
|
17777 | const fastq = __webpack_require__(103);
|
17778 | const common = __webpack_require__(105);
|
17779 | const reader_1 = __webpack_require__(106);
|
17780 | class AsyncReader extends reader_1.default {
|
17781 | constructor(_root, _settings) {
|
17782 | super(_root, _settings);
|
17783 | this._settings = _settings;
|
17784 | this._scandir = fsScandir.scandir;
|
17785 | this._emitter = new events_1.EventEmitter();
|
17786 | this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
|
17787 | this._isFatalError = false;
|
17788 | this._isDestroyed = false;
|
17789 | this._queue.drain = () => {
|
17790 | if (!this._isFatalError) {
|
17791 | this._emitter.emit('end');
|
17792 | }
|
17793 | };
|
17794 | }
|
17795 | read() {
|
17796 | this._isFatalError = false;
|
17797 | this._isDestroyed = false;
|
17798 | setImmediate(() => {
|
17799 | this._pushToQueue(this._root, this._settings.basePath);
|
17800 | });
|
17801 | return this._emitter;
|
17802 | }
|
17803 | destroy() {
|
17804 | if (this._isDestroyed) {
|
17805 | throw new Error('The reader is already destroyed');
|
17806 | }
|
17807 | this._isDestroyed = true;
|
17808 | this._queue.killAndDrain();
|
17809 | }
|
17810 | onEntry(callback) {
|
17811 | this._emitter.on('entry', callback);
|
17812 | }
|
17813 | onError(callback) {
|
17814 | this._emitter.once('error', callback);
|
17815 | }
|
17816 | onEnd(callback) {
|
17817 | this._emitter.once('end', callback);
|
17818 | }
|
17819 | _pushToQueue(dir, base) {
|
17820 | const queueItem = { dir, base };
|
17821 | this._queue.push(queueItem, (error) => {
|
17822 | if (error) {
|
17823 | this._handleError(error);
|
17824 | }
|
17825 | });
|
17826 | }
|
17827 | _worker(item, done) {
|
17828 | this._scandir(item.dir, this._settings.fsScandirSettings, (error, entries) => {
|
17829 | if (error) {
|
17830 | return done(error, undefined);
|
17831 | }
|
17832 | for (const entry of entries) {
|
17833 | this._handleEntry(entry, item.base);
|
17834 | }
|
17835 | done(null, undefined);
|
17836 | });
|
17837 | }
|
17838 | _handleError(error) {
|
17839 | if (!common.isFatalError(this._settings, error)) {
|
17840 | return;
|
17841 | }
|
17842 | this._isFatalError = true;
|
17843 | this._isDestroyed = true;
|
17844 | this._emitter.emit('error', error);
|
17845 | }
|
17846 | _handleEntry(entry, base) {
|
17847 | if (this._isDestroyed || this._isFatalError) {
|
17848 | return;
|
17849 | }
|
17850 | const fullpath = entry.path;
|
17851 | if (base !== undefined) {
|
17852 | entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
17853 | }
|
17854 | if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
17855 | this._emitEntry(entry);
|
17856 | }
|
17857 | if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
17858 | this._pushToQueue(fullpath, entry.path);
|
17859 | }
|
17860 | }
|
17861 | _emitEntry(entry) {
|
17862 | this._emitter.emit('entry', entry);
|
17863 | }
|
17864 | }
|
17865 | exports.default = AsyncReader;
|
17866 |
|
17867 |
|
17868 | }),
|
17869 |
|
17870 | (function(module, exports, __webpack_require__) {
|
17871 |
|
17872 | "use strict";
|
17873 |
|
17874 | Object.defineProperty(exports, "__esModule", { value: true });
|
17875 | const async = __webpack_require__(95);
|
17876 | const sync = __webpack_require__(100);
|
17877 | const settings_1 = __webpack_require__(101);
|
17878 | exports.Settings = settings_1.default;
|
17879 | function scandir(path, optionsOrSettingsOrCallback, callback) {
|
17880 | if (typeof optionsOrSettingsOrCallback === 'function') {
|
17881 | return async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
17882 | }
|
17883 | async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
17884 | }
|
17885 | exports.scandir = scandir;
|
17886 | function scandirSync(path, optionsOrSettings) {
|
17887 | const settings = getSettings(optionsOrSettings);
|
17888 | return sync.read(path, settings);
|
17889 | }
|
17890 | exports.scandirSync = scandirSync;
|
17891 | function getSettings(settingsOrOptions = {}) {
|
17892 | if (settingsOrOptions instanceof settings_1.default) {
|
17893 | return settingsOrOptions;
|
17894 | }
|
17895 | return new settings_1.default(settingsOrOptions);
|
17896 | }
|
17897 |
|
17898 |
|
17899 | }),
|
17900 |
|
17901 | (function(module, exports, __webpack_require__) {
|
17902 |
|
17903 | "use strict";
|
17904 |
|
17905 | Object.defineProperty(exports, "__esModule", { value: true });
|
17906 | const fsStat = __webpack_require__(86);
|
17907 | const rpl = __webpack_require__(96);
|
17908 | const constants_1 = __webpack_require__(97);
|
17909 | const utils = __webpack_require__(98);
|
17910 | function read(dir, settings, callback) {
|
17911 | if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
17912 | return readdirWithFileTypes(dir, settings, callback);
|
17913 | }
|
17914 | return readdir(dir, settings, callback);
|
17915 | }
|
17916 | exports.read = read;
|
17917 | function readdirWithFileTypes(dir, settings, callback) {
|
17918 | settings.fs.readdir(dir, { withFileTypes: true }, (readdirError, dirents) => {
|
17919 | if (readdirError) {
|
17920 | return callFailureCallback(callback, readdirError);
|
17921 | }
|
17922 | const entries = dirents.map((dirent) => ({
|
17923 | dirent,
|
17924 | name: dirent.name,
|
17925 | path: `${dir}${settings.pathSegmentSeparator}${dirent.name}`
|
17926 | }));
|
17927 | if (!settings.followSymbolicLinks) {
|
17928 | return callSuccessCallback(callback, entries);
|
17929 | }
|
17930 | const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
|
17931 | rpl(tasks, (rplError, rplEntries) => {
|
17932 | if (rplError) {
|
17933 | return callFailureCallback(callback, rplError);
|
17934 | }
|
17935 | callSuccessCallback(callback, rplEntries);
|
17936 | });
|
17937 | });
|
17938 | }
|
17939 | exports.readdirWithFileTypes = readdirWithFileTypes;
|
17940 | function makeRplTaskEntry(entry, settings) {
|
17941 | return (done) => {
|
17942 | if (!entry.dirent.isSymbolicLink()) {
|
17943 | return done(null, entry);
|
17944 | }
|
17945 | settings.fs.stat(entry.path, (statError, stats) => {
|
17946 | if (statError) {
|
17947 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
17948 | return done(statError);
|
17949 | }
|
17950 | return done(null, entry);
|
17951 | }
|
17952 | entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
17953 | return done(null, entry);
|
17954 | });
|
17955 | };
|
17956 | }
|
17957 | function readdir(dir, settings, callback) {
|
17958 | settings.fs.readdir(dir, (readdirError, names) => {
|
17959 | if (readdirError) {
|
17960 | return callFailureCallback(callback, readdirError);
|
17961 | }
|
17962 | const filepaths = names.map((name) => `${dir}${settings.pathSegmentSeparator}${name}`);
|
17963 | const tasks = filepaths.map((filepath) => {
|
17964 | return (done) => fsStat.stat(filepath, settings.fsStatSettings, done);
|
17965 | });
|
17966 | rpl(tasks, (rplError, results) => {
|
17967 | if (rplError) {
|
17968 | return callFailureCallback(callback, rplError);
|
17969 | }
|
17970 | const entries = [];
|
17971 | for (let index = 0; index < names.length; index++) {
|
17972 | const name = names[index];
|
17973 | const stats = results[index];
|
17974 | const entry = {
|
17975 | name,
|
17976 | path: filepaths[index],
|
17977 | dirent: utils.fs.createDirentFromStats(name, stats)
|
17978 | };
|
17979 | if (settings.stats) {
|
17980 | entry.stats = stats;
|
17981 | }
|
17982 | entries.push(entry);
|
17983 | }
|
17984 | callSuccessCallback(callback, entries);
|
17985 | });
|
17986 | });
|
17987 | }
|
17988 | exports.readdir = readdir;
|
17989 | function callFailureCallback(callback, error) {
|
17990 | callback(error);
|
17991 | }
|
17992 | function callSuccessCallback(callback, result) {
|
17993 | callback(null, result);
|
17994 | }
|
17995 |
|
17996 |
|
17997 | }),
|
17998 |
|
17999 | (function(module, exports) {
|
18000 |
|
18001 | module.exports = runParallel
|
18002 |
|
18003 | function runParallel (tasks, cb) {
|
18004 | var results, pending, keys
|
18005 | var isSync = true
|
18006 |
|
18007 | if (Array.isArray(tasks)) {
|
18008 | results = []
|
18009 | pending = tasks.length
|
18010 | } else {
|
18011 | keys = Object.keys(tasks)
|
18012 | results = {}
|
18013 | pending = keys.length
|
18014 | }
|
18015 |
|
18016 | function done (err) {
|
18017 | function end () {
|
18018 | if (cb) cb(err, results)
|
18019 | cb = null
|
18020 | }
|
18021 | if (isSync) process.nextTick(end)
|
18022 | else end()
|
18023 | }
|
18024 |
|
18025 | function each (i, err, result) {
|
18026 | results[i] = result
|
18027 | if (--pending === 0 || err) {
|
18028 | done(err)
|
18029 | }
|
18030 | }
|
18031 |
|
18032 | if (!pending) {
|
18033 |
|
18034 | done(null)
|
18035 | } else if (keys) {
|
18036 |
|
18037 | keys.forEach(function (key) {
|
18038 | tasks[key](function (err, result) { each(key, err, result) })
|
18039 | })
|
18040 | } else {
|
18041 |
|
18042 | tasks.forEach(function (task, i) {
|
18043 | task(function (err, result) { each(i, err, result) })
|
18044 | })
|
18045 | }
|
18046 |
|
18047 | isSync = false
|
18048 | }
|
18049 |
|
18050 |
|
18051 | }),
|
18052 |
|
18053 | (function(module, exports, __webpack_require__) {
|
18054 |
|
18055 | "use strict";
|
18056 |
|
18057 | Object.defineProperty(exports, "__esModule", { value: true });
|
18058 | const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.');
|
18059 | const MAJOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
|
18060 | const MINOR_VERSION = parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
|
18061 |
|
18062 |
|
18063 |
|
18064 | exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = MAJOR_VERSION > 10 || (MAJOR_VERSION === 10 && MINOR_VERSION >= 10);
|
18065 |
|
18066 |
|
18067 | }),
|
18068 |
|
18069 | (function(module, exports, __webpack_require__) {
|
18070 |
|
18071 | "use strict";
|
18072 |
|
18073 | Object.defineProperty(exports, "__esModule", { value: true });
|
18074 | const fs = __webpack_require__(99);
|
18075 | exports.fs = fs;
|
18076 |
|
18077 |
|
18078 | }),
|
18079 |
|
18080 | (function(module, exports, __webpack_require__) {
|
18081 |
|
18082 | "use strict";
|
18083 |
|
18084 | Object.defineProperty(exports, "__esModule", { value: true });
|
18085 | class DirentFromStats {
|
18086 | constructor(name, stats) {
|
18087 | this.name = name;
|
18088 | this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
18089 | this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
18090 | this.isDirectory = stats.isDirectory.bind(stats);
|
18091 | this.isFIFO = stats.isFIFO.bind(stats);
|
18092 | this.isFile = stats.isFile.bind(stats);
|
18093 | this.isSocket = stats.isSocket.bind(stats);
|
18094 | this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
18095 | }
|
18096 | }
|
18097 | function createDirentFromStats(name, stats) {
|
18098 | return new DirentFromStats(name, stats);
|
18099 | }
|
18100 | exports.createDirentFromStats = createDirentFromStats;
|
18101 |
|
18102 |
|
18103 | }),
|
18104 |
|
18105 | (function(module, exports, __webpack_require__) {
|
18106 |
|
18107 | "use strict";
|
18108 |
|
18109 | Object.defineProperty(exports, "__esModule", { value: true });
|
18110 | const fsStat = __webpack_require__(86);
|
18111 | const constants_1 = __webpack_require__(97);
|
18112 | const utils = __webpack_require__(98);
|
18113 | function read(dir, settings) {
|
18114 | if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
18115 | return readdirWithFileTypes(dir, settings);
|
18116 | }
|
18117 | return readdir(dir, settings);
|
18118 | }
|
18119 | exports.read = read;
|
18120 | function readdirWithFileTypes(dir, settings) {
|
18121 | const dirents = settings.fs.readdirSync(dir, { withFileTypes: true });
|
18122 | return dirents.map((dirent) => {
|
18123 | const entry = {
|
18124 | dirent,
|
18125 | name: dirent.name,
|
18126 | path: `${dir}${settings.pathSegmentSeparator}${dirent.name}`
|
18127 | };
|
18128 | if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
|
18129 | try {
|
18130 | const stats = settings.fs.statSync(entry.path);
|
18131 | entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
18132 | }
|
18133 | catch (error) {
|
18134 | if (settings.throwErrorOnBrokenSymbolicLink) {
|
18135 | throw error;
|
18136 | }
|
18137 | }
|
18138 | }
|
18139 | return entry;
|
18140 | });
|
18141 | }
|
18142 | exports.readdirWithFileTypes = readdirWithFileTypes;
|
18143 | function readdir(dir, settings) {
|
18144 | const names = settings.fs.readdirSync(dir);
|
18145 | return names.map((name) => {
|
18146 | const entryPath = `${dir}${settings.pathSegmentSeparator}${name}`;
|
18147 | const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
|
18148 | const entry = {
|
18149 | name,
|
18150 | path: entryPath,
|
18151 | dirent: utils.fs.createDirentFromStats(name, stats)
|
18152 | };
|
18153 | if (settings.stats) {
|
18154 | entry.stats = stats;
|
18155 | }
|
18156 | return entry;
|
18157 | });
|
18158 | }
|
18159 | exports.readdir = readdir;
|
18160 |
|
18161 |
|
18162 | }),
|
18163 |
|
18164 | (function(module, exports, __webpack_require__) {
|
18165 |
|
18166 | "use strict";
|
18167 |
|
18168 | Object.defineProperty(exports, "__esModule", { value: true });
|
18169 | const path = __webpack_require__(15);
|
18170 | const fsStat = __webpack_require__(86);
|
18171 | const fs = __webpack_require__(102);
|
18172 | class Settings {
|
18173 | constructor(_options = {}) {
|
18174 | this._options = _options;
|
18175 | this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
18176 | this.fs = fs.createFileSystemAdapter(this._options.fs);
|
18177 | this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
18178 | this.stats = this._getValue(this._options.stats, false);
|
18179 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
18180 | this.fsStatSettings = new fsStat.Settings({
|
18181 | followSymbolicLink: this.followSymbolicLinks,
|
18182 | fs: this.fs,
|
18183 | throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
|
18184 | });
|
18185 | }
|
18186 | _getValue(option, value) {
|
18187 | return option === undefined ? value : option;
|
18188 | }
|
18189 | }
|
18190 | exports.default = Settings;
|
18191 |
|
18192 |
|
18193 | }),
|
18194 |
|
18195 | (function(module, exports, __webpack_require__) {
|
18196 |
|
18197 | "use strict";
|
18198 |
|
18199 | Object.defineProperty(exports, "__esModule", { value: true });
|
18200 | const fs = __webpack_require__(36);
|
18201 | exports.FILE_SYSTEM_ADAPTER = {
|
18202 | lstat: fs.lstat,
|
18203 | stat: fs.stat,
|
18204 | lstatSync: fs.lstatSync,
|
18205 | statSync: fs.statSync,
|
18206 | readdir: fs.readdir,
|
18207 | readdirSync: fs.readdirSync
|
18208 | };
|
18209 | function createFileSystemAdapter(fsMethods) {
|
18210 | if (!fsMethods) {
|
18211 | return exports.FILE_SYSTEM_ADAPTER;
|
18212 | }
|
18213 | return Object.assign({}, exports.FILE_SYSTEM_ADAPTER, fsMethods);
|
18214 | }
|
18215 | exports.createFileSystemAdapter = createFileSystemAdapter;
|
18216 |
|
18217 |
|
18218 | }),
|
18219 |
|
18220 | (function(module, exports, __webpack_require__) {
|
18221 |
|
18222 | "use strict";
|
18223 |
|
18224 |
|
18225 | var reusify = __webpack_require__(104)
|
18226 |
|
18227 | function fastqueue (context, worker, concurrency) {
|
18228 | if (typeof context === 'function') {
|
18229 | concurrency = worker
|
18230 | worker = context
|
18231 | context = null
|
18232 | }
|
18233 |
|
18234 | var cache = reusify(Task)
|
18235 | var queueHead = null
|
18236 | var queueTail = null
|
18237 | var _running = 0
|
18238 |
|
18239 | var self = {
|
18240 | push: push,
|
18241 | drain: noop,
|
18242 | saturated: noop,
|
18243 | pause: pause,
|
18244 | paused: false,
|
18245 | concurrency: concurrency,
|
18246 | running: running,
|
18247 | resume: resume,
|
18248 | idle: idle,
|
18249 | length: length,
|
18250 | unshift: unshift,
|
18251 | empty: noop,
|
18252 | kill: kill,
|
18253 | killAndDrain: killAndDrain
|
18254 | }
|
18255 |
|
18256 | return self
|
18257 |
|
18258 | function running () {
|
18259 | return _running
|
18260 | }
|
18261 |
|
18262 | function pause () {
|
18263 | self.paused = true
|
18264 | }
|
18265 |
|
18266 | function length () {
|
18267 | var current = queueHead
|
18268 | var counter = 0
|
18269 |
|
18270 | while (current) {
|
18271 | current = current.next
|
18272 | counter++
|
18273 | }
|
18274 |
|
18275 | return counter
|
18276 | }
|
18277 |
|
18278 | function resume () {
|
18279 | if (!self.paused) return
|
18280 | self.paused = false
|
18281 | for (var i = 0; i < self.concurrency; i++) {
|
18282 | _running++
|
18283 | release()
|
18284 | }
|
18285 | }
|
18286 |
|
18287 | function idle () {
|
18288 | return _running === 0 && self.length() === 0
|
18289 | }
|
18290 |
|
18291 | function push (value, done) {
|
18292 | var current = cache.get()
|
18293 |
|
18294 | current.context = context
|
18295 | current.release = release
|
18296 | current.value = value
|
18297 | current.callback = done || noop
|
18298 |
|
18299 | if (_running === self.concurrency || self.paused) {
|
18300 | if (queueTail) {
|
18301 | queueTail.next = current
|
18302 | queueTail = current
|
18303 | } else {
|
18304 | queueHead = current
|
18305 | queueTail = current
|
18306 | self.saturated()
|
18307 | }
|
18308 | } else {
|
18309 | _running++
|
18310 | worker.call(context, current.value, current.worked)
|
18311 | }
|
18312 | }
|
18313 |
|
18314 | function unshift (value, done) {
|
18315 | var current = cache.get()
|
18316 |
|
18317 | current.context = context
|
18318 | current.release = release
|
18319 | current.value = value
|
18320 | current.callback = done || noop
|
18321 |
|
18322 | if (_running === self.concurrency || self.paused) {
|
18323 | if (queueHead) {
|
18324 | current.next = queueHead
|
18325 | queueHead = current
|
18326 | } else {
|
18327 | queueHead = current
|
18328 | queueTail = current
|
18329 | self.saturated()
|
18330 | }
|
18331 | } else {
|
18332 | _running++
|
18333 | worker.call(context, current.value, current.worked)
|
18334 | }
|
18335 | }
|
18336 |
|
18337 | function release (holder) {
|
18338 | if (holder) {
|
18339 | cache.release(holder)
|
18340 | }
|
18341 | var next = queueHead
|
18342 | if (next) {
|
18343 | if (!self.paused) {
|
18344 | if (queueTail === queueHead) {
|
18345 | queueTail = null
|
18346 | }
|
18347 | queueHead = next.next
|
18348 | next.next = null
|
18349 | worker.call(context, next.value, next.worked)
|
18350 | if (queueTail === null) {
|
18351 | self.empty()
|
18352 | }
|
18353 | } else {
|
18354 | _running--
|
18355 | }
|
18356 | } else if (--_running === 0) {
|
18357 | self.drain()
|
18358 | }
|
18359 | }
|
18360 |
|
18361 | function kill () {
|
18362 | queueHead = null
|
18363 | queueTail = null
|
18364 | self.drain = noop
|
18365 | }
|
18366 |
|
18367 | function killAndDrain () {
|
18368 | queueHead = null
|
18369 | queueTail = null
|
18370 | self.drain()
|
18371 | self.drain = noop
|
18372 | }
|
18373 | }
|
18374 |
|
18375 | function noop () {}
|
18376 |
|
18377 | function Task () {
|
18378 | this.value = null
|
18379 | this.callback = noop
|
18380 | this.next = null
|
18381 | this.release = noop
|
18382 | this.context = null
|
18383 |
|
18384 | var self = this
|
18385 |
|
18386 | this.worked = function worked (err, result) {
|
18387 | var callback = self.callback
|
18388 | self.value = null
|
18389 | self.callback = noop
|
18390 | callback.call(self.context, err, result)
|
18391 | self.release(self)
|
18392 | }
|
18393 | }
|
18394 |
|
18395 | module.exports = fastqueue
|
18396 |
|
18397 |
|
18398 | }),
|
18399 |
|
18400 | (function(module, exports, __webpack_require__) {
|
18401 |
|
18402 | "use strict";
|
18403 |
|
18404 |
|
18405 | function reusify (Constructor) {
|
18406 | var head = new Constructor()
|
18407 | var tail = head
|
18408 |
|
18409 | function get () {
|
18410 | var current = head
|
18411 |
|
18412 | if (current.next) {
|
18413 | head = current.next
|
18414 | } else {
|
18415 | head = new Constructor()
|
18416 | tail = head
|
18417 | }
|
18418 |
|
18419 | current.next = null
|
18420 |
|
18421 | return current
|
18422 | }
|
18423 |
|
18424 | function release (obj) {
|
18425 | tail.next = obj
|
18426 | tail = obj
|
18427 | }
|
18428 |
|
18429 | return {
|
18430 | get: get,
|
18431 | release: release
|
18432 | }
|
18433 | }
|
18434 |
|
18435 | module.exports = reusify
|
18436 |
|
18437 |
|
18438 | /***/ }),
|
18439 | /* 105 */
|
18440 | /***/ (function(module, exports, __webpack_require__) {
|
18441 |
|
18442 | "use strict";
|
18443 |
|
18444 | Object.defineProperty(exports, "__esModule", { value: true });
|
18445 | function isFatalError(settings, error) {
|
18446 | if (settings.errorFilter === null) {
|
18447 | return true;
|
18448 | }
|
18449 | return !settings.errorFilter(error);
|
18450 | }
|
18451 | exports.isFatalError = isFatalError;
|
18452 | function isAppliedFilter(filter, value) {
|
18453 | return filter === null || filter(value);
|
18454 | }
|
18455 | exports.isAppliedFilter = isAppliedFilter;
|
18456 | function replacePathSegmentSeparator(filepath, separator) {
|
18457 | return filepath.split(/[\\\/]/).join(separator);
|
18458 | }
|
18459 | exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
18460 | function joinPathSegments(a, b, separator) {
|
18461 | if (a === '') {
|
18462 | return b;
|
18463 | }
|
18464 | return a + separator + b;
|
18465 | }
|
18466 | exports.joinPathSegments = joinPathSegments;
|
18467 |
|
18468 |
|
18469 | }),
|
18470 |
|
18471 | (function(module, exports, __webpack_require__) {
|
18472 |
|
18473 | "use strict";
|
18474 |
|
18475 | Object.defineProperty(exports, "__esModule", { value: true });
|
18476 | const common = __webpack_require__(105);
|
18477 | class Reader {
|
18478 | constructor(_root, _settings) {
|
18479 | this._root = _root;
|
18480 | this._settings = _settings;
|
18481 | this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
|
18482 | }
|
18483 | }
|
18484 | exports.default = Reader;
|
18485 |
|
18486 |
|
18487 | }),
|
18488 |
|
18489 | (function(module, exports, __webpack_require__) {
|
18490 |
|
18491 | "use strict";
|
18492 |
|
18493 | Object.defineProperty(exports, "__esModule", { value: true });
|
18494 | const stream_1 = __webpack_require__(83);
|
18495 | const async_1 = __webpack_require__(93);
|
18496 | class StreamProvider {
|
18497 | constructor(_root, _settings) {
|
18498 | this._root = _root;
|
18499 | this._settings = _settings;
|
18500 | this._reader = new async_1.default(this._root, this._settings);
|
18501 | this._stream = new stream_1.Readable({
|
18502 | objectMode: true,
|
18503 | read: () => { },
|
18504 | destroy: this._reader.destroy.bind(this._reader)
|
18505 | });
|
18506 | }
|
18507 | read() {
|
18508 | this._reader.onError((error) => {
|
18509 | this._stream.emit('error', error);
|
18510 | });
|
18511 | this._reader.onEntry((entry) => {
|
18512 | this._stream.push(entry);
|
18513 | });
|
18514 | this._reader.onEnd(() => {
|
18515 | this._stream.push(null);
|
18516 | });
|
18517 | this._reader.read();
|
18518 | return this._stream;
|
18519 | }
|
18520 | }
|
18521 | exports.default = StreamProvider;
|
18522 |
|
18523 |
|
18524 | }),
|
18525 |
|
18526 | (function(module, exports, __webpack_require__) {
|
18527 |
|
18528 | "use strict";
|
18529 |
|
18530 | Object.defineProperty(exports, "__esModule", { value: true });
|
18531 | const sync_1 = __webpack_require__(109);
|
18532 | class SyncProvider {
|
18533 | constructor(_root, _settings) {
|
18534 | this._root = _root;
|
18535 | this._settings = _settings;
|
18536 | this._reader = new sync_1.default(this._root, this._settings);
|
18537 | }
|
18538 | read() {
|
18539 | return this._reader.read();
|
18540 | }
|
18541 | }
|
18542 | exports.default = SyncProvider;
|
18543 |
|
18544 |
|
18545 | }),
|
18546 |
|
18547 | (function(module, exports, __webpack_require__) {
|
18548 |
|
18549 | "use strict";
|
18550 |
|
18551 | Object.defineProperty(exports, "__esModule", { value: true });
|
18552 | const fsScandir = __webpack_require__(94);
|
18553 | const common = __webpack_require__(105);
|
18554 | const reader_1 = __webpack_require__(106);
|
18555 | class SyncReader extends reader_1.default {
|
18556 | constructor() {
|
18557 | super(...arguments);
|
18558 | this._scandir = fsScandir.scandirSync;
|
18559 | this._storage = new Set();
|
18560 | this._queue = new Set();
|
18561 | }
|
18562 | read() {
|
18563 | this._pushToQueue(this._root, this._settings.basePath);
|
18564 | this._handleQueue();
|
18565 | return Array.from(this._storage);
|
18566 | }
|
18567 | _pushToQueue(dir, base) {
|
18568 | this._queue.add({ dir, base });
|
18569 | }
|
18570 | _handleQueue() {
|
18571 | for (const item of this._queue.values()) {
|
18572 | this._handleDirectory(item.dir, item.base);
|
18573 | }
|
18574 | }
|
18575 | _handleDirectory(dir, base) {
|
18576 | try {
|
18577 | const entries = this._scandir(dir, this._settings.fsScandirSettings);
|
18578 | for (const entry of entries) {
|
18579 | this._handleEntry(entry, base);
|
18580 | }
|
18581 | }
|
18582 | catch (error) {
|
18583 | this._handleError(error);
|
18584 | }
|
18585 | }
|
18586 | _handleError(error) {
|
18587 | if (!common.isFatalError(this._settings, error)) {
|
18588 | return;
|
18589 | }
|
18590 | throw error;
|
18591 | }
|
18592 | _handleEntry(entry, base) {
|
18593 | const fullpath = entry.path;
|
18594 | if (base !== undefined) {
|
18595 | entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
18596 | }
|
18597 | if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
|
18598 | this._pushToStorage(entry);
|
18599 | }
|
18600 | if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
|
18601 | this._pushToQueue(fullpath, entry.path);
|
18602 | }
|
18603 | }
|
18604 | _pushToStorage(entry) {
|
18605 | this._storage.add(entry);
|
18606 | }
|
18607 | }
|
18608 | exports.default = SyncReader;
|
18609 |
|
18610 |
|
18611 | }),
|
18612 |
|
18613 | (function(module, exports, __webpack_require__) {
|
18614 |
|
18615 | "use strict";
|
18616 |
|
18617 | Object.defineProperty(exports, "__esModule", { value: true });
|
18618 | const path = __webpack_require__(15);
|
18619 | const fsScandir = __webpack_require__(94);
|
18620 | class Settings {
|
18621 | constructor(_options = {}) {
|
18622 | this._options = _options;
|
18623 | this.basePath = this._getValue(this._options.basePath, undefined);
|
18624 | this.concurrency = this._getValue(this._options.concurrency, Infinity);
|
18625 | this.deepFilter = this._getValue(this._options.deepFilter, null);
|
18626 | this.entryFilter = this._getValue(this._options.entryFilter, null);
|
18627 | this.errorFilter = this._getValue(this._options.errorFilter, null);
|
18628 | this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
|
18629 | this.fsScandirSettings = new fsScandir.Settings({
|
18630 | followSymbolicLinks: this._options.followSymbolicLinks,
|
18631 | fs: this._options.fs,
|
18632 | pathSegmentSeparator: this._options.pathSegmentSeparator,
|
18633 | stats: this._options.stats,
|
18634 | throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
|
18635 | });
|
18636 | }
|
18637 | _getValue(option, value) {
|
18638 | return option === undefined ? value : option;
|
18639 | }
|
18640 | }
|
18641 | exports.default = Settings;
|
18642 |
|
18643 |
|
18644 | }),
|
18645 |
|
18646 | (function(module, exports, __webpack_require__) {
|
18647 |
|
18648 | "use strict";
|
18649 |
|
18650 | Object.defineProperty(exports, "__esModule", { value: true });
|
18651 | const path = __webpack_require__(15);
|
18652 | const fsStat = __webpack_require__(86);
|
18653 | const utils = __webpack_require__(55);
|
18654 | class Reader {
|
18655 | constructor(_settings) {
|
18656 | this._settings = _settings;
|
18657 | this._fsStatSettings = new fsStat.Settings({
|
18658 | followSymbolicLink: this._settings.followSymbolicLinks,
|
18659 | fs: this._settings.fs,
|
18660 | throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
18661 | });
|
18662 | }
|
18663 | _getFullEntryPath(filepath) {
|
18664 | return path.resolve(this._settings.cwd, filepath);
|
18665 | }
|
18666 | _makeEntry(stats, pattern) {
|
18667 | const entry = {
|
18668 | name: pattern,
|
18669 | path: pattern,
|
18670 | dirent: utils.fs.createDirentFromStats(pattern, stats)
|
18671 | };
|
18672 | if (this._settings.stats) {
|
18673 | entry.stats = stats;
|
18674 | }
|
18675 | return entry;
|
18676 | }
|
18677 | _isFatalError(error) {
|
18678 | return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
18679 | }
|
18680 | }
|
18681 | exports.default = Reader;
|
18682 |
|
18683 |
|
18684 | }),
|
18685 |
|
18686 | (function(module, exports, __webpack_require__) {
|
18687 |
|
18688 | "use strict";
|
18689 |
|
18690 | Object.defineProperty(exports, "__esModule", { value: true });
|
18691 | const path = __webpack_require__(15);
|
18692 | const deep_1 = __webpack_require__(113);
|
18693 | const entry_1 = __webpack_require__(114);
|
18694 | const error_1 = __webpack_require__(115);
|
18695 | const entry_2 = __webpack_require__(116);
|
18696 | class Provider {
|
18697 | constructor(_settings) {
|
18698 | this._settings = _settings;
|
18699 | this.errorFilter = new error_1.default(this._settings);
|
18700 | this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
|
18701 | this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
|
18702 | this.entryTransformer = new entry_2.default(this._settings);
|
18703 | }
|
18704 | _getRootDirectory(task) {
|
18705 | return path.resolve(this._settings.cwd, task.base);
|
18706 | }
|
18707 | _getReaderOptions(task) {
|
18708 | const basePath = task.base === '.' ? '' : task.base;
|
18709 | return {
|
18710 | basePath,
|
18711 | pathSegmentSeparator: '/',
|
18712 | concurrency: this._settings.concurrency,
|
18713 | deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
18714 | entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
18715 | errorFilter: this.errorFilter.getFilter(),
|
18716 | followSymbolicLinks: this._settings.followSymbolicLinks,
|
18717 | fs: this._settings.fs,
|
18718 | stats: this._settings.stats,
|
18719 | throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
18720 | transform: this.entryTransformer.getTransformer()
|
18721 | };
|
18722 | }
|
18723 | _getMicromatchOptions() {
|
18724 | return {
|
18725 | dot: this._settings.dot,
|
18726 | matchBase: this._settings.baseNameMatch,
|
18727 | nobrace: !this._settings.braceExpansion,
|
18728 | nocase: !this._settings.caseSensitiveMatch,
|
18729 | noext: !this._settings.extglob,
|
18730 | noglobstar: !this._settings.globstar,
|
18731 | posix: true,
|
18732 | strictSlashes: false
|
18733 | };
|
18734 | }
|
18735 | }
|
18736 | exports.default = Provider;
|
18737 |
|
18738 |
|
18739 | }),
|
18740 |
|
18741 | (function(module, exports, __webpack_require__) {
|
18742 |
|
18743 | "use strict";
|
18744 |
|
18745 | Object.defineProperty(exports, "__esModule", { value: true });
|
18746 | const utils = __webpack_require__(55);
|
18747 | class DeepFilter {
|
18748 | constructor(_settings, _micromatchOptions) {
|
18749 | this._settings = _settings;
|
18750 | this._micromatchOptions = _micromatchOptions;
|
18751 | }
|
18752 | getFilter(basePath, positive, negative) {
|
18753 | const maxPatternDepth = this._getMaxPatternDepth(positive);
|
18754 | const negativeRe = this._getNegativePatternsRe(negative);
|
18755 | return (entry) => this._filter(basePath, entry, negativeRe, maxPatternDepth);
|
18756 | }
|
18757 | _getMaxPatternDepth(patterns) {
|
18758 | const globstar = patterns.some(utils.pattern.hasGlobStar);
|
18759 | return globstar ? Infinity : utils.pattern.getMaxNaivePatternsDepth(patterns);
|
18760 | }
|
18761 | _getNegativePatternsRe(patterns) {
|
18762 | const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
|
18763 | return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
18764 | }
|
18765 | _filter(basePath, entry, negativeRe, maxPatternDepth) {
|
18766 | const depth = this._getEntryDepth(basePath, entry.path);
|
18767 | if (this._isSkippedByDeep(depth)) {
|
18768 | return false;
|
18769 | }
|
18770 | if (this._isSkippedByMaxPatternDepth(depth, maxPatternDepth)) {
|
18771 | return false;
|
18772 | }
|
18773 | if (this._isSkippedSymbolicLink(entry)) {
|
18774 | return false;
|
18775 | }
|
18776 | if (this._isSkippedDotDirectory(entry)) {
|
18777 | return false;
|
18778 | }
|
18779 | return this._isSkippedByNegativePatterns(entry, negativeRe);
|
18780 | }
|
18781 | _getEntryDepth(basePath, entryPath) {
|
18782 | const basePathDepth = basePath.split('/').length;
|
18783 | const entryPathDepth = entryPath.split('/').length;
|
18784 | return entryPathDepth - (basePath === '' ? 0 : basePathDepth);
|
18785 | }
|
18786 | _isSkippedByDeep(entryDepth) {
|
18787 | return entryDepth >= this._settings.deep;
|
18788 | }
|
18789 | _isSkippedByMaxPatternDepth(entryDepth, maxPatternDepth) {
|
18790 | return !this._settings.baseNameMatch && maxPatternDepth !== Infinity && entryDepth > maxPatternDepth;
|
18791 | }
|
18792 | _isSkippedSymbolicLink(entry) {
|
18793 | return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
18794 | }
|
18795 | _isSkippedDotDirectory(entry) {
|
18796 | return !this._settings.dot && entry.name.startsWith('.');
|
18797 | }
|
18798 | _isSkippedByNegativePatterns(entry, negativeRe) {
|
18799 | return !utils.pattern.matchAny(entry.path, negativeRe);
|
18800 | }
|
18801 | }
|
18802 | exports.default = DeepFilter;
|
18803 |
|
18804 |
|
18805 | }),
|
18806 |
|
18807 | (function(module, exports, __webpack_require__) {
|
18808 |
|
18809 | "use strict";
|
18810 |
|
18811 | Object.defineProperty(exports, "__esModule", { value: true });
|
18812 | const utils = __webpack_require__(55);
|
18813 | class EntryFilter {
|
18814 | constructor(_settings, _micromatchOptions) {
|
18815 | this._settings = _settings;
|
18816 | this._micromatchOptions = _micromatchOptions;
|
18817 | this.index = new Map();
|
18818 | }
|
18819 | getFilter(positive, negative) {
|
18820 | const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
18821 | const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
18822 | return (entry) => this._filter(entry, positiveRe, negativeRe);
|
18823 | }
|
18824 | _filter(entry, positiveRe, negativeRe) {
|
18825 | if (this._settings.unique) {
|
18826 | if (this._isDuplicateEntry(entry)) {
|
18827 | return false;
|
18828 | }
|
18829 | this._createIndexRecord(entry);
|
18830 | }
|
18831 | if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
18832 | return false;
|
18833 | }
|
18834 | if (this._isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) {
|
18835 | return false;
|
18836 | }
|
18837 | const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
18838 | return this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
|
18839 | }
|
18840 | _isDuplicateEntry(entry) {
|
18841 | return this.index.has(entry.path);
|
18842 | }
|
18843 | _createIndexRecord(entry) {
|
18844 | this.index.set(entry.path, undefined);
|
18845 | }
|
18846 | _onlyFileFilter(entry) {
|
18847 | return this._settings.onlyFiles && !entry.dirent.isFile();
|
18848 | }
|
18849 | _onlyDirectoryFilter(entry) {
|
18850 | return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
18851 | }
|
18852 | _isSkippedByAbsoluteNegativePatterns(entry, negativeRe) {
|
18853 | if (!this._settings.absolute) {
|
18854 | return false;
|
18855 | }
|
18856 | const fullpath = utils.path.makeAbsolute(this._settings.cwd, entry.path);
|
18857 | return this._isMatchToPatterns(fullpath, negativeRe);
|
18858 | }
|
18859 | _isMatchToPatterns(filepath, patternsRe) {
|
18860 | return utils.pattern.matchAny(filepath, patternsRe);
|
18861 | }
|
18862 | }
|
18863 | exports.default = EntryFilter;
|
18864 |
|
18865 |
|
18866 | }),
|
18867 |
|
18868 | (function(module, exports, __webpack_require__) {
|
18869 |
|
18870 | "use strict";
|
18871 |
|
18872 | Object.defineProperty(exports, "__esModule", { value: true });
|
18873 | const utils = __webpack_require__(55);
|
18874 | class ErrorFilter {
|
18875 | constructor(_settings) {
|
18876 | this._settings = _settings;
|
18877 | }
|
18878 | getFilter() {
|
18879 | return (error) => this._isNonFatalError(error);
|
18880 | }
|
18881 | _isNonFatalError(error) {
|
18882 | return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
18883 | }
|
18884 | }
|
18885 | exports.default = ErrorFilter;
|
18886 |
|
18887 |
|
18888 | }),
|
18889 |
|
18890 | (function(module, exports, __webpack_require__) {
|
18891 |
|
18892 | "use strict";
|
18893 |
|
18894 | Object.defineProperty(exports, "__esModule", { value: true });
|
18895 | const utils = __webpack_require__(55);
|
18896 | class EntryTransformer {
|
18897 | constructor(_settings) {
|
18898 | this._settings = _settings;
|
18899 | }
|
18900 | getTransformer() {
|
18901 | return (entry) => this._transform(entry);
|
18902 | }
|
18903 | _transform(entry) {
|
18904 | let filepath = entry.path;
|
18905 | if (this._settings.absolute) {
|
18906 | filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
|
18907 | filepath = utils.path.unixify(filepath);
|
18908 | }
|
18909 | if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
18910 | filepath += '/';
|
18911 | }
|
18912 | if (!this._settings.objectMode) {
|
18913 | return filepath;
|
18914 | }
|
18915 | return Object.assign({}, entry, { path: filepath });
|
18916 | }
|
18917 | }
|
18918 | exports.default = EntryTransformer;
|
18919 |
|
18920 |
|
18921 | }),
|
18922 |
|
18923 | (function(module, exports, __webpack_require__) {
|
18924 |
|
18925 | "use strict";
|
18926 |
|
18927 | Object.defineProperty(exports, "__esModule", { value: true });
|
18928 | const stream_1 = __webpack_require__(83);
|
18929 | const stream_2 = __webpack_require__(85);
|
18930 | const provider_1 = __webpack_require__(112);
|
18931 | class ProviderStream extends provider_1.default {
|
18932 | constructor() {
|
18933 | super(...arguments);
|
18934 | this._reader = new stream_2.default(this._settings);
|
18935 | }
|
18936 | read(task) {
|
18937 | const root = this._getRootDirectory(task);
|
18938 | const options = this._getReaderOptions(task);
|
18939 | const source = this.api(root, task, options);
|
18940 | const dest = new stream_1.Readable({ objectMode: true, read: () => { } });
|
18941 | source
|
18942 | .once('error', (error) => dest.emit('error', error))
|
18943 | .on('data', (entry) => dest.emit('data', options.transform(entry)))
|
18944 | .once('end', () => dest.emit('end'));
|
18945 | return dest;
|
18946 | }
|
18947 | api(root, task, options) {
|
18948 | if (task.dynamic) {
|
18949 | return this._reader.dynamic(root, options);
|
18950 | }
|
18951 | return this._reader.static(task.patterns, options);
|
18952 | }
|
18953 | }
|
18954 | exports.default = ProviderStream;
|
18955 |
|
18956 |
|
18957 | }),
|
18958 |
|
18959 | (function(module, exports, __webpack_require__) {
|
18960 |
|
18961 | "use strict";
|
18962 |
|
18963 | Object.defineProperty(exports, "__esModule", { value: true });
|
18964 | const sync_1 = __webpack_require__(119);
|
18965 | const provider_1 = __webpack_require__(112);
|
18966 | class ProviderSync extends provider_1.default {
|
18967 | constructor() {
|
18968 | super(...arguments);
|
18969 | this._reader = new sync_1.default(this._settings);
|
18970 | }
|
18971 | read(task) {
|
18972 | const root = this._getRootDirectory(task);
|
18973 | const options = this._getReaderOptions(task);
|
18974 | const entries = this.api(root, task, options);
|
18975 | return entries.map(options.transform);
|
18976 | }
|
18977 | api(root, task, options) {
|
18978 | if (task.dynamic) {
|
18979 | return this._reader.dynamic(root, options);
|
18980 | }
|
18981 | return this._reader.static(task.patterns, options);
|
18982 | }
|
18983 | }
|
18984 | exports.default = ProviderSync;
|
18985 |
|
18986 |
|
18987 | }),
|
18988 |
|
18989 | (function(module, exports, __webpack_require__) {
|
18990 |
|
18991 | "use strict";
|
18992 |
|
18993 | Object.defineProperty(exports, "__esModule", { value: true });
|
18994 | const fsStat = __webpack_require__(86);
|
18995 | const fsWalk = __webpack_require__(91);
|
18996 | const reader_1 = __webpack_require__(111);
|
18997 | class ReaderSync extends reader_1.default {
|
18998 | constructor() {
|
18999 | super(...arguments);
|
19000 | this._walkSync = fsWalk.walkSync;
|
19001 | this._statSync = fsStat.statSync;
|
19002 | }
|
19003 | dynamic(root, options) {
|
19004 | return this._walkSync(root, options);
|
19005 | }
|
19006 | static(patterns, options) {
|
19007 | const entries = [];
|
19008 | for (const pattern of patterns) {
|
19009 | const filepath = this._getFullEntryPath(pattern);
|
19010 | const entry = this._getEntry(filepath, pattern, options);
|
19011 | if (entry === null || !options.entryFilter(entry)) {
|
19012 | continue;
|
19013 | }
|
19014 | entries.push(entry);
|
19015 | }
|
19016 | return entries;
|
19017 | }
|
19018 | _getEntry(filepath, pattern, options) {
|
19019 | try {
|
19020 | const stats = this._getStat(filepath);
|
19021 | return this._makeEntry(stats, pattern);
|
19022 | }
|
19023 | catch (error) {
|
19024 | if (options.errorFilter(error)) {
|
19025 | return null;
|
19026 | }
|
19027 | throw error;
|
19028 | }
|
19029 | }
|
19030 | _getStat(filepath) {
|
19031 | return this._statSync(filepath, this._fsStatSettings);
|
19032 | }
|
19033 | }
|
19034 | exports.default = ReaderSync;
|
19035 |
|
19036 |
|
19037 | }),
|
19038 |
|
19039 | (function(module, exports, __webpack_require__) {
|
19040 |
|
19041 | "use strict";
|
19042 |
|
19043 | Object.defineProperty(exports, "__esModule", { value: true });
|
19044 | const fs = __webpack_require__(36);
|
19045 | const os = __webpack_require__(16);
|
19046 | const CPU_COUNT = os.cpus().length;
|
19047 | exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
19048 | lstat: fs.lstat,
|
19049 | lstatSync: fs.lstatSync,
|
19050 | stat: fs.stat,
|
19051 | statSync: fs.statSync,
|
19052 | readdir: fs.readdir,
|
19053 | readdirSync: fs.readdirSync
|
19054 | };
|
19055 |
|
19056 | class Settings {
|
19057 | constructor(_options = {}) {
|
19058 | this._options = _options;
|
19059 | this.absolute = this._getValue(this._options.absolute, false);
|
19060 | this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
|
19061 | this.braceExpansion = this._getValue(this._options.braceExpansion, true);
|
19062 | this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
|
19063 | this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
|
19064 | this.cwd = this._getValue(this._options.cwd, process.cwd());
|
19065 | this.deep = this._getValue(this._options.deep, Infinity);
|
19066 | this.dot = this._getValue(this._options.dot, false);
|
19067 | this.extglob = this._getValue(this._options.extglob, true);
|
19068 | this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
|
19069 | this.fs = this._getFileSystemMethods(this._options.fs);
|
19070 | this.globstar = this._getValue(this._options.globstar, true);
|
19071 | this.ignore = this._getValue(this._options.ignore, []);
|
19072 | this.markDirectories = this._getValue(this._options.markDirectories, false);
|
19073 | this.objectMode = this._getValue(this._options.objectMode, false);
|
19074 | this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
|
19075 | this.onlyFiles = this._getValue(this._options.onlyFiles, true);
|
19076 | this.stats = this._getValue(this._options.stats, false);
|
19077 | this.suppressErrors = this._getValue(this._options.suppressErrors, false);
|
19078 | this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
|
19079 | this.unique = this._getValue(this._options.unique, true);
|
19080 | if (this.onlyDirectories) {
|
19081 | this.onlyFiles = false;
|
19082 | }
|
19083 | if (this.stats) {
|
19084 | this.objectMode = true;
|
19085 | }
|
19086 | }
|
19087 | _getValue(option, value) {
|
19088 | return option === undefined ? value : option;
|
19089 | }
|
19090 | _getFileSystemMethods(methods = {}) {
|
19091 | return Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER, methods);
|
19092 | }
|
19093 | }
|
19094 | exports.default = Settings;
|
19095 |
|
19096 |
|
19097 | }),
|
19098 | ,
|
19099 | ,
|
19100 | ,
|
19101 | ,
|
19102 | ,
|
19103 | ,
|
19104 | ,
|
19105 | ,
|
19106 | ,
|
19107 | ,
|
19108 | ,
|
19109 |
|
19110 | (function(module, __webpack_exports__, __webpack_require__) {
|
19111 |
|
19112 | "use strict";
|
19113 | __webpack_require__.r(__webpack_exports__);
|
19114 | __webpack_require__.d(__webpack_exports__, "setUriThrowOnMissingScheme", function() { return setUriThrowOnMissingScheme; });
|
19115 |
|
19116 |
|
19117 |
|
19118 |
|
19119 |
|
19120 | var __extends = (undefined && undefined.__extends) || (function () {
|
19121 | var extendStatics = Object.setPrototypeOf ||
|
19122 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
19123 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
19124 | return function (d, b) {
|
19125 | extendStatics(d, b);
|
19126 | function __() { this.constructor = d; }
|
19127 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
19128 | };
|
19129 | })();
|
19130 | var isWindows;
|
19131 | if (typeof process === 'object') {
|
19132 | isWindows = process.platform === 'win32';
|
19133 | }
|
19134 | else if (typeof navigator === 'object') {
|
19135 | var userAgent = navigator.userAgent;
|
19136 | isWindows = userAgent.indexOf('Windows') >= 0;
|
19137 | }
|
19138 |
|
19139 | var _schemePattern = /^\w[\w\d+.-]*$/;
|
19140 | var _singleSlashStart = /^\//;
|
19141 | var _doubleSlashStart = /^\/\//;
|
19142 | var _throwOnMissingSchema = true;
|
19143 |
|
19144 |
|
19145 |
|
19146 | function setUriThrowOnMissingScheme(value) {
|
19147 | var old = _throwOnMissingSchema;
|
19148 | _throwOnMissingSchema = value;
|
19149 | return old;
|
19150 | }
|
19151 | function _validateUri(ret, _strict) {
|
19152 |
|
19153 | if (!ret.scheme) {
|
19154 | if (_strict || _throwOnMissingSchema) {
|
19155 | throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}");
|
19156 |
|
19157 |
|
19158 | }
|
19159 | }
|
19160 |
|
19161 |
|
19162 | if (ret.scheme && !_schemePattern.test(ret.scheme)) {
|
19163 | throw new Error('[UriError]: Scheme contains illegal characters.');
|
19164 | }
|
19165 |
|
19166 |
|
19167 |
|
19168 |
|
19169 |
|
19170 | if (ret.path) {
|
19171 | if (ret.authority) {
|
19172 | if (!_singleSlashStart.test(ret.path)) {
|
19173 | throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
|
19174 | }
|
19175 | }
|
19176 | else {
|
19177 | if (_doubleSlashStart.test(ret.path)) {
|
19178 | throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
|
19179 | }
|
19180 | }
|
19181 | }
|
19182 | }
|
19183 |
|
19184 |
|
19185 |
|
19186 |
|
19187 | function _schemeFix(scheme, _strict) {
|
19188 | if (_strict || _throwOnMissingSchema) {
|
19189 | return scheme || _empty;
|
19190 | }
|
19191 | if (!scheme) {
|
19192 |
|
19193 | scheme = 'file';
|
19194 | }
|
19195 | return scheme;
|
19196 | }
|
19197 |
|
19198 | function _referenceResolution(scheme, path) {
|
19199 |
|
19200 |
|
19201 |
|
19202 |
|
19203 | switch (scheme) {
|
19204 | case 'https':
|
19205 | case 'http':
|
19206 | case 'file':
|
19207 | if (!path) {
|
19208 | path = _slash;
|
19209 | }
|
19210 | else if (path[0] !== _slash) {
|
19211 | path = _slash + path;
|
19212 | }
|
19213 | break;
|
19214 | }
|
19215 | return path;
|
19216 | }
|
19217 | var _empty = '';
|
19218 | var _slash = '/';
|
19219 | var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
|
19220 |
|
19221 |
|
19222 |
|
19223 |
|
19224 |
|
19225 |
|
19226 |
|
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 |
|
19233 |
|
19234 | var URI = (function () {
|
19235 | |
19236 |
|
19237 |
|
19238 | function URI(schemeOrData, authority, path, query, fragment, _strict) {
|
19239 | if (_strict === void 0) { _strict = false; }
|
19240 | if (typeof schemeOrData === 'object') {
|
19241 | this.scheme = schemeOrData.scheme || _empty;
|
19242 | this.authority = schemeOrData.authority || _empty;
|
19243 | this.path = schemeOrData.path || _empty;
|
19244 | this.query = schemeOrData.query || _empty;
|
19245 | this.fragment = schemeOrData.fragment || _empty;
|
19246 |
|
19247 |
|
19248 |
|
19249 | }
|
19250 | else {
|
19251 | this.scheme = _schemeFix(schemeOrData, _strict);
|
19252 | this.authority = authority || _empty;
|
19253 | this.path = _referenceResolution(this.scheme, path || _empty);
|
19254 | this.query = query || _empty;
|
19255 | this.fragment = fragment || _empty;
|
19256 | _validateUri(this, _strict);
|
19257 | }
|
19258 | }
|
19259 | URI.isUri = function (thing) {
|
19260 | if (thing instanceof URI) {
|
19261 | return true;
|
19262 | }
|
19263 | if (!thing) {
|
19264 | return false;
|
19265 | }
|
19266 | return typeof thing.authority === 'string'
|
19267 | && typeof thing.fragment === 'string'
|
19268 | && typeof thing.path === 'string'
|
19269 | && typeof thing.query === 'string'
|
19270 | && typeof thing.scheme === 'string'
|
19271 | && typeof thing.fsPath === 'function'
|
19272 | && typeof thing.with === 'function'
|
19273 | && typeof thing.toString === 'function';
|
19274 | };
|
19275 | Object.defineProperty(URI.prototype, "fsPath", {
|
19276 |
|
19277 | |
19278 |
|
19279 |
|
19280 |
|
19281 |
|
19282 |
|
19283 |
|
19284 |
|
19285 |
|
19286 |
|
19287 |
|
19288 |
|
19289 |
|
19290 |
|
19291 |
|
19292 |
|
19293 |
|
19294 |
|
19295 |
|
19296 |
|
19297 |
|
19298 |
|
19299 |
|
19300 |
|
19301 | get: function () {
|
19302 |
|
19303 |
|
19304 |
|
19305 | return _makeFsPath(this);
|
19306 | },
|
19307 | enumerable: true,
|
19308 | configurable: true
|
19309 | });
|
19310 |
|
19311 | URI.prototype.with = function (change) {
|
19312 | if (!change) {
|
19313 | return this;
|
19314 | }
|
19315 | var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;
|
19316 | if (scheme === undefined) {
|
19317 | scheme = this.scheme;
|
19318 | }
|
19319 | else if (scheme === null) {
|
19320 | scheme = _empty;
|
19321 | }
|
19322 | if (authority === undefined) {
|
19323 | authority = this.authority;
|
19324 | }
|
19325 | else if (authority === null) {
|
19326 | authority = _empty;
|
19327 | }
|
19328 | if (path === undefined) {
|
19329 | path = this.path;
|
19330 | }
|
19331 | else if (path === null) {
|
19332 | path = _empty;
|
19333 | }
|
19334 | if (query === undefined) {
|
19335 | query = this.query;
|
19336 | }
|
19337 | else if (query === null) {
|
19338 | query = _empty;
|
19339 | }
|
19340 | if (fragment === undefined) {
|
19341 | fragment = this.fragment;
|
19342 | }
|
19343 | else if (fragment === null) {
|
19344 | fragment = _empty;
|
19345 | }
|
19346 | if (scheme === this.scheme
|
19347 | && authority === this.authority
|
19348 | && path === this.path
|
19349 | && query === this.query
|
19350 | && fragment === this.fragment) {
|
19351 | return this;
|
19352 | }
|
19353 | return new _URI(scheme, authority, path, query, fragment);
|
19354 | };
|
19355 |
|
19356 | |
19357 |
|
19358 |
|
19359 |
|
19360 |
|
19361 |
|
19362 | URI.parse = function (value, _strict) {
|
19363 | if (_strict === void 0) { _strict = false; }
|
19364 | var match = _regexp.exec(value);
|
19365 | if (!match) {
|
19366 | return new _URI(_empty, _empty, _empty, _empty, _empty);
|
19367 | }
|
19368 | return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict);
|
19369 | };
|
19370 | |
19371 |
|
19372 |
|
19373 |
|
19374 |
|
19375 |
|
19376 |
|
19377 |
|
19378 |
|
19379 |
|
19380 |
|
19381 |
|
19382 |
|
19383 |
|
19384 |
|
19385 |
|
19386 |
|
19387 |
|
19388 |
|
19389 |
|
19390 |
|
19391 | URI.file = function (path) {
|
19392 | var authority = _empty;
|
19393 |
|
19394 |
|
19395 |
|
19396 | if (isWindows) {
|
19397 | path = path.replace(/\\/g, _slash);
|
19398 | }
|
19399 |
|
19400 |
|
19401 | if (path[0] === _slash && path[1] === _slash) {
|
19402 | var idx = path.indexOf(_slash, 2);
|
19403 | if (idx === -1) {
|
19404 | authority = path.substring(2);
|
19405 | path = _slash;
|
19406 | }
|
19407 | else {
|
19408 | authority = path.substring(2, idx);
|
19409 | path = path.substring(idx) || _slash;
|
19410 | }
|
19411 | }
|
19412 | return new _URI('file', authority, path, _empty, _empty);
|
19413 | };
|
19414 | URI.from = function (components) {
|
19415 | return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);
|
19416 | };
|
19417 |
|
19418 | |
19419 |
|
19420 |
|
19421 |
|
19422 |
|
19423 |
|
19424 |
|
19425 |
|
19426 |
|
19427 |
|
19428 |
|
19429 | URI.prototype.toString = function (skipEncoding) {
|
19430 | if (skipEncoding === void 0) { skipEncoding = false; }
|
19431 | return _asFormatted(this, skipEncoding);
|
19432 | };
|
19433 | URI.prototype.toJSON = function () {
|
19434 | return this;
|
19435 | };
|
19436 | URI.revive = function (data) {
|
19437 | if (!data) {
|
19438 | return data;
|
19439 | }
|
19440 | else if (data instanceof URI) {
|
19441 | return data;
|
19442 | }
|
19443 | else {
|
19444 | var result = new _URI(data);
|
19445 | result._formatted = data.external;
|
19446 | result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;
|
19447 | return result;
|
19448 | }
|
19449 | };
|
19450 | return URI;
|
19451 | }());
|
19452 | __webpack_exports__["default"] = (URI);
|
19453 | var _pathSepMarker = isWindows ? 1 : undefined;
|
19454 |
|
19455 | var _URI = (function (_super) {
|
19456 | __extends(_URI, _super);
|
19457 | function _URI() {
|
19458 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
19459 | _this._formatted = null;
|
19460 | _this._fsPath = null;
|
19461 | return _this;
|
19462 | }
|
19463 | Object.defineProperty(_URI.prototype, "fsPath", {
|
19464 | get: function () {
|
19465 | if (!this._fsPath) {
|
19466 | this._fsPath = _makeFsPath(this);
|
19467 | }
|
19468 | return this._fsPath;
|
19469 | },
|
19470 | enumerable: true,
|
19471 | configurable: true
|
19472 | });
|
19473 | _URI.prototype.toString = function (skipEncoding) {
|
19474 | if (skipEncoding === void 0) { skipEncoding = false; }
|
19475 | if (!skipEncoding) {
|
19476 | if (!this._formatted) {
|
19477 | this._formatted = _asFormatted(this, false);
|
19478 | }
|
19479 | return this._formatted;
|
19480 | }
|
19481 | else {
|
19482 |
|
19483 | return _asFormatted(this, true);
|
19484 | }
|
19485 | };
|
19486 | _URI.prototype.toJSON = function () {
|
19487 | var res = {
|
19488 | $mid: 1
|
19489 | };
|
19490 |
|
19491 | if (this._fsPath) {
|
19492 | res.fsPath = this._fsPath;
|
19493 | res._sep = _pathSepMarker;
|
19494 | }
|
19495 | if (this._formatted) {
|
19496 | res.external = this._formatted;
|
19497 | }
|
19498 |
|
19499 | if (this.path) {
|
19500 | res.path = this.path;
|
19501 | }
|
19502 | if (this.scheme) {
|
19503 | res.scheme = this.scheme;
|
19504 | }
|
19505 | if (this.authority) {
|
19506 | res.authority = this.authority;
|
19507 | }
|
19508 | if (this.query) {
|
19509 | res.query = this.query;
|
19510 | }
|
19511 | if (this.fragment) {
|
19512 | res.fragment = this.fragment;
|
19513 | }
|
19514 | return res;
|
19515 | };
|
19516 | return _URI;
|
19517 | }(URI));
|
19518 |
|
19519 | var encodeTable = (_a = {},
|
19520 | _a[58 ] = '%3A',
|
19521 | _a[47 ] = '%2F',
|
19522 | _a[63 ] = '%3F',
|
19523 | _a[35 ] = '%23',
|
19524 | _a[91 ] = '%5B',
|
19525 | _a[93 ] = '%5D',
|
19526 | _a[64 ] = '%40',
|
19527 | _a[33 ] = '%21',
|
19528 | _a[36 ] = '%24',
|
19529 | _a[38 ] = '%26',
|
19530 | _a[39 ] = '%27',
|
19531 | _a[40 ] = '%28',
|
19532 | _a[41 ] = '%29',
|
19533 | _a[42 ] = '%2A',
|
19534 | _a[43 ] = '%2B',
|
19535 | _a[44 ] = '%2C',
|
19536 | _a[59 ] = '%3B',
|
19537 | _a[61 ] = '%3D',
|
19538 | _a[32 ] = '%20',
|
19539 | _a);
|
19540 | function encodeURIComponentFast(uriComponent, allowSlash) {
|
19541 | var res = undefined;
|
19542 | var nativeEncodePos = -1;
|
19543 | for (var pos = 0; pos < uriComponent.length; pos++) {
|
19544 | var code = uriComponent.charCodeAt(pos);
|
19545 |
|
19546 | if ((code >= 97 && code <= 122 )
|
19547 | || (code >= 65 && code <= 90 )
|
19548 | || (code >= 48 && code <= 57 )
|
19549 | || code === 45
|
19550 | || code === 46
|
19551 | || code === 95
|
19552 | || code === 126
|
19553 | || (allowSlash && code === 47 )) {
|
19554 |
|
19555 | if (nativeEncodePos !== -1) {
|
19556 | res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
|
19557 | nativeEncodePos = -1;
|
19558 | }
|
19559 |
|
19560 | if (res !== undefined) {
|
19561 | res += uriComponent.charAt(pos);
|
19562 | }
|
19563 | }
|
19564 | else {
|
19565 |
|
19566 | if (res === undefined) {
|
19567 | res = uriComponent.substr(0, pos);
|
19568 | }
|
19569 |
|
19570 | var escaped = encodeTable[code];
|
19571 | if (escaped !== undefined) {
|
19572 |
|
19573 | if (nativeEncodePos !== -1) {
|
19574 | res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
|
19575 | nativeEncodePos = -1;
|
19576 | }
|
19577 |
|
19578 | res += escaped;
|
19579 | }
|
19580 | else if (nativeEncodePos === -1) {
|
19581 |
|
19582 | nativeEncodePos = pos;
|
19583 | }
|
19584 | }
|
19585 | }
|
19586 | if (nativeEncodePos !== -1) {
|
19587 | res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
|
19588 | }
|
19589 | return res !== undefined ? res : uriComponent;
|
19590 | }
|
19591 | function encodeURIComponentMinimal(path) {
|
19592 | var res = undefined;
|
19593 | for (var pos = 0; pos < path.length; pos++) {
|
19594 | var code = path.charCodeAt(pos);
|
19595 | if (code === 35 || code === 63 ) {
|
19596 | if (res === undefined) {
|
19597 | res = path.substr(0, pos);
|
19598 | }
|
19599 | res += encodeTable[code];
|
19600 | }
|
19601 | else {
|
19602 | if (res !== undefined) {
|
19603 | res += path[pos];
|
19604 | }
|
19605 | }
|
19606 | }
|
19607 | return res !== undefined ? res : path;
|
19608 | }
|
19609 |
|
19610 |
|
19611 |
|
19612 | function _makeFsPath(uri) {
|
19613 | var value;
|
19614 | if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {
|
19615 |
|
19616 | value = "//" + uri.authority + uri.path;
|
19617 | }
|
19618 | else if (uri.path.charCodeAt(0) === 47
|
19619 | && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122 )
|
19620 | && uri.path.charCodeAt(2) === 58 ) {
|
19621 |
|
19622 | value = uri.path[1].toLowerCase() + uri.path.substr(2);
|
19623 | }
|
19624 | else {
|
19625 |
|
19626 | value = uri.path;
|
19627 | }
|
19628 | if (isWindows) {
|
19629 | value = value.replace(/\//g, '\\');
|
19630 | }
|
19631 | return value;
|
19632 | }
|
19633 |
|
19634 |
|
19635 |
|
19636 | function _asFormatted(uri, skipEncoding) {
|
19637 | var encoder = !skipEncoding
|
19638 | ? encodeURIComponentFast
|
19639 | : encodeURIComponentMinimal;
|
19640 | var res = '';
|
19641 | var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
|
19642 | if (scheme) {
|
19643 | res += scheme;
|
19644 | res += ':';
|
19645 | }
|
19646 | if (authority || scheme === 'file') {
|
19647 | res += _slash;
|
19648 | res += _slash;
|
19649 | }
|
19650 | if (authority) {
|
19651 | var idx = authority.indexOf('@');
|
19652 | if (idx !== -1) {
|
19653 |
|
19654 | var userinfo = authority.substr(0, idx);
|
19655 | authority = authority.substr(idx + 1);
|
19656 | idx = userinfo.indexOf(':');
|
19657 | if (idx === -1) {
|
19658 | res += encoder(userinfo, false);
|
19659 | }
|
19660 | else {
|
19661 |
|
19662 | res += encoder(userinfo.substr(0, idx), false);
|
19663 | res += ':';
|
19664 | res += encoder(userinfo.substr(idx + 1), false);
|
19665 | }
|
19666 | res += '@';
|
19667 | }
|
19668 | authority = authority.toLowerCase();
|
19669 | idx = authority.indexOf(':');
|
19670 | if (idx === -1) {
|
19671 | res += encoder(authority, false);
|
19672 | }
|
19673 | else {
|
19674 |
|
19675 | res += encoder(authority.substr(0, idx), false);
|
19676 | res += authority.substr(idx);
|
19677 | }
|
19678 | }
|
19679 | if (path) {
|
19680 |
|
19681 | if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58 ) {
|
19682 | var code = path.charCodeAt(1);
|
19683 | if (code >= 65 && code <= 90 ) {
|
19684 | path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3);
|
19685 | }
|
19686 | }
|
19687 | else if (path.length >= 2 && path.charCodeAt(1) === 58 ) {
|
19688 | var code = path.charCodeAt(0);
|
19689 | if (code >= 65 && code <= 90 ) {
|
19690 | path = String.fromCharCode(code + 32) + ":" + path.substr(2);
|
19691 | }
|
19692 | }
|
19693 |
|
19694 | res += encoder(path, true);
|
19695 | }
|
19696 | if (query) {
|
19697 | res += '?';
|
19698 | res += encoder(query, false);
|
19699 | }
|
19700 | if (fragment) {
|
19701 | res += '#';
|
19702 | res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
|
19703 | }
|
19704 | return res;
|
19705 | }
|
19706 | var _a;
|
19707 |
|
19708 |
|
19709 | }),
|
19710 | ,
|
19711 | ,
|
19712 | ,
|
19713 | ,
|
19714 | ,
|
19715 | ,
|
19716 | ,
|
19717 | ,
|
19718 | ,
|
19719 | ,
|
19720 | ,
|
19721 | ,
|
19722 | ,
|
19723 | ,
|
19724 |
|
19725 | (function(module, __webpack_exports__, __webpack_require__) {
|
19726 |
|
19727 | "use strict";
|
19728 | __webpack_require__.r(__webpack_exports__);
|
19729 | var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
19730 | __webpack_require__.d(__webpack_exports__, "Observable", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]; });
|
19731 |
|
19732 | var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165);
|
19733 | __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__["ConnectableObservable"]; });
|
19734 |
|
19735 | var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(170);
|
19736 | __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__["GroupedObservable"]; });
|
19737 |
|
19738 | var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(162);
|
19739 | __webpack_require__.d(__webpack_exports__, "observable", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__["observable"]; });
|
19740 |
|
19741 | var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(166);
|
19742 | __webpack_require__.d(__webpack_exports__, "Subject", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]; });
|
19743 |
|
19744 | var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(171);
|
19745 | __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]; });
|
19746 |
|
19747 | var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(172);
|
19748 | __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__["ReplaySubject"]; });
|
19749 |
|
19750 | var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(189);
|
19751 | __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__["AsyncSubject"]; });
|
19752 |
|
19753 | var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(190);
|
19754 | __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asap"]; });
|
19755 |
|
19756 | var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(194);
|
19757 | __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["async"]; });
|
19758 |
|
19759 | var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(173);
|
19760 | __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queue"]; });
|
19761 |
|
19762 | var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(195);
|
19763 | __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrame"]; });
|
19764 |
|
19765 | var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(198);
|
19766 | __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualTimeScheduler"]; });
|
19767 |
|
19768 | __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualAction"]; });
|
19769 |
|
19770 | var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(179);
|
19771 | __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__["Scheduler"]; });
|
19772 |
|
19773 | var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(156);
|
19774 | __webpack_require__.d(__webpack_exports__, "Subscription", function() { return _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__["Subscription"]; });
|
19775 |
|
19776 | var _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(150);
|
19777 | __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__["Subscriber"]; });
|
19778 |
|
19779 | var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(181);
|
19780 | __webpack_require__.d(__webpack_exports__, "Notification", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["Notification"]; });
|
19781 |
|
19782 | __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["NotificationKind"]; });
|
19783 |
|
19784 | var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(163);
|
19785 | __webpack_require__.d(__webpack_exports__, "pipe", function() { return _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__["pipe"]; });
|
19786 |
|
19787 | var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(164);
|
19788 | __webpack_require__.d(__webpack_exports__, "noop", function() { return _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__["noop"]; });
|
19789 |
|
19790 | var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(199);
|
19791 | __webpack_require__.d(__webpack_exports__, "identity", function() { return _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__["identity"]; });
|
19792 |
|
19793 | var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(200);
|
19794 | __webpack_require__.d(__webpack_exports__, "isObservable", function() { return _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__["isObservable"]; });
|
19795 |
|
19796 | var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(201);
|
19797 | __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__["ArgumentOutOfRangeError"]; });
|
19798 |
|
19799 | var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(202);
|
19800 | __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__["EmptyError"]; });
|
19801 |
|
19802 | var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(167);
|
19803 | __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__["ObjectUnsubscribedError"]; });
|
19804 |
|
19805 | var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(159);
|
19806 | __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__["UnsubscriptionError"]; });
|
19807 |
|
19808 | var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(203);
|
19809 | __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__["TimeoutError"]; });
|
19810 |
|
19811 | var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(204);
|
19812 | __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__["bindCallback"]; });
|
19813 |
|
19814 | var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(206);
|
19815 | __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__["bindNodeCallback"]; });
|
19816 |
|
19817 | var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(207);
|
19818 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__["combineLatest"]; });
|
19819 |
|
19820 | var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(218);
|
19821 | __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__["concat"]; });
|
19822 |
|
19823 | var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(229);
|
19824 | __webpack_require__.d(__webpack_exports__, "defer", function() { return _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__["defer"]; });
|
19825 |
|
19826 | var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(182);
|
19827 | __webpack_require__.d(__webpack_exports__, "empty", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["empty"]; });
|
19828 |
|
19829 | var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(230);
|
19830 | __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__["forkJoin"]; });
|
19831 |
|
19832 | var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(222);
|
19833 | __webpack_require__.d(__webpack_exports__, "from", function() { return _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__["from"]; });
|
19834 |
|
19835 | var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(231);
|
19836 | __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__["fromEvent"]; });
|
19837 |
|
19838 | var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(232);
|
19839 | __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__["fromEventPattern"]; });
|
19840 |
|
19841 | var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(233);
|
19842 | __webpack_require__.d(__webpack_exports__, "generate", function() { return _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__["generate"]; });
|
19843 |
|
19844 | var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(234);
|
19845 | __webpack_require__.d(__webpack_exports__, "iif", function() { return _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__["iif"]; });
|
19846 |
|
19847 | var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(235);
|
19848 | __webpack_require__.d(__webpack_exports__, "interval", function() { return _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__["interval"]; });
|
19849 |
|
19850 | var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(237);
|
19851 | __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__["merge"]; });
|
19852 |
|
19853 | var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(238);
|
19854 | __webpack_require__.d(__webpack_exports__, "never", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["never"]; });
|
19855 |
|
19856 | var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(183);
|
19857 | __webpack_require__.d(__webpack_exports__, "of", function() { return _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__["of"]; });
|
19858 |
|
19859 | var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(239);
|
19860 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__["onErrorResumeNext"]; });
|
19861 |
|
19862 | var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(240);
|
19863 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__["pairs"]; });
|
19864 |
|
19865 | var _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(241);
|
19866 | __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__["partition"]; });
|
19867 |
|
19868 | var _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(244);
|
19869 | __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__["race"]; });
|
19870 |
|
19871 | var _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(245);
|
19872 | __webpack_require__.d(__webpack_exports__, "range", function() { return _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__["range"]; });
|
19873 |
|
19874 | var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(188);
|
19875 | __webpack_require__.d(__webpack_exports__, "throwError", function() { return _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__["throwError"]; });
|
19876 |
|
19877 | var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(246);
|
19878 | __webpack_require__.d(__webpack_exports__, "timer", function() { return _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__["timer"]; });
|
19879 |
|
19880 | var _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(247);
|
19881 | __webpack_require__.d(__webpack_exports__, "using", function() { return _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__["using"]; });
|
19882 |
|
19883 | var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(248);
|
19884 | __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__["zip"]; });
|
19885 |
|
19886 | var _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(223);
|
19887 | __webpack_require__.d(__webpack_exports__, "scheduled", function() { return _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__["scheduled"]; });
|
19888 |
|
19889 | __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["EMPTY"]; });
|
19890 |
|
19891 | __webpack_require__.d(__webpack_exports__, "NEVER", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["NEVER"]; });
|
19892 |
|
19893 | var _internal_config__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(154);
|
19894 | __webpack_require__.d(__webpack_exports__, "config", function() { return _internal_config__WEBPACK_IMPORTED_MODULE_52__["config"]; });
|
19895 |
|
19896 |
|
19897 |
|
19898 |
|
19899 |
|
19900 |
|
19901 |
|
19902 |
|
19903 |
|
19904 |
|
19905 |
|
19906 |
|
19907 |
|
19908 |
|
19909 |
|
19910 |
|
19911 |
|
19912 |
|
19913 |
|
19914 |
|
19915 |
|
19916 |
|
19917 |
|
19918 |
|
19919 |
|
19920 |
|
19921 |
|
19922 |
|
19923 |
|
19924 |
|
19925 |
|
19926 |
|
19927 |
|
19928 |
|
19929 |
|
19930 |
|
19931 |
|
19932 |
|
19933 |
|
19934 |
|
19935 |
|
19936 |
|
19937 |
|
19938 |
|
19939 |
|
19940 |
|
19941 |
|
19942 |
|
19943 |
|
19944 |
|
19945 |
|
19946 |
|
19947 |
|
19948 |
|
19949 |
|
19950 |
|
19951 |
|
19952 |
|
19953 |
|
19954 |
|
19955 | }),
|
19956 |
|
19957 | (function(module, __webpack_exports__, __webpack_require__) {
|
19958 |
|
19959 | "use strict";
|
19960 | __webpack_require__.r(__webpack_exports__);
|
19961 | __webpack_require__.d(__webpack_exports__, "Observable", function() { return Observable; });
|
19962 | var _util_canReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(149);
|
19963 | var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(161);
|
19964 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(162);
|
19965 | var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(163);
|
19966 | var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(154);
|
19967 |
|
19968 |
|
19969 |
|
19970 |
|
19971 |
|
19972 |
|
19973 | var Observable = (function () {
|
19974 | function Observable(subscribe) {
|
19975 | this._isScalar = false;
|
19976 | if (subscribe) {
|
19977 | this._subscribe = subscribe;
|
19978 | }
|
19979 | }
|
19980 | Observable.prototype.lift = function (operator) {
|
19981 | var observable = new Observable();
|
19982 | observable.source = this;
|
19983 | observable.operator = operator;
|
19984 | return observable;
|
19985 | };
|
19986 | Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
19987 | var operator = this.operator;
|
19988 | var sink = Object(_util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__["toSubscriber"])(observerOrNext, error, complete);
|
19989 | if (operator) {
|
19990 | sink.add(operator.call(sink, this.source));
|
19991 | }
|
19992 | else {
|
19993 | sink.add(this.source || (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
|
19994 | this._subscribe(sink) :
|
19995 | this._trySubscribe(sink));
|
19996 | }
|
19997 | if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
|
19998 | if (sink.syncErrorThrowable) {
|
19999 | sink.syncErrorThrowable = false;
|
20000 | if (sink.syncErrorThrown) {
|
20001 | throw sink.syncErrorValue;
|
20002 | }
|
20003 | }
|
20004 | }
|
20005 | return sink;
|
20006 | };
|
20007 | Observable.prototype._trySubscribe = function (sink) {
|
20008 | try {
|
20009 | return this._subscribe(sink);
|
20010 | }
|
20011 | catch (err) {
|
20012 | if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
|
20013 | sink.syncErrorThrown = true;
|
20014 | sink.syncErrorValue = err;
|
20015 | }
|
20016 | if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_0__["canReportError"])(sink)) {
|
20017 | sink.error(err);
|
20018 | }
|
20019 | else {
|
20020 | console.warn(err);
|
20021 | }
|
20022 | }
|
20023 | };
|
20024 | Observable.prototype.forEach = function (next, promiseCtor) {
|
20025 | var _this = this;
|
20026 | promiseCtor = getPromiseCtor(promiseCtor);
|
20027 | return new promiseCtor(function (resolve, reject) {
|
20028 | var subscription;
|
20029 | subscription = _this.subscribe(function (value) {
|
20030 | try {
|
20031 | next(value);
|
20032 | }
|
20033 | catch (err) {
|
20034 | reject(err);
|
20035 | if (subscription) {
|
20036 | subscription.unsubscribe();
|
20037 | }
|
20038 | }
|
20039 | }, reject, resolve);
|
20040 | });
|
20041 | };
|
20042 | Observable.prototype._subscribe = function (subscriber) {
|
20043 | var source = this.source;
|
20044 | return source && source.subscribe(subscriber);
|
20045 | };
|
20046 | Observable.prototype[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]] = function () {
|
20047 | return this;
|
20048 | };
|
20049 | Observable.prototype.pipe = function () {
|
20050 | var operations = [];
|
20051 | for (var _i = 0; _i < arguments.length; _i++) {
|
20052 | operations[_i] = arguments[_i];
|
20053 | }
|
20054 | if (operations.length === 0) {
|
20055 | return this;
|
20056 | }
|
20057 | return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipeFromArray"])(operations)(this);
|
20058 | };
|
20059 | Observable.prototype.toPromise = function (promiseCtor) {
|
20060 | var _this = this;
|
20061 | promiseCtor = getPromiseCtor(promiseCtor);
|
20062 | return new promiseCtor(function (resolve, reject) {
|
20063 | var value;
|
20064 | _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
|
20065 | });
|
20066 | };
|
20067 | Observable.create = function (subscribe) {
|
20068 | return new Observable(subscribe);
|
20069 | };
|
20070 | return Observable;
|
20071 | }());
|
20072 |
|
20073 | function getPromiseCtor(promiseCtor) {
|
20074 | if (!promiseCtor) {
|
20075 | promiseCtor = _config__WEBPACK_IMPORTED_MODULE_4__["config"].Promise || Promise;
|
20076 | }
|
20077 | if (!promiseCtor) {
|
20078 | throw new Error('no Promise impl found');
|
20079 | }
|
20080 | return promiseCtor;
|
20081 | }
|
20082 |
|
20083 |
|
20084 |
|
20085 | }),
|
20086 |
|
20087 | (function(module, __webpack_exports__, __webpack_require__) {
|
20088 |
|
20089 | "use strict";
|
20090 | __webpack_require__.r(__webpack_exports__);
|
20091 | __webpack_require__.d(__webpack_exports__, "canReportError", function() { return canReportError; });
|
20092 | var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(150);
|
20093 |
|
20094 |
|
20095 | function canReportError(observer) {
|
20096 | while (observer) {
|
20097 | var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
|
20098 | if (closed_1 || isStopped) {
|
20099 | return false;
|
20100 | }
|
20101 | else if (destination && destination instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) {
|
20102 | observer = destination;
|
20103 | }
|
20104 | else {
|
20105 | observer = null;
|
20106 | }
|
20107 | }
|
20108 | return true;
|
20109 | }
|
20110 |
|
20111 |
|
20112 |
|
20113 | }),
|
20114 |
|
20115 | (function(module, __webpack_exports__, __webpack_require__) {
|
20116 |
|
20117 | "use strict";
|
20118 | __webpack_require__.r(__webpack_exports__);
|
20119 | __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return Subscriber; });
|
20120 | __webpack_require__.d(__webpack_exports__, "SafeSubscriber", function() { return SafeSubscriber; });
|
20121 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
20122 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(152);
|
20123 | var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(153);
|
20124 | var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(156);
|
20125 | var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(160);
|
20126 | var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(154);
|
20127 | var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(155);
|
20128 |
|
20129 |
|
20130 |
|
20131 |
|
20132 |
|
20133 |
|
20134 |
|
20135 |
|
20136 | var Subscriber = (function (_super) {
|
20137 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subscriber, _super);
|
20138 | function Subscriber(destinationOrNext, error, complete) {
|
20139 | var _this = _super.call(this) || this;
|
20140 | _this.syncErrorValue = null;
|
20141 | _this.syncErrorThrown = false;
|
20142 | _this.syncErrorThrowable = false;
|
20143 | _this.isStopped = false;
|
20144 | switch (arguments.length) {
|
20145 | case 0:
|
20146 | _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"];
|
20147 | break;
|
20148 | case 1:
|
20149 | if (!destinationOrNext) {
|
20150 | _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"];
|
20151 | break;
|
20152 | }
|
20153 | if (typeof destinationOrNext === 'object') {
|
20154 | if (destinationOrNext instanceof Subscriber) {
|
20155 | _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
|
20156 | _this.destination = destinationOrNext;
|
20157 | destinationOrNext.add(_this);
|
20158 | }
|
20159 | else {
|
20160 | _this.syncErrorThrowable = true;
|
20161 | _this.destination = new SafeSubscriber(_this, destinationOrNext);
|
20162 | }
|
20163 | break;
|
20164 | }
|
20165 | default:
|
20166 | _this.syncErrorThrowable = true;
|
20167 | _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
|
20168 | break;
|
20169 | }
|
20170 | return _this;
|
20171 | }
|
20172 | Subscriber.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]] = function () { return this; };
|
20173 | Subscriber.create = function (next, error, complete) {
|
20174 | var subscriber = new Subscriber(next, error, complete);
|
20175 | subscriber.syncErrorThrowable = false;
|
20176 | return subscriber;
|
20177 | };
|
20178 | Subscriber.prototype.next = function (value) {
|
20179 | if (!this.isStopped) {
|
20180 | this._next(value);
|
20181 | }
|
20182 | };
|
20183 | Subscriber.prototype.error = function (err) {
|
20184 | if (!this.isStopped) {
|
20185 | this.isStopped = true;
|
20186 | this._error(err);
|
20187 | }
|
20188 | };
|
20189 | Subscriber.prototype.complete = function () {
|
20190 | if (!this.isStopped) {
|
20191 | this.isStopped = true;
|
20192 | this._complete();
|
20193 | }
|
20194 | };
|
20195 | Subscriber.prototype.unsubscribe = function () {
|
20196 | if (this.closed) {
|
20197 | return;
|
20198 | }
|
20199 | this.isStopped = true;
|
20200 | _super.prototype.unsubscribe.call(this);
|
20201 | };
|
20202 | Subscriber.prototype._next = function (value) {
|
20203 | this.destination.next(value);
|
20204 | };
|
20205 | Subscriber.prototype._error = function (err) {
|
20206 | this.destination.error(err);
|
20207 | this.unsubscribe();
|
20208 | };
|
20209 | Subscriber.prototype._complete = function () {
|
20210 | this.destination.complete();
|
20211 | this.unsubscribe();
|
20212 | };
|
20213 | Subscriber.prototype._unsubscribeAndRecycle = function () {
|
20214 | var _parentOrParents = this._parentOrParents;
|
20215 | this._parentOrParents = null;
|
20216 | this.unsubscribe();
|
20217 | this.closed = false;
|
20218 | this.isStopped = false;
|
20219 | this._parentOrParents = _parentOrParents;
|
20220 | return this;
|
20221 | };
|
20222 | return Subscriber;
|
20223 | }(_Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"]));
|
20224 |
|
20225 | var SafeSubscriber = (function (_super) {
|
20226 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SafeSubscriber, _super);
|
20227 | function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
|
20228 | var _this = _super.call(this) || this;
|
20229 | _this._parentSubscriber = _parentSubscriber;
|
20230 | var next;
|
20231 | var context = _this;
|
20232 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(observerOrNext)) {
|
20233 | next = observerOrNext;
|
20234 | }
|
20235 | else if (observerOrNext) {
|
20236 | next = observerOrNext.next;
|
20237 | error = observerOrNext.error;
|
20238 | complete = observerOrNext.complete;
|
20239 | if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]) {
|
20240 | context = Object.create(observerOrNext);
|
20241 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(context.unsubscribe)) {
|
20242 | _this.add(context.unsubscribe.bind(context));
|
20243 | }
|
20244 | context.unsubscribe = _this.unsubscribe.bind(_this);
|
20245 | }
|
20246 | }
|
20247 | _this._context = context;
|
20248 | _this._next = next;
|
20249 | _this._error = error;
|
20250 | _this._complete = complete;
|
20251 | return _this;
|
20252 | }
|
20253 | SafeSubscriber.prototype.next = function (value) {
|
20254 | if (!this.isStopped && this._next) {
|
20255 | var _parentSubscriber = this._parentSubscriber;
|
20256 | if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
20257 | this.__tryOrUnsub(this._next, value);
|
20258 | }
|
20259 | else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
20260 | this.unsubscribe();
|
20261 | }
|
20262 | }
|
20263 | };
|
20264 | SafeSubscriber.prototype.error = function (err) {
|
20265 | if (!this.isStopped) {
|
20266 | var _parentSubscriber = this._parentSubscriber;
|
20267 | var useDeprecatedSynchronousErrorHandling = _config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling;
|
20268 | if (this._error) {
|
20269 | if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
20270 | this.__tryOrUnsub(this._error, err);
|
20271 | this.unsubscribe();
|
20272 | }
|
20273 | else {
|
20274 | this.__tryOrSetError(_parentSubscriber, this._error, err);
|
20275 | this.unsubscribe();
|
20276 | }
|
20277 | }
|
20278 | else if (!_parentSubscriber.syncErrorThrowable) {
|
20279 | this.unsubscribe();
|
20280 | if (useDeprecatedSynchronousErrorHandling) {
|
20281 | throw err;
|
20282 | }
|
20283 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
20284 | }
|
20285 | else {
|
20286 | if (useDeprecatedSynchronousErrorHandling) {
|
20287 | _parentSubscriber.syncErrorValue = err;
|
20288 | _parentSubscriber.syncErrorThrown = true;
|
20289 | }
|
20290 | else {
|
20291 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
20292 | }
|
20293 | this.unsubscribe();
|
20294 | }
|
20295 | }
|
20296 | };
|
20297 | SafeSubscriber.prototype.complete = function () {
|
20298 | var _this = this;
|
20299 | if (!this.isStopped) {
|
20300 | var _parentSubscriber = this._parentSubscriber;
|
20301 | if (this._complete) {
|
20302 | var wrappedComplete = function () { return _this._complete.call(_this._context); };
|
20303 | if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
20304 | this.__tryOrUnsub(wrappedComplete);
|
20305 | this.unsubscribe();
|
20306 | }
|
20307 | else {
|
20308 | this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
20309 | this.unsubscribe();
|
20310 | }
|
20311 | }
|
20312 | else {
|
20313 | this.unsubscribe();
|
20314 | }
|
20315 | }
|
20316 | };
|
20317 | SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
|
20318 | try {
|
20319 | fn.call(this._context, value);
|
20320 | }
|
20321 | catch (err) {
|
20322 | this.unsubscribe();
|
20323 | if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
|
20324 | throw err;
|
20325 | }
|
20326 | else {
|
20327 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
20328 | }
|
20329 | }
|
20330 | };
|
20331 | SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
|
20332 | if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
|
20333 | throw new Error('bad call');
|
20334 | }
|
20335 | try {
|
20336 | fn.call(this._context, value);
|
20337 | }
|
20338 | catch (err) {
|
20339 | if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) {
|
20340 | parent.syncErrorValue = err;
|
20341 | parent.syncErrorThrown = true;
|
20342 | return true;
|
20343 | }
|
20344 | else {
|
20345 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err);
|
20346 | return true;
|
20347 | }
|
20348 | }
|
20349 | return false;
|
20350 | };
|
20351 | SafeSubscriber.prototype._unsubscribe = function () {
|
20352 | var _parentSubscriber = this._parentSubscriber;
|
20353 | this._context = null;
|
20354 | this._parentSubscriber = null;
|
20355 | _parentSubscriber.unsubscribe();
|
20356 | };
|
20357 | return SafeSubscriber;
|
20358 | }(Subscriber));
|
20359 |
|
20360 |
|
20361 |
|
20362 |
|
20363 | }),
|
20364 |
|
20365 | (function(module, __webpack_exports__, __webpack_require__) {
|
20366 |
|
20367 | "use strict";
|
20368 | __webpack_require__.r(__webpack_exports__);
|
20369 | __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
|
20370 | __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
|
20371 | __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
|
20372 | __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
|
20373 | __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
|
20374 | __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
|
20375 | __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
|
20376 | __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
|
20377 | __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
|
20378 | __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
|
20379 | __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
|
20380 | __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
|
20381 | __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
|
20382 | __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
|
20383 | __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
|
20384 | __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
|
20385 | __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
|
20386 | __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
|
20387 | __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
|
20388 | __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
|
20389 |
|
20390 |
|
20391 |
|
20392 |
|
20393 |
|
20394 |
|
20395 |
|
20396 |
|
20397 |
|
20398 |
|
20399 |
|
20400 |
|
20401 |
|
20402 |
|
20403 |
|
20404 |
|
20405 | var extendStatics = function(d, b) {
|
20406 | extendStatics = Object.setPrototypeOf ||
|
20407 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
20408 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
20409 | return extendStatics(d, b);
|
20410 | };
|
20411 |
|
20412 | function __extends(d, b) {
|
20413 | extendStatics(d, b);
|
20414 | function __() { this.constructor = d; }
|
20415 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
20416 | }
|
20417 |
|
20418 | var __assign = function() {
|
20419 | __assign = Object.assign || function __assign(t) {
|
20420 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
20421 | s = arguments[i];
|
20422 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
20423 | }
|
20424 | return t;
|
20425 | }
|
20426 | return __assign.apply(this, arguments);
|
20427 | }
|
20428 |
|
20429 | function __rest(s, e) {
|
20430 | var t = {};
|
20431 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
20432 | t[p] = s[p];
|
20433 | if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
20434 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
20435 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
20436 | t[p[i]] = s[p[i]];
|
20437 | }
|
20438 | return t;
|
20439 | }
|
20440 |
|
20441 | function __decorate(decorators, target, key, desc) {
|
20442 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
20443 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20444 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
20445 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
20446 | }
|
20447 |
|
20448 | function __param(paramIndex, decorator) {
|
20449 | return function (target, key) { decorator(target, key, paramIndex); }
|
20450 | }
|
20451 |
|
20452 | function __metadata(metadataKey, metadataValue) {
|
20453 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
20454 | }
|
20455 |
|
20456 | function __awaiter(thisArg, _arguments, P, generator) {
|
20457 | return new (P || (P = Promise))(function (resolve, reject) {
|
20458 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
20459 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
20460 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
20461 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
20462 | });
|
20463 | }
|
20464 |
|
20465 | function __generator(thisArg, body) {
|
20466 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
20467 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
20468 | function verb(n) { return function (v) { return step([n, v]); }; }
|
20469 | function step(op) {
|
20470 | if (f) throw new TypeError("Generator is already executing.");
|
20471 | while (_) try {
|
20472 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
20473 | if (y = 0, t) op = [op[0] & 2, t.value];
|
20474 | switch (op[0]) {
|
20475 | case 0: case 1: t = op; break;
|
20476 | case 4: _.label++; return { value: op[1], done: false };
|
20477 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
20478 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
20479 | default:
|
20480 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
20481 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
20482 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
20483 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
20484 | if (t[2]) _.ops.pop();
|
20485 | _.trys.pop(); continue;
|
20486 | }
|
20487 | op = body.call(thisArg, _);
|
20488 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
20489 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
20490 | }
|
20491 | }
|
20492 |
|
20493 | function __exportStar(m, exports) {
|
20494 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
20495 | }
|
20496 |
|
20497 | function __values(o) {
|
20498 | var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
20499 | if (m) return m.call(o);
|
20500 | return {
|
20501 | next: function () {
|
20502 | if (o && i >= o.length) o = void 0;
|
20503 | return { value: o && o[i++], done: !o };
|
20504 | }
|
20505 | };
|
20506 | }
|
20507 |
|
20508 | function __read(o, n) {
|
20509 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
20510 | if (!m) return o;
|
20511 | var i = m.call(o), r, ar = [], e;
|
20512 | try {
|
20513 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
20514 | }
|
20515 | catch (error) { e = { error: error }; }
|
20516 | finally {
|
20517 | try {
|
20518 | if (r && !r.done && (m = i["return"])) m.call(i);
|
20519 | }
|
20520 | finally { if (e) throw e.error; }
|
20521 | }
|
20522 | return ar;
|
20523 | }
|
20524 |
|
20525 | function __spread() {
|
20526 | for (var ar = [], i = 0; i < arguments.length; i++)
|
20527 | ar = ar.concat(__read(arguments[i]));
|
20528 | return ar;
|
20529 | }
|
20530 |
|
20531 | function __spreadArrays() {
|
20532 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
20533 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
20534 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
20535 | r[k] = a[j];
|
20536 | return r;
|
20537 | };
|
20538 |
|
20539 | function __await(v) {
|
20540 | return this instanceof __await ? (this.v = v, this) : new __await(v);
|
20541 | }
|
20542 |
|
20543 | function __asyncGenerator(thisArg, _arguments, generator) {
|
20544 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
20545 | var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
20546 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
20547 | function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
20548 | function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
20549 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
20550 | function fulfill(value) { resume("next", value); }
|
20551 | function reject(value) { resume("throw", value); }
|
20552 | function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
20553 | }
|
20554 |
|
20555 | function __asyncDelegator(o) {
|
20556 | var i, p;
|
20557 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
20558 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
20559 | }
|
20560 |
|
20561 | function __asyncValues(o) {
|
20562 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
20563 | var m = o[Symbol.asyncIterator], i;
|
20564 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
20565 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
20566 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
20567 | }
|
20568 |
|
20569 | function __makeTemplateObject(cooked, raw) {
|
20570 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
20571 | return cooked;
|
20572 | };
|
20573 |
|
20574 | function __importStar(mod) {
|
20575 | if (mod && mod.__esModule) return mod;
|
20576 | var result = {};
|
20577 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
20578 | result.default = mod;
|
20579 | return result;
|
20580 | }
|
20581 |
|
20582 | function __importDefault(mod) {
|
20583 | return (mod && mod.__esModule) ? mod : { default: mod };
|
20584 | }
|
20585 |
|
20586 |
|
20587 | }),
|
20588 |
|
20589 | (function(module, __webpack_exports__, __webpack_require__) {
|
20590 |
|
20591 | "use strict";
|
20592 | __webpack_require__.r(__webpack_exports__);
|
20593 | __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; });
|
20594 |
|
20595 | function isFunction(x) {
|
20596 | return typeof x === 'function';
|
20597 | }
|
20598 |
|
20599 |
|
20600 |
|
20601 | }),
|
20602 |
|
20603 | (function(module, __webpack_exports__, __webpack_require__) {
|
20604 |
|
20605 | "use strict";
|
20606 | __webpack_require__.r(__webpack_exports__);
|
20607 | __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
|
20608 | var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(154);
|
20609 | var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(155);
|
20610 |
|
20611 |
|
20612 |
|
20613 | var empty = {
|
20614 | closed: true,
|
20615 | next: function (value) { },
|
20616 | error: function (err) {
|
20617 | if (_config__WEBPACK_IMPORTED_MODULE_0__["config"].useDeprecatedSynchronousErrorHandling) {
|
20618 | throw err;
|
20619 | }
|
20620 | else {
|
20621 | Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__["hostReportError"])(err);
|
20622 | }
|
20623 | },
|
20624 | complete: function () { }
|
20625 | };
|
20626 |
|
20627 |
|
20628 |
|
20629 | }),
|
20630 |
|
20631 | (function(module, __webpack_exports__, __webpack_require__) {
|
20632 |
|
20633 | "use strict";
|
20634 | __webpack_require__.r(__webpack_exports__);
|
20635 | __webpack_require__.d(__webpack_exports__, "config", function() { return config; });
|
20636 |
|
20637 | var _enable_super_gross_mode_that_will_cause_bad_things = false;
|
20638 | var config = {
|
20639 | Promise: undefined,
|
20640 | set useDeprecatedSynchronousErrorHandling(value) {
|
20641 | if (value) {
|
20642 | var error = new Error();
|
20643 | console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
|
20644 | }
|
20645 | else if (_enable_super_gross_mode_that_will_cause_bad_things) {
|
20646 | console.log('RxJS: Back to a better error behavior. Thank you. <3');
|
20647 | }
|
20648 | _enable_super_gross_mode_that_will_cause_bad_things = value;
|
20649 | },
|
20650 | get useDeprecatedSynchronousErrorHandling() {
|
20651 | return _enable_super_gross_mode_that_will_cause_bad_things;
|
20652 | },
|
20653 | };
|
20654 |
|
20655 |
|
20656 |
|
20657 | }),
|
20658 |
|
20659 | (function(module, __webpack_exports__, __webpack_require__) {
|
20660 |
|
20661 | "use strict";
|
20662 | __webpack_require__.r(__webpack_exports__);
|
20663 | __webpack_require__.d(__webpack_exports__, "hostReportError", function() { return hostReportError; });
|
20664 |
|
20665 | function hostReportError(err) {
|
20666 | setTimeout(function () { throw err; }, 0);
|
20667 | }
|
20668 |
|
20669 |
|
20670 |
|
20671 | }),
|
20672 |
|
20673 | (function(module, __webpack_exports__, __webpack_require__) {
|
20674 |
|
20675 | "use strict";
|
20676 | __webpack_require__.r(__webpack_exports__);
|
20677 | __webpack_require__.d(__webpack_exports__, "Subscription", function() { return Subscription; });
|
20678 | var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(157);
|
20679 | var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(158);
|
20680 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(152);
|
20681 | var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(159);
|
20682 |
|
20683 |
|
20684 |
|
20685 |
|
20686 |
|
20687 | var Subscription = (function () {
|
20688 | function Subscription(unsubscribe) {
|
20689 | this.closed = false;
|
20690 | this._parentOrParents = null;
|
20691 | this._subscriptions = null;
|
20692 | if (unsubscribe) {
|
20693 | this._unsubscribe = unsubscribe;
|
20694 | }
|
20695 | }
|
20696 | Subscription.prototype.unsubscribe = function () {
|
20697 | var errors;
|
20698 | if (this.closed) {
|
20699 | return;
|
20700 | }
|
20701 | var _a = this, _parentOrParents = _a._parentOrParents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
|
20702 | this.closed = true;
|
20703 | this._parentOrParents = null;
|
20704 | this._subscriptions = null;
|
20705 | if (_parentOrParents instanceof Subscription) {
|
20706 | _parentOrParents.remove(this);
|
20707 | }
|
20708 | else if (_parentOrParents !== null) {
|
20709 | for (var index = 0; index < _parentOrParents.length; ++index) {
|
20710 | var parent_1 = _parentOrParents[index];
|
20711 | parent_1.remove(this);
|
20712 | }
|
20713 | }
|
20714 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(_unsubscribe)) {
|
20715 | try {
|
20716 | _unsubscribe.call(this);
|
20717 | }
|
20718 | catch (e) {
|
20719 | errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"] ? flattenUnsubscriptionErrors(e.errors) : [e];
|
20720 | }
|
20721 | }
|
20722 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(_subscriptions)) {
|
20723 | var index = -1;
|
20724 | var len = _subscriptions.length;
|
20725 | while (++index < len) {
|
20726 | var sub = _subscriptions[index];
|
20727 | if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_1__["isObject"])(sub)) {
|
20728 | try {
|
20729 | sub.unsubscribe();
|
20730 | }
|
20731 | catch (e) {
|
20732 | errors = errors || [];
|
20733 | if (e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) {
|
20734 | errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
|
20735 | }
|
20736 | else {
|
20737 | errors.push(e);
|
20738 | }
|
20739 | }
|
20740 | }
|
20741 | }
|
20742 | }
|
20743 | if (errors) {
|
20744 | throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"](errors);
|
20745 | }
|
20746 | };
|
20747 | Subscription.prototype.add = function (teardown) {
|
20748 | var subscription = teardown;
|
20749 | if (!teardown) {
|
20750 | return Subscription.EMPTY;
|
20751 | }
|
20752 | switch (typeof teardown) {
|
20753 | case 'function':
|
20754 | subscription = new Subscription(teardown);
|
20755 | case 'object':
|
20756 | if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
|
20757 | return subscription;
|
20758 | }
|
20759 | else if (this.closed) {
|
20760 | subscription.unsubscribe();
|
20761 | return subscription;
|
20762 | }
|
20763 | else if (!(subscription instanceof Subscription)) {
|
20764 | var tmp = subscription;
|
20765 | subscription = new Subscription();
|
20766 | subscription._subscriptions = [tmp];
|
20767 | }
|
20768 | break;
|
20769 | default: {
|
20770 | throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
|
20771 | }
|
20772 | }
|
20773 | var _parentOrParents = subscription._parentOrParents;
|
20774 | if (_parentOrParents === null) {
|
20775 | subscription._parentOrParents = this;
|
20776 | }
|
20777 | else if (_parentOrParents instanceof Subscription) {
|
20778 | if (_parentOrParents === this) {
|
20779 | return subscription;
|
20780 | }
|
20781 | subscription._parentOrParents = [_parentOrParents, this];
|
20782 | }
|
20783 | else if (_parentOrParents.indexOf(this) === -1) {
|
20784 | _parentOrParents.push(this);
|
20785 | }
|
20786 | else {
|
20787 | return subscription;
|
20788 | }
|
20789 | var subscriptions = this._subscriptions;
|
20790 | if (subscriptions === null) {
|
20791 | this._subscriptions = [subscription];
|
20792 | }
|
20793 | else {
|
20794 | subscriptions.push(subscription);
|
20795 | }
|
20796 | return subscription;
|
20797 | };
|
20798 | Subscription.prototype.remove = function (subscription) {
|
20799 | var subscriptions = this._subscriptions;
|
20800 | if (subscriptions) {
|
20801 | var subscriptionIndex = subscriptions.indexOf(subscription);
|
20802 | if (subscriptionIndex !== -1) {
|
20803 | subscriptions.splice(subscriptionIndex, 1);
|
20804 | }
|
20805 | }
|
20806 | };
|
20807 | Subscription.EMPTY = (function (empty) {
|
20808 | empty.closed = true;
|
20809 | return empty;
|
20810 | }(new Subscription()));
|
20811 | return Subscription;
|
20812 | }());
|
20813 |
|
20814 | function flattenUnsubscriptionErrors(errors) {
|
20815 | return errors.reduce(function (errs, err) { return errs.concat((err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) ? err.errors : err); }, []);
|
20816 | }
|
20817 |
|
20818 |
|
20819 |
|
20820 | }),
|
20821 |
|
20822 | (function(module, __webpack_exports__, __webpack_require__) {
|
20823 |
|
20824 | "use strict";
|
20825 | __webpack_require__.r(__webpack_exports__);
|
20826 | __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; });
|
20827 |
|
20828 | var isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });
|
20829 |
|
20830 |
|
20831 |
|
20832 | }),
|
20833 |
|
20834 | (function(module, __webpack_exports__, __webpack_require__) {
|
20835 |
|
20836 | "use strict";
|
20837 | __webpack_require__.r(__webpack_exports__);
|
20838 | __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
|
20839 |
|
20840 | function isObject(x) {
|
20841 | return x !== null && typeof x === 'object';
|
20842 | }
|
20843 |
|
20844 |
|
20845 |
|
20846 | }),
|
20847 |
|
20848 | (function(module, __webpack_exports__, __webpack_require__) {
|
20849 |
|
20850 | "use strict";
|
20851 | __webpack_require__.r(__webpack_exports__);
|
20852 | __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return UnsubscriptionError; });
|
20853 |
|
20854 | function UnsubscriptionErrorImpl(errors) {
|
20855 | Error.call(this);
|
20856 | this.message = errors ?
|
20857 | errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
|
20858 | this.name = 'UnsubscriptionError';
|
20859 | this.errors = errors;
|
20860 | return this;
|
20861 | }
|
20862 | UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
|
20863 | var UnsubscriptionError = UnsubscriptionErrorImpl;
|
20864 |
|
20865 |
|
20866 |
|
20867 | }),
|
20868 |
|
20869 | (function(module, __webpack_exports__, __webpack_require__) {
|
20870 |
|
20871 | "use strict";
|
20872 | __webpack_require__.r(__webpack_exports__);
|
20873 | __webpack_require__.d(__webpack_exports__, "rxSubscriber", function() { return rxSubscriber; });
|
20874 | __webpack_require__.d(__webpack_exports__, "$$rxSubscriber", function() { return $$rxSubscriber; });
|
20875 |
|
20876 | var rxSubscriber = typeof Symbol === 'function'
|
20877 | ? Symbol('rxSubscriber')
|
20878 | : '@@rxSubscriber_' + Math.random();
|
20879 | var $$rxSubscriber = rxSubscriber;
|
20880 |
|
20881 |
|
20882 |
|
20883 | }),
|
20884 |
|
20885 | (function(module, __webpack_exports__, __webpack_require__) {
|
20886 |
|
20887 | "use strict";
|
20888 | __webpack_require__.r(__webpack_exports__);
|
20889 | __webpack_require__.d(__webpack_exports__, "toSubscriber", function() { return toSubscriber; });
|
20890 | var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(150);
|
20891 | var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(160);
|
20892 | var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(153);
|
20893 |
|
20894 |
|
20895 |
|
20896 |
|
20897 | function toSubscriber(nextOrObserver, error, complete) {
|
20898 | if (nextOrObserver) {
|
20899 | if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) {
|
20900 | return nextOrObserver;
|
20901 | }
|
20902 | if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]) {
|
20903 | return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]();
|
20904 | }
|
20905 | }
|
20906 | if (!nextOrObserver && !error && !complete) {
|
20907 | return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](_Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]);
|
20908 | }
|
20909 | return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](nextOrObserver, error, complete);
|
20910 | }
|
20911 |
|
20912 |
|
20913 |
|
20914 | }),
|
20915 |
|
20916 | (function(module, __webpack_exports__, __webpack_require__) {
|
20917 |
|
20918 | "use strict";
|
20919 | __webpack_require__.r(__webpack_exports__);
|
20920 | __webpack_require__.d(__webpack_exports__, "observable", function() { return observable; });
|
20921 |
|
20922 | var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable';
|
20923 |
|
20924 |
|
20925 |
|
20926 | }),
|
20927 |
|
20928 | (function(module, __webpack_exports__, __webpack_require__) {
|
20929 |
|
20930 | "use strict";
|
20931 | __webpack_require__.r(__webpack_exports__);
|
20932 | __webpack_require__.d(__webpack_exports__, "pipe", function() { return pipe; });
|
20933 | __webpack_require__.d(__webpack_exports__, "pipeFromArray", function() { return pipeFromArray; });
|
20934 | var _noop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(164);
|
20935 |
|
20936 |
|
20937 | function pipe() {
|
20938 | var fns = [];
|
20939 | for (var _i = 0; _i < arguments.length; _i++) {
|
20940 | fns[_i] = arguments[_i];
|
20941 | }
|
20942 | return pipeFromArray(fns);
|
20943 | }
|
20944 | function pipeFromArray(fns) {
|
20945 | if (!fns) {
|
20946 | return _noop__WEBPACK_IMPORTED_MODULE_0__["noop"];
|
20947 | }
|
20948 | if (fns.length === 1) {
|
20949 | return fns[0];
|
20950 | }
|
20951 | return function piped(input) {
|
20952 | return fns.reduce(function (prev, fn) { return fn(prev); }, input);
|
20953 | };
|
20954 | }
|
20955 |
|
20956 |
|
20957 |
|
20958 | }),
|
20959 |
|
20960 | (function(module, __webpack_exports__, __webpack_require__) {
|
20961 |
|
20962 | "use strict";
|
20963 | __webpack_require__.r(__webpack_exports__);
|
20964 | __webpack_require__.d(__webpack_exports__, "noop", function() { return noop; });
|
20965 |
|
20966 | function noop() { }
|
20967 |
|
20968 |
|
20969 |
|
20970 | }),
|
20971 |
|
20972 | (function(module, __webpack_exports__, __webpack_require__) {
|
20973 |
|
20974 | "use strict";
|
20975 | __webpack_require__.r(__webpack_exports__);
|
20976 | __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return ConnectableObservable; });
|
20977 | __webpack_require__.d(__webpack_exports__, "connectableObservableDescriptor", function() { return connectableObservableDescriptor; });
|
20978 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
20979 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
20980 | var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148);
|
20981 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(150);
|
20982 | var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(156);
|
20983 | var _operators_refCount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(169);
|
20984 |
|
20985 |
|
20986 |
|
20987 |
|
20988 |
|
20989 |
|
20990 |
|
20991 | var ConnectableObservable = (function (_super) {
|
20992 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableObservable, _super);
|
20993 | function ConnectableObservable(source, subjectFactory) {
|
20994 | var _this = _super.call(this) || this;
|
20995 | _this.source = source;
|
20996 | _this.subjectFactory = subjectFactory;
|
20997 | _this._refCount = 0;
|
20998 | _this._isComplete = false;
|
20999 | return _this;
|
21000 | }
|
21001 | ConnectableObservable.prototype._subscribe = function (subscriber) {
|
21002 | return this.getSubject().subscribe(subscriber);
|
21003 | };
|
21004 | ConnectableObservable.prototype.getSubject = function () {
|
21005 | var subject = this._subject;
|
21006 | if (!subject || subject.isStopped) {
|
21007 | this._subject = this.subjectFactory();
|
21008 | }
|
21009 | return this._subject;
|
21010 | };
|
21011 | ConnectableObservable.prototype.connect = function () {
|
21012 | var connection = this._connection;
|
21013 | if (!connection) {
|
21014 | this._isComplete = false;
|
21015 | connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"]();
|
21016 | connection.add(this.source
|
21017 | .subscribe(new ConnectableSubscriber(this.getSubject(), this)));
|
21018 | if (connection.closed) {
|
21019 | this._connection = null;
|
21020 | connection = _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY;
|
21021 | }
|
21022 | }
|
21023 | return connection;
|
21024 | };
|
21025 | ConnectableObservable.prototype.refCount = function () {
|
21026 | return Object(_operators_refCount__WEBPACK_IMPORTED_MODULE_5__["refCount"])()(this);
|
21027 | };
|
21028 | return ConnectableObservable;
|
21029 | }(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]));
|
21030 |
|
21031 | var connectableProto = ConnectableObservable.prototype;
|
21032 | var connectableObservableDescriptor = {
|
21033 | operator: { value: null },
|
21034 | _refCount: { value: 0, writable: true },
|
21035 | _subject: { value: null, writable: true },
|
21036 | _connection: { value: null, writable: true },
|
21037 | _subscribe: { value: connectableProto._subscribe },
|
21038 | _isComplete: { value: connectableProto._isComplete, writable: true },
|
21039 | getSubject: { value: connectableProto.getSubject },
|
21040 | connect: { value: connectableProto.connect },
|
21041 | refCount: { value: connectableProto.refCount }
|
21042 | };
|
21043 | var ConnectableSubscriber = (function (_super) {
|
21044 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableSubscriber, _super);
|
21045 | function ConnectableSubscriber(destination, connectable) {
|
21046 | var _this = _super.call(this, destination) || this;
|
21047 | _this.connectable = connectable;
|
21048 | return _this;
|
21049 | }
|
21050 | ConnectableSubscriber.prototype._error = function (err) {
|
21051 | this._unsubscribe();
|
21052 | _super.prototype._error.call(this, err);
|
21053 | };
|
21054 | ConnectableSubscriber.prototype._complete = function () {
|
21055 | this.connectable._isComplete = true;
|
21056 | this._unsubscribe();
|
21057 | _super.prototype._complete.call(this);
|
21058 | };
|
21059 | ConnectableSubscriber.prototype._unsubscribe = function () {
|
21060 | var connectable = this.connectable;
|
21061 | if (connectable) {
|
21062 | this.connectable = null;
|
21063 | var connection = connectable._connection;
|
21064 | connectable._refCount = 0;
|
21065 | connectable._subject = null;
|
21066 | connectable._connection = null;
|
21067 | if (connection) {
|
21068 | connection.unsubscribe();
|
21069 | }
|
21070 | }
|
21071 | };
|
21072 | return ConnectableSubscriber;
|
21073 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["SubjectSubscriber"]));
|
21074 | var RefCountOperator = (function () {
|
21075 | function RefCountOperator(connectable) {
|
21076 | this.connectable = connectable;
|
21077 | }
|
21078 | RefCountOperator.prototype.call = function (subscriber, source) {
|
21079 | var connectable = this.connectable;
|
21080 | connectable._refCount++;
|
21081 | var refCounter = new RefCountSubscriber(subscriber, connectable);
|
21082 | var subscription = source.subscribe(refCounter);
|
21083 | if (!refCounter.closed) {
|
21084 | refCounter.connection = connectable.connect();
|
21085 | }
|
21086 | return subscription;
|
21087 | };
|
21088 | return RefCountOperator;
|
21089 | }());
|
21090 | var RefCountSubscriber = (function (_super) {
|
21091 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super);
|
21092 | function RefCountSubscriber(destination, connectable) {
|
21093 | var _this = _super.call(this, destination) || this;
|
21094 | _this.connectable = connectable;
|
21095 | return _this;
|
21096 | }
|
21097 | RefCountSubscriber.prototype._unsubscribe = function () {
|
21098 | var connectable = this.connectable;
|
21099 | if (!connectable) {
|
21100 | this.connection = null;
|
21101 | return;
|
21102 | }
|
21103 | this.connectable = null;
|
21104 | var refCount = connectable._refCount;
|
21105 | if (refCount <= 0) {
|
21106 | this.connection = null;
|
21107 | return;
|
21108 | }
|
21109 | connectable._refCount = refCount - 1;
|
21110 | if (refCount > 1) {
|
21111 | this.connection = null;
|
21112 | return;
|
21113 | }
|
21114 | var connection = this.connection;
|
21115 | var sharedConnection = connectable._connection;
|
21116 | this.connection = null;
|
21117 | if (sharedConnection && (!connection || sharedConnection === connection)) {
|
21118 | sharedConnection.unsubscribe();
|
21119 | }
|
21120 | };
|
21121 | return RefCountSubscriber;
|
21122 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
21123 |
|
21124 |
|
21125 |
|
21126 | }),
|
21127 |
|
21128 | (function(module, __webpack_exports__, __webpack_require__) {
|
21129 |
|
21130 | "use strict";
|
21131 | __webpack_require__.r(__webpack_exports__);
|
21132 | __webpack_require__.d(__webpack_exports__, "SubjectSubscriber", function() { return SubjectSubscriber; });
|
21133 | __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; });
|
21134 | __webpack_require__.d(__webpack_exports__, "AnonymousSubject", function() { return AnonymousSubject; });
|
21135 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21136 | var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148);
|
21137 | var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(150);
|
21138 | var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(156);
|
21139 | var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(167);
|
21140 | var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(168);
|
21141 | var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(160);
|
21142 |
|
21143 |
|
21144 |
|
21145 |
|
21146 |
|
21147 |
|
21148 |
|
21149 |
|
21150 | var SubjectSubscriber = (function (_super) {
|
21151 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscriber, _super);
|
21152 | function SubjectSubscriber(destination) {
|
21153 | var _this = _super.call(this, destination) || this;
|
21154 | _this.destination = destination;
|
21155 | return _this;
|
21156 | }
|
21157 | return SubjectSubscriber;
|
21158 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
|
21159 |
|
21160 | var Subject = (function (_super) {
|
21161 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subject, _super);
|
21162 | function Subject() {
|
21163 | var _this = _super.call(this) || this;
|
21164 | _this.observers = [];
|
21165 | _this.closed = false;
|
21166 | _this.isStopped = false;
|
21167 | _this.hasError = false;
|
21168 | _this.thrownError = null;
|
21169 | return _this;
|
21170 | }
|
21171 | Subject.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__["rxSubscriber"]] = function () {
|
21172 | return new SubjectSubscriber(this);
|
21173 | };
|
21174 | Subject.prototype.lift = function (operator) {
|
21175 | var subject = new AnonymousSubject(this, this);
|
21176 | subject.operator = operator;
|
21177 | return subject;
|
21178 | };
|
21179 | Subject.prototype.next = function (value) {
|
21180 | if (this.closed) {
|
21181 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
21182 | }
|
21183 | if (!this.isStopped) {
|
21184 | var observers = this.observers;
|
21185 | var len = observers.length;
|
21186 | var copy = observers.slice();
|
21187 | for (var i = 0; i < len; i++) {
|
21188 | copy[i].next(value);
|
21189 | }
|
21190 | }
|
21191 | };
|
21192 | Subject.prototype.error = function (err) {
|
21193 | if (this.closed) {
|
21194 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
21195 | }
|
21196 | this.hasError = true;
|
21197 | this.thrownError = err;
|
21198 | this.isStopped = true;
|
21199 | var observers = this.observers;
|
21200 | var len = observers.length;
|
21201 | var copy = observers.slice();
|
21202 | for (var i = 0; i < len; i++) {
|
21203 | copy[i].error(err);
|
21204 | }
|
21205 | this.observers.length = 0;
|
21206 | };
|
21207 | Subject.prototype.complete = function () {
|
21208 | if (this.closed) {
|
21209 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
21210 | }
|
21211 | this.isStopped = true;
|
21212 | var observers = this.observers;
|
21213 | var len = observers.length;
|
21214 | var copy = observers.slice();
|
21215 | for (var i = 0; i < len; i++) {
|
21216 | copy[i].complete();
|
21217 | }
|
21218 | this.observers.length = 0;
|
21219 | };
|
21220 | Subject.prototype.unsubscribe = function () {
|
21221 | this.isStopped = true;
|
21222 | this.closed = true;
|
21223 | this.observers = null;
|
21224 | };
|
21225 | Subject.prototype._trySubscribe = function (subscriber) {
|
21226 | if (this.closed) {
|
21227 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
21228 | }
|
21229 | else {
|
21230 | return _super.prototype._trySubscribe.call(this, subscriber);
|
21231 | }
|
21232 | };
|
21233 | Subject.prototype._subscribe = function (subscriber) {
|
21234 | if (this.closed) {
|
21235 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
|
21236 | }
|
21237 | else if (this.hasError) {
|
21238 | subscriber.error(this.thrownError);
|
21239 | return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
21240 | }
|
21241 | else if (this.isStopped) {
|
21242 | subscriber.complete();
|
21243 | return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
21244 | }
|
21245 | else {
|
21246 | this.observers.push(subscriber);
|
21247 | return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__["SubjectSubscription"](this, subscriber);
|
21248 | }
|
21249 | };
|
21250 | Subject.prototype.asObservable = function () {
|
21251 | var observable = new _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]();
|
21252 | observable.source = this;
|
21253 | return observable;
|
21254 | };
|
21255 | Subject.create = function (destination, source) {
|
21256 | return new AnonymousSubject(destination, source);
|
21257 | };
|
21258 | return Subject;
|
21259 | }(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]));
|
21260 |
|
21261 | var AnonymousSubject = (function (_super) {
|
21262 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnonymousSubject, _super);
|
21263 | function AnonymousSubject(destination, source) {
|
21264 | var _this = _super.call(this) || this;
|
21265 | _this.destination = destination;
|
21266 | _this.source = source;
|
21267 | return _this;
|
21268 | }
|
21269 | AnonymousSubject.prototype.next = function (value) {
|
21270 | var destination = this.destination;
|
21271 | if (destination && destination.next) {
|
21272 | destination.next(value);
|
21273 | }
|
21274 | };
|
21275 | AnonymousSubject.prototype.error = function (err) {
|
21276 | var destination = this.destination;
|
21277 | if (destination && destination.error) {
|
21278 | this.destination.error(err);
|
21279 | }
|
21280 | };
|
21281 | AnonymousSubject.prototype.complete = function () {
|
21282 | var destination = this.destination;
|
21283 | if (destination && destination.complete) {
|
21284 | this.destination.complete();
|
21285 | }
|
21286 | };
|
21287 | AnonymousSubject.prototype._subscribe = function (subscriber) {
|
21288 | var source = this.source;
|
21289 | if (source) {
|
21290 | return this.source.subscribe(subscriber);
|
21291 | }
|
21292 | else {
|
21293 | return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
21294 | }
|
21295 | };
|
21296 | return AnonymousSubject;
|
21297 | }(Subject));
|
21298 |
|
21299 |
|
21300 |
|
21301 |
|
21302 | }),
|
21303 |
|
21304 | (function(module, __webpack_exports__, __webpack_require__) {
|
21305 |
|
21306 | "use strict";
|
21307 | __webpack_require__.r(__webpack_exports__);
|
21308 | __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return ObjectUnsubscribedError; });
|
21309 |
|
21310 | function ObjectUnsubscribedErrorImpl() {
|
21311 | Error.call(this);
|
21312 | this.message = 'object unsubscribed';
|
21313 | this.name = 'ObjectUnsubscribedError';
|
21314 | return this;
|
21315 | }
|
21316 | ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);
|
21317 | var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
|
21318 |
|
21319 |
|
21320 |
|
21321 | }),
|
21322 |
|
21323 | (function(module, __webpack_exports__, __webpack_require__) {
|
21324 |
|
21325 | "use strict";
|
21326 | __webpack_require__.r(__webpack_exports__);
|
21327 | __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; });
|
21328 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21329 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
21330 |
|
21331 |
|
21332 |
|
21333 | var SubjectSubscription = (function (_super) {
|
21334 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscription, _super);
|
21335 | function SubjectSubscription(subject, subscriber) {
|
21336 | var _this = _super.call(this) || this;
|
21337 | _this.subject = subject;
|
21338 | _this.subscriber = subscriber;
|
21339 | _this.closed = false;
|
21340 | return _this;
|
21341 | }
|
21342 | SubjectSubscription.prototype.unsubscribe = function () {
|
21343 | if (this.closed) {
|
21344 | return;
|
21345 | }
|
21346 | this.closed = true;
|
21347 | var subject = this.subject;
|
21348 | var observers = subject.observers;
|
21349 | this.subject = null;
|
21350 | if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
|
21351 | return;
|
21352 | }
|
21353 | var subscriberIndex = observers.indexOf(this.subscriber);
|
21354 | if (subscriberIndex !== -1) {
|
21355 | observers.splice(subscriberIndex, 1);
|
21356 | }
|
21357 | };
|
21358 | return SubjectSubscription;
|
21359 | }(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]));
|
21360 |
|
21361 |
|
21362 |
|
21363 |
|
21364 | }),
|
21365 |
|
21366 | (function(module, __webpack_exports__, __webpack_require__) {
|
21367 |
|
21368 | "use strict";
|
21369 | __webpack_require__.r(__webpack_exports__);
|
21370 | __webpack_require__.d(__webpack_exports__, "refCount", function() { return refCount; });
|
21371 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21372 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
21373 |
|
21374 |
|
21375 |
|
21376 | function refCount() {
|
21377 | return function refCountOperatorFunction(source) {
|
21378 | return source.lift(new RefCountOperator(source));
|
21379 | };
|
21380 | }
|
21381 | var RefCountOperator = (function () {
|
21382 | function RefCountOperator(connectable) {
|
21383 | this.connectable = connectable;
|
21384 | }
|
21385 | RefCountOperator.prototype.call = function (subscriber, source) {
|
21386 | var connectable = this.connectable;
|
21387 | connectable._refCount++;
|
21388 | var refCounter = new RefCountSubscriber(subscriber, connectable);
|
21389 | var subscription = source.subscribe(refCounter);
|
21390 | if (!refCounter.closed) {
|
21391 | refCounter.connection = connectable.connect();
|
21392 | }
|
21393 | return subscription;
|
21394 | };
|
21395 | return RefCountOperator;
|
21396 | }());
|
21397 | var RefCountSubscriber = (function (_super) {
|
21398 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super);
|
21399 | function RefCountSubscriber(destination, connectable) {
|
21400 | var _this = _super.call(this, destination) || this;
|
21401 | _this.connectable = connectable;
|
21402 | return _this;
|
21403 | }
|
21404 | RefCountSubscriber.prototype._unsubscribe = function () {
|
21405 | var connectable = this.connectable;
|
21406 | if (!connectable) {
|
21407 | this.connection = null;
|
21408 | return;
|
21409 | }
|
21410 | this.connectable = null;
|
21411 | var refCount = connectable._refCount;
|
21412 | if (refCount <= 0) {
|
21413 | this.connection = null;
|
21414 | return;
|
21415 | }
|
21416 | connectable._refCount = refCount - 1;
|
21417 | if (refCount > 1) {
|
21418 | this.connection = null;
|
21419 | return;
|
21420 | }
|
21421 | var connection = this.connection;
|
21422 | var sharedConnection = connectable._connection;
|
21423 | this.connection = null;
|
21424 | if (sharedConnection && (!connection || sharedConnection === connection)) {
|
21425 | sharedConnection.unsubscribe();
|
21426 | }
|
21427 | };
|
21428 | return RefCountSubscriber;
|
21429 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
21430 |
|
21431 |
|
21432 |
|
21433 | }),
|
21434 |
|
21435 | (function(module, __webpack_exports__, __webpack_require__) {
|
21436 |
|
21437 | "use strict";
|
21438 | __webpack_require__.r(__webpack_exports__);
|
21439 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; });
|
21440 | __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return GroupedObservable; });
|
21441 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21442 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
21443 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(156);
|
21444 | var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(148);
|
21445 | var _Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(166);
|
21446 |
|
21447 |
|
21448 |
|
21449 |
|
21450 |
|
21451 |
|
21452 | function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {
|
21453 | return function (source) {
|
21454 | return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));
|
21455 | };
|
21456 | }
|
21457 | var GroupByOperator = (function () {
|
21458 | function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {
|
21459 | this.keySelector = keySelector;
|
21460 | this.elementSelector = elementSelector;
|
21461 | this.durationSelector = durationSelector;
|
21462 | this.subjectSelector = subjectSelector;
|
21463 | }
|
21464 | GroupByOperator.prototype.call = function (subscriber, source) {
|
21465 | return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
|
21466 | };
|
21467 | return GroupByOperator;
|
21468 | }());
|
21469 | var GroupBySubscriber = (function (_super) {
|
21470 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupBySubscriber, _super);
|
21471 | function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
|
21472 | var _this = _super.call(this, destination) || this;
|
21473 | _this.keySelector = keySelector;
|
21474 | _this.elementSelector = elementSelector;
|
21475 | _this.durationSelector = durationSelector;
|
21476 | _this.subjectSelector = subjectSelector;
|
21477 | _this.groups = null;
|
21478 | _this.attemptedToUnsubscribe = false;
|
21479 | _this.count = 0;
|
21480 | return _this;
|
21481 | }
|
21482 | GroupBySubscriber.prototype._next = function (value) {
|
21483 | var key;
|
21484 | try {
|
21485 | key = this.keySelector(value);
|
21486 | }
|
21487 | catch (err) {
|
21488 | this.error(err);
|
21489 | return;
|
21490 | }
|
21491 | this._group(value, key);
|
21492 | };
|
21493 | GroupBySubscriber.prototype._group = function (value, key) {
|
21494 | var groups = this.groups;
|
21495 | if (!groups) {
|
21496 | groups = this.groups = new Map();
|
21497 | }
|
21498 | var group = groups.get(key);
|
21499 | var element;
|
21500 | if (this.elementSelector) {
|
21501 | try {
|
21502 | element = this.elementSelector(value);
|
21503 | }
|
21504 | catch (err) {
|
21505 | this.error(err);
|
21506 | }
|
21507 | }
|
21508 | else {
|
21509 | element = value;
|
21510 | }
|
21511 | if (!group) {
|
21512 | group = (this.subjectSelector ? this.subjectSelector() : new _Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]());
|
21513 | groups.set(key, group);
|
21514 | var groupedObservable = new GroupedObservable(key, group, this);
|
21515 | this.destination.next(groupedObservable);
|
21516 | if (this.durationSelector) {
|
21517 | var duration = void 0;
|
21518 | try {
|
21519 | duration = this.durationSelector(new GroupedObservable(key, group));
|
21520 | }
|
21521 | catch (err) {
|
21522 | this.error(err);
|
21523 | return;
|
21524 | }
|
21525 | this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
|
21526 | }
|
21527 | }
|
21528 | if (!group.closed) {
|
21529 | group.next(element);
|
21530 | }
|
21531 | };
|
21532 | GroupBySubscriber.prototype._error = function (err) {
|
21533 | var groups = this.groups;
|
21534 | if (groups) {
|
21535 | groups.forEach(function (group, key) {
|
21536 | group.error(err);
|
21537 | });
|
21538 | groups.clear();
|
21539 | }
|
21540 | this.destination.error(err);
|
21541 | };
|
21542 | GroupBySubscriber.prototype._complete = function () {
|
21543 | var groups = this.groups;
|
21544 | if (groups) {
|
21545 | groups.forEach(function (group, key) {
|
21546 | group.complete();
|
21547 | });
|
21548 | groups.clear();
|
21549 | }
|
21550 | this.destination.complete();
|
21551 | };
|
21552 | GroupBySubscriber.prototype.removeGroup = function (key) {
|
21553 | this.groups.delete(key);
|
21554 | };
|
21555 | GroupBySubscriber.prototype.unsubscribe = function () {
|
21556 | if (!this.closed) {
|
21557 | this.attemptedToUnsubscribe = true;
|
21558 | if (this.count === 0) {
|
21559 | _super.prototype.unsubscribe.call(this);
|
21560 | }
|
21561 | }
|
21562 | };
|
21563 | return GroupBySubscriber;
|
21564 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
21565 | var GroupDurationSubscriber = (function (_super) {
|
21566 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupDurationSubscriber, _super);
|
21567 | function GroupDurationSubscriber(key, group, parent) {
|
21568 | var _this = _super.call(this, group) || this;
|
21569 | _this.key = key;
|
21570 | _this.group = group;
|
21571 | _this.parent = parent;
|
21572 | return _this;
|
21573 | }
|
21574 | GroupDurationSubscriber.prototype._next = function (value) {
|
21575 | this.complete();
|
21576 | };
|
21577 | GroupDurationSubscriber.prototype._unsubscribe = function () {
|
21578 | var _a = this, parent = _a.parent, key = _a.key;
|
21579 | this.key = this.parent = null;
|
21580 | if (parent) {
|
21581 | parent.removeGroup(key);
|
21582 | }
|
21583 | };
|
21584 | return GroupDurationSubscriber;
|
21585 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
21586 | var GroupedObservable = (function (_super) {
|
21587 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupedObservable, _super);
|
21588 | function GroupedObservable(key, groupSubject, refCountSubscription) {
|
21589 | var _this = _super.call(this) || this;
|
21590 | _this.key = key;
|
21591 | _this.groupSubject = groupSubject;
|
21592 | _this.refCountSubscription = refCountSubscription;
|
21593 | return _this;
|
21594 | }
|
21595 | GroupedObservable.prototype._subscribe = function (subscriber) {
|
21596 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]();
|
21597 | var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;
|
21598 | if (refCountSubscription && !refCountSubscription.closed) {
|
21599 | subscription.add(new InnerRefCountSubscription(refCountSubscription));
|
21600 | }
|
21601 | subscription.add(groupSubject.subscribe(subscriber));
|
21602 | return subscription;
|
21603 | };
|
21604 | return GroupedObservable;
|
21605 | }(_Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"]));
|
21606 |
|
21607 | var InnerRefCountSubscription = (function (_super) {
|
21608 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerRefCountSubscription, _super);
|
21609 | function InnerRefCountSubscription(parent) {
|
21610 | var _this = _super.call(this) || this;
|
21611 | _this.parent = parent;
|
21612 | parent.count++;
|
21613 | return _this;
|
21614 | }
|
21615 | InnerRefCountSubscription.prototype.unsubscribe = function () {
|
21616 | var parent = this.parent;
|
21617 | if (!parent.closed && !this.closed) {
|
21618 | _super.prototype.unsubscribe.call(this);
|
21619 | parent.count -= 1;
|
21620 | if (parent.count === 0 && parent.attemptedToUnsubscribe) {
|
21621 | parent.unsubscribe();
|
21622 | }
|
21623 | }
|
21624 | };
|
21625 | return InnerRefCountSubscription;
|
21626 | }(_Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]));
|
21627 |
|
21628 |
|
21629 |
|
21630 | }),
|
21631 |
|
21632 | (function(module, __webpack_exports__, __webpack_require__) {
|
21633 |
|
21634 | "use strict";
|
21635 | __webpack_require__.r(__webpack_exports__);
|
21636 | __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return BehaviorSubject; });
|
21637 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21638 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
21639 | var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167);
|
21640 |
|
21641 |
|
21642 |
|
21643 |
|
21644 | var BehaviorSubject = (function (_super) {
|
21645 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BehaviorSubject, _super);
|
21646 | function BehaviorSubject(_value) {
|
21647 | var _this = _super.call(this) || this;
|
21648 | _this._value = _value;
|
21649 | return _this;
|
21650 | }
|
21651 | Object.defineProperty(BehaviorSubject.prototype, "value", {
|
21652 | get: function () {
|
21653 | return this.getValue();
|
21654 | },
|
21655 | enumerable: true,
|
21656 | configurable: true
|
21657 | });
|
21658 | BehaviorSubject.prototype._subscribe = function (subscriber) {
|
21659 | var subscription = _super.prototype._subscribe.call(this, subscriber);
|
21660 | if (subscription && !subscription.closed) {
|
21661 | subscriber.next(this._value);
|
21662 | }
|
21663 | return subscription;
|
21664 | };
|
21665 | BehaviorSubject.prototype.getValue = function () {
|
21666 | if (this.hasError) {
|
21667 | throw this.thrownError;
|
21668 | }
|
21669 | else if (this.closed) {
|
21670 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__["ObjectUnsubscribedError"]();
|
21671 | }
|
21672 | else {
|
21673 | return this._value;
|
21674 | }
|
21675 | };
|
21676 | BehaviorSubject.prototype.next = function (value) {
|
21677 | _super.prototype.next.call(this, this._value = value);
|
21678 | };
|
21679 | return BehaviorSubject;
|
21680 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
21681 |
|
21682 |
|
21683 |
|
21684 |
|
21685 | }),
|
21686 |
|
21687 | (function(module, __webpack_exports__, __webpack_require__) {
|
21688 |
|
21689 | "use strict";
|
21690 | __webpack_require__.r(__webpack_exports__);
|
21691 | __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return ReplaySubject; });
|
21692 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21693 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
21694 | var _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(173);
|
21695 | var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(156);
|
21696 | var _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(180);
|
21697 | var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(167);
|
21698 | var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(168);
|
21699 |
|
21700 |
|
21701 |
|
21702 |
|
21703 |
|
21704 |
|
21705 |
|
21706 |
|
21707 | var ReplaySubject = (function (_super) {
|
21708 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ReplaySubject, _super);
|
21709 | function ReplaySubject(bufferSize, windowTime, scheduler) {
|
21710 | if (bufferSize === void 0) {
|
21711 | bufferSize = Number.POSITIVE_INFINITY;
|
21712 | }
|
21713 | if (windowTime === void 0) {
|
21714 | windowTime = Number.POSITIVE_INFINITY;
|
21715 | }
|
21716 | var _this = _super.call(this) || this;
|
21717 | _this.scheduler = scheduler;
|
21718 | _this._events = [];
|
21719 | _this._infiniteTimeWindow = false;
|
21720 | _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
|
21721 | _this._windowTime = windowTime < 1 ? 1 : windowTime;
|
21722 | if (windowTime === Number.POSITIVE_INFINITY) {
|
21723 | _this._infiniteTimeWindow = true;
|
21724 | _this.next = _this.nextInfiniteTimeWindow;
|
21725 | }
|
21726 | else {
|
21727 | _this.next = _this.nextTimeWindow;
|
21728 | }
|
21729 | return _this;
|
21730 | }
|
21731 | ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {
|
21732 | var _events = this._events;
|
21733 | _events.push(value);
|
21734 | if (_events.length > this._bufferSize) {
|
21735 | _events.shift();
|
21736 | }
|
21737 | _super.prototype.next.call(this, value);
|
21738 | };
|
21739 | ReplaySubject.prototype.nextTimeWindow = function (value) {
|
21740 | this._events.push(new ReplayEvent(this._getNow(), value));
|
21741 | this._trimBufferThenGetEvents();
|
21742 | _super.prototype.next.call(this, value);
|
21743 | };
|
21744 | ReplaySubject.prototype._subscribe = function (subscriber) {
|
21745 | var _infiniteTimeWindow = this._infiniteTimeWindow;
|
21746 | var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
|
21747 | var scheduler = this.scheduler;
|
21748 | var len = _events.length;
|
21749 | var subscription;
|
21750 | if (this.closed) {
|
21751 | throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__["ObjectUnsubscribedError"]();
|
21752 | }
|
21753 | else if (this.isStopped || this.hasError) {
|
21754 | subscription = _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
|
21755 | }
|
21756 | else {
|
21757 | this.observers.push(subscriber);
|
21758 | subscription = new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__["SubjectSubscription"](this, subscriber);
|
21759 | }
|
21760 | if (scheduler) {
|
21761 | subscriber.add(subscriber = new _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__["ObserveOnSubscriber"](subscriber, scheduler));
|
21762 | }
|
21763 | if (_infiniteTimeWindow) {
|
21764 | for (var i = 0; i < len && !subscriber.closed; i++) {
|
21765 | subscriber.next(_events[i]);
|
21766 | }
|
21767 | }
|
21768 | else {
|
21769 | for (var i = 0; i < len && !subscriber.closed; i++) {
|
21770 | subscriber.next(_events[i].value);
|
21771 | }
|
21772 | }
|
21773 | if (this.hasError) {
|
21774 | subscriber.error(this.thrownError);
|
21775 | }
|
21776 | else if (this.isStopped) {
|
21777 | subscriber.complete();
|
21778 | }
|
21779 | return subscription;
|
21780 | };
|
21781 | ReplaySubject.prototype._getNow = function () {
|
21782 | return (this.scheduler || _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__["queue"]).now();
|
21783 | };
|
21784 | ReplaySubject.prototype._trimBufferThenGetEvents = function () {
|
21785 | var now = this._getNow();
|
21786 | var _bufferSize = this._bufferSize;
|
21787 | var _windowTime = this._windowTime;
|
21788 | var _events = this._events;
|
21789 | var eventsCount = _events.length;
|
21790 | var spliceCount = 0;
|
21791 | while (spliceCount < eventsCount) {
|
21792 | if ((now - _events[spliceCount].time) < _windowTime) {
|
21793 | break;
|
21794 | }
|
21795 | spliceCount++;
|
21796 | }
|
21797 | if (eventsCount > _bufferSize) {
|
21798 | spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
|
21799 | }
|
21800 | if (spliceCount > 0) {
|
21801 | _events.splice(0, spliceCount);
|
21802 | }
|
21803 | return _events;
|
21804 | };
|
21805 | return ReplaySubject;
|
21806 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
21807 |
|
21808 | var ReplayEvent = (function () {
|
21809 | function ReplayEvent(time, value) {
|
21810 | this.time = time;
|
21811 | this.value = value;
|
21812 | }
|
21813 | return ReplayEvent;
|
21814 | }());
|
21815 |
|
21816 |
|
21817 |
|
21818 | }),
|
21819 |
|
21820 | (function(module, __webpack_exports__, __webpack_require__) {
|
21821 |
|
21822 | "use strict";
|
21823 | __webpack_require__.r(__webpack_exports__);
|
21824 | __webpack_require__.d(__webpack_exports__, "queue", function() { return queue; });
|
21825 | var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(174);
|
21826 | var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177);
|
21827 |
|
21828 |
|
21829 |
|
21830 | var queue = new _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__["QueueScheduler"](_QueueAction__WEBPACK_IMPORTED_MODULE_0__["QueueAction"]);
|
21831 |
|
21832 |
|
21833 |
|
21834 | }),
|
21835 |
|
21836 | (function(module, __webpack_exports__, __webpack_require__) {
|
21837 |
|
21838 | "use strict";
|
21839 | __webpack_require__.r(__webpack_exports__);
|
21840 | __webpack_require__.d(__webpack_exports__, "QueueAction", function() { return QueueAction; });
|
21841 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21842 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
21843 |
|
21844 |
|
21845 |
|
21846 | var QueueAction = (function (_super) {
|
21847 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueAction, _super);
|
21848 | function QueueAction(scheduler, work) {
|
21849 | var _this = _super.call(this, scheduler, work) || this;
|
21850 | _this.scheduler = scheduler;
|
21851 | _this.work = work;
|
21852 | return _this;
|
21853 | }
|
21854 | QueueAction.prototype.schedule = function (state, delay) {
|
21855 | if (delay === void 0) {
|
21856 | delay = 0;
|
21857 | }
|
21858 | if (delay > 0) {
|
21859 | return _super.prototype.schedule.call(this, state, delay);
|
21860 | }
|
21861 | this.delay = delay;
|
21862 | this.state = state;
|
21863 | this.scheduler.flush(this);
|
21864 | return this;
|
21865 | };
|
21866 | QueueAction.prototype.execute = function (state, delay) {
|
21867 | return (delay > 0 || this.closed) ?
|
21868 | _super.prototype.execute.call(this, state, delay) :
|
21869 | this._execute(state, delay);
|
21870 | };
|
21871 | QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
21872 | if (delay === void 0) {
|
21873 | delay = 0;
|
21874 | }
|
21875 | if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
|
21876 | return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
21877 | }
|
21878 | return scheduler.flush(this);
|
21879 | };
|
21880 | return QueueAction;
|
21881 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
|
21882 |
|
21883 |
|
21884 |
|
21885 |
|
21886 | }),
|
21887 |
|
21888 | (function(module, __webpack_exports__, __webpack_require__) {
|
21889 |
|
21890 | "use strict";
|
21891 | __webpack_require__.r(__webpack_exports__);
|
21892 | __webpack_require__.d(__webpack_exports__, "AsyncAction", function() { return AsyncAction; });
|
21893 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
21894 | var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176);
|
21895 |
|
21896 |
|
21897 |
|
21898 | var AsyncAction = (function (_super) {
|
21899 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncAction, _super);
|
21900 | function AsyncAction(scheduler, work) {
|
21901 | var _this = _super.call(this, scheduler, work) || this;
|
21902 | _this.scheduler = scheduler;
|
21903 | _this.work = work;
|
21904 | _this.pending = false;
|
21905 | return _this;
|
21906 | }
|
21907 | AsyncAction.prototype.schedule = function (state, delay) {
|
21908 | if (delay === void 0) {
|
21909 | delay = 0;
|
21910 | }
|
21911 | if (this.closed) {
|
21912 | return this;
|
21913 | }
|
21914 | this.state = state;
|
21915 | var id = this.id;
|
21916 | var scheduler = this.scheduler;
|
21917 | if (id != null) {
|
21918 | this.id = this.recycleAsyncId(scheduler, id, delay);
|
21919 | }
|
21920 | this.pending = true;
|
21921 | this.delay = delay;
|
21922 | this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
|
21923 | return this;
|
21924 | };
|
21925 | AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
21926 | if (delay === void 0) {
|
21927 | delay = 0;
|
21928 | }
|
21929 | return setInterval(scheduler.flush.bind(scheduler, this), delay);
|
21930 | };
|
21931 | AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
21932 | if (delay === void 0) {
|
21933 | delay = 0;
|
21934 | }
|
21935 | if (delay !== null && this.delay === delay && this.pending === false) {
|
21936 | return id;
|
21937 | }
|
21938 | clearInterval(id);
|
21939 | return undefined;
|
21940 | };
|
21941 | AsyncAction.prototype.execute = function (state, delay) {
|
21942 | if (this.closed) {
|
21943 | return new Error('executing a cancelled action');
|
21944 | }
|
21945 | this.pending = false;
|
21946 | var error = this._execute(state, delay);
|
21947 | if (error) {
|
21948 | return error;
|
21949 | }
|
21950 | else if (this.pending === false && this.id != null) {
|
21951 | this.id = this.recycleAsyncId(this.scheduler, this.id, null);
|
21952 | }
|
21953 | };
|
21954 | AsyncAction.prototype._execute = function (state, delay) {
|
21955 | var errored = false;
|
21956 | var errorValue = undefined;
|
21957 | try {
|
21958 | this.work(state);
|
21959 | }
|
21960 | catch (e) {
|
21961 | errored = true;
|
21962 | errorValue = !!e && e || new Error(e);
|
21963 | }
|
21964 | if (errored) {
|
21965 | this.unsubscribe();
|
21966 | return errorValue;
|
21967 | }
|
21968 | };
|
21969 | AsyncAction.prototype._unsubscribe = function () {
|
21970 | var id = this.id;
|
21971 | var scheduler = this.scheduler;
|
21972 | var actions = scheduler.actions;
|
21973 | var index = actions.indexOf(this);
|
21974 | this.work = null;
|
21975 | this.state = null;
|
21976 | this.pending = false;
|
21977 | this.scheduler = null;
|
21978 | if (index !== -1) {
|
21979 | actions.splice(index, 1);
|
21980 | }
|
21981 | if (id != null) {
|
21982 | this.id = this.recycleAsyncId(scheduler, id, null);
|
21983 | }
|
21984 | this.delay = null;
|
21985 | };
|
21986 | return AsyncAction;
|
21987 | }(_Action__WEBPACK_IMPORTED_MODULE_1__["Action"]));
|
21988 |
|
21989 |
|
21990 |
|
21991 |
|
21992 | }),
|
21993 |
|
21994 | (function(module, __webpack_exports__, __webpack_require__) {
|
21995 |
|
21996 | "use strict";
|
21997 | __webpack_require__.r(__webpack_exports__);
|
21998 | __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; });
|
21999 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22000 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
22001 |
|
22002 |
|
22003 |
|
22004 | var Action = (function (_super) {
|
22005 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Action, _super);
|
22006 | function Action(scheduler, work) {
|
22007 | return _super.call(this) || this;
|
22008 | }
|
22009 | Action.prototype.schedule = function (state, delay) {
|
22010 | if (delay === void 0) {
|
22011 | delay = 0;
|
22012 | }
|
22013 | return this;
|
22014 | };
|
22015 | return Action;
|
22016 | }(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]));
|
22017 |
|
22018 |
|
22019 |
|
22020 |
|
22021 | }),
|
22022 |
|
22023 | (function(module, __webpack_exports__, __webpack_require__) {
|
22024 |
|
22025 | "use strict";
|
22026 | __webpack_require__.r(__webpack_exports__);
|
22027 | __webpack_require__.d(__webpack_exports__, "QueueScheduler", function() { return QueueScheduler; });
|
22028 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22029 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178);
|
22030 |
|
22031 |
|
22032 |
|
22033 | var QueueScheduler = (function (_super) {
|
22034 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueScheduler, _super);
|
22035 | function QueueScheduler() {
|
22036 | return _super !== null && _super.apply(this, arguments) || this;
|
22037 | }
|
22038 | return QueueScheduler;
|
22039 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
|
22040 |
|
22041 |
|
22042 |
|
22043 |
|
22044 | }),
|
22045 |
|
22046 | (function(module, __webpack_exports__, __webpack_require__) {
|
22047 |
|
22048 | "use strict";
|
22049 | __webpack_require__.r(__webpack_exports__);
|
22050 | __webpack_require__.d(__webpack_exports__, "AsyncScheduler", function() { return AsyncScheduler; });
|
22051 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22052 | var _Scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(179);
|
22053 |
|
22054 |
|
22055 |
|
22056 | var AsyncScheduler = (function (_super) {
|
22057 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncScheduler, _super);
|
22058 | function AsyncScheduler(SchedulerAction, now) {
|
22059 | if (now === void 0) {
|
22060 | now = _Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"].now;
|
22061 | }
|
22062 | var _this = _super.call(this, SchedulerAction, function () {
|
22063 | if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {
|
22064 | return AsyncScheduler.delegate.now();
|
22065 | }
|
22066 | else {
|
22067 | return now();
|
22068 | }
|
22069 | }) || this;
|
22070 | _this.actions = [];
|
22071 | _this.active = false;
|
22072 | _this.scheduled = undefined;
|
22073 | return _this;
|
22074 | }
|
22075 | AsyncScheduler.prototype.schedule = function (work, delay, state) {
|
22076 | if (delay === void 0) {
|
22077 | delay = 0;
|
22078 | }
|
22079 | if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
|
22080 | return AsyncScheduler.delegate.schedule(work, delay, state);
|
22081 | }
|
22082 | else {
|
22083 | return _super.prototype.schedule.call(this, work, delay, state);
|
22084 | }
|
22085 | };
|
22086 | AsyncScheduler.prototype.flush = function (action) {
|
22087 | var actions = this.actions;
|
22088 | if (this.active) {
|
22089 | actions.push(action);
|
22090 | return;
|
22091 | }
|
22092 | var error;
|
22093 | this.active = true;
|
22094 | do {
|
22095 | if (error = action.execute(action.state, action.delay)) {
|
22096 | break;
|
22097 | }
|
22098 | } while (action = actions.shift());
|
22099 | this.active = false;
|
22100 | if (error) {
|
22101 | while (action = actions.shift()) {
|
22102 | action.unsubscribe();
|
22103 | }
|
22104 | throw error;
|
22105 | }
|
22106 | };
|
22107 | return AsyncScheduler;
|
22108 | }(_Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"]));
|
22109 |
|
22110 |
|
22111 |
|
22112 |
|
22113 | }),
|
22114 |
|
22115 | (function(module, __webpack_exports__, __webpack_require__) {
|
22116 |
|
22117 | "use strict";
|
22118 | __webpack_require__.r(__webpack_exports__);
|
22119 | __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return Scheduler; });
|
22120 | var Scheduler = (function () {
|
22121 | function Scheduler(SchedulerAction, now) {
|
22122 | if (now === void 0) {
|
22123 | now = Scheduler.now;
|
22124 | }
|
22125 | this.SchedulerAction = SchedulerAction;
|
22126 | this.now = now;
|
22127 | }
|
22128 | Scheduler.prototype.schedule = function (work, delay, state) {
|
22129 | if (delay === void 0) {
|
22130 | delay = 0;
|
22131 | }
|
22132 | return new this.SchedulerAction(this, work).schedule(state, delay);
|
22133 | };
|
22134 | Scheduler.now = function () { return Date.now(); };
|
22135 | return Scheduler;
|
22136 | }());
|
22137 |
|
22138 |
|
22139 |
|
22140 |
|
22141 | }),
|
22142 |
|
22143 | (function(module, __webpack_exports__, __webpack_require__) {
|
22144 |
|
22145 | "use strict";
|
22146 | __webpack_require__.r(__webpack_exports__);
|
22147 | __webpack_require__.d(__webpack_exports__, "observeOn", function() { return observeOn; });
|
22148 | __webpack_require__.d(__webpack_exports__, "ObserveOnOperator", function() { return ObserveOnOperator; });
|
22149 | __webpack_require__.d(__webpack_exports__, "ObserveOnSubscriber", function() { return ObserveOnSubscriber; });
|
22150 | __webpack_require__.d(__webpack_exports__, "ObserveOnMessage", function() { return ObserveOnMessage; });
|
22151 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22152 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
22153 | var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(181);
|
22154 |
|
22155 |
|
22156 |
|
22157 |
|
22158 | function observeOn(scheduler, delay) {
|
22159 | if (delay === void 0) {
|
22160 | delay = 0;
|
22161 | }
|
22162 | return function observeOnOperatorFunction(source) {
|
22163 | return source.lift(new ObserveOnOperator(scheduler, delay));
|
22164 | };
|
22165 | }
|
22166 | var ObserveOnOperator = (function () {
|
22167 | function ObserveOnOperator(scheduler, delay) {
|
22168 | if (delay === void 0) {
|
22169 | delay = 0;
|
22170 | }
|
22171 | this.scheduler = scheduler;
|
22172 | this.delay = delay;
|
22173 | }
|
22174 | ObserveOnOperator.prototype.call = function (subscriber, source) {
|
22175 | return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
|
22176 | };
|
22177 | return ObserveOnOperator;
|
22178 | }());
|
22179 |
|
22180 | var ObserveOnSubscriber = (function (_super) {
|
22181 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ObserveOnSubscriber, _super);
|
22182 | function ObserveOnSubscriber(destination, scheduler, delay) {
|
22183 | if (delay === void 0) {
|
22184 | delay = 0;
|
22185 | }
|
22186 | var _this = _super.call(this, destination) || this;
|
22187 | _this.scheduler = scheduler;
|
22188 | _this.delay = delay;
|
22189 | return _this;
|
22190 | }
|
22191 | ObserveOnSubscriber.dispatch = function (arg) {
|
22192 | var notification = arg.notification, destination = arg.destination;
|
22193 | notification.observe(destination);
|
22194 | this.unsubscribe();
|
22195 | };
|
22196 | ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
|
22197 | var destination = this.destination;
|
22198 | destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
|
22199 | };
|
22200 | ObserveOnSubscriber.prototype._next = function (value) {
|
22201 | this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value));
|
22202 | };
|
22203 | ObserveOnSubscriber.prototype._error = function (err) {
|
22204 | this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err));
|
22205 | this.unsubscribe();
|
22206 | };
|
22207 | ObserveOnSubscriber.prototype._complete = function () {
|
22208 | this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete());
|
22209 | this.unsubscribe();
|
22210 | };
|
22211 | return ObserveOnSubscriber;
|
22212 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
22213 |
|
22214 | var ObserveOnMessage = (function () {
|
22215 | function ObserveOnMessage(notification, destination) {
|
22216 | this.notification = notification;
|
22217 | this.destination = destination;
|
22218 | }
|
22219 | return ObserveOnMessage;
|
22220 | }());
|
22221 |
|
22222 |
|
22223 |
|
22224 |
|
22225 | }),
|
22226 |
|
22227 | (function(module, __webpack_exports__, __webpack_require__) {
|
22228 |
|
22229 | "use strict";
|
22230 | __webpack_require__.r(__webpack_exports__);
|
22231 | __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return NotificationKind; });
|
22232 | __webpack_require__.d(__webpack_exports__, "Notification", function() { return Notification; });
|
22233 | var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(182);
|
22234 | var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(183);
|
22235 | var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(188);
|
22236 |
|
22237 |
|
22238 |
|
22239 |
|
22240 | var NotificationKind;
|
22241 | (function (NotificationKind) {
|
22242 | NotificationKind["NEXT"] = "N";
|
22243 | NotificationKind["ERROR"] = "E";
|
22244 | NotificationKind["COMPLETE"] = "C";
|
22245 | })(NotificationKind || (NotificationKind = {}));
|
22246 | var Notification = (function () {
|
22247 | function Notification(kind, value, error) {
|
22248 | this.kind = kind;
|
22249 | this.value = value;
|
22250 | this.error = error;
|
22251 | this.hasValue = kind === 'N';
|
22252 | }
|
22253 | Notification.prototype.observe = function (observer) {
|
22254 | switch (this.kind) {
|
22255 | case 'N':
|
22256 | return observer.next && observer.next(this.value);
|
22257 | case 'E':
|
22258 | return observer.error && observer.error(this.error);
|
22259 | case 'C':
|
22260 | return observer.complete && observer.complete();
|
22261 | }
|
22262 | };
|
22263 | Notification.prototype.do = function (next, error, complete) {
|
22264 | var kind = this.kind;
|
22265 | switch (kind) {
|
22266 | case 'N':
|
22267 | return next && next(this.value);
|
22268 | case 'E':
|
22269 | return error && error(this.error);
|
22270 | case 'C':
|
22271 | return complete && complete();
|
22272 | }
|
22273 | };
|
22274 | Notification.prototype.accept = function (nextOrObserver, error, complete) {
|
22275 | if (nextOrObserver && typeof nextOrObserver.next === 'function') {
|
22276 | return this.observe(nextOrObserver);
|
22277 | }
|
22278 | else {
|
22279 | return this.do(nextOrObserver, error, complete);
|
22280 | }
|
22281 | };
|
22282 | Notification.prototype.toObservable = function () {
|
22283 | var kind = this.kind;
|
22284 | switch (kind) {
|
22285 | case 'N':
|
22286 | return Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(this.value);
|
22287 | case 'E':
|
22288 | return Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_2__["throwError"])(this.error);
|
22289 | case 'C':
|
22290 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_0__["empty"])();
|
22291 | }
|
22292 | throw new Error('unexpected notification kind value');
|
22293 | };
|
22294 | Notification.createNext = function (value) {
|
22295 | if (typeof value !== 'undefined') {
|
22296 | return new Notification('N', value);
|
22297 | }
|
22298 | return Notification.undefinedValueNotification;
|
22299 | };
|
22300 | Notification.createError = function (err) {
|
22301 | return new Notification('E', undefined, err);
|
22302 | };
|
22303 | Notification.createComplete = function () {
|
22304 | return Notification.completeNotification;
|
22305 | };
|
22306 | Notification.completeNotification = new Notification('C');
|
22307 | Notification.undefinedValueNotification = new Notification('N', undefined);
|
22308 | return Notification;
|
22309 | }());
|
22310 |
|
22311 |
|
22312 |
|
22313 |
|
22314 | }),
|
22315 |
|
22316 | (function(module, __webpack_exports__, __webpack_require__) {
|
22317 |
|
22318 | "use strict";
|
22319 | __webpack_require__.r(__webpack_exports__);
|
22320 | __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return EMPTY; });
|
22321 | __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
|
22322 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
22323 |
|
22324 |
|
22325 | var EMPTY = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.complete(); });
|
22326 | function empty(scheduler) {
|
22327 | return scheduler ? emptyScheduled(scheduler) : EMPTY;
|
22328 | }
|
22329 | function emptyScheduled(scheduler) {
|
22330 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });
|
22331 | }
|
22332 |
|
22333 |
|
22334 |
|
22335 | }),
|
22336 |
|
22337 | (function(module, __webpack_exports__, __webpack_require__) {
|
22338 |
|
22339 | "use strict";
|
22340 | __webpack_require__.r(__webpack_exports__);
|
22341 | __webpack_require__.d(__webpack_exports__, "of", function() { return of; });
|
22342 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(184);
|
22343 | var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
22344 | var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(187);
|
22345 |
|
22346 |
|
22347 |
|
22348 |
|
22349 | function of() {
|
22350 | var args = [];
|
22351 | for (var _i = 0; _i < arguments.length; _i++) {
|
22352 | args[_i] = arguments[_i];
|
22353 | }
|
22354 | var scheduler = args[args.length - 1];
|
22355 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(scheduler)) {
|
22356 | args.pop();
|
22357 | return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(args, scheduler);
|
22358 | }
|
22359 | else {
|
22360 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args);
|
22361 | }
|
22362 | }
|
22363 |
|
22364 |
|
22365 |
|
22366 | }),
|
22367 |
|
22368 | (function(module, __webpack_exports__, __webpack_require__) {
|
22369 |
|
22370 | "use strict";
|
22371 | __webpack_require__.r(__webpack_exports__);
|
22372 | __webpack_require__.d(__webpack_exports__, "isScheduler", function() { return isScheduler; });
|
22373 |
|
22374 | function isScheduler(value) {
|
22375 | return value && typeof value.schedule === 'function';
|
22376 | }
|
22377 |
|
22378 |
|
22379 |
|
22380 | }),
|
22381 |
|
22382 | (function(module, __webpack_exports__, __webpack_require__) {
|
22383 |
|
22384 | "use strict";
|
22385 | __webpack_require__.r(__webpack_exports__);
|
22386 | __webpack_require__.d(__webpack_exports__, "fromArray", function() { return fromArray; });
|
22387 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
22388 | var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(186);
|
22389 | var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(187);
|
22390 |
|
22391 |
|
22392 |
|
22393 |
|
22394 | function fromArray(input, scheduler) {
|
22395 | if (!scheduler) {
|
22396 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__["subscribeToArray"])(input));
|
22397 | }
|
22398 | else {
|
22399 | return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler);
|
22400 | }
|
22401 | }
|
22402 |
|
22403 |
|
22404 |
|
22405 | }),
|
22406 |
|
22407 | (function(module, __webpack_exports__, __webpack_require__) {
|
22408 |
|
22409 | "use strict";
|
22410 | __webpack_require__.r(__webpack_exports__);
|
22411 | __webpack_require__.d(__webpack_exports__, "subscribeToArray", function() { return subscribeToArray; });
|
22412 |
|
22413 | var subscribeToArray = function (array) {
|
22414 | return function (subscriber) {
|
22415 | for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {
|
22416 | subscriber.next(array[i]);
|
22417 | }
|
22418 | subscriber.complete();
|
22419 | };
|
22420 | };
|
22421 |
|
22422 |
|
22423 |
|
22424 | }),
|
22425 |
|
22426 | (function(module, __webpack_exports__, __webpack_require__) {
|
22427 |
|
22428 | "use strict";
|
22429 | __webpack_require__.r(__webpack_exports__);
|
22430 | __webpack_require__.d(__webpack_exports__, "scheduleArray", function() { return scheduleArray; });
|
22431 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
22432 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
22433 |
|
22434 |
|
22435 |
|
22436 | function scheduleArray(input, scheduler) {
|
22437 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
22438 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
22439 | var i = 0;
|
22440 | sub.add(scheduler.schedule(function () {
|
22441 | if (i === input.length) {
|
22442 | subscriber.complete();
|
22443 | return;
|
22444 | }
|
22445 | subscriber.next(input[i++]);
|
22446 | if (!subscriber.closed) {
|
22447 | sub.add(this.schedule());
|
22448 | }
|
22449 | }));
|
22450 | return sub;
|
22451 | });
|
22452 | }
|
22453 |
|
22454 |
|
22455 |
|
22456 | }),
|
22457 |
|
22458 | (function(module, __webpack_exports__, __webpack_require__) {
|
22459 |
|
22460 | "use strict";
|
22461 | __webpack_require__.r(__webpack_exports__);
|
22462 | __webpack_require__.d(__webpack_exports__, "throwError", function() { return throwError; });
|
22463 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
22464 |
|
22465 |
|
22466 | function throwError(error, scheduler) {
|
22467 | if (!scheduler) {
|
22468 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.error(error); });
|
22469 | }
|
22470 | else {
|
22471 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });
|
22472 | }
|
22473 | }
|
22474 | function dispatch(_a) {
|
22475 | var error = _a.error, subscriber = _a.subscriber;
|
22476 | subscriber.error(error);
|
22477 | }
|
22478 |
|
22479 |
|
22480 |
|
22481 | }),
|
22482 |
|
22483 | (function(module, __webpack_exports__, __webpack_require__) {
|
22484 |
|
22485 | "use strict";
|
22486 | __webpack_require__.r(__webpack_exports__);
|
22487 | __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return AsyncSubject; });
|
22488 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22489 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
22490 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(156);
|
22491 |
|
22492 |
|
22493 |
|
22494 |
|
22495 | var AsyncSubject = (function (_super) {
|
22496 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncSubject, _super);
|
22497 | function AsyncSubject() {
|
22498 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
22499 | _this.value = null;
|
22500 | _this.hasNext = false;
|
22501 | _this.hasCompleted = false;
|
22502 | return _this;
|
22503 | }
|
22504 | AsyncSubject.prototype._subscribe = function (subscriber) {
|
22505 | if (this.hasError) {
|
22506 | subscriber.error(this.thrownError);
|
22507 | return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
|
22508 | }
|
22509 | else if (this.hasCompleted && this.hasNext) {
|
22510 | subscriber.next(this.value);
|
22511 | subscriber.complete();
|
22512 | return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
|
22513 | }
|
22514 | return _super.prototype._subscribe.call(this, subscriber);
|
22515 | };
|
22516 | AsyncSubject.prototype.next = function (value) {
|
22517 | if (!this.hasCompleted) {
|
22518 | this.value = value;
|
22519 | this.hasNext = true;
|
22520 | }
|
22521 | };
|
22522 | AsyncSubject.prototype.error = function (error) {
|
22523 | if (!this.hasCompleted) {
|
22524 | _super.prototype.error.call(this, error);
|
22525 | }
|
22526 | };
|
22527 | AsyncSubject.prototype.complete = function () {
|
22528 | this.hasCompleted = true;
|
22529 | if (this.hasNext) {
|
22530 | _super.prototype.next.call(this, this.value);
|
22531 | }
|
22532 | _super.prototype.complete.call(this);
|
22533 | };
|
22534 | return AsyncSubject;
|
22535 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
22536 |
|
22537 |
|
22538 |
|
22539 |
|
22540 | }),
|
22541 |
|
22542 | (function(module, __webpack_exports__, __webpack_require__) {
|
22543 |
|
22544 | "use strict";
|
22545 | __webpack_require__.r(__webpack_exports__);
|
22546 | __webpack_require__.d(__webpack_exports__, "asap", function() { return asap; });
|
22547 | var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(191);
|
22548 | var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(193);
|
22549 |
|
22550 |
|
22551 |
|
22552 | var asap = new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__["AsapScheduler"](_AsapAction__WEBPACK_IMPORTED_MODULE_0__["AsapAction"]);
|
22553 |
|
22554 |
|
22555 |
|
22556 | }),
|
22557 |
|
22558 | (function(module, __webpack_exports__, __webpack_require__) {
|
22559 |
|
22560 | "use strict";
|
22561 | __webpack_require__.r(__webpack_exports__);
|
22562 | __webpack_require__.d(__webpack_exports__, "AsapAction", function() { return AsapAction; });
|
22563 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22564 | var _util_Immediate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(192);
|
22565 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175);
|
22566 |
|
22567 |
|
22568 |
|
22569 |
|
22570 | var AsapAction = (function (_super) {
|
22571 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapAction, _super);
|
22572 | function AsapAction(scheduler, work) {
|
22573 | var _this = _super.call(this, scheduler, work) || this;
|
22574 | _this.scheduler = scheduler;
|
22575 | _this.work = work;
|
22576 | return _this;
|
22577 | }
|
22578 | AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
22579 | if (delay === void 0) {
|
22580 | delay = 0;
|
22581 | }
|
22582 | if (delay !== null && delay > 0) {
|
22583 | return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
22584 | }
|
22585 | scheduler.actions.push(this);
|
22586 | return scheduler.scheduled || (scheduler.scheduled = _util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].setImmediate(scheduler.flush.bind(scheduler, null)));
|
22587 | };
|
22588 | AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
22589 | if (delay === void 0) {
|
22590 | delay = 0;
|
22591 | }
|
22592 | if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
|
22593 | return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
22594 | }
|
22595 | if (scheduler.actions.length === 0) {
|
22596 | _util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].clearImmediate(id);
|
22597 | scheduler.scheduled = undefined;
|
22598 | }
|
22599 | return undefined;
|
22600 | };
|
22601 | return AsapAction;
|
22602 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_2__["AsyncAction"]));
|
22603 |
|
22604 |
|
22605 |
|
22606 |
|
22607 | }),
|
22608 |
|
22609 | (function(module, __webpack_exports__, __webpack_require__) {
|
22610 |
|
22611 | "use strict";
|
22612 | __webpack_require__.r(__webpack_exports__);
|
22613 | __webpack_require__.d(__webpack_exports__, "Immediate", function() { return Immediate; });
|
22614 |
|
22615 | var nextHandle = 1;
|
22616 | var tasksByHandle = {};
|
22617 | function runIfPresent(handle) {
|
22618 | var cb = tasksByHandle[handle];
|
22619 | if (cb) {
|
22620 | cb();
|
22621 | }
|
22622 | }
|
22623 | var Immediate = {
|
22624 | setImmediate: function (cb) {
|
22625 | var handle = nextHandle++;
|
22626 | tasksByHandle[handle] = cb;
|
22627 | Promise.resolve().then(function () { return runIfPresent(handle); });
|
22628 | return handle;
|
22629 | },
|
22630 | clearImmediate: function (handle) {
|
22631 | delete tasksByHandle[handle];
|
22632 | },
|
22633 | };
|
22634 |
|
22635 |
|
22636 |
|
22637 | }),
|
22638 |
|
22639 | (function(module, __webpack_exports__, __webpack_require__) {
|
22640 |
|
22641 | "use strict";
|
22642 | __webpack_require__.r(__webpack_exports__);
|
22643 | __webpack_require__.d(__webpack_exports__, "AsapScheduler", function() { return AsapScheduler; });
|
22644 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22645 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178);
|
22646 |
|
22647 |
|
22648 |
|
22649 | var AsapScheduler = (function (_super) {
|
22650 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapScheduler, _super);
|
22651 | function AsapScheduler() {
|
22652 | return _super !== null && _super.apply(this, arguments) || this;
|
22653 | }
|
22654 | AsapScheduler.prototype.flush = function (action) {
|
22655 | this.active = true;
|
22656 | this.scheduled = undefined;
|
22657 | var actions = this.actions;
|
22658 | var error;
|
22659 | var index = -1;
|
22660 | var count = actions.length;
|
22661 | action = action || actions.shift();
|
22662 | do {
|
22663 | if (error = action.execute(action.state, action.delay)) {
|
22664 | break;
|
22665 | }
|
22666 | } while (++index < count && (action = actions.shift()));
|
22667 | this.active = false;
|
22668 | if (error) {
|
22669 | while (++index < count && (action = actions.shift())) {
|
22670 | action.unsubscribe();
|
22671 | }
|
22672 | throw error;
|
22673 | }
|
22674 | };
|
22675 | return AsapScheduler;
|
22676 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
|
22677 |
|
22678 |
|
22679 |
|
22680 |
|
22681 | }),
|
22682 |
|
22683 | (function(module, __webpack_exports__, __webpack_require__) {
|
22684 |
|
22685 | "use strict";
|
22686 | __webpack_require__.r(__webpack_exports__);
|
22687 | __webpack_require__.d(__webpack_exports__, "async", function() { return async; });
|
22688 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(175);
|
22689 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178);
|
22690 |
|
22691 |
|
22692 |
|
22693 | var async = new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"](_AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"]);
|
22694 |
|
22695 |
|
22696 |
|
22697 | }),
|
22698 |
|
22699 | (function(module, __webpack_exports__, __webpack_require__) {
|
22700 |
|
22701 | "use strict";
|
22702 | __webpack_require__.r(__webpack_exports__);
|
22703 | __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return animationFrame; });
|
22704 | var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(196);
|
22705 | var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(197);
|
22706 |
|
22707 |
|
22708 |
|
22709 | var animationFrame = new _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__["AnimationFrameScheduler"](_AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__["AnimationFrameAction"]);
|
22710 |
|
22711 |
|
22712 |
|
22713 | }),
|
22714 |
|
22715 | (function(module, __webpack_exports__, __webpack_require__) {
|
22716 |
|
22717 | "use strict";
|
22718 | __webpack_require__.r(__webpack_exports__);
|
22719 | __webpack_require__.d(__webpack_exports__, "AnimationFrameAction", function() { return AnimationFrameAction; });
|
22720 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22721 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
22722 |
|
22723 |
|
22724 |
|
22725 | var AnimationFrameAction = (function (_super) {
|
22726 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameAction, _super);
|
22727 | function AnimationFrameAction(scheduler, work) {
|
22728 | var _this = _super.call(this, scheduler, work) || this;
|
22729 | _this.scheduler = scheduler;
|
22730 | _this.work = work;
|
22731 | return _this;
|
22732 | }
|
22733 | AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
22734 | if (delay === void 0) {
|
22735 | delay = 0;
|
22736 | }
|
22737 | if (delay !== null && delay > 0) {
|
22738 | return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
|
22739 | }
|
22740 | scheduler.actions.push(this);
|
22741 | return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));
|
22742 | };
|
22743 | AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
22744 | if (delay === void 0) {
|
22745 | delay = 0;
|
22746 | }
|
22747 | if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
|
22748 | return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
22749 | }
|
22750 | if (scheduler.actions.length === 0) {
|
22751 | cancelAnimationFrame(id);
|
22752 | scheduler.scheduled = undefined;
|
22753 | }
|
22754 | return undefined;
|
22755 | };
|
22756 | return AnimationFrameAction;
|
22757 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
|
22758 |
|
22759 |
|
22760 |
|
22761 |
|
22762 | }),
|
22763 |
|
22764 | (function(module, __webpack_exports__, __webpack_require__) {
|
22765 |
|
22766 | "use strict";
|
22767 | __webpack_require__.r(__webpack_exports__);
|
22768 | __webpack_require__.d(__webpack_exports__, "AnimationFrameScheduler", function() { return AnimationFrameScheduler; });
|
22769 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22770 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178);
|
22771 |
|
22772 |
|
22773 |
|
22774 | var AnimationFrameScheduler = (function (_super) {
|
22775 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameScheduler, _super);
|
22776 | function AnimationFrameScheduler() {
|
22777 | return _super !== null && _super.apply(this, arguments) || this;
|
22778 | }
|
22779 | AnimationFrameScheduler.prototype.flush = function (action) {
|
22780 | this.active = true;
|
22781 | this.scheduled = undefined;
|
22782 | var actions = this.actions;
|
22783 | var error;
|
22784 | var index = -1;
|
22785 | var count = actions.length;
|
22786 | action = action || actions.shift();
|
22787 | do {
|
22788 | if (error = action.execute(action.state, action.delay)) {
|
22789 | break;
|
22790 | }
|
22791 | } while (++index < count && (action = actions.shift()));
|
22792 | this.active = false;
|
22793 | if (error) {
|
22794 | while (++index < count && (action = actions.shift())) {
|
22795 | action.unsubscribe();
|
22796 | }
|
22797 | throw error;
|
22798 | }
|
22799 | };
|
22800 | return AnimationFrameScheduler;
|
22801 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"]));
|
22802 |
|
22803 |
|
22804 |
|
22805 |
|
22806 | }),
|
22807 |
|
22808 | (function(module, __webpack_exports__, __webpack_require__) {
|
22809 |
|
22810 | "use strict";
|
22811 | __webpack_require__.r(__webpack_exports__);
|
22812 | __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return VirtualTimeScheduler; });
|
22813 | __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return VirtualAction; });
|
22814 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
22815 | var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(175);
|
22816 | var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(178);
|
22817 |
|
22818 |
|
22819 |
|
22820 |
|
22821 | var VirtualTimeScheduler = (function (_super) {
|
22822 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualTimeScheduler, _super);
|
22823 | function VirtualTimeScheduler(SchedulerAction, maxFrames) {
|
22824 | if (SchedulerAction === void 0) {
|
22825 | SchedulerAction = VirtualAction;
|
22826 | }
|
22827 | if (maxFrames === void 0) {
|
22828 | maxFrames = Number.POSITIVE_INFINITY;
|
22829 | }
|
22830 | var _this = _super.call(this, SchedulerAction, function () { return _this.frame; }) || this;
|
22831 | _this.maxFrames = maxFrames;
|
22832 | _this.frame = 0;
|
22833 | _this.index = -1;
|
22834 | return _this;
|
22835 | }
|
22836 | VirtualTimeScheduler.prototype.flush = function () {
|
22837 | var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
|
22838 | var error, action;
|
22839 | while ((action = actions[0]) && action.delay <= maxFrames) {
|
22840 | actions.shift();
|
22841 | this.frame = action.delay;
|
22842 | if (error = action.execute(action.state, action.delay)) {
|
22843 | break;
|
22844 | }
|
22845 | }
|
22846 | if (error) {
|
22847 | while (action = actions.shift()) {
|
22848 | action.unsubscribe();
|
22849 | }
|
22850 | throw error;
|
22851 | }
|
22852 | };
|
22853 | VirtualTimeScheduler.frameTimeFactor = 10;
|
22854 | return VirtualTimeScheduler;
|
22855 | }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__["AsyncScheduler"]));
|
22856 |
|
22857 | var VirtualAction = (function (_super) {
|
22858 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualAction, _super);
|
22859 | function VirtualAction(scheduler, work, index) {
|
22860 | if (index === void 0) {
|
22861 | index = scheduler.index += 1;
|
22862 | }
|
22863 | var _this = _super.call(this, scheduler, work) || this;
|
22864 | _this.scheduler = scheduler;
|
22865 | _this.work = work;
|
22866 | _this.index = index;
|
22867 | _this.active = true;
|
22868 | _this.index = scheduler.index = index;
|
22869 | return _this;
|
22870 | }
|
22871 | VirtualAction.prototype.schedule = function (state, delay) {
|
22872 | if (delay === void 0) {
|
22873 | delay = 0;
|
22874 | }
|
22875 | if (!this.id) {
|
22876 | return _super.prototype.schedule.call(this, state, delay);
|
22877 | }
|
22878 | this.active = false;
|
22879 | var action = new VirtualAction(this.scheduler, this.work);
|
22880 | this.add(action);
|
22881 | return action.schedule(state, delay);
|
22882 | };
|
22883 | VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {
|
22884 | if (delay === void 0) {
|
22885 | delay = 0;
|
22886 | }
|
22887 | this.delay = scheduler.frame + delay;
|
22888 | var actions = scheduler.actions;
|
22889 | actions.push(this);
|
22890 | actions.sort(VirtualAction.sortActions);
|
22891 | return true;
|
22892 | };
|
22893 | VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
|
22894 | if (delay === void 0) {
|
22895 | delay = 0;
|
22896 | }
|
22897 | return undefined;
|
22898 | };
|
22899 | VirtualAction.prototype._execute = function (state, delay) {
|
22900 | if (this.active === true) {
|
22901 | return _super.prototype._execute.call(this, state, delay);
|
22902 | }
|
22903 | };
|
22904 | VirtualAction.sortActions = function (a, b) {
|
22905 | if (a.delay === b.delay) {
|
22906 | if (a.index === b.index) {
|
22907 | return 0;
|
22908 | }
|
22909 | else if (a.index > b.index) {
|
22910 | return 1;
|
22911 | }
|
22912 | else {
|
22913 | return -1;
|
22914 | }
|
22915 | }
|
22916 | else if (a.delay > b.delay) {
|
22917 | return 1;
|
22918 | }
|
22919 | else {
|
22920 | return -1;
|
22921 | }
|
22922 | };
|
22923 | return VirtualAction;
|
22924 | }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"]));
|
22925 |
|
22926 |
|
22927 |
|
22928 |
|
22929 | }),
|
22930 |
|
22931 | (function(module, __webpack_exports__, __webpack_require__) {
|
22932 |
|
22933 | "use strict";
|
22934 | __webpack_require__.r(__webpack_exports__);
|
22935 | __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
|
22936 |
|
22937 | function identity(x) {
|
22938 | return x;
|
22939 | }
|
22940 |
|
22941 |
|
22942 |
|
22943 | }),
|
22944 |
|
22945 | (function(module, __webpack_exports__, __webpack_require__) {
|
22946 |
|
22947 | "use strict";
|
22948 | __webpack_require__.r(__webpack_exports__);
|
22949 | __webpack_require__.d(__webpack_exports__, "isObservable", function() { return isObservable; });
|
22950 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
22951 |
|
22952 |
|
22953 | function isObservable(obj) {
|
22954 | return !!obj && (obj instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));
|
22955 | }
|
22956 |
|
22957 |
|
22958 |
|
22959 | }),
|
22960 |
|
22961 | (function(module, __webpack_exports__, __webpack_require__) {
|
22962 |
|
22963 | "use strict";
|
22964 | __webpack_require__.r(__webpack_exports__);
|
22965 | __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return ArgumentOutOfRangeError; });
|
22966 |
|
22967 | function ArgumentOutOfRangeErrorImpl() {
|
22968 | Error.call(this);
|
22969 | this.message = 'argument out of range';
|
22970 | this.name = 'ArgumentOutOfRangeError';
|
22971 | return this;
|
22972 | }
|
22973 | ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);
|
22974 | var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;
|
22975 |
|
22976 |
|
22977 |
|
22978 | }),
|
22979 |
|
22980 | (function(module, __webpack_exports__, __webpack_require__) {
|
22981 |
|
22982 | "use strict";
|
22983 | __webpack_require__.r(__webpack_exports__);
|
22984 | __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return EmptyError; });
|
22985 |
|
22986 | function EmptyErrorImpl() {
|
22987 | Error.call(this);
|
22988 | this.message = 'no elements in sequence';
|
22989 | this.name = 'EmptyError';
|
22990 | return this;
|
22991 | }
|
22992 | EmptyErrorImpl.prototype = Object.create(Error.prototype);
|
22993 | var EmptyError = EmptyErrorImpl;
|
22994 |
|
22995 |
|
22996 |
|
22997 | }),
|
22998 |
|
22999 | (function(module, __webpack_exports__, __webpack_require__) {
|
23000 |
|
23001 | "use strict";
|
23002 | __webpack_require__.r(__webpack_exports__);
|
23003 | __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return TimeoutError; });
|
23004 |
|
23005 | function TimeoutErrorImpl() {
|
23006 | Error.call(this);
|
23007 | this.message = 'Timeout has occurred';
|
23008 | this.name = 'TimeoutError';
|
23009 | return this;
|
23010 | }
|
23011 | TimeoutErrorImpl.prototype = Object.create(Error.prototype);
|
23012 | var TimeoutError = TimeoutErrorImpl;
|
23013 |
|
23014 |
|
23015 |
|
23016 | }),
|
23017 |
|
23018 | (function(module, __webpack_exports__, __webpack_require__) {
|
23019 |
|
23020 | "use strict";
|
23021 | __webpack_require__.r(__webpack_exports__);
|
23022 | __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return bindCallback; });
|
23023 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
23024 | var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(189);
|
23025 | var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(205);
|
23026 | var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(149);
|
23027 | var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(157);
|
23028 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(184);
|
23029 |
|
23030 |
|
23031 |
|
23032 |
|
23033 |
|
23034 |
|
23035 |
|
23036 | function bindCallback(callbackFunc, resultSelector, scheduler) {
|
23037 | if (resultSelector) {
|
23038 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(resultSelector)) {
|
23039 | scheduler = resultSelector;
|
23040 | }
|
23041 | else {
|
23042 | return function () {
|
23043 | var args = [];
|
23044 | for (var _i = 0; _i < arguments.length; _i++) {
|
23045 | args[_i] = arguments[_i];
|
23046 | }
|
23047 | return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_4__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
23048 | };
|
23049 | }
|
23050 | }
|
23051 | return function () {
|
23052 | var args = [];
|
23053 | for (var _i = 0; _i < arguments.length; _i++) {
|
23054 | args[_i] = arguments[_i];
|
23055 | }
|
23056 | var context = this;
|
23057 | var subject;
|
23058 | var params = {
|
23059 | context: context,
|
23060 | subject: subject,
|
23061 | callbackFunc: callbackFunc,
|
23062 | scheduler: scheduler,
|
23063 | };
|
23064 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
23065 | if (!scheduler) {
|
23066 | if (!subject) {
|
23067 | subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
23068 | var handler = function () {
|
23069 | var innerArgs = [];
|
23070 | for (var _i = 0; _i < arguments.length; _i++) {
|
23071 | innerArgs[_i] = arguments[_i];
|
23072 | }
|
23073 | subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
|
23074 | subject.complete();
|
23075 | };
|
23076 | try {
|
23077 | callbackFunc.apply(context, args.concat([handler]));
|
23078 | }
|
23079 | catch (err) {
|
23080 | if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) {
|
23081 | subject.error(err);
|
23082 | }
|
23083 | else {
|
23084 | console.warn(err);
|
23085 | }
|
23086 | }
|
23087 | }
|
23088 | return subject.subscribe(subscriber);
|
23089 | }
|
23090 | else {
|
23091 | var state = {
|
23092 | args: args, subscriber: subscriber, params: params,
|
23093 | };
|
23094 | return scheduler.schedule(dispatch, 0, state);
|
23095 | }
|
23096 | });
|
23097 | };
|
23098 | }
|
23099 | function dispatch(state) {
|
23100 | var _this = this;
|
23101 | var self = this;
|
23102 | var args = state.args, subscriber = state.subscriber, params = state.params;
|
23103 | var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
|
23104 | var subject = params.subject;
|
23105 | if (!subject) {
|
23106 | subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
23107 | var handler = function () {
|
23108 | var innerArgs = [];
|
23109 | for (var _i = 0; _i < arguments.length; _i++) {
|
23110 | innerArgs[_i] = arguments[_i];
|
23111 | }
|
23112 | var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
|
23113 | _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
|
23114 | };
|
23115 | try {
|
23116 | callbackFunc.apply(context, args.concat([handler]));
|
23117 | }
|
23118 | catch (err) {
|
23119 | subject.error(err);
|
23120 | }
|
23121 | }
|
23122 | this.add(subject.subscribe(subscriber));
|
23123 | }
|
23124 | function dispatchNext(state) {
|
23125 | var value = state.value, subject = state.subject;
|
23126 | subject.next(value);
|
23127 | subject.complete();
|
23128 | }
|
23129 | function dispatchError(state) {
|
23130 | var err = state.err, subject = state.subject;
|
23131 | subject.error(err);
|
23132 | }
|
23133 |
|
23134 |
|
23135 |
|
23136 | }),
|
23137 |
|
23138 | (function(module, __webpack_exports__, __webpack_require__) {
|
23139 |
|
23140 | "use strict";
|
23141 | __webpack_require__.r(__webpack_exports__);
|
23142 | __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
|
23143 | __webpack_require__.d(__webpack_exports__, "MapOperator", function() { return MapOperator; });
|
23144 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
23145 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
23146 |
|
23147 |
|
23148 |
|
23149 | function map(project, thisArg) {
|
23150 | return function mapOperation(source) {
|
23151 | if (typeof project !== 'function') {
|
23152 | throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
|
23153 | }
|
23154 | return source.lift(new MapOperator(project, thisArg));
|
23155 | };
|
23156 | }
|
23157 | var MapOperator = (function () {
|
23158 | function MapOperator(project, thisArg) {
|
23159 | this.project = project;
|
23160 | this.thisArg = thisArg;
|
23161 | }
|
23162 | MapOperator.prototype.call = function (subscriber, source) {
|
23163 | return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
|
23164 | };
|
23165 | return MapOperator;
|
23166 | }());
|
23167 |
|
23168 | var MapSubscriber = (function (_super) {
|
23169 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapSubscriber, _super);
|
23170 | function MapSubscriber(destination, project, thisArg) {
|
23171 | var _this = _super.call(this, destination) || this;
|
23172 | _this.project = project;
|
23173 | _this.count = 0;
|
23174 | _this.thisArg = thisArg || _this;
|
23175 | return _this;
|
23176 | }
|
23177 | MapSubscriber.prototype._next = function (value) {
|
23178 | var result;
|
23179 | try {
|
23180 | result = this.project.call(this.thisArg, value, this.count++);
|
23181 | }
|
23182 | catch (err) {
|
23183 | this.destination.error(err);
|
23184 | return;
|
23185 | }
|
23186 | this.destination.next(result);
|
23187 | };
|
23188 | return MapSubscriber;
|
23189 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
23190 |
|
23191 |
|
23192 |
|
23193 | }),
|
23194 |
|
23195 | (function(module, __webpack_exports__, __webpack_require__) {
|
23196 |
|
23197 | "use strict";
|
23198 | __webpack_require__.r(__webpack_exports__);
|
23199 | __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return bindNodeCallback; });
|
23200 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
23201 | var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(189);
|
23202 | var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(205);
|
23203 | var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(149);
|
23204 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(184);
|
23205 | var _util_isArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(157);
|
23206 |
|
23207 |
|
23208 |
|
23209 |
|
23210 |
|
23211 |
|
23212 |
|
23213 | function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
|
23214 | if (resultSelector) {
|
23215 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(resultSelector)) {
|
23216 | scheduler = resultSelector;
|
23217 | }
|
23218 | else {
|
23219 | return function () {
|
23220 | var args = [];
|
23221 | for (var _i = 0; _i < arguments.length; _i++) {
|
23222 | args[_i] = arguments[_i];
|
23223 | }
|
23224 | return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_5__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
23225 | };
|
23226 | }
|
23227 | }
|
23228 | return function () {
|
23229 | var args = [];
|
23230 | for (var _i = 0; _i < arguments.length; _i++) {
|
23231 | args[_i] = arguments[_i];
|
23232 | }
|
23233 | var params = {
|
23234 | subject: undefined,
|
23235 | args: args,
|
23236 | callbackFunc: callbackFunc,
|
23237 | scheduler: scheduler,
|
23238 | context: this,
|
23239 | };
|
23240 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
23241 | var context = params.context;
|
23242 | var subject = params.subject;
|
23243 | if (!scheduler) {
|
23244 | if (!subject) {
|
23245 | subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
23246 | var handler = function () {
|
23247 | var innerArgs = [];
|
23248 | for (var _i = 0; _i < arguments.length; _i++) {
|
23249 | innerArgs[_i] = arguments[_i];
|
23250 | }
|
23251 | var err = innerArgs.shift();
|
23252 | if (err) {
|
23253 | subject.error(err);
|
23254 | return;
|
23255 | }
|
23256 | subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
|
23257 | subject.complete();
|
23258 | };
|
23259 | try {
|
23260 | callbackFunc.apply(context, args.concat([handler]));
|
23261 | }
|
23262 | catch (err) {
|
23263 | if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) {
|
23264 | subject.error(err);
|
23265 | }
|
23266 | else {
|
23267 | console.warn(err);
|
23268 | }
|
23269 | }
|
23270 | }
|
23271 | return subject.subscribe(subscriber);
|
23272 | }
|
23273 | else {
|
23274 | return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context });
|
23275 | }
|
23276 | });
|
23277 | };
|
23278 | }
|
23279 | function dispatch(state) {
|
23280 | var _this = this;
|
23281 | var params = state.params, subscriber = state.subscriber, context = state.context;
|
23282 | var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;
|
23283 | var subject = params.subject;
|
23284 | if (!subject) {
|
23285 | subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
|
23286 | var handler = function () {
|
23287 | var innerArgs = [];
|
23288 | for (var _i = 0; _i < arguments.length; _i++) {
|
23289 | innerArgs[_i] = arguments[_i];
|
23290 | }
|
23291 | var err = innerArgs.shift();
|
23292 | if (err) {
|
23293 | _this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
|
23294 | }
|
23295 | else {
|
23296 | var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
|
23297 | _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
|
23298 | }
|
23299 | };
|
23300 | try {
|
23301 | callbackFunc.apply(context, args.concat([handler]));
|
23302 | }
|
23303 | catch (err) {
|
23304 | this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
|
23305 | }
|
23306 | }
|
23307 | this.add(subject.subscribe(subscriber));
|
23308 | }
|
23309 | function dispatchNext(arg) {
|
23310 | var value = arg.value, subject = arg.subject;
|
23311 | subject.next(value);
|
23312 | subject.complete();
|
23313 | }
|
23314 | function dispatchError(arg) {
|
23315 | var err = arg.err, subject = arg.subject;
|
23316 | subject.error(err);
|
23317 | }
|
23318 |
|
23319 |
|
23320 |
|
23321 | }),
|
23322 |
|
23323 | (function(module, __webpack_exports__, __webpack_require__) {
|
23324 |
|
23325 | "use strict";
|
23326 | __webpack_require__.r(__webpack_exports__);
|
23327 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
|
23328 | __webpack_require__.d(__webpack_exports__, "CombineLatestOperator", function() { return CombineLatestOperator; });
|
23329 | __webpack_require__.d(__webpack_exports__, "CombineLatestSubscriber", function() { return CombineLatestSubscriber; });
|
23330 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
23331 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(184);
|
23332 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(157);
|
23333 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208);
|
23334 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(209);
|
23335 | var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(185);
|
23336 |
|
23337 |
|
23338 |
|
23339 |
|
23340 |
|
23341 |
|
23342 |
|
23343 | var NONE = {};
|
23344 | function combineLatest() {
|
23345 | var observables = [];
|
23346 | for (var _i = 0; _i < arguments.length; _i++) {
|
23347 | observables[_i] = arguments[_i];
|
23348 | }
|
23349 | var resultSelector = null;
|
23350 | var scheduler = null;
|
23351 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(observables[observables.length - 1])) {
|
23352 | scheduler = observables.pop();
|
23353 | }
|
23354 | if (typeof observables[observables.length - 1] === 'function') {
|
23355 | resultSelector = observables.pop();
|
23356 | }
|
23357 | if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(observables[0])) {
|
23358 | observables = observables[0];
|
23359 | }
|
23360 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_5__["fromArray"])(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
|
23361 | }
|
23362 | var CombineLatestOperator = (function () {
|
23363 | function CombineLatestOperator(resultSelector) {
|
23364 | this.resultSelector = resultSelector;
|
23365 | }
|
23366 | CombineLatestOperator.prototype.call = function (subscriber, source) {
|
23367 | return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
|
23368 | };
|
23369 | return CombineLatestOperator;
|
23370 | }());
|
23371 |
|
23372 | var CombineLatestSubscriber = (function (_super) {
|
23373 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CombineLatestSubscriber, _super);
|
23374 | function CombineLatestSubscriber(destination, resultSelector) {
|
23375 | var _this = _super.call(this, destination) || this;
|
23376 | _this.resultSelector = resultSelector;
|
23377 | _this.active = 0;
|
23378 | _this.values = [];
|
23379 | _this.observables = [];
|
23380 | return _this;
|
23381 | }
|
23382 | CombineLatestSubscriber.prototype._next = function (observable) {
|
23383 | this.values.push(NONE);
|
23384 | this.observables.push(observable);
|
23385 | };
|
23386 | CombineLatestSubscriber.prototype._complete = function () {
|
23387 | var observables = this.observables;
|
23388 | var len = observables.length;
|
23389 | if (len === 0) {
|
23390 | this.destination.complete();
|
23391 | }
|
23392 | else {
|
23393 | this.active = len;
|
23394 | this.toRespond = len;
|
23395 | for (var i = 0; i < len; i++) {
|
23396 | var observable = observables[i];
|
23397 | this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i));
|
23398 | }
|
23399 | }
|
23400 | };
|
23401 | CombineLatestSubscriber.prototype.notifyComplete = function (unused) {
|
23402 | if ((this.active -= 1) === 0) {
|
23403 | this.destination.complete();
|
23404 | }
|
23405 | };
|
23406 | CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
23407 | var values = this.values;
|
23408 | var oldVal = values[outerIndex];
|
23409 | var toRespond = !this.toRespond
|
23410 | ? 0
|
23411 | : oldVal === NONE ? --this.toRespond : this.toRespond;
|
23412 | values[outerIndex] = innerValue;
|
23413 | if (toRespond === 0) {
|
23414 | if (this.resultSelector) {
|
23415 | this._tryResultSelector(values);
|
23416 | }
|
23417 | else {
|
23418 | this.destination.next(values.slice());
|
23419 | }
|
23420 | }
|
23421 | };
|
23422 | CombineLatestSubscriber.prototype._tryResultSelector = function (values) {
|
23423 | var result;
|
23424 | try {
|
23425 | result = this.resultSelector.apply(this, values);
|
23426 | }
|
23427 | catch (err) {
|
23428 | this.destination.error(err);
|
23429 | return;
|
23430 | }
|
23431 | this.destination.next(result);
|
23432 | };
|
23433 | return CombineLatestSubscriber;
|
23434 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
23435 |
|
23436 |
|
23437 |
|
23438 |
|
23439 | }),
|
23440 |
|
23441 | (function(module, __webpack_exports__, __webpack_require__) {
|
23442 |
|
23443 | "use strict";
|
23444 | __webpack_require__.r(__webpack_exports__);
|
23445 | __webpack_require__.d(__webpack_exports__, "OuterSubscriber", function() { return OuterSubscriber; });
|
23446 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
23447 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
23448 |
|
23449 |
|
23450 |
|
23451 | var OuterSubscriber = (function (_super) {
|
23452 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OuterSubscriber, _super);
|
23453 | function OuterSubscriber() {
|
23454 | return _super !== null && _super.apply(this, arguments) || this;
|
23455 | }
|
23456 | OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
23457 | this.destination.next(innerValue);
|
23458 | };
|
23459 | OuterSubscriber.prototype.notifyError = function (error, innerSub) {
|
23460 | this.destination.error(error);
|
23461 | };
|
23462 | OuterSubscriber.prototype.notifyComplete = function (innerSub) {
|
23463 | this.destination.complete();
|
23464 | };
|
23465 | return OuterSubscriber;
|
23466 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
23467 |
|
23468 |
|
23469 |
|
23470 |
|
23471 | }),
|
23472 |
|
23473 | (function(module, __webpack_exports__, __webpack_require__) {
|
23474 |
|
23475 | "use strict";
|
23476 | __webpack_require__.r(__webpack_exports__);
|
23477 | __webpack_require__.d(__webpack_exports__, "subscribeToResult", function() { return subscribeToResult; });
|
23478 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210);
|
23479 | var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(211);
|
23480 | var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148);
|
23481 |
|
23482 |
|
23483 |
|
23484 |
|
23485 | function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) {
|
23486 | if (destination === void 0) {
|
23487 | destination = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__["InnerSubscriber"](outerSubscriber, outerValue, outerIndex);
|
23488 | }
|
23489 | if (destination.closed) {
|
23490 | return undefined;
|
23491 | }
|
23492 | if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]) {
|
23493 | return result.subscribe(destination);
|
23494 | }
|
23495 | return Object(_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(result)(destination);
|
23496 | }
|
23497 |
|
23498 |
|
23499 |
|
23500 | }),
|
23501 |
|
23502 | (function(module, __webpack_exports__, __webpack_require__) {
|
23503 |
|
23504 | "use strict";
|
23505 | __webpack_require__.r(__webpack_exports__);
|
23506 | __webpack_require__.d(__webpack_exports__, "InnerSubscriber", function() { return InnerSubscriber; });
|
23507 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
23508 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
23509 |
|
23510 |
|
23511 |
|
23512 | var InnerSubscriber = (function (_super) {
|
23513 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerSubscriber, _super);
|
23514 | function InnerSubscriber(parent, outerValue, outerIndex) {
|
23515 | var _this = _super.call(this) || this;
|
23516 | _this.parent = parent;
|
23517 | _this.outerValue = outerValue;
|
23518 | _this.outerIndex = outerIndex;
|
23519 | _this.index = 0;
|
23520 | return _this;
|
23521 | }
|
23522 | InnerSubscriber.prototype._next = function (value) {
|
23523 | this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
|
23524 | };
|
23525 | InnerSubscriber.prototype._error = function (error) {
|
23526 | this.parent.notifyError(error, this);
|
23527 | this.unsubscribe();
|
23528 | };
|
23529 | InnerSubscriber.prototype._complete = function () {
|
23530 | this.parent.notifyComplete(this);
|
23531 | this.unsubscribe();
|
23532 | };
|
23533 | return InnerSubscriber;
|
23534 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
23535 |
|
23536 |
|
23537 |
|
23538 |
|
23539 | }),
|
23540 |
|
23541 | (function(module, __webpack_exports__, __webpack_require__) {
|
23542 |
|
23543 | "use strict";
|
23544 | __webpack_require__.r(__webpack_exports__);
|
23545 | __webpack_require__.d(__webpack_exports__, "subscribeTo", function() { return subscribeTo; });
|
23546 | var _subscribeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(186);
|
23547 | var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(212);
|
23548 | var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(213);
|
23549 | var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(215);
|
23550 | var _isArrayLike__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(216);
|
23551 | var _isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(217);
|
23552 | var _isObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(158);
|
23553 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(214);
|
23554 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(162);
|
23555 |
|
23556 |
|
23557 |
|
23558 |
|
23559 |
|
23560 |
|
23561 |
|
23562 |
|
23563 |
|
23564 |
|
23565 | var subscribeTo = function (result) {
|
23566 | if (!!result && typeof result[_symbol_observable__WEBPACK_IMPORTED_MODULE_8__["observable"]] === 'function') {
|
23567 | return Object(_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__["subscribeToObservable"])(result);
|
23568 | }
|
23569 | else if (Object(_isArrayLike__WEBPACK_IMPORTED_MODULE_4__["isArrayLike"])(result)) {
|
23570 | return Object(_subscribeToArray__WEBPACK_IMPORTED_MODULE_0__["subscribeToArray"])(result);
|
23571 | }
|
23572 | else if (Object(_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(result)) {
|
23573 | return Object(_subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__["subscribeToPromise"])(result);
|
23574 | }
|
23575 | else if (!!result && typeof result[_symbol_iterator__WEBPACK_IMPORTED_MODULE_7__["iterator"]] === 'function') {
|
23576 | return Object(_subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__["subscribeToIterable"])(result);
|
23577 | }
|
23578 | else {
|
23579 | var value = Object(_isObject__WEBPACK_IMPORTED_MODULE_6__["isObject"])(result) ? 'an invalid object' : "'" + result + "'";
|
23580 | var msg = "You provided " + value + " where a stream was expected."
|
23581 | + ' You can provide an Observable, Promise, Array, or Iterable.';
|
23582 | throw new TypeError(msg);
|
23583 | }
|
23584 | };
|
23585 |
|
23586 |
|
23587 |
|
23588 | }),
|
23589 |
|
23590 | (function(module, __webpack_exports__, __webpack_require__) {
|
23591 |
|
23592 | "use strict";
|
23593 | __webpack_require__.r(__webpack_exports__);
|
23594 | __webpack_require__.d(__webpack_exports__, "subscribeToPromise", function() { return subscribeToPromise; });
|
23595 | var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(155);
|
23596 |
|
23597 |
|
23598 | var subscribeToPromise = function (promise) {
|
23599 | return function (subscriber) {
|
23600 | promise.then(function (value) {
|
23601 | if (!subscriber.closed) {
|
23602 | subscriber.next(value);
|
23603 | subscriber.complete();
|
23604 | }
|
23605 | }, function (err) { return subscriber.error(err); })
|
23606 | .then(null, _hostReportError__WEBPACK_IMPORTED_MODULE_0__["hostReportError"]);
|
23607 | return subscriber;
|
23608 | };
|
23609 | };
|
23610 |
|
23611 |
|
23612 |
|
23613 | }),
|
23614 |
|
23615 | (function(module, __webpack_exports__, __webpack_require__) {
|
23616 |
|
23617 | "use strict";
|
23618 | __webpack_require__.r(__webpack_exports__);
|
23619 | __webpack_require__.d(__webpack_exports__, "subscribeToIterable", function() { return subscribeToIterable; });
|
23620 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(214);
|
23621 |
|
23622 |
|
23623 | var subscribeToIterable = function (iterable) {
|
23624 | return function (subscriber) {
|
23625 | var iterator = iterable[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]]();
|
23626 | do {
|
23627 | var item = iterator.next();
|
23628 | if (item.done) {
|
23629 | subscriber.complete();
|
23630 | break;
|
23631 | }
|
23632 | subscriber.next(item.value);
|
23633 | if (subscriber.closed) {
|
23634 | break;
|
23635 | }
|
23636 | } while (true);
|
23637 | if (typeof iterator.return === 'function') {
|
23638 | subscriber.add(function () {
|
23639 | if (iterator.return) {
|
23640 | iterator.return();
|
23641 | }
|
23642 | });
|
23643 | }
|
23644 | return subscriber;
|
23645 | };
|
23646 | };
|
23647 |
|
23648 |
|
23649 |
|
23650 | }),
|
23651 |
|
23652 | (function(module, __webpack_exports__, __webpack_require__) {
|
23653 |
|
23654 | "use strict";
|
23655 | __webpack_require__.r(__webpack_exports__);
|
23656 | __webpack_require__.d(__webpack_exports__, "getSymbolIterator", function() { return getSymbolIterator; });
|
23657 | __webpack_require__.d(__webpack_exports__, "iterator", function() { return iterator; });
|
23658 | __webpack_require__.d(__webpack_exports__, "$$iterator", function() { return $$iterator; });
|
23659 |
|
23660 | function getSymbolIterator() {
|
23661 | if (typeof Symbol !== 'function' || !Symbol.iterator) {
|
23662 | return '@@iterator';
|
23663 | }
|
23664 | return Symbol.iterator;
|
23665 | }
|
23666 | var iterator = getSymbolIterator();
|
23667 | var $$iterator = iterator;
|
23668 |
|
23669 |
|
23670 |
|
23671 | }),
|
23672 |
|
23673 | (function(module, __webpack_exports__, __webpack_require__) {
|
23674 |
|
23675 | "use strict";
|
23676 | __webpack_require__.r(__webpack_exports__);
|
23677 | __webpack_require__.d(__webpack_exports__, "subscribeToObservable", function() { return subscribeToObservable; });
|
23678 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(162);
|
23679 |
|
23680 |
|
23681 | var subscribeToObservable = function (obj) {
|
23682 | return function (subscriber) {
|
23683 | var obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]]();
|
23684 | if (typeof obs.subscribe !== 'function') {
|
23685 | throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
23686 | }
|
23687 | else {
|
23688 | return obs.subscribe(subscriber);
|
23689 | }
|
23690 | };
|
23691 | };
|
23692 |
|
23693 |
|
23694 |
|
23695 | }),
|
23696 |
|
23697 | (function(module, __webpack_exports__, __webpack_require__) {
|
23698 |
|
23699 | "use strict";
|
23700 | __webpack_require__.r(__webpack_exports__);
|
23701 | __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return isArrayLike; });
|
23702 |
|
23703 | var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
|
23704 |
|
23705 |
|
23706 |
|
23707 | }),
|
23708 |
|
23709 | (function(module, __webpack_exports__, __webpack_require__) {
|
23710 |
|
23711 | "use strict";
|
23712 | __webpack_require__.r(__webpack_exports__);
|
23713 | __webpack_require__.d(__webpack_exports__, "isPromise", function() { return isPromise; });
|
23714 |
|
23715 | function isPromise(value) {
|
23716 | return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
|
23717 | }
|
23718 |
|
23719 |
|
23720 |
|
23721 | }),
|
23722 |
|
23723 | (function(module, __webpack_exports__, __webpack_require__) {
|
23724 |
|
23725 | "use strict";
|
23726 | __webpack_require__.r(__webpack_exports__);
|
23727 | __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
|
23728 | var _of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(183);
|
23729 | var _operators_concatAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(219);
|
23730 |
|
23731 |
|
23732 |
|
23733 | function concat() {
|
23734 | var observables = [];
|
23735 | for (var _i = 0; _i < arguments.length; _i++) {
|
23736 | observables[_i] = arguments[_i];
|
23737 | }
|
23738 | return Object(_operators_concatAll__WEBPACK_IMPORTED_MODULE_1__["concatAll"])()(_of__WEBPACK_IMPORTED_MODULE_0__["of"].apply(void 0, observables));
|
23739 | }
|
23740 |
|
23741 |
|
23742 |
|
23743 | }),
|
23744 |
|
23745 | (function(module, __webpack_exports__, __webpack_require__) {
|
23746 |
|
23747 | "use strict";
|
23748 | __webpack_require__.r(__webpack_exports__);
|
23749 | __webpack_require__.d(__webpack_exports__, "concatAll", function() { return concatAll; });
|
23750 | var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(220);
|
23751 |
|
23752 |
|
23753 | function concatAll() {
|
23754 | return Object(_mergeAll__WEBPACK_IMPORTED_MODULE_0__["mergeAll"])(1);
|
23755 | }
|
23756 |
|
23757 |
|
23758 |
|
23759 | }),
|
23760 |
|
23761 | (function(module, __webpack_exports__, __webpack_require__) {
|
23762 |
|
23763 | "use strict";
|
23764 | __webpack_require__.r(__webpack_exports__);
|
23765 | __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return mergeAll; });
|
23766 | var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221);
|
23767 | var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(199);
|
23768 |
|
23769 |
|
23770 |
|
23771 | function mergeAll(concurrent) {
|
23772 | if (concurrent === void 0) {
|
23773 | concurrent = Number.POSITIVE_INFINITY;
|
23774 | }
|
23775 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"], concurrent);
|
23776 | }
|
23777 |
|
23778 |
|
23779 |
|
23780 | }),
|
23781 |
|
23782 | (function(module, __webpack_exports__, __webpack_require__) {
|
23783 |
|
23784 | "use strict";
|
23785 | __webpack_require__.r(__webpack_exports__);
|
23786 | __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return mergeMap; });
|
23787 | __webpack_require__.d(__webpack_exports__, "MergeMapOperator", function() { return MergeMapOperator; });
|
23788 | __webpack_require__.d(__webpack_exports__, "MergeMapSubscriber", function() { return MergeMapSubscriber; });
|
23789 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
23790 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(209);
|
23791 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208);
|
23792 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(210);
|
23793 | var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(205);
|
23794 | var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(222);
|
23795 |
|
23796 |
|
23797 |
|
23798 |
|
23799 |
|
23800 |
|
23801 |
|
23802 | function mergeMap(project, resultSelector, concurrent) {
|
23803 | if (concurrent === void 0) {
|
23804 | concurrent = Number.POSITIVE_INFINITY;
|
23805 | }
|
23806 | if (typeof resultSelector === 'function') {
|
23807 | return function (source) { return source.pipe(mergeMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_5__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_4__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };
|
23808 | }
|
23809 | else if (typeof resultSelector === 'number') {
|
23810 | concurrent = resultSelector;
|
23811 | }
|
23812 | return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };
|
23813 | }
|
23814 | var MergeMapOperator = (function () {
|
23815 | function MergeMapOperator(project, concurrent) {
|
23816 | if (concurrent === void 0) {
|
23817 | concurrent = Number.POSITIVE_INFINITY;
|
23818 | }
|
23819 | this.project = project;
|
23820 | this.concurrent = concurrent;
|
23821 | }
|
23822 | MergeMapOperator.prototype.call = function (observer, source) {
|
23823 | return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
|
23824 | };
|
23825 | return MergeMapOperator;
|
23826 | }());
|
23827 |
|
23828 | var MergeMapSubscriber = (function (_super) {
|
23829 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeMapSubscriber, _super);
|
23830 | function MergeMapSubscriber(destination, project, concurrent) {
|
23831 | if (concurrent === void 0) {
|
23832 | concurrent = Number.POSITIVE_INFINITY;
|
23833 | }
|
23834 | var _this = _super.call(this, destination) || this;
|
23835 | _this.project = project;
|
23836 | _this.concurrent = concurrent;
|
23837 | _this.hasCompleted = false;
|
23838 | _this.buffer = [];
|
23839 | _this.active = 0;
|
23840 | _this.index = 0;
|
23841 | return _this;
|
23842 | }
|
23843 | MergeMapSubscriber.prototype._next = function (value) {
|
23844 | if (this.active < this.concurrent) {
|
23845 | this._tryNext(value);
|
23846 | }
|
23847 | else {
|
23848 | this.buffer.push(value);
|
23849 | }
|
23850 | };
|
23851 | MergeMapSubscriber.prototype._tryNext = function (value) {
|
23852 | var result;
|
23853 | var index = this.index++;
|
23854 | try {
|
23855 | result = this.project(value, index);
|
23856 | }
|
23857 | catch (err) {
|
23858 | this.destination.error(err);
|
23859 | return;
|
23860 | }
|
23861 | this.active++;
|
23862 | this._innerSub(result, value, index);
|
23863 | };
|
23864 | MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
|
23865 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__["InnerSubscriber"](this, undefined, undefined);
|
23866 | var destination = this.destination;
|
23867 | destination.add(innerSubscriber);
|
23868 | Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, ish, value, index, innerSubscriber);
|
23869 | };
|
23870 | MergeMapSubscriber.prototype._complete = function () {
|
23871 | this.hasCompleted = true;
|
23872 | if (this.active === 0 && this.buffer.length === 0) {
|
23873 | this.destination.complete();
|
23874 | }
|
23875 | this.unsubscribe();
|
23876 | };
|
23877 | MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
23878 | this.destination.next(innerValue);
|
23879 | };
|
23880 | MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
|
23881 | var buffer = this.buffer;
|
23882 | this.remove(innerSub);
|
23883 | this.active--;
|
23884 | if (buffer.length > 0) {
|
23885 | this._next(buffer.shift());
|
23886 | }
|
23887 | else if (this.active === 0 && this.hasCompleted) {
|
23888 | this.destination.complete();
|
23889 | }
|
23890 | };
|
23891 | return MergeMapSubscriber;
|
23892 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
23893 |
|
23894 |
|
23895 |
|
23896 |
|
23897 | }),
|
23898 |
|
23899 | (function(module, __webpack_exports__, __webpack_require__) {
|
23900 |
|
23901 | "use strict";
|
23902 | __webpack_require__.r(__webpack_exports__);
|
23903 | __webpack_require__.d(__webpack_exports__, "from", function() { return from; });
|
23904 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
23905 | var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(211);
|
23906 | var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(223);
|
23907 |
|
23908 |
|
23909 |
|
23910 |
|
23911 | function from(input, scheduler) {
|
23912 | if (!scheduler) {
|
23913 | if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
|
23914 | return input;
|
23915 | }
|
23916 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(input));
|
23917 | }
|
23918 | else {
|
23919 | return Object(_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__["scheduled"])(input, scheduler);
|
23920 | }
|
23921 | }
|
23922 |
|
23923 |
|
23924 |
|
23925 | }),
|
23926 |
|
23927 | (function(module, __webpack_exports__, __webpack_require__) {
|
23928 |
|
23929 | "use strict";
|
23930 | __webpack_require__.r(__webpack_exports__);
|
23931 | __webpack_require__.d(__webpack_exports__, "scheduled", function() { return scheduled; });
|
23932 | var _scheduleObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(224);
|
23933 | var _schedulePromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(225);
|
23934 | var _scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(187);
|
23935 | var _scheduleIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(226);
|
23936 | var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(227);
|
23937 | var _util_isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(217);
|
23938 | var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(216);
|
23939 | var _util_isIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(228);
|
23940 |
|
23941 |
|
23942 |
|
23943 |
|
23944 |
|
23945 |
|
23946 |
|
23947 |
|
23948 |
|
23949 | function scheduled(input, scheduler) {
|
23950 | if (input != null) {
|
23951 | if (Object(_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__["isInteropObservable"])(input)) {
|
23952 | return Object(_scheduleObservable__WEBPACK_IMPORTED_MODULE_0__["scheduleObservable"])(input, scheduler);
|
23953 | }
|
23954 | else if (Object(_util_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(input)) {
|
23955 | return Object(_schedulePromise__WEBPACK_IMPORTED_MODULE_1__["schedulePromise"])(input, scheduler);
|
23956 | }
|
23957 | else if (Object(_util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__["isArrayLike"])(input)) {
|
23958 | return Object(_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler);
|
23959 | }
|
23960 | else if (Object(_util_isIterable__WEBPACK_IMPORTED_MODULE_7__["isIterable"])(input) || typeof input === 'string') {
|
23961 | return Object(_scheduleIterable__WEBPACK_IMPORTED_MODULE_3__["scheduleIterable"])(input, scheduler);
|
23962 | }
|
23963 | }
|
23964 | throw new TypeError((input !== null && typeof input || input) + ' is not observable');
|
23965 | }
|
23966 |
|
23967 |
|
23968 |
|
23969 | }),
|
23970 |
|
23971 | (function(module, __webpack_exports__, __webpack_require__) {
|
23972 |
|
23973 | "use strict";
|
23974 | __webpack_require__.r(__webpack_exports__);
|
23975 | __webpack_require__.d(__webpack_exports__, "scheduleObservable", function() { return scheduleObservable; });
|
23976 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
23977 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
23978 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(162);
|
23979 |
|
23980 |
|
23981 |
|
23982 |
|
23983 | function scheduleObservable(input, scheduler) {
|
23984 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
23985 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
23986 | sub.add(scheduler.schedule(function () {
|
23987 | var observable = input[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]]();
|
23988 | sub.add(observable.subscribe({
|
23989 | next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },
|
23990 | error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },
|
23991 | complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },
|
23992 | }));
|
23993 | }));
|
23994 | return sub;
|
23995 | });
|
23996 | }
|
23997 |
|
23998 |
|
23999 |
|
24000 | }),
|
24001 |
|
24002 | (function(module, __webpack_exports__, __webpack_require__) {
|
24003 |
|
24004 | "use strict";
|
24005 | __webpack_require__.r(__webpack_exports__);
|
24006 | __webpack_require__.d(__webpack_exports__, "schedulePromise", function() { return schedulePromise; });
|
24007 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24008 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
24009 |
|
24010 |
|
24011 |
|
24012 | function schedulePromise(input, scheduler) {
|
24013 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24014 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
24015 | sub.add(scheduler.schedule(function () {
|
24016 | return input.then(function (value) {
|
24017 | sub.add(scheduler.schedule(function () {
|
24018 | subscriber.next(value);
|
24019 | sub.add(scheduler.schedule(function () { return subscriber.complete(); }));
|
24020 | }));
|
24021 | }, function (err) {
|
24022 | sub.add(scheduler.schedule(function () { return subscriber.error(err); }));
|
24023 | });
|
24024 | }));
|
24025 | return sub;
|
24026 | });
|
24027 | }
|
24028 |
|
24029 |
|
24030 |
|
24031 | }),
|
24032 |
|
24033 | (function(module, __webpack_exports__, __webpack_require__) {
|
24034 |
|
24035 | "use strict";
|
24036 | __webpack_require__.r(__webpack_exports__);
|
24037 | __webpack_require__.d(__webpack_exports__, "scheduleIterable", function() { return scheduleIterable; });
|
24038 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24039 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
24040 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(214);
|
24041 |
|
24042 |
|
24043 |
|
24044 |
|
24045 | function scheduleIterable(input, scheduler) {
|
24046 | if (!input) {
|
24047 | throw new Error('Iterable cannot be null');
|
24048 | }
|
24049 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24050 | var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
24051 | var iterator;
|
24052 | sub.add(function () {
|
24053 | if (iterator && typeof iterator.return === 'function') {
|
24054 | iterator.return();
|
24055 | }
|
24056 | });
|
24057 | sub.add(scheduler.schedule(function () {
|
24058 | iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__["iterator"]]();
|
24059 | sub.add(scheduler.schedule(function () {
|
24060 | if (subscriber.closed) {
|
24061 | return;
|
24062 | }
|
24063 | var value;
|
24064 | var done;
|
24065 | try {
|
24066 | var result = iterator.next();
|
24067 | value = result.value;
|
24068 | done = result.done;
|
24069 | }
|
24070 | catch (err) {
|
24071 | subscriber.error(err);
|
24072 | return;
|
24073 | }
|
24074 | if (done) {
|
24075 | subscriber.complete();
|
24076 | }
|
24077 | else {
|
24078 | subscriber.next(value);
|
24079 | this.schedule();
|
24080 | }
|
24081 | }));
|
24082 | }));
|
24083 | return sub;
|
24084 | });
|
24085 | }
|
24086 |
|
24087 |
|
24088 |
|
24089 | }),
|
24090 |
|
24091 | (function(module, __webpack_exports__, __webpack_require__) {
|
24092 |
|
24093 | "use strict";
|
24094 | __webpack_require__.r(__webpack_exports__);
|
24095 | __webpack_require__.d(__webpack_exports__, "isInteropObservable", function() { return isInteropObservable; });
|
24096 | var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(162);
|
24097 |
|
24098 |
|
24099 | function isInteropObservable(input) {
|
24100 | return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]] === 'function';
|
24101 | }
|
24102 |
|
24103 |
|
24104 |
|
24105 | }),
|
24106 |
|
24107 | (function(module, __webpack_exports__, __webpack_require__) {
|
24108 |
|
24109 | "use strict";
|
24110 | __webpack_require__.r(__webpack_exports__);
|
24111 | __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; });
|
24112 | var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(214);
|
24113 |
|
24114 |
|
24115 | function isIterable(input) {
|
24116 | return input && typeof input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]] === 'function';
|
24117 | }
|
24118 |
|
24119 |
|
24120 |
|
24121 | }),
|
24122 |
|
24123 | (function(module, __webpack_exports__, __webpack_require__) {
|
24124 |
|
24125 | "use strict";
|
24126 | __webpack_require__.r(__webpack_exports__);
|
24127 | __webpack_require__.d(__webpack_exports__, "defer", function() { return defer; });
|
24128 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24129 | var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(222);
|
24130 | var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(182);
|
24131 |
|
24132 |
|
24133 |
|
24134 |
|
24135 | function defer(observableFactory) {
|
24136 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24137 | var input;
|
24138 | try {
|
24139 | input = observableFactory();
|
24140 | }
|
24141 | catch (err) {
|
24142 | subscriber.error(err);
|
24143 | return undefined;
|
24144 | }
|
24145 | var source = input ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(input) : Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
|
24146 | return source.subscribe(subscriber);
|
24147 | });
|
24148 | }
|
24149 |
|
24150 |
|
24151 |
|
24152 | }),
|
24153 |
|
24154 | (function(module, __webpack_exports__, __webpack_require__) {
|
24155 |
|
24156 | "use strict";
|
24157 | __webpack_require__.r(__webpack_exports__);
|
24158 | __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return forkJoin; });
|
24159 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24160 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(157);
|
24161 | var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(205);
|
24162 | var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(158);
|
24163 | var _from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(222);
|
24164 |
|
24165 |
|
24166 |
|
24167 |
|
24168 |
|
24169 |
|
24170 | function forkJoin() {
|
24171 | var sources = [];
|
24172 | for (var _i = 0; _i < arguments.length; _i++) {
|
24173 | sources[_i] = arguments[_i];
|
24174 | }
|
24175 | if (sources.length === 1) {
|
24176 | var first_1 = sources[0];
|
24177 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(first_1)) {
|
24178 | return forkJoinInternal(first_1, null);
|
24179 | }
|
24180 | if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_3__["isObject"])(first_1) && Object.getPrototypeOf(first_1) === Object.prototype) {
|
24181 | var keys = Object.keys(first_1);
|
24182 | return forkJoinInternal(keys.map(function (key) { return first_1[key]; }), keys);
|
24183 | }
|
24184 | }
|
24185 | if (typeof sources[sources.length - 1] === 'function') {
|
24186 | var resultSelector_1 = sources.pop();
|
24187 | sources = (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(sources[0])) ? sources[0] : sources;
|
24188 | return forkJoinInternal(sources, null).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return resultSelector_1.apply(void 0, args); }));
|
24189 | }
|
24190 | return forkJoinInternal(sources, null);
|
24191 | }
|
24192 | function forkJoinInternal(sources, keys) {
|
24193 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24194 | var len = sources.length;
|
24195 | if (len === 0) {
|
24196 | subscriber.complete();
|
24197 | return;
|
24198 | }
|
24199 | var values = new Array(len);
|
24200 | var completed = 0;
|
24201 | var emitted = 0;
|
24202 | var _loop_1 = function (i) {
|
24203 | var source = Object(_from__WEBPACK_IMPORTED_MODULE_4__["from"])(sources[i]);
|
24204 | var hasValue = false;
|
24205 | subscriber.add(source.subscribe({
|
24206 | next: function (value) {
|
24207 | if (!hasValue) {
|
24208 | hasValue = true;
|
24209 | emitted++;
|
24210 | }
|
24211 | values[i] = value;
|
24212 | },
|
24213 | error: function (err) { return subscriber.error(err); },
|
24214 | complete: function () {
|
24215 | completed++;
|
24216 | if (completed === len || !hasValue) {
|
24217 | if (emitted === len) {
|
24218 | subscriber.next(keys ?
|
24219 | keys.reduce(function (result, key, i) { return (result[key] = values[i], result); }, {}) :
|
24220 | values);
|
24221 | }
|
24222 | subscriber.complete();
|
24223 | }
|
24224 | }
|
24225 | }));
|
24226 | };
|
24227 | for (var i = 0; i < len; i++) {
|
24228 | _loop_1(i);
|
24229 | }
|
24230 | });
|
24231 | }
|
24232 |
|
24233 |
|
24234 |
|
24235 | }),
|
24236 |
|
24237 | (function(module, __webpack_exports__, __webpack_require__) {
|
24238 |
|
24239 | "use strict";
|
24240 | __webpack_require__.r(__webpack_exports__);
|
24241 | __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return fromEvent; });
|
24242 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24243 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(157);
|
24244 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(152);
|
24245 | var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(205);
|
24246 |
|
24247 |
|
24248 |
|
24249 |
|
24250 |
|
24251 | var toString = Object.prototype.toString;
|
24252 | function fromEvent(target, eventName, options, resultSelector) {
|
24253 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(options)) {
|
24254 | resultSelector = options;
|
24255 | options = undefined;
|
24256 | }
|
24257 | if (resultSelector) {
|
24258 | return fromEvent(target, eventName, options).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
24259 | }
|
24260 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24261 | function handler(e) {
|
24262 | if (arguments.length > 1) {
|
24263 | subscriber.next(Array.prototype.slice.call(arguments));
|
24264 | }
|
24265 | else {
|
24266 | subscriber.next(e);
|
24267 | }
|
24268 | }
|
24269 | setupSubscription(target, eventName, handler, subscriber, options);
|
24270 | });
|
24271 | }
|
24272 | function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
|
24273 | var unsubscribe;
|
24274 | if (isEventTarget(sourceObj)) {
|
24275 | var source_1 = sourceObj;
|
24276 | sourceObj.addEventListener(eventName, handler, options);
|
24277 | unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };
|
24278 | }
|
24279 | else if (isJQueryStyleEventEmitter(sourceObj)) {
|
24280 | var source_2 = sourceObj;
|
24281 | sourceObj.on(eventName, handler);
|
24282 | unsubscribe = function () { return source_2.off(eventName, handler); };
|
24283 | }
|
24284 | else if (isNodeStyleEventEmitter(sourceObj)) {
|
24285 | var source_3 = sourceObj;
|
24286 | sourceObj.addListener(eventName, handler);
|
24287 | unsubscribe = function () { return source_3.removeListener(eventName, handler); };
|
24288 | }
|
24289 | else if (sourceObj && sourceObj.length) {
|
24290 | for (var i = 0, len = sourceObj.length; i < len; i++) {
|
24291 | setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
|
24292 | }
|
24293 | }
|
24294 | else {
|
24295 | throw new TypeError('Invalid event target');
|
24296 | }
|
24297 | subscriber.add(unsubscribe);
|
24298 | }
|
24299 | function isNodeStyleEventEmitter(sourceObj) {
|
24300 | return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
|
24301 | }
|
24302 | function isJQueryStyleEventEmitter(sourceObj) {
|
24303 | return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
|
24304 | }
|
24305 | function isEventTarget(sourceObj) {
|
24306 | return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
|
24307 | }
|
24308 |
|
24309 |
|
24310 |
|
24311 | }),
|
24312 |
|
24313 | (function(module, __webpack_exports__, __webpack_require__) {
|
24314 |
|
24315 | "use strict";
|
24316 | __webpack_require__.r(__webpack_exports__);
|
24317 | __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return fromEventPattern; });
|
24318 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24319 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(157);
|
24320 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(152);
|
24321 | var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(205);
|
24322 |
|
24323 |
|
24324 |
|
24325 |
|
24326 |
|
24327 | function fromEventPattern(addHandler, removeHandler, resultSelector) {
|
24328 | if (resultSelector) {
|
24329 | return fromEventPattern(addHandler, removeHandler).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
24330 | }
|
24331 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24332 | var handler = function () {
|
24333 | var e = [];
|
24334 | for (var _i = 0; _i < arguments.length; _i++) {
|
24335 | e[_i] = arguments[_i];
|
24336 | }
|
24337 | return subscriber.next(e.length === 1 ? e[0] : e);
|
24338 | };
|
24339 | var retValue;
|
24340 | try {
|
24341 | retValue = addHandler(handler);
|
24342 | }
|
24343 | catch (err) {
|
24344 | subscriber.error(err);
|
24345 | return undefined;
|
24346 | }
|
24347 | if (!Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(removeHandler)) {
|
24348 | return undefined;
|
24349 | }
|
24350 | return function () { return removeHandler(handler, retValue); };
|
24351 | });
|
24352 | }
|
24353 |
|
24354 |
|
24355 |
|
24356 | }),
|
24357 |
|
24358 | (function(module, __webpack_exports__, __webpack_require__) {
|
24359 |
|
24360 | "use strict";
|
24361 | __webpack_require__.r(__webpack_exports__);
|
24362 | __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
|
24363 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24364 | var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(199);
|
24365 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(184);
|
24366 |
|
24367 |
|
24368 |
|
24369 |
|
24370 | function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
|
24371 | var resultSelector;
|
24372 | var initialState;
|
24373 | if (arguments.length == 1) {
|
24374 | var options = initialStateOrOptions;
|
24375 | initialState = options.initialState;
|
24376 | condition = options.condition;
|
24377 | iterate = options.iterate;
|
24378 | resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
|
24379 | scheduler = options.scheduler;
|
24380 | }
|
24381 | else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) {
|
24382 | initialState = initialStateOrOptions;
|
24383 | resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
|
24384 | scheduler = resultSelectorOrObservable;
|
24385 | }
|
24386 | else {
|
24387 | initialState = initialStateOrOptions;
|
24388 | resultSelector = resultSelectorOrObservable;
|
24389 | }
|
24390 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24391 | var state = initialState;
|
24392 | if (scheduler) {
|
24393 | return scheduler.schedule(dispatch, 0, {
|
24394 | subscriber: subscriber,
|
24395 | iterate: iterate,
|
24396 | condition: condition,
|
24397 | resultSelector: resultSelector,
|
24398 | state: state
|
24399 | });
|
24400 | }
|
24401 | do {
|
24402 | if (condition) {
|
24403 | var conditionResult = void 0;
|
24404 | try {
|
24405 | conditionResult = condition(state);
|
24406 | }
|
24407 | catch (err) {
|
24408 | subscriber.error(err);
|
24409 | return undefined;
|
24410 | }
|
24411 | if (!conditionResult) {
|
24412 | subscriber.complete();
|
24413 | break;
|
24414 | }
|
24415 | }
|
24416 | var value = void 0;
|
24417 | try {
|
24418 | value = resultSelector(state);
|
24419 | }
|
24420 | catch (err) {
|
24421 | subscriber.error(err);
|
24422 | return undefined;
|
24423 | }
|
24424 | subscriber.next(value);
|
24425 | if (subscriber.closed) {
|
24426 | break;
|
24427 | }
|
24428 | try {
|
24429 | state = iterate(state);
|
24430 | }
|
24431 | catch (err) {
|
24432 | subscriber.error(err);
|
24433 | return undefined;
|
24434 | }
|
24435 | } while (true);
|
24436 | return undefined;
|
24437 | });
|
24438 | }
|
24439 | function dispatch(state) {
|
24440 | var subscriber = state.subscriber, condition = state.condition;
|
24441 | if (subscriber.closed) {
|
24442 | return undefined;
|
24443 | }
|
24444 | if (state.needIterate) {
|
24445 | try {
|
24446 | state.state = state.iterate(state.state);
|
24447 | }
|
24448 | catch (err) {
|
24449 | subscriber.error(err);
|
24450 | return undefined;
|
24451 | }
|
24452 | }
|
24453 | else {
|
24454 | state.needIterate = true;
|
24455 | }
|
24456 | if (condition) {
|
24457 | var conditionResult = void 0;
|
24458 | try {
|
24459 | conditionResult = condition(state.state);
|
24460 | }
|
24461 | catch (err) {
|
24462 | subscriber.error(err);
|
24463 | return undefined;
|
24464 | }
|
24465 | if (!conditionResult) {
|
24466 | subscriber.complete();
|
24467 | return undefined;
|
24468 | }
|
24469 | if (subscriber.closed) {
|
24470 | return undefined;
|
24471 | }
|
24472 | }
|
24473 | var value;
|
24474 | try {
|
24475 | value = state.resultSelector(state.state);
|
24476 | }
|
24477 | catch (err) {
|
24478 | subscriber.error(err);
|
24479 | return undefined;
|
24480 | }
|
24481 | if (subscriber.closed) {
|
24482 | return undefined;
|
24483 | }
|
24484 | subscriber.next(value);
|
24485 | if (subscriber.closed) {
|
24486 | return undefined;
|
24487 | }
|
24488 | return this.schedule(state);
|
24489 | }
|
24490 |
|
24491 |
|
24492 |
|
24493 | }),
|
24494 |
|
24495 | (function(module, __webpack_exports__, __webpack_require__) {
|
24496 |
|
24497 | "use strict";
|
24498 | __webpack_require__.r(__webpack_exports__);
|
24499 | __webpack_require__.d(__webpack_exports__, "iif", function() { return iif; });
|
24500 | var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(229);
|
24501 | var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182);
|
24502 |
|
24503 |
|
24504 |
|
24505 | function iif(condition, trueResult, falseResult) {
|
24506 | if (trueResult === void 0) {
|
24507 | trueResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"];
|
24508 | }
|
24509 | if (falseResult === void 0) {
|
24510 | falseResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"];
|
24511 | }
|
24512 | return Object(_defer__WEBPACK_IMPORTED_MODULE_0__["defer"])(function () { return condition() ? trueResult : falseResult; });
|
24513 | }
|
24514 |
|
24515 |
|
24516 |
|
24517 | }),
|
24518 |
|
24519 | (function(module, __webpack_exports__, __webpack_require__) {
|
24520 |
|
24521 | "use strict";
|
24522 | __webpack_require__.r(__webpack_exports__);
|
24523 | __webpack_require__.d(__webpack_exports__, "interval", function() { return interval; });
|
24524 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24525 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
24526 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(236);
|
24527 |
|
24528 |
|
24529 |
|
24530 |
|
24531 | function interval(period, scheduler) {
|
24532 | if (period === void 0) {
|
24533 | period = 0;
|
24534 | }
|
24535 | if (scheduler === void 0) {
|
24536 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
24537 | }
|
24538 | if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(period) || period < 0) {
|
24539 | period = 0;
|
24540 | }
|
24541 | if (!scheduler || typeof scheduler.schedule !== 'function') {
|
24542 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
24543 | }
|
24544 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24545 | subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
|
24546 | return subscriber;
|
24547 | });
|
24548 | }
|
24549 | function dispatch(state) {
|
24550 | var subscriber = state.subscriber, counter = state.counter, period = state.period;
|
24551 | subscriber.next(counter);
|
24552 | this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
|
24553 | }
|
24554 |
|
24555 |
|
24556 |
|
24557 | }),
|
24558 |
|
24559 | (function(module, __webpack_exports__, __webpack_require__) {
|
24560 |
|
24561 | "use strict";
|
24562 | __webpack_require__.r(__webpack_exports__);
|
24563 | __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; });
|
24564 | var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(157);
|
24565 |
|
24566 |
|
24567 | function isNumeric(val) {
|
24568 | return !Object(_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(val) && (val - parseFloat(val) + 1) >= 0;
|
24569 | }
|
24570 |
|
24571 |
|
24572 |
|
24573 | }),
|
24574 |
|
24575 | (function(module, __webpack_exports__, __webpack_require__) {
|
24576 |
|
24577 | "use strict";
|
24578 | __webpack_require__.r(__webpack_exports__);
|
24579 | __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
|
24580 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24581 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(184);
|
24582 | var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(220);
|
24583 | var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(185);
|
24584 |
|
24585 |
|
24586 |
|
24587 |
|
24588 |
|
24589 | function merge() {
|
24590 | var observables = [];
|
24591 | for (var _i = 0; _i < arguments.length; _i++) {
|
24592 | observables[_i] = arguments[_i];
|
24593 | }
|
24594 | var concurrent = Number.POSITIVE_INFINITY;
|
24595 | var scheduler = null;
|
24596 | var last = observables[observables.length - 1];
|
24597 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(last)) {
|
24598 | scheduler = observables.pop();
|
24599 | if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
|
24600 | concurrent = observables.pop();
|
24601 | }
|
24602 | }
|
24603 | else if (typeof last === 'number') {
|
24604 | concurrent = observables.pop();
|
24605 | }
|
24606 | if (scheduler === null && observables.length === 1 && observables[0] instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
|
24607 | return observables[0];
|
24608 | }
|
24609 | return Object(_operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__["mergeAll"])(concurrent)(Object(_fromArray__WEBPACK_IMPORTED_MODULE_3__["fromArray"])(observables, scheduler));
|
24610 | }
|
24611 |
|
24612 |
|
24613 |
|
24614 | }),
|
24615 |
|
24616 | (function(module, __webpack_exports__, __webpack_require__) {
|
24617 |
|
24618 | "use strict";
|
24619 | __webpack_require__.r(__webpack_exports__);
|
24620 | __webpack_require__.d(__webpack_exports__, "NEVER", function() { return NEVER; });
|
24621 | __webpack_require__.d(__webpack_exports__, "never", function() { return never; });
|
24622 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24623 | var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(164);
|
24624 |
|
24625 |
|
24626 |
|
24627 | var NEVER = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](_util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]);
|
24628 | function never() {
|
24629 | return NEVER;
|
24630 | }
|
24631 |
|
24632 |
|
24633 |
|
24634 | }),
|
24635 |
|
24636 | (function(module, __webpack_exports__, __webpack_require__) {
|
24637 |
|
24638 | "use strict";
|
24639 | __webpack_require__.r(__webpack_exports__);
|
24640 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
|
24641 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24642 | var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(222);
|
24643 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(157);
|
24644 | var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(182);
|
24645 |
|
24646 |
|
24647 |
|
24648 |
|
24649 |
|
24650 | function onErrorResumeNext() {
|
24651 | var sources = [];
|
24652 | for (var _i = 0; _i < arguments.length; _i++) {
|
24653 | sources[_i] = arguments[_i];
|
24654 | }
|
24655 | if (sources.length === 0) {
|
24656 | return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"];
|
24657 | }
|
24658 | var first = sources[0], remainder = sources.slice(1);
|
24659 | if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(first)) {
|
24660 | return onErrorResumeNext.apply(void 0, first);
|
24661 | }
|
24662 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24663 | var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); };
|
24664 | return Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(first).subscribe({
|
24665 | next: function (value) { subscriber.next(value); },
|
24666 | error: subNext,
|
24667 | complete: subNext,
|
24668 | });
|
24669 | });
|
24670 | }
|
24671 |
|
24672 |
|
24673 |
|
24674 | }),
|
24675 |
|
24676 | (function(module, __webpack_exports__, __webpack_require__) {
|
24677 |
|
24678 | "use strict";
|
24679 | __webpack_require__.r(__webpack_exports__);
|
24680 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return pairs; });
|
24681 | __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
|
24682 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24683 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
24684 |
|
24685 |
|
24686 |
|
24687 | function pairs(obj, scheduler) {
|
24688 | if (!scheduler) {
|
24689 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24690 | var keys = Object.keys(obj);
|
24691 | for (var i = 0; i < keys.length && !subscriber.closed; i++) {
|
24692 | var key = keys[i];
|
24693 | if (obj.hasOwnProperty(key)) {
|
24694 | subscriber.next([key, obj[key]]);
|
24695 | }
|
24696 | }
|
24697 | subscriber.complete();
|
24698 | });
|
24699 | }
|
24700 | else {
|
24701 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24702 | var keys = Object.keys(obj);
|
24703 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
24704 | subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
|
24705 | return subscription;
|
24706 | });
|
24707 | }
|
24708 | }
|
24709 | function dispatch(state) {
|
24710 | var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
|
24711 | if (!subscriber.closed) {
|
24712 | if (index < keys.length) {
|
24713 | var key = keys[index];
|
24714 | subscriber.next([key, obj[key]]);
|
24715 | subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
|
24716 | }
|
24717 | else {
|
24718 | subscriber.complete();
|
24719 | }
|
24720 | }
|
24721 | }
|
24722 |
|
24723 |
|
24724 |
|
24725 | }),
|
24726 |
|
24727 | (function(module, __webpack_exports__, __webpack_require__) {
|
24728 |
|
24729 | "use strict";
|
24730 | __webpack_require__.r(__webpack_exports__);
|
24731 | __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; });
|
24732 | var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(242);
|
24733 | var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(211);
|
24734 | var _operators_filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(243);
|
24735 | var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(148);
|
24736 |
|
24737 |
|
24738 |
|
24739 |
|
24740 |
|
24741 | function partition(source, predicate, thisArg) {
|
24742 | return [
|
24743 | Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(predicate, thisArg)(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source))),
|
24744 | Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source)))
|
24745 | ];
|
24746 | }
|
24747 |
|
24748 |
|
24749 |
|
24750 | }),
|
24751 |
|
24752 | (function(module, __webpack_exports__, __webpack_require__) {
|
24753 |
|
24754 | "use strict";
|
24755 | __webpack_require__.r(__webpack_exports__);
|
24756 | __webpack_require__.d(__webpack_exports__, "not", function() { return not; });
|
24757 |
|
24758 | function not(pred, thisArg) {
|
24759 | function notPred() {
|
24760 | return !(notPred.pred.apply(notPred.thisArg, arguments));
|
24761 | }
|
24762 | notPred.pred = pred;
|
24763 | notPred.thisArg = thisArg;
|
24764 | return notPred;
|
24765 | }
|
24766 |
|
24767 |
|
24768 |
|
24769 | }),
|
24770 |
|
24771 | (function(module, __webpack_exports__, __webpack_require__) {
|
24772 |
|
24773 | "use strict";
|
24774 | __webpack_require__.r(__webpack_exports__);
|
24775 | __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; });
|
24776 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
24777 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
24778 |
|
24779 |
|
24780 |
|
24781 | function filter(predicate, thisArg) {
|
24782 | return function filterOperatorFunction(source) {
|
24783 | return source.lift(new FilterOperator(predicate, thisArg));
|
24784 | };
|
24785 | }
|
24786 | var FilterOperator = (function () {
|
24787 | function FilterOperator(predicate, thisArg) {
|
24788 | this.predicate = predicate;
|
24789 | this.thisArg = thisArg;
|
24790 | }
|
24791 | FilterOperator.prototype.call = function (subscriber, source) {
|
24792 | return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
|
24793 | };
|
24794 | return FilterOperator;
|
24795 | }());
|
24796 | var FilterSubscriber = (function (_super) {
|
24797 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FilterSubscriber, _super);
|
24798 | function FilterSubscriber(destination, predicate, thisArg) {
|
24799 | var _this = _super.call(this, destination) || this;
|
24800 | _this.predicate = predicate;
|
24801 | _this.thisArg = thisArg;
|
24802 | _this.count = 0;
|
24803 | return _this;
|
24804 | }
|
24805 | FilterSubscriber.prototype._next = function (value) {
|
24806 | var result;
|
24807 | try {
|
24808 | result = this.predicate.call(this.thisArg, value, this.count++);
|
24809 | }
|
24810 | catch (err) {
|
24811 | this.destination.error(err);
|
24812 | return;
|
24813 | }
|
24814 | if (result) {
|
24815 | this.destination.next(value);
|
24816 | }
|
24817 | };
|
24818 | return FilterSubscriber;
|
24819 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
24820 |
|
24821 |
|
24822 |
|
24823 | }),
|
24824 |
|
24825 | (function(module, __webpack_exports__, __webpack_require__) {
|
24826 |
|
24827 | "use strict";
|
24828 | __webpack_require__.r(__webpack_exports__);
|
24829 | __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
|
24830 | __webpack_require__.d(__webpack_exports__, "RaceOperator", function() { return RaceOperator; });
|
24831 | __webpack_require__.d(__webpack_exports__, "RaceSubscriber", function() { return RaceSubscriber; });
|
24832 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
24833 | var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(157);
|
24834 | var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(185);
|
24835 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208);
|
24836 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(209);
|
24837 |
|
24838 |
|
24839 |
|
24840 |
|
24841 |
|
24842 |
|
24843 | function race() {
|
24844 | var observables = [];
|
24845 | for (var _i = 0; _i < arguments.length; _i++) {
|
24846 | observables[_i] = arguments[_i];
|
24847 | }
|
24848 | if (observables.length === 1) {
|
24849 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(observables[0])) {
|
24850 | observables = observables[0];
|
24851 | }
|
24852 | else {
|
24853 | return observables[0];
|
24854 | }
|
24855 | }
|
24856 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_2__["fromArray"])(observables, undefined).lift(new RaceOperator());
|
24857 | }
|
24858 | var RaceOperator = (function () {
|
24859 | function RaceOperator() {
|
24860 | }
|
24861 | RaceOperator.prototype.call = function (subscriber, source) {
|
24862 | return source.subscribe(new RaceSubscriber(subscriber));
|
24863 | };
|
24864 | return RaceOperator;
|
24865 | }());
|
24866 |
|
24867 | var RaceSubscriber = (function (_super) {
|
24868 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RaceSubscriber, _super);
|
24869 | function RaceSubscriber(destination) {
|
24870 | var _this = _super.call(this, destination) || this;
|
24871 | _this.hasFirst = false;
|
24872 | _this.observables = [];
|
24873 | _this.subscriptions = [];
|
24874 | return _this;
|
24875 | }
|
24876 | RaceSubscriber.prototype._next = function (observable) {
|
24877 | this.observables.push(observable);
|
24878 | };
|
24879 | RaceSubscriber.prototype._complete = function () {
|
24880 | var observables = this.observables;
|
24881 | var len = observables.length;
|
24882 | if (len === 0) {
|
24883 | this.destination.complete();
|
24884 | }
|
24885 | else {
|
24886 | for (var i = 0; i < len && !this.hasFirst; i++) {
|
24887 | var observable = observables[i];
|
24888 | var subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i);
|
24889 | if (this.subscriptions) {
|
24890 | this.subscriptions.push(subscription);
|
24891 | }
|
24892 | this.add(subscription);
|
24893 | }
|
24894 | this.observables = null;
|
24895 | }
|
24896 | };
|
24897 | RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
24898 | if (!this.hasFirst) {
|
24899 | this.hasFirst = true;
|
24900 | for (var i = 0; i < this.subscriptions.length; i++) {
|
24901 | if (i !== outerIndex) {
|
24902 | var subscription = this.subscriptions[i];
|
24903 | subscription.unsubscribe();
|
24904 | this.remove(subscription);
|
24905 | }
|
24906 | }
|
24907 | this.subscriptions = null;
|
24908 | }
|
24909 | this.destination.next(innerValue);
|
24910 | };
|
24911 | return RaceSubscriber;
|
24912 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
24913 |
|
24914 |
|
24915 |
|
24916 |
|
24917 | }),
|
24918 |
|
24919 | (function(module, __webpack_exports__, __webpack_require__) {
|
24920 |
|
24921 | "use strict";
|
24922 | __webpack_require__.r(__webpack_exports__);
|
24923 | __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
|
24924 | __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
|
24925 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24926 |
|
24927 |
|
24928 | function range(start, count, scheduler) {
|
24929 | if (start === void 0) {
|
24930 | start = 0;
|
24931 | }
|
24932 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
24933 | if (count === undefined) {
|
24934 | count = start;
|
24935 | start = 0;
|
24936 | }
|
24937 | var index = 0;
|
24938 | var current = start;
|
24939 | if (scheduler) {
|
24940 | return scheduler.schedule(dispatch, 0, {
|
24941 | index: index, count: count, start: start, subscriber: subscriber
|
24942 | });
|
24943 | }
|
24944 | else {
|
24945 | do {
|
24946 | if (index++ >= count) {
|
24947 | subscriber.complete();
|
24948 | break;
|
24949 | }
|
24950 | subscriber.next(current++);
|
24951 | if (subscriber.closed) {
|
24952 | break;
|
24953 | }
|
24954 | } while (true);
|
24955 | }
|
24956 | return undefined;
|
24957 | });
|
24958 | }
|
24959 | function dispatch(state) {
|
24960 | var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
|
24961 | if (index >= count) {
|
24962 | subscriber.complete();
|
24963 | return;
|
24964 | }
|
24965 | subscriber.next(start);
|
24966 | if (subscriber.closed) {
|
24967 | return;
|
24968 | }
|
24969 | state.index = index + 1;
|
24970 | state.start = start + 1;
|
24971 | this.schedule(state);
|
24972 | }
|
24973 |
|
24974 |
|
24975 |
|
24976 | }),
|
24977 |
|
24978 | (function(module, __webpack_exports__, __webpack_require__) {
|
24979 |
|
24980 | "use strict";
|
24981 | __webpack_require__.r(__webpack_exports__);
|
24982 | __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; });
|
24983 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
24984 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
24985 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(236);
|
24986 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(184);
|
24987 |
|
24988 |
|
24989 |
|
24990 |
|
24991 |
|
24992 | function timer(dueTime, periodOrScheduler, scheduler) {
|
24993 | if (dueTime === void 0) {
|
24994 | dueTime = 0;
|
24995 | }
|
24996 | var period = -1;
|
24997 | if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(periodOrScheduler)) {
|
24998 | period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
|
24999 | }
|
25000 | else if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(periodOrScheduler)) {
|
25001 | scheduler = periodOrScheduler;
|
25002 | }
|
25003 | if (!Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(scheduler)) {
|
25004 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
25005 | }
|
25006 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
25007 | var due = Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(dueTime)
|
25008 | ? dueTime
|
25009 | : (+dueTime - scheduler.now());
|
25010 | return scheduler.schedule(dispatch, due, {
|
25011 | index: 0, period: period, subscriber: subscriber
|
25012 | });
|
25013 | });
|
25014 | }
|
25015 | function dispatch(state) {
|
25016 | var index = state.index, period = state.period, subscriber = state.subscriber;
|
25017 | subscriber.next(index);
|
25018 | if (subscriber.closed) {
|
25019 | return;
|
25020 | }
|
25021 | else if (period === -1) {
|
25022 | return subscriber.complete();
|
25023 | }
|
25024 | state.index = index + 1;
|
25025 | this.schedule(state, period);
|
25026 | }
|
25027 |
|
25028 |
|
25029 |
|
25030 | }),
|
25031 |
|
25032 | (function(module, __webpack_exports__, __webpack_require__) {
|
25033 |
|
25034 | "use strict";
|
25035 | __webpack_require__.r(__webpack_exports__);
|
25036 | __webpack_require__.d(__webpack_exports__, "using", function() { return using; });
|
25037 | var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(148);
|
25038 | var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(222);
|
25039 | var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(182);
|
25040 |
|
25041 |
|
25042 |
|
25043 |
|
25044 | function using(resourceFactory, observableFactory) {
|
25045 | return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
|
25046 | var resource;
|
25047 | try {
|
25048 | resource = resourceFactory();
|
25049 | }
|
25050 | catch (err) {
|
25051 | subscriber.error(err);
|
25052 | return undefined;
|
25053 | }
|
25054 | var result;
|
25055 | try {
|
25056 | result = observableFactory(resource);
|
25057 | }
|
25058 | catch (err) {
|
25059 | subscriber.error(err);
|
25060 | return undefined;
|
25061 | }
|
25062 | var source = result ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(result) : _empty__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
|
25063 | var subscription = source.subscribe(subscriber);
|
25064 | return function () {
|
25065 | subscription.unsubscribe();
|
25066 | if (resource) {
|
25067 | resource.unsubscribe();
|
25068 | }
|
25069 | };
|
25070 | });
|
25071 | }
|
25072 |
|
25073 |
|
25074 |
|
25075 | }),
|
25076 |
|
25077 | (function(module, __webpack_exports__, __webpack_require__) {
|
25078 |
|
25079 | "use strict";
|
25080 | __webpack_require__.r(__webpack_exports__);
|
25081 | __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
|
25082 | __webpack_require__.d(__webpack_exports__, "ZipOperator", function() { return ZipOperator; });
|
25083 | __webpack_require__.d(__webpack_exports__, "ZipSubscriber", function() { return ZipSubscriber; });
|
25084 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
25085 | var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185);
|
25086 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(157);
|
25087 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(150);
|
25088 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(208);
|
25089 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(209);
|
25090 | var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(214);
|
25091 |
|
25092 |
|
25093 |
|
25094 |
|
25095 |
|
25096 |
|
25097 |
|
25098 |
|
25099 | function zip() {
|
25100 | var observables = [];
|
25101 | for (var _i = 0; _i < arguments.length; _i++) {
|
25102 | observables[_i] = arguments[_i];
|
25103 | }
|
25104 | var resultSelector = observables[observables.length - 1];
|
25105 | if (typeof resultSelector === 'function') {
|
25106 | observables.pop();
|
25107 | }
|
25108 | return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(observables, undefined).lift(new ZipOperator(resultSelector));
|
25109 | }
|
25110 | var ZipOperator = (function () {
|
25111 | function ZipOperator(resultSelector) {
|
25112 | this.resultSelector = resultSelector;
|
25113 | }
|
25114 | ZipOperator.prototype.call = function (subscriber, source) {
|
25115 | return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));
|
25116 | };
|
25117 | return ZipOperator;
|
25118 | }());
|
25119 |
|
25120 | var ZipSubscriber = (function (_super) {
|
25121 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipSubscriber, _super);
|
25122 | function ZipSubscriber(destination, resultSelector, values) {
|
25123 | if (values === void 0) {
|
25124 | values = Object.create(null);
|
25125 | }
|
25126 | var _this = _super.call(this, destination) || this;
|
25127 | _this.iterators = [];
|
25128 | _this.active = 0;
|
25129 | _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null;
|
25130 | _this.values = values;
|
25131 | return _this;
|
25132 | }
|
25133 | ZipSubscriber.prototype._next = function (value) {
|
25134 | var iterators = this.iterators;
|
25135 | if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(value)) {
|
25136 | iterators.push(new StaticArrayIterator(value));
|
25137 | }
|
25138 | else if (typeof value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] === 'function') {
|
25139 | iterators.push(new StaticIterator(value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]]()));
|
25140 | }
|
25141 | else {
|
25142 | iterators.push(new ZipBufferIterator(this.destination, this, value));
|
25143 | }
|
25144 | };
|
25145 | ZipSubscriber.prototype._complete = function () {
|
25146 | var iterators = this.iterators;
|
25147 | var len = iterators.length;
|
25148 | this.unsubscribe();
|
25149 | if (len === 0) {
|
25150 | this.destination.complete();
|
25151 | return;
|
25152 | }
|
25153 | this.active = len;
|
25154 | for (var i = 0; i < len; i++) {
|
25155 | var iterator = iterators[i];
|
25156 | if (iterator.stillUnsubscribed) {
|
25157 | var destination = this.destination;
|
25158 | destination.add(iterator.subscribe(iterator, i));
|
25159 | }
|
25160 | else {
|
25161 | this.active--;
|
25162 | }
|
25163 | }
|
25164 | };
|
25165 | ZipSubscriber.prototype.notifyInactive = function () {
|
25166 | this.active--;
|
25167 | if (this.active === 0) {
|
25168 | this.destination.complete();
|
25169 | }
|
25170 | };
|
25171 | ZipSubscriber.prototype.checkIterators = function () {
|
25172 | var iterators = this.iterators;
|
25173 | var len = iterators.length;
|
25174 | var destination = this.destination;
|
25175 | for (var i = 0; i < len; i++) {
|
25176 | var iterator = iterators[i];
|
25177 | if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {
|
25178 | return;
|
25179 | }
|
25180 | }
|
25181 | var shouldComplete = false;
|
25182 | var args = [];
|
25183 | for (var i = 0; i < len; i++) {
|
25184 | var iterator = iterators[i];
|
25185 | var result = iterator.next();
|
25186 | if (iterator.hasCompleted()) {
|
25187 | shouldComplete = true;
|
25188 | }
|
25189 | if (result.done) {
|
25190 | destination.complete();
|
25191 | return;
|
25192 | }
|
25193 | args.push(result.value);
|
25194 | }
|
25195 | if (this.resultSelector) {
|
25196 | this._tryresultSelector(args);
|
25197 | }
|
25198 | else {
|
25199 | destination.next(args);
|
25200 | }
|
25201 | if (shouldComplete) {
|
25202 | destination.complete();
|
25203 | }
|
25204 | };
|
25205 | ZipSubscriber.prototype._tryresultSelector = function (args) {
|
25206 | var result;
|
25207 | try {
|
25208 | result = this.resultSelector.apply(this, args);
|
25209 | }
|
25210 | catch (err) {
|
25211 | this.destination.error(err);
|
25212 | return;
|
25213 | }
|
25214 | this.destination.next(result);
|
25215 | };
|
25216 | return ZipSubscriber;
|
25217 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
25218 |
|
25219 | var StaticIterator = (function () {
|
25220 | function StaticIterator(iterator) {
|
25221 | this.iterator = iterator;
|
25222 | this.nextResult = iterator.next();
|
25223 | }
|
25224 | StaticIterator.prototype.hasValue = function () {
|
25225 | return true;
|
25226 | };
|
25227 | StaticIterator.prototype.next = function () {
|
25228 | var result = this.nextResult;
|
25229 | this.nextResult = this.iterator.next();
|
25230 | return result;
|
25231 | };
|
25232 | StaticIterator.prototype.hasCompleted = function () {
|
25233 | var nextResult = this.nextResult;
|
25234 | return nextResult && nextResult.done;
|
25235 | };
|
25236 | return StaticIterator;
|
25237 | }());
|
25238 | var StaticArrayIterator = (function () {
|
25239 | function StaticArrayIterator(array) {
|
25240 | this.array = array;
|
25241 | this.index = 0;
|
25242 | this.length = 0;
|
25243 | this.length = array.length;
|
25244 | }
|
25245 | StaticArrayIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () {
|
25246 | return this;
|
25247 | };
|
25248 | StaticArrayIterator.prototype.next = function (value) {
|
25249 | var i = this.index++;
|
25250 | var array = this.array;
|
25251 | return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
|
25252 | };
|
25253 | StaticArrayIterator.prototype.hasValue = function () {
|
25254 | return this.array.length > this.index;
|
25255 | };
|
25256 | StaticArrayIterator.prototype.hasCompleted = function () {
|
25257 | return this.array.length === this.index;
|
25258 | };
|
25259 | return StaticArrayIterator;
|
25260 | }());
|
25261 | var ZipBufferIterator = (function (_super) {
|
25262 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipBufferIterator, _super);
|
25263 | function ZipBufferIterator(destination, parent, observable) {
|
25264 | var _this = _super.call(this, destination) || this;
|
25265 | _this.parent = parent;
|
25266 | _this.observable = observable;
|
25267 | _this.stillUnsubscribed = true;
|
25268 | _this.buffer = [];
|
25269 | _this.isComplete = false;
|
25270 | return _this;
|
25271 | }
|
25272 | ZipBufferIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () {
|
25273 | return this;
|
25274 | };
|
25275 | ZipBufferIterator.prototype.next = function () {
|
25276 | var buffer = this.buffer;
|
25277 | if (buffer.length === 0 && this.isComplete) {
|
25278 | return { value: null, done: true };
|
25279 | }
|
25280 | else {
|
25281 | return { value: buffer.shift(), done: false };
|
25282 | }
|
25283 | };
|
25284 | ZipBufferIterator.prototype.hasValue = function () {
|
25285 | return this.buffer.length > 0;
|
25286 | };
|
25287 | ZipBufferIterator.prototype.hasCompleted = function () {
|
25288 | return this.buffer.length === 0 && this.isComplete;
|
25289 | };
|
25290 | ZipBufferIterator.prototype.notifyComplete = function () {
|
25291 | if (this.buffer.length > 0) {
|
25292 | this.isComplete = true;
|
25293 | this.parent.notifyInactive();
|
25294 | }
|
25295 | else {
|
25296 | this.destination.complete();
|
25297 | }
|
25298 | };
|
25299 | ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
25300 | this.buffer.push(innerValue);
|
25301 | this.parent.checkIterators();
|
25302 | };
|
25303 | ZipBufferIterator.prototype.subscribe = function (value, index) {
|
25304 | return Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, this.observable, this, index);
|
25305 | };
|
25306 | return ZipBufferIterator;
|
25307 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"]));
|
25308 |
|
25309 |
|
25310 |
|
25311 | }),
|
25312 | ,
|
25313 |
|
25314 | (function(module, __webpack_exports__, __webpack_require__) {
|
25315 |
|
25316 | "use strict";
|
25317 | __webpack_require__.r(__webpack_exports__);
|
25318 | var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(251);
|
25319 | __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; });
|
25320 |
|
25321 | var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(252);
|
25322 | __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; });
|
25323 |
|
25324 | var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(253);
|
25325 | __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; });
|
25326 |
|
25327 | var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(254);
|
25328 | __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; });
|
25329 |
|
25330 | var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(255);
|
25331 | __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; });
|
25332 |
|
25333 | var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(256);
|
25334 | __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; });
|
25335 |
|
25336 | var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(257);
|
25337 | __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; });
|
25338 |
|
25339 | var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(258);
|
25340 | __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; });
|
25341 |
|
25342 | var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(259);
|
25343 | __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; });
|
25344 |
|
25345 | var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(260);
|
25346 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; });
|
25347 |
|
25348 | var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(261);
|
25349 | __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; });
|
25350 |
|
25351 | var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(219);
|
25352 | __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; });
|
25353 |
|
25354 | var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(262);
|
25355 | __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; });
|
25356 |
|
25357 | var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(263);
|
25358 | __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; });
|
25359 |
|
25360 | var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(264);
|
25361 | __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; });
|
25362 |
|
25363 | var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(265);
|
25364 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; });
|
25365 |
|
25366 | var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(266);
|
25367 | __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; });
|
25368 |
|
25369 | var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(267);
|
25370 | __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; });
|
25371 |
|
25372 | var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(268);
|
25373 | __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; });
|
25374 |
|
25375 | var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(270);
|
25376 | __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; });
|
25377 |
|
25378 | var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(271);
|
25379 | __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; });
|
25380 |
|
25381 | var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(272);
|
25382 | __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; });
|
25383 |
|
25384 | var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(273);
|
25385 | __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; });
|
25386 |
|
25387 | var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(274);
|
25388 | __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; });
|
25389 |
|
25390 | var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(275);
|
25391 | __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; });
|
25392 |
|
25393 | var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(278);
|
25394 | __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; });
|
25395 |
|
25396 | var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(279);
|
25397 | __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; });
|
25398 |
|
25399 | var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(280);
|
25400 | __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; });
|
25401 |
|
25402 | var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(281);
|
25403 | __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; });
|
25404 |
|
25405 | var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(282);
|
25406 | __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; });
|
25407 |
|
25408 | var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(243);
|
25409 | __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; });
|
25410 |
|
25411 | var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(283);
|
25412 | __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; });
|
25413 |
|
25414 | var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(284);
|
25415 | __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; });
|
25416 |
|
25417 | var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(285);
|
25418 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; });
|
25419 |
|
25420 | var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(286);
|
25421 | __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; });
|
25422 |
|
25423 | var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(170);
|
25424 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; });
|
25425 |
|
25426 | var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(287);
|
25427 | __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; });
|
25428 |
|
25429 | var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(288);
|
25430 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; });
|
25431 |
|
25432 | var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(289);
|
25433 | __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; });
|
25434 |
|
25435 | var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(205);
|
25436 | __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; });
|
25437 |
|
25438 | var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(291);
|
25439 | __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; });
|
25440 |
|
25441 | var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(292);
|
25442 | __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; });
|
25443 |
|
25444 | var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(293);
|
25445 | __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; });
|
25446 |
|
25447 | var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(296);
|
25448 | __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; });
|
25449 |
|
25450 | var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(220);
|
25451 | __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__["mergeAll"]; });
|
25452 |
|
25453 | var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(221);
|
25454 | __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; });
|
25455 |
|
25456 | __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; });
|
25457 |
|
25458 | var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(297);
|
25459 | __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; });
|
25460 |
|
25461 | var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(298);
|
25462 | __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; });
|
25463 |
|
25464 | var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(299);
|
25465 | __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; });
|
25466 |
|
25467 | var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(300);
|
25468 | __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; });
|
25469 |
|
25470 | var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(180);
|
25471 | __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; });
|
25472 |
|
25473 | var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(301);
|
25474 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; });
|
25475 |
|
25476 | var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(302);
|
25477 | __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; });
|
25478 |
|
25479 | var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(303);
|
25480 | __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; });
|
25481 |
|
25482 | var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(304);
|
25483 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; });
|
25484 |
|
25485 | var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(305);
|
25486 | __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publish"]; });
|
25487 |
|
25488 | var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(306);
|
25489 | __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; });
|
25490 |
|
25491 | var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(307);
|
25492 | __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; });
|
25493 |
|
25494 | var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(308);
|
25495 | __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; });
|
25496 |
|
25497 | var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(309);
|
25498 | __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; });
|
25499 |
|
25500 | var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(294);
|
25501 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; });
|
25502 |
|
25503 | var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(310);
|
25504 | __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; });
|
25505 |
|
25506 | var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(311);
|
25507 | __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; });
|
25508 |
|
25509 | var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(312);
|
25510 | __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; });
|
25511 |
|
25512 | var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(313);
|
25513 | __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; });
|
25514 |
|
25515 | var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(169);
|
25516 | __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; });
|
25517 |
|
25518 | var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(314);
|
25519 | __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; });
|
25520 |
|
25521 | var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(315);
|
25522 | __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; });
|
25523 |
|
25524 | var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(295);
|
25525 | __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; });
|
25526 |
|
25527 | var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(316);
|
25528 | __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; });
|
25529 |
|
25530 | var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(317);
|
25531 | __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; });
|
25532 |
|
25533 | var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(318);
|
25534 | __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; });
|
25535 |
|
25536 | var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(319);
|
25537 | __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; });
|
25538 |
|
25539 | var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(320);
|
25540 | __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; });
|
25541 |
|
25542 | var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(321);
|
25543 | __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; });
|
25544 |
|
25545 | var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(322);
|
25546 | __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; });
|
25547 |
|
25548 | var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(323);
|
25549 | __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; });
|
25550 |
|
25551 | var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(324);
|
25552 | __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; });
|
25553 |
|
25554 | var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(325);
|
25555 | __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; });
|
25556 |
|
25557 | var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(327);
|
25558 | __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; });
|
25559 |
|
25560 | var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(328);
|
25561 | __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; });
|
25562 |
|
25563 | var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(329);
|
25564 | __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; });
|
25565 |
|
25566 | var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(277);
|
25567 | __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; });
|
25568 |
|
25569 | var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(290);
|
25570 | __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; });
|
25571 |
|
25572 | var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(330);
|
25573 | __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; });
|
25574 |
|
25575 | var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(331);
|
25576 | __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; });
|
25577 |
|
25578 | var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(332);
|
25579 | __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; });
|
25580 |
|
25581 | var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(333);
|
25582 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; });
|
25583 |
|
25584 | var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(334);
|
25585 | __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; });
|
25586 |
|
25587 | var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(276);
|
25588 | __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; });
|
25589 |
|
25590 | var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(335);
|
25591 | __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; });
|
25592 |
|
25593 | var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(336);
|
25594 | __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; });
|
25595 |
|
25596 | var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(337);
|
25597 | __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; });
|
25598 |
|
25599 | var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(338);
|
25600 | __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; });
|
25601 |
|
25602 | var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(339);
|
25603 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; });
|
25604 |
|
25605 | var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(340);
|
25606 | __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; });
|
25607 |
|
25608 | var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(341);
|
25609 | __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; });
|
25610 |
|
25611 | var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(342);
|
25612 | __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; });
|
25613 |
|
25614 | var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(343);
|
25615 | __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; });
|
25616 |
|
25617 | var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(344);
|
25618 | __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; });
|
25619 |
|
25620 | var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(345);
|
25621 | __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; });
|
25622 |
|
25623 | var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(346);
|
25624 | __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; });
|
25625 |
|
25626 | var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(347);
|
25627 | __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; });
|
25628 |
|
25629 |
|
25630 |
|
25631 |
|
25632 |
|
25633 |
|
25634 |
|
25635 |
|
25636 |
|
25637 |
|
25638 |
|
25639 |
|
25640 |
|
25641 |
|
25642 |
|
25643 |
|
25644 |
|
25645 |
|
25646 |
|
25647 |
|
25648 |
|
25649 |
|
25650 |
|
25651 |
|
25652 |
|
25653 |
|
25654 |
|
25655 |
|
25656 |
|
25657 |
|
25658 |
|
25659 |
|
25660 |
|
25661 |
|
25662 |
|
25663 |
|
25664 |
|
25665 |
|
25666 |
|
25667 |
|
25668 |
|
25669 |
|
25670 |
|
25671 |
|
25672 |
|
25673 |
|
25674 |
|
25675 |
|
25676 |
|
25677 |
|
25678 |
|
25679 |
|
25680 |
|
25681 |
|
25682 |
|
25683 |
|
25684 |
|
25685 |
|
25686 |
|
25687 |
|
25688 |
|
25689 |
|
25690 |
|
25691 |
|
25692 |
|
25693 |
|
25694 |
|
25695 |
|
25696 |
|
25697 |
|
25698 |
|
25699 |
|
25700 |
|
25701 |
|
25702 |
|
25703 |
|
25704 |
|
25705 |
|
25706 |
|
25707 |
|
25708 |
|
25709 |
|
25710 |
|
25711 |
|
25712 |
|
25713 |
|
25714 |
|
25715 |
|
25716 |
|
25717 |
|
25718 |
|
25719 |
|
25720 |
|
25721 |
|
25722 |
|
25723 |
|
25724 |
|
25725 |
|
25726 |
|
25727 |
|
25728 |
|
25729 |
|
25730 |
|
25731 |
|
25732 |
|
25733 |
|
25734 |
|
25735 |
|
25736 |
|
25737 | }),
|
25738 |
|
25739 | (function(module, __webpack_exports__, __webpack_require__) {
|
25740 |
|
25741 | "use strict";
|
25742 | __webpack_require__.r(__webpack_exports__);
|
25743 | __webpack_require__.d(__webpack_exports__, "audit", function() { return audit; });
|
25744 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
25745 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
25746 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
25747 |
|
25748 |
|
25749 |
|
25750 |
|
25751 | function audit(durationSelector) {
|
25752 | return function auditOperatorFunction(source) {
|
25753 | return source.lift(new AuditOperator(durationSelector));
|
25754 | };
|
25755 | }
|
25756 | var AuditOperator = (function () {
|
25757 | function AuditOperator(durationSelector) {
|
25758 | this.durationSelector = durationSelector;
|
25759 | }
|
25760 | AuditOperator.prototype.call = function (subscriber, source) {
|
25761 | return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));
|
25762 | };
|
25763 | return AuditOperator;
|
25764 | }());
|
25765 | var AuditSubscriber = (function (_super) {
|
25766 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AuditSubscriber, _super);
|
25767 | function AuditSubscriber(destination, durationSelector) {
|
25768 | var _this = _super.call(this, destination) || this;
|
25769 | _this.durationSelector = durationSelector;
|
25770 | _this.hasValue = false;
|
25771 | return _this;
|
25772 | }
|
25773 | AuditSubscriber.prototype._next = function (value) {
|
25774 | this.value = value;
|
25775 | this.hasValue = true;
|
25776 | if (!this.throttled) {
|
25777 | var duration = void 0;
|
25778 | try {
|
25779 | var durationSelector = this.durationSelector;
|
25780 | duration = durationSelector(value);
|
25781 | }
|
25782 | catch (err) {
|
25783 | return this.destination.error(err);
|
25784 | }
|
25785 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration);
|
25786 | if (!innerSubscription || innerSubscription.closed) {
|
25787 | this.clearThrottle();
|
25788 | }
|
25789 | else {
|
25790 | this.add(this.throttled = innerSubscription);
|
25791 | }
|
25792 | }
|
25793 | };
|
25794 | AuditSubscriber.prototype.clearThrottle = function () {
|
25795 | var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;
|
25796 | if (throttled) {
|
25797 | this.remove(throttled);
|
25798 | this.throttled = null;
|
25799 | throttled.unsubscribe();
|
25800 | }
|
25801 | if (hasValue) {
|
25802 | this.value = null;
|
25803 | this.hasValue = false;
|
25804 | this.destination.next(value);
|
25805 | }
|
25806 | };
|
25807 | AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {
|
25808 | this.clearThrottle();
|
25809 | };
|
25810 | AuditSubscriber.prototype.notifyComplete = function () {
|
25811 | this.clearThrottle();
|
25812 | };
|
25813 | return AuditSubscriber;
|
25814 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
25815 |
|
25816 |
|
25817 |
|
25818 | }),
|
25819 |
|
25820 | (function(module, __webpack_exports__, __webpack_require__) {
|
25821 |
|
25822 | "use strict";
|
25823 | __webpack_require__.r(__webpack_exports__);
|
25824 | __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; });
|
25825 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194);
|
25826 | var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(251);
|
25827 | var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(246);
|
25828 |
|
25829 |
|
25830 |
|
25831 |
|
25832 | function auditTime(duration, scheduler) {
|
25833 | if (scheduler === void 0) {
|
25834 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
25835 | }
|
25836 | return Object(_audit__WEBPACK_IMPORTED_MODULE_1__["audit"])(function () { return Object(_observable_timer__WEBPACK_IMPORTED_MODULE_2__["timer"])(duration, scheduler); });
|
25837 | }
|
25838 |
|
25839 |
|
25840 |
|
25841 | }),
|
25842 |
|
25843 | (function(module, __webpack_exports__, __webpack_require__) {
|
25844 |
|
25845 | "use strict";
|
25846 | __webpack_require__.r(__webpack_exports__);
|
25847 | __webpack_require__.d(__webpack_exports__, "buffer", function() { return buffer; });
|
25848 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
25849 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
25850 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
25851 |
|
25852 |
|
25853 |
|
25854 |
|
25855 | function buffer(closingNotifier) {
|
25856 | return function bufferOperatorFunction(source) {
|
25857 | return source.lift(new BufferOperator(closingNotifier));
|
25858 | };
|
25859 | }
|
25860 | var BufferOperator = (function () {
|
25861 | function BufferOperator(closingNotifier) {
|
25862 | this.closingNotifier = closingNotifier;
|
25863 | }
|
25864 | BufferOperator.prototype.call = function (subscriber, source) {
|
25865 | return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
|
25866 | };
|
25867 | return BufferOperator;
|
25868 | }());
|
25869 | var BufferSubscriber = (function (_super) {
|
25870 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSubscriber, _super);
|
25871 | function BufferSubscriber(destination, closingNotifier) {
|
25872 | var _this = _super.call(this, destination) || this;
|
25873 | _this.buffer = [];
|
25874 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, closingNotifier));
|
25875 | return _this;
|
25876 | }
|
25877 | BufferSubscriber.prototype._next = function (value) {
|
25878 | this.buffer.push(value);
|
25879 | };
|
25880 | BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
25881 | var buffer = this.buffer;
|
25882 | this.buffer = [];
|
25883 | this.destination.next(buffer);
|
25884 | };
|
25885 | return BufferSubscriber;
|
25886 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
25887 |
|
25888 |
|
25889 |
|
25890 | }),
|
25891 |
|
25892 | (function(module, __webpack_exports__, __webpack_require__) {
|
25893 |
|
25894 | "use strict";
|
25895 | __webpack_require__.r(__webpack_exports__);
|
25896 | __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return bufferCount; });
|
25897 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
25898 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
25899 |
|
25900 |
|
25901 |
|
25902 | function bufferCount(bufferSize, startBufferEvery) {
|
25903 | if (startBufferEvery === void 0) {
|
25904 | startBufferEvery = null;
|
25905 | }
|
25906 | return function bufferCountOperatorFunction(source) {
|
25907 | return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
|
25908 | };
|
25909 | }
|
25910 | var BufferCountOperator = (function () {
|
25911 | function BufferCountOperator(bufferSize, startBufferEvery) {
|
25912 | this.bufferSize = bufferSize;
|
25913 | this.startBufferEvery = startBufferEvery;
|
25914 | if (!startBufferEvery || bufferSize === startBufferEvery) {
|
25915 | this.subscriberClass = BufferCountSubscriber;
|
25916 | }
|
25917 | else {
|
25918 | this.subscriberClass = BufferSkipCountSubscriber;
|
25919 | }
|
25920 | }
|
25921 | BufferCountOperator.prototype.call = function (subscriber, source) {
|
25922 | return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
|
25923 | };
|
25924 | return BufferCountOperator;
|
25925 | }());
|
25926 | var BufferCountSubscriber = (function (_super) {
|
25927 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferCountSubscriber, _super);
|
25928 | function BufferCountSubscriber(destination, bufferSize) {
|
25929 | var _this = _super.call(this, destination) || this;
|
25930 | _this.bufferSize = bufferSize;
|
25931 | _this.buffer = [];
|
25932 | return _this;
|
25933 | }
|
25934 | BufferCountSubscriber.prototype._next = function (value) {
|
25935 | var buffer = this.buffer;
|
25936 | buffer.push(value);
|
25937 | if (buffer.length == this.bufferSize) {
|
25938 | this.destination.next(buffer);
|
25939 | this.buffer = [];
|
25940 | }
|
25941 | };
|
25942 | BufferCountSubscriber.prototype._complete = function () {
|
25943 | var buffer = this.buffer;
|
25944 | if (buffer.length > 0) {
|
25945 | this.destination.next(buffer);
|
25946 | }
|
25947 | _super.prototype._complete.call(this);
|
25948 | };
|
25949 | return BufferCountSubscriber;
|
25950 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
25951 | var BufferSkipCountSubscriber = (function (_super) {
|
25952 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSkipCountSubscriber, _super);
|
25953 | function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {
|
25954 | var _this = _super.call(this, destination) || this;
|
25955 | _this.bufferSize = bufferSize;
|
25956 | _this.startBufferEvery = startBufferEvery;
|
25957 | _this.buffers = [];
|
25958 | _this.count = 0;
|
25959 | return _this;
|
25960 | }
|
25961 | BufferSkipCountSubscriber.prototype._next = function (value) {
|
25962 | var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;
|
25963 | this.count++;
|
25964 | if (count % startBufferEvery === 0) {
|
25965 | buffers.push([]);
|
25966 | }
|
25967 | for (var i = buffers.length; i--;) {
|
25968 | var buffer = buffers[i];
|
25969 | buffer.push(value);
|
25970 | if (buffer.length === bufferSize) {
|
25971 | buffers.splice(i, 1);
|
25972 | this.destination.next(buffer);
|
25973 | }
|
25974 | }
|
25975 | };
|
25976 | BufferSkipCountSubscriber.prototype._complete = function () {
|
25977 | var _a = this, buffers = _a.buffers, destination = _a.destination;
|
25978 | while (buffers.length > 0) {
|
25979 | var buffer = buffers.shift();
|
25980 | if (buffer.length > 0) {
|
25981 | destination.next(buffer);
|
25982 | }
|
25983 | }
|
25984 | _super.prototype._complete.call(this);
|
25985 | };
|
25986 | return BufferSkipCountSubscriber;
|
25987 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
25988 |
|
25989 |
|
25990 |
|
25991 | }),
|
25992 |
|
25993 | (function(module, __webpack_exports__, __webpack_require__) {
|
25994 |
|
25995 | "use strict";
|
25996 | __webpack_require__.r(__webpack_exports__);
|
25997 | __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return bufferTime; });
|
25998 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
25999 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
26000 | var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(150);
|
26001 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(184);
|
26002 |
|
26003 |
|
26004 |
|
26005 |
|
26006 |
|
26007 | function bufferTime(bufferTimeSpan) {
|
26008 | var length = arguments.length;
|
26009 | var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
26010 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(arguments[arguments.length - 1])) {
|
26011 | scheduler = arguments[arguments.length - 1];
|
26012 | length--;
|
26013 | }
|
26014 | var bufferCreationInterval = null;
|
26015 | if (length >= 2) {
|
26016 | bufferCreationInterval = arguments[1];
|
26017 | }
|
26018 | var maxBufferSize = Number.POSITIVE_INFINITY;
|
26019 | if (length >= 3) {
|
26020 | maxBufferSize = arguments[2];
|
26021 | }
|
26022 | return function bufferTimeOperatorFunction(source) {
|
26023 | return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));
|
26024 | };
|
26025 | }
|
26026 | var BufferTimeOperator = (function () {
|
26027 | function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
|
26028 | this.bufferTimeSpan = bufferTimeSpan;
|
26029 | this.bufferCreationInterval = bufferCreationInterval;
|
26030 | this.maxBufferSize = maxBufferSize;
|
26031 | this.scheduler = scheduler;
|
26032 | }
|
26033 | BufferTimeOperator.prototype.call = function (subscriber, source) {
|
26034 | return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));
|
26035 | };
|
26036 | return BufferTimeOperator;
|
26037 | }());
|
26038 | var Context = (function () {
|
26039 | function Context() {
|
26040 | this.buffer = [];
|
26041 | }
|
26042 | return Context;
|
26043 | }());
|
26044 | var BufferTimeSubscriber = (function (_super) {
|
26045 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferTimeSubscriber, _super);
|
26046 | function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
|
26047 | var _this = _super.call(this, destination) || this;
|
26048 | _this.bufferTimeSpan = bufferTimeSpan;
|
26049 | _this.bufferCreationInterval = bufferCreationInterval;
|
26050 | _this.maxBufferSize = maxBufferSize;
|
26051 | _this.scheduler = scheduler;
|
26052 | _this.contexts = [];
|
26053 | var context = _this.openContext();
|
26054 | _this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
|
26055 | if (_this.timespanOnly) {
|
26056 | var timeSpanOnlyState = { subscriber: _this, context: context, bufferTimeSpan: bufferTimeSpan };
|
26057 | _this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
|
26058 | }
|
26059 | else {
|
26060 | var closeState = { subscriber: _this, context: context };
|
26061 | var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: _this, scheduler: scheduler };
|
26062 | _this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));
|
26063 | _this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));
|
26064 | }
|
26065 | return _this;
|
26066 | }
|
26067 | BufferTimeSubscriber.prototype._next = function (value) {
|
26068 | var contexts = this.contexts;
|
26069 | var len = contexts.length;
|
26070 | var filledBufferContext;
|
26071 | for (var i = 0; i < len; i++) {
|
26072 | var context_1 = contexts[i];
|
26073 | var buffer = context_1.buffer;
|
26074 | buffer.push(value);
|
26075 | if (buffer.length == this.maxBufferSize) {
|
26076 | filledBufferContext = context_1;
|
26077 | }
|
26078 | }
|
26079 | if (filledBufferContext) {
|
26080 | this.onBufferFull(filledBufferContext);
|
26081 | }
|
26082 | };
|
26083 | BufferTimeSubscriber.prototype._error = function (err) {
|
26084 | this.contexts.length = 0;
|
26085 | _super.prototype._error.call(this, err);
|
26086 | };
|
26087 | BufferTimeSubscriber.prototype._complete = function () {
|
26088 | var _a = this, contexts = _a.contexts, destination = _a.destination;
|
26089 | while (contexts.length > 0) {
|
26090 | var context_2 = contexts.shift();
|
26091 | destination.next(context_2.buffer);
|
26092 | }
|
26093 | _super.prototype._complete.call(this);
|
26094 | };
|
26095 | BufferTimeSubscriber.prototype._unsubscribe = function () {
|
26096 | this.contexts = null;
|
26097 | };
|
26098 | BufferTimeSubscriber.prototype.onBufferFull = function (context) {
|
26099 | this.closeContext(context);
|
26100 | var closeAction = context.closeAction;
|
26101 | closeAction.unsubscribe();
|
26102 | this.remove(closeAction);
|
26103 | if (!this.closed && this.timespanOnly) {
|
26104 | context = this.openContext();
|
26105 | var bufferTimeSpan = this.bufferTimeSpan;
|
26106 | var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };
|
26107 | this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
|
26108 | }
|
26109 | };
|
26110 | BufferTimeSubscriber.prototype.openContext = function () {
|
26111 | var context = new Context();
|
26112 | this.contexts.push(context);
|
26113 | return context;
|
26114 | };
|
26115 | BufferTimeSubscriber.prototype.closeContext = function (context) {
|
26116 | this.destination.next(context.buffer);
|
26117 | var contexts = this.contexts;
|
26118 | var spliceIndex = contexts ? contexts.indexOf(context) : -1;
|
26119 | if (spliceIndex >= 0) {
|
26120 | contexts.splice(contexts.indexOf(context), 1);
|
26121 | }
|
26122 | };
|
26123 | return BufferTimeSubscriber;
|
26124 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
|
26125 | function dispatchBufferTimeSpanOnly(state) {
|
26126 | var subscriber = state.subscriber;
|
26127 | var prevContext = state.context;
|
26128 | if (prevContext) {
|
26129 | subscriber.closeContext(prevContext);
|
26130 | }
|
26131 | if (!subscriber.closed) {
|
26132 | state.context = subscriber.openContext();
|
26133 | state.context.closeAction = this.schedule(state, state.bufferTimeSpan);
|
26134 | }
|
26135 | }
|
26136 | function dispatchBufferCreation(state) {
|
26137 | var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler;
|
26138 | var context = subscriber.openContext();
|
26139 | var action = this;
|
26140 | if (!subscriber.closed) {
|
26141 | subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context }));
|
26142 | action.schedule(state, bufferCreationInterval);
|
26143 | }
|
26144 | }
|
26145 | function dispatchBufferClose(arg) {
|
26146 | var subscriber = arg.subscriber, context = arg.context;
|
26147 | subscriber.closeContext(context);
|
26148 | }
|
26149 |
|
26150 |
|
26151 |
|
26152 | }),
|
26153 |
|
26154 | (function(module, __webpack_exports__, __webpack_require__) {
|
26155 |
|
26156 | "use strict";
|
26157 | __webpack_require__.r(__webpack_exports__);
|
26158 | __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return bufferToggle; });
|
26159 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26160 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
26161 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
26162 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208);
|
26163 |
|
26164 |
|
26165 |
|
26166 |
|
26167 |
|
26168 | function bufferToggle(openings, closingSelector) {
|
26169 | return function bufferToggleOperatorFunction(source) {
|
26170 | return source.lift(new BufferToggleOperator(openings, closingSelector));
|
26171 | };
|
26172 | }
|
26173 | var BufferToggleOperator = (function () {
|
26174 | function BufferToggleOperator(openings, closingSelector) {
|
26175 | this.openings = openings;
|
26176 | this.closingSelector = closingSelector;
|
26177 | }
|
26178 | BufferToggleOperator.prototype.call = function (subscriber, source) {
|
26179 | return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));
|
26180 | };
|
26181 | return BufferToggleOperator;
|
26182 | }());
|
26183 | var BufferToggleSubscriber = (function (_super) {
|
26184 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferToggleSubscriber, _super);
|
26185 | function BufferToggleSubscriber(destination, openings, closingSelector) {
|
26186 | var _this = _super.call(this, destination) || this;
|
26187 | _this.openings = openings;
|
26188 | _this.closingSelector = closingSelector;
|
26189 | _this.contexts = [];
|
26190 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, openings));
|
26191 | return _this;
|
26192 | }
|
26193 | BufferToggleSubscriber.prototype._next = function (value) {
|
26194 | var contexts = this.contexts;
|
26195 | var len = contexts.length;
|
26196 | for (var i = 0; i < len; i++) {
|
26197 | contexts[i].buffer.push(value);
|
26198 | }
|
26199 | };
|
26200 | BufferToggleSubscriber.prototype._error = function (err) {
|
26201 | var contexts = this.contexts;
|
26202 | while (contexts.length > 0) {
|
26203 | var context_1 = contexts.shift();
|
26204 | context_1.subscription.unsubscribe();
|
26205 | context_1.buffer = null;
|
26206 | context_1.subscription = null;
|
26207 | }
|
26208 | this.contexts = null;
|
26209 | _super.prototype._error.call(this, err);
|
26210 | };
|
26211 | BufferToggleSubscriber.prototype._complete = function () {
|
26212 | var contexts = this.contexts;
|
26213 | while (contexts.length > 0) {
|
26214 | var context_2 = contexts.shift();
|
26215 | this.destination.next(context_2.buffer);
|
26216 | context_2.subscription.unsubscribe();
|
26217 | context_2.buffer = null;
|
26218 | context_2.subscription = null;
|
26219 | }
|
26220 | this.contexts = null;
|
26221 | _super.prototype._complete.call(this);
|
26222 | };
|
26223 | BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
26224 | outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);
|
26225 | };
|
26226 | BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) {
|
26227 | this.closeBuffer(innerSub.context);
|
26228 | };
|
26229 | BufferToggleSubscriber.prototype.openBuffer = function (value) {
|
26230 | try {
|
26231 | var closingSelector = this.closingSelector;
|
26232 | var closingNotifier = closingSelector.call(this, value);
|
26233 | if (closingNotifier) {
|
26234 | this.trySubscribe(closingNotifier);
|
26235 | }
|
26236 | }
|
26237 | catch (err) {
|
26238 | this._error(err);
|
26239 | }
|
26240 | };
|
26241 | BufferToggleSubscriber.prototype.closeBuffer = function (context) {
|
26242 | var contexts = this.contexts;
|
26243 | if (contexts && context) {
|
26244 | var buffer = context.buffer, subscription = context.subscription;
|
26245 | this.destination.next(buffer);
|
26246 | contexts.splice(contexts.indexOf(context), 1);
|
26247 | this.remove(subscription);
|
26248 | subscription.unsubscribe();
|
26249 | }
|
26250 | };
|
26251 | BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) {
|
26252 | var contexts = this.contexts;
|
26253 | var buffer = [];
|
26254 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
26255 | var context = { buffer: buffer, subscription: subscription };
|
26256 | contexts.push(context);
|
26257 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, closingNotifier, context);
|
26258 | if (!innerSubscription || innerSubscription.closed) {
|
26259 | this.closeBuffer(context);
|
26260 | }
|
26261 | else {
|
26262 | innerSubscription.context = context;
|
26263 | this.add(innerSubscription);
|
26264 | subscription.add(innerSubscription);
|
26265 | }
|
26266 | };
|
26267 | return BufferToggleSubscriber;
|
26268 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
26269 |
|
26270 |
|
26271 |
|
26272 | }),
|
26273 |
|
26274 | (function(module, __webpack_exports__, __webpack_require__) {
|
26275 |
|
26276 | "use strict";
|
26277 | __webpack_require__.r(__webpack_exports__);
|
26278 | __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return bufferWhen; });
|
26279 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26280 | var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(156);
|
26281 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208);
|
26282 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
26283 |
|
26284 |
|
26285 |
|
26286 |
|
26287 |
|
26288 | function bufferWhen(closingSelector) {
|
26289 | return function (source) {
|
26290 | return source.lift(new BufferWhenOperator(closingSelector));
|
26291 | };
|
26292 | }
|
26293 | var BufferWhenOperator = (function () {
|
26294 | function BufferWhenOperator(closingSelector) {
|
26295 | this.closingSelector = closingSelector;
|
26296 | }
|
26297 | BufferWhenOperator.prototype.call = function (subscriber, source) {
|
26298 | return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
|
26299 | };
|
26300 | return BufferWhenOperator;
|
26301 | }());
|
26302 | var BufferWhenSubscriber = (function (_super) {
|
26303 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferWhenSubscriber, _super);
|
26304 | function BufferWhenSubscriber(destination, closingSelector) {
|
26305 | var _this = _super.call(this, destination) || this;
|
26306 | _this.closingSelector = closingSelector;
|
26307 | _this.subscribing = false;
|
26308 | _this.openBuffer();
|
26309 | return _this;
|
26310 | }
|
26311 | BufferWhenSubscriber.prototype._next = function (value) {
|
26312 | this.buffer.push(value);
|
26313 | };
|
26314 | BufferWhenSubscriber.prototype._complete = function () {
|
26315 | var buffer = this.buffer;
|
26316 | if (buffer) {
|
26317 | this.destination.next(buffer);
|
26318 | }
|
26319 | _super.prototype._complete.call(this);
|
26320 | };
|
26321 | BufferWhenSubscriber.prototype._unsubscribe = function () {
|
26322 | this.buffer = null;
|
26323 | this.subscribing = false;
|
26324 | };
|
26325 | BufferWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
26326 | this.openBuffer();
|
26327 | };
|
26328 | BufferWhenSubscriber.prototype.notifyComplete = function () {
|
26329 | if (this.subscribing) {
|
26330 | this.complete();
|
26331 | }
|
26332 | else {
|
26333 | this.openBuffer();
|
26334 | }
|
26335 | };
|
26336 | BufferWhenSubscriber.prototype.openBuffer = function () {
|
26337 | var closingSubscription = this.closingSubscription;
|
26338 | if (closingSubscription) {
|
26339 | this.remove(closingSubscription);
|
26340 | closingSubscription.unsubscribe();
|
26341 | }
|
26342 | var buffer = this.buffer;
|
26343 | if (this.buffer) {
|
26344 | this.destination.next(buffer);
|
26345 | }
|
26346 | this.buffer = [];
|
26347 | var closingNotifier;
|
26348 | try {
|
26349 | var closingSelector = this.closingSelector;
|
26350 | closingNotifier = closingSelector();
|
26351 | }
|
26352 | catch (err) {
|
26353 | return this.error(err);
|
26354 | }
|
26355 | closingSubscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
|
26356 | this.closingSubscription = closingSubscription;
|
26357 | this.add(closingSubscription);
|
26358 | this.subscribing = true;
|
26359 | closingSubscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, closingNotifier));
|
26360 | this.subscribing = false;
|
26361 | };
|
26362 | return BufferWhenSubscriber;
|
26363 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
26364 |
|
26365 |
|
26366 |
|
26367 | }),
|
26368 |
|
26369 | (function(module, __webpack_exports__, __webpack_require__) {
|
26370 |
|
26371 | "use strict";
|
26372 | __webpack_require__.r(__webpack_exports__);
|
26373 | __webpack_require__.d(__webpack_exports__, "catchError", function() { return catchError; });
|
26374 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26375 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
26376 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210);
|
26377 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
26378 |
|
26379 |
|
26380 |
|
26381 |
|
26382 |
|
26383 | function catchError(selector) {
|
26384 | return function catchErrorOperatorFunction(source) {
|
26385 | var operator = new CatchOperator(selector);
|
26386 | var caught = source.lift(operator);
|
26387 | return (operator.caught = caught);
|
26388 | };
|
26389 | }
|
26390 | var CatchOperator = (function () {
|
26391 | function CatchOperator(selector) {
|
26392 | this.selector = selector;
|
26393 | }
|
26394 | CatchOperator.prototype.call = function (subscriber, source) {
|
26395 | return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));
|
26396 | };
|
26397 | return CatchOperator;
|
26398 | }());
|
26399 | var CatchSubscriber = (function (_super) {
|
26400 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CatchSubscriber, _super);
|
26401 | function CatchSubscriber(destination, selector, caught) {
|
26402 | var _this = _super.call(this, destination) || this;
|
26403 | _this.selector = selector;
|
26404 | _this.caught = caught;
|
26405 | return _this;
|
26406 | }
|
26407 | CatchSubscriber.prototype.error = function (err) {
|
26408 | if (!this.isStopped) {
|
26409 | var result = void 0;
|
26410 | try {
|
26411 | result = this.selector(err, this.caught);
|
26412 | }
|
26413 | catch (err2) {
|
26414 | _super.prototype.error.call(this, err2);
|
26415 | return;
|
26416 | }
|
26417 | this._unsubscribeAndRecycle();
|
26418 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, undefined, undefined);
|
26419 | this.add(innerSubscriber);
|
26420 | Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, result, undefined, undefined, innerSubscriber);
|
26421 | }
|
26422 | };
|
26423 | return CatchSubscriber;
|
26424 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
26425 |
|
26426 |
|
26427 |
|
26428 | }),
|
26429 |
|
26430 | (function(module, __webpack_exports__, __webpack_require__) {
|
26431 |
|
26432 | "use strict";
|
26433 | __webpack_require__.r(__webpack_exports__);
|
26434 | __webpack_require__.d(__webpack_exports__, "combineAll", function() { return combineAll; });
|
26435 | var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(207);
|
26436 |
|
26437 |
|
26438 | function combineAll(project) {
|
26439 | return function (source) { return source.lift(new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__["CombineLatestOperator"](project)); };
|
26440 | }
|
26441 |
|
26442 |
|
26443 |
|
26444 | }),
|
26445 |
|
26446 | (function(module, __webpack_exports__, __webpack_require__) {
|
26447 |
|
26448 | "use strict";
|
26449 | __webpack_require__.r(__webpack_exports__);
|
26450 | __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
|
26451 | var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(157);
|
26452 | var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(207);
|
26453 | var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(222);
|
26454 |
|
26455 |
|
26456 |
|
26457 |
|
26458 | var none = {};
|
26459 | function combineLatest() {
|
26460 | var observables = [];
|
26461 | for (var _i = 0; _i < arguments.length; _i++) {
|
26462 | observables[_i] = arguments[_i];
|
26463 | }
|
26464 | var project = null;
|
26465 | if (typeof observables[observables.length - 1] === 'function') {
|
26466 | project = observables.pop();
|
26467 | }
|
26468 | if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
|
26469 | observables = observables[0].slice();
|
26470 | }
|
26471 | return function (source) { return source.lift.call(Object(_observable_from__WEBPACK_IMPORTED_MODULE_2__["from"])([source].concat(observables)), new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__["CombineLatestOperator"](project)); };
|
26472 | }
|
26473 |
|
26474 |
|
26475 |
|
26476 | }),
|
26477 |
|
26478 | (function(module, __webpack_exports__, __webpack_require__) {
|
26479 |
|
26480 | "use strict";
|
26481 | __webpack_require__.r(__webpack_exports__);
|
26482 | __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
|
26483 | var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(218);
|
26484 |
|
26485 |
|
26486 | function concat() {
|
26487 | var observables = [];
|
26488 | for (var _i = 0; _i < arguments.length; _i++) {
|
26489 | observables[_i] = arguments[_i];
|
26490 | }
|
26491 | return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"].apply(void 0, [source].concat(observables))); };
|
26492 | }
|
26493 |
|
26494 |
|
26495 |
|
26496 | }),
|
26497 |
|
26498 | (function(module, __webpack_exports__, __webpack_require__) {
|
26499 |
|
26500 | "use strict";
|
26501 | __webpack_require__.r(__webpack_exports__);
|
26502 | __webpack_require__.d(__webpack_exports__, "concatMap", function() { return concatMap; });
|
26503 | var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221);
|
26504 |
|
26505 |
|
26506 | function concatMap(project, resultSelector) {
|
26507 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(project, resultSelector, 1);
|
26508 | }
|
26509 |
|
26510 |
|
26511 |
|
26512 | }),
|
26513 |
|
26514 | (function(module, __webpack_exports__, __webpack_require__) {
|
26515 |
|
26516 | "use strict";
|
26517 | __webpack_require__.r(__webpack_exports__);
|
26518 | __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; });
|
26519 | var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(262);
|
26520 |
|
26521 |
|
26522 | function concatMapTo(innerObservable, resultSelector) {
|
26523 | return Object(_concatMap__WEBPACK_IMPORTED_MODULE_0__["concatMap"])(function () { return innerObservable; }, resultSelector);
|
26524 | }
|
26525 |
|
26526 |
|
26527 |
|
26528 | }),
|
26529 |
|
26530 | (function(module, __webpack_exports__, __webpack_require__) {
|
26531 |
|
26532 | "use strict";
|
26533 | __webpack_require__.r(__webpack_exports__);
|
26534 | __webpack_require__.d(__webpack_exports__, "count", function() { return count; });
|
26535 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26536 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
26537 |
|
26538 |
|
26539 |
|
26540 | function count(predicate) {
|
26541 | return function (source) { return source.lift(new CountOperator(predicate, source)); };
|
26542 | }
|
26543 | var CountOperator = (function () {
|
26544 | function CountOperator(predicate, source) {
|
26545 | this.predicate = predicate;
|
26546 | this.source = source;
|
26547 | }
|
26548 | CountOperator.prototype.call = function (subscriber, source) {
|
26549 | return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));
|
26550 | };
|
26551 | return CountOperator;
|
26552 | }());
|
26553 | var CountSubscriber = (function (_super) {
|
26554 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountSubscriber, _super);
|
26555 | function CountSubscriber(destination, predicate, source) {
|
26556 | var _this = _super.call(this, destination) || this;
|
26557 | _this.predicate = predicate;
|
26558 | _this.source = source;
|
26559 | _this.count = 0;
|
26560 | _this.index = 0;
|
26561 | return _this;
|
26562 | }
|
26563 | CountSubscriber.prototype._next = function (value) {
|
26564 | if (this.predicate) {
|
26565 | this._tryPredicate(value);
|
26566 | }
|
26567 | else {
|
26568 | this.count++;
|
26569 | }
|
26570 | };
|
26571 | CountSubscriber.prototype._tryPredicate = function (value) {
|
26572 | var result;
|
26573 | try {
|
26574 | result = this.predicate(value, this.index++, this.source);
|
26575 | }
|
26576 | catch (err) {
|
26577 | this.destination.error(err);
|
26578 | return;
|
26579 | }
|
26580 | if (result) {
|
26581 | this.count++;
|
26582 | }
|
26583 | };
|
26584 | CountSubscriber.prototype._complete = function () {
|
26585 | this.destination.next(this.count);
|
26586 | this.destination.complete();
|
26587 | };
|
26588 | return CountSubscriber;
|
26589 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
26590 |
|
26591 |
|
26592 |
|
26593 | }),
|
26594 |
|
26595 | (function(module, __webpack_exports__, __webpack_require__) {
|
26596 |
|
26597 | "use strict";
|
26598 | __webpack_require__.r(__webpack_exports__);
|
26599 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
|
26600 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26601 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
26602 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
26603 |
|
26604 |
|
26605 |
|
26606 |
|
26607 | function debounce(durationSelector) {
|
26608 | return function (source) { return source.lift(new DebounceOperator(durationSelector)); };
|
26609 | }
|
26610 | var DebounceOperator = (function () {
|
26611 | function DebounceOperator(durationSelector) {
|
26612 | this.durationSelector = durationSelector;
|
26613 | }
|
26614 | DebounceOperator.prototype.call = function (subscriber, source) {
|
26615 | return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
|
26616 | };
|
26617 | return DebounceOperator;
|
26618 | }());
|
26619 | var DebounceSubscriber = (function (_super) {
|
26620 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceSubscriber, _super);
|
26621 | function DebounceSubscriber(destination, durationSelector) {
|
26622 | var _this = _super.call(this, destination) || this;
|
26623 | _this.durationSelector = durationSelector;
|
26624 | _this.hasValue = false;
|
26625 | _this.durationSubscription = null;
|
26626 | return _this;
|
26627 | }
|
26628 | DebounceSubscriber.prototype._next = function (value) {
|
26629 | try {
|
26630 | var result = this.durationSelector.call(this, value);
|
26631 | if (result) {
|
26632 | this._tryNext(value, result);
|
26633 | }
|
26634 | }
|
26635 | catch (err) {
|
26636 | this.destination.error(err);
|
26637 | }
|
26638 | };
|
26639 | DebounceSubscriber.prototype._complete = function () {
|
26640 | this.emitValue();
|
26641 | this.destination.complete();
|
26642 | };
|
26643 | DebounceSubscriber.prototype._tryNext = function (value, duration) {
|
26644 | var subscription = this.durationSubscription;
|
26645 | this.value = value;
|
26646 | this.hasValue = true;
|
26647 | if (subscription) {
|
26648 | subscription.unsubscribe();
|
26649 | this.remove(subscription);
|
26650 | }
|
26651 | subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration);
|
26652 | if (subscription && !subscription.closed) {
|
26653 | this.add(this.durationSubscription = subscription);
|
26654 | }
|
26655 | };
|
26656 | DebounceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
26657 | this.emitValue();
|
26658 | };
|
26659 | DebounceSubscriber.prototype.notifyComplete = function () {
|
26660 | this.emitValue();
|
26661 | };
|
26662 | DebounceSubscriber.prototype.emitValue = function () {
|
26663 | if (this.hasValue) {
|
26664 | var value = this.value;
|
26665 | var subscription = this.durationSubscription;
|
26666 | if (subscription) {
|
26667 | this.durationSubscription = null;
|
26668 | subscription.unsubscribe();
|
26669 | this.remove(subscription);
|
26670 | }
|
26671 | this.value = null;
|
26672 | this.hasValue = false;
|
26673 | _super.prototype._next.call(this, value);
|
26674 | }
|
26675 | };
|
26676 | return DebounceSubscriber;
|
26677 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
26678 |
|
26679 |
|
26680 |
|
26681 | }),
|
26682 |
|
26683 | (function(module, __webpack_exports__, __webpack_require__) {
|
26684 |
|
26685 | "use strict";
|
26686 | __webpack_require__.r(__webpack_exports__);
|
26687 | __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return debounceTime; });
|
26688 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26689 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
26690 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194);
|
26691 |
|
26692 |
|
26693 |
|
26694 |
|
26695 | function debounceTime(dueTime, scheduler) {
|
26696 | if (scheduler === void 0) {
|
26697 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
26698 | }
|
26699 | return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };
|
26700 | }
|
26701 | var DebounceTimeOperator = (function () {
|
26702 | function DebounceTimeOperator(dueTime, scheduler) {
|
26703 | this.dueTime = dueTime;
|
26704 | this.scheduler = scheduler;
|
26705 | }
|
26706 | DebounceTimeOperator.prototype.call = function (subscriber, source) {
|
26707 | return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
|
26708 | };
|
26709 | return DebounceTimeOperator;
|
26710 | }());
|
26711 | var DebounceTimeSubscriber = (function (_super) {
|
26712 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceTimeSubscriber, _super);
|
26713 | function DebounceTimeSubscriber(destination, dueTime, scheduler) {
|
26714 | var _this = _super.call(this, destination) || this;
|
26715 | _this.dueTime = dueTime;
|
26716 | _this.scheduler = scheduler;
|
26717 | _this.debouncedSubscription = null;
|
26718 | _this.lastValue = null;
|
26719 | _this.hasValue = false;
|
26720 | return _this;
|
26721 | }
|
26722 | DebounceTimeSubscriber.prototype._next = function (value) {
|
26723 | this.clearDebounce();
|
26724 | this.lastValue = value;
|
26725 | this.hasValue = true;
|
26726 | this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
|
26727 | };
|
26728 | DebounceTimeSubscriber.prototype._complete = function () {
|
26729 | this.debouncedNext();
|
26730 | this.destination.complete();
|
26731 | };
|
26732 | DebounceTimeSubscriber.prototype.debouncedNext = function () {
|
26733 | this.clearDebounce();
|
26734 | if (this.hasValue) {
|
26735 | var lastValue = this.lastValue;
|
26736 | this.lastValue = null;
|
26737 | this.hasValue = false;
|
26738 | this.destination.next(lastValue);
|
26739 | }
|
26740 | };
|
26741 | DebounceTimeSubscriber.prototype.clearDebounce = function () {
|
26742 | var debouncedSubscription = this.debouncedSubscription;
|
26743 | if (debouncedSubscription !== null) {
|
26744 | this.remove(debouncedSubscription);
|
26745 | debouncedSubscription.unsubscribe();
|
26746 | this.debouncedSubscription = null;
|
26747 | }
|
26748 | };
|
26749 | return DebounceTimeSubscriber;
|
26750 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
26751 | function dispatchNext(subscriber) {
|
26752 | subscriber.debouncedNext();
|
26753 | }
|
26754 |
|
26755 |
|
26756 |
|
26757 | }),
|
26758 |
|
26759 | (function(module, __webpack_exports__, __webpack_require__) {
|
26760 |
|
26761 | "use strict";
|
26762 | __webpack_require__.r(__webpack_exports__);
|
26763 | __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return defaultIfEmpty; });
|
26764 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26765 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
26766 |
|
26767 |
|
26768 |
|
26769 | function defaultIfEmpty(defaultValue) {
|
26770 | if (defaultValue === void 0) {
|
26771 | defaultValue = null;
|
26772 | }
|
26773 | return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };
|
26774 | }
|
26775 | var DefaultIfEmptyOperator = (function () {
|
26776 | function DefaultIfEmptyOperator(defaultValue) {
|
26777 | this.defaultValue = defaultValue;
|
26778 | }
|
26779 | DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {
|
26780 | return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
|
26781 | };
|
26782 | return DefaultIfEmptyOperator;
|
26783 | }());
|
26784 | var DefaultIfEmptySubscriber = (function (_super) {
|
26785 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DefaultIfEmptySubscriber, _super);
|
26786 | function DefaultIfEmptySubscriber(destination, defaultValue) {
|
26787 | var _this = _super.call(this, destination) || this;
|
26788 | _this.defaultValue = defaultValue;
|
26789 | _this.isEmpty = true;
|
26790 | return _this;
|
26791 | }
|
26792 | DefaultIfEmptySubscriber.prototype._next = function (value) {
|
26793 | this.isEmpty = false;
|
26794 | this.destination.next(value);
|
26795 | };
|
26796 | DefaultIfEmptySubscriber.prototype._complete = function () {
|
26797 | if (this.isEmpty) {
|
26798 | this.destination.next(this.defaultValue);
|
26799 | }
|
26800 | this.destination.complete();
|
26801 | };
|
26802 | return DefaultIfEmptySubscriber;
|
26803 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
26804 |
|
26805 |
|
26806 |
|
26807 | }),
|
26808 |
|
26809 | (function(module, __webpack_exports__, __webpack_require__) {
|
26810 |
|
26811 | "use strict";
|
26812 | __webpack_require__.r(__webpack_exports__);
|
26813 | __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; });
|
26814 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26815 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
26816 | var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(269);
|
26817 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(150);
|
26818 | var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(181);
|
26819 |
|
26820 |
|
26821 |
|
26822 |
|
26823 |
|
26824 |
|
26825 | function delay(delay, scheduler) {
|
26826 | if (scheduler === void 0) {
|
26827 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
26828 | }
|
26829 | var absoluteDelay = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(delay);
|
26830 | var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
|
26831 | return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };
|
26832 | }
|
26833 | var DelayOperator = (function () {
|
26834 | function DelayOperator(delay, scheduler) {
|
26835 | this.delay = delay;
|
26836 | this.scheduler = scheduler;
|
26837 | }
|
26838 | DelayOperator.prototype.call = function (subscriber, source) {
|
26839 | return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
|
26840 | };
|
26841 | return DelayOperator;
|
26842 | }());
|
26843 | var DelaySubscriber = (function (_super) {
|
26844 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelaySubscriber, _super);
|
26845 | function DelaySubscriber(destination, delay, scheduler) {
|
26846 | var _this = _super.call(this, destination) || this;
|
26847 | _this.delay = delay;
|
26848 | _this.scheduler = scheduler;
|
26849 | _this.queue = [];
|
26850 | _this.active = false;
|
26851 | _this.errored = false;
|
26852 | return _this;
|
26853 | }
|
26854 | DelaySubscriber.dispatch = function (state) {
|
26855 | var source = state.source;
|
26856 | var queue = source.queue;
|
26857 | var scheduler = state.scheduler;
|
26858 | var destination = state.destination;
|
26859 | while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
|
26860 | queue.shift().notification.observe(destination);
|
26861 | }
|
26862 | if (queue.length > 0) {
|
26863 | var delay_1 = Math.max(0, queue[0].time - scheduler.now());
|
26864 | this.schedule(state, delay_1);
|
26865 | }
|
26866 | else {
|
26867 | this.unsubscribe();
|
26868 | source.active = false;
|
26869 | }
|
26870 | };
|
26871 | DelaySubscriber.prototype._schedule = function (scheduler) {
|
26872 | this.active = true;
|
26873 | var destination = this.destination;
|
26874 | destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
|
26875 | source: this, destination: this.destination, scheduler: scheduler
|
26876 | }));
|
26877 | };
|
26878 | DelaySubscriber.prototype.scheduleNotification = function (notification) {
|
26879 | if (this.errored === true) {
|
26880 | return;
|
26881 | }
|
26882 | var scheduler = this.scheduler;
|
26883 | var message = new DelayMessage(scheduler.now() + this.delay, notification);
|
26884 | this.queue.push(message);
|
26885 | if (this.active === false) {
|
26886 | this._schedule(scheduler);
|
26887 | }
|
26888 | };
|
26889 | DelaySubscriber.prototype._next = function (value) {
|
26890 | this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createNext(value));
|
26891 | };
|
26892 | DelaySubscriber.prototype._error = function (err) {
|
26893 | this.errored = true;
|
26894 | this.queue = [];
|
26895 | this.destination.error(err);
|
26896 | this.unsubscribe();
|
26897 | };
|
26898 | DelaySubscriber.prototype._complete = function () {
|
26899 | this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createComplete());
|
26900 | this.unsubscribe();
|
26901 | };
|
26902 | return DelaySubscriber;
|
26903 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
26904 | var DelayMessage = (function () {
|
26905 | function DelayMessage(time, notification) {
|
26906 | this.time = time;
|
26907 | this.notification = notification;
|
26908 | }
|
26909 | return DelayMessage;
|
26910 | }());
|
26911 |
|
26912 |
|
26913 |
|
26914 | }),
|
26915 |
|
26916 | (function(module, __webpack_exports__, __webpack_require__) {
|
26917 |
|
26918 | "use strict";
|
26919 | __webpack_require__.r(__webpack_exports__);
|
26920 | __webpack_require__.d(__webpack_exports__, "isDate", function() { return isDate; });
|
26921 |
|
26922 | function isDate(value) {
|
26923 | return value instanceof Date && !isNaN(+value);
|
26924 | }
|
26925 |
|
26926 |
|
26927 |
|
26928 | }),
|
26929 |
|
26930 | (function(module, __webpack_exports__, __webpack_require__) {
|
26931 |
|
26932 | "use strict";
|
26933 | __webpack_require__.r(__webpack_exports__);
|
26934 | __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return delayWhen; });
|
26935 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
26936 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
26937 | var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148);
|
26938 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208);
|
26939 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(209);
|
26940 |
|
26941 |
|
26942 |
|
26943 |
|
26944 |
|
26945 |
|
26946 | function delayWhen(delayDurationSelector, subscriptionDelay) {
|
26947 | if (subscriptionDelay) {
|
26948 | return function (source) {
|
26949 | return new SubscriptionDelayObservable(source, subscriptionDelay)
|
26950 | .lift(new DelayWhenOperator(delayDurationSelector));
|
26951 | };
|
26952 | }
|
26953 | return function (source) { return source.lift(new DelayWhenOperator(delayDurationSelector)); };
|
26954 | }
|
26955 | var DelayWhenOperator = (function () {
|
26956 | function DelayWhenOperator(delayDurationSelector) {
|
26957 | this.delayDurationSelector = delayDurationSelector;
|
26958 | }
|
26959 | DelayWhenOperator.prototype.call = function (subscriber, source) {
|
26960 | return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
|
26961 | };
|
26962 | return DelayWhenOperator;
|
26963 | }());
|
26964 | var DelayWhenSubscriber = (function (_super) {
|
26965 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelayWhenSubscriber, _super);
|
26966 | function DelayWhenSubscriber(destination, delayDurationSelector) {
|
26967 | var _this = _super.call(this, destination) || this;
|
26968 | _this.delayDurationSelector = delayDurationSelector;
|
26969 | _this.completed = false;
|
26970 | _this.delayNotifierSubscriptions = [];
|
26971 | _this.index = 0;
|
26972 | return _this;
|
26973 | }
|
26974 | DelayWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
26975 | this.destination.next(outerValue);
|
26976 | this.removeSubscription(innerSub);
|
26977 | this.tryComplete();
|
26978 | };
|
26979 | DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) {
|
26980 | this._error(error);
|
26981 | };
|
26982 | DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) {
|
26983 | var value = this.removeSubscription(innerSub);
|
26984 | if (value) {
|
26985 | this.destination.next(value);
|
26986 | }
|
26987 | this.tryComplete();
|
26988 | };
|
26989 | DelayWhenSubscriber.prototype._next = function (value) {
|
26990 | var index = this.index++;
|
26991 | try {
|
26992 | var delayNotifier = this.delayDurationSelector(value, index);
|
26993 | if (delayNotifier) {
|
26994 | this.tryDelay(delayNotifier, value);
|
26995 | }
|
26996 | }
|
26997 | catch (err) {
|
26998 | this.destination.error(err);
|
26999 | }
|
27000 | };
|
27001 | DelayWhenSubscriber.prototype._complete = function () {
|
27002 | this.completed = true;
|
27003 | this.tryComplete();
|
27004 | this.unsubscribe();
|
27005 | };
|
27006 | DelayWhenSubscriber.prototype.removeSubscription = function (subscription) {
|
27007 | subscription.unsubscribe();
|
27008 | var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
|
27009 | if (subscriptionIdx !== -1) {
|
27010 | this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
|
27011 | }
|
27012 | return subscription.outerValue;
|
27013 | };
|
27014 | DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) {
|
27015 | var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, delayNotifier, value);
|
27016 | if (notifierSubscription && !notifierSubscription.closed) {
|
27017 | var destination = this.destination;
|
27018 | destination.add(notifierSubscription);
|
27019 | this.delayNotifierSubscriptions.push(notifierSubscription);
|
27020 | }
|
27021 | };
|
27022 | DelayWhenSubscriber.prototype.tryComplete = function () {
|
27023 | if (this.completed && this.delayNotifierSubscriptions.length === 0) {
|
27024 | this.destination.complete();
|
27025 | }
|
27026 | };
|
27027 | return DelayWhenSubscriber;
|
27028 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
27029 | var SubscriptionDelayObservable = (function (_super) {
|
27030 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelayObservable, _super);
|
27031 | function SubscriptionDelayObservable(source, subscriptionDelay) {
|
27032 | var _this = _super.call(this) || this;
|
27033 | _this.source = source;
|
27034 | _this.subscriptionDelay = subscriptionDelay;
|
27035 | return _this;
|
27036 | }
|
27037 | SubscriptionDelayObservable.prototype._subscribe = function (subscriber) {
|
27038 | this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
|
27039 | };
|
27040 | return SubscriptionDelayObservable;
|
27041 | }(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]));
|
27042 | var SubscriptionDelaySubscriber = (function (_super) {
|
27043 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelaySubscriber, _super);
|
27044 | function SubscriptionDelaySubscriber(parent, source) {
|
27045 | var _this = _super.call(this) || this;
|
27046 | _this.parent = parent;
|
27047 | _this.source = source;
|
27048 | _this.sourceSubscribed = false;
|
27049 | return _this;
|
27050 | }
|
27051 | SubscriptionDelaySubscriber.prototype._next = function (unused) {
|
27052 | this.subscribeToSource();
|
27053 | };
|
27054 | SubscriptionDelaySubscriber.prototype._error = function (err) {
|
27055 | this.unsubscribe();
|
27056 | this.parent.error(err);
|
27057 | };
|
27058 | SubscriptionDelaySubscriber.prototype._complete = function () {
|
27059 | this.unsubscribe();
|
27060 | this.subscribeToSource();
|
27061 | };
|
27062 | SubscriptionDelaySubscriber.prototype.subscribeToSource = function () {
|
27063 | if (!this.sourceSubscribed) {
|
27064 | this.sourceSubscribed = true;
|
27065 | this.unsubscribe();
|
27066 | this.source.subscribe(this.parent);
|
27067 | }
|
27068 | };
|
27069 | return SubscriptionDelaySubscriber;
|
27070 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27071 |
|
27072 |
|
27073 |
|
27074 | }),
|
27075 |
|
27076 | (function(module, __webpack_exports__, __webpack_require__) {
|
27077 |
|
27078 | "use strict";
|
27079 | __webpack_require__.r(__webpack_exports__);
|
27080 | __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return dematerialize; });
|
27081 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27082 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27083 |
|
27084 |
|
27085 |
|
27086 | function dematerialize() {
|
27087 | return function dematerializeOperatorFunction(source) {
|
27088 | return source.lift(new DeMaterializeOperator());
|
27089 | };
|
27090 | }
|
27091 | var DeMaterializeOperator = (function () {
|
27092 | function DeMaterializeOperator() {
|
27093 | }
|
27094 | DeMaterializeOperator.prototype.call = function (subscriber, source) {
|
27095 | return source.subscribe(new DeMaterializeSubscriber(subscriber));
|
27096 | };
|
27097 | return DeMaterializeOperator;
|
27098 | }());
|
27099 | var DeMaterializeSubscriber = (function (_super) {
|
27100 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DeMaterializeSubscriber, _super);
|
27101 | function DeMaterializeSubscriber(destination) {
|
27102 | return _super.call(this, destination) || this;
|
27103 | }
|
27104 | DeMaterializeSubscriber.prototype._next = function (value) {
|
27105 | value.observe(this.destination);
|
27106 | };
|
27107 | return DeMaterializeSubscriber;
|
27108 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27109 |
|
27110 |
|
27111 |
|
27112 | }),
|
27113 |
|
27114 | (function(module, __webpack_exports__, __webpack_require__) {
|
27115 |
|
27116 | "use strict";
|
27117 | __webpack_require__.r(__webpack_exports__);
|
27118 | __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; });
|
27119 | __webpack_require__.d(__webpack_exports__, "DistinctSubscriber", function() { return DistinctSubscriber; });
|
27120 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27121 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
27122 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
27123 |
|
27124 |
|
27125 |
|
27126 |
|
27127 | function distinct(keySelector, flushes) {
|
27128 | return function (source) { return source.lift(new DistinctOperator(keySelector, flushes)); };
|
27129 | }
|
27130 | var DistinctOperator = (function () {
|
27131 | function DistinctOperator(keySelector, flushes) {
|
27132 | this.keySelector = keySelector;
|
27133 | this.flushes = flushes;
|
27134 | }
|
27135 | DistinctOperator.prototype.call = function (subscriber, source) {
|
27136 | return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));
|
27137 | };
|
27138 | return DistinctOperator;
|
27139 | }());
|
27140 | var DistinctSubscriber = (function (_super) {
|
27141 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctSubscriber, _super);
|
27142 | function DistinctSubscriber(destination, keySelector, flushes) {
|
27143 | var _this = _super.call(this, destination) || this;
|
27144 | _this.keySelector = keySelector;
|
27145 | _this.values = new Set();
|
27146 | if (flushes) {
|
27147 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, flushes));
|
27148 | }
|
27149 | return _this;
|
27150 | }
|
27151 | DistinctSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
27152 | this.values.clear();
|
27153 | };
|
27154 | DistinctSubscriber.prototype.notifyError = function (error, innerSub) {
|
27155 | this._error(error);
|
27156 | };
|
27157 | DistinctSubscriber.prototype._next = function (value) {
|
27158 | if (this.keySelector) {
|
27159 | this._useKeySelector(value);
|
27160 | }
|
27161 | else {
|
27162 | this._finalizeNext(value, value);
|
27163 | }
|
27164 | };
|
27165 | DistinctSubscriber.prototype._useKeySelector = function (value) {
|
27166 | var key;
|
27167 | var destination = this.destination;
|
27168 | try {
|
27169 | key = this.keySelector(value);
|
27170 | }
|
27171 | catch (err) {
|
27172 | destination.error(err);
|
27173 | return;
|
27174 | }
|
27175 | this._finalizeNext(key, value);
|
27176 | };
|
27177 | DistinctSubscriber.prototype._finalizeNext = function (key, value) {
|
27178 | var values = this.values;
|
27179 | if (!values.has(key)) {
|
27180 | values.add(key);
|
27181 | this.destination.next(value);
|
27182 | }
|
27183 | };
|
27184 | return DistinctSubscriber;
|
27185 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
27186 |
|
27187 |
|
27188 |
|
27189 |
|
27190 | }),
|
27191 |
|
27192 | (function(module, __webpack_exports__, __webpack_require__) {
|
27193 |
|
27194 | "use strict";
|
27195 | __webpack_require__.r(__webpack_exports__);
|
27196 | __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return distinctUntilChanged; });
|
27197 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27198 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27199 |
|
27200 |
|
27201 |
|
27202 | function distinctUntilChanged(compare, keySelector) {
|
27203 | return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };
|
27204 | }
|
27205 | var DistinctUntilChangedOperator = (function () {
|
27206 | function DistinctUntilChangedOperator(compare, keySelector) {
|
27207 | this.compare = compare;
|
27208 | this.keySelector = keySelector;
|
27209 | }
|
27210 | DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {
|
27211 | return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));
|
27212 | };
|
27213 | return DistinctUntilChangedOperator;
|
27214 | }());
|
27215 | var DistinctUntilChangedSubscriber = (function (_super) {
|
27216 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctUntilChangedSubscriber, _super);
|
27217 | function DistinctUntilChangedSubscriber(destination, compare, keySelector) {
|
27218 | var _this = _super.call(this, destination) || this;
|
27219 | _this.keySelector = keySelector;
|
27220 | _this.hasKey = false;
|
27221 | if (typeof compare === 'function') {
|
27222 | _this.compare = compare;
|
27223 | }
|
27224 | return _this;
|
27225 | }
|
27226 | DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {
|
27227 | return x === y;
|
27228 | };
|
27229 | DistinctUntilChangedSubscriber.prototype._next = function (value) {
|
27230 | var key;
|
27231 | try {
|
27232 | var keySelector = this.keySelector;
|
27233 | key = keySelector ? keySelector(value) : value;
|
27234 | }
|
27235 | catch (err) {
|
27236 | return this.destination.error(err);
|
27237 | }
|
27238 | var result = false;
|
27239 | if (this.hasKey) {
|
27240 | try {
|
27241 | var compare = this.compare;
|
27242 | result = compare(this.key, key);
|
27243 | }
|
27244 | catch (err) {
|
27245 | return this.destination.error(err);
|
27246 | }
|
27247 | }
|
27248 | else {
|
27249 | this.hasKey = true;
|
27250 | }
|
27251 | if (!result) {
|
27252 | this.key = key;
|
27253 | this.destination.next(value);
|
27254 | }
|
27255 | };
|
27256 | return DistinctUntilChangedSubscriber;
|
27257 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27258 |
|
27259 |
|
27260 |
|
27261 | }),
|
27262 |
|
27263 | (function(module, __webpack_exports__, __webpack_require__) {
|
27264 |
|
27265 | "use strict";
|
27266 | __webpack_require__.r(__webpack_exports__);
|
27267 | __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; });
|
27268 | var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(273);
|
27269 |
|
27270 |
|
27271 | function distinctUntilKeyChanged(key, compare) {
|
27272 | return Object(_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__["distinctUntilChanged"])(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });
|
27273 | }
|
27274 |
|
27275 |
|
27276 |
|
27277 | }),
|
27278 |
|
27279 | (function(module, __webpack_exports__, __webpack_require__) {
|
27280 |
|
27281 | "use strict";
|
27282 | __webpack_require__.r(__webpack_exports__);
|
27283 | __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; });
|
27284 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(201);
|
27285 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(243);
|
27286 | var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(276);
|
27287 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(267);
|
27288 | var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(277);
|
27289 |
|
27290 |
|
27291 |
|
27292 |
|
27293 |
|
27294 |
|
27295 | function elementAt(index, defaultValue) {
|
27296 | if (index < 0) {
|
27297 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"]();
|
27298 | }
|
27299 | var hasDefaultValue = arguments.length >= 2;
|
27300 | return function (source) {
|
27301 | return source.pipe(Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return i === index; }), Object(_take__WEBPACK_IMPORTED_MODULE_4__["take"])(1), hasDefaultValue
|
27302 | ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue)
|
27303 | : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__["throwIfEmpty"])(function () { return new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"](); }));
|
27304 | };
|
27305 | }
|
27306 |
|
27307 |
|
27308 |
|
27309 | }),
|
27310 |
|
27311 | (function(module, __webpack_exports__, __webpack_require__) {
|
27312 |
|
27313 | "use strict";
|
27314 | __webpack_require__.r(__webpack_exports__);
|
27315 | __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return throwIfEmpty; });
|
27316 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27317 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(202);
|
27318 | var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(150);
|
27319 |
|
27320 |
|
27321 |
|
27322 |
|
27323 | function throwIfEmpty(errorFactory) {
|
27324 | if (errorFactory === void 0) {
|
27325 | errorFactory = defaultErrorFactory;
|
27326 | }
|
27327 | return function (source) {
|
27328 | return source.lift(new ThrowIfEmptyOperator(errorFactory));
|
27329 | };
|
27330 | }
|
27331 | var ThrowIfEmptyOperator = (function () {
|
27332 | function ThrowIfEmptyOperator(errorFactory) {
|
27333 | this.errorFactory = errorFactory;
|
27334 | }
|
27335 | ThrowIfEmptyOperator.prototype.call = function (subscriber, source) {
|
27336 | return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory));
|
27337 | };
|
27338 | return ThrowIfEmptyOperator;
|
27339 | }());
|
27340 | var ThrowIfEmptySubscriber = (function (_super) {
|
27341 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrowIfEmptySubscriber, _super);
|
27342 | function ThrowIfEmptySubscriber(destination, errorFactory) {
|
27343 | var _this = _super.call(this, destination) || this;
|
27344 | _this.errorFactory = errorFactory;
|
27345 | _this.hasValue = false;
|
27346 | return _this;
|
27347 | }
|
27348 | ThrowIfEmptySubscriber.prototype._next = function (value) {
|
27349 | this.hasValue = true;
|
27350 | this.destination.next(value);
|
27351 | };
|
27352 | ThrowIfEmptySubscriber.prototype._complete = function () {
|
27353 | if (!this.hasValue) {
|
27354 | var err = void 0;
|
27355 | try {
|
27356 | err = this.errorFactory();
|
27357 | }
|
27358 | catch (e) {
|
27359 | err = e;
|
27360 | }
|
27361 | this.destination.error(err);
|
27362 | }
|
27363 | else {
|
27364 | return this.destination.complete();
|
27365 | }
|
27366 | };
|
27367 | return ThrowIfEmptySubscriber;
|
27368 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"]));
|
27369 | function defaultErrorFactory() {
|
27370 | return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__["EmptyError"]();
|
27371 | }
|
27372 |
|
27373 |
|
27374 |
|
27375 | }),
|
27376 |
|
27377 | (function(module, __webpack_exports__, __webpack_require__) {
|
27378 |
|
27379 | "use strict";
|
27380 | __webpack_require__.r(__webpack_exports__);
|
27381 | __webpack_require__.d(__webpack_exports__, "take", function() { return take; });
|
27382 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27383 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27384 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201);
|
27385 | var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(182);
|
27386 |
|
27387 |
|
27388 |
|
27389 |
|
27390 |
|
27391 | function take(count) {
|
27392 | return function (source) {
|
27393 | if (count === 0) {
|
27394 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])();
|
27395 | }
|
27396 | else {
|
27397 | return source.lift(new TakeOperator(count));
|
27398 | }
|
27399 | };
|
27400 | }
|
27401 | var TakeOperator = (function () {
|
27402 | function TakeOperator(total) {
|
27403 | this.total = total;
|
27404 | if (this.total < 0) {
|
27405 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
|
27406 | }
|
27407 | }
|
27408 | TakeOperator.prototype.call = function (subscriber, source) {
|
27409 | return source.subscribe(new TakeSubscriber(subscriber, this.total));
|
27410 | };
|
27411 | return TakeOperator;
|
27412 | }());
|
27413 | var TakeSubscriber = (function (_super) {
|
27414 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeSubscriber, _super);
|
27415 | function TakeSubscriber(destination, total) {
|
27416 | var _this = _super.call(this, destination) || this;
|
27417 | _this.total = total;
|
27418 | _this.count = 0;
|
27419 | return _this;
|
27420 | }
|
27421 | TakeSubscriber.prototype._next = function (value) {
|
27422 | var total = this.total;
|
27423 | var count = ++this.count;
|
27424 | if (count <= total) {
|
27425 | this.destination.next(value);
|
27426 | if (count === total) {
|
27427 | this.destination.complete();
|
27428 | this.unsubscribe();
|
27429 | }
|
27430 | }
|
27431 | };
|
27432 | return TakeSubscriber;
|
27433 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27434 |
|
27435 |
|
27436 |
|
27437 | }),
|
27438 |
|
27439 | (function(module, __webpack_exports__, __webpack_require__) {
|
27440 |
|
27441 | "use strict";
|
27442 | __webpack_require__.r(__webpack_exports__);
|
27443 | __webpack_require__.d(__webpack_exports__, "endWith", function() { return endWith; });
|
27444 | var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(218);
|
27445 | var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(183);
|
27446 |
|
27447 |
|
27448 |
|
27449 | function endWith() {
|
27450 | var array = [];
|
27451 | for (var _i = 0; _i < arguments.length; _i++) {
|
27452 | array[_i] = arguments[_i];
|
27453 | }
|
27454 | return function (source) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(source, _observable_of__WEBPACK_IMPORTED_MODULE_1__["of"].apply(void 0, array)); };
|
27455 | }
|
27456 |
|
27457 |
|
27458 |
|
27459 | }),
|
27460 |
|
27461 | (function(module, __webpack_exports__, __webpack_require__) {
|
27462 |
|
27463 | "use strict";
|
27464 | __webpack_require__.r(__webpack_exports__);
|
27465 | __webpack_require__.d(__webpack_exports__, "every", function() { return every; });
|
27466 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27467 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27468 |
|
27469 |
|
27470 |
|
27471 | function every(predicate, thisArg) {
|
27472 | return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
|
27473 | }
|
27474 | var EveryOperator = (function () {
|
27475 | function EveryOperator(predicate, thisArg, source) {
|
27476 | this.predicate = predicate;
|
27477 | this.thisArg = thisArg;
|
27478 | this.source = source;
|
27479 | }
|
27480 | EveryOperator.prototype.call = function (observer, source) {
|
27481 | return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
|
27482 | };
|
27483 | return EveryOperator;
|
27484 | }());
|
27485 | var EverySubscriber = (function (_super) {
|
27486 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](EverySubscriber, _super);
|
27487 | function EverySubscriber(destination, predicate, thisArg, source) {
|
27488 | var _this = _super.call(this, destination) || this;
|
27489 | _this.predicate = predicate;
|
27490 | _this.thisArg = thisArg;
|
27491 | _this.source = source;
|
27492 | _this.index = 0;
|
27493 | _this.thisArg = thisArg || _this;
|
27494 | return _this;
|
27495 | }
|
27496 | EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
|
27497 | this.destination.next(everyValueMatch);
|
27498 | this.destination.complete();
|
27499 | };
|
27500 | EverySubscriber.prototype._next = function (value) {
|
27501 | var result = false;
|
27502 | try {
|
27503 | result = this.predicate.call(this.thisArg, value, this.index++, this.source);
|
27504 | }
|
27505 | catch (err) {
|
27506 | this.destination.error(err);
|
27507 | return;
|
27508 | }
|
27509 | if (!result) {
|
27510 | this.notifyComplete(false);
|
27511 | }
|
27512 | };
|
27513 | EverySubscriber.prototype._complete = function () {
|
27514 | this.notifyComplete(true);
|
27515 | };
|
27516 | return EverySubscriber;
|
27517 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27518 |
|
27519 |
|
27520 |
|
27521 | }),
|
27522 |
|
27523 | (function(module, __webpack_exports__, __webpack_require__) {
|
27524 |
|
27525 | "use strict";
|
27526 | __webpack_require__.r(__webpack_exports__);
|
27527 | __webpack_require__.d(__webpack_exports__, "exhaust", function() { return exhaust; });
|
27528 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27529 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
27530 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
27531 |
|
27532 |
|
27533 |
|
27534 |
|
27535 | function exhaust() {
|
27536 | return function (source) { return source.lift(new SwitchFirstOperator()); };
|
27537 | }
|
27538 | var SwitchFirstOperator = (function () {
|
27539 | function SwitchFirstOperator() {
|
27540 | }
|
27541 | SwitchFirstOperator.prototype.call = function (subscriber, source) {
|
27542 | return source.subscribe(new SwitchFirstSubscriber(subscriber));
|
27543 | };
|
27544 | return SwitchFirstOperator;
|
27545 | }());
|
27546 | var SwitchFirstSubscriber = (function (_super) {
|
27547 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchFirstSubscriber, _super);
|
27548 | function SwitchFirstSubscriber(destination) {
|
27549 | var _this = _super.call(this, destination) || this;
|
27550 | _this.hasCompleted = false;
|
27551 | _this.hasSubscription = false;
|
27552 | return _this;
|
27553 | }
|
27554 | SwitchFirstSubscriber.prototype._next = function (value) {
|
27555 | if (!this.hasSubscription) {
|
27556 | this.hasSubscription = true;
|
27557 | this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, value));
|
27558 | }
|
27559 | };
|
27560 | SwitchFirstSubscriber.prototype._complete = function () {
|
27561 | this.hasCompleted = true;
|
27562 | if (!this.hasSubscription) {
|
27563 | this.destination.complete();
|
27564 | }
|
27565 | };
|
27566 | SwitchFirstSubscriber.prototype.notifyComplete = function (innerSub) {
|
27567 | this.remove(innerSub);
|
27568 | this.hasSubscription = false;
|
27569 | if (this.hasCompleted) {
|
27570 | this.destination.complete();
|
27571 | }
|
27572 | };
|
27573 | return SwitchFirstSubscriber;
|
27574 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
27575 |
|
27576 |
|
27577 |
|
27578 | }),
|
27579 |
|
27580 | (function(module, __webpack_exports__, __webpack_require__) {
|
27581 |
|
27582 | "use strict";
|
27583 | __webpack_require__.r(__webpack_exports__);
|
27584 | __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return exhaustMap; });
|
27585 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27586 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
27587 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210);
|
27588 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
27589 | var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(205);
|
27590 | var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(222);
|
27591 |
|
27592 |
|
27593 |
|
27594 |
|
27595 |
|
27596 |
|
27597 |
|
27598 | function exhaustMap(project, resultSelector) {
|
27599 | if (resultSelector) {
|
27600 | return function (source) { return source.pipe(exhaustMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_5__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_4__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
|
27601 | }
|
27602 | return function (source) {
|
27603 | return source.lift(new ExhaustMapOperator(project));
|
27604 | };
|
27605 | }
|
27606 | var ExhaustMapOperator = (function () {
|
27607 | function ExhaustMapOperator(project) {
|
27608 | this.project = project;
|
27609 | }
|
27610 | ExhaustMapOperator.prototype.call = function (subscriber, source) {
|
27611 | return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
|
27612 | };
|
27613 | return ExhaustMapOperator;
|
27614 | }());
|
27615 | var ExhaustMapSubscriber = (function (_super) {
|
27616 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExhaustMapSubscriber, _super);
|
27617 | function ExhaustMapSubscriber(destination, project) {
|
27618 | var _this = _super.call(this, destination) || this;
|
27619 | _this.project = project;
|
27620 | _this.hasSubscription = false;
|
27621 | _this.hasCompleted = false;
|
27622 | _this.index = 0;
|
27623 | return _this;
|
27624 | }
|
27625 | ExhaustMapSubscriber.prototype._next = function (value) {
|
27626 | if (!this.hasSubscription) {
|
27627 | this.tryNext(value);
|
27628 | }
|
27629 | };
|
27630 | ExhaustMapSubscriber.prototype.tryNext = function (value) {
|
27631 | var result;
|
27632 | var index = this.index++;
|
27633 | try {
|
27634 | result = this.project(value, index);
|
27635 | }
|
27636 | catch (err) {
|
27637 | this.destination.error(err);
|
27638 | return;
|
27639 | }
|
27640 | this.hasSubscription = true;
|
27641 | this._innerSub(result, value, index);
|
27642 | };
|
27643 | ExhaustMapSubscriber.prototype._innerSub = function (result, value, index) {
|
27644 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, undefined, undefined);
|
27645 | var destination = this.destination;
|
27646 | destination.add(innerSubscriber);
|
27647 | Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, result, value, index, innerSubscriber);
|
27648 | };
|
27649 | ExhaustMapSubscriber.prototype._complete = function () {
|
27650 | this.hasCompleted = true;
|
27651 | if (!this.hasSubscription) {
|
27652 | this.destination.complete();
|
27653 | }
|
27654 | this.unsubscribe();
|
27655 | };
|
27656 | ExhaustMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
27657 | this.destination.next(innerValue);
|
27658 | };
|
27659 | ExhaustMapSubscriber.prototype.notifyError = function (err) {
|
27660 | this.destination.error(err);
|
27661 | };
|
27662 | ExhaustMapSubscriber.prototype.notifyComplete = function (innerSub) {
|
27663 | var destination = this.destination;
|
27664 | destination.remove(innerSub);
|
27665 | this.hasSubscription = false;
|
27666 | if (this.hasCompleted) {
|
27667 | this.destination.complete();
|
27668 | }
|
27669 | };
|
27670 | return ExhaustMapSubscriber;
|
27671 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
27672 |
|
27673 |
|
27674 |
|
27675 | }),
|
27676 |
|
27677 | (function(module, __webpack_exports__, __webpack_require__) {
|
27678 |
|
27679 | "use strict";
|
27680 | __webpack_require__.r(__webpack_exports__);
|
27681 | __webpack_require__.d(__webpack_exports__, "expand", function() { return expand; });
|
27682 | __webpack_require__.d(__webpack_exports__, "ExpandOperator", function() { return ExpandOperator; });
|
27683 | __webpack_require__.d(__webpack_exports__, "ExpandSubscriber", function() { return ExpandSubscriber; });
|
27684 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27685 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
27686 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
27687 |
|
27688 |
|
27689 |
|
27690 |
|
27691 | function expand(project, concurrent, scheduler) {
|
27692 | if (concurrent === void 0) {
|
27693 | concurrent = Number.POSITIVE_INFINITY;
|
27694 | }
|
27695 | if (scheduler === void 0) {
|
27696 | scheduler = undefined;
|
27697 | }
|
27698 | concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;
|
27699 | return function (source) { return source.lift(new ExpandOperator(project, concurrent, scheduler)); };
|
27700 | }
|
27701 | var ExpandOperator = (function () {
|
27702 | function ExpandOperator(project, concurrent, scheduler) {
|
27703 | this.project = project;
|
27704 | this.concurrent = concurrent;
|
27705 | this.scheduler = scheduler;
|
27706 | }
|
27707 | ExpandOperator.prototype.call = function (subscriber, source) {
|
27708 | return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));
|
27709 | };
|
27710 | return ExpandOperator;
|
27711 | }());
|
27712 |
|
27713 | var ExpandSubscriber = (function (_super) {
|
27714 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExpandSubscriber, _super);
|
27715 | function ExpandSubscriber(destination, project, concurrent, scheduler) {
|
27716 | var _this = _super.call(this, destination) || this;
|
27717 | _this.project = project;
|
27718 | _this.concurrent = concurrent;
|
27719 | _this.scheduler = scheduler;
|
27720 | _this.index = 0;
|
27721 | _this.active = 0;
|
27722 | _this.hasCompleted = false;
|
27723 | if (concurrent < Number.POSITIVE_INFINITY) {
|
27724 | _this.buffer = [];
|
27725 | }
|
27726 | return _this;
|
27727 | }
|
27728 | ExpandSubscriber.dispatch = function (arg) {
|
27729 | var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index;
|
27730 | subscriber.subscribeToProjection(result, value, index);
|
27731 | };
|
27732 | ExpandSubscriber.prototype._next = function (value) {
|
27733 | var destination = this.destination;
|
27734 | if (destination.closed) {
|
27735 | this._complete();
|
27736 | return;
|
27737 | }
|
27738 | var index = this.index++;
|
27739 | if (this.active < this.concurrent) {
|
27740 | destination.next(value);
|
27741 | try {
|
27742 | var project = this.project;
|
27743 | var result = project(value, index);
|
27744 | if (!this.scheduler) {
|
27745 | this.subscribeToProjection(result, value, index);
|
27746 | }
|
27747 | else {
|
27748 | var state = { subscriber: this, result: result, value: value, index: index };
|
27749 | var destination_1 = this.destination;
|
27750 | destination_1.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));
|
27751 | }
|
27752 | }
|
27753 | catch (e) {
|
27754 | destination.error(e);
|
27755 | }
|
27756 | }
|
27757 | else {
|
27758 | this.buffer.push(value);
|
27759 | }
|
27760 | };
|
27761 | ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) {
|
27762 | this.active++;
|
27763 | var destination = this.destination;
|
27764 | destination.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, value, index));
|
27765 | };
|
27766 | ExpandSubscriber.prototype._complete = function () {
|
27767 | this.hasCompleted = true;
|
27768 | if (this.hasCompleted && this.active === 0) {
|
27769 | this.destination.complete();
|
27770 | }
|
27771 | this.unsubscribe();
|
27772 | };
|
27773 | ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
27774 | this._next(innerValue);
|
27775 | };
|
27776 | ExpandSubscriber.prototype.notifyComplete = function (innerSub) {
|
27777 | var buffer = this.buffer;
|
27778 | var destination = this.destination;
|
27779 | destination.remove(innerSub);
|
27780 | this.active--;
|
27781 | if (buffer && buffer.length > 0) {
|
27782 | this._next(buffer.shift());
|
27783 | }
|
27784 | if (this.hasCompleted && this.active === 0) {
|
27785 | this.destination.complete();
|
27786 | }
|
27787 | };
|
27788 | return ExpandSubscriber;
|
27789 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
27790 |
|
27791 |
|
27792 |
|
27793 |
|
27794 | }),
|
27795 |
|
27796 | (function(module, __webpack_exports__, __webpack_require__) {
|
27797 |
|
27798 | "use strict";
|
27799 | __webpack_require__.r(__webpack_exports__);
|
27800 | __webpack_require__.d(__webpack_exports__, "finalize", function() { return finalize; });
|
27801 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27802 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27803 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(156);
|
27804 |
|
27805 |
|
27806 |
|
27807 |
|
27808 | function finalize(callback) {
|
27809 | return function (source) { return source.lift(new FinallyOperator(callback)); };
|
27810 | }
|
27811 | var FinallyOperator = (function () {
|
27812 | function FinallyOperator(callback) {
|
27813 | this.callback = callback;
|
27814 | }
|
27815 | FinallyOperator.prototype.call = function (subscriber, source) {
|
27816 | return source.subscribe(new FinallySubscriber(subscriber, this.callback));
|
27817 | };
|
27818 | return FinallyOperator;
|
27819 | }());
|
27820 | var FinallySubscriber = (function (_super) {
|
27821 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FinallySubscriber, _super);
|
27822 | function FinallySubscriber(destination, callback) {
|
27823 | var _this = _super.call(this, destination) || this;
|
27824 | _this.add(new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"](callback));
|
27825 | return _this;
|
27826 | }
|
27827 | return FinallySubscriber;
|
27828 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27829 |
|
27830 |
|
27831 |
|
27832 | }),
|
27833 |
|
27834 | (function(module, __webpack_exports__, __webpack_require__) {
|
27835 |
|
27836 | "use strict";
|
27837 | __webpack_require__.r(__webpack_exports__);
|
27838 | __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
|
27839 | __webpack_require__.d(__webpack_exports__, "FindValueOperator", function() { return FindValueOperator; });
|
27840 | __webpack_require__.d(__webpack_exports__, "FindValueSubscriber", function() { return FindValueSubscriber; });
|
27841 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27842 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27843 |
|
27844 |
|
27845 |
|
27846 | function find(predicate, thisArg) {
|
27847 | if (typeof predicate !== 'function') {
|
27848 | throw new TypeError('predicate is not a function');
|
27849 | }
|
27850 | return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); };
|
27851 | }
|
27852 | var FindValueOperator = (function () {
|
27853 | function FindValueOperator(predicate, source, yieldIndex, thisArg) {
|
27854 | this.predicate = predicate;
|
27855 | this.source = source;
|
27856 | this.yieldIndex = yieldIndex;
|
27857 | this.thisArg = thisArg;
|
27858 | }
|
27859 | FindValueOperator.prototype.call = function (observer, source) {
|
27860 | return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
|
27861 | };
|
27862 | return FindValueOperator;
|
27863 | }());
|
27864 |
|
27865 | var FindValueSubscriber = (function (_super) {
|
27866 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FindValueSubscriber, _super);
|
27867 | function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {
|
27868 | var _this = _super.call(this, destination) || this;
|
27869 | _this.predicate = predicate;
|
27870 | _this.source = source;
|
27871 | _this.yieldIndex = yieldIndex;
|
27872 | _this.thisArg = thisArg;
|
27873 | _this.index = 0;
|
27874 | return _this;
|
27875 | }
|
27876 | FindValueSubscriber.prototype.notifyComplete = function (value) {
|
27877 | var destination = this.destination;
|
27878 | destination.next(value);
|
27879 | destination.complete();
|
27880 | this.unsubscribe();
|
27881 | };
|
27882 | FindValueSubscriber.prototype._next = function (value) {
|
27883 | var _a = this, predicate = _a.predicate, thisArg = _a.thisArg;
|
27884 | var index = this.index++;
|
27885 | try {
|
27886 | var result = predicate.call(thisArg || this, value, index, this.source);
|
27887 | if (result) {
|
27888 | this.notifyComplete(this.yieldIndex ? index : value);
|
27889 | }
|
27890 | }
|
27891 | catch (err) {
|
27892 | this.destination.error(err);
|
27893 | }
|
27894 | };
|
27895 | FindValueSubscriber.prototype._complete = function () {
|
27896 | this.notifyComplete(this.yieldIndex ? -1 : undefined);
|
27897 | };
|
27898 | return FindValueSubscriber;
|
27899 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27900 |
|
27901 |
|
27902 |
|
27903 |
|
27904 | }),
|
27905 |
|
27906 | (function(module, __webpack_exports__, __webpack_require__) {
|
27907 |
|
27908 | "use strict";
|
27909 | __webpack_require__.r(__webpack_exports__);
|
27910 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; });
|
27911 | var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(284);
|
27912 |
|
27913 |
|
27914 | function findIndex(predicate, thisArg) {
|
27915 | return function (source) { return source.lift(new _operators_find__WEBPACK_IMPORTED_MODULE_0__["FindValueOperator"](predicate, source, true, thisArg)); };
|
27916 | }
|
27917 |
|
27918 |
|
27919 |
|
27920 | }),
|
27921 |
|
27922 | (function(module, __webpack_exports__, __webpack_require__) {
|
27923 |
|
27924 | "use strict";
|
27925 | __webpack_require__.r(__webpack_exports__);
|
27926 | __webpack_require__.d(__webpack_exports__, "first", function() { return first; });
|
27927 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(202);
|
27928 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(243);
|
27929 | var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(277);
|
27930 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(267);
|
27931 | var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(276);
|
27932 | var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(199);
|
27933 |
|
27934 |
|
27935 |
|
27936 |
|
27937 |
|
27938 |
|
27939 |
|
27940 | function first(predicate, defaultValue) {
|
27941 | var hasDefaultValue = arguments.length >= 2;
|
27942 | return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_take__WEBPACK_IMPORTED_MODULE_2__["take"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); };
|
27943 | }
|
27944 |
|
27945 |
|
27946 |
|
27947 | }),
|
27948 |
|
27949 | (function(module, __webpack_exports__, __webpack_require__) {
|
27950 |
|
27951 | "use strict";
|
27952 | __webpack_require__.r(__webpack_exports__);
|
27953 | __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return ignoreElements; });
|
27954 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27955 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27956 |
|
27957 |
|
27958 |
|
27959 | function ignoreElements() {
|
27960 | return function ignoreElementsOperatorFunction(source) {
|
27961 | return source.lift(new IgnoreElementsOperator());
|
27962 | };
|
27963 | }
|
27964 | var IgnoreElementsOperator = (function () {
|
27965 | function IgnoreElementsOperator() {
|
27966 | }
|
27967 | IgnoreElementsOperator.prototype.call = function (subscriber, source) {
|
27968 | return source.subscribe(new IgnoreElementsSubscriber(subscriber));
|
27969 | };
|
27970 | return IgnoreElementsOperator;
|
27971 | }());
|
27972 | var IgnoreElementsSubscriber = (function (_super) {
|
27973 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IgnoreElementsSubscriber, _super);
|
27974 | function IgnoreElementsSubscriber() {
|
27975 | return _super !== null && _super.apply(this, arguments) || this;
|
27976 | }
|
27977 | IgnoreElementsSubscriber.prototype._next = function (unused) {
|
27978 | };
|
27979 | return IgnoreElementsSubscriber;
|
27980 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
27981 |
|
27982 |
|
27983 |
|
27984 | }),
|
27985 |
|
27986 | (function(module, __webpack_exports__, __webpack_require__) {
|
27987 |
|
27988 | "use strict";
|
27989 | __webpack_require__.r(__webpack_exports__);
|
27990 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; });
|
27991 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
27992 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
27993 |
|
27994 |
|
27995 |
|
27996 | function isEmpty() {
|
27997 | return function (source) { return source.lift(new IsEmptyOperator()); };
|
27998 | }
|
27999 | var IsEmptyOperator = (function () {
|
28000 | function IsEmptyOperator() {
|
28001 | }
|
28002 | IsEmptyOperator.prototype.call = function (observer, source) {
|
28003 | return source.subscribe(new IsEmptySubscriber(observer));
|
28004 | };
|
28005 | return IsEmptyOperator;
|
28006 | }());
|
28007 | var IsEmptySubscriber = (function (_super) {
|
28008 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IsEmptySubscriber, _super);
|
28009 | function IsEmptySubscriber(destination) {
|
28010 | return _super.call(this, destination) || this;
|
28011 | }
|
28012 | IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {
|
28013 | var destination = this.destination;
|
28014 | destination.next(isEmpty);
|
28015 | destination.complete();
|
28016 | };
|
28017 | IsEmptySubscriber.prototype._next = function (value) {
|
28018 | this.notifyComplete(false);
|
28019 | };
|
28020 | IsEmptySubscriber.prototype._complete = function () {
|
28021 | this.notifyComplete(true);
|
28022 | };
|
28023 | return IsEmptySubscriber;
|
28024 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28025 |
|
28026 |
|
28027 |
|
28028 | }),
|
28029 |
|
28030 | (function(module, __webpack_exports__, __webpack_require__) {
|
28031 |
|
28032 | "use strict";
|
28033 | __webpack_require__.r(__webpack_exports__);
|
28034 | __webpack_require__.d(__webpack_exports__, "last", function() { return last; });
|
28035 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(202);
|
28036 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(243);
|
28037 | var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(290);
|
28038 | var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(276);
|
28039 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(267);
|
28040 | var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(199);
|
28041 |
|
28042 |
|
28043 |
|
28044 |
|
28045 |
|
28046 |
|
28047 |
|
28048 | function last(predicate, defaultValue) {
|
28049 | var hasDefaultValue = arguments.length >= 2;
|
28050 | return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_takeLast__WEBPACK_IMPORTED_MODULE_2__["takeLast"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); };
|
28051 | }
|
28052 |
|
28053 |
|
28054 |
|
28055 | }),
|
28056 |
|
28057 | (function(module, __webpack_exports__, __webpack_require__) {
|
28058 |
|
28059 | "use strict";
|
28060 | __webpack_require__.r(__webpack_exports__);
|
28061 | __webpack_require__.d(__webpack_exports__, "takeLast", function() { return takeLast; });
|
28062 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28063 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
28064 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201);
|
28065 | var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(182);
|
28066 |
|
28067 |
|
28068 |
|
28069 |
|
28070 |
|
28071 | function takeLast(count) {
|
28072 | return function takeLastOperatorFunction(source) {
|
28073 | if (count === 0) {
|
28074 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])();
|
28075 | }
|
28076 | else {
|
28077 | return source.lift(new TakeLastOperator(count));
|
28078 | }
|
28079 | };
|
28080 | }
|
28081 | var TakeLastOperator = (function () {
|
28082 | function TakeLastOperator(total) {
|
28083 | this.total = total;
|
28084 | if (this.total < 0) {
|
28085 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
|
28086 | }
|
28087 | }
|
28088 | TakeLastOperator.prototype.call = function (subscriber, source) {
|
28089 | return source.subscribe(new TakeLastSubscriber(subscriber, this.total));
|
28090 | };
|
28091 | return TakeLastOperator;
|
28092 | }());
|
28093 | var TakeLastSubscriber = (function (_super) {
|
28094 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeLastSubscriber, _super);
|
28095 | function TakeLastSubscriber(destination, total) {
|
28096 | var _this = _super.call(this, destination) || this;
|
28097 | _this.total = total;
|
28098 | _this.ring = new Array();
|
28099 | _this.count = 0;
|
28100 | return _this;
|
28101 | }
|
28102 | TakeLastSubscriber.prototype._next = function (value) {
|
28103 | var ring = this.ring;
|
28104 | var total = this.total;
|
28105 | var count = this.count++;
|
28106 | if (ring.length < total) {
|
28107 | ring.push(value);
|
28108 | }
|
28109 | else {
|
28110 | var index = count % total;
|
28111 | ring[index] = value;
|
28112 | }
|
28113 | };
|
28114 | TakeLastSubscriber.prototype._complete = function () {
|
28115 | var destination = this.destination;
|
28116 | var count = this.count;
|
28117 | if (count > 0) {
|
28118 | var total = this.count >= this.total ? this.total : this.count;
|
28119 | var ring = this.ring;
|
28120 | for (var i = 0; i < total; i++) {
|
28121 | var idx = (count++) % total;
|
28122 | destination.next(ring[idx]);
|
28123 | }
|
28124 | }
|
28125 | destination.complete();
|
28126 | };
|
28127 | return TakeLastSubscriber;
|
28128 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28129 |
|
28130 |
|
28131 |
|
28132 | }),
|
28133 |
|
28134 | (function(module, __webpack_exports__, __webpack_require__) {
|
28135 |
|
28136 | "use strict";
|
28137 | __webpack_require__.r(__webpack_exports__);
|
28138 | __webpack_require__.d(__webpack_exports__, "mapTo", function() { return mapTo; });
|
28139 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28140 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
28141 |
|
28142 |
|
28143 |
|
28144 | function mapTo(value) {
|
28145 | return function (source) { return source.lift(new MapToOperator(value)); };
|
28146 | }
|
28147 | var MapToOperator = (function () {
|
28148 | function MapToOperator(value) {
|
28149 | this.value = value;
|
28150 | }
|
28151 | MapToOperator.prototype.call = function (subscriber, source) {
|
28152 | return source.subscribe(new MapToSubscriber(subscriber, this.value));
|
28153 | };
|
28154 | return MapToOperator;
|
28155 | }());
|
28156 | var MapToSubscriber = (function (_super) {
|
28157 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapToSubscriber, _super);
|
28158 | function MapToSubscriber(destination, value) {
|
28159 | var _this = _super.call(this, destination) || this;
|
28160 | _this.value = value;
|
28161 | return _this;
|
28162 | }
|
28163 | MapToSubscriber.prototype._next = function (x) {
|
28164 | this.destination.next(this.value);
|
28165 | };
|
28166 | return MapToSubscriber;
|
28167 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28168 |
|
28169 |
|
28170 |
|
28171 | }),
|
28172 |
|
28173 | (function(module, __webpack_exports__, __webpack_require__) {
|
28174 |
|
28175 | "use strict";
|
28176 | __webpack_require__.r(__webpack_exports__);
|
28177 | __webpack_require__.d(__webpack_exports__, "materialize", function() { return materialize; });
|
28178 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28179 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
28180 | var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(181);
|
28181 |
|
28182 |
|
28183 |
|
28184 |
|
28185 | function materialize() {
|
28186 | return function materializeOperatorFunction(source) {
|
28187 | return source.lift(new MaterializeOperator());
|
28188 | };
|
28189 | }
|
28190 | var MaterializeOperator = (function () {
|
28191 | function MaterializeOperator() {
|
28192 | }
|
28193 | MaterializeOperator.prototype.call = function (subscriber, source) {
|
28194 | return source.subscribe(new MaterializeSubscriber(subscriber));
|
28195 | };
|
28196 | return MaterializeOperator;
|
28197 | }());
|
28198 | var MaterializeSubscriber = (function (_super) {
|
28199 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MaterializeSubscriber, _super);
|
28200 | function MaterializeSubscriber(destination) {
|
28201 | return _super.call(this, destination) || this;
|
28202 | }
|
28203 | MaterializeSubscriber.prototype._next = function (value) {
|
28204 | this.destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value));
|
28205 | };
|
28206 | MaterializeSubscriber.prototype._error = function (err) {
|
28207 | var destination = this.destination;
|
28208 | destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err));
|
28209 | destination.complete();
|
28210 | };
|
28211 | MaterializeSubscriber.prototype._complete = function () {
|
28212 | var destination = this.destination;
|
28213 | destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete());
|
28214 | destination.complete();
|
28215 | };
|
28216 | return MaterializeSubscriber;
|
28217 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28218 |
|
28219 |
|
28220 |
|
28221 | }),
|
28222 |
|
28223 | (function(module, __webpack_exports__, __webpack_require__) {
|
28224 |
|
28225 | "use strict";
|
28226 | __webpack_require__.r(__webpack_exports__);
|
28227 | __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
|
28228 | var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(294);
|
28229 |
|
28230 |
|
28231 | function max(comparer) {
|
28232 | var max = (typeof comparer === 'function')
|
28233 | ? function (x, y) { return comparer(x, y) > 0 ? x : y; }
|
28234 | : function (x, y) { return x > y ? x : y; };
|
28235 | return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(max);
|
28236 | }
|
28237 |
|
28238 |
|
28239 |
|
28240 | }),
|
28241 |
|
28242 | (function(module, __webpack_exports__, __webpack_require__) {
|
28243 |
|
28244 | "use strict";
|
28245 | __webpack_require__.r(__webpack_exports__);
|
28246 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; });
|
28247 | var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(295);
|
28248 | var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(290);
|
28249 | var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(267);
|
28250 | var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(163);
|
28251 |
|
28252 |
|
28253 |
|
28254 |
|
28255 |
|
28256 | function reduce(accumulator, seed) {
|
28257 | if (arguments.length >= 2) {
|
28258 | return function reduceOperatorFunctionWithSeed(source) {
|
28259 | return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(accumulator, seed), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1), Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__["defaultIfEmpty"])(seed))(source);
|
28260 | };
|
28261 | }
|
28262 | return function reduceOperatorFunction(source) {
|
28263 | return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(function (acc, value, index) { return accumulator(acc, value, index + 1); }), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1))(source);
|
28264 | };
|
28265 | }
|
28266 |
|
28267 |
|
28268 |
|
28269 | }),
|
28270 |
|
28271 | (function(module, __webpack_exports__, __webpack_require__) {
|
28272 |
|
28273 | "use strict";
|
28274 | __webpack_require__.r(__webpack_exports__);
|
28275 | __webpack_require__.d(__webpack_exports__, "scan", function() { return scan; });
|
28276 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28277 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
28278 |
|
28279 |
|
28280 |
|
28281 | function scan(accumulator, seed) {
|
28282 | var hasSeed = false;
|
28283 | if (arguments.length >= 2) {
|
28284 | hasSeed = true;
|
28285 | }
|
28286 | return function scanOperatorFunction(source) {
|
28287 | return source.lift(new ScanOperator(accumulator, seed, hasSeed));
|
28288 | };
|
28289 | }
|
28290 | var ScanOperator = (function () {
|
28291 | function ScanOperator(accumulator, seed, hasSeed) {
|
28292 | if (hasSeed === void 0) {
|
28293 | hasSeed = false;
|
28294 | }
|
28295 | this.accumulator = accumulator;
|
28296 | this.seed = seed;
|
28297 | this.hasSeed = hasSeed;
|
28298 | }
|
28299 | ScanOperator.prototype.call = function (subscriber, source) {
|
28300 | return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
|
28301 | };
|
28302 | return ScanOperator;
|
28303 | }());
|
28304 | var ScanSubscriber = (function (_super) {
|
28305 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ScanSubscriber, _super);
|
28306 | function ScanSubscriber(destination, accumulator, _seed, hasSeed) {
|
28307 | var _this = _super.call(this, destination) || this;
|
28308 | _this.accumulator = accumulator;
|
28309 | _this._seed = _seed;
|
28310 | _this.hasSeed = hasSeed;
|
28311 | _this.index = 0;
|
28312 | return _this;
|
28313 | }
|
28314 | Object.defineProperty(ScanSubscriber.prototype, "seed", {
|
28315 | get: function () {
|
28316 | return this._seed;
|
28317 | },
|
28318 | set: function (value) {
|
28319 | this.hasSeed = true;
|
28320 | this._seed = value;
|
28321 | },
|
28322 | enumerable: true,
|
28323 | configurable: true
|
28324 | });
|
28325 | ScanSubscriber.prototype._next = function (value) {
|
28326 | if (!this.hasSeed) {
|
28327 | this.seed = value;
|
28328 | this.destination.next(value);
|
28329 | }
|
28330 | else {
|
28331 | return this._tryNext(value);
|
28332 | }
|
28333 | };
|
28334 | ScanSubscriber.prototype._tryNext = function (value) {
|
28335 | var index = this.index++;
|
28336 | var result;
|
28337 | try {
|
28338 | result = this.accumulator(this.seed, value, index);
|
28339 | }
|
28340 | catch (err) {
|
28341 | this.destination.error(err);
|
28342 | }
|
28343 | this.seed = result;
|
28344 | this.destination.next(result);
|
28345 | };
|
28346 | return ScanSubscriber;
|
28347 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28348 |
|
28349 |
|
28350 |
|
28351 | }),
|
28352 |
|
28353 | (function(module, __webpack_exports__, __webpack_require__) {
|
28354 |
|
28355 | "use strict";
|
28356 | __webpack_require__.r(__webpack_exports__);
|
28357 | __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
|
28358 | var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(237);
|
28359 |
|
28360 |
|
28361 | function merge() {
|
28362 | var observables = [];
|
28363 | for (var _i = 0; _i < arguments.length; _i++) {
|
28364 | observables[_i] = arguments[_i];
|
28365 | }
|
28366 | return function (source) { return source.lift.call(_observable_merge__WEBPACK_IMPORTED_MODULE_0__["merge"].apply(void 0, [source].concat(observables))); };
|
28367 | }
|
28368 |
|
28369 |
|
28370 |
|
28371 | }),
|
28372 |
|
28373 | (function(module, __webpack_exports__, __webpack_require__) {
|
28374 |
|
28375 | "use strict";
|
28376 | __webpack_require__.r(__webpack_exports__);
|
28377 | __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return mergeMapTo; });
|
28378 | var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221);
|
28379 |
|
28380 |
|
28381 | function mergeMapTo(innerObservable, resultSelector, concurrent) {
|
28382 | if (concurrent === void 0) {
|
28383 | concurrent = Number.POSITIVE_INFINITY;
|
28384 | }
|
28385 | if (typeof resultSelector === 'function') {
|
28386 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, resultSelector, concurrent);
|
28387 | }
|
28388 | if (typeof resultSelector === 'number') {
|
28389 | concurrent = resultSelector;
|
28390 | }
|
28391 | return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, concurrent);
|
28392 | }
|
28393 |
|
28394 |
|
28395 |
|
28396 | }),
|
28397 |
|
28398 | (function(module, __webpack_exports__, __webpack_require__) {
|
28399 |
|
28400 | "use strict";
|
28401 | __webpack_require__.r(__webpack_exports__);
|
28402 | __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return mergeScan; });
|
28403 | __webpack_require__.d(__webpack_exports__, "MergeScanOperator", function() { return MergeScanOperator; });
|
28404 | __webpack_require__.d(__webpack_exports__, "MergeScanSubscriber", function() { return MergeScanSubscriber; });
|
28405 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28406 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(209);
|
28407 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208);
|
28408 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(210);
|
28409 |
|
28410 |
|
28411 |
|
28412 |
|
28413 |
|
28414 | function mergeScan(accumulator, seed, concurrent) {
|
28415 | if (concurrent === void 0) {
|
28416 | concurrent = Number.POSITIVE_INFINITY;
|
28417 | }
|
28418 | return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); };
|
28419 | }
|
28420 | var MergeScanOperator = (function () {
|
28421 | function MergeScanOperator(accumulator, seed, concurrent) {
|
28422 | this.accumulator = accumulator;
|
28423 | this.seed = seed;
|
28424 | this.concurrent = concurrent;
|
28425 | }
|
28426 | MergeScanOperator.prototype.call = function (subscriber, source) {
|
28427 | return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
|
28428 | };
|
28429 | return MergeScanOperator;
|
28430 | }());
|
28431 |
|
28432 | var MergeScanSubscriber = (function (_super) {
|
28433 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeScanSubscriber, _super);
|
28434 | function MergeScanSubscriber(destination, accumulator, acc, concurrent) {
|
28435 | var _this = _super.call(this, destination) || this;
|
28436 | _this.accumulator = accumulator;
|
28437 | _this.acc = acc;
|
28438 | _this.concurrent = concurrent;
|
28439 | _this.hasValue = false;
|
28440 | _this.hasCompleted = false;
|
28441 | _this.buffer = [];
|
28442 | _this.active = 0;
|
28443 | _this.index = 0;
|
28444 | return _this;
|
28445 | }
|
28446 | MergeScanSubscriber.prototype._next = function (value) {
|
28447 | if (this.active < this.concurrent) {
|
28448 | var index = this.index++;
|
28449 | var destination = this.destination;
|
28450 | var ish = void 0;
|
28451 | try {
|
28452 | var accumulator = this.accumulator;
|
28453 | ish = accumulator(this.acc, value, index);
|
28454 | }
|
28455 | catch (e) {
|
28456 | return destination.error(e);
|
28457 | }
|
28458 | this.active++;
|
28459 | this._innerSub(ish, value, index);
|
28460 | }
|
28461 | else {
|
28462 | this.buffer.push(value);
|
28463 | }
|
28464 | };
|
28465 | MergeScanSubscriber.prototype._innerSub = function (ish, value, index) {
|
28466 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_3__["InnerSubscriber"](this, undefined, undefined);
|
28467 | var destination = this.destination;
|
28468 | destination.add(innerSubscriber);
|
28469 | Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, ish, value, index, innerSubscriber);
|
28470 | };
|
28471 | MergeScanSubscriber.prototype._complete = function () {
|
28472 | this.hasCompleted = true;
|
28473 | if (this.active === 0 && this.buffer.length === 0) {
|
28474 | if (this.hasValue === false) {
|
28475 | this.destination.next(this.acc);
|
28476 | }
|
28477 | this.destination.complete();
|
28478 | }
|
28479 | this.unsubscribe();
|
28480 | };
|
28481 | MergeScanSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
28482 | var destination = this.destination;
|
28483 | this.acc = innerValue;
|
28484 | this.hasValue = true;
|
28485 | destination.next(innerValue);
|
28486 | };
|
28487 | MergeScanSubscriber.prototype.notifyComplete = function (innerSub) {
|
28488 | var buffer = this.buffer;
|
28489 | var destination = this.destination;
|
28490 | destination.remove(innerSub);
|
28491 | this.active--;
|
28492 | if (buffer.length > 0) {
|
28493 | this._next(buffer.shift());
|
28494 | }
|
28495 | else if (this.active === 0 && this.hasCompleted) {
|
28496 | if (this.hasValue === false) {
|
28497 | this.destination.next(this.acc);
|
28498 | }
|
28499 | this.destination.complete();
|
28500 | }
|
28501 | };
|
28502 | return MergeScanSubscriber;
|
28503 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
28504 |
|
28505 |
|
28506 |
|
28507 |
|
28508 | }),
|
28509 |
|
28510 | (function(module, __webpack_exports__, __webpack_require__) {
|
28511 |
|
28512 | "use strict";
|
28513 | __webpack_require__.r(__webpack_exports__);
|
28514 | __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
|
28515 | var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(294);
|
28516 |
|
28517 |
|
28518 | function min(comparer) {
|
28519 | var min = (typeof comparer === 'function')
|
28520 | ? function (x, y) { return comparer(x, y) < 0 ? x : y; }
|
28521 | : function (x, y) { return x < y ? x : y; };
|
28522 | return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(min);
|
28523 | }
|
28524 |
|
28525 |
|
28526 |
|
28527 | }),
|
28528 |
|
28529 | (function(module, __webpack_exports__, __webpack_require__) {
|
28530 |
|
28531 | "use strict";
|
28532 | __webpack_require__.r(__webpack_exports__);
|
28533 | __webpack_require__.d(__webpack_exports__, "multicast", function() { return multicast; });
|
28534 | __webpack_require__.d(__webpack_exports__, "MulticastOperator", function() { return MulticastOperator; });
|
28535 | var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(165);
|
28536 |
|
28537 |
|
28538 | function multicast(subjectOrSubjectFactory, selector) {
|
28539 | return function multicastOperatorFunction(source) {
|
28540 | var subjectFactory;
|
28541 | if (typeof subjectOrSubjectFactory === 'function') {
|
28542 | subjectFactory = subjectOrSubjectFactory;
|
28543 | }
|
28544 | else {
|
28545 | subjectFactory = function subjectFactory() {
|
28546 | return subjectOrSubjectFactory;
|
28547 | };
|
28548 | }
|
28549 | if (typeof selector === 'function') {
|
28550 | return source.lift(new MulticastOperator(subjectFactory, selector));
|
28551 | }
|
28552 | var connectable = Object.create(source, _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__["connectableObservableDescriptor"]);
|
28553 | connectable.source = source;
|
28554 | connectable.subjectFactory = subjectFactory;
|
28555 | return connectable;
|
28556 | };
|
28557 | }
|
28558 | var MulticastOperator = (function () {
|
28559 | function MulticastOperator(subjectFactory, selector) {
|
28560 | this.subjectFactory = subjectFactory;
|
28561 | this.selector = selector;
|
28562 | }
|
28563 | MulticastOperator.prototype.call = function (subscriber, source) {
|
28564 | var selector = this.selector;
|
28565 | var subject = this.subjectFactory();
|
28566 | var subscription = selector(subject).subscribe(subscriber);
|
28567 | subscription.add(source.subscribe(subject));
|
28568 | return subscription;
|
28569 | };
|
28570 | return MulticastOperator;
|
28571 | }());
|
28572 |
|
28573 |
|
28574 |
|
28575 |
|
28576 | }),
|
28577 |
|
28578 | (function(module, __webpack_exports__, __webpack_require__) {
|
28579 |
|
28580 | "use strict";
|
28581 | __webpack_require__.r(__webpack_exports__);
|
28582 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
|
28583 | __webpack_require__.d(__webpack_exports__, "onErrorResumeNextStatic", function() { return onErrorResumeNextStatic; });
|
28584 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28585 | var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(222);
|
28586 | var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(157);
|
28587 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208);
|
28588 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(210);
|
28589 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(209);
|
28590 |
|
28591 |
|
28592 |
|
28593 |
|
28594 |
|
28595 |
|
28596 |
|
28597 | function onErrorResumeNext() {
|
28598 | var nextSources = [];
|
28599 | for (var _i = 0; _i < arguments.length; _i++) {
|
28600 | nextSources[_i] = arguments[_i];
|
28601 | }
|
28602 | if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) {
|
28603 | nextSources = nextSources[0];
|
28604 | }
|
28605 | return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };
|
28606 | }
|
28607 | function onErrorResumeNextStatic() {
|
28608 | var nextSources = [];
|
28609 | for (var _i = 0; _i < arguments.length; _i++) {
|
28610 | nextSources[_i] = arguments[_i];
|
28611 | }
|
28612 | var source = null;
|
28613 | if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) {
|
28614 | nextSources = nextSources[0];
|
28615 | }
|
28616 | source = nextSources.shift();
|
28617 | return Object(_observable_from__WEBPACK_IMPORTED_MODULE_1__["from"])(source, null).lift(new OnErrorResumeNextOperator(nextSources));
|
28618 | }
|
28619 | var OnErrorResumeNextOperator = (function () {
|
28620 | function OnErrorResumeNextOperator(nextSources) {
|
28621 | this.nextSources = nextSources;
|
28622 | }
|
28623 | OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
|
28624 | return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
|
28625 | };
|
28626 | return OnErrorResumeNextOperator;
|
28627 | }());
|
28628 | var OnErrorResumeNextSubscriber = (function (_super) {
|
28629 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OnErrorResumeNextSubscriber, _super);
|
28630 | function OnErrorResumeNextSubscriber(destination, nextSources) {
|
28631 | var _this = _super.call(this, destination) || this;
|
28632 | _this.destination = destination;
|
28633 | _this.nextSources = nextSources;
|
28634 | return _this;
|
28635 | }
|
28636 | OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) {
|
28637 | this.subscribeToNextSource();
|
28638 | };
|
28639 | OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) {
|
28640 | this.subscribeToNextSource();
|
28641 | };
|
28642 | OnErrorResumeNextSubscriber.prototype._error = function (err) {
|
28643 | this.subscribeToNextSource();
|
28644 | this.unsubscribe();
|
28645 | };
|
28646 | OnErrorResumeNextSubscriber.prototype._complete = function () {
|
28647 | this.subscribeToNextSource();
|
28648 | this.unsubscribe();
|
28649 | };
|
28650 | OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
|
28651 | var next = this.nextSources.shift();
|
28652 | if (!!next) {
|
28653 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_4__["InnerSubscriber"](this, undefined, undefined);
|
28654 | var destination = this.destination;
|
28655 | destination.add(innerSubscriber);
|
28656 | Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, next, undefined, undefined, innerSubscriber);
|
28657 | }
|
28658 | else {
|
28659 | this.destination.complete();
|
28660 | }
|
28661 | };
|
28662 | return OnErrorResumeNextSubscriber;
|
28663 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
28664 |
|
28665 |
|
28666 |
|
28667 | }),
|
28668 |
|
28669 | (function(module, __webpack_exports__, __webpack_require__) {
|
28670 |
|
28671 | "use strict";
|
28672 | __webpack_require__.r(__webpack_exports__);
|
28673 | __webpack_require__.d(__webpack_exports__, "pairwise", function() { return pairwise; });
|
28674 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28675 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
28676 |
|
28677 |
|
28678 |
|
28679 | function pairwise() {
|
28680 | return function (source) { return source.lift(new PairwiseOperator()); };
|
28681 | }
|
28682 | var PairwiseOperator = (function () {
|
28683 | function PairwiseOperator() {
|
28684 | }
|
28685 | PairwiseOperator.prototype.call = function (subscriber, source) {
|
28686 | return source.subscribe(new PairwiseSubscriber(subscriber));
|
28687 | };
|
28688 | return PairwiseOperator;
|
28689 | }());
|
28690 | var PairwiseSubscriber = (function (_super) {
|
28691 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](PairwiseSubscriber, _super);
|
28692 | function PairwiseSubscriber(destination) {
|
28693 | var _this = _super.call(this, destination) || this;
|
28694 | _this.hasPrev = false;
|
28695 | return _this;
|
28696 | }
|
28697 | PairwiseSubscriber.prototype._next = function (value) {
|
28698 | var pair;
|
28699 | if (this.hasPrev) {
|
28700 | pair = [this.prev, value];
|
28701 | }
|
28702 | else {
|
28703 | this.hasPrev = true;
|
28704 | }
|
28705 | this.prev = value;
|
28706 | if (pair) {
|
28707 | this.destination.next(pair);
|
28708 | }
|
28709 | };
|
28710 | return PairwiseSubscriber;
|
28711 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28712 |
|
28713 |
|
28714 |
|
28715 | }),
|
28716 |
|
28717 | (function(module, __webpack_exports__, __webpack_require__) {
|
28718 |
|
28719 | "use strict";
|
28720 | __webpack_require__.r(__webpack_exports__);
|
28721 | __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; });
|
28722 | var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(242);
|
28723 | var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(243);
|
28724 |
|
28725 |
|
28726 |
|
28727 | function partition(predicate, thisArg) {
|
28728 | return function (source) {
|
28729 | return [
|
28730 | Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(predicate, thisArg)(source),
|
28731 | Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(source)
|
28732 | ];
|
28733 | };
|
28734 | }
|
28735 |
|
28736 |
|
28737 |
|
28738 | }),
|
28739 |
|
28740 | (function(module, __webpack_exports__, __webpack_require__) {
|
28741 |
|
28742 | "use strict";
|
28743 | __webpack_require__.r(__webpack_exports__);
|
28744 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return pluck; });
|
28745 | var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(205);
|
28746 |
|
28747 |
|
28748 | function pluck() {
|
28749 | var properties = [];
|
28750 | for (var _i = 0; _i < arguments.length; _i++) {
|
28751 | properties[_i] = arguments[_i];
|
28752 | }
|
28753 | var length = properties.length;
|
28754 | if (length === 0) {
|
28755 | throw new Error('list of properties cannot be empty.');
|
28756 | }
|
28757 | return function (source) { return Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])(plucker(properties, length))(source); };
|
28758 | }
|
28759 | function plucker(props, length) {
|
28760 | var mapper = function (x) {
|
28761 | var currentProp = x;
|
28762 | for (var i = 0; i < length; i++) {
|
28763 | var p = currentProp[props[i]];
|
28764 | if (typeof p !== 'undefined') {
|
28765 | currentProp = p;
|
28766 | }
|
28767 | else {
|
28768 | return undefined;
|
28769 | }
|
28770 | }
|
28771 | return currentProp;
|
28772 | };
|
28773 | return mapper;
|
28774 | }
|
28775 |
|
28776 |
|
28777 |
|
28778 | }),
|
28779 |
|
28780 | (function(module, __webpack_exports__, __webpack_require__) {
|
28781 |
|
28782 | "use strict";
|
28783 | __webpack_require__.r(__webpack_exports__);
|
28784 | __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; });
|
28785 | var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166);
|
28786 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(300);
|
28787 |
|
28788 |
|
28789 |
|
28790 | function publish(selector) {
|
28791 | return selector ?
|
28792 | Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); }, selector) :
|
28793 | Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]());
|
28794 | }
|
28795 |
|
28796 |
|
28797 |
|
28798 | }),
|
28799 |
|
28800 | (function(module, __webpack_exports__, __webpack_require__) {
|
28801 |
|
28802 | "use strict";
|
28803 | __webpack_require__.r(__webpack_exports__);
|
28804 | __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; });
|
28805 | var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(171);
|
28806 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(300);
|
28807 |
|
28808 |
|
28809 |
|
28810 | function publishBehavior(value) {
|
28811 | return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__["BehaviorSubject"](value))(source); };
|
28812 | }
|
28813 |
|
28814 |
|
28815 |
|
28816 | }),
|
28817 |
|
28818 | (function(module, __webpack_exports__, __webpack_require__) {
|
28819 |
|
28820 | "use strict";
|
28821 | __webpack_require__.r(__webpack_exports__);
|
28822 | __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; });
|
28823 | var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(189);
|
28824 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(300);
|
28825 |
|
28826 |
|
28827 |
|
28828 | function publishLast() {
|
28829 | return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__["AsyncSubject"]())(source); };
|
28830 | }
|
28831 |
|
28832 |
|
28833 |
|
28834 | }),
|
28835 |
|
28836 | (function(module, __webpack_exports__, __webpack_require__) {
|
28837 |
|
28838 | "use strict";
|
28839 | __webpack_require__.r(__webpack_exports__);
|
28840 | __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; });
|
28841 | var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(172);
|
28842 | var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(300);
|
28843 |
|
28844 |
|
28845 |
|
28846 | function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
|
28847 | if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
|
28848 | scheduler = selectorOrScheduler;
|
28849 | }
|
28850 | var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
|
28851 | var subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
|
28852 | return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return subject; }, selector)(source); };
|
28853 | }
|
28854 |
|
28855 |
|
28856 |
|
28857 | }),
|
28858 |
|
28859 | (function(module, __webpack_exports__, __webpack_require__) {
|
28860 |
|
28861 | "use strict";
|
28862 | __webpack_require__.r(__webpack_exports__);
|
28863 | __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
|
28864 | var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(157);
|
28865 | var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(244);
|
28866 |
|
28867 |
|
28868 |
|
28869 | function race() {
|
28870 | var observables = [];
|
28871 | for (var _i = 0; _i < arguments.length; _i++) {
|
28872 | observables[_i] = arguments[_i];
|
28873 | }
|
28874 | return function raceOperatorFunction(source) {
|
28875 | if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
|
28876 | observables = observables[0];
|
28877 | }
|
28878 | return source.lift.call(_observable_race__WEBPACK_IMPORTED_MODULE_1__["race"].apply(void 0, [source].concat(observables)));
|
28879 | };
|
28880 | }
|
28881 |
|
28882 |
|
28883 |
|
28884 | }),
|
28885 |
|
28886 | (function(module, __webpack_exports__, __webpack_require__) {
|
28887 |
|
28888 | "use strict";
|
28889 | __webpack_require__.r(__webpack_exports__);
|
28890 | __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; });
|
28891 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28892 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
28893 | var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(182);
|
28894 |
|
28895 |
|
28896 |
|
28897 |
|
28898 | function repeat(count) {
|
28899 | if (count === void 0) {
|
28900 | count = -1;
|
28901 | }
|
28902 | return function (source) {
|
28903 | if (count === 0) {
|
28904 | return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
|
28905 | }
|
28906 | else if (count < 0) {
|
28907 | return source.lift(new RepeatOperator(-1, source));
|
28908 | }
|
28909 | else {
|
28910 | return source.lift(new RepeatOperator(count - 1, source));
|
28911 | }
|
28912 | };
|
28913 | }
|
28914 | var RepeatOperator = (function () {
|
28915 | function RepeatOperator(count, source) {
|
28916 | this.count = count;
|
28917 | this.source = source;
|
28918 | }
|
28919 | RepeatOperator.prototype.call = function (subscriber, source) {
|
28920 | return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
|
28921 | };
|
28922 | return RepeatOperator;
|
28923 | }());
|
28924 | var RepeatSubscriber = (function (_super) {
|
28925 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatSubscriber, _super);
|
28926 | function RepeatSubscriber(destination, count, source) {
|
28927 | var _this = _super.call(this, destination) || this;
|
28928 | _this.count = count;
|
28929 | _this.source = source;
|
28930 | return _this;
|
28931 | }
|
28932 | RepeatSubscriber.prototype.complete = function () {
|
28933 | if (!this.isStopped) {
|
28934 | var _a = this, source = _a.source, count = _a.count;
|
28935 | if (count === 0) {
|
28936 | return _super.prototype.complete.call(this);
|
28937 | }
|
28938 | else if (count > -1) {
|
28939 | this.count = count - 1;
|
28940 | }
|
28941 | source.subscribe(this._unsubscribeAndRecycle());
|
28942 | }
|
28943 | };
|
28944 | return RepeatSubscriber;
|
28945 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
28946 |
|
28947 |
|
28948 |
|
28949 | }),
|
28950 |
|
28951 | (function(module, __webpack_exports__, __webpack_require__) {
|
28952 |
|
28953 | "use strict";
|
28954 | __webpack_require__.r(__webpack_exports__);
|
28955 | __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return repeatWhen; });
|
28956 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
28957 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
28958 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208);
|
28959 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
28960 |
|
28961 |
|
28962 |
|
28963 |
|
28964 |
|
28965 | function repeatWhen(notifier) {
|
28966 | return function (source) { return source.lift(new RepeatWhenOperator(notifier)); };
|
28967 | }
|
28968 | var RepeatWhenOperator = (function () {
|
28969 | function RepeatWhenOperator(notifier) {
|
28970 | this.notifier = notifier;
|
28971 | }
|
28972 | RepeatWhenOperator.prototype.call = function (subscriber, source) {
|
28973 | return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));
|
28974 | };
|
28975 | return RepeatWhenOperator;
|
28976 | }());
|
28977 | var RepeatWhenSubscriber = (function (_super) {
|
28978 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatWhenSubscriber, _super);
|
28979 | function RepeatWhenSubscriber(destination, notifier, source) {
|
28980 | var _this = _super.call(this, destination) || this;
|
28981 | _this.notifier = notifier;
|
28982 | _this.source = source;
|
28983 | _this.sourceIsBeingSubscribedTo = true;
|
28984 | return _this;
|
28985 | }
|
28986 | RepeatWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
28987 | this.sourceIsBeingSubscribedTo = true;
|
28988 | this.source.subscribe(this);
|
28989 | };
|
28990 | RepeatWhenSubscriber.prototype.notifyComplete = function (innerSub) {
|
28991 | if (this.sourceIsBeingSubscribedTo === false) {
|
28992 | return _super.prototype.complete.call(this);
|
28993 | }
|
28994 | };
|
28995 | RepeatWhenSubscriber.prototype.complete = function () {
|
28996 | this.sourceIsBeingSubscribedTo = false;
|
28997 | if (!this.isStopped) {
|
28998 | if (!this.retries) {
|
28999 | this.subscribeToRetries();
|
29000 | }
|
29001 | if (!this.retriesSubscription || this.retriesSubscription.closed) {
|
29002 | return _super.prototype.complete.call(this);
|
29003 | }
|
29004 | this._unsubscribeAndRecycle();
|
29005 | this.notifications.next();
|
29006 | }
|
29007 | };
|
29008 | RepeatWhenSubscriber.prototype._unsubscribe = function () {
|
29009 | var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription;
|
29010 | if (notifications) {
|
29011 | notifications.unsubscribe();
|
29012 | this.notifications = null;
|
29013 | }
|
29014 | if (retriesSubscription) {
|
29015 | retriesSubscription.unsubscribe();
|
29016 | this.retriesSubscription = null;
|
29017 | }
|
29018 | this.retries = null;
|
29019 | };
|
29020 | RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () {
|
29021 | var _unsubscribe = this._unsubscribe;
|
29022 | this._unsubscribe = null;
|
29023 | _super.prototype._unsubscribeAndRecycle.call(this);
|
29024 | this._unsubscribe = _unsubscribe;
|
29025 | return this;
|
29026 | };
|
29027 | RepeatWhenSubscriber.prototype.subscribeToRetries = function () {
|
29028 | this.notifications = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
29029 | var retries;
|
29030 | try {
|
29031 | var notifier = this.notifier;
|
29032 | retries = notifier(this.notifications);
|
29033 | }
|
29034 | catch (e) {
|
29035 | return _super.prototype.complete.call(this);
|
29036 | }
|
29037 | this.retries = retries;
|
29038 | this.retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, retries);
|
29039 | };
|
29040 | return RepeatWhenSubscriber;
|
29041 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
29042 |
|
29043 |
|
29044 |
|
29045 | }),
|
29046 |
|
29047 | (function(module, __webpack_exports__, __webpack_require__) {
|
29048 |
|
29049 | "use strict";
|
29050 | __webpack_require__.r(__webpack_exports__);
|
29051 | __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; });
|
29052 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29053 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
29054 |
|
29055 |
|
29056 |
|
29057 | function retry(count) {
|
29058 | if (count === void 0) {
|
29059 | count = -1;
|
29060 | }
|
29061 | return function (source) { return source.lift(new RetryOperator(count, source)); };
|
29062 | }
|
29063 | var RetryOperator = (function () {
|
29064 | function RetryOperator(count, source) {
|
29065 | this.count = count;
|
29066 | this.source = source;
|
29067 | }
|
29068 | RetryOperator.prototype.call = function (subscriber, source) {
|
29069 | return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
|
29070 | };
|
29071 | return RetryOperator;
|
29072 | }());
|
29073 | var RetrySubscriber = (function (_super) {
|
29074 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetrySubscriber, _super);
|
29075 | function RetrySubscriber(destination, count, source) {
|
29076 | var _this = _super.call(this, destination) || this;
|
29077 | _this.count = count;
|
29078 | _this.source = source;
|
29079 | return _this;
|
29080 | }
|
29081 | RetrySubscriber.prototype.error = function (err) {
|
29082 | if (!this.isStopped) {
|
29083 | var _a = this, source = _a.source, count = _a.count;
|
29084 | if (count === 0) {
|
29085 | return _super.prototype.error.call(this, err);
|
29086 | }
|
29087 | else if (count > -1) {
|
29088 | this.count = count - 1;
|
29089 | }
|
29090 | source.subscribe(this._unsubscribeAndRecycle());
|
29091 | }
|
29092 | };
|
29093 | return RetrySubscriber;
|
29094 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29095 |
|
29096 |
|
29097 |
|
29098 | }),
|
29099 |
|
29100 | (function(module, __webpack_exports__, __webpack_require__) {
|
29101 |
|
29102 | "use strict";
|
29103 | __webpack_require__.r(__webpack_exports__);
|
29104 | __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return retryWhen; });
|
29105 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29106 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
29107 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208);
|
29108 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
29109 |
|
29110 |
|
29111 |
|
29112 |
|
29113 |
|
29114 | function retryWhen(notifier) {
|
29115 | return function (source) { return source.lift(new RetryWhenOperator(notifier, source)); };
|
29116 | }
|
29117 | var RetryWhenOperator = (function () {
|
29118 | function RetryWhenOperator(notifier, source) {
|
29119 | this.notifier = notifier;
|
29120 | this.source = source;
|
29121 | }
|
29122 | RetryWhenOperator.prototype.call = function (subscriber, source) {
|
29123 | return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));
|
29124 | };
|
29125 | return RetryWhenOperator;
|
29126 | }());
|
29127 | var RetryWhenSubscriber = (function (_super) {
|
29128 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetryWhenSubscriber, _super);
|
29129 | function RetryWhenSubscriber(destination, notifier, source) {
|
29130 | var _this = _super.call(this, destination) || this;
|
29131 | _this.notifier = notifier;
|
29132 | _this.source = source;
|
29133 | return _this;
|
29134 | }
|
29135 | RetryWhenSubscriber.prototype.error = function (err) {
|
29136 | if (!this.isStopped) {
|
29137 | var errors = this.errors;
|
29138 | var retries = this.retries;
|
29139 | var retriesSubscription = this.retriesSubscription;
|
29140 | if (!retries) {
|
29141 | errors = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
29142 | try {
|
29143 | var notifier = this.notifier;
|
29144 | retries = notifier(errors);
|
29145 | }
|
29146 | catch (e) {
|
29147 | return _super.prototype.error.call(this, e);
|
29148 | }
|
29149 | retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, retries);
|
29150 | }
|
29151 | else {
|
29152 | this.errors = null;
|
29153 | this.retriesSubscription = null;
|
29154 | }
|
29155 | this._unsubscribeAndRecycle();
|
29156 | this.errors = errors;
|
29157 | this.retries = retries;
|
29158 | this.retriesSubscription = retriesSubscription;
|
29159 | errors.next(err);
|
29160 | }
|
29161 | };
|
29162 | RetryWhenSubscriber.prototype._unsubscribe = function () {
|
29163 | var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription;
|
29164 | if (errors) {
|
29165 | errors.unsubscribe();
|
29166 | this.errors = null;
|
29167 | }
|
29168 | if (retriesSubscription) {
|
29169 | retriesSubscription.unsubscribe();
|
29170 | this.retriesSubscription = null;
|
29171 | }
|
29172 | this.retries = null;
|
29173 | };
|
29174 | RetryWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
29175 | var _unsubscribe = this._unsubscribe;
|
29176 | this._unsubscribe = null;
|
29177 | this._unsubscribeAndRecycle();
|
29178 | this._unsubscribe = _unsubscribe;
|
29179 | this.source.subscribe(this);
|
29180 | };
|
29181 | return RetryWhenSubscriber;
|
29182 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
29183 |
|
29184 |
|
29185 |
|
29186 | }),
|
29187 |
|
29188 | (function(module, __webpack_exports__, __webpack_require__) {
|
29189 |
|
29190 | "use strict";
|
29191 | __webpack_require__.r(__webpack_exports__);
|
29192 | __webpack_require__.d(__webpack_exports__, "sample", function() { return sample; });
|
29193 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29194 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
29195 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
29196 |
|
29197 |
|
29198 |
|
29199 |
|
29200 | function sample(notifier) {
|
29201 | return function (source) { return source.lift(new SampleOperator(notifier)); };
|
29202 | }
|
29203 | var SampleOperator = (function () {
|
29204 | function SampleOperator(notifier) {
|
29205 | this.notifier = notifier;
|
29206 | }
|
29207 | SampleOperator.prototype.call = function (subscriber, source) {
|
29208 | var sampleSubscriber = new SampleSubscriber(subscriber);
|
29209 | var subscription = source.subscribe(sampleSubscriber);
|
29210 | subscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(sampleSubscriber, this.notifier));
|
29211 | return subscription;
|
29212 | };
|
29213 | return SampleOperator;
|
29214 | }());
|
29215 | var SampleSubscriber = (function (_super) {
|
29216 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleSubscriber, _super);
|
29217 | function SampleSubscriber() {
|
29218 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
29219 | _this.hasValue = false;
|
29220 | return _this;
|
29221 | }
|
29222 | SampleSubscriber.prototype._next = function (value) {
|
29223 | this.value = value;
|
29224 | this.hasValue = true;
|
29225 | };
|
29226 | SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
29227 | this.emitValue();
|
29228 | };
|
29229 | SampleSubscriber.prototype.notifyComplete = function () {
|
29230 | this.emitValue();
|
29231 | };
|
29232 | SampleSubscriber.prototype.emitValue = function () {
|
29233 | if (this.hasValue) {
|
29234 | this.hasValue = false;
|
29235 | this.destination.next(this.value);
|
29236 | }
|
29237 | };
|
29238 | return SampleSubscriber;
|
29239 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
29240 |
|
29241 |
|
29242 |
|
29243 | }),
|
29244 |
|
29245 | (function(module, __webpack_exports__, __webpack_require__) {
|
29246 |
|
29247 | "use strict";
|
29248 | __webpack_require__.r(__webpack_exports__);
|
29249 | __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return sampleTime; });
|
29250 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29251 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
29252 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194);
|
29253 |
|
29254 |
|
29255 |
|
29256 |
|
29257 | function sampleTime(period, scheduler) {
|
29258 | if (scheduler === void 0) {
|
29259 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
29260 | }
|
29261 | return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); };
|
29262 | }
|
29263 | var SampleTimeOperator = (function () {
|
29264 | function SampleTimeOperator(period, scheduler) {
|
29265 | this.period = period;
|
29266 | this.scheduler = scheduler;
|
29267 | }
|
29268 | SampleTimeOperator.prototype.call = function (subscriber, source) {
|
29269 | return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
|
29270 | };
|
29271 | return SampleTimeOperator;
|
29272 | }());
|
29273 | var SampleTimeSubscriber = (function (_super) {
|
29274 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleTimeSubscriber, _super);
|
29275 | function SampleTimeSubscriber(destination, period, scheduler) {
|
29276 | var _this = _super.call(this, destination) || this;
|
29277 | _this.period = period;
|
29278 | _this.scheduler = scheduler;
|
29279 | _this.hasValue = false;
|
29280 | _this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period }));
|
29281 | return _this;
|
29282 | }
|
29283 | SampleTimeSubscriber.prototype._next = function (value) {
|
29284 | this.lastValue = value;
|
29285 | this.hasValue = true;
|
29286 | };
|
29287 | SampleTimeSubscriber.prototype.notifyNext = function () {
|
29288 | if (this.hasValue) {
|
29289 | this.hasValue = false;
|
29290 | this.destination.next(this.lastValue);
|
29291 | }
|
29292 | };
|
29293 | return SampleTimeSubscriber;
|
29294 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29295 | function dispatchNotification(state) {
|
29296 | var subscriber = state.subscriber, period = state.period;
|
29297 | subscriber.notifyNext();
|
29298 | this.schedule(state, period);
|
29299 | }
|
29300 |
|
29301 |
|
29302 |
|
29303 | }),
|
29304 |
|
29305 | (function(module, __webpack_exports__, __webpack_require__) {
|
29306 |
|
29307 | "use strict";
|
29308 | __webpack_require__.r(__webpack_exports__);
|
29309 | __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return sequenceEqual; });
|
29310 | __webpack_require__.d(__webpack_exports__, "SequenceEqualOperator", function() { return SequenceEqualOperator; });
|
29311 | __webpack_require__.d(__webpack_exports__, "SequenceEqualSubscriber", function() { return SequenceEqualSubscriber; });
|
29312 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29313 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
29314 |
|
29315 |
|
29316 |
|
29317 | function sequenceEqual(compareTo, comparator) {
|
29318 | return function (source) { return source.lift(new SequenceEqualOperator(compareTo, comparator)); };
|
29319 | }
|
29320 | var SequenceEqualOperator = (function () {
|
29321 | function SequenceEqualOperator(compareTo, comparator) {
|
29322 | this.compareTo = compareTo;
|
29323 | this.comparator = comparator;
|
29324 | }
|
29325 | SequenceEqualOperator.prototype.call = function (subscriber, source) {
|
29326 | return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparator));
|
29327 | };
|
29328 | return SequenceEqualOperator;
|
29329 | }());
|
29330 |
|
29331 | var SequenceEqualSubscriber = (function (_super) {
|
29332 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualSubscriber, _super);
|
29333 | function SequenceEqualSubscriber(destination, compareTo, comparator) {
|
29334 | var _this = _super.call(this, destination) || this;
|
29335 | _this.compareTo = compareTo;
|
29336 | _this.comparator = comparator;
|
29337 | _this._a = [];
|
29338 | _this._b = [];
|
29339 | _this._oneComplete = false;
|
29340 | _this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, _this)));
|
29341 | return _this;
|
29342 | }
|
29343 | SequenceEqualSubscriber.prototype._next = function (value) {
|
29344 | if (this._oneComplete && this._b.length === 0) {
|
29345 | this.emit(false);
|
29346 | }
|
29347 | else {
|
29348 | this._a.push(value);
|
29349 | this.checkValues();
|
29350 | }
|
29351 | };
|
29352 | SequenceEqualSubscriber.prototype._complete = function () {
|
29353 | if (this._oneComplete) {
|
29354 | this.emit(this._a.length === 0 && this._b.length === 0);
|
29355 | }
|
29356 | else {
|
29357 | this._oneComplete = true;
|
29358 | }
|
29359 | this.unsubscribe();
|
29360 | };
|
29361 | SequenceEqualSubscriber.prototype.checkValues = function () {
|
29362 | var _c = this, _a = _c._a, _b = _c._b, comparator = _c.comparator;
|
29363 | while (_a.length > 0 && _b.length > 0) {
|
29364 | var a = _a.shift();
|
29365 | var b = _b.shift();
|
29366 | var areEqual = false;
|
29367 | try {
|
29368 | areEqual = comparator ? comparator(a, b) : a === b;
|
29369 | }
|
29370 | catch (e) {
|
29371 | this.destination.error(e);
|
29372 | }
|
29373 | if (!areEqual) {
|
29374 | this.emit(false);
|
29375 | }
|
29376 | }
|
29377 | };
|
29378 | SequenceEqualSubscriber.prototype.emit = function (value) {
|
29379 | var destination = this.destination;
|
29380 | destination.next(value);
|
29381 | destination.complete();
|
29382 | };
|
29383 | SequenceEqualSubscriber.prototype.nextB = function (value) {
|
29384 | if (this._oneComplete && this._a.length === 0) {
|
29385 | this.emit(false);
|
29386 | }
|
29387 | else {
|
29388 | this._b.push(value);
|
29389 | this.checkValues();
|
29390 | }
|
29391 | };
|
29392 | SequenceEqualSubscriber.prototype.completeB = function () {
|
29393 | if (this._oneComplete) {
|
29394 | this.emit(this._a.length === 0 && this._b.length === 0);
|
29395 | }
|
29396 | else {
|
29397 | this._oneComplete = true;
|
29398 | }
|
29399 | };
|
29400 | return SequenceEqualSubscriber;
|
29401 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29402 |
|
29403 | var SequenceEqualCompareToSubscriber = (function (_super) {
|
29404 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualCompareToSubscriber, _super);
|
29405 | function SequenceEqualCompareToSubscriber(destination, parent) {
|
29406 | var _this = _super.call(this, destination) || this;
|
29407 | _this.parent = parent;
|
29408 | return _this;
|
29409 | }
|
29410 | SequenceEqualCompareToSubscriber.prototype._next = function (value) {
|
29411 | this.parent.nextB(value);
|
29412 | };
|
29413 | SequenceEqualCompareToSubscriber.prototype._error = function (err) {
|
29414 | this.parent.error(err);
|
29415 | this.unsubscribe();
|
29416 | };
|
29417 | SequenceEqualCompareToSubscriber.prototype._complete = function () {
|
29418 | this.parent.completeB();
|
29419 | this.unsubscribe();
|
29420 | };
|
29421 | return SequenceEqualCompareToSubscriber;
|
29422 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29423 |
|
29424 |
|
29425 |
|
29426 | }),
|
29427 |
|
29428 | (function(module, __webpack_exports__, __webpack_require__) {
|
29429 |
|
29430 | "use strict";
|
29431 | __webpack_require__.r(__webpack_exports__);
|
29432 | __webpack_require__.d(__webpack_exports__, "share", function() { return share; });
|
29433 | var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(300);
|
29434 | var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(169);
|
29435 | var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(166);
|
29436 |
|
29437 |
|
29438 |
|
29439 |
|
29440 | function shareSubjectFactory() {
|
29441 | return new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
|
29442 | }
|
29443 | function share() {
|
29444 | return function (source) { return Object(_refCount__WEBPACK_IMPORTED_MODULE_1__["refCount"])()(Object(_multicast__WEBPACK_IMPORTED_MODULE_0__["multicast"])(shareSubjectFactory)(source)); };
|
29445 | }
|
29446 |
|
29447 |
|
29448 |
|
29449 | }),
|
29450 |
|
29451 | (function(module, __webpack_exports__, __webpack_require__) {
|
29452 |
|
29453 | "use strict";
|
29454 | __webpack_require__.r(__webpack_exports__);
|
29455 | __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return shareReplay; });
|
29456 | var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(172);
|
29457 |
|
29458 |
|
29459 | function shareReplay(configOrBufferSize, windowTime, scheduler) {
|
29460 | var config;
|
29461 | if (configOrBufferSize && typeof configOrBufferSize === 'object') {
|
29462 | config = configOrBufferSize;
|
29463 | }
|
29464 | else {
|
29465 | config = {
|
29466 | bufferSize: configOrBufferSize,
|
29467 | windowTime: windowTime,
|
29468 | refCount: false,
|
29469 | scheduler: scheduler
|
29470 | };
|
29471 | }
|
29472 | return function (source) { return source.lift(shareReplayOperator(config)); };
|
29473 | }
|
29474 | function shareReplayOperator(_a) {
|
29475 | var _b = _a.bufferSize, bufferSize = _b === void 0 ? Number.POSITIVE_INFINITY : _b, _c = _a.windowTime, windowTime = _c === void 0 ? Number.POSITIVE_INFINITY : _c, useRefCount = _a.refCount, scheduler = _a.scheduler;
|
29476 | var subject;
|
29477 | var refCount = 0;
|
29478 | var subscription;
|
29479 | var hasError = false;
|
29480 | var isComplete = false;
|
29481 | return function shareReplayOperation(source) {
|
29482 | refCount++;
|
29483 | if (!subject || hasError) {
|
29484 | hasError = false;
|
29485 | subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
|
29486 | subscription = source.subscribe({
|
29487 | next: function (value) { subject.next(value); },
|
29488 | error: function (err) {
|
29489 | hasError = true;
|
29490 | subject.error(err);
|
29491 | },
|
29492 | complete: function () {
|
29493 | isComplete = true;
|
29494 | subject.complete();
|
29495 | },
|
29496 | });
|
29497 | }
|
29498 | var innerSub = subject.subscribe(this);
|
29499 | this.add(function () {
|
29500 | refCount--;
|
29501 | innerSub.unsubscribe();
|
29502 | if (subscription && !isComplete && useRefCount && refCount === 0) {
|
29503 | subscription.unsubscribe();
|
29504 | subscription = undefined;
|
29505 | subject = undefined;
|
29506 | }
|
29507 | });
|
29508 | };
|
29509 | }
|
29510 |
|
29511 |
|
29512 |
|
29513 | }),
|
29514 |
|
29515 | (function(module, __webpack_exports__, __webpack_require__) {
|
29516 |
|
29517 | "use strict";
|
29518 | __webpack_require__.r(__webpack_exports__);
|
29519 | __webpack_require__.d(__webpack_exports__, "single", function() { return single; });
|
29520 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29521 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
29522 | var _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202);
|
29523 |
|
29524 |
|
29525 |
|
29526 |
|
29527 | function single(predicate) {
|
29528 | return function (source) { return source.lift(new SingleOperator(predicate, source)); };
|
29529 | }
|
29530 | var SingleOperator = (function () {
|
29531 | function SingleOperator(predicate, source) {
|
29532 | this.predicate = predicate;
|
29533 | this.source = source;
|
29534 | }
|
29535 | SingleOperator.prototype.call = function (subscriber, source) {
|
29536 | return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));
|
29537 | };
|
29538 | return SingleOperator;
|
29539 | }());
|
29540 | var SingleSubscriber = (function (_super) {
|
29541 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SingleSubscriber, _super);
|
29542 | function SingleSubscriber(destination, predicate, source) {
|
29543 | var _this = _super.call(this, destination) || this;
|
29544 | _this.predicate = predicate;
|
29545 | _this.source = source;
|
29546 | _this.seenValue = false;
|
29547 | _this.index = 0;
|
29548 | return _this;
|
29549 | }
|
29550 | SingleSubscriber.prototype.applySingleValue = function (value) {
|
29551 | if (this.seenValue) {
|
29552 | this.destination.error('Sequence contains more than one element');
|
29553 | }
|
29554 | else {
|
29555 | this.seenValue = true;
|
29556 | this.singleValue = value;
|
29557 | }
|
29558 | };
|
29559 | SingleSubscriber.prototype._next = function (value) {
|
29560 | var index = this.index++;
|
29561 | if (this.predicate) {
|
29562 | this.tryNext(value, index);
|
29563 | }
|
29564 | else {
|
29565 | this.applySingleValue(value);
|
29566 | }
|
29567 | };
|
29568 | SingleSubscriber.prototype.tryNext = function (value, index) {
|
29569 | try {
|
29570 | if (this.predicate(value, index, this.source)) {
|
29571 | this.applySingleValue(value);
|
29572 | }
|
29573 | }
|
29574 | catch (err) {
|
29575 | this.destination.error(err);
|
29576 | }
|
29577 | };
|
29578 | SingleSubscriber.prototype._complete = function () {
|
29579 | var destination = this.destination;
|
29580 | if (this.index > 0) {
|
29581 | destination.next(this.seenValue ? this.singleValue : undefined);
|
29582 | destination.complete();
|
29583 | }
|
29584 | else {
|
29585 | destination.error(new _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__["EmptyError"]);
|
29586 | }
|
29587 | };
|
29588 | return SingleSubscriber;
|
29589 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29590 |
|
29591 |
|
29592 |
|
29593 | }),
|
29594 |
|
29595 | (function(module, __webpack_exports__, __webpack_require__) {
|
29596 |
|
29597 | "use strict";
|
29598 | __webpack_require__.r(__webpack_exports__);
|
29599 | __webpack_require__.d(__webpack_exports__, "skip", function() { return skip; });
|
29600 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29601 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
29602 |
|
29603 |
|
29604 |
|
29605 | function skip(count) {
|
29606 | return function (source) { return source.lift(new SkipOperator(count)); };
|
29607 | }
|
29608 | var SkipOperator = (function () {
|
29609 | function SkipOperator(total) {
|
29610 | this.total = total;
|
29611 | }
|
29612 | SkipOperator.prototype.call = function (subscriber, source) {
|
29613 | return source.subscribe(new SkipSubscriber(subscriber, this.total));
|
29614 | };
|
29615 | return SkipOperator;
|
29616 | }());
|
29617 | var SkipSubscriber = (function (_super) {
|
29618 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipSubscriber, _super);
|
29619 | function SkipSubscriber(destination, total) {
|
29620 | var _this = _super.call(this, destination) || this;
|
29621 | _this.total = total;
|
29622 | _this.count = 0;
|
29623 | return _this;
|
29624 | }
|
29625 | SkipSubscriber.prototype._next = function (x) {
|
29626 | if (++this.count > this.total) {
|
29627 | this.destination.next(x);
|
29628 | }
|
29629 | };
|
29630 | return SkipSubscriber;
|
29631 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29632 |
|
29633 |
|
29634 |
|
29635 | }),
|
29636 |
|
29637 | (function(module, __webpack_exports__, __webpack_require__) {
|
29638 |
|
29639 | "use strict";
|
29640 | __webpack_require__.r(__webpack_exports__);
|
29641 | __webpack_require__.d(__webpack_exports__, "skipLast", function() { return skipLast; });
|
29642 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29643 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
29644 | var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201);
|
29645 |
|
29646 |
|
29647 |
|
29648 |
|
29649 | function skipLast(count) {
|
29650 | return function (source) { return source.lift(new SkipLastOperator(count)); };
|
29651 | }
|
29652 | var SkipLastOperator = (function () {
|
29653 | function SkipLastOperator(_skipCount) {
|
29654 | this._skipCount = _skipCount;
|
29655 | if (this._skipCount < 0) {
|
29656 | throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"];
|
29657 | }
|
29658 | }
|
29659 | SkipLastOperator.prototype.call = function (subscriber, source) {
|
29660 | if (this._skipCount === 0) {
|
29661 | return source.subscribe(new _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"](subscriber));
|
29662 | }
|
29663 | else {
|
29664 | return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
|
29665 | }
|
29666 | };
|
29667 | return SkipLastOperator;
|
29668 | }());
|
29669 | var SkipLastSubscriber = (function (_super) {
|
29670 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipLastSubscriber, _super);
|
29671 | function SkipLastSubscriber(destination, _skipCount) {
|
29672 | var _this = _super.call(this, destination) || this;
|
29673 | _this._skipCount = _skipCount;
|
29674 | _this._count = 0;
|
29675 | _this._ring = new Array(_skipCount);
|
29676 | return _this;
|
29677 | }
|
29678 | SkipLastSubscriber.prototype._next = function (value) {
|
29679 | var skipCount = this._skipCount;
|
29680 | var count = this._count++;
|
29681 | if (count < skipCount) {
|
29682 | this._ring[count] = value;
|
29683 | }
|
29684 | else {
|
29685 | var currentIndex = count % skipCount;
|
29686 | var ring = this._ring;
|
29687 | var oldValue = ring[currentIndex];
|
29688 | ring[currentIndex] = value;
|
29689 | this.destination.next(oldValue);
|
29690 | }
|
29691 | };
|
29692 | return SkipLastSubscriber;
|
29693 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29694 |
|
29695 |
|
29696 |
|
29697 | }),
|
29698 |
|
29699 | (function(module, __webpack_exports__, __webpack_require__) {
|
29700 |
|
29701 | "use strict";
|
29702 | __webpack_require__.r(__webpack_exports__);
|
29703 | __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return skipUntil; });
|
29704 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29705 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
29706 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210);
|
29707 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
29708 |
|
29709 |
|
29710 |
|
29711 |
|
29712 |
|
29713 | function skipUntil(notifier) {
|
29714 | return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
|
29715 | }
|
29716 | var SkipUntilOperator = (function () {
|
29717 | function SkipUntilOperator(notifier) {
|
29718 | this.notifier = notifier;
|
29719 | }
|
29720 | SkipUntilOperator.prototype.call = function (destination, source) {
|
29721 | return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
|
29722 | };
|
29723 | return SkipUntilOperator;
|
29724 | }());
|
29725 | var SkipUntilSubscriber = (function (_super) {
|
29726 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipUntilSubscriber, _super);
|
29727 | function SkipUntilSubscriber(destination, notifier) {
|
29728 | var _this = _super.call(this, destination) || this;
|
29729 | _this.hasValue = false;
|
29730 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](_this, undefined, undefined);
|
29731 | _this.add(innerSubscriber);
|
29732 | _this.innerSubscription = innerSubscriber;
|
29733 | Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(_this, notifier, undefined, undefined, innerSubscriber);
|
29734 | return _this;
|
29735 | }
|
29736 | SkipUntilSubscriber.prototype._next = function (value) {
|
29737 | if (this.hasValue) {
|
29738 | _super.prototype._next.call(this, value);
|
29739 | }
|
29740 | };
|
29741 | SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
29742 | this.hasValue = true;
|
29743 | if (this.innerSubscription) {
|
29744 | this.innerSubscription.unsubscribe();
|
29745 | }
|
29746 | };
|
29747 | SkipUntilSubscriber.prototype.notifyComplete = function () {
|
29748 | };
|
29749 | return SkipUntilSubscriber;
|
29750 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
29751 |
|
29752 |
|
29753 |
|
29754 | }),
|
29755 |
|
29756 | (function(module, __webpack_exports__, __webpack_require__) {
|
29757 |
|
29758 | "use strict";
|
29759 | __webpack_require__.r(__webpack_exports__);
|
29760 | __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return skipWhile; });
|
29761 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29762 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
29763 |
|
29764 |
|
29765 |
|
29766 | function skipWhile(predicate) {
|
29767 | return function (source) { return source.lift(new SkipWhileOperator(predicate)); };
|
29768 | }
|
29769 | var SkipWhileOperator = (function () {
|
29770 | function SkipWhileOperator(predicate) {
|
29771 | this.predicate = predicate;
|
29772 | }
|
29773 | SkipWhileOperator.prototype.call = function (subscriber, source) {
|
29774 | return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
|
29775 | };
|
29776 | return SkipWhileOperator;
|
29777 | }());
|
29778 | var SkipWhileSubscriber = (function (_super) {
|
29779 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipWhileSubscriber, _super);
|
29780 | function SkipWhileSubscriber(destination, predicate) {
|
29781 | var _this = _super.call(this, destination) || this;
|
29782 | _this.predicate = predicate;
|
29783 | _this.skipping = true;
|
29784 | _this.index = 0;
|
29785 | return _this;
|
29786 | }
|
29787 | SkipWhileSubscriber.prototype._next = function (value) {
|
29788 | var destination = this.destination;
|
29789 | if (this.skipping) {
|
29790 | this.tryCallPredicate(value);
|
29791 | }
|
29792 | if (!this.skipping) {
|
29793 | destination.next(value);
|
29794 | }
|
29795 | };
|
29796 | SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
|
29797 | try {
|
29798 | var result = this.predicate(value, this.index++);
|
29799 | this.skipping = Boolean(result);
|
29800 | }
|
29801 | catch (err) {
|
29802 | this.destination.error(err);
|
29803 | }
|
29804 | };
|
29805 | return SkipWhileSubscriber;
|
29806 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
29807 |
|
29808 |
|
29809 |
|
29810 | }),
|
29811 |
|
29812 | (function(module, __webpack_exports__, __webpack_require__) {
|
29813 |
|
29814 | "use strict";
|
29815 | __webpack_require__.r(__webpack_exports__);
|
29816 | __webpack_require__.d(__webpack_exports__, "startWith", function() { return startWith; });
|
29817 | var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(218);
|
29818 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(184);
|
29819 |
|
29820 |
|
29821 |
|
29822 | function startWith() {
|
29823 | var array = [];
|
29824 | for (var _i = 0; _i < arguments.length; _i++) {
|
29825 | array[_i] = arguments[_i];
|
29826 | }
|
29827 | var scheduler = array[array.length - 1];
|
29828 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(scheduler)) {
|
29829 | array.pop();
|
29830 | return function (source) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source, scheduler); };
|
29831 | }
|
29832 | else {
|
29833 | return function (source) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source); };
|
29834 | }
|
29835 | }
|
29836 |
|
29837 |
|
29838 |
|
29839 | }),
|
29840 |
|
29841 | (function(module, __webpack_exports__, __webpack_require__) {
|
29842 |
|
29843 | "use strict";
|
29844 | __webpack_require__.r(__webpack_exports__);
|
29845 | __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; });
|
29846 | var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(326);
|
29847 |
|
29848 |
|
29849 | function subscribeOn(scheduler, delay) {
|
29850 | if (delay === void 0) {
|
29851 | delay = 0;
|
29852 | }
|
29853 | return function subscribeOnOperatorFunction(source) {
|
29854 | return source.lift(new SubscribeOnOperator(scheduler, delay));
|
29855 | };
|
29856 | }
|
29857 | var SubscribeOnOperator = (function () {
|
29858 | function SubscribeOnOperator(scheduler, delay) {
|
29859 | this.scheduler = scheduler;
|
29860 | this.delay = delay;
|
29861 | }
|
29862 | SubscribeOnOperator.prototype.call = function (subscriber, source) {
|
29863 | return new _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__["SubscribeOnObservable"](source, this.delay, this.scheduler).subscribe(subscriber);
|
29864 | };
|
29865 | return SubscribeOnOperator;
|
29866 | }());
|
29867 |
|
29868 |
|
29869 |
|
29870 | }),
|
29871 |
|
29872 | (function(module, __webpack_exports__, __webpack_require__) {
|
29873 |
|
29874 | "use strict";
|
29875 | __webpack_require__.r(__webpack_exports__);
|
29876 | __webpack_require__.d(__webpack_exports__, "SubscribeOnObservable", function() { return SubscribeOnObservable; });
|
29877 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29878 | var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(148);
|
29879 | var _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(190);
|
29880 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(236);
|
29881 |
|
29882 |
|
29883 |
|
29884 |
|
29885 |
|
29886 | var SubscribeOnObservable = (function (_super) {
|
29887 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscribeOnObservable, _super);
|
29888 | function SubscribeOnObservable(source, delayTime, scheduler) {
|
29889 | if (delayTime === void 0) {
|
29890 | delayTime = 0;
|
29891 | }
|
29892 | if (scheduler === void 0) {
|
29893 | scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
|
29894 | }
|
29895 | var _this = _super.call(this) || this;
|
29896 | _this.source = source;
|
29897 | _this.delayTime = delayTime;
|
29898 | _this.scheduler = scheduler;
|
29899 | if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(delayTime) || delayTime < 0) {
|
29900 | _this.delayTime = 0;
|
29901 | }
|
29902 | if (!scheduler || typeof scheduler.schedule !== 'function') {
|
29903 | _this.scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
|
29904 | }
|
29905 | return _this;
|
29906 | }
|
29907 | SubscribeOnObservable.create = function (source, delay, scheduler) {
|
29908 | if (delay === void 0) {
|
29909 | delay = 0;
|
29910 | }
|
29911 | if (scheduler === void 0) {
|
29912 | scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"];
|
29913 | }
|
29914 | return new SubscribeOnObservable(source, delay, scheduler);
|
29915 | };
|
29916 | SubscribeOnObservable.dispatch = function (arg) {
|
29917 | var source = arg.source, subscriber = arg.subscriber;
|
29918 | return this.add(source.subscribe(subscriber));
|
29919 | };
|
29920 | SubscribeOnObservable.prototype._subscribe = function (subscriber) {
|
29921 | var delay = this.delayTime;
|
29922 | var source = this.source;
|
29923 | var scheduler = this.scheduler;
|
29924 | return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
|
29925 | source: source, subscriber: subscriber
|
29926 | });
|
29927 | };
|
29928 | return SubscribeOnObservable;
|
29929 | }(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]));
|
29930 |
|
29931 |
|
29932 |
|
29933 |
|
29934 | }),
|
29935 |
|
29936 | (function(module, __webpack_exports__, __webpack_require__) {
|
29937 |
|
29938 | "use strict";
|
29939 | __webpack_require__.r(__webpack_exports__);
|
29940 | __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; });
|
29941 | var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(328);
|
29942 | var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(199);
|
29943 |
|
29944 |
|
29945 |
|
29946 | function switchAll() {
|
29947 | return Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]);
|
29948 | }
|
29949 |
|
29950 |
|
29951 |
|
29952 | }),
|
29953 |
|
29954 | (function(module, __webpack_exports__, __webpack_require__) {
|
29955 |
|
29956 | "use strict";
|
29957 | __webpack_require__.r(__webpack_exports__);
|
29958 | __webpack_require__.d(__webpack_exports__, "switchMap", function() { return switchMap; });
|
29959 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
29960 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
29961 | var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210);
|
29962 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
29963 | var _map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(205);
|
29964 | var _observable_from__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(222);
|
29965 |
|
29966 |
|
29967 |
|
29968 |
|
29969 |
|
29970 |
|
29971 |
|
29972 | function switchMap(project, resultSelector) {
|
29973 | if (typeof resultSelector === 'function') {
|
29974 | return function (source) { return source.pipe(switchMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_5__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_4__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
|
29975 | }
|
29976 | return function (source) { return source.lift(new SwitchMapOperator(project)); };
|
29977 | }
|
29978 | var SwitchMapOperator = (function () {
|
29979 | function SwitchMapOperator(project) {
|
29980 | this.project = project;
|
29981 | }
|
29982 | SwitchMapOperator.prototype.call = function (subscriber, source) {
|
29983 | return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));
|
29984 | };
|
29985 | return SwitchMapOperator;
|
29986 | }());
|
29987 | var SwitchMapSubscriber = (function (_super) {
|
29988 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchMapSubscriber, _super);
|
29989 | function SwitchMapSubscriber(destination, project) {
|
29990 | var _this = _super.call(this, destination) || this;
|
29991 | _this.project = project;
|
29992 | _this.index = 0;
|
29993 | return _this;
|
29994 | }
|
29995 | SwitchMapSubscriber.prototype._next = function (value) {
|
29996 | var result;
|
29997 | var index = this.index++;
|
29998 | try {
|
29999 | result = this.project(value, index);
|
30000 | }
|
30001 | catch (error) {
|
30002 | this.destination.error(error);
|
30003 | return;
|
30004 | }
|
30005 | this._innerSub(result, value, index);
|
30006 | };
|
30007 | SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {
|
30008 | var innerSubscription = this.innerSubscription;
|
30009 | if (innerSubscription) {
|
30010 | innerSubscription.unsubscribe();
|
30011 | }
|
30012 | var innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_2__["InnerSubscriber"](this, undefined, undefined);
|
30013 | var destination = this.destination;
|
30014 | destination.add(innerSubscriber);
|
30015 | this.innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, result, value, index, innerSubscriber);
|
30016 | };
|
30017 | SwitchMapSubscriber.prototype._complete = function () {
|
30018 | var innerSubscription = this.innerSubscription;
|
30019 | if (!innerSubscription || innerSubscription.closed) {
|
30020 | _super.prototype._complete.call(this);
|
30021 | }
|
30022 | this.unsubscribe();
|
30023 | };
|
30024 | SwitchMapSubscriber.prototype._unsubscribe = function () {
|
30025 | this.innerSubscription = null;
|
30026 | };
|
30027 | SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {
|
30028 | var destination = this.destination;
|
30029 | destination.remove(innerSub);
|
30030 | this.innerSubscription = null;
|
30031 | if (this.isStopped) {
|
30032 | _super.prototype._complete.call(this);
|
30033 | }
|
30034 | };
|
30035 | SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
30036 | this.destination.next(innerValue);
|
30037 | };
|
30038 | return SwitchMapSubscriber;
|
30039 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
30040 |
|
30041 |
|
30042 |
|
30043 | }),
|
30044 |
|
30045 | (function(module, __webpack_exports__, __webpack_require__) {
|
30046 |
|
30047 | "use strict";
|
30048 | __webpack_require__.r(__webpack_exports__);
|
30049 | __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; });
|
30050 | var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(328);
|
30051 |
|
30052 |
|
30053 | function switchMapTo(innerObservable, resultSelector) {
|
30054 | return resultSelector ? Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; }, resultSelector) : Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; });
|
30055 | }
|
30056 |
|
30057 |
|
30058 |
|
30059 | }),
|
30060 |
|
30061 | (function(module, __webpack_exports__, __webpack_require__) {
|
30062 |
|
30063 | "use strict";
|
30064 | __webpack_require__.r(__webpack_exports__);
|
30065 | __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; });
|
30066 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30067 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
30068 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
30069 |
|
30070 |
|
30071 |
|
30072 |
|
30073 | function takeUntil(notifier) {
|
30074 | return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
|
30075 | }
|
30076 | var TakeUntilOperator = (function () {
|
30077 | function TakeUntilOperator(notifier) {
|
30078 | this.notifier = notifier;
|
30079 | }
|
30080 | TakeUntilOperator.prototype.call = function (subscriber, source) {
|
30081 | var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
|
30082 | var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(takeUntilSubscriber, this.notifier);
|
30083 | if (notifierSubscription && !takeUntilSubscriber.seenValue) {
|
30084 | takeUntilSubscriber.add(notifierSubscription);
|
30085 | return source.subscribe(takeUntilSubscriber);
|
30086 | }
|
30087 | return takeUntilSubscriber;
|
30088 | };
|
30089 | return TakeUntilOperator;
|
30090 | }());
|
30091 | var TakeUntilSubscriber = (function (_super) {
|
30092 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeUntilSubscriber, _super);
|
30093 | function TakeUntilSubscriber(destination) {
|
30094 | var _this = _super.call(this, destination) || this;
|
30095 | _this.seenValue = false;
|
30096 | return _this;
|
30097 | }
|
30098 | TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
30099 | this.seenValue = true;
|
30100 | this.complete();
|
30101 | };
|
30102 | TakeUntilSubscriber.prototype.notifyComplete = function () {
|
30103 | };
|
30104 | return TakeUntilSubscriber;
|
30105 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
30106 |
|
30107 |
|
30108 |
|
30109 | }),
|
30110 |
|
30111 | (function(module, __webpack_exports__, __webpack_require__) {
|
30112 |
|
30113 | "use strict";
|
30114 | __webpack_require__.r(__webpack_exports__);
|
30115 | __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return takeWhile; });
|
30116 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30117 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
30118 |
|
30119 |
|
30120 |
|
30121 | function takeWhile(predicate, inclusive) {
|
30122 | if (inclusive === void 0) {
|
30123 | inclusive = false;
|
30124 | }
|
30125 | return function (source) {
|
30126 | return source.lift(new TakeWhileOperator(predicate, inclusive));
|
30127 | };
|
30128 | }
|
30129 | var TakeWhileOperator = (function () {
|
30130 | function TakeWhileOperator(predicate, inclusive) {
|
30131 | this.predicate = predicate;
|
30132 | this.inclusive = inclusive;
|
30133 | }
|
30134 | TakeWhileOperator.prototype.call = function (subscriber, source) {
|
30135 | return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));
|
30136 | };
|
30137 | return TakeWhileOperator;
|
30138 | }());
|
30139 | var TakeWhileSubscriber = (function (_super) {
|
30140 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeWhileSubscriber, _super);
|
30141 | function TakeWhileSubscriber(destination, predicate, inclusive) {
|
30142 | var _this = _super.call(this, destination) || this;
|
30143 | _this.predicate = predicate;
|
30144 | _this.inclusive = inclusive;
|
30145 | _this.index = 0;
|
30146 | return _this;
|
30147 | }
|
30148 | TakeWhileSubscriber.prototype._next = function (value) {
|
30149 | var destination = this.destination;
|
30150 | var result;
|
30151 | try {
|
30152 | result = this.predicate(value, this.index++);
|
30153 | }
|
30154 | catch (err) {
|
30155 | destination.error(err);
|
30156 | return;
|
30157 | }
|
30158 | this.nextOrComplete(value, result);
|
30159 | };
|
30160 | TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) {
|
30161 | var destination = this.destination;
|
30162 | if (Boolean(predicateResult)) {
|
30163 | destination.next(value);
|
30164 | }
|
30165 | else {
|
30166 | if (this.inclusive) {
|
30167 | destination.next(value);
|
30168 | }
|
30169 | destination.complete();
|
30170 | }
|
30171 | };
|
30172 | return TakeWhileSubscriber;
|
30173 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30174 |
|
30175 |
|
30176 |
|
30177 | }),
|
30178 |
|
30179 | (function(module, __webpack_exports__, __webpack_require__) {
|
30180 |
|
30181 | "use strict";
|
30182 | __webpack_require__.r(__webpack_exports__);
|
30183 | __webpack_require__.d(__webpack_exports__, "tap", function() { return tap; });
|
30184 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30185 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
30186 | var _util_noop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(164);
|
30187 | var _util_isFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(152);
|
30188 |
|
30189 |
|
30190 |
|
30191 |
|
30192 |
|
30193 | function tap(nextOrObserver, error, complete) {
|
30194 | return function tapOperatorFunction(source) {
|
30195 | return source.lift(new DoOperator(nextOrObserver, error, complete));
|
30196 | };
|
30197 | }
|
30198 | var DoOperator = (function () {
|
30199 | function DoOperator(nextOrObserver, error, complete) {
|
30200 | this.nextOrObserver = nextOrObserver;
|
30201 | this.error = error;
|
30202 | this.complete = complete;
|
30203 | }
|
30204 | DoOperator.prototype.call = function (subscriber, source) {
|
30205 | return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
|
30206 | };
|
30207 | return DoOperator;
|
30208 | }());
|
30209 | var TapSubscriber = (function (_super) {
|
30210 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TapSubscriber, _super);
|
30211 | function TapSubscriber(destination, observerOrNext, error, complete) {
|
30212 | var _this = _super.call(this, destination) || this;
|
30213 | _this._tapNext = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30214 | _this._tapError = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30215 | _this._tapComplete = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30216 | _this._tapError = error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30217 | _this._tapComplete = complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30218 | if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_3__["isFunction"])(observerOrNext)) {
|
30219 | _this._context = _this;
|
30220 | _this._tapNext = observerOrNext;
|
30221 | }
|
30222 | else if (observerOrNext) {
|
30223 | _this._context = observerOrNext;
|
30224 | _this._tapNext = observerOrNext.next || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30225 | _this._tapError = observerOrNext.error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30226 | _this._tapComplete = observerOrNext.complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"];
|
30227 | }
|
30228 | return _this;
|
30229 | }
|
30230 | TapSubscriber.prototype._next = function (value) {
|
30231 | try {
|
30232 | this._tapNext.call(this._context, value);
|
30233 | }
|
30234 | catch (err) {
|
30235 | this.destination.error(err);
|
30236 | return;
|
30237 | }
|
30238 | this.destination.next(value);
|
30239 | };
|
30240 | TapSubscriber.prototype._error = function (err) {
|
30241 | try {
|
30242 | this._tapError.call(this._context, err);
|
30243 | }
|
30244 | catch (err) {
|
30245 | this.destination.error(err);
|
30246 | return;
|
30247 | }
|
30248 | this.destination.error(err);
|
30249 | };
|
30250 | TapSubscriber.prototype._complete = function () {
|
30251 | try {
|
30252 | this._tapComplete.call(this._context);
|
30253 | }
|
30254 | catch (err) {
|
30255 | this.destination.error(err);
|
30256 | return;
|
30257 | }
|
30258 | return this.destination.complete();
|
30259 | };
|
30260 | return TapSubscriber;
|
30261 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30262 |
|
30263 |
|
30264 |
|
30265 | }),
|
30266 |
|
30267 | (function(module, __webpack_exports__, __webpack_require__) {
|
30268 |
|
30269 | "use strict";
|
30270 | __webpack_require__.r(__webpack_exports__);
|
30271 | __webpack_require__.d(__webpack_exports__, "defaultThrottleConfig", function() { return defaultThrottleConfig; });
|
30272 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; });
|
30273 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30274 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
30275 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
30276 |
|
30277 |
|
30278 |
|
30279 |
|
30280 | var defaultThrottleConfig = {
|
30281 | leading: true,
|
30282 | trailing: false
|
30283 | };
|
30284 | function throttle(durationSelector, config) {
|
30285 | if (config === void 0) {
|
30286 | config = defaultThrottleConfig;
|
30287 | }
|
30288 | return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };
|
30289 | }
|
30290 | var ThrottleOperator = (function () {
|
30291 | function ThrottleOperator(durationSelector, leading, trailing) {
|
30292 | this.durationSelector = durationSelector;
|
30293 | this.leading = leading;
|
30294 | this.trailing = trailing;
|
30295 | }
|
30296 | ThrottleOperator.prototype.call = function (subscriber, source) {
|
30297 | return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));
|
30298 | };
|
30299 | return ThrottleOperator;
|
30300 | }());
|
30301 | var ThrottleSubscriber = (function (_super) {
|
30302 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleSubscriber, _super);
|
30303 | function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {
|
30304 | var _this = _super.call(this, destination) || this;
|
30305 | _this.destination = destination;
|
30306 | _this.durationSelector = durationSelector;
|
30307 | _this._leading = _leading;
|
30308 | _this._trailing = _trailing;
|
30309 | _this._hasValue = false;
|
30310 | return _this;
|
30311 | }
|
30312 | ThrottleSubscriber.prototype._next = function (value) {
|
30313 | this._hasValue = true;
|
30314 | this._sendValue = value;
|
30315 | if (!this._throttled) {
|
30316 | if (this._leading) {
|
30317 | this.send();
|
30318 | }
|
30319 | else {
|
30320 | this.throttle(value);
|
30321 | }
|
30322 | }
|
30323 | };
|
30324 | ThrottleSubscriber.prototype.send = function () {
|
30325 | var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;
|
30326 | if (_hasValue) {
|
30327 | this.destination.next(_sendValue);
|
30328 | this.throttle(_sendValue);
|
30329 | }
|
30330 | this._hasValue = false;
|
30331 | this._sendValue = null;
|
30332 | };
|
30333 | ThrottleSubscriber.prototype.throttle = function (value) {
|
30334 | var duration = this.tryDurationSelector(value);
|
30335 | if (!!duration) {
|
30336 | this.add(this._throttled = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration));
|
30337 | }
|
30338 | };
|
30339 | ThrottleSubscriber.prototype.tryDurationSelector = function (value) {
|
30340 | try {
|
30341 | return this.durationSelector(value);
|
30342 | }
|
30343 | catch (err) {
|
30344 | this.destination.error(err);
|
30345 | return null;
|
30346 | }
|
30347 | };
|
30348 | ThrottleSubscriber.prototype.throttlingDone = function () {
|
30349 | var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;
|
30350 | if (_throttled) {
|
30351 | _throttled.unsubscribe();
|
30352 | }
|
30353 | this._throttled = null;
|
30354 | if (_trailing) {
|
30355 | this.send();
|
30356 | }
|
30357 | };
|
30358 | ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
30359 | this.throttlingDone();
|
30360 | };
|
30361 | ThrottleSubscriber.prototype.notifyComplete = function () {
|
30362 | this.throttlingDone();
|
30363 | };
|
30364 | return ThrottleSubscriber;
|
30365 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
30366 |
|
30367 |
|
30368 |
|
30369 | }),
|
30370 |
|
30371 | (function(module, __webpack_exports__, __webpack_require__) {
|
30372 |
|
30373 | "use strict";
|
30374 | __webpack_require__.r(__webpack_exports__);
|
30375 | __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return throttleTime; });
|
30376 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30377 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
30378 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194);
|
30379 | var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(333);
|
30380 |
|
30381 |
|
30382 |
|
30383 |
|
30384 |
|
30385 | function throttleTime(duration, scheduler, config) {
|
30386 | if (scheduler === void 0) {
|
30387 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
30388 | }
|
30389 | if (config === void 0) {
|
30390 | config = _throttle__WEBPACK_IMPORTED_MODULE_3__["defaultThrottleConfig"];
|
30391 | }
|
30392 | return function (source) { return source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); };
|
30393 | }
|
30394 | var ThrottleTimeOperator = (function () {
|
30395 | function ThrottleTimeOperator(duration, scheduler, leading, trailing) {
|
30396 | this.duration = duration;
|
30397 | this.scheduler = scheduler;
|
30398 | this.leading = leading;
|
30399 | this.trailing = trailing;
|
30400 | }
|
30401 | ThrottleTimeOperator.prototype.call = function (subscriber, source) {
|
30402 | return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));
|
30403 | };
|
30404 | return ThrottleTimeOperator;
|
30405 | }());
|
30406 | var ThrottleTimeSubscriber = (function (_super) {
|
30407 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleTimeSubscriber, _super);
|
30408 | function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) {
|
30409 | var _this = _super.call(this, destination) || this;
|
30410 | _this.duration = duration;
|
30411 | _this.scheduler = scheduler;
|
30412 | _this.leading = leading;
|
30413 | _this.trailing = trailing;
|
30414 | _this._hasTrailingValue = false;
|
30415 | _this._trailingValue = null;
|
30416 | return _this;
|
30417 | }
|
30418 | ThrottleTimeSubscriber.prototype._next = function (value) {
|
30419 | if (this.throttled) {
|
30420 | if (this.trailing) {
|
30421 | this._trailingValue = value;
|
30422 | this._hasTrailingValue = true;
|
30423 | }
|
30424 | }
|
30425 | else {
|
30426 | this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
|
30427 | if (this.leading) {
|
30428 | this.destination.next(value);
|
30429 | }
|
30430 | else if (this.trailing) {
|
30431 | this._trailingValue = value;
|
30432 | this._hasTrailingValue = true;
|
30433 | }
|
30434 | }
|
30435 | };
|
30436 | ThrottleTimeSubscriber.prototype._complete = function () {
|
30437 | if (this._hasTrailingValue) {
|
30438 | this.destination.next(this._trailingValue);
|
30439 | this.destination.complete();
|
30440 | }
|
30441 | else {
|
30442 | this.destination.complete();
|
30443 | }
|
30444 | };
|
30445 | ThrottleTimeSubscriber.prototype.clearThrottle = function () {
|
30446 | var throttled = this.throttled;
|
30447 | if (throttled) {
|
30448 | if (this.trailing && this._hasTrailingValue) {
|
30449 | this.destination.next(this._trailingValue);
|
30450 | this._trailingValue = null;
|
30451 | this._hasTrailingValue = false;
|
30452 | }
|
30453 | throttled.unsubscribe();
|
30454 | this.remove(throttled);
|
30455 | this.throttled = null;
|
30456 | }
|
30457 | };
|
30458 | return ThrottleTimeSubscriber;
|
30459 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30460 | function dispatchNext(arg) {
|
30461 | var subscriber = arg.subscriber;
|
30462 | subscriber.clearThrottle();
|
30463 | }
|
30464 |
|
30465 |
|
30466 |
|
30467 | }),
|
30468 |
|
30469 | (function(module, __webpack_exports__, __webpack_require__) {
|
30470 |
|
30471 | "use strict";
|
30472 | __webpack_require__.r(__webpack_exports__);
|
30473 | __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; });
|
30474 | __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; });
|
30475 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194);
|
30476 | var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(295);
|
30477 | var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(229);
|
30478 | var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(205);
|
30479 |
|
30480 |
|
30481 |
|
30482 |
|
30483 |
|
30484 | function timeInterval(scheduler) {
|
30485 | if (scheduler === void 0) {
|
30486 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
30487 | }
|
30488 | return function (source) {
|
30489 | return Object(_observable_defer__WEBPACK_IMPORTED_MODULE_2__["defer"])(function () {
|
30490 | return source.pipe(Object(_scan__WEBPACK_IMPORTED_MODULE_1__["scan"])(function (_a, value) {
|
30491 | var current = _a.current;
|
30492 | return ({ value: value, current: scheduler.now(), last: current });
|
30493 | }, { current: scheduler.now(), value: undefined, last: undefined }), Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (_a) {
|
30494 | var current = _a.current, last = _a.last, value = _a.value;
|
30495 | return new TimeInterval(value, current - last);
|
30496 | }));
|
30497 | });
|
30498 | };
|
30499 | }
|
30500 | var TimeInterval = (function () {
|
30501 | function TimeInterval(value, interval) {
|
30502 | this.value = value;
|
30503 | this.interval = interval;
|
30504 | }
|
30505 | return TimeInterval;
|
30506 | }());
|
30507 |
|
30508 |
|
30509 |
|
30510 |
|
30511 | }),
|
30512 |
|
30513 | (function(module, __webpack_exports__, __webpack_require__) {
|
30514 |
|
30515 | "use strict";
|
30516 | __webpack_require__.r(__webpack_exports__);
|
30517 | __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; });
|
30518 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194);
|
30519 | var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203);
|
30520 | var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(337);
|
30521 | var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(188);
|
30522 |
|
30523 |
|
30524 |
|
30525 |
|
30526 |
|
30527 | function timeout(due, scheduler) {
|
30528 | if (scheduler === void 0) {
|
30529 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
30530 | }
|
30531 | return Object(_timeoutWith__WEBPACK_IMPORTED_MODULE_2__["timeoutWith"])(due, Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_3__["throwError"])(new _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]()), scheduler);
|
30532 | }
|
30533 |
|
30534 |
|
30535 |
|
30536 | }),
|
30537 |
|
30538 | (function(module, __webpack_exports__, __webpack_require__) {
|
30539 |
|
30540 | "use strict";
|
30541 | __webpack_require__.r(__webpack_exports__);
|
30542 | __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; });
|
30543 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30544 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194);
|
30545 | var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(269);
|
30546 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208);
|
30547 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(209);
|
30548 |
|
30549 |
|
30550 |
|
30551 |
|
30552 |
|
30553 |
|
30554 | function timeoutWith(due, withObservable, scheduler) {
|
30555 | if (scheduler === void 0) {
|
30556 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
|
30557 | }
|
30558 | return function (source) {
|
30559 | var absoluteTimeout = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(due);
|
30560 | var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
|
30561 | return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
|
30562 | };
|
30563 | }
|
30564 | var TimeoutWithOperator = (function () {
|
30565 | function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) {
|
30566 | this.waitFor = waitFor;
|
30567 | this.absoluteTimeout = absoluteTimeout;
|
30568 | this.withObservable = withObservable;
|
30569 | this.scheduler = scheduler;
|
30570 | }
|
30571 | TimeoutWithOperator.prototype.call = function (subscriber, source) {
|
30572 | return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));
|
30573 | };
|
30574 | return TimeoutWithOperator;
|
30575 | }());
|
30576 | var TimeoutWithSubscriber = (function (_super) {
|
30577 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TimeoutWithSubscriber, _super);
|
30578 | function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) {
|
30579 | var _this = _super.call(this, destination) || this;
|
30580 | _this.absoluteTimeout = absoluteTimeout;
|
30581 | _this.waitFor = waitFor;
|
30582 | _this.withObservable = withObservable;
|
30583 | _this.scheduler = scheduler;
|
30584 | _this.action = null;
|
30585 | _this.scheduleTimeout();
|
30586 | return _this;
|
30587 | }
|
30588 | TimeoutWithSubscriber.dispatchTimeout = function (subscriber) {
|
30589 | var withObservable = subscriber.withObservable;
|
30590 | subscriber._unsubscribeAndRecycle();
|
30591 | subscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(subscriber, withObservable));
|
30592 | };
|
30593 | TimeoutWithSubscriber.prototype.scheduleTimeout = function () {
|
30594 | var action = this.action;
|
30595 | if (action) {
|
30596 | this.action = action.schedule(this, this.waitFor);
|
30597 | }
|
30598 | else {
|
30599 | this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));
|
30600 | }
|
30601 | };
|
30602 | TimeoutWithSubscriber.prototype._next = function (value) {
|
30603 | if (!this.absoluteTimeout) {
|
30604 | this.scheduleTimeout();
|
30605 | }
|
30606 | _super.prototype._next.call(this, value);
|
30607 | };
|
30608 | TimeoutWithSubscriber.prototype._unsubscribe = function () {
|
30609 | this.action = null;
|
30610 | this.scheduler = null;
|
30611 | this.withObservable = null;
|
30612 | };
|
30613 | return TimeoutWithSubscriber;
|
30614 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
30615 |
|
30616 |
|
30617 |
|
30618 | }),
|
30619 |
|
30620 | (function(module, __webpack_exports__, __webpack_require__) {
|
30621 |
|
30622 | "use strict";
|
30623 | __webpack_require__.r(__webpack_exports__);
|
30624 | __webpack_require__.d(__webpack_exports__, "timestamp", function() { return timestamp; });
|
30625 | __webpack_require__.d(__webpack_exports__, "Timestamp", function() { return Timestamp; });
|
30626 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(194);
|
30627 | var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(205);
|
30628 |
|
30629 |
|
30630 |
|
30631 | function timestamp(scheduler) {
|
30632 | if (scheduler === void 0) {
|
30633 | scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
|
30634 | }
|
30635 | return Object(_map__WEBPACK_IMPORTED_MODULE_1__["map"])(function (value) { return new Timestamp(value, scheduler.now()); });
|
30636 | }
|
30637 | var Timestamp = (function () {
|
30638 | function Timestamp(value, timestamp) {
|
30639 | this.value = value;
|
30640 | this.timestamp = timestamp;
|
30641 | }
|
30642 | return Timestamp;
|
30643 | }());
|
30644 |
|
30645 |
|
30646 |
|
30647 |
|
30648 | }),
|
30649 |
|
30650 | (function(module, __webpack_exports__, __webpack_require__) {
|
30651 |
|
30652 | "use strict";
|
30653 | __webpack_require__.r(__webpack_exports__);
|
30654 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; });
|
30655 | var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(294);
|
30656 |
|
30657 |
|
30658 | function toArrayReducer(arr, item, index) {
|
30659 | if (index === 0) {
|
30660 | return [item];
|
30661 | }
|
30662 | arr.push(item);
|
30663 | return arr;
|
30664 | }
|
30665 | function toArray() {
|
30666 | return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(toArrayReducer, []);
|
30667 | }
|
30668 |
|
30669 |
|
30670 |
|
30671 | }),
|
30672 |
|
30673 | (function(module, __webpack_exports__, __webpack_require__) {
|
30674 |
|
30675 | "use strict";
|
30676 | __webpack_require__.r(__webpack_exports__);
|
30677 | __webpack_require__.d(__webpack_exports__, "window", function() { return window; });
|
30678 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30679 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
30680 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208);
|
30681 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
30682 |
|
30683 |
|
30684 |
|
30685 |
|
30686 |
|
30687 | function window(windowBoundaries) {
|
30688 | return function windowOperatorFunction(source) {
|
30689 | return source.lift(new WindowOperator(windowBoundaries));
|
30690 | };
|
30691 | }
|
30692 | var WindowOperator = (function () {
|
30693 | function WindowOperator(windowBoundaries) {
|
30694 | this.windowBoundaries = windowBoundaries;
|
30695 | }
|
30696 | WindowOperator.prototype.call = function (subscriber, source) {
|
30697 | var windowSubscriber = new WindowSubscriber(subscriber);
|
30698 | var sourceSubscription = source.subscribe(windowSubscriber);
|
30699 | if (!sourceSubscription.closed) {
|
30700 | windowSubscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(windowSubscriber, this.windowBoundaries));
|
30701 | }
|
30702 | return sourceSubscription;
|
30703 | };
|
30704 | return WindowOperator;
|
30705 | }());
|
30706 | var WindowSubscriber = (function (_super) {
|
30707 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super);
|
30708 | function WindowSubscriber(destination) {
|
30709 | var _this = _super.call(this, destination) || this;
|
30710 | _this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
30711 | destination.next(_this.window);
|
30712 | return _this;
|
30713 | }
|
30714 | WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
30715 | this.openWindow();
|
30716 | };
|
30717 | WindowSubscriber.prototype.notifyError = function (error, innerSub) {
|
30718 | this._error(error);
|
30719 | };
|
30720 | WindowSubscriber.prototype.notifyComplete = function (innerSub) {
|
30721 | this._complete();
|
30722 | };
|
30723 | WindowSubscriber.prototype._next = function (value) {
|
30724 | this.window.next(value);
|
30725 | };
|
30726 | WindowSubscriber.prototype._error = function (err) {
|
30727 | this.window.error(err);
|
30728 | this.destination.error(err);
|
30729 | };
|
30730 | WindowSubscriber.prototype._complete = function () {
|
30731 | this.window.complete();
|
30732 | this.destination.complete();
|
30733 | };
|
30734 | WindowSubscriber.prototype._unsubscribe = function () {
|
30735 | this.window = null;
|
30736 | };
|
30737 | WindowSubscriber.prototype.openWindow = function () {
|
30738 | var prevWindow = this.window;
|
30739 | if (prevWindow) {
|
30740 | prevWindow.complete();
|
30741 | }
|
30742 | var destination = this.destination;
|
30743 | var newWindow = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
30744 | destination.next(newWindow);
|
30745 | };
|
30746 | return WindowSubscriber;
|
30747 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
30748 |
|
30749 |
|
30750 |
|
30751 | }),
|
30752 |
|
30753 | (function(module, __webpack_exports__, __webpack_require__) {
|
30754 |
|
30755 | "use strict";
|
30756 | __webpack_require__.r(__webpack_exports__);
|
30757 | __webpack_require__.d(__webpack_exports__, "windowCount", function() { return windowCount; });
|
30758 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30759 | var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(150);
|
30760 | var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(166);
|
30761 |
|
30762 |
|
30763 |
|
30764 |
|
30765 | function windowCount(windowSize, startWindowEvery) {
|
30766 | if (startWindowEvery === void 0) {
|
30767 | startWindowEvery = 0;
|
30768 | }
|
30769 | return function windowCountOperatorFunction(source) {
|
30770 | return source.lift(new WindowCountOperator(windowSize, startWindowEvery));
|
30771 | };
|
30772 | }
|
30773 | var WindowCountOperator = (function () {
|
30774 | function WindowCountOperator(windowSize, startWindowEvery) {
|
30775 | this.windowSize = windowSize;
|
30776 | this.startWindowEvery = startWindowEvery;
|
30777 | }
|
30778 | WindowCountOperator.prototype.call = function (subscriber, source) {
|
30779 | return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
|
30780 | };
|
30781 | return WindowCountOperator;
|
30782 | }());
|
30783 | var WindowCountSubscriber = (function (_super) {
|
30784 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowCountSubscriber, _super);
|
30785 | function WindowCountSubscriber(destination, windowSize, startWindowEvery) {
|
30786 | var _this = _super.call(this, destination) || this;
|
30787 | _this.destination = destination;
|
30788 | _this.windowSize = windowSize;
|
30789 | _this.startWindowEvery = startWindowEvery;
|
30790 | _this.windows = [new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]()];
|
30791 | _this.count = 0;
|
30792 | destination.next(_this.windows[0]);
|
30793 | return _this;
|
30794 | }
|
30795 | WindowCountSubscriber.prototype._next = function (value) {
|
30796 | var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
|
30797 | var destination = this.destination;
|
30798 | var windowSize = this.windowSize;
|
30799 | var windows = this.windows;
|
30800 | var len = windows.length;
|
30801 | for (var i = 0; i < len && !this.closed; i++) {
|
30802 | windows[i].next(value);
|
30803 | }
|
30804 | var c = this.count - windowSize + 1;
|
30805 | if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
|
30806 | windows.shift().complete();
|
30807 | }
|
30808 | if (++this.count % startWindowEvery === 0 && !this.closed) {
|
30809 | var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
|
30810 | windows.push(window_1);
|
30811 | destination.next(window_1);
|
30812 | }
|
30813 | };
|
30814 | WindowCountSubscriber.prototype._error = function (err) {
|
30815 | var windows = this.windows;
|
30816 | if (windows) {
|
30817 | while (windows.length > 0 && !this.closed) {
|
30818 | windows.shift().error(err);
|
30819 | }
|
30820 | }
|
30821 | this.destination.error(err);
|
30822 | };
|
30823 | WindowCountSubscriber.prototype._complete = function () {
|
30824 | var windows = this.windows;
|
30825 | if (windows) {
|
30826 | while (windows.length > 0 && !this.closed) {
|
30827 | windows.shift().complete();
|
30828 | }
|
30829 | }
|
30830 | this.destination.complete();
|
30831 | };
|
30832 | WindowCountSubscriber.prototype._unsubscribe = function () {
|
30833 | this.count = 0;
|
30834 | this.windows = null;
|
30835 | };
|
30836 | return WindowCountSubscriber;
|
30837 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"]));
|
30838 |
|
30839 |
|
30840 |
|
30841 | }),
|
30842 |
|
30843 | (function(module, __webpack_exports__, __webpack_require__) {
|
30844 |
|
30845 | "use strict";
|
30846 | __webpack_require__.r(__webpack_exports__);
|
30847 | __webpack_require__.d(__webpack_exports__, "windowTime", function() { return windowTime; });
|
30848 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
30849 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
30850 | var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194);
|
30851 | var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(150);
|
30852 | var _util_isNumeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(236);
|
30853 | var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(184);
|
30854 |
|
30855 |
|
30856 |
|
30857 |
|
30858 |
|
30859 |
|
30860 |
|
30861 | function windowTime(windowTimeSpan) {
|
30862 | var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"];
|
30863 | var windowCreationInterval = null;
|
30864 | var maxWindowSize = Number.POSITIVE_INFINITY;
|
30865 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[3])) {
|
30866 | scheduler = arguments[3];
|
30867 | }
|
30868 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[2])) {
|
30869 | scheduler = arguments[2];
|
30870 | }
|
30871 | else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[2])) {
|
30872 | maxWindowSize = arguments[2];
|
30873 | }
|
30874 | if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[1])) {
|
30875 | scheduler = arguments[1];
|
30876 | }
|
30877 | else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[1])) {
|
30878 | windowCreationInterval = arguments[1];
|
30879 | }
|
30880 | return function windowTimeOperatorFunction(source) {
|
30881 | return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
|
30882 | };
|
30883 | }
|
30884 | var WindowTimeOperator = (function () {
|
30885 | function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
|
30886 | this.windowTimeSpan = windowTimeSpan;
|
30887 | this.windowCreationInterval = windowCreationInterval;
|
30888 | this.maxWindowSize = maxWindowSize;
|
30889 | this.scheduler = scheduler;
|
30890 | }
|
30891 | WindowTimeOperator.prototype.call = function (subscriber, source) {
|
30892 | return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
|
30893 | };
|
30894 | return WindowTimeOperator;
|
30895 | }());
|
30896 | var CountedSubject = (function (_super) {
|
30897 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountedSubject, _super);
|
30898 | function CountedSubject() {
|
30899 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
30900 | _this._numberOfNextedValues = 0;
|
30901 | return _this;
|
30902 | }
|
30903 | CountedSubject.prototype.next = function (value) {
|
30904 | this._numberOfNextedValues++;
|
30905 | _super.prototype.next.call(this, value);
|
30906 | };
|
30907 | Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
|
30908 | get: function () {
|
30909 | return this._numberOfNextedValues;
|
30910 | },
|
30911 | enumerable: true,
|
30912 | configurable: true
|
30913 | });
|
30914 | return CountedSubject;
|
30915 | }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]));
|
30916 | var WindowTimeSubscriber = (function (_super) {
|
30917 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowTimeSubscriber, _super);
|
30918 | function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
|
30919 | var _this = _super.call(this, destination) || this;
|
30920 | _this.destination = destination;
|
30921 | _this.windowTimeSpan = windowTimeSpan;
|
30922 | _this.windowCreationInterval = windowCreationInterval;
|
30923 | _this.maxWindowSize = maxWindowSize;
|
30924 | _this.scheduler = scheduler;
|
30925 | _this.windows = [];
|
30926 | var window = _this.openWindow();
|
30927 | if (windowCreationInterval !== null && windowCreationInterval >= 0) {
|
30928 | var closeState = { subscriber: _this, window: window, context: null };
|
30929 | var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };
|
30930 | _this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
|
30931 | _this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
|
30932 | }
|
30933 | else {
|
30934 | var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };
|
30935 | _this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
|
30936 | }
|
30937 | return _this;
|
30938 | }
|
30939 | WindowTimeSubscriber.prototype._next = function (value) {
|
30940 | var windows = this.windows;
|
30941 | var len = windows.length;
|
30942 | for (var i = 0; i < len; i++) {
|
30943 | var window_1 = windows[i];
|
30944 | if (!window_1.closed) {
|
30945 | window_1.next(value);
|
30946 | if (window_1.numberOfNextedValues >= this.maxWindowSize) {
|
30947 | this.closeWindow(window_1);
|
30948 | }
|
30949 | }
|
30950 | }
|
30951 | };
|
30952 | WindowTimeSubscriber.prototype._error = function (err) {
|
30953 | var windows = this.windows;
|
30954 | while (windows.length > 0) {
|
30955 | windows.shift().error(err);
|
30956 | }
|
30957 | this.destination.error(err);
|
30958 | };
|
30959 | WindowTimeSubscriber.prototype._complete = function () {
|
30960 | var windows = this.windows;
|
30961 | while (windows.length > 0) {
|
30962 | var window_2 = windows.shift();
|
30963 | if (!window_2.closed) {
|
30964 | window_2.complete();
|
30965 | }
|
30966 | }
|
30967 | this.destination.complete();
|
30968 | };
|
30969 | WindowTimeSubscriber.prototype.openWindow = function () {
|
30970 | var window = new CountedSubject();
|
30971 | this.windows.push(window);
|
30972 | var destination = this.destination;
|
30973 | destination.next(window);
|
30974 | return window;
|
30975 | };
|
30976 | WindowTimeSubscriber.prototype.closeWindow = function (window) {
|
30977 | window.complete();
|
30978 | var windows = this.windows;
|
30979 | windows.splice(windows.indexOf(window), 1);
|
30980 | };
|
30981 | return WindowTimeSubscriber;
|
30982 | }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"]));
|
30983 | function dispatchWindowTimeSpanOnly(state) {
|
30984 | var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
|
30985 | if (window) {
|
30986 | subscriber.closeWindow(window);
|
30987 | }
|
30988 | state.window = subscriber.openWindow();
|
30989 | this.schedule(state, windowTimeSpan);
|
30990 | }
|
30991 | function dispatchWindowCreation(state) {
|
30992 | var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
|
30993 | var window = subscriber.openWindow();
|
30994 | var action = this;
|
30995 | var context = { action: action, subscription: null };
|
30996 | var timeSpanState = { subscriber: subscriber, window: window, context: context };
|
30997 | context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
|
30998 | action.add(context.subscription);
|
30999 | action.schedule(state, windowCreationInterval);
|
31000 | }
|
31001 | function dispatchWindowClose(state) {
|
31002 | var subscriber = state.subscriber, window = state.window, context = state.context;
|
31003 | if (context && context.action && context.subscription) {
|
31004 | context.action.remove(context.subscription);
|
31005 | }
|
31006 | subscriber.closeWindow(window);
|
31007 | }
|
31008 |
|
31009 |
|
31010 |
|
31011 | }),
|
31012 |
|
31013 | (function(module, __webpack_exports__, __webpack_require__) {
|
31014 |
|
31015 | "use strict";
|
31016 | __webpack_require__.r(__webpack_exports__);
|
31017 | __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return windowToggle; });
|
31018 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
31019 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
31020 | var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(156);
|
31021 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(208);
|
31022 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(209);
|
31023 |
|
31024 |
|
31025 |
|
31026 |
|
31027 |
|
31028 |
|
31029 | function windowToggle(openings, closingSelector) {
|
31030 | return function (source) { return source.lift(new WindowToggleOperator(openings, closingSelector)); };
|
31031 | }
|
31032 | var WindowToggleOperator = (function () {
|
31033 | function WindowToggleOperator(openings, closingSelector) {
|
31034 | this.openings = openings;
|
31035 | this.closingSelector = closingSelector;
|
31036 | }
|
31037 | WindowToggleOperator.prototype.call = function (subscriber, source) {
|
31038 | return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));
|
31039 | };
|
31040 | return WindowToggleOperator;
|
31041 | }());
|
31042 | var WindowToggleSubscriber = (function (_super) {
|
31043 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowToggleSubscriber, _super);
|
31044 | function WindowToggleSubscriber(destination, openings, closingSelector) {
|
31045 | var _this = _super.call(this, destination) || this;
|
31046 | _this.openings = openings;
|
31047 | _this.closingSelector = closingSelector;
|
31048 | _this.contexts = [];
|
31049 | _this.add(_this.openSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(_this, openings, openings));
|
31050 | return _this;
|
31051 | }
|
31052 | WindowToggleSubscriber.prototype._next = function (value) {
|
31053 | var contexts = this.contexts;
|
31054 | if (contexts) {
|
31055 | var len = contexts.length;
|
31056 | for (var i = 0; i < len; i++) {
|
31057 | contexts[i].window.next(value);
|
31058 | }
|
31059 | }
|
31060 | };
|
31061 | WindowToggleSubscriber.prototype._error = function (err) {
|
31062 | var contexts = this.contexts;
|
31063 | this.contexts = null;
|
31064 | if (contexts) {
|
31065 | var len = contexts.length;
|
31066 | var index = -1;
|
31067 | while (++index < len) {
|
31068 | var context_1 = contexts[index];
|
31069 | context_1.window.error(err);
|
31070 | context_1.subscription.unsubscribe();
|
31071 | }
|
31072 | }
|
31073 | _super.prototype._error.call(this, err);
|
31074 | };
|
31075 | WindowToggleSubscriber.prototype._complete = function () {
|
31076 | var contexts = this.contexts;
|
31077 | this.contexts = null;
|
31078 | if (contexts) {
|
31079 | var len = contexts.length;
|
31080 | var index = -1;
|
31081 | while (++index < len) {
|
31082 | var context_2 = contexts[index];
|
31083 | context_2.window.complete();
|
31084 | context_2.subscription.unsubscribe();
|
31085 | }
|
31086 | }
|
31087 | _super.prototype._complete.call(this);
|
31088 | };
|
31089 | WindowToggleSubscriber.prototype._unsubscribe = function () {
|
31090 | var contexts = this.contexts;
|
31091 | this.contexts = null;
|
31092 | if (contexts) {
|
31093 | var len = contexts.length;
|
31094 | var index = -1;
|
31095 | while (++index < len) {
|
31096 | var context_3 = contexts[index];
|
31097 | context_3.window.unsubscribe();
|
31098 | context_3.subscription.unsubscribe();
|
31099 | }
|
31100 | }
|
31101 | };
|
31102 | WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
31103 | if (outerValue === this.openings) {
|
31104 | var closingNotifier = void 0;
|
31105 | try {
|
31106 | var closingSelector = this.closingSelector;
|
31107 | closingNotifier = closingSelector(innerValue);
|
31108 | }
|
31109 | catch (e) {
|
31110 | return this.error(e);
|
31111 | }
|
31112 | var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
31113 | var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"]();
|
31114 | var context_4 = { window: window_1, subscription: subscription };
|
31115 | this.contexts.push(context_4);
|
31116 | var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, closingNotifier, context_4);
|
31117 | if (innerSubscription.closed) {
|
31118 | this.closeWindow(this.contexts.length - 1);
|
31119 | }
|
31120 | else {
|
31121 | innerSubscription.context = context_4;
|
31122 | subscription.add(innerSubscription);
|
31123 | }
|
31124 | this.destination.next(window_1);
|
31125 | }
|
31126 | else {
|
31127 | this.closeWindow(this.contexts.indexOf(outerValue));
|
31128 | }
|
31129 | };
|
31130 | WindowToggleSubscriber.prototype.notifyError = function (err) {
|
31131 | this.error(err);
|
31132 | };
|
31133 | WindowToggleSubscriber.prototype.notifyComplete = function (inner) {
|
31134 | if (inner !== this.openSubscription) {
|
31135 | this.closeWindow(this.contexts.indexOf(inner.context));
|
31136 | }
|
31137 | };
|
31138 | WindowToggleSubscriber.prototype.closeWindow = function (index) {
|
31139 | if (index === -1) {
|
31140 | return;
|
31141 | }
|
31142 | var contexts = this.contexts;
|
31143 | var context = contexts[index];
|
31144 | var window = context.window, subscription = context.subscription;
|
31145 | contexts.splice(index, 1);
|
31146 | window.complete();
|
31147 | subscription.unsubscribe();
|
31148 | };
|
31149 | return WindowToggleSubscriber;
|
31150 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"]));
|
31151 |
|
31152 |
|
31153 |
|
31154 | }),
|
31155 |
|
31156 | (function(module, __webpack_exports__, __webpack_require__) {
|
31157 |
|
31158 | "use strict";
|
31159 | __webpack_require__.r(__webpack_exports__);
|
31160 | __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return windowWhen; });
|
31161 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
31162 | var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(166);
|
31163 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(208);
|
31164 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(209);
|
31165 |
|
31166 |
|
31167 |
|
31168 |
|
31169 |
|
31170 | function windowWhen(closingSelector) {
|
31171 | return function windowWhenOperatorFunction(source) {
|
31172 | return source.lift(new WindowOperator(closingSelector));
|
31173 | };
|
31174 | }
|
31175 | var WindowOperator = (function () {
|
31176 | function WindowOperator(closingSelector) {
|
31177 | this.closingSelector = closingSelector;
|
31178 | }
|
31179 | WindowOperator.prototype.call = function (subscriber, source) {
|
31180 | return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
|
31181 | };
|
31182 | return WindowOperator;
|
31183 | }());
|
31184 | var WindowSubscriber = (function (_super) {
|
31185 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super);
|
31186 | function WindowSubscriber(destination, closingSelector) {
|
31187 | var _this = _super.call(this, destination) || this;
|
31188 | _this.destination = destination;
|
31189 | _this.closingSelector = closingSelector;
|
31190 | _this.openWindow();
|
31191 | return _this;
|
31192 | }
|
31193 | WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
31194 | this.openWindow(innerSub);
|
31195 | };
|
31196 | WindowSubscriber.prototype.notifyError = function (error, innerSub) {
|
31197 | this._error(error);
|
31198 | };
|
31199 | WindowSubscriber.prototype.notifyComplete = function (innerSub) {
|
31200 | this.openWindow(innerSub);
|
31201 | };
|
31202 | WindowSubscriber.prototype._next = function (value) {
|
31203 | this.window.next(value);
|
31204 | };
|
31205 | WindowSubscriber.prototype._error = function (err) {
|
31206 | this.window.error(err);
|
31207 | this.destination.error(err);
|
31208 | this.unsubscribeClosingNotification();
|
31209 | };
|
31210 | WindowSubscriber.prototype._complete = function () {
|
31211 | this.window.complete();
|
31212 | this.destination.complete();
|
31213 | this.unsubscribeClosingNotification();
|
31214 | };
|
31215 | WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
|
31216 | if (this.closingNotification) {
|
31217 | this.closingNotification.unsubscribe();
|
31218 | }
|
31219 | };
|
31220 | WindowSubscriber.prototype.openWindow = function (innerSub) {
|
31221 | if (innerSub === void 0) {
|
31222 | innerSub = null;
|
31223 | }
|
31224 | if (innerSub) {
|
31225 | this.remove(innerSub);
|
31226 | innerSub.unsubscribe();
|
31227 | }
|
31228 | var prevWindow = this.window;
|
31229 | if (prevWindow) {
|
31230 | prevWindow.complete();
|
31231 | }
|
31232 | var window = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
|
31233 | this.destination.next(window);
|
31234 | var closingNotifier;
|
31235 | try {
|
31236 | var closingSelector = this.closingSelector;
|
31237 | closingNotifier = closingSelector();
|
31238 | }
|
31239 | catch (e) {
|
31240 | this.destination.error(e);
|
31241 | this.window.error(e);
|
31242 | return;
|
31243 | }
|
31244 | this.add(this.closingNotification = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, closingNotifier));
|
31245 | };
|
31246 | return WindowSubscriber;
|
31247 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"]));
|
31248 |
|
31249 |
|
31250 |
|
31251 | }),
|
31252 |
|
31253 | (function(module, __webpack_exports__, __webpack_require__) {
|
31254 |
|
31255 | "use strict";
|
31256 | __webpack_require__.r(__webpack_exports__);
|
31257 | __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return withLatestFrom; });
|
31258 | var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(151);
|
31259 | var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208);
|
31260 | var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(209);
|
31261 |
|
31262 |
|
31263 |
|
31264 |
|
31265 | function withLatestFrom() {
|
31266 | var args = [];
|
31267 | for (var _i = 0; _i < arguments.length; _i++) {
|
31268 | args[_i] = arguments[_i];
|
31269 | }
|
31270 | return function (source) {
|
31271 | var project;
|
31272 | if (typeof args[args.length - 1] === 'function') {
|
31273 | project = args.pop();
|
31274 | }
|
31275 | var observables = args;
|
31276 | return source.lift(new WithLatestFromOperator(observables, project));
|
31277 | };
|
31278 | }
|
31279 | var WithLatestFromOperator = (function () {
|
31280 | function WithLatestFromOperator(observables, project) {
|
31281 | this.observables = observables;
|
31282 | this.project = project;
|
31283 | }
|
31284 | WithLatestFromOperator.prototype.call = function (subscriber, source) {
|
31285 | return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
|
31286 | };
|
31287 | return WithLatestFromOperator;
|
31288 | }());
|
31289 | var WithLatestFromSubscriber = (function (_super) {
|
31290 | tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WithLatestFromSubscriber, _super);
|
31291 | function WithLatestFromSubscriber(destination, observables, project) {
|
31292 | var _this = _super.call(this, destination) || this;
|
31293 | _this.observables = observables;
|
31294 | _this.project = project;
|
31295 | _this.toRespond = [];
|
31296 | var len = observables.length;
|
31297 | _this.values = new Array(len);
|
31298 | for (var i = 0; i < len; i++) {
|
31299 | _this.toRespond.push(i);
|
31300 | }
|
31301 | for (var i = 0; i < len; i++) {
|
31302 | var observable = observables[i];
|
31303 | _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, observable, observable, i));
|
31304 | }
|
31305 | return _this;
|
31306 | }
|
31307 | WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
31308 | this.values[outerIndex] = innerValue;
|
31309 | var toRespond = this.toRespond;
|
31310 | if (toRespond.length > 0) {
|
31311 | var found = toRespond.indexOf(outerIndex);
|
31312 | if (found !== -1) {
|
31313 | toRespond.splice(found, 1);
|
31314 | }
|
31315 | }
|
31316 | };
|
31317 | WithLatestFromSubscriber.prototype.notifyComplete = function () {
|
31318 | };
|
31319 | WithLatestFromSubscriber.prototype._next = function (value) {
|
31320 | if (this.toRespond.length === 0) {
|
31321 | var args = [value].concat(this.values);
|
31322 | if (this.project) {
|
31323 | this._tryProject(args);
|
31324 | }
|
31325 | else {
|
31326 | this.destination.next(args);
|
31327 | }
|
31328 | }
|
31329 | };
|
31330 | WithLatestFromSubscriber.prototype._tryProject = function (args) {
|
31331 | var result;
|
31332 | try {
|
31333 | result = this.project.apply(this, args);
|
31334 | }
|
31335 | catch (err) {
|
31336 | this.destination.error(err);
|
31337 | return;
|
31338 | }
|
31339 | this.destination.next(result);
|
31340 | };
|
31341 | return WithLatestFromSubscriber;
|
31342 | }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"]));
|
31343 |
|
31344 |
|
31345 |
|
31346 | }),
|
31347 |
|
31348 | (function(module, __webpack_exports__, __webpack_require__) {
|
31349 |
|
31350 | "use strict";
|
31351 | __webpack_require__.r(__webpack_exports__);
|
31352 | __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
|
31353 | var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(248);
|
31354 |
|
31355 |
|
31356 | function zip() {
|
31357 | var observables = [];
|
31358 | for (var _i = 0; _i < arguments.length; _i++) {
|
31359 | observables[_i] = arguments[_i];
|
31360 | }
|
31361 | return function zipOperatorFunction(source) {
|
31362 | return source.lift.call(_observable_zip__WEBPACK_IMPORTED_MODULE_0__["zip"].apply(void 0, [source].concat(observables)));
|
31363 | };
|
31364 | }
|
31365 |
|
31366 |
|
31367 |
|
31368 | }),
|
31369 |
|
31370 | (function(module, __webpack_exports__, __webpack_require__) {
|
31371 |
|
31372 | "use strict";
|
31373 | __webpack_require__.r(__webpack_exports__);
|
31374 | __webpack_require__.d(__webpack_exports__, "zipAll", function() { return zipAll; });
|
31375 | var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(248);
|
31376 |
|
31377 |
|
31378 | function zipAll(project) {
|
31379 | return function (source) { return source.lift(new _observable_zip__WEBPACK_IMPORTED_MODULE_0__["ZipOperator"](project)); };
|
31380 | }
|
31381 |
|
31382 |
|
31383 |
|
31384 | }),
|
31385 | ,
|
31386 |
|
31387 | (function(module, exports, __webpack_require__) {
|
31388 |
|
31389 | "use strict";
|
31390 |
|
31391 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
31392 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
31393 | };
|
31394 | Object.defineProperty(exports, "__esModule", { value: true });
|
31395 | var fast_glob_1 = __importDefault(__webpack_require__(53));
|
31396 | var os_1 = __importDefault(__webpack_require__(16));
|
31397 | var path_1 = __webpack_require__(15);
|
31398 | var rxjs_1 = __webpack_require__(147);
|
31399 | var operators_1 = __webpack_require__(250);
|
31400 | var vscode_uri_1 = __importDefault(__webpack_require__(132));
|
31401 | var fs_1 = __webpack_require__(36);
|
31402 | var constant_1 = __webpack_require__(2);
|
31403 | var util_1 = __webpack_require__(40);
|
31404 | var indexes = {};
|
31405 | var indexesFiles = {};
|
31406 | var queue = [];
|
31407 | var source$;
|
31408 | var gap = 100;
|
31409 | var count = 3;
|
31410 | var customProjectRootPatterns = constant_1.projectRootPatterns;
|
31411 | function initSource() {
|
31412 | if (source$) {
|
31413 | return;
|
31414 | }
|
31415 | source$ = new rxjs_1.Subject();
|
31416 | source$.pipe(operators_1.concatMap(function (uri) {
|
31417 | return rxjs_1.from(util_1.findProjectRoot(vscode_uri_1.default.parse(uri).fsPath, customProjectRootPatterns)).pipe(operators_1.switchMap(function (projectRoot) {
|
31418 | return rxjs_1.from(util_1.getRealPath(projectRoot));
|
31419 | }), operators_1.filter(function (projectRoot) { return projectRoot && projectRoot !== os_1.default.homedir(); }), operators_1.map(function (projectRoot) { return ({
|
31420 | uri: uri,
|
31421 | projectRoot: projectRoot,
|
31422 | }); }));
|
31423 | }), operators_1.filter(function (_a) {
|
31424 | var projectRoot = _a.projectRoot;
|
31425 | if (!indexes[projectRoot]) {
|
31426 | indexes[projectRoot] = true;
|
31427 | return true;
|
31428 | }
|
31429 | return false;
|
31430 | }), operators_1.concatMap(function (_a) {
|
31431 | var projectRoot = _a.projectRoot;
|
31432 | var indexPath = path_1.join(projectRoot, "**/*.vim");
|
31433 | return rxjs_1.from(fast_glob_1.default([indexPath, "!**/node_modules/**"])).pipe(operators_1.catchError(function (error) {
|
31434 | process.send({
|
31435 | msglog: [
|
31436 | "Index Workspace Error: " + indexPath,
|
31437 | "Error => " + (error.stack || error.message || error),
|
31438 | ].join("\n"),
|
31439 | });
|
31440 | return rxjs_1.of(undefined);
|
31441 | }), operators_1.filter(function (list) { return list && list.length > 0; }), operators_1.concatMap(function (list) {
|
31442 | return rxjs_1.of.apply(void 0, list.sort(function (a, b) { return a.length - b.length; })).pipe(operators_1.filter(function (fpath) {
|
31443 | if (!indexesFiles[fpath]) {
|
31444 | indexesFiles[fpath] = true;
|
31445 | return true;
|
31446 | }
|
31447 | return false;
|
31448 | }), operators_1.mergeMap(function (fpath) {
|
31449 | return rxjs_1.timer(gap).pipe(operators_1.concatMap(function () {
|
31450 | var content = fs_1.readFileSync(fpath).toString();
|
31451 | return rxjs_1.from(util_1.handleParse(content)).pipe(operators_1.filter(function (res) { return res[0] !== null; }), operators_1.map(function (res) { return ({
|
31452 | node: res[0],
|
31453 | uri: vscode_uri_1.default.file(fpath).toString(),
|
31454 | }); }), operators_1.catchError(function (error) {
|
31455 | process.send({
|
31456 | msglog: fpath + ":\n" + (error.stack || error.message || error),
|
31457 | });
|
31458 | return rxjs_1.of(undefined);
|
31459 | }));
|
31460 | }));
|
31461 | }, count));
|
31462 | }));
|
31463 | }), operators_1.filter(function (res) { return !!res; })).subscribe(function (res) {
|
31464 | process.send({
|
31465 | data: res,
|
31466 | });
|
31467 | }, function (error) {
|
31468 | process.send({
|
31469 | msglog: error.stack || error.message || error,
|
31470 | });
|
31471 | });
|
31472 | if (queue.length) {
|
31473 | queue.forEach(function (uri) {
|
31474 | source$.next(uri);
|
31475 | });
|
31476 | queue = [];
|
31477 | }
|
31478 | }
|
31479 | process.on("message", function (mess) {
|
31480 | var uri = mess.uri, config = mess.config;
|
31481 | if (uri) {
|
31482 | if (source$) {
|
31483 | source$.next(uri);
|
31484 | }
|
31485 | else {
|
31486 | queue.push(uri);
|
31487 | }
|
31488 | }
|
31489 | if (config) {
|
31490 | if (config.gap !== undefined) {
|
31491 | gap = config.gap;
|
31492 | }
|
31493 | if (config.count !== undefined) {
|
31494 | count = config.count;
|
31495 | }
|
31496 | if (config.projectRootPatterns !== undefined) {
|
31497 | customProjectRootPatterns = config.projectRootPatterns;
|
31498 | }
|
31499 | initSource();
|
31500 | }
|
31501 | });
|
31502 |
|
31503 |
|
31504 | })
|
31505 | ]))); |
\ | No newline at end of file |