1 | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bkmrkd = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
2 | module.exports={
|
3 | "development": {
|
4 | "port": 3000,
|
5 | "rethinkdbHost": "localhost",
|
6 | "rethinkdbPort": 28015,
|
7 | "rethinkdbName": "bkmrkd_development",
|
8 | "snippetHost": "https://localhost:3000",
|
9 | "cert": "./ssl/server.crt",
|
10 | "certKey": "./ssl/server.key",
|
11 | "publicKeyPins": ["TROyeItK/2uzqYisNiSlkJshWmxQqMH+M9OJD4N+JEM=", "TROyeItK/2uzqYisNiSlkJshWmxQqMH+M9OJD4N+JEM="]
|
12 | },
|
13 | "stage": {
|
14 | "port": 3000,
|
15 | "rethinkdbHost": "localhost",
|
16 | "rethinkdbPort": 28015,
|
17 | "rethinkdbName": "bkmrkd_stage",
|
18 | "snippetHost": "https://bkmrkd.com",
|
19 | "cert": "./ssl/server.crt",
|
20 | "certKey": "./ssl/server.key",
|
21 | "publicKeyPins": ["TROyeItK/2uzqYisNiSlkJshWmxQqMH+M9OJD4N+JEM=", "TROyeItK/2uzqYisNiSlkJshWmxQqMH+M9OJD4N+JEM="]
|
22 | },
|
23 | "production": {
|
24 | "port": 3000,
|
25 | "rethinkdbHost": "localhost",
|
26 | "rethinkdbPort": 28015,
|
27 | "rethinkdbName": "bkmrkd_production",
|
28 | "snippetHost": "https://bkmrkd.com",
|
29 | "cert": "./ssl/server.crt",
|
30 | "certKey": "./ssl/server.key",
|
31 | "publicKeyPins": ["TROyeItK/2uzqYisNiSlkJshWmxQqMH+M9OJD4N+JEM=", "TROyeItK/2uzqYisNiSlkJshWmxQqMH+M9OJD4N+JEM="]
|
32 | }
|
33 | }
|
34 |
|
35 | },{}],2:[function(require,module,exports){
|
36 | (function (process){
|
37 | 'use strict';
|
38 |
|
39 | Object.defineProperty(exports, "__esModule", {
|
40 | value: true
|
41 | });
|
42 | exports.args = undefined;
|
43 |
|
44 | var _fs = require(8);
|
45 |
|
46 | var _fs2 = _interopRequireDefault(_fs);
|
47 |
|
48 | var _path = require(90);
|
49 |
|
50 | var _path2 = _interopRequireDefault(_path);
|
51 |
|
52 | var _subarg = require(332);
|
53 |
|
54 | var _subarg2 = _interopRequireDefault(_subarg);
|
55 |
|
56 | var _environments = require(1);
|
57 |
|
58 | var _environments2 = _interopRequireDefault(_environments);
|
59 |
|
60 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
61 |
|
62 | var args = exports.args = (0, _subarg2.default)(process.argv.slice(2));
|
63 |
|
64 | function readConfig() {
|
65 | return JSON.parse(_fs2.default.readFileSync(_path2.default.resolve(process.cwd(), args.c || args.config || process.env.BKMRKD_CONFIG_PATH), {
|
66 | encoding: 'utf8'
|
67 | }));
|
68 | }
|
69 |
|
70 | exports.default = args.c || args.config || process.env.BKMRKD_CONFIG_PATH ? readConfig() : _environments2.default;
|
71 |
|
72 | }).call(this,require(91))
|
73 | },{"1":1,"332":332,"8":8,"90":90,"91":91}],3:[function(require,module,exports){
|
74 | module.exports = after
|
75 |
|
76 | function after(count, callback, err_cb) {
|
77 | var bail = false
|
78 | err_cb = err_cb || noop
|
79 | proxy.count = count
|
80 |
|
81 | return (count === 0) ? callback() : proxy
|
82 |
|
83 | function proxy(err, result) {
|
84 | if (proxy.count <= 0) {
|
85 | throw new Error('after called too many times')
|
86 | }
|
87 | --proxy.count
|
88 |
|
89 |
|
90 | if (err) {
|
91 | bail = true
|
92 | callback(err)
|
93 |
|
94 | callback = err_cb
|
95 | } else if (proxy.count === 0 && !bail) {
|
96 | callback(null, result)
|
97 | }
|
98 | }
|
99 | }
|
100 |
|
101 | function noop() {}
|
102 |
|
103 | },{}],4:[function(require,module,exports){
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | module.exports = function(arraybuffer, start, end) {
|
112 | var bytes = arraybuffer.byteLength;
|
113 | start = start || 0;
|
114 | end = end || bytes;
|
115 |
|
116 | if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
|
117 |
|
118 | if (start < 0) { start += bytes; }
|
119 | if (end < 0) { end += bytes; }
|
120 | if (end > bytes) { end = bytes; }
|
121 |
|
122 | if (start >= bytes || start >= end || bytes === 0) {
|
123 | return new ArrayBuffer(0);
|
124 | }
|
125 |
|
126 | var abv = new Uint8Array(arraybuffer);
|
127 | var result = new Uint8Array(end - start);
|
128 | for (var i = start, ii = 0; i < end; i++, ii++) {
|
129 | result[ii] = abv[i];
|
130 | }
|
131 | return result.buffer;
|
132 | };
|
133 |
|
134 | },{}],5:[function(require,module,exports){
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 | module.exports = Backoff;
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 | function Backoff(opts) {
|
155 | opts = opts || {};
|
156 | this.ms = opts.min || 100;
|
157 | this.max = opts.max || 10000;
|
158 | this.factor = opts.factor || 2;
|
159 | this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
|
160 | this.attempts = 0;
|
161 | }
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 | Backoff.prototype.duration = function(){
|
171 | var ms = this.ms * Math.pow(this.factor, this.attempts++);
|
172 | if (this.jitter) {
|
173 | var rand = Math.random();
|
174 | var deviation = Math.floor(rand * this.jitter * ms);
|
175 | ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
|
176 | }
|
177 | return Math.min(ms, this.max) | 0;
|
178 | };
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 | Backoff.prototype.reset = function(){
|
187 | this.attempts = 0;
|
188 | };
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 | Backoff.prototype.setMin = function(min){
|
197 | this.ms = min;
|
198 | };
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 | Backoff.prototype.setMax = function(max){
|
207 | this.max = max;
|
208 | };
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | Backoff.prototype.setJitter = function(jitter){
|
217 | this.jitter = jitter;
|
218 | };
|
219 |
|
220 |
|
221 | },{}],6:[function(require,module,exports){
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 | (function(chars){
|
230 | "use strict";
|
231 |
|
232 | exports.encode = function(arraybuffer) {
|
233 | var bytes = new Uint8Array(arraybuffer),
|
234 | i, len = bytes.length, base64 = "";
|
235 |
|
236 | for (i = 0; i < len; i+=3) {
|
237 | base64 += chars[bytes[i] >> 2];
|
238 | base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
|
239 | base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
|
240 | base64 += chars[bytes[i + 2] & 63];
|
241 | }
|
242 |
|
243 | if ((len % 3) === 2) {
|
244 | base64 = base64.substring(0, base64.length - 1) + "=";
|
245 | } else if (len % 3 === 1) {
|
246 | base64 = base64.substring(0, base64.length - 2) + "==";
|
247 | }
|
248 |
|
249 | return base64;
|
250 | };
|
251 |
|
252 | exports.decode = function(base64) {
|
253 | var bufferLength = base64.length * 0.75,
|
254 | len = base64.length, i, p = 0,
|
255 | encoded1, encoded2, encoded3, encoded4;
|
256 |
|
257 | if (base64[base64.length - 1] === "=") {
|
258 | bufferLength--;
|
259 | if (base64[base64.length - 2] === "=") {
|
260 | bufferLength--;
|
261 | }
|
262 | }
|
263 |
|
264 | var arraybuffer = new ArrayBuffer(bufferLength),
|
265 | bytes = new Uint8Array(arraybuffer);
|
266 |
|
267 | for (i = 0; i < len; i+=4) {
|
268 | encoded1 = chars.indexOf(base64[i]);
|
269 | encoded2 = chars.indexOf(base64[i+1]);
|
270 | encoded3 = chars.indexOf(base64[i+2]);
|
271 | encoded4 = chars.indexOf(base64[i+3]);
|
272 |
|
273 | bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
|
274 | bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
|
275 | bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
|
276 | }
|
277 |
|
278 | return arraybuffer;
|
279 | };
|
280 | })("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
|
281 |
|
282 | },{}],7:[function(require,module,exports){
|
283 | (function (global){
|
284 |
|
285 |
|
286 |
|
287 |
|
288 | var BlobBuilder = global.BlobBuilder
|
289 | || global.WebKitBlobBuilder
|
290 | || global.MSBlobBuilder
|
291 | || global.MozBlobBuilder;
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 | var blobSupported = (function() {
|
298 | try {
|
299 | var a = new Blob(['hi']);
|
300 | return a.size === 2;
|
301 | } catch(e) {
|
302 | return false;
|
303 | }
|
304 | })();
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 | var blobSupportsArrayBufferView = blobSupported && (function() {
|
312 | try {
|
313 | var b = new Blob([new Uint8Array([1,2])]);
|
314 | return b.size === 2;
|
315 | } catch(e) {
|
316 | return false;
|
317 | }
|
318 | })();
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 | var blobBuilderSupported = BlobBuilder
|
325 | && BlobBuilder.prototype.append
|
326 | && BlobBuilder.prototype.getBlob;
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 | function mapArrayBufferViews(ary) {
|
335 | for (var i = 0; i < ary.length; i++) {
|
336 | var chunk = ary[i];
|
337 | if (chunk.buffer instanceof ArrayBuffer) {
|
338 | var buf = chunk.buffer;
|
339 |
|
340 |
|
341 |
|
342 | if (chunk.byteLength !== buf.byteLength) {
|
343 | var copy = new Uint8Array(chunk.byteLength);
|
344 | copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
|
345 | buf = copy.buffer;
|
346 | }
|
347 |
|
348 | ary[i] = buf;
|
349 | }
|
350 | }
|
351 | }
|
352 |
|
353 | function BlobBuilderConstructor(ary, options) {
|
354 | options = options || {};
|
355 |
|
356 | var bb = new BlobBuilder();
|
357 | mapArrayBufferViews(ary);
|
358 |
|
359 | for (var i = 0; i < ary.length; i++) {
|
360 | bb.append(ary[i]);
|
361 | }
|
362 |
|
363 | return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
|
364 | };
|
365 |
|
366 | function BlobConstructor(ary, options) {
|
367 | mapArrayBufferViews(ary);
|
368 | return new Blob(ary, options || {});
|
369 | };
|
370 |
|
371 | module.exports = (function() {
|
372 | if (blobSupported) {
|
373 | return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;
|
374 | } else if (blobBuilderSupported) {
|
375 | return BlobBuilderConstructor;
|
376 | } else {
|
377 | return undefined;
|
378 | }
|
379 | })();
|
380 |
|
381 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
382 | },{}],8:[function(require,module,exports){
|
383 |
|
384 | },{}],9:[function(require,module,exports){
|
385 |
|
386 |
|
387 |
|
388 |
|
389 | var slice = [].slice;
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 | module.exports = function(obj, fn){
|
401 | if ('string' == typeof fn) fn = obj[fn];
|
402 | if ('function' != typeof fn) throw new Error('bind() requires a function');
|
403 | var args = slice.call(arguments, 2);
|
404 | return function(){
|
405 | return fn.apply(obj, args.concat(slice.call(arguments)));
|
406 | }
|
407 | };
|
408 |
|
409 | },{}],10:[function(require,module,exports){
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 | module.exports = Emitter;
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 | function Emitter(obj) {
|
424 | if (obj) return mixin(obj);
|
425 | };
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 | function mixin(obj) {
|
436 | for (var key in Emitter.prototype) {
|
437 | obj[key] = Emitter.prototype[key];
|
438 | }
|
439 | return obj;
|
440 | }
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 | Emitter.prototype.on =
|
452 | Emitter.prototype.addEventListener = function(event, fn){
|
453 | this._callbacks = this._callbacks || {};
|
454 | (this._callbacks[event] = this._callbacks[event] || [])
|
455 | .push(fn);
|
456 | return this;
|
457 | };
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 | Emitter.prototype.once = function(event, fn){
|
470 | var self = this;
|
471 | this._callbacks = this._callbacks || {};
|
472 |
|
473 | function on() {
|
474 | self.off(event, on);
|
475 | fn.apply(this, arguments);
|
476 | }
|
477 |
|
478 | on.fn = fn;
|
479 | this.on(event, on);
|
480 | return this;
|
481 | };
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 | Emitter.prototype.off =
|
494 | Emitter.prototype.removeListener =
|
495 | Emitter.prototype.removeAllListeners =
|
496 | Emitter.prototype.removeEventListener = function(event, fn){
|
497 | this._callbacks = this._callbacks || {};
|
498 |
|
499 |
|
500 | if (0 == arguments.length) {
|
501 | this._callbacks = {};
|
502 | return this;
|
503 | }
|
504 |
|
505 |
|
506 | var callbacks = this._callbacks[event];
|
507 | if (!callbacks) return this;
|
508 |
|
509 |
|
510 | if (1 == arguments.length) {
|
511 | delete this._callbacks[event];
|
512 | return this;
|
513 | }
|
514 |
|
515 |
|
516 | var cb;
|
517 | for (var i = 0; i < callbacks.length; i++) {
|
518 | cb = callbacks[i];
|
519 | if (cb === fn || cb.fn === fn) {
|
520 | callbacks.splice(i, 1);
|
521 | break;
|
522 | }
|
523 | }
|
524 | return this;
|
525 | };
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 | Emitter.prototype.emit = function(event){
|
536 | this._callbacks = this._callbacks || {};
|
537 | var args = [].slice.call(arguments, 1)
|
538 | , callbacks = this._callbacks[event];
|
539 |
|
540 | if (callbacks) {
|
541 | callbacks = callbacks.slice(0);
|
542 | for (var i = 0, len = callbacks.length; i < len; ++i) {
|
543 | callbacks[i].apply(this, args);
|
544 | }
|
545 | }
|
546 |
|
547 | return this;
|
548 | };
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 | Emitter.prototype.listeners = function(event){
|
559 | this._callbacks = this._callbacks || {};
|
560 | return this._callbacks[event] || [];
|
561 | };
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 | Emitter.prototype.hasListeners = function(event){
|
572 | return !! this.listeners(event).length;
|
573 | };
|
574 |
|
575 | },{}],11:[function(require,module,exports){
|
576 |
|
577 | module.exports = function(a, b){
|
578 | var fn = function(){};
|
579 | fn.prototype = b.prototype;
|
580 | a.prototype = new fn;
|
581 | a.prototype.constructor = a;
|
582 | };
|
583 | },{}],12:[function(require,module,exports){
|
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 | exports = module.exports = require(13);
|
592 | exports.log = log;
|
593 | exports.formatArgs = formatArgs;
|
594 | exports.save = save;
|
595 | exports.load = load;
|
596 | exports.useColors = useColors;
|
597 | exports.storage = 'undefined' != typeof chrome
|
598 | && 'undefined' != typeof chrome.storage
|
599 | ? chrome.storage.local
|
600 | : localstorage();
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 | exports.colors = [
|
607 | 'lightseagreen',
|
608 | 'forestgreen',
|
609 | 'goldenrod',
|
610 | 'dodgerblue',
|
611 | 'darkorchid',
|
612 | 'crimson'
|
613 | ];
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 | function useColors() {
|
624 |
|
625 | return ('WebkitAppearance' in document.documentElement.style) ||
|
626 |
|
627 | (window.console && (console.firebug || (console.exception && console.table))) ||
|
628 |
|
629 |
|
630 | (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
|
631 | }
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 | exports.formatters.j = function(v) {
|
638 | return JSON.stringify(v);
|
639 | };
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 | function formatArgs() {
|
649 | var args = arguments;
|
650 | var useColors = this.useColors;
|
651 |
|
652 | args[0] = (useColors ? '%c' : '')
|
653 | + this.namespace
|
654 | + (useColors ? ' %c' : ' ')
|
655 | + args[0]
|
656 | + (useColors ? '%c ' : ' ')
|
657 | + '+' + exports.humanize(this.diff);
|
658 |
|
659 | if (!useColors) return args;
|
660 |
|
661 | var c = 'color: ' + this.color;
|
662 | args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
|
663 |
|
664 |
|
665 |
|
666 |
|
667 | var index = 0;
|
668 | var lastC = 0;
|
669 | args[0].replace(/%[a-z%]/g, function(match) {
|
670 | if ('%%' === match) return;
|
671 | index++;
|
672 | if ('%c' === match) {
|
673 |
|
674 |
|
675 | lastC = index;
|
676 | }
|
677 | });
|
678 |
|
679 | args.splice(lastC, 0, c);
|
680 | return args;
|
681 | }
|
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 | function log() {
|
691 |
|
692 |
|
693 | return 'object' === typeof console
|
694 | && console.log
|
695 | && Function.prototype.apply.call(console.log, console, arguments);
|
696 | }
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 | function save(namespaces) {
|
706 | try {
|
707 | if (null == namespaces) {
|
708 | exports.storage.removeItem('debug');
|
709 | } else {
|
710 | exports.storage.debug = namespaces;
|
711 | }
|
712 | } catch(e) {}
|
713 | }
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 | function load() {
|
723 | var r;
|
724 | try {
|
725 | r = exports.storage.debug;
|
726 | } catch(e) {}
|
727 | return r;
|
728 | }
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 | exports.enable(load());
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 | function localstorage(){
|
748 | try {
|
749 | return window.localStorage;
|
750 | } catch (e) {}
|
751 | }
|
752 |
|
753 | },{"13":13}],13:[function(require,module,exports){
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 | exports = module.exports = debug;
|
763 | exports.coerce = coerce;
|
764 | exports.disable = disable;
|
765 | exports.enable = enable;
|
766 | exports.enabled = enabled;
|
767 | exports.humanize = require(86);
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 | exports.names = [];
|
774 | exports.skips = [];
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 | exports.formatters = {};
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 | var prevColor = 0;
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 | var prevTime;
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 | function selectColor() {
|
804 | return exports.colors[prevColor++ % exports.colors.length];
|
805 | }
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 | function debug(namespace) {
|
816 |
|
817 |
|
818 | function disabled() {
|
819 | }
|
820 | disabled.enabled = false;
|
821 |
|
822 |
|
823 | function enabled() {
|
824 |
|
825 | var self = enabled;
|
826 |
|
827 |
|
828 | var curr = +new Date();
|
829 | var ms = curr - (prevTime || curr);
|
830 | self.diff = ms;
|
831 | self.prev = prevTime;
|
832 | self.curr = curr;
|
833 | prevTime = curr;
|
834 |
|
835 |
|
836 | if (null == self.useColors) self.useColors = exports.useColors();
|
837 | if (null == self.color && self.useColors) self.color = selectColor();
|
838 |
|
839 | var args = Array.prototype.slice.call(arguments);
|
840 |
|
841 | args[0] = exports.coerce(args[0]);
|
842 |
|
843 | if ('string' !== typeof args[0]) {
|
844 |
|
845 | args = ['%o'].concat(args);
|
846 | }
|
847 |
|
848 |
|
849 | var index = 0;
|
850 | args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
|
851 |
|
852 | if (match === '%%') return match;
|
853 | index++;
|
854 | var formatter = exports.formatters[format];
|
855 | if ('function' === typeof formatter) {
|
856 | var val = args[index];
|
857 | match = formatter.call(self, val);
|
858 |
|
859 |
|
860 | args.splice(index, 1);
|
861 | index--;
|
862 | }
|
863 | return match;
|
864 | });
|
865 |
|
866 | if ('function' === typeof exports.formatArgs) {
|
867 | args = exports.formatArgs.apply(self, args);
|
868 | }
|
869 | var logFn = enabled.log || exports.log || console.log.bind(console);
|
870 | logFn.apply(self, args);
|
871 | }
|
872 | enabled.enabled = true;
|
873 |
|
874 | var fn = exports.enabled(namespace) ? enabled : disabled;
|
875 |
|
876 | fn.namespace = namespace;
|
877 |
|
878 | return fn;
|
879 | }
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 | function enable(namespaces) {
|
890 | exports.save(namespaces);
|
891 |
|
892 | var split = (namespaces || '').split(/[\s,]+/);
|
893 | var len = split.length;
|
894 |
|
895 | for (var i = 0; i < len; i++) {
|
896 | if (!split[i]) continue;
|
897 | namespaces = split[i].replace(/\*/g, '.*?');
|
898 | if (namespaces[0] === '-') {
|
899 | exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
900 | } else {
|
901 | exports.names.push(new RegExp('^' + namespaces + '$'));
|
902 | }
|
903 | }
|
904 | }
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 |
|
912 | function disable() {
|
913 | exports.enable('');
|
914 | }
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 | function enabled(name) {
|
925 | var i, len;
|
926 | for (i = 0, len = exports.skips.length; i < len; i++) {
|
927 | if (exports.skips[i].test(name)) {
|
928 | return false;
|
929 | }
|
930 | }
|
931 | for (i = 0, len = exports.names.length; i < len; i++) {
|
932 | if (exports.names[i].test(name)) {
|
933 | return true;
|
934 | }
|
935 | }
|
936 | return false;
|
937 | }
|
938 |
|
939 |
|
940 |
|
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 | function coerce(val) {
|
948 | if (val instanceof Error) return val.stack || val.message;
|
949 | return val;
|
950 | }
|
951 |
|
952 | },{"86":86}],14:[function(require,module,exports){
|
953 | var pSlice = Array.prototype.slice;
|
954 | var objectKeys = require(16);
|
955 | var isArguments = require(15);
|
956 |
|
957 | var deepEqual = module.exports = function (actual, expected, opts) {
|
958 | if (!opts) opts = {};
|
959 |
|
960 | if (actual === expected) {
|
961 | return true;
|
962 |
|
963 | } else if (actual instanceof Date && expected instanceof Date) {
|
964 | return actual.getTime() === expected.getTime();
|
965 |
|
966 |
|
967 |
|
968 | } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {
|
969 | return opts.strict ? actual === expected : actual == expected;
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 | } else {
|
978 | return objEquiv(actual, expected, opts);
|
979 | }
|
980 | }
|
981 |
|
982 | function isUndefinedOrNull(value) {
|
983 | return value === null || value === undefined;
|
984 | }
|
985 |
|
986 | function isBuffer (x) {
|
987 | if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;
|
988 | if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
|
989 | return false;
|
990 | }
|
991 | if (x.length > 0 && typeof x[0] !== 'number') return false;
|
992 | return true;
|
993 | }
|
994 |
|
995 | function objEquiv(a, b, opts) {
|
996 | var i, key;
|
997 | if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
|
998 | return false;
|
999 |
|
1000 | if (a.prototype !== b.prototype) return false;
|
1001 |
|
1002 |
|
1003 | if (isArguments(a)) {
|
1004 | if (!isArguments(b)) {
|
1005 | return false;
|
1006 | }
|
1007 | a = pSlice.call(a);
|
1008 | b = pSlice.call(b);
|
1009 | return deepEqual(a, b, opts);
|
1010 | }
|
1011 | if (isBuffer(a)) {
|
1012 | if (!isBuffer(b)) {
|
1013 | return false;
|
1014 | }
|
1015 | if (a.length !== b.length) return false;
|
1016 | for (i = 0; i < a.length; i++) {
|
1017 | if (a[i] !== b[i]) return false;
|
1018 | }
|
1019 | return true;
|
1020 | }
|
1021 | try {
|
1022 | var ka = objectKeys(a),
|
1023 | kb = objectKeys(b);
|
1024 | } catch (e) {
|
1025 | return false;
|
1026 | }
|
1027 |
|
1028 |
|
1029 | if (ka.length != kb.length)
|
1030 | return false;
|
1031 |
|
1032 | ka.sort();
|
1033 | kb.sort();
|
1034 |
|
1035 | for (i = ka.length - 1; i >= 0; i--) {
|
1036 | if (ka[i] != kb[i])
|
1037 | return false;
|
1038 | }
|
1039 |
|
1040 |
|
1041 | for (i = ka.length - 1; i >= 0; i--) {
|
1042 | key = ka[i];
|
1043 | if (!deepEqual(a[key], b[key], opts)) return false;
|
1044 | }
|
1045 | return typeof a === typeof b;
|
1046 | }
|
1047 |
|
1048 | },{"15":15,"16":16}],15:[function(require,module,exports){
|
1049 | var supportsArgumentsClass = (function(){
|
1050 | return Object.prototype.toString.call(arguments)
|
1051 | })() == '[object Arguments]';
|
1052 |
|
1053 | exports = module.exports = supportsArgumentsClass ? supported : unsupported;
|
1054 |
|
1055 | exports.supported = supported;
|
1056 | function supported(object) {
|
1057 | return Object.prototype.toString.call(object) == '[object Arguments]';
|
1058 | };
|
1059 |
|
1060 | exports.unsupported = unsupported;
|
1061 | function unsupported(object){
|
1062 | return object &&
|
1063 | typeof object == 'object' &&
|
1064 | typeof object.length == 'number' &&
|
1065 | Object.prototype.hasOwnProperty.call(object, 'callee') &&
|
1066 | !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||
|
1067 | false;
|
1068 | };
|
1069 |
|
1070 | },{}],16:[function(require,module,exports){
|
1071 | exports = module.exports = typeof Object.keys === 'function'
|
1072 | ? Object.keys : shim;
|
1073 |
|
1074 | exports.shim = shim;
|
1075 | function shim (obj) {
|
1076 | var keys = [];
|
1077 | for (var key in obj) keys.push(key);
|
1078 | return keys;
|
1079 | }
|
1080 |
|
1081 | },{}],17:[function(require,module,exports){
|
1082 |
|
1083 | module.exports = require(18);
|
1084 |
|
1085 | },{"18":18}],18:[function(require,module,exports){
|
1086 |
|
1087 | module.exports = require(19);
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 | module.exports.parser = require(27);
|
1096 |
|
1097 | },{"19":19,"27":27}],19:[function(require,module,exports){
|
1098 | (function (global){
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 | var transports = require(21);
|
1104 | var Emitter = require(10);
|
1105 | var debug = require(12)('engine.io-client:socket');
|
1106 | var index = require(80);
|
1107 | var parser = require(27);
|
1108 | var parseuri = require(89);
|
1109 | var parsejson = require(87);
|
1110 | var parseqs = require(88);
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 | module.exports = Socket;
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 | function noop(){}
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 |
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 | function Socket(uri, opts){
|
1135 | if (!(this instanceof Socket)) return new Socket(uri, opts);
|
1136 |
|
1137 | opts = opts || {};
|
1138 |
|
1139 | if (uri && 'object' == typeof uri) {
|
1140 | opts = uri;
|
1141 | uri = null;
|
1142 | }
|
1143 |
|
1144 | if (uri) {
|
1145 | uri = parseuri(uri);
|
1146 | opts.hostname = uri.host;
|
1147 | opts.secure = uri.protocol == 'https' || uri.protocol == 'wss';
|
1148 | opts.port = uri.port;
|
1149 | if (uri.query) opts.query = uri.query;
|
1150 | } else if (opts.host) {
|
1151 | opts.hostname = parseuri(opts.host).host;
|
1152 | }
|
1153 |
|
1154 | this.secure = null != opts.secure ? opts.secure :
|
1155 | (global.location && 'https:' == location.protocol);
|
1156 |
|
1157 | if (opts.hostname && !opts.port) {
|
1158 |
|
1159 | opts.port = this.secure ? '443' : '80';
|
1160 | }
|
1161 |
|
1162 | this.agent = opts.agent || false;
|
1163 | this.hostname = opts.hostname ||
|
1164 | (global.location ? location.hostname : 'localhost');
|
1165 | this.port = opts.port || (global.location && location.port ?
|
1166 | location.port :
|
1167 | (this.secure ? 443 : 80));
|
1168 | this.query = opts.query || {};
|
1169 | if ('string' == typeof this.query) this.query = parseqs.decode(this.query);
|
1170 | this.upgrade = false !== opts.upgrade;
|
1171 | this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
|
1172 | this.forceJSONP = !!opts.forceJSONP;
|
1173 | this.jsonp = false !== opts.jsonp;
|
1174 | this.forceBase64 = !!opts.forceBase64;
|
1175 | this.enablesXDR = !!opts.enablesXDR;
|
1176 | this.timestampParam = opts.timestampParam || 't';
|
1177 | this.timestampRequests = opts.timestampRequests;
|
1178 | this.transports = opts.transports || ['polling', 'websocket'];
|
1179 | this.readyState = '';
|
1180 | this.writeBuffer = [];
|
1181 | this.policyPort = opts.policyPort || 843;
|
1182 | this.rememberUpgrade = opts.rememberUpgrade || false;
|
1183 | this.binaryType = null;
|
1184 | this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
|
1185 | this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;
|
1186 |
|
1187 | if (true === this.perMessageDeflate) this.perMessageDeflate = {};
|
1188 | if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
|
1189 | this.perMessageDeflate.threshold = 1024;
|
1190 | }
|
1191 |
|
1192 |
|
1193 | this.pfx = opts.pfx || null;
|
1194 | this.key = opts.key || null;
|
1195 | this.passphrase = opts.passphrase || null;
|
1196 | this.cert = opts.cert || null;
|
1197 | this.ca = opts.ca || null;
|
1198 | this.ciphers = opts.ciphers || null;
|
1199 | this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;
|
1200 |
|
1201 |
|
1202 | var freeGlobal = typeof global == 'object' && global;
|
1203 | if (freeGlobal.global === freeGlobal) {
|
1204 | if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
|
1205 | this.extraHeaders = opts.extraHeaders;
|
1206 | }
|
1207 | }
|
1208 |
|
1209 | this.open();
|
1210 | }
|
1211 |
|
1212 | Socket.priorWebsocketSuccess = false;
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 | Emitter(Socket.prototype);
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 | Socket.protocol = parser.protocol;
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 | Socket.Socket = Socket;
|
1234 | Socket.Transport = require(20);
|
1235 | Socket.transports = require(21);
|
1236 | Socket.parser = require(27);
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 | Socket.prototype.createTransport = function (name) {
|
1247 | debug('creating transport "%s"', name);
|
1248 | var query = clone(this.query);
|
1249 |
|
1250 |
|
1251 | query.EIO = parser.protocol;
|
1252 |
|
1253 |
|
1254 | query.transport = name;
|
1255 |
|
1256 |
|
1257 | if (this.id) query.sid = this.id;
|
1258 |
|
1259 | var transport = new transports[name]({
|
1260 | agent: this.agent,
|
1261 | hostname: this.hostname,
|
1262 | port: this.port,
|
1263 | secure: this.secure,
|
1264 | path: this.path,
|
1265 | query: query,
|
1266 | forceJSONP: this.forceJSONP,
|
1267 | jsonp: this.jsonp,
|
1268 | forceBase64: this.forceBase64,
|
1269 | enablesXDR: this.enablesXDR,
|
1270 | timestampRequests: this.timestampRequests,
|
1271 | timestampParam: this.timestampParam,
|
1272 | policyPort: this.policyPort,
|
1273 | socket: this,
|
1274 | pfx: this.pfx,
|
1275 | key: this.key,
|
1276 | passphrase: this.passphrase,
|
1277 | cert: this.cert,
|
1278 | ca: this.ca,
|
1279 | ciphers: this.ciphers,
|
1280 | rejectUnauthorized: this.rejectUnauthorized,
|
1281 | perMessageDeflate: this.perMessageDeflate,
|
1282 | extraHeaders: this.extraHeaders
|
1283 | });
|
1284 |
|
1285 | return transport;
|
1286 | };
|
1287 |
|
1288 | function clone (obj) {
|
1289 | var o = {};
|
1290 | for (var i in obj) {
|
1291 | if (obj.hasOwnProperty(i)) {
|
1292 | o[i] = obj[i];
|
1293 | }
|
1294 | }
|
1295 | return o;
|
1296 | }
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 | Socket.prototype.open = function () {
|
1304 | var transport;
|
1305 | if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) {
|
1306 | transport = 'websocket';
|
1307 | } else if (0 === this.transports.length) {
|
1308 |
|
1309 | var self = this;
|
1310 | setTimeout(function() {
|
1311 | self.emit('error', 'No transports available');
|
1312 | }, 0);
|
1313 | return;
|
1314 | } else {
|
1315 | transport = this.transports[0];
|
1316 | }
|
1317 | this.readyState = 'opening';
|
1318 |
|
1319 |
|
1320 | try {
|
1321 | transport = this.createTransport(transport);
|
1322 | } catch (e) {
|
1323 | this.transports.shift();
|
1324 | this.open();
|
1325 | return;
|
1326 | }
|
1327 |
|
1328 | transport.open();
|
1329 | this.setTransport(transport);
|
1330 | };
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 | Socket.prototype.setTransport = function(transport){
|
1339 | debug('setting transport %s', transport.name);
|
1340 | var self = this;
|
1341 |
|
1342 | if (this.transport) {
|
1343 | debug('clearing existing transport %s', this.transport.name);
|
1344 | this.transport.removeAllListeners();
|
1345 | }
|
1346 |
|
1347 |
|
1348 | this.transport = transport;
|
1349 |
|
1350 |
|
1351 | transport
|
1352 | .on('drain', function(){
|
1353 | self.onDrain();
|
1354 | })
|
1355 | .on('packet', function(packet){
|
1356 | self.onPacket(packet);
|
1357 | })
|
1358 | .on('error', function(e){
|
1359 | self.onError(e);
|
1360 | })
|
1361 | .on('close', function(){
|
1362 | self.onClose('transport close');
|
1363 | });
|
1364 | };
|
1365 |
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 |
|
1373 | Socket.prototype.probe = function (name) {
|
1374 | debug('probing transport "%s"', name);
|
1375 | var transport = this.createTransport(name, { probe: 1 })
|
1376 | , failed = false
|
1377 | , self = this;
|
1378 |
|
1379 | Socket.priorWebsocketSuccess = false;
|
1380 |
|
1381 | function onTransportOpen(){
|
1382 | if (self.onlyBinaryUpgrades) {
|
1383 | var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
|
1384 | failed = failed || upgradeLosesBinary;
|
1385 | }
|
1386 | if (failed) return;
|
1387 |
|
1388 | debug('probe transport "%s" opened', name);
|
1389 | transport.send([{ type: 'ping', data: 'probe' }]);
|
1390 | transport.once('packet', function (msg) {
|
1391 | if (failed) return;
|
1392 | if ('pong' == msg.type && 'probe' == msg.data) {
|
1393 | debug('probe transport "%s" pong', name);
|
1394 | self.upgrading = true;
|
1395 | self.emit('upgrading', transport);
|
1396 | if (!transport) return;
|
1397 | Socket.priorWebsocketSuccess = 'websocket' == transport.name;
|
1398 |
|
1399 | debug('pausing current transport "%s"', self.transport.name);
|
1400 | self.transport.pause(function () {
|
1401 | if (failed) return;
|
1402 | if ('closed' == self.readyState) return;
|
1403 | debug('changing transport and sending upgrade packet');
|
1404 |
|
1405 | cleanup();
|
1406 |
|
1407 | self.setTransport(transport);
|
1408 | transport.send([{ type: 'upgrade' }]);
|
1409 | self.emit('upgrade', transport);
|
1410 | transport = null;
|
1411 | self.upgrading = false;
|
1412 | self.flush();
|
1413 | });
|
1414 | } else {
|
1415 | debug('probe transport "%s" failed', name);
|
1416 | var err = new Error('probe error');
|
1417 | err.transport = transport.name;
|
1418 | self.emit('upgradeError', err);
|
1419 | }
|
1420 | });
|
1421 | }
|
1422 |
|
1423 | function freezeTransport() {
|
1424 | if (failed) return;
|
1425 |
|
1426 |
|
1427 | failed = true;
|
1428 |
|
1429 | cleanup();
|
1430 |
|
1431 | transport.close();
|
1432 | transport = null;
|
1433 | }
|
1434 |
|
1435 |
|
1436 | function onerror(err) {
|
1437 | var error = new Error('probe error: ' + err);
|
1438 | error.transport = transport.name;
|
1439 |
|
1440 | freezeTransport();
|
1441 |
|
1442 | debug('probe transport "%s" failed because of error: %s', name, err);
|
1443 |
|
1444 | self.emit('upgradeError', error);
|
1445 | }
|
1446 |
|
1447 | function onTransportClose(){
|
1448 | onerror("transport closed");
|
1449 | }
|
1450 |
|
1451 |
|
1452 | function onclose(){
|
1453 | onerror("socket closed");
|
1454 | }
|
1455 |
|
1456 |
|
1457 | function onupgrade(to){
|
1458 | if (transport && to.name != transport.name) {
|
1459 | debug('"%s" works - aborting "%s"', to.name, transport.name);
|
1460 | freezeTransport();
|
1461 | }
|
1462 | }
|
1463 |
|
1464 |
|
1465 | function cleanup(){
|
1466 | transport.removeListener('open', onTransportOpen);
|
1467 | transport.removeListener('error', onerror);
|
1468 | transport.removeListener('close', onTransportClose);
|
1469 | self.removeListener('close', onclose);
|
1470 | self.removeListener('upgrading', onupgrade);
|
1471 | }
|
1472 |
|
1473 | transport.once('open', onTransportOpen);
|
1474 | transport.once('error', onerror);
|
1475 | transport.once('close', onTransportClose);
|
1476 |
|
1477 | this.once('close', onclose);
|
1478 | this.once('upgrading', onupgrade);
|
1479 |
|
1480 | transport.open();
|
1481 |
|
1482 | };
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 | Socket.prototype.onOpen = function () {
|
1491 | debug('socket open');
|
1492 | this.readyState = 'open';
|
1493 | Socket.priorWebsocketSuccess = 'websocket' == this.transport.name;
|
1494 | this.emit('open');
|
1495 | this.flush();
|
1496 |
|
1497 |
|
1498 |
|
1499 | if ('open' == this.readyState && this.upgrade && this.transport.pause) {
|
1500 | debug('starting upgrade probes');
|
1501 | for (var i = 0, l = this.upgrades.length; i < l; i++) {
|
1502 | this.probe(this.upgrades[i]);
|
1503 | }
|
1504 | }
|
1505 | };
|
1506 |
|
1507 |
|
1508 |
|
1509 |
|
1510 |
|
1511 |
|
1512 |
|
1513 | Socket.prototype.onPacket = function (packet) {
|
1514 | if ('opening' == this.readyState || 'open' == this.readyState) {
|
1515 | debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
|
1516 |
|
1517 | this.emit('packet', packet);
|
1518 |
|
1519 |
|
1520 | this.emit('heartbeat');
|
1521 |
|
1522 | switch (packet.type) {
|
1523 | case 'open':
|
1524 | this.onHandshake(parsejson(packet.data));
|
1525 | break;
|
1526 |
|
1527 | case 'pong':
|
1528 | this.setPing();
|
1529 | this.emit('pong');
|
1530 | break;
|
1531 |
|
1532 | case 'error':
|
1533 | var err = new Error('server error');
|
1534 | err.code = packet.data;
|
1535 | this.onError(err);
|
1536 | break;
|
1537 |
|
1538 | case 'message':
|
1539 | this.emit('data', packet.data);
|
1540 | this.emit('message', packet.data);
|
1541 | break;
|
1542 | }
|
1543 | } else {
|
1544 | debug('packet received with socket readyState "%s"', this.readyState);
|
1545 | }
|
1546 | };
|
1547 |
|
1548 |
|
1549 |
|
1550 |
|
1551 |
|
1552 |
|
1553 |
|
1554 |
|
1555 | Socket.prototype.onHandshake = function (data) {
|
1556 | this.emit('handshake', data);
|
1557 | this.id = data.sid;
|
1558 | this.transport.query.sid = data.sid;
|
1559 | this.upgrades = this.filterUpgrades(data.upgrades);
|
1560 | this.pingInterval = data.pingInterval;
|
1561 | this.pingTimeout = data.pingTimeout;
|
1562 | this.onOpen();
|
1563 |
|
1564 | if ('closed' == this.readyState) return;
|
1565 | this.setPing();
|
1566 |
|
1567 |
|
1568 | this.removeListener('heartbeat', this.onHeartbeat);
|
1569 | this.on('heartbeat', this.onHeartbeat);
|
1570 | };
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 |
|
1577 |
|
1578 | Socket.prototype.onHeartbeat = function (timeout) {
|
1579 | clearTimeout(this.pingTimeoutTimer);
|
1580 | var self = this;
|
1581 | self.pingTimeoutTimer = setTimeout(function () {
|
1582 | if ('closed' == self.readyState) return;
|
1583 | self.onClose('ping timeout');
|
1584 | }, timeout || (self.pingInterval + self.pingTimeout));
|
1585 | };
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 | Socket.prototype.setPing = function () {
|
1595 | var self = this;
|
1596 | clearTimeout(self.pingIntervalTimer);
|
1597 | self.pingIntervalTimer = setTimeout(function () {
|
1598 | debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
|
1599 | self.ping();
|
1600 | self.onHeartbeat(self.pingTimeout);
|
1601 | }, self.pingInterval);
|
1602 | };
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 | Socket.prototype.ping = function () {
|
1611 | var self = this;
|
1612 | this.sendPacket('ping', function(){
|
1613 | self.emit('ping');
|
1614 | });
|
1615 | };
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 | Socket.prototype.onDrain = function() {
|
1624 | this.writeBuffer.splice(0, this.prevBufferLen);
|
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 | this.prevBufferLen = 0;
|
1630 |
|
1631 | if (0 === this.writeBuffer.length) {
|
1632 | this.emit('drain');
|
1633 | } else {
|
1634 | this.flush();
|
1635 | }
|
1636 | };
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 | Socket.prototype.flush = function () {
|
1645 | if ('closed' != this.readyState && this.transport.writable &&
|
1646 | !this.upgrading && this.writeBuffer.length) {
|
1647 | debug('flushing %d packets in socket', this.writeBuffer.length);
|
1648 | this.transport.send(this.writeBuffer);
|
1649 |
|
1650 |
|
1651 | this.prevBufferLen = this.writeBuffer.length;
|
1652 | this.emit('flush');
|
1653 | }
|
1654 | };
|
1655 |
|
1656 |
|
1657 |
|
1658 |
|
1659 |
|
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 | Socket.prototype.write =
|
1667 | Socket.prototype.send = function (msg, options, fn) {
|
1668 | this.sendPacket('message', msg, options, fn);
|
1669 | return this;
|
1670 | };
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 | Socket.prototype.sendPacket = function (type, data, options, fn) {
|
1683 | if('function' == typeof data) {
|
1684 | fn = data;
|
1685 | data = undefined;
|
1686 | }
|
1687 |
|
1688 | if ('function' == typeof options) {
|
1689 | fn = options;
|
1690 | options = null;
|
1691 | }
|
1692 |
|
1693 | if ('closing' == this.readyState || 'closed' == this.readyState) {
|
1694 | return;
|
1695 | }
|
1696 |
|
1697 | options = options || {};
|
1698 | options.compress = false !== options.compress;
|
1699 |
|
1700 | var packet = {
|
1701 | type: type,
|
1702 | data: data,
|
1703 | options: options
|
1704 | };
|
1705 | this.emit('packetCreate', packet);
|
1706 | this.writeBuffer.push(packet);
|
1707 | if (fn) this.once('flush', fn);
|
1708 | this.flush();
|
1709 | };
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 | Socket.prototype.close = function () {
|
1718 | if ('opening' == this.readyState || 'open' == this.readyState) {
|
1719 | this.readyState = 'closing';
|
1720 |
|
1721 | var self = this;
|
1722 |
|
1723 | if (this.writeBuffer.length) {
|
1724 | this.once('drain', function() {
|
1725 | if (this.upgrading) {
|
1726 | waitForUpgrade();
|
1727 | } else {
|
1728 | close();
|
1729 | }
|
1730 | });
|
1731 | } else if (this.upgrading) {
|
1732 | waitForUpgrade();
|
1733 | } else {
|
1734 | close();
|
1735 | }
|
1736 | }
|
1737 |
|
1738 | function close() {
|
1739 | self.onClose('forced close');
|
1740 | debug('socket closing - telling transport to close');
|
1741 | self.transport.close();
|
1742 | }
|
1743 |
|
1744 | function cleanupAndClose() {
|
1745 | self.removeListener('upgrade', cleanupAndClose);
|
1746 | self.removeListener('upgradeError', cleanupAndClose);
|
1747 | close();
|
1748 | }
|
1749 |
|
1750 | function waitForUpgrade() {
|
1751 |
|
1752 | self.once('upgrade', cleanupAndClose);
|
1753 | self.once('upgradeError', cleanupAndClose);
|
1754 | }
|
1755 |
|
1756 | return this;
|
1757 | };
|
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 |
|
1765 | Socket.prototype.onError = function (err) {
|
1766 | debug('socket error %j', err);
|
1767 | Socket.priorWebsocketSuccess = false;
|
1768 | this.emit('error', err);
|
1769 | this.onClose('transport error', err);
|
1770 | };
|
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 |
|
1777 |
|
1778 | Socket.prototype.onClose = function (reason, desc) {
|
1779 | if ('opening' == this.readyState || 'open' == this.readyState || 'closing' == this.readyState) {
|
1780 | debug('socket close with reason: "%s"', reason);
|
1781 | var self = this;
|
1782 |
|
1783 |
|
1784 | clearTimeout(this.pingIntervalTimer);
|
1785 | clearTimeout(this.pingTimeoutTimer);
|
1786 |
|
1787 |
|
1788 | this.transport.removeAllListeners('close');
|
1789 |
|
1790 |
|
1791 | this.transport.close();
|
1792 |
|
1793 |
|
1794 | this.transport.removeAllListeners();
|
1795 |
|
1796 |
|
1797 | this.readyState = 'closed';
|
1798 |
|
1799 |
|
1800 | this.id = null;
|
1801 |
|
1802 |
|
1803 | this.emit('close', reason, desc);
|
1804 |
|
1805 |
|
1806 |
|
1807 | self.writeBuffer = [];
|
1808 | self.prevBufferLen = 0;
|
1809 | }
|
1810 | };
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 | Socket.prototype.filterUpgrades = function (upgrades) {
|
1821 | var filteredUpgrades = [];
|
1822 | for (var i = 0, j = upgrades.length; i<j; i++) {
|
1823 | if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
|
1824 | }
|
1825 | return filteredUpgrades;
|
1826 | };
|
1827 |
|
1828 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
1829 | },{"10":10,"12":12,"20":20,"21":21,"27":27,"80":80,"87":87,"88":88,"89":89}],20:[function(require,module,exports){
|
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 | var parser = require(27);
|
1835 | var Emitter = require(10);
|
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 | module.exports = Transport;
|
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 |
|
1848 |
|
1849 |
|
1850 | function Transport (opts) {
|
1851 | this.path = opts.path;
|
1852 | this.hostname = opts.hostname;
|
1853 | this.port = opts.port;
|
1854 | this.secure = opts.secure;
|
1855 | this.query = opts.query;
|
1856 | this.timestampParam = opts.timestampParam;
|
1857 | this.timestampRequests = opts.timestampRequests;
|
1858 | this.readyState = '';
|
1859 | this.agent = opts.agent || false;
|
1860 | this.socket = opts.socket;
|
1861 | this.enablesXDR = opts.enablesXDR;
|
1862 |
|
1863 |
|
1864 | this.pfx = opts.pfx;
|
1865 | this.key = opts.key;
|
1866 | this.passphrase = opts.passphrase;
|
1867 | this.cert = opts.cert;
|
1868 | this.ca = opts.ca;
|
1869 | this.ciphers = opts.ciphers;
|
1870 | this.rejectUnauthorized = opts.rejectUnauthorized;
|
1871 |
|
1872 |
|
1873 | this.extraHeaders = opts.extraHeaders;
|
1874 | }
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 | Emitter(Transport.prototype);
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 |
|
1889 |
|
1890 | Transport.prototype.onError = function (msg, desc) {
|
1891 | var err = new Error(msg);
|
1892 | err.type = 'TransportError';
|
1893 | err.description = desc;
|
1894 | this.emit('error', err);
|
1895 | return this;
|
1896 | };
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 | Transport.prototype.open = function () {
|
1905 | if ('closed' == this.readyState || '' == this.readyState) {
|
1906 | this.readyState = 'opening';
|
1907 | this.doOpen();
|
1908 | }
|
1909 |
|
1910 | return this;
|
1911 | };
|
1912 |
|
1913 |
|
1914 |
|
1915 |
|
1916 |
|
1917 |
|
1918 |
|
1919 | Transport.prototype.close = function () {
|
1920 | if ('opening' == this.readyState || 'open' == this.readyState) {
|
1921 | this.doClose();
|
1922 | this.onClose();
|
1923 | }
|
1924 |
|
1925 | return this;
|
1926 | };
|
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 |
|
1932 |
|
1933 |
|
1934 |
|
1935 | Transport.prototype.send = function(packets){
|
1936 | if ('open' == this.readyState) {
|
1937 | this.write(packets);
|
1938 | } else {
|
1939 | throw new Error('Transport not open');
|
1940 | }
|
1941 | };
|
1942 |
|
1943 |
|
1944 |
|
1945 |
|
1946 |
|
1947 |
|
1948 |
|
1949 | Transport.prototype.onOpen = function () {
|
1950 | this.readyState = 'open';
|
1951 | this.writable = true;
|
1952 | this.emit('open');
|
1953 | };
|
1954 |
|
1955 |
|
1956 |
|
1957 |
|
1958 |
|
1959 |
|
1960 |
|
1961 |
|
1962 | Transport.prototype.onData = function(data){
|
1963 | var packet = parser.decodePacket(data, this.socket.binaryType);
|
1964 | this.onPacket(packet);
|
1965 | };
|
1966 |
|
1967 |
|
1968 |
|
1969 |
|
1970 |
|
1971 | Transport.prototype.onPacket = function (packet) {
|
1972 | this.emit('packet', packet);
|
1973 | };
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 |
|
1981 | Transport.prototype.onClose = function () {
|
1982 | this.readyState = 'closed';
|
1983 | this.emit('close');
|
1984 | };
|
1985 |
|
1986 | },{"10":10,"27":27}],21:[function(require,module,exports){
|
1987 | (function (global){
|
1988 |
|
1989 |
|
1990 |
|
1991 |
|
1992 | var XMLHttpRequest = require(26);
|
1993 | var XHR = require(23);
|
1994 | var JSONP = require(22);
|
1995 | var websocket = require(25);
|
1996 |
|
1997 |
|
1998 |
|
1999 |
|
2000 |
|
2001 | exports.polling = polling;
|
2002 | exports.websocket = websocket;
|
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 | function polling(opts){
|
2012 | var xhr;
|
2013 | var xd = false;
|
2014 | var xs = false;
|
2015 | var jsonp = false !== opts.jsonp;
|
2016 |
|
2017 | if (global.location) {
|
2018 | var isSSL = 'https:' == location.protocol;
|
2019 | var port = location.port;
|
2020 |
|
2021 |
|
2022 | if (!port) {
|
2023 | port = isSSL ? 443 : 80;
|
2024 | }
|
2025 |
|
2026 | xd = opts.hostname != location.hostname || port != opts.port;
|
2027 | xs = opts.secure != isSSL;
|
2028 | }
|
2029 |
|
2030 | opts.xdomain = xd;
|
2031 | opts.xscheme = xs;
|
2032 | xhr = new XMLHttpRequest(opts);
|
2033 |
|
2034 | if ('open' in xhr && !opts.forceJSONP) {
|
2035 | return new XHR(opts);
|
2036 | } else {
|
2037 | if (!jsonp) throw new Error('JSONP disabled');
|
2038 | return new JSONP(opts);
|
2039 | }
|
2040 | }
|
2041 |
|
2042 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
2043 | },{"22":22,"23":23,"25":25,"26":26}],22:[function(require,module,exports){
|
2044 | (function (global){
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 |
|
2050 | var Polling = require(24);
|
2051 | var inherit = require(11);
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 | module.exports = JSONPPolling;
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 | var rNewline = /\n/g;
|
2064 | var rEscapedNewline = /\\n/g;
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 | var callbacks;
|
2071 |
|
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 | var index = 0;
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 | function empty () { }
|
2083 |
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 | function JSONPPolling (opts) {
|
2092 | Polling.call(this, opts);
|
2093 |
|
2094 | this.query = this.query || {};
|
2095 |
|
2096 |
|
2097 |
|
2098 | if (!callbacks) {
|
2099 |
|
2100 | if (!global.___eio) global.___eio = [];
|
2101 | callbacks = global.___eio;
|
2102 | }
|
2103 |
|
2104 |
|
2105 | this.index = callbacks.length;
|
2106 |
|
2107 |
|
2108 | var self = this;
|
2109 | callbacks.push(function (msg) {
|
2110 | self.onData(msg);
|
2111 | });
|
2112 |
|
2113 |
|
2114 | this.query.j = this.index;
|
2115 |
|
2116 |
|
2117 | if (global.document && global.addEventListener) {
|
2118 | global.addEventListener('beforeunload', function () {
|
2119 | if (self.script) self.script.onerror = empty;
|
2120 | }, false);
|
2121 | }
|
2122 | }
|
2123 |
|
2124 |
|
2125 |
|
2126 |
|
2127 |
|
2128 | inherit(JSONPPolling, Polling);
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 | JSONPPolling.prototype.supportsBinary = false;
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 | JSONPPolling.prototype.doClose = function () {
|
2143 | if (this.script) {
|
2144 | this.script.parentNode.removeChild(this.script);
|
2145 | this.script = null;
|
2146 | }
|
2147 |
|
2148 | if (this.form) {
|
2149 | this.form.parentNode.removeChild(this.form);
|
2150 | this.form = null;
|
2151 | this.iframe = null;
|
2152 | }
|
2153 |
|
2154 | Polling.prototype.doClose.call(this);
|
2155 | };
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 | JSONPPolling.prototype.doPoll = function () {
|
2164 | var self = this;
|
2165 | var script = document.createElement('script');
|
2166 |
|
2167 | if (this.script) {
|
2168 | this.script.parentNode.removeChild(this.script);
|
2169 | this.script = null;
|
2170 | }
|
2171 |
|
2172 | script.async = true;
|
2173 | script.src = this.uri();
|
2174 | script.onerror = function(e){
|
2175 | self.onError('jsonp poll error',e);
|
2176 | };
|
2177 |
|
2178 | var insertAt = document.getElementsByTagName('script')[0];
|
2179 | if (insertAt) {
|
2180 | insertAt.parentNode.insertBefore(script, insertAt);
|
2181 | }
|
2182 | else {
|
2183 | (document.head || document.body).appendChild(script);
|
2184 | }
|
2185 | this.script = script;
|
2186 |
|
2187 | var isUAgecko = 'undefined' != typeof navigator && /gecko/i.test(navigator.userAgent);
|
2188 |
|
2189 | if (isUAgecko) {
|
2190 | setTimeout(function () {
|
2191 | var iframe = document.createElement('iframe');
|
2192 | document.body.appendChild(iframe);
|
2193 | document.body.removeChild(iframe);
|
2194 | }, 100);
|
2195 | }
|
2196 | };
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 | JSONPPolling.prototype.doWrite = function (data, fn) {
|
2207 | var self = this;
|
2208 |
|
2209 | if (!this.form) {
|
2210 | var form = document.createElement('form');
|
2211 | var area = document.createElement('textarea');
|
2212 | var id = this.iframeId = 'eio_iframe_' + this.index;
|
2213 | var iframe;
|
2214 |
|
2215 | form.className = 'socketio';
|
2216 | form.style.position = 'absolute';
|
2217 | form.style.top = '-1000px';
|
2218 | form.style.left = '-1000px';
|
2219 | form.target = id;
|
2220 | form.method = 'POST';
|
2221 | form.setAttribute('accept-charset', 'utf-8');
|
2222 | area.name = 'd';
|
2223 | form.appendChild(area);
|
2224 | document.body.appendChild(form);
|
2225 |
|
2226 | this.form = form;
|
2227 | this.area = area;
|
2228 | }
|
2229 |
|
2230 | this.form.action = this.uri();
|
2231 |
|
2232 | function complete () {
|
2233 | initIframe();
|
2234 | fn();
|
2235 | }
|
2236 |
|
2237 | function initIframe () {
|
2238 | if (self.iframe) {
|
2239 | try {
|
2240 | self.form.removeChild(self.iframe);
|
2241 | } catch (e) {
|
2242 | self.onError('jsonp polling iframe removal error', e);
|
2243 | }
|
2244 | }
|
2245 |
|
2246 | try {
|
2247 |
|
2248 | var html = '<iframe src="javascript:0" name="'+ self.iframeId +'">';
|
2249 | iframe = document.createElement(html);
|
2250 | } catch (e) {
|
2251 | iframe = document.createElement('iframe');
|
2252 | iframe.name = self.iframeId;
|
2253 | iframe.src = 'javascript:0';
|
2254 | }
|
2255 |
|
2256 | iframe.id = self.iframeId;
|
2257 |
|
2258 | self.form.appendChild(iframe);
|
2259 | self.iframe = iframe;
|
2260 | }
|
2261 |
|
2262 | initIframe();
|
2263 |
|
2264 |
|
2265 |
|
2266 | data = data.replace(rEscapedNewline, '\\\n');
|
2267 | this.area.value = data.replace(rNewline, '\\n');
|
2268 |
|
2269 | try {
|
2270 | this.form.submit();
|
2271 | } catch(e) {}
|
2272 |
|
2273 | if (this.iframe.attachEvent) {
|
2274 | this.iframe.onreadystatechange = function(){
|
2275 | if (self.iframe.readyState == 'complete') {
|
2276 | complete();
|
2277 | }
|
2278 | };
|
2279 | } else {
|
2280 | this.iframe.onload = complete;
|
2281 | }
|
2282 | };
|
2283 |
|
2284 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
2285 | },{"11":11,"24":24}],23:[function(require,module,exports){
|
2286 | (function (global){
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 | var XMLHttpRequest = require(26);
|
2292 | var Polling = require(24);
|
2293 | var Emitter = require(10);
|
2294 | var inherit = require(11);
|
2295 | var debug = require(12)('engine.io-client:polling-xhr');
|
2296 |
|
2297 |
|
2298 |
|
2299 |
|
2300 |
|
2301 | module.exports = XHR;
|
2302 | module.exports.Request = Request;
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 |
|
2308 | function empty(){}
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 |
|
2315 |
|
2316 |
|
2317 | function XHR(opts){
|
2318 | Polling.call(this, opts);
|
2319 |
|
2320 | if (global.location) {
|
2321 | var isSSL = 'https:' == location.protocol;
|
2322 | var port = location.port;
|
2323 |
|
2324 |
|
2325 | if (!port) {
|
2326 | port = isSSL ? 443 : 80;
|
2327 | }
|
2328 |
|
2329 | this.xd = opts.hostname != global.location.hostname ||
|
2330 | port != opts.port;
|
2331 | this.xs = opts.secure != isSSL;
|
2332 | } else {
|
2333 | this.extraHeaders = opts.extraHeaders;
|
2334 | }
|
2335 | }
|
2336 |
|
2337 |
|
2338 |
|
2339 |
|
2340 |
|
2341 | inherit(XHR, Polling);
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 |
|
2347 | XHR.prototype.supportsBinary = true;
|
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 | XHR.prototype.request = function(opts){
|
2357 | opts = opts || {};
|
2358 | opts.uri = this.uri();
|
2359 | opts.xd = this.xd;
|
2360 | opts.xs = this.xs;
|
2361 | opts.agent = this.agent || false;
|
2362 | opts.supportsBinary = this.supportsBinary;
|
2363 | opts.enablesXDR = this.enablesXDR;
|
2364 |
|
2365 |
|
2366 | opts.pfx = this.pfx;
|
2367 | opts.key = this.key;
|
2368 | opts.passphrase = this.passphrase;
|
2369 | opts.cert = this.cert;
|
2370 | opts.ca = this.ca;
|
2371 | opts.ciphers = this.ciphers;
|
2372 | opts.rejectUnauthorized = this.rejectUnauthorized;
|
2373 |
|
2374 |
|
2375 | opts.extraHeaders = this.extraHeaders;
|
2376 |
|
2377 | return new Request(opts);
|
2378 | };
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 |
|
2384 |
|
2385 |
|
2386 |
|
2387 |
|
2388 | XHR.prototype.doWrite = function(data, fn){
|
2389 | var isBinary = typeof data !== 'string' && data !== undefined;
|
2390 | var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
|
2391 | var self = this;
|
2392 | req.on('success', fn);
|
2393 | req.on('error', function(err){
|
2394 | self.onError('xhr post error', err);
|
2395 | });
|
2396 | this.sendXhr = req;
|
2397 | };
|
2398 |
|
2399 |
|
2400 |
|
2401 |
|
2402 |
|
2403 |
|
2404 |
|
2405 | XHR.prototype.doPoll = function(){
|
2406 | debug('xhr poll');
|
2407 | var req = this.request();
|
2408 | var self = this;
|
2409 | req.on('data', function(data){
|
2410 | self.onData(data);
|
2411 | });
|
2412 | req.on('error', function(err){
|
2413 | self.onError('xhr poll error', err);
|
2414 | });
|
2415 | this.pollXhr = req;
|
2416 | };
|
2417 |
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 |
|
2425 | function Request(opts){
|
2426 | this.method = opts.method || 'GET';
|
2427 | this.uri = opts.uri;
|
2428 | this.xd = !!opts.xd;
|
2429 | this.xs = !!opts.xs;
|
2430 | this.async = false !== opts.async;
|
2431 | this.data = undefined != opts.data ? opts.data : null;
|
2432 | this.agent = opts.agent;
|
2433 | this.isBinary = opts.isBinary;
|
2434 | this.supportsBinary = opts.supportsBinary;
|
2435 | this.enablesXDR = opts.enablesXDR;
|
2436 |
|
2437 |
|
2438 | this.pfx = opts.pfx;
|
2439 | this.key = opts.key;
|
2440 | this.passphrase = opts.passphrase;
|
2441 | this.cert = opts.cert;
|
2442 | this.ca = opts.ca;
|
2443 | this.ciphers = opts.ciphers;
|
2444 | this.rejectUnauthorized = opts.rejectUnauthorized;
|
2445 |
|
2446 |
|
2447 | this.extraHeaders = opts.extraHeaders;
|
2448 |
|
2449 | this.create();
|
2450 | }
|
2451 |
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 | Emitter(Request.prototype);
|
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 | Request.prototype.create = function(){
|
2465 | var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
|
2466 |
|
2467 |
|
2468 | opts.pfx = this.pfx;
|
2469 | opts.key = this.key;
|
2470 | opts.passphrase = this.passphrase;
|
2471 | opts.cert = this.cert;
|
2472 | opts.ca = this.ca;
|
2473 | opts.ciphers = this.ciphers;
|
2474 | opts.rejectUnauthorized = this.rejectUnauthorized;
|
2475 |
|
2476 | var xhr = this.xhr = new XMLHttpRequest(opts);
|
2477 | var self = this;
|
2478 |
|
2479 | try {
|
2480 | debug('xhr open %s: %s', this.method, this.uri);
|
2481 | xhr.open(this.method, this.uri, this.async);
|
2482 | try {
|
2483 | if (this.extraHeaders) {
|
2484 | xhr.setDisableHeaderCheck(true);
|
2485 | for (var i in this.extraHeaders) {
|
2486 | if (this.extraHeaders.hasOwnProperty(i)) {
|
2487 | xhr.setRequestHeader(i, this.extraHeaders[i]);
|
2488 | }
|
2489 | }
|
2490 | }
|
2491 | } catch (e) {}
|
2492 | if (this.supportsBinary) {
|
2493 |
|
2494 |
|
2495 | xhr.responseType = 'arraybuffer';
|
2496 | }
|
2497 |
|
2498 | if ('POST' == this.method) {
|
2499 | try {
|
2500 | if (this.isBinary) {
|
2501 | xhr.setRequestHeader('Content-type', 'application/octet-stream');
|
2502 | } else {
|
2503 | xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
|
2504 | }
|
2505 | } catch (e) {}
|
2506 | }
|
2507 |
|
2508 |
|
2509 | if ('withCredentials' in xhr) {
|
2510 | xhr.withCredentials = true;
|
2511 | }
|
2512 |
|
2513 | if (this.hasXDR()) {
|
2514 | xhr.onload = function(){
|
2515 | self.onLoad();
|
2516 | };
|
2517 | xhr.onerror = function(){
|
2518 | self.onError(xhr.responseText);
|
2519 | };
|
2520 | } else {
|
2521 | xhr.onreadystatechange = function(){
|
2522 | if (4 != xhr.readyState) return;
|
2523 | if (200 == xhr.status || 1223 == xhr.status) {
|
2524 | self.onLoad();
|
2525 | } else {
|
2526 |
|
2527 |
|
2528 | setTimeout(function(){
|
2529 | self.onError(xhr.status);
|
2530 | }, 0);
|
2531 | }
|
2532 | };
|
2533 | }
|
2534 |
|
2535 | debug('xhr data %s', this.data);
|
2536 | xhr.send(this.data);
|
2537 | } catch (e) {
|
2538 |
|
2539 |
|
2540 |
|
2541 | setTimeout(function() {
|
2542 | self.onError(e);
|
2543 | }, 0);
|
2544 | return;
|
2545 | }
|
2546 |
|
2547 | if (global.document) {
|
2548 | this.index = Request.requestsCount++;
|
2549 | Request.requests[this.index] = this;
|
2550 | }
|
2551 | };
|
2552 |
|
2553 |
|
2554 |
|
2555 |
|
2556 |
|
2557 |
|
2558 |
|
2559 | Request.prototype.onSuccess = function(){
|
2560 | this.emit('success');
|
2561 | this.cleanup();
|
2562 | };
|
2563 |
|
2564 |
|
2565 |
|
2566 |
|
2567 |
|
2568 |
|
2569 |
|
2570 | Request.prototype.onData = function(data){
|
2571 | this.emit('data', data);
|
2572 | this.onSuccess();
|
2573 | };
|
2574 |
|
2575 |
|
2576 |
|
2577 |
|
2578 |
|
2579 |
|
2580 |
|
2581 | Request.prototype.onError = function(err){
|
2582 | this.emit('error', err);
|
2583 | this.cleanup(true);
|
2584 | };
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 | Request.prototype.cleanup = function(fromError){
|
2593 | if ('undefined' == typeof this.xhr || null === this.xhr) {
|
2594 | return;
|
2595 | }
|
2596 |
|
2597 | if (this.hasXDR()) {
|
2598 | this.xhr.onload = this.xhr.onerror = empty;
|
2599 | } else {
|
2600 | this.xhr.onreadystatechange = empty;
|
2601 | }
|
2602 |
|
2603 | if (fromError) {
|
2604 | try {
|
2605 | this.xhr.abort();
|
2606 | } catch(e) {}
|
2607 | }
|
2608 |
|
2609 | if (global.document) {
|
2610 | delete Request.requests[this.index];
|
2611 | }
|
2612 |
|
2613 | this.xhr = null;
|
2614 | };
|
2615 |
|
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 |
|
2621 |
|
2622 | Request.prototype.onLoad = function(){
|
2623 | var data;
|
2624 | try {
|
2625 | var contentType;
|
2626 | try {
|
2627 | contentType = this.xhr.getResponseHeader('Content-Type').split(';')[0];
|
2628 | } catch (e) {}
|
2629 | if (contentType === 'application/octet-stream') {
|
2630 | data = this.xhr.response;
|
2631 | } else {
|
2632 | if (!this.supportsBinary) {
|
2633 | data = this.xhr.responseText;
|
2634 | } else {
|
2635 | try {
|
2636 | data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));
|
2637 | } catch (e) {
|
2638 | var ui8Arr = new Uint8Array(this.xhr.response);
|
2639 | var dataArray = [];
|
2640 | for (var idx = 0, length = ui8Arr.length; idx < length; idx++) {
|
2641 | dataArray.push(ui8Arr[idx]);
|
2642 | }
|
2643 |
|
2644 | data = String.fromCharCode.apply(null, dataArray);
|
2645 | }
|
2646 | }
|
2647 | }
|
2648 | } catch (e) {
|
2649 | this.onError(e);
|
2650 | }
|
2651 | if (null != data) {
|
2652 | this.onData(data);
|
2653 | }
|
2654 | };
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 | Request.prototype.hasXDR = function(){
|
2663 | return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;
|
2664 | };
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 | Request.prototype.abort = function(){
|
2673 | this.cleanup();
|
2674 | };
|
2675 |
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 | if (global.document) {
|
2683 | Request.requestsCount = 0;
|
2684 | Request.requests = {};
|
2685 | if (global.attachEvent) {
|
2686 | global.attachEvent('onunload', unloadHandler);
|
2687 | } else if (global.addEventListener) {
|
2688 | global.addEventListener('beforeunload', unloadHandler, false);
|
2689 | }
|
2690 | }
|
2691 |
|
2692 | function unloadHandler() {
|
2693 | for (var i in Request.requests) {
|
2694 | if (Request.requests.hasOwnProperty(i)) {
|
2695 | Request.requests[i].abort();
|
2696 | }
|
2697 | }
|
2698 | }
|
2699 |
|
2700 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
2701 | },{"10":10,"11":11,"12":12,"24":24,"26":26}],24:[function(require,module,exports){
|
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 | var Transport = require(20);
|
2707 | var parseqs = require(88);
|
2708 | var parser = require(27);
|
2709 | var inherit = require(11);
|
2710 | var yeast = require(338);
|
2711 | var debug = require(12)('engine.io-client:polling');
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 | module.exports = Polling;
|
2718 |
|
2719 |
|
2720 |
|
2721 |
|
2722 |
|
2723 | var hasXHR2 = (function() {
|
2724 | var XMLHttpRequest = require(26);
|
2725 | var xhr = new XMLHttpRequest({ xdomain: false });
|
2726 | return null != xhr.responseType;
|
2727 | })();
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 |
|
2736 | function Polling(opts){
|
2737 | var forceBase64 = (opts && opts.forceBase64);
|
2738 | if (!hasXHR2 || forceBase64) {
|
2739 | this.supportsBinary = false;
|
2740 | }
|
2741 | Transport.call(this, opts);
|
2742 | }
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 | inherit(Polling, Transport);
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 | Polling.prototype.name = 'polling';
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 | Polling.prototype.doOpen = function(){
|
2764 | this.poll();
|
2765 | };
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 | Polling.prototype.pause = function(onPause){
|
2775 | var pending = 0;
|
2776 | var self = this;
|
2777 |
|
2778 | this.readyState = 'pausing';
|
2779 |
|
2780 | function pause(){
|
2781 | debug('paused');
|
2782 | self.readyState = 'paused';
|
2783 | onPause();
|
2784 | }
|
2785 |
|
2786 | if (this.polling || !this.writable) {
|
2787 | var total = 0;
|
2788 |
|
2789 | if (this.polling) {
|
2790 | debug('we are currently polling - waiting to pause');
|
2791 | total++;
|
2792 | this.once('pollComplete', function(){
|
2793 | debug('pre-pause polling complete');
|
2794 | --total || pause();
|
2795 | });
|
2796 | }
|
2797 |
|
2798 | if (!this.writable) {
|
2799 | debug('we are currently writing - waiting to pause');
|
2800 | total++;
|
2801 | this.once('drain', function(){
|
2802 | debug('pre-pause writing complete');
|
2803 | --total || pause();
|
2804 | });
|
2805 | }
|
2806 | } else {
|
2807 | pause();
|
2808 | }
|
2809 | };
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 | Polling.prototype.poll = function(){
|
2818 | debug('polling');
|
2819 | this.polling = true;
|
2820 | this.doPoll();
|
2821 | this.emit('poll');
|
2822 | };
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 |
|
2828 |
|
2829 |
|
2830 | Polling.prototype.onData = function(data){
|
2831 | var self = this;
|
2832 | debug('polling got data %s', data);
|
2833 | var callback = function(packet, index, total) {
|
2834 |
|
2835 | if ('opening' == self.readyState) {
|
2836 | self.onOpen();
|
2837 | }
|
2838 |
|
2839 |
|
2840 | if ('close' == packet.type) {
|
2841 | self.onClose();
|
2842 | return false;
|
2843 | }
|
2844 |
|
2845 |
|
2846 | self.onPacket(packet);
|
2847 | };
|
2848 |
|
2849 |
|
2850 | parser.decodePayload(data, this.socket.binaryType, callback);
|
2851 |
|
2852 |
|
2853 | if ('closed' != this.readyState) {
|
2854 |
|
2855 | this.polling = false;
|
2856 | this.emit('pollComplete');
|
2857 |
|
2858 | if ('open' == this.readyState) {
|
2859 | this.poll();
|
2860 | } else {
|
2861 | debug('ignoring poll - transport state "%s"', this.readyState);
|
2862 | }
|
2863 | }
|
2864 | };
|
2865 |
|
2866 |
|
2867 |
|
2868 |
|
2869 |
|
2870 |
|
2871 |
|
2872 | Polling.prototype.doClose = function(){
|
2873 | var self = this;
|
2874 |
|
2875 | function close(){
|
2876 | debug('writing close packet');
|
2877 | self.write([{ type: 'close' }]);
|
2878 | }
|
2879 |
|
2880 | if ('open' == this.readyState) {
|
2881 | debug('transport open - closing');
|
2882 | close();
|
2883 | } else {
|
2884 |
|
2885 |
|
2886 | debug('transport not open - deferring close');
|
2887 | this.once('open', close);
|
2888 | }
|
2889 | };
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 |
|
2897 |
|
2898 |
|
2899 | Polling.prototype.write = function(packets){
|
2900 | var self = this;
|
2901 | this.writable = false;
|
2902 | var callbackfn = function() {
|
2903 | self.writable = true;
|
2904 | self.emit('drain');
|
2905 | };
|
2906 |
|
2907 | var self = this;
|
2908 | parser.encodePayload(packets, this.supportsBinary, function(data) {
|
2909 | self.doWrite(data, callbackfn);
|
2910 | });
|
2911 | };
|
2912 |
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 | Polling.prototype.uri = function(){
|
2920 | var query = this.query || {};
|
2921 | var schema = this.secure ? 'https' : 'http';
|
2922 | var port = '';
|
2923 |
|
2924 |
|
2925 | if (false !== this.timestampRequests) {
|
2926 | query[this.timestampParam] = yeast();
|
2927 | }
|
2928 |
|
2929 | if (!this.supportsBinary && !query.sid) {
|
2930 | query.b64 = 1;
|
2931 | }
|
2932 |
|
2933 | query = parseqs.encode(query);
|
2934 |
|
2935 |
|
2936 | if (this.port && (('https' == schema && this.port != 443) ||
|
2937 | ('http' == schema && this.port != 80))) {
|
2938 | port = ':' + this.port;
|
2939 | }
|
2940 |
|
2941 |
|
2942 | if (query.length) {
|
2943 | query = '?' + query;
|
2944 | }
|
2945 |
|
2946 | var ipv6 = this.hostname.indexOf(':') !== -1;
|
2947 | return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
|
2948 | };
|
2949 |
|
2950 | },{"11":11,"12":12,"20":20,"26":26,"27":27,"338":338,"88":88}],25:[function(require,module,exports){
|
2951 | (function (global){
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 | var Transport = require(20);
|
2957 | var parser = require(27);
|
2958 | var parseqs = require(88);
|
2959 | var inherit = require(11);
|
2960 | var yeast = require(338);
|
2961 | var debug = require(12)('engine.io-client:websocket');
|
2962 | var BrowserWebSocket = global.WebSocket || global.MozWebSocket;
|
2963 |
|
2964 |
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 | var WebSocket = BrowserWebSocket;
|
2971 | if (!WebSocket && typeof window === 'undefined') {
|
2972 | try {
|
2973 | WebSocket = require('ws');
|
2974 | } catch (e) { }
|
2975 | }
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 | module.exports = WS;
|
2982 |
|
2983 |
|
2984 |
|
2985 |
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 | function WS(opts){
|
2991 | var forceBase64 = (opts && opts.forceBase64);
|
2992 | if (forceBase64) {
|
2993 | this.supportsBinary = false;
|
2994 | }
|
2995 | this.perMessageDeflate = opts.perMessageDeflate;
|
2996 | Transport.call(this, opts);
|
2997 | }
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 |
|
3003 | inherit(WS, Transport);
|
3004 |
|
3005 |
|
3006 |
|
3007 |
|
3008 |
|
3009 |
|
3010 |
|
3011 | WS.prototype.name = 'websocket';
|
3012 |
|
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 | WS.prototype.supportsBinary = true;
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 | WS.prototype.doOpen = function(){
|
3026 | if (!this.check()) {
|
3027 |
|
3028 | return;
|
3029 | }
|
3030 |
|
3031 | var self = this;
|
3032 | var uri = this.uri();
|
3033 | var protocols = void(0);
|
3034 | var opts = {
|
3035 | agent: this.agent,
|
3036 | perMessageDeflate: this.perMessageDeflate
|
3037 | };
|
3038 |
|
3039 |
|
3040 | opts.pfx = this.pfx;
|
3041 | opts.key = this.key;
|
3042 | opts.passphrase = this.passphrase;
|
3043 | opts.cert = this.cert;
|
3044 | opts.ca = this.ca;
|
3045 | opts.ciphers = this.ciphers;
|
3046 | opts.rejectUnauthorized = this.rejectUnauthorized;
|
3047 | if (this.extraHeaders) {
|
3048 | opts.headers = this.extraHeaders;
|
3049 | }
|
3050 |
|
3051 | this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
|
3052 |
|
3053 | if (this.ws.binaryType === undefined) {
|
3054 | this.supportsBinary = false;
|
3055 | }
|
3056 |
|
3057 | if (this.ws.supports && this.ws.supports.binary) {
|
3058 | this.supportsBinary = true;
|
3059 | this.ws.binaryType = 'buffer';
|
3060 | } else {
|
3061 | this.ws.binaryType = 'arraybuffer';
|
3062 | }
|
3063 |
|
3064 | this.addEventListeners();
|
3065 | };
|
3066 |
|
3067 |
|
3068 |
|
3069 |
|
3070 |
|
3071 |
|
3072 |
|
3073 | WS.prototype.addEventListeners = function(){
|
3074 | var self = this;
|
3075 |
|
3076 | this.ws.onopen = function(){
|
3077 | self.onOpen();
|
3078 | };
|
3079 | this.ws.onclose = function(){
|
3080 | self.onClose();
|
3081 | };
|
3082 | this.ws.onmessage = function(ev){
|
3083 | self.onData(ev.data);
|
3084 | };
|
3085 | this.ws.onerror = function(e){
|
3086 | self.onError('websocket error', e);
|
3087 | };
|
3088 | };
|
3089 |
|
3090 |
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 | if ('undefined' != typeof navigator
|
3098 | && /iPad|iPhone|iPod/i.test(navigator.userAgent)) {
|
3099 | WS.prototype.onData = function(data){
|
3100 | var self = this;
|
3101 | setTimeout(function(){
|
3102 | Transport.prototype.onData.call(self, data);
|
3103 | }, 0);
|
3104 | };
|
3105 | }
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 | WS.prototype.write = function(packets){
|
3115 | var self = this;
|
3116 | this.writable = false;
|
3117 |
|
3118 |
|
3119 |
|
3120 | var total = packets.length;
|
3121 | for (var i = 0, l = total; i < l; i++) {
|
3122 | (function(packet) {
|
3123 | parser.encodePacket(packet, self.supportsBinary, function(data) {
|
3124 | if (!BrowserWebSocket) {
|
3125 |
|
3126 | var opts = {};
|
3127 | if (packet.options) {
|
3128 | opts.compress = packet.options.compress;
|
3129 | }
|
3130 |
|
3131 | if (self.perMessageDeflate) {
|
3132 | var len = 'string' == typeof data ? global.Buffer.byteLength(data) : data.length;
|
3133 | if (len < self.perMessageDeflate.threshold) {
|
3134 | opts.compress = false;
|
3135 | }
|
3136 | }
|
3137 | }
|
3138 |
|
3139 |
|
3140 |
|
3141 |
|
3142 | try {
|
3143 | if (BrowserWebSocket) {
|
3144 |
|
3145 | self.ws.send(data);
|
3146 | } else {
|
3147 | self.ws.send(data, opts);
|
3148 | }
|
3149 | } catch (e){
|
3150 | debug('websocket closed before onclose event');
|
3151 | }
|
3152 |
|
3153 | --total || done();
|
3154 | });
|
3155 | })(packets[i]);
|
3156 | }
|
3157 |
|
3158 | function done(){
|
3159 | self.emit('flush');
|
3160 |
|
3161 |
|
3162 |
|
3163 | setTimeout(function(){
|
3164 | self.writable = true;
|
3165 | self.emit('drain');
|
3166 | }, 0);
|
3167 | }
|
3168 | };
|
3169 |
|
3170 |
|
3171 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 | WS.prototype.onClose = function(){
|
3177 | Transport.prototype.onClose.call(this);
|
3178 | };
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 | WS.prototype.doClose = function(){
|
3187 | if (typeof this.ws !== 'undefined') {
|
3188 | this.ws.close();
|
3189 | }
|
3190 | };
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 | WS.prototype.uri = function(){
|
3199 | var query = this.query || {};
|
3200 | var schema = this.secure ? 'wss' : 'ws';
|
3201 | var port = '';
|
3202 |
|
3203 |
|
3204 | if (this.port && (('wss' == schema && this.port != 443)
|
3205 | || ('ws' == schema && this.port != 80))) {
|
3206 | port = ':' + this.port;
|
3207 | }
|
3208 |
|
3209 |
|
3210 | if (this.timestampRequests) {
|
3211 | query[this.timestampParam] = yeast();
|
3212 | }
|
3213 |
|
3214 |
|
3215 | if (!this.supportsBinary) {
|
3216 | query.b64 = 1;
|
3217 | }
|
3218 |
|
3219 | query = parseqs.encode(query);
|
3220 |
|
3221 |
|
3222 | if (query.length) {
|
3223 | query = '?' + query;
|
3224 | }
|
3225 |
|
3226 | var ipv6 = this.hostname.indexOf(':') !== -1;
|
3227 | return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
|
3228 | };
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 | WS.prototype.check = function(){
|
3238 | return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);
|
3239 | };
|
3240 |
|
3241 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
3242 | },{"11":11,"12":12,"20":20,"27":27,"338":338,"88":88,"undefined":undefined}],26:[function(require,module,exports){
|
3243 |
|
3244 | var hasCORS = require(57);
|
3245 |
|
3246 | module.exports = function(opts) {
|
3247 | var xdomain = opts.xdomain;
|
3248 |
|
3249 |
|
3250 |
|
3251 | var xscheme = opts.xscheme;
|
3252 |
|
3253 |
|
3254 |
|
3255 | var enablesXDR = opts.enablesXDR;
|
3256 |
|
3257 |
|
3258 | try {
|
3259 | if ('undefined' != typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
3260 | return new XMLHttpRequest();
|
3261 | }
|
3262 | } catch (e) { }
|
3263 |
|
3264 |
|
3265 |
|
3266 |
|
3267 | try {
|
3268 | if ('undefined' != typeof XDomainRequest && !xscheme && enablesXDR) {
|
3269 | return new XDomainRequest();
|
3270 | }
|
3271 | } catch (e) { }
|
3272 |
|
3273 | if (!xdomain) {
|
3274 | try {
|
3275 | return new ActiveXObject('Microsoft.XMLHTTP');
|
3276 | } catch(e) { }
|
3277 | }
|
3278 | }
|
3279 |
|
3280 | },{"57":57}],27:[function(require,module,exports){
|
3281 | (function (global){
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 | var keys = require(28);
|
3287 | var hasBinary = require(29);
|
3288 | var sliceBuffer = require(4);
|
3289 | var base64encoder = require(6);
|
3290 | var after = require(3);
|
3291 | var utf8 = require(336);
|
3292 |
|
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 |
|
3300 | var isAndroid = navigator.userAgent.match(/Android/i);
|
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 |
|
3307 |
|
3308 | var isPhantomJS = /PhantomJS/i.test(navigator.userAgent);
|
3309 |
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 | var dontSendBlobs = isAndroid || isPhantomJS;
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 |
|
3320 | exports.protocol = 3;
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 |
|
3326 | var packets = exports.packets = {
|
3327 | open: 0
|
3328 | , close: 1
|
3329 | , ping: 2
|
3330 | , pong: 3
|
3331 | , message: 4
|
3332 | , upgrade: 5
|
3333 | , noop: 6
|
3334 | };
|
3335 |
|
3336 | var packetslist = keys(packets);
|
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 |
|
3342 | var err = { type: 'error', data: 'parser error' };
|
3343 |
|
3344 |
|
3345 |
|
3346 |
|
3347 |
|
3348 | var Blob = require(7);
|
3349 |
|
3350 |
|
3351 |
|
3352 |
|
3353 |
|
3354 |
|
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 | exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
|
3367 | if ('function' == typeof supportsBinary) {
|
3368 | callback = supportsBinary;
|
3369 | supportsBinary = false;
|
3370 | }
|
3371 |
|
3372 | if ('function' == typeof utf8encode) {
|
3373 | callback = utf8encode;
|
3374 | utf8encode = null;
|
3375 | }
|
3376 |
|
3377 | var data = (packet.data === undefined)
|
3378 | ? undefined
|
3379 | : packet.data.buffer || packet.data;
|
3380 |
|
3381 | if (global.ArrayBuffer && data instanceof ArrayBuffer) {
|
3382 | return encodeArrayBuffer(packet, supportsBinary, callback);
|
3383 | } else if (Blob && data instanceof global.Blob) {
|
3384 | return encodeBlob(packet, supportsBinary, callback);
|
3385 | }
|
3386 |
|
3387 |
|
3388 | if (data && data.base64) {
|
3389 | return encodeBase64Object(packet, callback);
|
3390 | }
|
3391 |
|
3392 |
|
3393 | var encoded = packets[packet.type];
|
3394 |
|
3395 |
|
3396 | if (undefined !== packet.data) {
|
3397 | encoded += utf8encode ? utf8.encode(String(packet.data)) : String(packet.data);
|
3398 | }
|
3399 |
|
3400 | return callback('' + encoded);
|
3401 |
|
3402 | };
|
3403 |
|
3404 | function encodeBase64Object(packet, callback) {
|
3405 |
|
3406 | var message = 'b' + exports.packets[packet.type] + packet.data.data;
|
3407 | return callback(message);
|
3408 | }
|
3409 |
|
3410 |
|
3411 |
|
3412 |
|
3413 |
|
3414 | function encodeArrayBuffer(packet, supportsBinary, callback) {
|
3415 | if (!supportsBinary) {
|
3416 | return exports.encodeBase64Packet(packet, callback);
|
3417 | }
|
3418 |
|
3419 | var data = packet.data;
|
3420 | var contentArray = new Uint8Array(data);
|
3421 | var resultBuffer = new Uint8Array(1 + data.byteLength);
|
3422 |
|
3423 | resultBuffer[0] = packets[packet.type];
|
3424 | for (var i = 0; i < contentArray.length; i++) {
|
3425 | resultBuffer[i+1] = contentArray[i];
|
3426 | }
|
3427 |
|
3428 | return callback(resultBuffer.buffer);
|
3429 | }
|
3430 |
|
3431 | function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {
|
3432 | if (!supportsBinary) {
|
3433 | return exports.encodeBase64Packet(packet, callback);
|
3434 | }
|
3435 |
|
3436 | var fr = new FileReader();
|
3437 | fr.onload = function() {
|
3438 | packet.data = fr.result;
|
3439 | exports.encodePacket(packet, supportsBinary, true, callback);
|
3440 | };
|
3441 | return fr.readAsArrayBuffer(packet.data);
|
3442 | }
|
3443 |
|
3444 | function encodeBlob(packet, supportsBinary, callback) {
|
3445 | if (!supportsBinary) {
|
3446 | return exports.encodeBase64Packet(packet, callback);
|
3447 | }
|
3448 |
|
3449 | if (dontSendBlobs) {
|
3450 | return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
|
3451 | }
|
3452 |
|
3453 | var length = new Uint8Array(1);
|
3454 | length[0] = packets[packet.type];
|
3455 | var blob = new Blob([length.buffer, packet.data]);
|
3456 |
|
3457 | return callback(blob);
|
3458 | }
|
3459 |
|
3460 |
|
3461 |
|
3462 |
|
3463 |
|
3464 |
|
3465 |
|
3466 |
|
3467 | exports.encodeBase64Packet = function(packet, callback) {
|
3468 | var message = 'b' + exports.packets[packet.type];
|
3469 | if (Blob && packet.data instanceof global.Blob) {
|
3470 | var fr = new FileReader();
|
3471 | fr.onload = function() {
|
3472 | var b64 = fr.result.split(',')[1];
|
3473 | callback(message + b64);
|
3474 | };
|
3475 | return fr.readAsDataURL(packet.data);
|
3476 | }
|
3477 |
|
3478 | var b64data;
|
3479 | try {
|
3480 | b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));
|
3481 | } catch (e) {
|
3482 |
|
3483 | var typed = new Uint8Array(packet.data);
|
3484 | var basic = new Array(typed.length);
|
3485 | for (var i = 0; i < typed.length; i++) {
|
3486 | basic[i] = typed[i];
|
3487 | }
|
3488 | b64data = String.fromCharCode.apply(null, basic);
|
3489 | }
|
3490 | message += global.btoa(b64data);
|
3491 | return callback(message);
|
3492 | };
|
3493 |
|
3494 |
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 | exports.decodePacket = function (data, binaryType, utf8decode) {
|
3502 |
|
3503 | if (typeof data == 'string' || data === undefined) {
|
3504 | if (data.charAt(0) == 'b') {
|
3505 | return exports.decodeBase64Packet(data.substr(1), binaryType);
|
3506 | }
|
3507 |
|
3508 | if (utf8decode) {
|
3509 | try {
|
3510 | data = utf8.decode(data);
|
3511 | } catch (e) {
|
3512 | return err;
|
3513 | }
|
3514 | }
|
3515 | var type = data.charAt(0);
|
3516 |
|
3517 | if (Number(type) != type || !packetslist[type]) {
|
3518 | return err;
|
3519 | }
|
3520 |
|
3521 | if (data.length > 1) {
|
3522 | return { type: packetslist[type], data: data.substring(1) };
|
3523 | } else {
|
3524 | return { type: packetslist[type] };
|
3525 | }
|
3526 | }
|
3527 |
|
3528 | var asArray = new Uint8Array(data);
|
3529 | var type = asArray[0];
|
3530 | var rest = sliceBuffer(data, 1);
|
3531 | if (Blob && binaryType === 'blob') {
|
3532 | rest = new Blob([rest]);
|
3533 | }
|
3534 | return { type: packetslist[type], data: rest };
|
3535 | };
|
3536 |
|
3537 |
|
3538 |
|
3539 |
|
3540 |
|
3541 |
|
3542 |
|
3543 |
|
3544 | exports.decodeBase64Packet = function(msg, binaryType) {
|
3545 | var type = packetslist[msg.charAt(0)];
|
3546 | if (!global.ArrayBuffer) {
|
3547 | return { type: type, data: { base64: true, data: msg.substr(1) } };
|
3548 | }
|
3549 |
|
3550 | var data = base64encoder.decode(msg.substr(1));
|
3551 |
|
3552 | if (binaryType === 'blob' && Blob) {
|
3553 | data = new Blob([data]);
|
3554 | }
|
3555 |
|
3556 | return { type: type, data: data };
|
3557 | };
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 |
|
3565 |
|
3566 |
|
3567 |
|
3568 |
|
3569 |
|
3570 |
|
3571 |
|
3572 |
|
3573 |
|
3574 |
|
3575 | exports.encodePayload = function (packets, supportsBinary, callback) {
|
3576 | if (typeof supportsBinary == 'function') {
|
3577 | callback = supportsBinary;
|
3578 | supportsBinary = null;
|
3579 | }
|
3580 |
|
3581 | var isBinary = hasBinary(packets);
|
3582 |
|
3583 | if (supportsBinary && isBinary) {
|
3584 | if (Blob && !dontSendBlobs) {
|
3585 | return exports.encodePayloadAsBlob(packets, callback);
|
3586 | }
|
3587 |
|
3588 | return exports.encodePayloadAsArrayBuffer(packets, callback);
|
3589 | }
|
3590 |
|
3591 | if (!packets.length) {
|
3592 | return callback('0:');
|
3593 | }
|
3594 |
|
3595 | function setLengthHeader(message) {
|
3596 | return message.length + ':' + message;
|
3597 | }
|
3598 |
|
3599 | function encodeOne(packet, doneCallback) {
|
3600 | exports.encodePacket(packet, !isBinary ? false : supportsBinary, true, function(message) {
|
3601 | doneCallback(null, setLengthHeader(message));
|
3602 | });
|
3603 | }
|
3604 |
|
3605 | map(packets, encodeOne, function(err, results) {
|
3606 | return callback(results.join(''));
|
3607 | });
|
3608 | };
|
3609 |
|
3610 |
|
3611 |
|
3612 |
|
3613 |
|
3614 | function map(ary, each, done) {
|
3615 | var result = new Array(ary.length);
|
3616 | var next = after(ary.length, done);
|
3617 |
|
3618 | var eachWithIndex = function(i, el, cb) {
|
3619 | each(el, function(error, msg) {
|
3620 | result[i] = msg;
|
3621 | cb(error, result);
|
3622 | });
|
3623 | };
|
3624 |
|
3625 | for (var i = 0; i < ary.length; i++) {
|
3626 | eachWithIndex(i, ary[i], next);
|
3627 | }
|
3628 | }
|
3629 |
|
3630 |
|
3631 |
|
3632 |
|
3633 |
|
3634 |
|
3635 |
|
3636 |
|
3637 |
|
3638 | exports.decodePayload = function (data, binaryType, callback) {
|
3639 | if (typeof data != 'string') {
|
3640 | return exports.decodePayloadAsBinary(data, binaryType, callback);
|
3641 | }
|
3642 |
|
3643 | if (typeof binaryType === 'function') {
|
3644 | callback = binaryType;
|
3645 | binaryType = null;
|
3646 | }
|
3647 |
|
3648 | var packet;
|
3649 | if (data == '') {
|
3650 |
|
3651 | return callback(err, 0, 1);
|
3652 | }
|
3653 |
|
3654 | var length = ''
|
3655 | , n, msg;
|
3656 |
|
3657 | for (var i = 0, l = data.length; i < l; i++) {
|
3658 | var chr = data.charAt(i);
|
3659 |
|
3660 | if (':' != chr) {
|
3661 | length += chr;
|
3662 | } else {
|
3663 | if ('' == length || (length != (n = Number(length)))) {
|
3664 |
|
3665 | return callback(err, 0, 1);
|
3666 | }
|
3667 |
|
3668 | msg = data.substr(i + 1, n);
|
3669 |
|
3670 | if (length != msg.length) {
|
3671 |
|
3672 | return callback(err, 0, 1);
|
3673 | }
|
3674 |
|
3675 | if (msg.length) {
|
3676 | packet = exports.decodePacket(msg, binaryType, true);
|
3677 |
|
3678 | if (err.type == packet.type && err.data == packet.data) {
|
3679 |
|
3680 | return callback(err, 0, 1);
|
3681 | }
|
3682 |
|
3683 | var ret = callback(packet, i + n, l);
|
3684 | if (false === ret) return;
|
3685 | }
|
3686 |
|
3687 |
|
3688 | i += n;
|
3689 | length = '';
|
3690 | }
|
3691 | }
|
3692 |
|
3693 | if (length != '') {
|
3694 |
|
3695 | return callback(err, 0, 1);
|
3696 | }
|
3697 |
|
3698 | };
|
3699 |
|
3700 |
|
3701 |
|
3702 |
|
3703 |
|
3704 |
|
3705 |
|
3706 |
|
3707 |
|
3708 |
|
3709 |
|
3710 |
|
3711 |
|
3712 |
|
3713 |
|
3714 | exports.encodePayloadAsArrayBuffer = function(packets, callback) {
|
3715 | if (!packets.length) {
|
3716 | return callback(new ArrayBuffer(0));
|
3717 | }
|
3718 |
|
3719 | function encodeOne(packet, doneCallback) {
|
3720 | exports.encodePacket(packet, true, true, function(data) {
|
3721 | return doneCallback(null, data);
|
3722 | });
|
3723 | }
|
3724 |
|
3725 | map(packets, encodeOne, function(err, encodedPackets) {
|
3726 | var totalLength = encodedPackets.reduce(function(acc, p) {
|
3727 | var len;
|
3728 | if (typeof p === 'string'){
|
3729 | len = p.length;
|
3730 | } else {
|
3731 | len = p.byteLength;
|
3732 | }
|
3733 | return acc + len.toString().length + len + 2;
|
3734 | }, 0);
|
3735 |
|
3736 | var resultArray = new Uint8Array(totalLength);
|
3737 |
|
3738 | var bufferIndex = 0;
|
3739 | encodedPackets.forEach(function(p) {
|
3740 | var isString = typeof p === 'string';
|
3741 | var ab = p;
|
3742 | if (isString) {
|
3743 | var view = new Uint8Array(p.length);
|
3744 | for (var i = 0; i < p.length; i++) {
|
3745 | view[i] = p.charCodeAt(i);
|
3746 | }
|
3747 | ab = view.buffer;
|
3748 | }
|
3749 |
|
3750 | if (isString) {
|
3751 | resultArray[bufferIndex++] = 0;
|
3752 | } else {
|
3753 | resultArray[bufferIndex++] = 1;
|
3754 | }
|
3755 |
|
3756 | var lenStr = ab.byteLength.toString();
|
3757 | for (var i = 0; i < lenStr.length; i++) {
|
3758 | resultArray[bufferIndex++] = parseInt(lenStr[i]);
|
3759 | }
|
3760 | resultArray[bufferIndex++] = 255;
|
3761 |
|
3762 | var view = new Uint8Array(ab);
|
3763 | for (var i = 0; i < view.length; i++) {
|
3764 | resultArray[bufferIndex++] = view[i];
|
3765 | }
|
3766 | });
|
3767 |
|
3768 | return callback(resultArray.buffer);
|
3769 | });
|
3770 | };
|
3771 |
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 | exports.encodePayloadAsBlob = function(packets, callback) {
|
3777 | function encodeOne(packet, doneCallback) {
|
3778 | exports.encodePacket(packet, true, true, function(encoded) {
|
3779 | var binaryIdentifier = new Uint8Array(1);
|
3780 | binaryIdentifier[0] = 1;
|
3781 | if (typeof encoded === 'string') {
|
3782 | var view = new Uint8Array(encoded.length);
|
3783 | for (var i = 0; i < encoded.length; i++) {
|
3784 | view[i] = encoded.charCodeAt(i);
|
3785 | }
|
3786 | encoded = view.buffer;
|
3787 | binaryIdentifier[0] = 0;
|
3788 | }
|
3789 |
|
3790 | var len = (encoded instanceof ArrayBuffer)
|
3791 | ? encoded.byteLength
|
3792 | : encoded.size;
|
3793 |
|
3794 | var lenStr = len.toString();
|
3795 | var lengthAry = new Uint8Array(lenStr.length + 1);
|
3796 | for (var i = 0; i < lenStr.length; i++) {
|
3797 | lengthAry[i] = parseInt(lenStr[i]);
|
3798 | }
|
3799 | lengthAry[lenStr.length] = 255;
|
3800 |
|
3801 | if (Blob) {
|
3802 | var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);
|
3803 | doneCallback(null, blob);
|
3804 | }
|
3805 | });
|
3806 | }
|
3807 |
|
3808 | map(packets, encodeOne, function(err, results) {
|
3809 | return callback(new Blob(results));
|
3810 | });
|
3811 | };
|
3812 |
|
3813 |
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 | exports.decodePayloadAsBinary = function (data, binaryType, callback) {
|
3823 | if (typeof binaryType === 'function') {
|
3824 | callback = binaryType;
|
3825 | binaryType = null;
|
3826 | }
|
3827 |
|
3828 | var bufferTail = data;
|
3829 | var buffers = [];
|
3830 |
|
3831 | var numberTooLong = false;
|
3832 | while (bufferTail.byteLength > 0) {
|
3833 | var tailArray = new Uint8Array(bufferTail);
|
3834 | var isString = tailArray[0] === 0;
|
3835 | var msgLength = '';
|
3836 |
|
3837 | for (var i = 1; ; i++) {
|
3838 | if (tailArray[i] == 255) break;
|
3839 |
|
3840 | if (msgLength.length > 310) {
|
3841 | numberTooLong = true;
|
3842 | break;
|
3843 | }
|
3844 |
|
3845 | msgLength += tailArray[i];
|
3846 | }
|
3847 |
|
3848 | if(numberTooLong) return callback(err, 0, 1);
|
3849 |
|
3850 | bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);
|
3851 | msgLength = parseInt(msgLength);
|
3852 |
|
3853 | var msg = sliceBuffer(bufferTail, 0, msgLength);
|
3854 | if (isString) {
|
3855 | try {
|
3856 | msg = String.fromCharCode.apply(null, new Uint8Array(msg));
|
3857 | } catch (e) {
|
3858 |
|
3859 | var typed = new Uint8Array(msg);
|
3860 | msg = '';
|
3861 | for (var i = 0; i < typed.length; i++) {
|
3862 | msg += String.fromCharCode(typed[i]);
|
3863 | }
|
3864 | }
|
3865 | }
|
3866 |
|
3867 | buffers.push(msg);
|
3868 | bufferTail = sliceBuffer(bufferTail, msgLength);
|
3869 | }
|
3870 |
|
3871 | var total = buffers.length;
|
3872 | buffers.forEach(function(buffer, i) {
|
3873 | callback(exports.decodePacket(buffer, binaryType, true), i, total);
|
3874 | });
|
3875 | };
|
3876 |
|
3877 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
3878 | },{"28":28,"29":29,"3":3,"336":336,"4":4,"6":6,"7":7}],28:[function(require,module,exports){
|
3879 |
|
3880 |
|
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 |
|
3886 |
|
3887 | module.exports = Object.keys || function keys (obj){
|
3888 | var arr = [];
|
3889 | var has = Object.prototype.hasOwnProperty;
|
3890 |
|
3891 | for (var i in obj) {
|
3892 | if (has.call(obj, i)) {
|
3893 | arr.push(i);
|
3894 | }
|
3895 | }
|
3896 | return arr;
|
3897 | };
|
3898 |
|
3899 | },{}],29:[function(require,module,exports){
|
3900 | (function (global){
|
3901 |
|
3902 |
|
3903 |
|
3904 |
|
3905 |
|
3906 | var isArray = require(82);
|
3907 |
|
3908 |
|
3909 |
|
3910 |
|
3911 |
|
3912 | module.exports = hasBinary;
|
3913 |
|
3914 |
|
3915 |
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 |
|
3922 |
|
3923 | function hasBinary(data) {
|
3924 |
|
3925 | function _hasBinary(obj) {
|
3926 | if (!obj) return false;
|
3927 |
|
3928 | if ( (global.Buffer && global.Buffer.isBuffer(obj)) ||
|
3929 | (global.ArrayBuffer && obj instanceof ArrayBuffer) ||
|
3930 | (global.Blob && obj instanceof Blob) ||
|
3931 | (global.File && obj instanceof File)
|
3932 | ) {
|
3933 | return true;
|
3934 | }
|
3935 |
|
3936 | if (isArray(obj)) {
|
3937 | for (var i = 0; i < obj.length; i++) {
|
3938 | if (_hasBinary(obj[i])) {
|
3939 | return true;
|
3940 | }
|
3941 | }
|
3942 | } else if (obj && 'object' == typeof obj) {
|
3943 | if (obj.toJSON) {
|
3944 | obj = obj.toJSON();
|
3945 | }
|
3946 |
|
3947 | for (var key in obj) {
|
3948 | if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {
|
3949 | return true;
|
3950 | }
|
3951 | }
|
3952 | }
|
3953 |
|
3954 | return false;
|
3955 | }
|
3956 |
|
3957 | return _hasBinary(data);
|
3958 | }
|
3959 |
|
3960 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
3961 | },{"82":82}],30:[function(require,module,exports){
|
3962 | (function (process){
|
3963 | 'use strict';
|
3964 |
|
3965 |
|
3966 |
|
3967 |
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 |
|
3974 |
|
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 |
|
3980 |
|
3981 |
|
3982 |
|
3983 | var emptyFunction = require(37);
|
3984 |
|
3985 |
|
3986 |
|
3987 |
|
3988 |
|
3989 | var EventListener = {
|
3990 | |
3991 |
|
3992 |
|
3993 |
|
3994 |
|
3995 |
|
3996 |
|
3997 |
|
3998 | listen: function (target, eventType, callback) {
|
3999 | if (target.addEventListener) {
|
4000 | target.addEventListener(eventType, callback, false);
|
4001 | return {
|
4002 | remove: function () {
|
4003 | target.removeEventListener(eventType, callback, false);
|
4004 | }
|
4005 | };
|
4006 | } else if (target.attachEvent) {
|
4007 | target.attachEvent('on' + eventType, callback);
|
4008 | return {
|
4009 | remove: function () {
|
4010 | target.detachEvent('on' + eventType, callback);
|
4011 | }
|
4012 | };
|
4013 | }
|
4014 | },
|
4015 |
|
4016 | |
4017 |
|
4018 |
|
4019 |
|
4020 |
|
4021 |
|
4022 |
|
4023 |
|
4024 | capture: function (target, eventType, callback) {
|
4025 | if (target.addEventListener) {
|
4026 | target.addEventListener(eventType, callback, true);
|
4027 | return {
|
4028 | remove: function () {
|
4029 | target.removeEventListener(eventType, callback, true);
|
4030 | }
|
4031 | };
|
4032 | } else {
|
4033 | if (process.env.NODE_ENV !== 'production') {
|
4034 | console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
|
4035 | }
|
4036 | return {
|
4037 | remove: emptyFunction
|
4038 | };
|
4039 | }
|
4040 | },
|
4041 |
|
4042 | registerDefault: function () {}
|
4043 | };
|
4044 |
|
4045 | module.exports = EventListener;
|
4046 | }).call(this,require(91))
|
4047 | },{"37":37,"91":91}],31:[function(require,module,exports){
|
4048 |
|
4049 |
|
4050 |
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 |
|
4057 |
|
4058 | 'use strict';
|
4059 |
|
4060 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
4061 |
|
4062 |
|
4063 |
|
4064 |
|
4065 |
|
4066 |
|
4067 |
|
4068 | var ExecutionEnvironment = {
|
4069 |
|
4070 | canUseDOM: canUseDOM,
|
4071 |
|
4072 | canUseWorkers: typeof Worker !== 'undefined',
|
4073 |
|
4074 | canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
4075 |
|
4076 | canUseViewport: canUseDOM && !!window.screen,
|
4077 |
|
4078 | isInWorker: !canUseDOM
|
4079 |
|
4080 | };
|
4081 |
|
4082 | module.exports = ExecutionEnvironment;
|
4083 | },{}],32:[function(require,module,exports){
|
4084 | "use strict";
|
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 |
|
4097 | var _hyphenPattern = /-(.)/g;
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 |
|
4108 | function camelize(string) {
|
4109 | return string.replace(_hyphenPattern, function (_, character) {
|
4110 | return character.toUpperCase();
|
4111 | });
|
4112 | }
|
4113 |
|
4114 | module.exports = camelize;
|
4115 | },{}],33:[function(require,module,exports){
|
4116 |
|
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 |
|
4124 |
|
4125 |
|
4126 |
|
4127 | 'use strict';
|
4128 |
|
4129 | var camelize = require(32);
|
4130 |
|
4131 | var msPattern = /^-ms-/;
|
4132 |
|
4133 |
|
4134 |
|
4135 |
|
4136 |
|
4137 |
|
4138 |
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 |
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 |
|
4150 | function camelizeStyleName(string) {
|
4151 | return camelize(string.replace(msPattern, 'ms-'));
|
4152 | }
|
4153 |
|
4154 | module.exports = camelizeStyleName;
|
4155 | },{"32":32}],34:[function(require,module,exports){
|
4156 | 'use strict';
|
4157 |
|
4158 |
|
4159 |
|
4160 |
|
4161 |
|
4162 |
|
4163 |
|
4164 |
|
4165 |
|
4166 |
|
4167 |
|
4168 |
|
4169 | var isTextNode = require(47);
|
4170 |
|
4171 |
|
4172 |
|
4173 |
|
4174 |
|
4175 |
|
4176 |
|
4177 |
|
4178 |
|
4179 |
|
4180 | function containsNode(outerNode, innerNode) {
|
4181 | if (!outerNode || !innerNode) {
|
4182 | return false;
|
4183 | } else if (outerNode === innerNode) {
|
4184 | return true;
|
4185 | } else if (isTextNode(outerNode)) {
|
4186 | return false;
|
4187 | } else if (isTextNode(innerNode)) {
|
4188 | return containsNode(outerNode, innerNode.parentNode);
|
4189 | } else if (outerNode.contains) {
|
4190 | return outerNode.contains(innerNode);
|
4191 | } else if (outerNode.compareDocumentPosition) {
|
4192 | return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
4193 | } else {
|
4194 | return false;
|
4195 | }
|
4196 | }
|
4197 |
|
4198 | module.exports = containsNode;
|
4199 | },{"47":47}],35:[function(require,module,exports){
|
4200 | (function (process){
|
4201 | 'use strict';
|
4202 |
|
4203 |
|
4204 |
|
4205 |
|
4206 |
|
4207 |
|
4208 |
|
4209 |
|
4210 |
|
4211 |
|
4212 |
|
4213 |
|
4214 | var invariant = require(45);
|
4215 |
|
4216 |
|
4217 |
|
4218 |
|
4219 |
|
4220 |
|
4221 |
|
4222 |
|
4223 |
|
4224 |
|
4225 | function toArray(obj) {
|
4226 | var length = obj.length;
|
4227 |
|
4228 |
|
4229 |
|
4230 | !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
|
4231 |
|
4232 | !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
|
4233 |
|
4234 | !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
|
4235 |
|
4236 | !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
|
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 | if (obj.hasOwnProperty) {
|
4242 | try {
|
4243 | return Array.prototype.slice.call(obj);
|
4244 | } catch (e) {
|
4245 |
|
4246 | }
|
4247 | }
|
4248 |
|
4249 |
|
4250 |
|
4251 | var ret = Array(length);
|
4252 | for (var ii = 0; ii < length; ii++) {
|
4253 | ret[ii] = obj[ii];
|
4254 | }
|
4255 | return ret;
|
4256 | }
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 |
|
4271 |
|
4272 |
|
4273 | function hasArrayNature(obj) {
|
4274 | return(
|
4275 |
|
4276 | !!obj && (
|
4277 |
|
4278 | typeof obj == 'object' || typeof obj == 'function') &&
|
4279 |
|
4280 | 'length' in obj &&
|
4281 |
|
4282 | !('setInterval' in obj) &&
|
4283 |
|
4284 |
|
4285 | typeof obj.nodeType != 'number' && (
|
4286 |
|
4287 | Array.isArray(obj) ||
|
4288 |
|
4289 | 'callee' in obj ||
|
4290 |
|
4291 | 'item' in obj)
|
4292 | );
|
4293 | }
|
4294 |
|
4295 |
|
4296 |
|
4297 |
|
4298 |
|
4299 |
|
4300 |
|
4301 |
|
4302 |
|
4303 |
|
4304 |
|
4305 |
|
4306 |
|
4307 |
|
4308 |
|
4309 |
|
4310 |
|
4311 |
|
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 | function createArrayFromMixed(obj) {
|
4317 | if (!hasArrayNature(obj)) {
|
4318 | return [obj];
|
4319 | } else if (Array.isArray(obj)) {
|
4320 | return obj.slice();
|
4321 | } else {
|
4322 | return toArray(obj);
|
4323 | }
|
4324 | }
|
4325 |
|
4326 | module.exports = createArrayFromMixed;
|
4327 | }).call(this,require(91))
|
4328 | },{"45":45,"91":91}],36:[function(require,module,exports){
|
4329 | (function (process){
|
4330 | 'use strict';
|
4331 |
|
4332 |
|
4333 |
|
4334 |
|
4335 |
|
4336 |
|
4337 |
|
4338 |
|
4339 |
|
4340 |
|
4341 |
|
4342 |
|
4343 |
|
4344 |
|
4345 | var ExecutionEnvironment = require(31);
|
4346 |
|
4347 | var createArrayFromMixed = require(35);
|
4348 | var getMarkupWrap = require(41);
|
4349 | var invariant = require(45);
|
4350 |
|
4351 |
|
4352 |
|
4353 |
|
4354 | var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
4355 |
|
4356 |
|
4357 |
|
4358 |
|
4359 | var nodeNamePattern = /^\s*<(\w+)/;
|
4360 |
|
4361 |
|
4362 |
|
4363 |
|
4364 |
|
4365 |
|
4366 |
|
4367 | function getNodeName(markup) {
|
4368 | var nodeNameMatch = markup.match(nodeNamePattern);
|
4369 | return nodeNameMatch && nodeNameMatch[1].toLowerCase();
|
4370 | }
|
4371 |
|
4372 |
|
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 |
|
4378 |
|
4379 |
|
4380 |
|
4381 |
|
4382 | function createNodesFromMarkup(markup, handleScript) {
|
4383 | var node = dummyNode;
|
4384 | !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
|
4385 | var nodeName = getNodeName(markup);
|
4386 |
|
4387 | var wrap = nodeName && getMarkupWrap(nodeName);
|
4388 | if (wrap) {
|
4389 | node.innerHTML = wrap[1] + markup + wrap[2];
|
4390 |
|
4391 | var wrapDepth = wrap[0];
|
4392 | while (wrapDepth--) {
|
4393 | node = node.lastChild;
|
4394 | }
|
4395 | } else {
|
4396 | node.innerHTML = markup;
|
4397 | }
|
4398 |
|
4399 | var scripts = node.getElementsByTagName('script');
|
4400 | if (scripts.length) {
|
4401 | !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
|
4402 | createArrayFromMixed(scripts).forEach(handleScript);
|
4403 | }
|
4404 |
|
4405 | var nodes = Array.from(node.childNodes);
|
4406 | while (node.lastChild) {
|
4407 | node.removeChild(node.lastChild);
|
4408 | }
|
4409 | return nodes;
|
4410 | }
|
4411 |
|
4412 | module.exports = createNodesFromMarkup;
|
4413 | }).call(this,require(91))
|
4414 | },{"31":31,"35":35,"41":41,"45":45,"91":91}],37:[function(require,module,exports){
|
4415 | "use strict";
|
4416 |
|
4417 |
|
4418 |
|
4419 |
|
4420 |
|
4421 |
|
4422 |
|
4423 |
|
4424 |
|
4425 |
|
4426 |
|
4427 | function makeEmptyFunction(arg) {
|
4428 | return function () {
|
4429 | return arg;
|
4430 | };
|
4431 | }
|
4432 |
|
4433 |
|
4434 |
|
4435 |
|
4436 |
|
4437 |
|
4438 | function emptyFunction() {}
|
4439 |
|
4440 | emptyFunction.thatReturns = makeEmptyFunction;
|
4441 | emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
4442 | emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
4443 | emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
4444 | emptyFunction.thatReturnsThis = function () {
|
4445 | return this;
|
4446 | };
|
4447 | emptyFunction.thatReturnsArgument = function (arg) {
|
4448 | return arg;
|
4449 | };
|
4450 |
|
4451 | module.exports = emptyFunction;
|
4452 | },{}],38:[function(require,module,exports){
|
4453 | (function (process){
|
4454 |
|
4455 |
|
4456 |
|
4457 |
|
4458 |
|
4459 |
|
4460 |
|
4461 |
|
4462 |
|
4463 |
|
4464 | 'use strict';
|
4465 |
|
4466 | var emptyObject = {};
|
4467 |
|
4468 | if (process.env.NODE_ENV !== 'production') {
|
4469 | Object.freeze(emptyObject);
|
4470 | }
|
4471 |
|
4472 | module.exports = emptyObject;
|
4473 | }).call(this,require(91))
|
4474 | },{"91":91}],39:[function(require,module,exports){
|
4475 |
|
4476 |
|
4477 |
|
4478 |
|
4479 |
|
4480 |
|
4481 |
|
4482 |
|
4483 |
|
4484 |
|
4485 | 'use strict';
|
4486 |
|
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 | function focusNode(node) {
|
4492 |
|
4493 |
|
4494 |
|
4495 | try {
|
4496 | node.focus();
|
4497 | } catch (e) {}
|
4498 | }
|
4499 |
|
4500 | module.exports = focusNode;
|
4501 | },{}],40:[function(require,module,exports){
|
4502 | 'use strict';
|
4503 |
|
4504 |
|
4505 |
|
4506 |
|
4507 |
|
4508 |
|
4509 |
|
4510 |
|
4511 |
|
4512 |
|
4513 |
|
4514 |
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 |
|
4522 |
|
4523 |
|
4524 | function getActiveElement() /*?DOMElement*/{
|
4525 | if (typeof document === 'undefined') {
|
4526 | return null;
|
4527 | }
|
4528 | try {
|
4529 | return document.activeElement || document.body;
|
4530 | } catch (e) {
|
4531 | return document.body;
|
4532 | }
|
4533 | }
|
4534 |
|
4535 | module.exports = getActiveElement;
|
4536 | },{}],41:[function(require,module,exports){
|
4537 | (function (process){
|
4538 | 'use strict';
|
4539 |
|
4540 |
|
4541 |
|
4542 |
|
4543 |
|
4544 |
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 | var ExecutionEnvironment = require(31);
|
4553 |
|
4554 | var invariant = require(45);
|
4555 |
|
4556 |
|
4557 |
|
4558 |
|
4559 | var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
4560 |
|
4561 |
|
4562 |
|
4563 |
|
4564 |
|
4565 |
|
4566 |
|
4567 |
|
4568 | var shouldWrap = {};
|
4569 |
|
4570 | var selectWrap = [1, '<select multiple="true">', '</select>'];
|
4571 | var tableWrap = [1, '<table>', '</table>'];
|
4572 | var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
4573 |
|
4574 | var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
|
4575 |
|
4576 | var markupWrap = {
|
4577 | '*': [1, '?<div>', '</div>'],
|
4578 |
|
4579 | 'area': [1, '<map>', '</map>'],
|
4580 | 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
4581 | 'legend': [1, '<fieldset>', '</fieldset>'],
|
4582 | 'param': [1, '<object>', '</object>'],
|
4583 | 'tr': [2, '<table><tbody>', '</tbody></table>'],
|
4584 |
|
4585 | 'optgroup': selectWrap,
|
4586 | 'option': selectWrap,
|
4587 |
|
4588 | 'caption': tableWrap,
|
4589 | 'colgroup': tableWrap,
|
4590 | 'tbody': tableWrap,
|
4591 | 'tfoot': tableWrap,
|
4592 | 'thead': tableWrap,
|
4593 |
|
4594 | 'td': trWrap,
|
4595 | 'th': trWrap
|
4596 | };
|
4597 |
|
4598 |
|
4599 |
|
4600 |
|
4601 | var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
|
4602 | svgElements.forEach(function (nodeName) {
|
4603 | markupWrap[nodeName] = svgWrap;
|
4604 | shouldWrap[nodeName] = true;
|
4605 | });
|
4606 |
|
4607 |
|
4608 |
|
4609 |
|
4610 |
|
4611 |
|
4612 |
|
4613 |
|
4614 |
|
4615 | function getMarkupWrap(nodeName) {
|
4616 | !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
|
4617 | if (!markupWrap.hasOwnProperty(nodeName)) {
|
4618 | nodeName = '*';
|
4619 | }
|
4620 | if (!shouldWrap.hasOwnProperty(nodeName)) {
|
4621 | if (nodeName === '*') {
|
4622 | dummyNode.innerHTML = '<link />';
|
4623 | } else {
|
4624 | dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
|
4625 | }
|
4626 | shouldWrap[nodeName] = !dummyNode.firstChild;
|
4627 | }
|
4628 | return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
|
4629 | }
|
4630 |
|
4631 | module.exports = getMarkupWrap;
|
4632 | }).call(this,require(91))
|
4633 | },{"31":31,"45":45,"91":91}],42:[function(require,module,exports){
|
4634 |
|
4635 |
|
4636 |
|
4637 |
|
4638 |
|
4639 |
|
4640 |
|
4641 |
|
4642 |
|
4643 |
|
4644 |
|
4645 | 'use strict';
|
4646 |
|
4647 |
|
4648 |
|
4649 |
|
4650 |
|
4651 |
|
4652 |
|
4653 |
|
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 | function getUnboundedScrollPosition(scrollable) {
|
4659 | if (scrollable === window) {
|
4660 | return {
|
4661 | x: window.pageXOffset || document.documentElement.scrollLeft,
|
4662 | y: window.pageYOffset || document.documentElement.scrollTop
|
4663 | };
|
4664 | }
|
4665 | return {
|
4666 | x: scrollable.scrollLeft,
|
4667 | y: scrollable.scrollTop
|
4668 | };
|
4669 | }
|
4670 |
|
4671 | module.exports = getUnboundedScrollPosition;
|
4672 | },{}],43:[function(require,module,exports){
|
4673 | 'use strict';
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 |
|
4679 |
|
4680 |
|
4681 |
|
4682 |
|
4683 |
|
4684 |
|
4685 |
|
4686 | var _uppercasePattern = /([A-Z])/g;
|
4687 |
|
4688 |
|
4689 |
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 |
|
4699 |
|
4700 | function hyphenate(string) {
|
4701 | return string.replace(_uppercasePattern, '-$1').toLowerCase();
|
4702 | }
|
4703 |
|
4704 | module.exports = hyphenate;
|
4705 | },{}],44:[function(require,module,exports){
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 |
|
4712 |
|
4713 |
|
4714 |
|
4715 |
|
4716 |
|
4717 | 'use strict';
|
4718 |
|
4719 | var hyphenate = require(43);
|
4720 |
|
4721 | var msPattern = /^ms-/;
|
4722 |
|
4723 |
|
4724 |
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 |
|
4739 | function hyphenateStyleName(string) {
|
4740 | return hyphenate(string).replace(msPattern, '-ms-');
|
4741 | }
|
4742 |
|
4743 | module.exports = hyphenateStyleName;
|
4744 | },{"43":43}],45:[function(require,module,exports){
|
4745 | (function (process){
|
4746 |
|
4747 |
|
4748 |
|
4749 |
|
4750 |
|
4751 |
|
4752 |
|
4753 |
|
4754 |
|
4755 |
|
4756 | 'use strict';
|
4757 |
|
4758 |
|
4759 |
|
4760 |
|
4761 |
|
4762 |
|
4763 |
|
4764 |
|
4765 |
|
4766 |
|
4767 |
|
4768 |
|
4769 | function invariant(condition, format, a, b, c, d, e, f) {
|
4770 | if (process.env.NODE_ENV !== 'production') {
|
4771 | if (format === undefined) {
|
4772 | throw new Error('invariant requires an error message argument');
|
4773 | }
|
4774 | }
|
4775 |
|
4776 | if (!condition) {
|
4777 | var error;
|
4778 | if (format === undefined) {
|
4779 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
4780 | } else {
|
4781 | var args = [a, b, c, d, e, f];
|
4782 | var argIndex = 0;
|
4783 | error = new Error(format.replace(/%s/g, function () {
|
4784 | return args[argIndex++];
|
4785 | }));
|
4786 | error.name = 'Invariant Violation';
|
4787 | }
|
4788 |
|
4789 | error.framesToPop = 1;
|
4790 | throw error;
|
4791 | }
|
4792 | }
|
4793 |
|
4794 | module.exports = invariant;
|
4795 | }).call(this,require(91))
|
4796 | },{"91":91}],46:[function(require,module,exports){
|
4797 | 'use strict';
|
4798 |
|
4799 |
|
4800 |
|
4801 |
|
4802 |
|
4803 |
|
4804 |
|
4805 |
|
4806 |
|
4807 |
|
4808 |
|
4809 |
|
4810 |
|
4811 |
|
4812 |
|
4813 |
|
4814 | function isNode(object) {
|
4815 | return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
|
4816 | }
|
4817 |
|
4818 | module.exports = isNode;
|
4819 | },{}],47:[function(require,module,exports){
|
4820 | 'use strict';
|
4821 |
|
4822 |
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 | var isNode = require(46);
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 |
|
4839 | function isTextNode(object) {
|
4840 | return isNode(object) && object.nodeType == 3;
|
4841 | }
|
4842 |
|
4843 | module.exports = isTextNode;
|
4844 | },{"46":46}],48:[function(require,module,exports){
|
4845 | (function (process){
|
4846 |
|
4847 |
|
4848 |
|
4849 |
|
4850 |
|
4851 |
|
4852 |
|
4853 |
|
4854 |
|
4855 |
|
4856 |
|
4857 | 'use strict';
|
4858 |
|
4859 | var invariant = require(45);
|
4860 |
|
4861 |
|
4862 |
|
4863 |
|
4864 |
|
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 |
|
4871 |
|
4872 |
|
4873 |
|
4874 |
|
4875 |
|
4876 |
|
4877 |
|
4878 |
|
4879 | var keyMirror = function (obj) {
|
4880 | var ret = {};
|
4881 | var key;
|
4882 | !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
|
4883 | for (key in obj) {
|
4884 | if (!obj.hasOwnProperty(key)) {
|
4885 | continue;
|
4886 | }
|
4887 | ret[key] = key;
|
4888 | }
|
4889 | return ret;
|
4890 | };
|
4891 |
|
4892 | module.exports = keyMirror;
|
4893 | }).call(this,require(91))
|
4894 | },{"45":45,"91":91}],49:[function(require,module,exports){
|
4895 | "use strict";
|
4896 |
|
4897 |
|
4898 |
|
4899 |
|
4900 |
|
4901 |
|
4902 |
|
4903 |
|
4904 |
|
4905 |
|
4906 |
|
4907 |
|
4908 |
|
4909 |
|
4910 |
|
4911 |
|
4912 |
|
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 | var keyOf = function (oneKeyObj) {
|
4918 | var key;
|
4919 | for (key in oneKeyObj) {
|
4920 | if (!oneKeyObj.hasOwnProperty(key)) {
|
4921 | continue;
|
4922 | }
|
4923 | return key;
|
4924 | }
|
4925 | return null;
|
4926 | };
|
4927 |
|
4928 | module.exports = keyOf;
|
4929 | },{}],50:[function(require,module,exports){
|
4930 |
|
4931 |
|
4932 |
|
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 |
|
4938 |
|
4939 |
|
4940 | 'use strict';
|
4941 |
|
4942 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
4943 |
|
4944 |
|
4945 |
|
4946 |
|
4947 |
|
4948 |
|
4949 |
|
4950 |
|
4951 |
|
4952 |
|
4953 |
|
4954 |
|
4955 |
|
4956 |
|
4957 |
|
4958 |
|
4959 |
|
4960 |
|
4961 |
|
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 | function mapObject(object, callback, context) {
|
4967 | if (!object) {
|
4968 | return null;
|
4969 | }
|
4970 | var result = {};
|
4971 | for (var name in object) {
|
4972 | if (hasOwnProperty.call(object, name)) {
|
4973 | result[name] = callback.call(context, object[name], name, object);
|
4974 | }
|
4975 | }
|
4976 | return result;
|
4977 | }
|
4978 |
|
4979 | module.exports = mapObject;
|
4980 | },{}],51:[function(require,module,exports){
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 |
|
4986 |
|
4987 |
|
4988 |
|
4989 |
|
4990 |
|
4991 |
|
4992 | 'use strict';
|
4993 |
|
4994 |
|
4995 |
|
4996 |
|
4997 |
|
4998 |
|
4999 |
|
5000 |
|
5001 | function memoizeStringOnly(callback) {
|
5002 | var cache = {};
|
5003 | return function (string) {
|
5004 | if (!cache.hasOwnProperty(string)) {
|
5005 | cache[string] = callback.call(this, string);
|
5006 | }
|
5007 | return cache[string];
|
5008 | };
|
5009 | }
|
5010 |
|
5011 | module.exports = memoizeStringOnly;
|
5012 | },{}],52:[function(require,module,exports){
|
5013 |
|
5014 |
|
5015 |
|
5016 |
|
5017 |
|
5018 |
|
5019 |
|
5020 |
|
5021 |
|
5022 |
|
5023 |
|
5024 | 'use strict';
|
5025 |
|
5026 | var ExecutionEnvironment = require(31);
|
5027 |
|
5028 | var performance;
|
5029 |
|
5030 | if (ExecutionEnvironment.canUseDOM) {
|
5031 | performance = window.performance || window.msPerformance || window.webkitPerformance;
|
5032 | }
|
5033 |
|
5034 | module.exports = performance || {};
|
5035 | },{"31":31}],53:[function(require,module,exports){
|
5036 | 'use strict';
|
5037 |
|
5038 |
|
5039 |
|
5040 |
|
5041 |
|
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 |
|
5047 |
|
5048 |
|
5049 | var performance = require(52);
|
5050 |
|
5051 | var performanceNow;
|
5052 |
|
5053 |
|
5054 |
|
5055 |
|
5056 |
|
5057 |
|
5058 | if (performance.now) {
|
5059 | performanceNow = function () {
|
5060 | return performance.now();
|
5061 | };
|
5062 | } else {
|
5063 | performanceNow = function () {
|
5064 | return Date.now();
|
5065 | };
|
5066 | }
|
5067 |
|
5068 | module.exports = performanceNow;
|
5069 | },{"52":52}],54:[function(require,module,exports){
|
5070 |
|
5071 |
|
5072 |
|
5073 |
|
5074 |
|
5075 |
|
5076 |
|
5077 |
|
5078 |
|
5079 |
|
5080 |
|
5081 |
|
5082 |
|
5083 |
|
5084 | 'use strict';
|
5085 |
|
5086 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
5087 |
|
5088 |
|
5089 |
|
5090 |
|
5091 |
|
5092 | function is(x, y) {
|
5093 |
|
5094 | if (x === y) {
|
5095 |
|
5096 |
|
5097 | return x !== 0 || 1 / x === 1 / y;
|
5098 | } else {
|
5099 |
|
5100 | return x !== x && y !== y;
|
5101 | }
|
5102 | }
|
5103 |
|
5104 |
|
5105 |
|
5106 |
|
5107 |
|
5108 |
|
5109 | function shallowEqual(objA, objB) {
|
5110 | if (is(objA, objB)) {
|
5111 | return true;
|
5112 | }
|
5113 |
|
5114 | if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
5115 | return false;
|
5116 | }
|
5117 |
|
5118 | var keysA = Object.keys(objA);
|
5119 | var keysB = Object.keys(objB);
|
5120 |
|
5121 | if (keysA.length !== keysB.length) {
|
5122 | return false;
|
5123 | }
|
5124 |
|
5125 |
|
5126 | for (var i = 0; i < keysA.length; i++) {
|
5127 | if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
5128 | return false;
|
5129 | }
|
5130 | }
|
5131 |
|
5132 | return true;
|
5133 | }
|
5134 |
|
5135 | module.exports = shallowEqual;
|
5136 | },{}],55:[function(require,module,exports){
|
5137 | (function (process){
|
5138 |
|
5139 |
|
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 |
|
5147 |
|
5148 | 'use strict';
|
5149 |
|
5150 | var emptyFunction = require(37);
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 | var warning = emptyFunction;
|
5160 |
|
5161 | if (process.env.NODE_ENV !== 'production') {
|
5162 | warning = function (condition, format) {
|
5163 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
5164 | args[_key - 2] = arguments[_key];
|
5165 | }
|
5166 |
|
5167 | if (format === undefined) {
|
5168 | throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
5169 | }
|
5170 |
|
5171 | if (format.indexOf('Failed Composite propType: ') === 0) {
|
5172 | return;
|
5173 | }
|
5174 |
|
5175 | if (!condition) {
|
5176 | var argIndex = 0;
|
5177 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
5178 | return args[argIndex++];
|
5179 | });
|
5180 | if (typeof console !== 'undefined') {
|
5181 | console.error(message);
|
5182 | }
|
5183 | try {
|
5184 |
|
5185 |
|
5186 |
|
5187 | throw new Error(message);
|
5188 | } catch (x) {}
|
5189 | }
|
5190 | };
|
5191 | }
|
5192 |
|
5193 | module.exports = warning;
|
5194 | }).call(this,require(91))
|
5195 | },{"37":37,"91":91}],56:[function(require,module,exports){
|
5196 | (function (global){
|
5197 |
|
5198 |
|
5199 |
|
5200 |
|
5201 |
|
5202 | var isArray = require(82);
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 | module.exports = hasBinary;
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 |
|
5219 | function hasBinary(data) {
|
5220 |
|
5221 | function _hasBinary(obj) {
|
5222 | if (!obj) return false;
|
5223 |
|
5224 | if ( (global.Buffer && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||
|
5225 | (global.ArrayBuffer && obj instanceof ArrayBuffer) ||
|
5226 | (global.Blob && obj instanceof Blob) ||
|
5227 | (global.File && obj instanceof File)
|
5228 | ) {
|
5229 | return true;
|
5230 | }
|
5231 |
|
5232 | if (isArray(obj)) {
|
5233 | for (var i = 0; i < obj.length; i++) {
|
5234 | if (_hasBinary(obj[i])) {
|
5235 | return true;
|
5236 | }
|
5237 | }
|
5238 | } else if (obj && 'object' == typeof obj) {
|
5239 |
|
5240 | if (obj.toJSON && 'function' == typeof obj.toJSON) {
|
5241 | obj = obj.toJSON();
|
5242 | }
|
5243 |
|
5244 | for (var key in obj) {
|
5245 | if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {
|
5246 | return true;
|
5247 | }
|
5248 | }
|
5249 | }
|
5250 |
|
5251 | return false;
|
5252 | }
|
5253 |
|
5254 | return _hasBinary(data);
|
5255 | }
|
5256 |
|
5257 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
5258 | },{"82":82}],57:[function(require,module,exports){
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 | try {
|
5269 | module.exports = typeof XMLHttpRequest !== 'undefined' &&
|
5270 | 'withCredentials' in new XMLHttpRequest();
|
5271 | } catch (err) {
|
5272 |
|
5273 |
|
5274 | module.exports = false;
|
5275 | }
|
5276 |
|
5277 | },{}],58:[function(require,module,exports){
|
5278 | 'use strict';
|
5279 |
|
5280 | Object.defineProperty(exports, "__esModule", {
|
5281 | value: true
|
5282 | });
|
5283 |
|
5284 |
|
5285 |
|
5286 | var PUSH = exports.PUSH = 'PUSH';
|
5287 |
|
5288 |
|
5289 |
|
5290 |
|
5291 | var REPLACE = exports.REPLACE = 'REPLACE';
|
5292 |
|
5293 |
|
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 |
|
5299 |
|
5300 |
|
5301 | var POP = exports.POP = 'POP';
|
5302 | },{}],59:[function(require,module,exports){
|
5303 | "use strict";
|
5304 |
|
5305 | Object.defineProperty(exports, "__esModule", {
|
5306 | value: true
|
5307 | });
|
5308 |
|
5309 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
5310 |
|
5311 | var loopAsync = exports.loopAsync = function loopAsync(turns, work, callback) {
|
5312 | var currentTurn = 0,
|
5313 | isDone = false;
|
5314 | var isSync = false,
|
5315 | hasNext = false,
|
5316 | doneArgs = void 0;
|
5317 |
|
5318 | var done = function done() {
|
5319 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
5320 | args[_key] = arguments[_key];
|
5321 | }
|
5322 |
|
5323 | isDone = true;
|
5324 |
|
5325 | if (isSync) {
|
5326 |
|
5327 | doneArgs = args;
|
5328 | return;
|
5329 | }
|
5330 |
|
5331 | callback.apply(undefined, args);
|
5332 | };
|
5333 |
|
5334 | var next = function next() {
|
5335 | if (isDone) return;
|
5336 |
|
5337 | hasNext = true;
|
5338 |
|
5339 | if (isSync) return;
|
5340 |
|
5341 | isSync = true;
|
5342 |
|
5343 | while (!isDone && currentTurn < turns && hasNext) {
|
5344 | hasNext = false;
|
5345 | work(currentTurn++, next, done);
|
5346 | }
|
5347 |
|
5348 | isSync = false;
|
5349 |
|
5350 | if (isDone) {
|
5351 |
|
5352 | callback.apply(undefined, _toConsumableArray(doneArgs));
|
5353 | return;
|
5354 | }
|
5355 |
|
5356 | if (currentTurn >= turns && hasNext) {
|
5357 | isDone = true;
|
5358 | callback();
|
5359 | }
|
5360 | };
|
5361 |
|
5362 | next();
|
5363 | };
|
5364 | },{}],60:[function(require,module,exports){
|
5365 | 'use strict';
|
5366 |
|
5367 | Object.defineProperty(exports, "__esModule", {
|
5368 | value: true
|
5369 | });
|
5370 | exports.go = exports.replaceLocation = exports.pushLocation = exports.startListener = exports.getUserConfirmation = exports.getCurrentLocation = undefined;
|
5371 |
|
5372 | var _LocationUtils = require(65);
|
5373 |
|
5374 | var _DOMUtils = require(62);
|
5375 |
|
5376 | var _DOMStateStorage = require(61);
|
5377 |
|
5378 | var _PathUtils = require(66);
|
5379 |
|
5380 |
|
5381 |
|
5382 |
|
5383 | var PopStateEvent = 'popstate';
|
5384 |
|
5385 | var _createLocation = function _createLocation(historyState) {
|
5386 | var key = historyState && historyState.key;
|
5387 |
|
5388 | return (0, _LocationUtils.createLocation)({
|
5389 | pathname: window.location.pathname,
|
5390 | search: window.location.search,
|
5391 | hash: window.location.hash,
|
5392 | state: key ? (0, _DOMStateStorage.readState)(key) : undefined
|
5393 | }, undefined, key);
|
5394 | };
|
5395 |
|
5396 | var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation() {
|
5397 | var historyState = void 0;
|
5398 | try {
|
5399 | historyState = window.history.state || {};
|
5400 | } catch (error) {
|
5401 |
|
5402 |
|
5403 | historyState = {};
|
5404 | }
|
5405 |
|
5406 | return _createLocation(historyState);
|
5407 | };
|
5408 |
|
5409 | var getUserConfirmation = exports.getUserConfirmation = function getUserConfirmation(message, callback) {
|
5410 | return callback(window.confirm(message));
|
5411 | };
|
5412 |
|
5413 | var startListener = exports.startListener = function startListener(listener) {
|
5414 | var handlePopState = function handlePopState(event) {
|
5415 | if (event.state !== undefined)
|
5416 | listener(_createLocation(event.state));
|
5417 | };
|
5418 |
|
5419 | (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);
|
5420 |
|
5421 | return function () {
|
5422 | return (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);
|
5423 | };
|
5424 | };
|
5425 |
|
5426 | var updateLocation = function updateLocation(location, updateState) {
|
5427 | var state = location.state;
|
5428 | var key = location.key;
|
5429 |
|
5430 |
|
5431 | if (state !== undefined) (0, _DOMStateStorage.saveState)(key, state);
|
5432 |
|
5433 | updateState({ key: key }, (0, _PathUtils.createPath)(location));
|
5434 | };
|
5435 |
|
5436 | var pushLocation = exports.pushLocation = function pushLocation(location) {
|
5437 | return updateLocation(location, function (state, path) {
|
5438 | return window.history.pushState(state, null, path);
|
5439 | });
|
5440 | };
|
5441 |
|
5442 | var replaceLocation = exports.replaceLocation = function replaceLocation(location) {
|
5443 | return updateLocation(location, function (state, path) {
|
5444 | return window.history.replaceState(state, null, path);
|
5445 | });
|
5446 | };
|
5447 |
|
5448 | var go = exports.go = function go(n) {
|
5449 | if (n) window.history.go(n);
|
5450 | };
|
5451 | },{"61":61,"62":62,"65":65,"66":66}],61:[function(require,module,exports){
|
5452 | (function (process){
|
5453 | 'use strict';
|
5454 |
|
5455 | Object.defineProperty(exports, "__esModule", {
|
5456 | value: true
|
5457 | });
|
5458 | exports.readState = exports.saveState = undefined;
|
5459 |
|
5460 | var _warning = require(337);
|
5461 |
|
5462 | var _warning2 = _interopRequireDefault(_warning);
|
5463 |
|
5464 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5465 |
|
5466 | var QuotaExceededErrors = ['QuotaExceededError', 'QUOTA_EXCEEDED_ERR'];
|
5467 |
|
5468 |
|
5469 | var SecurityError = 'SecurityError';
|
5470 | var KeyPrefix = '@@History/';
|
5471 |
|
5472 | var createKey = function createKey(key) {
|
5473 | return KeyPrefix + key;
|
5474 | };
|
5475 |
|
5476 | var saveState = exports.saveState = function saveState(key, state) {
|
5477 | if (!window.sessionStorage) {
|
5478 |
|
5479 |
|
5480 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available') : void 0;
|
5481 | return;
|
5482 | }
|
5483 |
|
5484 | try {
|
5485 | if (state == null) {
|
5486 | window.sessionStorage.removeItem(createKey(key));
|
5487 | } else {
|
5488 | window.sessionStorage.setItem(createKey(key), JSON.stringify(state));
|
5489 | }
|
5490 | } catch (error) {
|
5491 | if (error.name === SecurityError) {
|
5492 |
|
5493 |
|
5494 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available due to security settings') : void 0;
|
5495 |
|
5496 | return;
|
5497 | }
|
5498 |
|
5499 | if (QuotaExceededErrors.indexOf(error.name) >= 0 && window.sessionStorage.length === 0) {
|
5500 |
|
5501 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available in Safari private mode') : void 0;
|
5502 |
|
5503 | return;
|
5504 | }
|
5505 |
|
5506 | throw error;
|
5507 | }
|
5508 | };
|
5509 |
|
5510 | var readState = exports.readState = function readState(key) {
|
5511 | var json = void 0;
|
5512 | try {
|
5513 | json = window.sessionStorage.getItem(createKey(key));
|
5514 | } catch (error) {
|
5515 | if (error.name === SecurityError) {
|
5516 |
|
5517 |
|
5518 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to read state; sessionStorage is not available due to security settings') : void 0;
|
5519 |
|
5520 | return undefined;
|
5521 | }
|
5522 | }
|
5523 |
|
5524 | if (json) {
|
5525 | try {
|
5526 | return JSON.parse(json);
|
5527 | } catch (error) {
|
5528 |
|
5529 | }
|
5530 | }
|
5531 |
|
5532 | return undefined;
|
5533 | };
|
5534 | }).call(this,require(91))
|
5535 | },{"337":337,"91":91}],62:[function(require,module,exports){
|
5536 | 'use strict';
|
5537 |
|
5538 | Object.defineProperty(exports, "__esModule", {
|
5539 | value: true
|
5540 | });
|
5541 | var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {
|
5542 | return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);
|
5543 | };
|
5544 |
|
5545 | var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {
|
5546 | return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);
|
5547 | };
|
5548 |
|
5549 |
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 |
|
5555 |
|
5556 | var supportsHistory = exports.supportsHistory = function supportsHistory() {
|
5557 | var ua = window.navigator.userAgent;
|
5558 |
|
5559 | if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
5560 |
|
5561 | return window.history && 'pushState' in window.history;
|
5562 | };
|
5563 |
|
5564 |
|
5565 |
|
5566 |
|
5567 | var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
|
5568 | return window.navigator.userAgent.indexOf('Firefox') === -1;
|
5569 | };
|
5570 | },{}],63:[function(require,module,exports){
|
5571 | 'use strict';
|
5572 |
|
5573 | Object.defineProperty(exports, "__esModule", {
|
5574 | value: true
|
5575 | });
|
5576 | var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
5577 | },{}],64:[function(require,module,exports){
|
5578 | (function (process){
|
5579 | 'use strict';
|
5580 |
|
5581 | Object.defineProperty(exports, "__esModule", {
|
5582 | value: true
|
5583 | });
|
5584 | exports.replaceLocation = exports.pushLocation = exports.startListener = exports.getCurrentLocation = exports.go = exports.getUserConfirmation = undefined;
|
5585 |
|
5586 | var _BrowserProtocol = require(60);
|
5587 |
|
5588 | Object.defineProperty(exports, 'getUserConfirmation', {
|
5589 | enumerable: true,
|
5590 | get: function get() {
|
5591 | return _BrowserProtocol.getUserConfirmation;
|
5592 | }
|
5593 | });
|
5594 | Object.defineProperty(exports, 'go', {
|
5595 | enumerable: true,
|
5596 | get: function get() {
|
5597 | return _BrowserProtocol.go;
|
5598 | }
|
5599 | });
|
5600 |
|
5601 | var _warning = require(337);
|
5602 |
|
5603 | var _warning2 = _interopRequireDefault(_warning);
|
5604 |
|
5605 | var _LocationUtils = require(65);
|
5606 |
|
5607 | var _DOMUtils = require(62);
|
5608 |
|
5609 | var _DOMStateStorage = require(61);
|
5610 |
|
5611 | var _PathUtils = require(66);
|
5612 |
|
5613 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5614 |
|
5615 | var HashChangeEvent = 'hashchange';
|
5616 |
|
5617 | var getHashPath = function getHashPath() {
|
5618 |
|
5619 |
|
5620 | var href = window.location.href;
|
5621 | var index = href.indexOf('#');
|
5622 | return index === -1 ? '' : href.substring(index + 1);
|
5623 | };
|
5624 |
|
5625 | var pushHashPath = function pushHashPath(path) {
|
5626 | return window.location.hash = path;
|
5627 | };
|
5628 |
|
5629 | var replaceHashPath = function replaceHashPath(path) {
|
5630 | var i = window.location.href.indexOf('#');
|
5631 |
|
5632 | window.location.replace(window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path);
|
5633 | };
|
5634 |
|
5635 | var ensureSlash = function ensureSlash() {
|
5636 | var path = getHashPath();
|
5637 |
|
5638 | if ((0, _PathUtils.isAbsolutePath)(path)) return true;
|
5639 |
|
5640 | replaceHashPath('/' + path);
|
5641 |
|
5642 | return false;
|
5643 | };
|
5644 |
|
5645 | var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation(queryKey) {
|
5646 | var path = getHashPath();
|
5647 | var key = (0, _PathUtils.getQueryStringValueFromPath)(path, queryKey);
|
5648 |
|
5649 | var state = void 0;
|
5650 | if (key) {
|
5651 | path = (0, _PathUtils.stripQueryStringValueFromPath)(path, queryKey);
|
5652 | state = (0, _DOMStateStorage.readState)(key);
|
5653 | }
|
5654 |
|
5655 | var init = (0, _PathUtils.parsePath)(path);
|
5656 | init.state = state;
|
5657 |
|
5658 | return (0, _LocationUtils.createLocation)(init, undefined, key);
|
5659 | };
|
5660 |
|
5661 | var prevLocation = void 0;
|
5662 |
|
5663 | var startListener = exports.startListener = function startListener(listener, queryKey) {
|
5664 | var handleHashChange = function handleHashChange() {
|
5665 | if (!ensureSlash()) return;
|
5666 |
|
5667 | var currentLocation = getCurrentLocation(queryKey);
|
5668 |
|
5669 | if (prevLocation && currentLocation.key && prevLocation.key === currentLocation.key) return;
|
5670 |
|
5671 | prevLocation = currentLocation;
|
5672 |
|
5673 | listener(currentLocation);
|
5674 | };
|
5675 |
|
5676 | ensureSlash();
|
5677 | (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
|
5678 |
|
5679 | return function () {
|
5680 | return (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
|
5681 | };
|
5682 | };
|
5683 |
|
5684 | var updateLocation = function updateLocation(location, queryKey, updateHash) {
|
5685 | var state = location.state;
|
5686 | var key = location.key;
|
5687 |
|
5688 | var path = (0, _PathUtils.createPath)(location);
|
5689 |
|
5690 | if (state !== undefined) {
|
5691 | path = (0, _PathUtils.addQueryStringValueToPath)(path, queryKey, key);
|
5692 | (0, _DOMStateStorage.saveState)(key, state);
|
5693 | }
|
5694 |
|
5695 | prevLocation = location;
|
5696 |
|
5697 | updateHash(path);
|
5698 | };
|
5699 |
|
5700 | var pushLocation = exports.pushLocation = function pushLocation(location, queryKey) {
|
5701 | return updateLocation(location, queryKey, function (path) {
|
5702 | if (getHashPath() !== path) {
|
5703 | pushHashPath(path);
|
5704 | } else {
|
5705 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, 'You cannot PUSH the same path using hash history') : void 0;
|
5706 | }
|
5707 | });
|
5708 | };
|
5709 |
|
5710 | var replaceLocation = exports.replaceLocation = function replaceLocation(location, queryKey) {
|
5711 | return updateLocation(location, queryKey, function (path) {
|
5712 | if (getHashPath() !== path) replaceHashPath(path);
|
5713 | });
|
5714 | };
|
5715 | }).call(this,require(91))
|
5716 | },{"337":337,"60":60,"61":61,"62":62,"65":65,"66":66,"91":91}],65:[function(require,module,exports){
|
5717 | (function (process){
|
5718 | 'use strict';
|
5719 |
|
5720 | Object.defineProperty(exports, "__esModule", {
|
5721 | value: true
|
5722 | });
|
5723 | exports.locationsAreEqual = exports.statesAreEqual = exports.createLocation = exports.createQuery = undefined;
|
5724 |
|
5725 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
5726 |
|
5727 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
5728 |
|
5729 | var _invariant = require(81);
|
5730 |
|
5731 | var _invariant2 = _interopRequireDefault(_invariant);
|
5732 |
|
5733 | var _PathUtils = require(66);
|
5734 |
|
5735 | var _Actions = require(58);
|
5736 |
|
5737 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5738 |
|
5739 | var createQuery = exports.createQuery = function createQuery(props) {
|
5740 | return _extends(Object.create(null), props);
|
5741 | };
|
5742 |
|
5743 | var createLocation = exports.createLocation = function createLocation() {
|
5744 | var input = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0];
|
5745 | var action = arguments.length <= 1 || arguments[1] === undefined ? _Actions.POP : arguments[1];
|
5746 | var key = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
|
5747 |
|
5748 | var object = typeof input === 'string' ? (0, _PathUtils.parsePath)(input) : input;
|
5749 |
|
5750 | var pathname = object.pathname || '/';
|
5751 | var search = object.search || '';
|
5752 | var hash = object.hash || '';
|
5753 | var state = object.state;
|
5754 |
|
5755 | return {
|
5756 | pathname: pathname,
|
5757 | search: search,
|
5758 | hash: hash,
|
5759 | state: state,
|
5760 | action: action,
|
5761 | key: key
|
5762 | };
|
5763 | };
|
5764 |
|
5765 | var isDate = function isDate(object) {
|
5766 | return Object.prototype.toString.call(object) === '[object Date]';
|
5767 | };
|
5768 |
|
5769 | var statesAreEqual = exports.statesAreEqual = function statesAreEqual(a, b) {
|
5770 | if (a === b) return true;
|
5771 |
|
5772 | var typeofA = typeof a === 'undefined' ? 'undefined' : _typeof(a);
|
5773 | var typeofB = typeof b === 'undefined' ? 'undefined' : _typeof(b);
|
5774 |
|
5775 | if (typeofA !== typeofB) return false;
|
5776 |
|
5777 | !(typeofA !== 'function') ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'You must not store functions in location state') : (0, _invariant2.default)(false) : void 0;
|
5778 |
|
5779 |
|
5780 | if (typeofA === 'object') {
|
5781 | !!(isDate(a) && isDate(b)) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'You must not store Date objects in location state') : (0, _invariant2.default)(false) : void 0;
|
5782 |
|
5783 | if (!Array.isArray(a)) return Object.keys(a).every(function (key) {
|
5784 | return statesAreEqual(a[key], b[key]);
|
5785 | });
|
5786 |
|
5787 | return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
|
5788 | return statesAreEqual(item, b[index]);
|
5789 | });
|
5790 | }
|
5791 |
|
5792 |
|
5793 |
|
5794 | return false;
|
5795 | };
|
5796 |
|
5797 | var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {
|
5798 | return a.key === b.key &&
|
5799 |
|
5800 | a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && statesAreEqual(a.state, b.state);
|
5801 | };
|
5802 | }).call(this,require(91))
|
5803 | },{"58":58,"66":66,"81":81,"91":91}],66:[function(require,module,exports){
|
5804 | (function (process){
|
5805 | 'use strict';
|
5806 |
|
5807 | Object.defineProperty(exports, "__esModule", {
|
5808 | value: true
|
5809 | });
|
5810 | exports.createPath = exports.parsePath = exports.getQueryStringValueFromPath = exports.stripQueryStringValueFromPath = exports.addQueryStringValueToPath = exports.isAbsolutePath = undefined;
|
5811 |
|
5812 | var _warning = require(337);
|
5813 |
|
5814 | var _warning2 = _interopRequireDefault(_warning);
|
5815 |
|
5816 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5817 |
|
5818 | var isAbsolutePath = exports.isAbsolutePath = function isAbsolutePath(path) {
|
5819 | return typeof path === 'string' && path.charAt(0) === '/';
|
5820 | };
|
5821 |
|
5822 | var addQueryStringValueToPath = exports.addQueryStringValueToPath = function addQueryStringValueToPath(path, key, value) {
|
5823 | var _parsePath = parsePath(path);
|
5824 |
|
5825 | var pathname = _parsePath.pathname;
|
5826 | var search = _parsePath.search;
|
5827 | var hash = _parsePath.hash;
|
5828 |
|
5829 |
|
5830 | return createPath({
|
5831 | pathname: pathname,
|
5832 | search: search + (search.indexOf('?') === -1 ? '?' : '&') + key + '=' + value,
|
5833 | hash: hash
|
5834 | });
|
5835 | };
|
5836 |
|
5837 | var stripQueryStringValueFromPath = exports.stripQueryStringValueFromPath = function stripQueryStringValueFromPath(path, key) {
|
5838 | var _parsePath2 = parsePath(path);
|
5839 |
|
5840 | var pathname = _parsePath2.pathname;
|
5841 | var search = _parsePath2.search;
|
5842 | var hash = _parsePath2.hash;
|
5843 |
|
5844 |
|
5845 | return createPath({
|
5846 | pathname: pathname,
|
5847 | search: search.replace(new RegExp('([?&])' + key + '=[a-zA-Z0-9]+(&?)'), function (match, prefix, suffix) {
|
5848 | return prefix === '?' ? prefix : suffix;
|
5849 | }),
|
5850 | hash: hash
|
5851 | });
|
5852 | };
|
5853 |
|
5854 | var getQueryStringValueFromPath = exports.getQueryStringValueFromPath = function getQueryStringValueFromPath(path, key) {
|
5855 | var _parsePath3 = parsePath(path);
|
5856 |
|
5857 | var search = _parsePath3.search;
|
5858 |
|
5859 | var match = search.match(new RegExp('[?&]' + key + '=([a-zA-Z0-9]+)'));
|
5860 | return match && match[1];
|
5861 | };
|
5862 |
|
5863 | var extractPath = function extractPath(string) {
|
5864 | var match = string.match(/^(https?:)?\/\/[^\/]*/);
|
5865 | return match == null ? string : string.substring(match[0].length);
|
5866 | };
|
5867 |
|
5868 | var parsePath = exports.parsePath = function parsePath(path) {
|
5869 | var pathname = extractPath(path);
|
5870 | var search = '';
|
5871 | var hash = '';
|
5872 |
|
5873 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(path === pathname, 'A path must be pathname + search + hash only, not a full URL like "%s"', path) : void 0;
|
5874 |
|
5875 | var hashIndex = pathname.indexOf('#');
|
5876 | if (hashIndex !== -1) {
|
5877 | hash = pathname.substring(hashIndex);
|
5878 | pathname = pathname.substring(0, hashIndex);
|
5879 | }
|
5880 |
|
5881 | var searchIndex = pathname.indexOf('?');
|
5882 | if (searchIndex !== -1) {
|
5883 | search = pathname.substring(searchIndex);
|
5884 | pathname = pathname.substring(0, searchIndex);
|
5885 | }
|
5886 |
|
5887 | if (pathname === '') pathname = '/';
|
5888 |
|
5889 | return {
|
5890 | pathname: pathname,
|
5891 | search: search,
|
5892 | hash: hash
|
5893 | };
|
5894 | };
|
5895 |
|
5896 | var createPath = exports.createPath = function createPath(location) {
|
5897 | if (location == null || typeof location === 'string') return location;
|
5898 |
|
5899 | var basename = location.basename;
|
5900 | var pathname = location.pathname;
|
5901 | var search = location.search;
|
5902 | var hash = location.hash;
|
5903 |
|
5904 | var path = (basename || '') + pathname;
|
5905 |
|
5906 | if (search && search !== '?') path += search;
|
5907 |
|
5908 | if (hash) path += hash;
|
5909 |
|
5910 | return path;
|
5911 | };
|
5912 | }).call(this,require(91))
|
5913 | },{"337":337,"91":91}],67:[function(require,module,exports){
|
5914 | 'use strict';
|
5915 |
|
5916 | Object.defineProperty(exports, "__esModule", {
|
5917 | value: true
|
5918 | });
|
5919 | exports.replaceLocation = exports.pushLocation = exports.getCurrentLocation = exports.go = exports.getUserConfirmation = undefined;
|
5920 |
|
5921 | var _BrowserProtocol = require(60);
|
5922 |
|
5923 | Object.defineProperty(exports, 'getUserConfirmation', {
|
5924 | enumerable: true,
|
5925 | get: function get() {
|
5926 | return _BrowserProtocol.getUserConfirmation;
|
5927 | }
|
5928 | });
|
5929 | Object.defineProperty(exports, 'go', {
|
5930 | enumerable: true,
|
5931 | get: function get() {
|
5932 | return _BrowserProtocol.go;
|
5933 | }
|
5934 | });
|
5935 |
|
5936 | var _LocationUtils = require(65);
|
5937 |
|
5938 | var _PathUtils = require(66);
|
5939 |
|
5940 | var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation() {
|
5941 | return (0, _LocationUtils.createLocation)(window.location);
|
5942 | };
|
5943 |
|
5944 | var pushLocation = exports.pushLocation = function pushLocation(location) {
|
5945 | window.location.href = (0, _PathUtils.createPath)(location);
|
5946 | return false;
|
5947 | };
|
5948 |
|
5949 | var replaceLocation = exports.replaceLocation = function replaceLocation(location) {
|
5950 | window.location.replace((0, _PathUtils.createPath)(location));
|
5951 | return false;
|
5952 | };
|
5953 | },{"60":60,"65":65,"66":66}],68:[function(require,module,exports){
|
5954 | (function (process){
|
5955 | 'use strict';
|
5956 |
|
5957 | Object.defineProperty(exports, "__esModule", {
|
5958 | value: true
|
5959 | });
|
5960 |
|
5961 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
5962 |
|
5963 | var _invariant = require(81);
|
5964 |
|
5965 | var _invariant2 = _interopRequireDefault(_invariant);
|
5966 |
|
5967 | var _ExecutionEnvironment = require(63);
|
5968 |
|
5969 | var _BrowserProtocol = require(60);
|
5970 |
|
5971 | var BrowserProtocol = _interopRequireWildcard(_BrowserProtocol);
|
5972 |
|
5973 | var _RefreshProtocol = require(67);
|
5974 |
|
5975 | var RefreshProtocol = _interopRequireWildcard(_RefreshProtocol);
|
5976 |
|
5977 | var _DOMUtils = require(62);
|
5978 |
|
5979 | var _createHistory = require(70);
|
5980 |
|
5981 | var _createHistory2 = _interopRequireDefault(_createHistory);
|
5982 |
|
5983 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
5984 |
|
5985 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5986 |
|
5987 |
|
5988 |
|
5989 |
|
5990 |
|
5991 |
|
5992 |
|
5993 |
|
5994 |
|
5995 |
|
5996 |
|
5997 | var createBrowserHistory = function createBrowserHistory() {
|
5998 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
5999 |
|
6000 | !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Browser history needs a DOM') : (0, _invariant2.default)(false) : void 0;
|
6001 |
|
6002 | var useRefresh = options.forceRefresh || !(0, _DOMUtils.supportsHistory)();
|
6003 | var Protocol = useRefresh ? RefreshProtocol : BrowserProtocol;
|
6004 |
|
6005 | var getUserConfirmation = Protocol.getUserConfirmation;
|
6006 | var getCurrentLocation = Protocol.getCurrentLocation;
|
6007 | var pushLocation = Protocol.pushLocation;
|
6008 | var replaceLocation = Protocol.replaceLocation;
|
6009 | var go = Protocol.go;
|
6010 |
|
6011 |
|
6012 | var history = (0, _createHistory2.default)(_extends({
|
6013 | getUserConfirmation: getUserConfirmation }, options, {
|
6014 | getCurrentLocation: getCurrentLocation,
|
6015 | pushLocation: pushLocation,
|
6016 | replaceLocation: replaceLocation,
|
6017 | go: go
|
6018 | }));
|
6019 |
|
6020 | var listenerCount = 0,
|
6021 | stopListener = void 0;
|
6022 |
|
6023 | var startListener = function startListener(listener, before) {
|
6024 | if (++listenerCount === 1) stopListener = BrowserProtocol.startListener(history.transitionTo);
|
6025 |
|
6026 | var unlisten = before ? history.listenBefore(listener) : history.listen(listener);
|
6027 |
|
6028 | return function () {
|
6029 | unlisten();
|
6030 |
|
6031 | if (--listenerCount === 0) stopListener();
|
6032 | };
|
6033 | };
|
6034 |
|
6035 | var listenBefore = function listenBefore(listener) {
|
6036 | return startListener(listener, true);
|
6037 | };
|
6038 |
|
6039 | var listen = function listen(listener) {
|
6040 | return startListener(listener, false);
|
6041 | };
|
6042 |
|
6043 | return _extends({}, history, {
|
6044 | listenBefore: listenBefore,
|
6045 | listen: listen
|
6046 | });
|
6047 | };
|
6048 |
|
6049 | exports.default = createBrowserHistory;
|
6050 | }).call(this,require(91))
|
6051 | },{"60":60,"62":62,"63":63,"67":67,"70":70,"81":81,"91":91}],69:[function(require,module,exports){
|
6052 | (function (process){
|
6053 | 'use strict';
|
6054 |
|
6055 | Object.defineProperty(exports, "__esModule", {
|
6056 | value: true
|
6057 | });
|
6058 |
|
6059 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
6060 |
|
6061 | var _warning = require(337);
|
6062 |
|
6063 | var _warning2 = _interopRequireDefault(_warning);
|
6064 |
|
6065 | var _invariant = require(81);
|
6066 |
|
6067 | var _invariant2 = _interopRequireDefault(_invariant);
|
6068 |
|
6069 | var _ExecutionEnvironment = require(63);
|
6070 |
|
6071 | var _DOMUtils = require(62);
|
6072 |
|
6073 | var _HashProtocol = require(64);
|
6074 |
|
6075 | var HashProtocol = _interopRequireWildcard(_HashProtocol);
|
6076 |
|
6077 | var _createHistory = require(70);
|
6078 |
|
6079 | var _createHistory2 = _interopRequireDefault(_createHistory);
|
6080 |
|
6081 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
6082 |
|
6083 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6084 |
|
6085 | var DefaultQueryKey = '_k';
|
6086 |
|
6087 | var createHashHistory = function createHashHistory() {
|
6088 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
6089 |
|
6090 | !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Hash history needs a DOM') : (0, _invariant2.default)(false) : void 0;
|
6091 |
|
6092 | var queryKey = options.queryKey;
|
6093 |
|
6094 |
|
6095 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(queryKey !== false, 'Using { queryKey: false } no longer works. Instead, just don\'t ' + 'use location state if you don\'t want a key in your URL query string') : void 0;
|
6096 |
|
6097 | if (typeof queryKey !== 'string') queryKey = DefaultQueryKey;
|
6098 |
|
6099 | var getUserConfirmation = HashProtocol.getUserConfirmation;
|
6100 |
|
6101 |
|
6102 | var getCurrentLocation = function getCurrentLocation() {
|
6103 | return HashProtocol.getCurrentLocation(queryKey);
|
6104 | };
|
6105 |
|
6106 | var pushLocation = function pushLocation(location) {
|
6107 | return HashProtocol.pushLocation(location, queryKey);
|
6108 | };
|
6109 |
|
6110 | var replaceLocation = function replaceLocation(location) {
|
6111 | return HashProtocol.replaceLocation(location, queryKey);
|
6112 | };
|
6113 |
|
6114 | var history = (0, _createHistory2.default)(_extends({
|
6115 | getUserConfirmation: getUserConfirmation }, options, {
|
6116 | getCurrentLocation: getCurrentLocation,
|
6117 | pushLocation: pushLocation,
|
6118 | replaceLocation: replaceLocation,
|
6119 | go: HashProtocol.go
|
6120 | }));
|
6121 |
|
6122 | var listenerCount = 0,
|
6123 | stopListener = void 0;
|
6124 |
|
6125 | var startListener = function startListener(listener, before) {
|
6126 | if (++listenerCount === 1) stopListener = HashProtocol.startListener(history.transitionTo, queryKey);
|
6127 |
|
6128 | var unlisten = before ? history.listenBefore(listener) : history.listen(listener);
|
6129 |
|
6130 | return function () {
|
6131 | unlisten();
|
6132 |
|
6133 | if (--listenerCount === 0) stopListener();
|
6134 | };
|
6135 | };
|
6136 |
|
6137 | var listenBefore = function listenBefore(listener) {
|
6138 | return startListener(listener, true);
|
6139 | };
|
6140 |
|
6141 | var listen = function listen(listener) {
|
6142 | return startListener(listener, false);
|
6143 | };
|
6144 |
|
6145 | var goIsSupportedWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();
|
6146 |
|
6147 | var go = function go(n) {
|
6148 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(goIsSupportedWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;
|
6149 |
|
6150 | history.go(n);
|
6151 | };
|
6152 |
|
6153 | var createHref = function createHref(path) {
|
6154 | return '#' + history.createHref(path);
|
6155 | };
|
6156 |
|
6157 | return _extends({}, history, {
|
6158 | listenBefore: listenBefore,
|
6159 | listen: listen,
|
6160 | go: go,
|
6161 | createHref: createHref
|
6162 | });
|
6163 | };
|
6164 |
|
6165 | exports.default = createHashHistory;
|
6166 | }).call(this,require(91))
|
6167 | },{"337":337,"62":62,"63":63,"64":64,"70":70,"81":81,"91":91}],70:[function(require,module,exports){
|
6168 | 'use strict';
|
6169 |
|
6170 | Object.defineProperty(exports, "__esModule", {
|
6171 | value: true
|
6172 | });
|
6173 |
|
6174 | var _AsyncUtils = require(59);
|
6175 |
|
6176 | var _PathUtils = require(66);
|
6177 |
|
6178 | var _runTransitionHook = require(73);
|
6179 |
|
6180 | var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
|
6181 |
|
6182 | var _Actions = require(58);
|
6183 |
|
6184 | var _LocationUtils = require(65);
|
6185 |
|
6186 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6187 |
|
6188 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
6189 |
|
6190 | var createHistory = function createHistory() {
|
6191 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
6192 | var getCurrentLocation = options.getCurrentLocation;
|
6193 | var getUserConfirmation = options.getUserConfirmation;
|
6194 | var pushLocation = options.pushLocation;
|
6195 | var replaceLocation = options.replaceLocation;
|
6196 | var go = options.go;
|
6197 | var keyLength = options.keyLength;
|
6198 |
|
6199 |
|
6200 | var currentLocation = void 0;
|
6201 | var pendingLocation = void 0;
|
6202 | var beforeListeners = [];
|
6203 | var listeners = [];
|
6204 | var allKeys = [];
|
6205 |
|
6206 | var getCurrentIndex = function getCurrentIndex() {
|
6207 | if (pendingLocation && pendingLocation.action === _Actions.POP) return allKeys.indexOf(pendingLocation.key);
|
6208 |
|
6209 | if (currentLocation) return allKeys.indexOf(currentLocation.key);
|
6210 |
|
6211 | return -1;
|
6212 | };
|
6213 |
|
6214 | var updateLocation = function updateLocation(nextLocation) {
|
6215 | currentLocation = nextLocation;
|
6216 |
|
6217 | var currentIndex = getCurrentIndex();
|
6218 |
|
6219 | if (currentLocation.action === _Actions.PUSH) {
|
6220 | allKeys = [].concat(_toConsumableArray(allKeys.slice(0, currentIndex + 1)), [currentLocation.key]);
|
6221 | } else if (currentLocation.action === _Actions.REPLACE) {
|
6222 | allKeys[currentIndex] = currentLocation.key;
|
6223 | }
|
6224 |
|
6225 | listeners.forEach(function (listener) {
|
6226 | return listener(currentLocation);
|
6227 | });
|
6228 | };
|
6229 |
|
6230 | var listenBefore = function listenBefore(listener) {
|
6231 | beforeListeners.push(listener);
|
6232 |
|
6233 | return function () {
|
6234 | return beforeListeners = beforeListeners.filter(function (item) {
|
6235 | return item !== listener;
|
6236 | });
|
6237 | };
|
6238 | };
|
6239 |
|
6240 | var listen = function listen(listener) {
|
6241 | listeners.push(listener);
|
6242 |
|
6243 | return function () {
|
6244 | return listeners = listeners.filter(function (item) {
|
6245 | return item !== listener;
|
6246 | });
|
6247 | };
|
6248 | };
|
6249 |
|
6250 | var confirmTransitionTo = function confirmTransitionTo(location, callback) {
|
6251 | (0, _AsyncUtils.loopAsync)(beforeListeners.length, function (index, next, done) {
|
6252 | (0, _runTransitionHook2.default)(beforeListeners[index], location, function (result) {
|
6253 | return result != null ? done(result) : next();
|
6254 | });
|
6255 | }, function (message) {
|
6256 | if (getUserConfirmation && typeof message === 'string') {
|
6257 | getUserConfirmation(message, function (ok) {
|
6258 | return callback(ok !== false);
|
6259 | });
|
6260 | } else {
|
6261 | callback(message !== false);
|
6262 | }
|
6263 | });
|
6264 | };
|
6265 |
|
6266 | var transitionTo = function transitionTo(nextLocation) {
|
6267 | if (currentLocation && (0, _LocationUtils.locationsAreEqual)(currentLocation, nextLocation) || pendingLocation && (0, _LocationUtils.locationsAreEqual)(pendingLocation, nextLocation)) return;
|
6268 |
|
6269 | pendingLocation = nextLocation;
|
6270 |
|
6271 | confirmTransitionTo(nextLocation, function (ok) {
|
6272 | if (pendingLocation !== nextLocation) return;
|
6273 |
|
6274 | pendingLocation = null;
|
6275 |
|
6276 | if (ok) {
|
6277 |
|
6278 | if (nextLocation.action === _Actions.PUSH) {
|
6279 | var prevPath = (0, _PathUtils.createPath)(currentLocation);
|
6280 | var nextPath = (0, _PathUtils.createPath)(nextLocation);
|
6281 |
|
6282 | if (nextPath === prevPath && (0, _LocationUtils.statesAreEqual)(currentLocation.state, nextLocation.state)) nextLocation.action = _Actions.REPLACE;
|
6283 | }
|
6284 |
|
6285 | if (nextLocation.action === _Actions.POP) {
|
6286 | updateLocation(nextLocation);
|
6287 | } else if (nextLocation.action === _Actions.PUSH) {
|
6288 | if (pushLocation(nextLocation) !== false) updateLocation(nextLocation);
|
6289 | } else if (nextLocation.action === _Actions.REPLACE) {
|
6290 | if (replaceLocation(nextLocation) !== false) updateLocation(nextLocation);
|
6291 | }
|
6292 | } else if (currentLocation && nextLocation.action === _Actions.POP) {
|
6293 | var prevIndex = allKeys.indexOf(currentLocation.key);
|
6294 | var nextIndex = allKeys.indexOf(nextLocation.key);
|
6295 |
|
6296 | if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex);
|
6297 | }
|
6298 | });
|
6299 | };
|
6300 |
|
6301 | var push = function push(input) {
|
6302 | return transitionTo(createLocation(input, _Actions.PUSH));
|
6303 | };
|
6304 |
|
6305 | var replace = function replace(input) {
|
6306 | return transitionTo(createLocation(input, _Actions.REPLACE));
|
6307 | };
|
6308 |
|
6309 | var goBack = function goBack() {
|
6310 | return go(-1);
|
6311 | };
|
6312 |
|
6313 | var goForward = function goForward() {
|
6314 | return go(1);
|
6315 | };
|
6316 |
|
6317 | var createKey = function createKey() {
|
6318 | return Math.random().toString(36).substr(2, keyLength || 6);
|
6319 | };
|
6320 |
|
6321 | var createHref = function createHref(location) {
|
6322 | return (0, _PathUtils.createPath)(location);
|
6323 | };
|
6324 |
|
6325 | var createLocation = function createLocation(location, action) {
|
6326 | var key = arguments.length <= 2 || arguments[2] === undefined ? createKey() : arguments[2];
|
6327 | return (0, _LocationUtils.createLocation)(location, action, key);
|
6328 | };
|
6329 |
|
6330 | return {
|
6331 | getCurrentLocation: getCurrentLocation,
|
6332 | listenBefore: listenBefore,
|
6333 | listen: listen,
|
6334 | transitionTo: transitionTo,
|
6335 | push: push,
|
6336 | replace: replace,
|
6337 | go: go,
|
6338 | goBack: goBack,
|
6339 | goForward: goForward,
|
6340 | createKey: createKey,
|
6341 | createPath: _PathUtils.createPath,
|
6342 | createHref: createHref,
|
6343 | createLocation: createLocation
|
6344 | };
|
6345 | };
|
6346 |
|
6347 | exports.default = createHistory;
|
6348 | },{"58":58,"59":59,"65":65,"66":66,"73":73}],71:[function(require,module,exports){
|
6349 | (function (process){
|
6350 | 'use strict';
|
6351 |
|
6352 | Object.defineProperty(exports, "__esModule", {
|
6353 | value: true
|
6354 | });
|
6355 |
|
6356 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
6357 |
|
6358 | var _warning = require(337);
|
6359 |
|
6360 | var _warning2 = _interopRequireDefault(_warning);
|
6361 |
|
6362 | var _invariant = require(81);
|
6363 |
|
6364 | var _invariant2 = _interopRequireDefault(_invariant);
|
6365 |
|
6366 | var _LocationUtils = require(65);
|
6367 |
|
6368 | var _PathUtils = require(66);
|
6369 |
|
6370 | var _createHistory = require(70);
|
6371 |
|
6372 | var _createHistory2 = _interopRequireDefault(_createHistory);
|
6373 |
|
6374 | var _Actions = require(58);
|
6375 |
|
6376 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6377 |
|
6378 | var createStateStorage = function createStateStorage(entries) {
|
6379 | return entries.filter(function (entry) {
|
6380 | return entry.state;
|
6381 | }).reduce(function (memo, entry) {
|
6382 | memo[entry.key] = entry.state;
|
6383 | return memo;
|
6384 | }, {});
|
6385 | };
|
6386 |
|
6387 | var createMemoryHistory = function createMemoryHistory() {
|
6388 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
6389 |
|
6390 | if (Array.isArray(options)) {
|
6391 | options = { entries: options };
|
6392 | } else if (typeof options === 'string') {
|
6393 | options = { entries: [options] };
|
6394 | }
|
6395 |
|
6396 | var getCurrentLocation = function getCurrentLocation() {
|
6397 | var entry = entries[current];
|
6398 | var path = (0, _PathUtils.createPath)(entry);
|
6399 |
|
6400 | var key = void 0,
|
6401 | state = void 0;
|
6402 | if (entry.key) {
|
6403 | key = entry.key;
|
6404 | state = readState(key);
|
6405 | }
|
6406 |
|
6407 | var init = (0, _PathUtils.parsePath)(path);
|
6408 |
|
6409 | return (0, _LocationUtils.createLocation)(_extends({}, init, { state: state }), undefined, key);
|
6410 | };
|
6411 |
|
6412 | var canGo = function canGo(n) {
|
6413 | var index = current + n;
|
6414 | return index >= 0 && index < entries.length;
|
6415 | };
|
6416 |
|
6417 | var go = function go(n) {
|
6418 | if (!n) return;
|
6419 |
|
6420 | if (!canGo(n)) {
|
6421 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, 'Cannot go(%s) there is not enough history', n) : void 0;
|
6422 |
|
6423 | return;
|
6424 | }
|
6425 |
|
6426 | current += n;
|
6427 | var currentLocation = getCurrentLocation();
|
6428 |
|
6429 |
|
6430 | history.transitionTo(_extends({}, currentLocation, { action: _Actions.POP }));
|
6431 | };
|
6432 |
|
6433 | var pushLocation = function pushLocation(location) {
|
6434 | current += 1;
|
6435 |
|
6436 | if (current < entries.length) entries.splice(current);
|
6437 |
|
6438 | entries.push(location);
|
6439 |
|
6440 | saveState(location.key, location.state);
|
6441 | };
|
6442 |
|
6443 | var replaceLocation = function replaceLocation(location) {
|
6444 | entries[current] = location;
|
6445 | saveState(location.key, location.state);
|
6446 | };
|
6447 |
|
6448 | var history = (0, _createHistory2.default)(_extends({}, options, {
|
6449 | getCurrentLocation: getCurrentLocation,
|
6450 | pushLocation: pushLocation,
|
6451 | replaceLocation: replaceLocation,
|
6452 | go: go
|
6453 | }));
|
6454 |
|
6455 | var _options = options;
|
6456 | var entries = _options.entries;
|
6457 | var current = _options.current;
|
6458 |
|
6459 |
|
6460 | if (typeof entries === 'string') {
|
6461 | entries = [entries];
|
6462 | } else if (!Array.isArray(entries)) {
|
6463 | entries = ['/'];
|
6464 | }
|
6465 |
|
6466 | entries = entries.map(function (entry) {
|
6467 | return (0, _LocationUtils.createLocation)(entry);
|
6468 | });
|
6469 |
|
6470 | if (current == null) {
|
6471 | current = entries.length - 1;
|
6472 | } else {
|
6473 | !(current >= 0 && current < entries.length) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Current index must be >= 0 and < %s, was %s', entries.length, current) : (0, _invariant2.default)(false) : void 0;
|
6474 | }
|
6475 |
|
6476 | var storage = createStateStorage(entries);
|
6477 |
|
6478 | var saveState = function saveState(key, state) {
|
6479 | return storage[key] = state;
|
6480 | };
|
6481 |
|
6482 | var readState = function readState(key) {
|
6483 | return storage[key];
|
6484 | };
|
6485 |
|
6486 | return history;
|
6487 | };
|
6488 |
|
6489 | exports.default = createMemoryHistory;
|
6490 | }).call(this,require(91))
|
6491 | },{"337":337,"58":58,"65":65,"66":66,"70":70,"81":81,"91":91}],72:[function(require,module,exports){
|
6492 | 'use strict';
|
6493 |
|
6494 | Object.defineProperty(exports, "__esModule", {
|
6495 | value: true
|
6496 | });
|
6497 | exports.locationsAreEqual = exports.Actions = exports.useQueries = exports.useBeforeUnload = exports.useBasename = exports.createMemoryHistory = exports.createHashHistory = exports.createHistory = undefined;
|
6498 |
|
6499 | var _LocationUtils = require(65);
|
6500 |
|
6501 | Object.defineProperty(exports, 'locationsAreEqual', {
|
6502 | enumerable: true,
|
6503 | get: function get() {
|
6504 | return _LocationUtils.locationsAreEqual;
|
6505 | }
|
6506 | });
|
6507 |
|
6508 | var _createBrowserHistory = require(68);
|
6509 |
|
6510 | var _createBrowserHistory2 = _interopRequireDefault(_createBrowserHistory);
|
6511 |
|
6512 | var _createHashHistory2 = require(69);
|
6513 |
|
6514 | var _createHashHistory3 = _interopRequireDefault(_createHashHistory2);
|
6515 |
|
6516 | var _createMemoryHistory2 = require(71);
|
6517 |
|
6518 | var _createMemoryHistory3 = _interopRequireDefault(_createMemoryHistory2);
|
6519 |
|
6520 | var _useBasename2 = require(74);
|
6521 |
|
6522 | var _useBasename3 = _interopRequireDefault(_useBasename2);
|
6523 |
|
6524 | var _useBeforeUnload2 = require(75);
|
6525 |
|
6526 | var _useBeforeUnload3 = _interopRequireDefault(_useBeforeUnload2);
|
6527 |
|
6528 | var _useQueries2 = require(76);
|
6529 |
|
6530 | var _useQueries3 = _interopRequireDefault(_useQueries2);
|
6531 |
|
6532 | var _Actions2 = require(58);
|
6533 |
|
6534 | var _Actions3 = _interopRequireDefault(_Actions2);
|
6535 |
|
6536 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6537 |
|
6538 | exports.createHistory = _createBrowserHistory2.default;
|
6539 | exports.createHashHistory = _createHashHistory3.default;
|
6540 | exports.createMemoryHistory = _createMemoryHistory3.default;
|
6541 | exports.useBasename = _useBasename3.default;
|
6542 | exports.useBeforeUnload = _useBeforeUnload3.default;
|
6543 | exports.useQueries = _useQueries3.default;
|
6544 | exports.Actions = _Actions3.default;
|
6545 | },{"58":58,"65":65,"68":68,"69":69,"71":71,"74":74,"75":75,"76":76}],73:[function(require,module,exports){
|
6546 | (function (process){
|
6547 | 'use strict';
|
6548 |
|
6549 | Object.defineProperty(exports, "__esModule", {
|
6550 | value: true
|
6551 | });
|
6552 |
|
6553 | var _warning = require(337);
|
6554 |
|
6555 | var _warning2 = _interopRequireDefault(_warning);
|
6556 |
|
6557 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6558 |
|
6559 | var runTransitionHook = function runTransitionHook(hook, location, callback) {
|
6560 | var result = hook(location, callback);
|
6561 |
|
6562 | if (hook.length < 2) {
|
6563 |
|
6564 |
|
6565 | callback(result);
|
6566 | } else {
|
6567 | process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(result === undefined, 'You should not "return" in a transition hook with a callback argument; ' + 'call the callback instead') : void 0;
|
6568 | }
|
6569 | };
|
6570 |
|
6571 | exports.default = runTransitionHook;
|
6572 | }).call(this,require(91))
|
6573 | },{"337":337,"91":91}],74:[function(require,module,exports){
|
6574 | 'use strict';
|
6575 |
|
6576 | Object.defineProperty(exports, "__esModule", {
|
6577 | value: true
|
6578 | });
|
6579 |
|
6580 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
6581 |
|
6582 | var _runTransitionHook = require(73);
|
6583 |
|
6584 | var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
|
6585 |
|
6586 | var _PathUtils = require(66);
|
6587 |
|
6588 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6589 |
|
6590 | var useBasename = function useBasename(createHistory) {
|
6591 | return function () {
|
6592 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
6593 |
|
6594 | var history = createHistory(options);
|
6595 | var basename = options.basename;
|
6596 |
|
6597 |
|
6598 | var addBasename = function addBasename(location) {
|
6599 | if (!location) return location;
|
6600 |
|
6601 | if (basename && location.basename == null) {
|
6602 | if (location.pathname.indexOf(basename) === 0) {
|
6603 | location.pathname = location.pathname.substring(basename.length);
|
6604 | location.basename = basename;
|
6605 |
|
6606 | if (location.pathname === '') location.pathname = '/';
|
6607 | } else {
|
6608 | location.basename = '';
|
6609 | }
|
6610 | }
|
6611 |
|
6612 | return location;
|
6613 | };
|
6614 |
|
6615 | var prependBasename = function prependBasename(location) {
|
6616 | if (!basename) return location;
|
6617 |
|
6618 | var object = typeof location === 'string' ? (0, _PathUtils.parsePath)(location) : location;
|
6619 | var pname = object.pathname;
|
6620 | var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/';
|
6621 | var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname;
|
6622 | var pathname = normalizedBasename + normalizedPathname;
|
6623 |
|
6624 | return _extends({}, location, {
|
6625 | pathname: pathname
|
6626 | });
|
6627 | };
|
6628 |
|
6629 |
|
6630 | var getCurrentLocation = function getCurrentLocation() {
|
6631 | return addBasename(history.getCurrentLocation());
|
6632 | };
|
6633 |
|
6634 | var listenBefore = function listenBefore(hook) {
|
6635 | return history.listenBefore(function (location, callback) {
|
6636 | return (0, _runTransitionHook2.default)(hook, addBasename(location), callback);
|
6637 | });
|
6638 | };
|
6639 |
|
6640 | var listen = function listen(listener) {
|
6641 | return history.listen(function (location) {
|
6642 | return listener(addBasename(location));
|
6643 | });
|
6644 | };
|
6645 |
|
6646 |
|
6647 | var push = function push(location) {
|
6648 | return history.push(prependBasename(location));
|
6649 | };
|
6650 |
|
6651 | var replace = function replace(location) {
|
6652 | return history.replace(prependBasename(location));
|
6653 | };
|
6654 |
|
6655 | var createPath = function createPath(location) {
|
6656 | return history.createPath(prependBasename(location));
|
6657 | };
|
6658 |
|
6659 | var createHref = function createHref(location) {
|
6660 | return history.createHref(prependBasename(location));
|
6661 | };
|
6662 |
|
6663 | var createLocation = function createLocation(location) {
|
6664 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
6665 | args[_key - 1] = arguments[_key];
|
6666 | }
|
6667 |
|
6668 | return addBasename(history.createLocation.apply(history, [prependBasename(location)].concat(args)));
|
6669 | };
|
6670 |
|
6671 | return _extends({}, history, {
|
6672 | getCurrentLocation: getCurrentLocation,
|
6673 | listenBefore: listenBefore,
|
6674 | listen: listen,
|
6675 | push: push,
|
6676 | replace: replace,
|
6677 | createPath: createPath,
|
6678 | createHref: createHref,
|
6679 | createLocation: createLocation
|
6680 | });
|
6681 | };
|
6682 | };
|
6683 |
|
6684 | exports.default = useBasename;
|
6685 | },{"66":66,"73":73}],75:[function(require,module,exports){
|
6686 | (function (process){
|
6687 | 'use strict';
|
6688 |
|
6689 | Object.defineProperty(exports, "__esModule", {
|
6690 | value: true
|
6691 | });
|
6692 |
|
6693 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
6694 |
|
6695 | var _invariant = require(81);
|
6696 |
|
6697 | var _invariant2 = _interopRequireDefault(_invariant);
|
6698 |
|
6699 | var _DOMUtils = require(62);
|
6700 |
|
6701 | var _ExecutionEnvironment = require(63);
|
6702 |
|
6703 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6704 |
|
6705 | var startListener = function startListener(getPromptMessage) {
|
6706 | var handleBeforeUnload = function handleBeforeUnload(event) {
|
6707 | var message = getPromptMessage();
|
6708 |
|
6709 | if (typeof message === 'string') {
|
6710 | (event || window.event).returnValue = message;
|
6711 | return message;
|
6712 | }
|
6713 |
|
6714 | return undefined;
|
6715 | };
|
6716 |
|
6717 | (0, _DOMUtils.addEventListener)(window, 'beforeunload', handleBeforeUnload);
|
6718 |
|
6719 | return function () {
|
6720 | return (0, _DOMUtils.removeEventListener)(window, 'beforeunload', handleBeforeUnload);
|
6721 | };
|
6722 | };
|
6723 |
|
6724 |
|
6725 |
|
6726 |
|
6727 |
|
6728 |
|
6729 | var useBeforeUnload = function useBeforeUnload(createHistory) {
|
6730 | !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'useBeforeUnload only works in DOM environments') : (0, _invariant2.default)(false) : void 0;
|
6731 |
|
6732 | return function (options) {
|
6733 | var history = createHistory(options);
|
6734 |
|
6735 | var listeners = [];
|
6736 | var stopListener = void 0;
|
6737 |
|
6738 | var getPromptMessage = function getPromptMessage() {
|
6739 | var message = void 0;
|
6740 | for (var i = 0, len = listeners.length; message == null && i < len; ++i) {
|
6741 | message = listeners[i].call();
|
6742 | }return message;
|
6743 | };
|
6744 |
|
6745 | var listenBeforeUnload = function listenBeforeUnload(listener) {
|
6746 | if (listeners.push(listener) === 1) stopListener = startListener(getPromptMessage);
|
6747 |
|
6748 | return function () {
|
6749 | listeners = listeners.filter(function (item) {
|
6750 | return item !== listener;
|
6751 | });
|
6752 |
|
6753 | if (listeners.length === 0 && stopListener) {
|
6754 | stopListener();
|
6755 | stopListener = null;
|
6756 | }
|
6757 | };
|
6758 | };
|
6759 |
|
6760 | return _extends({}, history, {
|
6761 | listenBeforeUnload: listenBeforeUnload
|
6762 | });
|
6763 | };
|
6764 | };
|
6765 |
|
6766 | exports.default = useBeforeUnload;
|
6767 | }).call(this,require(91))
|
6768 | },{"62":62,"63":63,"81":81,"91":91}],76:[function(require,module,exports){
|
6769 | 'use strict';
|
6770 |
|
6771 | Object.defineProperty(exports, "__esModule", {
|
6772 | value: true
|
6773 | });
|
6774 |
|
6775 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
6776 |
|
6777 | var _queryString = require(78);
|
6778 |
|
6779 | var _runTransitionHook = require(73);
|
6780 |
|
6781 | var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
|
6782 |
|
6783 | var _LocationUtils = require(65);
|
6784 |
|
6785 | var _PathUtils = require(66);
|
6786 |
|
6787 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6788 |
|
6789 | var defaultStringifyQuery = function defaultStringifyQuery(query) {
|
6790 | return (0, _queryString.stringify)(query).replace(/%20/g, '+');
|
6791 | };
|
6792 |
|
6793 | var defaultParseQueryString = _queryString.parse;
|
6794 |
|
6795 |
|
6796 |
|
6797 |
|
6798 |
|
6799 | var useQueries = function useQueries(createHistory) {
|
6800 | return function () {
|
6801 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
6802 |
|
6803 | var history = createHistory(options);
|
6804 | var stringifyQuery = options.stringifyQuery;
|
6805 | var parseQueryString = options.parseQueryString;
|
6806 |
|
6807 |
|
6808 | if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery;
|
6809 |
|
6810 | if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString;
|
6811 |
|
6812 | var decodeQuery = function decodeQuery(location) {
|
6813 | if (!location) return location;
|
6814 |
|
6815 | if (location.query == null) location.query = parseQueryString(location.search.substring(1));
|
6816 |
|
6817 | return location;
|
6818 | };
|
6819 |
|
6820 | var encodeQuery = function encodeQuery(location, query) {
|
6821 | if (query == null) return location;
|
6822 |
|
6823 | var object = typeof location === 'string' ? (0, _PathUtils.parsePath)(location) : location;
|
6824 | var queryString = stringifyQuery(query);
|
6825 | var search = queryString ? '?' + queryString : '';
|
6826 |
|
6827 | return _extends({}, object, {
|
6828 | search: search
|
6829 | });
|
6830 | };
|
6831 |
|
6832 |
|
6833 | var getCurrentLocation = function getCurrentLocation() {
|
6834 | return decodeQuery(history.getCurrentLocation());
|
6835 | };
|
6836 |
|
6837 | var listenBefore = function listenBefore(hook) {
|
6838 | return history.listenBefore(function (location, callback) {
|
6839 | return (0, _runTransitionHook2.default)(hook, decodeQuery(location), callback);
|
6840 | });
|
6841 | };
|
6842 |
|
6843 | var listen = function listen(listener) {
|
6844 | return history.listen(function (location) {
|
6845 | return listener(decodeQuery(location));
|
6846 | });
|
6847 | };
|
6848 |
|
6849 |
|
6850 | var push = function push(location) {
|
6851 | return history.push(encodeQuery(location, location.query));
|
6852 | };
|
6853 |
|
6854 | var replace = function replace(location) {
|
6855 | return history.replace(encodeQuery(location, location.query));
|
6856 | };
|
6857 |
|
6858 | var createPath = function createPath(location) {
|
6859 | return history.createPath(encodeQuery(location, location.query));
|
6860 | };
|
6861 |
|
6862 | var createHref = function createHref(location) {
|
6863 | return history.createHref(encodeQuery(location, location.query));
|
6864 | };
|
6865 |
|
6866 | var createLocation = function createLocation(location) {
|
6867 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
6868 | args[_key - 1] = arguments[_key];
|
6869 | }
|
6870 |
|
6871 | var newLocation = history.createLocation.apply(history, [encodeQuery(location, location.query)].concat(args));
|
6872 |
|
6873 | if (location.query) newLocation.query = (0, _LocationUtils.createQuery)(location.query);
|
6874 |
|
6875 | return decodeQuery(newLocation);
|
6876 | };
|
6877 |
|
6878 | return _extends({}, history, {
|
6879 | getCurrentLocation: getCurrentLocation,
|
6880 | listenBefore: listenBefore,
|
6881 | listen: listen,
|
6882 | push: push,
|
6883 | replace: replace,
|
6884 | createPath: createPath,
|
6885 | createHref: createHref,
|
6886 | createLocation: createLocation
|
6887 | });
|
6888 | };
|
6889 | };
|
6890 |
|
6891 | exports.default = useQueries;
|
6892 | },{"65":65,"66":66,"73":73,"78":78}],77:[function(require,module,exports){
|
6893 | 'use strict';
|
6894 |
|
6895 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
6896 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
6897 |
|
6898 | function toObject(val) {
|
6899 | if (val === null || val === undefined) {
|
6900 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
6901 | }
|
6902 |
|
6903 | return Object(val);
|
6904 | }
|
6905 |
|
6906 | function shouldUseNative() {
|
6907 | try {
|
6908 | if (!Object.assign) {
|
6909 | return false;
|
6910 | }
|
6911 |
|
6912 |
|
6913 |
|
6914 |
|
6915 | var test1 = new String('abc');
|
6916 | test1[5] = 'de';
|
6917 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
6918 | return false;
|
6919 | }
|
6920 |
|
6921 |
|
6922 | var test2 = {};
|
6923 | for (var i = 0; i < 10; i++) {
|
6924 | test2['_' + String.fromCharCode(i)] = i;
|
6925 | }
|
6926 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
6927 | return test2[n];
|
6928 | });
|
6929 | if (order2.join('') !== '0123456789') {
|
6930 | return false;
|
6931 | }
|
6932 |
|
6933 |
|
6934 | var test3 = {};
|
6935 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
6936 | test3[letter] = letter;
|
6937 | });
|
6938 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
6939 | 'abcdefghijklmnopqrst') {
|
6940 | return false;
|
6941 | }
|
6942 |
|
6943 | return true;
|
6944 | } catch (e) {
|
6945 |
|
6946 | return false;
|
6947 | }
|
6948 | }
|
6949 |
|
6950 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
6951 | var from;
|
6952 | var to = toObject(target);
|
6953 | var symbols;
|
6954 |
|
6955 | for (var s = 1; s < arguments.length; s++) {
|
6956 | from = Object(arguments[s]);
|
6957 |
|
6958 | for (var key in from) {
|
6959 | if (hasOwnProperty.call(from, key)) {
|
6960 | to[key] = from[key];
|
6961 | }
|
6962 | }
|
6963 |
|
6964 | if (Object.getOwnPropertySymbols) {
|
6965 | symbols = Object.getOwnPropertySymbols(from);
|
6966 | for (var i = 0; i < symbols.length; i++) {
|
6967 | if (propIsEnumerable.call(from, symbols[i])) {
|
6968 | to[symbols[i]] = from[symbols[i]];
|
6969 | }
|
6970 | }
|
6971 | }
|
6972 | }
|
6973 |
|
6974 | return to;
|
6975 | };
|
6976 |
|
6977 | },{}],78:[function(require,module,exports){
|
6978 | 'use strict';
|
6979 | var strictUriEncode = require(331);
|
6980 | var objectAssign = require(77);
|
6981 |
|
6982 | function encode(value, opts) {
|
6983 | if (opts.encode) {
|
6984 | return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
|
6985 | }
|
6986 |
|
6987 | return value;
|
6988 | }
|
6989 |
|
6990 | exports.extract = function (str) {
|
6991 | return str.split('?')[1] || '';
|
6992 | };
|
6993 |
|
6994 | exports.parse = function (str) {
|
6995 |
|
6996 |
|
6997 | var ret = Object.create(null);
|
6998 |
|
6999 | if (typeof str !== 'string') {
|
7000 | return ret;
|
7001 | }
|
7002 |
|
7003 | str = str.trim().replace(/^(\?|#|&)/, '');
|
7004 |
|
7005 | if (!str) {
|
7006 | return ret;
|
7007 | }
|
7008 |
|
7009 | str.split('&').forEach(function (param) {
|
7010 | var parts = param.replace(/\+/g, ' ').split('=');
|
7011 |
|
7012 |
|
7013 | var key = parts.shift();
|
7014 | var val = parts.length > 0 ? parts.join('=') : undefined;
|
7015 |
|
7016 | key = decodeURIComponent(key);
|
7017 |
|
7018 |
|
7019 |
|
7020 | val = val === undefined ? null : decodeURIComponent(val);
|
7021 |
|
7022 | if (ret[key] === undefined) {
|
7023 | ret[key] = val;
|
7024 | } else if (Array.isArray(ret[key])) {
|
7025 | ret[key].push(val);
|
7026 | } else {
|
7027 | ret[key] = [ret[key], val];
|
7028 | }
|
7029 | });
|
7030 |
|
7031 | return ret;
|
7032 | };
|
7033 |
|
7034 | exports.stringify = function (obj, opts) {
|
7035 | var defaults = {
|
7036 | encode: true,
|
7037 | strict: true
|
7038 | };
|
7039 |
|
7040 | opts = objectAssign(defaults, opts);
|
7041 |
|
7042 | return obj ? Object.keys(obj).sort().map(function (key) {
|
7043 | var val = obj[key];
|
7044 |
|
7045 | if (val === undefined) {
|
7046 | return '';
|
7047 | }
|
7048 |
|
7049 | if (val === null) {
|
7050 | return key;
|
7051 | }
|
7052 |
|
7053 | if (Array.isArray(val)) {
|
7054 | var result = [];
|
7055 |
|
7056 | val.slice().sort().forEach(function (val2) {
|
7057 | if (val2 === undefined) {
|
7058 | return;
|
7059 | }
|
7060 |
|
7061 | if (val2 === null) {
|
7062 | result.push(encode(key, opts));
|
7063 | } else {
|
7064 | result.push(encode(key, opts) + '=' + encode(val2, opts));
|
7065 | }
|
7066 | });
|
7067 |
|
7068 | return result.join('&');
|
7069 | }
|
7070 |
|
7071 | return encode(key, opts) + '=' + encode(val, opts);
|
7072 | }).filter(function (x) {
|
7073 | return x.length > 0;
|
7074 | }).join('&') : '';
|
7075 | };
|
7076 |
|
7077 | },{"331":331,"77":77}],79:[function(require,module,exports){
|
7078 |
|
7079 |
|
7080 |
|
7081 |
|
7082 | 'use strict';
|
7083 |
|
7084 | var REACT_STATICS = {
|
7085 | childContextTypes: true,
|
7086 | contextTypes: true,
|
7087 | defaultProps: true,
|
7088 | displayName: true,
|
7089 | getDefaultProps: true,
|
7090 | mixins: true,
|
7091 | propTypes: true,
|
7092 | type: true
|
7093 | };
|
7094 |
|
7095 | var KNOWN_STATICS = {
|
7096 | name: true,
|
7097 | length: true,
|
7098 | prototype: true,
|
7099 | caller: true,
|
7100 | arguments: true,
|
7101 | arity: true
|
7102 | };
|
7103 |
|
7104 | module.exports = function hoistNonReactStatics(targetComponent, sourceComponent) {
|
7105 | if (typeof sourceComponent !== 'string') {
|
7106 | var keys = Object.getOwnPropertyNames(sourceComponent);
|
7107 | for (var i=0; i<keys.length; ++i) {
|
7108 | if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]]) {
|
7109 | try {
|
7110 | targetComponent[keys[i]] = sourceComponent[keys[i]];
|
7111 | } catch (error) {
|
7112 |
|
7113 | }
|
7114 | }
|
7115 | }
|
7116 | }
|
7117 |
|
7118 | return targetComponent;
|
7119 | };
|
7120 |
|
7121 | },{}],80:[function(require,module,exports){
|
7122 |
|
7123 | var indexOf = [].indexOf;
|
7124 |
|
7125 | module.exports = function(arr, obj){
|
7126 | if (indexOf) return arr.indexOf(obj);
|
7127 | for (var i = 0; i < arr.length; ++i) {
|
7128 | if (arr[i] === obj) return i;
|
7129 | }
|
7130 | return -1;
|
7131 | };
|
7132 | },{}],81:[function(require,module,exports){
|
7133 | (function (process){
|
7134 |
|
7135 |
|
7136 |
|
7137 |
|
7138 |
|
7139 |
|
7140 |
|
7141 |
|
7142 |
|
7143 | 'use strict';
|
7144 |
|
7145 |
|
7146 |
|
7147 |
|
7148 |
|
7149 |
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 |
|
7155 |
|
7156 | var invariant = function(condition, format, a, b, c, d, e, f) {
|
7157 | if (process.env.NODE_ENV !== 'production') {
|
7158 | if (format === undefined) {
|
7159 | throw new Error('invariant requires an error message argument');
|
7160 | }
|
7161 | }
|
7162 |
|
7163 | if (!condition) {
|
7164 | var error;
|
7165 | if (format === undefined) {
|
7166 | error = new Error(
|
7167 | 'Minified exception occurred; use the non-minified dev environment ' +
|
7168 | 'for the full error message and additional helpful warnings.'
|
7169 | );
|
7170 | } else {
|
7171 | var args = [a, b, c, d, e, f];
|
7172 | var argIndex = 0;
|
7173 | error = new Error(
|
7174 | format.replace(/%s/g, function() { return args[argIndex++]; })
|
7175 | );
|
7176 | error.name = 'Invariant Violation';
|
7177 | }
|
7178 |
|
7179 | error.framesToPop = 1;
|
7180 | throw error;
|
7181 | }
|
7182 | };
|
7183 |
|
7184 | module.exports = invariant;
|
7185 |
|
7186 | }).call(this,require(91))
|
7187 | },{"91":91}],82:[function(require,module,exports){
|
7188 | module.exports = Array.isArray || function (arr) {
|
7189 | return Object.prototype.toString.call(arr) == '[object Array]';
|
7190 | };
|
7191 |
|
7192 | },{}],83:[function(require,module,exports){
|
7193 | (function (global){
|
7194 |
|
7195 |
|
7196 |
|
7197 |
|
7198 |
|
7199 |
|
7200 |
|
7201 |
|
7202 |
|
7203 |
|
7204 | var INFINITY = 1 / 0;
|
7205 |
|
7206 |
|
7207 | var symbolTag = '[object Symbol]';
|
7208 |
|
7209 |
|
7210 | var objectTypes = {
|
7211 | 'function': true,
|
7212 | 'object': true
|
7213 | };
|
7214 |
|
7215 |
|
7216 | var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
|
7217 | ? exports
|
7218 | : undefined;
|
7219 |
|
7220 |
|
7221 | var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
|
7222 | ? module
|
7223 | : undefined;
|
7224 |
|
7225 |
|
7226 | var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
|
7227 |
|
7228 |
|
7229 | var freeSelf = checkGlobal(objectTypes[typeof self] && self);
|
7230 |
|
7231 |
|
7232 | var freeWindow = checkGlobal(objectTypes[typeof window] && window);
|
7233 |
|
7234 |
|
7235 | var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
|
7236 |
|
7237 |
|
7238 |
|
7239 |
|
7240 |
|
7241 |
|
7242 |
|
7243 | var root = freeGlobal ||
|
7244 | ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
|
7245 | freeSelf || thisGlobal || Function('return this')();
|
7246 |
|
7247 |
|
7248 |
|
7249 |
|
7250 |
|
7251 |
|
7252 |
|
7253 |
|
7254 | function checkGlobal(value) {
|
7255 | return (value && value.Object === Object) ? value : null;
|
7256 | }
|
7257 |
|
7258 |
|
7259 | var objectProto = Object.prototype;
|
7260 |
|
7261 |
|
7262 |
|
7263 |
|
7264 |
|
7265 | var objectToString = objectProto.toString;
|
7266 |
|
7267 |
|
7268 | var Symbol = root.Symbol;
|
7269 |
|
7270 |
|
7271 | var symbolProto = Symbol ? Symbol.prototype : undefined,
|
7272 | symbolToString = Symbol ? symbolProto.toString : undefined;
|
7273 |
|
7274 |
|
7275 |
|
7276 |
|
7277 |
|
7278 |
|
7279 |
|
7280 |
|
7281 |
|
7282 |
|
7283 |
|
7284 |
|
7285 |
|
7286 |
|
7287 |
|
7288 |
|
7289 |
|
7290 |
|
7291 |
|
7292 |
|
7293 |
|
7294 |
|
7295 |
|
7296 |
|
7297 | function isObjectLike(value) {
|
7298 | return !!value && typeof value == 'object';
|
7299 | }
|
7300 |
|
7301 |
|
7302 |
|
7303 |
|
7304 |
|
7305 |
|
7306 |
|
7307 |
|
7308 |
|
7309 |
|
7310 |
|
7311 |
|
7312 |
|
7313 |
|
7314 |
|
7315 |
|
7316 |
|
7317 | function isSymbol(value) {
|
7318 | return typeof value == 'symbol' ||
|
7319 | (isObjectLike(value) && objectToString.call(value) == symbolTag);
|
7320 | }
|
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 |
|
7326 |
|
7327 |
|
7328 |
|
7329 |
|
7330 |
|
7331 |
|
7332 |
|
7333 |
|
7334 |
|
7335 |
|
7336 |
|
7337 |
|
7338 |
|
7339 |
|
7340 |
|
7341 |
|
7342 | function toString(value) {
|
7343 |
|
7344 | if (typeof value == 'string') {
|
7345 | return value;
|
7346 | }
|
7347 | if (value == null) {
|
7348 | return '';
|
7349 | }
|
7350 | if (isSymbol(value)) {
|
7351 | return Symbol ? symbolToString.call(value) : '';
|
7352 | }
|
7353 | var result = (value + '');
|
7354 | return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
7355 | }
|
7356 |
|
7357 | module.exports = toString;
|
7358 |
|
7359 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
7360 | },{}],84:[function(require,module,exports){
|
7361 |
|
7362 |
|
7363 |
|
7364 |
|
7365 |
|
7366 |
|
7367 |
|
7368 |
|
7369 | var toString = require(83);
|
7370 |
|
7371 |
|
7372 | var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
|
7373 | reHasEscapedHtml = RegExp(reEscapedHtml.source);
|
7374 |
|
7375 |
|
7376 | var htmlUnescapes = {
|
7377 | '&': '&',
|
7378 | '<': '<',
|
7379 | '>': '>',
|
7380 | '"': '"',
|
7381 | ''': "'",
|
7382 | '`': '`'
|
7383 | };
|
7384 |
|
7385 |
|
7386 |
|
7387 |
|
7388 |
|
7389 |
|
7390 |
|
7391 |
|
7392 | function unescapeHtmlChar(chr) {
|
7393 | return htmlUnescapes[chr];
|
7394 | }
|
7395 |
|
7396 |
|
7397 |
|
7398 |
|
7399 |
|
7400 |
|
7401 |
|
7402 |
|
7403 |
|
7404 |
|
7405 |
|
7406 |
|
7407 |
|
7408 |
|
7409 |
|
7410 |
|
7411 |
|
7412 |
|
7413 |
|
7414 | function unescape(string) {
|
7415 | string = toString(string);
|
7416 | return (string && reHasEscapedHtml.test(string))
|
7417 | ? string.replace(reEscapedHtml, unescapeHtmlChar)
|
7418 | : string;
|
7419 | }
|
7420 |
|
7421 | module.exports = unescape;
|
7422 |
|
7423 | },{"83":83}],85:[function(require,module,exports){
|
7424 | module.exports = function (args, opts) {
|
7425 | if (!opts) opts = {};
|
7426 |
|
7427 | var flags = { bools : {}, strings : {}, unknownFn: null };
|
7428 |
|
7429 | if (typeof opts['unknown'] === 'function') {
|
7430 | flags.unknownFn = opts['unknown'];
|
7431 | }
|
7432 |
|
7433 | if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {
|
7434 | flags.allBools = true;
|
7435 | } else {
|
7436 | [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
|
7437 | flags.bools[key] = true;
|
7438 | });
|
7439 | }
|
7440 |
|
7441 | var aliases = {};
|
7442 | Object.keys(opts.alias || {}).forEach(function (key) {
|
7443 | aliases[key] = [].concat(opts.alias[key]);
|
7444 | aliases[key].forEach(function (x) {
|
7445 | aliases[x] = [key].concat(aliases[key].filter(function (y) {
|
7446 | return x !== y;
|
7447 | }));
|
7448 | });
|
7449 | });
|
7450 |
|
7451 | [].concat(opts.string).filter(Boolean).forEach(function (key) {
|
7452 | flags.strings[key] = true;
|
7453 | if (aliases[key]) {
|
7454 | flags.strings[aliases[key]] = true;
|
7455 | }
|
7456 | });
|
7457 |
|
7458 | var defaults = opts['default'] || {};
|
7459 |
|
7460 | var argv = { _ : [] };
|
7461 | Object.keys(flags.bools).forEach(function (key) {
|
7462 | setArg(key, defaults[key] === undefined ? false : defaults[key]);
|
7463 | });
|
7464 |
|
7465 | var notFlags = [];
|
7466 |
|
7467 | if (args.indexOf('--') !== -1) {
|
7468 | notFlags = args.slice(args.indexOf('--')+1);
|
7469 | args = args.slice(0, args.indexOf('--'));
|
7470 | }
|
7471 |
|
7472 | function argDefined(key, arg) {
|
7473 | return (flags.allBools && /^--[^=]+$/.test(arg)) ||
|
7474 | flags.strings[key] || flags.bools[key] || aliases[key];
|
7475 | }
|
7476 |
|
7477 | function setArg (key, val, arg) {
|
7478 | if (arg && flags.unknownFn && !argDefined(key, arg)) {
|
7479 | if (flags.unknownFn(arg) === false) return;
|
7480 | }
|
7481 |
|
7482 | var value = !flags.strings[key] && isNumber(val)
|
7483 | ? Number(val) : val
|
7484 | ;
|
7485 | setKey(argv, key.split('.'), value);
|
7486 |
|
7487 | (aliases[key] || []).forEach(function (x) {
|
7488 | setKey(argv, x.split('.'), value);
|
7489 | });
|
7490 | }
|
7491 |
|
7492 | function setKey (obj, keys, value) {
|
7493 | var o = obj;
|
7494 | keys.slice(0,-1).forEach(function (key) {
|
7495 | if (o[key] === undefined) o[key] = {};
|
7496 | o = o[key];
|
7497 | });
|
7498 |
|
7499 | var key = keys[keys.length - 1];
|
7500 | if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {
|
7501 | o[key] = value;
|
7502 | }
|
7503 | else if (Array.isArray(o[key])) {
|
7504 | o[key].push(value);
|
7505 | }
|
7506 | else {
|
7507 | o[key] = [ o[key], value ];
|
7508 | }
|
7509 | }
|
7510 |
|
7511 | function aliasIsBoolean(key) {
|
7512 | return aliases[key].some(function (x) {
|
7513 | return flags.bools[x];
|
7514 | });
|
7515 | }
|
7516 |
|
7517 | for (var i = 0; i < args.length; i++) {
|
7518 | var arg = args[i];
|
7519 |
|
7520 | if (/^--.+=/.test(arg)) {
|
7521 |
|
7522 |
|
7523 |
|
7524 | var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
7525 | var key = m[1];
|
7526 | var value = m[2];
|
7527 | if (flags.bools[key]) {
|
7528 | value = value !== 'false';
|
7529 | }
|
7530 | setArg(key, value, arg);
|
7531 | }
|
7532 | else if (/^--no-.+/.test(arg)) {
|
7533 | var key = arg.match(/^--no-(.+)/)[1];
|
7534 | setArg(key, false, arg);
|
7535 | }
|
7536 | else if (/^--.+/.test(arg)) {
|
7537 | var key = arg.match(/^--(.+)/)[1];
|
7538 | var next = args[i + 1];
|
7539 | if (next !== undefined && !/^-/.test(next)
|
7540 | && !flags.bools[key]
|
7541 | && !flags.allBools
|
7542 | && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
7543 | setArg(key, next, arg);
|
7544 | i++;
|
7545 | }
|
7546 | else if (/^(true|false)$/.test(next)) {
|
7547 | setArg(key, next === 'true', arg);
|
7548 | i++;
|
7549 | }
|
7550 | else {
|
7551 | setArg(key, flags.strings[key] ? '' : true, arg);
|
7552 | }
|
7553 | }
|
7554 | else if (/^-[^-]+/.test(arg)) {
|
7555 | var letters = arg.slice(1,-1).split('');
|
7556 |
|
7557 | var broken = false;
|
7558 | for (var j = 0; j < letters.length; j++) {
|
7559 | var next = arg.slice(j+2);
|
7560 |
|
7561 | if (next === '-') {
|
7562 | setArg(letters[j], next, arg)
|
7563 | continue;
|
7564 | }
|
7565 |
|
7566 | if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
|
7567 | setArg(letters[j], next.split('=')[1], arg);
|
7568 | broken = true;
|
7569 | break;
|
7570 | }
|
7571 |
|
7572 | if (/[A-Za-z]/.test(letters[j])
|
7573 | && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
7574 | setArg(letters[j], next, arg);
|
7575 | broken = true;
|
7576 | break;
|
7577 | }
|
7578 |
|
7579 | if (letters[j+1] && letters[j+1].match(/\W/)) {
|
7580 | setArg(letters[j], arg.slice(j+2), arg);
|
7581 | broken = true;
|
7582 | break;
|
7583 | }
|
7584 | else {
|
7585 | setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
|
7586 | }
|
7587 | }
|
7588 |
|
7589 | var key = arg.slice(-1)[0];
|
7590 | if (!broken && key !== '-') {
|
7591 | if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
|
7592 | && !flags.bools[key]
|
7593 | && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
7594 | setArg(key, args[i+1], arg);
|
7595 | i++;
|
7596 | }
|
7597 | else if (args[i+1] && /true|false/.test(args[i+1])) {
|
7598 | setArg(key, args[i+1] === 'true', arg);
|
7599 | i++;
|
7600 | }
|
7601 | else {
|
7602 | setArg(key, flags.strings[key] ? '' : true, arg);
|
7603 | }
|
7604 | }
|
7605 | }
|
7606 | else {
|
7607 | if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
|
7608 | argv._.push(
|
7609 | flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
|
7610 | );
|
7611 | }
|
7612 | if (opts.stopEarly) {
|
7613 | argv._.push.apply(argv._, args.slice(i + 1));
|
7614 | break;
|
7615 | }
|
7616 | }
|
7617 | }
|
7618 |
|
7619 | Object.keys(defaults).forEach(function (key) {
|
7620 | if (!hasKey(argv, key.split('.'))) {
|
7621 | setKey(argv, key.split('.'), defaults[key]);
|
7622 |
|
7623 | (aliases[key] || []).forEach(function (x) {
|
7624 | setKey(argv, x.split('.'), defaults[key]);
|
7625 | });
|
7626 | }
|
7627 | });
|
7628 |
|
7629 | if (opts['--']) {
|
7630 | argv['--'] = new Array();
|
7631 | notFlags.forEach(function(key) {
|
7632 | argv['--'].push(key);
|
7633 | });
|
7634 | }
|
7635 | else {
|
7636 | notFlags.forEach(function(key) {
|
7637 | argv._.push(key);
|
7638 | });
|
7639 | }
|
7640 |
|
7641 | return argv;
|
7642 | };
|
7643 |
|
7644 | function hasKey (obj, keys) {
|
7645 | var o = obj;
|
7646 | keys.slice(0,-1).forEach(function (key) {
|
7647 | o = (o[key] || {});
|
7648 | });
|
7649 |
|
7650 | var key = keys[keys.length - 1];
|
7651 | return key in o;
|
7652 | }
|
7653 |
|
7654 | function isNumber (x) {
|
7655 | if (typeof x === 'number') return true;
|
7656 | if (/^0x[0-9a-f]+$/i.test(x)) return true;
|
7657 | return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
7658 | }
|
7659 |
|
7660 |
|
7661 | },{}],86:[function(require,module,exports){
|
7662 |
|
7663 |
|
7664 |
|
7665 |
|
7666 | var s = 1000;
|
7667 | var m = s * 60;
|
7668 | var h = m * 60;
|
7669 | var d = h * 24;
|
7670 | var y = d * 365.25;
|
7671 |
|
7672 |
|
7673 |
|
7674 |
|
7675 |
|
7676 |
|
7677 |
|
7678 |
|
7679 |
|
7680 |
|
7681 |
|
7682 |
|
7683 |
|
7684 |
|
7685 | module.exports = function(val, options){
|
7686 | options = options || {};
|
7687 | if ('string' == typeof val) return parse(val);
|
7688 | return options.long
|
7689 | ? long(val)
|
7690 | : short(val);
|
7691 | };
|
7692 |
|
7693 |
|
7694 |
|
7695 |
|
7696 |
|
7697 |
|
7698 |
|
7699 |
|
7700 |
|
7701 | function parse(str) {
|
7702 | str = '' + str;
|
7703 | if (str.length > 10000) return;
|
7704 | var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
|
7705 | if (!match) return;
|
7706 | var n = parseFloat(match[1]);
|
7707 | var type = (match[2] || 'ms').toLowerCase();
|
7708 | switch (type) {
|
7709 | case 'years':
|
7710 | case 'year':
|
7711 | case 'yrs':
|
7712 | case 'yr':
|
7713 | case 'y':
|
7714 | return n * y;
|
7715 | case 'days':
|
7716 | case 'day':
|
7717 | case 'd':
|
7718 | return n * d;
|
7719 | case 'hours':
|
7720 | case 'hour':
|
7721 | case 'hrs':
|
7722 | case 'hr':
|
7723 | case 'h':
|
7724 | return n * h;
|
7725 | case 'minutes':
|
7726 | case 'minute':
|
7727 | case 'mins':
|
7728 | case 'min':
|
7729 | case 'm':
|
7730 | return n * m;
|
7731 | case 'seconds':
|
7732 | case 'second':
|
7733 | case 'secs':
|
7734 | case 'sec':
|
7735 | case 's':
|
7736 | return n * s;
|
7737 | case 'milliseconds':
|
7738 | case 'millisecond':
|
7739 | case 'msecs':
|
7740 | case 'msec':
|
7741 | case 'ms':
|
7742 | return n;
|
7743 | }
|
7744 | }
|
7745 |
|
7746 |
|
7747 |
|
7748 |
|
7749 |
|
7750 |
|
7751 |
|
7752 |
|
7753 |
|
7754 | function short(ms) {
|
7755 | if (ms >= d) return Math.round(ms / d) + 'd';
|
7756 | if (ms >= h) return Math.round(ms / h) + 'h';
|
7757 | if (ms >= m) return Math.round(ms / m) + 'm';
|
7758 | if (ms >= s) return Math.round(ms / s) + 's';
|
7759 | return ms + 'ms';
|
7760 | }
|
7761 |
|
7762 |
|
7763 |
|
7764 |
|
7765 |
|
7766 |
|
7767 |
|
7768 |
|
7769 |
|
7770 | function long(ms) {
|
7771 | return plural(ms, d, 'day')
|
7772 | || plural(ms, h, 'hour')
|
7773 | || plural(ms, m, 'minute')
|
7774 | || plural(ms, s, 'second')
|
7775 | || ms + ' ms';
|
7776 | }
|
7777 |
|
7778 |
|
7779 |
|
7780 |
|
7781 |
|
7782 | function plural(ms, n, name) {
|
7783 | if (ms < n) return;
|
7784 | if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
|
7785 | return Math.ceil(ms / n) + ' ' + name + 's';
|
7786 | }
|
7787 |
|
7788 | },{}],87:[function(require,module,exports){
|
7789 | (function (global){
|
7790 |
|
7791 |
|
7792 |
|
7793 |
|
7794 |
|
7795 |
|
7796 |
|
7797 | var rvalidchars = /^[\],:{}\s]*$/;
|
7798 | var rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
|
7799 | var rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
|
7800 | var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g;
|
7801 | var rtrimLeft = /^\s+/;
|
7802 | var rtrimRight = /\s+$/;
|
7803 |
|
7804 | module.exports = function parsejson(data) {
|
7805 | if ('string' != typeof data || !data) {
|
7806 | return null;
|
7807 | }
|
7808 |
|
7809 | data = data.replace(rtrimLeft, '').replace(rtrimRight, '');
|
7810 |
|
7811 |
|
7812 | if (global.JSON && JSON.parse) {
|
7813 | return JSON.parse(data);
|
7814 | }
|
7815 |
|
7816 | if (rvalidchars.test(data.replace(rvalidescape, '@')
|
7817 | .replace(rvalidtokens, ']')
|
7818 | .replace(rvalidbraces, ''))) {
|
7819 | return (new Function('return ' + data))();
|
7820 | }
|
7821 | };
|
7822 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
7823 | },{}],88:[function(require,module,exports){
|
7824 |
|
7825 |
|
7826 |
|
7827 |
|
7828 |
|
7829 |
|
7830 |
|
7831 |
|
7832 | exports.encode = function (obj) {
|
7833 | var str = '';
|
7834 |
|
7835 | for (var i in obj) {
|
7836 | if (obj.hasOwnProperty(i)) {
|
7837 | if (str.length) str += '&';
|
7838 | str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
|
7839 | }
|
7840 | }
|
7841 |
|
7842 | return str;
|
7843 | };
|
7844 |
|
7845 |
|
7846 |
|
7847 |
|
7848 |
|
7849 |
|
7850 |
|
7851 |
|
7852 | exports.decode = function(qs){
|
7853 | var qry = {};
|
7854 | var pairs = qs.split('&');
|
7855 | for (var i = 0, l = pairs.length; i < l; i++) {
|
7856 | var pair = pairs[i].split('=');
|
7857 | qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
7858 | }
|
7859 | return qry;
|
7860 | };
|
7861 |
|
7862 | },{}],89:[function(require,module,exports){
|
7863 |
|
7864 |
|
7865 |
|
7866 |
|
7867 |
|
7868 |
|
7869 |
|
7870 | var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
|
7871 |
|
7872 | var parts = [
|
7873 | 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
|
7874 | ];
|
7875 |
|
7876 | module.exports = function parseuri(str) {
|
7877 | var src = str,
|
7878 | b = str.indexOf('['),
|
7879 | e = str.indexOf(']');
|
7880 |
|
7881 | if (b != -1 && e != -1) {
|
7882 | str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
|
7883 | }
|
7884 |
|
7885 | var m = re.exec(str || ''),
|
7886 | uri = {},
|
7887 | i = 14;
|
7888 |
|
7889 | while (i--) {
|
7890 | uri[parts[i]] = m[i] || '';
|
7891 | }
|
7892 |
|
7893 | if (b != -1 && e != -1) {
|
7894 | uri.source = src;
|
7895 | uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
|
7896 | uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
|
7897 | uri.ipv6uri = true;
|
7898 | }
|
7899 |
|
7900 | return uri;
|
7901 | };
|
7902 |
|
7903 | },{}],90:[function(require,module,exports){
|
7904 | (function (process){
|
7905 |
|
7906 |
|
7907 |
|
7908 |
|
7909 |
|
7910 |
|
7911 |
|
7912 |
|
7913 |
|
7914 |
|
7915 |
|
7916 |
|
7917 |
|
7918 |
|
7919 |
|
7920 |
|
7921 |
|
7922 |
|
7923 |
|
7924 |
|
7925 |
|
7926 |
|
7927 |
|
7928 |
|
7929 |
|
7930 | function normalizeArray(parts, allowAboveRoot) {
|
7931 |
|
7932 | var up = 0;
|
7933 | for (var i = parts.length - 1; i >= 0; i--) {
|
7934 | var last = parts[i];
|
7935 | if (last === '.') {
|
7936 | parts.splice(i, 1);
|
7937 | } else if (last === '..') {
|
7938 | parts.splice(i, 1);
|
7939 | up++;
|
7940 | } else if (up) {
|
7941 | parts.splice(i, 1);
|
7942 | up--;
|
7943 | }
|
7944 | }
|
7945 |
|
7946 |
|
7947 | if (allowAboveRoot) {
|
7948 | for (; up--; up) {
|
7949 | parts.unshift('..');
|
7950 | }
|
7951 | }
|
7952 |
|
7953 | return parts;
|
7954 | }
|
7955 |
|
7956 |
|
7957 |
|
7958 | var splitPathRe =
|
7959 | /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
7960 | var splitPath = function(filename) {
|
7961 | return splitPathRe.exec(filename).slice(1);
|
7962 | };
|
7963 |
|
7964 |
|
7965 |
|
7966 | exports.resolve = function() {
|
7967 | var resolvedPath = '',
|
7968 | resolvedAbsolute = false;
|
7969 |
|
7970 | for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
7971 | var path = (i >= 0) ? arguments[i] : process.cwd();
|
7972 |
|
7973 |
|
7974 | if (typeof path !== 'string') {
|
7975 | throw new TypeError('Arguments to path.resolve must be strings');
|
7976 | } else if (!path) {
|
7977 | continue;
|
7978 | }
|
7979 |
|
7980 | resolvedPath = path + '/' + resolvedPath;
|
7981 | resolvedAbsolute = path.charAt(0) === '/';
|
7982 | }
|
7983 |
|
7984 |
|
7985 |
|
7986 |
|
7987 |
|
7988 | resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
|
7989 | return !!p;
|
7990 | }), !resolvedAbsolute).join('/');
|
7991 |
|
7992 | return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
7993 | };
|
7994 |
|
7995 |
|
7996 |
|
7997 | exports.normalize = function(path) {
|
7998 | var isAbsolute = exports.isAbsolute(path),
|
7999 | trailingSlash = substr(path, -1) === '/';
|
8000 |
|
8001 |
|
8002 | path = normalizeArray(filter(path.split('/'), function(p) {
|
8003 | return !!p;
|
8004 | }), !isAbsolute).join('/');
|
8005 |
|
8006 | if (!path && !isAbsolute) {
|
8007 | path = '.';
|
8008 | }
|
8009 | if (path && trailingSlash) {
|
8010 | path += '/';
|
8011 | }
|
8012 |
|
8013 | return (isAbsolute ? '/' : '') + path;
|
8014 | };
|
8015 |
|
8016 |
|
8017 | exports.isAbsolute = function(path) {
|
8018 | return path.charAt(0) === '/';
|
8019 | };
|
8020 |
|
8021 |
|
8022 | exports.join = function() {
|
8023 | var paths = Array.prototype.slice.call(arguments, 0);
|
8024 | return exports.normalize(filter(paths, function(p, index) {
|
8025 | if (typeof p !== 'string') {
|
8026 | throw new TypeError('Arguments to path.join must be strings');
|
8027 | }
|
8028 | return p;
|
8029 | }).join('/'));
|
8030 | };
|
8031 |
|
8032 |
|
8033 |
|
8034 |
|
8035 | exports.relative = function(from, to) {
|
8036 | from = exports.resolve(from).substr(1);
|
8037 | to = exports.resolve(to).substr(1);
|
8038 |
|
8039 | function trim(arr) {
|
8040 | var start = 0;
|
8041 | for (; start < arr.length; start++) {
|
8042 | if (arr[start] !== '') break;
|
8043 | }
|
8044 |
|
8045 | var end = arr.length - 1;
|
8046 | for (; end >= 0; end--) {
|
8047 | if (arr[end] !== '') break;
|
8048 | }
|
8049 |
|
8050 | if (start > end) return [];
|
8051 | return arr.slice(start, end - start + 1);
|
8052 | }
|
8053 |
|
8054 | var fromParts = trim(from.split('/'));
|
8055 | var toParts = trim(to.split('/'));
|
8056 |
|
8057 | var length = Math.min(fromParts.length, toParts.length);
|
8058 | var samePartsLength = length;
|
8059 | for (var i = 0; i < length; i++) {
|
8060 | if (fromParts[i] !== toParts[i]) {
|
8061 | samePartsLength = i;
|
8062 | break;
|
8063 | }
|
8064 | }
|
8065 |
|
8066 | var outputParts = [];
|
8067 | for (var i = samePartsLength; i < fromParts.length; i++) {
|
8068 | outputParts.push('..');
|
8069 | }
|
8070 |
|
8071 | outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
8072 |
|
8073 | return outputParts.join('/');
|
8074 | };
|
8075 |
|
8076 | exports.sep = '/';
|
8077 | exports.delimiter = ':';
|
8078 |
|
8079 | exports.dirname = function(path) {
|
8080 | var result = splitPath(path),
|
8081 | root = result[0],
|
8082 | dir = result[1];
|
8083 |
|
8084 | if (!root && !dir) {
|
8085 |
|
8086 | return '.';
|
8087 | }
|
8088 |
|
8089 | if (dir) {
|
8090 |
|
8091 | dir = dir.substr(0, dir.length - 1);
|
8092 | }
|
8093 |
|
8094 | return root + dir;
|
8095 | };
|
8096 |
|
8097 |
|
8098 | exports.basename = function(path, ext) {
|
8099 | var f = splitPath(path)[2];
|
8100 |
|
8101 | if (ext && f.substr(-1 * ext.length) === ext) {
|
8102 | f = f.substr(0, f.length - ext.length);
|
8103 | }
|
8104 | return f;
|
8105 | };
|
8106 |
|
8107 |
|
8108 | exports.extname = function(path) {
|
8109 | return splitPath(path)[3];
|
8110 | };
|
8111 |
|
8112 | function filter (xs, f) {
|
8113 | if (xs.filter) return xs.filter(f);
|
8114 | var res = [];
|
8115 | for (var i = 0; i < xs.length; i++) {
|
8116 | if (f(xs[i], i, xs)) res.push(xs[i]);
|
8117 | }
|
8118 | return res;
|
8119 | }
|
8120 |
|
8121 |
|
8122 | var substr = 'ab'.substr(-1) === 'b'
|
8123 | ? function (str, start, len) { return str.substr(start, len) }
|
8124 | : function (str, start, len) {
|
8125 | if (start < 0) start = str.length + start;
|
8126 | return str.substr(start, len);
|
8127 | }
|
8128 | ;
|
8129 |
|
8130 | }).call(this,require(91))
|
8131 | },{"91":91}],91:[function(require,module,exports){
|
8132 |
|
8133 |
|
8134 | var process = module.exports = {};
|
8135 | var queue = [];
|
8136 | var draining = false;
|
8137 | var currentQueue;
|
8138 | var queueIndex = -1;
|
8139 |
|
8140 | function cleanUpNextTick() {
|
8141 | draining = false;
|
8142 | if (currentQueue.length) {
|
8143 | queue = currentQueue.concat(queue);
|
8144 | } else {
|
8145 | queueIndex = -1;
|
8146 | }
|
8147 | if (queue.length) {
|
8148 | drainQueue();
|
8149 | }
|
8150 | }
|
8151 |
|
8152 | function drainQueue() {
|
8153 | if (draining) {
|
8154 | return;
|
8155 | }
|
8156 | var timeout = setTimeout(cleanUpNextTick);
|
8157 | draining = true;
|
8158 |
|
8159 | var len = queue.length;
|
8160 | while(len) {
|
8161 | currentQueue = queue;
|
8162 | queue = [];
|
8163 | while (++queueIndex < len) {
|
8164 | if (currentQueue) {
|
8165 | currentQueue[queueIndex].run();
|
8166 | }
|
8167 | }
|
8168 | queueIndex = -1;
|
8169 | len = queue.length;
|
8170 | }
|
8171 | currentQueue = null;
|
8172 | draining = false;
|
8173 | clearTimeout(timeout);
|
8174 | }
|
8175 |
|
8176 | process.nextTick = function (fun) {
|
8177 | var args = new Array(arguments.length - 1);
|
8178 | if (arguments.length > 1) {
|
8179 | for (var i = 1; i < arguments.length; i++) {
|
8180 | args[i - 1] = arguments[i];
|
8181 | }
|
8182 | }
|
8183 | queue.push(new Item(fun, args));
|
8184 | if (queue.length === 1 && !draining) {
|
8185 | setTimeout(drainQueue, 0);
|
8186 | }
|
8187 | };
|
8188 |
|
8189 |
|
8190 | function Item(fun, array) {
|
8191 | this.fun = fun;
|
8192 | this.array = array;
|
8193 | }
|
8194 | Item.prototype.run = function () {
|
8195 | this.fun.apply(null, this.array);
|
8196 | };
|
8197 | process.title = 'browser';
|
8198 | process.browser = true;
|
8199 | process.env = {};
|
8200 | process.argv = [];
|
8201 | process.version = '';
|
8202 | process.versions = {};
|
8203 |
|
8204 | function noop() {}
|
8205 |
|
8206 | process.on = noop;
|
8207 | process.addListener = noop;
|
8208 | process.once = noop;
|
8209 | process.off = noop;
|
8210 | process.removeListener = noop;
|
8211 | process.removeAllListeners = noop;
|
8212 | process.emit = noop;
|
8213 |
|
8214 | process.binding = function (name) {
|
8215 | throw new Error('process.binding is not supported');
|
8216 | };
|
8217 |
|
8218 | process.cwd = function () { return '/' };
|
8219 | process.chdir = function (dir) {
|
8220 | throw new Error('process.chdir is not supported');
|
8221 | };
|
8222 | process.umask = function() { return 0; };
|
8223 |
|
8224 | },{}],92:[function(require,module,exports){
|
8225 | (function (global){
|
8226 |
|
8227 | ;(function(root) {
|
8228 |
|
8229 |
|
8230 | var freeExports = typeof exports == 'object' && exports &&
|
8231 | !exports.nodeType && exports;
|
8232 | var freeModule = typeof module == 'object' && module &&
|
8233 | !module.nodeType && module;
|
8234 | var freeGlobal = typeof global == 'object' && global;
|
8235 | if (
|
8236 | freeGlobal.global === freeGlobal ||
|
8237 | freeGlobal.window === freeGlobal ||
|
8238 | freeGlobal.self === freeGlobal
|
8239 | ) {
|
8240 | root = freeGlobal;
|
8241 | }
|
8242 |
|
8243 | |
8244 |
|
8245 |
|
8246 |
|
8247 |
|
8248 | var punycode,
|
8249 |
|
8250 |
|
8251 | maxInt = 2147483647,
|
8252 |
|
8253 |
|
8254 | base = 36,
|
8255 | tMin = 1,
|
8256 | tMax = 26,
|
8257 | skew = 38,
|
8258 | damp = 700,
|
8259 | initialBias = 72,
|
8260 | initialN = 128,
|
8261 | delimiter = '-',
|
8262 |
|
8263 |
|
8264 | regexPunycode = /^xn--/,
|
8265 | regexNonASCII = /[^\x20-\x7E]/,
|
8266 | regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g,
|
8267 |
|
8268 |
|
8269 | errors = {
|
8270 | 'overflow': 'Overflow: input needs wider integers to process',
|
8271 | 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
8272 | 'invalid-input': 'Invalid input'
|
8273 | },
|
8274 |
|
8275 |
|
8276 | baseMinusTMin = base - tMin,
|
8277 | floor = Math.floor,
|
8278 | stringFromCharCode = String.fromCharCode,
|
8279 |
|
8280 |
|
8281 | key;
|
8282 |
|
8283 |
|
8284 |
|
8285 | |
8286 |
|
8287 |
|
8288 |
|
8289 |
|
8290 |
|
8291 | function error(type) {
|
8292 | throw new RangeError(errors[type]);
|
8293 | }
|
8294 |
|
8295 | |
8296 |
|
8297 |
|
8298 |
|
8299 |
|
8300 |
|
8301 |
|
8302 |
|
8303 | function map(array, fn) {
|
8304 | var length = array.length;
|
8305 | var result = [];
|
8306 | while (length--) {
|
8307 | result[length] = fn(array[length]);
|
8308 | }
|
8309 | return result;
|
8310 | }
|
8311 |
|
8312 | |
8313 |
|
8314 |
|
8315 |
|
8316 |
|
8317 |
|
8318 |
|
8319 |
|
8320 |
|
8321 |
|
8322 | function mapDomain(string, fn) {
|
8323 | var parts = string.split('@');
|
8324 | var result = '';
|
8325 | if (parts.length > 1) {
|
8326 |
|
8327 |
|
8328 | result = parts[0] + '@';
|
8329 | string = parts[1];
|
8330 | }
|
8331 |
|
8332 | string = string.replace(regexSeparators, '\x2E');
|
8333 | var labels = string.split('.');
|
8334 | var encoded = map(labels, fn).join('.');
|
8335 | return result + encoded;
|
8336 | }
|
8337 |
|
8338 | |
8339 |
|
8340 |
|
8341 |
|
8342 |
|
8343 |
|
8344 |
|
8345 |
|
8346 |
|
8347 |
|
8348 |
|
8349 |
|
8350 |
|
8351 | function ucs2decode(string) {
|
8352 | var output = [],
|
8353 | counter = 0,
|
8354 | length = string.length,
|
8355 | value,
|
8356 | extra;
|
8357 | while (counter < length) {
|
8358 | value = string.charCodeAt(counter++);
|
8359 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
8360 |
|
8361 | extra = string.charCodeAt(counter++);
|
8362 | if ((extra & 0xFC00) == 0xDC00) {
|
8363 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
8364 | } else {
|
8365 |
|
8366 |
|
8367 | output.push(value);
|
8368 | counter--;
|
8369 | }
|
8370 | } else {
|
8371 | output.push(value);
|
8372 | }
|
8373 | }
|
8374 | return output;
|
8375 | }
|
8376 |
|
8377 | |
8378 |
|
8379 |
|
8380 |
|
8381 |
|
8382 |
|
8383 |
|
8384 |
|
8385 | function ucs2encode(array) {
|
8386 | return map(array, function(value) {
|
8387 | var output = '';
|
8388 | if (value > 0xFFFF) {
|
8389 | value -= 0x10000;
|
8390 | output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
|
8391 | value = 0xDC00 | value & 0x3FF;
|
8392 | }
|
8393 | output += stringFromCharCode(value);
|
8394 | return output;
|
8395 | }).join('');
|
8396 | }
|
8397 |
|
8398 | |
8399 |
|
8400 |
|
8401 |
|
8402 |
|
8403 |
|
8404 |
|
8405 |
|
8406 |
|
8407 | function basicToDigit(codePoint) {
|
8408 | if (codePoint - 48 < 10) {
|
8409 | return codePoint - 22;
|
8410 | }
|
8411 | if (codePoint - 65 < 26) {
|
8412 | return codePoint - 65;
|
8413 | }
|
8414 | if (codePoint - 97 < 26) {
|
8415 | return codePoint - 97;
|
8416 | }
|
8417 | return base;
|
8418 | }
|
8419 |
|
8420 | |
8421 |
|
8422 |
|
8423 |
|
8424 |
|
8425 |
|
8426 |
|
8427 |
|
8428 |
|
8429 |
|
8430 |
|
8431 | function digitToBasic(digit, flag) {
|
8432 |
|
8433 |
|
8434 | return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
8435 | }
|
8436 |
|
8437 | |
8438 |
|
8439 |
|
8440 |
|
8441 |
|
8442 | function adapt(delta, numPoints, firstTime) {
|
8443 | var k = 0;
|
8444 | delta = firstTime ? floor(delta / damp) : delta >> 1;
|
8445 | delta += floor(delta / numPoints);
|
8446 | for (; delta > baseMinusTMin * tMax >> 1; k += base) {
|
8447 | delta = floor(delta / baseMinusTMin);
|
8448 | }
|
8449 | return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
8450 | }
|
8451 |
|
8452 | |
8453 |
|
8454 |
|
8455 |
|
8456 |
|
8457 |
|
8458 |
|
8459 | function decode(input) {
|
8460 |
|
8461 | var output = [],
|
8462 | inputLength = input.length,
|
8463 | out,
|
8464 | i = 0,
|
8465 | n = initialN,
|
8466 | bias = initialBias,
|
8467 | basic,
|
8468 | j,
|
8469 | index,
|
8470 | oldi,
|
8471 | w,
|
8472 | k,
|
8473 | digit,
|
8474 | t,
|
8475 |
|
8476 | baseMinusT;
|
8477 |
|
8478 |
|
8479 |
|
8480 |
|
8481 |
|
8482 | basic = input.lastIndexOf(delimiter);
|
8483 | if (basic < 0) {
|
8484 | basic = 0;
|
8485 | }
|
8486 |
|
8487 | for (j = 0; j < basic; ++j) {
|
8488 |
|
8489 | if (input.charCodeAt(j) >= 0x80) {
|
8490 | error('not-basic');
|
8491 | }
|
8492 | output.push(input.charCodeAt(j));
|
8493 | }
|
8494 |
|
8495 |
|
8496 |
|
8497 |
|
8498 | for (index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
8499 |
|
8500 |
|
8501 |
|
8502 |
|
8503 |
|
8504 |
|
8505 | for (oldi = i, w = 1, k = base; ; k += base) {
|
8506 |
|
8507 | if (index >= inputLength) {
|
8508 | error('invalid-input');
|
8509 | }
|
8510 |
|
8511 | digit = basicToDigit(input.charCodeAt(index++));
|
8512 |
|
8513 | if (digit >= base || digit > floor((maxInt - i) / w)) {
|
8514 | error('overflow');
|
8515 | }
|
8516 |
|
8517 | i += digit * w;
|
8518 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
8519 |
|
8520 | if (digit < t) {
|
8521 | break;
|
8522 | }
|
8523 |
|
8524 | baseMinusT = base - t;
|
8525 | if (w > floor(maxInt / baseMinusT)) {
|
8526 | error('overflow');
|
8527 | }
|
8528 |
|
8529 | w *= baseMinusT;
|
8530 |
|
8531 | }
|
8532 |
|
8533 | out = output.length + 1;
|
8534 | bias = adapt(i - oldi, out, oldi == 0);
|
8535 |
|
8536 |
|
8537 |
|
8538 | if (floor(i / out) > maxInt - n) {
|
8539 | error('overflow');
|
8540 | }
|
8541 |
|
8542 | n += floor(i / out);
|
8543 | i %= out;
|
8544 |
|
8545 |
|
8546 | output.splice(i++, 0, n);
|
8547 |
|
8548 | }
|
8549 |
|
8550 | return ucs2encode(output);
|
8551 | }
|
8552 |
|
8553 | |
8554 |
|
8555 |
|
8556 |
|
8557 |
|
8558 |
|
8559 |
|
8560 | function encode(input) {
|
8561 | var n,
|
8562 | delta,
|
8563 | handledCPCount,
|
8564 | basicLength,
|
8565 | bias,
|
8566 | j,
|
8567 | m,
|
8568 | q,
|
8569 | k,
|
8570 | t,
|
8571 | currentValue,
|
8572 | output = [],
|
8573 |
|
8574 | inputLength,
|
8575 |
|
8576 | handledCPCountPlusOne,
|
8577 | baseMinusT,
|
8578 | qMinusT;
|
8579 |
|
8580 |
|
8581 | input = ucs2decode(input);
|
8582 |
|
8583 |
|
8584 | inputLength = input.length;
|
8585 |
|
8586 |
|
8587 | n = initialN;
|
8588 | delta = 0;
|
8589 | bias = initialBias;
|
8590 |
|
8591 |
|
8592 | for (j = 0; j < inputLength; ++j) {
|
8593 | currentValue = input[j];
|
8594 | if (currentValue < 0x80) {
|
8595 | output.push(stringFromCharCode(currentValue));
|
8596 | }
|
8597 | }
|
8598 |
|
8599 | handledCPCount = basicLength = output.length;
|
8600 |
|
8601 |
|
8602 |
|
8603 |
|
8604 |
|
8605 | if (basicLength) {
|
8606 | output.push(delimiter);
|
8607 | }
|
8608 |
|
8609 |
|
8610 | while (handledCPCount < inputLength) {
|
8611 |
|
8612 |
|
8613 |
|
8614 | for (m = maxInt, j = 0; j < inputLength; ++j) {
|
8615 | currentValue = input[j];
|
8616 | if (currentValue >= n && currentValue < m) {
|
8617 | m = currentValue;
|
8618 | }
|
8619 | }
|
8620 |
|
8621 |
|
8622 |
|
8623 | handledCPCountPlusOne = handledCPCount + 1;
|
8624 | if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
8625 | error('overflow');
|
8626 | }
|
8627 |
|
8628 | delta += (m - n) * handledCPCountPlusOne;
|
8629 | n = m;
|
8630 |
|
8631 | for (j = 0; j < inputLength; ++j) {
|
8632 | currentValue = input[j];
|
8633 |
|
8634 | if (currentValue < n && ++delta > maxInt) {
|
8635 | error('overflow');
|
8636 | }
|
8637 |
|
8638 | if (currentValue == n) {
|
8639 |
|
8640 | for (q = delta, k = base; ; k += base) {
|
8641 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
8642 | if (q < t) {
|
8643 | break;
|
8644 | }
|
8645 | qMinusT = q - t;
|
8646 | baseMinusT = base - t;
|
8647 | output.push(
|
8648 | stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
|
8649 | );
|
8650 | q = floor(qMinusT / baseMinusT);
|
8651 | }
|
8652 |
|
8653 | output.push(stringFromCharCode(digitToBasic(q, 0)));
|
8654 | bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
8655 | delta = 0;
|
8656 | ++handledCPCount;
|
8657 | }
|
8658 | }
|
8659 |
|
8660 | ++delta;
|
8661 | ++n;
|
8662 |
|
8663 | }
|
8664 | return output.join('');
|
8665 | }
|
8666 |
|
8667 | |
8668 |
|
8669 |
|
8670 |
|
8671 |
|
8672 |
|
8673 |
|
8674 |
|
8675 |
|
8676 |
|
8677 |
|
8678 | function toUnicode(input) {
|
8679 | return mapDomain(input, function(string) {
|
8680 | return regexPunycode.test(string)
|
8681 | ? decode(string.slice(4).toLowerCase())
|
8682 | : string;
|
8683 | });
|
8684 | }
|
8685 |
|
8686 | |
8687 |
|
8688 |
|
8689 |
|
8690 |
|
8691 |
|
8692 |
|
8693 |
|
8694 |
|
8695 |
|
8696 |
|
8697 | function toASCII(input) {
|
8698 | return mapDomain(input, function(string) {
|
8699 | return regexNonASCII.test(string)
|
8700 | ? 'xn--' + encode(string)
|
8701 | : string;
|
8702 | });
|
8703 | }
|
8704 |
|
8705 |
|
8706 |
|
8707 |
|
8708 | punycode = {
|
8709 | |
8710 |
|
8711 |
|
8712 |
|
8713 |
|
8714 | 'version': '1.3.2',
|
8715 | |
8716 |
|
8717 |
|
8718 |
|
8719 |
|
8720 |
|
8721 |
|
8722 | 'ucs2': {
|
8723 | 'decode': ucs2decode,
|
8724 | 'encode': ucs2encode
|
8725 | },
|
8726 | 'decode': decode,
|
8727 | 'encode': encode,
|
8728 | 'toASCII': toASCII,
|
8729 | 'toUnicode': toUnicode
|
8730 | };
|
8731 |
|
8732 |
|
8733 |
|
8734 |
|
8735 | if (
|
8736 | typeof define == 'function' &&
|
8737 | typeof define.amd == 'object' &&
|
8738 | define.amd
|
8739 | ) {
|
8740 | define('punycode', function() {
|
8741 | return punycode;
|
8742 | });
|
8743 | } else if (freeExports && freeModule) {
|
8744 | if (module.exports == freeExports) {
|
8745 |
|
8746 | freeModule.exports = punycode;
|
8747 | } else {
|
8748 |
|
8749 | for (key in punycode) {
|
8750 | punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
|
8751 | }
|
8752 | }
|
8753 | } else {
|
8754 |
|
8755 | root.punycode = punycode;
|
8756 | }
|
8757 |
|
8758 | }(this));
|
8759 |
|
8760 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
8761 | },{}],93:[function(require,module,exports){
|
8762 | 'use strict';
|
8763 | var strictUriEncode = require(331);
|
8764 |
|
8765 | exports.extract = function (str) {
|
8766 | return str.split('?')[1] || '';
|
8767 | };
|
8768 |
|
8769 | exports.parse = function (str) {
|
8770 | if (typeof str !== 'string') {
|
8771 | return {};
|
8772 | }
|
8773 |
|
8774 | str = str.trim().replace(/^(\?|#|&)/, '');
|
8775 |
|
8776 | if (!str) {
|
8777 | return {};
|
8778 | }
|
8779 |
|
8780 | return str.split('&').reduce(function (ret, param) {
|
8781 | var parts = param.replace(/\+/g, ' ').split('=');
|
8782 |
|
8783 |
|
8784 | var key = parts.shift();
|
8785 | var val = parts.length > 0 ? parts.join('=') : undefined;
|
8786 |
|
8787 | key = decodeURIComponent(key);
|
8788 |
|
8789 |
|
8790 |
|
8791 | val = val === undefined ? null : decodeURIComponent(val);
|
8792 |
|
8793 | if (!ret.hasOwnProperty(key)) {
|
8794 | ret[key] = val;
|
8795 | } else if (Array.isArray(ret[key])) {
|
8796 | ret[key].push(val);
|
8797 | } else {
|
8798 | ret[key] = [ret[key], val];
|
8799 | }
|
8800 |
|
8801 | return ret;
|
8802 | }, {});
|
8803 | };
|
8804 |
|
8805 | exports.stringify = function (obj) {
|
8806 | return obj ? Object.keys(obj).sort().map(function (key) {
|
8807 | var val = obj[key];
|
8808 |
|
8809 | if (val === undefined) {
|
8810 | return '';
|
8811 | }
|
8812 |
|
8813 | if (val === null) {
|
8814 | return key;
|
8815 | }
|
8816 |
|
8817 | if (Array.isArray(val)) {
|
8818 | return val.sort().map(function (val2) {
|
8819 | return strictUriEncode(key) + '=' + strictUriEncode(val2);
|
8820 | }).join('&');
|
8821 | }
|
8822 |
|
8823 | return strictUriEncode(key) + '=' + strictUriEncode(val);
|
8824 | }).filter(function (x) {
|
8825 | return x.length > 0;
|
8826 | }).join('&') : '';
|
8827 | };
|
8828 |
|
8829 | },{"331":331}],94:[function(require,module,exports){
|
8830 |
|
8831 |
|
8832 |
|
8833 |
|
8834 |
|
8835 |
|
8836 |
|
8837 |
|
8838 |
|
8839 |
|
8840 |
|
8841 |
|
8842 |
|
8843 |
|
8844 |
|
8845 |
|
8846 |
|
8847 |
|
8848 |
|
8849 |
|
8850 |
|
8851 | 'use strict';
|
8852 |
|
8853 |
|
8854 |
|
8855 |
|
8856 | function hasOwnProperty(obj, prop) {
|
8857 | return Object.prototype.hasOwnProperty.call(obj, prop);
|
8858 | }
|
8859 |
|
8860 | module.exports = function(qs, sep, eq, options) {
|
8861 | sep = sep || '&';
|
8862 | eq = eq || '=';
|
8863 | var obj = {};
|
8864 |
|
8865 | if (typeof qs !== 'string' || qs.length === 0) {
|
8866 | return obj;
|
8867 | }
|
8868 |
|
8869 | var regexp = /\+/g;
|
8870 | qs = qs.split(sep);
|
8871 |
|
8872 | var maxKeys = 1000;
|
8873 | if (options && typeof options.maxKeys === 'number') {
|
8874 | maxKeys = options.maxKeys;
|
8875 | }
|
8876 |
|
8877 | var len = qs.length;
|
8878 |
|
8879 | if (maxKeys > 0 && len > maxKeys) {
|
8880 | len = maxKeys;
|
8881 | }
|
8882 |
|
8883 | for (var i = 0; i < len; ++i) {
|
8884 | var x = qs[i].replace(regexp, '%20'),
|
8885 | idx = x.indexOf(eq),
|
8886 | kstr, vstr, k, v;
|
8887 |
|
8888 | if (idx >= 0) {
|
8889 | kstr = x.substr(0, idx);
|
8890 | vstr = x.substr(idx + 1);
|
8891 | } else {
|
8892 | kstr = x;
|
8893 | vstr = '';
|
8894 | }
|
8895 |
|
8896 | k = decodeURIComponent(kstr);
|
8897 | v = decodeURIComponent(vstr);
|
8898 |
|
8899 | if (!hasOwnProperty(obj, k)) {
|
8900 | obj[k] = v;
|
8901 | } else if (isArray(obj[k])) {
|
8902 | obj[k].push(v);
|
8903 | } else {
|
8904 | obj[k] = [obj[k], v];
|
8905 | }
|
8906 | }
|
8907 |
|
8908 | return obj;
|
8909 | };
|
8910 |
|
8911 | var isArray = Array.isArray || function (xs) {
|
8912 | return Object.prototype.toString.call(xs) === '[object Array]';
|
8913 | };
|
8914 |
|
8915 | },{}],95:[function(require,module,exports){
|
8916 |
|
8917 |
|
8918 |
|
8919 |
|
8920 |
|
8921 |
|
8922 |
|
8923 |
|
8924 |
|
8925 |
|
8926 |
|
8927 |
|
8928 |
|
8929 |
|
8930 |
|
8931 |
|
8932 |
|
8933 |
|
8934 |
|
8935 |
|
8936 |
|
8937 | 'use strict';
|
8938 |
|
8939 | var stringifyPrimitive = function(v) {
|
8940 | switch (typeof v) {
|
8941 | case 'string':
|
8942 | return v;
|
8943 |
|
8944 | case 'boolean':
|
8945 | return v ? 'true' : 'false';
|
8946 |
|
8947 | case 'number':
|
8948 | return isFinite(v) ? v : '';
|
8949 |
|
8950 | default:
|
8951 | return '';
|
8952 | }
|
8953 | };
|
8954 |
|
8955 | module.exports = function(obj, sep, eq, name) {
|
8956 | sep = sep || '&';
|
8957 | eq = eq || '=';
|
8958 | if (obj === null) {
|
8959 | obj = undefined;
|
8960 | }
|
8961 |
|
8962 | if (typeof obj === 'object') {
|
8963 | return map(objectKeys(obj), function(k) {
|
8964 | var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
|
8965 | if (isArray(obj[k])) {
|
8966 | return map(obj[k], function(v) {
|
8967 | return ks + encodeURIComponent(stringifyPrimitive(v));
|
8968 | }).join(sep);
|
8969 | } else {
|
8970 | return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
|
8971 | }
|
8972 | }).join(sep);
|
8973 |
|
8974 | }
|
8975 |
|
8976 | if (!name) return '';
|
8977 | return encodeURIComponent(stringifyPrimitive(name)) + eq +
|
8978 | encodeURIComponent(stringifyPrimitive(obj));
|
8979 | };
|
8980 |
|
8981 | var isArray = Array.isArray || function (xs) {
|
8982 | return Object.prototype.toString.call(xs) === '[object Array]';
|
8983 | };
|
8984 |
|
8985 | function map (xs, f) {
|
8986 | if (xs.map) return xs.map(f);
|
8987 | var res = [];
|
8988 | for (var i = 0; i < xs.length; i++) {
|
8989 | res.push(f(xs[i], i));
|
8990 | }
|
8991 | return res;
|
8992 | }
|
8993 |
|
8994 | var objectKeys = Object.keys || function (obj) {
|
8995 | var res = [];
|
8996 | for (var key in obj) {
|
8997 | if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
|
8998 | }
|
8999 | return res;
|
9000 | };
|
9001 |
|
9002 | },{}],96:[function(require,module,exports){
|
9003 | 'use strict';
|
9004 |
|
9005 | exports.decode = exports.parse = require(94);
|
9006 | exports.encode = exports.stringify = require(95);
|
9007 |
|
9008 | },{"94":94,"95":95}],97:[function(require,module,exports){
|
9009 | 'use strict';
|
9010 |
|
9011 | module.exports = require(195);
|
9012 |
|
9013 | },{"195":195}],98:[function(require,module,exports){
|
9014 | (function (process){
|
9015 | 'use strict';
|
9016 |
|
9017 | exports.__esModule = true;
|
9018 | exports["default"] = undefined;
|
9019 |
|
9020 | var _react = require(297);
|
9021 |
|
9022 | var _storeShape = require(102);
|
9023 |
|
9024 | var _storeShape2 = _interopRequireDefault(_storeShape);
|
9025 |
|
9026 | var _warning = require(103);
|
9027 |
|
9028 | var _warning2 = _interopRequireDefault(_warning);
|
9029 |
|
9030 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
9031 |
|
9032 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
9033 |
|
9034 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
9035 |
|
9036 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
9037 |
|
9038 | var didWarnAboutReceivingStore = false;
|
9039 | function warnAboutReceivingStore() {
|
9040 | if (didWarnAboutReceivingStore) {
|
9041 | return;
|
9042 | }
|
9043 | didWarnAboutReceivingStore = true;
|
9044 |
|
9045 | (0, _warning2["default"])('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');
|
9046 | }
|
9047 |
|
9048 | var Provider = function (_Component) {
|
9049 | _inherits(Provider, _Component);
|
9050 |
|
9051 | Provider.prototype.getChildContext = function getChildContext() {
|
9052 | return { store: this.store };
|
9053 | };
|
9054 |
|
9055 | function Provider(props, context) {
|
9056 | _classCallCheck(this, Provider);
|
9057 |
|
9058 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
9059 |
|
9060 | _this.store = props.store;
|
9061 | return _this;
|
9062 | }
|
9063 |
|
9064 | Provider.prototype.render = function render() {
|
9065 | var children = this.props.children;
|
9066 |
|
9067 | return _react.Children.only(children);
|
9068 | };
|
9069 |
|
9070 | return Provider;
|
9071 | }(_react.Component);
|
9072 |
|
9073 | exports["default"] = Provider;
|
9074 |
|
9075 | if (process.env.NODE_ENV !== 'production') {
|
9076 | Provider.prototype.componentWillReceiveProps = function (nextProps) {
|
9077 | var store = this.store;
|
9078 | var nextStore = nextProps.store;
|
9079 |
|
9080 | if (store !== nextStore) {
|
9081 | warnAboutReceivingStore();
|
9082 | }
|
9083 | };
|
9084 | }
|
9085 |
|
9086 | Provider.propTypes = {
|
9087 | store: _storeShape2["default"].isRequired,
|
9088 | children: _react.PropTypes.element.isRequired
|
9089 | };
|
9090 | Provider.childContextTypes = {
|
9091 | store: _storeShape2["default"].isRequired
|
9092 | };
|
9093 | }).call(this,require(91))
|
9094 | },{"102":102,"103":103,"297":297,"91":91}],99:[function(require,module,exports){
|
9095 | (function (process){
|
9096 | 'use strict';
|
9097 |
|
9098 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
9099 |
|
9100 | exports.__esModule = true;
|
9101 | exports["default"] = connect;
|
9102 |
|
9103 | var _react = require(297);
|
9104 |
|
9105 | var _storeShape = require(102);
|
9106 |
|
9107 | var _storeShape2 = _interopRequireDefault(_storeShape);
|
9108 |
|
9109 | var _shallowEqual = require(101);
|
9110 |
|
9111 | var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
|
9112 |
|
9113 | var _wrapActionCreators = require(104);
|
9114 |
|
9115 | var _wrapActionCreators2 = _interopRequireDefault(_wrapActionCreators);
|
9116 |
|
9117 | var _warning = require(103);
|
9118 |
|
9119 | var _warning2 = _interopRequireDefault(_warning);
|
9120 |
|
9121 | var _isPlainObject = require(108);
|
9122 |
|
9123 | var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
|
9124 |
|
9125 | var _hoistNonReactStatics = require(79);
|
9126 |
|
9127 | var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
|
9128 |
|
9129 | var _invariant = require(81);
|
9130 |
|
9131 | var _invariant2 = _interopRequireDefault(_invariant);
|
9132 |
|
9133 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
9134 |
|
9135 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
9136 |
|
9137 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
9138 |
|
9139 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
9140 |
|
9141 | var defaultMapStateToProps = function defaultMapStateToProps(state) {
|
9142 | return {};
|
9143 | };
|
9144 | var defaultMapDispatchToProps = function defaultMapDispatchToProps(dispatch) {
|
9145 | return { dispatch: dispatch };
|
9146 | };
|
9147 | var defaultMergeProps = function defaultMergeProps(stateProps, dispatchProps, parentProps) {
|
9148 | return _extends({}, parentProps, stateProps, dispatchProps);
|
9149 | };
|
9150 |
|
9151 | function getDisplayName(WrappedComponent) {
|
9152 | return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
9153 | }
|
9154 |
|
9155 | var errorObject = { value: null };
|
9156 | function tryCatch(fn, ctx) {
|
9157 | try {
|
9158 | return fn.apply(ctx);
|
9159 | } catch (e) {
|
9160 | errorObject.value = e;
|
9161 | return errorObject;
|
9162 | }
|
9163 | }
|
9164 |
|
9165 |
|
9166 | var nextVersion = 0;
|
9167 |
|
9168 | function connect(mapStateToProps, mapDispatchToProps, mergeProps) {
|
9169 | var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
|
9170 |
|
9171 | var shouldSubscribe = Boolean(mapStateToProps);
|
9172 | var mapState = mapStateToProps || defaultMapStateToProps;
|
9173 |
|
9174 | var mapDispatch = undefined;
|
9175 | if (typeof mapDispatchToProps === 'function') {
|
9176 | mapDispatch = mapDispatchToProps;
|
9177 | } else if (!mapDispatchToProps) {
|
9178 | mapDispatch = defaultMapDispatchToProps;
|
9179 | } else {
|
9180 | mapDispatch = (0, _wrapActionCreators2["default"])(mapDispatchToProps);
|
9181 | }
|
9182 |
|
9183 | var finalMergeProps = mergeProps || defaultMergeProps;
|
9184 | var _options$pure = options.pure;
|
9185 | var pure = _options$pure === undefined ? true : _options$pure;
|
9186 | var _options$withRef = options.withRef;
|
9187 | var withRef = _options$withRef === undefined ? false : _options$withRef;
|
9188 |
|
9189 | var checkMergedEquals = pure && finalMergeProps !== defaultMergeProps;
|
9190 |
|
9191 |
|
9192 | var version = nextVersion++;
|
9193 |
|
9194 | return function wrapWithConnect(WrappedComponent) {
|
9195 | var connectDisplayName = 'Connect(' + getDisplayName(WrappedComponent) + ')';
|
9196 |
|
9197 | function checkStateShape(props, methodName) {
|
9198 | if (!(0, _isPlainObject2["default"])(props)) {
|
9199 | (0, _warning2["default"])(methodName + '() in ' + connectDisplayName + ' must return a plain object. ' + ('Instead received ' + props + '.'));
|
9200 | }
|
9201 | }
|
9202 |
|
9203 | function computeMergedProps(stateProps, dispatchProps, parentProps) {
|
9204 | var mergedProps = finalMergeProps(stateProps, dispatchProps, parentProps);
|
9205 | if (process.env.NODE_ENV !== 'production') {
|
9206 | checkStateShape(mergedProps, 'mergeProps');
|
9207 | }
|
9208 | return mergedProps;
|
9209 | }
|
9210 |
|
9211 | var Connect = function (_Component) {
|
9212 | _inherits(Connect, _Component);
|
9213 |
|
9214 | Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {
|
9215 | return !pure || this.haveOwnPropsChanged || this.hasStoreStateChanged;
|
9216 | };
|
9217 |
|
9218 | function Connect(props, context) {
|
9219 | _classCallCheck(this, Connect);
|
9220 |
|
9221 | var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
|
9222 |
|
9223 | _this.version = version;
|
9224 | _this.store = props.store || context.store;
|
9225 |
|
9226 | (0, _invariant2["default"])(_this.store, 'Could not find "store" in either the context or ' + ('props of "' + connectDisplayName + '". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass "store" as a prop to "' + connectDisplayName + '".'));
|
9227 |
|
9228 | var storeState = _this.store.getState();
|
9229 | _this.state = { storeState: storeState };
|
9230 | _this.clearCache();
|
9231 | return _this;
|
9232 | }
|
9233 |
|
9234 | Connect.prototype.computeStateProps = function computeStateProps(store, props) {
|
9235 | if (!this.finalMapStateToProps) {
|
9236 | return this.configureFinalMapState(store, props);
|
9237 | }
|
9238 |
|
9239 | var state = store.getState();
|
9240 | var stateProps = this.doStatePropsDependOnOwnProps ? this.finalMapStateToProps(state, props) : this.finalMapStateToProps(state);
|
9241 |
|
9242 | if (process.env.NODE_ENV !== 'production') {
|
9243 | checkStateShape(stateProps, 'mapStateToProps');
|
9244 | }
|
9245 | return stateProps;
|
9246 | };
|
9247 |
|
9248 | Connect.prototype.configureFinalMapState = function configureFinalMapState(store, props) {
|
9249 | var mappedState = mapState(store.getState(), props);
|
9250 | var isFactory = typeof mappedState === 'function';
|
9251 |
|
9252 | this.finalMapStateToProps = isFactory ? mappedState : mapState;
|
9253 | this.doStatePropsDependOnOwnProps = this.finalMapStateToProps.length !== 1;
|
9254 |
|
9255 | if (isFactory) {
|
9256 | return this.computeStateProps(store, props);
|
9257 | }
|
9258 |
|
9259 | if (process.env.NODE_ENV !== 'production') {
|
9260 | checkStateShape(mappedState, 'mapStateToProps');
|
9261 | }
|
9262 | return mappedState;
|
9263 | };
|
9264 |
|
9265 | Connect.prototype.computeDispatchProps = function computeDispatchProps(store, props) {
|
9266 | if (!this.finalMapDispatchToProps) {
|
9267 | return this.configureFinalMapDispatch(store, props);
|
9268 | }
|
9269 |
|
9270 | var dispatch = store.dispatch;
|
9271 |
|
9272 | var dispatchProps = this.doDispatchPropsDependOnOwnProps ? this.finalMapDispatchToProps(dispatch, props) : this.finalMapDispatchToProps(dispatch);
|
9273 |
|
9274 | if (process.env.NODE_ENV !== 'production') {
|
9275 | checkStateShape(dispatchProps, 'mapDispatchToProps');
|
9276 | }
|
9277 | return dispatchProps;
|
9278 | };
|
9279 |
|
9280 | Connect.prototype.configureFinalMapDispatch = function configureFinalMapDispatch(store, props) {
|
9281 | var mappedDispatch = mapDispatch(store.dispatch, props);
|
9282 | var isFactory = typeof mappedDispatch === 'function';
|
9283 |
|
9284 | this.finalMapDispatchToProps = isFactory ? mappedDispatch : mapDispatch;
|
9285 | this.doDispatchPropsDependOnOwnProps = this.finalMapDispatchToProps.length !== 1;
|
9286 |
|
9287 | if (isFactory) {
|
9288 | return this.computeDispatchProps(store, props);
|
9289 | }
|
9290 |
|
9291 | if (process.env.NODE_ENV !== 'production') {
|
9292 | checkStateShape(mappedDispatch, 'mapDispatchToProps');
|
9293 | }
|
9294 | return mappedDispatch;
|
9295 | };
|
9296 |
|
9297 | Connect.prototype.updateStatePropsIfNeeded = function updateStatePropsIfNeeded() {
|
9298 | var nextStateProps = this.computeStateProps(this.store, this.props);
|
9299 | if (this.stateProps && (0, _shallowEqual2["default"])(nextStateProps, this.stateProps)) {
|
9300 | return false;
|
9301 | }
|
9302 |
|
9303 | this.stateProps = nextStateProps;
|
9304 | return true;
|
9305 | };
|
9306 |
|
9307 | Connect.prototype.updateDispatchPropsIfNeeded = function updateDispatchPropsIfNeeded() {
|
9308 | var nextDispatchProps = this.computeDispatchProps(this.store, this.props);
|
9309 | if (this.dispatchProps && (0, _shallowEqual2["default"])(nextDispatchProps, this.dispatchProps)) {
|
9310 | return false;
|
9311 | }
|
9312 |
|
9313 | this.dispatchProps = nextDispatchProps;
|
9314 | return true;
|
9315 | };
|
9316 |
|
9317 | Connect.prototype.updateMergedPropsIfNeeded = function updateMergedPropsIfNeeded() {
|
9318 | var nextMergedProps = computeMergedProps(this.stateProps, this.dispatchProps, this.props);
|
9319 | if (this.mergedProps && checkMergedEquals && (0, _shallowEqual2["default"])(nextMergedProps, this.mergedProps)) {
|
9320 | return false;
|
9321 | }
|
9322 |
|
9323 | this.mergedProps = nextMergedProps;
|
9324 | return true;
|
9325 | };
|
9326 |
|
9327 | Connect.prototype.isSubscribed = function isSubscribed() {
|
9328 | return typeof this.unsubscribe === 'function';
|
9329 | };
|
9330 |
|
9331 | Connect.prototype.trySubscribe = function trySubscribe() {
|
9332 | if (shouldSubscribe && !this.unsubscribe) {
|
9333 | this.unsubscribe = this.store.subscribe(this.handleChange.bind(this));
|
9334 | this.handleChange();
|
9335 | }
|
9336 | };
|
9337 |
|
9338 | Connect.prototype.tryUnsubscribe = function tryUnsubscribe() {
|
9339 | if (this.unsubscribe) {
|
9340 | this.unsubscribe();
|
9341 | this.unsubscribe = null;
|
9342 | }
|
9343 | };
|
9344 |
|
9345 | Connect.prototype.componentDidMount = function componentDidMount() {
|
9346 | this.trySubscribe();
|
9347 | };
|
9348 |
|
9349 | Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
9350 | if (!pure || !(0, _shallowEqual2["default"])(nextProps, this.props)) {
|
9351 | this.haveOwnPropsChanged = true;
|
9352 | }
|
9353 | };
|
9354 |
|
9355 | Connect.prototype.componentWillUnmount = function componentWillUnmount() {
|
9356 | this.tryUnsubscribe();
|
9357 | this.clearCache();
|
9358 | };
|
9359 |
|
9360 | Connect.prototype.clearCache = function clearCache() {
|
9361 | this.dispatchProps = null;
|
9362 | this.stateProps = null;
|
9363 | this.mergedProps = null;
|
9364 | this.haveOwnPropsChanged = true;
|
9365 | this.hasStoreStateChanged = true;
|
9366 | this.haveStatePropsBeenPrecalculated = false;
|
9367 | this.statePropsPrecalculationError = null;
|
9368 | this.renderedElement = null;
|
9369 | this.finalMapDispatchToProps = null;
|
9370 | this.finalMapStateToProps = null;
|
9371 | };
|
9372 |
|
9373 | Connect.prototype.handleChange = function handleChange() {
|
9374 | if (!this.unsubscribe) {
|
9375 | return;
|
9376 | }
|
9377 |
|
9378 | var storeState = this.store.getState();
|
9379 | var prevStoreState = this.state.storeState;
|
9380 | if (pure && prevStoreState === storeState) {
|
9381 | return;
|
9382 | }
|
9383 |
|
9384 | if (pure && !this.doStatePropsDependOnOwnProps) {
|
9385 | var haveStatePropsChanged = tryCatch(this.updateStatePropsIfNeeded, this);
|
9386 | if (!haveStatePropsChanged) {
|
9387 | return;
|
9388 | }
|
9389 | if (haveStatePropsChanged === errorObject) {
|
9390 | this.statePropsPrecalculationError = errorObject.value;
|
9391 | }
|
9392 | this.haveStatePropsBeenPrecalculated = true;
|
9393 | }
|
9394 |
|
9395 | this.hasStoreStateChanged = true;
|
9396 | this.setState({ storeState: storeState });
|
9397 | };
|
9398 |
|
9399 | Connect.prototype.getWrappedInstance = function getWrappedInstance() {
|
9400 | (0, _invariant2["default"])(withRef, 'To access the wrapped instance, you need to specify ' + '{ withRef: true } as the fourth argument of the connect() call.');
|
9401 |
|
9402 | return this.refs.wrappedInstance;
|
9403 | };
|
9404 |
|
9405 | Connect.prototype.render = function render() {
|
9406 | var haveOwnPropsChanged = this.haveOwnPropsChanged;
|
9407 | var hasStoreStateChanged = this.hasStoreStateChanged;
|
9408 | var haveStatePropsBeenPrecalculated = this.haveStatePropsBeenPrecalculated;
|
9409 | var statePropsPrecalculationError = this.statePropsPrecalculationError;
|
9410 | var renderedElement = this.renderedElement;
|
9411 |
|
9412 | this.haveOwnPropsChanged = false;
|
9413 | this.hasStoreStateChanged = false;
|
9414 | this.haveStatePropsBeenPrecalculated = false;
|
9415 | this.statePropsPrecalculationError = null;
|
9416 |
|
9417 | if (statePropsPrecalculationError) {
|
9418 | throw statePropsPrecalculationError;
|
9419 | }
|
9420 |
|
9421 | var shouldUpdateStateProps = true;
|
9422 | var shouldUpdateDispatchProps = true;
|
9423 | if (pure && renderedElement) {
|
9424 | shouldUpdateStateProps = hasStoreStateChanged || haveOwnPropsChanged && this.doStatePropsDependOnOwnProps;
|
9425 | shouldUpdateDispatchProps = haveOwnPropsChanged && this.doDispatchPropsDependOnOwnProps;
|
9426 | }
|
9427 |
|
9428 | var haveStatePropsChanged = false;
|
9429 | var haveDispatchPropsChanged = false;
|
9430 | if (haveStatePropsBeenPrecalculated) {
|
9431 | haveStatePropsChanged = true;
|
9432 | } else if (shouldUpdateStateProps) {
|
9433 | haveStatePropsChanged = this.updateStatePropsIfNeeded();
|
9434 | }
|
9435 | if (shouldUpdateDispatchProps) {
|
9436 | haveDispatchPropsChanged = this.updateDispatchPropsIfNeeded();
|
9437 | }
|
9438 |
|
9439 | var haveMergedPropsChanged = true;
|
9440 | if (haveStatePropsChanged || haveDispatchPropsChanged || haveOwnPropsChanged) {
|
9441 | haveMergedPropsChanged = this.updateMergedPropsIfNeeded();
|
9442 | } else {
|
9443 | haveMergedPropsChanged = false;
|
9444 | }
|
9445 |
|
9446 | if (!haveMergedPropsChanged && renderedElement) {
|
9447 | return renderedElement;
|
9448 | }
|
9449 |
|
9450 | if (withRef) {
|
9451 | this.renderedElement = (0, _react.createElement)(WrappedComponent, _extends({}, this.mergedProps, {
|
9452 | ref: 'wrappedInstance'
|
9453 | }));
|
9454 | } else {
|
9455 | this.renderedElement = (0, _react.createElement)(WrappedComponent, this.mergedProps);
|
9456 | }
|
9457 |
|
9458 | return this.renderedElement;
|
9459 | };
|
9460 |
|
9461 | return Connect;
|
9462 | }(_react.Component);
|
9463 |
|
9464 | Connect.displayName = connectDisplayName;
|
9465 | Connect.WrappedComponent = WrappedComponent;
|
9466 | Connect.contextTypes = {
|
9467 | store: _storeShape2["default"]
|
9468 | };
|
9469 | Connect.propTypes = {
|
9470 | store: _storeShape2["default"]
|
9471 | };
|
9472 |
|
9473 | if (process.env.NODE_ENV !== 'production') {
|
9474 | Connect.prototype.componentWillUpdate = function componentWillUpdate() {
|
9475 | if (this.version === version) {
|
9476 | return;
|
9477 | }
|
9478 |
|
9479 |
|
9480 | this.version = version;
|
9481 | this.trySubscribe();
|
9482 | this.clearCache();
|
9483 | };
|
9484 | }
|
9485 |
|
9486 | return (0, _hoistNonReactStatics2["default"])(Connect, WrappedComponent);
|
9487 | };
|
9488 | }
|
9489 | }).call(this,require(91))
|
9490 | },{"101":101,"102":102,"103":103,"104":104,"108":108,"297":297,"79":79,"81":81,"91":91}],100:[function(require,module,exports){
|
9491 | 'use strict';
|
9492 |
|
9493 | exports.__esModule = true;
|
9494 | exports.connect = exports.Provider = undefined;
|
9495 |
|
9496 | var _Provider = require(98);
|
9497 |
|
9498 | var _Provider2 = _interopRequireDefault(_Provider);
|
9499 |
|
9500 | var _connect = require(99);
|
9501 |
|
9502 | var _connect2 = _interopRequireDefault(_connect);
|
9503 |
|
9504 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
9505 |
|
9506 | exports.Provider = _Provider2["default"];
|
9507 | exports.connect = _connect2["default"];
|
9508 | },{"98":98,"99":99}],101:[function(require,module,exports){
|
9509 | "use strict";
|
9510 |
|
9511 | exports.__esModule = true;
|
9512 | exports["default"] = shallowEqual;
|
9513 | function shallowEqual(objA, objB) {
|
9514 | if (objA === objB) {
|
9515 | return true;
|
9516 | }
|
9517 |
|
9518 | var keysA = Object.keys(objA);
|
9519 | var keysB = Object.keys(objB);
|
9520 |
|
9521 | if (keysA.length !== keysB.length) {
|
9522 | return false;
|
9523 | }
|
9524 |
|
9525 |
|
9526 | var hasOwn = Object.prototype.hasOwnProperty;
|
9527 | for (var i = 0; i < keysA.length; i++) {
|
9528 | if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
|
9529 | return false;
|
9530 | }
|
9531 | }
|
9532 |
|
9533 | return true;
|
9534 | }
|
9535 | },{}],102:[function(require,module,exports){
|
9536 | 'use strict';
|
9537 |
|
9538 | exports.__esModule = true;
|
9539 |
|
9540 | var _react = require(297);
|
9541 |
|
9542 | exports["default"] = _react.PropTypes.shape({
|
9543 | subscribe: _react.PropTypes.func.isRequired,
|
9544 | dispatch: _react.PropTypes.func.isRequired,
|
9545 | getState: _react.PropTypes.func.isRequired
|
9546 | });
|
9547 | },{"297":297}],103:[function(require,module,exports){
|
9548 | 'use strict';
|
9549 |
|
9550 | exports.__esModule = true;
|
9551 | exports["default"] = warning;
|
9552 |
|
9553 |
|
9554 |
|
9555 |
|
9556 |
|
9557 |
|
9558 | function warning(message) {
|
9559 |
|
9560 | if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
9561 | console.error(message);
|
9562 | }
|
9563 |
|
9564 | try {
|
9565 |
|
9566 |
|
9567 | throw new Error(message);
|
9568 |
|
9569 | } catch (e) {}
|
9570 |
|
9571 | }
|
9572 | },{}],104:[function(require,module,exports){
|
9573 | 'use strict';
|
9574 |
|
9575 | exports.__esModule = true;
|
9576 | exports["default"] = wrapActionCreators;
|
9577 |
|
9578 | var _redux = require(316);
|
9579 |
|
9580 | function wrapActionCreators(actionCreators) {
|
9581 | return function (dispatch) {
|
9582 | return (0, _redux.bindActionCreators)(actionCreators, dispatch);
|
9583 | };
|
9584 | }
|
9585 | },{"316":316}],105:[function(require,module,exports){
|
9586 |
|
9587 | var nativeGetPrototype = Object.getPrototypeOf;
|
9588 |
|
9589 |
|
9590 |
|
9591 |
|
9592 |
|
9593 |
|
9594 |
|
9595 |
|
9596 | function getPrototype(value) {
|
9597 | return nativeGetPrototype(Object(value));
|
9598 | }
|
9599 |
|
9600 | module.exports = getPrototype;
|
9601 |
|
9602 | },{}],106:[function(require,module,exports){
|
9603 |
|
9604 |
|
9605 |
|
9606 |
|
9607 |
|
9608 |
|
9609 |
|
9610 | function isHostObject(value) {
|
9611 |
|
9612 |
|
9613 | var result = false;
|
9614 | if (value != null && typeof value.toString != 'function') {
|
9615 | try {
|
9616 | result = !!(value + '');
|
9617 | } catch (e) {}
|
9618 | }
|
9619 | return result;
|
9620 | }
|
9621 |
|
9622 | module.exports = isHostObject;
|
9623 |
|
9624 | },{}],107:[function(require,module,exports){
|
9625 |
|
9626 |
|
9627 |
|
9628 |
|
9629 |
|
9630 |
|
9631 |
|
9632 |
|
9633 |
|
9634 |
|
9635 |
|
9636 |
|
9637 |
|
9638 |
|
9639 |
|
9640 |
|
9641 |
|
9642 |
|
9643 |
|
9644 |
|
9645 |
|
9646 |
|
9647 |
|
9648 |
|
9649 | function isObjectLike(value) {
|
9650 | return !!value && typeof value == 'object';
|
9651 | }
|
9652 |
|
9653 | module.exports = isObjectLike;
|
9654 |
|
9655 | },{}],108:[function(require,module,exports){
|
9656 | var getPrototype = require(105),
|
9657 | isHostObject = require(106),
|
9658 | isObjectLike = require(107);
|
9659 |
|
9660 |
|
9661 | var objectTag = '[object Object]';
|
9662 |
|
9663 |
|
9664 | var objectProto = Object.prototype;
|
9665 |
|
9666 |
|
9667 | var funcToString = Function.prototype.toString;
|
9668 |
|
9669 |
|
9670 | var hasOwnProperty = objectProto.hasOwnProperty;
|
9671 |
|
9672 |
|
9673 | var objectCtorString = funcToString.call(Object);
|
9674 |
|
9675 |
|
9676 |
|
9677 |
|
9678 |
|
9679 |
|
9680 | var objectToString = objectProto.toString;
|
9681 |
|
9682 |
|
9683 |
|
9684 |
|
9685 |
|
9686 |
|
9687 |
|
9688 |
|
9689 |
|
9690 |
|
9691 |
|
9692 |
|
9693 |
|
9694 |
|
9695 |
|
9696 |
|
9697 |
|
9698 |
|
9699 |
|
9700 |
|
9701 |
|
9702 |
|
9703 |
|
9704 |
|
9705 |
|
9706 |
|
9707 |
|
9708 |
|
9709 |
|
9710 |
|
9711 | function isPlainObject(value) {
|
9712 | if (!isObjectLike(value) ||
|
9713 | objectToString.call(value) != objectTag || isHostObject(value)) {
|
9714 | return false;
|
9715 | }
|
9716 | var proto = getPrototype(value);
|
9717 | if (proto === null) {
|
9718 | return true;
|
9719 | }
|
9720 | var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
9721 | return (typeof Ctor == 'function' &&
|
9722 | Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
|
9723 | }
|
9724 |
|
9725 | module.exports = isPlainObject;
|
9726 |
|
9727 | },{"105":105,"106":106,"107":107}],109:[function(require,module,exports){
|
9728 | "use strict";
|
9729 |
|
9730 | exports.__esModule = true;
|
9731 | var _slice = Array.prototype.slice;
|
9732 | exports.loopAsync = loopAsync;
|
9733 | exports.mapAsync = mapAsync;
|
9734 |
|
9735 | function loopAsync(turns, work, callback) {
|
9736 | var currentTurn = 0,
|
9737 | isDone = false;
|
9738 | var sync = false,
|
9739 | hasNext = false,
|
9740 | doneArgs = undefined;
|
9741 |
|
9742 | function done() {
|
9743 | isDone = true;
|
9744 | if (sync) {
|
9745 |
|
9746 | doneArgs = [].concat(_slice.call(arguments));
|
9747 | return;
|
9748 | }
|
9749 |
|
9750 | callback.apply(this, arguments);
|
9751 | }
|
9752 |
|
9753 | function next() {
|
9754 | if (isDone) {
|
9755 | return;
|
9756 | }
|
9757 |
|
9758 | hasNext = true;
|
9759 | if (sync) {
|
9760 |
|
9761 | return;
|
9762 | }
|
9763 |
|
9764 | sync = true;
|
9765 |
|
9766 | while (!isDone && currentTurn < turns && hasNext) {
|
9767 | hasNext = false;
|
9768 | work.call(this, currentTurn++, next, done);
|
9769 | }
|
9770 |
|
9771 | sync = false;
|
9772 |
|
9773 | if (isDone) {
|
9774 |
|
9775 | callback.apply(this, doneArgs);
|
9776 | return;
|
9777 | }
|
9778 |
|
9779 | if (currentTurn >= turns && hasNext) {
|
9780 | isDone = true;
|
9781 | callback();
|
9782 | }
|
9783 | }
|
9784 |
|
9785 | next();
|
9786 | }
|
9787 |
|
9788 | function mapAsync(array, work, callback) {
|
9789 | var length = array.length;
|
9790 | var values = [];
|
9791 |
|
9792 | if (length === 0) return callback(null, values);
|
9793 |
|
9794 | var isDone = false,
|
9795 | doneCount = 0;
|
9796 |
|
9797 | function done(index, error, value) {
|
9798 | if (isDone) return;
|
9799 |
|
9800 | if (error) {
|
9801 | isDone = true;
|
9802 | callback(error);
|
9803 | } else {
|
9804 | values[index] = value;
|
9805 |
|
9806 | isDone = ++doneCount === length;
|
9807 |
|
9808 | if (isDone) callback(null, values);
|
9809 | }
|
9810 | }
|
9811 |
|
9812 | array.forEach(function (item, index) {
|
9813 | work(item, index, function (error, value) {
|
9814 | done(index, error, value);
|
9815 | });
|
9816 | });
|
9817 | }
|
9818 | },{}],110:[function(require,module,exports){
|
9819 | (function (process){
|
9820 | 'use strict';
|
9821 |
|
9822 | exports.__esModule = true;
|
9823 |
|
9824 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9825 |
|
9826 | var _routerWarning = require(140);
|
9827 |
|
9828 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
9829 |
|
9830 | var _PropTypes = require(117);
|
9831 |
|
9832 |
|
9833 |
|
9834 |
|
9835 | var History = {
|
9836 |
|
9837 | contextTypes: {
|
9838 | history: _PropTypes.history
|
9839 | },
|
9840 |
|
9841 | componentWillMount: function componentWillMount() {
|
9842 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'the `History` mixin is deprecated, please access `context.router` with your own `contextTypes`. http://tiny.cc/router-historymixin') : undefined;
|
9843 | this.history = this.context.history;
|
9844 | }
|
9845 |
|
9846 | };
|
9847 |
|
9848 | exports['default'] = History;
|
9849 | module.exports = exports['default'];
|
9850 | }).call(this,require(91))
|
9851 | },{"117":117,"140":140,"91":91}],111:[function(require,module,exports){
|
9852 | 'use strict';
|
9853 |
|
9854 | exports.__esModule = true;
|
9855 |
|
9856 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
9857 |
|
9858 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9859 |
|
9860 | var _react = require(297);
|
9861 |
|
9862 | var _react2 = _interopRequireDefault(_react);
|
9863 |
|
9864 | var _Link = require(115);
|
9865 |
|
9866 | var _Link2 = _interopRequireDefault(_Link);
|
9867 |
|
9868 |
|
9869 |
|
9870 |
|
9871 | var IndexLink = _react2['default'].createClass({
|
9872 | displayName: 'IndexLink',
|
9873 |
|
9874 | render: function render() {
|
9875 | return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true }));
|
9876 | }
|
9877 |
|
9878 | });
|
9879 |
|
9880 | exports['default'] = IndexLink;
|
9881 | module.exports = exports['default'];
|
9882 | },{"115":115,"297":297}],112:[function(require,module,exports){
|
9883 | (function (process){
|
9884 | 'use strict';
|
9885 |
|
9886 | exports.__esModule = true;
|
9887 |
|
9888 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9889 |
|
9890 | var _react = require(297);
|
9891 |
|
9892 | var _react2 = _interopRequireDefault(_react);
|
9893 |
|
9894 | var _routerWarning = require(140);
|
9895 |
|
9896 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
9897 |
|
9898 | var _invariant = require(81);
|
9899 |
|
9900 | var _invariant2 = _interopRequireDefault(_invariant);
|
9901 |
|
9902 | var _Redirect = require(118);
|
9903 |
|
9904 | var _Redirect2 = _interopRequireDefault(_Redirect);
|
9905 |
|
9906 | var _PropTypes = require(117);
|
9907 |
|
9908 | var _React$PropTypes = _react2['default'].PropTypes;
|
9909 | var string = _React$PropTypes.string;
|
9910 | var object = _React$PropTypes.object;
|
9911 |
|
9912 |
|
9913 |
|
9914 |
|
9915 | var IndexRedirect = _react2['default'].createClass({
|
9916 | displayName: 'IndexRedirect',
|
9917 |
|
9918 | statics: {
|
9919 |
|
9920 | createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) {
|
9921 |
|
9922 | if (parentRoute) {
|
9923 | parentRoute.indexRoute = _Redirect2['default'].createRouteFromReactElement(element);
|
9924 | } else {
|
9925 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'An <IndexRedirect> does not make sense at the root of your route config') : undefined;
|
9926 | }
|
9927 | }
|
9928 |
|
9929 | },
|
9930 |
|
9931 | propTypes: {
|
9932 | to: string.isRequired,
|
9933 | query: object,
|
9934 | state: object,
|
9935 | onEnter: _PropTypes.falsy,
|
9936 | children: _PropTypes.falsy
|
9937 | },
|
9938 |
|
9939 |
|
9940 | render: function render() {
|
9941 | !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, '<IndexRedirect> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
|
9942 | }
|
9943 |
|
9944 | });
|
9945 |
|
9946 | exports['default'] = IndexRedirect;
|
9947 | module.exports = exports['default'];
|
9948 | }).call(this,require(91))
|
9949 | },{"117":117,"118":118,"140":140,"297":297,"81":81,"91":91}],113:[function(require,module,exports){
|
9950 | (function (process){
|
9951 | 'use strict';
|
9952 |
|
9953 | exports.__esModule = true;
|
9954 |
|
9955 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9956 |
|
9957 | var _react = require(297);
|
9958 |
|
9959 | var _react2 = _interopRequireDefault(_react);
|
9960 |
|
9961 | var _routerWarning = require(140);
|
9962 |
|
9963 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
9964 |
|
9965 | var _invariant = require(81);
|
9966 |
|
9967 | var _invariant2 = _interopRequireDefault(_invariant);
|
9968 |
|
9969 | var _RouteUtils = require(121);
|
9970 |
|
9971 | var _PropTypes = require(117);
|
9972 |
|
9973 | var func = _react2['default'].PropTypes.func;
|
9974 |
|
9975 |
|
9976 |
|
9977 |
|
9978 |
|
9979 | var IndexRoute = _react2['default'].createClass({
|
9980 | displayName: 'IndexRoute',
|
9981 |
|
9982 | statics: {
|
9983 |
|
9984 | createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) {
|
9985 |
|
9986 | if (parentRoute) {
|
9987 | parentRoute.indexRoute = _RouteUtils.createRouteFromReactElement(element);
|
9988 | } else {
|
9989 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'An <IndexRoute> does not make sense at the root of your route config') : undefined;
|
9990 | }
|
9991 | }
|
9992 |
|
9993 | },
|
9994 |
|
9995 | propTypes: {
|
9996 | path: _PropTypes.falsy,
|
9997 | component: _PropTypes.component,
|
9998 | components: _PropTypes.components,
|
9999 | getComponent: func,
|
10000 | getComponents: func
|
10001 | },
|
10002 |
|
10003 |
|
10004 | render: function render() {
|
10005 | !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, '<IndexRoute> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
|
10006 | }
|
10007 |
|
10008 | });
|
10009 |
|
10010 | exports['default'] = IndexRoute;
|
10011 | module.exports = exports['default'];
|
10012 | }).call(this,require(91))
|
10013 | },{"117":117,"121":121,"140":140,"297":297,"81":81,"91":91}],114:[function(require,module,exports){
|
10014 | (function (process){
|
10015 | 'use strict';
|
10016 |
|
10017 | exports.__esModule = true;
|
10018 |
|
10019 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10020 |
|
10021 | var _routerWarning = require(140);
|
10022 |
|
10023 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
10024 |
|
10025 | var _react = require(297);
|
10026 |
|
10027 | var _react2 = _interopRequireDefault(_react);
|
10028 |
|
10029 | var _invariant = require(81);
|
10030 |
|
10031 | var _invariant2 = _interopRequireDefault(_invariant);
|
10032 |
|
10033 | var object = _react2['default'].PropTypes.object;
|
10034 |
|
10035 |
|
10036 |
|
10037 |
|
10038 |
|
10039 |
|
10040 |
|
10041 |
|
10042 |
|
10043 |
|
10044 |
|
10045 |
|
10046 |
|
10047 |
|
10048 |
|
10049 |
|
10050 | var Lifecycle = {
|
10051 |
|
10052 | contextTypes: {
|
10053 | history: object.isRequired,
|
10054 |
|
10055 |
|
10056 |
|
10057 | route: object
|
10058 | },
|
10059 |
|
10060 | propTypes: {
|
10061 |
|
10062 | route: object
|
10063 | },
|
10064 |
|
10065 | componentDidMount: function componentDidMount() {
|
10066 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'the `Lifecycle` mixin is deprecated, please use `context.router.setRouteLeaveHook(route, hook)`. http://tiny.cc/router-lifecyclemixin') : undefined;
|
10067 | !this.routerWillLeave ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The Lifecycle mixin requires you to define a routerWillLeave method') : _invariant2['default'](false) : undefined;
|
10068 |
|
10069 | var route = this.props.route || this.context.route;
|
10070 |
|
10071 | !route ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The Lifecycle mixin must be used on either a) a <Route component> or ' + 'b) a descendant of a <Route component> that uses the RouteContext mixin') : _invariant2['default'](false) : undefined;
|
10072 |
|
10073 | this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(route, this.routerWillLeave);
|
10074 | },
|
10075 |
|
10076 | componentWillUnmount: function componentWillUnmount() {
|
10077 | if (this._unlistenBeforeLeavingRoute) this._unlistenBeforeLeavingRoute();
|
10078 | }
|
10079 |
|
10080 | };
|
10081 |
|
10082 | exports['default'] = Lifecycle;
|
10083 | module.exports = exports['default'];
|
10084 | }).call(this,require(91))
|
10085 | },{"140":140,"297":297,"81":81,"91":91}],115:[function(require,module,exports){
|
10086 | (function (process){
|
10087 | 'use strict';
|
10088 |
|
10089 | exports.__esModule = true;
|
10090 |
|
10091 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
10092 |
|
10093 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10094 |
|
10095 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
10096 |
|
10097 | var _react = require(297);
|
10098 |
|
10099 | var _react2 = _interopRequireDefault(_react);
|
10100 |
|
10101 | var _routerWarning = require(140);
|
10102 |
|
10103 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
10104 |
|
10105 | var _React$PropTypes = _react2['default'].PropTypes;
|
10106 | var bool = _React$PropTypes.bool;
|
10107 | var object = _React$PropTypes.object;
|
10108 | var string = _React$PropTypes.string;
|
10109 | var func = _React$PropTypes.func;
|
10110 | var oneOfType = _React$PropTypes.oneOfType;
|
10111 |
|
10112 | function isLeftClickEvent(event) {
|
10113 | return event.button === 0;
|
10114 | }
|
10115 |
|
10116 | function isModifiedEvent(event) {
|
10117 | return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
10118 | }
|
10119 |
|
10120 | function isEmptyObject(object) {
|
10121 | for (var p in object) {
|
10122 | if (object.hasOwnProperty(p)) return false;
|
10123 | }return true;
|
10124 | }
|
10125 |
|
10126 | function createLocationDescriptor(to, _ref) {
|
10127 | var query = _ref.query;
|
10128 | var hash = _ref.hash;
|
10129 | var state = _ref.state;
|
10130 |
|
10131 | if (query || hash || state) {
|
10132 | return { pathname: to, query: query, hash: hash, state: state };
|
10133 | }
|
10134 |
|
10135 | return to;
|
10136 | }
|
10137 |
|
10138 |
|
10139 |
|
10140 |
|
10141 |
|
10142 |
|
10143 |
|
10144 |
|
10145 |
|
10146 |
|
10147 |
|
10148 |
|
10149 |
|
10150 |
|
10151 |
|
10152 |
|
10153 |
|
10154 |
|
10155 |
|
10156 | var Link = _react2['default'].createClass({
|
10157 | displayName: 'Link',
|
10158 |
|
10159 | contextTypes: {
|
10160 | router: object
|
10161 | },
|
10162 |
|
10163 | propTypes: {
|
10164 | to: oneOfType([string, object]).isRequired,
|
10165 | query: object,
|
10166 | hash: string,
|
10167 | state: object,
|
10168 | activeStyle: object,
|
10169 | activeClassName: string,
|
10170 | onlyActiveOnIndex: bool.isRequired,
|
10171 | onClick: func
|
10172 | },
|
10173 |
|
10174 | getDefaultProps: function getDefaultProps() {
|
10175 | return {
|
10176 | onlyActiveOnIndex: false,
|
10177 | className: '',
|
10178 | style: {}
|
10179 | };
|
10180 | },
|
10181 |
|
10182 | handleClick: function handleClick(event) {
|
10183 | var allowTransition = true;
|
10184 |
|
10185 | if (this.props.onClick) this.props.onClick(event);
|
10186 |
|
10187 | if (isModifiedEvent(event) || !isLeftClickEvent(event)) return;
|
10188 |
|
10189 | if (event.defaultPrevented === true) allowTransition = false;
|
10190 |
|
10191 |
|
10192 |
|
10193 | if (this.props.target) {
|
10194 | if (!allowTransition) event.preventDefault();
|
10195 |
|
10196 | return;
|
10197 | }
|
10198 |
|
10199 | event.preventDefault();
|
10200 |
|
10201 | if (allowTransition) {
|
10202 | var _props = this.props;
|
10203 | var to = _props.to;
|
10204 | var query = _props.query;
|
10205 | var hash = _props.hash;
|
10206 | var state = _props.state;
|
10207 |
|
10208 | var _location = createLocationDescriptor(to, { query: query, hash: hash, state: state });
|
10209 |
|
10210 | this.context.router.push(_location);
|
10211 | }
|
10212 | },
|
10213 |
|
10214 | render: function render() {
|
10215 | var _props2 = this.props;
|
10216 | var to = _props2.to;
|
10217 | var query = _props2.query;
|
10218 | var hash = _props2.hash;
|
10219 | var state = _props2.state;
|
10220 | var activeClassName = _props2.activeClassName;
|
10221 | var activeStyle = _props2.activeStyle;
|
10222 | var onlyActiveOnIndex = _props2.onlyActiveOnIndex;
|
10223 |
|
10224 | var props = _objectWithoutProperties(_props2, ['to', 'query', 'hash', 'state', 'activeClassName', 'activeStyle', 'onlyActiveOnIndex']);
|
10225 |
|
10226 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!(query || hash || state), 'the `query`, `hash`, and `state` props on `<Link>` are deprecated, use `<Link to={{ pathname, query, hash, state }}/>. http://tiny.cc/router-isActivedeprecated') : undefined;
|
10227 |
|
10228 |
|
10229 | var router = this.context.router;
|
10230 |
|
10231 | if (router) {
|
10232 | var _location2 = createLocationDescriptor(to, { query: query, hash: hash, state: state });
|
10233 | props.href = router.createHref(_location2);
|
10234 |
|
10235 | if (activeClassName || activeStyle != null && !isEmptyObject(activeStyle)) {
|
10236 | if (router.isActive(_location2, onlyActiveOnIndex)) {
|
10237 | if (activeClassName) props.className += props.className === '' ? activeClassName : ' ' + activeClassName;
|
10238 |
|
10239 | if (activeStyle) props.style = _extends({}, props.style, activeStyle);
|
10240 | }
|
10241 | }
|
10242 | }
|
10243 |
|
10244 | return _react2['default'].createElement('a', _extends({}, props, { onClick: this.handleClick }));
|
10245 | }
|
10246 |
|
10247 | });
|
10248 |
|
10249 | exports['default'] = Link;
|
10250 | module.exports = exports['default'];
|
10251 | }).call(this,require(91))
|
10252 | },{"140":140,"297":297,"91":91}],116:[function(require,module,exports){
|
10253 | (function (process){
|
10254 | 'use strict';
|
10255 |
|
10256 | exports.__esModule = true;
|
10257 | exports.compilePattern = compilePattern;
|
10258 | exports.matchPattern = matchPattern;
|
10259 | exports.getParamNames = getParamNames;
|
10260 | exports.getParams = getParams;
|
10261 | exports.formatPattern = formatPattern;
|
10262 |
|
10263 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10264 |
|
10265 | var _invariant = require(81);
|
10266 |
|
10267 | var _invariant2 = _interopRequireDefault(_invariant);
|
10268 |
|
10269 | function escapeRegExp(string) {
|
10270 | return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
10271 | }
|
10272 |
|
10273 | function escapeSource(string) {
|
10274 | return escapeRegExp(string).replace(/\/+/g, '/+');
|
10275 | }
|
10276 |
|
10277 | function _compilePattern(pattern) {
|
10278 | var regexpSource = '';
|
10279 | var paramNames = [];
|
10280 | var tokens = [];
|
10281 |
|
10282 | var match = undefined,
|
10283 | lastIndex = 0,
|
10284 | matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g;
|
10285 | while (match = matcher.exec(pattern)) {
|
10286 | if (match.index !== lastIndex) {
|
10287 | tokens.push(pattern.slice(lastIndex, match.index));
|
10288 | regexpSource += escapeSource(pattern.slice(lastIndex, match.index));
|
10289 | }
|
10290 |
|
10291 | if (match[1]) {
|
10292 | regexpSource += '([^/?#]+)';
|
10293 | paramNames.push(match[1]);
|
10294 | } else if (match[0] === '**') {
|
10295 | regexpSource += '([\\s\\S]*)';
|
10296 | paramNames.push('splat');
|
10297 | } else if (match[0] === '*') {
|
10298 | regexpSource += '([\\s\\S]*?)';
|
10299 | paramNames.push('splat');
|
10300 | } else if (match[0] === '(') {
|
10301 | regexpSource += '(?:';
|
10302 | } else if (match[0] === ')') {
|
10303 | regexpSource += ')?';
|
10304 | }
|
10305 |
|
10306 | tokens.push(match[0]);
|
10307 |
|
10308 | lastIndex = matcher.lastIndex;
|
10309 | }
|
10310 |
|
10311 | if (lastIndex !== pattern.length) {
|
10312 | tokens.push(pattern.slice(lastIndex, pattern.length));
|
10313 | regexpSource += escapeSource(pattern.slice(lastIndex, pattern.length));
|
10314 | }
|
10315 |
|
10316 | return {
|
10317 | pattern: pattern,
|
10318 | regexpSource: regexpSource,
|
10319 | paramNames: paramNames,
|
10320 | tokens: tokens
|
10321 | };
|
10322 | }
|
10323 |
|
10324 | var CompiledPatternsCache = {};
|
10325 |
|
10326 | function compilePattern(pattern) {
|
10327 | if (!(pattern in CompiledPatternsCache)) CompiledPatternsCache[pattern] = _compilePattern(pattern);
|
10328 |
|
10329 | return CompiledPatternsCache[pattern];
|
10330 | }
|
10331 |
|
10332 |
|
10333 |
|
10334 |
|
10335 |
|
10336 |
|
10337 |
|
10338 |
|
10339 |
|
10340 |
|
10341 |
|
10342 |
|
10343 |
|
10344 |
|
10345 |
|
10346 |
|
10347 |
|
10348 |
|
10349 |
|
10350 |
|
10351 |
|
10352 | function matchPattern(pattern, pathname) {
|
10353 |
|
10354 | if (pattern.charAt(0) !== '/') {
|
10355 | pattern = '/' + pattern;
|
10356 | }
|
10357 | if (pathname.charAt(0) !== '/') {
|
10358 | pathname = '/' + pathname;
|
10359 | }
|
10360 |
|
10361 | var _compilePattern2 = compilePattern(pattern);
|
10362 |
|
10363 | var regexpSource = _compilePattern2.regexpSource;
|
10364 | var paramNames = _compilePattern2.paramNames;
|
10365 | var tokens = _compilePattern2.tokens;
|
10366 |
|
10367 | regexpSource += '/*';
|
10368 |
|
10369 |
|
10370 | var captureRemaining = tokens[tokens.length - 1] !== '*';
|
10371 |
|
10372 | if (captureRemaining) {
|
10373 |
|
10374 | regexpSource += '([\\s\\S]*?)';
|
10375 | }
|
10376 |
|
10377 | var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i'));
|
10378 |
|
10379 | var remainingPathname = undefined,
|
10380 | paramValues = undefined;
|
10381 | if (match != null) {
|
10382 | if (captureRemaining) {
|
10383 | remainingPathname = match.pop();
|
10384 | var matchedPath = match[0].substr(0, match[0].length - remainingPathname.length);
|
10385 |
|
10386 |
|
10387 |
|
10388 |
|
10389 | if (remainingPathname && matchedPath.charAt(matchedPath.length - 1) !== '/') {
|
10390 | return {
|
10391 | remainingPathname: null,
|
10392 | paramNames: paramNames,
|
10393 | paramValues: null
|
10394 | };
|
10395 | }
|
10396 | } else {
|
10397 |
|
10398 | remainingPathname = '';
|
10399 | }
|
10400 |
|
10401 | paramValues = match.slice(1).map(function (v) {
|
10402 | return v != null ? decodeURIComponent(v) : v;
|
10403 | });
|
10404 | } else {
|
10405 | remainingPathname = paramValues = null;
|
10406 | }
|
10407 |
|
10408 | return {
|
10409 | remainingPathname: remainingPathname,
|
10410 | paramNames: paramNames,
|
10411 | paramValues: paramValues
|
10412 | };
|
10413 | }
|
10414 |
|
10415 | function getParamNames(pattern) {
|
10416 | return compilePattern(pattern).paramNames;
|
10417 | }
|
10418 |
|
10419 | function getParams(pattern, pathname) {
|
10420 | var _matchPattern = matchPattern(pattern, pathname);
|
10421 |
|
10422 | var paramNames = _matchPattern.paramNames;
|
10423 | var paramValues = _matchPattern.paramValues;
|
10424 |
|
10425 | if (paramValues != null) {
|
10426 | return paramNames.reduce(function (memo, paramName, index) {
|
10427 | memo[paramName] = paramValues[index];
|
10428 | return memo;
|
10429 | }, {});
|
10430 | }
|
10431 |
|
10432 | return null;
|
10433 | }
|
10434 |
|
10435 |
|
10436 |
|
10437 |
|
10438 |
|
10439 |
|
10440 | function formatPattern(pattern, params) {
|
10441 | params = params || {};
|
10442 |
|
10443 | var _compilePattern3 = compilePattern(pattern);
|
10444 |
|
10445 | var tokens = _compilePattern3.tokens;
|
10446 |
|
10447 | var parenCount = 0,
|
10448 | pathname = '',
|
10449 | splatIndex = 0;
|
10450 |
|
10451 | var token = undefined,
|
10452 | paramName = undefined,
|
10453 | paramValue = undefined;
|
10454 | for (var i = 0, len = tokens.length; i < len; ++i) {
|
10455 | token = tokens[i];
|
10456 |
|
10457 | if (token === '*' || token === '**') {
|
10458 | paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat;
|
10459 |
|
10460 | !(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Missing splat #%s for path "%s"', splatIndex, pattern) : _invariant2['default'](false) : undefined;
|
10461 |
|
10462 | if (paramValue != null) pathname += encodeURI(paramValue);
|
10463 | } else if (token === '(') {
|
10464 | parenCount += 1;
|
10465 | } else if (token === ')') {
|
10466 | parenCount -= 1;
|
10467 | } else if (token.charAt(0) === ':') {
|
10468 | paramName = token.substring(1);
|
10469 | paramValue = params[paramName];
|
10470 |
|
10471 | !(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Missing "%s" parameter for path "%s"', paramName, pattern) : _invariant2['default'](false) : undefined;
|
10472 |
|
10473 | if (paramValue != null) pathname += encodeURIComponent(paramValue);
|
10474 | } else {
|
10475 | pathname += token;
|
10476 | }
|
10477 | }
|
10478 |
|
10479 | return pathname.replace(/\/+/g, '/');
|
10480 | }
|
10481 | }).call(this,require(91))
|
10482 | },{"81":81,"91":91}],117:[function(require,module,exports){
|
10483 | 'use strict';
|
10484 |
|
10485 | exports.__esModule = true;
|
10486 | exports.falsy = falsy;
|
10487 |
|
10488 | var _react = require(297);
|
10489 |
|
10490 | var func = _react.PropTypes.func;
|
10491 | var object = _react.PropTypes.object;
|
10492 | var arrayOf = _react.PropTypes.arrayOf;
|
10493 | var oneOfType = _react.PropTypes.oneOfType;
|
10494 | var element = _react.PropTypes.element;
|
10495 | var shape = _react.PropTypes.shape;
|
10496 | var string = _react.PropTypes.string;
|
10497 |
|
10498 | function falsy(props, propName, componentName) {
|
10499 | if (props[propName]) return new Error('<' + componentName + '> should not have a "' + propName + '" prop');
|
10500 | }
|
10501 |
|
10502 | var history = shape({
|
10503 | listen: func.isRequired,
|
10504 | pushState: func.isRequired,
|
10505 | replaceState: func.isRequired,
|
10506 | go: func.isRequired
|
10507 | });
|
10508 |
|
10509 | exports.history = history;
|
10510 | var location = shape({
|
10511 | pathname: string.isRequired,
|
10512 | search: string.isRequired,
|
10513 | state: object,
|
10514 | action: string.isRequired,
|
10515 | key: string
|
10516 | });
|
10517 |
|
10518 | exports.location = location;
|
10519 | var component = oneOfType([func, string]);
|
10520 | exports.component = component;
|
10521 | var components = oneOfType([component, object]);
|
10522 | exports.components = components;
|
10523 | var route = oneOfType([object, element]);
|
10524 | exports.route = route;
|
10525 | var routes = oneOfType([route, arrayOf(route)]);
|
10526 |
|
10527 | exports.routes = routes;
|
10528 | exports['default'] = {
|
10529 | falsy: falsy,
|
10530 | history: history,
|
10531 | location: location,
|
10532 | component: component,
|
10533 | components: components,
|
10534 | route: route
|
10535 | };
|
10536 | },{"297":297}],118:[function(require,module,exports){
|
10537 | (function (process){
|
10538 | 'use strict';
|
10539 |
|
10540 | exports.__esModule = true;
|
10541 |
|
10542 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10543 |
|
10544 | var _react = require(297);
|
10545 |
|
10546 | var _react2 = _interopRequireDefault(_react);
|
10547 |
|
10548 | var _invariant = require(81);
|
10549 |
|
10550 | var _invariant2 = _interopRequireDefault(_invariant);
|
10551 |
|
10552 | var _RouteUtils = require(121);
|
10553 |
|
10554 | var _PatternUtils = require(116);
|
10555 |
|
10556 | var _PropTypes = require(117);
|
10557 |
|
10558 | var _React$PropTypes = _react2['default'].PropTypes;
|
10559 | var string = _React$PropTypes.string;
|
10560 | var object = _React$PropTypes.object;
|
10561 |
|
10562 |
|
10563 |
|
10564 |
|
10565 |
|
10566 |
|
10567 |
|
10568 |
|
10569 | var Redirect = _react2['default'].createClass({
|
10570 | displayName: 'Redirect',
|
10571 |
|
10572 | statics: {
|
10573 |
|
10574 | createRouteFromReactElement: function createRouteFromReactElement(element) {
|
10575 | var route = _RouteUtils.createRouteFromReactElement(element);
|
10576 |
|
10577 | if (route.from) route.path = route.from;
|
10578 |
|
10579 | route.onEnter = function (nextState, replace) {
|
10580 | var location = nextState.location;
|
10581 | var params = nextState.params;
|
10582 |
|
10583 | var pathname = undefined;
|
10584 | if (route.to.charAt(0) === '/') {
|
10585 | pathname = _PatternUtils.formatPattern(route.to, params);
|
10586 | } else if (!route.to) {
|
10587 | pathname = location.pathname;
|
10588 | } else {
|
10589 | var routeIndex = nextState.routes.indexOf(route);
|
10590 | var parentPattern = Redirect.getRoutePattern(nextState.routes, routeIndex - 1);
|
10591 | var pattern = parentPattern.replace(/\/*$/, '/') + route.to;
|
10592 | pathname = _PatternUtils.formatPattern(pattern, params);
|
10593 | }
|
10594 |
|
10595 | replace({
|
10596 | pathname: pathname,
|
10597 | query: route.query || location.query,
|
10598 | state: route.state || location.state
|
10599 | });
|
10600 | };
|
10601 |
|
10602 | return route;
|
10603 | },
|
10604 |
|
10605 | getRoutePattern: function getRoutePattern(routes, routeIndex) {
|
10606 | var parentPattern = '';
|
10607 |
|
10608 | for (var i = routeIndex; i >= 0; i--) {
|
10609 | var route = routes[i];
|
10610 | var pattern = route.path || '';
|
10611 |
|
10612 | parentPattern = pattern.replace(/\/*$/, '/') + parentPattern;
|
10613 |
|
10614 | if (pattern.indexOf('/') === 0) break;
|
10615 | }
|
10616 |
|
10617 | return '/' + parentPattern;
|
10618 | }
|
10619 |
|
10620 | },
|
10621 |
|
10622 | propTypes: {
|
10623 | path: string,
|
10624 | from: string,
|
10625 | to: string.isRequired,
|
10626 | query: object,
|
10627 | state: object,
|
10628 | onEnter: _PropTypes.falsy,
|
10629 | children: _PropTypes.falsy
|
10630 | },
|
10631 |
|
10632 |
|
10633 | render: function render() {
|
10634 | !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, '<Redirect> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
|
10635 | }
|
10636 |
|
10637 | });
|
10638 |
|
10639 | exports['default'] = Redirect;
|
10640 | module.exports = exports['default'];
|
10641 | }).call(this,require(91))
|
10642 | },{"116":116,"117":117,"121":121,"297":297,"81":81,"91":91}],119:[function(require,module,exports){
|
10643 | (function (process){
|
10644 | 'use strict';
|
10645 |
|
10646 | exports.__esModule = true;
|
10647 |
|
10648 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10649 |
|
10650 | var _react = require(297);
|
10651 |
|
10652 | var _react2 = _interopRequireDefault(_react);
|
10653 |
|
10654 | var _invariant = require(81);
|
10655 |
|
10656 | var _invariant2 = _interopRequireDefault(_invariant);
|
10657 |
|
10658 | var _RouteUtils = require(121);
|
10659 |
|
10660 | var _PropTypes = require(117);
|
10661 |
|
10662 | var _React$PropTypes = _react2['default'].PropTypes;
|
10663 | var string = _React$PropTypes.string;
|
10664 | var func = _React$PropTypes.func;
|
10665 |
|
10666 |
|
10667 |
|
10668 |
|
10669 |
|
10670 |
|
10671 |
|
10672 |
|
10673 |
|
10674 |
|
10675 |
|
10676 | var Route = _react2['default'].createClass({
|
10677 | displayName: 'Route',
|
10678 |
|
10679 | statics: {
|
10680 | createRouteFromReactElement: _RouteUtils.createRouteFromReactElement
|
10681 | },
|
10682 |
|
10683 | propTypes: {
|
10684 | path: string,
|
10685 | component: _PropTypes.component,
|
10686 | components: _PropTypes.components,
|
10687 | getComponent: func,
|
10688 | getComponents: func
|
10689 | },
|
10690 |
|
10691 |
|
10692 | render: function render() {
|
10693 | !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, '<Route> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
|
10694 | }
|
10695 |
|
10696 | });
|
10697 |
|
10698 | exports['default'] = Route;
|
10699 | module.exports = exports['default'];
|
10700 | }).call(this,require(91))
|
10701 | },{"117":117,"121":121,"297":297,"81":81,"91":91}],120:[function(require,module,exports){
|
10702 | (function (process){
|
10703 | 'use strict';
|
10704 |
|
10705 | exports.__esModule = true;
|
10706 |
|
10707 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10708 |
|
10709 | var _routerWarning = require(140);
|
10710 |
|
10711 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
10712 |
|
10713 | var _react = require(297);
|
10714 |
|
10715 | var _react2 = _interopRequireDefault(_react);
|
10716 |
|
10717 | var object = _react2['default'].PropTypes.object;
|
10718 |
|
10719 |
|
10720 |
|
10721 |
|
10722 |
|
10723 |
|
10724 |
|
10725 | var RouteContext = {
|
10726 |
|
10727 | propTypes: {
|
10728 | route: object.isRequired
|
10729 | },
|
10730 |
|
10731 | childContextTypes: {
|
10732 | route: object.isRequired
|
10733 | },
|
10734 |
|
10735 | getChildContext: function getChildContext() {
|
10736 | return {
|
10737 | route: this.props.route
|
10738 | };
|
10739 | },
|
10740 |
|
10741 | componentWillMount: function componentWillMount() {
|
10742 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'The `RouteContext` mixin is deprecated. You can provide `this.props.route` on context with your own `contextTypes`. http://tiny.cc/router-routecontextmixin') : undefined;
|
10743 | }
|
10744 |
|
10745 | };
|
10746 |
|
10747 | exports['default'] = RouteContext;
|
10748 | module.exports = exports['default'];
|
10749 | }).call(this,require(91))
|
10750 | },{"140":140,"297":297,"91":91}],121:[function(require,module,exports){
|
10751 | (function (process){
|
10752 | 'use strict';
|
10753 |
|
10754 | exports.__esModule = true;
|
10755 |
|
10756 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
10757 |
|
10758 | exports.isReactChildren = isReactChildren;
|
10759 | exports.createRouteFromReactElement = createRouteFromReactElement;
|
10760 | exports.createRoutesFromReactChildren = createRoutesFromReactChildren;
|
10761 | exports.createRoutes = createRoutes;
|
10762 |
|
10763 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10764 |
|
10765 | var _react = require(297);
|
10766 |
|
10767 | var _react2 = _interopRequireDefault(_react);
|
10768 |
|
10769 | var _routerWarning = require(140);
|
10770 |
|
10771 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
10772 |
|
10773 | function isValidChild(object) {
|
10774 | return object == null || _react2['default'].isValidElement(object);
|
10775 | }
|
10776 |
|
10777 | function isReactChildren(object) {
|
10778 | return isValidChild(object) || Array.isArray(object) && object.every(isValidChild);
|
10779 | }
|
10780 |
|
10781 | function checkPropTypes(componentName, propTypes, props) {
|
10782 | componentName = componentName || 'UnknownComponent';
|
10783 |
|
10784 | for (var propName in propTypes) {
|
10785 | if (propTypes.hasOwnProperty(propName)) {
|
10786 | var error = propTypes[propName](props, propName, componentName);
|
10787 |
|
10788 |
|
10789 | if (error instanceof Error) process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, error.message) : undefined;
|
10790 | }
|
10791 | }
|
10792 | }
|
10793 |
|
10794 | function createRoute(defaultProps, props) {
|
10795 | return _extends({}, defaultProps, props);
|
10796 | }
|
10797 |
|
10798 | function createRouteFromReactElement(element) {
|
10799 | var type = element.type;
|
10800 | var route = createRoute(type.defaultProps, element.props);
|
10801 |
|
10802 | if (type.propTypes) checkPropTypes(type.displayName || type.name, type.propTypes, route);
|
10803 |
|
10804 | if (route.children) {
|
10805 | var childRoutes = createRoutesFromReactChildren(route.children, route);
|
10806 |
|
10807 | if (childRoutes.length) route.childRoutes = childRoutes;
|
10808 |
|
10809 | delete route.children;
|
10810 | }
|
10811 |
|
10812 | return route;
|
10813 | }
|
10814 |
|
10815 |
|
10816 |
|
10817 |
|
10818 |
|
10819 |
|
10820 |
|
10821 |
|
10822 |
|
10823 |
|
10824 |
|
10825 |
|
10826 |
|
10827 |
|
10828 |
|
10829 |
|
10830 |
|
10831 |
|
10832 |
|
10833 | function createRoutesFromReactChildren(children, parentRoute) {
|
10834 | var routes = [];
|
10835 |
|
10836 | _react2['default'].Children.forEach(children, function (element) {
|
10837 | if (_react2['default'].isValidElement(element)) {
|
10838 |
|
10839 | if (element.type.createRouteFromReactElement) {
|
10840 | var route = element.type.createRouteFromReactElement(element, parentRoute);
|
10841 |
|
10842 | if (route) routes.push(route);
|
10843 | } else {
|
10844 | routes.push(createRouteFromReactElement(element));
|
10845 | }
|
10846 | }
|
10847 | });
|
10848 |
|
10849 | return routes;
|
10850 | }
|
10851 |
|
10852 |
|
10853 |
|
10854 |
|
10855 |
|
10856 |
|
10857 | function createRoutes(routes) {
|
10858 | if (isReactChildren(routes)) {
|
10859 | routes = createRoutesFromReactChildren(routes);
|
10860 | } else if (routes && !Array.isArray(routes)) {
|
10861 | routes = [routes];
|
10862 | }
|
10863 |
|
10864 | return routes;
|
10865 | }
|
10866 | }).call(this,require(91))
|
10867 | },{"140":140,"297":297,"91":91}],122:[function(require,module,exports){
|
10868 | (function (process){
|
10869 | 'use strict';
|
10870 |
|
10871 | exports.__esModule = true;
|
10872 |
|
10873 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
10874 |
|
10875 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
10876 |
|
10877 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
10878 |
|
10879 | var _historyLibCreateHashHistory = require(151);
|
10880 |
|
10881 | var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory);
|
10882 |
|
10883 | var _historyLibUseQueries = require(158);
|
10884 |
|
10885 | var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries);
|
10886 |
|
10887 | var _react = require(297);
|
10888 |
|
10889 | var _react2 = _interopRequireDefault(_react);
|
10890 |
|
10891 | var _createTransitionManager = require(131);
|
10892 |
|
10893 | var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
|
10894 |
|
10895 | var _PropTypes = require(117);
|
10896 |
|
10897 | var _RouterContext = require(123);
|
10898 |
|
10899 | var _RouterContext2 = _interopRequireDefault(_RouterContext);
|
10900 |
|
10901 | var _RouteUtils = require(121);
|
10902 |
|
10903 | var _RouterUtils = require(124);
|
10904 |
|
10905 | var _routerWarning = require(140);
|
10906 |
|
10907 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
10908 |
|
10909 | function isDeprecatedHistory(history) {
|
10910 | return !history || !history.__v2_compatible__;
|
10911 | }
|
10912 |
|
10913 | var _React$PropTypes = _react2['default'].PropTypes;
|
10914 | var func = _React$PropTypes.func;
|
10915 | var object = _React$PropTypes.object;
|
10916 |
|
10917 |
|
10918 |
|
10919 |
|
10920 |
|
10921 |
|
10922 | var Router = _react2['default'].createClass({
|
10923 | displayName: 'Router',
|
10924 |
|
10925 | propTypes: {
|
10926 | history: object,
|
10927 | children: _PropTypes.routes,
|
10928 | routes: _PropTypes.routes,
|
10929 | render: func,
|
10930 | createElement: func,
|
10931 | onError: func,
|
10932 | onUpdate: func,
|
10933 |
|
10934 |
|
10935 | matchContext: object
|
10936 | },
|
10937 |
|
10938 | getDefaultProps: function getDefaultProps() {
|
10939 | return {
|
10940 | render: function render(props) {
|
10941 | return _react2['default'].createElement(_RouterContext2['default'], props);
|
10942 | }
|
10943 | };
|
10944 | },
|
10945 |
|
10946 | getInitialState: function getInitialState() {
|
10947 | return {
|
10948 | location: null,
|
10949 | routes: null,
|
10950 | params: null,
|
10951 | components: null
|
10952 | };
|
10953 | },
|
10954 |
|
10955 | handleError: function handleError(error) {
|
10956 | if (this.props.onError) {
|
10957 | this.props.onError.call(this, error);
|
10958 | } else {
|
10959 |
|
10960 | throw error;
|
10961 | }
|
10962 | },
|
10963 |
|
10964 | componentWillMount: function componentWillMount() {
|
10965 | var _this = this;
|
10966 |
|
10967 | var _props = this.props;
|
10968 | var parseQueryString = _props.parseQueryString;
|
10969 | var stringifyQuery = _props.stringifyQuery;
|
10970 |
|
10971 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!(parseQueryString || stringifyQuery), '`parseQueryString` and `stringifyQuery` are deprecated. Please create a custom history. http://tiny.cc/router-customquerystring') : undefined;
|
10972 |
|
10973 | var _createRouterObjects = this.createRouterObjects();
|
10974 |
|
10975 | var history = _createRouterObjects.history;
|
10976 | var transitionManager = _createRouterObjects.transitionManager;
|
10977 | var router = _createRouterObjects.router;
|
10978 |
|
10979 | this._unlisten = transitionManager.listen(function (error, state) {
|
10980 | if (error) {
|
10981 | _this.handleError(error);
|
10982 | } else {
|
10983 | _this.setState(state, _this.props.onUpdate);
|
10984 | }
|
10985 | });
|
10986 |
|
10987 | this.history = history;
|
10988 | this.router = router;
|
10989 | },
|
10990 |
|
10991 | createRouterObjects: function createRouterObjects() {
|
10992 | var matchContext = this.props.matchContext;
|
10993 |
|
10994 | if (matchContext) {
|
10995 | return matchContext;
|
10996 | }
|
10997 |
|
10998 | var history = this.props.history;
|
10999 | var _props2 = this.props;
|
11000 | var routes = _props2.routes;
|
11001 | var children = _props2.children;
|
11002 |
|
11003 | if (isDeprecatedHistory(history)) {
|
11004 | history = this.wrapDeprecatedHistory(history);
|
11005 | }
|
11006 |
|
11007 | var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes || children));
|
11008 | var router = _RouterUtils.createRouterObject(history, transitionManager);
|
11009 | var routingHistory = _RouterUtils.createRoutingHistory(history, transitionManager);
|
11010 |
|
11011 | return { history: routingHistory, transitionManager: transitionManager, router: router };
|
11012 | },
|
11013 |
|
11014 | wrapDeprecatedHistory: function wrapDeprecatedHistory(history) {
|
11015 | var _props3 = this.props;
|
11016 | var parseQueryString = _props3.parseQueryString;
|
11017 | var stringifyQuery = _props3.stringifyQuery;
|
11018 |
|
11019 | var createHistory = undefined;
|
11020 | if (history) {
|
11021 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'It appears you have provided a deprecated history object to `<Router/>`, please use a history provided by ' + 'React Router with `import { browserHistory } from \'react-router\'` or `import { hashHistory } from \'react-router\'`. ' + 'If you are using a custom history please create it with `useRouterHistory`, see http://tiny.cc/router-usinghistory for details.') : undefined;
|
11022 | createHistory = function () {
|
11023 | return history;
|
11024 | };
|
11025 | } else {
|
11026 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`Router` no longer defaults the history prop to hash history. Please use the `hashHistory` singleton instead. http://tiny.cc/router-defaulthistory') : undefined;
|
11027 | createHistory = _historyLibCreateHashHistory2['default'];
|
11028 | }
|
11029 |
|
11030 | return _historyLibUseQueries2['default'](createHistory)({ parseQueryString: parseQueryString, stringifyQuery: stringifyQuery });
|
11031 | },
|
11032 |
|
11033 |
|
11034 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
|
11035 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](nextProps.history === this.props.history, 'You cannot change <Router history>; it will be ignored') : undefined;
|
11036 |
|
11037 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default']((nextProps.routes || nextProps.children) === (this.props.routes || this.props.children), 'You cannot change <Router routes>; it will be ignored') : undefined;
|
11038 | },
|
11039 |
|
11040 | componentWillUnmount: function componentWillUnmount() {
|
11041 | if (this._unlisten) this._unlisten();
|
11042 | },
|
11043 |
|
11044 | render: function render() {
|
11045 | var _state = this.state;
|
11046 | var location = _state.location;
|
11047 | var routes = _state.routes;
|
11048 | var params = _state.params;
|
11049 | var components = _state.components;
|
11050 | var _props4 = this.props;
|
11051 | var createElement = _props4.createElement;
|
11052 | var render = _props4.render;
|
11053 |
|
11054 | var props = _objectWithoutProperties(_props4, ['createElement', 'render']);
|
11055 |
|
11056 | if (location == null) return null;
|
11057 |
|
11058 |
|
11059 |
|
11060 | Object.keys(Router.propTypes).forEach(function (propType) {
|
11061 | return delete props[propType];
|
11062 | });
|
11063 |
|
11064 | return render(_extends({}, props, {
|
11065 | history: this.history,
|
11066 | router: this.router,
|
11067 | location: location,
|
11068 | routes: routes,
|
11069 | params: params,
|
11070 | components: components,
|
11071 | createElement: createElement
|
11072 | }));
|
11073 | }
|
11074 |
|
11075 | });
|
11076 |
|
11077 | exports['default'] = Router;
|
11078 | module.exports = exports['default'];
|
11079 | }).call(this,require(91))
|
11080 | },{"117":117,"121":121,"123":123,"124":124,"131":131,"140":140,"151":151,"158":158,"297":297,"91":91}],123:[function(require,module,exports){
|
11081 | (function (process){
|
11082 | 'use strict';
|
11083 |
|
11084 | exports.__esModule = true;
|
11085 |
|
11086 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
11087 |
|
11088 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11089 |
|
11090 | var _invariant = require(81);
|
11091 |
|
11092 | var _invariant2 = _interopRequireDefault(_invariant);
|
11093 |
|
11094 | var _react = require(297);
|
11095 |
|
11096 | var _react2 = _interopRequireDefault(_react);
|
11097 |
|
11098 | var _deprecateObjectProperties = require(132);
|
11099 |
|
11100 | var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties);
|
11101 |
|
11102 | var _getRouteParams = require(134);
|
11103 |
|
11104 | var _getRouteParams2 = _interopRequireDefault(_getRouteParams);
|
11105 |
|
11106 | var _RouteUtils = require(121);
|
11107 |
|
11108 | var _routerWarning = require(140);
|
11109 |
|
11110 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
11111 |
|
11112 | var _React$PropTypes = _react2['default'].PropTypes;
|
11113 | var array = _React$PropTypes.array;
|
11114 | var func = _React$PropTypes.func;
|
11115 | var object = _React$PropTypes.object;
|
11116 |
|
11117 |
|
11118 |
|
11119 |
|
11120 |
|
11121 | var RouterContext = _react2['default'].createClass({
|
11122 | displayName: 'RouterContext',
|
11123 |
|
11124 | propTypes: {
|
11125 | history: object,
|
11126 | router: object.isRequired,
|
11127 | location: object.isRequired,
|
11128 | routes: array.isRequired,
|
11129 | params: object.isRequired,
|
11130 | components: array.isRequired,
|
11131 | createElement: func.isRequired
|
11132 | },
|
11133 |
|
11134 | getDefaultProps: function getDefaultProps() {
|
11135 | return {
|
11136 | createElement: _react2['default'].createElement
|
11137 | };
|
11138 | },
|
11139 |
|
11140 | childContextTypes: {
|
11141 | history: object,
|
11142 | location: object.isRequired,
|
11143 | router: object.isRequired
|
11144 | },
|
11145 |
|
11146 | getChildContext: function getChildContext() {
|
11147 | var _props = this.props;
|
11148 | var router = _props.router;
|
11149 | var history = _props.history;
|
11150 | var location = _props.location;
|
11151 |
|
11152 | if (!router) {
|
11153 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`<RouterContext>` expects a `router` rather than a `history`') : undefined;
|
11154 |
|
11155 | router = _extends({}, history, {
|
11156 | setRouteLeaveHook: history.listenBeforeLeavingRoute
|
11157 | });
|
11158 | delete router.listenBeforeLeavingRoute;
|
11159 | }
|
11160 |
|
11161 | if (process.env.NODE_ENV !== 'production') {
|
11162 | location = _deprecateObjectProperties2['default'](location, '`context.location` is deprecated, please use a route component\'s `props.location` instead. http://tiny.cc/router-accessinglocation');
|
11163 | }
|
11164 |
|
11165 | return { history: history, location: location, router: router };
|
11166 | },
|
11167 |
|
11168 | createElement: function createElement(component, props) {
|
11169 | return component == null ? null : this.props.createElement(component, props);
|
11170 | },
|
11171 |
|
11172 | render: function render() {
|
11173 | var _this = this;
|
11174 |
|
11175 | var _props2 = this.props;
|
11176 | var history = _props2.history;
|
11177 | var location = _props2.location;
|
11178 | var routes = _props2.routes;
|
11179 | var params = _props2.params;
|
11180 | var components = _props2.components;
|
11181 |
|
11182 | var element = null;
|
11183 |
|
11184 | if (components) {
|
11185 | element = components.reduceRight(function (element, components, index) {
|
11186 | if (components == null) return element;
|
11187 |
|
11188 | var route = routes[index];
|
11189 | var routeParams = _getRouteParams2['default'](route, params);
|
11190 | var props = {
|
11191 | history: history,
|
11192 | location: location,
|
11193 | params: params,
|
11194 | route: route,
|
11195 | routeParams: routeParams,
|
11196 | routes: routes
|
11197 | };
|
11198 |
|
11199 | if (_RouteUtils.isReactChildren(element)) {
|
11200 | props.children = element;
|
11201 | } else if (element) {
|
11202 | for (var prop in element) {
|
11203 | if (element.hasOwnProperty(prop)) props[prop] = element[prop];
|
11204 | }
|
11205 | }
|
11206 |
|
11207 | if (typeof components === 'object') {
|
11208 | var elements = {};
|
11209 |
|
11210 | for (var key in components) {
|
11211 | if (components.hasOwnProperty(key)) {
|
11212 |
|
11213 |
|
11214 |
|
11215 | elements[key] = _this.createElement(components[key], _extends({
|
11216 | key: key }, props));
|
11217 | }
|
11218 | }
|
11219 |
|
11220 | return elements;
|
11221 | }
|
11222 |
|
11223 | return _this.createElement(components, props);
|
11224 | }, element);
|
11225 | }
|
11226 |
|
11227 | !(element === null || element === false || _react2['default'].isValidElement(element)) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The root route must render a single element') : _invariant2['default'](false) : undefined;
|
11228 |
|
11229 | return element;
|
11230 | }
|
11231 |
|
11232 | });
|
11233 |
|
11234 | exports['default'] = RouterContext;
|
11235 | module.exports = exports['default'];
|
11236 | }).call(this,require(91))
|
11237 | },{"121":121,"132":132,"134":134,"140":140,"297":297,"81":81,"91":91}],124:[function(require,module,exports){
|
11238 | (function (process){
|
11239 | 'use strict';
|
11240 |
|
11241 | exports.__esModule = true;
|
11242 |
|
11243 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
11244 |
|
11245 | exports.createRouterObject = createRouterObject;
|
11246 | exports.createRoutingHistory = createRoutingHistory;
|
11247 |
|
11248 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11249 |
|
11250 | var _deprecateObjectProperties = require(132);
|
11251 |
|
11252 | var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties);
|
11253 |
|
11254 | function createRouterObject(history, transitionManager) {
|
11255 | return _extends({}, history, {
|
11256 | setRouteLeaveHook: transitionManager.listenBeforeLeavingRoute,
|
11257 | isActive: transitionManager.isActive
|
11258 | });
|
11259 | }
|
11260 |
|
11261 |
|
11262 |
|
11263 | function createRoutingHistory(history, transitionManager) {
|
11264 | history = _extends({}, history, transitionManager);
|
11265 |
|
11266 | if (process.env.NODE_ENV !== 'production') {
|
11267 | history = _deprecateObjectProperties2['default'](history, '`props.history` and `context.history` are deprecated. Please use `context.router`. http://tiny.cc/router-contextchanges');
|
11268 | }
|
11269 |
|
11270 | return history;
|
11271 | }
|
11272 | }).call(this,require(91))
|
11273 | },{"132":132,"91":91}],125:[function(require,module,exports){
|
11274 | (function (process){
|
11275 | 'use strict';
|
11276 |
|
11277 | exports.__esModule = true;
|
11278 |
|
11279 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11280 |
|
11281 | var _react = require(297);
|
11282 |
|
11283 | var _react2 = _interopRequireDefault(_react);
|
11284 |
|
11285 | var _RouterContext = require(123);
|
11286 |
|
11287 | var _RouterContext2 = _interopRequireDefault(_RouterContext);
|
11288 |
|
11289 | var _routerWarning = require(140);
|
11290 |
|
11291 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
11292 |
|
11293 | var RoutingContext = _react2['default'].createClass({
|
11294 | displayName: 'RoutingContext',
|
11295 |
|
11296 | componentWillMount: function componentWillMount() {
|
11297 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`RoutingContext` has been renamed to `RouterContext`. Please use `import { RouterContext } from \'react-router\'`. http://tiny.cc/router-routercontext') : undefined;
|
11298 | },
|
11299 |
|
11300 | render: function render() {
|
11301 | return _react2['default'].createElement(_RouterContext2['default'], this.props);
|
11302 | }
|
11303 | });
|
11304 |
|
11305 | exports['default'] = RoutingContext;
|
11306 | module.exports = exports['default'];
|
11307 | }).call(this,require(91))
|
11308 | },{"123":123,"140":140,"297":297,"91":91}],126:[function(require,module,exports){
|
11309 | (function (process){
|
11310 | 'use strict';
|
11311 |
|
11312 | exports.__esModule = true;
|
11313 | exports.runEnterHooks = runEnterHooks;
|
11314 | exports.runLeaveHooks = runLeaveHooks;
|
11315 |
|
11316 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11317 |
|
11318 | var _AsyncUtils = require(109);
|
11319 |
|
11320 | var _routerWarning = require(140);
|
11321 |
|
11322 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
11323 |
|
11324 | function createEnterHook(hook, route) {
|
11325 | return function (a, b, callback) {
|
11326 | hook.apply(route, arguments);
|
11327 |
|
11328 | if (hook.length < 3) {
|
11329 |
|
11330 |
|
11331 | callback();
|
11332 | }
|
11333 | };
|
11334 | }
|
11335 |
|
11336 | function getEnterHooks(routes) {
|
11337 | return routes.reduce(function (hooks, route) {
|
11338 | if (route.onEnter) hooks.push(createEnterHook(route.onEnter, route));
|
11339 |
|
11340 | return hooks;
|
11341 | }, []);
|
11342 | }
|
11343 |
|
11344 |
|
11345 |
|
11346 |
|
11347 |
|
11348 |
|
11349 |
|
11350 |
|
11351 |
|
11352 |
|
11353 |
|
11354 |
|
11355 | function runEnterHooks(routes, nextState, callback) {
|
11356 | var hooks = getEnterHooks(routes);
|
11357 |
|
11358 | if (!hooks.length) {
|
11359 | callback();
|
11360 | return;
|
11361 | }
|
11362 |
|
11363 | var redirectInfo = undefined;
|
11364 | function replace(location, deprecatedPathname, deprecatedQuery) {
|
11365 | if (deprecatedPathname) {
|
11366 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;
|
11367 | redirectInfo = {
|
11368 | pathname: deprecatedPathname,
|
11369 | query: deprecatedQuery,
|
11370 | state: location
|
11371 | };
|
11372 |
|
11373 | return;
|
11374 | }
|
11375 |
|
11376 | redirectInfo = location;
|
11377 | }
|
11378 |
|
11379 | _AsyncUtils.loopAsync(hooks.length, function (index, next, done) {
|
11380 | hooks[index](nextState, replace, function (error) {
|
11381 | if (error || redirectInfo) {
|
11382 | done(error, redirectInfo);
|
11383 | } else {
|
11384 | next();
|
11385 | }
|
11386 | });
|
11387 | }, callback);
|
11388 | }
|
11389 |
|
11390 |
|
11391 |
|
11392 |
|
11393 |
|
11394 | function runLeaveHooks(routes) {
|
11395 | for (var i = 0, len = routes.length; i < len; ++i) {
|
11396 | if (routes[i].onLeave) routes[i].onLeave.call(routes[i]);
|
11397 | }
|
11398 | }
|
11399 | }).call(this,require(91))
|
11400 | },{"109":109,"140":140,"91":91}],127:[function(require,module,exports){
|
11401 | 'use strict';
|
11402 |
|
11403 | exports.__esModule = true;
|
11404 |
|
11405 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11406 |
|
11407 | var _historyLibCreateBrowserHistory = require(149);
|
11408 |
|
11409 | var _historyLibCreateBrowserHistory2 = _interopRequireDefault(_historyLibCreateBrowserHistory);
|
11410 |
|
11411 | var _createRouterHistory = require(130);
|
11412 |
|
11413 | var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory);
|
11414 |
|
11415 | exports['default'] = _createRouterHistory2['default'](_historyLibCreateBrowserHistory2['default']);
|
11416 | module.exports = exports['default'];
|
11417 | },{"130":130,"149":149}],128:[function(require,module,exports){
|
11418 | 'use strict';
|
11419 |
|
11420 | exports.__esModule = true;
|
11421 |
|
11422 | var _PatternUtils = require(116);
|
11423 |
|
11424 | function routeParamsChanged(route, prevState, nextState) {
|
11425 | if (!route.path) return false;
|
11426 |
|
11427 | var paramNames = _PatternUtils.getParamNames(route.path);
|
11428 |
|
11429 | return paramNames.some(function (paramName) {
|
11430 | return prevState.params[paramName] !== nextState.params[paramName];
|
11431 | });
|
11432 | }
|
11433 |
|
11434 |
|
11435 |
|
11436 |
|
11437 |
|
11438 |
|
11439 |
|
11440 |
|
11441 |
|
11442 |
|
11443 |
|
11444 | function computeChangedRoutes(prevState, nextState) {
|
11445 | var prevRoutes = prevState && prevState.routes;
|
11446 | var nextRoutes = nextState.routes;
|
11447 |
|
11448 | var leaveRoutes = undefined,
|
11449 | enterRoutes = undefined;
|
11450 | if (prevRoutes) {
|
11451 | leaveRoutes = prevRoutes.filter(function (route) {
|
11452 | return nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState);
|
11453 | });
|
11454 |
|
11455 |
|
11456 | leaveRoutes.reverse();
|
11457 |
|
11458 | enterRoutes = nextRoutes.filter(function (route) {
|
11459 | return prevRoutes.indexOf(route) === -1 || leaveRoutes.indexOf(route) !== -1;
|
11460 | });
|
11461 | } else {
|
11462 | leaveRoutes = [];
|
11463 | enterRoutes = nextRoutes;
|
11464 | }
|
11465 |
|
11466 | return {
|
11467 | leaveRoutes: leaveRoutes,
|
11468 | enterRoutes: enterRoutes
|
11469 | };
|
11470 | }
|
11471 |
|
11472 | exports['default'] = computeChangedRoutes;
|
11473 | module.exports = exports['default'];
|
11474 | },{"116":116}],129:[function(require,module,exports){
|
11475 | 'use strict';
|
11476 |
|
11477 | exports.__esModule = true;
|
11478 | exports['default'] = createMemoryHistory;
|
11479 |
|
11480 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11481 |
|
11482 | var _historyLibUseQueries = require(158);
|
11483 |
|
11484 | var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries);
|
11485 |
|
11486 | var _historyLibUseBasename = require(157);
|
11487 |
|
11488 | var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename);
|
11489 |
|
11490 | var _historyLibCreateMemoryHistory = require(154);
|
11491 |
|
11492 | var _historyLibCreateMemoryHistory2 = _interopRequireDefault(_historyLibCreateMemoryHistory);
|
11493 |
|
11494 | function createMemoryHistory(options) {
|
11495 |
|
11496 |
|
11497 |
|
11498 | var memoryHistory = _historyLibCreateMemoryHistory2['default'](options);
|
11499 | var createHistory = function createHistory() {
|
11500 | return memoryHistory;
|
11501 | };
|
11502 | var history = _historyLibUseQueries2['default'](_historyLibUseBasename2['default'](createHistory))(options);
|
11503 | history.__v2_compatible__ = true;
|
11504 | return history;
|
11505 | }
|
11506 |
|
11507 | module.exports = exports['default'];
|
11508 | },{"154":154,"157":157,"158":158}],130:[function(require,module,exports){
|
11509 | 'use strict';
|
11510 |
|
11511 | exports.__esModule = true;
|
11512 |
|
11513 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11514 |
|
11515 | var _useRouterHistory = require(141);
|
11516 |
|
11517 | var _useRouterHistory2 = _interopRequireDefault(_useRouterHistory);
|
11518 |
|
11519 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
11520 |
|
11521 | exports['default'] = function (createHistory) {
|
11522 | var history = undefined;
|
11523 | if (canUseDOM) history = _useRouterHistory2['default'](createHistory)();
|
11524 | return history;
|
11525 | };
|
11526 |
|
11527 | module.exports = exports['default'];
|
11528 | },{"141":141}],131:[function(require,module,exports){
|
11529 | (function (process){
|
11530 | 'use strict';
|
11531 |
|
11532 | exports.__esModule = true;
|
11533 |
|
11534 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
11535 |
|
11536 | exports['default'] = createTransitionManager;
|
11537 |
|
11538 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11539 |
|
11540 | var _routerWarning = require(140);
|
11541 |
|
11542 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
11543 |
|
11544 | var _historyLibActions = require(143);
|
11545 |
|
11546 | var _computeChangedRoutes2 = require(128);
|
11547 |
|
11548 | var _computeChangedRoutes3 = _interopRequireDefault(_computeChangedRoutes2);
|
11549 |
|
11550 | var _TransitionUtils = require(126);
|
11551 |
|
11552 | var _isActive2 = require(137);
|
11553 |
|
11554 | var _isActive3 = _interopRequireDefault(_isActive2);
|
11555 |
|
11556 | var _getComponents = require(133);
|
11557 |
|
11558 | var _getComponents2 = _interopRequireDefault(_getComponents);
|
11559 |
|
11560 | var _matchRoutes = require(139);
|
11561 |
|
11562 | var _matchRoutes2 = _interopRequireDefault(_matchRoutes);
|
11563 |
|
11564 | function hasAnyProperties(object) {
|
11565 | for (var p in object) {
|
11566 | if (object.hasOwnProperty(p)) return true;
|
11567 | }return false;
|
11568 | }
|
11569 |
|
11570 | function createTransitionManager(history, routes) {
|
11571 | var state = {};
|
11572 |
|
11573 |
|
11574 |
|
11575 | function isActive(location) {
|
11576 | var indexOnlyOrDeprecatedQuery = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
|
11577 | var deprecatedIndexOnly = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
|
11578 |
|
11579 | var indexOnly = undefined;
|
11580 | if (indexOnlyOrDeprecatedQuery && indexOnlyOrDeprecatedQuery !== true || deprecatedIndexOnly !== null) {
|
11581 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`isActive(pathname, query, indexOnly) is deprecated; use `isActive(location, indexOnly)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined;
|
11582 | location = { pathname: location, query: indexOnlyOrDeprecatedQuery };
|
11583 | indexOnly = deprecatedIndexOnly || false;
|
11584 | } else {
|
11585 | location = history.createLocation(location);
|
11586 | indexOnly = indexOnlyOrDeprecatedQuery;
|
11587 | }
|
11588 |
|
11589 | return _isActive3['default'](location, indexOnly, state.location, state.routes, state.params);
|
11590 | }
|
11591 |
|
11592 | function createLocationFromRedirectInfo(location) {
|
11593 | return history.createLocation(location, _historyLibActions.REPLACE);
|
11594 | }
|
11595 |
|
11596 | var partialNextState = undefined;
|
11597 |
|
11598 | function match(location, callback) {
|
11599 | if (partialNextState && partialNextState.location === location) {
|
11600 |
|
11601 | finishMatch(partialNextState, callback);
|
11602 | } else {
|
11603 | _matchRoutes2['default'](routes, location, function (error, nextState) {
|
11604 | if (error) {
|
11605 | callback(error);
|
11606 | } else if (nextState) {
|
11607 | finishMatch(_extends({}, nextState, { location: location }), callback);
|
11608 | } else {
|
11609 | callback();
|
11610 | }
|
11611 | });
|
11612 | }
|
11613 | }
|
11614 |
|
11615 | function finishMatch(nextState, callback) {
|
11616 | var _computeChangedRoutes = _computeChangedRoutes3['default'](state, nextState);
|
11617 |
|
11618 | var leaveRoutes = _computeChangedRoutes.leaveRoutes;
|
11619 | var enterRoutes = _computeChangedRoutes.enterRoutes;
|
11620 |
|
11621 | _TransitionUtils.runLeaveHooks(leaveRoutes);
|
11622 |
|
11623 |
|
11624 | leaveRoutes.forEach(removeListenBeforeHooksForRoute);
|
11625 |
|
11626 | _TransitionUtils.runEnterHooks(enterRoutes, nextState, function (error, redirectInfo) {
|
11627 | if (error) {
|
11628 | callback(error);
|
11629 | } else if (redirectInfo) {
|
11630 | callback(null, createLocationFromRedirectInfo(redirectInfo));
|
11631 | } else {
|
11632 |
|
11633 | _getComponents2['default'](nextState, function (error, components) {
|
11634 | if (error) {
|
11635 | callback(error);
|
11636 | } else {
|
11637 |
|
11638 |
|
11639 | callback(null, null, state = _extends({}, nextState, { components: components }));
|
11640 | }
|
11641 | });
|
11642 | }
|
11643 | });
|
11644 | }
|
11645 |
|
11646 | var RouteGuid = 1;
|
11647 |
|
11648 | function getRouteID(route) {
|
11649 | var create = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
|
11650 |
|
11651 | return route.__id__ || create && (route.__id__ = RouteGuid++);
|
11652 | }
|
11653 |
|
11654 | var RouteHooks = {};
|
11655 |
|
11656 | function getRouteHooksForRoutes(routes) {
|
11657 | return routes.reduce(function (hooks, route) {
|
11658 | hooks.push.apply(hooks, RouteHooks[getRouteID(route)]);
|
11659 | return hooks;
|
11660 | }, []);
|
11661 | }
|
11662 |
|
11663 | function transitionHook(location, callback) {
|
11664 | _matchRoutes2['default'](routes, location, function (error, nextState) {
|
11665 | if (nextState == null) {
|
11666 |
|
11667 |
|
11668 |
|
11669 | callback();
|
11670 | return;
|
11671 | }
|
11672 |
|
11673 |
|
11674 |
|
11675 | partialNextState = _extends({}, nextState, { location: location });
|
11676 |
|
11677 | var hooks = getRouteHooksForRoutes(_computeChangedRoutes3['default'](state, partialNextState).leaveRoutes);
|
11678 |
|
11679 | var result = undefined;
|
11680 | for (var i = 0, len = hooks.length; result == null && i < len; ++i) {
|
11681 |
|
11682 |
|
11683 | result = hooks[i](location);
|
11684 | }
|
11685 |
|
11686 | callback(result);
|
11687 | });
|
11688 | }
|
11689 |
|
11690 |
|
11691 | function beforeUnloadHook() {
|
11692 |
|
11693 |
|
11694 | if (state.routes) {
|
11695 | var hooks = getRouteHooksForRoutes(state.routes);
|
11696 |
|
11697 | var message = undefined;
|
11698 | for (var i = 0, len = hooks.length; typeof message !== 'string' && i < len; ++i) {
|
11699 |
|
11700 |
|
11701 | message = hooks[i]();
|
11702 | }
|
11703 |
|
11704 | return message;
|
11705 | }
|
11706 | }
|
11707 |
|
11708 | var unlistenBefore = undefined,
|
11709 | unlistenBeforeUnload = undefined;
|
11710 |
|
11711 | function removeListenBeforeHooksForRoute(route) {
|
11712 | var routeID = getRouteID(route, false);
|
11713 | if (!routeID) {
|
11714 | return;
|
11715 | }
|
11716 |
|
11717 | delete RouteHooks[routeID];
|
11718 |
|
11719 | if (!hasAnyProperties(RouteHooks)) {
|
11720 |
|
11721 | if (unlistenBefore) {
|
11722 | unlistenBefore();
|
11723 | unlistenBefore = null;
|
11724 | }
|
11725 |
|
11726 | if (unlistenBeforeUnload) {
|
11727 | unlistenBeforeUnload();
|
11728 | unlistenBeforeUnload = null;
|
11729 | }
|
11730 | }
|
11731 | }
|
11732 |
|
11733 | |
11734 |
|
11735 |
|
11736 |
|
11737 |
|
11738 |
|
11739 |
|
11740 |
|
11741 |
|
11742 |
|
11743 |
|
11744 |
|
11745 |
|
11746 | function listenBeforeLeavingRoute(route, hook) {
|
11747 |
|
11748 |
|
11749 |
|
11750 | var routeID = getRouteID(route);
|
11751 | var hooks = RouteHooks[routeID];
|
11752 |
|
11753 | if (!hooks) {
|
11754 | var thereWereNoRouteHooks = !hasAnyProperties(RouteHooks);
|
11755 |
|
11756 | RouteHooks[routeID] = [hook];
|
11757 |
|
11758 | if (thereWereNoRouteHooks) {
|
11759 |
|
11760 | unlistenBefore = history.listenBefore(transitionHook);
|
11761 |
|
11762 | if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook);
|
11763 | }
|
11764 | } else {
|
11765 | if (hooks.indexOf(hook) === -1) {
|
11766 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'adding multiple leave hooks for the same route is deprecated; manage multiple confirmations in your own code instead') : undefined;
|
11767 |
|
11768 | hooks.push(hook);
|
11769 | }
|
11770 | }
|
11771 |
|
11772 | return function () {
|
11773 | var hooks = RouteHooks[routeID];
|
11774 |
|
11775 | if (hooks) {
|
11776 | var newHooks = hooks.filter(function (item) {
|
11777 | return item !== hook;
|
11778 | });
|
11779 |
|
11780 | if (newHooks.length === 0) {
|
11781 | removeListenBeforeHooksForRoute(route);
|
11782 | } else {
|
11783 | RouteHooks[routeID] = newHooks;
|
11784 | }
|
11785 | }
|
11786 | };
|
11787 | }
|
11788 |
|
11789 | |
11790 |
|
11791 |
|
11792 |
|
11793 |
|
11794 | function listen(listener) {
|
11795 |
|
11796 |
|
11797 | return history.listen(function (location) {
|
11798 | if (state.location === location) {
|
11799 | listener(null, state);
|
11800 | } else {
|
11801 | match(location, function (error, redirectLocation, nextState) {
|
11802 | if (error) {
|
11803 | listener(error);
|
11804 | } else if (redirectLocation) {
|
11805 | history.transitionTo(redirectLocation);
|
11806 | } else if (nextState) {
|
11807 | listener(null, nextState);
|
11808 | } else {
|
11809 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'Location "%s" did not match any routes', location.pathname + location.search + location.hash) : undefined;
|
11810 | }
|
11811 | });
|
11812 | }
|
11813 | });
|
11814 | }
|
11815 |
|
11816 | return {
|
11817 | isActive: isActive,
|
11818 | match: match,
|
11819 | listenBeforeLeavingRoute: listenBeforeLeavingRoute,
|
11820 | listen: listen
|
11821 | };
|
11822 | }
|
11823 |
|
11824 |
|
11825 | module.exports = exports['default'];
|
11826 | }).call(this,require(91))
|
11827 | },{"126":126,"128":128,"133":133,"137":137,"139":139,"140":140,"143":143,"91":91}],132:[function(require,module,exports){
|
11828 | (function (process){
|
11829 |
|
11830 | 'use strict';
|
11831 |
|
11832 | exports.__esModule = true;
|
11833 | exports['default'] = deprecateObjectProperties;
|
11834 |
|
11835 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11836 |
|
11837 | var _routerWarning = require(140);
|
11838 |
|
11839 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
11840 |
|
11841 | var useMembrane = false;
|
11842 |
|
11843 | if (process.env.NODE_ENV !== 'production') {
|
11844 | try {
|
11845 | if (Object.defineProperty({}, 'x', { get: function get() {
|
11846 | return true;
|
11847 | } }).x) {
|
11848 | useMembrane = true;
|
11849 | }
|
11850 | } catch (e) {}
|
11851 | }
|
11852 |
|
11853 |
|
11854 |
|
11855 | function deprecateObjectProperties(object, message) {
|
11856 | if (!useMembrane) return object;
|
11857 |
|
11858 | var membrane = {};
|
11859 |
|
11860 | var _loop = function (prop) {
|
11861 | if (typeof object[prop] === 'function') {
|
11862 | membrane[prop] = function () {
|
11863 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, message) : undefined;
|
11864 | return object[prop].apply(object, arguments);
|
11865 | };
|
11866 | } else {
|
11867 | Object.defineProperty(membrane, prop, {
|
11868 | configurable: false,
|
11869 | enumerable: false,
|
11870 | get: function get() {
|
11871 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, message) : undefined;
|
11872 | return object[prop];
|
11873 | }
|
11874 | });
|
11875 | }
|
11876 | };
|
11877 |
|
11878 | for (var prop in object) {
|
11879 | _loop(prop);
|
11880 | }
|
11881 |
|
11882 | return membrane;
|
11883 | }
|
11884 |
|
11885 | module.exports = exports['default'];
|
11886 | }).call(this,require(91))
|
11887 | },{"140":140,"91":91}],133:[function(require,module,exports){
|
11888 | 'use strict';
|
11889 |
|
11890 | exports.__esModule = true;
|
11891 |
|
11892 | var _AsyncUtils = require(109);
|
11893 |
|
11894 | function getComponentsForRoute(location, route, callback) {
|
11895 | if (route.component || route.components) {
|
11896 | callback(null, route.component || route.components);
|
11897 | } else if (route.getComponent) {
|
11898 | route.getComponent(location, callback);
|
11899 | } else if (route.getComponents) {
|
11900 | route.getComponents(location, callback);
|
11901 | } else {
|
11902 | callback();
|
11903 | }
|
11904 | }
|
11905 |
|
11906 |
|
11907 |
|
11908 |
|
11909 |
|
11910 |
|
11911 |
|
11912 |
|
11913 | function getComponents(nextState, callback) {
|
11914 | _AsyncUtils.mapAsync(nextState.routes, function (route, index, callback) {
|
11915 | getComponentsForRoute(nextState.location, route, callback);
|
11916 | }, callback);
|
11917 | }
|
11918 |
|
11919 | exports['default'] = getComponents;
|
11920 | module.exports = exports['default'];
|
11921 | },{"109":109}],134:[function(require,module,exports){
|
11922 | 'use strict';
|
11923 |
|
11924 | exports.__esModule = true;
|
11925 |
|
11926 | var _PatternUtils = require(116);
|
11927 |
|
11928 |
|
11929 |
|
11930 |
|
11931 |
|
11932 | function getRouteParams(route, params) {
|
11933 | var routeParams = {};
|
11934 |
|
11935 | if (!route.path) return routeParams;
|
11936 |
|
11937 | var paramNames = _PatternUtils.getParamNames(route.path);
|
11938 |
|
11939 | for (var p in params) {
|
11940 | if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];
|
11941 | }return routeParams;
|
11942 | }
|
11943 |
|
11944 | exports['default'] = getRouteParams;
|
11945 | module.exports = exports['default'];
|
11946 | },{"116":116}],135:[function(require,module,exports){
|
11947 | 'use strict';
|
11948 |
|
11949 | exports.__esModule = true;
|
11950 |
|
11951 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11952 |
|
11953 | var _historyLibCreateHashHistory = require(151);
|
11954 |
|
11955 | var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory);
|
11956 |
|
11957 | var _createRouterHistory = require(130);
|
11958 |
|
11959 | var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory);
|
11960 |
|
11961 | exports['default'] = _createRouterHistory2['default'](_historyLibCreateHashHistory2['default']);
|
11962 | module.exports = exports['default'];
|
11963 | },{"130":130,"151":151}],136:[function(require,module,exports){
|
11964 |
|
11965 | 'use strict';
|
11966 |
|
11967 | exports.__esModule = true;
|
11968 |
|
11969 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
11970 |
|
11971 | var _Router2 = require(122);
|
11972 |
|
11973 | var _Router3 = _interopRequireDefault(_Router2);
|
11974 |
|
11975 | exports.Router = _Router3['default'];
|
11976 |
|
11977 | var _Link2 = require(115);
|
11978 |
|
11979 | var _Link3 = _interopRequireDefault(_Link2);
|
11980 |
|
11981 | exports.Link = _Link3['default'];
|
11982 |
|
11983 | var _IndexLink2 = require(111);
|
11984 |
|
11985 | var _IndexLink3 = _interopRequireDefault(_IndexLink2);
|
11986 |
|
11987 | exports.IndexLink = _IndexLink3['default'];
|
11988 |
|
11989 |
|
11990 |
|
11991 | var _IndexRedirect2 = require(112);
|
11992 |
|
11993 | var _IndexRedirect3 = _interopRequireDefault(_IndexRedirect2);
|
11994 |
|
11995 | exports.IndexRedirect = _IndexRedirect3['default'];
|
11996 |
|
11997 | var _IndexRoute2 = require(113);
|
11998 |
|
11999 | var _IndexRoute3 = _interopRequireDefault(_IndexRoute2);
|
12000 |
|
12001 | exports.IndexRoute = _IndexRoute3['default'];
|
12002 |
|
12003 | var _Redirect2 = require(118);
|
12004 |
|
12005 | var _Redirect3 = _interopRequireDefault(_Redirect2);
|
12006 |
|
12007 | exports.Redirect = _Redirect3['default'];
|
12008 |
|
12009 | var _Route2 = require(119);
|
12010 |
|
12011 | var _Route3 = _interopRequireDefault(_Route2);
|
12012 |
|
12013 | exports.Route = _Route3['default'];
|
12014 |
|
12015 |
|
12016 |
|
12017 | var _History2 = require(110);
|
12018 |
|
12019 | var _History3 = _interopRequireDefault(_History2);
|
12020 |
|
12021 | exports.History = _History3['default'];
|
12022 |
|
12023 | var _Lifecycle2 = require(114);
|
12024 |
|
12025 | var _Lifecycle3 = _interopRequireDefault(_Lifecycle2);
|
12026 |
|
12027 | exports.Lifecycle = _Lifecycle3['default'];
|
12028 |
|
12029 | var _RouteContext2 = require(120);
|
12030 |
|
12031 | var _RouteContext3 = _interopRequireDefault(_RouteContext2);
|
12032 |
|
12033 | exports.RouteContext = _RouteContext3['default'];
|
12034 |
|
12035 |
|
12036 |
|
12037 | var _useRoutes2 = require(142);
|
12038 |
|
12039 | var _useRoutes3 = _interopRequireDefault(_useRoutes2);
|
12040 |
|
12041 | exports.useRoutes = _useRoutes3['default'];
|
12042 |
|
12043 | var _RouteUtils = require(121);
|
12044 |
|
12045 | exports.createRoutes = _RouteUtils.createRoutes;
|
12046 |
|
12047 | var _RouterContext2 = require(123);
|
12048 |
|
12049 | var _RouterContext3 = _interopRequireDefault(_RouterContext2);
|
12050 |
|
12051 | exports.RouterContext = _RouterContext3['default'];
|
12052 |
|
12053 | var _RoutingContext2 = require(125);
|
12054 |
|
12055 | var _RoutingContext3 = _interopRequireDefault(_RoutingContext2);
|
12056 |
|
12057 | exports.RoutingContext = _RoutingContext3['default'];
|
12058 |
|
12059 | var _PropTypes2 = require(117);
|
12060 |
|
12061 | var _PropTypes3 = _interopRequireDefault(_PropTypes2);
|
12062 |
|
12063 | exports.PropTypes = _PropTypes3['default'];
|
12064 |
|
12065 | var _match2 = require(138);
|
12066 |
|
12067 | var _match3 = _interopRequireDefault(_match2);
|
12068 |
|
12069 | exports.match = _match3['default'];
|
12070 |
|
12071 | var _useRouterHistory2 = require(141);
|
12072 |
|
12073 | var _useRouterHistory3 = _interopRequireDefault(_useRouterHistory2);
|
12074 |
|
12075 | exports.useRouterHistory = _useRouterHistory3['default'];
|
12076 |
|
12077 | var _PatternUtils = require(116);
|
12078 |
|
12079 | exports.formatPattern = _PatternUtils.formatPattern;
|
12080 |
|
12081 |
|
12082 |
|
12083 | var _browserHistory2 = require(127);
|
12084 |
|
12085 | var _browserHistory3 = _interopRequireDefault(_browserHistory2);
|
12086 |
|
12087 | exports.browserHistory = _browserHistory3['default'];
|
12088 |
|
12089 | var _hashHistory2 = require(135);
|
12090 |
|
12091 | var _hashHistory3 = _interopRequireDefault(_hashHistory2);
|
12092 |
|
12093 | exports.hashHistory = _hashHistory3['default'];
|
12094 |
|
12095 | var _createMemoryHistory2 = require(129);
|
12096 |
|
12097 | var _createMemoryHistory3 = _interopRequireDefault(_createMemoryHistory2);
|
12098 |
|
12099 | exports.createMemoryHistory = _createMemoryHistory3['default'];
|
12100 | },{"110":110,"111":111,"112":112,"113":113,"114":114,"115":115,"116":116,"117":117,"118":118,"119":119,"120":120,"121":121,"122":122,"123":123,"125":125,"127":127,"129":129,"135":135,"138":138,"141":141,"142":142}],137:[function(require,module,exports){
|
12101 | 'use strict';
|
12102 |
|
12103 | exports.__esModule = true;
|
12104 | exports['default'] = isActive;
|
12105 |
|
12106 | var _PatternUtils = require(116);
|
12107 |
|
12108 | function deepEqual(a, b) {
|
12109 | if (a == b) return true;
|
12110 |
|
12111 | if (a == null || b == null) return false;
|
12112 |
|
12113 | if (Array.isArray(a)) {
|
12114 | return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
|
12115 | return deepEqual(item, b[index]);
|
12116 | });
|
12117 | }
|
12118 |
|
12119 | if (typeof a === 'object') {
|
12120 | for (var p in a) {
|
12121 | if (!a.hasOwnProperty(p)) {
|
12122 | continue;
|
12123 | }
|
12124 |
|
12125 | if (a[p] === undefined) {
|
12126 | if (b[p] !== undefined) {
|
12127 | return false;
|
12128 | }
|
12129 | } else if (!b.hasOwnProperty(p)) {
|
12130 | return false;
|
12131 | } else if (!deepEqual(a[p], b[p])) {
|
12132 | return false;
|
12133 | }
|
12134 | }
|
12135 |
|
12136 | return true;
|
12137 | }
|
12138 |
|
12139 | return String(a) === String(b);
|
12140 | }
|
12141 |
|
12142 | function paramsAreActive(paramNames, paramValues, activeParams) {
|
12143 |
|
12144 | return paramNames.every(function (paramName, index) {
|
12145 | return String(paramValues[index]) === String(activeParams[paramName]);
|
12146 | });
|
12147 | }
|
12148 |
|
12149 | function getMatchingRouteIndex(pathname, activeRoutes, activeParams) {
|
12150 | var remainingPathname = pathname,
|
12151 | paramNames = [],
|
12152 | paramValues = [];
|
12153 |
|
12154 | for (var i = 0, len = activeRoutes.length; i < len; ++i) {
|
12155 | var route = activeRoutes[i];
|
12156 | var pattern = route.path || '';
|
12157 |
|
12158 | if (pattern.charAt(0) === '/') {
|
12159 | remainingPathname = pathname;
|
12160 | paramNames = [];
|
12161 | paramValues = [];
|
12162 | }
|
12163 |
|
12164 | if (remainingPathname !== null) {
|
12165 | var matched = _PatternUtils.matchPattern(pattern, remainingPathname);
|
12166 | remainingPathname = matched.remainingPathname;
|
12167 | paramNames = [].concat(paramNames, matched.paramNames);
|
12168 | paramValues = [].concat(paramValues, matched.paramValues);
|
12169 | }
|
12170 |
|
12171 | if (remainingPathname === '' && route.path && paramsAreActive(paramNames, paramValues, activeParams)) return i;
|
12172 | }
|
12173 |
|
12174 | return null;
|
12175 | }
|
12176 |
|
12177 |
|
12178 |
|
12179 |
|
12180 |
|
12181 | function routeIsActive(pathname, routes, params, indexOnly) {
|
12182 | var i = getMatchingRouteIndex(pathname, routes, params);
|
12183 |
|
12184 | if (i === null) {
|
12185 |
|
12186 | return false;
|
12187 | } else if (!indexOnly) {
|
12188 |
|
12189 | return true;
|
12190 | }
|
12191 |
|
12192 |
|
12193 |
|
12194 | return routes.slice(i + 1).every(function (route) {
|
12195 | return !route.path;
|
12196 | });
|
12197 | }
|
12198 |
|
12199 |
|
12200 |
|
12201 |
|
12202 |
|
12203 | function queryIsActive(query, activeQuery) {
|
12204 | if (activeQuery == null) return query == null;
|
12205 |
|
12206 | if (query == null) return true;
|
12207 |
|
12208 | return deepEqual(query, activeQuery);
|
12209 | }
|
12210 |
|
12211 |
|
12212 |
|
12213 |
|
12214 |
|
12215 |
|
12216 | function isActive(_ref, indexOnly, currentLocation, routes, params) {
|
12217 | var pathname = _ref.pathname;
|
12218 | var query = _ref.query;
|
12219 |
|
12220 | if (currentLocation == null) return false;
|
12221 |
|
12222 | if (!routeIsActive(pathname, routes, params, indexOnly)) return false;
|
12223 |
|
12224 | return queryIsActive(query, currentLocation.query);
|
12225 | }
|
12226 |
|
12227 | module.exports = exports['default'];
|
12228 | },{"116":116}],138:[function(require,module,exports){
|
12229 | (function (process){
|
12230 | 'use strict';
|
12231 |
|
12232 | exports.__esModule = true;
|
12233 |
|
12234 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
12235 |
|
12236 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12237 |
|
12238 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
12239 |
|
12240 | var _invariant = require(81);
|
12241 |
|
12242 | var _invariant2 = _interopRequireDefault(_invariant);
|
12243 |
|
12244 | var _createMemoryHistory = require(129);
|
12245 |
|
12246 | var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory);
|
12247 |
|
12248 | var _createTransitionManager = require(131);
|
12249 |
|
12250 | var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
|
12251 |
|
12252 | var _RouteUtils = require(121);
|
12253 |
|
12254 | var _RouterUtils = require(124);
|
12255 |
|
12256 |
|
12257 |
|
12258 |
|
12259 |
|
12260 |
|
12261 |
|
12262 |
|
12263 |
|
12264 |
|
12265 | function match(_ref, callback) {
|
12266 | var history = _ref.history;
|
12267 | var routes = _ref.routes;
|
12268 | var location = _ref.location;
|
12269 |
|
12270 | var options = _objectWithoutProperties(_ref, ['history', 'routes', 'location']);
|
12271 |
|
12272 | !(history || location) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'match needs a history or a location') : _invariant2['default'](false) : undefined;
|
12273 |
|
12274 | history = history ? history : _createMemoryHistory2['default'](options);
|
12275 | var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes));
|
12276 |
|
12277 | var unlisten = undefined;
|
12278 |
|
12279 | if (location) {
|
12280 |
|
12281 | location = history.createLocation(location);
|
12282 | } else {
|
12283 |
|
12284 |
|
12285 | unlisten = history.listen(function (historyLocation) {
|
12286 | location = historyLocation;
|
12287 | });
|
12288 | }
|
12289 |
|
12290 | var router = _RouterUtils.createRouterObject(history, transitionManager);
|
12291 | history = _RouterUtils.createRoutingHistory(history, transitionManager);
|
12292 |
|
12293 | transitionManager.match(location, function (error, redirectLocation, nextState) {
|
12294 | callback(error, redirectLocation, nextState && _extends({}, nextState, {
|
12295 | history: history,
|
12296 | router: router,
|
12297 | matchContext: { history: history, transitionManager: transitionManager, router: router }
|
12298 | }));
|
12299 |
|
12300 |
|
12301 |
|
12302 |
|
12303 | if (unlisten) {
|
12304 | unlisten();
|
12305 | }
|
12306 | });
|
12307 | }
|
12308 |
|
12309 | exports['default'] = match;
|
12310 | module.exports = exports['default'];
|
12311 | }).call(this,require(91))
|
12312 | },{"121":121,"124":124,"129":129,"131":131,"81":81,"91":91}],139:[function(require,module,exports){
|
12313 | (function (process){
|
12314 | 'use strict';
|
12315 |
|
12316 | exports.__esModule = true;
|
12317 |
|
12318 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12319 |
|
12320 | var _routerWarning = require(140);
|
12321 |
|
12322 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
12323 |
|
12324 | var _AsyncUtils = require(109);
|
12325 |
|
12326 | var _PatternUtils = require(116);
|
12327 |
|
12328 | var _RouteUtils = require(121);
|
12329 |
|
12330 | function getChildRoutes(route, location, callback) {
|
12331 | if (route.childRoutes) {
|
12332 | return [null, route.childRoutes];
|
12333 | }
|
12334 | if (!route.getChildRoutes) {
|
12335 | return [];
|
12336 | }
|
12337 |
|
12338 | var sync = true,
|
12339 | result = undefined;
|
12340 |
|
12341 | route.getChildRoutes(location, function (error, childRoutes) {
|
12342 | childRoutes = !error && _RouteUtils.createRoutes(childRoutes);
|
12343 | if (sync) {
|
12344 | result = [error, childRoutes];
|
12345 | return;
|
12346 | }
|
12347 |
|
12348 | callback(error, childRoutes);
|
12349 | });
|
12350 |
|
12351 | sync = false;
|
12352 | return result;
|
12353 | }
|
12354 |
|
12355 | function getIndexRoute(route, location, callback) {
|
12356 | if (route.indexRoute) {
|
12357 | callback(null, route.indexRoute);
|
12358 | } else if (route.getIndexRoute) {
|
12359 | route.getIndexRoute(location, function (error, indexRoute) {
|
12360 | callback(error, !error && _RouteUtils.createRoutes(indexRoute)[0]);
|
12361 | });
|
12362 | } else if (route.childRoutes) {
|
12363 | (function () {
|
12364 | var pathless = route.childRoutes.filter(function (obj) {
|
12365 | return !obj.hasOwnProperty('path');
|
12366 | });
|
12367 |
|
12368 | _AsyncUtils.loopAsync(pathless.length, function (index, next, done) {
|
12369 | getIndexRoute(pathless[index], location, function (error, indexRoute) {
|
12370 | if (error || indexRoute) {
|
12371 | var routes = [pathless[index]].concat(Array.isArray(indexRoute) ? indexRoute : [indexRoute]);
|
12372 | done(error, routes);
|
12373 | } else {
|
12374 | next();
|
12375 | }
|
12376 | });
|
12377 | }, function (err, routes) {
|
12378 | callback(null, routes);
|
12379 | });
|
12380 | })();
|
12381 | } else {
|
12382 | callback();
|
12383 | }
|
12384 | }
|
12385 |
|
12386 | function assignParams(params, paramNames, paramValues) {
|
12387 | return paramNames.reduce(function (params, paramName, index) {
|
12388 | var paramValue = paramValues && paramValues[index];
|
12389 |
|
12390 | if (Array.isArray(params[paramName])) {
|
12391 | params[paramName].push(paramValue);
|
12392 | } else if (paramName in params) {
|
12393 | params[paramName] = [params[paramName], paramValue];
|
12394 | } else {
|
12395 | params[paramName] = paramValue;
|
12396 | }
|
12397 |
|
12398 | return params;
|
12399 | }, params);
|
12400 | }
|
12401 |
|
12402 | function createParams(paramNames, paramValues) {
|
12403 | return assignParams({}, paramNames, paramValues);
|
12404 | }
|
12405 |
|
12406 | function matchRouteDeep(route, location, remainingPathname, paramNames, paramValues, callback) {
|
12407 | var pattern = route.path || '';
|
12408 |
|
12409 | if (pattern.charAt(0) === '/') {
|
12410 | remainingPathname = location.pathname;
|
12411 | paramNames = [];
|
12412 | paramValues = [];
|
12413 | }
|
12414 |
|
12415 | if (remainingPathname !== null) {
|
12416 | var matched = _PatternUtils.matchPattern(pattern, remainingPathname);
|
12417 | remainingPathname = matched.remainingPathname;
|
12418 | paramNames = [].concat(paramNames, matched.paramNames);
|
12419 | paramValues = [].concat(paramValues, matched.paramValues);
|
12420 |
|
12421 | if (remainingPathname === '' && route.path) {
|
12422 | var _ret2 = (function () {
|
12423 | var match = {
|
12424 | routes: [route],
|
12425 | params: createParams(paramNames, paramValues)
|
12426 | };
|
12427 |
|
12428 | getIndexRoute(route, location, function (error, indexRoute) {
|
12429 | if (error) {
|
12430 | callback(error);
|
12431 | } else {
|
12432 | if (Array.isArray(indexRoute)) {
|
12433 | var _match$routes;
|
12434 |
|
12435 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](indexRoute.every(function (route) {
|
12436 | return !route.path;
|
12437 | }), 'Index routes should not have paths') : undefined;
|
12438 | (_match$routes = match.routes).push.apply(_match$routes, indexRoute);
|
12439 | } else if (indexRoute) {
|
12440 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!indexRoute.path, 'Index routes should not have paths') : undefined;
|
12441 | match.routes.push(indexRoute);
|
12442 | }
|
12443 |
|
12444 | callback(null, match);
|
12445 | }
|
12446 | });
|
12447 | return {
|
12448 | v: undefined
|
12449 | };
|
12450 | })();
|
12451 |
|
12452 | if (typeof _ret2 === 'object') return _ret2.v;
|
12453 | }
|
12454 | }
|
12455 |
|
12456 | if (remainingPathname != null || route.childRoutes) {
|
12457 |
|
12458 |
|
12459 |
|
12460 | var onChildRoutes = function onChildRoutes(error, childRoutes) {
|
12461 | if (error) {
|
12462 | callback(error);
|
12463 | } else if (childRoutes) {
|
12464 |
|
12465 | matchRoutes(childRoutes, location, function (error, match) {
|
12466 | if (error) {
|
12467 | callback(error);
|
12468 | } else if (match) {
|
12469 |
|
12470 | match.routes.unshift(route);
|
12471 | callback(null, match);
|
12472 | } else {
|
12473 | callback();
|
12474 | }
|
12475 | }, remainingPathname, paramNames, paramValues);
|
12476 | } else {
|
12477 | callback();
|
12478 | }
|
12479 | };
|
12480 |
|
12481 | var result = getChildRoutes(route, location, onChildRoutes);
|
12482 | if (result) {
|
12483 | onChildRoutes.apply(undefined, result);
|
12484 | }
|
12485 | } else {
|
12486 | callback();
|
12487 | }
|
12488 | }
|
12489 |
|
12490 |
|
12491 |
|
12492 |
|
12493 |
|
12494 |
|
12495 |
|
12496 |
|
12497 |
|
12498 |
|
12499 |
|
12500 |
|
12501 | function matchRoutes(routes, location, callback) {
|
12502 | var remainingPathname = arguments.length <= 3 || arguments[3] === undefined ? location.pathname : arguments[3];
|
12503 | var paramNames = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4];
|
12504 | var paramValues = arguments.length <= 5 || arguments[5] === undefined ? [] : arguments[5];
|
12505 | return (function () {
|
12506 | _AsyncUtils.loopAsync(routes.length, function (index, next, done) {
|
12507 | matchRouteDeep(routes[index], location, remainingPathname, paramNames, paramValues, function (error, match) {
|
12508 | if (error || match) {
|
12509 | done(error, match);
|
12510 | } else {
|
12511 | next();
|
12512 | }
|
12513 | });
|
12514 | }, callback);
|
12515 | })();
|
12516 | }
|
12517 |
|
12518 | exports['default'] = matchRoutes;
|
12519 | module.exports = exports['default'];
|
12520 | }).call(this,require(91))
|
12521 | },{"109":109,"116":116,"121":121,"140":140,"91":91}],140:[function(require,module,exports){
|
12522 | (function (process){
|
12523 | 'use strict';
|
12524 |
|
12525 | exports.__esModule = true;
|
12526 | exports['default'] = routerWarning;
|
12527 |
|
12528 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12529 |
|
12530 | var _warning = require(337);
|
12531 |
|
12532 | var _warning2 = _interopRequireDefault(_warning);
|
12533 |
|
12534 | function routerWarning(falseToWarn, message) {
|
12535 | message = '[react-router] ' + message;
|
12536 |
|
12537 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
12538 | args[_key - 2] = arguments[_key];
|
12539 | }
|
12540 |
|
12541 | process.env.NODE_ENV !== 'production' ? _warning2['default'].apply(undefined, [falseToWarn, message].concat(args)) : undefined;
|
12542 | }
|
12543 |
|
12544 | module.exports = exports['default'];
|
12545 | }).call(this,require(91))
|
12546 | },{"337":337,"91":91}],141:[function(require,module,exports){
|
12547 | 'use strict';
|
12548 |
|
12549 | exports.__esModule = true;
|
12550 | exports['default'] = useRouterHistory;
|
12551 |
|
12552 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12553 |
|
12554 | var _historyLibUseQueries = require(158);
|
12555 |
|
12556 | var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries);
|
12557 |
|
12558 | var _historyLibUseBasename = require(157);
|
12559 |
|
12560 | var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename);
|
12561 |
|
12562 | function useRouterHistory(createHistory) {
|
12563 | return function (options) {
|
12564 | var history = _historyLibUseQueries2['default'](_historyLibUseBasename2['default'](createHistory))(options);
|
12565 | history.__v2_compatible__ = true;
|
12566 | return history;
|
12567 | };
|
12568 | }
|
12569 |
|
12570 | module.exports = exports['default'];
|
12571 | },{"157":157,"158":158}],142:[function(require,module,exports){
|
12572 | (function (process){
|
12573 | 'use strict';
|
12574 |
|
12575 | exports.__esModule = true;
|
12576 |
|
12577 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
12578 |
|
12579 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12580 |
|
12581 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
12582 |
|
12583 | var _historyLibUseQueries = require(158);
|
12584 |
|
12585 | var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries);
|
12586 |
|
12587 | var _createTransitionManager = require(131);
|
12588 |
|
12589 | var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
|
12590 |
|
12591 | var _routerWarning = require(140);
|
12592 |
|
12593 | var _routerWarning2 = _interopRequireDefault(_routerWarning);
|
12594 |
|
12595 |
|
12596 |
|
12597 |
|
12598 |
|
12599 |
|
12600 |
|
12601 |
|
12602 |
|
12603 |
|
12604 |
|
12605 |
|
12606 | function useRoutes(createHistory) {
|
12607 | process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`useRoutes` is deprecated. Please use `createTransitionManager` instead.') : undefined;
|
12608 |
|
12609 | return function () {
|
12610 | var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
12611 |
|
12612 | var routes = _ref.routes;
|
12613 |
|
12614 | var options = _objectWithoutProperties(_ref, ['routes']);
|
12615 |
|
12616 | var history = _historyLibUseQueries2['default'](createHistory)(options);
|
12617 | var transitionManager = _createTransitionManager2['default'](history, routes);
|
12618 | return _extends({}, history, transitionManager);
|
12619 | };
|
12620 | }
|
12621 |
|
12622 | exports['default'] = useRoutes;
|
12623 | module.exports = exports['default'];
|
12624 | }).call(this,require(91))
|
12625 | },{"131":131,"140":140,"158":158,"91":91}],143:[function(require,module,exports){
|
12626 |
|
12627 |
|
12628 |
|
12629 | 'use strict';
|
12630 |
|
12631 | exports.__esModule = true;
|
12632 | var PUSH = 'PUSH';
|
12633 |
|
12634 | exports.PUSH = PUSH;
|
12635 |
|
12636 |
|
12637 |
|
12638 | var REPLACE = 'REPLACE';
|
12639 |
|
12640 | exports.REPLACE = REPLACE;
|
12641 |
|
12642 |
|
12643 |
|
12644 |
|
12645 |
|
12646 |
|
12647 |
|
12648 |
|
12649 | var POP = 'POP';
|
12650 |
|
12651 | exports.POP = POP;
|
12652 | exports['default'] = {
|
12653 | PUSH: PUSH,
|
12654 | REPLACE: REPLACE,
|
12655 | POP: POP
|
12656 | };
|
12657 | },{}],144:[function(require,module,exports){
|
12658 | "use strict";
|
12659 |
|
12660 | exports.__esModule = true;
|
12661 | var _slice = Array.prototype.slice;
|
12662 | exports.loopAsync = loopAsync;
|
12663 |
|
12664 | function loopAsync(turns, work, callback) {
|
12665 | var currentTurn = 0,
|
12666 | isDone = false;
|
12667 | var sync = false,
|
12668 | hasNext = false,
|
12669 | doneArgs = undefined;
|
12670 |
|
12671 | function done() {
|
12672 | isDone = true;
|
12673 | if (sync) {
|
12674 |
|
12675 | doneArgs = [].concat(_slice.call(arguments));
|
12676 | return;
|
12677 | }
|
12678 |
|
12679 | callback.apply(this, arguments);
|
12680 | }
|
12681 |
|
12682 | function next() {
|
12683 | if (isDone) {
|
12684 | return;
|
12685 | }
|
12686 |
|
12687 | hasNext = true;
|
12688 | if (sync) {
|
12689 |
|
12690 | return;
|
12691 | }
|
12692 |
|
12693 | sync = true;
|
12694 |
|
12695 | while (!isDone && currentTurn < turns && hasNext) {
|
12696 | hasNext = false;
|
12697 | work.call(this, currentTurn++, next, done);
|
12698 | }
|
12699 |
|
12700 | sync = false;
|
12701 |
|
12702 | if (isDone) {
|
12703 |
|
12704 | callback.apply(this, doneArgs);
|
12705 | return;
|
12706 | }
|
12707 |
|
12708 | if (currentTurn >= turns && hasNext) {
|
12709 | isDone = true;
|
12710 | callback();
|
12711 | }
|
12712 | }
|
12713 |
|
12714 | next();
|
12715 | }
|
12716 | },{}],145:[function(require,module,exports){
|
12717 | (function (process){
|
12718 |
|
12719 | 'use strict';
|
12720 |
|
12721 | exports.__esModule = true;
|
12722 | exports.saveState = saveState;
|
12723 | exports.readState = readState;
|
12724 |
|
12725 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12726 |
|
12727 | var _warning = require(337);
|
12728 |
|
12729 | var _warning2 = _interopRequireDefault(_warning);
|
12730 |
|
12731 | var KeyPrefix = '@@History/';
|
12732 | var QuotaExceededErrors = ['QuotaExceededError', 'QUOTA_EXCEEDED_ERR'];
|
12733 |
|
12734 | var SecurityError = 'SecurityError';
|
12735 |
|
12736 | function createKey(key) {
|
12737 | return KeyPrefix + key;
|
12738 | }
|
12739 |
|
12740 | function saveState(key, state) {
|
12741 | try {
|
12742 | if (state == null) {
|
12743 | window.sessionStorage.removeItem(createKey(key));
|
12744 | } else {
|
12745 | window.sessionStorage.setItem(createKey(key), JSON.stringify(state));
|
12746 | }
|
12747 | } catch (error) {
|
12748 | if (error.name === SecurityError) {
|
12749 |
|
12750 |
|
12751 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available due to security settings') : undefined;
|
12752 |
|
12753 | return;
|
12754 | }
|
12755 |
|
12756 | if (QuotaExceededErrors.indexOf(error.name) >= 0 && window.sessionStorage.length === 0) {
|
12757 |
|
12758 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available in Safari private mode') : undefined;
|
12759 |
|
12760 | return;
|
12761 | }
|
12762 |
|
12763 | throw error;
|
12764 | }
|
12765 | }
|
12766 |
|
12767 | function readState(key) {
|
12768 | var json = undefined;
|
12769 | try {
|
12770 | json = window.sessionStorage.getItem(createKey(key));
|
12771 | } catch (error) {
|
12772 | if (error.name === SecurityError) {
|
12773 |
|
12774 |
|
12775 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to read state; sessionStorage is not available due to security settings') : undefined;
|
12776 |
|
12777 | return null;
|
12778 | }
|
12779 | }
|
12780 |
|
12781 | if (json) {
|
12782 | try {
|
12783 | return JSON.parse(json);
|
12784 | } catch (error) {
|
12785 |
|
12786 | }
|
12787 | }
|
12788 |
|
12789 | return null;
|
12790 | }
|
12791 | }).call(this,require(91))
|
12792 | },{"337":337,"91":91}],146:[function(require,module,exports){
|
12793 | 'use strict';
|
12794 |
|
12795 | exports.__esModule = true;
|
12796 | exports.addEventListener = addEventListener;
|
12797 | exports.removeEventListener = removeEventListener;
|
12798 | exports.getHashPath = getHashPath;
|
12799 | exports.replaceHashPath = replaceHashPath;
|
12800 | exports.getWindowPath = getWindowPath;
|
12801 | exports.go = go;
|
12802 | exports.getUserConfirmation = getUserConfirmation;
|
12803 | exports.supportsHistory = supportsHistory;
|
12804 | exports.supportsGoWithoutReloadUsingHash = supportsGoWithoutReloadUsingHash;
|
12805 |
|
12806 | function addEventListener(node, event, listener) {
|
12807 | if (node.addEventListener) {
|
12808 | node.addEventListener(event, listener, false);
|
12809 | } else {
|
12810 | node.attachEvent('on' + event, listener);
|
12811 | }
|
12812 | }
|
12813 |
|
12814 | function removeEventListener(node, event, listener) {
|
12815 | if (node.removeEventListener) {
|
12816 | node.removeEventListener(event, listener, false);
|
12817 | } else {
|
12818 | node.detachEvent('on' + event, listener);
|
12819 | }
|
12820 | }
|
12821 |
|
12822 | function getHashPath() {
|
12823 |
|
12824 |
|
12825 | return window.location.href.split('#')[1] || '';
|
12826 | }
|
12827 |
|
12828 | function replaceHashPath(path) {
|
12829 | window.location.replace(window.location.pathname + window.location.search + '#' + path);
|
12830 | }
|
12831 |
|
12832 | function getWindowPath() {
|
12833 | return window.location.pathname + window.location.search + window.location.hash;
|
12834 | }
|
12835 |
|
12836 | function go(n) {
|
12837 | if (n) window.history.go(n);
|
12838 | }
|
12839 |
|
12840 | function getUserConfirmation(message, callback) {
|
12841 | callback(window.confirm(message));
|
12842 | }
|
12843 |
|
12844 |
|
12845 |
|
12846 |
|
12847 |
|
12848 |
|
12849 |
|
12850 |
|
12851 |
|
12852 | function supportsHistory() {
|
12853 | var ua = navigator.userAgent;
|
12854 | if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {
|
12855 | return false;
|
12856 | }
|
12857 | return window.history && 'pushState' in window.history;
|
12858 | }
|
12859 |
|
12860 |
|
12861 |
|
12862 |
|
12863 |
|
12864 | function supportsGoWithoutReloadUsingHash() {
|
12865 | var ua = navigator.userAgent;
|
12866 | return ua.indexOf('Firefox') === -1;
|
12867 | }
|
12868 | },{}],147:[function(require,module,exports){
|
12869 | 'use strict';
|
12870 |
|
12871 | exports.__esModule = true;
|
12872 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
12873 | exports.canUseDOM = canUseDOM;
|
12874 | },{}],148:[function(require,module,exports){
|
12875 | (function (process){
|
12876 | 'use strict';
|
12877 |
|
12878 | exports.__esModule = true;
|
12879 | exports.extractPath = extractPath;
|
12880 | exports.parsePath = parsePath;
|
12881 |
|
12882 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12883 |
|
12884 | var _warning = require(337);
|
12885 |
|
12886 | var _warning2 = _interopRequireDefault(_warning);
|
12887 |
|
12888 | function extractPath(string) {
|
12889 | var match = string.match(/^https?:\/\/[^\/]*/);
|
12890 |
|
12891 | if (match == null) return string;
|
12892 |
|
12893 | return string.substring(match[0].length);
|
12894 | }
|
12895 |
|
12896 | function parsePath(path) {
|
12897 | var pathname = extractPath(path);
|
12898 | var search = '';
|
12899 | var hash = '';
|
12900 |
|
12901 | process.env.NODE_ENV !== 'production' ? _warning2['default'](path === pathname, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', path) : undefined;
|
12902 |
|
12903 | var hashIndex = pathname.indexOf('#');
|
12904 | if (hashIndex !== -1) {
|
12905 | hash = pathname.substring(hashIndex);
|
12906 | pathname = pathname.substring(0, hashIndex);
|
12907 | }
|
12908 |
|
12909 | var searchIndex = pathname.indexOf('?');
|
12910 | if (searchIndex !== -1) {
|
12911 | search = pathname.substring(searchIndex);
|
12912 | pathname = pathname.substring(0, searchIndex);
|
12913 | }
|
12914 |
|
12915 | if (pathname === '') pathname = '/';
|
12916 |
|
12917 | return {
|
12918 | pathname: pathname,
|
12919 | search: search,
|
12920 | hash: hash
|
12921 | };
|
12922 | }
|
12923 | }).call(this,require(91))
|
12924 | },{"337":337,"91":91}],149:[function(require,module,exports){
|
12925 | (function (process){
|
12926 | 'use strict';
|
12927 |
|
12928 | exports.__esModule = true;
|
12929 |
|
12930 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
12931 |
|
12932 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12933 |
|
12934 | var _invariant = require(81);
|
12935 |
|
12936 | var _invariant2 = _interopRequireDefault(_invariant);
|
12937 |
|
12938 | var _Actions = require(143);
|
12939 |
|
12940 | var _PathUtils = require(148);
|
12941 |
|
12942 | var _ExecutionEnvironment = require(147);
|
12943 |
|
12944 | var _DOMUtils = require(146);
|
12945 |
|
12946 | var _DOMStateStorage = require(145);
|
12947 |
|
12948 | var _createDOMHistory = require(150);
|
12949 |
|
12950 | var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory);
|
12951 |
|
12952 |
|
12953 |
|
12954 |
|
12955 |
|
12956 |
|
12957 |
|
12958 |
|
12959 |
|
12960 |
|
12961 | function createBrowserHistory() {
|
12962 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
12963 |
|
12964 | !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;
|
12965 |
|
12966 | var forceRefresh = options.forceRefresh;
|
12967 |
|
12968 | var isSupported = _DOMUtils.supportsHistory();
|
12969 | var useRefresh = !isSupported || forceRefresh;
|
12970 |
|
12971 | function getCurrentLocation(historyState) {
|
12972 | try {
|
12973 | historyState = historyState || window.history.state || {};
|
12974 | } catch (e) {
|
12975 | historyState = {};
|
12976 | }
|
12977 |
|
12978 | var path = _DOMUtils.getWindowPath();
|
12979 | var _historyState = historyState;
|
12980 | var key = _historyState.key;
|
12981 |
|
12982 | var state = undefined;
|
12983 | if (key) {
|
12984 | state = _DOMStateStorage.readState(key);
|
12985 | } else {
|
12986 | state = null;
|
12987 | key = history.createKey();
|
12988 |
|
12989 | if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);
|
12990 | }
|
12991 |
|
12992 | var location = _PathUtils.parsePath(path);
|
12993 |
|
12994 | return history.createLocation(_extends({}, location, { state: state }), undefined, key);
|
12995 | }
|
12996 |
|
12997 | function startPopStateListener(_ref) {
|
12998 | var transitionTo = _ref.transitionTo;
|
12999 |
|
13000 | function popStateListener(event) {
|
13001 | if (event.state === undefined) return;
|
13002 |
|
13003 | transitionTo(getCurrentLocation(event.state));
|
13004 | }
|
13005 |
|
13006 | _DOMUtils.addEventListener(window, 'popstate', popStateListener);
|
13007 |
|
13008 | return function () {
|
13009 | _DOMUtils.removeEventListener(window, 'popstate', popStateListener);
|
13010 | };
|
13011 | }
|
13012 |
|
13013 | function finishTransition(location) {
|
13014 | var basename = location.basename;
|
13015 | var pathname = location.pathname;
|
13016 | var search = location.search;
|
13017 | var hash = location.hash;
|
13018 | var state = location.state;
|
13019 | var action = location.action;
|
13020 | var key = location.key;
|
13021 |
|
13022 | if (action === _Actions.POP) return;
|
13023 |
|
13024 | _DOMStateStorage.saveState(key, state);
|
13025 |
|
13026 | var path = (basename || '') + pathname + search + hash;
|
13027 | var historyState = {
|
13028 | key: key
|
13029 | };
|
13030 |
|
13031 | if (action === _Actions.PUSH) {
|
13032 | if (useRefresh) {
|
13033 | window.location.href = path;
|
13034 | return false;
|
13035 | } else {
|
13036 | window.history.pushState(historyState, null, path);
|
13037 | }
|
13038 | } else {
|
13039 |
|
13040 | if (useRefresh) {
|
13041 | window.location.replace(path);
|
13042 | return false;
|
13043 | } else {
|
13044 | window.history.replaceState(historyState, null, path);
|
13045 | }
|
13046 | }
|
13047 | }
|
13048 |
|
13049 | var history = _createDOMHistory2['default'](_extends({}, options, {
|
13050 | getCurrentLocation: getCurrentLocation,
|
13051 | finishTransition: finishTransition,
|
13052 | saveState: _DOMStateStorage.saveState
|
13053 | }));
|
13054 |
|
13055 | var listenerCount = 0,
|
13056 | stopPopStateListener = undefined;
|
13057 |
|
13058 | function listenBefore(listener) {
|
13059 | if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);
|
13060 |
|
13061 | var unlisten = history.listenBefore(listener);
|
13062 |
|
13063 | return function () {
|
13064 | unlisten();
|
13065 |
|
13066 | if (--listenerCount === 0) stopPopStateListener();
|
13067 | };
|
13068 | }
|
13069 |
|
13070 | function listen(listener) {
|
13071 | if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);
|
13072 |
|
13073 | var unlisten = history.listen(listener);
|
13074 |
|
13075 | return function () {
|
13076 | unlisten();
|
13077 |
|
13078 | if (--listenerCount === 0) stopPopStateListener();
|
13079 | };
|
13080 | }
|
13081 |
|
13082 |
|
13083 | function registerTransitionHook(hook) {
|
13084 | if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);
|
13085 |
|
13086 | history.registerTransitionHook(hook);
|
13087 | }
|
13088 |
|
13089 |
|
13090 | function unregisterTransitionHook(hook) {
|
13091 | history.unregisterTransitionHook(hook);
|
13092 |
|
13093 | if (--listenerCount === 0) stopPopStateListener();
|
13094 | }
|
13095 |
|
13096 | return _extends({}, history, {
|
13097 | listenBefore: listenBefore,
|
13098 | listen: listen,
|
13099 | registerTransitionHook: registerTransitionHook,
|
13100 | unregisterTransitionHook: unregisterTransitionHook
|
13101 | });
|
13102 | }
|
13103 |
|
13104 | exports['default'] = createBrowserHistory;
|
13105 | module.exports = exports['default'];
|
13106 | }).call(this,require(91))
|
13107 | },{"143":143,"145":145,"146":146,"147":147,"148":148,"150":150,"81":81,"91":91}],150:[function(require,module,exports){
|
13108 | (function (process){
|
13109 | 'use strict';
|
13110 |
|
13111 | exports.__esModule = true;
|
13112 |
|
13113 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13114 |
|
13115 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13116 |
|
13117 | var _invariant = require(81);
|
13118 |
|
13119 | var _invariant2 = _interopRequireDefault(_invariant);
|
13120 |
|
13121 | var _ExecutionEnvironment = require(147);
|
13122 |
|
13123 | var _DOMUtils = require(146);
|
13124 |
|
13125 | var _createHistory = require(152);
|
13126 |
|
13127 | var _createHistory2 = _interopRequireDefault(_createHistory);
|
13128 |
|
13129 | function createDOMHistory(options) {
|
13130 | var history = _createHistory2['default'](_extends({
|
13131 | getUserConfirmation: _DOMUtils.getUserConfirmation
|
13132 | }, options, {
|
13133 | go: _DOMUtils.go
|
13134 | }));
|
13135 |
|
13136 | function listen(listener) {
|
13137 | !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'DOM history needs a DOM') : _invariant2['default'](false) : undefined;
|
13138 |
|
13139 | return history.listen(listener);
|
13140 | }
|
13141 |
|
13142 | return _extends({}, history, {
|
13143 | listen: listen
|
13144 | });
|
13145 | }
|
13146 |
|
13147 | exports['default'] = createDOMHistory;
|
13148 | module.exports = exports['default'];
|
13149 | }).call(this,require(91))
|
13150 | },{"146":146,"147":147,"152":152,"81":81,"91":91}],151:[function(require,module,exports){
|
13151 | (function (process){
|
13152 | 'use strict';
|
13153 |
|
13154 | exports.__esModule = true;
|
13155 |
|
13156 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13157 |
|
13158 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13159 |
|
13160 | var _warning = require(337);
|
13161 |
|
13162 | var _warning2 = _interopRequireDefault(_warning);
|
13163 |
|
13164 | var _invariant = require(81);
|
13165 |
|
13166 | var _invariant2 = _interopRequireDefault(_invariant);
|
13167 |
|
13168 | var _Actions = require(143);
|
13169 |
|
13170 | var _PathUtils = require(148);
|
13171 |
|
13172 | var _ExecutionEnvironment = require(147);
|
13173 |
|
13174 | var _DOMUtils = require(146);
|
13175 |
|
13176 | var _DOMStateStorage = require(145);
|
13177 |
|
13178 | var _createDOMHistory = require(150);
|
13179 |
|
13180 | var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory);
|
13181 |
|
13182 | function isAbsolutePath(path) {
|
13183 | return typeof path === 'string' && path.charAt(0) === '/';
|
13184 | }
|
13185 |
|
13186 | function ensureSlash() {
|
13187 | var path = _DOMUtils.getHashPath();
|
13188 |
|
13189 | if (isAbsolutePath(path)) return true;
|
13190 |
|
13191 | _DOMUtils.replaceHashPath('/' + path);
|
13192 |
|
13193 | return false;
|
13194 | }
|
13195 |
|
13196 | function addQueryStringValueToPath(path, key, value) {
|
13197 | return path + (path.indexOf('?') === -1 ? '?' : '&') + (key + '=' + value);
|
13198 | }
|
13199 |
|
13200 | function stripQueryStringValueFromPath(path, key) {
|
13201 | return path.replace(new RegExp('[?&]?' + key + '=[a-zA-Z0-9]+'), '');
|
13202 | }
|
13203 |
|
13204 | function getQueryStringValueFromPath(path, key) {
|
13205 | var match = path.match(new RegExp('\\?.*?\\b' + key + '=(.+?)\\b'));
|
13206 | return match && match[1];
|
13207 | }
|
13208 |
|
13209 | var DefaultQueryKey = '_k';
|
13210 |
|
13211 | function createHashHistory() {
|
13212 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
13213 |
|
13214 | !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Hash history needs a DOM') : _invariant2['default'](false) : undefined;
|
13215 |
|
13216 | var queryKey = options.queryKey;
|
13217 |
|
13218 | if (queryKey === undefined || !!queryKey) queryKey = typeof queryKey === 'string' ? queryKey : DefaultQueryKey;
|
13219 |
|
13220 | function getCurrentLocation() {
|
13221 | var path = _DOMUtils.getHashPath();
|
13222 |
|
13223 | var key = undefined,
|
13224 | state = undefined;
|
13225 | if (queryKey) {
|
13226 | key = getQueryStringValueFromPath(path, queryKey);
|
13227 | path = stripQueryStringValueFromPath(path, queryKey);
|
13228 |
|
13229 | if (key) {
|
13230 | state = _DOMStateStorage.readState(key);
|
13231 | } else {
|
13232 | state = null;
|
13233 | key = history.createKey();
|
13234 | _DOMUtils.replaceHashPath(addQueryStringValueToPath(path, queryKey, key));
|
13235 | }
|
13236 | } else {
|
13237 | key = state = null;
|
13238 | }
|
13239 |
|
13240 | var location = _PathUtils.parsePath(path);
|
13241 |
|
13242 | return history.createLocation(_extends({}, location, { state: state }), undefined, key);
|
13243 | }
|
13244 |
|
13245 | function startHashChangeListener(_ref) {
|
13246 | var transitionTo = _ref.transitionTo;
|
13247 |
|
13248 | function hashChangeListener() {
|
13249 | if (!ensureSlash()) return;
|
13250 |
|
13251 | transitionTo(getCurrentLocation());
|
13252 | }
|
13253 |
|
13254 | ensureSlash();
|
13255 | _DOMUtils.addEventListener(window, 'hashchange', hashChangeListener);
|
13256 |
|
13257 | return function () {
|
13258 | _DOMUtils.removeEventListener(window, 'hashchange', hashChangeListener);
|
13259 | };
|
13260 | }
|
13261 |
|
13262 | function finishTransition(location) {
|
13263 | var basename = location.basename;
|
13264 | var pathname = location.pathname;
|
13265 | var search = location.search;
|
13266 | var state = location.state;
|
13267 | var action = location.action;
|
13268 | var key = location.key;
|
13269 |
|
13270 | if (action === _Actions.POP) return;
|
13271 |
|
13272 | var path = (basename || '') + pathname + search;
|
13273 |
|
13274 | if (queryKey) {
|
13275 | path = addQueryStringValueToPath(path, queryKey, key);
|
13276 | _DOMStateStorage.saveState(key, state);
|
13277 | } else {
|
13278 |
|
13279 | location.key = location.state = null;
|
13280 | }
|
13281 |
|
13282 | var currentHash = _DOMUtils.getHashPath();
|
13283 |
|
13284 | if (action === _Actions.PUSH) {
|
13285 | if (currentHash !== path) {
|
13286 | window.location.hash = path;
|
13287 | } else {
|
13288 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'You cannot PUSH the same path using hash history') : undefined;
|
13289 | }
|
13290 | } else if (currentHash !== path) {
|
13291 |
|
13292 | _DOMUtils.replaceHashPath(path);
|
13293 | }
|
13294 | }
|
13295 |
|
13296 | var history = _createDOMHistory2['default'](_extends({}, options, {
|
13297 | getCurrentLocation: getCurrentLocation,
|
13298 | finishTransition: finishTransition,
|
13299 | saveState: _DOMStateStorage.saveState
|
13300 | }));
|
13301 |
|
13302 | var listenerCount = 0,
|
13303 | stopHashChangeListener = undefined;
|
13304 |
|
13305 | function listenBefore(listener) {
|
13306 | if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history);
|
13307 |
|
13308 | var unlisten = history.listenBefore(listener);
|
13309 |
|
13310 | return function () {
|
13311 | unlisten();
|
13312 |
|
13313 | if (--listenerCount === 0) stopHashChangeListener();
|
13314 | };
|
13315 | }
|
13316 |
|
13317 | function listen(listener) {
|
13318 | if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history);
|
13319 |
|
13320 | var unlisten = history.listen(listener);
|
13321 |
|
13322 | return function () {
|
13323 | unlisten();
|
13324 |
|
13325 | if (--listenerCount === 0) stopHashChangeListener();
|
13326 | };
|
13327 | }
|
13328 |
|
13329 | function push(location) {
|
13330 | process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined;
|
13331 |
|
13332 | history.push(location);
|
13333 | }
|
13334 |
|
13335 | function replace(location) {
|
13336 | process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined;
|
13337 |
|
13338 | history.replace(location);
|
13339 | }
|
13340 |
|
13341 | var goIsSupportedWithoutReload = _DOMUtils.supportsGoWithoutReloadUsingHash();
|
13342 |
|
13343 | function go(n) {
|
13344 | process.env.NODE_ENV !== 'production' ? _warning2['default'](goIsSupportedWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : undefined;
|
13345 |
|
13346 | history.go(n);
|
13347 | }
|
13348 |
|
13349 | function createHref(path) {
|
13350 | return '#' + history.createHref(path);
|
13351 | }
|
13352 |
|
13353 |
|
13354 | function registerTransitionHook(hook) {
|
13355 | if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history);
|
13356 |
|
13357 | history.registerTransitionHook(hook);
|
13358 | }
|
13359 |
|
13360 |
|
13361 | function unregisterTransitionHook(hook) {
|
13362 | history.unregisterTransitionHook(hook);
|
13363 |
|
13364 | if (--listenerCount === 0) stopHashChangeListener();
|
13365 | }
|
13366 |
|
13367 |
|
13368 | function pushState(state, path) {
|
13369 | process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined;
|
13370 |
|
13371 | history.pushState(state, path);
|
13372 | }
|
13373 |
|
13374 |
|
13375 | function replaceState(state, path) {
|
13376 | process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined;
|
13377 |
|
13378 | history.replaceState(state, path);
|
13379 | }
|
13380 |
|
13381 | return _extends({}, history, {
|
13382 | listenBefore: listenBefore,
|
13383 | listen: listen,
|
13384 | push: push,
|
13385 | replace: replace,
|
13386 | go: go,
|
13387 | createHref: createHref,
|
13388 |
|
13389 | registerTransitionHook: registerTransitionHook,
|
13390 | unregisterTransitionHook: unregisterTransitionHook,
|
13391 | pushState: pushState,
|
13392 | replaceState: replaceState
|
13393 | });
|
13394 | }
|
13395 |
|
13396 | exports['default'] = createHashHistory;
|
13397 | module.exports = exports['default'];
|
13398 | }).call(this,require(91))
|
13399 | },{"143":143,"145":145,"146":146,"147":147,"148":148,"150":150,"337":337,"81":81,"91":91}],152:[function(require,module,exports){
|
13400 | (function (process){
|
13401 | 'use strict';
|
13402 |
|
13403 | exports.__esModule = true;
|
13404 |
|
13405 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13406 |
|
13407 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13408 |
|
13409 | var _warning = require(337);
|
13410 |
|
13411 | var _warning2 = _interopRequireDefault(_warning);
|
13412 |
|
13413 | var _deepEqual = require(14);
|
13414 |
|
13415 | var _deepEqual2 = _interopRequireDefault(_deepEqual);
|
13416 |
|
13417 | var _PathUtils = require(148);
|
13418 |
|
13419 | var _AsyncUtils = require(144);
|
13420 |
|
13421 | var _Actions = require(143);
|
13422 |
|
13423 | var _createLocation2 = require(153);
|
13424 |
|
13425 | var _createLocation3 = _interopRequireDefault(_createLocation2);
|
13426 |
|
13427 | var _runTransitionHook = require(156);
|
13428 |
|
13429 | var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
|
13430 |
|
13431 | var _deprecate = require(155);
|
13432 |
|
13433 | var _deprecate2 = _interopRequireDefault(_deprecate);
|
13434 |
|
13435 | function createRandomKey(length) {
|
13436 | return Math.random().toString(36).substr(2, length);
|
13437 | }
|
13438 |
|
13439 | function locationsAreEqual(a, b) {
|
13440 | return a.pathname === b.pathname && a.search === b.search &&
|
13441 |
|
13442 | a.key === b.key && _deepEqual2['default'](a.state, b.state);
|
13443 | }
|
13444 |
|
13445 | var DefaultKeyLength = 6;
|
13446 |
|
13447 | function createHistory() {
|
13448 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
13449 | var getCurrentLocation = options.getCurrentLocation;
|
13450 | var finishTransition = options.finishTransition;
|
13451 | var saveState = options.saveState;
|
13452 | var go = options.go;
|
13453 | var getUserConfirmation = options.getUserConfirmation;
|
13454 | var keyLength = options.keyLength;
|
13455 |
|
13456 | if (typeof keyLength !== 'number') keyLength = DefaultKeyLength;
|
13457 |
|
13458 | var transitionHooks = [];
|
13459 |
|
13460 | function listenBefore(hook) {
|
13461 | transitionHooks.push(hook);
|
13462 |
|
13463 | return function () {
|
13464 | transitionHooks = transitionHooks.filter(function (item) {
|
13465 | return item !== hook;
|
13466 | });
|
13467 | };
|
13468 | }
|
13469 |
|
13470 | var allKeys = [];
|
13471 | var changeListeners = [];
|
13472 | var location = undefined;
|
13473 |
|
13474 | function getCurrent() {
|
13475 | if (pendingLocation && pendingLocation.action === _Actions.POP) {
|
13476 | return allKeys.indexOf(pendingLocation.key);
|
13477 | } else if (location) {
|
13478 | return allKeys.indexOf(location.key);
|
13479 | } else {
|
13480 | return -1;
|
13481 | }
|
13482 | }
|
13483 |
|
13484 | function updateLocation(newLocation) {
|
13485 | var current = getCurrent();
|
13486 |
|
13487 | location = newLocation;
|
13488 |
|
13489 | if (location.action === _Actions.PUSH) {
|
13490 | allKeys = [].concat(allKeys.slice(0, current + 1), [location.key]);
|
13491 | } else if (location.action === _Actions.REPLACE) {
|
13492 | allKeys[current] = location.key;
|
13493 | }
|
13494 |
|
13495 | changeListeners.forEach(function (listener) {
|
13496 | listener(location);
|
13497 | });
|
13498 | }
|
13499 |
|
13500 | function listen(listener) {
|
13501 | changeListeners.push(listener);
|
13502 |
|
13503 | if (location) {
|
13504 | listener(location);
|
13505 | } else {
|
13506 | var _location = getCurrentLocation();
|
13507 | allKeys = [_location.key];
|
13508 | updateLocation(_location);
|
13509 | }
|
13510 |
|
13511 | return function () {
|
13512 | changeListeners = changeListeners.filter(function (item) {
|
13513 | return item !== listener;
|
13514 | });
|
13515 | };
|
13516 | }
|
13517 |
|
13518 | function confirmTransitionTo(location, callback) {
|
13519 | _AsyncUtils.loopAsync(transitionHooks.length, function (index, next, done) {
|
13520 | _runTransitionHook2['default'](transitionHooks[index], location, function (result) {
|
13521 | if (result != null) {
|
13522 | done(result);
|
13523 | } else {
|
13524 | next();
|
13525 | }
|
13526 | });
|
13527 | }, function (message) {
|
13528 | if (getUserConfirmation && typeof message === 'string') {
|
13529 | getUserConfirmation(message, function (ok) {
|
13530 | callback(ok !== false);
|
13531 | });
|
13532 | } else {
|
13533 | callback(message !== false);
|
13534 | }
|
13535 | });
|
13536 | }
|
13537 |
|
13538 | var pendingLocation = undefined;
|
13539 |
|
13540 | function transitionTo(nextLocation) {
|
13541 | if (location && locationsAreEqual(location, nextLocation)) return;
|
13542 |
|
13543 | pendingLocation = nextLocation;
|
13544 |
|
13545 | confirmTransitionTo(nextLocation, function (ok) {
|
13546 | if (pendingLocation !== nextLocation) return;
|
13547 |
|
13548 | if (ok) {
|
13549 |
|
13550 | if (nextLocation.action === _Actions.PUSH) {
|
13551 | var prevPath = createPath(location);
|
13552 | var nextPath = createPath(nextLocation);
|
13553 |
|
13554 | if (nextPath === prevPath && _deepEqual2['default'](location.state, nextLocation.state)) nextLocation.action = _Actions.REPLACE;
|
13555 | }
|
13556 |
|
13557 | if (finishTransition(nextLocation) !== false) updateLocation(nextLocation);
|
13558 | } else if (location && nextLocation.action === _Actions.POP) {
|
13559 | var prevIndex = allKeys.indexOf(location.key);
|
13560 | var nextIndex = allKeys.indexOf(nextLocation.key);
|
13561 |
|
13562 | if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex);
|
13563 | }
|
13564 | });
|
13565 | }
|
13566 |
|
13567 | function push(location) {
|
13568 | transitionTo(createLocation(location, _Actions.PUSH, createKey()));
|
13569 | }
|
13570 |
|
13571 | function replace(location) {
|
13572 | transitionTo(createLocation(location, _Actions.REPLACE, createKey()));
|
13573 | }
|
13574 |
|
13575 | function goBack() {
|
13576 | go(-1);
|
13577 | }
|
13578 |
|
13579 | function goForward() {
|
13580 | go(1);
|
13581 | }
|
13582 |
|
13583 | function createKey() {
|
13584 | return createRandomKey(keyLength);
|
13585 | }
|
13586 |
|
13587 | function createPath(location) {
|
13588 | if (location == null || typeof location === 'string') return location;
|
13589 |
|
13590 | var pathname = location.pathname;
|
13591 | var search = location.search;
|
13592 | var hash = location.hash;
|
13593 |
|
13594 | var result = pathname;
|
13595 |
|
13596 | if (search) result += search;
|
13597 |
|
13598 | if (hash) result += hash;
|
13599 |
|
13600 | return result;
|
13601 | }
|
13602 |
|
13603 | function createHref(location) {
|
13604 | return createPath(location);
|
13605 | }
|
13606 |
|
13607 | function createLocation(location, action) {
|
13608 | var key = arguments.length <= 2 || arguments[2] === undefined ? createKey() : arguments[2];
|
13609 |
|
13610 | if (typeof action === 'object') {
|
13611 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'The state (2nd) argument to history.createLocation is deprecated; use a ' + 'location descriptor instead') : undefined;
|
13612 |
|
13613 | if (typeof location === 'string') location = _PathUtils.parsePath(location);
|
13614 |
|
13615 | location = _extends({}, location, { state: action });
|
13616 |
|
13617 | action = key;
|
13618 | key = arguments[3] || createKey();
|
13619 | }
|
13620 |
|
13621 | return _createLocation3['default'](location, action, key);
|
13622 | }
|
13623 |
|
13624 |
|
13625 | function setState(state) {
|
13626 | if (location) {
|
13627 | updateLocationState(location, state);
|
13628 | updateLocation(location);
|
13629 | } else {
|
13630 | updateLocationState(getCurrentLocation(), state);
|
13631 | }
|
13632 | }
|
13633 |
|
13634 | function updateLocationState(location, state) {
|
13635 | location.state = _extends({}, location.state, state);
|
13636 | saveState(location.key, location.state);
|
13637 | }
|
13638 |
|
13639 |
|
13640 | function registerTransitionHook(hook) {
|
13641 | if (transitionHooks.indexOf(hook) === -1) transitionHooks.push(hook);
|
13642 | }
|
13643 |
|
13644 |
|
13645 | function unregisterTransitionHook(hook) {
|
13646 | transitionHooks = transitionHooks.filter(function (item) {
|
13647 | return item !== hook;
|
13648 | });
|
13649 | }
|
13650 |
|
13651 |
|
13652 | function pushState(state, path) {
|
13653 | if (typeof path === 'string') path = _PathUtils.parsePath(path);
|
13654 |
|
13655 | push(_extends({ state: state }, path));
|
13656 | }
|
13657 |
|
13658 |
|
13659 | function replaceState(state, path) {
|
13660 | if (typeof path === 'string') path = _PathUtils.parsePath(path);
|
13661 |
|
13662 | replace(_extends({ state: state }, path));
|
13663 | }
|
13664 |
|
13665 | return {
|
13666 | listenBefore: listenBefore,
|
13667 | listen: listen,
|
13668 | transitionTo: transitionTo,
|
13669 | push: push,
|
13670 | replace: replace,
|
13671 | go: go,
|
13672 | goBack: goBack,
|
13673 | goForward: goForward,
|
13674 | createKey: createKey,
|
13675 | createPath: createPath,
|
13676 | createHref: createHref,
|
13677 | createLocation: createLocation,
|
13678 |
|
13679 | setState: _deprecate2['default'](setState, 'setState is deprecated; use location.key to save state instead'),
|
13680 | registerTransitionHook: _deprecate2['default'](registerTransitionHook, 'registerTransitionHook is deprecated; use listenBefore instead'),
|
13681 | unregisterTransitionHook: _deprecate2['default'](unregisterTransitionHook, 'unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead'),
|
13682 | pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'),
|
13683 | replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead')
|
13684 | };
|
13685 | }
|
13686 |
|
13687 | exports['default'] = createHistory;
|
13688 | module.exports = exports['default'];
|
13689 | }).call(this,require(91))
|
13690 | },{"14":14,"143":143,"144":144,"148":148,"153":153,"155":155,"156":156,"337":337,"91":91}],153:[function(require,module,exports){
|
13691 | (function (process){
|
13692 | 'use strict';
|
13693 |
|
13694 | exports.__esModule = true;
|
13695 |
|
13696 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13697 |
|
13698 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13699 |
|
13700 | var _warning = require(337);
|
13701 |
|
13702 | var _warning2 = _interopRequireDefault(_warning);
|
13703 |
|
13704 | var _Actions = require(143);
|
13705 |
|
13706 | var _PathUtils = require(148);
|
13707 |
|
13708 | function createLocation() {
|
13709 | var location = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0];
|
13710 | var action = arguments.length <= 1 || arguments[1] === undefined ? _Actions.POP : arguments[1];
|
13711 | var key = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
|
13712 |
|
13713 | var _fourthArg = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3];
|
13714 |
|
13715 | if (typeof location === 'string') location = _PathUtils.parsePath(location);
|
13716 |
|
13717 | if (typeof action === 'object') {
|
13718 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'The state (2nd) argument to createLocation is deprecated; use a ' + 'location descriptor instead') : undefined;
|
13719 |
|
13720 | location = _extends({}, location, { state: action });
|
13721 |
|
13722 | action = key || _Actions.POP;
|
13723 | key = _fourthArg;
|
13724 | }
|
13725 |
|
13726 | var pathname = location.pathname || '/';
|
13727 | var search = location.search || '';
|
13728 | var hash = location.hash || '';
|
13729 | var state = location.state || null;
|
13730 |
|
13731 | return {
|
13732 | pathname: pathname,
|
13733 | search: search,
|
13734 | hash: hash,
|
13735 | state: state,
|
13736 | action: action,
|
13737 | key: key
|
13738 | };
|
13739 | }
|
13740 |
|
13741 | exports['default'] = createLocation;
|
13742 | module.exports = exports['default'];
|
13743 | }).call(this,require(91))
|
13744 | },{"143":143,"148":148,"337":337,"91":91}],154:[function(require,module,exports){
|
13745 | (function (process){
|
13746 | 'use strict';
|
13747 |
|
13748 | exports.__esModule = true;
|
13749 |
|
13750 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13751 |
|
13752 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13753 |
|
13754 | var _warning = require(337);
|
13755 |
|
13756 | var _warning2 = _interopRequireDefault(_warning);
|
13757 |
|
13758 | var _invariant = require(81);
|
13759 |
|
13760 | var _invariant2 = _interopRequireDefault(_invariant);
|
13761 |
|
13762 | var _PathUtils = require(148);
|
13763 |
|
13764 | var _Actions = require(143);
|
13765 |
|
13766 | var _createHistory = require(152);
|
13767 |
|
13768 | var _createHistory2 = _interopRequireDefault(_createHistory);
|
13769 |
|
13770 | function createStateStorage(entries) {
|
13771 | return entries.filter(function (entry) {
|
13772 | return entry.state;
|
13773 | }).reduce(function (memo, entry) {
|
13774 | memo[entry.key] = entry.state;
|
13775 | return memo;
|
13776 | }, {});
|
13777 | }
|
13778 |
|
13779 | function createMemoryHistory() {
|
13780 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
13781 |
|
13782 | if (Array.isArray(options)) {
|
13783 | options = { entries: options };
|
13784 | } else if (typeof options === 'string') {
|
13785 | options = { entries: [options] };
|
13786 | }
|
13787 |
|
13788 | var history = _createHistory2['default'](_extends({}, options, {
|
13789 | getCurrentLocation: getCurrentLocation,
|
13790 | finishTransition: finishTransition,
|
13791 | saveState: saveState,
|
13792 | go: go
|
13793 | }));
|
13794 |
|
13795 | var _options = options;
|
13796 | var entries = _options.entries;
|
13797 | var current = _options.current;
|
13798 |
|
13799 | if (typeof entries === 'string') {
|
13800 | entries = [entries];
|
13801 | } else if (!Array.isArray(entries)) {
|
13802 | entries = ['/'];
|
13803 | }
|
13804 |
|
13805 | entries = entries.map(function (entry) {
|
13806 | var key = history.createKey();
|
13807 |
|
13808 | if (typeof entry === 'string') return { pathname: entry, key: key };
|
13809 |
|
13810 | if (typeof entry === 'object' && entry) return _extends({}, entry, { key: key });
|
13811 |
|
13812 | !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Unable to create history entry from %s', entry) : _invariant2['default'](false) : undefined;
|
13813 | });
|
13814 |
|
13815 | if (current == null) {
|
13816 | current = entries.length - 1;
|
13817 | } else {
|
13818 | !(current >= 0 && current < entries.length) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Current index must be >= 0 and < %s, was %s', entries.length, current) : _invariant2['default'](false) : undefined;
|
13819 | }
|
13820 |
|
13821 | var storage = createStateStorage(entries);
|
13822 |
|
13823 | function saveState(key, state) {
|
13824 | storage[key] = state;
|
13825 | }
|
13826 |
|
13827 | function readState(key) {
|
13828 | return storage[key];
|
13829 | }
|
13830 |
|
13831 | function getCurrentLocation() {
|
13832 | var entry = entries[current];
|
13833 | var basename = entry.basename;
|
13834 | var pathname = entry.pathname;
|
13835 | var search = entry.search;
|
13836 |
|
13837 | var path = (basename || '') + pathname + (search || '');
|
13838 |
|
13839 | var key = undefined,
|
13840 | state = undefined;
|
13841 | if (entry.key) {
|
13842 | key = entry.key;
|
13843 | state = readState(key);
|
13844 | } else {
|
13845 | key = history.createKey();
|
13846 | state = null;
|
13847 | entry.key = key;
|
13848 | }
|
13849 |
|
13850 | var location = _PathUtils.parsePath(path);
|
13851 |
|
13852 | return history.createLocation(_extends({}, location, { state: state }), undefined, key);
|
13853 | }
|
13854 |
|
13855 | function canGo(n) {
|
13856 | var index = current + n;
|
13857 | return index >= 0 && index < entries.length;
|
13858 | }
|
13859 |
|
13860 | function go(n) {
|
13861 | if (n) {
|
13862 | if (!canGo(n)) {
|
13863 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'Cannot go(%s) there is not enough history', n) : undefined;
|
13864 | return;
|
13865 | }
|
13866 |
|
13867 | current += n;
|
13868 |
|
13869 | var currentLocation = getCurrentLocation();
|
13870 |
|
13871 |
|
13872 | history.transitionTo(_extends({}, currentLocation, { action: _Actions.POP }));
|
13873 | }
|
13874 | }
|
13875 |
|
13876 | function finishTransition(location) {
|
13877 | switch (location.action) {
|
13878 | case _Actions.PUSH:
|
13879 | current += 1;
|
13880 |
|
13881 |
|
13882 |
|
13883 | if (current < entries.length) entries.splice(current);
|
13884 |
|
13885 | entries.push(location);
|
13886 | saveState(location.key, location.state);
|
13887 | break;
|
13888 | case _Actions.REPLACE:
|
13889 | entries[current] = location;
|
13890 | saveState(location.key, location.state);
|
13891 | break;
|
13892 | }
|
13893 | }
|
13894 |
|
13895 | return history;
|
13896 | }
|
13897 |
|
13898 | exports['default'] = createMemoryHistory;
|
13899 | module.exports = exports['default'];
|
13900 | }).call(this,require(91))
|
13901 | },{"143":143,"148":148,"152":152,"337":337,"81":81,"91":91}],155:[function(require,module,exports){
|
13902 | (function (process){
|
13903 | 'use strict';
|
13904 |
|
13905 | exports.__esModule = true;
|
13906 |
|
13907 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13908 |
|
13909 | var _warning = require(337);
|
13910 |
|
13911 | var _warning2 = _interopRequireDefault(_warning);
|
13912 |
|
13913 | function deprecate(fn, message) {
|
13914 | return function () {
|
13915 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] ' + message) : undefined;
|
13916 | return fn.apply(this, arguments);
|
13917 | };
|
13918 | }
|
13919 |
|
13920 | exports['default'] = deprecate;
|
13921 | module.exports = exports['default'];
|
13922 | }).call(this,require(91))
|
13923 | },{"337":337,"91":91}],156:[function(require,module,exports){
|
13924 | (function (process){
|
13925 | 'use strict';
|
13926 |
|
13927 | exports.__esModule = true;
|
13928 |
|
13929 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13930 |
|
13931 | var _warning = require(337);
|
13932 |
|
13933 | var _warning2 = _interopRequireDefault(_warning);
|
13934 |
|
13935 | function runTransitionHook(hook, location, callback) {
|
13936 | var result = hook(location, callback);
|
13937 |
|
13938 | if (hook.length < 2) {
|
13939 |
|
13940 |
|
13941 | callback(result);
|
13942 | } else {
|
13943 | process.env.NODE_ENV !== 'production' ? _warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead') : undefined;
|
13944 | }
|
13945 | }
|
13946 |
|
13947 | exports['default'] = runTransitionHook;
|
13948 | module.exports = exports['default'];
|
13949 | }).call(this,require(91))
|
13950 | },{"337":337,"91":91}],157:[function(require,module,exports){
|
13951 | (function (process){
|
13952 | 'use strict';
|
13953 |
|
13954 | exports.__esModule = true;
|
13955 |
|
13956 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13957 |
|
13958 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
13959 |
|
13960 | var _warning = require(337);
|
13961 |
|
13962 | var _warning2 = _interopRequireDefault(_warning);
|
13963 |
|
13964 | var _ExecutionEnvironment = require(147);
|
13965 |
|
13966 | var _PathUtils = require(148);
|
13967 |
|
13968 | var _runTransitionHook = require(156);
|
13969 |
|
13970 | var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
|
13971 |
|
13972 | var _deprecate = require(155);
|
13973 |
|
13974 | var _deprecate2 = _interopRequireDefault(_deprecate);
|
13975 |
|
13976 | function useBasename(createHistory) {
|
13977 | return function () {
|
13978 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
13979 |
|
13980 | var history = createHistory(options);
|
13981 |
|
13982 | var basename = options.basename;
|
13983 |
|
13984 | var checkedBaseHref = false;
|
13985 |
|
13986 | function checkBaseHref() {
|
13987 | if (checkedBaseHref) {
|
13988 | return;
|
13989 | }
|
13990 |
|
13991 |
|
13992 |
|
13993 | if (basename == null && _ExecutionEnvironment.canUseDOM) {
|
13994 | var base = document.getElementsByTagName('base')[0];
|
13995 | var baseHref = base && base.getAttribute('href');
|
13996 |
|
13997 | if (baseHref != null) {
|
13998 | basename = baseHref;
|
13999 |
|
14000 | process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'Automatically setting basename using <base href> is deprecated and will ' + 'be removed in the next major release. The semantics of <base href> are ' + 'subtly different from basename. Please pass the basename explicitly in ' + 'the options to createHistory') : undefined;
|
14001 | }
|
14002 | }
|
14003 |
|
14004 | checkedBaseHref = true;
|
14005 | }
|
14006 |
|
14007 | function addBasename(location) {
|
14008 | checkBaseHref();
|
14009 |
|
14010 | if (basename && location.basename == null) {
|
14011 | if (location.pathname.indexOf(basename) === 0) {
|
14012 | location.pathname = location.pathname.substring(basename.length);
|
14013 | location.basename = basename;
|
14014 |
|
14015 | if (location.pathname === '') location.pathname = '/';
|
14016 | } else {
|
14017 | location.basename = '';
|
14018 | }
|
14019 | }
|
14020 |
|
14021 | return location;
|
14022 | }
|
14023 |
|
14024 | function prependBasename(location) {
|
14025 | checkBaseHref();
|
14026 |
|
14027 | if (!basename) return location;
|
14028 |
|
14029 | if (typeof location === 'string') location = _PathUtils.parsePath(location);
|
14030 |
|
14031 | var pname = location.pathname;
|
14032 | var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/';
|
14033 | var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname;
|
14034 | var pathname = normalizedBasename + normalizedPathname;
|
14035 |
|
14036 | return _extends({}, location, {
|
14037 | pathname: pathname
|
14038 | });
|
14039 | }
|
14040 |
|
14041 |
|
14042 | function listenBefore(hook) {
|
14043 | return history.listenBefore(function (location, callback) {
|
14044 | _runTransitionHook2['default'](hook, addBasename(location), callback);
|
14045 | });
|
14046 | }
|
14047 |
|
14048 | function listen(listener) {
|
14049 | return history.listen(function (location) {
|
14050 | listener(addBasename(location));
|
14051 | });
|
14052 | }
|
14053 |
|
14054 |
|
14055 | function push(location) {
|
14056 | history.push(prependBasename(location));
|
14057 | }
|
14058 |
|
14059 | function replace(location) {
|
14060 | history.replace(prependBasename(location));
|
14061 | }
|
14062 |
|
14063 | function createPath(location) {
|
14064 | return history.createPath(prependBasename(location));
|
14065 | }
|
14066 |
|
14067 | function createHref(location) {
|
14068 | return history.createHref(prependBasename(location));
|
14069 | }
|
14070 |
|
14071 | function createLocation(location) {
|
14072 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
14073 | args[_key - 1] = arguments[_key];
|
14074 | }
|
14075 |
|
14076 | return addBasename(history.createLocation.apply(history, [prependBasename(location)].concat(args)));
|
14077 | }
|
14078 |
|
14079 |
|
14080 | function pushState(state, path) {
|
14081 | if (typeof path === 'string') path = _PathUtils.parsePath(path);
|
14082 |
|
14083 | push(_extends({ state: state }, path));
|
14084 | }
|
14085 |
|
14086 |
|
14087 | function replaceState(state, path) {
|
14088 | if (typeof path === 'string') path = _PathUtils.parsePath(path);
|
14089 |
|
14090 | replace(_extends({ state: state }, path));
|
14091 | }
|
14092 |
|
14093 | return _extends({}, history, {
|
14094 | listenBefore: listenBefore,
|
14095 | listen: listen,
|
14096 | push: push,
|
14097 | replace: replace,
|
14098 | createPath: createPath,
|
14099 | createHref: createHref,
|
14100 | createLocation: createLocation,
|
14101 |
|
14102 | pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'),
|
14103 | replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead')
|
14104 | });
|
14105 | };
|
14106 | }
|
14107 |
|
14108 | exports['default'] = useBasename;
|
14109 | module.exports = exports['default'];
|
14110 | }).call(this,require(91))
|
14111 | },{"147":147,"148":148,"155":155,"156":156,"337":337,"91":91}],158:[function(require,module,exports){
|
14112 | (function (process){
|
14113 | 'use strict';
|
14114 |
|
14115 | exports.__esModule = true;
|
14116 |
|
14117 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
14118 |
|
14119 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14120 |
|
14121 | var _warning = require(337);
|
14122 |
|
14123 | var _warning2 = _interopRequireDefault(_warning);
|
14124 |
|
14125 | var _queryString = require(93);
|
14126 |
|
14127 | var _runTransitionHook = require(156);
|
14128 |
|
14129 | var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
|
14130 |
|
14131 | var _PathUtils = require(148);
|
14132 |
|
14133 | var _deprecate = require(155);
|
14134 |
|
14135 | var _deprecate2 = _interopRequireDefault(_deprecate);
|
14136 |
|
14137 | var SEARCH_BASE_KEY = '$searchBase';
|
14138 |
|
14139 | function defaultStringifyQuery(query) {
|
14140 | return _queryString.stringify(query).replace(/%20/g, '+');
|
14141 | }
|
14142 |
|
14143 | var defaultParseQueryString = _queryString.parse;
|
14144 |
|
14145 | function isNestedObject(object) {
|
14146 | for (var p in object) {
|
14147 | if (Object.prototype.hasOwnProperty.call(object, p) && typeof object[p] === 'object' && !Array.isArray(object[p]) && object[p] !== null) return true;
|
14148 | }return false;
|
14149 | }
|
14150 |
|
14151 |
|
14152 |
|
14153 |
|
14154 |
|
14155 | function useQueries(createHistory) {
|
14156 | return function () {
|
14157 | var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
14158 |
|
14159 | var history = createHistory(options);
|
14160 |
|
14161 | var stringifyQuery = options.stringifyQuery;
|
14162 | var parseQueryString = options.parseQueryString;
|
14163 |
|
14164 | if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery;
|
14165 |
|
14166 | if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString;
|
14167 |
|
14168 | function addQuery(location) {
|
14169 | if (location.query == null) {
|
14170 | var search = location.search;
|
14171 |
|
14172 | location.query = parseQueryString(search.substring(1));
|
14173 | location[SEARCH_BASE_KEY] = { search: search, searchBase: '' };
|
14174 | }
|
14175 |
|
14176 |
|
14177 |
|
14178 |
|
14179 | return location;
|
14180 | }
|
14181 |
|
14182 | function appendQuery(location, query) {
|
14183 | var _extends2;
|
14184 |
|
14185 | var searchBaseSpec = location[SEARCH_BASE_KEY];
|
14186 | var queryString = query ? stringifyQuery(query) : '';
|
14187 | if (!searchBaseSpec && !queryString) {
|
14188 | return location;
|
14189 | }
|
14190 |
|
14191 | process.env.NODE_ENV !== 'production' ? _warning2['default'](stringifyQuery !== defaultStringifyQuery || !isNestedObject(query), 'useQueries does not stringify nested query objects by default; ' + 'use a custom stringifyQuery function') : undefined;
|
14192 |
|
14193 | if (typeof location === 'string') location = _PathUtils.parsePath(location);
|
14194 |
|
14195 | var searchBase = undefined;
|
14196 | if (searchBaseSpec && location.search === searchBaseSpec.search) {
|
14197 | searchBase = searchBaseSpec.searchBase;
|
14198 | } else {
|
14199 | searchBase = location.search || '';
|
14200 | }
|
14201 |
|
14202 | var search = searchBase;
|
14203 | if (queryString) {
|
14204 | search += (search ? '&' : '?') + queryString;
|
14205 | }
|
14206 |
|
14207 | return _extends({}, location, (_extends2 = {
|
14208 | search: search
|
14209 | }, _extends2[SEARCH_BASE_KEY] = { search: search, searchBase: searchBase }, _extends2));
|
14210 | }
|
14211 |
|
14212 |
|
14213 | function listenBefore(hook) {
|
14214 | return history.listenBefore(function (location, callback) {
|
14215 | _runTransitionHook2['default'](hook, addQuery(location), callback);
|
14216 | });
|
14217 | }
|
14218 |
|
14219 | function listen(listener) {
|
14220 | return history.listen(function (location) {
|
14221 | listener(addQuery(location));
|
14222 | });
|
14223 | }
|
14224 |
|
14225 |
|
14226 | function push(location) {
|
14227 | history.push(appendQuery(location, location.query));
|
14228 | }
|
14229 |
|
14230 | function replace(location) {
|
14231 | history.replace(appendQuery(location, location.query));
|
14232 | }
|
14233 |
|
14234 | function createPath(location, query) {
|
14235 | process.env.NODE_ENV !== 'production' ? _warning2['default'](!query, 'the query argument to createPath is deprecated; use a location descriptor instead') : undefined;
|
14236 |
|
14237 | return history.createPath(appendQuery(location, query || location.query));
|
14238 | }
|
14239 |
|
14240 | function createHref(location, query) {
|
14241 | process.env.NODE_ENV !== 'production' ? _warning2['default'](!query, 'the query argument to createHref is deprecated; use a location descriptor instead') : undefined;
|
14242 |
|
14243 | return history.createHref(appendQuery(location, query || location.query));
|
14244 | }
|
14245 |
|
14246 | function createLocation(location) {
|
14247 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
14248 | args[_key - 1] = arguments[_key];
|
14249 | }
|
14250 |
|
14251 | var fullLocation = history.createLocation.apply(history, [appendQuery(location, location.query)].concat(args));
|
14252 | if (location.query) {
|
14253 | fullLocation.query = location.query;
|
14254 | }
|
14255 | return addQuery(fullLocation);
|
14256 | }
|
14257 |
|
14258 |
|
14259 | function pushState(state, path, query) {
|
14260 | if (typeof path === 'string') path = _PathUtils.parsePath(path);
|
14261 |
|
14262 | push(_extends({ state: state }, path, { query: query }));
|
14263 | }
|
14264 |
|
14265 |
|
14266 | function replaceState(state, path, query) {
|
14267 | if (typeof path === 'string') path = _PathUtils.parsePath(path);
|
14268 |
|
14269 | replace(_extends({ state: state }, path, { query: query }));
|
14270 | }
|
14271 |
|
14272 | return _extends({}, history, {
|
14273 | listenBefore: listenBefore,
|
14274 | listen: listen,
|
14275 | push: push,
|
14276 | replace: replace,
|
14277 | createPath: createPath,
|
14278 | createHref: createHref,
|
14279 | createLocation: createLocation,
|
14280 |
|
14281 | pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'),
|
14282 | replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead')
|
14283 | });
|
14284 | };
|
14285 | }
|
14286 |
|
14287 | exports['default'] = useQueries;
|
14288 | module.exports = exports['default'];
|
14289 | }).call(this,require(91))
|
14290 | },{"148":148,"155":155,"156":156,"337":337,"91":91,"93":93}],159:[function(require,module,exports){
|
14291 |
|
14292 |
|
14293 |
|
14294 |
|
14295 |
|
14296 |
|
14297 |
|
14298 |
|
14299 |
|
14300 |
|
14301 |
|
14302 | 'use strict';
|
14303 |
|
14304 | var ReactDOMComponentTree = require(199);
|
14305 |
|
14306 | var focusNode = require(39);
|
14307 |
|
14308 | var AutoFocusUtils = {
|
14309 | focusDOMComponent: function () {
|
14310 | focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
|
14311 | }
|
14312 | };
|
14313 |
|
14314 | module.exports = AutoFocusUtils;
|
14315 | },{"199":199,"39":39}],160:[function(require,module,exports){
|
14316 |
|
14317 |
|
14318 |
|
14319 |
|
14320 |
|
14321 |
|
14322 |
|
14323 |
|
14324 |
|
14325 |
|
14326 |
|
14327 | 'use strict';
|
14328 |
|
14329 | var EventConstants = require(174);
|
14330 | var EventPropagators = require(178);
|
14331 | var ExecutionEnvironment = require(31);
|
14332 | var FallbackCompositionState = require(179);
|
14333 | var SyntheticCompositionEvent = require(254);
|
14334 | var SyntheticInputEvent = require(258);
|
14335 |
|
14336 | var keyOf = require(49);
|
14337 |
|
14338 | var END_KEYCODES = [9, 13, 27, 32];
|
14339 | var START_KEYCODE = 229;
|
14340 |
|
14341 | var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
|
14342 |
|
14343 | var documentMode = null;
|
14344 | if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
|
14345 | documentMode = document.documentMode;
|
14346 | }
|
14347 |
|
14348 |
|
14349 |
|
14350 |
|
14351 | var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
|
14352 |
|
14353 |
|
14354 |
|
14355 |
|
14356 | var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
|
14357 |
|
14358 |
|
14359 |
|
14360 |
|
14361 |
|
14362 | function isPresto() {
|
14363 | var opera = window.opera;
|
14364 | return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
|
14365 | }
|
14366 |
|
14367 | var SPACEBAR_CODE = 32;
|
14368 | var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
14369 |
|
14370 | var topLevelTypes = EventConstants.topLevelTypes;
|
14371 |
|
14372 |
|
14373 | var eventTypes = {
|
14374 | beforeInput: {
|
14375 | phasedRegistrationNames: {
|
14376 | bubbled: keyOf({ onBeforeInput: null }),
|
14377 | captured: keyOf({ onBeforeInputCapture: null })
|
14378 | },
|
14379 | dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
|
14380 | },
|
14381 | compositionEnd: {
|
14382 | phasedRegistrationNames: {
|
14383 | bubbled: keyOf({ onCompositionEnd: null }),
|
14384 | captured: keyOf({ onCompositionEndCapture: null })
|
14385 | },
|
14386 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
14387 | },
|
14388 | compositionStart: {
|
14389 | phasedRegistrationNames: {
|
14390 | bubbled: keyOf({ onCompositionStart: null }),
|
14391 | captured: keyOf({ onCompositionStartCapture: null })
|
14392 | },
|
14393 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
14394 | },
|
14395 | compositionUpdate: {
|
14396 | phasedRegistrationNames: {
|
14397 | bubbled: keyOf({ onCompositionUpdate: null }),
|
14398 | captured: keyOf({ onCompositionUpdateCapture: null })
|
14399 | },
|
14400 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
14401 | }
|
14402 | };
|
14403 |
|
14404 |
|
14405 | var hasSpaceKeypress = false;
|
14406 |
|
14407 |
|
14408 |
|
14409 |
|
14410 |
|
14411 |
|
14412 | function isKeypressCommand(nativeEvent) {
|
14413 | return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
|
14414 |
|
14415 | !(nativeEvent.ctrlKey && nativeEvent.altKey);
|
14416 | }
|
14417 |
|
14418 |
|
14419 |
|
14420 |
|
14421 |
|
14422 |
|
14423 |
|
14424 | function getCompositionEventType(topLevelType) {
|
14425 | switch (topLevelType) {
|
14426 | case topLevelTypes.topCompositionStart:
|
14427 | return eventTypes.compositionStart;
|
14428 | case topLevelTypes.topCompositionEnd:
|
14429 | return eventTypes.compositionEnd;
|
14430 | case topLevelTypes.topCompositionUpdate:
|
14431 | return eventTypes.compositionUpdate;
|
14432 | }
|
14433 | }
|
14434 |
|
14435 |
|
14436 |
|
14437 |
|
14438 |
|
14439 |
|
14440 |
|
14441 |
|
14442 |
|
14443 | function isFallbackCompositionStart(topLevelType, nativeEvent) {
|
14444 | return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
|
14445 | }
|
14446 |
|
14447 |
|
14448 |
|
14449 |
|
14450 |
|
14451 |
|
14452 |
|
14453 |
|
14454 | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
|
14455 | switch (topLevelType) {
|
14456 | case topLevelTypes.topKeyUp:
|
14457 |
|
14458 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
|
14459 | case topLevelTypes.topKeyDown:
|
14460 |
|
14461 |
|
14462 | return nativeEvent.keyCode !== START_KEYCODE;
|
14463 | case topLevelTypes.topKeyPress:
|
14464 | case topLevelTypes.topMouseDown:
|
14465 | case topLevelTypes.topBlur:
|
14466 |
|
14467 | return true;
|
14468 | default:
|
14469 | return false;
|
14470 | }
|
14471 | }
|
14472 |
|
14473 |
|
14474 |
|
14475 |
|
14476 |
|
14477 |
|
14478 |
|
14479 |
|
14480 |
|
14481 |
|
14482 | function getDataFromCustomEvent(nativeEvent) {
|
14483 | var detail = nativeEvent.detail;
|
14484 | if (typeof detail === 'object' && 'data' in detail) {
|
14485 | return detail.data;
|
14486 | }
|
14487 | return null;
|
14488 | }
|
14489 |
|
14490 |
|
14491 | var currentComposition = null;
|
14492 |
|
14493 |
|
14494 |
|
14495 |
|
14496 | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
14497 | var eventType;
|
14498 | var fallbackData;
|
14499 |
|
14500 | if (canUseCompositionEvent) {
|
14501 | eventType = getCompositionEventType(topLevelType);
|
14502 | } else if (!currentComposition) {
|
14503 | if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
|
14504 | eventType = eventTypes.compositionStart;
|
14505 | }
|
14506 | } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
14507 | eventType = eventTypes.compositionEnd;
|
14508 | }
|
14509 |
|
14510 | if (!eventType) {
|
14511 | return null;
|
14512 | }
|
14513 |
|
14514 | if (useFallbackCompositionData) {
|
14515 |
|
14516 |
|
14517 | if (!currentComposition && eventType === eventTypes.compositionStart) {
|
14518 | currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
|
14519 | } else if (eventType === eventTypes.compositionEnd) {
|
14520 | if (currentComposition) {
|
14521 | fallbackData = currentComposition.getData();
|
14522 | }
|
14523 | }
|
14524 | }
|
14525 |
|
14526 | var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
|
14527 |
|
14528 | if (fallbackData) {
|
14529 |
|
14530 |
|
14531 | event.data = fallbackData;
|
14532 | } else {
|
14533 | var customData = getDataFromCustomEvent(nativeEvent);
|
14534 | if (customData !== null) {
|
14535 | event.data = customData;
|
14536 | }
|
14537 | }
|
14538 |
|
14539 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
14540 | return event;
|
14541 | }
|
14542 |
|
14543 |
|
14544 |
|
14545 |
|
14546 |
|
14547 |
|
14548 | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
|
14549 | switch (topLevelType) {
|
14550 | case topLevelTypes.topCompositionEnd:
|
14551 | return getDataFromCustomEvent(nativeEvent);
|
14552 | case topLevelTypes.topKeyPress:
|
14553 | |
14554 |
|
14555 |
|
14556 |
|
14557 |
|
14558 |
|
14559 |
|
14560 |
|
14561 |
|
14562 |
|
14563 |
|
14564 |
|
14565 |
|
14566 |
|
14567 | var which = nativeEvent.which;
|
14568 | if (which !== SPACEBAR_CODE) {
|
14569 | return null;
|
14570 | }
|
14571 |
|
14572 | hasSpaceKeypress = true;
|
14573 | return SPACEBAR_CHAR;
|
14574 |
|
14575 | case topLevelTypes.topTextInput:
|
14576 |
|
14577 | var chars = nativeEvent.data;
|
14578 |
|
14579 |
|
14580 |
|
14581 |
|
14582 | if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
|
14583 | return null;
|
14584 | }
|
14585 |
|
14586 | return chars;
|
14587 |
|
14588 | default:
|
14589 |
|
14590 | return null;
|
14591 | }
|
14592 | }
|
14593 |
|
14594 |
|
14595 |
|
14596 |
|
14597 |
|
14598 |
|
14599 |
|
14600 |
|
14601 |
|
14602 | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
|
14603 |
|
14604 |
|
14605 | if (currentComposition) {
|
14606 | if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
14607 | var chars = currentComposition.getData();
|
14608 | FallbackCompositionState.release(currentComposition);
|
14609 | currentComposition = null;
|
14610 | return chars;
|
14611 | }
|
14612 | return null;
|
14613 | }
|
14614 |
|
14615 | switch (topLevelType) {
|
14616 | case topLevelTypes.topPaste:
|
14617 |
|
14618 |
|
14619 | return null;
|
14620 | case topLevelTypes.topKeyPress:
|
14621 | |
14622 |
|
14623 |
|
14624 |
|
14625 |
|
14626 |
|
14627 |
|
14628 |
|
14629 |
|
14630 |
|
14631 |
|
14632 |
|
14633 |
|
14634 |
|
14635 |
|
14636 |
|
14637 | if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
|
14638 | return String.fromCharCode(nativeEvent.which);
|
14639 | }
|
14640 | return null;
|
14641 | case topLevelTypes.topCompositionEnd:
|
14642 | return useFallbackCompositionData ? null : nativeEvent.data;
|
14643 | default:
|
14644 | return null;
|
14645 | }
|
14646 | }
|
14647 |
|
14648 |
|
14649 |
|
14650 |
|
14651 |
|
14652 |
|
14653 |
|
14654 | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
14655 | var chars;
|
14656 |
|
14657 | if (canUseTextInputEvent) {
|
14658 | chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
|
14659 | } else {
|
14660 | chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
|
14661 | }
|
14662 |
|
14663 |
|
14664 |
|
14665 | if (!chars) {
|
14666 | return null;
|
14667 | }
|
14668 |
|
14669 | var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
|
14670 |
|
14671 | event.data = chars;
|
14672 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
14673 | return event;
|
14674 | }
|
14675 |
|
14676 |
|
14677 |
|
14678 |
|
14679 |
|
14680 |
|
14681 |
|
14682 |
|
14683 |
|
14684 |
|
14685 |
|
14686 |
|
14687 |
|
14688 |
|
14689 |
|
14690 |
|
14691 |
|
14692 |
|
14693 |
|
14694 | var BeforeInputEventPlugin = {
|
14695 |
|
14696 | eventTypes: eventTypes,
|
14697 |
|
14698 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
14699 | return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
|
14700 | }
|
14701 | };
|
14702 |
|
14703 | module.exports = BeforeInputEventPlugin;
|
14704 | },{"174":174,"178":178,"179":179,"254":254,"258":258,"31":31,"49":49}],161:[function(require,module,exports){
|
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 |
|
14710 |
|
14711 |
|
14712 |
|
14713 |
|
14714 |
|
14715 |
|
14716 | 'use strict';
|
14717 |
|
14718 |
|
14719 |
|
14720 |
|
14721 |
|
14722 | var isUnitlessNumber = {
|
14723 | animationIterationCount: true,
|
14724 | borderImageOutset: true,
|
14725 | borderImageSlice: true,
|
14726 | borderImageWidth: true,
|
14727 | boxFlex: true,
|
14728 | boxFlexGroup: true,
|
14729 | boxOrdinalGroup: true,
|
14730 | columnCount: true,
|
14731 | flex: true,
|
14732 | flexGrow: true,
|
14733 | flexPositive: true,
|
14734 | flexShrink: true,
|
14735 | flexNegative: true,
|
14736 | flexOrder: true,
|
14737 | gridRow: true,
|
14738 | gridColumn: true,
|
14739 | fontWeight: true,
|
14740 | lineClamp: true,
|
14741 | lineHeight: true,
|
14742 | opacity: true,
|
14743 | order: true,
|
14744 | orphans: true,
|
14745 | tabSize: true,
|
14746 | widows: true,
|
14747 | zIndex: true,
|
14748 | zoom: true,
|
14749 |
|
14750 |
|
14751 | fillOpacity: true,
|
14752 | floodOpacity: true,
|
14753 | stopOpacity: true,
|
14754 | strokeDasharray: true,
|
14755 | strokeDashoffset: true,
|
14756 | strokeMiterlimit: true,
|
14757 | strokeOpacity: true,
|
14758 | strokeWidth: true
|
14759 | };
|
14760 |
|
14761 |
|
14762 |
|
14763 |
|
14764 |
|
14765 |
|
14766 |
|
14767 | function prefixKey(prefix, key) {
|
14768 | return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
14769 | }
|
14770 |
|
14771 |
|
14772 |
|
14773 |
|
14774 |
|
14775 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
14776 |
|
14777 |
|
14778 |
|
14779 | Object.keys(isUnitlessNumber).forEach(function (prop) {
|
14780 | prefixes.forEach(function (prefix) {
|
14781 | isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
14782 | });
|
14783 | });
|
14784 |
|
14785 |
|
14786 |
|
14787 |
|
14788 |
|
14789 |
|
14790 |
|
14791 |
|
14792 |
|
14793 |
|
14794 | var shorthandPropertyExpansions = {
|
14795 | background: {
|
14796 | backgroundAttachment: true,
|
14797 | backgroundColor: true,
|
14798 | backgroundImage: true,
|
14799 | backgroundPositionX: true,
|
14800 | backgroundPositionY: true,
|
14801 | backgroundRepeat: true
|
14802 | },
|
14803 | backgroundPosition: {
|
14804 | backgroundPositionX: true,
|
14805 | backgroundPositionY: true
|
14806 | },
|
14807 | border: {
|
14808 | borderWidth: true,
|
14809 | borderStyle: true,
|
14810 | borderColor: true
|
14811 | },
|
14812 | borderBottom: {
|
14813 | borderBottomWidth: true,
|
14814 | borderBottomStyle: true,
|
14815 | borderBottomColor: true
|
14816 | },
|
14817 | borderLeft: {
|
14818 | borderLeftWidth: true,
|
14819 | borderLeftStyle: true,
|
14820 | borderLeftColor: true
|
14821 | },
|
14822 | borderRight: {
|
14823 | borderRightWidth: true,
|
14824 | borderRightStyle: true,
|
14825 | borderRightColor: true
|
14826 | },
|
14827 | borderTop: {
|
14828 | borderTopWidth: true,
|
14829 | borderTopStyle: true,
|
14830 | borderTopColor: true
|
14831 | },
|
14832 | font: {
|
14833 | fontStyle: true,
|
14834 | fontVariant: true,
|
14835 | fontWeight: true,
|
14836 | fontSize: true,
|
14837 | lineHeight: true,
|
14838 | fontFamily: true
|
14839 | },
|
14840 | outline: {
|
14841 | outlineWidth: true,
|
14842 | outlineStyle: true,
|
14843 | outlineColor: true
|
14844 | }
|
14845 | };
|
14846 |
|
14847 | var CSSProperty = {
|
14848 | isUnitlessNumber: isUnitlessNumber,
|
14849 | shorthandPropertyExpansions: shorthandPropertyExpansions
|
14850 | };
|
14851 |
|
14852 | module.exports = CSSProperty;
|
14853 | },{}],162:[function(require,module,exports){
|
14854 | (function (process){
|
14855 |
|
14856 |
|
14857 |
|
14858 |
|
14859 |
|
14860 |
|
14861 |
|
14862 |
|
14863 |
|
14864 |
|
14865 |
|
14866 | 'use strict';
|
14867 |
|
14868 | var CSSProperty = require(161);
|
14869 | var ExecutionEnvironment = require(31);
|
14870 | var ReactInstrumentation = require(228);
|
14871 |
|
14872 | var camelizeStyleName = require(33);
|
14873 | var dangerousStyleValue = require(271);
|
14874 | var hyphenateStyleName = require(44);
|
14875 | var memoizeStringOnly = require(51);
|
14876 | var warning = require(55);
|
14877 |
|
14878 | var processStyleName = memoizeStringOnly(function (styleName) {
|
14879 | return hyphenateStyleName(styleName);
|
14880 | });
|
14881 |
|
14882 | var hasShorthandPropertyBug = false;
|
14883 | var styleFloatAccessor = 'cssFloat';
|
14884 | if (ExecutionEnvironment.canUseDOM) {
|
14885 | var tempStyle = document.createElement('div').style;
|
14886 | try {
|
14887 |
|
14888 | tempStyle.font = '';
|
14889 | } catch (e) {
|
14890 | hasShorthandPropertyBug = true;
|
14891 | }
|
14892 |
|
14893 | if (document.documentElement.style.cssFloat === undefined) {
|
14894 | styleFloatAccessor = 'styleFloat';
|
14895 | }
|
14896 | }
|
14897 |
|
14898 | if (process.env.NODE_ENV !== 'production') {
|
14899 |
|
14900 | var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
14901 |
|
14902 |
|
14903 | var badStyleValueWithSemicolonPattern = /;\s*$/;
|
14904 |
|
14905 | var warnedStyleNames = {};
|
14906 | var warnedStyleValues = {};
|
14907 | var warnedForNaNValue = false;
|
14908 |
|
14909 | var warnHyphenatedStyleName = function (name, owner) {
|
14910 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
14911 | return;
|
14912 | }
|
14913 |
|
14914 | warnedStyleNames[name] = true;
|
14915 | process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
|
14916 | };
|
14917 |
|
14918 | var warnBadVendoredStyleName = function (name, owner) {
|
14919 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
14920 | return;
|
14921 | }
|
14922 |
|
14923 | warnedStyleNames[name] = true;
|
14924 | process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
|
14925 | };
|
14926 |
|
14927 | var warnStyleValueWithSemicolon = function (name, value, owner) {
|
14928 | if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
14929 | return;
|
14930 | }
|
14931 |
|
14932 | warnedStyleValues[value] = true;
|
14933 | process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
|
14934 | };
|
14935 |
|
14936 | var warnStyleValueIsNaN = function (name, value, owner) {
|
14937 | if (warnedForNaNValue) {
|
14938 | return;
|
14939 | }
|
14940 |
|
14941 | warnedForNaNValue = true;
|
14942 | process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
|
14943 | };
|
14944 |
|
14945 | var checkRenderMessage = function (owner) {
|
14946 | if (owner) {
|
14947 | var name = owner.getName();
|
14948 | if (name) {
|
14949 | return ' Check the render method of `' + name + '`.';
|
14950 | }
|
14951 | }
|
14952 | return '';
|
14953 | };
|
14954 |
|
14955 | |
14956 |
|
14957 |
|
14958 |
|
14959 |
|
14960 | var warnValidStyle = function (name, value, component) {
|
14961 | var owner;
|
14962 | if (component) {
|
14963 | owner = component._currentElement._owner;
|
14964 | }
|
14965 | if (name.indexOf('-') > -1) {
|
14966 | warnHyphenatedStyleName(name, owner);
|
14967 | } else if (badVendoredStyleNamePattern.test(name)) {
|
14968 | warnBadVendoredStyleName(name, owner);
|
14969 | } else if (badStyleValueWithSemicolonPattern.test(value)) {
|
14970 | warnStyleValueWithSemicolon(name, value, owner);
|
14971 | }
|
14972 |
|
14973 | if (typeof value === 'number' && isNaN(value)) {
|
14974 | warnStyleValueIsNaN(name, value, owner);
|
14975 | }
|
14976 | };
|
14977 | }
|
14978 |
|
14979 |
|
14980 |
|
14981 |
|
14982 | var CSSPropertyOperations = {
|
14983 |
|
14984 | |
14985 |
|
14986 |
|
14987 |
|
14988 |
|
14989 |
|
14990 |
|
14991 |
|
14992 |
|
14993 |
|
14994 |
|
14995 |
|
14996 |
|
14997 | createMarkupForStyles: function (styles, component) {
|
14998 | var serialized = '';
|
14999 | for (var styleName in styles) {
|
15000 | if (!styles.hasOwnProperty(styleName)) {
|
15001 | continue;
|
15002 | }
|
15003 | var styleValue = styles[styleName];
|
15004 | if (process.env.NODE_ENV !== 'production') {
|
15005 | warnValidStyle(styleName, styleValue, component);
|
15006 | }
|
15007 | if (styleValue != null) {
|
15008 | serialized += processStyleName(styleName) + ':';
|
15009 | serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
|
15010 | }
|
15011 | }
|
15012 | return serialized || null;
|
15013 | },
|
15014 |
|
15015 | |
15016 |
|
15017 |
|
15018 |
|
15019 |
|
15020 |
|
15021 |
|
15022 |
|
15023 | setValueForStyles: function (node, styles, component) {
|
15024 | if (process.env.NODE_ENV !== 'production') {
|
15025 | ReactInstrumentation.debugTool.onNativeOperation(component._debugID, 'update styles', styles);
|
15026 | }
|
15027 |
|
15028 | var style = node.style;
|
15029 | for (var styleName in styles) {
|
15030 | if (!styles.hasOwnProperty(styleName)) {
|
15031 | continue;
|
15032 | }
|
15033 | if (process.env.NODE_ENV !== 'production') {
|
15034 | warnValidStyle(styleName, styles[styleName], component);
|
15035 | }
|
15036 | var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
|
15037 | if (styleName === 'float' || styleName === 'cssFloat') {
|
15038 | styleName = styleFloatAccessor;
|
15039 | }
|
15040 | if (styleValue) {
|
15041 | style[styleName] = styleValue;
|
15042 | } else {
|
15043 | var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
|
15044 | if (expansion) {
|
15045 |
|
15046 |
|
15047 | for (var individualStyleName in expansion) {
|
15048 | style[individualStyleName] = '';
|
15049 | }
|
15050 | } else {
|
15051 | style[styleName] = '';
|
15052 | }
|
15053 | }
|
15054 | }
|
15055 | }
|
15056 |
|
15057 | };
|
15058 |
|
15059 | module.exports = CSSPropertyOperations;
|
15060 | }).call(this,require(91))
|
15061 | },{"161":161,"228":228,"271":271,"31":31,"33":33,"44":44,"51":51,"55":55,"91":91}],163:[function(require,module,exports){
|
15062 | (function (process){
|
15063 |
|
15064 |
|
15065 |
|
15066 |
|
15067 |
|
15068 |
|
15069 |
|
15070 |
|
15071 |
|
15072 |
|
15073 |
|
15074 | 'use strict';
|
15075 |
|
15076 | var _assign = require(296);
|
15077 |
|
15078 | var PooledClass = require(183);
|
15079 |
|
15080 | var invariant = require(45);
|
15081 |
|
15082 |
|
15083 |
|
15084 |
|
15085 |
|
15086 |
|
15087 |
|
15088 |
|
15089 |
|
15090 |
|
15091 |
|
15092 |
|
15093 | function CallbackQueue() {
|
15094 | this._callbacks = null;
|
15095 | this._contexts = null;
|
15096 | }
|
15097 |
|
15098 | _assign(CallbackQueue.prototype, {
|
15099 |
|
15100 | |
15101 |
|
15102 |
|
15103 |
|
15104 |
|
15105 |
|
15106 |
|
15107 | enqueue: function (callback, context) {
|
15108 | this._callbacks = this._callbacks || [];
|
15109 | this._contexts = this._contexts || [];
|
15110 | this._callbacks.push(callback);
|
15111 | this._contexts.push(context);
|
15112 | },
|
15113 |
|
15114 | |
15115 |
|
15116 |
|
15117 |
|
15118 |
|
15119 |
|
15120 | notifyAll: function () {
|
15121 | var callbacks = this._callbacks;
|
15122 | var contexts = this._contexts;
|
15123 | if (callbacks) {
|
15124 | !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : void 0;
|
15125 | this._callbacks = null;
|
15126 | this._contexts = null;
|
15127 | for (var i = 0; i < callbacks.length; i++) {
|
15128 | callbacks[i].call(contexts[i]);
|
15129 | }
|
15130 | callbacks.length = 0;
|
15131 | contexts.length = 0;
|
15132 | }
|
15133 | },
|
15134 |
|
15135 | checkpoint: function () {
|
15136 | return this._callbacks ? this._callbacks.length : 0;
|
15137 | },
|
15138 |
|
15139 | rollback: function (len) {
|
15140 | if (this._callbacks) {
|
15141 | this._callbacks.length = len;
|
15142 | this._contexts.length = len;
|
15143 | }
|
15144 | },
|
15145 |
|
15146 | |
15147 |
|
15148 |
|
15149 |
|
15150 |
|
15151 | reset: function () {
|
15152 | this._callbacks = null;
|
15153 | this._contexts = null;
|
15154 | },
|
15155 |
|
15156 | |
15157 |
|
15158 |
|
15159 | destructor: function () {
|
15160 | this.reset();
|
15161 | }
|
15162 |
|
15163 | });
|
15164 |
|
15165 | PooledClass.addPoolingTo(CallbackQueue);
|
15166 |
|
15167 | module.exports = CallbackQueue;
|
15168 | }).call(this,require(91))
|
15169 | },{"183":183,"296":296,"45":45,"91":91}],164:[function(require,module,exports){
|
15170 |
|
15171 |
|
15172 |
|
15173 |
|
15174 |
|
15175 |
|
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 | 'use strict';
|
15182 |
|
15183 | var EventConstants = require(174);
|
15184 | var EventPluginHub = require(175);
|
15185 | var EventPropagators = require(178);
|
15186 | var ExecutionEnvironment = require(31);
|
15187 | var ReactDOMComponentTree = require(199);
|
15188 | var ReactUpdates = require(247);
|
15189 | var SyntheticEvent = require(256);
|
15190 |
|
15191 | var getEventTarget = require(279);
|
15192 | var isEventSupported = require(286);
|
15193 | var isTextInputElement = require(287);
|
15194 | var keyOf = require(49);
|
15195 |
|
15196 | var topLevelTypes = EventConstants.topLevelTypes;
|
15197 |
|
15198 | var eventTypes = {
|
15199 | change: {
|
15200 | phasedRegistrationNames: {
|
15201 | bubbled: keyOf({ onChange: null }),
|
15202 | captured: keyOf({ onChangeCapture: null })
|
15203 | },
|
15204 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
|
15205 | }
|
15206 | };
|
15207 |
|
15208 |
|
15209 |
|
15210 |
|
15211 | var activeElement = null;
|
15212 | var activeElementInst = null;
|
15213 | var activeElementValue = null;
|
15214 | var activeElementValueProp = null;
|
15215 |
|
15216 |
|
15217 |
|
15218 |
|
15219 | function shouldUseChangeEvent(elem) {
|
15220 | var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
|
15221 | return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
|
15222 | }
|
15223 |
|
15224 | var doesChangeEventBubble = false;
|
15225 | if (ExecutionEnvironment.canUseDOM) {
|
15226 |
|
15227 | doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
|
15228 | }
|
15229 |
|
15230 | function manualDispatchChangeEvent(nativeEvent) {
|
15231 | var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
|
15232 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
15233 |
|
15234 |
|
15235 |
|
15236 |
|
15237 |
|
15238 |
|
15239 |
|
15240 |
|
15241 |
|
15242 |
|
15243 |
|
15244 |
|
15245 | ReactUpdates.batchedUpdates(runEventInBatch, event);
|
15246 | }
|
15247 |
|
15248 | function runEventInBatch(event) {
|
15249 | EventPluginHub.enqueueEvents(event);
|
15250 | EventPluginHub.processEventQueue(false);
|
15251 | }
|
15252 |
|
15253 | function startWatchingForChangeEventIE8(target, targetInst) {
|
15254 | activeElement = target;
|
15255 | activeElementInst = targetInst;
|
15256 | activeElement.attachEvent('onchange', manualDispatchChangeEvent);
|
15257 | }
|
15258 |
|
15259 | function stopWatchingForChangeEventIE8() {
|
15260 | if (!activeElement) {
|
15261 | return;
|
15262 | }
|
15263 | activeElement.detachEvent('onchange', manualDispatchChangeEvent);
|
15264 | activeElement = null;
|
15265 | activeElementInst = null;
|
15266 | }
|
15267 |
|
15268 | function getTargetInstForChangeEvent(topLevelType, targetInst) {
|
15269 | if (topLevelType === topLevelTypes.topChange) {
|
15270 | return targetInst;
|
15271 | }
|
15272 | }
|
15273 | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
|
15274 | if (topLevelType === topLevelTypes.topFocus) {
|
15275 |
|
15276 |
|
15277 | stopWatchingForChangeEventIE8();
|
15278 | startWatchingForChangeEventIE8(target, targetInst);
|
15279 | } else if (topLevelType === topLevelTypes.topBlur) {
|
15280 | stopWatchingForChangeEventIE8();
|
15281 | }
|
15282 | }
|
15283 |
|
15284 |
|
15285 |
|
15286 |
|
15287 | var isInputEventSupported = false;
|
15288 | if (ExecutionEnvironment.canUseDOM) {
|
15289 |
|
15290 |
|
15291 |
|
15292 |
|
15293 | isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11);
|
15294 | }
|
15295 |
|
15296 |
|
15297 |
|
15298 |
|
15299 |
|
15300 | var newValueProp = {
|
15301 | get: function () {
|
15302 | return activeElementValueProp.get.call(this);
|
15303 | },
|
15304 | set: function (val) {
|
15305 |
|
15306 | activeElementValue = '' + val;
|
15307 | activeElementValueProp.set.call(this, val);
|
15308 | }
|
15309 | };
|
15310 |
|
15311 |
|
15312 |
|
15313 |
|
15314 |
|
15315 |
|
15316 | function startWatchingForValueChange(target, targetInst) {
|
15317 | activeElement = target;
|
15318 | activeElementInst = targetInst;
|
15319 | activeElementValue = target.value;
|
15320 | activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
|
15321 |
|
15322 |
|
15323 |
|
15324 | Object.defineProperty(activeElement, 'value', newValueProp);
|
15325 | if (activeElement.attachEvent) {
|
15326 | activeElement.attachEvent('onpropertychange', handlePropertyChange);
|
15327 | } else {
|
15328 | activeElement.addEventListener('propertychange', handlePropertyChange, false);
|
15329 | }
|
15330 | }
|
15331 |
|
15332 |
|
15333 |
|
15334 |
|
15335 |
|
15336 | function stopWatchingForValueChange() {
|
15337 | if (!activeElement) {
|
15338 | return;
|
15339 | }
|
15340 |
|
15341 |
|
15342 | delete activeElement.value;
|
15343 |
|
15344 | if (activeElement.detachEvent) {
|
15345 | activeElement.detachEvent('onpropertychange', handlePropertyChange);
|
15346 | } else {
|
15347 | activeElement.removeEventListener('propertychange', handlePropertyChange, false);
|
15348 | }
|
15349 |
|
15350 | activeElement = null;
|
15351 | activeElementInst = null;
|
15352 | activeElementValue = null;
|
15353 | activeElementValueProp = null;
|
15354 | }
|
15355 |
|
15356 |
|
15357 |
|
15358 |
|
15359 |
|
15360 | function handlePropertyChange(nativeEvent) {
|
15361 | if (nativeEvent.propertyName !== 'value') {
|
15362 | return;
|
15363 | }
|
15364 | var value = nativeEvent.srcElement.value;
|
15365 | if (value === activeElementValue) {
|
15366 | return;
|
15367 | }
|
15368 | activeElementValue = value;
|
15369 |
|
15370 | manualDispatchChangeEvent(nativeEvent);
|
15371 | }
|
15372 |
|
15373 |
|
15374 |
|
15375 |
|
15376 | function getTargetInstForInputEvent(topLevelType, targetInst) {
|
15377 | if (topLevelType === topLevelTypes.topInput) {
|
15378 |
|
15379 |
|
15380 | return targetInst;
|
15381 | }
|
15382 | }
|
15383 |
|
15384 | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
|
15385 | if (topLevelType === topLevelTypes.topFocus) {
|
15386 |
|
15387 |
|
15388 |
|
15389 |
|
15390 |
|
15391 |
|
15392 |
|
15393 |
|
15394 |
|
15395 |
|
15396 |
|
15397 |
|
15398 |
|
15399 | stopWatchingForValueChange();
|
15400 | startWatchingForValueChange(target, targetInst);
|
15401 | } else if (topLevelType === topLevelTypes.topBlur) {
|
15402 | stopWatchingForValueChange();
|
15403 | }
|
15404 | }
|
15405 |
|
15406 |
|
15407 | function getTargetInstForInputEventIE(topLevelType, targetInst) {
|
15408 | if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
|
15409 |
|
15410 |
|
15411 |
|
15412 |
|
15413 |
|
15414 |
|
15415 |
|
15416 |
|
15417 |
|
15418 |
|
15419 | if (activeElement && activeElement.value !== activeElementValue) {
|
15420 | activeElementValue = activeElement.value;
|
15421 | return activeElementInst;
|
15422 | }
|
15423 | }
|
15424 | }
|
15425 |
|
15426 |
|
15427 |
|
15428 |
|
15429 | function shouldUseClickEvent(elem) {
|
15430 |
|
15431 |
|
15432 |
|
15433 | return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
|
15434 | }
|
15435 |
|
15436 | function getTargetInstForClickEvent(topLevelType, targetInst) {
|
15437 | if (topLevelType === topLevelTypes.topClick) {
|
15438 | return targetInst;
|
15439 | }
|
15440 | }
|
15441 |
|
15442 |
|
15443 |
|
15444 |
|
15445 |
|
15446 |
|
15447 |
|
15448 |
|
15449 |
|
15450 |
|
15451 |
|
15452 | var ChangeEventPlugin = {
|
15453 |
|
15454 | eventTypes: eventTypes,
|
15455 |
|
15456 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
15457 | var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
|
15458 |
|
15459 | var getTargetInstFunc, handleEventFunc;
|
15460 | if (shouldUseChangeEvent(targetNode)) {
|
15461 | if (doesChangeEventBubble) {
|
15462 | getTargetInstFunc = getTargetInstForChangeEvent;
|
15463 | } else {
|
15464 | handleEventFunc = handleEventsForChangeEventIE8;
|
15465 | }
|
15466 | } else if (isTextInputElement(targetNode)) {
|
15467 | if (isInputEventSupported) {
|
15468 | getTargetInstFunc = getTargetInstForInputEvent;
|
15469 | } else {
|
15470 | getTargetInstFunc = getTargetInstForInputEventIE;
|
15471 | handleEventFunc = handleEventsForInputEventIE;
|
15472 | }
|
15473 | } else if (shouldUseClickEvent(targetNode)) {
|
15474 | getTargetInstFunc = getTargetInstForClickEvent;
|
15475 | }
|
15476 |
|
15477 | if (getTargetInstFunc) {
|
15478 | var inst = getTargetInstFunc(topLevelType, targetInst);
|
15479 | if (inst) {
|
15480 | var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
|
15481 | event.type = 'change';
|
15482 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
15483 | return event;
|
15484 | }
|
15485 | }
|
15486 |
|
15487 | if (handleEventFunc) {
|
15488 | handleEventFunc(topLevelType, targetNode, targetInst);
|
15489 | }
|
15490 | }
|
15491 |
|
15492 | };
|
15493 |
|
15494 | module.exports = ChangeEventPlugin;
|
15495 | },{"174":174,"175":175,"178":178,"199":199,"247":247,"256":256,"279":279,"286":286,"287":287,"31":31,"49":49}],165:[function(require,module,exports){
|
15496 | (function (process){
|
15497 |
|
15498 |
|
15499 |
|
15500 |
|
15501 |
|
15502 |
|
15503 |
|
15504 |
|
15505 |
|
15506 |
|
15507 |
|
15508 | 'use strict';
|
15509 |
|
15510 | var DOMLazyTree = require(166);
|
15511 | var Danger = require(170);
|
15512 | var ReactMultiChildUpdateTypes = require(233);
|
15513 | var ReactDOMComponentTree = require(199);
|
15514 | var ReactInstrumentation = require(228);
|
15515 |
|
15516 | var createMicrosoftUnsafeLocalFunction = require(270);
|
15517 | var setInnerHTML = require(291);
|
15518 | var setTextContent = require(292);
|
15519 |
|
15520 | function getNodeAfter(parentNode, node) {
|
15521 |
|
15522 |
|
15523 | if (Array.isArray(node)) {
|
15524 | node = node[1];
|
15525 | }
|
15526 | return node ? node.nextSibling : parentNode.firstChild;
|
15527 | }
|
15528 |
|
15529 |
|
15530 |
|
15531 |
|
15532 |
|
15533 |
|
15534 |
|
15535 |
|
15536 |
|
15537 | var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
|
15538 |
|
15539 |
|
15540 |
|
15541 | parentNode.insertBefore(childNode, referenceNode);
|
15542 | });
|
15543 |
|
15544 | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
|
15545 | DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
|
15546 | }
|
15547 |
|
15548 | function moveChild(parentNode, childNode, referenceNode) {
|
15549 | if (Array.isArray(childNode)) {
|
15550 | moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
|
15551 | } else {
|
15552 | insertChildAt(parentNode, childNode, referenceNode);
|
15553 | }
|
15554 | }
|
15555 |
|
15556 | function removeChild(parentNode, childNode) {
|
15557 | if (Array.isArray(childNode)) {
|
15558 | var closingComment = childNode[1];
|
15559 | childNode = childNode[0];
|
15560 | removeDelimitedText(parentNode, childNode, closingComment);
|
15561 | parentNode.removeChild(closingComment);
|
15562 | }
|
15563 | parentNode.removeChild(childNode);
|
15564 | }
|
15565 |
|
15566 | function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
|
15567 | var node = openingComment;
|
15568 | while (true) {
|
15569 | var nextNode = node.nextSibling;
|
15570 | insertChildAt(parentNode, node, referenceNode);
|
15571 | if (node === closingComment) {
|
15572 | break;
|
15573 | }
|
15574 | node = nextNode;
|
15575 | }
|
15576 | }
|
15577 |
|
15578 | function removeDelimitedText(parentNode, startNode, closingComment) {
|
15579 | while (true) {
|
15580 | var node = startNode.nextSibling;
|
15581 | if (node === closingComment) {
|
15582 |
|
15583 | break;
|
15584 | } else {
|
15585 | parentNode.removeChild(node);
|
15586 | }
|
15587 | }
|
15588 | }
|
15589 |
|
15590 | function replaceDelimitedText(openingComment, closingComment, stringText) {
|
15591 | var parentNode = openingComment.parentNode;
|
15592 | var nodeAfterComment = openingComment.nextSibling;
|
15593 | if (nodeAfterComment === closingComment) {
|
15594 |
|
15595 |
|
15596 | if (stringText) {
|
15597 | insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
|
15598 | }
|
15599 | } else {
|
15600 | if (stringText) {
|
15601 |
|
15602 |
|
15603 | setTextContent(nodeAfterComment, stringText);
|
15604 | removeDelimitedText(parentNode, nodeAfterComment, closingComment);
|
15605 | } else {
|
15606 | removeDelimitedText(parentNode, openingComment, closingComment);
|
15607 | }
|
15608 | }
|
15609 |
|
15610 | if (process.env.NODE_ENV !== 'production') {
|
15611 | ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
|
15612 | }
|
15613 | }
|
15614 |
|
15615 | var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
|
15616 | if (process.env.NODE_ENV !== 'production') {
|
15617 | dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
|
15618 | Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
|
15619 | if (prevInstance._debugID !== 0) {
|
15620 | ReactInstrumentation.debugTool.onNativeOperation(prevInstance._debugID, 'replace with', markup.toString());
|
15621 | } else {
|
15622 | var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
|
15623 | if (nextInstance._debugID !== 0) {
|
15624 | ReactInstrumentation.debugTool.onNativeOperation(nextInstance._debugID, 'mount', markup.toString());
|
15625 | }
|
15626 | }
|
15627 | };
|
15628 | }
|
15629 |
|
15630 |
|
15631 |
|
15632 |
|
15633 | var DOMChildrenOperations = {
|
15634 |
|
15635 | dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
|
15636 |
|
15637 | replaceDelimitedText: replaceDelimitedText,
|
15638 |
|
15639 | |
15640 |
|
15641 |
|
15642 |
|
15643 |
|
15644 |
|
15645 |
|
15646 | processUpdates: function (parentNode, updates) {
|
15647 | if (process.env.NODE_ENV !== 'production') {
|
15648 | var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
|
15649 | }
|
15650 |
|
15651 | for (var k = 0; k < updates.length; k++) {
|
15652 | var update = updates[k];
|
15653 | switch (update.type) {
|
15654 | case ReactMultiChildUpdateTypes.INSERT_MARKUP:
|
15655 | insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
|
15656 | if (process.env.NODE_ENV !== 'production') {
|
15657 | ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
|
15658 | }
|
15659 | break;
|
15660 | case ReactMultiChildUpdateTypes.MOVE_EXISTING:
|
15661 | moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
|
15662 | if (process.env.NODE_ENV !== 'production') {
|
15663 | ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
|
15664 | }
|
15665 | break;
|
15666 | case ReactMultiChildUpdateTypes.SET_MARKUP:
|
15667 | setInnerHTML(parentNode, update.content);
|
15668 | if (process.env.NODE_ENV !== 'production') {
|
15669 | ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace children', update.content.toString());
|
15670 | }
|
15671 | break;
|
15672 | case ReactMultiChildUpdateTypes.TEXT_CONTENT:
|
15673 | setTextContent(parentNode, update.content);
|
15674 | if (process.env.NODE_ENV !== 'production') {
|
15675 | ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace text', update.content.toString());
|
15676 | }
|
15677 | break;
|
15678 | case ReactMultiChildUpdateTypes.REMOVE_NODE:
|
15679 | removeChild(parentNode, update.fromNode);
|
15680 | if (process.env.NODE_ENV !== 'production') {
|
15681 | ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
|
15682 | }
|
15683 | break;
|
15684 | }
|
15685 | }
|
15686 | }
|
15687 |
|
15688 | };
|
15689 |
|
15690 | module.exports = DOMChildrenOperations;
|
15691 | }).call(this,require(91))
|
15692 | },{"166":166,"170":170,"199":199,"228":228,"233":233,"270":270,"291":291,"292":292,"91":91}],166:[function(require,module,exports){
|
15693 |
|
15694 |
|
15695 |
|
15696 |
|
15697 |
|
15698 |
|
15699 |
|
15700 |
|
15701 |
|
15702 |
|
15703 |
|
15704 | 'use strict';
|
15705 |
|
15706 | var DOMNamespaces = require(167);
|
15707 |
|
15708 | var createMicrosoftUnsafeLocalFunction = require(270);
|
15709 | var setTextContent = require(292);
|
15710 |
|
15711 | var ELEMENT_NODE_TYPE = 1;
|
15712 | var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
15713 |
|
15714 |
|
15715 |
|
15716 |
|
15717 |
|
15718 |
|
15719 |
|
15720 |
|
15721 |
|
15722 |
|
15723 |
|
15724 |
|
15725 | var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
|
15726 |
|
15727 | function insertTreeChildren(tree) {
|
15728 | if (!enableLazy) {
|
15729 | return;
|
15730 | }
|
15731 | var node = tree.node;
|
15732 | var children = tree.children;
|
15733 | if (children.length) {
|
15734 | for (var i = 0; i < children.length; i++) {
|
15735 | insertTreeBefore(node, children[i], null);
|
15736 | }
|
15737 | } else if (tree.html != null) {
|
15738 | node.innerHTML = tree.html;
|
15739 | } else if (tree.text != null) {
|
15740 | setTextContent(node, tree.text);
|
15741 | }
|
15742 | }
|
15743 |
|
15744 | var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
|
15745 |
|
15746 |
|
15747 |
|
15748 |
|
15749 |
|
15750 |
|
15751 | if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
|
15752 | insertTreeChildren(tree);
|
15753 | parentNode.insertBefore(tree.node, referenceNode);
|
15754 | } else {
|
15755 | parentNode.insertBefore(tree.node, referenceNode);
|
15756 | insertTreeChildren(tree);
|
15757 | }
|
15758 | });
|
15759 |
|
15760 | function replaceChildWithTree(oldNode, newTree) {
|
15761 | oldNode.parentNode.replaceChild(newTree.node, oldNode);
|
15762 | insertTreeChildren(newTree);
|
15763 | }
|
15764 |
|
15765 | function queueChild(parentTree, childTree) {
|
15766 | if (enableLazy) {
|
15767 | parentTree.children.push(childTree);
|
15768 | } else {
|
15769 | parentTree.node.appendChild(childTree.node);
|
15770 | }
|
15771 | }
|
15772 |
|
15773 | function queueHTML(tree, html) {
|
15774 | if (enableLazy) {
|
15775 | tree.html = html;
|
15776 | } else {
|
15777 | tree.node.innerHTML = html;
|
15778 | }
|
15779 | }
|
15780 |
|
15781 | function queueText(tree, text) {
|
15782 | if (enableLazy) {
|
15783 | tree.text = text;
|
15784 | } else {
|
15785 | setTextContent(tree.node, text);
|
15786 | }
|
15787 | }
|
15788 |
|
15789 | function toString() {
|
15790 | return this.node.nodeName;
|
15791 | }
|
15792 |
|
15793 | function DOMLazyTree(node) {
|
15794 | return {
|
15795 | node: node,
|
15796 | children: [],
|
15797 | html: null,
|
15798 | text: null,
|
15799 | toString: toString
|
15800 | };
|
15801 | }
|
15802 |
|
15803 | DOMLazyTree.insertTreeBefore = insertTreeBefore;
|
15804 | DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
|
15805 | DOMLazyTree.queueChild = queueChild;
|
15806 | DOMLazyTree.queueHTML = queueHTML;
|
15807 | DOMLazyTree.queueText = queueText;
|
15808 |
|
15809 | module.exports = DOMLazyTree;
|
15810 | },{"167":167,"270":270,"292":292}],167:[function(require,module,exports){
|
15811 |
|
15812 |
|
15813 |
|
15814 |
|
15815 |
|
15816 |
|
15817 |
|
15818 |
|
15819 |
|
15820 |
|
15821 |
|
15822 | 'use strict';
|
15823 |
|
15824 | var DOMNamespaces = {
|
15825 | html: 'http://www.w3.org/1999/xhtml',
|
15826 | mathml: 'http://www.w3.org/1998/Math/MathML',
|
15827 | svg: 'http://www.w3.org/2000/svg'
|
15828 | };
|
15829 |
|
15830 | module.exports = DOMNamespaces;
|
15831 | },{}],168:[function(require,module,exports){
|
15832 | (function (process){
|
15833 |
|
15834 |
|
15835 |
|
15836 |
|
15837 |
|
15838 |
|
15839 |
|
15840 |
|
15841 |
|
15842 |
|
15843 |
|
15844 | 'use strict';
|
15845 |
|
15846 | var invariant = require(45);
|
15847 |
|
15848 | function checkMask(value, bitmask) {
|
15849 | return (value & bitmask) === bitmask;
|
15850 | }
|
15851 |
|
15852 | var DOMPropertyInjection = {
|
15853 | |
15854 |
|
15855 |
|
15856 |
|
15857 | MUST_USE_PROPERTY: 0x1,
|
15858 | HAS_SIDE_EFFECTS: 0x2,
|
15859 | HAS_BOOLEAN_VALUE: 0x4,
|
15860 | HAS_NUMERIC_VALUE: 0x8,
|
15861 | HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
|
15862 | HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
|
15863 |
|
15864 | |
15865 |
|
15866 |
|
15867 |
|
15868 |
|
15869 |
|
15870 |
|
15871 |
|
15872 |
|
15873 |
|
15874 |
|
15875 |
|
15876 |
|
15877 |
|
15878 |
|
15879 |
|
15880 |
|
15881 |
|
15882 |
|
15883 |
|
15884 |
|
15885 |
|
15886 |
|
15887 |
|
15888 |
|
15889 |
|
15890 |
|
15891 |
|
15892 | injectDOMPropertyConfig: function (domPropertyConfig) {
|
15893 | var Injection = DOMPropertyInjection;
|
15894 | var Properties = domPropertyConfig.Properties || {};
|
15895 | var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
|
15896 | var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
|
15897 | var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
|
15898 | var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
|
15899 |
|
15900 | if (domPropertyConfig.isCustomAttribute) {
|
15901 | DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
|
15902 | }
|
15903 |
|
15904 | for (var propName in Properties) {
|
15905 | !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : void 0;
|
15906 |
|
15907 | var lowerCased = propName.toLowerCase();
|
15908 | var propConfig = Properties[propName];
|
15909 |
|
15910 | var propertyInfo = {
|
15911 | attributeName: lowerCased,
|
15912 | attributeNamespace: null,
|
15913 | propertyName: propName,
|
15914 | mutationMethod: null,
|
15915 |
|
15916 | mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
|
15917 | hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
|
15918 | hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
|
15919 | hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
|
15920 | hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
|
15921 | hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
|
15922 | };
|
15923 |
|
15924 | !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : void 0;
|
15925 | !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : void 0;
|
15926 |
|
15927 | if (process.env.NODE_ENV !== 'production') {
|
15928 | DOMProperty.getPossibleStandardName[lowerCased] = propName;
|
15929 | }
|
15930 |
|
15931 | if (DOMAttributeNames.hasOwnProperty(propName)) {
|
15932 | var attributeName = DOMAttributeNames[propName];
|
15933 | propertyInfo.attributeName = attributeName;
|
15934 | if (process.env.NODE_ENV !== 'production') {
|
15935 | DOMProperty.getPossibleStandardName[attributeName] = propName;
|
15936 | }
|
15937 | }
|
15938 |
|
15939 | if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
|
15940 | propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
|
15941 | }
|
15942 |
|
15943 | if (DOMPropertyNames.hasOwnProperty(propName)) {
|
15944 | propertyInfo.propertyName = DOMPropertyNames[propName];
|
15945 | }
|
15946 |
|
15947 | if (DOMMutationMethods.hasOwnProperty(propName)) {
|
15948 | propertyInfo.mutationMethod = DOMMutationMethods[propName];
|
15949 | }
|
15950 |
|
15951 | DOMProperty.properties[propName] = propertyInfo;
|
15952 | }
|
15953 | }
|
15954 | };
|
15955 |
|
15956 |
|
15957 | var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
15958 |
|
15959 |
|
15960 |
|
15961 |
|
15962 |
|
15963 |
|
15964 |
|
15965 |
|
15966 |
|
15967 |
|
15968 |
|
15969 |
|
15970 |
|
15971 |
|
15972 |
|
15973 | var DOMProperty = {
|
15974 |
|
15975 | ID_ATTRIBUTE_NAME: 'data-reactid',
|
15976 | ROOT_ATTRIBUTE_NAME: 'data-reactroot',
|
15977 |
|
15978 | ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
|
15979 | ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\uB7\\u0300-\\u036F\\u203F-\\u2040',
|
15980 |
|
15981 | |
15982 |
|
15983 |
|
15984 |
|
15985 |
|
15986 |
|
15987 |
|
15988 |
|
15989 |
|
15990 |
|
15991 |
|
15992 |
|
15993 |
|
15994 |
|
15995 |
|
15996 |
|
15997 |
|
15998 |
|
15999 |
|
16000 |
|
16001 |
|
16002 |
|
16003 |
|
16004 |
|
16005 |
|
16006 |
|
16007 |
|
16008 |
|
16009 |
|
16010 |
|
16011 |
|
16012 |
|
16013 |
|
16014 | properties: {},
|
16015 |
|
16016 | |
16017 |
|
16018 |
|
16019 |
|
16020 |
|
16021 | getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null,
|
16022 |
|
16023 | |
16024 |
|
16025 |
|
16026 | _isCustomAttributeFunctions: [],
|
16027 |
|
16028 | |
16029 |
|
16030 |
|
16031 |
|
16032 | isCustomAttribute: function (attributeName) {
|
16033 | for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
|
16034 | var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
|
16035 | if (isCustomAttributeFn(attributeName)) {
|
16036 | return true;
|
16037 | }
|
16038 | }
|
16039 | return false;
|
16040 | },
|
16041 |
|
16042 | injection: DOMPropertyInjection
|
16043 | };
|
16044 |
|
16045 | module.exports = DOMProperty;
|
16046 | }).call(this,require(91))
|
16047 | },{"45":45,"91":91}],169:[function(require,module,exports){
|
16048 | (function (process){
|
16049 |
|
16050 |
|
16051 |
|
16052 |
|
16053 |
|
16054 |
|
16055 |
|
16056 |
|
16057 |
|
16058 |
|
16059 |
|
16060 | 'use strict';
|
16061 |
|
16062 | var DOMProperty = require(168);
|
16063 | var ReactDOMComponentTree = require(199);
|
16064 | var ReactDOMInstrumentation = require(207);
|
16065 | var ReactInstrumentation = require(228);
|
16066 |
|
16067 | var quoteAttributeValueForBrowser = require(289);
|
16068 | var warning = require(55);
|
16069 |
|
16070 | var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
|
16071 | var illegalAttributeNameCache = {};
|
16072 | var validatedAttributeNameCache = {};
|
16073 |
|
16074 | function isAttributeNameSafe(attributeName) {
|
16075 | if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
|
16076 | return true;
|
16077 | }
|
16078 | if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
|
16079 | return false;
|
16080 | }
|
16081 | if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
16082 | validatedAttributeNameCache[attributeName] = true;
|
16083 | return true;
|
16084 | }
|
16085 | illegalAttributeNameCache[attributeName] = true;
|
16086 | process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
|
16087 | return false;
|
16088 | }
|
16089 |
|
16090 | function shouldIgnoreValue(propertyInfo, value) {
|
16091 | return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
|
16092 | }
|
16093 |
|
16094 |
|
16095 |
|
16096 |
|
16097 | var DOMPropertyOperations = {
|
16098 |
|
16099 | |
16100 |
|
16101 |
|
16102 |
|
16103 |
|
16104 |
|
16105 | createMarkupForID: function (id) {
|
16106 | return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
|
16107 | },
|
16108 |
|
16109 | setAttributeForID: function (node, id) {
|
16110 | node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
|
16111 | },
|
16112 |
|
16113 | createMarkupForRoot: function () {
|
16114 | return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
|
16115 | },
|
16116 |
|
16117 | setAttributeForRoot: function (node) {
|
16118 | node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
|
16119 | },
|
16120 |
|
16121 | |
16122 |
|
16123 |
|
16124 |
|
16125 |
|
16126 |
|
16127 |
|
16128 | createMarkupForProperty: function (name, value) {
|
16129 | if (process.env.NODE_ENV !== 'production') {
|
16130 | ReactDOMInstrumentation.debugTool.onCreateMarkupForProperty(name, value);
|
16131 | }
|
16132 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
16133 | if (propertyInfo) {
|
16134 | if (shouldIgnoreValue(propertyInfo, value)) {
|
16135 | return '';
|
16136 | }
|
16137 | var attributeName = propertyInfo.attributeName;
|
16138 | if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
16139 | return attributeName + '=""';
|
16140 | }
|
16141 | return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
16142 | } else if (DOMProperty.isCustomAttribute(name)) {
|
16143 | if (value == null) {
|
16144 | return '';
|
16145 | }
|
16146 | return name + '=' + quoteAttributeValueForBrowser(value);
|
16147 | }
|
16148 | return null;
|
16149 | },
|
16150 |
|
16151 | |
16152 |
|
16153 |
|
16154 |
|
16155 |
|
16156 |
|
16157 |
|
16158 | createMarkupForCustomAttribute: function (name, value) {
|
16159 | if (!isAttributeNameSafe(name) || value == null) {
|
16160 | return '';
|
16161 | }
|
16162 | return name + '=' + quoteAttributeValueForBrowser(value);
|
16163 | },
|
16164 |
|
16165 | |
16166 |
|
16167 |
|
16168 |
|
16169 |
|
16170 |
|
16171 |
|
16172 | setValueForProperty: function (node, name, value) {
|
16173 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
16174 | if (propertyInfo) {
|
16175 | var mutationMethod = propertyInfo.mutationMethod;
|
16176 | if (mutationMethod) {
|
16177 | mutationMethod(node, value);
|
16178 | } else if (shouldIgnoreValue(propertyInfo, value)) {
|
16179 | this.deleteValueForProperty(node, name);
|
16180 | return;
|
16181 | } else if (propertyInfo.mustUseProperty) {
|
16182 | var propName = propertyInfo.propertyName;
|
16183 |
|
16184 |
|
16185 | if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
|
16186 |
|
16187 |
|
16188 | node[propName] = value;
|
16189 | }
|
16190 | } else {
|
16191 | var attributeName = propertyInfo.attributeName;
|
16192 | var namespace = propertyInfo.attributeNamespace;
|
16193 |
|
16194 |
|
16195 | if (namespace) {
|
16196 | node.setAttributeNS(namespace, attributeName, '' + value);
|
16197 | } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
16198 | node.setAttribute(attributeName, '');
|
16199 | } else {
|
16200 | node.setAttribute(attributeName, '' + value);
|
16201 | }
|
16202 | }
|
16203 | } else if (DOMProperty.isCustomAttribute(name)) {
|
16204 | DOMPropertyOperations.setValueForAttribute(node, name, value);
|
16205 | return;
|
16206 | }
|
16207 |
|
16208 | if (process.env.NODE_ENV !== 'production') {
|
16209 | ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);
|
16210 | var payload = {};
|
16211 | payload[name] = value;
|
16212 | ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
|
16213 | }
|
16214 | },
|
16215 |
|
16216 | setValueForAttribute: function (node, name, value) {
|
16217 | if (!isAttributeNameSafe(name)) {
|
16218 | return;
|
16219 | }
|
16220 | if (value == null) {
|
16221 | node.removeAttribute(name);
|
16222 | } else {
|
16223 | node.setAttribute(name, '' + value);
|
16224 | }
|
16225 |
|
16226 | if (process.env.NODE_ENV !== 'production') {
|
16227 | var payload = {};
|
16228 | payload[name] = value;
|
16229 | ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
|
16230 | }
|
16231 | },
|
16232 |
|
16233 | |
16234 |
|
16235 |
|
16236 |
|
16237 |
|
16238 |
|
16239 | deleteValueForProperty: function (node, name) {
|
16240 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
16241 | if (propertyInfo) {
|
16242 | var mutationMethod = propertyInfo.mutationMethod;
|
16243 | if (mutationMethod) {
|
16244 | mutationMethod(node, undefined);
|
16245 | } else if (propertyInfo.mustUseProperty) {
|
16246 | var propName = propertyInfo.propertyName;
|
16247 | if (propertyInfo.hasBooleanValue) {
|
16248 |
|
16249 | node[propName] = false;
|
16250 | } else {
|
16251 | if (!propertyInfo.hasSideEffects || '' + node[propName] !== '') {
|
16252 | node[propName] = '';
|
16253 | }
|
16254 | }
|
16255 | } else {
|
16256 | node.removeAttribute(propertyInfo.attributeName);
|
16257 | }
|
16258 | } else if (DOMProperty.isCustomAttribute(name)) {
|
16259 | node.removeAttribute(name);
|
16260 | }
|
16261 |
|
16262 | if (process.env.NODE_ENV !== 'production') {
|
16263 | ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);
|
16264 | ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
|
16265 | }
|
16266 | }
|
16267 |
|
16268 | };
|
16269 |
|
16270 | module.exports = DOMPropertyOperations;
|
16271 | }).call(this,require(91))
|
16272 | },{"168":168,"199":199,"207":207,"228":228,"289":289,"55":55,"91":91}],170:[function(require,module,exports){
|
16273 | (function (process){
|
16274 |
|
16275 |
|
16276 |
|
16277 |
|
16278 |
|
16279 |
|
16280 |
|
16281 |
|
16282 |
|
16283 |
|
16284 |
|
16285 | 'use strict';
|
16286 |
|
16287 | var DOMLazyTree = require(166);
|
16288 | var ExecutionEnvironment = require(31);
|
16289 |
|
16290 | var createNodesFromMarkup = require(36);
|
16291 | var emptyFunction = require(37);
|
16292 | var getMarkupWrap = require(41);
|
16293 | var invariant = require(45);
|
16294 |
|
16295 | var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
|
16296 | var RESULT_INDEX_ATTR = 'data-danger-index';
|
16297 |
|
16298 |
|
16299 |
|
16300 |
|
16301 |
|
16302 |
|
16303 |
|
16304 |
|
16305 |
|
16306 |
|
16307 |
|
16308 |
|
16309 | function getNodeName(markup) {
|
16310 | return markup.substring(1, markup.indexOf(' '));
|
16311 | }
|
16312 |
|
16313 | var Danger = {
|
16314 |
|
16315 | |
16316 |
|
16317 |
|
16318 |
|
16319 |
|
16320 |
|
16321 |
|
16322 |
|
16323 |
|
16324 | dangerouslyRenderMarkup: function (markupList) {
|
16325 | !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : void 0;
|
16326 | var nodeName;
|
16327 | var markupByNodeName = {};
|
16328 |
|
16329 | for (var i = 0; i < markupList.length; i++) {
|
16330 | !markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : void 0;
|
16331 | nodeName = getNodeName(markupList[i]);
|
16332 | nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
|
16333 | markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
|
16334 | markupByNodeName[nodeName][i] = markupList[i];
|
16335 | }
|
16336 | var resultList = [];
|
16337 | var resultListAssignmentCount = 0;
|
16338 | for (nodeName in markupByNodeName) {
|
16339 | if (!markupByNodeName.hasOwnProperty(nodeName)) {
|
16340 | continue;
|
16341 | }
|
16342 | var markupListByNodeName = markupByNodeName[nodeName];
|
16343 |
|
16344 |
|
16345 |
|
16346 |
|
16347 | var resultIndex;
|
16348 | for (resultIndex in markupListByNodeName) {
|
16349 | if (markupListByNodeName.hasOwnProperty(resultIndex)) {
|
16350 | var markup = markupListByNodeName[resultIndex];
|
16351 |
|
16352 |
|
16353 |
|
16354 |
|
16355 | markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
|
16356 |
|
16357 | '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
|
16358 | }
|
16359 | }
|
16360 |
|
16361 |
|
16362 | var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction
|
16363 | );
|
16364 |
|
16365 | for (var j = 0; j < renderNodes.length; ++j) {
|
16366 | var renderNode = renderNodes[j];
|
16367 | if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
|
16368 |
|
16369 | resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
|
16370 | renderNode.removeAttribute(RESULT_INDEX_ATTR);
|
16371 |
|
16372 | !!resultList.hasOwnProperty(resultIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : void 0;
|
16373 |
|
16374 | resultList[resultIndex] = renderNode;
|
16375 |
|
16376 |
|
16377 |
|
16378 | resultListAssignmentCount += 1;
|
16379 | } else if (process.env.NODE_ENV !== 'production') {
|
16380 | console.error('Danger: Discarding unexpected node:', renderNode);
|
16381 | }
|
16382 | }
|
16383 | }
|
16384 |
|
16385 |
|
16386 |
|
16387 | !(resultListAssignmentCount === resultList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : void 0;
|
16388 |
|
16389 | !(resultList.length === markupList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : void 0;
|
16390 |
|
16391 | return resultList;
|
16392 | },
|
16393 |
|
16394 | |
16395 |
|
16396 |
|
16397 |
|
16398 |
|
16399 |
|
16400 |
|
16401 |
|
16402 | dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
|
16403 | !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;
|
16404 | !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : void 0;
|
16405 | !(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : void 0;
|
16406 |
|
16407 | if (typeof markup === 'string') {
|
16408 | var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
|
16409 | oldChild.parentNode.replaceChild(newChild, oldChild);
|
16410 | } else {
|
16411 | DOMLazyTree.replaceChildWithTree(oldChild, markup);
|
16412 | }
|
16413 | }
|
16414 |
|
16415 | };
|
16416 |
|
16417 | module.exports = Danger;
|
16418 | }).call(this,require(91))
|
16419 | },{"166":166,"31":31,"36":36,"37":37,"41":41,"45":45,"91":91}],171:[function(require,module,exports){
|
16420 |
|
16421 |
|
16422 |
|
16423 |
|
16424 |
|
16425 |
|
16426 |
|
16427 |
|
16428 |
|
16429 |
|
16430 |
|
16431 | 'use strict';
|
16432 |
|
16433 | var keyOf = require(49);
|
16434 |
|
16435 |
|
16436 |
|
16437 |
|
16438 |
|
16439 |
|
16440 |
|
16441 |
|
16442 |
|
16443 |
|
16444 | var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
|
16445 |
|
16446 | module.exports = DefaultEventPluginOrder;
|
16447 | },{"49":49}],172:[function(require,module,exports){
|
16448 |
|
16449 |
|
16450 |
|
16451 |
|
16452 |
|
16453 |
|
16454 |
|
16455 |
|
16456 |
|
16457 |
|
16458 |
|
16459 | 'use strict';
|
16460 |
|
16461 | var disableableMouseListenerNames = {
|
16462 | onClick: true,
|
16463 | onDoubleClick: true,
|
16464 | onMouseDown: true,
|
16465 | onMouseMove: true,
|
16466 | onMouseUp: true,
|
16467 |
|
16468 | onClickCapture: true,
|
16469 | onDoubleClickCapture: true,
|
16470 | onMouseDownCapture: true,
|
16471 | onMouseMoveCapture: true,
|
16472 | onMouseUpCapture: true
|
16473 | };
|
16474 |
|
16475 |
|
16476 |
|
16477 |
|
16478 |
|
16479 | var DisabledInputUtils = {
|
16480 | getNativeProps: function (inst, props) {
|
16481 | if (!props.disabled) {
|
16482 | return props;
|
16483 | }
|
16484 |
|
16485 |
|
16486 | var nativeProps = {};
|
16487 | for (var key in props) {
|
16488 | if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
|
16489 | nativeProps[key] = props[key];
|
16490 | }
|
16491 | }
|
16492 |
|
16493 | return nativeProps;
|
16494 | }
|
16495 | };
|
16496 |
|
16497 | module.exports = DisabledInputUtils;
|
16498 | },{}],173:[function(require,module,exports){
|
16499 |
|
16500 |
|
16501 |
|
16502 |
|
16503 |
|
16504 |
|
16505 |
|
16506 |
|
16507 |
|
16508 |
|
16509 |
|
16510 | 'use strict';
|
16511 |
|
16512 | var EventConstants = require(174);
|
16513 | var EventPropagators = require(178);
|
16514 | var ReactDOMComponentTree = require(199);
|
16515 | var SyntheticMouseEvent = require(260);
|
16516 |
|
16517 | var keyOf = require(49);
|
16518 |
|
16519 | var topLevelTypes = EventConstants.topLevelTypes;
|
16520 |
|
16521 | var eventTypes = {
|
16522 | mouseEnter: {
|
16523 | registrationName: keyOf({ onMouseEnter: null }),
|
16524 | dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
16525 | },
|
16526 | mouseLeave: {
|
16527 | registrationName: keyOf({ onMouseLeave: null }),
|
16528 | dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
16529 | }
|
16530 | };
|
16531 |
|
16532 | var EnterLeaveEventPlugin = {
|
16533 |
|
16534 | eventTypes: eventTypes,
|
16535 |
|
16536 | |
16537 |
|
16538 |
|
16539 |
|
16540 |
|
16541 |
|
16542 |
|
16543 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
16544 | if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
|
16545 | return null;
|
16546 | }
|
16547 | if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
|
16548 |
|
16549 | return null;
|
16550 | }
|
16551 |
|
16552 | var win;
|
16553 | if (nativeEventTarget.window === nativeEventTarget) {
|
16554 |
|
16555 | win = nativeEventTarget;
|
16556 | } else {
|
16557 |
|
16558 | var doc = nativeEventTarget.ownerDocument;
|
16559 | if (doc) {
|
16560 | win = doc.defaultView || doc.parentWindow;
|
16561 | } else {
|
16562 | win = window;
|
16563 | }
|
16564 | }
|
16565 |
|
16566 | var from;
|
16567 | var to;
|
16568 | if (topLevelType === topLevelTypes.topMouseOut) {
|
16569 | from = targetInst;
|
16570 | var related = nativeEvent.relatedTarget || nativeEvent.toElement;
|
16571 | to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
|
16572 | } else {
|
16573 |
|
16574 | from = null;
|
16575 | to = targetInst;
|
16576 | }
|
16577 |
|
16578 | if (from === to) {
|
16579 |
|
16580 | return null;
|
16581 | }
|
16582 |
|
16583 | var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
|
16584 | var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
|
16585 |
|
16586 | var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
|
16587 | leave.type = 'mouseleave';
|
16588 | leave.target = fromNode;
|
16589 | leave.relatedTarget = toNode;
|
16590 |
|
16591 | var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
|
16592 | enter.type = 'mouseenter';
|
16593 | enter.target = toNode;
|
16594 | enter.relatedTarget = fromNode;
|
16595 |
|
16596 | EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
|
16597 |
|
16598 | return [leave, enter];
|
16599 | }
|
16600 |
|
16601 | };
|
16602 |
|
16603 | module.exports = EnterLeaveEventPlugin;
|
16604 | },{"174":174,"178":178,"199":199,"260":260,"49":49}],174:[function(require,module,exports){
|
16605 |
|
16606 |
|
16607 |
|
16608 |
|
16609 |
|
16610 |
|
16611 |
|
16612 |
|
16613 |
|
16614 |
|
16615 |
|
16616 | 'use strict';
|
16617 |
|
16618 | var keyMirror = require(48);
|
16619 |
|
16620 | var PropagationPhases = keyMirror({ bubbled: null, captured: null });
|
16621 |
|
16622 |
|
16623 |
|
16624 |
|
16625 | var topLevelTypes = keyMirror({
|
16626 | topAbort: null,
|
16627 | topAnimationEnd: null,
|
16628 | topAnimationIteration: null,
|
16629 | topAnimationStart: null,
|
16630 | topBlur: null,
|
16631 | topCanPlay: null,
|
16632 | topCanPlayThrough: null,
|
16633 | topChange: null,
|
16634 | topClick: null,
|
16635 | topCompositionEnd: null,
|
16636 | topCompositionStart: null,
|
16637 | topCompositionUpdate: null,
|
16638 | topContextMenu: null,
|
16639 | topCopy: null,
|
16640 | topCut: null,
|
16641 | topDoubleClick: null,
|
16642 | topDrag: null,
|
16643 | topDragEnd: null,
|
16644 | topDragEnter: null,
|
16645 | topDragExit: null,
|
16646 | topDragLeave: null,
|
16647 | topDragOver: null,
|
16648 | topDragStart: null,
|
16649 | topDrop: null,
|
16650 | topDurationChange: null,
|
16651 | topEmptied: null,
|
16652 | topEncrypted: null,
|
16653 | topEnded: null,
|
16654 | topError: null,
|
16655 | topFocus: null,
|
16656 | topInput: null,
|
16657 | topInvalid: null,
|
16658 | topKeyDown: null,
|
16659 | topKeyPress: null,
|
16660 | topKeyUp: null,
|
16661 | topLoad: null,
|
16662 | topLoadedData: null,
|
16663 | topLoadedMetadata: null,
|
16664 | topLoadStart: null,
|
16665 | topMouseDown: null,
|
16666 | topMouseMove: null,
|
16667 | topMouseOut: null,
|
16668 | topMouseOver: null,
|
16669 | topMouseUp: null,
|
16670 | topPaste: null,
|
16671 | topPause: null,
|
16672 | topPlay: null,
|
16673 | topPlaying: null,
|
16674 | topProgress: null,
|
16675 | topRateChange: null,
|
16676 | topReset: null,
|
16677 | topScroll: null,
|
16678 | topSeeked: null,
|
16679 | topSeeking: null,
|
16680 | topSelectionChange: null,
|
16681 | topStalled: null,
|
16682 | topSubmit: null,
|
16683 | topSuspend: null,
|
16684 | topTextInput: null,
|
16685 | topTimeUpdate: null,
|
16686 | topTouchCancel: null,
|
16687 | topTouchEnd: null,
|
16688 | topTouchMove: null,
|
16689 | topTouchStart: null,
|
16690 | topTransitionEnd: null,
|
16691 | topVolumeChange: null,
|
16692 | topWaiting: null,
|
16693 | topWheel: null
|
16694 | });
|
16695 |
|
16696 | var EventConstants = {
|
16697 | topLevelTypes: topLevelTypes,
|
16698 | PropagationPhases: PropagationPhases
|
16699 | };
|
16700 |
|
16701 | module.exports = EventConstants;
|
16702 | },{"48":48}],175:[function(require,module,exports){
|
16703 | (function (process){
|
16704 |
|
16705 |
|
16706 |
|
16707 |
|
16708 |
|
16709 |
|
16710 |
|
16711 |
|
16712 |
|
16713 |
|
16714 |
|
16715 | 'use strict';
|
16716 |
|
16717 | var EventPluginRegistry = require(176);
|
16718 | var EventPluginUtils = require(177);
|
16719 | var ReactErrorUtils = require(221);
|
16720 |
|
16721 | var accumulateInto = require(267);
|
16722 | var forEachAccumulated = require(275);
|
16723 | var invariant = require(45);
|
16724 |
|
16725 |
|
16726 |
|
16727 |
|
16728 | var listenerBank = {};
|
16729 |
|
16730 |
|
16731 |
|
16732 |
|
16733 |
|
16734 | var eventQueue = null;
|
16735 |
|
16736 |
|
16737 |
|
16738 |
|
16739 |
|
16740 |
|
16741 |
|
16742 |
|
16743 | var executeDispatchesAndRelease = function (event, simulated) {
|
16744 | if (event) {
|
16745 | EventPluginUtils.executeDispatchesInOrder(event, simulated);
|
16746 |
|
16747 | if (!event.isPersistent()) {
|
16748 | event.constructor.release(event);
|
16749 | }
|
16750 | }
|
16751 | };
|
16752 | var executeDispatchesAndReleaseSimulated = function (e) {
|
16753 | return executeDispatchesAndRelease(e, true);
|
16754 | };
|
16755 | var executeDispatchesAndReleaseTopLevel = function (e) {
|
16756 | return executeDispatchesAndRelease(e, false);
|
16757 | };
|
16758 |
|
16759 |
|
16760 |
|
16761 |
|
16762 |
|
16763 |
|
16764 |
|
16765 |
|
16766 |
|
16767 |
|
16768 |
|
16769 |
|
16770 |
|
16771 |
|
16772 |
|
16773 |
|
16774 |
|
16775 |
|
16776 |
|
16777 |
|
16778 |
|
16779 |
|
16780 |
|
16781 | var EventPluginHub = {
|
16782 |
|
16783 | |
16784 |
|
16785 |
|
16786 | injection: {
|
16787 |
|
16788 | |
16789 |
|
16790 |
|
16791 |
|
16792 | injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
|
16793 |
|
16794 | |
16795 |
|
16796 |
|
16797 | injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
|
16798 |
|
16799 | },
|
16800 |
|
16801 | |
16802 |
|
16803 |
|
16804 |
|
16805 |
|
16806 |
|
16807 |
|
16808 | putListener: function (inst, registrationName, listener) {
|
16809 | !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : void 0;
|
16810 |
|
16811 | var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
|
16812 | bankForRegistrationName[inst._rootNodeID] = listener;
|
16813 |
|
16814 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
16815 | if (PluginModule && PluginModule.didPutListener) {
|
16816 | PluginModule.didPutListener(inst, registrationName, listener);
|
16817 | }
|
16818 | },
|
16819 |
|
16820 | |
16821 |
|
16822 |
|
16823 |
|
16824 |
|
16825 | getListener: function (inst, registrationName) {
|
16826 | var bankForRegistrationName = listenerBank[registrationName];
|
16827 | return bankForRegistrationName && bankForRegistrationName[inst._rootNodeID];
|
16828 | },
|
16829 |
|
16830 | |
16831 |
|
16832 |
|
16833 |
|
16834 |
|
16835 |
|
16836 | deleteListener: function (inst, registrationName) {
|
16837 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
16838 | if (PluginModule && PluginModule.willDeleteListener) {
|
16839 | PluginModule.willDeleteListener(inst, registrationName);
|
16840 | }
|
16841 |
|
16842 | var bankForRegistrationName = listenerBank[registrationName];
|
16843 |
|
16844 | if (bankForRegistrationName) {
|
16845 | delete bankForRegistrationName[inst._rootNodeID];
|
16846 | }
|
16847 | },
|
16848 |
|
16849 | |
16850 |
|
16851 |
|
16852 |
|
16853 |
|
16854 | deleteAllListeners: function (inst) {
|
16855 | for (var registrationName in listenerBank) {
|
16856 | if (!listenerBank[registrationName][inst._rootNodeID]) {
|
16857 | continue;
|
16858 | }
|
16859 |
|
16860 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
16861 | if (PluginModule && PluginModule.willDeleteListener) {
|
16862 | PluginModule.willDeleteListener(inst, registrationName);
|
16863 | }
|
16864 |
|
16865 | delete listenerBank[registrationName][inst._rootNodeID];
|
16866 | }
|
16867 | },
|
16868 |
|
16869 | |
16870 |
|
16871 |
|
16872 |
|
16873 |
|
16874 |
|
16875 |
|
16876 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
16877 | var events;
|
16878 | var plugins = EventPluginRegistry.plugins;
|
16879 | for (var i = 0; i < plugins.length; i++) {
|
16880 |
|
16881 | var possiblePlugin = plugins[i];
|
16882 | if (possiblePlugin) {
|
16883 | var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
16884 | if (extractedEvents) {
|
16885 | events = accumulateInto(events, extractedEvents);
|
16886 | }
|
16887 | }
|
16888 | }
|
16889 | return events;
|
16890 | },
|
16891 |
|
16892 | |
16893 |
|
16894 |
|
16895 |
|
16896 |
|
16897 |
|
16898 |
|
16899 | enqueueEvents: function (events) {
|
16900 | if (events) {
|
16901 | eventQueue = accumulateInto(eventQueue, events);
|
16902 | }
|
16903 | },
|
16904 |
|
16905 | |
16906 |
|
16907 |
|
16908 |
|
16909 |
|
16910 | processEventQueue: function (simulated) {
|
16911 |
|
16912 |
|
16913 | var processingEventQueue = eventQueue;
|
16914 | eventQueue = null;
|
16915 | if (simulated) {
|
16916 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
|
16917 | } else {
|
16918 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
|
16919 | }
|
16920 | !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : void 0;
|
16921 |
|
16922 | ReactErrorUtils.rethrowCaughtError();
|
16923 | },
|
16924 |
|
16925 | |
16926 |
|
16927 |
|
16928 | __purge: function () {
|
16929 | listenerBank = {};
|
16930 | },
|
16931 |
|
16932 | __getListenerBank: function () {
|
16933 | return listenerBank;
|
16934 | }
|
16935 |
|
16936 | };
|
16937 |
|
16938 | module.exports = EventPluginHub;
|
16939 | }).call(this,require(91))
|
16940 | },{"176":176,"177":177,"221":221,"267":267,"275":275,"45":45,"91":91}],176:[function(require,module,exports){
|
16941 | (function (process){
|
16942 |
|
16943 |
|
16944 |
|
16945 |
|
16946 |
|
16947 |
|
16948 |
|
16949 |
|
16950 |
|
16951 |
|
16952 |
|
16953 | 'use strict';
|
16954 |
|
16955 | var invariant = require(45);
|
16956 |
|
16957 |
|
16958 |
|
16959 |
|
16960 | var EventPluginOrder = null;
|
16961 |
|
16962 |
|
16963 |
|
16964 |
|
16965 | var namesToPlugins = {};
|
16966 |
|
16967 |
|
16968 |
|
16969 |
|
16970 |
|
16971 |
|
16972 | function recomputePluginOrdering() {
|
16973 | if (!EventPluginOrder) {
|
16974 |
|
16975 | return;
|
16976 | }
|
16977 | for (var pluginName in namesToPlugins) {
|
16978 | var PluginModule = namesToPlugins[pluginName];
|
16979 | var pluginIndex = EventPluginOrder.indexOf(pluginName);
|
16980 | !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : void 0;
|
16981 | if (EventPluginRegistry.plugins[pluginIndex]) {
|
16982 | continue;
|
16983 | }
|
16984 | !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : void 0;
|
16985 | EventPluginRegistry.plugins[pluginIndex] = PluginModule;
|
16986 | var publishedEvents = PluginModule.eventTypes;
|
16987 | for (var eventName in publishedEvents) {
|
16988 | !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : void 0;
|
16989 | }
|
16990 | }
|
16991 | }
|
16992 |
|
16993 |
|
16994 |
|
16995 |
|
16996 |
|
16997 |
|
16998 |
|
16999 |
|
17000 |
|
17001 | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
|
17002 | !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : void 0;
|
17003 | EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
|
17004 |
|
17005 | var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
17006 | if (phasedRegistrationNames) {
|
17007 | for (var phaseName in phasedRegistrationNames) {
|
17008 | if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
|
17009 | var phasedRegistrationName = phasedRegistrationNames[phaseName];
|
17010 | publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
|
17011 | }
|
17012 | }
|
17013 | return true;
|
17014 | } else if (dispatchConfig.registrationName) {
|
17015 | publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
|
17016 | return true;
|
17017 | }
|
17018 | return false;
|
17019 | }
|
17020 |
|
17021 |
|
17022 |
|
17023 |
|
17024 |
|
17025 |
|
17026 |
|
17027 |
|
17028 |
|
17029 | function publishRegistrationName(registrationName, PluginModule, eventName) {
|
17030 | !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : void 0;
|
17031 | EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
|
17032 | EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
|
17033 |
|
17034 | if (process.env.NODE_ENV !== 'production') {
|
17035 | var lowerCasedName = registrationName.toLowerCase();
|
17036 | EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
|
17037 | }
|
17038 | }
|
17039 |
|
17040 |
|
17041 |
|
17042 |
|
17043 |
|
17044 |
|
17045 | var EventPluginRegistry = {
|
17046 |
|
17047 | |
17048 |
|
17049 |
|
17050 | plugins: [],
|
17051 |
|
17052 | |
17053 |
|
17054 |
|
17055 | eventNameDispatchConfigs: {},
|
17056 |
|
17057 | |
17058 |
|
17059 |
|
17060 | registrationNameModules: {},
|
17061 |
|
17062 | |
17063 |
|
17064 |
|
17065 | registrationNameDependencies: {},
|
17066 |
|
17067 | |
17068 |
|
17069 |
|
17070 |
|
17071 |
|
17072 |
|
17073 | possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null,
|
17074 |
|
17075 | |
17076 |
|
17077 |
|
17078 |
|
17079 |
|
17080 |
|
17081 |
|
17082 |
|
17083 |
|
17084 | injectEventPluginOrder: function (InjectedEventPluginOrder) {
|
17085 | !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : void 0;
|
17086 |
|
17087 | EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
|
17088 | recomputePluginOrdering();
|
17089 | },
|
17090 |
|
17091 | |
17092 |
|
17093 |
|
17094 |
|
17095 |
|
17096 |
|
17097 |
|
17098 |
|
17099 |
|
17100 |
|
17101 | injectEventPluginsByName: function (injectedNamesToPlugins) {
|
17102 | var isOrderingDirty = false;
|
17103 | for (var pluginName in injectedNamesToPlugins) {
|
17104 | if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
|
17105 | continue;
|
17106 | }
|
17107 | var PluginModule = injectedNamesToPlugins[pluginName];
|
17108 | if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
|
17109 | !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : void 0;
|
17110 | namesToPlugins[pluginName] = PluginModule;
|
17111 | isOrderingDirty = true;
|
17112 | }
|
17113 | }
|
17114 | if (isOrderingDirty) {
|
17115 | recomputePluginOrdering();
|
17116 | }
|
17117 | },
|
17118 |
|
17119 | |
17120 |
|
17121 |
|
17122 |
|
17123 |
|
17124 |
|
17125 |
|
17126 | getPluginModuleForEvent: function (event) {
|
17127 | var dispatchConfig = event.dispatchConfig;
|
17128 | if (dispatchConfig.registrationName) {
|
17129 | return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
|
17130 | }
|
17131 | for (var phase in dispatchConfig.phasedRegistrationNames) {
|
17132 | if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
|
17133 | continue;
|
17134 | }
|
17135 | var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
|
17136 | if (PluginModule) {
|
17137 | return PluginModule;
|
17138 | }
|
17139 | }
|
17140 | return null;
|
17141 | },
|
17142 |
|
17143 | |
17144 |
|
17145 |
|
17146 |
|
17147 | _resetEventPlugins: function () {
|
17148 | EventPluginOrder = null;
|
17149 | for (var pluginName in namesToPlugins) {
|
17150 | if (namesToPlugins.hasOwnProperty(pluginName)) {
|
17151 | delete namesToPlugins[pluginName];
|
17152 | }
|
17153 | }
|
17154 | EventPluginRegistry.plugins.length = 0;
|
17155 |
|
17156 | var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
|
17157 | for (var eventName in eventNameDispatchConfigs) {
|
17158 | if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
|
17159 | delete eventNameDispatchConfigs[eventName];
|
17160 | }
|
17161 | }
|
17162 |
|
17163 | var registrationNameModules = EventPluginRegistry.registrationNameModules;
|
17164 | for (var registrationName in registrationNameModules) {
|
17165 | if (registrationNameModules.hasOwnProperty(registrationName)) {
|
17166 | delete registrationNameModules[registrationName];
|
17167 | }
|
17168 | }
|
17169 |
|
17170 | if (process.env.NODE_ENV !== 'production') {
|
17171 | var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
|
17172 | for (var lowerCasedName in possibleRegistrationNames) {
|
17173 | if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
|
17174 | delete possibleRegistrationNames[lowerCasedName];
|
17175 | }
|
17176 | }
|
17177 | }
|
17178 | }
|
17179 |
|
17180 | };
|
17181 |
|
17182 | module.exports = EventPluginRegistry;
|
17183 | }).call(this,require(91))
|
17184 | },{"45":45,"91":91}],177:[function(require,module,exports){
|
17185 | (function (process){
|
17186 |
|
17187 |
|
17188 |
|
17189 |
|
17190 |
|
17191 |
|
17192 |
|
17193 |
|
17194 |
|
17195 |
|
17196 |
|
17197 | 'use strict';
|
17198 |
|
17199 | var EventConstants = require(174);
|
17200 | var ReactErrorUtils = require(221);
|
17201 |
|
17202 | var invariant = require(45);
|
17203 | var warning = require(55);
|
17204 |
|
17205 |
|
17206 |
|
17207 |
|
17208 |
|
17209 |
|
17210 |
|
17211 |
|
17212 |
|
17213 | var ComponentTree;
|
17214 | var TreeTraversal;
|
17215 | var injection = {
|
17216 | injectComponentTree: function (Injected) {
|
17217 | ComponentTree = Injected;
|
17218 | if (process.env.NODE_ENV !== 'production') {
|
17219 | process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
|
17220 | }
|
17221 | },
|
17222 | injectTreeTraversal: function (Injected) {
|
17223 | TreeTraversal = Injected;
|
17224 | if (process.env.NODE_ENV !== 'production') {
|
17225 | process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
|
17226 | }
|
17227 | }
|
17228 | };
|
17229 |
|
17230 | var topLevelTypes = EventConstants.topLevelTypes;
|
17231 |
|
17232 | function isEndish(topLevelType) {
|
17233 | return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
|
17234 | }
|
17235 |
|
17236 | function isMoveish(topLevelType) {
|
17237 | return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
|
17238 | }
|
17239 | function isStartish(topLevelType) {
|
17240 | return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
|
17241 | }
|
17242 |
|
17243 | var validateEventDispatches;
|
17244 | if (process.env.NODE_ENV !== 'production') {
|
17245 | validateEventDispatches = function (event) {
|
17246 | var dispatchListeners = event._dispatchListeners;
|
17247 | var dispatchInstances = event._dispatchInstances;
|
17248 |
|
17249 | var listenersIsArr = Array.isArray(dispatchListeners);
|
17250 | var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
|
17251 |
|
17252 | var instancesIsArr = Array.isArray(dispatchInstances);
|
17253 | var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
|
17254 |
|
17255 | process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
|
17256 | };
|
17257 | }
|
17258 |
|
17259 |
|
17260 |
|
17261 |
|
17262 |
|
17263 |
|
17264 |
|
17265 |
|
17266 | function executeDispatch(event, simulated, listener, inst) {
|
17267 | var type = event.type || 'unknown-event';
|
17268 | event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
|
17269 | if (simulated) {
|
17270 | ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
|
17271 | } else {
|
17272 | ReactErrorUtils.invokeGuardedCallback(type, listener, event);
|
17273 | }
|
17274 | event.currentTarget = null;
|
17275 | }
|
17276 |
|
17277 |
|
17278 |
|
17279 |
|
17280 | function executeDispatchesInOrder(event, simulated) {
|
17281 | var dispatchListeners = event._dispatchListeners;
|
17282 | var dispatchInstances = event._dispatchInstances;
|
17283 | if (process.env.NODE_ENV !== 'production') {
|
17284 | validateEventDispatches(event);
|
17285 | }
|
17286 | if (Array.isArray(dispatchListeners)) {
|
17287 | for (var i = 0; i < dispatchListeners.length; i++) {
|
17288 | if (event.isPropagationStopped()) {
|
17289 | break;
|
17290 | }
|
17291 |
|
17292 | executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
|
17293 | }
|
17294 | } else if (dispatchListeners) {
|
17295 | executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
|
17296 | }
|
17297 | event._dispatchListeners = null;
|
17298 | event._dispatchInstances = null;
|
17299 | }
|
17300 |
|
17301 |
|
17302 |
|
17303 |
|
17304 |
|
17305 |
|
17306 |
|
17307 |
|
17308 | function executeDispatchesInOrderStopAtTrueImpl(event) {
|
17309 | var dispatchListeners = event._dispatchListeners;
|
17310 | var dispatchInstances = event._dispatchInstances;
|
17311 | if (process.env.NODE_ENV !== 'production') {
|
17312 | validateEventDispatches(event);
|
17313 | }
|
17314 | if (Array.isArray(dispatchListeners)) {
|
17315 | for (var i = 0; i < dispatchListeners.length; i++) {
|
17316 | if (event.isPropagationStopped()) {
|
17317 | break;
|
17318 | }
|
17319 |
|
17320 | if (dispatchListeners[i](event, dispatchInstances[i])) {
|
17321 | return dispatchInstances[i];
|
17322 | }
|
17323 | }
|
17324 | } else if (dispatchListeners) {
|
17325 | if (dispatchListeners(event, dispatchInstances)) {
|
17326 | return dispatchInstances;
|
17327 | }
|
17328 | }
|
17329 | return null;
|
17330 | }
|
17331 |
|
17332 |
|
17333 |
|
17334 |
|
17335 | function executeDispatchesInOrderStopAtTrue(event) {
|
17336 | var ret = executeDispatchesInOrderStopAtTrueImpl(event);
|
17337 | event._dispatchInstances = null;
|
17338 | event._dispatchListeners = null;
|
17339 | return ret;
|
17340 | }
|
17341 |
|
17342 |
|
17343 |
|
17344 |
|
17345 |
|
17346 |
|
17347 |
|
17348 |
|
17349 |
|
17350 |
|
17351 | function executeDirectDispatch(event) {
|
17352 | if (process.env.NODE_ENV !== 'production') {
|
17353 | validateEventDispatches(event);
|
17354 | }
|
17355 | var dispatchListener = event._dispatchListeners;
|
17356 | var dispatchInstance = event._dispatchInstances;
|
17357 | !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : void 0;
|
17358 | event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
|
17359 | var res = dispatchListener ? dispatchListener(event) : null;
|
17360 | event.currentTarget = null;
|
17361 | event._dispatchListeners = null;
|
17362 | event._dispatchInstances = null;
|
17363 | return res;
|
17364 | }
|
17365 |
|
17366 |
|
17367 |
|
17368 |
|
17369 |
|
17370 | function hasDispatches(event) {
|
17371 | return !!event._dispatchListeners;
|
17372 | }
|
17373 |
|
17374 |
|
17375 |
|
17376 |
|
17377 | var EventPluginUtils = {
|
17378 | isEndish: isEndish,
|
17379 | isMoveish: isMoveish,
|
17380 | isStartish: isStartish,
|
17381 |
|
17382 | executeDirectDispatch: executeDirectDispatch,
|
17383 | executeDispatchesInOrder: executeDispatchesInOrder,
|
17384 | executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
|
17385 | hasDispatches: hasDispatches,
|
17386 |
|
17387 | getInstanceFromNode: function (node) {
|
17388 | return ComponentTree.getInstanceFromNode(node);
|
17389 | },
|
17390 | getNodeFromInstance: function (node) {
|
17391 | return ComponentTree.getNodeFromInstance(node);
|
17392 | },
|
17393 | isAncestor: function (a, b) {
|
17394 | return TreeTraversal.isAncestor(a, b);
|
17395 | },
|
17396 | getLowestCommonAncestor: function (a, b) {
|
17397 | return TreeTraversal.getLowestCommonAncestor(a, b);
|
17398 | },
|
17399 | getParentInstance: function (inst) {
|
17400 | return TreeTraversal.getParentInstance(inst);
|
17401 | },
|
17402 | traverseTwoPhase: function (target, fn, arg) {
|
17403 | return TreeTraversal.traverseTwoPhase(target, fn, arg);
|
17404 | },
|
17405 | traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
|
17406 | return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
|
17407 | },
|
17408 |
|
17409 | injection: injection
|
17410 | };
|
17411 |
|
17412 | module.exports = EventPluginUtils;
|
17413 | }).call(this,require(91))
|
17414 | },{"174":174,"221":221,"45":45,"55":55,"91":91}],178:[function(require,module,exports){
|
17415 | (function (process){
|
17416 |
|
17417 |
|
17418 |
|
17419 |
|
17420 |
|
17421 |
|
17422 |
|
17423 |
|
17424 |
|
17425 |
|
17426 |
|
17427 | 'use strict';
|
17428 |
|
17429 | var EventConstants = require(174);
|
17430 | var EventPluginHub = require(175);
|
17431 | var EventPluginUtils = require(177);
|
17432 |
|
17433 | var accumulateInto = require(267);
|
17434 | var forEachAccumulated = require(275);
|
17435 | var warning = require(55);
|
17436 |
|
17437 | var PropagationPhases = EventConstants.PropagationPhases;
|
17438 | var getListener = EventPluginHub.getListener;
|
17439 |
|
17440 |
|
17441 |
|
17442 |
|
17443 |
|
17444 | function listenerAtPhase(inst, event, propagationPhase) {
|
17445 | var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
|
17446 | return getListener(inst, registrationName);
|
17447 | }
|
17448 |
|
17449 |
|
17450 |
|
17451 |
|
17452 |
|
17453 |
|
17454 |
|
17455 | function accumulateDirectionalDispatches(inst, upwards, event) {
|
17456 | if (process.env.NODE_ENV !== 'production') {
|
17457 | process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
|
17458 | }
|
17459 | var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
|
17460 | var listener = listenerAtPhase(inst, event, phase);
|
17461 | if (listener) {
|
17462 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
17463 | event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
17464 | }
|
17465 | }
|
17466 |
|
17467 |
|
17468 |
|
17469 |
|
17470 |
|
17471 |
|
17472 |
|
17473 |
|
17474 | function accumulateTwoPhaseDispatchesSingle(event) {
|
17475 | if (event && event.dispatchConfig.phasedRegistrationNames) {
|
17476 | EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
17477 | }
|
17478 | }
|
17479 |
|
17480 |
|
17481 |
|
17482 |
|
17483 | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
|
17484 | if (event && event.dispatchConfig.phasedRegistrationNames) {
|
17485 | var targetInst = event._targetInst;
|
17486 | var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
|
17487 | EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
|
17488 | }
|
17489 | }
|
17490 |
|
17491 |
|
17492 |
|
17493 |
|
17494 |
|
17495 |
|
17496 | function accumulateDispatches(inst, ignoredDirection, event) {
|
17497 | if (event && event.dispatchConfig.registrationName) {
|
17498 | var registrationName = event.dispatchConfig.registrationName;
|
17499 | var listener = getListener(inst, registrationName);
|
17500 | if (listener) {
|
17501 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
17502 | event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
17503 | }
|
17504 | }
|
17505 | }
|
17506 |
|
17507 |
|
17508 |
|
17509 |
|
17510 |
|
17511 |
|
17512 | function accumulateDirectDispatchesSingle(event) {
|
17513 | if (event && event.dispatchConfig.registrationName) {
|
17514 | accumulateDispatches(event._targetInst, null, event);
|
17515 | }
|
17516 | }
|
17517 |
|
17518 | function accumulateTwoPhaseDispatches(events) {
|
17519 | forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
|
17520 | }
|
17521 |
|
17522 | function accumulateTwoPhaseDispatchesSkipTarget(events) {
|
17523 | forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
|
17524 | }
|
17525 |
|
17526 | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
|
17527 | EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
|
17528 | }
|
17529 |
|
17530 | function accumulateDirectDispatches(events) {
|
17531 | forEachAccumulated(events, accumulateDirectDispatchesSingle);
|
17532 | }
|
17533 |
|
17534 |
|
17535 |
|
17536 |
|
17537 |
|
17538 |
|
17539 |
|
17540 |
|
17541 |
|
17542 |
|
17543 |
|
17544 |
|
17545 | var EventPropagators = {
|
17546 | accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
|
17547 | accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
|
17548 | accumulateDirectDispatches: accumulateDirectDispatches,
|
17549 | accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
|
17550 | };
|
17551 |
|
17552 | module.exports = EventPropagators;
|
17553 | }).call(this,require(91))
|
17554 | },{"174":174,"175":175,"177":177,"267":267,"275":275,"55":55,"91":91}],179:[function(require,module,exports){
|
17555 |
|
17556 |
|
17557 |
|
17558 |
|
17559 |
|
17560 |
|
17561 |
|
17562 |
|
17563 |
|
17564 |
|
17565 |
|
17566 | 'use strict';
|
17567 |
|
17568 | var _assign = require(296);
|
17569 |
|
17570 | var PooledClass = require(183);
|
17571 |
|
17572 | var getTextContentAccessor = require(283);
|
17573 |
|
17574 |
|
17575 |
|
17576 |
|
17577 |
|
17578 |
|
17579 |
|
17580 |
|
17581 |
|
17582 |
|
17583 |
|
17584 |
|
17585 | function FallbackCompositionState(root) {
|
17586 | this._root = root;
|
17587 | this._startText = this.getText();
|
17588 | this._fallbackText = null;
|
17589 | }
|
17590 |
|
17591 | _assign(FallbackCompositionState.prototype, {
|
17592 | destructor: function () {
|
17593 | this._root = null;
|
17594 | this._startText = null;
|
17595 | this._fallbackText = null;
|
17596 | },
|
17597 |
|
17598 | |
17599 |
|
17600 |
|
17601 |
|
17602 |
|
17603 | getText: function () {
|
17604 | if ('value' in this._root) {
|
17605 | return this._root.value;
|
17606 | }
|
17607 | return this._root[getTextContentAccessor()];
|
17608 | },
|
17609 |
|
17610 | |
17611 |
|
17612 |
|
17613 |
|
17614 |
|
17615 |
|
17616 | getData: function () {
|
17617 | if (this._fallbackText) {
|
17618 | return this._fallbackText;
|
17619 | }
|
17620 |
|
17621 | var start;
|
17622 | var startValue = this._startText;
|
17623 | var startLength = startValue.length;
|
17624 | var end;
|
17625 | var endValue = this.getText();
|
17626 | var endLength = endValue.length;
|
17627 |
|
17628 | for (start = 0; start < startLength; start++) {
|
17629 | if (startValue[start] !== endValue[start]) {
|
17630 | break;
|
17631 | }
|
17632 | }
|
17633 |
|
17634 | var minEnd = startLength - start;
|
17635 | for (end = 1; end <= minEnd; end++) {
|
17636 | if (startValue[startLength - end] !== endValue[endLength - end]) {
|
17637 | break;
|
17638 | }
|
17639 | }
|
17640 |
|
17641 | var sliceTail = end > 1 ? 1 - end : undefined;
|
17642 | this._fallbackText = endValue.slice(start, sliceTail);
|
17643 | return this._fallbackText;
|
17644 | }
|
17645 | });
|
17646 |
|
17647 | PooledClass.addPoolingTo(FallbackCompositionState);
|
17648 |
|
17649 | module.exports = FallbackCompositionState;
|
17650 | },{"183":183,"283":283,"296":296}],180:[function(require,module,exports){
|
17651 |
|
17652 |
|
17653 |
|
17654 |
|
17655 |
|
17656 |
|
17657 |
|
17658 |
|
17659 |
|
17660 |
|
17661 |
|
17662 | 'use strict';
|
17663 |
|
17664 | var DOMProperty = require(168);
|
17665 |
|
17666 | var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
|
17667 | var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
|
17668 | var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
|
17669 | var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
|
17670 | var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
|
17671 | var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
|
17672 |
|
17673 | var HTMLDOMPropertyConfig = {
|
17674 | isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
|
17675 | Properties: {
|
17676 | |
17677 |
|
17678 |
|
17679 | accept: 0,
|
17680 | acceptCharset: 0,
|
17681 | accessKey: 0,
|
17682 | action: 0,
|
17683 | allowFullScreen: HAS_BOOLEAN_VALUE,
|
17684 | allowTransparency: 0,
|
17685 | alt: 0,
|
17686 | async: HAS_BOOLEAN_VALUE,
|
17687 | autoComplete: 0,
|
17688 |
|
17689 |
|
17690 | autoPlay: HAS_BOOLEAN_VALUE,
|
17691 | capture: HAS_BOOLEAN_VALUE,
|
17692 | cellPadding: 0,
|
17693 | cellSpacing: 0,
|
17694 | charSet: 0,
|
17695 | challenge: 0,
|
17696 | checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
17697 | cite: 0,
|
17698 | classID: 0,
|
17699 | className: 0,
|
17700 | cols: HAS_POSITIVE_NUMERIC_VALUE,
|
17701 | colSpan: 0,
|
17702 | content: 0,
|
17703 | contentEditable: 0,
|
17704 | contextMenu: 0,
|
17705 | controls: HAS_BOOLEAN_VALUE,
|
17706 | coords: 0,
|
17707 | crossOrigin: 0,
|
17708 | data: 0,
|
17709 | dateTime: 0,
|
17710 | 'default': HAS_BOOLEAN_VALUE,
|
17711 | defer: HAS_BOOLEAN_VALUE,
|
17712 | dir: 0,
|
17713 | disabled: HAS_BOOLEAN_VALUE,
|
17714 | download: HAS_OVERLOADED_BOOLEAN_VALUE,
|
17715 | draggable: 0,
|
17716 | encType: 0,
|
17717 | form: 0,
|
17718 | formAction: 0,
|
17719 | formEncType: 0,
|
17720 | formMethod: 0,
|
17721 | formNoValidate: HAS_BOOLEAN_VALUE,
|
17722 | formTarget: 0,
|
17723 | frameBorder: 0,
|
17724 | headers: 0,
|
17725 | height: 0,
|
17726 | hidden: HAS_BOOLEAN_VALUE,
|
17727 | high: 0,
|
17728 | href: 0,
|
17729 | hrefLang: 0,
|
17730 | htmlFor: 0,
|
17731 | httpEquiv: 0,
|
17732 | icon: 0,
|
17733 | id: 0,
|
17734 | inputMode: 0,
|
17735 | integrity: 0,
|
17736 | is: 0,
|
17737 | keyParams: 0,
|
17738 | keyType: 0,
|
17739 | kind: 0,
|
17740 | label: 0,
|
17741 | lang: 0,
|
17742 | list: 0,
|
17743 | loop: HAS_BOOLEAN_VALUE,
|
17744 | low: 0,
|
17745 | manifest: 0,
|
17746 | marginHeight: 0,
|
17747 | marginWidth: 0,
|
17748 | max: 0,
|
17749 | maxLength: 0,
|
17750 | media: 0,
|
17751 | mediaGroup: 0,
|
17752 | method: 0,
|
17753 | min: 0,
|
17754 | minLength: 0,
|
17755 |
|
17756 |
|
17757 | multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
17758 | muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
17759 | name: 0,
|
17760 | nonce: 0,
|
17761 | noValidate: HAS_BOOLEAN_VALUE,
|
17762 | open: HAS_BOOLEAN_VALUE,
|
17763 | optimum: 0,
|
17764 | pattern: 0,
|
17765 | placeholder: 0,
|
17766 | poster: 0,
|
17767 | preload: 0,
|
17768 | profile: 0,
|
17769 | radioGroup: 0,
|
17770 | readOnly: HAS_BOOLEAN_VALUE,
|
17771 | rel: 0,
|
17772 | required: HAS_BOOLEAN_VALUE,
|
17773 | reversed: HAS_BOOLEAN_VALUE,
|
17774 | role: 0,
|
17775 | rows: HAS_POSITIVE_NUMERIC_VALUE,
|
17776 | rowSpan: HAS_NUMERIC_VALUE,
|
17777 | sandbox: 0,
|
17778 | scope: 0,
|
17779 | scoped: HAS_BOOLEAN_VALUE,
|
17780 | scrolling: 0,
|
17781 | seamless: HAS_BOOLEAN_VALUE,
|
17782 | selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
17783 | shape: 0,
|
17784 | size: HAS_POSITIVE_NUMERIC_VALUE,
|
17785 | sizes: 0,
|
17786 | span: HAS_POSITIVE_NUMERIC_VALUE,
|
17787 | spellCheck: 0,
|
17788 | src: 0,
|
17789 | srcDoc: 0,
|
17790 | srcLang: 0,
|
17791 | srcSet: 0,
|
17792 | start: HAS_NUMERIC_VALUE,
|
17793 | step: 0,
|
17794 | style: 0,
|
17795 | summary: 0,
|
17796 | tabIndex: 0,
|
17797 | target: 0,
|
17798 | title: 0,
|
17799 |
|
17800 | type: 0,
|
17801 | useMap: 0,
|
17802 | value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
|
17803 | width: 0,
|
17804 | wmode: 0,
|
17805 | wrap: 0,
|
17806 |
|
17807 | |
17808 |
|
17809 |
|
17810 | about: 0,
|
17811 | datatype: 0,
|
17812 | inlist: 0,
|
17813 | prefix: 0,
|
17814 |
|
17815 | property: 0,
|
17816 | resource: 0,
|
17817 | 'typeof': 0,
|
17818 | vocab: 0,
|
17819 |
|
17820 | |
17821 |
|
17822 |
|
17823 |
|
17824 |
|
17825 | autoCapitalize: 0,
|
17826 | autoCorrect: 0,
|
17827 |
|
17828 | autoSave: 0,
|
17829 |
|
17830 | color: 0,
|
17831 |
|
17832 |
|
17833 | itemProp: 0,
|
17834 | itemScope: HAS_BOOLEAN_VALUE,
|
17835 | itemType: 0,
|
17836 |
|
17837 |
|
17838 |
|
17839 | itemID: 0,
|
17840 | itemRef: 0,
|
17841 |
|
17842 |
|
17843 | results: 0,
|
17844 |
|
17845 |
|
17846 | security: 0,
|
17847 |
|
17848 | unselectable: 0
|
17849 | },
|
17850 | DOMAttributeNames: {
|
17851 | acceptCharset: 'accept-charset',
|
17852 | className: 'class',
|
17853 | htmlFor: 'for',
|
17854 | httpEquiv: 'http-equiv'
|
17855 | },
|
17856 | DOMPropertyNames: {}
|
17857 | };
|
17858 |
|
17859 | module.exports = HTMLDOMPropertyConfig;
|
17860 | },{"168":168}],181:[function(require,module,exports){
|
17861 |
|
17862 |
|
17863 |
|
17864 |
|
17865 |
|
17866 |
|
17867 |
|
17868 |
|
17869 |
|
17870 |
|
17871 |
|
17872 | 'use strict';
|
17873 |
|
17874 |
|
17875 |
|
17876 |
|
17877 |
|
17878 |
|
17879 |
|
17880 |
|
17881 | function escape(key) {
|
17882 | var escapeRegex = /[=:]/g;
|
17883 | var escaperLookup = {
|
17884 | '=': '=0',
|
17885 | ':': '=2'
|
17886 | };
|
17887 | var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
17888 | return escaperLookup[match];
|
17889 | });
|
17890 |
|
17891 | return '$' + escapedString;
|
17892 | }
|
17893 |
|
17894 |
|
17895 |
|
17896 |
|
17897 |
|
17898 |
|
17899 |
|
17900 | function unescape(key) {
|
17901 | var unescapeRegex = /(=0|=2)/g;
|
17902 | var unescaperLookup = {
|
17903 | '=0': '=',
|
17904 | '=2': ':'
|
17905 | };
|
17906 | var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
|
17907 |
|
17908 | return ('' + keySubstring).replace(unescapeRegex, function (match) {
|
17909 | return unescaperLookup[match];
|
17910 | });
|
17911 | }
|
17912 |
|
17913 | var KeyEscapeUtils = {
|
17914 | escape: escape,
|
17915 | unescape: unescape
|
17916 | };
|
17917 |
|
17918 | module.exports = KeyEscapeUtils;
|
17919 | },{}],182:[function(require,module,exports){
|
17920 | (function (process){
|
17921 |
|
17922 |
|
17923 |
|
17924 |
|
17925 |
|
17926 |
|
17927 |
|
17928 |
|
17929 |
|
17930 |
|
17931 |
|
17932 | 'use strict';
|
17933 |
|
17934 | var ReactPropTypes = require(241);
|
17935 | var ReactPropTypeLocations = require(240);
|
17936 |
|
17937 | var invariant = require(45);
|
17938 | var warning = require(55);
|
17939 |
|
17940 | var hasReadOnlyValue = {
|
17941 | 'button': true,
|
17942 | 'checkbox': true,
|
17943 | 'image': true,
|
17944 | 'hidden': true,
|
17945 | 'radio': true,
|
17946 | 'reset': true,
|
17947 | 'submit': true
|
17948 | };
|
17949 |
|
17950 | function _assertSingleLink(inputProps) {
|
17951 | !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : void 0;
|
17952 | }
|
17953 | function _assertValueLink(inputProps) {
|
17954 | _assertSingleLink(inputProps);
|
17955 | !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : void 0;
|
17956 | }
|
17957 |
|
17958 | function _assertCheckedLink(inputProps) {
|
17959 | _assertSingleLink(inputProps);
|
17960 | !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : void 0;
|
17961 | }
|
17962 |
|
17963 | var propTypes = {
|
17964 | value: function (props, propName, componentName) {
|
17965 | if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
|
17966 | return null;
|
17967 | }
|
17968 | return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
17969 | },
|
17970 | checked: function (props, propName, componentName) {
|
17971 | if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
|
17972 | return null;
|
17973 | }
|
17974 | return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
17975 | },
|
17976 | onChange: ReactPropTypes.func
|
17977 | };
|
17978 |
|
17979 | var loggedTypeFailures = {};
|
17980 | function getDeclarationErrorAddendum(owner) {
|
17981 | if (owner) {
|
17982 | var name = owner.getName();
|
17983 | if (name) {
|
17984 | return ' Check the render method of `' + name + '`.';
|
17985 | }
|
17986 | }
|
17987 | return '';
|
17988 | }
|
17989 |
|
17990 |
|
17991 |
|
17992 |
|
17993 |
|
17994 | var LinkedValueUtils = {
|
17995 | checkPropTypes: function (tagName, props, owner) {
|
17996 | for (var propName in propTypes) {
|
17997 | if (propTypes.hasOwnProperty(propName)) {
|
17998 | var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
|
17999 | }
|
18000 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
18001 |
|
18002 |
|
18003 | loggedTypeFailures[error.message] = true;
|
18004 |
|
18005 | var addendum = getDeclarationErrorAddendum(owner);
|
18006 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
|
18007 | }
|
18008 | }
|
18009 | },
|
18010 |
|
18011 | |
18012 |
|
18013 |
|
18014 |
|
18015 | getValue: function (inputProps) {
|
18016 | if (inputProps.valueLink) {
|
18017 | _assertValueLink(inputProps);
|
18018 | return inputProps.valueLink.value;
|
18019 | }
|
18020 | return inputProps.value;
|
18021 | },
|
18022 |
|
18023 | |
18024 |
|
18025 |
|
18026 |
|
18027 |
|
18028 | getChecked: function (inputProps) {
|
18029 | if (inputProps.checkedLink) {
|
18030 | _assertCheckedLink(inputProps);
|
18031 | return inputProps.checkedLink.value;
|
18032 | }
|
18033 | return inputProps.checked;
|
18034 | },
|
18035 |
|
18036 | |
18037 |
|
18038 |
|
18039 |
|
18040 | executeOnChange: function (inputProps, event) {
|
18041 | if (inputProps.valueLink) {
|
18042 | _assertValueLink(inputProps);
|
18043 | return inputProps.valueLink.requestChange(event.target.value);
|
18044 | } else if (inputProps.checkedLink) {
|
18045 | _assertCheckedLink(inputProps);
|
18046 | return inputProps.checkedLink.requestChange(event.target.checked);
|
18047 | } else if (inputProps.onChange) {
|
18048 | return inputProps.onChange.call(undefined, event);
|
18049 | }
|
18050 | }
|
18051 | };
|
18052 |
|
18053 | module.exports = LinkedValueUtils;
|
18054 | }).call(this,require(91))
|
18055 | },{"240":240,"241":241,"45":45,"55":55,"91":91}],183:[function(require,module,exports){
|
18056 | (function (process){
|
18057 |
|
18058 |
|
18059 |
|
18060 |
|
18061 |
|
18062 |
|
18063 |
|
18064 |
|
18065 |
|
18066 |
|
18067 |
|
18068 | 'use strict';
|
18069 |
|
18070 | var invariant = require(45);
|
18071 |
|
18072 |
|
18073 |
|
18074 |
|
18075 |
|
18076 |
|
18077 |
|
18078 |
|
18079 | var oneArgumentPooler = function (copyFieldsFrom) {
|
18080 | var Klass = this;
|
18081 | if (Klass.instancePool.length) {
|
18082 | var instance = Klass.instancePool.pop();
|
18083 | Klass.call(instance, copyFieldsFrom);
|
18084 | return instance;
|
18085 | } else {
|
18086 | return new Klass(copyFieldsFrom);
|
18087 | }
|
18088 | };
|
18089 |
|
18090 | var twoArgumentPooler = function (a1, a2) {
|
18091 | var Klass = this;
|
18092 | if (Klass.instancePool.length) {
|
18093 | var instance = Klass.instancePool.pop();
|
18094 | Klass.call(instance, a1, a2);
|
18095 | return instance;
|
18096 | } else {
|
18097 | return new Klass(a1, a2);
|
18098 | }
|
18099 | };
|
18100 |
|
18101 | var threeArgumentPooler = function (a1, a2, a3) {
|
18102 | var Klass = this;
|
18103 | if (Klass.instancePool.length) {
|
18104 | var instance = Klass.instancePool.pop();
|
18105 | Klass.call(instance, a1, a2, a3);
|
18106 | return instance;
|
18107 | } else {
|
18108 | return new Klass(a1, a2, a3);
|
18109 | }
|
18110 | };
|
18111 |
|
18112 | var fourArgumentPooler = function (a1, a2, a3, a4) {
|
18113 | var Klass = this;
|
18114 | if (Klass.instancePool.length) {
|
18115 | var instance = Klass.instancePool.pop();
|
18116 | Klass.call(instance, a1, a2, a3, a4);
|
18117 | return instance;
|
18118 | } else {
|
18119 | return new Klass(a1, a2, a3, a4);
|
18120 | }
|
18121 | };
|
18122 |
|
18123 | var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
18124 | var Klass = this;
|
18125 | if (Klass.instancePool.length) {
|
18126 | var instance = Klass.instancePool.pop();
|
18127 | Klass.call(instance, a1, a2, a3, a4, a5);
|
18128 | return instance;
|
18129 | } else {
|
18130 | return new Klass(a1, a2, a3, a4, a5);
|
18131 | }
|
18132 | };
|
18133 |
|
18134 | var standardReleaser = function (instance) {
|
18135 | var Klass = this;
|
18136 | !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0;
|
18137 | instance.destructor();
|
18138 | if (Klass.instancePool.length < Klass.poolSize) {
|
18139 | Klass.instancePool.push(instance);
|
18140 | }
|
18141 | };
|
18142 |
|
18143 | var DEFAULT_POOL_SIZE = 10;
|
18144 | var DEFAULT_POOLER = oneArgumentPooler;
|
18145 |
|
18146 |
|
18147 |
|
18148 |
|
18149 |
|
18150 |
|
18151 |
|
18152 |
|
18153 |
|
18154 |
|
18155 | var addPoolingTo = function (CopyConstructor, pooler) {
|
18156 | var NewKlass = CopyConstructor;
|
18157 | NewKlass.instancePool = [];
|
18158 | NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
18159 | if (!NewKlass.poolSize) {
|
18160 | NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
18161 | }
|
18162 | NewKlass.release = standardReleaser;
|
18163 | return NewKlass;
|
18164 | };
|
18165 |
|
18166 | var PooledClass = {
|
18167 | addPoolingTo: addPoolingTo,
|
18168 | oneArgumentPooler: oneArgumentPooler,
|
18169 | twoArgumentPooler: twoArgumentPooler,
|
18170 | threeArgumentPooler: threeArgumentPooler,
|
18171 | fourArgumentPooler: fourArgumentPooler,
|
18172 | fiveArgumentPooler: fiveArgumentPooler
|
18173 | };
|
18174 |
|
18175 | module.exports = PooledClass;
|
18176 | }).call(this,require(91))
|
18177 | },{"45":45,"91":91}],184:[function(require,module,exports){
|
18178 | (function (process){
|
18179 |
|
18180 |
|
18181 |
|
18182 |
|
18183 |
|
18184 |
|
18185 |
|
18186 |
|
18187 |
|
18188 |
|
18189 |
|
18190 | 'use strict';
|
18191 |
|
18192 | var _assign = require(296);
|
18193 |
|
18194 | var ReactChildren = require(187);
|
18195 | var ReactComponent = require(189);
|
18196 | var ReactClass = require(188);
|
18197 | var ReactDOMFactories = require(203);
|
18198 | var ReactElement = require(218);
|
18199 | var ReactElementValidator = require(219);
|
18200 | var ReactPropTypes = require(241);
|
18201 | var ReactVersion = require(248);
|
18202 |
|
18203 | var onlyChild = require(288);
|
18204 | var warning = require(55);
|
18205 |
|
18206 | var createElement = ReactElement.createElement;
|
18207 | var createFactory = ReactElement.createFactory;
|
18208 | var cloneElement = ReactElement.cloneElement;
|
18209 |
|
18210 | if (process.env.NODE_ENV !== 'production') {
|
18211 | createElement = ReactElementValidator.createElement;
|
18212 | createFactory = ReactElementValidator.createFactory;
|
18213 | cloneElement = ReactElementValidator.cloneElement;
|
18214 | }
|
18215 |
|
18216 | var __spread = _assign;
|
18217 |
|
18218 | if (process.env.NODE_ENV !== 'production') {
|
18219 | var warned = false;
|
18220 | __spread = function () {
|
18221 | process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
|
18222 | warned = true;
|
18223 | return _assign.apply(null, arguments);
|
18224 | };
|
18225 | }
|
18226 |
|
18227 | var React = {
|
18228 |
|
18229 |
|
18230 |
|
18231 | Children: {
|
18232 | map: ReactChildren.map,
|
18233 | forEach: ReactChildren.forEach,
|
18234 | count: ReactChildren.count,
|
18235 | toArray: ReactChildren.toArray,
|
18236 | only: onlyChild
|
18237 | },
|
18238 |
|
18239 | Component: ReactComponent,
|
18240 |
|
18241 | createElement: createElement,
|
18242 | cloneElement: cloneElement,
|
18243 | isValidElement: ReactElement.isValidElement,
|
18244 |
|
18245 |
|
18246 |
|
18247 | PropTypes: ReactPropTypes,
|
18248 | createClass: ReactClass.createClass,
|
18249 | createFactory: createFactory,
|
18250 | createMixin: function (mixin) {
|
18251 |
|
18252 | return mixin;
|
18253 | },
|
18254 |
|
18255 |
|
18256 |
|
18257 | DOM: ReactDOMFactories,
|
18258 |
|
18259 | version: ReactVersion,
|
18260 |
|
18261 |
|
18262 | __spread: __spread
|
18263 | };
|
18264 |
|
18265 | module.exports = React;
|
18266 | }).call(this,require(91))
|
18267 | },{"187":187,"188":188,"189":189,"203":203,"218":218,"219":219,"241":241,"248":248,"288":288,"296":296,"55":55,"91":91}],185:[function(require,module,exports){
|
18268 |
|
18269 |
|
18270 |
|
18271 |
|
18272 |
|
18273 |
|
18274 |
|
18275 |
|
18276 |
|
18277 |
|
18278 |
|
18279 | 'use strict';
|
18280 |
|
18281 | var _assign = require(296);
|
18282 |
|
18283 | var EventConstants = require(174);
|
18284 | var EventPluginRegistry = require(176);
|
18285 | var ReactEventEmitterMixin = require(222);
|
18286 | var ViewportMetrics = require(266);
|
18287 |
|
18288 | var getVendorPrefixedEventName = require(284);
|
18289 | var isEventSupported = require(286);
|
18290 |
|
18291 |
|
18292 |
|
18293 |
|
18294 |
|
18295 |
|
18296 |
|
18297 |
|
18298 |
|
18299 |
|
18300 |
|
18301 |
|
18302 |
|
18303 |
|
18304 |
|
18305 |
|
18306 |
|
18307 |
|
18308 |
|
18309 |
|
18310 |
|
18311 |
|
18312 |
|
18313 |
|
18314 |
|
18315 |
|
18316 |
|
18317 |
|
18318 |
|
18319 |
|
18320 |
|
18321 |
|
18322 |
|
18323 |
|
18324 |
|
18325 |
|
18326 |
|
18327 |
|
18328 |
|
18329 |
|
18330 |
|
18331 |
|
18332 |
|
18333 |
|
18334 |
|
18335 |
|
18336 |
|
18337 |
|
18338 |
|
18339 |
|
18340 |
|
18341 |
|
18342 |
|
18343 |
|
18344 |
|
18345 |
|
18346 | var hasEventPageXY;
|
18347 | var alreadyListeningTo = {};
|
18348 | var isMonitoringScrollValue = false;
|
18349 | var reactTopListenersCounter = 0;
|
18350 |
|
18351 |
|
18352 |
|
18353 |
|
18354 | var topEventMapping = {
|
18355 | topAbort: 'abort',
|
18356 | topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
|
18357 | topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
|
18358 | topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
|
18359 | topBlur: 'blur',
|
18360 | topCanPlay: 'canplay',
|
18361 | topCanPlayThrough: 'canplaythrough',
|
18362 | topChange: 'change',
|
18363 | topClick: 'click',
|
18364 | topCompositionEnd: 'compositionend',
|
18365 | topCompositionStart: 'compositionstart',
|
18366 | topCompositionUpdate: 'compositionupdate',
|
18367 | topContextMenu: 'contextmenu',
|
18368 | topCopy: 'copy',
|
18369 | topCut: 'cut',
|
18370 | topDoubleClick: 'dblclick',
|
18371 | topDrag: 'drag',
|
18372 | topDragEnd: 'dragend',
|
18373 | topDragEnter: 'dragenter',
|
18374 | topDragExit: 'dragexit',
|
18375 | topDragLeave: 'dragleave',
|
18376 | topDragOver: 'dragover',
|
18377 | topDragStart: 'dragstart',
|
18378 | topDrop: 'drop',
|
18379 | topDurationChange: 'durationchange',
|
18380 | topEmptied: 'emptied',
|
18381 | topEncrypted: 'encrypted',
|
18382 | topEnded: 'ended',
|
18383 | topError: 'error',
|
18384 | topFocus: 'focus',
|
18385 | topInput: 'input',
|
18386 | topKeyDown: 'keydown',
|
18387 | topKeyPress: 'keypress',
|
18388 | topKeyUp: 'keyup',
|
18389 | topLoadedData: 'loadeddata',
|
18390 | topLoadedMetadata: 'loadedmetadata',
|
18391 | topLoadStart: 'loadstart',
|
18392 | topMouseDown: 'mousedown',
|
18393 | topMouseMove: 'mousemove',
|
18394 | topMouseOut: 'mouseout',
|
18395 | topMouseOver: 'mouseover',
|
18396 | topMouseUp: 'mouseup',
|
18397 | topPaste: 'paste',
|
18398 | topPause: 'pause',
|
18399 | topPlay: 'play',
|
18400 | topPlaying: 'playing',
|
18401 | topProgress: 'progress',
|
18402 | topRateChange: 'ratechange',
|
18403 | topScroll: 'scroll',
|
18404 | topSeeked: 'seeked',
|
18405 | topSeeking: 'seeking',
|
18406 | topSelectionChange: 'selectionchange',
|
18407 | topStalled: 'stalled',
|
18408 | topSuspend: 'suspend',
|
18409 | topTextInput: 'textInput',
|
18410 | topTimeUpdate: 'timeupdate',
|
18411 | topTouchCancel: 'touchcancel',
|
18412 | topTouchEnd: 'touchend',
|
18413 | topTouchMove: 'touchmove',
|
18414 | topTouchStart: 'touchstart',
|
18415 | topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
|
18416 | topVolumeChange: 'volumechange',
|
18417 | topWaiting: 'waiting',
|
18418 | topWheel: 'wheel'
|
18419 | };
|
18420 |
|
18421 |
|
18422 |
|
18423 |
|
18424 | var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
|
18425 |
|
18426 | function getListeningForDocument(mountAt) {
|
18427 |
|
18428 |
|
18429 | if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
|
18430 | mountAt[topListenersIDKey] = reactTopListenersCounter++;
|
18431 | alreadyListeningTo[mountAt[topListenersIDKey]] = {};
|
18432 | }
|
18433 | return alreadyListeningTo[mountAt[topListenersIDKey]];
|
18434 | }
|
18435 |
|
18436 |
|
18437 |
|
18438 |
|
18439 |
|
18440 |
|
18441 |
|
18442 |
|
18443 |
|
18444 |
|
18445 |
|
18446 | var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
|
18447 |
|
18448 | |
18449 |
|
18450 |
|
18451 | ReactEventListener: null,
|
18452 |
|
18453 | injection: {
|
18454 | |
18455 |
|
18456 |
|
18457 | injectReactEventListener: function (ReactEventListener) {
|
18458 | ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
|
18459 | ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
|
18460 | }
|
18461 | },
|
18462 |
|
18463 | |
18464 |
|
18465 |
|
18466 |
|
18467 |
|
18468 | setEnabled: function (enabled) {
|
18469 | if (ReactBrowserEventEmitter.ReactEventListener) {
|
18470 | ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
|
18471 | }
|
18472 | },
|
18473 |
|
18474 | |
18475 |
|
18476 |
|
18477 | isEnabled: function () {
|
18478 | return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
|
18479 | },
|
18480 |
|
18481 | |
18482 |
|
18483 |
|
18484 |
|
18485 |
|
18486 |
|
18487 |
|
18488 |
|
18489 |
|
18490 |
|
18491 |
|
18492 |
|
18493 |
|
18494 |
|
18495 |
|
18496 |
|
18497 |
|
18498 |
|
18499 |
|
18500 |
|
18501 |
|
18502 | listenTo: function (registrationName, contentDocumentHandle) {
|
18503 | var mountAt = contentDocumentHandle;
|
18504 | var isListening = getListeningForDocument(mountAt);
|
18505 | var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
|
18506 |
|
18507 | var topLevelTypes = EventConstants.topLevelTypes;
|
18508 | for (var i = 0; i < dependencies.length; i++) {
|
18509 | var dependency = dependencies[i];
|
18510 | if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
|
18511 | if (dependency === topLevelTypes.topWheel) {
|
18512 | if (isEventSupported('wheel')) {
|
18513 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
|
18514 | } else if (isEventSupported('mousewheel')) {
|
18515 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
|
18516 | } else {
|
18517 |
|
18518 |
|
18519 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
|
18520 | }
|
18521 | } else if (dependency === topLevelTypes.topScroll) {
|
18522 |
|
18523 | if (isEventSupported('scroll', true)) {
|
18524 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
|
18525 | } else {
|
18526 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
|
18527 | }
|
18528 | } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
|
18529 |
|
18530 | if (isEventSupported('focus', true)) {
|
18531 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
|
18532 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
|
18533 | } else if (isEventSupported('focusin')) {
|
18534 |
|
18535 |
|
18536 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
|
18537 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
|
18538 | }
|
18539 |
|
18540 |
|
18541 | isListening[topLevelTypes.topBlur] = true;
|
18542 | isListening[topLevelTypes.topFocus] = true;
|
18543 | } else if (topEventMapping.hasOwnProperty(dependency)) {
|
18544 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
|
18545 | }
|
18546 |
|
18547 | isListening[dependency] = true;
|
18548 | }
|
18549 | }
|
18550 | },
|
18551 |
|
18552 | trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
18553 | return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
|
18554 | },
|
18555 |
|
18556 | trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
18557 | return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
|
18558 | },
|
18559 |
|
18560 | |
18561 |
|
18562 |
|
18563 |
|
18564 |
|
18565 |
|
18566 |
|
18567 |
|
18568 |
|
18569 |
|
18570 |
|
18571 | ensureScrollValueMonitoring: function () {
|
18572 | if (hasEventPageXY === undefined) {
|
18573 | hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');
|
18574 | }
|
18575 | if (!hasEventPageXY && !isMonitoringScrollValue) {
|
18576 | var refresh = ViewportMetrics.refreshScrollValues;
|
18577 | ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
|
18578 | isMonitoringScrollValue = true;
|
18579 | }
|
18580 | }
|
18581 |
|
18582 | });
|
18583 |
|
18584 | module.exports = ReactBrowserEventEmitter;
|
18585 | },{"174":174,"176":176,"222":222,"266":266,"284":284,"286":286,"296":296}],186:[function(require,module,exports){
|
18586 | (function (process){
|
18587 |
|
18588 |
|
18589 |
|
18590 |
|
18591 |
|
18592 |
|
18593 |
|
18594 |
|
18595 |
|
18596 |
|
18597 |
|
18598 | 'use strict';
|
18599 |
|
18600 | var ReactReconciler = require(243);
|
18601 |
|
18602 | var instantiateReactComponent = require(285);
|
18603 | var KeyEscapeUtils = require(181);
|
18604 | var shouldUpdateReactComponent = require(293);
|
18605 | var traverseAllChildren = require(294);
|
18606 | var warning = require(55);
|
18607 |
|
18608 | function instantiateChild(childInstances, child, name) {
|
18609 |
|
18610 | var keyUnique = childInstances[name] === undefined;
|
18611 | if (process.env.NODE_ENV !== 'production') {
|
18612 | process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;
|
18613 | }
|
18614 | if (child != null && keyUnique) {
|
18615 | childInstances[name] = instantiateReactComponent(child);
|
18616 | }
|
18617 | }
|
18618 |
|
18619 |
|
18620 |
|
18621 |
|
18622 |
|
18623 |
|
18624 | var ReactChildReconciler = {
|
18625 | |
18626 |
|
18627 |
|
18628 |
|
18629 |
|
18630 |
|
18631 |
|
18632 |
|
18633 | instantiateChildren: function (nestedChildNodes, transaction, context) {
|
18634 | if (nestedChildNodes == null) {
|
18635 | return null;
|
18636 | }
|
18637 | var childInstances = {};
|
18638 | traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
|
18639 | return childInstances;
|
18640 | },
|
18641 |
|
18642 | |
18643 |
|
18644 |
|
18645 |
|
18646 |
|
18647 |
|
18648 |
|
18649 |
|
18650 |
|
18651 |
|
18652 | updateChildren: function (prevChildren, nextChildren, removedNodes, transaction, context) {
|
18653 |
|
18654 |
|
18655 |
|
18656 |
|
18657 |
|
18658 | if (!nextChildren && !prevChildren) {
|
18659 | return;
|
18660 | }
|
18661 | var name;
|
18662 | var prevChild;
|
18663 | for (name in nextChildren) {
|
18664 | if (!nextChildren.hasOwnProperty(name)) {
|
18665 | continue;
|
18666 | }
|
18667 | prevChild = prevChildren && prevChildren[name];
|
18668 | var prevElement = prevChild && prevChild._currentElement;
|
18669 | var nextElement = nextChildren[name];
|
18670 | if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
|
18671 | ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
|
18672 | nextChildren[name] = prevChild;
|
18673 | } else {
|
18674 | if (prevChild) {
|
18675 | removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
|
18676 | ReactReconciler.unmountComponent(prevChild, false);
|
18677 | }
|
18678 |
|
18679 | var nextChildInstance = instantiateReactComponent(nextElement);
|
18680 | nextChildren[name] = nextChildInstance;
|
18681 | }
|
18682 | }
|
18683 |
|
18684 | for (name in prevChildren) {
|
18685 | if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
|
18686 | prevChild = prevChildren[name];
|
18687 | removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
|
18688 | ReactReconciler.unmountComponent(prevChild, false);
|
18689 | }
|
18690 | }
|
18691 | },
|
18692 |
|
18693 | |
18694 |
|
18695 |
|
18696 |
|
18697 |
|
18698 |
|
18699 |
|
18700 | unmountChildren: function (renderedChildren, safely) {
|
18701 | for (var name in renderedChildren) {
|
18702 | if (renderedChildren.hasOwnProperty(name)) {
|
18703 | var renderedChild = renderedChildren[name];
|
18704 | ReactReconciler.unmountComponent(renderedChild, safely);
|
18705 | }
|
18706 | }
|
18707 | }
|
18708 |
|
18709 | };
|
18710 |
|
18711 | module.exports = ReactChildReconciler;
|
18712 | }).call(this,require(91))
|
18713 | },{"181":181,"243":243,"285":285,"293":293,"294":294,"55":55,"91":91}],187:[function(require,module,exports){
|
18714 |
|
18715 |
|
18716 |
|
18717 |
|
18718 |
|
18719 |
|
18720 |
|
18721 |
|
18722 |
|
18723 |
|
18724 |
|
18725 | 'use strict';
|
18726 |
|
18727 | var PooledClass = require(183);
|
18728 | var ReactElement = require(218);
|
18729 |
|
18730 | var emptyFunction = require(37);
|
18731 | var traverseAllChildren = require(294);
|
18732 |
|
18733 | var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
18734 | var fourArgumentPooler = PooledClass.fourArgumentPooler;
|
18735 |
|
18736 | var userProvidedKeyEscapeRegex = /\/+/g;
|
18737 | function escapeUserProvidedKey(text) {
|
18738 | return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
18739 | }
|
18740 |
|
18741 |
|
18742 |
|
18743 |
|
18744 |
|
18745 |
|
18746 |
|
18747 |
|
18748 |
|
18749 | function ForEachBookKeeping(forEachFunction, forEachContext) {
|
18750 | this.func = forEachFunction;
|
18751 | this.context = forEachContext;
|
18752 | this.count = 0;
|
18753 | }
|
18754 | ForEachBookKeeping.prototype.destructor = function () {
|
18755 | this.func = null;
|
18756 | this.context = null;
|
18757 | this.count = 0;
|
18758 | };
|
18759 | PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
|
18760 |
|
18761 | function forEachSingleChild(bookKeeping, child, name) {
|
18762 | var func = bookKeeping.func;
|
18763 | var context = bookKeeping.context;
|
18764 |
|
18765 | func.call(context, child, bookKeeping.count++);
|
18766 | }
|
18767 |
|
18768 |
|
18769 |
|
18770 |
|
18771 |
|
18772 |
|
18773 |
|
18774 |
|
18775 |
|
18776 |
|
18777 |
|
18778 |
|
18779 |
|
18780 | function forEachChildren(children, forEachFunc, forEachContext) {
|
18781 | if (children == null) {
|
18782 | return children;
|
18783 | }
|
18784 | var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
|
18785 | traverseAllChildren(children, forEachSingleChild, traverseContext);
|
18786 | ForEachBookKeeping.release(traverseContext);
|
18787 | }
|
18788 |
|
18789 |
|
18790 |
|
18791 |
|
18792 |
|
18793 |
|
18794 |
|
18795 |
|
18796 |
|
18797 |
|
18798 | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
18799 | this.result = mapResult;
|
18800 | this.keyPrefix = keyPrefix;
|
18801 | this.func = mapFunction;
|
18802 | this.context = mapContext;
|
18803 | this.count = 0;
|
18804 | }
|
18805 | MapBookKeeping.prototype.destructor = function () {
|
18806 | this.result = null;
|
18807 | this.keyPrefix = null;
|
18808 | this.func = null;
|
18809 | this.context = null;
|
18810 | this.count = 0;
|
18811 | };
|
18812 | PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
18813 |
|
18814 | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
18815 | var result = bookKeeping.result;
|
18816 | var keyPrefix = bookKeeping.keyPrefix;
|
18817 | var func = bookKeeping.func;
|
18818 | var context = bookKeeping.context;
|
18819 |
|
18820 |
|
18821 | var mappedChild = func.call(context, child, bookKeeping.count++);
|
18822 | if (Array.isArray(mappedChild)) {
|
18823 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
|
18824 | } else if (mappedChild != null) {
|
18825 | if (ReactElement.isValidElement(mappedChild)) {
|
18826 | mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
|
18827 |
|
18828 |
|
18829 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
18830 | }
|
18831 | result.push(mappedChild);
|
18832 | }
|
18833 | }
|
18834 |
|
18835 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
18836 | var escapedPrefix = '';
|
18837 | if (prefix != null) {
|
18838 | escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
18839 | }
|
18840 | var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
|
18841 | traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
18842 | MapBookKeeping.release(traverseContext);
|
18843 | }
|
18844 |
|
18845 |
|
18846 |
|
18847 |
|
18848 |
|
18849 |
|
18850 |
|
18851 |
|
18852 |
|
18853 |
|
18854 |
|
18855 |
|
18856 |
|
18857 |
|
18858 | function mapChildren(children, func, context) {
|
18859 | if (children == null) {
|
18860 | return children;
|
18861 | }
|
18862 | var result = [];
|
18863 | mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
18864 | return result;
|
18865 | }
|
18866 |
|
18867 | function forEachSingleChildDummy(traverseContext, child, name) {
|
18868 | return null;
|
18869 | }
|
18870 |
|
18871 |
|
18872 |
|
18873 |
|
18874 |
|
18875 |
|
18876 |
|
18877 |
|
18878 |
|
18879 |
|
18880 | function countChildren(children, context) {
|
18881 | return traverseAllChildren(children, forEachSingleChildDummy, null);
|
18882 | }
|
18883 |
|
18884 |
|
18885 |
|
18886 |
|
18887 |
|
18888 |
|
18889 |
|
18890 | function toArray(children) {
|
18891 | var result = [];
|
18892 | mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
|
18893 | return result;
|
18894 | }
|
18895 |
|
18896 | var ReactChildren = {
|
18897 | forEach: forEachChildren,
|
18898 | map: mapChildren,
|
18899 | mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
|
18900 | count: countChildren,
|
18901 | toArray: toArray
|
18902 | };
|
18903 |
|
18904 | module.exports = ReactChildren;
|
18905 | },{"183":183,"218":218,"294":294,"37":37}],188:[function(require,module,exports){
|
18906 | (function (process){
|
18907 |
|
18908 |
|
18909 |
|
18910 |
|
18911 |
|
18912 |
|
18913 |
|
18914 |
|
18915 |
|
18916 |
|
18917 |
|
18918 | 'use strict';
|
18919 |
|
18920 | var _assign = require(296);
|
18921 |
|
18922 | var ReactComponent = require(189);
|
18923 | var ReactElement = require(218);
|
18924 | var ReactPropTypeLocations = require(240);
|
18925 | var ReactPropTypeLocationNames = require(239);
|
18926 | var ReactNoopUpdateQueue = require(237);
|
18927 |
|
18928 | var emptyObject = require(38);
|
18929 | var invariant = require(45);
|
18930 | var keyMirror = require(48);
|
18931 | var keyOf = require(49);
|
18932 | var warning = require(55);
|
18933 |
|
18934 | var MIXINS_KEY = keyOf({ mixins: null });
|
18935 |
|
18936 |
|
18937 |
|
18938 |
|
18939 | var SpecPolicy = keyMirror({
|
18940 | |
18941 |
|
18942 |
|
18943 | DEFINE_ONCE: null,
|
18944 | |
18945 |
|
18946 |
|
18947 |
|
18948 | DEFINE_MANY: null,
|
18949 | |
18950 |
|
18951 |
|
18952 | OVERRIDE_BASE: null,
|
18953 | |
18954 |
|
18955 |
|
18956 |
|
18957 |
|
18958 | DEFINE_MANY_MERGED: null
|
18959 | });
|
18960 |
|
18961 | var injectedMixins = [];
|
18962 |
|
18963 |
|
18964 |
|
18965 |
|
18966 |
|
18967 |
|
18968 |
|
18969 |
|
18970 |
|
18971 |
|
18972 |
|
18973 |
|
18974 |
|
18975 |
|
18976 |
|
18977 |
|
18978 |
|
18979 |
|
18980 |
|
18981 |
|
18982 |
|
18983 |
|
18984 |
|
18985 | var ReactClassInterface = {
|
18986 |
|
18987 | |
18988 |
|
18989 |
|
18990 |
|
18991 |
|
18992 |
|
18993 | mixins: SpecPolicy.DEFINE_MANY,
|
18994 |
|
18995 | |
18996 |
|
18997 |
|
18998 |
|
18999 |
|
19000 |
|
19001 |
|
19002 | statics: SpecPolicy.DEFINE_MANY,
|
19003 |
|
19004 | |
19005 |
|
19006 |
|
19007 |
|
19008 |
|
19009 |
|
19010 | propTypes: SpecPolicy.DEFINE_MANY,
|
19011 |
|
19012 | |
19013 |
|
19014 |
|
19015 |
|
19016 |
|
19017 |
|
19018 | contextTypes: SpecPolicy.DEFINE_MANY,
|
19019 |
|
19020 | |
19021 |
|
19022 |
|
19023 |
|
19024 |
|
19025 |
|
19026 | childContextTypes: SpecPolicy.DEFINE_MANY,
|
19027 |
|
19028 |
|
19029 |
|
19030 | |
19031 |
|
19032 |
|
19033 |
|
19034 |
|
19035 |
|
19036 |
|
19037 |
|
19038 |
|
19039 |
|
19040 | getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
|
19041 |
|
19042 | |
19043 |
|
19044 |
|
19045 |
|
19046 |
|
19047 |
|
19048 |
|
19049 |
|
19050 |
|
19051 |
|
19052 |
|
19053 |
|
19054 |
|
19055 |
|
19056 | getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
|
19057 |
|
19058 | |
19059 |
|
19060 |
|
19061 |
|
19062 | getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
|
19063 |
|
19064 | |
19065 |
|
19066 |
|
19067 |
|
19068 |
|
19069 |
|
19070 |
|
19071 |
|
19072 |
|
19073 |
|
19074 |
|
19075 |
|
19076 |
|
19077 |
|
19078 |
|
19079 |
|
19080 | render: SpecPolicy.DEFINE_ONCE,
|
19081 |
|
19082 |
|
19083 |
|
19084 | |
19085 |
|
19086 |
|
19087 |
|
19088 |
|
19089 |
|
19090 |
|
19091 | componentWillMount: SpecPolicy.DEFINE_MANY,
|
19092 |
|
19093 | |
19094 |
|
19095 |
|
19096 |
|
19097 |
|
19098 |
|
19099 |
|
19100 |
|
19101 |
|
19102 |
|
19103 | componentDidMount: SpecPolicy.DEFINE_MANY,
|
19104 |
|
19105 | |
19106 |
|
19107 |
|
19108 |
|
19109 |
|
19110 |
|
19111 |
|
19112 |
|
19113 |
|
19114 |
|
19115 |
|
19116 |
|
19117 |
|
19118 |
|
19119 |
|
19120 |
|
19121 |
|
19122 |
|
19123 |
|
19124 | componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
|
19125 |
|
19126 | |
19127 |
|
19128 |
|
19129 |
|
19130 |
|
19131 |
|
19132 |
|
19133 |
|
19134 |
|
19135 |
|
19136 |
|
19137 |
|
19138 |
|
19139 |
|
19140 |
|
19141 |
|
19142 |
|
19143 |
|
19144 |
|
19145 |
|
19146 | shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
|
19147 |
|
19148 | |
19149 |
|
19150 |
|
19151 |
|
19152 |
|
19153 |
|
19154 |
|
19155 |
|
19156 |
|
19157 |
|
19158 |
|
19159 |
|
19160 |
|
19161 |
|
19162 |
|
19163 | componentWillUpdate: SpecPolicy.DEFINE_MANY,
|
19164 |
|
19165 | |
19166 |
|
19167 |
|
19168 |
|
19169 |
|
19170 |
|
19171 |
|
19172 |
|
19173 |
|
19174 |
|
19175 |
|
19176 |
|
19177 | componentDidUpdate: SpecPolicy.DEFINE_MANY,
|
19178 |
|
19179 | |
19180 |
|
19181 |
|
19182 |
|
19183 |
|
19184 |
|
19185 |
|
19186 |
|
19187 |
|
19188 |
|
19189 |
|
19190 | componentWillUnmount: SpecPolicy.DEFINE_MANY,
|
19191 |
|
19192 |
|
19193 |
|
19194 | |
19195 |
|
19196 |
|
19197 |
|
19198 |
|
19199 |
|
19200 |
|
19201 |
|
19202 |
|
19203 |
|
19204 | updateComponent: SpecPolicy.OVERRIDE_BASE
|
19205 |
|
19206 | };
|
19207 |
|
19208 |
|
19209 |
|
19210 |
|
19211 |
|
19212 |
|
19213 |
|
19214 |
|
19215 |
|
19216 |
|
19217 | var RESERVED_SPEC_KEYS = {
|
19218 | displayName: function (Constructor, displayName) {
|
19219 | Constructor.displayName = displayName;
|
19220 | },
|
19221 | mixins: function (Constructor, mixins) {
|
19222 | if (mixins) {
|
19223 | for (var i = 0; i < mixins.length; i++) {
|
19224 | mixSpecIntoComponent(Constructor, mixins[i]);
|
19225 | }
|
19226 | }
|
19227 | },
|
19228 | childContextTypes: function (Constructor, childContextTypes) {
|
19229 | if (process.env.NODE_ENV !== 'production') {
|
19230 | validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
|
19231 | }
|
19232 | Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
|
19233 | },
|
19234 | contextTypes: function (Constructor, contextTypes) {
|
19235 | if (process.env.NODE_ENV !== 'production') {
|
19236 | validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
|
19237 | }
|
19238 | Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
|
19239 | },
|
19240 | |
19241 |
|
19242 |
|
19243 |
|
19244 | getDefaultProps: function (Constructor, getDefaultProps) {
|
19245 | if (Constructor.getDefaultProps) {
|
19246 | Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
|
19247 | } else {
|
19248 | Constructor.getDefaultProps = getDefaultProps;
|
19249 | }
|
19250 | },
|
19251 | propTypes: function (Constructor, propTypes) {
|
19252 | if (process.env.NODE_ENV !== 'production') {
|
19253 | validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
|
19254 | }
|
19255 | Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
|
19256 | },
|
19257 | statics: function (Constructor, statics) {
|
19258 | mixStaticSpecIntoComponent(Constructor, statics);
|
19259 | },
|
19260 | autobind: function () {} };
|
19261 |
|
19262 |
|
19263 | function validateTypeDef(Constructor, typeDef, location) {
|
19264 | for (var propName in typeDef) {
|
19265 | if (typeDef.hasOwnProperty(propName)) {
|
19266 |
|
19267 |
|
19268 | process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
|
19269 | }
|
19270 | }
|
19271 | }
|
19272 |
|
19273 | function validateMethodOverride(isAlreadyDefined, name) {
|
19274 | var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
|
19275 |
|
19276 |
|
19277 | if (ReactClassMixin.hasOwnProperty(name)) {
|
19278 | !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : void 0;
|
19279 | }
|
19280 |
|
19281 |
|
19282 | if (isAlreadyDefined) {
|
19283 | !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : void 0;
|
19284 | }
|
19285 | }
|
19286 |
|
19287 |
|
19288 |
|
19289 |
|
19290 |
|
19291 | function mixSpecIntoComponent(Constructor, spec) {
|
19292 | if (!spec) {
|
19293 | return;
|
19294 | }
|
19295 |
|
19296 | !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.') : invariant(false) : void 0;
|
19297 | !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : void 0;
|
19298 |
|
19299 | var proto = Constructor.prototype;
|
19300 | var autoBindPairs = proto.__reactAutoBindPairs;
|
19301 |
|
19302 |
|
19303 |
|
19304 |
|
19305 | if (spec.hasOwnProperty(MIXINS_KEY)) {
|
19306 | RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
|
19307 | }
|
19308 |
|
19309 | for (var name in spec) {
|
19310 | if (!spec.hasOwnProperty(name)) {
|
19311 | continue;
|
19312 | }
|
19313 |
|
19314 | if (name === MIXINS_KEY) {
|
19315 |
|
19316 | continue;
|
19317 | }
|
19318 |
|
19319 | var property = spec[name];
|
19320 | var isAlreadyDefined = proto.hasOwnProperty(name);
|
19321 | validateMethodOverride(isAlreadyDefined, name);
|
19322 |
|
19323 | if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
|
19324 | RESERVED_SPEC_KEYS[name](Constructor, property);
|
19325 | } else {
|
19326 |
|
19327 |
|
19328 |
|
19329 |
|
19330 | var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
|
19331 | var isFunction = typeof property === 'function';
|
19332 | var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
|
19333 |
|
19334 | if (shouldAutoBind) {
|
19335 | autoBindPairs.push(name, property);
|
19336 | proto[name] = property;
|
19337 | } else {
|
19338 | if (isAlreadyDefined) {
|
19339 | var specPolicy = ReactClassInterface[name];
|
19340 |
|
19341 |
|
19342 | !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : void 0;
|
19343 |
|
19344 |
|
19345 |
|
19346 | if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
|
19347 | proto[name] = createMergedResultFunction(proto[name], property);
|
19348 | } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
|
19349 | proto[name] = createChainedFunction(proto[name], property);
|
19350 | }
|
19351 | } else {
|
19352 | proto[name] = property;
|
19353 | if (process.env.NODE_ENV !== 'production') {
|
19354 |
|
19355 |
|
19356 | if (typeof property === 'function' && spec.displayName) {
|
19357 | proto[name].displayName = spec.displayName + '_' + name;
|
19358 | }
|
19359 | }
|
19360 | }
|
19361 | }
|
19362 | }
|
19363 | }
|
19364 | }
|
19365 |
|
19366 | function mixStaticSpecIntoComponent(Constructor, statics) {
|
19367 | if (!statics) {
|
19368 | return;
|
19369 | }
|
19370 | for (var name in statics) {
|
19371 | var property = statics[name];
|
19372 | if (!statics.hasOwnProperty(name)) {
|
19373 | continue;
|
19374 | }
|
19375 |
|
19376 | var isReserved = name in RESERVED_SPEC_KEYS;
|
19377 | !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : void 0;
|
19378 |
|
19379 | var isInherited = name in Constructor;
|
19380 | !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : void 0;
|
19381 | Constructor[name] = property;
|
19382 | }
|
19383 | }
|
19384 |
|
19385 |
|
19386 |
|
19387 |
|
19388 |
|
19389 |
|
19390 |
|
19391 |
|
19392 | function mergeIntoWithNoDuplicateKeys(one, two) {
|
19393 | !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : void 0;
|
19394 |
|
19395 | for (var key in two) {
|
19396 | if (two.hasOwnProperty(key)) {
|
19397 | !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : void 0;
|
19398 | one[key] = two[key];
|
19399 | }
|
19400 | }
|
19401 | return one;
|
19402 | }
|
19403 |
|
19404 |
|
19405 |
|
19406 |
|
19407 |
|
19408 |
|
19409 |
|
19410 |
|
19411 |
|
19412 | function createMergedResultFunction(one, two) {
|
19413 | return function mergedResult() {
|
19414 | var a = one.apply(this, arguments);
|
19415 | var b = two.apply(this, arguments);
|
19416 | if (a == null) {
|
19417 | return b;
|
19418 | } else if (b == null) {
|
19419 | return a;
|
19420 | }
|
19421 | var c = {};
|
19422 | mergeIntoWithNoDuplicateKeys(c, a);
|
19423 | mergeIntoWithNoDuplicateKeys(c, b);
|
19424 | return c;
|
19425 | };
|
19426 | }
|
19427 |
|
19428 |
|
19429 |
|
19430 |
|
19431 |
|
19432 |
|
19433 |
|
19434 |
|
19435 |
|
19436 | function createChainedFunction(one, two) {
|
19437 | return function chainedFunction() {
|
19438 | one.apply(this, arguments);
|
19439 | two.apply(this, arguments);
|
19440 | };
|
19441 | }
|
19442 |
|
19443 |
|
19444 |
|
19445 |
|
19446 |
|
19447 |
|
19448 |
|
19449 |
|
19450 | function bindAutoBindMethod(component, method) {
|
19451 | var boundMethod = method.bind(component);
|
19452 | if (process.env.NODE_ENV !== 'production') {
|
19453 | boundMethod.__reactBoundContext = component;
|
19454 | boundMethod.__reactBoundMethod = method;
|
19455 | boundMethod.__reactBoundArguments = null;
|
19456 | var componentName = component.constructor.displayName;
|
19457 | var _bind = boundMethod.bind;
|
19458 | boundMethod.bind = function (newThis) {
|
19459 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
19460 | args[_key - 1] = arguments[_key];
|
19461 | }
|
19462 |
|
19463 |
|
19464 |
|
19465 |
|
19466 | if (newThis !== component && newThis !== null) {
|
19467 | process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
|
19468 | } else if (!args.length) {
|
19469 | process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
|
19470 | return boundMethod;
|
19471 | }
|
19472 | var reboundMethod = _bind.apply(boundMethod, arguments);
|
19473 | reboundMethod.__reactBoundContext = component;
|
19474 | reboundMethod.__reactBoundMethod = method;
|
19475 | reboundMethod.__reactBoundArguments = args;
|
19476 | return reboundMethod;
|
19477 | };
|
19478 | }
|
19479 | return boundMethod;
|
19480 | }
|
19481 |
|
19482 |
|
19483 |
|
19484 |
|
19485 |
|
19486 |
|
19487 | function bindAutoBindMethods(component) {
|
19488 | var pairs = component.__reactAutoBindPairs;
|
19489 | for (var i = 0; i < pairs.length; i += 2) {
|
19490 | var autoBindKey = pairs[i];
|
19491 | var method = pairs[i + 1];
|
19492 | component[autoBindKey] = bindAutoBindMethod(component, method);
|
19493 | }
|
19494 | }
|
19495 |
|
19496 |
|
19497 |
|
19498 |
|
19499 |
|
19500 | var ReactClassMixin = {
|
19501 |
|
19502 | |
19503 |
|
19504 |
|
19505 |
|
19506 | replaceState: function (newState, callback) {
|
19507 | this.updater.enqueueReplaceState(this, newState);
|
19508 | if (callback) {
|
19509 | this.updater.enqueueCallback(this, callback, 'replaceState');
|
19510 | }
|
19511 | },
|
19512 |
|
19513 | |
19514 |
|
19515 |
|
19516 |
|
19517 |
|
19518 |
|
19519 | isMounted: function () {
|
19520 | return this.updater.isMounted(this);
|
19521 | }
|
19522 | };
|
19523 |
|
19524 | var ReactClassComponent = function () {};
|
19525 | _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
|
19526 |
|
19527 |
|
19528 |
|
19529 |
|
19530 |
|
19531 |
|
19532 | var ReactClass = {
|
19533 |
|
19534 | |
19535 |
|
19536 |
|
19537 |
|
19538 |
|
19539 |
|
19540 |
|
19541 |
|
19542 | createClass: function (spec) {
|
19543 | var Constructor = function (props, context, updater) {
|
19544 |
|
19545 |
|
19546 |
|
19547 | if (process.env.NODE_ENV !== 'production') {
|
19548 | process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
|
19549 | }
|
19550 |
|
19551 |
|
19552 | if (this.__reactAutoBindPairs.length) {
|
19553 | bindAutoBindMethods(this);
|
19554 | }
|
19555 |
|
19556 | this.props = props;
|
19557 | this.context = context;
|
19558 | this.refs = emptyObject;
|
19559 | this.updater = updater || ReactNoopUpdateQueue;
|
19560 |
|
19561 | this.state = null;
|
19562 |
|
19563 |
|
19564 |
|
19565 |
|
19566 | var initialState = this.getInitialState ? this.getInitialState() : null;
|
19567 | if (process.env.NODE_ENV !== 'production') {
|
19568 |
|
19569 | if (initialState === undefined && this.getInitialState._isMockFunction) {
|
19570 |
|
19571 |
|
19572 | initialState = null;
|
19573 | }
|
19574 | }
|
19575 | !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : void 0;
|
19576 |
|
19577 | this.state = initialState;
|
19578 | };
|
19579 | Constructor.prototype = new ReactClassComponent();
|
19580 | Constructor.prototype.constructor = Constructor;
|
19581 | Constructor.prototype.__reactAutoBindPairs = [];
|
19582 |
|
19583 | injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
|
19584 |
|
19585 | mixSpecIntoComponent(Constructor, spec);
|
19586 |
|
19587 |
|
19588 | if (Constructor.getDefaultProps) {
|
19589 | Constructor.defaultProps = Constructor.getDefaultProps();
|
19590 | }
|
19591 |
|
19592 | if (process.env.NODE_ENV !== 'production') {
|
19593 |
|
19594 |
|
19595 |
|
19596 |
|
19597 | if (Constructor.getDefaultProps) {
|
19598 | Constructor.getDefaultProps.isReactClassApproved = {};
|
19599 | }
|
19600 | if (Constructor.prototype.getInitialState) {
|
19601 | Constructor.prototype.getInitialState.isReactClassApproved = {};
|
19602 | }
|
19603 | }
|
19604 |
|
19605 | !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : void 0;
|
19606 |
|
19607 | if (process.env.NODE_ENV !== 'production') {
|
19608 | process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
|
19609 | process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
|
19610 | }
|
19611 |
|
19612 |
|
19613 | for (var methodName in ReactClassInterface) {
|
19614 | if (!Constructor.prototype[methodName]) {
|
19615 | Constructor.prototype[methodName] = null;
|
19616 | }
|
19617 | }
|
19618 |
|
19619 | return Constructor;
|
19620 | },
|
19621 |
|
19622 | injection: {
|
19623 | injectMixin: function (mixin) {
|
19624 | injectedMixins.push(mixin);
|
19625 | }
|
19626 | }
|
19627 |
|
19628 | };
|
19629 |
|
19630 | module.exports = ReactClass;
|
19631 | }).call(this,require(91))
|
19632 | },{"189":189,"218":218,"237":237,"239":239,"240":240,"296":296,"38":38,"45":45,"48":48,"49":49,"55":55,"91":91}],189:[function(require,module,exports){
|
19633 | (function (process){
|
19634 |
|
19635 |
|
19636 |
|
19637 |
|
19638 |
|
19639 |
|
19640 |
|
19641 |
|
19642 |
|
19643 |
|
19644 |
|
19645 | 'use strict';
|
19646 |
|
19647 | var ReactNoopUpdateQueue = require(237);
|
19648 | var ReactInstrumentation = require(228);
|
19649 |
|
19650 | var canDefineProperty = require(269);
|
19651 | var emptyObject = require(38);
|
19652 | var invariant = require(45);
|
19653 | var warning = require(55);
|
19654 |
|
19655 |
|
19656 |
|
19657 |
|
19658 | function ReactComponent(props, context, updater) {
|
19659 | this.props = props;
|
19660 | this.context = context;
|
19661 | this.refs = emptyObject;
|
19662 |
|
19663 |
|
19664 | this.updater = updater || ReactNoopUpdateQueue;
|
19665 | }
|
19666 |
|
19667 | ReactComponent.prototype.isReactComponent = {};
|
19668 |
|
19669 |
|
19670 |
|
19671 |
|
19672 |
|
19673 |
|
19674 |
|
19675 |
|
19676 |
|
19677 |
|
19678 |
|
19679 |
|
19680 |
|
19681 |
|
19682 |
|
19683 |
|
19684 |
|
19685 |
|
19686 |
|
19687 |
|
19688 |
|
19689 |
|
19690 |
|
19691 |
|
19692 |
|
19693 |
|
19694 | ReactComponent.prototype.setState = function (partialState, callback) {
|
19695 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : void 0;
|
19696 | if (process.env.NODE_ENV !== 'production') {
|
19697 | ReactInstrumentation.debugTool.onSetState();
|
19698 | process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
|
19699 | }
|
19700 | this.updater.enqueueSetState(this, partialState);
|
19701 | if (callback) {
|
19702 | this.updater.enqueueCallback(this, callback, 'setState');
|
19703 | }
|
19704 | };
|
19705 |
|
19706 |
|
19707 |
|
19708 |
|
19709 |
|
19710 |
|
19711 |
|
19712 |
|
19713 |
|
19714 |
|
19715 |
|
19716 |
|
19717 |
|
19718 |
|
19719 |
|
19720 | ReactComponent.prototype.forceUpdate = function (callback) {
|
19721 | this.updater.enqueueForceUpdate(this);
|
19722 | if (callback) {
|
19723 | this.updater.enqueueCallback(this, callback, 'forceUpdate');
|
19724 | }
|
19725 | };
|
19726 |
|
19727 |
|
19728 |
|
19729 |
|
19730 |
|
19731 |
|
19732 | if (process.env.NODE_ENV !== 'production') {
|
19733 | var deprecatedAPIs = {
|
19734 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
19735 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
19736 | };
|
19737 | var defineDeprecationWarning = function (methodName, info) {
|
19738 | if (canDefineProperty) {
|
19739 | Object.defineProperty(ReactComponent.prototype, methodName, {
|
19740 | get: function () {
|
19741 | process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
|
19742 | return undefined;
|
19743 | }
|
19744 | });
|
19745 | }
|
19746 | };
|
19747 | for (var fnName in deprecatedAPIs) {
|
19748 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
19749 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
19750 | }
|
19751 | }
|
19752 | }
|
19753 |
|
19754 | module.exports = ReactComponent;
|
19755 | }).call(this,require(91))
|
19756 | },{"228":228,"237":237,"269":269,"38":38,"45":45,"55":55,"91":91}],190:[function(require,module,exports){
|
19757 |
|
19758 |
|
19759 |
|
19760 |
|
19761 |
|
19762 |
|
19763 |
|
19764 |
|
19765 |
|
19766 |
|
19767 |
|
19768 | 'use strict';
|
19769 |
|
19770 | var DOMChildrenOperations = require(165);
|
19771 | var ReactDOMIDOperations = require(205);
|
19772 |
|
19773 |
|
19774 |
|
19775 |
|
19776 |
|
19777 |
|
19778 | var ReactComponentBrowserEnvironment = {
|
19779 |
|
19780 | processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
|
19781 |
|
19782 | replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup,
|
19783 |
|
19784 | |
19785 |
|
19786 |
|
19787 |
|
19788 |
|
19789 |
|
19790 |
|
19791 | unmountIDFromEnvironment: function (rootNodeID) {}
|
19792 |
|
19793 | };
|
19794 |
|
19795 | module.exports = ReactComponentBrowserEnvironment;
|
19796 | },{"165":165,"205":205}],191:[function(require,module,exports){
|
19797 | (function (process){
|
19798 |
|
19799 |
|
19800 |
|
19801 |
|
19802 |
|
19803 |
|
19804 |
|
19805 |
|
19806 |
|
19807 |
|
19808 |
|
19809 | 'use strict';
|
19810 |
|
19811 | var invariant = require(45);
|
19812 |
|
19813 | var injected = false;
|
19814 |
|
19815 | var ReactComponentEnvironment = {
|
19816 |
|
19817 | |
19818 |
|
19819 |
|
19820 |
|
19821 |
|
19822 | unmountIDFromEnvironment: null,
|
19823 |
|
19824 | |
19825 |
|
19826 |
|
19827 |
|
19828 | replaceNodeWithMarkup: null,
|
19829 |
|
19830 | |
19831 |
|
19832 |
|
19833 |
|
19834 | processChildrenUpdates: null,
|
19835 |
|
19836 | injection: {
|
19837 | injectEnvironment: function (environment) {
|
19838 | !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : void 0;
|
19839 | ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
|
19840 | ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
|
19841 | ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
|
19842 | injected = true;
|
19843 | }
|
19844 | }
|
19845 |
|
19846 | };
|
19847 |
|
19848 | module.exports = ReactComponentEnvironment;
|
19849 | }).call(this,require(91))
|
19850 | },{"45":45,"91":91}],192:[function(require,module,exports){
|
19851 | (function (process){
|
19852 |
|
19853 |
|
19854 |
|
19855 |
|
19856 |
|
19857 |
|
19858 |
|
19859 |
|
19860 |
|
19861 |
|
19862 |
|
19863 | 'use strict';
|
19864 |
|
19865 | var invariant = require(45);
|
19866 |
|
19867 | var tree = {};
|
19868 | var rootIDs = [];
|
19869 |
|
19870 | function updateTree(id, update) {
|
19871 | if (!tree[id]) {
|
19872 | tree[id] = {
|
19873 | parentID: null,
|
19874 | ownerID: null,
|
19875 | text: null,
|
19876 | childIDs: [],
|
19877 | displayName: 'Unknown',
|
19878 | isMounted: false,
|
19879 | updateCount: 0
|
19880 | };
|
19881 | }
|
19882 | update(tree[id]);
|
19883 | }
|
19884 |
|
19885 | function purgeDeep(id) {
|
19886 | var item = tree[id];
|
19887 | if (item) {
|
19888 | var childIDs = item.childIDs;
|
19889 |
|
19890 | delete tree[id];
|
19891 | childIDs.forEach(purgeDeep);
|
19892 | }
|
19893 | }
|
19894 |
|
19895 | var ReactComponentTreeDevtool = {
|
19896 | onSetDisplayName: function (id, displayName) {
|
19897 | updateTree(id, function (item) {
|
19898 | return item.displayName = displayName;
|
19899 | });
|
19900 | },
|
19901 | onSetChildren: function (id, nextChildIDs) {
|
19902 | updateTree(id, function (item) {
|
19903 | var prevChildIDs = item.childIDs;
|
19904 | item.childIDs = nextChildIDs;
|
19905 |
|
19906 | nextChildIDs.forEach(function (nextChildID) {
|
19907 | var nextChild = tree[nextChildID];
|
19908 | !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected devtool events to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
|
19909 | !(nextChild.displayName != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetDisplayName() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
|
19910 | !(nextChild.childIDs != null || nextChild.text != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() or onSetText() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
|
19911 | !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
|
19912 |
|
19913 | if (prevChildIDs.indexOf(nextChildID) === -1) {
|
19914 | nextChild.parentID = id;
|
19915 | }
|
19916 | });
|
19917 | });
|
19918 | },
|
19919 | onSetOwner: function (id, ownerID) {
|
19920 | updateTree(id, function (item) {
|
19921 | return item.ownerID = ownerID;
|
19922 | });
|
19923 | },
|
19924 | onSetText: function (id, text) {
|
19925 | updateTree(id, function (item) {
|
19926 | return item.text = text;
|
19927 | });
|
19928 | },
|
19929 | onMountComponent: function (id) {
|
19930 | updateTree(id, function (item) {
|
19931 | return item.isMounted = true;
|
19932 | });
|
19933 | },
|
19934 | onMountRootComponent: function (id) {
|
19935 | rootIDs.push(id);
|
19936 | },
|
19937 | onUpdateComponent: function (id) {
|
19938 | updateTree(id, function (item) {
|
19939 | return item.updateCount++;
|
19940 | });
|
19941 | },
|
19942 | onUnmountComponent: function (id) {
|
19943 | updateTree(id, function (item) {
|
19944 | return item.isMounted = false;
|
19945 | });
|
19946 | rootIDs = rootIDs.filter(function (rootID) {
|
19947 | return rootID !== id;
|
19948 | });
|
19949 | },
|
19950 | purgeUnmountedComponents: function () {
|
19951 | if (ReactComponentTreeDevtool._preventPurging) {
|
19952 |
|
19953 | return;
|
19954 | }
|
19955 |
|
19956 | Object.keys(tree).filter(function (id) {
|
19957 | return !tree[id].isMounted;
|
19958 | }).forEach(purgeDeep);
|
19959 | },
|
19960 | isMounted: function (id) {
|
19961 | var item = tree[id];
|
19962 | return item ? item.isMounted : false;
|
19963 | },
|
19964 | getChildIDs: function (id) {
|
19965 | var item = tree[id];
|
19966 | return item ? item.childIDs : [];
|
19967 | },
|
19968 | getDisplayName: function (id) {
|
19969 | var item = tree[id];
|
19970 | return item ? item.displayName : 'Unknown';
|
19971 | },
|
19972 | getOwnerID: function (id) {
|
19973 | var item = tree[id];
|
19974 | return item ? item.ownerID : null;
|
19975 | },
|
19976 | getParentID: function (id) {
|
19977 | var item = tree[id];
|
19978 | return item ? item.parentID : null;
|
19979 | },
|
19980 | getText: function (id) {
|
19981 | var item = tree[id];
|
19982 | return item ? item.text : null;
|
19983 | },
|
19984 | getUpdateCount: function (id) {
|
19985 | var item = tree[id];
|
19986 | return item ? item.updateCount : 0;
|
19987 | },
|
19988 | getRootIDs: function () {
|
19989 | return rootIDs;
|
19990 | },
|
19991 | getRegisteredIDs: function () {
|
19992 | return Object.keys(tree);
|
19993 | }
|
19994 | };
|
19995 |
|
19996 | module.exports = ReactComponentTreeDevtool;
|
19997 | }).call(this,require(91))
|
19998 | },{"45":45,"91":91}],193:[function(require,module,exports){
|
19999 | (function (process){
|
20000 |
|
20001 |
|
20002 |
|
20003 |
|
20004 |
|
20005 |
|
20006 |
|
20007 |
|
20008 |
|
20009 |
|
20010 |
|
20011 | 'use strict';
|
20012 |
|
20013 | var _assign = require(296);
|
20014 |
|
20015 | var ReactComponentEnvironment = require(191);
|
20016 | var ReactCurrentOwner = require(194);
|
20017 | var ReactElement = require(218);
|
20018 | var ReactErrorUtils = require(221);
|
20019 | var ReactInstanceMap = require(227);
|
20020 | var ReactInstrumentation = require(228);
|
20021 | var ReactNodeTypes = require(236);
|
20022 | var ReactPropTypeLocations = require(240);
|
20023 | var ReactPropTypeLocationNames = require(239);
|
20024 | var ReactReconciler = require(243);
|
20025 | var ReactUpdateQueue = require(246);
|
20026 |
|
20027 | var emptyObject = require(38);
|
20028 | var invariant = require(45);
|
20029 | var shouldUpdateReactComponent = require(293);
|
20030 | var warning = require(55);
|
20031 |
|
20032 | function getDeclarationErrorAddendum(component) {
|
20033 | var owner = component._currentElement._owner || null;
|
20034 | if (owner) {
|
20035 | var name = owner.getName();
|
20036 | if (name) {
|
20037 | return ' Check the render method of `' + name + '`.';
|
20038 | }
|
20039 | }
|
20040 | return '';
|
20041 | }
|
20042 |
|
20043 | function StatelessComponent(Component) {}
|
20044 | StatelessComponent.prototype.render = function () {
|
20045 | var Component = ReactInstanceMap.get(this)._currentElement.type;
|
20046 | var element = Component(this.props, this.context, this.updater);
|
20047 | warnIfInvalidElement(Component, element);
|
20048 | return element;
|
20049 | };
|
20050 |
|
20051 | function warnIfInvalidElement(Component, element) {
|
20052 | if (process.env.NODE_ENV !== 'production') {
|
20053 | process.env.NODE_ENV !== 'production' ? warning(element === null || element === false || ReactElement.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
|
20054 | }
|
20055 | }
|
20056 |
|
20057 | function invokeComponentDidMountWithTimer() {
|
20058 | var publicInstance = this._instance;
|
20059 | if (this._debugID !== 0) {
|
20060 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');
|
20061 | }
|
20062 | publicInstance.componentDidMount();
|
20063 | if (this._debugID !== 0) {
|
20064 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');
|
20065 | }
|
20066 | }
|
20067 |
|
20068 | function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {
|
20069 | var publicInstance = this._instance;
|
20070 | if (this._debugID !== 0) {
|
20071 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');
|
20072 | }
|
20073 | publicInstance.componentDidUpdate(prevProps, prevState, prevContext);
|
20074 | if (this._debugID !== 0) {
|
20075 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');
|
20076 | }
|
20077 | }
|
20078 |
|
20079 | function shouldConstruct(Component) {
|
20080 | return Component.prototype && Component.prototype.isReactComponent;
|
20081 | }
|
20082 |
|
20083 |
|
20084 |
|
20085 |
|
20086 |
|
20087 |
|
20088 |
|
20089 |
|
20090 |
|
20091 |
|
20092 |
|
20093 |
|
20094 |
|
20095 |
|
20096 |
|
20097 |
|
20098 |
|
20099 |
|
20100 |
|
20101 |
|
20102 |
|
20103 |
|
20104 |
|
20105 |
|
20106 |
|
20107 |
|
20108 |
|
20109 |
|
20110 |
|
20111 |
|
20112 |
|
20113 |
|
20114 |
|
20115 |
|
20116 | var nextMountID = 1;
|
20117 |
|
20118 |
|
20119 |
|
20120 |
|
20121 | var ReactCompositeComponentMixin = {
|
20122 |
|
20123 | |
20124 |
|
20125 |
|
20126 |
|
20127 |
|
20128 |
|
20129 |
|
20130 | construct: function (element) {
|
20131 | this._currentElement = element;
|
20132 | this._rootNodeID = null;
|
20133 | this._instance = null;
|
20134 | this._nativeParent = null;
|
20135 | this._nativeContainerInfo = null;
|
20136 |
|
20137 |
|
20138 | this._updateBatchNumber = null;
|
20139 | this._pendingElement = null;
|
20140 | this._pendingStateQueue = null;
|
20141 | this._pendingReplaceState = false;
|
20142 | this._pendingForceUpdate = false;
|
20143 |
|
20144 | this._renderedNodeType = null;
|
20145 | this._renderedComponent = null;
|
20146 | this._context = null;
|
20147 | this._mountOrder = 0;
|
20148 | this._topLevelWrapper = null;
|
20149 |
|
20150 |
|
20151 | this._pendingCallbacks = null;
|
20152 |
|
20153 |
|
20154 | this._calledComponentWillUnmount = false;
|
20155 | },
|
20156 |
|
20157 | |
20158 |
|
20159 |
|
20160 |
|
20161 |
|
20162 |
|
20163 |
|
20164 |
|
20165 |
|
20166 |
|
20167 |
|
20168 | mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
|
20169 | this._context = context;
|
20170 | this._mountOrder = nextMountID++;
|
20171 | this._nativeParent = nativeParent;
|
20172 | this._nativeContainerInfo = nativeContainerInfo;
|
20173 |
|
20174 | var publicProps = this._processProps(this._currentElement.props);
|
20175 | var publicContext = this._processContext(context);
|
20176 |
|
20177 | var Component = this._currentElement.type;
|
20178 |
|
20179 |
|
20180 | var inst = this._constructComponent(publicProps, publicContext);
|
20181 | var renderedElement;
|
20182 |
|
20183 |
|
20184 | if (!shouldConstruct(Component) && (inst == null || inst.render == null)) {
|
20185 | renderedElement = inst;
|
20186 | warnIfInvalidElement(Component, renderedElement);
|
20187 | !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : invariant(false) : void 0;
|
20188 | inst = new StatelessComponent(Component);
|
20189 | }
|
20190 |
|
20191 | if (process.env.NODE_ENV !== 'production') {
|
20192 |
|
20193 |
|
20194 | if (inst.render == null) {
|
20195 | process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
|
20196 | }
|
20197 |
|
20198 | var propsMutated = inst.props !== publicProps;
|
20199 | var componentName = Component.displayName || Component.name || 'Component';
|
20200 |
|
20201 | process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
|
20202 | }
|
20203 |
|
20204 |
|
20205 |
|
20206 | inst.props = publicProps;
|
20207 | inst.context = publicContext;
|
20208 | inst.refs = emptyObject;
|
20209 | inst.updater = ReactUpdateQueue;
|
20210 |
|
20211 | this._instance = inst;
|
20212 |
|
20213 |
|
20214 | ReactInstanceMap.set(inst, this);
|
20215 |
|
20216 | if (process.env.NODE_ENV !== 'production') {
|
20217 |
|
20218 |
|
20219 |
|
20220 | process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
|
20221 | process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
|
20222 | process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
|
20223 | process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
|
20224 | process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0;
|
20225 | process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
|
20226 | process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
|
20227 | }
|
20228 |
|
20229 | var initialState = inst.state;
|
20230 | if (initialState === undefined) {
|
20231 | inst.state = initialState = null;
|
20232 | }
|
20233 | !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
|
20234 |
|
20235 | this._pendingStateQueue = null;
|
20236 | this._pendingReplaceState = false;
|
20237 | this._pendingForceUpdate = false;
|
20238 |
|
20239 | var markup;
|
20240 | if (inst.unstable_handleError) {
|
20241 | markup = this.performInitialMountWithErrorHandling(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
|
20242 | } else {
|
20243 | markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
|
20244 | }
|
20245 |
|
20246 | if (inst.componentDidMount) {
|
20247 | if (process.env.NODE_ENV !== 'production') {
|
20248 | transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this);
|
20249 | } else {
|
20250 | transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
|
20251 | }
|
20252 | }
|
20253 |
|
20254 | return markup;
|
20255 | },
|
20256 |
|
20257 | _constructComponent: function (publicProps, publicContext) {
|
20258 | if (process.env.NODE_ENV !== 'production') {
|
20259 | ReactCurrentOwner.current = this;
|
20260 | try {
|
20261 | return this._constructComponentWithoutOwner(publicProps, publicContext);
|
20262 | } finally {
|
20263 | ReactCurrentOwner.current = null;
|
20264 | }
|
20265 | } else {
|
20266 | return this._constructComponentWithoutOwner(publicProps, publicContext);
|
20267 | }
|
20268 | },
|
20269 |
|
20270 | _constructComponentWithoutOwner: function (publicProps, publicContext) {
|
20271 | var Component = this._currentElement.type;
|
20272 | var instanceOrElement;
|
20273 | if (shouldConstruct(Component)) {
|
20274 | if (process.env.NODE_ENV !== 'production') {
|
20275 | if (this._debugID !== 0) {
|
20276 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor');
|
20277 | }
|
20278 | }
|
20279 | instanceOrElement = new Component(publicProps, publicContext, ReactUpdateQueue);
|
20280 | if (process.env.NODE_ENV !== 'production') {
|
20281 | if (this._debugID !== 0) {
|
20282 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');
|
20283 | }
|
20284 | }
|
20285 | } else {
|
20286 |
|
20287 |
|
20288 | if (process.env.NODE_ENV !== 'production') {
|
20289 | if (this._debugID !== 0) {
|
20290 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
|
20291 | }
|
20292 | }
|
20293 | instanceOrElement = Component(publicProps, publicContext, ReactUpdateQueue);
|
20294 | if (process.env.NODE_ENV !== 'production') {
|
20295 | if (this._debugID !== 0) {
|
20296 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
|
20297 | }
|
20298 | }
|
20299 | }
|
20300 | return instanceOrElement;
|
20301 | },
|
20302 |
|
20303 | performInitialMountWithErrorHandling: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
|
20304 | var markup;
|
20305 | var checkpoint = transaction.checkpoint();
|
20306 | try {
|
20307 | markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
|
20308 | } catch (e) {
|
20309 |
|
20310 | transaction.rollback(checkpoint);
|
20311 | this._instance.unstable_handleError(e);
|
20312 | if (this._pendingStateQueue) {
|
20313 | this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
|
20314 | }
|
20315 | checkpoint = transaction.checkpoint();
|
20316 |
|
20317 | this._renderedComponent.unmountComponent(true);
|
20318 | transaction.rollback(checkpoint);
|
20319 |
|
20320 |
|
20321 |
|
20322 | markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
|
20323 | }
|
20324 | return markup;
|
20325 | },
|
20326 |
|
20327 | performInitialMount: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
|
20328 | var inst = this._instance;
|
20329 | if (inst.componentWillMount) {
|
20330 | if (process.env.NODE_ENV !== 'production') {
|
20331 | if (this._debugID !== 0) {
|
20332 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount');
|
20333 | }
|
20334 | }
|
20335 | inst.componentWillMount();
|
20336 | if (process.env.NODE_ENV !== 'production') {
|
20337 | if (this._debugID !== 0) {
|
20338 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');
|
20339 | }
|
20340 | }
|
20341 |
|
20342 |
|
20343 | if (this._pendingStateQueue) {
|
20344 | inst.state = this._processPendingState(inst.props, inst.context);
|
20345 | }
|
20346 | }
|
20347 |
|
20348 |
|
20349 | if (renderedElement === undefined) {
|
20350 | renderedElement = this._renderValidatedComponent();
|
20351 | }
|
20352 |
|
20353 | this._renderedNodeType = ReactNodeTypes.getType(renderedElement);
|
20354 | this._renderedComponent = this._instantiateReactComponent(renderedElement);
|
20355 |
|
20356 | var markup = ReactReconciler.mountComponent(this._renderedComponent, transaction, nativeParent, nativeContainerInfo, this._processChildContext(context));
|
20357 |
|
20358 | if (process.env.NODE_ENV !== 'production') {
|
20359 | if (this._debugID !== 0) {
|
20360 | ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
|
20361 | }
|
20362 | }
|
20363 |
|
20364 | return markup;
|
20365 | },
|
20366 |
|
20367 | getNativeNode: function () {
|
20368 | return ReactReconciler.getNativeNode(this._renderedComponent);
|
20369 | },
|
20370 |
|
20371 | |
20372 |
|
20373 |
|
20374 |
|
20375 |
|
20376 |
|
20377 | unmountComponent: function (safely) {
|
20378 | if (!this._renderedComponent) {
|
20379 | return;
|
20380 | }
|
20381 | var inst = this._instance;
|
20382 |
|
20383 | if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
|
20384 | inst._calledComponentWillUnmount = true;
|
20385 | if (process.env.NODE_ENV !== 'production') {
|
20386 | if (this._debugID !== 0) {
|
20387 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');
|
20388 | }
|
20389 | }
|
20390 | if (safely) {
|
20391 | var name = this.getName() + '.componentWillUnmount()';
|
20392 | ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
|
20393 | } else {
|
20394 | inst.componentWillUnmount();
|
20395 | }
|
20396 | if (process.env.NODE_ENV !== 'production') {
|
20397 | if (this._debugID !== 0) {
|
20398 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount');
|
20399 | }
|
20400 | }
|
20401 | }
|
20402 |
|
20403 | if (this._renderedComponent) {
|
20404 | ReactReconciler.unmountComponent(this._renderedComponent, safely);
|
20405 | this._renderedNodeType = null;
|
20406 | this._renderedComponent = null;
|
20407 | this._instance = null;
|
20408 | }
|
20409 |
|
20410 |
|
20411 |
|
20412 |
|
20413 | this._pendingStateQueue = null;
|
20414 | this._pendingReplaceState = false;
|
20415 | this._pendingForceUpdate = false;
|
20416 | this._pendingCallbacks = null;
|
20417 | this._pendingElement = null;
|
20418 |
|
20419 |
|
20420 |
|
20421 | this._context = null;
|
20422 | this._rootNodeID = null;
|
20423 | this._topLevelWrapper = null;
|
20424 |
|
20425 |
|
20426 |
|
20427 |
|
20428 | ReactInstanceMap.remove(inst);
|
20429 |
|
20430 |
|
20431 |
|
20432 |
|
20433 |
|
20434 |
|
20435 | },
|
20436 |
|
20437 | |
20438 |
|
20439 |
|
20440 |
|
20441 |
|
20442 |
|
20443 |
|
20444 |
|
20445 | _maskContext: function (context) {
|
20446 | var Component = this._currentElement.type;
|
20447 | var contextTypes = Component.contextTypes;
|
20448 | if (!contextTypes) {
|
20449 | return emptyObject;
|
20450 | }
|
20451 | var maskedContext = {};
|
20452 | for (var contextName in contextTypes) {
|
20453 | maskedContext[contextName] = context[contextName];
|
20454 | }
|
20455 | return maskedContext;
|
20456 | },
|
20457 |
|
20458 | |
20459 |
|
20460 |
|
20461 |
|
20462 |
|
20463 |
|
20464 |
|
20465 |
|
20466 | _processContext: function (context) {
|
20467 | var maskedContext = this._maskContext(context);
|
20468 | if (process.env.NODE_ENV !== 'production') {
|
20469 | var Component = this._currentElement.type;
|
20470 | if (Component.contextTypes) {
|
20471 | this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
|
20472 | }
|
20473 | }
|
20474 | return maskedContext;
|
20475 | },
|
20476 |
|
20477 | |
20478 |
|
20479 |
|
20480 |
|
20481 |
|
20482 | _processChildContext: function (currentContext) {
|
20483 | var Component = this._currentElement.type;
|
20484 | var inst = this._instance;
|
20485 | if (process.env.NODE_ENV !== 'production') {
|
20486 | ReactInstrumentation.debugTool.onBeginProcessingChildContext();
|
20487 | }
|
20488 | var childContext = inst.getChildContext && inst.getChildContext();
|
20489 | if (process.env.NODE_ENV !== 'production') {
|
20490 | ReactInstrumentation.debugTool.onEndProcessingChildContext();
|
20491 | }
|
20492 | if (childContext) {
|
20493 | !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
|
20494 | if (process.env.NODE_ENV !== 'production') {
|
20495 | this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
|
20496 | }
|
20497 | for (var name in childContext) {
|
20498 | !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : void 0;
|
20499 | }
|
20500 | return _assign({}, currentContext, childContext);
|
20501 | }
|
20502 | return currentContext;
|
20503 | },
|
20504 |
|
20505 | |
20506 |
|
20507 |
|
20508 |
|
20509 |
|
20510 |
|
20511 |
|
20512 |
|
20513 |
|
20514 | _processProps: function (newProps) {
|
20515 | if (process.env.NODE_ENV !== 'production') {
|
20516 | var Component = this._currentElement.type;
|
20517 | if (Component.propTypes) {
|
20518 | this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
|
20519 | }
|
20520 | }
|
20521 | return newProps;
|
20522 | },
|
20523 |
|
20524 | |
20525 |
|
20526 |
|
20527 |
|
20528 |
|
20529 |
|
20530 |
|
20531 |
|
20532 | _checkPropTypes: function (propTypes, props, location) {
|
20533 |
|
20534 |
|
20535 | var componentName = this.getName();
|
20536 | for (var propName in propTypes) {
|
20537 | if (propTypes.hasOwnProperty(propName)) {
|
20538 | var error;
|
20539 | try {
|
20540 |
|
20541 |
|
20542 | !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;
|
20543 | error = propTypes[propName](props, propName, componentName, location);
|
20544 | } catch (ex) {
|
20545 | error = ex;
|
20546 | }
|
20547 | if (error instanceof Error) {
|
20548 |
|
20549 |
|
20550 |
|
20551 | var addendum = getDeclarationErrorAddendum(this);
|
20552 |
|
20553 | if (location === ReactPropTypeLocations.prop) {
|
20554 |
|
20555 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : void 0;
|
20556 | } else {
|
20557 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : void 0;
|
20558 | }
|
20559 | }
|
20560 | }
|
20561 | }
|
20562 | },
|
20563 |
|
20564 | receiveComponent: function (nextElement, transaction, nextContext) {
|
20565 | var prevElement = this._currentElement;
|
20566 | var prevContext = this._context;
|
20567 |
|
20568 | this._pendingElement = null;
|
20569 |
|
20570 | this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
|
20571 | },
|
20572 |
|
20573 | |
20574 |
|
20575 |
|
20576 |
|
20577 |
|
20578 |
|
20579 |
|
20580 | performUpdateIfNecessary: function (transaction) {
|
20581 | if (this._pendingElement != null) {
|
20582 | ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
|
20583 | } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
|
20584 | this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
|
20585 | } else {
|
20586 | this._updateBatchNumber = null;
|
20587 | }
|
20588 | },
|
20589 |
|
20590 | |
20591 |
|
20592 |
|
20593 |
|
20594 |
|
20595 |
|
20596 |
|
20597 |
|
20598 |
|
20599 |
|
20600 |
|
20601 |
|
20602 |
|
20603 |
|
20604 |
|
20605 | updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
|
20606 | var inst = this._instance;
|
20607 | var willReceive = false;
|
20608 | var nextContext;
|
20609 | var nextProps;
|
20610 |
|
20611 |
|
20612 | if (this._context === nextUnmaskedContext) {
|
20613 | nextContext = inst.context;
|
20614 | } else {
|
20615 | nextContext = this._processContext(nextUnmaskedContext);
|
20616 | willReceive = true;
|
20617 | }
|
20618 |
|
20619 |
|
20620 | if (prevParentElement === nextParentElement) {
|
20621 |
|
20622 |
|
20623 | nextProps = nextParentElement.props;
|
20624 | } else {
|
20625 | nextProps = this._processProps(nextParentElement.props);
|
20626 | willReceive = true;
|
20627 | }
|
20628 |
|
20629 |
|
20630 |
|
20631 |
|
20632 | if (willReceive && inst.componentWillReceiveProps) {
|
20633 | if (process.env.NODE_ENV !== 'production') {
|
20634 | if (this._debugID !== 0) {
|
20635 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
|
20636 | }
|
20637 | }
|
20638 | inst.componentWillReceiveProps(nextProps, nextContext);
|
20639 | if (process.env.NODE_ENV !== 'production') {
|
20640 | if (this._debugID !== 0) {
|
20641 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
|
20642 | }
|
20643 | }
|
20644 | }
|
20645 |
|
20646 | var nextState = this._processPendingState(nextProps, nextContext);
|
20647 | var shouldUpdate = true;
|
20648 |
|
20649 | if (!this._pendingForceUpdate && inst.shouldComponentUpdate) {
|
20650 | if (process.env.NODE_ENV !== 'production') {
|
20651 | if (this._debugID !== 0) {
|
20652 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
|
20653 | }
|
20654 | }
|
20655 | shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
|
20656 | if (process.env.NODE_ENV !== 'production') {
|
20657 | if (this._debugID !== 0) {
|
20658 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
|
20659 | }
|
20660 | }
|
20661 | }
|
20662 |
|
20663 | if (process.env.NODE_ENV !== 'production') {
|
20664 | process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
|
20665 | }
|
20666 |
|
20667 | this._updateBatchNumber = null;
|
20668 | if (shouldUpdate) {
|
20669 | this._pendingForceUpdate = false;
|
20670 |
|
20671 | this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
|
20672 | } else {
|
20673 |
|
20674 |
|
20675 | this._currentElement = nextParentElement;
|
20676 | this._context = nextUnmaskedContext;
|
20677 | inst.props = nextProps;
|
20678 | inst.state = nextState;
|
20679 | inst.context = nextContext;
|
20680 | }
|
20681 | },
|
20682 |
|
20683 | _processPendingState: function (props, context) {
|
20684 | var inst = this._instance;
|
20685 | var queue = this._pendingStateQueue;
|
20686 | var replace = this._pendingReplaceState;
|
20687 | this._pendingReplaceState = false;
|
20688 | this._pendingStateQueue = null;
|
20689 |
|
20690 | if (!queue) {
|
20691 | return inst.state;
|
20692 | }
|
20693 |
|
20694 | if (replace && queue.length === 1) {
|
20695 | return queue[0];
|
20696 | }
|
20697 |
|
20698 | var nextState = _assign({}, replace ? queue[0] : inst.state);
|
20699 | for (var i = replace ? 1 : 0; i < queue.length; i++) {
|
20700 | var partial = queue[i];
|
20701 | _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
|
20702 | }
|
20703 |
|
20704 | return nextState;
|
20705 | },
|
20706 |
|
20707 | |
20708 |
|
20709 |
|
20710 |
|
20711 |
|
20712 |
|
20713 |
|
20714 |
|
20715 |
|
20716 |
|
20717 |
|
20718 |
|
20719 | _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
|
20720 | var inst = this._instance;
|
20721 |
|
20722 | var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
|
20723 | var prevProps;
|
20724 | var prevState;
|
20725 | var prevContext;
|
20726 | if (hasComponentDidUpdate) {
|
20727 | prevProps = inst.props;
|
20728 | prevState = inst.state;
|
20729 | prevContext = inst.context;
|
20730 | }
|
20731 |
|
20732 | if (inst.componentWillUpdate) {
|
20733 | if (process.env.NODE_ENV !== 'production') {
|
20734 | if (this._debugID !== 0) {
|
20735 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate');
|
20736 | }
|
20737 | }
|
20738 | inst.componentWillUpdate(nextProps, nextState, nextContext);
|
20739 | if (process.env.NODE_ENV !== 'production') {
|
20740 | if (this._debugID !== 0) {
|
20741 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');
|
20742 | }
|
20743 | }
|
20744 | }
|
20745 |
|
20746 | this._currentElement = nextElement;
|
20747 | this._context = unmaskedContext;
|
20748 | inst.props = nextProps;
|
20749 | inst.state = nextState;
|
20750 | inst.context = nextContext;
|
20751 |
|
20752 | this._updateRenderedComponent(transaction, unmaskedContext);
|
20753 |
|
20754 | if (hasComponentDidUpdate) {
|
20755 | if (process.env.NODE_ENV !== 'production') {
|
20756 | transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this);
|
20757 | } else {
|
20758 | transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
|
20759 | }
|
20760 | }
|
20761 | },
|
20762 |
|
20763 | |
20764 |
|
20765 |
|
20766 |
|
20767 |
|
20768 |
|
20769 | _updateRenderedComponent: function (transaction, context) {
|
20770 | var prevComponentInstance = this._renderedComponent;
|
20771 | var prevRenderedElement = prevComponentInstance._currentElement;
|
20772 | var nextRenderedElement = this._renderValidatedComponent();
|
20773 | if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
|
20774 | ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
|
20775 | } else {
|
20776 | var oldNativeNode = ReactReconciler.getNativeNode(prevComponentInstance);
|
20777 | ReactReconciler.unmountComponent(prevComponentInstance, false);
|
20778 |
|
20779 | this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElement);
|
20780 | this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
|
20781 |
|
20782 | var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, transaction, this._nativeParent, this._nativeContainerInfo, this._processChildContext(context));
|
20783 |
|
20784 | if (process.env.NODE_ENV !== 'production') {
|
20785 | if (this._debugID !== 0) {
|
20786 | ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
|
20787 | }
|
20788 | }
|
20789 |
|
20790 | this._replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevComponentInstance);
|
20791 | }
|
20792 | },
|
20793 |
|
20794 | |
20795 |
|
20796 |
|
20797 |
|
20798 |
|
20799 | _replaceNodeWithMarkup: function (oldNativeNode, nextMarkup, prevInstance) {
|
20800 | ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevInstance);
|
20801 | },
|
20802 |
|
20803 | |
20804 |
|
20805 |
|
20806 | _renderValidatedComponentWithoutOwnerOrContext: function () {
|
20807 | var inst = this._instance;
|
20808 |
|
20809 | if (process.env.NODE_ENV !== 'production') {
|
20810 | if (this._debugID !== 0) {
|
20811 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
|
20812 | }
|
20813 | }
|
20814 | var renderedComponent = inst.render();
|
20815 | if (process.env.NODE_ENV !== 'production') {
|
20816 | if (this._debugID !== 0) {
|
20817 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
|
20818 | }
|
20819 | }
|
20820 |
|
20821 | if (process.env.NODE_ENV !== 'production') {
|
20822 |
|
20823 | if (renderedComponent === undefined && inst.render._isMockFunction) {
|
20824 |
|
20825 |
|
20826 | renderedComponent = null;
|
20827 | }
|
20828 | }
|
20829 |
|
20830 | return renderedComponent;
|
20831 | },
|
20832 |
|
20833 | |
20834 |
|
20835 |
|
20836 | _renderValidatedComponent: function () {
|
20837 | var renderedComponent;
|
20838 | ReactCurrentOwner.current = this;
|
20839 | try {
|
20840 | renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
|
20841 | } finally {
|
20842 | ReactCurrentOwner.current = null;
|
20843 | }
|
20844 | !(
|
20845 |
|
20846 | renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
|
20847 |
|
20848 | return renderedComponent;
|
20849 | },
|
20850 |
|
20851 | |
20852 |
|
20853 |
|
20854 |
|
20855 |
|
20856 |
|
20857 |
|
20858 |
|
20859 | attachRef: function (ref, component) {
|
20860 | var inst = this.getPublicInstance();
|
20861 | !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : void 0;
|
20862 | var publicComponentInstance = component.getPublicInstance();
|
20863 | if (process.env.NODE_ENV !== 'production') {
|
20864 | var componentName = component && component.getName ? component.getName() : 'a component';
|
20865 | process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
|
20866 | }
|
20867 | var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
|
20868 | refs[ref] = publicComponentInstance;
|
20869 | },
|
20870 |
|
20871 | |
20872 |
|
20873 |
|
20874 |
|
20875 |
|
20876 |
|
20877 |
|
20878 | detachRef: function (ref) {
|
20879 | var refs = this.getPublicInstance().refs;
|
20880 | delete refs[ref];
|
20881 | },
|
20882 |
|
20883 | |
20884 |
|
20885 |
|
20886 |
|
20887 |
|
20888 |
|
20889 | getName: function () {
|
20890 | var type = this._currentElement.type;
|
20891 | var constructor = this._instance && this._instance.constructor;
|
20892 | return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
|
20893 | },
|
20894 |
|
20895 | /**
|
20896 | * Get the publicly accessible representation of this component - i.e. what
|
20897 | * is exposed by refs and returned by render. Can be null for stateless
|
20898 | * components.
|
20899 | *
|
20900 | * @return {ReactComponent} the public component instance.
|
20901 | * @internal
|
20902 | */
|
20903 | getPublicInstance: function () {
|
20904 | var inst = this._instance;
|
20905 | if (inst instanceof StatelessComponent) {
|
20906 | return null;
|
20907 | }
|
20908 | return inst;
|
20909 | },
|
20910 |
|
20911 |
|
20912 | _instantiateReactComponent: null
|
20913 |
|
20914 | };
|
20915 |
|
20916 | var ReactCompositeComponent = {
|
20917 |
|
20918 | Mixin: ReactCompositeComponentMixin
|
20919 |
|
20920 | };
|
20921 |
|
20922 | module.exports = ReactCompositeComponent;
|
20923 | }).call(this,require(91))
|
20924 | },{"191":191,"194":194,"218":218,"221":221,"227":227,"228":228,"236":236,"239":239,"240":240,"243":243,"246":246,"293":293,"296":296,"38":38,"45":45,"55":55,"91":91}],194:[function(require,module,exports){
|
20925 |
|
20926 |
|
20927 |
|
20928 |
|
20929 |
|
20930 |
|
20931 |
|
20932 |
|
20933 |
|
20934 |
|
20935 |
|
20936 | 'use strict';
|
20937 |
|
20938 |
|
20939 |
|
20940 |
|
20941 |
|
20942 |
|
20943 |
|
20944 |
|
20945 | var ReactCurrentOwner = {
|
20946 |
|
20947 | |
20948 |
|
20949 |
|
20950 |
|
20951 | current: null
|
20952 |
|
20953 | };
|
20954 |
|
20955 | module.exports = ReactCurrentOwner;
|
20956 | },{}],195:[function(require,module,exports){
|
20957 | (function (process){
|
20958 |
|
20959 |
|
20960 |
|
20961 |
|
20962 |
|
20963 |
|
20964 |
|
20965 |
|
20966 |
|
20967 |
|
20968 |
|
20969 |
|
20970 |
|
20971 | 'use strict';
|
20972 |
|
20973 | var ReactDOMComponentTree = require(199);
|
20974 | var ReactDefaultInjection = require(217);
|
20975 | var ReactMount = require(231);
|
20976 | var ReactReconciler = require(243);
|
20977 | var ReactUpdates = require(247);
|
20978 | var ReactVersion = require(248);
|
20979 |
|
20980 | var findDOMNode = require(273);
|
20981 | var getNativeComponentFromComposite = require(281);
|
20982 | var renderSubtreeIntoContainer = require(290);
|
20983 | var warning = require(55);
|
20984 |
|
20985 | ReactDefaultInjection.inject();
|
20986 |
|
20987 | var React = {
|
20988 | findDOMNode: findDOMNode,
|
20989 | render: ReactMount.render,
|
20990 | unmountComponentAtNode: ReactMount.unmountComponentAtNode,
|
20991 | version: ReactVersion,
|
20992 |
|
20993 |
|
20994 | unstable_batchedUpdates: ReactUpdates.batchedUpdates,
|
20995 | unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
|
20996 | };
|
20997 |
|
20998 |
|
20999 |
|
21000 |
|
21001 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
|
21002 | __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
|
21003 | ComponentTree: {
|
21004 | getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
|
21005 | getNodeFromInstance: function (inst) {
|
21006 |
|
21007 | if (inst._renderedComponent) {
|
21008 | inst = getNativeComponentFromComposite(inst);
|
21009 | }
|
21010 | if (inst) {
|
21011 | return ReactDOMComponentTree.getNodeFromInstance(inst);
|
21012 | } else {
|
21013 | return null;
|
21014 | }
|
21015 | }
|
21016 | },
|
21017 | Mount: ReactMount,
|
21018 | Reconciler: ReactReconciler
|
21019 | });
|
21020 | }
|
21021 |
|
21022 | if (process.env.NODE_ENV !== 'production') {
|
21023 | var ExecutionEnvironment = require(31);
|
21024 | if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
|
21025 |
|
21026 |
|
21027 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
21028 |
|
21029 | if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
|
21030 |
|
21031 | var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
|
21032 | console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
|
21033 | }
|
21034 | }
|
21035 |
|
21036 | var testFunc = function testFn() {};
|
21037 | process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
|
21038 |
|
21039 |
|
21040 |
|
21041 | var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
|
21042 |
|
21043 | process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
|
21044 |
|
21045 | var expectedFeatures = [
|
21046 |
|
21047 | Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim];
|
21048 |
|
21049 | for (var i = 0; i < expectedFeatures.length; i++) {
|
21050 | if (!expectedFeatures[i]) {
|
21051 | process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
|
21052 | break;
|
21053 | }
|
21054 | }
|
21055 | }
|
21056 | }
|
21057 |
|
21058 | module.exports = React;
|
21059 | }).call(this,require(91))
|
21060 | },{"199":199,"217":217,"231":231,"243":243,"247":247,"248":248,"273":273,"281":281,"290":290,"31":31,"55":55,"91":91}],196:[function(require,module,exports){
|
21061 |
|
21062 |
|
21063 |
|
21064 |
|
21065 |
|
21066 |
|
21067 |
|
21068 |
|
21069 |
|
21070 |
|
21071 |
|
21072 | 'use strict';
|
21073 |
|
21074 | var DisabledInputUtils = require(172);
|
21075 |
|
21076 |
|
21077 |
|
21078 |
|
21079 |
|
21080 | var ReactDOMButton = {
|
21081 | getNativeProps: DisabledInputUtils.getNativeProps
|
21082 | };
|
21083 |
|
21084 | module.exports = ReactDOMButton;
|
21085 | },{"172":172}],197:[function(require,module,exports){
|
21086 | (function (process){
|
21087 |
|
21088 |
|
21089 |
|
21090 |
|
21091 |
|
21092 |
|
21093 |
|
21094 |
|
21095 |
|
21096 |
|
21097 |
|
21098 |
|
21099 |
|
21100 | 'use strict';
|
21101 |
|
21102 | var _assign = require(296);
|
21103 |
|
21104 | var AutoFocusUtils = require(159);
|
21105 | var CSSPropertyOperations = require(162);
|
21106 | var DOMLazyTree = require(166);
|
21107 | var DOMNamespaces = require(167);
|
21108 | var DOMProperty = require(168);
|
21109 | var DOMPropertyOperations = require(169);
|
21110 | var EventConstants = require(174);
|
21111 | var EventPluginHub = require(175);
|
21112 | var EventPluginRegistry = require(176);
|
21113 | var ReactBrowserEventEmitter = require(185);
|
21114 | var ReactComponentBrowserEnvironment = require(190);
|
21115 | var ReactDOMButton = require(196);
|
21116 | var ReactDOMComponentFlags = require(198);
|
21117 | var ReactDOMComponentTree = require(199);
|
21118 | var ReactDOMInput = require(206);
|
21119 | var ReactDOMOption = require(208);
|
21120 | var ReactDOMSelect = require(209);
|
21121 | var ReactDOMTextarea = require(212);
|
21122 | var ReactInstrumentation = require(228);
|
21123 | var ReactMultiChild = require(232);
|
21124 | var ReactServerRenderingTransaction = require(245);
|
21125 |
|
21126 | var emptyFunction = require(37);
|
21127 | var escapeTextContentForBrowser = require(272);
|
21128 | var invariant = require(45);
|
21129 | var isEventSupported = require(286);
|
21130 | var keyOf = require(49);
|
21131 | var shallowEqual = require(54);
|
21132 | var validateDOMNesting = require(295);
|
21133 | var warning = require(55);
|
21134 |
|
21135 | var Flags = ReactDOMComponentFlags;
|
21136 | var deleteListener = EventPluginHub.deleteListener;
|
21137 | var getNode = ReactDOMComponentTree.getNodeFromInstance;
|
21138 | var listenTo = ReactBrowserEventEmitter.listenTo;
|
21139 | var registrationNameModules = EventPluginRegistry.registrationNameModules;
|
21140 |
|
21141 |
|
21142 | var CONTENT_TYPES = { 'string': true, 'number': true };
|
21143 |
|
21144 | var STYLE = keyOf({ style: null });
|
21145 | var HTML = keyOf({ __html: null });
|
21146 | var RESERVED_PROPS = {
|
21147 | children: null,
|
21148 | dangerouslySetInnerHTML: null,
|
21149 | suppressContentEditableWarning: null
|
21150 | };
|
21151 |
|
21152 |
|
21153 | var DOC_FRAGMENT_TYPE = 11;
|
21154 |
|
21155 | function getDeclarationErrorAddendum(internalInstance) {
|
21156 | if (internalInstance) {
|
21157 | var owner = internalInstance._currentElement._owner || null;
|
21158 | if (owner) {
|
21159 | var name = owner.getName();
|
21160 | if (name) {
|
21161 | return ' This DOM node was rendered by `' + name + '`.';
|
21162 | }
|
21163 | }
|
21164 | }
|
21165 | return '';
|
21166 | }
|
21167 |
|
21168 | function friendlyStringify(obj) {
|
21169 | if (typeof obj === 'object') {
|
21170 | if (Array.isArray(obj)) {
|
21171 | return '[' + obj.map(friendlyStringify).join(', ') + ']';
|
21172 | } else {
|
21173 | var pairs = [];
|
21174 | for (var key in obj) {
|
21175 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
21176 | var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
|
21177 | pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
|
21178 | }
|
21179 | }
|
21180 | return '{' + pairs.join(', ') + '}';
|
21181 | }
|
21182 | } else if (typeof obj === 'string') {
|
21183 | return JSON.stringify(obj);
|
21184 | } else if (typeof obj === 'function') {
|
21185 | return '[function object]';
|
21186 | }
|
21187 |
|
21188 |
|
21189 | return String(obj);
|
21190 | }
|
21191 |
|
21192 | var styleMutationWarning = {};
|
21193 |
|
21194 | function checkAndWarnForMutatedStyle(style1, style2, component) {
|
21195 | if (style1 == null || style2 == null) {
|
21196 | return;
|
21197 | }
|
21198 | if (shallowEqual(style1, style2)) {
|
21199 | return;
|
21200 | }
|
21201 |
|
21202 | var componentName = component._tag;
|
21203 | var owner = component._currentElement._owner;
|
21204 | var ownerName;
|
21205 | if (owner) {
|
21206 | ownerName = owner.getName();
|
21207 | }
|
21208 |
|
21209 | var hash = ownerName + '|' + componentName;
|
21210 |
|
21211 | if (styleMutationWarning.hasOwnProperty(hash)) {
|
21212 | return;
|
21213 | }
|
21214 |
|
21215 | styleMutationWarning[hash] = true;
|
21216 |
|
21217 | process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
|
21218 | }
|
21219 |
|
21220 |
|
21221 |
|
21222 |
|
21223 |
|
21224 | function assertValidProps(component, props) {
|
21225 | if (!props) {
|
21226 | return;
|
21227 | }
|
21228 |
|
21229 | if (voidElementTags[component._tag]) {
|
21230 | !(props.children == null && props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : invariant(false) : void 0;
|
21231 | }
|
21232 | if (props.dangerouslySetInnerHTML != null) {
|
21233 | !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : void 0;
|
21234 | !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : void 0;
|
21235 | }
|
21236 | if (process.env.NODE_ENV !== 'production') {
|
21237 | process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
|
21238 | process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
|
21239 | process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
|
21240 | }
|
21241 | !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : void 0;
|
21242 | }
|
21243 |
|
21244 | function enqueuePutListener(inst, registrationName, listener, transaction) {
|
21245 | if (transaction instanceof ReactServerRenderingTransaction) {
|
21246 | return;
|
21247 | }
|
21248 | if (process.env.NODE_ENV !== 'production') {
|
21249 |
|
21250 |
|
21251 | process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
|
21252 | }
|
21253 | var containerInfo = inst._nativeContainerInfo;
|
21254 | var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
|
21255 | var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
|
21256 | listenTo(registrationName, doc);
|
21257 | transaction.getReactMountReady().enqueue(putListener, {
|
21258 | inst: inst,
|
21259 | registrationName: registrationName,
|
21260 | listener: listener
|
21261 | });
|
21262 | }
|
21263 |
|
21264 | function putListener() {
|
21265 | var listenerToPut = this;
|
21266 | EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
|
21267 | }
|
21268 |
|
21269 | function optionPostMount() {
|
21270 | var inst = this;
|
21271 | ReactDOMOption.postMountWrapper(inst);
|
21272 | }
|
21273 |
|
21274 | var setContentChildForInstrumentation = emptyFunction;
|
21275 | if (process.env.NODE_ENV !== 'production') {
|
21276 | setContentChildForInstrumentation = function (contentToUse) {
|
21277 | var debugID = this._debugID;
|
21278 | var contentDebugID = debugID + '#text';
|
21279 | this._contentDebugID = contentDebugID;
|
21280 | ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text');
|
21281 | ReactInstrumentation.debugTool.onSetText(contentDebugID, '' + contentToUse);
|
21282 | ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
|
21283 | ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
|
21284 | };
|
21285 | }
|
21286 |
|
21287 |
|
21288 |
|
21289 | var mediaEvents = {
|
21290 | topAbort: 'abort',
|
21291 | topCanPlay: 'canplay',
|
21292 | topCanPlayThrough: 'canplaythrough',
|
21293 | topDurationChange: 'durationchange',
|
21294 | topEmptied: 'emptied',
|
21295 | topEncrypted: 'encrypted',
|
21296 | topEnded: 'ended',
|
21297 | topError: 'error',
|
21298 | topLoadedData: 'loadeddata',
|
21299 | topLoadedMetadata: 'loadedmetadata',
|
21300 | topLoadStart: 'loadstart',
|
21301 | topPause: 'pause',
|
21302 | topPlay: 'play',
|
21303 | topPlaying: 'playing',
|
21304 | topProgress: 'progress',
|
21305 | topRateChange: 'ratechange',
|
21306 | topSeeked: 'seeked',
|
21307 | topSeeking: 'seeking',
|
21308 | topStalled: 'stalled',
|
21309 | topSuspend: 'suspend',
|
21310 | topTimeUpdate: 'timeupdate',
|
21311 | topVolumeChange: 'volumechange',
|
21312 | topWaiting: 'waiting'
|
21313 | };
|
21314 |
|
21315 | function trapBubbledEventsLocal() {
|
21316 | var inst = this;
|
21317 |
|
21318 |
|
21319 | !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : void 0;
|
21320 | var node = getNode(inst);
|
21321 | !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : void 0;
|
21322 |
|
21323 | switch (inst._tag) {
|
21324 | case 'iframe':
|
21325 | case 'object':
|
21326 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
21327 | break;
|
21328 | case 'video':
|
21329 | case 'audio':
|
21330 |
|
21331 | inst._wrapperState.listeners = [];
|
21332 |
|
21333 | for (var event in mediaEvents) {
|
21334 | if (mediaEvents.hasOwnProperty(event)) {
|
21335 | inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
|
21336 | }
|
21337 | }
|
21338 |
|
21339 | break;
|
21340 | case 'img':
|
21341 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
21342 | break;
|
21343 | case 'form':
|
21344 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
|
21345 | break;
|
21346 | case 'input':
|
21347 | case 'select':
|
21348 | case 'textarea':
|
21349 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
|
21350 | break;
|
21351 | }
|
21352 | }
|
21353 |
|
21354 | function postUpdateSelectWrapper() {
|
21355 | ReactDOMSelect.postUpdateWrapper(this);
|
21356 | }
|
21357 |
|
21358 |
|
21359 |
|
21360 |
|
21361 | var omittedCloseTags = {
|
21362 | 'area': true,
|
21363 | 'base': true,
|
21364 | 'br': true,
|
21365 | 'col': true,
|
21366 | 'embed': true,
|
21367 | 'hr': true,
|
21368 | 'img': true,
|
21369 | 'input': true,
|
21370 | 'keygen': true,
|
21371 | 'link': true,
|
21372 | 'meta': true,
|
21373 | 'param': true,
|
21374 | 'source': true,
|
21375 | 'track': true,
|
21376 | 'wbr': true
|
21377 | };
|
21378 |
|
21379 |
|
21380 | var newlineEatingTags = {
|
21381 | 'listing': true,
|
21382 | 'pre': true,
|
21383 | 'textarea': true
|
21384 | };
|
21385 |
|
21386 |
|
21387 |
|
21388 |
|
21389 | var voidElementTags = _assign({
|
21390 | 'menuitem': true
|
21391 | }, omittedCloseTags);
|
21392 |
|
21393 |
|
21394 |
|
21395 |
|
21396 |
|
21397 | var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/;
|
21398 | var validatedTagCache = {};
|
21399 | var hasOwnProperty = {}.hasOwnProperty;
|
21400 |
|
21401 | function validateDangerousTag(tag) {
|
21402 | if (!hasOwnProperty.call(validatedTagCache, tag)) {
|
21403 | !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : void 0;
|
21404 | validatedTagCache[tag] = true;
|
21405 | }
|
21406 | }
|
21407 |
|
21408 | function isCustomComponent(tagName, props) {
|
21409 | return tagName.indexOf('-') >= 0 || props.is != null;
|
21410 | }
|
21411 |
|
21412 | var globalIdCounter = 1;
|
21413 |
|
21414 |
|
21415 |
|
21416 |
|
21417 |
|
21418 |
|
21419 |
|
21420 |
|
21421 |
|
21422 |
|
21423 |
|
21424 |
|
21425 |
|
21426 |
|
21427 |
|
21428 | function ReactDOMComponent(element) {
|
21429 | var tag = element.type;
|
21430 | validateDangerousTag(tag);
|
21431 | this._currentElement = element;
|
21432 | this._tag = tag.toLowerCase();
|
21433 | this._namespaceURI = null;
|
21434 | this._renderedChildren = null;
|
21435 | this._previousStyle = null;
|
21436 | this._previousStyleCopy = null;
|
21437 | this._nativeNode = null;
|
21438 | this._nativeParent = null;
|
21439 | this._rootNodeID = null;
|
21440 | this._domID = null;
|
21441 | this._nativeContainerInfo = null;
|
21442 | this._wrapperState = null;
|
21443 | this._topLevelWrapper = null;
|
21444 | this._flags = 0;
|
21445 | if (process.env.NODE_ENV !== 'production') {
|
21446 | this._ancestorInfo = null;
|
21447 | this._contentDebugID = null;
|
21448 | }
|
21449 | }
|
21450 |
|
21451 | ReactDOMComponent.displayName = 'ReactDOMComponent';
|
21452 |
|
21453 | ReactDOMComponent.Mixin = {
|
21454 |
|
21455 | |
21456 |
|
21457 |
|
21458 |
|
21459 |
|
21460 |
|
21461 |
|
21462 |
|
21463 |
|
21464 |
|
21465 |
|
21466 | mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
|
21467 | this._rootNodeID = globalIdCounter++;
|
21468 | this._domID = nativeContainerInfo._idCounter++;
|
21469 | this._nativeParent = nativeParent;
|
21470 | this._nativeContainerInfo = nativeContainerInfo;
|
21471 |
|
21472 | var props = this._currentElement.props;
|
21473 |
|
21474 | switch (this._tag) {
|
21475 | case 'iframe':
|
21476 | case 'object':
|
21477 | case 'img':
|
21478 | case 'form':
|
21479 | case 'video':
|
21480 | case 'audio':
|
21481 | this._wrapperState = {
|
21482 | listeners: null
|
21483 | };
|
21484 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
21485 | break;
|
21486 | case 'button':
|
21487 | props = ReactDOMButton.getNativeProps(this, props, nativeParent);
|
21488 | break;
|
21489 | case 'input':
|
21490 | ReactDOMInput.mountWrapper(this, props, nativeParent);
|
21491 | props = ReactDOMInput.getNativeProps(this, props);
|
21492 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
21493 | break;
|
21494 | case 'option':
|
21495 | ReactDOMOption.mountWrapper(this, props, nativeParent);
|
21496 | props = ReactDOMOption.getNativeProps(this, props);
|
21497 | break;
|
21498 | case 'select':
|
21499 | ReactDOMSelect.mountWrapper(this, props, nativeParent);
|
21500 | props = ReactDOMSelect.getNativeProps(this, props);
|
21501 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
21502 | break;
|
21503 | case 'textarea':
|
21504 | ReactDOMTextarea.mountWrapper(this, props, nativeParent);
|
21505 | props = ReactDOMTextarea.getNativeProps(this, props);
|
21506 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
21507 | break;
|
21508 | }
|
21509 |
|
21510 | assertValidProps(this, props);
|
21511 |
|
21512 |
|
21513 |
|
21514 | var namespaceURI;
|
21515 | var parentTag;
|
21516 | if (nativeParent != null) {
|
21517 | namespaceURI = nativeParent._namespaceURI;
|
21518 | parentTag = nativeParent._tag;
|
21519 | } else if (nativeContainerInfo._tag) {
|
21520 | namespaceURI = nativeContainerInfo._namespaceURI;
|
21521 | parentTag = nativeContainerInfo._tag;
|
21522 | }
|
21523 | if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
|
21524 | namespaceURI = DOMNamespaces.html;
|
21525 | }
|
21526 | if (namespaceURI === DOMNamespaces.html) {
|
21527 | if (this._tag === 'svg') {
|
21528 | namespaceURI = DOMNamespaces.svg;
|
21529 | } else if (this._tag === 'math') {
|
21530 | namespaceURI = DOMNamespaces.mathml;
|
21531 | }
|
21532 | }
|
21533 | this._namespaceURI = namespaceURI;
|
21534 |
|
21535 | if (process.env.NODE_ENV !== 'production') {
|
21536 | var parentInfo;
|
21537 | if (nativeParent != null) {
|
21538 | parentInfo = nativeParent._ancestorInfo;
|
21539 | } else if (nativeContainerInfo._tag) {
|
21540 | parentInfo = nativeContainerInfo._ancestorInfo;
|
21541 | }
|
21542 | if (parentInfo) {
|
21543 |
|
21544 |
|
21545 | validateDOMNesting(this._tag, this, parentInfo);
|
21546 | }
|
21547 | this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
|
21548 | }
|
21549 |
|
21550 | var mountImage;
|
21551 | if (transaction.useCreateElement) {
|
21552 | var ownerDocument = nativeContainerInfo._ownerDocument;
|
21553 | var el;
|
21554 | if (namespaceURI === DOMNamespaces.html) {
|
21555 | if (this._tag === 'script') {
|
21556 |
|
21557 |
|
21558 | var div = ownerDocument.createElement('div');
|
21559 | var type = this._currentElement.type;
|
21560 | div.innerHTML = '<' + type + '></' + type + '>';
|
21561 | el = div.removeChild(div.firstChild);
|
21562 | } else {
|
21563 | el = ownerDocument.createElement(this._currentElement.type, props.is || null);
|
21564 | }
|
21565 | } else {
|
21566 | el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
|
21567 | }
|
21568 | ReactDOMComponentTree.precacheNode(this, el);
|
21569 | this._flags |= Flags.hasCachedChildNodes;
|
21570 | if (!this._nativeParent) {
|
21571 | DOMPropertyOperations.setAttributeForRoot(el);
|
21572 | }
|
21573 | this._updateDOMProperties(null, props, transaction);
|
21574 | var lazyTree = DOMLazyTree(el);
|
21575 | this._createInitialChildren(transaction, props, context, lazyTree);
|
21576 | mountImage = lazyTree;
|
21577 | } else {
|
21578 | var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
|
21579 | var tagContent = this._createContentMarkup(transaction, props, context);
|
21580 | if (!tagContent && omittedCloseTags[this._tag]) {
|
21581 | mountImage = tagOpen + '/>';
|
21582 | } else {
|
21583 | mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
|
21584 | }
|
21585 | }
|
21586 |
|
21587 | switch (this._tag) {
|
21588 | case 'button':
|
21589 | case 'input':
|
21590 | case 'select':
|
21591 | case 'textarea':
|
21592 | if (props.autoFocus) {
|
21593 | transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
21594 | }
|
21595 | break;
|
21596 | case 'option':
|
21597 | transaction.getReactMountReady().enqueue(optionPostMount, this);
|
21598 | }
|
21599 |
|
21600 | return mountImage;
|
21601 | },
|
21602 |
|
21603 | |
21604 |
|
21605 |
|
21606 |
|
21607 |
|
21608 |
|
21609 |
|
21610 |
|
21611 |
|
21612 |
|
21613 |
|
21614 |
|
21615 |
|
21616 | _createOpenTagMarkupAndPutListeners: function (transaction, props) {
|
21617 | var ret = '<' + this._currentElement.type;
|
21618 |
|
21619 | for (var propKey in props) {
|
21620 | if (!props.hasOwnProperty(propKey)) {
|
21621 | continue;
|
21622 | }
|
21623 | var propValue = props[propKey];
|
21624 | if (propValue == null) {
|
21625 | continue;
|
21626 | }
|
21627 | if (registrationNameModules.hasOwnProperty(propKey)) {
|
21628 | if (propValue) {
|
21629 | enqueuePutListener(this, propKey, propValue, transaction);
|
21630 | }
|
21631 | } else {
|
21632 | if (propKey === STYLE) {
|
21633 | if (propValue) {
|
21634 | if (process.env.NODE_ENV !== 'production') {
|
21635 |
|
21636 | this._previousStyle = propValue;
|
21637 | }
|
21638 | propValue = this._previousStyleCopy = _assign({}, props.style);
|
21639 | }
|
21640 | propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
|
21641 | }
|
21642 | var markup = null;
|
21643 | if (this._tag != null && isCustomComponent(this._tag, props)) {
|
21644 | if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
21645 | markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
|
21646 | }
|
21647 | } else {
|
21648 | markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
|
21649 | }
|
21650 | if (markup) {
|
21651 | ret += ' ' + markup;
|
21652 | }
|
21653 | }
|
21654 | }
|
21655 |
|
21656 |
|
21657 |
|
21658 | if (transaction.renderToStaticMarkup) {
|
21659 | return ret;
|
21660 | }
|
21661 |
|
21662 | if (!this._nativeParent) {
|
21663 | ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
|
21664 | }
|
21665 | ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
|
21666 | return ret;
|
21667 | },
|
21668 |
|
21669 | |
21670 |
|
21671 |
|
21672 |
|
21673 |
|
21674 |
|
21675 |
|
21676 |
|
21677 |
|
21678 | _createContentMarkup: function (transaction, props, context) {
|
21679 | var ret = '';
|
21680 |
|
21681 |
|
21682 | var innerHTML = props.dangerouslySetInnerHTML;
|
21683 | if (innerHTML != null) {
|
21684 | if (innerHTML.__html != null) {
|
21685 | ret = innerHTML.__html;
|
21686 | }
|
21687 | } else {
|
21688 | var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
21689 | var childrenToUse = contentToUse != null ? null : props.children;
|
21690 | if (contentToUse != null) {
|
21691 |
|
21692 | ret = escapeTextContentForBrowser(contentToUse);
|
21693 | if (process.env.NODE_ENV !== 'production') {
|
21694 | setContentChildForInstrumentation.call(this, contentToUse);
|
21695 | }
|
21696 | } else if (childrenToUse != null) {
|
21697 | var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
21698 | ret = mountImages.join('');
|
21699 | }
|
21700 | }
|
21701 | if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
|
21702 |
|
21703 |
|
21704 |
|
21705 |
|
21706 |
|
21707 |
|
21708 |
|
21709 |
|
21710 |
|
21711 |
|
21712 | return '\n' + ret;
|
21713 | } else {
|
21714 | return ret;
|
21715 | }
|
21716 | },
|
21717 |
|
21718 | _createInitialChildren: function (transaction, props, context, lazyTree) {
|
21719 |
|
21720 | var innerHTML = props.dangerouslySetInnerHTML;
|
21721 | if (innerHTML != null) {
|
21722 | if (innerHTML.__html != null) {
|
21723 | DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
|
21724 | }
|
21725 | } else {
|
21726 | var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
21727 | var childrenToUse = contentToUse != null ? null : props.children;
|
21728 | if (contentToUse != null) {
|
21729 |
|
21730 | if (process.env.NODE_ENV !== 'production') {
|
21731 | setContentChildForInstrumentation.call(this, contentToUse);
|
21732 | }
|
21733 | DOMLazyTree.queueText(lazyTree, contentToUse);
|
21734 | } else if (childrenToUse != null) {
|
21735 | var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
21736 | for (var i = 0; i < mountImages.length; i++) {
|
21737 | DOMLazyTree.queueChild(lazyTree, mountImages[i]);
|
21738 | }
|
21739 | }
|
21740 | }
|
21741 | },
|
21742 |
|
21743 | |
21744 |
|
21745 |
|
21746 |
|
21747 |
|
21748 |
|
21749 |
|
21750 |
|
21751 | receiveComponent: function (nextElement, transaction, context) {
|
21752 | var prevElement = this._currentElement;
|
21753 | this._currentElement = nextElement;
|
21754 | this.updateComponent(transaction, prevElement, nextElement, context);
|
21755 | },
|
21756 |
|
21757 | |
21758 |
|
21759 |
|
21760 |
|
21761 |
|
21762 |
|
21763 |
|
21764 |
|
21765 |
|
21766 |
|
21767 | updateComponent: function (transaction, prevElement, nextElement, context) {
|
21768 | var lastProps = prevElement.props;
|
21769 | var nextProps = this._currentElement.props;
|
21770 |
|
21771 | switch (this._tag) {
|
21772 | case 'button':
|
21773 | lastProps = ReactDOMButton.getNativeProps(this, lastProps);
|
21774 | nextProps = ReactDOMButton.getNativeProps(this, nextProps);
|
21775 | break;
|
21776 | case 'input':
|
21777 | ReactDOMInput.updateWrapper(this);
|
21778 | lastProps = ReactDOMInput.getNativeProps(this, lastProps);
|
21779 | nextProps = ReactDOMInput.getNativeProps(this, nextProps);
|
21780 | break;
|
21781 | case 'option':
|
21782 | lastProps = ReactDOMOption.getNativeProps(this, lastProps);
|
21783 | nextProps = ReactDOMOption.getNativeProps(this, nextProps);
|
21784 | break;
|
21785 | case 'select':
|
21786 | lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
|
21787 | nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
|
21788 | break;
|
21789 | case 'textarea':
|
21790 | ReactDOMTextarea.updateWrapper(this);
|
21791 | lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
|
21792 | nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
|
21793 | break;
|
21794 | }
|
21795 |
|
21796 | assertValidProps(this, nextProps);
|
21797 | this._updateDOMProperties(lastProps, nextProps, transaction);
|
21798 | this._updateDOMChildren(lastProps, nextProps, transaction, context);
|
21799 |
|
21800 | if (this._tag === 'select') {
|
21801 |
|
21802 |
|
21803 | transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
|
21804 | }
|
21805 | },
|
21806 |
|
21807 | |
21808 |
|
21809 |
|
21810 |
|
21811 |
|
21812 |
|
21813 |
|
21814 |
|
21815 |
|
21816 |
|
21817 |
|
21818 |
|
21819 |
|
21820 |
|
21821 |
|
21822 |
|
21823 | _updateDOMProperties: function (lastProps, nextProps, transaction) {
|
21824 | var propKey;
|
21825 | var styleName;
|
21826 | var styleUpdates;
|
21827 | for (propKey in lastProps) {
|
21828 | if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
|
21829 | continue;
|
21830 | }
|
21831 | if (propKey === STYLE) {
|
21832 | var lastStyle = this._previousStyleCopy;
|
21833 | for (styleName in lastStyle) {
|
21834 | if (lastStyle.hasOwnProperty(styleName)) {
|
21835 | styleUpdates = styleUpdates || {};
|
21836 | styleUpdates[styleName] = '';
|
21837 | }
|
21838 | }
|
21839 | this._previousStyleCopy = null;
|
21840 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
21841 | if (lastProps[propKey]) {
|
21842 |
|
21843 |
|
21844 |
|
21845 | deleteListener(this, propKey);
|
21846 | }
|
21847 | } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
21848 | DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
|
21849 | }
|
21850 | }
|
21851 | for (propKey in nextProps) {
|
21852 | var nextProp = nextProps[propKey];
|
21853 | var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
|
21854 | if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
|
21855 | continue;
|
21856 | }
|
21857 | if (propKey === STYLE) {
|
21858 | if (nextProp) {
|
21859 | if (process.env.NODE_ENV !== 'production') {
|
21860 | checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
|
21861 | this._previousStyle = nextProp;
|
21862 | }
|
21863 | nextProp = this._previousStyleCopy = _assign({}, nextProp);
|
21864 | } else {
|
21865 | this._previousStyleCopy = null;
|
21866 | }
|
21867 | if (lastProp) {
|
21868 |
|
21869 | for (styleName in lastProp) {
|
21870 | if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
|
21871 | styleUpdates = styleUpdates || {};
|
21872 | styleUpdates[styleName] = '';
|
21873 | }
|
21874 | }
|
21875 |
|
21876 | for (styleName in nextProp) {
|
21877 | if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
|
21878 | styleUpdates = styleUpdates || {};
|
21879 | styleUpdates[styleName] = nextProp[styleName];
|
21880 | }
|
21881 | }
|
21882 | } else {
|
21883 |
|
21884 | styleUpdates = nextProp;
|
21885 | }
|
21886 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
21887 | if (nextProp) {
|
21888 | enqueuePutListener(this, propKey, nextProp, transaction);
|
21889 | } else if (lastProp) {
|
21890 | deleteListener(this, propKey);
|
21891 | }
|
21892 | } else if (isCustomComponent(this._tag, nextProps)) {
|
21893 | if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
21894 | DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
|
21895 | }
|
21896 | } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
21897 | var node = getNode(this);
|
21898 |
|
21899 |
|
21900 |
|
21901 | if (nextProp != null) {
|
21902 | DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
|
21903 | } else {
|
21904 | DOMPropertyOperations.deleteValueForProperty(node, propKey);
|
21905 | }
|
21906 | }
|
21907 | }
|
21908 | if (styleUpdates) {
|
21909 | CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
|
21910 | }
|
21911 | },
|
21912 |
|
21913 | |
21914 |
|
21915 |
|
21916 |
|
21917 |
|
21918 |
|
21919 |
|
21920 |
|
21921 |
|
21922 | _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
|
21923 | var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
|
21924 | var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
|
21925 |
|
21926 | var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
|
21927 | var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
|
21928 |
|
21929 |
|
21930 | var lastChildren = lastContent != null ? null : lastProps.children;
|
21931 | var nextChildren = nextContent != null ? null : nextProps.children;
|
21932 |
|
21933 |
|
21934 |
|
21935 | var lastHasContentOrHtml = lastContent != null || lastHtml != null;
|
21936 | var nextHasContentOrHtml = nextContent != null || nextHtml != null;
|
21937 | if (lastChildren != null && nextChildren == null) {
|
21938 | this.updateChildren(null, transaction, context);
|
21939 | } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
|
21940 | this.updateTextContent('');
|
21941 | if (process.env.NODE_ENV !== 'production') {
|
21942 | ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
|
21943 | }
|
21944 | }
|
21945 |
|
21946 | if (nextContent != null) {
|
21947 | if (lastContent !== nextContent) {
|
21948 | this.updateTextContent('' + nextContent);
|
21949 | if (process.env.NODE_ENV !== 'production') {
|
21950 | this._contentDebugID = this._debugID + '#text';
|
21951 | setContentChildForInstrumentation.call(this, nextContent);
|
21952 | }
|
21953 | }
|
21954 | } else if (nextHtml != null) {
|
21955 | if (lastHtml !== nextHtml) {
|
21956 | this.updateMarkup('' + nextHtml);
|
21957 | }
|
21958 | if (process.env.NODE_ENV !== 'production') {
|
21959 | ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
|
21960 | }
|
21961 | } else if (nextChildren != null) {
|
21962 | if (process.env.NODE_ENV !== 'production') {
|
21963 | if (this._contentDebugID) {
|
21964 | ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
|
21965 | this._contentDebugID = null;
|
21966 | }
|
21967 | }
|
21968 |
|
21969 | this.updateChildren(nextChildren, transaction, context);
|
21970 | }
|
21971 | },
|
21972 |
|
21973 | getNativeNode: function () {
|
21974 | return getNode(this);
|
21975 | },
|
21976 |
|
21977 | |
21978 |
|
21979 |
|
21980 |
|
21981 |
|
21982 |
|
21983 | unmountComponent: function (safely) {
|
21984 | switch (this._tag) {
|
21985 | case 'iframe':
|
21986 | case 'object':
|
21987 | case 'img':
|
21988 | case 'form':
|
21989 | case 'video':
|
21990 | case 'audio':
|
21991 | var listeners = this._wrapperState.listeners;
|
21992 | if (listeners) {
|
21993 | for (var i = 0; i < listeners.length; i++) {
|
21994 | listeners[i].remove();
|
21995 | }
|
21996 | }
|
21997 | break;
|
21998 | case 'html':
|
21999 | case 'head':
|
22000 | case 'body':
|
22001 | |
22002 |
|
22003 |
|
22004 |
|
22005 |
|
22006 |
|
22007 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : void 0;
|
22008 | break;
|
22009 | }
|
22010 |
|
22011 | this.unmountChildren(safely);
|
22012 | ReactDOMComponentTree.uncacheNode(this);
|
22013 | EventPluginHub.deleteAllListeners(this);
|
22014 | ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
|
22015 | this._rootNodeID = null;
|
22016 | this._domID = null;
|
22017 | this._wrapperState = null;
|
22018 |
|
22019 | if (process.env.NODE_ENV !== 'production') {
|
22020 | if (this._contentDebugID) {
|
22021 | ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
|
22022 | this._contentDebugID = null;
|
22023 | }
|
22024 | }
|
22025 | },
|
22026 |
|
22027 | getPublicInstance: function () {
|
22028 | return getNode(this);
|
22029 | }
|
22030 |
|
22031 | };
|
22032 |
|
22033 | _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
|
22034 |
|
22035 | module.exports = ReactDOMComponent;
|
22036 | }).call(this,require(91))
|
22037 | },{"159":159,"162":162,"166":166,"167":167,"168":168,"169":169,"174":174,"175":175,"176":176,"185":185,"190":190,"196":196,"198":198,"199":199,"206":206,"208":208,"209":209,"212":212,"228":228,"232":232,"245":245,"272":272,"286":286,"295":295,"296":296,"37":37,"45":45,"49":49,"54":54,"55":55,"91":91}],198:[function(require,module,exports){
|
22038 |
|
22039 |
|
22040 |
|
22041 |
|
22042 |
|
22043 |
|
22044 |
|
22045 |
|
22046 |
|
22047 |
|
22048 |
|
22049 | 'use strict';
|
22050 |
|
22051 | var ReactDOMComponentFlags = {
|
22052 | hasCachedChildNodes: 1 << 0
|
22053 | };
|
22054 |
|
22055 | module.exports = ReactDOMComponentFlags;
|
22056 | },{}],199:[function(require,module,exports){
|
22057 | (function (process){
|
22058 |
|
22059 |
|
22060 |
|
22061 |
|
22062 |
|
22063 |
|
22064 |
|
22065 |
|
22066 |
|
22067 |
|
22068 |
|
22069 | 'use strict';
|
22070 |
|
22071 | var DOMProperty = require(168);
|
22072 | var ReactDOMComponentFlags = require(198);
|
22073 |
|
22074 | var invariant = require(45);
|
22075 |
|
22076 | var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
|
22077 | var Flags = ReactDOMComponentFlags;
|
22078 |
|
22079 | var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
|
22080 |
|
22081 |
|
22082 |
|
22083 |
|
22084 |
|
22085 |
|
22086 |
|
22087 |
|
22088 | function getRenderedNativeOrTextFromComponent(component) {
|
22089 | var rendered;
|
22090 | while (rendered = component._renderedComponent) {
|
22091 | component = rendered;
|
22092 | }
|
22093 | return component;
|
22094 | }
|
22095 |
|
22096 |
|
22097 |
|
22098 |
|
22099 |
|
22100 | function precacheNode(inst, node) {
|
22101 | var nativeInst = getRenderedNativeOrTextFromComponent(inst);
|
22102 | nativeInst._nativeNode = node;
|
22103 | node[internalInstanceKey] = nativeInst;
|
22104 | }
|
22105 |
|
22106 | function uncacheNode(inst) {
|
22107 | var node = inst._nativeNode;
|
22108 | if (node) {
|
22109 | delete node[internalInstanceKey];
|
22110 | inst._nativeNode = null;
|
22111 | }
|
22112 | }
|
22113 |
|
22114 |
|
22115 |
|
22116 |
|
22117 |
|
22118 |
|
22119 |
|
22120 |
|
22121 |
|
22122 |
|
22123 |
|
22124 |
|
22125 |
|
22126 |
|
22127 |
|
22128 | function precacheChildNodes(inst, node) {
|
22129 | if (inst._flags & Flags.hasCachedChildNodes) {
|
22130 | return;
|
22131 | }
|
22132 | var children = inst._renderedChildren;
|
22133 | var childNode = node.firstChild;
|
22134 | outer: for (var name in children) {
|
22135 | if (!children.hasOwnProperty(name)) {
|
22136 | continue;
|
22137 | }
|
22138 | var childInst = children[name];
|
22139 | var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;
|
22140 | if (childID == null) {
|
22141 |
|
22142 | continue;
|
22143 | }
|
22144 |
|
22145 | for (; childNode !== null; childNode = childNode.nextSibling) {
|
22146 | if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
|
22147 | precacheNode(childInst, childNode);
|
22148 | continue outer;
|
22149 | }
|
22150 | }
|
22151 |
|
22152 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;
|
22153 | }
|
22154 | inst._flags |= Flags.hasCachedChildNodes;
|
22155 | }
|
22156 |
|
22157 |
|
22158 |
|
22159 |
|
22160 |
|
22161 | function getClosestInstanceFromNode(node) {
|
22162 | if (node[internalInstanceKey]) {
|
22163 | return node[internalInstanceKey];
|
22164 | }
|
22165 |
|
22166 |
|
22167 | var parents = [];
|
22168 | while (!node[internalInstanceKey]) {
|
22169 | parents.push(node);
|
22170 | if (node.parentNode) {
|
22171 | node = node.parentNode;
|
22172 | } else {
|
22173 |
|
22174 |
|
22175 | return null;
|
22176 | }
|
22177 | }
|
22178 |
|
22179 | var closest;
|
22180 | var inst;
|
22181 | for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
|
22182 | closest = inst;
|
22183 | if (parents.length) {
|
22184 | precacheChildNodes(inst, node);
|
22185 | }
|
22186 | }
|
22187 |
|
22188 | return closest;
|
22189 | }
|
22190 |
|
22191 |
|
22192 |
|
22193 |
|
22194 |
|
22195 | function getInstanceFromNode(node) {
|
22196 | var inst = getClosestInstanceFromNode(node);
|
22197 | if (inst != null && inst._nativeNode === node) {
|
22198 | return inst;
|
22199 | } else {
|
22200 | return null;
|
22201 | }
|
22202 | }
|
22203 |
|
22204 |
|
22205 |
|
22206 |
|
22207 |
|
22208 | function getNodeFromInstance(inst) {
|
22209 |
|
22210 |
|
22211 | !(inst._nativeNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
|
22212 |
|
22213 | if (inst._nativeNode) {
|
22214 | return inst._nativeNode;
|
22215 | }
|
22216 |
|
22217 |
|
22218 | var parents = [];
|
22219 | while (!inst._nativeNode) {
|
22220 | parents.push(inst);
|
22221 | !inst._nativeParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : invariant(false) : void 0;
|
22222 | inst = inst._nativeParent;
|
22223 | }
|
22224 |
|
22225 |
|
22226 |
|
22227 | for (; parents.length; inst = parents.pop()) {
|
22228 | precacheChildNodes(inst, inst._nativeNode);
|
22229 | }
|
22230 |
|
22231 | return inst._nativeNode;
|
22232 | }
|
22233 |
|
22234 | var ReactDOMComponentTree = {
|
22235 | getClosestInstanceFromNode: getClosestInstanceFromNode,
|
22236 | getInstanceFromNode: getInstanceFromNode,
|
22237 | getNodeFromInstance: getNodeFromInstance,
|
22238 | precacheChildNodes: precacheChildNodes,
|
22239 | precacheNode: precacheNode,
|
22240 | uncacheNode: uncacheNode
|
22241 | };
|
22242 |
|
22243 | module.exports = ReactDOMComponentTree;
|
22244 | }).call(this,require(91))
|
22245 | },{"168":168,"198":198,"45":45,"91":91}],200:[function(require,module,exports){
|
22246 | (function (process){
|
22247 |
|
22248 |
|
22249 |
|
22250 |
|
22251 |
|
22252 |
|
22253 |
|
22254 |
|
22255 |
|
22256 |
|
22257 |
|
22258 | 'use strict';
|
22259 |
|
22260 | var validateDOMNesting = require(295);
|
22261 |
|
22262 | var DOC_NODE_TYPE = 9;
|
22263 |
|
22264 | function ReactDOMContainerInfo(topLevelWrapper, node) {
|
22265 | var info = {
|
22266 | _topLevelWrapper: topLevelWrapper,
|
22267 | _idCounter: 1,
|
22268 | _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
|
22269 | _node: node,
|
22270 | _tag: node ? node.nodeName.toLowerCase() : null,
|
22271 | _namespaceURI: node ? node.namespaceURI : null
|
22272 | };
|
22273 | if (process.env.NODE_ENV !== 'production') {
|
22274 | info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
|
22275 | }
|
22276 | return info;
|
22277 | }
|
22278 |
|
22279 | module.exports = ReactDOMContainerInfo;
|
22280 | }).call(this,require(91))
|
22281 | },{"295":295,"91":91}],201:[function(require,module,exports){
|
22282 | (function (process){
|
22283 |
|
22284 |
|
22285 |
|
22286 |
|
22287 |
|
22288 |
|
22289 |
|
22290 |
|
22291 |
|
22292 |
|
22293 |
|
22294 | 'use strict';
|
22295 |
|
22296 | var ReactDOMUnknownPropertyDevtool = require(214);
|
22297 |
|
22298 | var warning = require(55);
|
22299 |
|
22300 | var eventHandlers = [];
|
22301 | var handlerDoesThrowForEvent = {};
|
22302 |
|
22303 | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
|
22304 | if (process.env.NODE_ENV !== 'production') {
|
22305 | eventHandlers.forEach(function (handler) {
|
22306 | try {
|
22307 | if (handler[handlerFunctionName]) {
|
22308 | handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
|
22309 | }
|
22310 | } catch (e) {
|
22311 | process.env.NODE_ENV !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
|
22312 | handlerDoesThrowForEvent[handlerFunctionName] = true;
|
22313 | }
|
22314 | });
|
22315 | }
|
22316 | }
|
22317 |
|
22318 | var ReactDOMDebugTool = {
|
22319 | addDevtool: function (devtool) {
|
22320 | eventHandlers.push(devtool);
|
22321 | },
|
22322 | removeDevtool: function (devtool) {
|
22323 | for (var i = 0; i < eventHandlers.length; i++) {
|
22324 | if (eventHandlers[i] === devtool) {
|
22325 | eventHandlers.splice(i, 1);
|
22326 | i--;
|
22327 | }
|
22328 | }
|
22329 | },
|
22330 | onCreateMarkupForProperty: function (name, value) {
|
22331 | emitEvent('onCreateMarkupForProperty', name, value);
|
22332 | },
|
22333 | onSetValueForProperty: function (node, name, value) {
|
22334 | emitEvent('onSetValueForProperty', node, name, value);
|
22335 | },
|
22336 | onDeleteValueForProperty: function (node, name) {
|
22337 | emitEvent('onDeleteValueForProperty', node, name);
|
22338 | }
|
22339 | };
|
22340 |
|
22341 | ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
|
22342 |
|
22343 | module.exports = ReactDOMDebugTool;
|
22344 | }).call(this,require(91))
|
22345 | },{"214":214,"55":55,"91":91}],202:[function(require,module,exports){
|
22346 |
|
22347 |
|
22348 |
|
22349 |
|
22350 |
|
22351 |
|
22352 |
|
22353 |
|
22354 |
|
22355 |
|
22356 |
|
22357 | 'use strict';
|
22358 |
|
22359 | var _assign = require(296);
|
22360 |
|
22361 | var DOMLazyTree = require(166);
|
22362 | var ReactDOMComponentTree = require(199);
|
22363 |
|
22364 | var ReactDOMEmptyComponent = function (instantiate) {
|
22365 |
|
22366 | this._currentElement = null;
|
22367 |
|
22368 | this._nativeNode = null;
|
22369 | this._nativeParent = null;
|
22370 | this._nativeContainerInfo = null;
|
22371 | this._domID = null;
|
22372 | };
|
22373 | _assign(ReactDOMEmptyComponent.prototype, {
|
22374 | mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
|
22375 | var domID = nativeContainerInfo._idCounter++;
|
22376 | this._domID = domID;
|
22377 | this._nativeParent = nativeParent;
|
22378 | this._nativeContainerInfo = nativeContainerInfo;
|
22379 |
|
22380 | var nodeValue = ' react-empty: ' + this._domID + ' ';
|
22381 | if (transaction.useCreateElement) {
|
22382 | var ownerDocument = nativeContainerInfo._ownerDocument;
|
22383 | var node = ownerDocument.createComment(nodeValue);
|
22384 | ReactDOMComponentTree.precacheNode(this, node);
|
22385 | return DOMLazyTree(node);
|
22386 | } else {
|
22387 | if (transaction.renderToStaticMarkup) {
|
22388 |
|
22389 |
|
22390 |
|
22391 | return '';
|
22392 | }
|
22393 | return '<!--' + nodeValue + '-->';
|
22394 | }
|
22395 | },
|
22396 | receiveComponent: function () {},
|
22397 | getNativeNode: function () {
|
22398 | return ReactDOMComponentTree.getNodeFromInstance(this);
|
22399 | },
|
22400 | unmountComponent: function () {
|
22401 | ReactDOMComponentTree.uncacheNode(this);
|
22402 | }
|
22403 | });
|
22404 |
|
22405 | module.exports = ReactDOMEmptyComponent;
|
22406 | },{"166":166,"199":199,"296":296}],203:[function(require,module,exports){
|
22407 | (function (process){
|
22408 |
|
22409 |
|
22410 |
|
22411 |
|
22412 |
|
22413 |
|
22414 |
|
22415 |
|
22416 |
|
22417 |
|
22418 |
|
22419 | 'use strict';
|
22420 |
|
22421 | var ReactElement = require(218);
|
22422 | var ReactElementValidator = require(219);
|
22423 |
|
22424 | var mapObject = require(50);
|
22425 |
|
22426 |
|
22427 |
|
22428 |
|
22429 |
|
22430 |
|
22431 |
|
22432 | function createDOMFactory(tag) {
|
22433 | if (process.env.NODE_ENV !== 'production') {
|
22434 | return ReactElementValidator.createFactory(tag);
|
22435 | }
|
22436 | return ReactElement.createFactory(tag);
|
22437 | }
|
22438 |
|
22439 |
|
22440 |
|
22441 |
|
22442 |
|
22443 |
|
22444 |
|
22445 | var ReactDOMFactories = mapObject({
|
22446 | a: 'a',
|
22447 | abbr: 'abbr',
|
22448 | address: 'address',
|
22449 | area: 'area',
|
22450 | article: 'article',
|
22451 | aside: 'aside',
|
22452 | audio: 'audio',
|
22453 | b: 'b',
|
22454 | base: 'base',
|
22455 | bdi: 'bdi',
|
22456 | bdo: 'bdo',
|
22457 | big: 'big',
|
22458 | blockquote: 'blockquote',
|
22459 | body: 'body',
|
22460 | br: 'br',
|
22461 | button: 'button',
|
22462 | canvas: 'canvas',
|
22463 | caption: 'caption',
|
22464 | cite: 'cite',
|
22465 | code: 'code',
|
22466 | col: 'col',
|
22467 | colgroup: 'colgroup',
|
22468 | data: 'data',
|
22469 | datalist: 'datalist',
|
22470 | dd: 'dd',
|
22471 | del: 'del',
|
22472 | details: 'details',
|
22473 | dfn: 'dfn',
|
22474 | dialog: 'dialog',
|
22475 | div: 'div',
|
22476 | dl: 'dl',
|
22477 | dt: 'dt',
|
22478 | em: 'em',
|
22479 | embed: 'embed',
|
22480 | fieldset: 'fieldset',
|
22481 | figcaption: 'figcaption',
|
22482 | figure: 'figure',
|
22483 | footer: 'footer',
|
22484 | form: 'form',
|
22485 | h1: 'h1',
|
22486 | h2: 'h2',
|
22487 | h3: 'h3',
|
22488 | h4: 'h4',
|
22489 | h5: 'h5',
|
22490 | h6: 'h6',
|
22491 | head: 'head',
|
22492 | header: 'header',
|
22493 | hgroup: 'hgroup',
|
22494 | hr: 'hr',
|
22495 | html: 'html',
|
22496 | i: 'i',
|
22497 | iframe: 'iframe',
|
22498 | img: 'img',
|
22499 | input: 'input',
|
22500 | ins: 'ins',
|
22501 | kbd: 'kbd',
|
22502 | keygen: 'keygen',
|
22503 | label: 'label',
|
22504 | legend: 'legend',
|
22505 | li: 'li',
|
22506 | link: 'link',
|
22507 | main: 'main',
|
22508 | map: 'map',
|
22509 | mark: 'mark',
|
22510 | menu: 'menu',
|
22511 | menuitem: 'menuitem',
|
22512 | meta: 'meta',
|
22513 | meter: 'meter',
|
22514 | nav: 'nav',
|
22515 | noscript: 'noscript',
|
22516 | object: 'object',
|
22517 | ol: 'ol',
|
22518 | optgroup: 'optgroup',
|
22519 | option: 'option',
|
22520 | output: 'output',
|
22521 | p: 'p',
|
22522 | param: 'param',
|
22523 | picture: 'picture',
|
22524 | pre: 'pre',
|
22525 | progress: 'progress',
|
22526 | q: 'q',
|
22527 | rp: 'rp',
|
22528 | rt: 'rt',
|
22529 | ruby: 'ruby',
|
22530 | s: 's',
|
22531 | samp: 'samp',
|
22532 | script: 'script',
|
22533 | section: 'section',
|
22534 | select: 'select',
|
22535 | small: 'small',
|
22536 | source: 'source',
|
22537 | span: 'span',
|
22538 | strong: 'strong',
|
22539 | style: 'style',
|
22540 | sub: 'sub',
|
22541 | summary: 'summary',
|
22542 | sup: 'sup',
|
22543 | table: 'table',
|
22544 | tbody: 'tbody',
|
22545 | td: 'td',
|
22546 | textarea: 'textarea',
|
22547 | tfoot: 'tfoot',
|
22548 | th: 'th',
|
22549 | thead: 'thead',
|
22550 | time: 'time',
|
22551 | title: 'title',
|
22552 | tr: 'tr',
|
22553 | track: 'track',
|
22554 | u: 'u',
|
22555 | ul: 'ul',
|
22556 | 'var': 'var',
|
22557 | video: 'video',
|
22558 | wbr: 'wbr',
|
22559 |
|
22560 |
|
22561 | circle: 'circle',
|
22562 | clipPath: 'clipPath',
|
22563 | defs: 'defs',
|
22564 | ellipse: 'ellipse',
|
22565 | g: 'g',
|
22566 | image: 'image',
|
22567 | line: 'line',
|
22568 | linearGradient: 'linearGradient',
|
22569 | mask: 'mask',
|
22570 | path: 'path',
|
22571 | pattern: 'pattern',
|
22572 | polygon: 'polygon',
|
22573 | polyline: 'polyline',
|
22574 | radialGradient: 'radialGradient',
|
22575 | rect: 'rect',
|
22576 | stop: 'stop',
|
22577 | svg: 'svg',
|
22578 | text: 'text',
|
22579 | tspan: 'tspan'
|
22580 |
|
22581 | }, createDOMFactory);
|
22582 |
|
22583 | module.exports = ReactDOMFactories;
|
22584 | }).call(this,require(91))
|
22585 | },{"218":218,"219":219,"50":50,"91":91}],204:[function(require,module,exports){
|
22586 |
|
22587 |
|
22588 |
|
22589 |
|
22590 |
|
22591 |
|
22592 |
|
22593 |
|
22594 |
|
22595 |
|
22596 |
|
22597 | 'use strict';
|
22598 |
|
22599 | var ReactDOMFeatureFlags = {
|
22600 | useCreateElement: true
|
22601 | };
|
22602 |
|
22603 | module.exports = ReactDOMFeatureFlags;
|
22604 | },{}],205:[function(require,module,exports){
|
22605 |
|
22606 |
|
22607 |
|
22608 |
|
22609 |
|
22610 |
|
22611 |
|
22612 |
|
22613 |
|
22614 |
|
22615 |
|
22616 | 'use strict';
|
22617 |
|
22618 | var DOMChildrenOperations = require(165);
|
22619 | var ReactDOMComponentTree = require(199);
|
22620 |
|
22621 |
|
22622 |
|
22623 |
|
22624 | var ReactDOMIDOperations = {
|
22625 |
|
22626 | |
22627 |
|
22628 |
|
22629 |
|
22630 |
|
22631 |
|
22632 | dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
|
22633 | var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
|
22634 | DOMChildrenOperations.processUpdates(node, updates);
|
22635 | }
|
22636 | };
|
22637 |
|
22638 | module.exports = ReactDOMIDOperations;
|
22639 | },{"165":165,"199":199}],206:[function(require,module,exports){
|
22640 | (function (process){
|
22641 |
|
22642 |
|
22643 |
|
22644 |
|
22645 |
|
22646 |
|
22647 |
|
22648 |
|
22649 |
|
22650 |
|
22651 |
|
22652 | 'use strict';
|
22653 |
|
22654 | var _assign = require(296);
|
22655 |
|
22656 | var DisabledInputUtils = require(172);
|
22657 | var DOMPropertyOperations = require(169);
|
22658 | var LinkedValueUtils = require(182);
|
22659 | var ReactDOMComponentTree = require(199);
|
22660 | var ReactUpdates = require(247);
|
22661 |
|
22662 | var invariant = require(45);
|
22663 | var warning = require(55);
|
22664 |
|
22665 | var didWarnValueLink = false;
|
22666 | var didWarnCheckedLink = false;
|
22667 | var didWarnValueNull = false;
|
22668 | var didWarnValueDefaultValue = false;
|
22669 | var didWarnCheckedDefaultChecked = false;
|
22670 | var didWarnControlledToUncontrolled = false;
|
22671 | var didWarnUncontrolledToControlled = false;
|
22672 |
|
22673 | function forceUpdateIfMounted() {
|
22674 | if (this._rootNodeID) {
|
22675 |
|
22676 | ReactDOMInput.updateWrapper(this);
|
22677 | }
|
22678 | }
|
22679 |
|
22680 | function warnIfValueIsNull(props) {
|
22681 | if (props != null && props.value === null && !didWarnValueNull) {
|
22682 | process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `input` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
|
22683 |
|
22684 | didWarnValueNull = true;
|
22685 | }
|
22686 | }
|
22687 |
|
22688 |
|
22689 |
|
22690 |
|
22691 |
|
22692 |
|
22693 |
|
22694 |
|
22695 |
|
22696 |
|
22697 |
|
22698 |
|
22699 |
|
22700 |
|
22701 |
|
22702 |
|
22703 |
|
22704 | var ReactDOMInput = {
|
22705 | getNativeProps: function (inst, props) {
|
22706 | var value = LinkedValueUtils.getValue(props);
|
22707 | var checked = LinkedValueUtils.getChecked(props);
|
22708 |
|
22709 | var nativeProps = _assign({
|
22710 |
|
22711 |
|
22712 | type: undefined
|
22713 | }, DisabledInputUtils.getNativeProps(inst, props), {
|
22714 | defaultChecked: undefined,
|
22715 | defaultValue: undefined,
|
22716 | value: value != null ? value : inst._wrapperState.initialValue,
|
22717 | checked: checked != null ? checked : inst._wrapperState.initialChecked,
|
22718 | onChange: inst._wrapperState.onChange
|
22719 | });
|
22720 |
|
22721 | return nativeProps;
|
22722 | },
|
22723 |
|
22724 | mountWrapper: function (inst, props) {
|
22725 | if (process.env.NODE_ENV !== 'production') {
|
22726 | LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
|
22727 |
|
22728 | var owner = inst._currentElement._owner;
|
22729 |
|
22730 | if (props.valueLink !== undefined && !didWarnValueLink) {
|
22731 | process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
|
22732 | didWarnValueLink = true;
|
22733 | }
|
22734 | if (props.checkedLink !== undefined && !didWarnCheckedLink) {
|
22735 | process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
|
22736 | didWarnCheckedLink = true;
|
22737 | }
|
22738 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
|
22739 | process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
22740 | didWarnCheckedDefaultChecked = true;
|
22741 | }
|
22742 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
|
22743 | process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
22744 | didWarnValueDefaultValue = true;
|
22745 | }
|
22746 | warnIfValueIsNull(props);
|
22747 | }
|
22748 |
|
22749 | var defaultValue = props.defaultValue;
|
22750 | inst._wrapperState = {
|
22751 | initialChecked: props.defaultChecked || false,
|
22752 | initialValue: defaultValue != null ? defaultValue : null,
|
22753 | listeners: null,
|
22754 | onChange: _handleChange.bind(inst)
|
22755 | };
|
22756 |
|
22757 | if (process.env.NODE_ENV !== 'production') {
|
22758 | inst._wrapperState.controlled = props.checked !== undefined || props.value !== undefined;
|
22759 | }
|
22760 | },
|
22761 |
|
22762 | updateWrapper: function (inst) {
|
22763 | var props = inst._currentElement.props;
|
22764 |
|
22765 | if (process.env.NODE_ENV !== 'production') {
|
22766 | warnIfValueIsNull(props);
|
22767 |
|
22768 | var initialValue = inst._wrapperState.initialChecked || inst._wrapperState.initialValue;
|
22769 | var defaultValue = props.defaultChecked || props.defaultValue;
|
22770 | var controlled = props.checked !== undefined || props.value !== undefined;
|
22771 | var owner = inst._currentElement._owner;
|
22772 |
|
22773 | if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) {
|
22774 | process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
22775 | didWarnUncontrolledToControlled = true;
|
22776 | }
|
22777 | if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) {
|
22778 | process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
22779 | didWarnControlledToUncontrolled = true;
|
22780 | }
|
22781 | }
|
22782 |
|
22783 |
|
22784 | var checked = props.checked;
|
22785 | if (checked != null) {
|
22786 | DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
|
22787 | }
|
22788 |
|
22789 | var value = LinkedValueUtils.getValue(props);
|
22790 | if (value != null) {
|
22791 |
|
22792 |
|
22793 | DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
|
22794 | }
|
22795 | }
|
22796 | };
|
22797 |
|
22798 | function _handleChange(event) {
|
22799 | var props = this._currentElement.props;
|
22800 |
|
22801 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
22802 |
|
22803 |
|
22804 |
|
22805 |
|
22806 | ReactUpdates.asap(forceUpdateIfMounted, this);
|
22807 |
|
22808 | var name = props.name;
|
22809 | if (props.type === 'radio' && name != null) {
|
22810 | var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
|
22811 | var queryRoot = rootNode;
|
22812 |
|
22813 | while (queryRoot.parentNode) {
|
22814 | queryRoot = queryRoot.parentNode;
|
22815 | }
|
22816 |
|
22817 |
|
22818 |
|
22819 |
|
22820 |
|
22821 |
|
22822 |
|
22823 | var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
|
22824 |
|
22825 | for (var i = 0; i < group.length; i++) {
|
22826 | var otherNode = group[i];
|
22827 | if (otherNode === rootNode || otherNode.form !== rootNode.form) {
|
22828 | continue;
|
22829 | }
|
22830 |
|
22831 |
|
22832 |
|
22833 |
|
22834 | var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
|
22835 | !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : void 0;
|
22836 |
|
22837 |
|
22838 |
|
22839 | ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
|
22840 | }
|
22841 | }
|
22842 |
|
22843 | return returnValue;
|
22844 | }
|
22845 |
|
22846 | module.exports = ReactDOMInput;
|
22847 | }).call(this,require(91))
|
22848 | },{"169":169,"172":172,"182":182,"199":199,"247":247,"296":296,"45":45,"55":55,"91":91}],207:[function(require,module,exports){
|
22849 |
|
22850 |
|
22851 |
|
22852 |
|
22853 |
|
22854 |
|
22855 |
|
22856 |
|
22857 |
|
22858 |
|
22859 |
|
22860 | 'use strict';
|
22861 |
|
22862 | var ReactDOMDebugTool = require(201);
|
22863 |
|
22864 | module.exports = { debugTool: ReactDOMDebugTool };
|
22865 | },{"201":201}],208:[function(require,module,exports){
|
22866 | (function (process){
|
22867 |
|
22868 |
|
22869 |
|
22870 |
|
22871 |
|
22872 |
|
22873 |
|
22874 |
|
22875 |
|
22876 |
|
22877 |
|
22878 | 'use strict';
|
22879 |
|
22880 | var _assign = require(296);
|
22881 |
|
22882 | var ReactChildren = require(187);
|
22883 | var ReactDOMComponentTree = require(199);
|
22884 | var ReactDOMSelect = require(209);
|
22885 |
|
22886 | var warning = require(55);
|
22887 |
|
22888 |
|
22889 |
|
22890 |
|
22891 | var ReactDOMOption = {
|
22892 | mountWrapper: function (inst, props, nativeParent) {
|
22893 |
|
22894 | if (process.env.NODE_ENV !== 'production') {
|
22895 | process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
|
22896 | }
|
22897 |
|
22898 |
|
22899 | var selectValue = null;
|
22900 | if (nativeParent != null) {
|
22901 | var selectParent = nativeParent;
|
22902 |
|
22903 | if (selectParent._tag === 'optgroup') {
|
22904 | selectParent = selectParent._nativeParent;
|
22905 | }
|
22906 |
|
22907 | if (selectParent != null && selectParent._tag === 'select') {
|
22908 | selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
|
22909 | }
|
22910 | }
|
22911 |
|
22912 |
|
22913 |
|
22914 | var selected = null;
|
22915 | if (selectValue != null) {
|
22916 | selected = false;
|
22917 | if (Array.isArray(selectValue)) {
|
22918 |
|
22919 | for (var i = 0; i < selectValue.length; i++) {
|
22920 | if ('' + selectValue[i] === '' + props.value) {
|
22921 | selected = true;
|
22922 | break;
|
22923 | }
|
22924 | }
|
22925 | } else {
|
22926 | selected = '' + selectValue === '' + props.value;
|
22927 | }
|
22928 | }
|
22929 |
|
22930 | inst._wrapperState = { selected: selected };
|
22931 | },
|
22932 |
|
22933 | postMountWrapper: function (inst) {
|
22934 |
|
22935 | var props = inst._currentElement.props;
|
22936 | if (props.value != null) {
|
22937 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
22938 | node.setAttribute('value', props.value);
|
22939 | }
|
22940 | },
|
22941 |
|
22942 | getNativeProps: function (inst, props) {
|
22943 | var nativeProps = _assign({ selected: undefined, children: undefined }, props);
|
22944 |
|
22945 |
|
22946 |
|
22947 | if (inst._wrapperState.selected != null) {
|
22948 | nativeProps.selected = inst._wrapperState.selected;
|
22949 | }
|
22950 |
|
22951 | var content = '';
|
22952 |
|
22953 |
|
22954 |
|
22955 | ReactChildren.forEach(props.children, function (child) {
|
22956 | if (child == null) {
|
22957 | return;
|
22958 | }
|
22959 | if (typeof child === 'string' || typeof child === 'number') {
|
22960 | content += child;
|
22961 | } else {
|
22962 | process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
|
22963 | }
|
22964 | });
|
22965 |
|
22966 | if (content) {
|
22967 | nativeProps.children = content;
|
22968 | }
|
22969 |
|
22970 | return nativeProps;
|
22971 | }
|
22972 |
|
22973 | };
|
22974 |
|
22975 | module.exports = ReactDOMOption;
|
22976 | }).call(this,require(91))
|
22977 | },{"187":187,"199":199,"209":209,"296":296,"55":55,"91":91}],209:[function(require,module,exports){
|
22978 | (function (process){
|
22979 |
|
22980 |
|
22981 |
|
22982 |
|
22983 |
|
22984 |
|
22985 |
|
22986 |
|
22987 |
|
22988 |
|
22989 |
|
22990 | 'use strict';
|
22991 |
|
22992 | var _assign = require(296);
|
22993 |
|
22994 | var DisabledInputUtils = require(172);
|
22995 | var LinkedValueUtils = require(182);
|
22996 | var ReactDOMComponentTree = require(199);
|
22997 | var ReactUpdates = require(247);
|
22998 |
|
22999 | var warning = require(55);
|
23000 |
|
23001 | var didWarnValueLink = false;
|
23002 | var didWarnValueNull = false;
|
23003 | var didWarnValueDefaultValue = false;
|
23004 |
|
23005 | function updateOptionsIfPendingUpdateAndMounted() {
|
23006 | if (this._rootNodeID && this._wrapperState.pendingUpdate) {
|
23007 | this._wrapperState.pendingUpdate = false;
|
23008 |
|
23009 | var props = this._currentElement.props;
|
23010 | var value = LinkedValueUtils.getValue(props);
|
23011 |
|
23012 | if (value != null) {
|
23013 | updateOptions(this, Boolean(props.multiple), value);
|
23014 | }
|
23015 | }
|
23016 | }
|
23017 |
|
23018 | function getDeclarationErrorAddendum(owner) {
|
23019 | if (owner) {
|
23020 | var name = owner.getName();
|
23021 | if (name) {
|
23022 | return ' Check the render method of `' + name + '`.';
|
23023 | }
|
23024 | }
|
23025 | return '';
|
23026 | }
|
23027 |
|
23028 | function warnIfValueIsNull(props) {
|
23029 | if (props != null && props.value === null && !didWarnValueNull) {
|
23030 | process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `select` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
|
23031 |
|
23032 | didWarnValueNull = true;
|
23033 | }
|
23034 | }
|
23035 |
|
23036 | var valuePropNames = ['value', 'defaultValue'];
|
23037 |
|
23038 |
|
23039 |
|
23040 |
|
23041 |
|
23042 | function checkSelectPropTypes(inst, props) {
|
23043 | var owner = inst._currentElement._owner;
|
23044 | LinkedValueUtils.checkPropTypes('select', props, owner);
|
23045 |
|
23046 | if (props.valueLink !== undefined && !didWarnValueLink) {
|
23047 | process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
|
23048 | didWarnValueLink = true;
|
23049 | }
|
23050 |
|
23051 | for (var i = 0; i < valuePropNames.length; i++) {
|
23052 | var propName = valuePropNames[i];
|
23053 | if (props[propName] == null) {
|
23054 | continue;
|
23055 | }
|
23056 | if (props.multiple) {
|
23057 | process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
|
23058 | } else {
|
23059 | process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
|
23060 | }
|
23061 | }
|
23062 | }
|
23063 |
|
23064 |
|
23065 |
|
23066 |
|
23067 |
|
23068 |
|
23069 |
|
23070 | function updateOptions(inst, multiple, propValue) {
|
23071 | var selectedValue, i;
|
23072 | var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
|
23073 |
|
23074 | if (multiple) {
|
23075 | selectedValue = {};
|
23076 | for (i = 0; i < propValue.length; i++) {
|
23077 | selectedValue['' + propValue[i]] = true;
|
23078 | }
|
23079 | for (i = 0; i < options.length; i++) {
|
23080 | var selected = selectedValue.hasOwnProperty(options[i].value);
|
23081 | if (options[i].selected !== selected) {
|
23082 | options[i].selected = selected;
|
23083 | }
|
23084 | }
|
23085 | } else {
|
23086 |
|
23087 |
|
23088 | selectedValue = '' + propValue;
|
23089 | for (i = 0; i < options.length; i++) {
|
23090 | if (options[i].value === selectedValue) {
|
23091 | options[i].selected = true;
|
23092 | return;
|
23093 | }
|
23094 | }
|
23095 | if (options.length) {
|
23096 | options[0].selected = true;
|
23097 | }
|
23098 | }
|
23099 | }
|
23100 |
|
23101 |
|
23102 |
|
23103 |
|
23104 |
|
23105 |
|
23106 |
|
23107 |
|
23108 |
|
23109 |
|
23110 |
|
23111 |
|
23112 |
|
23113 |
|
23114 |
|
23115 |
|
23116 | var ReactDOMSelect = {
|
23117 | getNativeProps: function (inst, props) {
|
23118 | return _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
|
23119 | onChange: inst._wrapperState.onChange,
|
23120 | value: undefined
|
23121 | });
|
23122 | },
|
23123 |
|
23124 | mountWrapper: function (inst, props) {
|
23125 | if (process.env.NODE_ENV !== 'production') {
|
23126 | checkSelectPropTypes(inst, props);
|
23127 | warnIfValueIsNull(props);
|
23128 | }
|
23129 |
|
23130 | var value = LinkedValueUtils.getValue(props);
|
23131 | inst._wrapperState = {
|
23132 | pendingUpdate: false,
|
23133 | initialValue: value != null ? value : props.defaultValue,
|
23134 | listeners: null,
|
23135 | onChange: _handleChange.bind(inst),
|
23136 | wasMultiple: Boolean(props.multiple)
|
23137 | };
|
23138 |
|
23139 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
|
23140 | process.env.NODE_ENV !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
|
23141 | didWarnValueDefaultValue = true;
|
23142 | }
|
23143 | },
|
23144 |
|
23145 | getSelectValueContext: function (inst) {
|
23146 |
|
23147 |
|
23148 | return inst._wrapperState.initialValue;
|
23149 | },
|
23150 |
|
23151 | postUpdateWrapper: function (inst) {
|
23152 | var props = inst._currentElement.props;
|
23153 | if (process.env.NODE_ENV !== 'production') {
|
23154 | warnIfValueIsNull(props);
|
23155 | }
|
23156 |
|
23157 |
|
23158 |
|
23159 | inst._wrapperState.initialValue = undefined;
|
23160 |
|
23161 | var wasMultiple = inst._wrapperState.wasMultiple;
|
23162 | inst._wrapperState.wasMultiple = Boolean(props.multiple);
|
23163 |
|
23164 | var value = LinkedValueUtils.getValue(props);
|
23165 | if (value != null) {
|
23166 | inst._wrapperState.pendingUpdate = false;
|
23167 | updateOptions(inst, Boolean(props.multiple), value);
|
23168 | } else if (wasMultiple !== Boolean(props.multiple)) {
|
23169 |
|
23170 | if (props.defaultValue != null) {
|
23171 | updateOptions(inst, Boolean(props.multiple), props.defaultValue);
|
23172 | } else {
|
23173 |
|
23174 | updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
|
23175 | }
|
23176 | }
|
23177 | }
|
23178 | };
|
23179 |
|
23180 | function _handleChange(event) {
|
23181 | var props = this._currentElement.props;
|
23182 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
23183 |
|
23184 | if (this._rootNodeID) {
|
23185 | this._wrapperState.pendingUpdate = true;
|
23186 | }
|
23187 | ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
|
23188 | return returnValue;
|
23189 | }
|
23190 |
|
23191 | module.exports = ReactDOMSelect;
|
23192 | }).call(this,require(91))
|
23193 | },{"172":172,"182":182,"199":199,"247":247,"296":296,"55":55,"91":91}],210:[function(require,module,exports){
|
23194 |
|
23195 |
|
23196 |
|
23197 |
|
23198 |
|
23199 |
|
23200 |
|
23201 |
|
23202 |
|
23203 |
|
23204 |
|
23205 | 'use strict';
|
23206 |
|
23207 | var ExecutionEnvironment = require(31);
|
23208 |
|
23209 | var getNodeForCharacterOffset = require(282);
|
23210 | var getTextContentAccessor = require(283);
|
23211 |
|
23212 |
|
23213 |
|
23214 |
|
23215 |
|
23216 |
|
23217 | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
|
23218 | return anchorNode === focusNode && anchorOffset === focusOffset;
|
23219 | }
|
23220 |
|
23221 |
|
23222 |
|
23223 |
|
23224 |
|
23225 |
|
23226 |
|
23227 |
|
23228 |
|
23229 |
|
23230 |
|
23231 |
|
23232 |
|
23233 |
|
23234 |
|
23235 | function getIEOffsets(node) {
|
23236 | var selection = document.selection;
|
23237 | var selectedRange = selection.createRange();
|
23238 | var selectedLength = selectedRange.text.length;
|
23239 |
|
23240 |
|
23241 | var fromStart = selectedRange.duplicate();
|
23242 | fromStart.moveToElementText(node);
|
23243 | fromStart.setEndPoint('EndToStart', selectedRange);
|
23244 |
|
23245 | var startOffset = fromStart.text.length;
|
23246 | var endOffset = startOffset + selectedLength;
|
23247 |
|
23248 | return {
|
23249 | start: startOffset,
|
23250 | end: endOffset
|
23251 | };
|
23252 | }
|
23253 |
|
23254 |
|
23255 |
|
23256 |
|
23257 |
|
23258 | function getModernOffsets(node) {
|
23259 | var selection = window.getSelection && window.getSelection();
|
23260 |
|
23261 | if (!selection || selection.rangeCount === 0) {
|
23262 | return null;
|
23263 | }
|
23264 |
|
23265 | var anchorNode = selection.anchorNode;
|
23266 | var anchorOffset = selection.anchorOffset;
|
23267 | var focusNode = selection.focusNode;
|
23268 | var focusOffset = selection.focusOffset;
|
23269 |
|
23270 | var currentRange = selection.getRangeAt(0);
|
23271 |
|
23272 |
|
23273 |
|
23274 |
|
23275 |
|
23276 |
|
23277 |
|
23278 |
|
23279 | try {
|
23280 |
|
23281 | currentRange.startContainer.nodeType;
|
23282 | currentRange.endContainer.nodeType;
|
23283 |
|
23284 | } catch (e) {
|
23285 | return null;
|
23286 | }
|
23287 |
|
23288 |
|
23289 |
|
23290 |
|
23291 | var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
|
23292 |
|
23293 | var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
|
23294 |
|
23295 | var tempRange = currentRange.cloneRange();
|
23296 | tempRange.selectNodeContents(node);
|
23297 | tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
|
23298 |
|
23299 | var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
|
23300 |
|
23301 | var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
|
23302 | var end = start + rangeLength;
|
23303 |
|
23304 |
|
23305 | var detectionRange = document.createRange();
|
23306 | detectionRange.setStart(anchorNode, anchorOffset);
|
23307 | detectionRange.setEnd(focusNode, focusOffset);
|
23308 | var isBackward = detectionRange.collapsed;
|
23309 |
|
23310 | return {
|
23311 | start: isBackward ? end : start,
|
23312 | end: isBackward ? start : end
|
23313 | };
|
23314 | }
|
23315 |
|
23316 |
|
23317 |
|
23318 |
|
23319 |
|
23320 | function setIEOffsets(node, offsets) {
|
23321 | var range = document.selection.createRange().duplicate();
|
23322 | var start, end;
|
23323 |
|
23324 | if (offsets.end === undefined) {
|
23325 | start = offsets.start;
|
23326 | end = start;
|
23327 | } else if (offsets.start > offsets.end) {
|
23328 | start = offsets.end;
|
23329 | end = offsets.start;
|
23330 | } else {
|
23331 | start = offsets.start;
|
23332 | end = offsets.end;
|
23333 | }
|
23334 |
|
23335 | range.moveToElementText(node);
|
23336 | range.moveStart('character', start);
|
23337 | range.setEndPoint('EndToStart', range);
|
23338 | range.moveEnd('character', end - start);
|
23339 | range.select();
|
23340 | }
|
23341 |
|
23342 |
|
23343 |
|
23344 |
|
23345 |
|
23346 |
|
23347 |
|
23348 |
|
23349 |
|
23350 |
|
23351 |
|
23352 |
|
23353 |
|
23354 | function setModernOffsets(node, offsets) {
|
23355 | if (!window.getSelection) {
|
23356 | return;
|
23357 | }
|
23358 |
|
23359 | var selection = window.getSelection();
|
23360 | var length = node[getTextContentAccessor()].length;
|
23361 | var start = Math.min(offsets.start, length);
|
23362 | var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
|
23363 |
|
23364 |
|
23365 |
|
23366 | if (!selection.extend && start > end) {
|
23367 | var temp = end;
|
23368 | end = start;
|
23369 | start = temp;
|
23370 | }
|
23371 |
|
23372 | var startMarker = getNodeForCharacterOffset(node, start);
|
23373 | var endMarker = getNodeForCharacterOffset(node, end);
|
23374 |
|
23375 | if (startMarker && endMarker) {
|
23376 | var range = document.createRange();
|
23377 | range.setStart(startMarker.node, startMarker.offset);
|
23378 | selection.removeAllRanges();
|
23379 |
|
23380 | if (start > end) {
|
23381 | selection.addRange(range);
|
23382 | selection.extend(endMarker.node, endMarker.offset);
|
23383 | } else {
|
23384 | range.setEnd(endMarker.node, endMarker.offset);
|
23385 | selection.addRange(range);
|
23386 | }
|
23387 | }
|
23388 | }
|
23389 |
|
23390 | var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
|
23391 |
|
23392 | var ReactDOMSelection = {
|
23393 | |
23394 |
|
23395 |
|
23396 | getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
|
23397 |
|
23398 | |
23399 |
|
23400 |
|
23401 |
|
23402 | setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
|
23403 | };
|
23404 |
|
23405 | module.exports = ReactDOMSelection;
|
23406 | },{"282":282,"283":283,"31":31}],211:[function(require,module,exports){
|
23407 | (function (process){
|
23408 |
|
23409 |
|
23410 |
|
23411 |
|
23412 |
|
23413 |
|
23414 |
|
23415 |
|
23416 |
|
23417 |
|
23418 |
|
23419 | 'use strict';
|
23420 |
|
23421 | var _assign = require(296);
|
23422 |
|
23423 | var DOMChildrenOperations = require(165);
|
23424 | var DOMLazyTree = require(166);
|
23425 | var ReactDOMComponentTree = require(199);
|
23426 | var ReactInstrumentation = require(228);
|
23427 |
|
23428 | var escapeTextContentForBrowser = require(272);
|
23429 | var invariant = require(45);
|
23430 | var validateDOMNesting = require(295);
|
23431 |
|
23432 |
|
23433 |
|
23434 |
|
23435 |
|
23436 |
|
23437 |
|
23438 |
|
23439 |
|
23440 |
|
23441 |
|
23442 |
|
23443 |
|
23444 |
|
23445 |
|
23446 |
|
23447 | var ReactDOMTextComponent = function (text) {
|
23448 |
|
23449 | this._currentElement = text;
|
23450 | this._stringText = '' + text;
|
23451 |
|
23452 | this._nativeNode = null;
|
23453 | this._nativeParent = null;
|
23454 |
|
23455 |
|
23456 | this._domID = null;
|
23457 | this._mountIndex = 0;
|
23458 | this._closingComment = null;
|
23459 | this._commentNodes = null;
|
23460 | };
|
23461 |
|
23462 | _assign(ReactDOMTextComponent.prototype, {
|
23463 |
|
23464 | |
23465 |
|
23466 |
|
23467 |
|
23468 |
|
23469 |
|
23470 |
|
23471 |
|
23472 | mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
|
23473 | if (process.env.NODE_ENV !== 'production') {
|
23474 | ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
|
23475 |
|
23476 | var parentInfo;
|
23477 | if (nativeParent != null) {
|
23478 | parentInfo = nativeParent._ancestorInfo;
|
23479 | } else if (nativeContainerInfo != null) {
|
23480 | parentInfo = nativeContainerInfo._ancestorInfo;
|
23481 | }
|
23482 | if (parentInfo) {
|
23483 |
|
23484 |
|
23485 | validateDOMNesting('#text', this, parentInfo);
|
23486 | }
|
23487 | }
|
23488 |
|
23489 | var domID = nativeContainerInfo._idCounter++;
|
23490 | var openingValue = ' react-text: ' + domID + ' ';
|
23491 | var closingValue = ' /react-text ';
|
23492 | this._domID = domID;
|
23493 | this._nativeParent = nativeParent;
|
23494 | if (transaction.useCreateElement) {
|
23495 | var ownerDocument = nativeContainerInfo._ownerDocument;
|
23496 | var openingComment = ownerDocument.createComment(openingValue);
|
23497 | var closingComment = ownerDocument.createComment(closingValue);
|
23498 | var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
|
23499 | DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
|
23500 | if (this._stringText) {
|
23501 | DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
|
23502 | }
|
23503 | DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
|
23504 | ReactDOMComponentTree.precacheNode(this, openingComment);
|
23505 | this._closingComment = closingComment;
|
23506 | return lazyTree;
|
23507 | } else {
|
23508 | var escapedText = escapeTextContentForBrowser(this._stringText);
|
23509 |
|
23510 | if (transaction.renderToStaticMarkup) {
|
23511 |
|
23512 |
|
23513 |
|
23514 | return escapedText;
|
23515 | }
|
23516 |
|
23517 | return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
|
23518 | }
|
23519 | },
|
23520 |
|
23521 | |
23522 |
|
23523 |
|
23524 |
|
23525 |
|
23526 |
|
23527 |
|
23528 | receiveComponent: function (nextText, transaction) {
|
23529 | if (nextText !== this._currentElement) {
|
23530 | this._currentElement = nextText;
|
23531 | var nextStringText = '' + nextText;
|
23532 | if (nextStringText !== this._stringText) {
|
23533 |
|
23534 |
|
23535 |
|
23536 | this._stringText = nextStringText;
|
23537 | var commentNodes = this.getNativeNode();
|
23538 | DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
|
23539 |
|
23540 | if (process.env.NODE_ENV !== 'production') {
|
23541 | ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
|
23542 | }
|
23543 | }
|
23544 | }
|
23545 | },
|
23546 |
|
23547 | getNativeNode: function () {
|
23548 | var nativeNode = this._commentNodes;
|
23549 | if (nativeNode) {
|
23550 | return nativeNode;
|
23551 | }
|
23552 | if (!this._closingComment) {
|
23553 | var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
|
23554 | var node = openingComment.nextSibling;
|
23555 | while (true) {
|
23556 | !(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : invariant(false) : void 0;
|
23557 | if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
|
23558 | this._closingComment = node;
|
23559 | break;
|
23560 | }
|
23561 | node = node.nextSibling;
|
23562 | }
|
23563 | }
|
23564 | nativeNode = [this._nativeNode, this._closingComment];
|
23565 | this._commentNodes = nativeNode;
|
23566 | return nativeNode;
|
23567 | },
|
23568 |
|
23569 | unmountComponent: function () {
|
23570 | this._closingComment = null;
|
23571 | this._commentNodes = null;
|
23572 | ReactDOMComponentTree.uncacheNode(this);
|
23573 | }
|
23574 |
|
23575 | });
|
23576 |
|
23577 | module.exports = ReactDOMTextComponent;
|
23578 | }).call(this,require(91))
|
23579 | },{"165":165,"166":166,"199":199,"228":228,"272":272,"295":295,"296":296,"45":45,"91":91}],212:[function(require,module,exports){
|
23580 | (function (process){
|
23581 |
|
23582 |
|
23583 |
|
23584 |
|
23585 |
|
23586 |
|
23587 |
|
23588 |
|
23589 |
|
23590 |
|
23591 |
|
23592 | 'use strict';
|
23593 |
|
23594 | var _assign = require(296);
|
23595 |
|
23596 | var DisabledInputUtils = require(172);
|
23597 | var DOMPropertyOperations = require(169);
|
23598 | var LinkedValueUtils = require(182);
|
23599 | var ReactDOMComponentTree = require(199);
|
23600 | var ReactUpdates = require(247);
|
23601 |
|
23602 | var invariant = require(45);
|
23603 | var warning = require(55);
|
23604 |
|
23605 | var didWarnValueLink = false;
|
23606 | var didWarnValueNull = false;
|
23607 | var didWarnValDefaultVal = false;
|
23608 |
|
23609 | function forceUpdateIfMounted() {
|
23610 | if (this._rootNodeID) {
|
23611 |
|
23612 | ReactDOMTextarea.updateWrapper(this);
|
23613 | }
|
23614 | }
|
23615 |
|
23616 | function warnIfValueIsNull(props) {
|
23617 | if (props != null && props.value === null && !didWarnValueNull) {
|
23618 | process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `textarea` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
|
23619 |
|
23620 | didWarnValueNull = true;
|
23621 | }
|
23622 | }
|
23623 |
|
23624 |
|
23625 |
|
23626 |
|
23627 |
|
23628 |
|
23629 |
|
23630 |
|
23631 |
|
23632 |
|
23633 |
|
23634 |
|
23635 |
|
23636 |
|
23637 |
|
23638 |
|
23639 | var ReactDOMTextarea = {
|
23640 | getNativeProps: function (inst, props) {
|
23641 | !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : void 0;
|
23642 |
|
23643 |
|
23644 |
|
23645 | var nativeProps = _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
|
23646 | defaultValue: undefined,
|
23647 | value: undefined,
|
23648 | children: inst._wrapperState.initialValue,
|
23649 | onChange: inst._wrapperState.onChange
|
23650 | });
|
23651 |
|
23652 | return nativeProps;
|
23653 | },
|
23654 |
|
23655 | mountWrapper: function (inst, props) {
|
23656 | if (process.env.NODE_ENV !== 'production') {
|
23657 | LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
|
23658 | if (props.valueLink !== undefined && !didWarnValueLink) {
|
23659 | process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
|
23660 | didWarnValueLink = true;
|
23661 | }
|
23662 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
|
23663 | process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
|
23664 | didWarnValDefaultVal = true;
|
23665 | }
|
23666 | warnIfValueIsNull(props);
|
23667 | }
|
23668 |
|
23669 | var defaultValue = props.defaultValue;
|
23670 |
|
23671 | var children = props.children;
|
23672 | if (children != null) {
|
23673 | if (process.env.NODE_ENV !== 'production') {
|
23674 | process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
|
23675 | }
|
23676 | !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : void 0;
|
23677 | if (Array.isArray(children)) {
|
23678 | !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : void 0;
|
23679 | children = children[0];
|
23680 | }
|
23681 |
|
23682 | defaultValue = '' + children;
|
23683 | }
|
23684 | if (defaultValue == null) {
|
23685 | defaultValue = '';
|
23686 | }
|
23687 | var value = LinkedValueUtils.getValue(props);
|
23688 | inst._wrapperState = {
|
23689 |
|
23690 |
|
23691 |
|
23692 |
|
23693 | initialValue: '' + (value != null ? value : defaultValue),
|
23694 | listeners: null,
|
23695 | onChange: _handleChange.bind(inst)
|
23696 | };
|
23697 | },
|
23698 |
|
23699 | updateWrapper: function (inst) {
|
23700 | var props = inst._currentElement.props;
|
23701 |
|
23702 | if (process.env.NODE_ENV !== 'production') {
|
23703 | warnIfValueIsNull(props);
|
23704 | }
|
23705 |
|
23706 | var value = LinkedValueUtils.getValue(props);
|
23707 | if (value != null) {
|
23708 |
|
23709 |
|
23710 | DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
|
23711 | }
|
23712 | }
|
23713 | };
|
23714 |
|
23715 | function _handleChange(event) {
|
23716 | var props = this._currentElement.props;
|
23717 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
23718 | ReactUpdates.asap(forceUpdateIfMounted, this);
|
23719 | return returnValue;
|
23720 | }
|
23721 |
|
23722 | module.exports = ReactDOMTextarea;
|
23723 | }).call(this,require(91))
|
23724 | },{"169":169,"172":172,"182":182,"199":199,"247":247,"296":296,"45":45,"55":55,"91":91}],213:[function(require,module,exports){
|
23725 | (function (process){
|
23726 |
|
23727 |
|
23728 |
|
23729 |
|
23730 |
|
23731 |
|
23732 |
|
23733 |
|
23734 |
|
23735 |
|
23736 |
|
23737 | 'use strict';
|
23738 |
|
23739 | var invariant = require(45);
|
23740 |
|
23741 |
|
23742 |
|
23743 |
|
23744 |
|
23745 | function getLowestCommonAncestor(instA, instB) {
|
23746 | !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
|
23747 | !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
|
23748 |
|
23749 | var depthA = 0;
|
23750 | for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
|
23751 | depthA++;
|
23752 | }
|
23753 | var depthB = 0;
|
23754 | for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
|
23755 | depthB++;
|
23756 | }
|
23757 |
|
23758 |
|
23759 | while (depthA - depthB > 0) {
|
23760 | instA = instA._nativeParent;
|
23761 | depthA--;
|
23762 | }
|
23763 |
|
23764 |
|
23765 | while (depthB - depthA > 0) {
|
23766 | instB = instB._nativeParent;
|
23767 | depthB--;
|
23768 | }
|
23769 |
|
23770 |
|
23771 | var depth = depthA;
|
23772 | while (depth--) {
|
23773 | if (instA === instB) {
|
23774 | return instA;
|
23775 | }
|
23776 | instA = instA._nativeParent;
|
23777 | instB = instB._nativeParent;
|
23778 | }
|
23779 | return null;
|
23780 | }
|
23781 |
|
23782 |
|
23783 |
|
23784 |
|
23785 | function isAncestor(instA, instB) {
|
23786 | !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
|
23787 | !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
|
23788 |
|
23789 | while (instB) {
|
23790 | if (instB === instA) {
|
23791 | return true;
|
23792 | }
|
23793 | instB = instB._nativeParent;
|
23794 | }
|
23795 | return false;
|
23796 | }
|
23797 |
|
23798 |
|
23799 |
|
23800 |
|
23801 | function getParentInstance(inst) {
|
23802 | !('_nativeNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;
|
23803 |
|
23804 | return inst._nativeParent;
|
23805 | }
|
23806 |
|
23807 |
|
23808 |
|
23809 |
|
23810 | function traverseTwoPhase(inst, fn, arg) {
|
23811 | var path = [];
|
23812 | while (inst) {
|
23813 | path.push(inst);
|
23814 | inst = inst._nativeParent;
|
23815 | }
|
23816 | var i;
|
23817 | for (i = path.length; i-- > 0;) {
|
23818 | fn(path[i], false, arg);
|
23819 | }
|
23820 | for (i = 0; i < path.length; i++) {
|
23821 | fn(path[i], true, arg);
|
23822 | }
|
23823 | }
|
23824 |
|
23825 |
|
23826 |
|
23827 |
|
23828 |
|
23829 |
|
23830 |
|
23831 |
|
23832 | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
|
23833 | var common = from && to ? getLowestCommonAncestor(from, to) : null;
|
23834 | var pathFrom = [];
|
23835 | while (from && from !== common) {
|
23836 | pathFrom.push(from);
|
23837 | from = from._nativeParent;
|
23838 | }
|
23839 | var pathTo = [];
|
23840 | while (to && to !== common) {
|
23841 | pathTo.push(to);
|
23842 | to = to._nativeParent;
|
23843 | }
|
23844 | var i;
|
23845 | for (i = 0; i < pathFrom.length; i++) {
|
23846 | fn(pathFrom[i], true, argFrom);
|
23847 | }
|
23848 | for (i = pathTo.length; i-- > 0;) {
|
23849 | fn(pathTo[i], false, argTo);
|
23850 | }
|
23851 | }
|
23852 |
|
23853 | module.exports = {
|
23854 | isAncestor: isAncestor,
|
23855 | getLowestCommonAncestor: getLowestCommonAncestor,
|
23856 | getParentInstance: getParentInstance,
|
23857 | traverseTwoPhase: traverseTwoPhase,
|
23858 | traverseEnterLeave: traverseEnterLeave
|
23859 | };
|
23860 | }).call(this,require(91))
|
23861 | },{"45":45,"91":91}],214:[function(require,module,exports){
|
23862 | (function (process){
|
23863 |
|
23864 |
|
23865 |
|
23866 |
|
23867 |
|
23868 |
|
23869 |
|
23870 |
|
23871 |
|
23872 |
|
23873 |
|
23874 | 'use strict';
|
23875 |
|
23876 | var DOMProperty = require(168);
|
23877 | var EventPluginRegistry = require(176);
|
23878 |
|
23879 | var warning = require(55);
|
23880 |
|
23881 | if (process.env.NODE_ENV !== 'production') {
|
23882 | var reactProps = {
|
23883 | children: true,
|
23884 | dangerouslySetInnerHTML: true,
|
23885 | key: true,
|
23886 | ref: true
|
23887 | };
|
23888 | var warnedProperties = {};
|
23889 |
|
23890 | var warnUnknownProperty = function (name) {
|
23891 | if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
|
23892 | return;
|
23893 | }
|
23894 | if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
|
23895 | return;
|
23896 | }
|
23897 |
|
23898 | warnedProperties[name] = true;
|
23899 | var lowerCasedName = name.toLowerCase();
|
23900 |
|
23901 |
|
23902 | var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
|
23903 |
|
23904 |
|
23905 |
|
23906 | process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : void 0;
|
23907 |
|
23908 | var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
|
23909 |
|
23910 | process.env.NODE_ENV !== 'production' ? warning(registrationName == null, 'Unknown event handler property %s. Did you mean `%s`?', name, registrationName) : void 0;
|
23911 | };
|
23912 | }
|
23913 |
|
23914 | var ReactDOMUnknownPropertyDevtool = {
|
23915 | onCreateMarkupForProperty: function (name, value) {
|
23916 | warnUnknownProperty(name);
|
23917 | },
|
23918 | onSetValueForProperty: function (node, name, value) {
|
23919 | warnUnknownProperty(name);
|
23920 | },
|
23921 | onDeleteValueForProperty: function (node, name) {
|
23922 | warnUnknownProperty(name);
|
23923 | }
|
23924 | };
|
23925 |
|
23926 | module.exports = ReactDOMUnknownPropertyDevtool;
|
23927 | }).call(this,require(91))
|
23928 | },{"168":168,"176":176,"55":55,"91":91}],215:[function(require,module,exports){
|
23929 | (function (process){
|
23930 |
|
23931 |
|
23932 |
|
23933 |
|
23934 |
|
23935 |
|
23936 |
|
23937 |
|
23938 |
|
23939 |
|
23940 |
|
23941 | 'use strict';
|
23942 |
|
23943 | var ExecutionEnvironment = require(31);
|
23944 |
|
23945 | var performanceNow = require(53);
|
23946 | var warning = require(55);
|
23947 |
|
23948 | var eventHandlers = [];
|
23949 | var handlerDoesThrowForEvent = {};
|
23950 |
|
23951 | function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
|
23952 | if (process.env.NODE_ENV !== 'production') {
|
23953 | eventHandlers.forEach(function (handler) {
|
23954 | try {
|
23955 | if (handler[handlerFunctionName]) {
|
23956 | handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
|
23957 | }
|
23958 | } catch (e) {
|
23959 | process.env.NODE_ENV !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
|
23960 | handlerDoesThrowForEvent[handlerFunctionName] = true;
|
23961 | }
|
23962 | });
|
23963 | }
|
23964 | }
|
23965 |
|
23966 | var isProfiling = false;
|
23967 | var flushHistory = [];
|
23968 | var currentFlushNesting = 0;
|
23969 | var currentFlushMeasurements = null;
|
23970 | var currentFlushStartTime = null;
|
23971 | var currentTimerDebugID = null;
|
23972 | var currentTimerStartTime = null;
|
23973 | var currentTimerType = null;
|
23974 |
|
23975 | function clearHistory() {
|
23976 | ReactComponentTreeDevtool.purgeUnmountedComponents();
|
23977 | ReactNativeOperationHistoryDevtool.clearHistory();
|
23978 | }
|
23979 |
|
23980 | function getTreeSnapshot(registeredIDs) {
|
23981 | return registeredIDs.reduce(function (tree, id) {
|
23982 | var ownerID = ReactComponentTreeDevtool.getOwnerID(id);
|
23983 | var parentID = ReactComponentTreeDevtool.getParentID(id);
|
23984 | tree[id] = {
|
23985 | displayName: ReactComponentTreeDevtool.getDisplayName(id),
|
23986 | text: ReactComponentTreeDevtool.getText(id),
|
23987 | updateCount: ReactComponentTreeDevtool.getUpdateCount(id),
|
23988 | childIDs: ReactComponentTreeDevtool.getChildIDs(id),
|
23989 |
|
23990 | ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),
|
23991 | parentID: parentID
|
23992 | };
|
23993 | return tree;
|
23994 | }, {});
|
23995 | }
|
23996 |
|
23997 | function resetMeasurements() {
|
23998 | if (process.env.NODE_ENV !== 'production') {
|
23999 | var previousStartTime = currentFlushStartTime;
|
24000 | var previousMeasurements = currentFlushMeasurements || [];
|
24001 | var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
|
24002 |
|
24003 | if (!isProfiling || currentFlushNesting === 0) {
|
24004 | currentFlushStartTime = null;
|
24005 | currentFlushMeasurements = null;
|
24006 | clearHistory();
|
24007 | return;
|
24008 | }
|
24009 |
|
24010 | if (previousMeasurements.length || previousOperations.length) {
|
24011 | var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
|
24012 | flushHistory.push({
|
24013 | duration: performanceNow() - previousStartTime,
|
24014 | measurements: previousMeasurements || [],
|
24015 | operations: previousOperations || [],
|
24016 | treeSnapshot: getTreeSnapshot(registeredIDs)
|
24017 | });
|
24018 | }
|
24019 |
|
24020 | clearHistory();
|
24021 | currentFlushStartTime = performanceNow();
|
24022 | currentFlushMeasurements = [];
|
24023 | }
|
24024 | }
|
24025 |
|
24026 | function checkDebugID(debugID) {
|
24027 | process.env.NODE_ENV !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0;
|
24028 | }
|
24029 |
|
24030 | var ReactDebugTool = {
|
24031 | addDevtool: function (devtool) {
|
24032 | eventHandlers.push(devtool);
|
24033 | },
|
24034 | removeDevtool: function (devtool) {
|
24035 | for (var i = 0; i < eventHandlers.length; i++) {
|
24036 | if (eventHandlers[i] === devtool) {
|
24037 | eventHandlers.splice(i, 1);
|
24038 | i--;
|
24039 | }
|
24040 | }
|
24041 | },
|
24042 | beginProfiling: function () {
|
24043 | if (process.env.NODE_ENV !== 'production') {
|
24044 | if (isProfiling) {
|
24045 | return;
|
24046 | }
|
24047 |
|
24048 | isProfiling = true;
|
24049 | flushHistory.length = 0;
|
24050 | resetMeasurements();
|
24051 | }
|
24052 | },
|
24053 | endProfiling: function () {
|
24054 | if (process.env.NODE_ENV !== 'production') {
|
24055 | if (!isProfiling) {
|
24056 | return;
|
24057 | }
|
24058 |
|
24059 | isProfiling = false;
|
24060 | resetMeasurements();
|
24061 | }
|
24062 | },
|
24063 | getFlushHistory: function () {
|
24064 | if (process.env.NODE_ENV !== 'production') {
|
24065 | return flushHistory;
|
24066 | }
|
24067 | },
|
24068 | onBeginFlush: function () {
|
24069 | if (process.env.NODE_ENV !== 'production') {
|
24070 | currentFlushNesting++;
|
24071 | resetMeasurements();
|
24072 | }
|
24073 | emitEvent('onBeginFlush');
|
24074 | },
|
24075 | onEndFlush: function () {
|
24076 | if (process.env.NODE_ENV !== 'production') {
|
24077 | resetMeasurements();
|
24078 | currentFlushNesting--;
|
24079 | }
|
24080 | emitEvent('onEndFlush');
|
24081 | },
|
24082 | onBeginLifeCycleTimer: function (debugID, timerType) {
|
24083 | checkDebugID(debugID);
|
24084 | emitEvent('onBeginLifeCycleTimer', debugID, timerType);
|
24085 | if (process.env.NODE_ENV !== 'production') {
|
24086 | if (isProfiling && currentFlushNesting > 0) {
|
24087 | process.env.NODE_ENV !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
24088 | currentTimerStartTime = performanceNow();
|
24089 | currentTimerDebugID = debugID;
|
24090 | currentTimerType = timerType;
|
24091 | }
|
24092 | }
|
24093 | },
|
24094 | onEndLifeCycleTimer: function (debugID, timerType) {
|
24095 | checkDebugID(debugID);
|
24096 | if (process.env.NODE_ENV !== 'production') {
|
24097 | if (isProfiling && currentFlushNesting > 0) {
|
24098 | process.env.NODE_ENV !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
24099 | currentFlushMeasurements.push({
|
24100 | timerType: timerType,
|
24101 | instanceID: debugID,
|
24102 | duration: performanceNow() - currentTimerStartTime
|
24103 | });
|
24104 | currentTimerStartTime = null;
|
24105 | currentTimerDebugID = null;
|
24106 | currentTimerType = null;
|
24107 | }
|
24108 | }
|
24109 | emitEvent('onEndLifeCycleTimer', debugID, timerType);
|
24110 | },
|
24111 | onBeginReconcilerTimer: function (debugID, timerType) {
|
24112 | checkDebugID(debugID);
|
24113 | emitEvent('onBeginReconcilerTimer', debugID, timerType);
|
24114 | },
|
24115 | onEndReconcilerTimer: function (debugID, timerType) {
|
24116 | checkDebugID(debugID);
|
24117 | emitEvent('onEndReconcilerTimer', debugID, timerType);
|
24118 | },
|
24119 | onBeginProcessingChildContext: function () {
|
24120 | emitEvent('onBeginProcessingChildContext');
|
24121 | },
|
24122 | onEndProcessingChildContext: function () {
|
24123 | emitEvent('onEndProcessingChildContext');
|
24124 | },
|
24125 | onNativeOperation: function (debugID, type, payload) {
|
24126 | checkDebugID(debugID);
|
24127 | emitEvent('onNativeOperation', debugID, type, payload);
|
24128 | },
|
24129 | onSetState: function () {
|
24130 | emitEvent('onSetState');
|
24131 | },
|
24132 | onSetDisplayName: function (debugID, displayName) {
|
24133 | checkDebugID(debugID);
|
24134 | emitEvent('onSetDisplayName', debugID, displayName);
|
24135 | },
|
24136 | onSetChildren: function (debugID, childDebugIDs) {
|
24137 | checkDebugID(debugID);
|
24138 | emitEvent('onSetChildren', debugID, childDebugIDs);
|
24139 | },
|
24140 | onSetOwner: function (debugID, ownerDebugID) {
|
24141 | checkDebugID(debugID);
|
24142 | emitEvent('onSetOwner', debugID, ownerDebugID);
|
24143 | },
|
24144 | onSetText: function (debugID, text) {
|
24145 | checkDebugID(debugID);
|
24146 | emitEvent('onSetText', debugID, text);
|
24147 | },
|
24148 | onMountRootComponent: function (debugID) {
|
24149 | checkDebugID(debugID);
|
24150 | emitEvent('onMountRootComponent', debugID);
|
24151 | },
|
24152 | onMountComponent: function (debugID) {
|
24153 | checkDebugID(debugID);
|
24154 | emitEvent('onMountComponent', debugID);
|
24155 | },
|
24156 | onUpdateComponent: function (debugID) {
|
24157 | checkDebugID(debugID);
|
24158 | emitEvent('onUpdateComponent', debugID);
|
24159 | },
|
24160 | onUnmountComponent: function (debugID) {
|
24161 | checkDebugID(debugID);
|
24162 | emitEvent('onUnmountComponent', debugID);
|
24163 | }
|
24164 | };
|
24165 |
|
24166 | if (process.env.NODE_ENV !== 'production') {
|
24167 | var ReactInvalidSetStateWarningDevTool = require(229);
|
24168 | var ReactNativeOperationHistoryDevtool = require(235);
|
24169 | var ReactComponentTreeDevtool = require(192);
|
24170 | ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
|
24171 | ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
|
24172 | ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
|
24173 | var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
24174 | if (/[?&]react_perf\b/.test(url)) {
|
24175 | ReactDebugTool.beginProfiling();
|
24176 | }
|
24177 | }
|
24178 |
|
24179 | module.exports = ReactDebugTool;
|
24180 | }).call(this,require(91))
|
24181 | },{"192":192,"229":229,"235":235,"31":31,"53":53,"55":55,"91":91}],216:[function(require,module,exports){
|
24182 |
|
24183 |
|
24184 |
|
24185 |
|
24186 |
|
24187 |
|
24188 |
|
24189 |
|
24190 |
|
24191 |
|
24192 |
|
24193 | 'use strict';
|
24194 |
|
24195 | var _assign = require(296);
|
24196 |
|
24197 | var ReactUpdates = require(247);
|
24198 | var Transaction = require(265);
|
24199 |
|
24200 | var emptyFunction = require(37);
|
24201 |
|
24202 | var RESET_BATCHED_UPDATES = {
|
24203 | initialize: emptyFunction,
|
24204 | close: function () {
|
24205 | ReactDefaultBatchingStrategy.isBatchingUpdates = false;
|
24206 | }
|
24207 | };
|
24208 |
|
24209 | var FLUSH_BATCHED_UPDATES = {
|
24210 | initialize: emptyFunction,
|
24211 | close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
|
24212 | };
|
24213 |
|
24214 | var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
|
24215 |
|
24216 | function ReactDefaultBatchingStrategyTransaction() {
|
24217 | this.reinitializeTransaction();
|
24218 | }
|
24219 |
|
24220 | _assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
|
24221 | getTransactionWrappers: function () {
|
24222 | return TRANSACTION_WRAPPERS;
|
24223 | }
|
24224 | });
|
24225 |
|
24226 | var transaction = new ReactDefaultBatchingStrategyTransaction();
|
24227 |
|
24228 | var ReactDefaultBatchingStrategy = {
|
24229 | isBatchingUpdates: false,
|
24230 |
|
24231 | |
24232 |
|
24233 |
|
24234 |
|
24235 | batchedUpdates: function (callback, a, b, c, d, e) {
|
24236 | var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
|
24237 |
|
24238 | ReactDefaultBatchingStrategy.isBatchingUpdates = true;
|
24239 |
|
24240 |
|
24241 | if (alreadyBatchingUpdates) {
|
24242 | callback(a, b, c, d, e);
|
24243 | } else {
|
24244 | transaction.perform(callback, null, a, b, c, d, e);
|
24245 | }
|
24246 | }
|
24247 | };
|
24248 |
|
24249 | module.exports = ReactDefaultBatchingStrategy;
|
24250 | },{"247":247,"265":265,"296":296,"37":37}],217:[function(require,module,exports){
|
24251 |
|
24252 |
|
24253 |
|
24254 |
|
24255 |
|
24256 |
|
24257 |
|
24258 |
|
24259 |
|
24260 |
|
24261 |
|
24262 | 'use strict';
|
24263 |
|
24264 | var BeforeInputEventPlugin = require(160);
|
24265 | var ChangeEventPlugin = require(164);
|
24266 | var DefaultEventPluginOrder = require(171);
|
24267 | var EnterLeaveEventPlugin = require(173);
|
24268 | var HTMLDOMPropertyConfig = require(180);
|
24269 | var ReactComponentBrowserEnvironment = require(190);
|
24270 | var ReactDOMComponent = require(197);
|
24271 | var ReactDOMComponentTree = require(199);
|
24272 | var ReactDOMEmptyComponent = require(202);
|
24273 | var ReactDOMTreeTraversal = require(213);
|
24274 | var ReactDOMTextComponent = require(211);
|
24275 | var ReactDefaultBatchingStrategy = require(216);
|
24276 | var ReactEventListener = require(223);
|
24277 | var ReactInjection = require(225);
|
24278 | var ReactReconcileTransaction = require(242);
|
24279 | var SVGDOMPropertyConfig = require(249);
|
24280 | var SelectEventPlugin = require(250);
|
24281 | var SimpleEventPlugin = require(251);
|
24282 |
|
24283 | var alreadyInjected = false;
|
24284 |
|
24285 | function inject() {
|
24286 | if (alreadyInjected) {
|
24287 |
|
24288 |
|
24289 |
|
24290 | return;
|
24291 | }
|
24292 | alreadyInjected = true;
|
24293 |
|
24294 | ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
|
24295 |
|
24296 | |
24297 |
|
24298 |
|
24299 | ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
|
24300 | ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
|
24301 | ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
|
24302 |
|
24303 | |
24304 |
|
24305 |
|
24306 |
|
24307 | ReactInjection.EventPluginHub.injectEventPluginsByName({
|
24308 | SimpleEventPlugin: SimpleEventPlugin,
|
24309 | EnterLeaveEventPlugin: EnterLeaveEventPlugin,
|
24310 | ChangeEventPlugin: ChangeEventPlugin,
|
24311 | SelectEventPlugin: SelectEventPlugin,
|
24312 | BeforeInputEventPlugin: BeforeInputEventPlugin
|
24313 | });
|
24314 |
|
24315 | ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
|
24316 |
|
24317 | ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
|
24318 |
|
24319 | ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
|
24320 | ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
|
24321 |
|
24322 | ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
|
24323 | return new ReactDOMEmptyComponent(instantiate);
|
24324 | });
|
24325 |
|
24326 | ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
|
24327 | ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
24328 |
|
24329 | ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
|
24330 | }
|
24331 |
|
24332 | module.exports = {
|
24333 | inject: inject
|
24334 | };
|
24335 | },{"160":160,"164":164,"171":171,"173":173,"180":180,"190":190,"197":197,"199":199,"202":202,"211":211,"213":213,"216":216,"223":223,"225":225,"242":242,"249":249,"250":250,"251":251}],218:[function(require,module,exports){
|
24336 | (function (process){
|
24337 |
|
24338 |
|
24339 |
|
24340 |
|
24341 |
|
24342 |
|
24343 |
|
24344 |
|
24345 |
|
24346 |
|
24347 |
|
24348 | 'use strict';
|
24349 |
|
24350 | var _assign = require(296);
|
24351 |
|
24352 | var ReactCurrentOwner = require(194);
|
24353 |
|
24354 | var warning = require(55);
|
24355 | var canDefineProperty = require(269);
|
24356 |
|
24357 |
|
24358 |
|
24359 | var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
24360 |
|
24361 | var RESERVED_PROPS = {
|
24362 | key: true,
|
24363 | ref: true,
|
24364 | __self: true,
|
24365 | __source: true
|
24366 | };
|
24367 |
|
24368 | var specialPropKeyWarningShown, specialPropRefWarningShown;
|
24369 |
|
24370 |
|
24371 |
|
24372 |
|
24373 |
|
24374 |
|
24375 |
|
24376 |
|
24377 |
|
24378 |
|
24379 |
|
24380 |
|
24381 |
|
24382 |
|
24383 |
|
24384 |
|
24385 |
|
24386 |
|
24387 |
|
24388 |
|
24389 |
|
24390 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
24391 | var element = {
|
24392 |
|
24393 | $$typeof: REACT_ELEMENT_TYPE,
|
24394 |
|
24395 |
|
24396 | type: type,
|
24397 | key: key,
|
24398 | ref: ref,
|
24399 | props: props,
|
24400 |
|
24401 |
|
24402 | _owner: owner
|
24403 | };
|
24404 |
|
24405 | if (process.env.NODE_ENV !== 'production') {
|
24406 |
|
24407 |
|
24408 |
|
24409 |
|
24410 | element._store = {};
|
24411 |
|
24412 |
|
24413 |
|
24414 |
|
24415 |
|
24416 | if (canDefineProperty) {
|
24417 | Object.defineProperty(element._store, 'validated', {
|
24418 | configurable: false,
|
24419 | enumerable: false,
|
24420 | writable: true,
|
24421 | value: false
|
24422 | });
|
24423 |
|
24424 | Object.defineProperty(element, '_self', {
|
24425 | configurable: false,
|
24426 | enumerable: false,
|
24427 | writable: false,
|
24428 | value: self
|
24429 | });
|
24430 |
|
24431 |
|
24432 | Object.defineProperty(element, '_source', {
|
24433 | configurable: false,
|
24434 | enumerable: false,
|
24435 | writable: false,
|
24436 | value: source
|
24437 | });
|
24438 | } else {
|
24439 | element._store.validated = false;
|
24440 | element._self = self;
|
24441 | element._source = source;
|
24442 | }
|
24443 | if (Object.freeze) {
|
24444 | Object.freeze(element.props);
|
24445 | Object.freeze(element);
|
24446 | }
|
24447 | }
|
24448 |
|
24449 | return element;
|
24450 | };
|
24451 |
|
24452 |
|
24453 |
|
24454 |
|
24455 |
|
24456 | ReactElement.createElement = function (type, config, children) {
|
24457 | var propName;
|
24458 |
|
24459 |
|
24460 | var props = {};
|
24461 |
|
24462 | var key = null;
|
24463 | var ref = null;
|
24464 | var self = null;
|
24465 | var source = null;
|
24466 |
|
24467 | if (config != null) {
|
24468 | if (process.env.NODE_ENV !== 'production') {
|
24469 | process.env.NODE_ENV !== 'production' ? warning(
|
24470 |
|
24471 | config.__proto__ == null || config.__proto__ === Object.prototype,
|
24472 |
|
24473 | 'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
24474 | ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref;
|
24475 | key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key;
|
24476 | } else {
|
24477 | ref = config.ref === undefined ? null : config.ref;
|
24478 | key = config.key === undefined ? null : '' + config.key;
|
24479 | }
|
24480 | self = config.__self === undefined ? null : config.__self;
|
24481 | source = config.__source === undefined ? null : config.__source;
|
24482 |
|
24483 | for (propName in config) {
|
24484 | if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
24485 | props[propName] = config[propName];
|
24486 | }
|
24487 | }
|
24488 | }
|
24489 |
|
24490 |
|
24491 |
|
24492 | var childrenLength = arguments.length - 2;
|
24493 | if (childrenLength === 1) {
|
24494 | props.children = children;
|
24495 | } else if (childrenLength > 1) {
|
24496 | var childArray = Array(childrenLength);
|
24497 | for (var i = 0; i < childrenLength; i++) {
|
24498 | childArray[i] = arguments[i + 2];
|
24499 | }
|
24500 | props.children = childArray;
|
24501 | }
|
24502 |
|
24503 |
|
24504 | if (type && type.defaultProps) {
|
24505 | var defaultProps = type.defaultProps;
|
24506 | for (propName in defaultProps) {
|
24507 | if (props[propName] === undefined) {
|
24508 | props[propName] = defaultProps[propName];
|
24509 | }
|
24510 | }
|
24511 | }
|
24512 | if (process.env.NODE_ENV !== 'production') {
|
24513 |
|
24514 |
|
24515 | if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
|
24516 | if (!props.hasOwnProperty('key')) {
|
24517 | Object.defineProperty(props, 'key', {
|
24518 | get: function () {
|
24519 | if (!specialPropKeyWarningShown) {
|
24520 | specialPropKeyWarningShown = true;
|
24521 | process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
|
24522 | }
|
24523 | return undefined;
|
24524 | },
|
24525 | configurable: true
|
24526 | });
|
24527 | }
|
24528 | if (!props.hasOwnProperty('ref')) {
|
24529 | Object.defineProperty(props, 'ref', {
|
24530 | get: function () {
|
24531 | if (!specialPropRefWarningShown) {
|
24532 | specialPropRefWarningShown = true;
|
24533 | process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
|
24534 | }
|
24535 | return undefined;
|
24536 | },
|
24537 | configurable: true
|
24538 | });
|
24539 | }
|
24540 | }
|
24541 | }
|
24542 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
24543 | };
|
24544 |
|
24545 |
|
24546 |
|
24547 |
|
24548 |
|
24549 | ReactElement.createFactory = function (type) {
|
24550 | var factory = ReactElement.createElement.bind(null, type);
|
24551 |
|
24552 |
|
24553 |
|
24554 |
|
24555 |
|
24556 | factory.type = type;
|
24557 | return factory;
|
24558 | };
|
24559 |
|
24560 | ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
|
24561 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
24562 |
|
24563 | return newElement;
|
24564 | };
|
24565 |
|
24566 |
|
24567 |
|
24568 |
|
24569 |
|
24570 | ReactElement.cloneElement = function (element, config, children) {
|
24571 | var propName;
|
24572 |
|
24573 |
|
24574 | var props = _assign({}, element.props);
|
24575 |
|
24576 |
|
24577 | var key = element.key;
|
24578 | var ref = element.ref;
|
24579 |
|
24580 | var self = element._self;
|
24581 |
|
24582 |
|
24583 |
|
24584 | var source = element._source;
|
24585 |
|
24586 |
|
24587 | var owner = element._owner;
|
24588 |
|
24589 | if (config != null) {
|
24590 | if (process.env.NODE_ENV !== 'production') {
|
24591 | process.env.NODE_ENV !== 'production' ? warning(
|
24592 |
|
24593 | config.__proto__ == null || config.__proto__ === Object.prototype,
|
24594 |
|
24595 | 'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
24596 | }
|
24597 | if (config.ref !== undefined) {
|
24598 |
|
24599 | ref = config.ref;
|
24600 | owner = ReactCurrentOwner.current;
|
24601 | }
|
24602 | if (config.key !== undefined) {
|
24603 | key = '' + config.key;
|
24604 | }
|
24605 |
|
24606 | var defaultProps;
|
24607 | if (element.type && element.type.defaultProps) {
|
24608 | defaultProps = element.type.defaultProps;
|
24609 | }
|
24610 | for (propName in config) {
|
24611 | if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
24612 | if (config[propName] === undefined && defaultProps !== undefined) {
|
24613 |
|
24614 | props[propName] = defaultProps[propName];
|
24615 | } else {
|
24616 | props[propName] = config[propName];
|
24617 | }
|
24618 | }
|
24619 | }
|
24620 | }
|
24621 |
|
24622 |
|
24623 |
|
24624 | var childrenLength = arguments.length - 2;
|
24625 | if (childrenLength === 1) {
|
24626 | props.children = children;
|
24627 | } else if (childrenLength > 1) {
|
24628 | var childArray = Array(childrenLength);
|
24629 | for (var i = 0; i < childrenLength; i++) {
|
24630 | childArray[i] = arguments[i + 2];
|
24631 | }
|
24632 | props.children = childArray;
|
24633 | }
|
24634 |
|
24635 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
24636 | };
|
24637 |
|
24638 |
|
24639 |
|
24640 |
|
24641 |
|
24642 |
|
24643 |
|
24644 |
|
24645 | ReactElement.isValidElement = function (object) {
|
24646 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
24647 | };
|
24648 |
|
24649 | module.exports = ReactElement;
|
24650 | }).call(this,require(91))
|
24651 | },{"194":194,"269":269,"296":296,"55":55,"91":91}],219:[function(require,module,exports){
|
24652 | (function (process){
|
24653 |
|
24654 |
|
24655 |
|
24656 |
|
24657 |
|
24658 |
|
24659 |
|
24660 |
|
24661 |
|
24662 |
|
24663 |
|
24664 |
|
24665 |
|
24666 |
|
24667 |
|
24668 |
|
24669 |
|
24670 |
|
24671 | 'use strict';
|
24672 |
|
24673 | var ReactElement = require(218);
|
24674 | var ReactPropTypeLocations = require(240);
|
24675 | var ReactPropTypeLocationNames = require(239);
|
24676 | var ReactCurrentOwner = require(194);
|
24677 |
|
24678 | var canDefineProperty = require(269);
|
24679 | var getIteratorFn = require(280);
|
24680 | var invariant = require(45);
|
24681 | var warning = require(55);
|
24682 |
|
24683 | function getDeclarationErrorAddendum() {
|
24684 | if (ReactCurrentOwner.current) {
|
24685 | var name = ReactCurrentOwner.current.getName();
|
24686 | if (name) {
|
24687 | return ' Check the render method of `' + name + '`.';
|
24688 | }
|
24689 | }
|
24690 | return '';
|
24691 | }
|
24692 |
|
24693 |
|
24694 |
|
24695 |
|
24696 |
|
24697 |
|
24698 | var ownerHasKeyUseWarning = {};
|
24699 |
|
24700 | var loggedTypeFailures = {};
|
24701 |
|
24702 |
|
24703 |
|
24704 |
|
24705 |
|
24706 |
|
24707 |
|
24708 |
|
24709 |
|
24710 |
|
24711 |
|
24712 | function validateExplicitKey(element, parentType) {
|
24713 | if (!element._store || element._store.validated || element.key != null) {
|
24714 | return;
|
24715 | }
|
24716 | element._store.validated = true;
|
24717 |
|
24718 | var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
|
24719 | if (addenda === null) {
|
24720 |
|
24721 | return;
|
24722 | }
|
24723 | process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : void 0;
|
24724 | }
|
24725 |
|
24726 |
|
24727 |
|
24728 |
|
24729 |
|
24730 |
|
24731 |
|
24732 |
|
24733 |
|
24734 |
|
24735 |
|
24736 | function getAddendaForKeyUse(messageType, element, parentType) {
|
24737 | var addendum = getDeclarationErrorAddendum();
|
24738 | if (!addendum) {
|
24739 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
24740 | if (parentName) {
|
24741 | addendum = ' Check the top-level render call using <' + parentName + '>.';
|
24742 | }
|
24743 | }
|
24744 |
|
24745 | var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
|
24746 | if (memoizer[addendum]) {
|
24747 | return null;
|
24748 | }
|
24749 | memoizer[addendum] = true;
|
24750 |
|
24751 | var addenda = {
|
24752 | parentOrOwner: addendum,
|
24753 | url: ' See https://fb.me/react-warning-keys for more information.',
|
24754 | childOwner: null
|
24755 | };
|
24756 |
|
24757 |
|
24758 |
|
24759 |
|
24760 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
24761 |
|
24762 | addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
|
24763 | }
|
24764 |
|
24765 | return addenda;
|
24766 | }
|
24767 |
|
24768 |
|
24769 |
|
24770 |
|
24771 |
|
24772 |
|
24773 |
|
24774 |
|
24775 |
|
24776 |
|
24777 | function validateChildKeys(node, parentType) {
|
24778 | if (typeof node !== 'object') {
|
24779 | return;
|
24780 | }
|
24781 | if (Array.isArray(node)) {
|
24782 | for (var i = 0; i < node.length; i++) {
|
24783 | var child = node[i];
|
24784 | if (ReactElement.isValidElement(child)) {
|
24785 | validateExplicitKey(child, parentType);
|
24786 | }
|
24787 | }
|
24788 | } else if (ReactElement.isValidElement(node)) {
|
24789 |
|
24790 | if (node._store) {
|
24791 | node._store.validated = true;
|
24792 | }
|
24793 | } else if (node) {
|
24794 | var iteratorFn = getIteratorFn(node);
|
24795 |
|
24796 | if (iteratorFn) {
|
24797 | if (iteratorFn !== node.entries) {
|
24798 | var iterator = iteratorFn.call(node);
|
24799 | var step;
|
24800 | while (!(step = iterator.next()).done) {
|
24801 | if (ReactElement.isValidElement(step.value)) {
|
24802 | validateExplicitKey(step.value, parentType);
|
24803 | }
|
24804 | }
|
24805 | }
|
24806 | }
|
24807 | }
|
24808 | }
|
24809 |
|
24810 |
|
24811 |
|
24812 |
|
24813 |
|
24814 |
|
24815 |
|
24816 |
|
24817 |
|
24818 |
|
24819 | function checkPropTypes(componentName, propTypes, props, location) {
|
24820 | for (var propName in propTypes) {
|
24821 | if (propTypes.hasOwnProperty(propName)) {
|
24822 | var error;
|
24823 |
|
24824 |
|
24825 |
|
24826 | try {
|
24827 |
|
24828 |
|
24829 | !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;
|
24830 | error = propTypes[propName](props, propName, componentName, location);
|
24831 | } catch (ex) {
|
24832 | error = ex;
|
24833 | }
|
24834 | process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : void 0;
|
24835 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
24836 |
|
24837 |
|
24838 | loggedTypeFailures[error.message] = true;
|
24839 |
|
24840 | var addendum = getDeclarationErrorAddendum();
|
24841 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : void 0;
|
24842 | }
|
24843 | }
|
24844 | }
|
24845 | }
|
24846 |
|
24847 |
|
24848 |
|
24849 |
|
24850 |
|
24851 |
|
24852 |
|
24853 | function validatePropTypes(element) {
|
24854 | var componentClass = element.type;
|
24855 | if (typeof componentClass !== 'function') {
|
24856 | return;
|
24857 | }
|
24858 | var name = componentClass.displayName || componentClass.name;
|
24859 | if (componentClass.propTypes) {
|
24860 | checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
|
24861 | }
|
24862 | if (typeof componentClass.getDefaultProps === 'function') {
|
24863 | process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
24864 | }
|
24865 | }
|
24866 |
|
24867 | var ReactElementValidator = {
|
24868 |
|
24869 | createElement: function (type, props, children) {
|
24870 | var validType = typeof type === 'string' || typeof type === 'function';
|
24871 |
|
24872 |
|
24873 | process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0;
|
24874 |
|
24875 | var element = ReactElement.createElement.apply(this, arguments);
|
24876 |
|
24877 |
|
24878 |
|
24879 | if (element == null) {
|
24880 | return element;
|
24881 | }
|
24882 |
|
24883 |
|
24884 |
|
24885 |
|
24886 |
|
24887 |
|
24888 | if (validType) {
|
24889 | for (var i = 2; i < arguments.length; i++) {
|
24890 | validateChildKeys(arguments[i], type);
|
24891 | }
|
24892 | }
|
24893 |
|
24894 | validatePropTypes(element);
|
24895 |
|
24896 | return element;
|
24897 | },
|
24898 |
|
24899 | createFactory: function (type) {
|
24900 | var validatedFactory = ReactElementValidator.createElement.bind(null, type);
|
24901 |
|
24902 | validatedFactory.type = type;
|
24903 |
|
24904 | if (process.env.NODE_ENV !== 'production') {
|
24905 | if (canDefineProperty) {
|
24906 | Object.defineProperty(validatedFactory, 'type', {
|
24907 | enumerable: false,
|
24908 | get: function () {
|
24909 | process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
|
24910 | Object.defineProperty(this, 'type', {
|
24911 | value: type
|
24912 | });
|
24913 | return type;
|
24914 | }
|
24915 | });
|
24916 | }
|
24917 | }
|
24918 |
|
24919 | return validatedFactory;
|
24920 | },
|
24921 |
|
24922 | cloneElement: function (element, props, children) {
|
24923 | var newElement = ReactElement.cloneElement.apply(this, arguments);
|
24924 | for (var i = 2; i < arguments.length; i++) {
|
24925 | validateChildKeys(arguments[i], newElement.type);
|
24926 | }
|
24927 | validatePropTypes(newElement);
|
24928 | return newElement;
|
24929 | }
|
24930 |
|
24931 | };
|
24932 |
|
24933 | module.exports = ReactElementValidator;
|
24934 | }).call(this,require(91))
|
24935 | },{"194":194,"218":218,"239":239,"240":240,"269":269,"280":280,"45":45,"55":55,"91":91}],220:[function(require,module,exports){
|
24936 |
|
24937 |
|
24938 |
|
24939 |
|
24940 |
|
24941 |
|
24942 |
|
24943 |
|
24944 |
|
24945 |
|
24946 |
|
24947 | 'use strict';
|
24948 |
|
24949 | var emptyComponentFactory;
|
24950 |
|
24951 | var ReactEmptyComponentInjection = {
|
24952 | injectEmptyComponentFactory: function (factory) {
|
24953 | emptyComponentFactory = factory;
|
24954 | }
|
24955 | };
|
24956 |
|
24957 | var ReactEmptyComponent = {
|
24958 | create: function (instantiate) {
|
24959 | return emptyComponentFactory(instantiate);
|
24960 | }
|
24961 | };
|
24962 |
|
24963 | ReactEmptyComponent.injection = ReactEmptyComponentInjection;
|
24964 |
|
24965 | module.exports = ReactEmptyComponent;
|
24966 | },{}],221:[function(require,module,exports){
|
24967 | (function (process){
|
24968 |
|
24969 |
|
24970 |
|
24971 |
|
24972 |
|
24973 |
|
24974 |
|
24975 |
|
24976 |
|
24977 |
|
24978 |
|
24979 | 'use strict';
|
24980 |
|
24981 | var caughtError = null;
|
24982 |
|
24983 |
|
24984 |
|
24985 |
|
24986 |
|
24987 |
|
24988 |
|
24989 |
|
24990 |
|
24991 | function invokeGuardedCallback(name, func, a, b) {
|
24992 | try {
|
24993 | return func(a, b);
|
24994 | } catch (x) {
|
24995 | if (caughtError === null) {
|
24996 | caughtError = x;
|
24997 | }
|
24998 | return undefined;
|
24999 | }
|
25000 | }
|
25001 |
|
25002 | var ReactErrorUtils = {
|
25003 | invokeGuardedCallback: invokeGuardedCallback,
|
25004 |
|
25005 | |
25006 |
|
25007 |
|
25008 |
|
25009 | invokeGuardedCallbackWithCatch: invokeGuardedCallback,
|
25010 |
|
25011 | |
25012 |
|
25013 |
|
25014 |
|
25015 | rethrowCaughtError: function () {
|
25016 | if (caughtError) {
|
25017 | var error = caughtError;
|
25018 | caughtError = null;
|
25019 | throw error;
|
25020 | }
|
25021 | }
|
25022 | };
|
25023 |
|
25024 | if (process.env.NODE_ENV !== 'production') {
|
25025 | |
25026 |
|
25027 |
|
25028 |
|
25029 | if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
|
25030 | var fakeNode = document.createElement('react');
|
25031 | ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
|
25032 | var boundFunc = func.bind(null, a, b);
|
25033 | var evtType = 'react-' + name;
|
25034 | fakeNode.addEventListener(evtType, boundFunc, false);
|
25035 | var evt = document.createEvent('Event');
|
25036 | evt.initEvent(evtType, false, false);
|
25037 | fakeNode.dispatchEvent(evt);
|
25038 | fakeNode.removeEventListener(evtType, boundFunc, false);
|
25039 | };
|
25040 | }
|
25041 | }
|
25042 |
|
25043 | module.exports = ReactErrorUtils;
|
25044 | }).call(this,require(91))
|
25045 | },{"91":91}],222:[function(require,module,exports){
|
25046 |
|
25047 |
|
25048 |
|
25049 |
|
25050 |
|
25051 |
|
25052 |
|
25053 |
|
25054 |
|
25055 |
|
25056 |
|
25057 | 'use strict';
|
25058 |
|
25059 | var EventPluginHub = require(175);
|
25060 |
|
25061 | function runEventQueueInBatch(events) {
|
25062 | EventPluginHub.enqueueEvents(events);
|
25063 | EventPluginHub.processEventQueue(false);
|
25064 | }
|
25065 |
|
25066 | var ReactEventEmitterMixin = {
|
25067 |
|
25068 | |
25069 |
|
25070 |
|
25071 |
|
25072 | handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
25073 | var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
25074 | runEventQueueInBatch(events);
|
25075 | }
|
25076 | };
|
25077 |
|
25078 | module.exports = ReactEventEmitterMixin;
|
25079 | },{"175":175}],223:[function(require,module,exports){
|
25080 |
|
25081 |
|
25082 |
|
25083 |
|
25084 |
|
25085 |
|
25086 |
|
25087 |
|
25088 |
|
25089 |
|
25090 |
|
25091 | 'use strict';
|
25092 |
|
25093 | var _assign = require(296);
|
25094 |
|
25095 | var EventListener = require(30);
|
25096 | var ExecutionEnvironment = require(31);
|
25097 | var PooledClass = require(183);
|
25098 | var ReactDOMComponentTree = require(199);
|
25099 | var ReactUpdates = require(247);
|
25100 |
|
25101 | var getEventTarget = require(279);
|
25102 | var getUnboundedScrollPosition = require(42);
|
25103 |
|
25104 |
|
25105 |
|
25106 |
|
25107 |
|
25108 |
|
25109 | function findParent(inst) {
|
25110 |
|
25111 |
|
25112 |
|
25113 | while (inst._nativeParent) {
|
25114 | inst = inst._nativeParent;
|
25115 | }
|
25116 | var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
|
25117 | var container = rootNode.parentNode;
|
25118 | return ReactDOMComponentTree.getClosestInstanceFromNode(container);
|
25119 | }
|
25120 |
|
25121 |
|
25122 | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
|
25123 | this.topLevelType = topLevelType;
|
25124 | this.nativeEvent = nativeEvent;
|
25125 | this.ancestors = [];
|
25126 | }
|
25127 | _assign(TopLevelCallbackBookKeeping.prototype, {
|
25128 | destructor: function () {
|
25129 | this.topLevelType = null;
|
25130 | this.nativeEvent = null;
|
25131 | this.ancestors.length = 0;
|
25132 | }
|
25133 | });
|
25134 | PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
|
25135 |
|
25136 | function handleTopLevelImpl(bookKeeping) {
|
25137 | var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
|
25138 | var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
|
25139 |
|
25140 |
|
25141 |
|
25142 |
|
25143 |
|
25144 | var ancestor = targetInst;
|
25145 | do {
|
25146 | bookKeeping.ancestors.push(ancestor);
|
25147 | ancestor = ancestor && findParent(ancestor);
|
25148 | } while (ancestor);
|
25149 |
|
25150 | for (var i = 0; i < bookKeeping.ancestors.length; i++) {
|
25151 | targetInst = bookKeeping.ancestors[i];
|
25152 | ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
25153 | }
|
25154 | }
|
25155 |
|
25156 | function scrollValueMonitor(cb) {
|
25157 | var scrollPosition = getUnboundedScrollPosition(window);
|
25158 | cb(scrollPosition);
|
25159 | }
|
25160 |
|
25161 | var ReactEventListener = {
|
25162 | _enabled: true,
|
25163 | _handleTopLevel: null,
|
25164 |
|
25165 | WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
|
25166 |
|
25167 | setHandleTopLevel: function (handleTopLevel) {
|
25168 | ReactEventListener._handleTopLevel = handleTopLevel;
|
25169 | },
|
25170 |
|
25171 | setEnabled: function (enabled) {
|
25172 | ReactEventListener._enabled = !!enabled;
|
25173 | },
|
25174 |
|
25175 | isEnabled: function () {
|
25176 | return ReactEventListener._enabled;
|
25177 | },
|
25178 |
|
25179 | |
25180 |
|
25181 |
|
25182 |
|
25183 |
|
25184 |
|
25185 |
|
25186 |
|
25187 |
|
25188 |
|
25189 | trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
25190 | var element = handle;
|
25191 | if (!element) {
|
25192 | return null;
|
25193 | }
|
25194 | return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
25195 | },
|
25196 |
|
25197 | |
25198 |
|
25199 |
|
25200 |
|
25201 |
|
25202 |
|
25203 |
|
25204 |
|
25205 |
|
25206 |
|
25207 | trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
25208 | var element = handle;
|
25209 | if (!element) {
|
25210 | return null;
|
25211 | }
|
25212 | return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
25213 | },
|
25214 |
|
25215 | monitorScrollValue: function (refresh) {
|
25216 | var callback = scrollValueMonitor.bind(null, refresh);
|
25217 | EventListener.listen(window, 'scroll', callback);
|
25218 | },
|
25219 |
|
25220 | dispatchEvent: function (topLevelType, nativeEvent) {
|
25221 | if (!ReactEventListener._enabled) {
|
25222 | return;
|
25223 | }
|
25224 |
|
25225 | var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
|
25226 | try {
|
25227 |
|
25228 |
|
25229 | ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
|
25230 | } finally {
|
25231 | TopLevelCallbackBookKeeping.release(bookKeeping);
|
25232 | }
|
25233 | }
|
25234 | };
|
25235 |
|
25236 | module.exports = ReactEventListener;
|
25237 | },{"183":183,"199":199,"247":247,"279":279,"296":296,"30":30,"31":31,"42":42}],224:[function(require,module,exports){
|
25238 |
|
25239 |
|
25240 |
|
25241 |
|
25242 |
|
25243 |
|
25244 |
|
25245 |
|
25246 |
|
25247 |
|
25248 |
|
25249 | 'use strict';
|
25250 |
|
25251 | var ReactFeatureFlags = {
|
25252 |
|
25253 |
|
25254 |
|
25255 | logTopLevelRenders: false
|
25256 | };
|
25257 |
|
25258 | module.exports = ReactFeatureFlags;
|
25259 | },{}],225:[function(require,module,exports){
|
25260 |
|
25261 |
|
25262 |
|
25263 |
|
25264 |
|
25265 |
|
25266 |
|
25267 |
|
25268 |
|
25269 |
|
25270 |
|
25271 | 'use strict';
|
25272 |
|
25273 | var DOMProperty = require(168);
|
25274 | var EventPluginHub = require(175);
|
25275 | var EventPluginUtils = require(177);
|
25276 | var ReactComponentEnvironment = require(191);
|
25277 | var ReactClass = require(188);
|
25278 | var ReactEmptyComponent = require(220);
|
25279 | var ReactBrowserEventEmitter = require(185);
|
25280 | var ReactNativeComponent = require(234);
|
25281 | var ReactUpdates = require(247);
|
25282 |
|
25283 | var ReactInjection = {
|
25284 | Component: ReactComponentEnvironment.injection,
|
25285 | Class: ReactClass.injection,
|
25286 | DOMProperty: DOMProperty.injection,
|
25287 | EmptyComponent: ReactEmptyComponent.injection,
|
25288 | EventPluginHub: EventPluginHub.injection,
|
25289 | EventPluginUtils: EventPluginUtils.injection,
|
25290 | EventEmitter: ReactBrowserEventEmitter.injection,
|
25291 | NativeComponent: ReactNativeComponent.injection,
|
25292 | Updates: ReactUpdates.injection
|
25293 | };
|
25294 |
|
25295 | module.exports = ReactInjection;
|
25296 | },{"168":168,"175":175,"177":177,"185":185,"188":188,"191":191,"220":220,"234":234,"247":247}],226:[function(require,module,exports){
|
25297 |
|
25298 |
|
25299 |
|
25300 |
|
25301 |
|
25302 |
|
25303 |
|
25304 |
|
25305 |
|
25306 |
|
25307 |
|
25308 | 'use strict';
|
25309 |
|
25310 | var ReactDOMSelection = require(210);
|
25311 |
|
25312 | var containsNode = require(34);
|
25313 | var focusNode = require(39);
|
25314 | var getActiveElement = require(40);
|
25315 |
|
25316 | function isInDocument(node) {
|
25317 | return containsNode(document.documentElement, node);
|
25318 | }
|
25319 |
|
25320 |
|
25321 |
|
25322 |
|
25323 |
|
25324 |
|
25325 |
|
25326 | var ReactInputSelection = {
|
25327 |
|
25328 | hasSelectionCapabilities: function (elem) {
|
25329 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
25330 | return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
|
25331 | },
|
25332 |
|
25333 | getSelectionInformation: function () {
|
25334 | var focusedElem = getActiveElement();
|
25335 | return {
|
25336 | focusedElem: focusedElem,
|
25337 | selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
|
25338 | };
|
25339 | },
|
25340 |
|
25341 | |
25342 |
|
25343 |
|
25344 |
|
25345 |
|
25346 | restoreSelection: function (priorSelectionInformation) {
|
25347 | var curFocusedElem = getActiveElement();
|
25348 | var priorFocusedElem = priorSelectionInformation.focusedElem;
|
25349 | var priorSelectionRange = priorSelectionInformation.selectionRange;
|
25350 | if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
|
25351 | if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
|
25352 | ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
|
25353 | }
|
25354 | focusNode(priorFocusedElem);
|
25355 | }
|
25356 | },
|
25357 |
|
25358 | |
25359 |
|
25360 |
|
25361 |
|
25362 |
|
25363 |
|
25364 | getSelection: function (input) {
|
25365 | var selection;
|
25366 |
|
25367 | if ('selectionStart' in input) {
|
25368 |
|
25369 | selection = {
|
25370 | start: input.selectionStart,
|
25371 | end: input.selectionEnd
|
25372 | };
|
25373 | } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
|
25374 |
|
25375 | var range = document.selection.createRange();
|
25376 |
|
25377 |
|
25378 | if (range.parentElement() === input) {
|
25379 | selection = {
|
25380 | start: -range.moveStart('character', -input.value.length),
|
25381 | end: -range.moveEnd('character', -input.value.length)
|
25382 | };
|
25383 | }
|
25384 | } else {
|
25385 |
|
25386 | selection = ReactDOMSelection.getOffsets(input);
|
25387 | }
|
25388 |
|
25389 | return selection || { start: 0, end: 0 };
|
25390 | },
|
25391 |
|
25392 | |
25393 |
|
25394 |
|
25395 |
|
25396 |
|
25397 |
|
25398 | setSelection: function (input, offsets) {
|
25399 | var start = offsets.start;
|
25400 | var end = offsets.end;
|
25401 | if (end === undefined) {
|
25402 | end = start;
|
25403 | }
|
25404 |
|
25405 | if ('selectionStart' in input) {
|
25406 | input.selectionStart = start;
|
25407 | input.selectionEnd = Math.min(end, input.value.length);
|
25408 | } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
|
25409 | var range = input.createTextRange();
|
25410 | range.collapse(true);
|
25411 | range.moveStart('character', start);
|
25412 | range.moveEnd('character', end - start);
|
25413 | range.select();
|
25414 | } else {
|
25415 | ReactDOMSelection.setOffsets(input, offsets);
|
25416 | }
|
25417 | }
|
25418 | };
|
25419 |
|
25420 | module.exports = ReactInputSelection;
|
25421 | },{"210":210,"34":34,"39":39,"40":40}],227:[function(require,module,exports){
|
25422 |
|
25423 |
|
25424 |
|
25425 |
|
25426 |
|
25427 |
|
25428 |
|
25429 |
|
25430 |
|
25431 |
|
25432 |
|
25433 | 'use strict';
|
25434 |
|
25435 |
|
25436 |
|
25437 |
|
25438 |
|
25439 |
|
25440 |
|
25441 |
|
25442 |
|
25443 |
|
25444 | var ReactInstanceMap = {
|
25445 |
|
25446 | |
25447 |
|
25448 |
|
25449 |
|
25450 |
|
25451 | remove: function (key) {
|
25452 | key._reactInternalInstance = undefined;
|
25453 | },
|
25454 |
|
25455 | get: function (key) {
|
25456 | return key._reactInternalInstance;
|
25457 | },
|
25458 |
|
25459 | has: function (key) {
|
25460 | return key._reactInternalInstance !== undefined;
|
25461 | },
|
25462 |
|
25463 | set: function (key, value) {
|
25464 | key._reactInternalInstance = value;
|
25465 | }
|
25466 |
|
25467 | };
|
25468 |
|
25469 | module.exports = ReactInstanceMap;
|
25470 | },{}],228:[function(require,module,exports){
|
25471 |
|
25472 |
|
25473 |
|
25474 |
|
25475 |
|
25476 |
|
25477 |
|
25478 |
|
25479 |
|
25480 |
|
25481 |
|
25482 | 'use strict';
|
25483 |
|
25484 | var ReactDebugTool = require(215);
|
25485 |
|
25486 | module.exports = { debugTool: ReactDebugTool };
|
25487 | },{"215":215}],229:[function(require,module,exports){
|
25488 | (function (process){
|
25489 |
|
25490 |
|
25491 |
|
25492 |
|
25493 |
|
25494 |
|
25495 |
|
25496 |
|
25497 |
|
25498 |
|
25499 |
|
25500 | 'use strict';
|
25501 |
|
25502 | var warning = require(55);
|
25503 |
|
25504 | if (process.env.NODE_ENV !== 'production') {
|
25505 | var processingChildContext = false;
|
25506 |
|
25507 | var warnInvalidSetState = function () {
|
25508 | process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
|
25509 | };
|
25510 | }
|
25511 |
|
25512 | var ReactInvalidSetStateWarningDevTool = {
|
25513 | onBeginProcessingChildContext: function () {
|
25514 | processingChildContext = true;
|
25515 | },
|
25516 | onEndProcessingChildContext: function () {
|
25517 | processingChildContext = false;
|
25518 | },
|
25519 | onSetState: function () {
|
25520 | warnInvalidSetState();
|
25521 | }
|
25522 | };
|
25523 |
|
25524 | module.exports = ReactInvalidSetStateWarningDevTool;
|
25525 | }).call(this,require(91))
|
25526 | },{"55":55,"91":91}],230:[function(require,module,exports){
|
25527 |
|
25528 |
|
25529 |
|
25530 |
|
25531 |
|
25532 |
|
25533 |
|
25534 |
|
25535 |
|
25536 |
|
25537 |
|
25538 | 'use strict';
|
25539 |
|
25540 | var adler32 = require(268);
|
25541 |
|
25542 | var TAG_END = /\/?>/;
|
25543 | var COMMENT_START = /^<\!\-\-/;
|
25544 |
|
25545 | var ReactMarkupChecksum = {
|
25546 | CHECKSUM_ATTR_NAME: 'data-react-checksum',
|
25547 |
|
25548 | |
25549 |
|
25550 |
|
25551 |
|
25552 | addChecksumToMarkup: function (markup) {
|
25553 | var checksum = adler32(markup);
|
25554 |
|
25555 |
|
25556 | if (COMMENT_START.test(markup)) {
|
25557 | return markup;
|
25558 | } else {
|
25559 | return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
|
25560 | }
|
25561 | },
|
25562 |
|
25563 | |
25564 |
|
25565 |
|
25566 |
|
25567 |
|
25568 | canReuseMarkup: function (markup, element) {
|
25569 | var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
25570 | existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
|
25571 | var markupChecksum = adler32(markup);
|
25572 | return markupChecksum === existingChecksum;
|
25573 | }
|
25574 | };
|
25575 |
|
25576 | module.exports = ReactMarkupChecksum;
|
25577 | },{"268":268}],231:[function(require,module,exports){
|
25578 | (function (process){
|
25579 |
|
25580 |
|
25581 |
|
25582 |
|
25583 |
|
25584 |
|
25585 |
|
25586 |
|
25587 |
|
25588 |
|
25589 |
|
25590 | 'use strict';
|
25591 |
|
25592 | var DOMLazyTree = require(166);
|
25593 | var DOMProperty = require(168);
|
25594 | var ReactBrowserEventEmitter = require(185);
|
25595 | var ReactCurrentOwner = require(194);
|
25596 | var ReactDOMComponentTree = require(199);
|
25597 | var ReactDOMContainerInfo = require(200);
|
25598 | var ReactDOMFeatureFlags = require(204);
|
25599 | var ReactElement = require(218);
|
25600 | var ReactFeatureFlags = require(224);
|
25601 | var ReactInstrumentation = require(228);
|
25602 | var ReactMarkupChecksum = require(230);
|
25603 | var ReactReconciler = require(243);
|
25604 | var ReactUpdateQueue = require(246);
|
25605 | var ReactUpdates = require(247);
|
25606 |
|
25607 | var emptyObject = require(38);
|
25608 | var instantiateReactComponent = require(285);
|
25609 | var invariant = require(45);
|
25610 | var setInnerHTML = require(291);
|
25611 | var shouldUpdateReactComponent = require(293);
|
25612 | var warning = require(55);
|
25613 |
|
25614 | var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
|
25615 | var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
|
25616 |
|
25617 | var ELEMENT_NODE_TYPE = 1;
|
25618 | var DOC_NODE_TYPE = 9;
|
25619 | var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
25620 |
|
25621 | var instancesByReactRootID = {};
|
25622 |
|
25623 |
|
25624 |
|
25625 |
|
25626 |
|
25627 |
|
25628 |
|
25629 | function firstDifferenceIndex(string1, string2) {
|
25630 | var minLen = Math.min(string1.length, string2.length);
|
25631 | for (var i = 0; i < minLen; i++) {
|
25632 | if (string1.charAt(i) !== string2.charAt(i)) {
|
25633 | return i;
|
25634 | }
|
25635 | }
|
25636 | return string1.length === string2.length ? -1 : minLen;
|
25637 | }
|
25638 |
|
25639 |
|
25640 |
|
25641 |
|
25642 |
|
25643 |
|
25644 | function getReactRootElementInContainer(container) {
|
25645 | if (!container) {
|
25646 | return null;
|
25647 | }
|
25648 |
|
25649 | if (container.nodeType === DOC_NODE_TYPE) {
|
25650 | return container.documentElement;
|
25651 | } else {
|
25652 | return container.firstChild;
|
25653 | }
|
25654 | }
|
25655 |
|
25656 | function internalGetID(node) {
|
25657 |
|
25658 |
|
25659 |
|
25660 | return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
|
25661 | }
|
25662 |
|
25663 |
|
25664 |
|
25665 |
|
25666 |
|
25667 |
|
25668 |
|
25669 |
|
25670 |
|
25671 | function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
|
25672 | var markerName;
|
25673 | if (ReactFeatureFlags.logTopLevelRenders) {
|
25674 | var wrappedElement = wrapperInstance._currentElement.props;
|
25675 | var type = wrappedElement.type;
|
25676 | markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
|
25677 | console.time(markerName);
|
25678 | }
|
25679 |
|
25680 | var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context);
|
25681 |
|
25682 | if (markerName) {
|
25683 | console.timeEnd(markerName);
|
25684 | }
|
25685 |
|
25686 | wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
|
25687 | ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
|
25688 | }
|
25689 |
|
25690 |
|
25691 |
|
25692 |
|
25693 |
|
25694 |
|
25695 |
|
25696 |
|
25697 | function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
|
25698 | var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
|
25699 |
|
25700 | !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
|
25701 | transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
|
25702 | ReactUpdates.ReactReconcileTransaction.release(transaction);
|
25703 | }
|
25704 |
|
25705 |
|
25706 |
|
25707 |
|
25708 |
|
25709 |
|
25710 |
|
25711 |
|
25712 |
|
25713 |
|
25714 | function unmountComponentFromNode(instance, container, safely) {
|
25715 | ReactReconciler.unmountComponent(instance, safely);
|
25716 |
|
25717 | if (container.nodeType === DOC_NODE_TYPE) {
|
25718 | container = container.documentElement;
|
25719 | }
|
25720 |
|
25721 |
|
25722 | while (container.lastChild) {
|
25723 | container.removeChild(container.lastChild);
|
25724 | }
|
25725 | }
|
25726 |
|
25727 |
|
25728 |
|
25729 |
|
25730 |
|
25731 |
|
25732 |
|
25733 |
|
25734 |
|
25735 |
|
25736 |
|
25737 | function hasNonRootReactChild(container) {
|
25738 | var rootEl = getReactRootElementInContainer(container);
|
25739 | if (rootEl) {
|
25740 | var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
|
25741 | return !!(inst && inst._nativeParent);
|
25742 | }
|
25743 | }
|
25744 |
|
25745 | function getNativeRootInstanceInContainer(container) {
|
25746 | var rootEl = getReactRootElementInContainer(container);
|
25747 | var prevNativeInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
|
25748 | return prevNativeInstance && !prevNativeInstance._nativeParent ? prevNativeInstance : null;
|
25749 | }
|
25750 |
|
25751 | function getTopLevelWrapperInContainer(container) {
|
25752 | var root = getNativeRootInstanceInContainer(container);
|
25753 | return root ? root._nativeContainerInfo._topLevelWrapper : null;
|
25754 | }
|
25755 |
|
25756 |
|
25757 |
|
25758 |
|
25759 |
|
25760 |
|
25761 | var topLevelRootCounter = 1;
|
25762 | var TopLevelWrapper = function () {
|
25763 | this.rootID = topLevelRootCounter++;
|
25764 | };
|
25765 | TopLevelWrapper.prototype.isReactComponent = {};
|
25766 | if (process.env.NODE_ENV !== 'production') {
|
25767 | TopLevelWrapper.displayName = 'TopLevelWrapper';
|
25768 | }
|
25769 | TopLevelWrapper.prototype.render = function () {
|
25770 |
|
25771 | return this.props;
|
25772 | };
|
25773 |
|
25774 |
|
25775 |
|
25776 |
|
25777 |
|
25778 |
|
25779 |
|
25780 |
|
25781 |
|
25782 |
|
25783 |
|
25784 |
|
25785 |
|
25786 |
|
25787 |
|
25788 |
|
25789 |
|
25790 |
|
25791 |
|
25792 | var ReactMount = {
|
25793 |
|
25794 | TopLevelWrapper: TopLevelWrapper,
|
25795 |
|
25796 | |
25797 |
|
25798 |
|
25799 | _instancesByReactRootID: instancesByReactRootID,
|
25800 |
|
25801 | |
25802 |
|
25803 |
|
25804 |
|
25805 |
|
25806 |
|
25807 |
|
25808 |
|
25809 | scrollMonitor: function (container, renderCallback) {
|
25810 | renderCallback();
|
25811 | },
|
25812 |
|
25813 | |
25814 |
|
25815 |
|
25816 |
|
25817 |
|
25818 |
|
25819 |
|
25820 | _updateRootComponent: function (prevComponent, nextElement, container, callback) {
|
25821 | ReactMount.scrollMonitor(container, function () {
|
25822 | ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
|
25823 | if (callback) {
|
25824 | ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
|
25825 | }
|
25826 | });
|
25827 |
|
25828 | return prevComponent;
|
25829 | },
|
25830 |
|
25831 | |
25832 |
|
25833 |
|
25834 |
|
25835 |
|
25836 |
|
25837 |
|
25838 |
|
25839 | _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
|
25840 | if (process.env.NODE_ENV !== 'production') {
|
25841 | ReactInstrumentation.debugTool.onBeginFlush();
|
25842 | }
|
25843 |
|
25844 |
|
25845 |
|
25846 |
|
25847 | process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
|
25848 |
|
25849 | !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : void 0;
|
25850 |
|
25851 | ReactBrowserEventEmitter.ensureScrollValueMonitoring();
|
25852 | var componentInstance = instantiateReactComponent(nextElement);
|
25853 |
|
25854 | if (process.env.NODE_ENV !== 'production') {
|
25855 |
|
25856 |
|
25857 | componentInstance._debugID = 0;
|
25858 | }
|
25859 |
|
25860 |
|
25861 |
|
25862 |
|
25863 |
|
25864 | ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
|
25865 |
|
25866 | var wrapperID = componentInstance._instance.rootID;
|
25867 | instancesByReactRootID[wrapperID] = componentInstance;
|
25868 |
|
25869 | if (process.env.NODE_ENV !== 'production') {
|
25870 |
|
25871 | ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);
|
25872 | ReactInstrumentation.debugTool.onEndFlush();
|
25873 | }
|
25874 |
|
25875 | return componentInstance;
|
25876 | },
|
25877 |
|
25878 | |
25879 |
|
25880 |
|
25881 |
|
25882 |
|
25883 |
|
25884 |
|
25885 |
|
25886 |
|
25887 |
|
25888 |
|
25889 |
|
25890 |
|
25891 | renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
25892 | !(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : void 0;
|
25893 | return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
|
25894 | },
|
25895 |
|
25896 | _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
25897 | ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
|
25898 | !ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
|
25899 |
|
25900 | nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : void 0;
|
25901 |
|
25902 | process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
|
25903 |
|
25904 | var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
|
25905 |
|
25906 | var prevComponent = getTopLevelWrapperInContainer(container);
|
25907 |
|
25908 | if (prevComponent) {
|
25909 | var prevWrappedElement = prevComponent._currentElement;
|
25910 | var prevElement = prevWrappedElement.props;
|
25911 | if (shouldUpdateReactComponent(prevElement, nextElement)) {
|
25912 | var publicInst = prevComponent._renderedComponent.getPublicInstance();
|
25913 | var updatedCallback = callback && function () {
|
25914 | callback.call(publicInst);
|
25915 | };
|
25916 | ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
|
25917 | return publicInst;
|
25918 | } else {
|
25919 | ReactMount.unmountComponentAtNode(container);
|
25920 | }
|
25921 | }
|
25922 |
|
25923 | var reactRootElement = getReactRootElementInContainer(container);
|
25924 | var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
|
25925 | var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
25926 |
|
25927 | if (process.env.NODE_ENV !== 'production') {
|
25928 | process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
|
25929 |
|
25930 | if (!containerHasReactMarkup || reactRootElement.nextSibling) {
|
25931 | var rootElementSibling = reactRootElement;
|
25932 | while (rootElementSibling) {
|
25933 | if (internalGetID(rootElementSibling)) {
|
25934 | process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
|
25935 | break;
|
25936 | }
|
25937 | rootElementSibling = rootElementSibling.nextSibling;
|
25938 | }
|
25939 | }
|
25940 | }
|
25941 |
|
25942 | var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
|
25943 | var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
|
25944 | if (callback) {
|
25945 | callback.call(component);
|
25946 | }
|
25947 | return component;
|
25948 | },
|
25949 |
|
25950 | |
25951 |
|
25952 |
|
25953 |
|
25954 |
|
25955 |
|
25956 |
|
25957 |
|
25958 |
|
25959 |
|
25960 |
|
25961 |
|
25962 |
|
25963 | render: function (nextElement, container, callback) {
|
25964 | return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
|
25965 | },
|
25966 |
|
25967 | |
25968 |
|
25969 |
|
25970 |
|
25971 |
|
25972 |
|
25973 |
|
25974 |
|
25975 | unmountComponentAtNode: function (container) {
|
25976 |
|
25977 |
|
25978 |
|
25979 |
|
25980 | process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
|
25981 |
|
25982 | !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : void 0;
|
25983 |
|
25984 | var prevComponent = getTopLevelWrapperInContainer(container);
|
25985 | if (!prevComponent) {
|
25986 |
|
25987 |
|
25988 | var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
25989 |
|
25990 |
|
25991 | var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
|
25992 |
|
25993 | if (process.env.NODE_ENV !== 'production') {
|
25994 | process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
|
25995 | }
|
25996 |
|
25997 | return false;
|
25998 | }
|
25999 | delete instancesByReactRootID[prevComponent._instance.rootID];
|
26000 | ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
|
26001 | return true;
|
26002 | },
|
26003 |
|
26004 | _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
|
26005 | !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : void 0;
|
26006 |
|
26007 | if (shouldReuseMarkup) {
|
26008 | var rootElement = getReactRootElementInContainer(container);
|
26009 | if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
|
26010 | ReactDOMComponentTree.precacheNode(instance, rootElement);
|
26011 | return;
|
26012 | } else {
|
26013 | var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
26014 | rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
26015 |
|
26016 | var rootMarkup = rootElement.outerHTML;
|
26017 | rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
|
26018 |
|
26019 | var normalizedMarkup = markup;
|
26020 | if (process.env.NODE_ENV !== 'production') {
|
26021 |
|
26022 |
|
26023 |
|
26024 |
|
26025 | var normalizer;
|
26026 | if (container.nodeType === ELEMENT_NODE_TYPE) {
|
26027 | normalizer = document.createElement('div');
|
26028 | normalizer.innerHTML = markup;
|
26029 | normalizedMarkup = normalizer.innerHTML;
|
26030 | } else {
|
26031 | normalizer = document.createElement('iframe');
|
26032 | document.body.appendChild(normalizer);
|
26033 | normalizer.contentDocument.write(markup);
|
26034 | normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
|
26035 | document.body.removeChild(normalizer);
|
26036 | }
|
26037 | }
|
26038 |
|
26039 | var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
|
26040 | var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
|
26041 |
|
26042 | !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : void 0;
|
26043 |
|
26044 | if (process.env.NODE_ENV !== 'production') {
|
26045 | process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
|
26046 | }
|
26047 | }
|
26048 | }
|
26049 |
|
26050 | !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;
|
26051 |
|
26052 | if (transaction.useCreateElement) {
|
26053 | while (container.lastChild) {
|
26054 | container.removeChild(container.lastChild);
|
26055 | }
|
26056 | DOMLazyTree.insertTreeBefore(container, markup, null);
|
26057 | } else {
|
26058 | setInnerHTML(container, markup);
|
26059 | ReactDOMComponentTree.precacheNode(instance, container.firstChild);
|
26060 | }
|
26061 |
|
26062 | if (process.env.NODE_ENV !== 'production') {
|
26063 | var nativeNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
|
26064 | if (nativeNode._debugID !== 0) {
|
26065 | ReactInstrumentation.debugTool.onNativeOperation(nativeNode._debugID, 'mount', markup.toString());
|
26066 | }
|
26067 | }
|
26068 | }
|
26069 | };
|
26070 |
|
26071 | module.exports = ReactMount;
|
26072 | }).call(this,require(91))
|
26073 | },{"166":166,"168":168,"185":185,"194":194,"199":199,"200":200,"204":204,"218":218,"224":224,"228":228,"230":230,"243":243,"246":246,"247":247,"285":285,"291":291,"293":293,"38":38,"45":45,"55":55,"91":91}],232:[function(require,module,exports){
|
26074 | (function (process){
|
26075 |
|
26076 |
|
26077 |
|
26078 |
|
26079 |
|
26080 |
|
26081 |
|
26082 |
|
26083 |
|
26084 |
|
26085 |
|
26086 | 'use strict';
|
26087 |
|
26088 | var ReactComponentEnvironment = require(191);
|
26089 | var ReactInstrumentation = require(228);
|
26090 | var ReactMultiChildUpdateTypes = require(233);
|
26091 |
|
26092 | var ReactCurrentOwner = require(194);
|
26093 | var ReactReconciler = require(243);
|
26094 | var ReactChildReconciler = require(186);
|
26095 |
|
26096 | var emptyFunction = require(37);
|
26097 | var flattenChildren = require(274);
|
26098 | var invariant = require(45);
|
26099 |
|
26100 |
|
26101 |
|
26102 |
|
26103 |
|
26104 |
|
26105 |
|
26106 |
|
26107 | function makeInsertMarkup(markup, afterNode, toIndex) {
|
26108 |
|
26109 | return {
|
26110 | type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
|
26111 | content: markup,
|
26112 | fromIndex: null,
|
26113 | fromNode: null,
|
26114 | toIndex: toIndex,
|
26115 | afterNode: afterNode
|
26116 | };
|
26117 | }
|
26118 |
|
26119 |
|
26120 |
|
26121 |
|
26122 |
|
26123 |
|
26124 |
|
26125 |
|
26126 | function makeMove(child, afterNode, toIndex) {
|
26127 |
|
26128 | return {
|
26129 | type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
|
26130 | content: null,
|
26131 | fromIndex: child._mountIndex,
|
26132 | fromNode: ReactReconciler.getNativeNode(child),
|
26133 | toIndex: toIndex,
|
26134 | afterNode: afterNode
|
26135 | };
|
26136 | }
|
26137 |
|
26138 |
|
26139 |
|
26140 |
|
26141 |
|
26142 |
|
26143 |
|
26144 | function makeRemove(child, node) {
|
26145 |
|
26146 | return {
|
26147 | type: ReactMultiChildUpdateTypes.REMOVE_NODE,
|
26148 | content: null,
|
26149 | fromIndex: child._mountIndex,
|
26150 | fromNode: node,
|
26151 | toIndex: null,
|
26152 | afterNode: null
|
26153 | };
|
26154 | }
|
26155 |
|
26156 |
|
26157 |
|
26158 |
|
26159 |
|
26160 |
|
26161 |
|
26162 | function makeSetMarkup(markup) {
|
26163 |
|
26164 | return {
|
26165 | type: ReactMultiChildUpdateTypes.SET_MARKUP,
|
26166 | content: markup,
|
26167 | fromIndex: null,
|
26168 | fromNode: null,
|
26169 | toIndex: null,
|
26170 | afterNode: null
|
26171 | };
|
26172 | }
|
26173 |
|
26174 |
|
26175 |
|
26176 |
|
26177 |
|
26178 |
|
26179 |
|
26180 | function makeTextContent(textContent) {
|
26181 |
|
26182 | return {
|
26183 | type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
|
26184 | content: textContent,
|
26185 | fromIndex: null,
|
26186 | fromNode: null,
|
26187 | toIndex: null,
|
26188 | afterNode: null
|
26189 | };
|
26190 | }
|
26191 |
|
26192 |
|
26193 |
|
26194 |
|
26195 |
|
26196 | function enqueue(queue, update) {
|
26197 | if (update) {
|
26198 | queue = queue || [];
|
26199 | queue.push(update);
|
26200 | }
|
26201 | return queue;
|
26202 | }
|
26203 |
|
26204 |
|
26205 |
|
26206 |
|
26207 |
|
26208 |
|
26209 | function processQueue(inst, updateQueue) {
|
26210 | ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
|
26211 | }
|
26212 |
|
26213 | var setChildrenForInstrumentation = emptyFunction;
|
26214 | if (process.env.NODE_ENV !== 'production') {
|
26215 | setChildrenForInstrumentation = function (children) {
|
26216 | ReactInstrumentation.debugTool.onSetChildren(this._debugID, children ? Object.keys(children).map(function (key) {
|
26217 | return children[key]._debugID;
|
26218 | }) : []);
|
26219 | };
|
26220 | }
|
26221 |
|
26222 |
|
26223 |
|
26224 |
|
26225 |
|
26226 |
|
26227 |
|
26228 | var ReactMultiChild = {
|
26229 |
|
26230 | |
26231 |
|
26232 |
|
26233 |
|
26234 |
|
26235 |
|
26236 |
|
26237 | Mixin: {
|
26238 |
|
26239 | _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
|
26240 | if (process.env.NODE_ENV !== 'production') {
|
26241 | if (this._currentElement) {
|
26242 | try {
|
26243 | ReactCurrentOwner.current = this._currentElement._owner;
|
26244 | return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
|
26245 | } finally {
|
26246 | ReactCurrentOwner.current = null;
|
26247 | }
|
26248 | }
|
26249 | }
|
26250 | return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
|
26251 | },
|
26252 |
|
26253 | _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, removedNodes, transaction, context) {
|
26254 | var nextChildren;
|
26255 | if (process.env.NODE_ENV !== 'production') {
|
26256 | if (this._currentElement) {
|
26257 | try {
|
26258 | ReactCurrentOwner.current = this._currentElement._owner;
|
26259 | nextChildren = flattenChildren(nextNestedChildrenElements);
|
26260 | } finally {
|
26261 | ReactCurrentOwner.current = null;
|
26262 | }
|
26263 | ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
|
26264 | return nextChildren;
|
26265 | }
|
26266 | }
|
26267 | nextChildren = flattenChildren(nextNestedChildrenElements);
|
26268 | ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
|
26269 | return nextChildren;
|
26270 | },
|
26271 |
|
26272 | |
26273 |
|
26274 |
|
26275 |
|
26276 |
|
26277 |
|
26278 |
|
26279 |
|
26280 | mountChildren: function (nestedChildren, transaction, context) {
|
26281 | var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
|
26282 | this._renderedChildren = children;
|
26283 |
|
26284 | var mountImages = [];
|
26285 | var index = 0;
|
26286 | for (var name in children) {
|
26287 | if (children.hasOwnProperty(name)) {
|
26288 | var child = children[name];
|
26289 | var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
|
26290 | child._mountIndex = index++;
|
26291 | mountImages.push(mountImage);
|
26292 | }
|
26293 | }
|
26294 |
|
26295 | if (process.env.NODE_ENV !== 'production') {
|
26296 | setChildrenForInstrumentation.call(this, children);
|
26297 | }
|
26298 |
|
26299 | return mountImages;
|
26300 | },
|
26301 |
|
26302 | |
26303 |
|
26304 |
|
26305 |
|
26306 |
|
26307 |
|
26308 | updateTextContent: function (nextContent) {
|
26309 | var prevChildren = this._renderedChildren;
|
26310 |
|
26311 | ReactChildReconciler.unmountChildren(prevChildren, false);
|
26312 | for (var name in prevChildren) {
|
26313 | if (prevChildren.hasOwnProperty(name)) {
|
26314 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
|
26315 | }
|
26316 | }
|
26317 |
|
26318 | var updates = [makeTextContent(nextContent)];
|
26319 | processQueue(this, updates);
|
26320 | },
|
26321 |
|
26322 | |
26323 |
|
26324 |
|
26325 |
|
26326 |
|
26327 |
|
26328 | updateMarkup: function (nextMarkup) {
|
26329 | var prevChildren = this._renderedChildren;
|
26330 |
|
26331 | ReactChildReconciler.unmountChildren(prevChildren, false);
|
26332 | for (var name in prevChildren) {
|
26333 | if (prevChildren.hasOwnProperty(name)) {
|
26334 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
|
26335 | }
|
26336 | }
|
26337 | var updates = [makeSetMarkup(nextMarkup)];
|
26338 | processQueue(this, updates);
|
26339 | },
|
26340 |
|
26341 | |
26342 |
|
26343 |
|
26344 |
|
26345 |
|
26346 |
|
26347 |
|
26348 | updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
26349 |
|
26350 | this._updateChildren(nextNestedChildrenElements, transaction, context);
|
26351 | },
|
26352 |
|
26353 | |
26354 |
|
26355 |
|
26356 |
|
26357 |
|
26358 |
|
26359 | _updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
26360 | var prevChildren = this._renderedChildren;
|
26361 | var removedNodes = {};
|
26362 | var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, removedNodes, transaction, context);
|
26363 | if (!nextChildren && !prevChildren) {
|
26364 | return;
|
26365 | }
|
26366 | var updates = null;
|
26367 | var name;
|
26368 |
|
26369 |
|
26370 | var lastIndex = 0;
|
26371 | var nextIndex = 0;
|
26372 | var lastPlacedNode = null;
|
26373 | for (name in nextChildren) {
|
26374 | if (!nextChildren.hasOwnProperty(name)) {
|
26375 | continue;
|
26376 | }
|
26377 | var prevChild = prevChildren && prevChildren[name];
|
26378 | var nextChild = nextChildren[name];
|
26379 | if (prevChild === nextChild) {
|
26380 | updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
|
26381 | lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
26382 | prevChild._mountIndex = nextIndex;
|
26383 | } else {
|
26384 | if (prevChild) {
|
26385 |
|
26386 | lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
26387 |
|
26388 | }
|
26389 |
|
26390 | updates = enqueue(updates, this._mountChildAtIndex(nextChild, lastPlacedNode, nextIndex, transaction, context));
|
26391 | }
|
26392 | nextIndex++;
|
26393 | lastPlacedNode = ReactReconciler.getNativeNode(nextChild);
|
26394 | }
|
26395 |
|
26396 | for (name in removedNodes) {
|
26397 | if (removedNodes.hasOwnProperty(name)) {
|
26398 | updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
|
26399 | }
|
26400 | }
|
26401 | if (updates) {
|
26402 | processQueue(this, updates);
|
26403 | }
|
26404 | this._renderedChildren = nextChildren;
|
26405 |
|
26406 | if (process.env.NODE_ENV !== 'production') {
|
26407 | setChildrenForInstrumentation.call(this, nextChildren);
|
26408 | }
|
26409 | },
|
26410 |
|
26411 | |
26412 |
|
26413 |
|
26414 |
|
26415 |
|
26416 |
|
26417 |
|
26418 | unmountChildren: function (safely) {
|
26419 | var renderedChildren = this._renderedChildren;
|
26420 | ReactChildReconciler.unmountChildren(renderedChildren, safely);
|
26421 | this._renderedChildren = null;
|
26422 | },
|
26423 |
|
26424 | |
26425 |
|
26426 |
|
26427 |
|
26428 |
|
26429 |
|
26430 |
|
26431 |
|
26432 | moveChild: function (child, afterNode, toIndex, lastIndex) {
|
26433 |
|
26434 |
|
26435 |
|
26436 | if (child._mountIndex < lastIndex) {
|
26437 | return makeMove(child, afterNode, toIndex);
|
26438 | }
|
26439 | },
|
26440 |
|
26441 | |
26442 |
|
26443 |
|
26444 |
|
26445 |
|
26446 |
|
26447 |
|
26448 | createChild: function (child, afterNode, mountImage) {
|
26449 | return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
|
26450 | },
|
26451 |
|
26452 | |
26453 |
|
26454 |
|
26455 |
|
26456 |
|
26457 |
|
26458 | removeChild: function (child, node) {
|
26459 | return makeRemove(child, node);
|
26460 | },
|
26461 |
|
26462 | |
26463 |
|
26464 |
|
26465 |
|
26466 |
|
26467 |
|
26468 |
|
26469 |
|
26470 |
|
26471 |
|
26472 |
|
26473 | _mountChildAtIndex: function (child, afterNode, index, transaction, context) {
|
26474 | var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
|
26475 | child._mountIndex = index;
|
26476 | return this.createChild(child, afterNode, mountImage);
|
26477 | },
|
26478 |
|
26479 | |
26480 |
|
26481 |
|
26482 |
|
26483 |
|
26484 |
|
26485 |
|
26486 |
|
26487 | _unmountChild: function (child, node) {
|
26488 | var update = this.removeChild(child, node);
|
26489 | child._mountIndex = null;
|
26490 | return update;
|
26491 | }
|
26492 |
|
26493 | }
|
26494 |
|
26495 | };
|
26496 |
|
26497 | module.exports = ReactMultiChild;
|
26498 | }).call(this,require(91))
|
26499 | },{"186":186,"191":191,"194":194,"228":228,"233":233,"243":243,"274":274,"37":37,"45":45,"91":91}],233:[function(require,module,exports){
|
26500 |
|
26501 |
|
26502 |
|
26503 |
|
26504 |
|
26505 |
|
26506 |
|
26507 |
|
26508 |
|
26509 |
|
26510 |
|
26511 | 'use strict';
|
26512 |
|
26513 | var keyMirror = require(48);
|
26514 |
|
26515 |
|
26516 |
|
26517 |
|
26518 |
|
26519 |
|
26520 |
|
26521 |
|
26522 |
|
26523 | var ReactMultiChildUpdateTypes = keyMirror({
|
26524 | INSERT_MARKUP: null,
|
26525 | MOVE_EXISTING: null,
|
26526 | REMOVE_NODE: null,
|
26527 | SET_MARKUP: null,
|
26528 | TEXT_CONTENT: null
|
26529 | });
|
26530 |
|
26531 | module.exports = ReactMultiChildUpdateTypes;
|
26532 | },{"48":48}],234:[function(require,module,exports){
|
26533 | (function (process){
|
26534 |
|
26535 |
|
26536 |
|
26537 |
|
26538 |
|
26539 |
|
26540 |
|
26541 |
|
26542 |
|
26543 |
|
26544 |
|
26545 | 'use strict';
|
26546 |
|
26547 | var _assign = require(296);
|
26548 |
|
26549 | var invariant = require(45);
|
26550 |
|
26551 | var autoGenerateWrapperClass = null;
|
26552 | var genericComponentClass = null;
|
26553 |
|
26554 | var tagToComponentClass = {};
|
26555 | var textComponentClass = null;
|
26556 |
|
26557 | var ReactNativeComponentInjection = {
|
26558 |
|
26559 |
|
26560 | injectGenericComponentClass: function (componentClass) {
|
26561 | genericComponentClass = componentClass;
|
26562 | },
|
26563 |
|
26564 |
|
26565 | injectTextComponentClass: function (componentClass) {
|
26566 | textComponentClass = componentClass;
|
26567 | },
|
26568 |
|
26569 |
|
26570 | injectComponentClasses: function (componentClasses) {
|
26571 | _assign(tagToComponentClass, componentClasses);
|
26572 | }
|
26573 | };
|
26574 |
|
26575 |
|
26576 |
|
26577 |
|
26578 |
|
26579 |
|
26580 |
|
26581 | function getComponentClassForElement(element) {
|
26582 | if (typeof element.type === 'function') {
|
26583 | return element.type;
|
26584 | }
|
26585 | var tag = element.type;
|
26586 | var componentClass = tagToComponentClass[tag];
|
26587 | if (componentClass == null) {
|
26588 | tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
|
26589 | }
|
26590 | return componentClass;
|
26591 | }
|
26592 |
|
26593 |
|
26594 |
|
26595 |
|
26596 |
|
26597 |
|
26598 |
|
26599 | function createInternalComponent(element) {
|
26600 | !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : void 0;
|
26601 | return new genericComponentClass(element);
|
26602 | }
|
26603 |
|
26604 |
|
26605 |
|
26606 |
|
26607 |
|
26608 | function createInstanceForText(text) {
|
26609 | return new textComponentClass(text);
|
26610 | }
|
26611 |
|
26612 |
|
26613 |
|
26614 |
|
26615 |
|
26616 | function isTextComponent(component) {
|
26617 | return component instanceof textComponentClass;
|
26618 | }
|
26619 |
|
26620 | var ReactNativeComponent = {
|
26621 | getComponentClassForElement: getComponentClassForElement,
|
26622 | createInternalComponent: createInternalComponent,
|
26623 | createInstanceForText: createInstanceForText,
|
26624 | isTextComponent: isTextComponent,
|
26625 | injection: ReactNativeComponentInjection
|
26626 | };
|
26627 |
|
26628 | module.exports = ReactNativeComponent;
|
26629 | }).call(this,require(91))
|
26630 | },{"296":296,"45":45,"91":91}],235:[function(require,module,exports){
|
26631 |
|
26632 |
|
26633 |
|
26634 |
|
26635 |
|
26636 |
|
26637 |
|
26638 |
|
26639 |
|
26640 |
|
26641 |
|
26642 | 'use strict';
|
26643 |
|
26644 | var history = [];
|
26645 |
|
26646 | var ReactNativeOperationHistoryDevtool = {
|
26647 | onNativeOperation: function (debugID, type, payload) {
|
26648 | history.push({
|
26649 | instanceID: debugID,
|
26650 | type: type,
|
26651 | payload: payload
|
26652 | });
|
26653 | },
|
26654 | clearHistory: function () {
|
26655 | if (ReactNativeOperationHistoryDevtool._preventClearing) {
|
26656 |
|
26657 | return;
|
26658 | }
|
26659 |
|
26660 | history = [];
|
26661 | },
|
26662 | getHistory: function () {
|
26663 | return history;
|
26664 | }
|
26665 | };
|
26666 |
|
26667 | module.exports = ReactNativeOperationHistoryDevtool;
|
26668 | },{}],236:[function(require,module,exports){
|
26669 | (function (process){
|
26670 |
|
26671 |
|
26672 |
|
26673 |
|
26674 |
|
26675 |
|
26676 |
|
26677 |
|
26678 |
|
26679 |
|
26680 |
|
26681 | 'use strict';
|
26682 |
|
26683 | var ReactElement = require(218);
|
26684 |
|
26685 | var invariant = require(45);
|
26686 |
|
26687 | var ReactNodeTypes = {
|
26688 | NATIVE: 0,
|
26689 | COMPOSITE: 1,
|
26690 | EMPTY: 2,
|
26691 |
|
26692 | getType: function (node) {
|
26693 | if (node === null || node === false) {
|
26694 | return ReactNodeTypes.EMPTY;
|
26695 | } else if (ReactElement.isValidElement(node)) {
|
26696 | if (typeof node.type === 'function') {
|
26697 | return ReactNodeTypes.COMPOSITE;
|
26698 | } else {
|
26699 | return ReactNodeTypes.NATIVE;
|
26700 | }
|
26701 | }
|
26702 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : invariant(false) : void 0;
|
26703 | }
|
26704 | };
|
26705 |
|
26706 | module.exports = ReactNodeTypes;
|
26707 | }).call(this,require(91))
|
26708 | },{"218":218,"45":45,"91":91}],237:[function(require,module,exports){
|
26709 | (function (process){
|
26710 |
|
26711 |
|
26712 |
|
26713 |
|
26714 |
|
26715 |
|
26716 |
|
26717 |
|
26718 |
|
26719 |
|
26720 |
|
26721 | 'use strict';
|
26722 |
|
26723 | var warning = require(55);
|
26724 |
|
26725 | function warnTDZ(publicInstance, callerName) {
|
26726 | if (process.env.NODE_ENV !== 'production') {
|
26727 | process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : void 0;
|
26728 | }
|
26729 | }
|
26730 |
|
26731 |
|
26732 |
|
26733 |
|
26734 | var ReactNoopUpdateQueue = {
|
26735 |
|
26736 | |
26737 |
|
26738 |
|
26739 |
|
26740 |
|
26741 |
|
26742 |
|
26743 | isMounted: function (publicInstance) {
|
26744 | return false;
|
26745 | },
|
26746 |
|
26747 | |
26748 |
|
26749 |
|
26750 |
|
26751 |
|
26752 |
|
26753 |
|
26754 |
|
26755 | enqueueCallback: function (publicInstance, callback) {},
|
26756 |
|
26757 | |
26758 |
|
26759 |
|
26760 |
|
26761 |
|
26762 |
|
26763 |
|
26764 |
|
26765 |
|
26766 |
|
26767 |
|
26768 |
|
26769 |
|
26770 | enqueueForceUpdate: function (publicInstance) {
|
26771 | warnTDZ(publicInstance, 'forceUpdate');
|
26772 | },
|
26773 |
|
26774 | |
26775 |
|
26776 |
|
26777 |
|
26778 |
|
26779 |
|
26780 |
|
26781 |
|
26782 |
|
26783 |
|
26784 |
|
26785 | enqueueReplaceState: function (publicInstance, completeState) {
|
26786 | warnTDZ(publicInstance, 'replaceState');
|
26787 | },
|
26788 |
|
26789 | |
26790 |
|
26791 |
|
26792 |
|
26793 |
|
26794 |
|
26795 |
|
26796 |
|
26797 |
|
26798 |
|
26799 | enqueueSetState: function (publicInstance, partialState) {
|
26800 | warnTDZ(publicInstance, 'setState');
|
26801 | }
|
26802 | };
|
26803 |
|
26804 | module.exports = ReactNoopUpdateQueue;
|
26805 | }).call(this,require(91))
|
26806 | },{"55":55,"91":91}],238:[function(require,module,exports){
|
26807 | (function (process){
|
26808 |
|
26809 |
|
26810 |
|
26811 |
|
26812 |
|
26813 |
|
26814 |
|
26815 |
|
26816 |
|
26817 |
|
26818 |
|
26819 | 'use strict';
|
26820 |
|
26821 | var invariant = require(45);
|
26822 |
|
26823 |
|
26824 |
|
26825 |
|
26826 |
|
26827 |
|
26828 |
|
26829 |
|
26830 |
|
26831 |
|
26832 |
|
26833 |
|
26834 |
|
26835 |
|
26836 |
|
26837 |
|
26838 |
|
26839 |
|
26840 |
|
26841 |
|
26842 |
|
26843 |
|
26844 |
|
26845 |
|
26846 |
|
26847 |
|
26848 |
|
26849 |
|
26850 |
|
26851 |
|
26852 |
|
26853 | var ReactOwner = {
|
26854 |
|
26855 | |
26856 |
|
26857 |
|
26858 |
|
26859 |
|
26860 | isValidOwner: function (object) {
|
26861 | return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
|
26862 | },
|
26863 |
|
26864 | |
26865 |
|
26866 |
|
26867 |
|
26868 |
|
26869 |
|
26870 |
|
26871 |
|
26872 |
|
26873 | addComponentAsRefTo: function (component, ref, owner) {
|
26874 | !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;
|
26875 | owner.attachRef(ref, component);
|
26876 | },
|
26877 |
|
26878 | |
26879 |
|
26880 |
|
26881 |
|
26882 |
|
26883 |
|
26884 |
|
26885 |
|
26886 |
|
26887 | removeComponentAsRefFrom: function (component, ref, owner) {
|
26888 | !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;
|
26889 | var ownerPublicInstance = owner.getPublicInstance();
|
26890 |
|
26891 |
|
26892 | if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
|
26893 | owner.detachRef(ref);
|
26894 | }
|
26895 | }
|
26896 |
|
26897 | };
|
26898 |
|
26899 | module.exports = ReactOwner;
|
26900 | }).call(this,require(91))
|
26901 | },{"45":45,"91":91}],239:[function(require,module,exports){
|
26902 | (function (process){
|
26903 |
|
26904 |
|
26905 |
|
26906 |
|
26907 |
|
26908 |
|
26909 |
|
26910 |
|
26911 |
|
26912 |
|
26913 |
|
26914 | 'use strict';
|
26915 |
|
26916 | var ReactPropTypeLocationNames = {};
|
26917 |
|
26918 | if (process.env.NODE_ENV !== 'production') {
|
26919 | ReactPropTypeLocationNames = {
|
26920 | prop: 'prop',
|
26921 | context: 'context',
|
26922 | childContext: 'child context'
|
26923 | };
|
26924 | }
|
26925 |
|
26926 | module.exports = ReactPropTypeLocationNames;
|
26927 | }).call(this,require(91))
|
26928 | },{"91":91}],240:[function(require,module,exports){
|
26929 |
|
26930 |
|
26931 |
|
26932 |
|
26933 |
|
26934 |
|
26935 |
|
26936 |
|
26937 |
|
26938 |
|
26939 |
|
26940 | 'use strict';
|
26941 |
|
26942 | var keyMirror = require(48);
|
26943 |
|
26944 | var ReactPropTypeLocations = keyMirror({
|
26945 | prop: null,
|
26946 | context: null,
|
26947 | childContext: null
|
26948 | });
|
26949 |
|
26950 | module.exports = ReactPropTypeLocations;
|
26951 | },{"48":48}],241:[function(require,module,exports){
|
26952 |
|
26953 |
|
26954 |
|
26955 |
|
26956 |
|
26957 |
|
26958 |
|
26959 |
|
26960 |
|
26961 |
|
26962 |
|
26963 | 'use strict';
|
26964 |
|
26965 | var ReactElement = require(218);
|
26966 | var ReactPropTypeLocationNames = require(239);
|
26967 |
|
26968 | var emptyFunction = require(37);
|
26969 | var getIteratorFn = require(280);
|
26970 |
|
26971 |
|
26972 |
|
26973 |
|
26974 |
|
26975 |
|
26976 |
|
26977 |
|
26978 |
|
26979 |
|
26980 |
|
26981 |
|
26982 |
|
26983 |
|
26984 |
|
26985 |
|
26986 |
|
26987 |
|
26988 |
|
26989 |
|
26990 |
|
26991 |
|
26992 |
|
26993 |
|
26994 |
|
26995 |
|
26996 |
|
26997 |
|
26998 |
|
26999 |
|
27000 |
|
27001 |
|
27002 |
|
27003 |
|
27004 |
|
27005 |
|
27006 |
|
27007 |
|
27008 |
|
27009 |
|
27010 |
|
27011 |
|
27012 |
|
27013 |
|
27014 |
|
27015 |
|
27016 |
|
27017 |
|
27018 | var ANONYMOUS = '<<anonymous>>';
|
27019 |
|
27020 | var ReactPropTypes = {
|
27021 | array: createPrimitiveTypeChecker('array'),
|
27022 | bool: createPrimitiveTypeChecker('boolean'),
|
27023 | func: createPrimitiveTypeChecker('function'),
|
27024 | number: createPrimitiveTypeChecker('number'),
|
27025 | object: createPrimitiveTypeChecker('object'),
|
27026 | string: createPrimitiveTypeChecker('string'),
|
27027 |
|
27028 | any: createAnyTypeChecker(),
|
27029 | arrayOf: createArrayOfTypeChecker,
|
27030 | element: createElementTypeChecker(),
|
27031 | instanceOf: createInstanceTypeChecker,
|
27032 | node: createNodeChecker(),
|
27033 | objectOf: createObjectOfTypeChecker,
|
27034 | oneOf: createEnumTypeChecker,
|
27035 | oneOfType: createUnionTypeChecker,
|
27036 | shape: createShapeTypeChecker
|
27037 | };
|
27038 |
|
27039 |
|
27040 |
|
27041 |
|
27042 |
|
27043 |
|
27044 | function is(x, y) {
|
27045 |
|
27046 | if (x === y) {
|
27047 |
|
27048 |
|
27049 | return x !== 0 || 1 / x === 1 / y;
|
27050 | } else {
|
27051 |
|
27052 | return x !== x && y !== y;
|
27053 | }
|
27054 | }
|
27055 |
|
27056 |
|
27057 | function createChainableTypeChecker(validate) {
|
27058 | function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
27059 | componentName = componentName || ANONYMOUS;
|
27060 | propFullName = propFullName || propName;
|
27061 | if (props[propName] == null) {
|
27062 | var locationName = ReactPropTypeLocationNames[location];
|
27063 | if (isRequired) {
|
27064 | return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
|
27065 | }
|
27066 | return null;
|
27067 | } else {
|
27068 | return validate(props, propName, componentName, location, propFullName);
|
27069 | }
|
27070 | }
|
27071 |
|
27072 | var chainedCheckType = checkType.bind(null, false);
|
27073 | chainedCheckType.isRequired = checkType.bind(null, true);
|
27074 |
|
27075 | return chainedCheckType;
|
27076 | }
|
27077 |
|
27078 | function createPrimitiveTypeChecker(expectedType) {
|
27079 | function validate(props, propName, componentName, location, propFullName) {
|
27080 | var propValue = props[propName];
|
27081 | var propType = getPropType(propValue);
|
27082 | if (propType !== expectedType) {
|
27083 | var locationName = ReactPropTypeLocationNames[location];
|
27084 |
|
27085 |
|
27086 |
|
27087 | var preciseType = getPreciseType(propValue);
|
27088 |
|
27089 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
27090 | }
|
27091 | return null;
|
27092 | }
|
27093 | return createChainableTypeChecker(validate);
|
27094 | }
|
27095 |
|
27096 | function createAnyTypeChecker() {
|
27097 | return createChainableTypeChecker(emptyFunction.thatReturns(null));
|
27098 | }
|
27099 |
|
27100 | function createArrayOfTypeChecker(typeChecker) {
|
27101 | function validate(props, propName, componentName, location, propFullName) {
|
27102 | if (typeof typeChecker !== 'function') {
|
27103 | return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
27104 | }
|
27105 | var propValue = props[propName];
|
27106 | if (!Array.isArray(propValue)) {
|
27107 | var locationName = ReactPropTypeLocationNames[location];
|
27108 | var propType = getPropType(propValue);
|
27109 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
27110 | }
|
27111 | for (var i = 0; i < propValue.length; i++) {
|
27112 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
|
27113 | if (error instanceof Error) {
|
27114 | return error;
|
27115 | }
|
27116 | }
|
27117 | return null;
|
27118 | }
|
27119 | return createChainableTypeChecker(validate);
|
27120 | }
|
27121 |
|
27122 | function createElementTypeChecker() {
|
27123 | function validate(props, propName, componentName, location, propFullName) {
|
27124 | if (!ReactElement.isValidElement(props[propName])) {
|
27125 | var locationName = ReactPropTypeLocationNames[location];
|
27126 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
|
27127 | }
|
27128 | return null;
|
27129 | }
|
27130 | return createChainableTypeChecker(validate);
|
27131 | }
|
27132 |
|
27133 | function createInstanceTypeChecker(expectedClass) {
|
27134 | function validate(props, propName, componentName, location, propFullName) {
|
27135 | if (!(props[propName] instanceof expectedClass)) {
|
27136 | var locationName = ReactPropTypeLocationNames[location];
|
27137 | var expectedClassName = expectedClass.name || ANONYMOUS;
|
27138 | var actualClassName = getClassName(props[propName]);
|
27139 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
27140 | }
|
27141 | return null;
|
27142 | }
|
27143 | return createChainableTypeChecker(validate);
|
27144 | }
|
27145 |
|
27146 | function createEnumTypeChecker(expectedValues) {
|
27147 | if (!Array.isArray(expectedValues)) {
|
27148 | return createChainableTypeChecker(function () {
|
27149 | return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
|
27150 | });
|
27151 | }
|
27152 |
|
27153 | function validate(props, propName, componentName, location, propFullName) {
|
27154 | var propValue = props[propName];
|
27155 | for (var i = 0; i < expectedValues.length; i++) {
|
27156 | if (is(propValue, expectedValues[i])) {
|
27157 | return null;
|
27158 | }
|
27159 | }
|
27160 |
|
27161 | var locationName = ReactPropTypeLocationNames[location];
|
27162 | var valuesString = JSON.stringify(expectedValues);
|
27163 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
27164 | }
|
27165 | return createChainableTypeChecker(validate);
|
27166 | }
|
27167 |
|
27168 | function createObjectOfTypeChecker(typeChecker) {
|
27169 | function validate(props, propName, componentName, location, propFullName) {
|
27170 | if (typeof typeChecker !== 'function') {
|
27171 | return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
27172 | }
|
27173 | var propValue = props[propName];
|
27174 | var propType = getPropType(propValue);
|
27175 | if (propType !== 'object') {
|
27176 | var locationName = ReactPropTypeLocationNames[location];
|
27177 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
27178 | }
|
27179 | for (var key in propValue) {
|
27180 | if (propValue.hasOwnProperty(key)) {
|
27181 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
|
27182 | if (error instanceof Error) {
|
27183 | return error;
|
27184 | }
|
27185 | }
|
27186 | }
|
27187 | return null;
|
27188 | }
|
27189 | return createChainableTypeChecker(validate);
|
27190 | }
|
27191 |
|
27192 | function createUnionTypeChecker(arrayOfTypeCheckers) {
|
27193 | if (!Array.isArray(arrayOfTypeCheckers)) {
|
27194 | return createChainableTypeChecker(function () {
|
27195 | return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
|
27196 | });
|
27197 | }
|
27198 |
|
27199 | function validate(props, propName, componentName, location, propFullName) {
|
27200 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
27201 | var checker = arrayOfTypeCheckers[i];
|
27202 | if (checker(props, propName, componentName, location, propFullName) == null) {
|
27203 | return null;
|
27204 | }
|
27205 | }
|
27206 |
|
27207 | var locationName = ReactPropTypeLocationNames[location];
|
27208 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
27209 | }
|
27210 | return createChainableTypeChecker(validate);
|
27211 | }
|
27212 |
|
27213 | function createNodeChecker() {
|
27214 | function validate(props, propName, componentName, location, propFullName) {
|
27215 | if (!isNode(props[propName])) {
|
27216 | var locationName = ReactPropTypeLocationNames[location];
|
27217 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
27218 | }
|
27219 | return null;
|
27220 | }
|
27221 | return createChainableTypeChecker(validate);
|
27222 | }
|
27223 |
|
27224 | function createShapeTypeChecker(shapeTypes) {
|
27225 | function validate(props, propName, componentName, location, propFullName) {
|
27226 | var propValue = props[propName];
|
27227 | var propType = getPropType(propValue);
|
27228 | if (propType !== 'object') {
|
27229 | var locationName = ReactPropTypeLocationNames[location];
|
27230 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
27231 | }
|
27232 | for (var key in shapeTypes) {
|
27233 | var checker = shapeTypes[key];
|
27234 | if (!checker) {
|
27235 | continue;
|
27236 | }
|
27237 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
|
27238 | if (error) {
|
27239 | return error;
|
27240 | }
|
27241 | }
|
27242 | return null;
|
27243 | }
|
27244 | return createChainableTypeChecker(validate);
|
27245 | }
|
27246 |
|
27247 | function isNode(propValue) {
|
27248 | switch (typeof propValue) {
|
27249 | case 'number':
|
27250 | case 'string':
|
27251 | case 'undefined':
|
27252 | return true;
|
27253 | case 'boolean':
|
27254 | return !propValue;
|
27255 | case 'object':
|
27256 | if (Array.isArray(propValue)) {
|
27257 | return propValue.every(isNode);
|
27258 | }
|
27259 | if (propValue === null || ReactElement.isValidElement(propValue)) {
|
27260 | return true;
|
27261 | }
|
27262 |
|
27263 | var iteratorFn = getIteratorFn(propValue);
|
27264 | if (iteratorFn) {
|
27265 | var iterator = iteratorFn.call(propValue);
|
27266 | var step;
|
27267 | if (iteratorFn !== propValue.entries) {
|
27268 | while (!(step = iterator.next()).done) {
|
27269 | if (!isNode(step.value)) {
|
27270 | return false;
|
27271 | }
|
27272 | }
|
27273 | } else {
|
27274 |
|
27275 | while (!(step = iterator.next()).done) {
|
27276 | var entry = step.value;
|
27277 | if (entry) {
|
27278 | if (!isNode(entry[1])) {
|
27279 | return false;
|
27280 | }
|
27281 | }
|
27282 | }
|
27283 | }
|
27284 | } else {
|
27285 | return false;
|
27286 | }
|
27287 |
|
27288 | return true;
|
27289 | default:
|
27290 | return false;
|
27291 | }
|
27292 | }
|
27293 |
|
27294 |
|
27295 | function getPropType(propValue) {
|
27296 | var propType = typeof propValue;
|
27297 | if (Array.isArray(propValue)) {
|
27298 | return 'array';
|
27299 | }
|
27300 | if (propValue instanceof RegExp) {
|
27301 |
|
27302 |
|
27303 |
|
27304 | return 'object';
|
27305 | }
|
27306 | return propType;
|
27307 | }
|
27308 |
|
27309 |
|
27310 |
|
27311 | function getPreciseType(propValue) {
|
27312 | var propType = getPropType(propValue);
|
27313 | if (propType === 'object') {
|
27314 | if (propValue instanceof Date) {
|
27315 | return 'date';
|
27316 | } else if (propValue instanceof RegExp) {
|
27317 | return 'regexp';
|
27318 | }
|
27319 | }
|
27320 | return propType;
|
27321 | }
|
27322 |
|
27323 |
|
27324 | function getClassName(propValue) {
|
27325 | if (!propValue.constructor || !propValue.constructor.name) {
|
27326 | return ANONYMOUS;
|
27327 | }
|
27328 | return propValue.constructor.name;
|
27329 | }
|
27330 |
|
27331 | module.exports = ReactPropTypes;
|
27332 | },{"218":218,"239":239,"280":280,"37":37}],242:[function(require,module,exports){
|
27333 |
|
27334 |
|
27335 |
|
27336 |
|
27337 |
|
27338 |
|
27339 |
|
27340 |
|
27341 |
|
27342 |
|
27343 |
|
27344 | 'use strict';
|
27345 |
|
27346 | var _assign = require(296);
|
27347 |
|
27348 | var CallbackQueue = require(163);
|
27349 | var PooledClass = require(183);
|
27350 | var ReactBrowserEventEmitter = require(185);
|
27351 | var ReactInputSelection = require(226);
|
27352 | var Transaction = require(265);
|
27353 |
|
27354 |
|
27355 |
|
27356 |
|
27357 |
|
27358 | var SELECTION_RESTORATION = {
|
27359 | |
27360 |
|
27361 |
|
27362 | initialize: ReactInputSelection.getSelectionInformation,
|
27363 | |
27364 |
|
27365 |
|
27366 | close: ReactInputSelection.restoreSelection
|
27367 | };
|
27368 |
|
27369 |
|
27370 |
|
27371 |
|
27372 |
|
27373 |
|
27374 | var EVENT_SUPPRESSION = {
|
27375 | |
27376 |
|
27377 |
|
27378 |
|
27379 | initialize: function () {
|
27380 | var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
|
27381 | ReactBrowserEventEmitter.setEnabled(false);
|
27382 | return currentlyEnabled;
|
27383 | },
|
27384 |
|
27385 | |
27386 |
|
27387 |
|
27388 |
|
27389 |
|
27390 | close: function (previouslyEnabled) {
|
27391 | ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
|
27392 | }
|
27393 | };
|
27394 |
|
27395 |
|
27396 |
|
27397 |
|
27398 |
|
27399 | var ON_DOM_READY_QUEUEING = {
|
27400 | |
27401 |
|
27402 |
|
27403 | initialize: function () {
|
27404 | this.reactMountReady.reset();
|
27405 | },
|
27406 |
|
27407 | |
27408 |
|
27409 |
|
27410 | close: function () {
|
27411 | this.reactMountReady.notifyAll();
|
27412 | }
|
27413 | };
|
27414 |
|
27415 |
|
27416 |
|
27417 |
|
27418 |
|
27419 |
|
27420 | var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
|
27421 |
|
27422 |
|
27423 |
|
27424 |
|
27425 |
|
27426 |
|
27427 |
|
27428 |
|
27429 |
|
27430 |
|
27431 |
|
27432 |
|
27433 |
|
27434 |
|
27435 |
|
27436 | function ReactReconcileTransaction(useCreateElement) {
|
27437 | this.reinitializeTransaction();
|
27438 |
|
27439 |
|
27440 |
|
27441 |
|
27442 |
|
27443 | this.renderToStaticMarkup = false;
|
27444 | this.reactMountReady = CallbackQueue.getPooled(null);
|
27445 | this.useCreateElement = useCreateElement;
|
27446 | }
|
27447 |
|
27448 | var Mixin = {
|
27449 | |
27450 |
|
27451 |
|
27452 |
|
27453 |
|
27454 |
|
27455 |
|
27456 | getTransactionWrappers: function () {
|
27457 | return TRANSACTION_WRAPPERS;
|
27458 | },
|
27459 |
|
27460 | |
27461 |
|
27462 |
|
27463 | getReactMountReady: function () {
|
27464 | return this.reactMountReady;
|
27465 | },
|
27466 |
|
27467 | |
27468 |
|
27469 |
|
27470 |
|
27471 | checkpoint: function () {
|
27472 |
|
27473 | return this.reactMountReady.checkpoint();
|
27474 | },
|
27475 |
|
27476 | rollback: function (checkpoint) {
|
27477 | this.reactMountReady.rollback(checkpoint);
|
27478 | },
|
27479 |
|
27480 | |
27481 |
|
27482 |
|
27483 |
|
27484 | destructor: function () {
|
27485 | CallbackQueue.release(this.reactMountReady);
|
27486 | this.reactMountReady = null;
|
27487 | }
|
27488 | };
|
27489 |
|
27490 | _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
|
27491 |
|
27492 | PooledClass.addPoolingTo(ReactReconcileTransaction);
|
27493 |
|
27494 | module.exports = ReactReconcileTransaction;
|
27495 | },{"163":163,"183":183,"185":185,"226":226,"265":265,"296":296}],243:[function(require,module,exports){
|
27496 | (function (process){
|
27497 |
|
27498 |
|
27499 |
|
27500 |
|
27501 |
|
27502 |
|
27503 |
|
27504 |
|
27505 |
|
27506 |
|
27507 |
|
27508 | 'use strict';
|
27509 |
|
27510 | var ReactRef = require(244);
|
27511 | var ReactInstrumentation = require(228);
|
27512 |
|
27513 | var invariant = require(45);
|
27514 |
|
27515 |
|
27516 |
|
27517 |
|
27518 |
|
27519 | function attachRefs() {
|
27520 | ReactRef.attachRefs(this, this._currentElement);
|
27521 | }
|
27522 |
|
27523 | var ReactReconciler = {
|
27524 |
|
27525 | |
27526 |
|
27527 |
|
27528 |
|
27529 |
|
27530 |
|
27531 |
|
27532 |
|
27533 |
|
27534 |
|
27535 |
|
27536 | mountComponent: function (internalInstance, transaction, nativeParent, nativeContainerInfo, context) {
|
27537 | if (process.env.NODE_ENV !== 'production') {
|
27538 | if (internalInstance._debugID !== 0) {
|
27539 | ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent');
|
27540 | }
|
27541 | }
|
27542 | var markup = internalInstance.mountComponent(transaction, nativeParent, nativeContainerInfo, context);
|
27543 | if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
27544 | transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
27545 | }
|
27546 | if (process.env.NODE_ENV !== 'production') {
|
27547 | if (internalInstance._debugID !== 0) {
|
27548 | ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent');
|
27549 | ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
|
27550 | }
|
27551 | }
|
27552 | return markup;
|
27553 | },
|
27554 |
|
27555 | |
27556 |
|
27557 |
|
27558 |
|
27559 | getNativeNode: function (internalInstance) {
|
27560 | return internalInstance.getNativeNode();
|
27561 | },
|
27562 |
|
27563 | |
27564 |
|
27565 |
|
27566 |
|
27567 |
|
27568 |
|
27569 | unmountComponent: function (internalInstance, safely) {
|
27570 | if (process.env.NODE_ENV !== 'production') {
|
27571 | if (internalInstance._debugID !== 0) {
|
27572 | ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent');
|
27573 | }
|
27574 | }
|
27575 | ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
|
27576 | internalInstance.unmountComponent(safely);
|
27577 | if (process.env.NODE_ENV !== 'production') {
|
27578 | if (internalInstance._debugID !== 0) {
|
27579 | ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent');
|
27580 | ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
|
27581 | }
|
27582 | }
|
27583 | },
|
27584 |
|
27585 | |
27586 |
|
27587 |
|
27588 |
|
27589 |
|
27590 |
|
27591 |
|
27592 |
|
27593 |
|
27594 | receiveComponent: function (internalInstance, nextElement, transaction, context) {
|
27595 | var prevElement = internalInstance._currentElement;
|
27596 |
|
27597 | if (nextElement === prevElement && context === internalInstance._context) {
|
27598 |
|
27599 |
|
27600 |
|
27601 |
|
27602 |
|
27603 |
|
27604 |
|
27605 |
|
27606 |
|
27607 |
|
27608 | return;
|
27609 | }
|
27610 |
|
27611 | if (process.env.NODE_ENV !== 'production') {
|
27612 | if (internalInstance._debugID !== 0) {
|
27613 | ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent');
|
27614 | }
|
27615 | }
|
27616 |
|
27617 | var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
|
27618 |
|
27619 | if (refsChanged) {
|
27620 | ReactRef.detachRefs(internalInstance, prevElement);
|
27621 | }
|
27622 |
|
27623 | internalInstance.receiveComponent(nextElement, transaction, context);
|
27624 |
|
27625 | if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
27626 | transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
27627 | }
|
27628 |
|
27629 | if (process.env.NODE_ENV !== 'production') {
|
27630 | if (internalInstance._debugID !== 0) {
|
27631 | ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent');
|
27632 | ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
|
27633 | }
|
27634 | }
|
27635 | },
|
27636 |
|
27637 | |
27638 |
|
27639 |
|
27640 |
|
27641 |
|
27642 |
|
27643 |
|
27644 | performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
|
27645 | if (internalInstance._updateBatchNumber !== updateBatchNumber) {
|
27646 |
|
27647 |
|
27648 | !(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : invariant(false) : void 0;
|
27649 | return;
|
27650 | }
|
27651 | if (process.env.NODE_ENV !== 'production') {
|
27652 | if (internalInstance._debugID !== 0) {
|
27653 | ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
|
27654 | }
|
27655 | }
|
27656 | internalInstance.performUpdateIfNecessary(transaction);
|
27657 | if (process.env.NODE_ENV !== 'production') {
|
27658 | if (internalInstance._debugID !== 0) {
|
27659 | ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
|
27660 | ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
|
27661 | }
|
27662 | }
|
27663 | }
|
27664 |
|
27665 | };
|
27666 |
|
27667 | module.exports = ReactReconciler;
|
27668 | }).call(this,require(91))
|
27669 | },{"228":228,"244":244,"45":45,"91":91}],244:[function(require,module,exports){
|
27670 |
|
27671 |
|
27672 |
|
27673 |
|
27674 |
|
27675 |
|
27676 |
|
27677 |
|
27678 |
|
27679 |
|
27680 |
|
27681 | 'use strict';
|
27682 |
|
27683 | var ReactOwner = require(238);
|
27684 |
|
27685 | var ReactRef = {};
|
27686 |
|
27687 | function attachRef(ref, component, owner) {
|
27688 | if (typeof ref === 'function') {
|
27689 | ref(component.getPublicInstance());
|
27690 | } else {
|
27691 |
|
27692 | ReactOwner.addComponentAsRefTo(component, ref, owner);
|
27693 | }
|
27694 | }
|
27695 |
|
27696 | function detachRef(ref, component, owner) {
|
27697 | if (typeof ref === 'function') {
|
27698 | ref(null);
|
27699 | } else {
|
27700 |
|
27701 | ReactOwner.removeComponentAsRefFrom(component, ref, owner);
|
27702 | }
|
27703 | }
|
27704 |
|
27705 | ReactRef.attachRefs = function (instance, element) {
|
27706 | if (element === null || element === false) {
|
27707 | return;
|
27708 | }
|
27709 | var ref = element.ref;
|
27710 | if (ref != null) {
|
27711 | attachRef(ref, instance, element._owner);
|
27712 | }
|
27713 | };
|
27714 |
|
27715 | ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
|
27716 |
|
27717 |
|
27718 |
|
27719 |
|
27720 |
|
27721 |
|
27722 |
|
27723 |
|
27724 |
|
27725 |
|
27726 |
|
27727 |
|
27728 | var prevEmpty = prevElement === null || prevElement === false;
|
27729 | var nextEmpty = nextElement === null || nextElement === false;
|
27730 |
|
27731 | return(
|
27732 |
|
27733 | prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
|
27734 | );
|
27735 | };
|
27736 |
|
27737 | ReactRef.detachRefs = function (instance, element) {
|
27738 | if (element === null || element === false) {
|
27739 | return;
|
27740 | }
|
27741 | var ref = element.ref;
|
27742 | if (ref != null) {
|
27743 | detachRef(ref, instance, element._owner);
|
27744 | }
|
27745 | };
|
27746 |
|
27747 | module.exports = ReactRef;
|
27748 | },{"238":238}],245:[function(require,module,exports){
|
27749 |
|
27750 |
|
27751 |
|
27752 |
|
27753 |
|
27754 |
|
27755 |
|
27756 |
|
27757 |
|
27758 |
|
27759 |
|
27760 | 'use strict';
|
27761 |
|
27762 | var _assign = require(296);
|
27763 |
|
27764 | var PooledClass = require(183);
|
27765 | var Transaction = require(265);
|
27766 |
|
27767 |
|
27768 |
|
27769 |
|
27770 |
|
27771 |
|
27772 | var TRANSACTION_WRAPPERS = [];
|
27773 |
|
27774 | var noopCallbackQueue = {
|
27775 | enqueue: function () {}
|
27776 | };
|
27777 |
|
27778 |
|
27779 |
|
27780 |
|
27781 |
|
27782 | function ReactServerRenderingTransaction(renderToStaticMarkup) {
|
27783 | this.reinitializeTransaction();
|
27784 | this.renderToStaticMarkup = renderToStaticMarkup;
|
27785 | this.useCreateElement = false;
|
27786 | }
|
27787 |
|
27788 | var Mixin = {
|
27789 | |
27790 |
|
27791 |
|
27792 |
|
27793 |
|
27794 |
|
27795 | getTransactionWrappers: function () {
|
27796 | return TRANSACTION_WRAPPERS;
|
27797 | },
|
27798 |
|
27799 | |
27800 |
|
27801 |
|
27802 | getReactMountReady: function () {
|
27803 | return noopCallbackQueue;
|
27804 | },
|
27805 |
|
27806 | |
27807 |
|
27808 |
|
27809 |
|
27810 | destructor: function () {},
|
27811 |
|
27812 | checkpoint: function () {},
|
27813 |
|
27814 | rollback: function () {}
|
27815 | };
|
27816 |
|
27817 | _assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
|
27818 |
|
27819 | PooledClass.addPoolingTo(ReactServerRenderingTransaction);
|
27820 |
|
27821 | module.exports = ReactServerRenderingTransaction;
|
27822 | },{"183":183,"265":265,"296":296}],246:[function(require,module,exports){
|
27823 | (function (process){
|
27824 |
|
27825 |
|
27826 |
|
27827 |
|
27828 |
|
27829 |
|
27830 |
|
27831 |
|
27832 |
|
27833 |
|
27834 |
|
27835 | 'use strict';
|
27836 |
|
27837 | var ReactCurrentOwner = require(194);
|
27838 | var ReactInstanceMap = require(227);
|
27839 | var ReactUpdates = require(247);
|
27840 |
|
27841 | var invariant = require(45);
|
27842 | var warning = require(55);
|
27843 |
|
27844 | function enqueueUpdate(internalInstance) {
|
27845 | ReactUpdates.enqueueUpdate(internalInstance);
|
27846 | }
|
27847 |
|
27848 | function formatUnexpectedArgument(arg) {
|
27849 | var type = typeof arg;
|
27850 | if (type !== 'object') {
|
27851 | return type;
|
27852 | }
|
27853 | var displayName = arg.constructor && arg.constructor.name || type;
|
27854 | var keys = Object.keys(arg);
|
27855 | if (keys.length > 0 && keys.length < 20) {
|
27856 | return displayName + ' (keys: ' + keys.join(', ') + ')';
|
27857 | }
|
27858 | return displayName;
|
27859 | }
|
27860 |
|
27861 | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
|
27862 | var internalInstance = ReactInstanceMap.get(publicInstance);
|
27863 | if (!internalInstance) {
|
27864 | if (process.env.NODE_ENV !== 'production') {
|
27865 |
|
27866 |
|
27867 |
|
27868 | process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : void 0;
|
27869 | }
|
27870 | return null;
|
27871 | }
|
27872 |
|
27873 | if (process.env.NODE_ENV !== 'production') {
|
27874 | process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
|
27875 | }
|
27876 |
|
27877 | return internalInstance;
|
27878 | }
|
27879 |
|
27880 |
|
27881 |
|
27882 |
|
27883 |
|
27884 | var ReactUpdateQueue = {
|
27885 |
|
27886 | |
27887 |
|
27888 |
|
27889 |
|
27890 |
|
27891 |
|
27892 |
|
27893 | isMounted: function (publicInstance) {
|
27894 | if (process.env.NODE_ENV !== 'production') {
|
27895 | var owner = ReactCurrentOwner.current;
|
27896 | if (owner !== null) {
|
27897 | process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
|
27898 | owner._warnedAboutRefsInRender = true;
|
27899 | }
|
27900 | }
|
27901 | var internalInstance = ReactInstanceMap.get(publicInstance);
|
27902 | if (internalInstance) {
|
27903 |
|
27904 |
|
27905 |
|
27906 | return !!internalInstance._renderedComponent;
|
27907 | } else {
|
27908 | return false;
|
27909 | }
|
27910 | },
|
27911 |
|
27912 | |
27913 |
|
27914 |
|
27915 |
|
27916 |
|
27917 |
|
27918 |
|
27919 |
|
27920 |
|
27921 | enqueueCallback: function (publicInstance, callback, callerName) {
|
27922 | ReactUpdateQueue.validateCallback(callback, callerName);
|
27923 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
|
27924 |
|
27925 |
|
27926 |
|
27927 |
|
27928 |
|
27929 |
|
27930 | if (!internalInstance) {
|
27931 | return null;
|
27932 | }
|
27933 |
|
27934 | if (internalInstance._pendingCallbacks) {
|
27935 | internalInstance._pendingCallbacks.push(callback);
|
27936 | } else {
|
27937 | internalInstance._pendingCallbacks = [callback];
|
27938 | }
|
27939 |
|
27940 |
|
27941 |
|
27942 |
|
27943 | enqueueUpdate(internalInstance);
|
27944 | },
|
27945 |
|
27946 | enqueueCallbackInternal: function (internalInstance, callback) {
|
27947 | if (internalInstance._pendingCallbacks) {
|
27948 | internalInstance._pendingCallbacks.push(callback);
|
27949 | } else {
|
27950 | internalInstance._pendingCallbacks = [callback];
|
27951 | }
|
27952 | enqueueUpdate(internalInstance);
|
27953 | },
|
27954 |
|
27955 | |
27956 |
|
27957 |
|
27958 |
|
27959 |
|
27960 |
|
27961 |
|
27962 |
|
27963 |
|
27964 |
|
27965 |
|
27966 |
|
27967 |
|
27968 | enqueueForceUpdate: function (publicInstance) {
|
27969 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
|
27970 |
|
27971 | if (!internalInstance) {
|
27972 | return;
|
27973 | }
|
27974 |
|
27975 | internalInstance._pendingForceUpdate = true;
|
27976 |
|
27977 | enqueueUpdate(internalInstance);
|
27978 | },
|
27979 |
|
27980 | |
27981 |
|
27982 |
|
27983 |
|
27984 |
|
27985 |
|
27986 |
|
27987 |
|
27988 |
|
27989 |
|
27990 |
|
27991 | enqueueReplaceState: function (publicInstance, completeState) {
|
27992 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
|
27993 |
|
27994 | if (!internalInstance) {
|
27995 | return;
|
27996 | }
|
27997 |
|
27998 | internalInstance._pendingStateQueue = [completeState];
|
27999 | internalInstance._pendingReplaceState = true;
|
28000 |
|
28001 | enqueueUpdate(internalInstance);
|
28002 | },
|
28003 |
|
28004 | |
28005 |
|
28006 |
|
28007 |
|
28008 |
|
28009 |
|
28010 |
|
28011 |
|
28012 |
|
28013 |
|
28014 | enqueueSetState: function (publicInstance, partialState) {
|
28015 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
|
28016 |
|
28017 | if (!internalInstance) {
|
28018 | return;
|
28019 | }
|
28020 |
|
28021 | var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
|
28022 | queue.push(partialState);
|
28023 |
|
28024 | enqueueUpdate(internalInstance);
|
28025 | },
|
28026 |
|
28027 | enqueueElementInternal: function (internalInstance, newElement) {
|
28028 | internalInstance._pendingElement = newElement;
|
28029 | enqueueUpdate(internalInstance);
|
28030 | },
|
28031 |
|
28032 | validateCallback: function (callback, callerName) {
|
28033 | !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : invariant(false) : void 0;
|
28034 | }
|
28035 |
|
28036 | };
|
28037 |
|
28038 | module.exports = ReactUpdateQueue;
|
28039 | }).call(this,require(91))
|
28040 | },{"194":194,"227":227,"247":247,"45":45,"55":55,"91":91}],247:[function(require,module,exports){
|
28041 | (function (process){
|
28042 |
|
28043 |
|
28044 |
|
28045 |
|
28046 |
|
28047 |
|
28048 |
|
28049 |
|
28050 |
|
28051 |
|
28052 |
|
28053 | 'use strict';
|
28054 |
|
28055 | var _assign = require(296);
|
28056 |
|
28057 | var CallbackQueue = require(163);
|
28058 | var PooledClass = require(183);
|
28059 | var ReactFeatureFlags = require(224);
|
28060 | var ReactInstrumentation = require(228);
|
28061 | var ReactReconciler = require(243);
|
28062 | var Transaction = require(265);
|
28063 |
|
28064 | var invariant = require(45);
|
28065 |
|
28066 | var dirtyComponents = [];
|
28067 | var updateBatchNumber = 0;
|
28068 | var asapCallbackQueue = CallbackQueue.getPooled();
|
28069 | var asapEnqueued = false;
|
28070 |
|
28071 | var batchingStrategy = null;
|
28072 |
|
28073 | function ensureInjected() {
|
28074 | !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : void 0;
|
28075 | }
|
28076 |
|
28077 | var NESTED_UPDATES = {
|
28078 | initialize: function () {
|
28079 | this.dirtyComponentsLength = dirtyComponents.length;
|
28080 | },
|
28081 | close: function () {
|
28082 | if (this.dirtyComponentsLength !== dirtyComponents.length) {
|
28083 |
|
28084 |
|
28085 |
|
28086 |
|
28087 |
|
28088 | dirtyComponents.splice(0, this.dirtyComponentsLength);
|
28089 | flushBatchedUpdates();
|
28090 | } else {
|
28091 | dirtyComponents.length = 0;
|
28092 | }
|
28093 | }
|
28094 | };
|
28095 |
|
28096 | var UPDATE_QUEUEING = {
|
28097 | initialize: function () {
|
28098 | this.callbackQueue.reset();
|
28099 | },
|
28100 | close: function () {
|
28101 | this.callbackQueue.notifyAll();
|
28102 | }
|
28103 | };
|
28104 |
|
28105 | var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
|
28106 |
|
28107 | function ReactUpdatesFlushTransaction() {
|
28108 | this.reinitializeTransaction();
|
28109 | this.dirtyComponentsLength = null;
|
28110 | this.callbackQueue = CallbackQueue.getPooled();
|
28111 | this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
|
28112 | true);
|
28113 | }
|
28114 |
|
28115 | _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
|
28116 | getTransactionWrappers: function () {
|
28117 | return TRANSACTION_WRAPPERS;
|
28118 | },
|
28119 |
|
28120 | destructor: function () {
|
28121 | this.dirtyComponentsLength = null;
|
28122 | CallbackQueue.release(this.callbackQueue);
|
28123 | this.callbackQueue = null;
|
28124 | ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
|
28125 | this.reconcileTransaction = null;
|
28126 | },
|
28127 |
|
28128 | perform: function (method, scope, a) {
|
28129 |
|
28130 |
|
28131 | return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
|
28132 | }
|
28133 | });
|
28134 |
|
28135 | PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
|
28136 |
|
28137 | function batchedUpdates(callback, a, b, c, d, e) {
|
28138 | ensureInjected();
|
28139 | batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
|
28140 | }
|
28141 |
|
28142 |
|
28143 |
|
28144 |
|
28145 |
|
28146 |
|
28147 |
|
28148 |
|
28149 | function mountOrderComparator(c1, c2) {
|
28150 | return c1._mountOrder - c2._mountOrder;
|
28151 | }
|
28152 |
|
28153 | function runBatchedUpdates(transaction) {
|
28154 | var len = transaction.dirtyComponentsLength;
|
28155 | !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : void 0;
|
28156 |
|
28157 |
|
28158 |
|
28159 |
|
28160 | dirtyComponents.sort(mountOrderComparator);
|
28161 |
|
28162 |
|
28163 |
|
28164 |
|
28165 |
|
28166 |
|
28167 | updateBatchNumber++;
|
28168 |
|
28169 | for (var i = 0; i < len; i++) {
|
28170 |
|
28171 |
|
28172 |
|
28173 | var component = dirtyComponents[i];
|
28174 |
|
28175 |
|
28176 |
|
28177 |
|
28178 | var callbacks = component._pendingCallbacks;
|
28179 | component._pendingCallbacks = null;
|
28180 |
|
28181 | var markerName;
|
28182 | if (ReactFeatureFlags.logTopLevelRenders) {
|
28183 | var namedComponent = component;
|
28184 |
|
28185 | if (component._currentElement.props === component._renderedComponent._currentElement) {
|
28186 | namedComponent = component._renderedComponent;
|
28187 | }
|
28188 | markerName = 'React update: ' + namedComponent.getName();
|
28189 | console.time(markerName);
|
28190 | }
|
28191 |
|
28192 | ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
|
28193 |
|
28194 | if (markerName) {
|
28195 | console.timeEnd(markerName);
|
28196 | }
|
28197 |
|
28198 | if (callbacks) {
|
28199 | for (var j = 0; j < callbacks.length; j++) {
|
28200 | transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
|
28201 | }
|
28202 | }
|
28203 | }
|
28204 | }
|
28205 |
|
28206 | var flushBatchedUpdates = function () {
|
28207 | if (process.env.NODE_ENV !== 'production') {
|
28208 | ReactInstrumentation.debugTool.onBeginFlush();
|
28209 | }
|
28210 |
|
28211 |
|
28212 |
|
28213 |
|
28214 |
|
28215 | while (dirtyComponents.length || asapEnqueued) {
|
28216 | if (dirtyComponents.length) {
|
28217 | var transaction = ReactUpdatesFlushTransaction.getPooled();
|
28218 | transaction.perform(runBatchedUpdates, null, transaction);
|
28219 | ReactUpdatesFlushTransaction.release(transaction);
|
28220 | }
|
28221 |
|
28222 | if (asapEnqueued) {
|
28223 | asapEnqueued = false;
|
28224 | var queue = asapCallbackQueue;
|
28225 | asapCallbackQueue = CallbackQueue.getPooled();
|
28226 | queue.notifyAll();
|
28227 | CallbackQueue.release(queue);
|
28228 | }
|
28229 | }
|
28230 |
|
28231 | if (process.env.NODE_ENV !== 'production') {
|
28232 | ReactInstrumentation.debugTool.onEndFlush();
|
28233 | }
|
28234 | };
|
28235 |
|
28236 |
|
28237 |
|
28238 |
|
28239 |
|
28240 | function enqueueUpdate(component) {
|
28241 | ensureInjected();
|
28242 |
|
28243 |
|
28244 |
|
28245 |
|
28246 |
|
28247 |
|
28248 |
|
28249 | if (!batchingStrategy.isBatchingUpdates) {
|
28250 | batchingStrategy.batchedUpdates(enqueueUpdate, component);
|
28251 | return;
|
28252 | }
|
28253 |
|
28254 | dirtyComponents.push(component);
|
28255 | if (component._updateBatchNumber == null) {
|
28256 | component._updateBatchNumber = updateBatchNumber + 1;
|
28257 | }
|
28258 | }
|
28259 |
|
28260 |
|
28261 |
|
28262 |
|
28263 |
|
28264 | function asap(callback, context) {
|
28265 | !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;
|
28266 | asapCallbackQueue.enqueue(callback, context);
|
28267 | asapEnqueued = true;
|
28268 | }
|
28269 |
|
28270 | var ReactUpdatesInjection = {
|
28271 | injectReconcileTransaction: function (ReconcileTransaction) {
|
28272 | !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : void 0;
|
28273 | ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
|
28274 | },
|
28275 |
|
28276 | injectBatchingStrategy: function (_batchingStrategy) {
|
28277 | !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : void 0;
|
28278 | !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : void 0;
|
28279 | !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : void 0;
|
28280 | batchingStrategy = _batchingStrategy;
|
28281 | }
|
28282 | };
|
28283 |
|
28284 | var ReactUpdates = {
|
28285 | |
28286 |
|
28287 |
|
28288 |
|
28289 |
|
28290 |
|
28291 | ReactReconcileTransaction: null,
|
28292 |
|
28293 | batchedUpdates: batchedUpdates,
|
28294 | enqueueUpdate: enqueueUpdate,
|
28295 | flushBatchedUpdates: flushBatchedUpdates,
|
28296 | injection: ReactUpdatesInjection,
|
28297 | asap: asap
|
28298 | };
|
28299 |
|
28300 | module.exports = ReactUpdates;
|
28301 | }).call(this,require(91))
|
28302 | },{"163":163,"183":183,"224":224,"228":228,"243":243,"265":265,"296":296,"45":45,"91":91}],248:[function(require,module,exports){
|
28303 |
|
28304 |
|
28305 |
|
28306 |
|
28307 |
|
28308 |
|
28309 |
|
28310 |
|
28311 |
|
28312 |
|
28313 |
|
28314 | 'use strict';
|
28315 |
|
28316 | module.exports = '15.1.0';
|
28317 | },{}],249:[function(require,module,exports){
|
28318 |
|
28319 |
|
28320 |
|
28321 |
|
28322 |
|
28323 |
|
28324 |
|
28325 |
|
28326 |
|
28327 |
|
28328 |
|
28329 | 'use strict';
|
28330 |
|
28331 | var NS = {
|
28332 | xlink: 'http://www.w3.org/1999/xlink',
|
28333 | xml: 'http://www.w3.org/XML/1998/namespace'
|
28334 | };
|
28335 |
|
28336 |
|
28337 |
|
28338 |
|
28339 |
|
28340 |
|
28341 |
|
28342 |
|
28343 |
|
28344 |
|
28345 |
|
28346 |
|
28347 |
|
28348 |
|
28349 |
|
28350 |
|
28351 |
|
28352 |
|
28353 | var ATTRS = {
|
28354 | accentHeight: 'accent-height',
|
28355 | accumulate: 0,
|
28356 | additive: 0,
|
28357 | alignmentBaseline: 'alignment-baseline',
|
28358 | allowReorder: 'allowReorder',
|
28359 | alphabetic: 0,
|
28360 | amplitude: 0,
|
28361 | arabicForm: 'arabic-form',
|
28362 | ascent: 0,
|
28363 | attributeName: 'attributeName',
|
28364 | attributeType: 'attributeType',
|
28365 | autoReverse: 'autoReverse',
|
28366 | azimuth: 0,
|
28367 | baseFrequency: 'baseFrequency',
|
28368 | baseProfile: 'baseProfile',
|
28369 | baselineShift: 'baseline-shift',
|
28370 | bbox: 0,
|
28371 | begin: 0,
|
28372 | bias: 0,
|
28373 | by: 0,
|
28374 | calcMode: 'calcMode',
|
28375 | capHeight: 'cap-height',
|
28376 | clip: 0,
|
28377 | clipPath: 'clip-path',
|
28378 | clipRule: 'clip-rule',
|
28379 | clipPathUnits: 'clipPathUnits',
|
28380 | colorInterpolation: 'color-interpolation',
|
28381 | colorInterpolationFilters: 'color-interpolation-filters',
|
28382 | colorProfile: 'color-profile',
|
28383 | colorRendering: 'color-rendering',
|
28384 | contentScriptType: 'contentScriptType',
|
28385 | contentStyleType: 'contentStyleType',
|
28386 | cursor: 0,
|
28387 | cx: 0,
|
28388 | cy: 0,
|
28389 | d: 0,
|
28390 | decelerate: 0,
|
28391 | descent: 0,
|
28392 | diffuseConstant: 'diffuseConstant',
|
28393 | direction: 0,
|
28394 | display: 0,
|
28395 | divisor: 0,
|
28396 | dominantBaseline: 'dominant-baseline',
|
28397 | dur: 0,
|
28398 | dx: 0,
|
28399 | dy: 0,
|
28400 | edgeMode: 'edgeMode',
|
28401 | elevation: 0,
|
28402 | enableBackground: 'enable-background',
|
28403 | end: 0,
|
28404 | exponent: 0,
|
28405 | externalResourcesRequired: 'externalResourcesRequired',
|
28406 | fill: 0,
|
28407 | fillOpacity: 'fill-opacity',
|
28408 | fillRule: 'fill-rule',
|
28409 | filter: 0,
|
28410 | filterRes: 'filterRes',
|
28411 | filterUnits: 'filterUnits',
|
28412 | floodColor: 'flood-color',
|
28413 | floodOpacity: 'flood-opacity',
|
28414 | focusable: 0,
|
28415 | fontFamily: 'font-family',
|
28416 | fontSize: 'font-size',
|
28417 | fontSizeAdjust: 'font-size-adjust',
|
28418 | fontStretch: 'font-stretch',
|
28419 | fontStyle: 'font-style',
|
28420 | fontVariant: 'font-variant',
|
28421 | fontWeight: 'font-weight',
|
28422 | format: 0,
|
28423 | from: 0,
|
28424 | fx: 0,
|
28425 | fy: 0,
|
28426 | g1: 0,
|
28427 | g2: 0,
|
28428 | glyphName: 'glyph-name',
|
28429 | glyphOrientationHorizontal: 'glyph-orientation-horizontal',
|
28430 | glyphOrientationVertical: 'glyph-orientation-vertical',
|
28431 | glyphRef: 'glyphRef',
|
28432 | gradientTransform: 'gradientTransform',
|
28433 | gradientUnits: 'gradientUnits',
|
28434 | hanging: 0,
|
28435 | horizAdvX: 'horiz-adv-x',
|
28436 | horizOriginX: 'horiz-origin-x',
|
28437 | ideographic: 0,
|
28438 | imageRendering: 'image-rendering',
|
28439 | 'in': 0,
|
28440 | in2: 0,
|
28441 | intercept: 0,
|
28442 | k: 0,
|
28443 | k1: 0,
|
28444 | k2: 0,
|
28445 | k3: 0,
|
28446 | k4: 0,
|
28447 | kernelMatrix: 'kernelMatrix',
|
28448 | kernelUnitLength: 'kernelUnitLength',
|
28449 | kerning: 0,
|
28450 | keyPoints: 'keyPoints',
|
28451 | keySplines: 'keySplines',
|
28452 | keyTimes: 'keyTimes',
|
28453 | lengthAdjust: 'lengthAdjust',
|
28454 | letterSpacing: 'letter-spacing',
|
28455 | lightingColor: 'lighting-color',
|
28456 | limitingConeAngle: 'limitingConeAngle',
|
28457 | local: 0,
|
28458 | markerEnd: 'marker-end',
|
28459 | markerMid: 'marker-mid',
|
28460 | markerStart: 'marker-start',
|
28461 | markerHeight: 'markerHeight',
|
28462 | markerUnits: 'markerUnits',
|
28463 | markerWidth: 'markerWidth',
|
28464 | mask: 0,
|
28465 | maskContentUnits: 'maskContentUnits',
|
28466 | maskUnits: 'maskUnits',
|
28467 | mathematical: 0,
|
28468 | mode: 0,
|
28469 | numOctaves: 'numOctaves',
|
28470 | offset: 0,
|
28471 | opacity: 0,
|
28472 | operator: 0,
|
28473 | order: 0,
|
28474 | orient: 0,
|
28475 | orientation: 0,
|
28476 | origin: 0,
|
28477 | overflow: 0,
|
28478 | overlinePosition: 'overline-position',
|
28479 | overlineThickness: 'overline-thickness',
|
28480 | paintOrder: 'paint-order',
|
28481 | panose1: 'panose-1',
|
28482 | pathLength: 'pathLength',
|
28483 | patternContentUnits: 'patternContentUnits',
|
28484 | patternTransform: 'patternTransform',
|
28485 | patternUnits: 'patternUnits',
|
28486 | pointerEvents: 'pointer-events',
|
28487 | points: 0,
|
28488 | pointsAtX: 'pointsAtX',
|
28489 | pointsAtY: 'pointsAtY',
|
28490 | pointsAtZ: 'pointsAtZ',
|
28491 | preserveAlpha: 'preserveAlpha',
|
28492 | preserveAspectRatio: 'preserveAspectRatio',
|
28493 | primitiveUnits: 'primitiveUnits',
|
28494 | r: 0,
|
28495 | radius: 0,
|
28496 | refX: 'refX',
|
28497 | refY: 'refY',
|
28498 | renderingIntent: 'rendering-intent',
|
28499 | repeatCount: 'repeatCount',
|
28500 | repeatDur: 'repeatDur',
|
28501 | requiredExtensions: 'requiredExtensions',
|
28502 | requiredFeatures: 'requiredFeatures',
|
28503 | restart: 0,
|
28504 | result: 0,
|
28505 | rotate: 0,
|
28506 | rx: 0,
|
28507 | ry: 0,
|
28508 | scale: 0,
|
28509 | seed: 0,
|
28510 | shapeRendering: 'shape-rendering',
|
28511 | slope: 0,
|
28512 | spacing: 0,
|
28513 | specularConstant: 'specularConstant',
|
28514 | specularExponent: 'specularExponent',
|
28515 | speed: 0,
|
28516 | spreadMethod: 'spreadMethod',
|
28517 | startOffset: 'startOffset',
|
28518 | stdDeviation: 'stdDeviation',
|
28519 | stemh: 0,
|
28520 | stemv: 0,
|
28521 | stitchTiles: 'stitchTiles',
|
28522 | stopColor: 'stop-color',
|
28523 | stopOpacity: 'stop-opacity',
|
28524 | strikethroughPosition: 'strikethrough-position',
|
28525 | strikethroughThickness: 'strikethrough-thickness',
|
28526 | string: 0,
|
28527 | stroke: 0,
|
28528 | strokeDasharray: 'stroke-dasharray',
|
28529 | strokeDashoffset: 'stroke-dashoffset',
|
28530 | strokeLinecap: 'stroke-linecap',
|
28531 | strokeLinejoin: 'stroke-linejoin',
|
28532 | strokeMiterlimit: 'stroke-miterlimit',
|
28533 | strokeOpacity: 'stroke-opacity',
|
28534 | strokeWidth: 'stroke-width',
|
28535 | surfaceScale: 'surfaceScale',
|
28536 | systemLanguage: 'systemLanguage',
|
28537 | tableValues: 'tableValues',
|
28538 | targetX: 'targetX',
|
28539 | targetY: 'targetY',
|
28540 | textAnchor: 'text-anchor',
|
28541 | textDecoration: 'text-decoration',
|
28542 | textRendering: 'text-rendering',
|
28543 | textLength: 'textLength',
|
28544 | to: 0,
|
28545 | transform: 0,
|
28546 | u1: 0,
|
28547 | u2: 0,
|
28548 | underlinePosition: 'underline-position',
|
28549 | underlineThickness: 'underline-thickness',
|
28550 | unicode: 0,
|
28551 | unicodeBidi: 'unicode-bidi',
|
28552 | unicodeRange: 'unicode-range',
|
28553 | unitsPerEm: 'units-per-em',
|
28554 | vAlphabetic: 'v-alphabetic',
|
28555 | vHanging: 'v-hanging',
|
28556 | vIdeographic: 'v-ideographic',
|
28557 | vMathematical: 'v-mathematical',
|
28558 | values: 0,
|
28559 | vectorEffect: 'vector-effect',
|
28560 | version: 0,
|
28561 | vertAdvY: 'vert-adv-y',
|
28562 | vertOriginX: 'vert-origin-x',
|
28563 | vertOriginY: 'vert-origin-y',
|
28564 | viewBox: 'viewBox',
|
28565 | viewTarget: 'viewTarget',
|
28566 | visibility: 0,
|
28567 | widths: 0,
|
28568 | wordSpacing: 'word-spacing',
|
28569 | writingMode: 'writing-mode',
|
28570 | x: 0,
|
28571 | xHeight: 'x-height',
|
28572 | x1: 0,
|
28573 | x2: 0,
|
28574 | xChannelSelector: 'xChannelSelector',
|
28575 | xlinkActuate: 'xlink:actuate',
|
28576 | xlinkArcrole: 'xlink:arcrole',
|
28577 | xlinkHref: 'xlink:href',
|
28578 | xlinkRole: 'xlink:role',
|
28579 | xlinkShow: 'xlink:show',
|
28580 | xlinkTitle: 'xlink:title',
|
28581 | xlinkType: 'xlink:type',
|
28582 | xmlBase: 'xml:base',
|
28583 | xmlLang: 'xml:lang',
|
28584 | xmlSpace: 'xml:space',
|
28585 | y: 0,
|
28586 | y1: 0,
|
28587 | y2: 0,
|
28588 | yChannelSelector: 'yChannelSelector',
|
28589 | z: 0,
|
28590 | zoomAndPan: 'zoomAndPan'
|
28591 | };
|
28592 |
|
28593 | var SVGDOMPropertyConfig = {
|
28594 | Properties: {},
|
28595 | DOMAttributeNamespaces: {
|
28596 | xlinkActuate: NS.xlink,
|
28597 | xlinkArcrole: NS.xlink,
|
28598 | xlinkHref: NS.xlink,
|
28599 | xlinkRole: NS.xlink,
|
28600 | xlinkShow: NS.xlink,
|
28601 | xlinkTitle: NS.xlink,
|
28602 | xlinkType: NS.xlink,
|
28603 | xmlBase: NS.xml,
|
28604 | xmlLang: NS.xml,
|
28605 | xmlSpace: NS.xml
|
28606 | },
|
28607 | DOMAttributeNames: {}
|
28608 | };
|
28609 |
|
28610 | Object.keys(ATTRS).forEach(function (key) {
|
28611 | SVGDOMPropertyConfig.Properties[key] = 0;
|
28612 | if (ATTRS[key]) {
|
28613 | SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
|
28614 | }
|
28615 | });
|
28616 |
|
28617 | module.exports = SVGDOMPropertyConfig;
|
28618 | },{}],250:[function(require,module,exports){
|
28619 |
|
28620 |
|
28621 |
|
28622 |
|
28623 |
|
28624 |
|
28625 |
|
28626 |
|
28627 |
|
28628 |
|
28629 |
|
28630 | 'use strict';
|
28631 |
|
28632 | var EventConstants = require(174);
|
28633 | var EventPropagators = require(178);
|
28634 | var ExecutionEnvironment = require(31);
|
28635 | var ReactDOMComponentTree = require(199);
|
28636 | var ReactInputSelection = require(226);
|
28637 | var SyntheticEvent = require(256);
|
28638 |
|
28639 | var getActiveElement = require(40);
|
28640 | var isTextInputElement = require(287);
|
28641 | var keyOf = require(49);
|
28642 | var shallowEqual = require(54);
|
28643 |
|
28644 | var topLevelTypes = EventConstants.topLevelTypes;
|
28645 |
|
28646 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
|
28647 |
|
28648 | var eventTypes = {
|
28649 | select: {
|
28650 | phasedRegistrationNames: {
|
28651 | bubbled: keyOf({ onSelect: null }),
|
28652 | captured: keyOf({ onSelectCapture: null })
|
28653 | },
|
28654 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
|
28655 | }
|
28656 | };
|
28657 |
|
28658 | var activeElement = null;
|
28659 | var activeElementInst = null;
|
28660 | var lastSelection = null;
|
28661 | var mouseDown = false;
|
28662 |
|
28663 |
|
28664 |
|
28665 | var hasListener = false;
|
28666 | var ON_SELECT_KEY = keyOf({ onSelect: null });
|
28667 |
|
28668 |
|
28669 |
|
28670 |
|
28671 |
|
28672 |
|
28673 |
|
28674 |
|
28675 |
|
28676 |
|
28677 | function getSelection(node) {
|
28678 | if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
|
28679 | return {
|
28680 | start: node.selectionStart,
|
28681 | end: node.selectionEnd
|
28682 | };
|
28683 | } else if (window.getSelection) {
|
28684 | var selection = window.getSelection();
|
28685 | return {
|
28686 | anchorNode: selection.anchorNode,
|
28687 | anchorOffset: selection.anchorOffset,
|
28688 | focusNode: selection.focusNode,
|
28689 | focusOffset: selection.focusOffset
|
28690 | };
|
28691 | } else if (document.selection) {
|
28692 | var range = document.selection.createRange();
|
28693 | return {
|
28694 | parentElement: range.parentElement(),
|
28695 | text: range.text,
|
28696 | top: range.boundingTop,
|
28697 | left: range.boundingLeft
|
28698 | };
|
28699 | }
|
28700 | }
|
28701 |
|
28702 |
|
28703 |
|
28704 |
|
28705 |
|
28706 |
|
28707 |
|
28708 | function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
28709 |
|
28710 |
|
28711 |
|
28712 |
|
28713 | if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
|
28714 | return null;
|
28715 | }
|
28716 |
|
28717 |
|
28718 | var currentSelection = getSelection(activeElement);
|
28719 | if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
28720 | lastSelection = currentSelection;
|
28721 |
|
28722 | var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
|
28723 |
|
28724 | syntheticEvent.type = 'select';
|
28725 | syntheticEvent.target = activeElement;
|
28726 |
|
28727 | EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
|
28728 |
|
28729 | return syntheticEvent;
|
28730 | }
|
28731 |
|
28732 | return null;
|
28733 | }
|
28734 |
|
28735 |
|
28736 |
|
28737 |
|
28738 |
|
28739 |
|
28740 |
|
28741 |
|
28742 |
|
28743 |
|
28744 |
|
28745 |
|
28746 |
|
28747 |
|
28748 |
|
28749 | var SelectEventPlugin = {
|
28750 |
|
28751 | eventTypes: eventTypes,
|
28752 |
|
28753 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
28754 | if (!hasListener) {
|
28755 | return null;
|
28756 | }
|
28757 |
|
28758 | var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
|
28759 |
|
28760 | switch (topLevelType) {
|
28761 |
|
28762 | case topLevelTypes.topFocus:
|
28763 | if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
|
28764 | activeElement = targetNode;
|
28765 | activeElementInst = targetInst;
|
28766 | lastSelection = null;
|
28767 | }
|
28768 | break;
|
28769 | case topLevelTypes.topBlur:
|
28770 | activeElement = null;
|
28771 | activeElementInst = null;
|
28772 | lastSelection = null;
|
28773 | break;
|
28774 |
|
28775 |
|
28776 |
|
28777 | case topLevelTypes.topMouseDown:
|
28778 | mouseDown = true;
|
28779 | break;
|
28780 | case topLevelTypes.topContextMenu:
|
28781 | case topLevelTypes.topMouseUp:
|
28782 | mouseDown = false;
|
28783 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
28784 |
|
28785 |
|
28786 |
|
28787 |
|
28788 |
|
28789 |
|
28790 |
|
28791 |
|
28792 |
|
28793 |
|
28794 | case topLevelTypes.topSelectionChange:
|
28795 | if (skipSelectionChangeEvent) {
|
28796 | break;
|
28797 | }
|
28798 |
|
28799 | case topLevelTypes.topKeyDown:
|
28800 | case topLevelTypes.topKeyUp:
|
28801 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
28802 | }
|
28803 |
|
28804 | return null;
|
28805 | },
|
28806 |
|
28807 | didPutListener: function (inst, registrationName, listener) {
|
28808 | if (registrationName === ON_SELECT_KEY) {
|
28809 | hasListener = true;
|
28810 | }
|
28811 | }
|
28812 | };
|
28813 |
|
28814 | module.exports = SelectEventPlugin;
|
28815 | },{"174":174,"178":178,"199":199,"226":226,"256":256,"287":287,"31":31,"40":40,"49":49,"54":54}],251:[function(require,module,exports){
|
28816 | (function (process){
|
28817 |
|
28818 |
|
28819 |
|
28820 |
|
28821 |
|
28822 |
|
28823 |
|
28824 |
|
28825 |
|
28826 |
|
28827 |
|
28828 | 'use strict';
|
28829 |
|
28830 | var EventConstants = require(174);
|
28831 | var EventListener = require(30);
|
28832 | var EventPropagators = require(178);
|
28833 | var ReactDOMComponentTree = require(199);
|
28834 | var SyntheticAnimationEvent = require(252);
|
28835 | var SyntheticClipboardEvent = require(253);
|
28836 | var SyntheticEvent = require(256);
|
28837 | var SyntheticFocusEvent = require(257);
|
28838 | var SyntheticKeyboardEvent = require(259);
|
28839 | var SyntheticMouseEvent = require(260);
|
28840 | var SyntheticDragEvent = require(255);
|
28841 | var SyntheticTouchEvent = require(261);
|
28842 | var SyntheticTransitionEvent = require(262);
|
28843 | var SyntheticUIEvent = require(263);
|
28844 | var SyntheticWheelEvent = require(264);
|
28845 |
|
28846 | var emptyFunction = require(37);
|
28847 | var getEventCharCode = require(276);
|
28848 | var invariant = require(45);
|
28849 | var keyOf = require(49);
|
28850 |
|
28851 | var topLevelTypes = EventConstants.topLevelTypes;
|
28852 |
|
28853 | var eventTypes = {
|
28854 | abort: {
|
28855 | phasedRegistrationNames: {
|
28856 | bubbled: keyOf({ onAbort: true }),
|
28857 | captured: keyOf({ onAbortCapture: true })
|
28858 | }
|
28859 | },
|
28860 | animationEnd: {
|
28861 | phasedRegistrationNames: {
|
28862 | bubbled: keyOf({ onAnimationEnd: true }),
|
28863 | captured: keyOf({ onAnimationEndCapture: true })
|
28864 | }
|
28865 | },
|
28866 | animationIteration: {
|
28867 | phasedRegistrationNames: {
|
28868 | bubbled: keyOf({ onAnimationIteration: true }),
|
28869 | captured: keyOf({ onAnimationIterationCapture: true })
|
28870 | }
|
28871 | },
|
28872 | animationStart: {
|
28873 | phasedRegistrationNames: {
|
28874 | bubbled: keyOf({ onAnimationStart: true }),
|
28875 | captured: keyOf({ onAnimationStartCapture: true })
|
28876 | }
|
28877 | },
|
28878 | blur: {
|
28879 | phasedRegistrationNames: {
|
28880 | bubbled: keyOf({ onBlur: true }),
|
28881 | captured: keyOf({ onBlurCapture: true })
|
28882 | }
|
28883 | },
|
28884 | canPlay: {
|
28885 | phasedRegistrationNames: {
|
28886 | bubbled: keyOf({ onCanPlay: true }),
|
28887 | captured: keyOf({ onCanPlayCapture: true })
|
28888 | }
|
28889 | },
|
28890 | canPlayThrough: {
|
28891 | phasedRegistrationNames: {
|
28892 | bubbled: keyOf({ onCanPlayThrough: true }),
|
28893 | captured: keyOf({ onCanPlayThroughCapture: true })
|
28894 | }
|
28895 | },
|
28896 | click: {
|
28897 | phasedRegistrationNames: {
|
28898 | bubbled: keyOf({ onClick: true }),
|
28899 | captured: keyOf({ onClickCapture: true })
|
28900 | }
|
28901 | },
|
28902 | contextMenu: {
|
28903 | phasedRegistrationNames: {
|
28904 | bubbled: keyOf({ onContextMenu: true }),
|
28905 | captured: keyOf({ onContextMenuCapture: true })
|
28906 | }
|
28907 | },
|
28908 | copy: {
|
28909 | phasedRegistrationNames: {
|
28910 | bubbled: keyOf({ onCopy: true }),
|
28911 | captured: keyOf({ onCopyCapture: true })
|
28912 | }
|
28913 | },
|
28914 | cut: {
|
28915 | phasedRegistrationNames: {
|
28916 | bubbled: keyOf({ onCut: true }),
|
28917 | captured: keyOf({ onCutCapture: true })
|
28918 | }
|
28919 | },
|
28920 | doubleClick: {
|
28921 | phasedRegistrationNames: {
|
28922 | bubbled: keyOf({ onDoubleClick: true }),
|
28923 | captured: keyOf({ onDoubleClickCapture: true })
|
28924 | }
|
28925 | },
|
28926 | drag: {
|
28927 | phasedRegistrationNames: {
|
28928 | bubbled: keyOf({ onDrag: true }),
|
28929 | captured: keyOf({ onDragCapture: true })
|
28930 | }
|
28931 | },
|
28932 | dragEnd: {
|
28933 | phasedRegistrationNames: {
|
28934 | bubbled: keyOf({ onDragEnd: true }),
|
28935 | captured: keyOf({ onDragEndCapture: true })
|
28936 | }
|
28937 | },
|
28938 | dragEnter: {
|
28939 | phasedRegistrationNames: {
|
28940 | bubbled: keyOf({ onDragEnter: true }),
|
28941 | captured: keyOf({ onDragEnterCapture: true })
|
28942 | }
|
28943 | },
|
28944 | dragExit: {
|
28945 | phasedRegistrationNames: {
|
28946 | bubbled: keyOf({ onDragExit: true }),
|
28947 | captured: keyOf({ onDragExitCapture: true })
|
28948 | }
|
28949 | },
|
28950 | dragLeave: {
|
28951 | phasedRegistrationNames: {
|
28952 | bubbled: keyOf({ onDragLeave: true }),
|
28953 | captured: keyOf({ onDragLeaveCapture: true })
|
28954 | }
|
28955 | },
|
28956 | dragOver: {
|
28957 | phasedRegistrationNames: {
|
28958 | bubbled: keyOf({ onDragOver: true }),
|
28959 | captured: keyOf({ onDragOverCapture: true })
|
28960 | }
|
28961 | },
|
28962 | dragStart: {
|
28963 | phasedRegistrationNames: {
|
28964 | bubbled: keyOf({ onDragStart: true }),
|
28965 | captured: keyOf({ onDragStartCapture: true })
|
28966 | }
|
28967 | },
|
28968 | drop: {
|
28969 | phasedRegistrationNames: {
|
28970 | bubbled: keyOf({ onDrop: true }),
|
28971 | captured: keyOf({ onDropCapture: true })
|
28972 | }
|
28973 | },
|
28974 | durationChange: {
|
28975 | phasedRegistrationNames: {
|
28976 | bubbled: keyOf({ onDurationChange: true }),
|
28977 | captured: keyOf({ onDurationChangeCapture: true })
|
28978 | }
|
28979 | },
|
28980 | emptied: {
|
28981 | phasedRegistrationNames: {
|
28982 | bubbled: keyOf({ onEmptied: true }),
|
28983 | captured: keyOf({ onEmptiedCapture: true })
|
28984 | }
|
28985 | },
|
28986 | encrypted: {
|
28987 | phasedRegistrationNames: {
|
28988 | bubbled: keyOf({ onEncrypted: true }),
|
28989 | captured: keyOf({ onEncryptedCapture: true })
|
28990 | }
|
28991 | },
|
28992 | ended: {
|
28993 | phasedRegistrationNames: {
|
28994 | bubbled: keyOf({ onEnded: true }),
|
28995 | captured: keyOf({ onEndedCapture: true })
|
28996 | }
|
28997 | },
|
28998 | error: {
|
28999 | phasedRegistrationNames: {
|
29000 | bubbled: keyOf({ onError: true }),
|
29001 | captured: keyOf({ onErrorCapture: true })
|
29002 | }
|
29003 | },
|
29004 | focus: {
|
29005 | phasedRegistrationNames: {
|
29006 | bubbled: keyOf({ onFocus: true }),
|
29007 | captured: keyOf({ onFocusCapture: true })
|
29008 | }
|
29009 | },
|
29010 | input: {
|
29011 | phasedRegistrationNames: {
|
29012 | bubbled: keyOf({ onInput: true }),
|
29013 | captured: keyOf({ onInputCapture: true })
|
29014 | }
|
29015 | },
|
29016 | invalid: {
|
29017 | phasedRegistrationNames: {
|
29018 | bubbled: keyOf({ onInvalid: true }),
|
29019 | captured: keyOf({ onInvalidCapture: true })
|
29020 | }
|
29021 | },
|
29022 | keyDown: {
|
29023 | phasedRegistrationNames: {
|
29024 | bubbled: keyOf({ onKeyDown: true }),
|
29025 | captured: keyOf({ onKeyDownCapture: true })
|
29026 | }
|
29027 | },
|
29028 | keyPress: {
|
29029 | phasedRegistrationNames: {
|
29030 | bubbled: keyOf({ onKeyPress: true }),
|
29031 | captured: keyOf({ onKeyPressCapture: true })
|
29032 | }
|
29033 | },
|
29034 | keyUp: {
|
29035 | phasedRegistrationNames: {
|
29036 | bubbled: keyOf({ onKeyUp: true }),
|
29037 | captured: keyOf({ onKeyUpCapture: true })
|
29038 | }
|
29039 | },
|
29040 | load: {
|
29041 | phasedRegistrationNames: {
|
29042 | bubbled: keyOf({ onLoad: true }),
|
29043 | captured: keyOf({ onLoadCapture: true })
|
29044 | }
|
29045 | },
|
29046 | loadedData: {
|
29047 | phasedRegistrationNames: {
|
29048 | bubbled: keyOf({ onLoadedData: true }),
|
29049 | captured: keyOf({ onLoadedDataCapture: true })
|
29050 | }
|
29051 | },
|
29052 | loadedMetadata: {
|
29053 | phasedRegistrationNames: {
|
29054 | bubbled: keyOf({ onLoadedMetadata: true }),
|
29055 | captured: keyOf({ onLoadedMetadataCapture: true })
|
29056 | }
|
29057 | },
|
29058 | loadStart: {
|
29059 | phasedRegistrationNames: {
|
29060 | bubbled: keyOf({ onLoadStart: true }),
|
29061 | captured: keyOf({ onLoadStartCapture: true })
|
29062 | }
|
29063 | },
|
29064 |
|
29065 |
|
29066 | mouseDown: {
|
29067 | phasedRegistrationNames: {
|
29068 | bubbled: keyOf({ onMouseDown: true }),
|
29069 | captured: keyOf({ onMouseDownCapture: true })
|
29070 | }
|
29071 | },
|
29072 | mouseMove: {
|
29073 | phasedRegistrationNames: {
|
29074 | bubbled: keyOf({ onMouseMove: true }),
|
29075 | captured: keyOf({ onMouseMoveCapture: true })
|
29076 | }
|
29077 | },
|
29078 | mouseOut: {
|
29079 | phasedRegistrationNames: {
|
29080 | bubbled: keyOf({ onMouseOut: true }),
|
29081 | captured: keyOf({ onMouseOutCapture: true })
|
29082 | }
|
29083 | },
|
29084 | mouseOver: {
|
29085 | phasedRegistrationNames: {
|
29086 | bubbled: keyOf({ onMouseOver: true }),
|
29087 | captured: keyOf({ onMouseOverCapture: true })
|
29088 | }
|
29089 | },
|
29090 | mouseUp: {
|
29091 | phasedRegistrationNames: {
|
29092 | bubbled: keyOf({ onMouseUp: true }),
|
29093 | captured: keyOf({ onMouseUpCapture: true })
|
29094 | }
|
29095 | },
|
29096 | paste: {
|
29097 | phasedRegistrationNames: {
|
29098 | bubbled: keyOf({ onPaste: true }),
|
29099 | captured: keyOf({ onPasteCapture: true })
|
29100 | }
|
29101 | },
|
29102 | pause: {
|
29103 | phasedRegistrationNames: {
|
29104 | bubbled: keyOf({ onPause: true }),
|
29105 | captured: keyOf({ onPauseCapture: true })
|
29106 | }
|
29107 | },
|
29108 | play: {
|
29109 | phasedRegistrationNames: {
|
29110 | bubbled: keyOf({ onPlay: true }),
|
29111 | captured: keyOf({ onPlayCapture: true })
|
29112 | }
|
29113 | },
|
29114 | playing: {
|
29115 | phasedRegistrationNames: {
|
29116 | bubbled: keyOf({ onPlaying: true }),
|
29117 | captured: keyOf({ onPlayingCapture: true })
|
29118 | }
|
29119 | },
|
29120 | progress: {
|
29121 | phasedRegistrationNames: {
|
29122 | bubbled: keyOf({ onProgress: true }),
|
29123 | captured: keyOf({ onProgressCapture: true })
|
29124 | }
|
29125 | },
|
29126 | rateChange: {
|
29127 | phasedRegistrationNames: {
|
29128 | bubbled: keyOf({ onRateChange: true }),
|
29129 | captured: keyOf({ onRateChangeCapture: true })
|
29130 | }
|
29131 | },
|
29132 | reset: {
|
29133 | phasedRegistrationNames: {
|
29134 | bubbled: keyOf({ onReset: true }),
|
29135 | captured: keyOf({ onResetCapture: true })
|
29136 | }
|
29137 | },
|
29138 | scroll: {
|
29139 | phasedRegistrationNames: {
|
29140 | bubbled: keyOf({ onScroll: true }),
|
29141 | captured: keyOf({ onScrollCapture: true })
|
29142 | }
|
29143 | },
|
29144 | seeked: {
|
29145 | phasedRegistrationNames: {
|
29146 | bubbled: keyOf({ onSeeked: true }),
|
29147 | captured: keyOf({ onSeekedCapture: true })
|
29148 | }
|
29149 | },
|
29150 | seeking: {
|
29151 | phasedRegistrationNames: {
|
29152 | bubbled: keyOf({ onSeeking: true }),
|
29153 | captured: keyOf({ onSeekingCapture: true })
|
29154 | }
|
29155 | },
|
29156 | stalled: {
|
29157 | phasedRegistrationNames: {
|
29158 | bubbled: keyOf({ onStalled: true }),
|
29159 | captured: keyOf({ onStalledCapture: true })
|
29160 | }
|
29161 | },
|
29162 | submit: {
|
29163 | phasedRegistrationNames: {
|
29164 | bubbled: keyOf({ onSubmit: true }),
|
29165 | captured: keyOf({ onSubmitCapture: true })
|
29166 | }
|
29167 | },
|
29168 | suspend: {
|
29169 | phasedRegistrationNames: {
|
29170 | bubbled: keyOf({ onSuspend: true }),
|
29171 | captured: keyOf({ onSuspendCapture: true })
|
29172 | }
|
29173 | },
|
29174 | timeUpdate: {
|
29175 | phasedRegistrationNames: {
|
29176 | bubbled: keyOf({ onTimeUpdate: true }),
|
29177 | captured: keyOf({ onTimeUpdateCapture: true })
|
29178 | }
|
29179 | },
|
29180 | touchCancel: {
|
29181 | phasedRegistrationNames: {
|
29182 | bubbled: keyOf({ onTouchCancel: true }),
|
29183 | captured: keyOf({ onTouchCancelCapture: true })
|
29184 | }
|
29185 | },
|
29186 | touchEnd: {
|
29187 | phasedRegistrationNames: {
|
29188 | bubbled: keyOf({ onTouchEnd: true }),
|
29189 | captured: keyOf({ onTouchEndCapture: true })
|
29190 | }
|
29191 | },
|
29192 | touchMove: {
|
29193 | phasedRegistrationNames: {
|
29194 | bubbled: keyOf({ onTouchMove: true }),
|
29195 | captured: keyOf({ onTouchMoveCapture: true })
|
29196 | }
|
29197 | },
|
29198 | touchStart: {
|
29199 | phasedRegistrationNames: {
|
29200 | bubbled: keyOf({ onTouchStart: true }),
|
29201 | captured: keyOf({ onTouchStartCapture: true })
|
29202 | }
|
29203 | },
|
29204 | transitionEnd: {
|
29205 | phasedRegistrationNames: {
|
29206 | bubbled: keyOf({ onTransitionEnd: true }),
|
29207 | captured: keyOf({ onTransitionEndCapture: true })
|
29208 | }
|
29209 | },
|
29210 | volumeChange: {
|
29211 | phasedRegistrationNames: {
|
29212 | bubbled: keyOf({ onVolumeChange: true }),
|
29213 | captured: keyOf({ onVolumeChangeCapture: true })
|
29214 | }
|
29215 | },
|
29216 | waiting: {
|
29217 | phasedRegistrationNames: {
|
29218 | bubbled: keyOf({ onWaiting: true }),
|
29219 | captured: keyOf({ onWaitingCapture: true })
|
29220 | }
|
29221 | },
|
29222 | wheel: {
|
29223 | phasedRegistrationNames: {
|
29224 | bubbled: keyOf({ onWheel: true }),
|
29225 | captured: keyOf({ onWheelCapture: true })
|
29226 | }
|
29227 | }
|
29228 | };
|
29229 |
|
29230 | var topLevelEventsToDispatchConfig = {
|
29231 | topAbort: eventTypes.abort,
|
29232 | topAnimationEnd: eventTypes.animationEnd,
|
29233 | topAnimationIteration: eventTypes.animationIteration,
|
29234 | topAnimationStart: eventTypes.animationStart,
|
29235 | topBlur: eventTypes.blur,
|
29236 | topCanPlay: eventTypes.canPlay,
|
29237 | topCanPlayThrough: eventTypes.canPlayThrough,
|
29238 | topClick: eventTypes.click,
|
29239 | topContextMenu: eventTypes.contextMenu,
|
29240 | topCopy: eventTypes.copy,
|
29241 | topCut: eventTypes.cut,
|
29242 | topDoubleClick: eventTypes.doubleClick,
|
29243 | topDrag: eventTypes.drag,
|
29244 | topDragEnd: eventTypes.dragEnd,
|
29245 | topDragEnter: eventTypes.dragEnter,
|
29246 | topDragExit: eventTypes.dragExit,
|
29247 | topDragLeave: eventTypes.dragLeave,
|
29248 | topDragOver: eventTypes.dragOver,
|
29249 | topDragStart: eventTypes.dragStart,
|
29250 | topDrop: eventTypes.drop,
|
29251 | topDurationChange: eventTypes.durationChange,
|
29252 | topEmptied: eventTypes.emptied,
|
29253 | topEncrypted: eventTypes.encrypted,
|
29254 | topEnded: eventTypes.ended,
|
29255 | topError: eventTypes.error,
|
29256 | topFocus: eventTypes.focus,
|
29257 | topInput: eventTypes.input,
|
29258 | topInvalid: eventTypes.invalid,
|
29259 | topKeyDown: eventTypes.keyDown,
|
29260 | topKeyPress: eventTypes.keyPress,
|
29261 | topKeyUp: eventTypes.keyUp,
|
29262 | topLoad: eventTypes.load,
|
29263 | topLoadedData: eventTypes.loadedData,
|
29264 | topLoadedMetadata: eventTypes.loadedMetadata,
|
29265 | topLoadStart: eventTypes.loadStart,
|
29266 | topMouseDown: eventTypes.mouseDown,
|
29267 | topMouseMove: eventTypes.mouseMove,
|
29268 | topMouseOut: eventTypes.mouseOut,
|
29269 | topMouseOver: eventTypes.mouseOver,
|
29270 | topMouseUp: eventTypes.mouseUp,
|
29271 | topPaste: eventTypes.paste,
|
29272 | topPause: eventTypes.pause,
|
29273 | topPlay: eventTypes.play,
|
29274 | topPlaying: eventTypes.playing,
|
29275 | topProgress: eventTypes.progress,
|
29276 | topRateChange: eventTypes.rateChange,
|
29277 | topReset: eventTypes.reset,
|
29278 | topScroll: eventTypes.scroll,
|
29279 | topSeeked: eventTypes.seeked,
|
29280 | topSeeking: eventTypes.seeking,
|
29281 | topStalled: eventTypes.stalled,
|
29282 | topSubmit: eventTypes.submit,
|
29283 | topSuspend: eventTypes.suspend,
|
29284 | topTimeUpdate: eventTypes.timeUpdate,
|
29285 | topTouchCancel: eventTypes.touchCancel,
|
29286 | topTouchEnd: eventTypes.touchEnd,
|
29287 | topTouchMove: eventTypes.touchMove,
|
29288 | topTouchStart: eventTypes.touchStart,
|
29289 | topTransitionEnd: eventTypes.transitionEnd,
|
29290 | topVolumeChange: eventTypes.volumeChange,
|
29291 | topWaiting: eventTypes.waiting,
|
29292 | topWheel: eventTypes.wheel
|
29293 | };
|
29294 |
|
29295 | for (var type in topLevelEventsToDispatchConfig) {
|
29296 | topLevelEventsToDispatchConfig[type].dependencies = [type];
|
29297 | }
|
29298 |
|
29299 | var ON_CLICK_KEY = keyOf({ onClick: null });
|
29300 | var onClickListeners = {};
|
29301 |
|
29302 | var SimpleEventPlugin = {
|
29303 |
|
29304 | eventTypes: eventTypes,
|
29305 |
|
29306 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
29307 | var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
|
29308 | if (!dispatchConfig) {
|
29309 | return null;
|
29310 | }
|
29311 | var EventConstructor;
|
29312 | switch (topLevelType) {
|
29313 | case topLevelTypes.topAbort:
|
29314 | case topLevelTypes.topCanPlay:
|
29315 | case topLevelTypes.topCanPlayThrough:
|
29316 | case topLevelTypes.topDurationChange:
|
29317 | case topLevelTypes.topEmptied:
|
29318 | case topLevelTypes.topEncrypted:
|
29319 | case topLevelTypes.topEnded:
|
29320 | case topLevelTypes.topError:
|
29321 | case topLevelTypes.topInput:
|
29322 | case topLevelTypes.topInvalid:
|
29323 | case topLevelTypes.topLoad:
|
29324 | case topLevelTypes.topLoadedData:
|
29325 | case topLevelTypes.topLoadedMetadata:
|
29326 | case topLevelTypes.topLoadStart:
|
29327 | case topLevelTypes.topPause:
|
29328 | case topLevelTypes.topPlay:
|
29329 | case topLevelTypes.topPlaying:
|
29330 | case topLevelTypes.topProgress:
|
29331 | case topLevelTypes.topRateChange:
|
29332 | case topLevelTypes.topReset:
|
29333 | case topLevelTypes.topSeeked:
|
29334 | case topLevelTypes.topSeeking:
|
29335 | case topLevelTypes.topStalled:
|
29336 | case topLevelTypes.topSubmit:
|
29337 | case topLevelTypes.topSuspend:
|
29338 | case topLevelTypes.topTimeUpdate:
|
29339 | case topLevelTypes.topVolumeChange:
|
29340 | case topLevelTypes.topWaiting:
|
29341 |
|
29342 |
|
29343 | EventConstructor = SyntheticEvent;
|
29344 | break;
|
29345 | case topLevelTypes.topKeyPress:
|
29346 |
|
29347 |
|
29348 |
|
29349 | if (getEventCharCode(nativeEvent) === 0) {
|
29350 | return null;
|
29351 | }
|
29352 |
|
29353 | case topLevelTypes.topKeyDown:
|
29354 | case topLevelTypes.topKeyUp:
|
29355 | EventConstructor = SyntheticKeyboardEvent;
|
29356 | break;
|
29357 | case topLevelTypes.topBlur:
|
29358 | case topLevelTypes.topFocus:
|
29359 | EventConstructor = SyntheticFocusEvent;
|
29360 | break;
|
29361 | case topLevelTypes.topClick:
|
29362 |
|
29363 |
|
29364 | if (nativeEvent.button === 2) {
|
29365 | return null;
|
29366 | }
|
29367 |
|
29368 | case topLevelTypes.topContextMenu:
|
29369 | case topLevelTypes.topDoubleClick:
|
29370 | case topLevelTypes.topMouseDown:
|
29371 | case topLevelTypes.topMouseMove:
|
29372 | case topLevelTypes.topMouseOut:
|
29373 | case topLevelTypes.topMouseOver:
|
29374 | case topLevelTypes.topMouseUp:
|
29375 | EventConstructor = SyntheticMouseEvent;
|
29376 | break;
|
29377 | case topLevelTypes.topDrag:
|
29378 | case topLevelTypes.topDragEnd:
|
29379 | case topLevelTypes.topDragEnter:
|
29380 | case topLevelTypes.topDragExit:
|
29381 | case topLevelTypes.topDragLeave:
|
29382 | case topLevelTypes.topDragOver:
|
29383 | case topLevelTypes.topDragStart:
|
29384 | case topLevelTypes.topDrop:
|
29385 | EventConstructor = SyntheticDragEvent;
|
29386 | break;
|
29387 | case topLevelTypes.topTouchCancel:
|
29388 | case topLevelTypes.topTouchEnd:
|
29389 | case topLevelTypes.topTouchMove:
|
29390 | case topLevelTypes.topTouchStart:
|
29391 | EventConstructor = SyntheticTouchEvent;
|
29392 | break;
|
29393 | case topLevelTypes.topAnimationEnd:
|
29394 | case topLevelTypes.topAnimationIteration:
|
29395 | case topLevelTypes.topAnimationStart:
|
29396 | EventConstructor = SyntheticAnimationEvent;
|
29397 | break;
|
29398 | case topLevelTypes.topTransitionEnd:
|
29399 | EventConstructor = SyntheticTransitionEvent;
|
29400 | break;
|
29401 | case topLevelTypes.topScroll:
|
29402 | EventConstructor = SyntheticUIEvent;
|
29403 | break;
|
29404 | case topLevelTypes.topWheel:
|
29405 | EventConstructor = SyntheticWheelEvent;
|
29406 | break;
|
29407 | case topLevelTypes.topCopy:
|
29408 | case topLevelTypes.topCut:
|
29409 | case topLevelTypes.topPaste:
|
29410 | EventConstructor = SyntheticClipboardEvent;
|
29411 | break;
|
29412 | }
|
29413 | !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : void 0;
|
29414 | var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
|
29415 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
29416 | return event;
|
29417 | },
|
29418 |
|
29419 | didPutListener: function (inst, registrationName, listener) {
|
29420 |
|
29421 |
|
29422 |
|
29423 |
|
29424 | if (registrationName === ON_CLICK_KEY) {
|
29425 | var id = inst._rootNodeID;
|
29426 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
29427 | if (!onClickListeners[id]) {
|
29428 | onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
|
29429 | }
|
29430 | }
|
29431 | },
|
29432 |
|
29433 | willDeleteListener: function (inst, registrationName) {
|
29434 | if (registrationName === ON_CLICK_KEY) {
|
29435 | var id = inst._rootNodeID;
|
29436 | onClickListeners[id].remove();
|
29437 | delete onClickListeners[id];
|
29438 | }
|
29439 | }
|
29440 |
|
29441 | };
|
29442 |
|
29443 | module.exports = SimpleEventPlugin;
|
29444 | }).call(this,require(91))
|
29445 | },{"174":174,"178":178,"199":199,"252":252,"253":253,"255":255,"256":256,"257":257,"259":259,"260":260,"261":261,"262":262,"263":263,"264":264,"276":276,"30":30,"37":37,"45":45,"49":49,"91":91}],252:[function(require,module,exports){
|
29446 |
|
29447 |
|
29448 |
|
29449 |
|
29450 |
|
29451 |
|
29452 |
|
29453 |
|
29454 |
|
29455 |
|
29456 |
|
29457 | 'use strict';
|
29458 |
|
29459 | var SyntheticEvent = require(256);
|
29460 |
|
29461 |
|
29462 |
|
29463 |
|
29464 |
|
29465 |
|
29466 | var AnimationEventInterface = {
|
29467 | animationName: null,
|
29468 | elapsedTime: null,
|
29469 | pseudoElement: null
|
29470 | };
|
29471 |
|
29472 |
|
29473 |
|
29474 |
|
29475 |
|
29476 |
|
29477 |
|
29478 | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
29479 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
29480 | }
|
29481 |
|
29482 | SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
|
29483 |
|
29484 | module.exports = SyntheticAnimationEvent;
|
29485 | },{"256":256}],253:[function(require,module,exports){
|
29486 |
|
29487 |
|
29488 |
|
29489 |
|
29490 |
|
29491 |
|
29492 |
|
29493 |
|
29494 |
|
29495 |
|
29496 |
|
29497 | 'use strict';
|
29498 |
|
29499 | var SyntheticEvent = require(256);
|
29500 |
|
29501 |
|
29502 |
|
29503 |
|
29504 |
|
29505 | var ClipboardEventInterface = {
|
29506 | clipboardData: function (event) {
|
29507 | return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
|
29508 | }
|
29509 | };
|
29510 |
|
29511 |
|
29512 |
|
29513 |
|
29514 |
|
29515 |
|
29516 |
|
29517 | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
29518 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
29519 | }
|
29520 |
|
29521 | SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
|
29522 |
|
29523 | module.exports = SyntheticClipboardEvent;
|
29524 | },{"256":256}],254:[function(require,module,exports){
|
29525 |
|
29526 |
|
29527 |
|
29528 |
|
29529 |
|
29530 |
|
29531 |
|
29532 |
|
29533 |
|
29534 |
|
29535 |
|
29536 | 'use strict';
|
29537 |
|
29538 | var SyntheticEvent = require(256);
|
29539 |
|
29540 |
|
29541 |
|
29542 |
|
29543 |
|
29544 | var CompositionEventInterface = {
|
29545 | data: null
|
29546 | };
|
29547 |
|
29548 |
|
29549 |
|
29550 |
|
29551 |
|
29552 |
|
29553 |
|
29554 | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
29555 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
29556 | }
|
29557 |
|
29558 | SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
|
29559 |
|
29560 | module.exports = SyntheticCompositionEvent;
|
29561 | },{"256":256}],255:[function(require,module,exports){
|
29562 |
|
29563 |
|
29564 |
|
29565 |
|
29566 |
|
29567 |
|
29568 |
|
29569 |
|
29570 |
|
29571 |
|
29572 |
|
29573 | 'use strict';
|
29574 |
|
29575 | var SyntheticMouseEvent = require(260);
|
29576 |
|
29577 |
|
29578 |
|
29579 |
|
29580 |
|
29581 | var DragEventInterface = {
|
29582 | dataTransfer: null
|
29583 | };
|
29584 |
|
29585 |
|
29586 |
|
29587 |
|
29588 |
|
29589 |
|
29590 |
|
29591 | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
29592 | return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
29593 | }
|
29594 |
|
29595 | SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
|
29596 |
|
29597 | module.exports = SyntheticDragEvent;
|
29598 | },{"260":260}],256:[function(require,module,exports){
|
29599 | (function (process){
|
29600 |
|
29601 |
|
29602 |
|
29603 |
|
29604 |
|
29605 |
|
29606 |
|
29607 |
|
29608 |
|
29609 |
|
29610 |
|
29611 | 'use strict';
|
29612 |
|
29613 | var _assign = require(296);
|
29614 |
|
29615 | var PooledClass = require(183);
|
29616 |
|
29617 | var emptyFunction = require(37);
|
29618 | var warning = require(55);
|
29619 |
|
29620 | var didWarnForAddedNewProperty = false;
|
29621 | var isProxySupported = typeof Proxy === 'function';
|
29622 |
|
29623 | var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
|
29624 |
|
29625 |
|
29626 |
|
29627 |
|
29628 |
|
29629 | var EventInterface = {
|
29630 | type: null,
|
29631 | target: null,
|
29632 |
|
29633 | currentTarget: emptyFunction.thatReturnsNull,
|
29634 | eventPhase: null,
|
29635 | bubbles: null,
|
29636 | cancelable: null,
|
29637 | timeStamp: function (event) {
|
29638 | return event.timeStamp || Date.now();
|
29639 | },
|
29640 | defaultPrevented: null,
|
29641 | isTrusted: null
|
29642 | };
|
29643 |
|
29644 |
|
29645 |
|
29646 |
|
29647 |
|
29648 |
|
29649 |
|
29650 |
|
29651 |
|
29652 |
|
29653 |
|
29654 |
|
29655 |
|
29656 |
|
29657 |
|
29658 |
|
29659 |
|
29660 |
|
29661 |
|
29662 | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
|
29663 | if (process.env.NODE_ENV !== 'production') {
|
29664 |
|
29665 | delete this.nativeEvent;
|
29666 | delete this.preventDefault;
|
29667 | delete this.stopPropagation;
|
29668 | }
|
29669 |
|
29670 | this.dispatchConfig = dispatchConfig;
|
29671 | this._targetInst = targetInst;
|
29672 | this.nativeEvent = nativeEvent;
|
29673 |
|
29674 | var Interface = this.constructor.Interface;
|
29675 | for (var propName in Interface) {
|
29676 | if (!Interface.hasOwnProperty(propName)) {
|
29677 | continue;
|
29678 | }
|
29679 | if (process.env.NODE_ENV !== 'production') {
|
29680 | delete this[propName];
|
29681 | }
|
29682 | var normalize = Interface[propName];
|
29683 | if (normalize) {
|
29684 | this[propName] = normalize(nativeEvent);
|
29685 | } else {
|
29686 | if (propName === 'target') {
|
29687 | this.target = nativeEventTarget;
|
29688 | } else {
|
29689 | this[propName] = nativeEvent[propName];
|
29690 | }
|
29691 | }
|
29692 | }
|
29693 |
|
29694 | var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
29695 | if (defaultPrevented) {
|
29696 | this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
29697 | } else {
|
29698 | this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
|
29699 | }
|
29700 | this.isPropagationStopped = emptyFunction.thatReturnsFalse;
|
29701 | return this;
|
29702 | }
|
29703 |
|
29704 | _assign(SyntheticEvent.prototype, {
|
29705 |
|
29706 | preventDefault: function () {
|
29707 | this.defaultPrevented = true;
|
29708 | var event = this.nativeEvent;
|
29709 | if (!event) {
|
29710 | return;
|
29711 | }
|
29712 |
|
29713 | if (event.preventDefault) {
|
29714 | event.preventDefault();
|
29715 | } else {
|
29716 | event.returnValue = false;
|
29717 | }
|
29718 | this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
29719 | },
|
29720 |
|
29721 | stopPropagation: function () {
|
29722 | var event = this.nativeEvent;
|
29723 | if (!event) {
|
29724 | return;
|
29725 | }
|
29726 |
|
29727 | if (event.stopPropagation) {
|
29728 | event.stopPropagation();
|
29729 | } else {
|
29730 | event.cancelBubble = true;
|
29731 | }
|
29732 | this.isPropagationStopped = emptyFunction.thatReturnsTrue;
|
29733 | },
|
29734 |
|
29735 | |
29736 |
|
29737 |
|
29738 |
|
29739 |
|
29740 | persist: function () {
|
29741 | this.isPersistent = emptyFunction.thatReturnsTrue;
|
29742 | },
|
29743 |
|
29744 | |
29745 |
|
29746 |
|
29747 |
|
29748 |
|
29749 | isPersistent: emptyFunction.thatReturnsFalse,
|
29750 |
|
29751 | |
29752 |
|
29753 |
|
29754 | destructor: function () {
|
29755 | var Interface = this.constructor.Interface;
|
29756 | for (var propName in Interface) {
|
29757 | if (process.env.NODE_ENV !== 'production') {
|
29758 | Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
|
29759 | } else {
|
29760 | this[propName] = null;
|
29761 | }
|
29762 | }
|
29763 | for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
|
29764 | this[shouldBeReleasedProperties[i]] = null;
|
29765 | }
|
29766 | if (process.env.NODE_ENV !== 'production') {
|
29767 | var noop = require(37);
|
29768 | Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
|
29769 | Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', noop));
|
29770 | Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', noop));
|
29771 | }
|
29772 | }
|
29773 |
|
29774 | });
|
29775 |
|
29776 | SyntheticEvent.Interface = EventInterface;
|
29777 |
|
29778 | if (process.env.NODE_ENV !== 'production') {
|
29779 | if (isProxySupported) {
|
29780 |
|
29781 | SyntheticEvent = new Proxy(SyntheticEvent, {
|
29782 | construct: function (target, args) {
|
29783 | return this.apply(target, Object.create(target.prototype), args);
|
29784 | },
|
29785 | apply: function (constructor, that, args) {
|
29786 | return new Proxy(constructor.apply(that, args), {
|
29787 | set: function (target, prop, value) {
|
29788 | if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
29789 | process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
|
29790 | didWarnForAddedNewProperty = true;
|
29791 | }
|
29792 | target[prop] = value;
|
29793 | return true;
|
29794 | }
|
29795 | });
|
29796 | }
|
29797 | });
|
29798 |
|
29799 | }
|
29800 | }
|
29801 |
|
29802 |
|
29803 |
|
29804 |
|
29805 |
|
29806 |
|
29807 | SyntheticEvent.augmentClass = function (Class, Interface) {
|
29808 | var Super = this;
|
29809 |
|
29810 | var E = function () {};
|
29811 | E.prototype = Super.prototype;
|
29812 | var prototype = new E();
|
29813 |
|
29814 | _assign(prototype, Class.prototype);
|
29815 | Class.prototype = prototype;
|
29816 | Class.prototype.constructor = Class;
|
29817 |
|
29818 | Class.Interface = _assign({}, Super.Interface, Interface);
|
29819 | Class.augmentClass = Super.augmentClass;
|
29820 |
|
29821 | PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
|
29822 | };
|
29823 |
|
29824 | PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
|
29825 |
|
29826 | module.exports = SyntheticEvent;
|
29827 |
|
29828 |
|
29829 |
|
29830 |
|
29831 |
|
29832 |
|
29833 |
|
29834 |
|
29835 | function getPooledWarningPropertyDefinition(propName, getVal) {
|
29836 | var isFunction = typeof getVal === 'function';
|
29837 | return {
|
29838 | configurable: true,
|
29839 | set: set,
|
29840 | get: get
|
29841 | };
|
29842 |
|
29843 | function set(val) {
|
29844 | var action = isFunction ? 'setting the method' : 'setting the property';
|
29845 | warn(action, 'This is effectively a no-op');
|
29846 | return val;
|
29847 | }
|
29848 |
|
29849 | function get() {
|
29850 | var action = isFunction ? 'accessing the method' : 'accessing the property';
|
29851 | var result = isFunction ? 'This is a no-op function' : 'This is set to null';
|
29852 | warn(action, result);
|
29853 | return getVal;
|
29854 | }
|
29855 |
|
29856 | function warn(action, result) {
|
29857 | var warningCondition = false;
|
29858 | process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
29859 | }
|
29860 | }
|
29861 | }).call(this,require(91))
|
29862 | },{"183":183,"296":296,"37":37,"55":55,"91":91}],257:[function(require,module,exports){
|
29863 |
|
29864 |
|
29865 |
|
29866 |
|
29867 |
|
29868 |
|
29869 |
|
29870 |
|
29871 |
|
29872 |
|
29873 |
|
29874 | 'use strict';
|
29875 |
|
29876 | var SyntheticUIEvent = require(263);
|
29877 |
|
29878 |
|
29879 |
|
29880 |
|
29881 |
|
29882 | var FocusEventInterface = {
|
29883 | relatedTarget: null
|
29884 | };
|
29885 |
|
29886 |
|
29887 |
|
29888 |
|
29889 |
|
29890 |
|
29891 |
|
29892 | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
29893 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
29894 | }
|
29895 |
|
29896 | SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
|
29897 |
|
29898 | module.exports = SyntheticFocusEvent;
|
29899 | },{"263":263}],258:[function(require,module,exports){
|
29900 |
|
29901 |
|
29902 |
|
29903 |
|
29904 |
|
29905 |
|
29906 |
|
29907 |
|
29908 |
|
29909 |
|
29910 |
|
29911 | 'use strict';
|
29912 |
|
29913 | var SyntheticEvent = require(256);
|
29914 |
|
29915 |
|
29916 |
|
29917 |
|
29918 |
|
29919 |
|
29920 | var InputEventInterface = {
|
29921 | data: null
|
29922 | };
|
29923 |
|
29924 |
|
29925 |
|
29926 |
|
29927 |
|
29928 |
|
29929 |
|
29930 | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
29931 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
29932 | }
|
29933 |
|
29934 | SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
|
29935 |
|
29936 | module.exports = SyntheticInputEvent;
|
29937 | },{"256":256}],259:[function(require,module,exports){
|
29938 |
|
29939 |
|
29940 |
|
29941 |
|
29942 |
|
29943 |
|
29944 |
|
29945 |
|
29946 |
|
29947 |
|
29948 |
|
29949 | 'use strict';
|
29950 |
|
29951 | var SyntheticUIEvent = require(263);
|
29952 |
|
29953 | var getEventCharCode = require(276);
|
29954 | var getEventKey = require(277);
|
29955 | var getEventModifierState = require(278);
|
29956 |
|
29957 |
|
29958 |
|
29959 |
|
29960 |
|
29961 | var KeyboardEventInterface = {
|
29962 | key: getEventKey,
|
29963 | location: null,
|
29964 | ctrlKey: null,
|
29965 | shiftKey: null,
|
29966 | altKey: null,
|
29967 | metaKey: null,
|
29968 | repeat: null,
|
29969 | locale: null,
|
29970 | getModifierState: getEventModifierState,
|
29971 |
|
29972 | charCode: function (event) {
|
29973 |
|
29974 |
|
29975 |
|
29976 |
|
29977 |
|
29978 | if (event.type === 'keypress') {
|
29979 | return getEventCharCode(event);
|
29980 | }
|
29981 | return 0;
|
29982 | },
|
29983 | keyCode: function (event) {
|
29984 |
|
29985 |
|
29986 |
|
29987 |
|
29988 |
|
29989 |
|
29990 |
|
29991 | if (event.type === 'keydown' || event.type === 'keyup') {
|
29992 | return event.keyCode;
|
29993 | }
|
29994 | return 0;
|
29995 | },
|
29996 | which: function (event) {
|
29997 |
|
29998 |
|
29999 | if (event.type === 'keypress') {
|
30000 | return getEventCharCode(event);
|
30001 | }
|
30002 | if (event.type === 'keydown' || event.type === 'keyup') {
|
30003 | return event.keyCode;
|
30004 | }
|
30005 | return 0;
|
30006 | }
|
30007 | };
|
30008 |
|
30009 |
|
30010 |
|
30011 |
|
30012 |
|
30013 |
|
30014 |
|
30015 | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
30016 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
30017 | }
|
30018 |
|
30019 | SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
|
30020 |
|
30021 | module.exports = SyntheticKeyboardEvent;
|
30022 | },{"263":263,"276":276,"277":277,"278":278}],260:[function(require,module,exports){
|
30023 |
|
30024 |
|
30025 |
|
30026 |
|
30027 |
|
30028 |
|
30029 |
|
30030 |
|
30031 |
|
30032 |
|
30033 |
|
30034 | 'use strict';
|
30035 |
|
30036 | var SyntheticUIEvent = require(263);
|
30037 | var ViewportMetrics = require(266);
|
30038 |
|
30039 | var getEventModifierState = require(278);
|
30040 |
|
30041 |
|
30042 |
|
30043 |
|
30044 |
|
30045 | var MouseEventInterface = {
|
30046 | screenX: null,
|
30047 | screenY: null,
|
30048 | clientX: null,
|
30049 | clientY: null,
|
30050 | ctrlKey: null,
|
30051 | shiftKey: null,
|
30052 | altKey: null,
|
30053 | metaKey: null,
|
30054 | getModifierState: getEventModifierState,
|
30055 | button: function (event) {
|
30056 |
|
30057 |
|
30058 |
|
30059 | var button = event.button;
|
30060 | if ('which' in event) {
|
30061 | return button;
|
30062 | }
|
30063 |
|
30064 |
|
30065 |
|
30066 |
|
30067 | return button === 2 ? 2 : button === 4 ? 1 : 0;
|
30068 | },
|
30069 | buttons: null,
|
30070 | relatedTarget: function (event) {
|
30071 | return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
|
30072 | },
|
30073 |
|
30074 | pageX: function (event) {
|
30075 | return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
|
30076 | },
|
30077 | pageY: function (event) {
|
30078 | return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
|
30079 | }
|
30080 | };
|
30081 |
|
30082 |
|
30083 |
|
30084 |
|
30085 |
|
30086 |
|
30087 |
|
30088 | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
30089 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
30090 | }
|
30091 |
|
30092 | SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
|
30093 |
|
30094 | module.exports = SyntheticMouseEvent;
|
30095 | },{"263":263,"266":266,"278":278}],261:[function(require,module,exports){
|
30096 |
|
30097 |
|
30098 |
|
30099 |
|
30100 |
|
30101 |
|
30102 |
|
30103 |
|
30104 |
|
30105 |
|
30106 |
|
30107 | 'use strict';
|
30108 |
|
30109 | var SyntheticUIEvent = require(263);
|
30110 |
|
30111 | var getEventModifierState = require(278);
|
30112 |
|
30113 |
|
30114 |
|
30115 |
|
30116 |
|
30117 | var TouchEventInterface = {
|
30118 | touches: null,
|
30119 | targetTouches: null,
|
30120 | changedTouches: null,
|
30121 | altKey: null,
|
30122 | metaKey: null,
|
30123 | ctrlKey: null,
|
30124 | shiftKey: null,
|
30125 | getModifierState: getEventModifierState
|
30126 | };
|
30127 |
|
30128 |
|
30129 |
|
30130 |
|
30131 |
|
30132 |
|
30133 |
|
30134 | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
30135 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
30136 | }
|
30137 |
|
30138 | SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
|
30139 |
|
30140 | module.exports = SyntheticTouchEvent;
|
30141 | },{"263":263,"278":278}],262:[function(require,module,exports){
|
30142 |
|
30143 |
|
30144 |
|
30145 |
|
30146 |
|
30147 |
|
30148 |
|
30149 |
|
30150 |
|
30151 |
|
30152 |
|
30153 | 'use strict';
|
30154 |
|
30155 | var SyntheticEvent = require(256);
|
30156 |
|
30157 |
|
30158 |
|
30159 |
|
30160 |
|
30161 |
|
30162 | var TransitionEventInterface = {
|
30163 | propertyName: null,
|
30164 | elapsedTime: null,
|
30165 | pseudoElement: null
|
30166 | };
|
30167 |
|
30168 |
|
30169 |
|
30170 |
|
30171 |
|
30172 |
|
30173 |
|
30174 | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
30175 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
30176 | }
|
30177 |
|
30178 | SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
|
30179 |
|
30180 | module.exports = SyntheticTransitionEvent;
|
30181 | },{"256":256}],263:[function(require,module,exports){
|
30182 |
|
30183 |
|
30184 |
|
30185 |
|
30186 |
|
30187 |
|
30188 |
|
30189 |
|
30190 |
|
30191 |
|
30192 |
|
30193 | 'use strict';
|
30194 |
|
30195 | var SyntheticEvent = require(256);
|
30196 |
|
30197 | var getEventTarget = require(279);
|
30198 |
|
30199 |
|
30200 |
|
30201 |
|
30202 |
|
30203 | var UIEventInterface = {
|
30204 | view: function (event) {
|
30205 | if (event.view) {
|
30206 | return event.view;
|
30207 | }
|
30208 |
|
30209 | var target = getEventTarget(event);
|
30210 | if (target != null && target.window === target) {
|
30211 |
|
30212 | return target;
|
30213 | }
|
30214 |
|
30215 | var doc = target.ownerDocument;
|
30216 |
|
30217 | if (doc) {
|
30218 | return doc.defaultView || doc.parentWindow;
|
30219 | } else {
|
30220 | return window;
|
30221 | }
|
30222 | },
|
30223 | detail: function (event) {
|
30224 | return event.detail || 0;
|
30225 | }
|
30226 | };
|
30227 |
|
30228 |
|
30229 |
|
30230 |
|
30231 |
|
30232 |
|
30233 |
|
30234 | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
30235 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
30236 | }
|
30237 |
|
30238 | SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
|
30239 |
|
30240 | module.exports = SyntheticUIEvent;
|
30241 | },{"256":256,"279":279}],264:[function(require,module,exports){
|
30242 |
|
30243 |
|
30244 |
|
30245 |
|
30246 |
|
30247 |
|
30248 |
|
30249 |
|
30250 |
|
30251 |
|
30252 |
|
30253 | 'use strict';
|
30254 |
|
30255 | var SyntheticMouseEvent = require(260);
|
30256 |
|
30257 |
|
30258 |
|
30259 |
|
30260 |
|
30261 | var WheelEventInterface = {
|
30262 | deltaX: function (event) {
|
30263 | return 'deltaX' in event ? event.deltaX :
|
30264 |
|
30265 | 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
30266 | },
|
30267 | deltaY: function (event) {
|
30268 | return 'deltaY' in event ? event.deltaY :
|
30269 |
|
30270 | 'wheelDeltaY' in event ? -event.wheelDeltaY :
|
30271 |
|
30272 | 'wheelDelta' in event ? -event.wheelDelta : 0;
|
30273 | },
|
30274 | deltaZ: null,
|
30275 |
|
30276 |
|
30277 |
|
30278 |
|
30279 |
|
30280 | deltaMode: null
|
30281 | };
|
30282 |
|
30283 |
|
30284 |
|
30285 |
|
30286 |
|
30287 |
|
30288 |
|
30289 | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
30290 | return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
30291 | }
|
30292 |
|
30293 | SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
|
30294 |
|
30295 | module.exports = SyntheticWheelEvent;
|
30296 | },{"260":260}],265:[function(require,module,exports){
|
30297 | (function (process){
|
30298 |
|
30299 |
|
30300 |
|
30301 |
|
30302 |
|
30303 |
|
30304 |
|
30305 |
|
30306 |
|
30307 |
|
30308 |
|
30309 | 'use strict';
|
30310 |
|
30311 | var invariant = require(45);
|
30312 |
|
30313 |
|
30314 |
|
30315 |
|
30316 |
|
30317 |
|
30318 |
|
30319 |
|
30320 |
|
30321 |
|
30322 |
|
30323 |
|
30324 |
|
30325 |
|
30326 |
|
30327 |
|
30328 |
|
30329 |
|
30330 |
|
30331 |
|
30332 |
|
30333 |
|
30334 |
|
30335 |
|
30336 |
|
30337 |
|
30338 |
|
30339 |
|
30340 |
|
30341 |
|
30342 |
|
30343 |
|
30344 |
|
30345 |
|
30346 |
|
30347 |
|
30348 |
|
30349 |
|
30350 |
|
30351 |
|
30352 |
|
30353 |
|
30354 |
|
30355 |
|
30356 |
|
30357 |
|
30358 |
|
30359 |
|
30360 |
|
30361 |
|
30362 |
|
30363 |
|
30364 |
|
30365 |
|
30366 |
|
30367 |
|
30368 |
|
30369 |
|
30370 |
|
30371 |
|
30372 |
|
30373 |
|
30374 | var Mixin = {
|
30375 | |
30376 |
|
30377 |
|
30378 |
|
30379 |
|
30380 |
|
30381 |
|
30382 | reinitializeTransaction: function () {
|
30383 | this.transactionWrappers = this.getTransactionWrappers();
|
30384 | if (this.wrapperInitData) {
|
30385 | this.wrapperInitData.length = 0;
|
30386 | } else {
|
30387 | this.wrapperInitData = [];
|
30388 | }
|
30389 | this._isInTransaction = false;
|
30390 | },
|
30391 |
|
30392 | _isInTransaction: false,
|
30393 |
|
30394 | |
30395 |
|
30396 |
|
30397 |
|
30398 | getTransactionWrappers: null,
|
30399 |
|
30400 | isInTransaction: function () {
|
30401 | return !!this._isInTransaction;
|
30402 | },
|
30403 |
|
30404 | |
30405 |
|
30406 |
|
30407 |
|
30408 |
|
30409 |
|
30410 |
|
30411 |
|
30412 |
|
30413 |
|
30414 |
|
30415 |
|
30416 |
|
30417 |
|
30418 |
|
30419 |
|
30420 |
|
30421 | perform: function (method, scope, a, b, c, d, e, f) {
|
30422 | !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;
|
30423 | var errorThrown;
|
30424 | var ret;
|
30425 | try {
|
30426 | this._isInTransaction = true;
|
30427 |
|
30428 |
|
30429 |
|
30430 |
|
30431 | errorThrown = true;
|
30432 | this.initializeAll(0);
|
30433 | ret = method.call(scope, a, b, c, d, e, f);
|
30434 | errorThrown = false;
|
30435 | } finally {
|
30436 | try {
|
30437 | if (errorThrown) {
|
30438 |
|
30439 |
|
30440 | try {
|
30441 | this.closeAll(0);
|
30442 | } catch (err) {}
|
30443 | } else {
|
30444 |
|
30445 |
|
30446 | this.closeAll(0);
|
30447 | }
|
30448 | } finally {
|
30449 | this._isInTransaction = false;
|
30450 | }
|
30451 | }
|
30452 | return ret;
|
30453 | },
|
30454 |
|
30455 | initializeAll: function (startIndex) {
|
30456 | var transactionWrappers = this.transactionWrappers;
|
30457 | for (var i = startIndex; i < transactionWrappers.length; i++) {
|
30458 | var wrapper = transactionWrappers[i];
|
30459 | try {
|
30460 |
|
30461 |
|
30462 |
|
30463 |
|
30464 | this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
|
30465 | this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
|
30466 | } finally {
|
30467 | if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
|
30468 |
|
30469 |
|
30470 |
|
30471 | try {
|
30472 | this.initializeAll(i + 1);
|
30473 | } catch (err) {}
|
30474 | }
|
30475 | }
|
30476 | }
|
30477 | },
|
30478 |
|
30479 | |
30480 |
|
30481 |
|
30482 |
|
30483 |
|
30484 |
|
30485 | closeAll: function (startIndex) {
|
30486 | !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : void 0;
|
30487 | var transactionWrappers = this.transactionWrappers;
|
30488 | for (var i = startIndex; i < transactionWrappers.length; i++) {
|
30489 | var wrapper = transactionWrappers[i];
|
30490 | var initData = this.wrapperInitData[i];
|
30491 | var errorThrown;
|
30492 | try {
|
30493 |
|
30494 |
|
30495 |
|
30496 |
|
30497 | errorThrown = true;
|
30498 | if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
|
30499 | wrapper.close.call(this, initData);
|
30500 | }
|
30501 | errorThrown = false;
|
30502 | } finally {
|
30503 | if (errorThrown) {
|
30504 |
|
30505 |
|
30506 |
|
30507 | try {
|
30508 | this.closeAll(i + 1);
|
30509 | } catch (e) {}
|
30510 | }
|
30511 | }
|
30512 | }
|
30513 | this.wrapperInitData.length = 0;
|
30514 | }
|
30515 | };
|
30516 |
|
30517 | var Transaction = {
|
30518 |
|
30519 | Mixin: Mixin,
|
30520 |
|
30521 | |
30522 |
|
30523 |
|
30524 | OBSERVED_ERROR: {}
|
30525 |
|
30526 | };
|
30527 |
|
30528 | module.exports = Transaction;
|
30529 | }).call(this,require(91))
|
30530 | },{"45":45,"91":91}],266:[function(require,module,exports){
|
30531 |
|
30532 |
|
30533 |
|
30534 |
|
30535 |
|
30536 |
|
30537 |
|
30538 |
|
30539 |
|
30540 |
|
30541 |
|
30542 | 'use strict';
|
30543 |
|
30544 | var ViewportMetrics = {
|
30545 |
|
30546 | currentScrollLeft: 0,
|
30547 |
|
30548 | currentScrollTop: 0,
|
30549 |
|
30550 | refreshScrollValues: function (scrollPosition) {
|
30551 | ViewportMetrics.currentScrollLeft = scrollPosition.x;
|
30552 | ViewportMetrics.currentScrollTop = scrollPosition.y;
|
30553 | }
|
30554 |
|
30555 | };
|
30556 |
|
30557 | module.exports = ViewportMetrics;
|
30558 | },{}],267:[function(require,module,exports){
|
30559 | (function (process){
|
30560 |
|
30561 |
|
30562 |
|
30563 |
|
30564 |
|
30565 |
|
30566 |
|
30567 |
|
30568 |
|
30569 |
|
30570 |
|
30571 | 'use strict';
|
30572 |
|
30573 | var invariant = require(45);
|
30574 |
|
30575 |
|
30576 |
|
30577 |
|
30578 |
|
30579 |
|
30580 |
|
30581 |
|
30582 |
|
30583 |
|
30584 |
|
30585 |
|
30586 |
|
30587 |
|
30588 |
|
30589 | function accumulateInto(current, next) {
|
30590 | !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : void 0;
|
30591 | if (current == null) {
|
30592 | return next;
|
30593 | }
|
30594 |
|
30595 |
|
30596 |
|
30597 | var currentIsArray = Array.isArray(current);
|
30598 | var nextIsArray = Array.isArray(next);
|
30599 |
|
30600 | if (currentIsArray && nextIsArray) {
|
30601 | current.push.apply(current, next);
|
30602 | return current;
|
30603 | }
|
30604 |
|
30605 | if (currentIsArray) {
|
30606 | current.push(next);
|
30607 | return current;
|
30608 | }
|
30609 |
|
30610 | if (nextIsArray) {
|
30611 |
|
30612 | return [current].concat(next);
|
30613 | }
|
30614 |
|
30615 | return [current, next];
|
30616 | }
|
30617 |
|
30618 | module.exports = accumulateInto;
|
30619 | }).call(this,require(91))
|
30620 | },{"45":45,"91":91}],268:[function(require,module,exports){
|
30621 |
|
30622 |
|
30623 |
|
30624 |
|
30625 |
|
30626 |
|
30627 |
|
30628 |
|
30629 |
|
30630 |
|
30631 |
|
30632 | 'use strict';
|
30633 |
|
30634 | var MOD = 65521;
|
30635 |
|
30636 |
|
30637 |
|
30638 |
|
30639 |
|
30640 |
|
30641 | function adler32(data) {
|
30642 | var a = 1;
|
30643 | var b = 0;
|
30644 | var i = 0;
|
30645 | var l = data.length;
|
30646 | var m = l & ~0x3;
|
30647 | while (i < m) {
|
30648 | var n = Math.min(i + 4096, m);
|
30649 | for (; i < n; i += 4) {
|
30650 | b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
|
30651 | }
|
30652 | a %= MOD;
|
30653 | b %= MOD;
|
30654 | }
|
30655 | for (; i < l; i++) {
|
30656 | b += a += data.charCodeAt(i);
|
30657 | }
|
30658 | a %= MOD;
|
30659 | b %= MOD;
|
30660 | return a | b << 16;
|
30661 | }
|
30662 |
|
30663 | module.exports = adler32;
|
30664 | },{}],269:[function(require,module,exports){
|
30665 | (function (process){
|
30666 |
|
30667 |
|
30668 |
|
30669 |
|
30670 |
|
30671 |
|
30672 |
|
30673 |
|
30674 |
|
30675 |
|
30676 |
|
30677 | 'use strict';
|
30678 |
|
30679 | var canDefineProperty = false;
|
30680 | if (process.env.NODE_ENV !== 'production') {
|
30681 | try {
|
30682 | Object.defineProperty({}, 'x', { get: function () {} });
|
30683 | canDefineProperty = true;
|
30684 | } catch (x) {
|
30685 |
|
30686 | }
|
30687 | }
|
30688 |
|
30689 | module.exports = canDefineProperty;
|
30690 | }).call(this,require(91))
|
30691 | },{"91":91}],270:[function(require,module,exports){
|
30692 |
|
30693 |
|
30694 |
|
30695 |
|
30696 |
|
30697 |
|
30698 |
|
30699 |
|
30700 |
|
30701 |
|
30702 |
|
30703 |
|
30704 |
|
30705 | 'use strict';
|
30706 |
|
30707 |
|
30708 |
|
30709 |
|
30710 |
|
30711 | var createMicrosoftUnsafeLocalFunction = function (func) {
|
30712 | if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
30713 | return function (arg0, arg1, arg2, arg3) {
|
30714 | MSApp.execUnsafeLocalFunction(function () {
|
30715 | return func(arg0, arg1, arg2, arg3);
|
30716 | });
|
30717 | };
|
30718 | } else {
|
30719 | return func;
|
30720 | }
|
30721 | };
|
30722 |
|
30723 | module.exports = createMicrosoftUnsafeLocalFunction;
|
30724 | },{}],271:[function(require,module,exports){
|
30725 | (function (process){
|
30726 |
|
30727 |
|
30728 |
|
30729 |
|
30730 |
|
30731 |
|
30732 |
|
30733 |
|
30734 |
|
30735 |
|
30736 |
|
30737 | 'use strict';
|
30738 |
|
30739 | var CSSProperty = require(161);
|
30740 | var warning = require(55);
|
30741 |
|
30742 | var isUnitlessNumber = CSSProperty.isUnitlessNumber;
|
30743 | var styleWarnings = {};
|
30744 |
|
30745 |
|
30746 |
|
30747 |
|
30748 |
|
30749 |
|
30750 |
|
30751 |
|
30752 |
|
30753 |
|
30754 |
|
30755 | function dangerousStyleValue(name, value, component) {
|
30756 |
|
30757 |
|
30758 |
|
30759 |
|
30760 |
|
30761 |
|
30762 |
|
30763 |
|
30764 |
|
30765 |
|
30766 | var isEmpty = value == null || typeof value === 'boolean' || value === '';
|
30767 | if (isEmpty) {
|
30768 | return '';
|
30769 | }
|
30770 |
|
30771 | var isNonNumeric = isNaN(value);
|
30772 | if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
|
30773 | return '' + value;
|
30774 | }
|
30775 |
|
30776 | if (typeof value === 'string') {
|
30777 | if (process.env.NODE_ENV !== 'production') {
|
30778 | if (component) {
|
30779 | var owner = component._currentElement._owner;
|
30780 | var ownerName = owner ? owner.getName() : null;
|
30781 | if (ownerName && !styleWarnings[ownerName]) {
|
30782 | styleWarnings[ownerName] = {};
|
30783 | }
|
30784 | var warned = false;
|
30785 | if (ownerName) {
|
30786 | var warnings = styleWarnings[ownerName];
|
30787 | warned = warnings[name];
|
30788 | if (!warned) {
|
30789 | warnings[name] = true;
|
30790 | }
|
30791 | }
|
30792 | if (!warned) {
|
30793 | process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
|
30794 | }
|
30795 | }
|
30796 | }
|
30797 | value = value.trim();
|
30798 | }
|
30799 | return value + 'px';
|
30800 | }
|
30801 |
|
30802 | module.exports = dangerousStyleValue;
|
30803 | }).call(this,require(91))
|
30804 | },{"161":161,"55":55,"91":91}],272:[function(require,module,exports){
|
30805 |
|
30806 |
|
30807 |
|
30808 |
|
30809 |
|
30810 |
|
30811 |
|
30812 |
|
30813 |
|
30814 |
|
30815 |
|
30816 | 'use strict';
|
30817 |
|
30818 | var ESCAPE_LOOKUP = {
|
30819 | '&': '&',
|
30820 | '>': '>',
|
30821 | '<': '<',
|
30822 | '"': '"',
|
30823 | '\'': '''
|
30824 | };
|
30825 |
|
30826 | var ESCAPE_REGEX = /[&><"']/g;
|
30827 |
|
30828 | function escaper(match) {
|
30829 | return ESCAPE_LOOKUP[match];
|
30830 | }
|
30831 |
|
30832 |
|
30833 |
|
30834 |
|
30835 |
|
30836 |
|
30837 |
|
30838 | function escapeTextContentForBrowser(text) {
|
30839 | return ('' + text).replace(ESCAPE_REGEX, escaper);
|
30840 | }
|
30841 |
|
30842 | module.exports = escapeTextContentForBrowser;
|
30843 | },{}],273:[function(require,module,exports){
|
30844 | (function (process){
|
30845 |
|
30846 |
|
30847 |
|
30848 |
|
30849 |
|
30850 |
|
30851 |
|
30852 |
|
30853 |
|
30854 |
|
30855 |
|
30856 | 'use strict';
|
30857 |
|
30858 | var ReactCurrentOwner = require(194);
|
30859 | var ReactDOMComponentTree = require(199);
|
30860 | var ReactInstanceMap = require(227);
|
30861 |
|
30862 | var getNativeComponentFromComposite = require(281);
|
30863 | var invariant = require(45);
|
30864 | var warning = require(55);
|
30865 |
|
30866 |
|
30867 |
|
30868 |
|
30869 |
|
30870 |
|
30871 |
|
30872 |
|
30873 |
|
30874 | function findDOMNode(componentOrElement) {
|
30875 | if (process.env.NODE_ENV !== 'production') {
|
30876 | var owner = ReactCurrentOwner.current;
|
30877 | if (owner !== null) {
|
30878 | process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
|
30879 | owner._warnedAboutRefsInRender = true;
|
30880 | }
|
30881 | }
|
30882 | if (componentOrElement == null) {
|
30883 | return null;
|
30884 | }
|
30885 | if (componentOrElement.nodeType === 1) {
|
30886 | return componentOrElement;
|
30887 | }
|
30888 |
|
30889 | var inst = ReactInstanceMap.get(componentOrElement);
|
30890 | if (inst) {
|
30891 | inst = getNativeComponentFromComposite(inst);
|
30892 | return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
|
30893 | }
|
30894 |
|
30895 | if (typeof componentOrElement.render === 'function') {
|
30896 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : void 0;
|
30897 | } else {
|
30898 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : void 0;
|
30899 | }
|
30900 | }
|
30901 |
|
30902 | module.exports = findDOMNode;
|
30903 | }).call(this,require(91))
|
30904 | },{"194":194,"199":199,"227":227,"281":281,"45":45,"55":55,"91":91}],274:[function(require,module,exports){
|
30905 | (function (process){
|
30906 |
|
30907 |
|
30908 |
|
30909 |
|
30910 |
|
30911 |
|
30912 |
|
30913 |
|
30914 |
|
30915 |
|
30916 |
|
30917 | 'use strict';
|
30918 |
|
30919 | var KeyEscapeUtils = require(181);
|
30920 | var traverseAllChildren = require(294);
|
30921 | var warning = require(55);
|
30922 |
|
30923 |
|
30924 |
|
30925 |
|
30926 |
|
30927 |
|
30928 | function flattenSingleChildIntoContext(traverseContext, child, name) {
|
30929 |
|
30930 | var result = traverseContext;
|
30931 | var keyUnique = result[name] === undefined;
|
30932 | if (process.env.NODE_ENV !== 'production') {
|
30933 | process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;
|
30934 | }
|
30935 | if (keyUnique && child != null) {
|
30936 | result[name] = child;
|
30937 | }
|
30938 | }
|
30939 |
|
30940 |
|
30941 |
|
30942 |
|
30943 |
|
30944 |
|
30945 | function flattenChildren(children) {
|
30946 | if (children == null) {
|
30947 | return children;
|
30948 | }
|
30949 | var result = {};
|
30950 | traverseAllChildren(children, flattenSingleChildIntoContext, result);
|
30951 | return result;
|
30952 | }
|
30953 |
|
30954 | module.exports = flattenChildren;
|
30955 | }).call(this,require(91))
|
30956 | },{"181":181,"294":294,"55":55,"91":91}],275:[function(require,module,exports){
|
30957 |
|
30958 |
|
30959 |
|
30960 |
|
30961 |
|
30962 |
|
30963 |
|
30964 |
|
30965 |
|
30966 |
|
30967 |
|
30968 | 'use strict';
|
30969 |
|
30970 |
|
30971 |
|
30972 |
|
30973 |
|
30974 |
|
30975 |
|
30976 |
|
30977 |
|
30978 | var forEachAccumulated = function (arr, cb, scope) {
|
30979 | if (Array.isArray(arr)) {
|
30980 | arr.forEach(cb, scope);
|
30981 | } else if (arr) {
|
30982 | cb.call(scope, arr);
|
30983 | }
|
30984 | };
|
30985 |
|
30986 | module.exports = forEachAccumulated;
|
30987 | },{}],276:[function(require,module,exports){
|
30988 |
|
30989 |
|
30990 |
|
30991 |
|
30992 |
|
30993 |
|
30994 |
|
30995 |
|
30996 |
|
30997 |
|
30998 |
|
30999 | 'use strict';
|
31000 |
|
31001 |
|
31002 |
|
31003 |
|
31004 |
|
31005 |
|
31006 |
|
31007 |
|
31008 |
|
31009 |
|
31010 |
|
31011 |
|
31012 | function getEventCharCode(nativeEvent) {
|
31013 | var charCode;
|
31014 | var keyCode = nativeEvent.keyCode;
|
31015 |
|
31016 | if ('charCode' in nativeEvent) {
|
31017 | charCode = nativeEvent.charCode;
|
31018 |
|
31019 |
|
31020 | if (charCode === 0 && keyCode === 13) {
|
31021 | charCode = 13;
|
31022 | }
|
31023 | } else {
|
31024 |
|
31025 | charCode = keyCode;
|
31026 | }
|
31027 |
|
31028 |
|
31029 |
|
31030 | if (charCode >= 32 || charCode === 13) {
|
31031 | return charCode;
|
31032 | }
|
31033 |
|
31034 | return 0;
|
31035 | }
|
31036 |
|
31037 | module.exports = getEventCharCode;
|
31038 | },{}],277:[function(require,module,exports){
|
31039 |
|
31040 |
|
31041 |
|
31042 |
|
31043 |
|
31044 |
|
31045 |
|
31046 |
|
31047 |
|
31048 |
|
31049 |
|
31050 | 'use strict';
|
31051 |
|
31052 | var getEventCharCode = require(276);
|
31053 |
|
31054 |
|
31055 |
|
31056 |
|
31057 |
|
31058 | var normalizeKey = {
|
31059 | 'Esc': 'Escape',
|
31060 | 'Spacebar': ' ',
|
31061 | 'Left': 'ArrowLeft',
|
31062 | 'Up': 'ArrowUp',
|
31063 | 'Right': 'ArrowRight',
|
31064 | 'Down': 'ArrowDown',
|
31065 | 'Del': 'Delete',
|
31066 | 'Win': 'OS',
|
31067 | 'Menu': 'ContextMenu',
|
31068 | 'Apps': 'ContextMenu',
|
31069 | 'Scroll': 'ScrollLock',
|
31070 | 'MozPrintableKey': 'Unidentified'
|
31071 | };
|
31072 |
|
31073 |
|
31074 |
|
31075 |
|
31076 |
|
31077 |
|
31078 | var translateToKey = {
|
31079 | 8: 'Backspace',
|
31080 | 9: 'Tab',
|
31081 | 12: 'Clear',
|
31082 | 13: 'Enter',
|
31083 | 16: 'Shift',
|
31084 | 17: 'Control',
|
31085 | 18: 'Alt',
|
31086 | 19: 'Pause',
|
31087 | 20: 'CapsLock',
|
31088 | 27: 'Escape',
|
31089 | 32: ' ',
|
31090 | 33: 'PageUp',
|
31091 | 34: 'PageDown',
|
31092 | 35: 'End',
|
31093 | 36: 'Home',
|
31094 | 37: 'ArrowLeft',
|
31095 | 38: 'ArrowUp',
|
31096 | 39: 'ArrowRight',
|
31097 | 40: 'ArrowDown',
|
31098 | 45: 'Insert',
|
31099 | 46: 'Delete',
|
31100 | 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
|
31101 | 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
|
31102 | 144: 'NumLock',
|
31103 | 145: 'ScrollLock',
|
31104 | 224: 'Meta'
|
31105 | };
|
31106 |
|
31107 |
|
31108 |
|
31109 |
|
31110 |
|
31111 | function getEventKey(nativeEvent) {
|
31112 | if (nativeEvent.key) {
|
31113 |
|
31114 |
|
31115 |
|
31116 |
|
31117 |
|
31118 | var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
31119 | if (key !== 'Unidentified') {
|
31120 | return key;
|
31121 | }
|
31122 | }
|
31123 |
|
31124 |
|
31125 | if (nativeEvent.type === 'keypress') {
|
31126 | var charCode = getEventCharCode(nativeEvent);
|
31127 |
|
31128 |
|
31129 |
|
31130 | return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
|
31131 | }
|
31132 | if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
|
31133 |
|
31134 |
|
31135 | return translateToKey[nativeEvent.keyCode] || 'Unidentified';
|
31136 | }
|
31137 | return '';
|
31138 | }
|
31139 |
|
31140 | module.exports = getEventKey;
|
31141 | },{"276":276}],278:[function(require,module,exports){
|
31142 |
|
31143 |
|
31144 |
|
31145 |
|
31146 |
|
31147 |
|
31148 |
|
31149 |
|
31150 |
|
31151 |
|
31152 |
|
31153 | 'use strict';
|
31154 |
|
31155 |
|
31156 |
|
31157 |
|
31158 |
|
31159 |
|
31160 | var modifierKeyToProp = {
|
31161 | 'Alt': 'altKey',
|
31162 | 'Control': 'ctrlKey',
|
31163 | 'Meta': 'metaKey',
|
31164 | 'Shift': 'shiftKey'
|
31165 | };
|
31166 |
|
31167 |
|
31168 |
|
31169 |
|
31170 | function modifierStateGetter(keyArg) {
|
31171 | var syntheticEvent = this;
|
31172 | var nativeEvent = syntheticEvent.nativeEvent;
|
31173 | if (nativeEvent.getModifierState) {
|
31174 | return nativeEvent.getModifierState(keyArg);
|
31175 | }
|
31176 | var keyProp = modifierKeyToProp[keyArg];
|
31177 | return keyProp ? !!nativeEvent[keyProp] : false;
|
31178 | }
|
31179 |
|
31180 | function getEventModifierState(nativeEvent) {
|
31181 | return modifierStateGetter;
|
31182 | }
|
31183 |
|
31184 | module.exports = getEventModifierState;
|
31185 | },{}],279:[function(require,module,exports){
|
31186 |
|
31187 |
|
31188 |
|
31189 |
|
31190 |
|
31191 |
|
31192 |
|
31193 |
|
31194 |
|
31195 |
|
31196 |
|
31197 | 'use strict';
|
31198 |
|
31199 |
|
31200 |
|
31201 |
|
31202 |
|
31203 |
|
31204 |
|
31205 |
|
31206 |
|
31207 | function getEventTarget(nativeEvent) {
|
31208 | var target = nativeEvent.target || nativeEvent.srcElement || window;
|
31209 |
|
31210 |
|
31211 | if (target.correspondingUseElement) {
|
31212 | target = target.correspondingUseElement;
|
31213 | }
|
31214 |
|
31215 |
|
31216 |
|
31217 | return target.nodeType === 3 ? target.parentNode : target;
|
31218 | }
|
31219 |
|
31220 | module.exports = getEventTarget;
|
31221 | },{}],280:[function(require,module,exports){
|
31222 |
|
31223 |
|
31224 |
|
31225 |
|
31226 |
|
31227 |
|
31228 |
|
31229 |
|
31230 |
|
31231 |
|
31232 |
|
31233 | 'use strict';
|
31234 |
|
31235 |
|
31236 |
|
31237 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
31238 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
31239 |
|
31240 |
|
31241 |
|
31242 |
|
31243 |
|
31244 |
|
31245 |
|
31246 |
|
31247 |
|
31248 |
|
31249 |
|
31250 |
|
31251 |
|
31252 |
|
31253 |
|
31254 | function getIteratorFn(maybeIterable) {
|
31255 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
31256 | if (typeof iteratorFn === 'function') {
|
31257 | return iteratorFn;
|
31258 | }
|
31259 | }
|
31260 |
|
31261 | module.exports = getIteratorFn;
|
31262 | },{}],281:[function(require,module,exports){
|
31263 |
|
31264 |
|
31265 |
|
31266 |
|
31267 |
|
31268 |
|
31269 |
|
31270 |
|
31271 |
|
31272 |
|
31273 |
|
31274 | 'use strict';
|
31275 |
|
31276 | var ReactNodeTypes = require(236);
|
31277 |
|
31278 | function getNativeComponentFromComposite(inst) {
|
31279 | var type;
|
31280 |
|
31281 | while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
|
31282 | inst = inst._renderedComponent;
|
31283 | }
|
31284 |
|
31285 | if (type === ReactNodeTypes.NATIVE) {
|
31286 | return inst._renderedComponent;
|
31287 | } else if (type === ReactNodeTypes.EMPTY) {
|
31288 | return null;
|
31289 | }
|
31290 | }
|
31291 |
|
31292 | module.exports = getNativeComponentFromComposite;
|
31293 | },{"236":236}],282:[function(require,module,exports){
|
31294 |
|
31295 |
|
31296 |
|
31297 |
|
31298 |
|
31299 |
|
31300 |
|
31301 |
|
31302 |
|
31303 |
|
31304 |
|
31305 | 'use strict';
|
31306 |
|
31307 |
|
31308 |
|
31309 |
|
31310 |
|
31311 |
|
31312 |
|
31313 |
|
31314 | function getLeafNode(node) {
|
31315 | while (node && node.firstChild) {
|
31316 | node = node.firstChild;
|
31317 | }
|
31318 | return node;
|
31319 | }
|
31320 |
|
31321 |
|
31322 |
|
31323 |
|
31324 |
|
31325 |
|
31326 |
|
31327 |
|
31328 | function getSiblingNode(node) {
|
31329 | while (node) {
|
31330 | if (node.nextSibling) {
|
31331 | return node.nextSibling;
|
31332 | }
|
31333 | node = node.parentNode;
|
31334 | }
|
31335 | }
|
31336 |
|
31337 |
|
31338 |
|
31339 |
|
31340 |
|
31341 |
|
31342 |
|
31343 |
|
31344 | function getNodeForCharacterOffset(root, offset) {
|
31345 | var node = getLeafNode(root);
|
31346 | var nodeStart = 0;
|
31347 | var nodeEnd = 0;
|
31348 |
|
31349 | while (node) {
|
31350 | if (node.nodeType === 3) {
|
31351 | nodeEnd = nodeStart + node.textContent.length;
|
31352 |
|
31353 | if (nodeStart <= offset && nodeEnd >= offset) {
|
31354 | return {
|
31355 | node: node,
|
31356 | offset: offset - nodeStart
|
31357 | };
|
31358 | }
|
31359 |
|
31360 | nodeStart = nodeEnd;
|
31361 | }
|
31362 |
|
31363 | node = getLeafNode(getSiblingNode(node));
|
31364 | }
|
31365 | }
|
31366 |
|
31367 | module.exports = getNodeForCharacterOffset;
|
31368 | },{}],283:[function(require,module,exports){
|
31369 |
|
31370 |
|
31371 |
|
31372 |
|
31373 |
|
31374 |
|
31375 |
|
31376 |
|
31377 |
|
31378 |
|
31379 |
|
31380 | 'use strict';
|
31381 |
|
31382 | var ExecutionEnvironment = require(31);
|
31383 |
|
31384 | var contentKey = null;
|
31385 |
|
31386 |
|
31387 |
|
31388 |
|
31389 |
|
31390 |
|
31391 |
|
31392 | function getTextContentAccessor() {
|
31393 | if (!contentKey && ExecutionEnvironment.canUseDOM) {
|
31394 |
|
31395 |
|
31396 | contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
|
31397 | }
|
31398 | return contentKey;
|
31399 | }
|
31400 |
|
31401 | module.exports = getTextContentAccessor;
|
31402 | },{"31":31}],284:[function(require,module,exports){
|
31403 |
|
31404 |
|
31405 |
|
31406 |
|
31407 |
|
31408 |
|
31409 |
|
31410 |
|
31411 |
|
31412 |
|
31413 |
|
31414 | 'use strict';
|
31415 |
|
31416 | var ExecutionEnvironment = require(31);
|
31417 |
|
31418 |
|
31419 |
|
31420 |
|
31421 |
|
31422 |
|
31423 |
|
31424 |
|
31425 | function makePrefixMap(styleProp, eventName) {
|
31426 | var prefixes = {};
|
31427 |
|
31428 | prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
31429 | prefixes['Webkit' + styleProp] = 'webkit' + eventName;
|
31430 | prefixes['Moz' + styleProp] = 'moz' + eventName;
|
31431 | prefixes['ms' + styleProp] = 'MS' + eventName;
|
31432 | prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
|
31433 |
|
31434 | return prefixes;
|
31435 | }
|
31436 |
|
31437 |
|
31438 |
|
31439 |
|
31440 | var vendorPrefixes = {
|
31441 | animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
31442 | animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
|
31443 | animationstart: makePrefixMap('Animation', 'AnimationStart'),
|
31444 | transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
31445 | };
|
31446 |
|
31447 |
|
31448 |
|
31449 |
|
31450 | var prefixedEventNames = {};
|
31451 |
|
31452 |
|
31453 |
|
31454 |
|
31455 | var style = {};
|
31456 |
|
31457 |
|
31458 |
|
31459 |
|
31460 | if (ExecutionEnvironment.canUseDOM) {
|
31461 | style = document.createElement('div').style;
|
31462 |
|
31463 |
|
31464 |
|
31465 |
|
31466 |
|
31467 | if (!('AnimationEvent' in window)) {
|
31468 | delete vendorPrefixes.animationend.animation;
|
31469 | delete vendorPrefixes.animationiteration.animation;
|
31470 | delete vendorPrefixes.animationstart.animation;
|
31471 | }
|
31472 |
|
31473 |
|
31474 | if (!('TransitionEvent' in window)) {
|
31475 | delete vendorPrefixes.transitionend.transition;
|
31476 | }
|
31477 | }
|
31478 |
|
31479 |
|
31480 |
|
31481 |
|
31482 |
|
31483 |
|
31484 |
|
31485 | function getVendorPrefixedEventName(eventName) {
|
31486 | if (prefixedEventNames[eventName]) {
|
31487 | return prefixedEventNames[eventName];
|
31488 | } else if (!vendorPrefixes[eventName]) {
|
31489 | return eventName;
|
31490 | }
|
31491 |
|
31492 | var prefixMap = vendorPrefixes[eventName];
|
31493 |
|
31494 | for (var styleProp in prefixMap) {
|
31495 | if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
|
31496 | return prefixedEventNames[eventName] = prefixMap[styleProp];
|
31497 | }
|
31498 | }
|
31499 |
|
31500 | return '';
|
31501 | }
|
31502 |
|
31503 | module.exports = getVendorPrefixedEventName;
|
31504 | },{"31":31}],285:[function(require,module,exports){
|
31505 | (function (process){
|
31506 |
|
31507 |
|
31508 |
|
31509 |
|
31510 |
|
31511 |
|
31512 |
|
31513 |
|
31514 |
|
31515 |
|
31516 |
|
31517 | 'use strict';
|
31518 |
|
31519 | var _assign = require(296);
|
31520 |
|
31521 | var ReactCompositeComponent = require(193);
|
31522 | var ReactEmptyComponent = require(220);
|
31523 | var ReactNativeComponent = require(234);
|
31524 | var ReactInstrumentation = require(228);
|
31525 |
|
31526 | var invariant = require(45);
|
31527 | var warning = require(55);
|
31528 |
|
31529 |
|
31530 | var ReactCompositeComponentWrapper = function (element) {
|
31531 | this.construct(element);
|
31532 | };
|
31533 | _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
|
31534 | _instantiateReactComponent: instantiateReactComponent
|
31535 | });
|
31536 |
|
31537 | function getDeclarationErrorAddendum(owner) {
|
31538 | if (owner) {
|
31539 | var name = owner.getName();
|
31540 | if (name) {
|
31541 | return ' Check the render method of `' + name + '`.';
|
31542 | }
|
31543 | }
|
31544 | return '';
|
31545 | }
|
31546 |
|
31547 | function getDisplayName(instance) {
|
31548 | var element = instance._currentElement;
|
31549 | if (element == null) {
|
31550 | return '#empty';
|
31551 | } else if (typeof element === 'string' || typeof element === 'number') {
|
31552 | return '#text';
|
31553 | } else if (typeof element.type === 'string') {
|
31554 | return element.type;
|
31555 | } else if (instance.getName) {
|
31556 | return instance.getName() || 'Unknown';
|
31557 | } else {
|
31558 | return element.type.displayName || element.type.name || 'Unknown';
|
31559 | }
|
31560 | }
|
31561 |
|
31562 |
|
31563 |
|
31564 |
|
31565 |
|
31566 |
|
31567 |
|
31568 |
|
31569 | function isInternalComponentType(type) {
|
31570 | return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
|
31571 | }
|
31572 |
|
31573 | var nextDebugID = 1;
|
31574 |
|
31575 |
|
31576 |
|
31577 |
|
31578 |
|
31579 |
|
31580 |
|
31581 |
|
31582 | function instantiateReactComponent(node) {
|
31583 | var instance;
|
31584 |
|
31585 | var isEmpty = node === null || node === false;
|
31586 | if (isEmpty) {
|
31587 | instance = ReactEmptyComponent.create(instantiateReactComponent);
|
31588 | } else if (typeof node === 'object') {
|
31589 | var element = node;
|
31590 | !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : void 0;
|
31591 |
|
31592 |
|
31593 | if (typeof element.type === 'string') {
|
31594 | instance = ReactNativeComponent.createInternalComponent(element);
|
31595 | } else if (isInternalComponentType(element.type)) {
|
31596 |
|
31597 |
|
31598 |
|
31599 | instance = new element.type(element);
|
31600 | } else {
|
31601 | instance = new ReactCompositeComponentWrapper(element);
|
31602 | }
|
31603 | } else if (typeof node === 'string' || typeof node === 'number') {
|
31604 | instance = ReactNativeComponent.createInstanceForText(node);
|
31605 | } else {
|
31606 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : void 0;
|
31607 | }
|
31608 |
|
31609 | if (process.env.NODE_ENV !== 'production') {
|
31610 | process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
|
31611 | }
|
31612 |
|
31613 |
|
31614 |
|
31615 |
|
31616 | instance._mountIndex = 0;
|
31617 | instance._mountImage = null;
|
31618 |
|
31619 | if (process.env.NODE_ENV !== 'production') {
|
31620 | instance._isOwnerNecessary = false;
|
31621 | instance._warnedAboutRefsInRender = false;
|
31622 | }
|
31623 |
|
31624 | if (process.env.NODE_ENV !== 'production') {
|
31625 | var debugID = isEmpty ? 0 : nextDebugID++;
|
31626 | instance._debugID = debugID;
|
31627 |
|
31628 | if (debugID !== 0) {
|
31629 | var displayName = getDisplayName(instance);
|
31630 | ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName);
|
31631 | var owner = node && node._owner;
|
31632 | if (owner) {
|
31633 | ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID);
|
31634 | }
|
31635 | }
|
31636 | }
|
31637 |
|
31638 |
|
31639 |
|
31640 | if (process.env.NODE_ENV !== 'production') {
|
31641 | if (Object.preventExtensions) {
|
31642 | Object.preventExtensions(instance);
|
31643 | }
|
31644 | }
|
31645 |
|
31646 | return instance;
|
31647 | }
|
31648 |
|
31649 | module.exports = instantiateReactComponent;
|
31650 | }).call(this,require(91))
|
31651 | },{"193":193,"220":220,"228":228,"234":234,"296":296,"45":45,"55":55,"91":91}],286:[function(require,module,exports){
|
31652 |
|
31653 |
|
31654 |
|
31655 |
|
31656 |
|
31657 |
|
31658 |
|
31659 |
|
31660 |
|
31661 |
|
31662 |
|
31663 | 'use strict';
|
31664 |
|
31665 | var ExecutionEnvironment = require(31);
|
31666 |
|
31667 | var useHasFeature;
|
31668 | if (ExecutionEnvironment.canUseDOM) {
|
31669 | useHasFeature = document.implementation && document.implementation.hasFeature &&
|
31670 |
|
31671 |
|
31672 | document.implementation.hasFeature('', '') !== true;
|
31673 | }
|
31674 |
|
31675 |
|
31676 |
|
31677 |
|
31678 |
|
31679 |
|
31680 |
|
31681 |
|
31682 |
|
31683 |
|
31684 |
|
31685 |
|
31686 |
|
31687 |
|
31688 |
|
31689 | function isEventSupported(eventNameSuffix, capture) {
|
31690 | if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
|
31691 | return false;
|
31692 | }
|
31693 |
|
31694 | var eventName = 'on' + eventNameSuffix;
|
31695 | var isSupported = eventName in document;
|
31696 |
|
31697 | if (!isSupported) {
|
31698 | var element = document.createElement('div');
|
31699 | element.setAttribute(eventName, 'return;');
|
31700 | isSupported = typeof element[eventName] === 'function';
|
31701 | }
|
31702 |
|
31703 | if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
|
31704 |
|
31705 | isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
31706 | }
|
31707 |
|
31708 | return isSupported;
|
31709 | }
|
31710 |
|
31711 | module.exports = isEventSupported;
|
31712 | },{"31":31}],287:[function(require,module,exports){
|
31713 |
|
31714 |
|
31715 |
|
31716 |
|
31717 |
|
31718 |
|
31719 |
|
31720 |
|
31721 |
|
31722 |
|
31723 |
|
31724 | 'use strict';
|
31725 |
|
31726 |
|
31727 |
|
31728 |
|
31729 |
|
31730 | var supportedInputTypes = {
|
31731 | 'color': true,
|
31732 | 'date': true,
|
31733 | 'datetime': true,
|
31734 | 'datetime-local': true,
|
31735 | 'email': true,
|
31736 | 'month': true,
|
31737 | 'number': true,
|
31738 | 'password': true,
|
31739 | 'range': true,
|
31740 | 'search': true,
|
31741 | 'tel': true,
|
31742 | 'text': true,
|
31743 | 'time': true,
|
31744 | 'url': true,
|
31745 | 'week': true
|
31746 | };
|
31747 |
|
31748 | function isTextInputElement(elem) {
|
31749 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
31750 | return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
|
31751 | }
|
31752 |
|
31753 | module.exports = isTextInputElement;
|
31754 | },{}],288:[function(require,module,exports){
|
31755 | (function (process){
|
31756 |
|
31757 |
|
31758 |
|
31759 |
|
31760 |
|
31761 |
|
31762 |
|
31763 |
|
31764 |
|
31765 |
|
31766 | 'use strict';
|
31767 |
|
31768 | var ReactElement = require(218);
|
31769 |
|
31770 | var invariant = require(45);
|
31771 |
|
31772 |
|
31773 |
|
31774 |
|
31775 |
|
31776 |
|
31777 |
|
31778 |
|
31779 |
|
31780 |
|
31781 |
|
31782 |
|
31783 |
|
31784 |
|
31785 |
|
31786 | function onlyChild(children) {
|
31787 | !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : void 0;
|
31788 | return children;
|
31789 | }
|
31790 |
|
31791 | module.exports = onlyChild;
|
31792 | }).call(this,require(91))
|
31793 | },{"218":218,"45":45,"91":91}],289:[function(require,module,exports){
|
31794 |
|
31795 |
|
31796 |
|
31797 |
|
31798 |
|
31799 |
|
31800 |
|
31801 |
|
31802 |
|
31803 |
|
31804 |
|
31805 | 'use strict';
|
31806 |
|
31807 | var escapeTextContentForBrowser = require(272);
|
31808 |
|
31809 |
|
31810 |
|
31811 |
|
31812 |
|
31813 |
|
31814 |
|
31815 | function quoteAttributeValueForBrowser(value) {
|
31816 | return '"' + escapeTextContentForBrowser(value) + '"';
|
31817 | }
|
31818 |
|
31819 | module.exports = quoteAttributeValueForBrowser;
|
31820 | },{"272":272}],290:[function(require,module,exports){
|
31821 |
|
31822 |
|
31823 |
|
31824 |
|
31825 |
|
31826 |
|
31827 |
|
31828 |
|
31829 |
|
31830 |
|
31831 |
|
31832 | 'use strict';
|
31833 |
|
31834 | var ReactMount = require(231);
|
31835 |
|
31836 | module.exports = ReactMount.renderSubtreeIntoContainer;
|
31837 | },{"231":231}],291:[function(require,module,exports){
|
31838 |
|
31839 |
|
31840 |
|
31841 |
|
31842 |
|
31843 |
|
31844 |
|
31845 |
|
31846 |
|
31847 |
|
31848 |
|
31849 | 'use strict';
|
31850 |
|
31851 | var ExecutionEnvironment = require(31);
|
31852 |
|
31853 | var WHITESPACE_TEST = /^[ \r\n\t\f]/;
|
31854 | var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
|
31855 |
|
31856 | var createMicrosoftUnsafeLocalFunction = require(270);
|
31857 |
|
31858 |
|
31859 |
|
31860 |
|
31861 |
|
31862 |
|
31863 |
|
31864 |
|
31865 |
|
31866 | var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
|
31867 | node.innerHTML = html;
|
31868 | });
|
31869 |
|
31870 | if (ExecutionEnvironment.canUseDOM) {
|
31871 |
|
31872 |
|
31873 |
|
31874 |
|
31875 |
|
31876 |
|
31877 | var testElement = document.createElement('div');
|
31878 | testElement.innerHTML = ' ';
|
31879 | if (testElement.innerHTML === '') {
|
31880 | setInnerHTML = function (node, html) {
|
31881 |
|
31882 |
|
31883 |
|
31884 |
|
31885 |
|
31886 | if (node.parentNode) {
|
31887 | node.parentNode.replaceChild(node, node);
|
31888 | }
|
31889 |
|
31890 |
|
31891 |
|
31892 |
|
31893 |
|
31894 | if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
|
31895 |
|
31896 |
|
31897 |
|
31898 |
|
31899 |
|
31900 |
|
31901 | node.innerHTML = String.fromCharCode(0xFEFF) + html;
|
31902 |
|
31903 |
|
31904 |
|
31905 | var textNode = node.firstChild;
|
31906 | if (textNode.data.length === 1) {
|
31907 | node.removeChild(textNode);
|
31908 | } else {
|
31909 | textNode.deleteData(0, 1);
|
31910 | }
|
31911 | } else {
|
31912 | node.innerHTML = html;
|
31913 | }
|
31914 | };
|
31915 | }
|
31916 | testElement = null;
|
31917 | }
|
31918 |
|
31919 | module.exports = setInnerHTML;
|
31920 | },{"270":270,"31":31}],292:[function(require,module,exports){
|
31921 |
|
31922 |
|
31923 |
|
31924 |
|
31925 |
|
31926 |
|
31927 |
|
31928 |
|
31929 |
|
31930 |
|
31931 |
|
31932 | 'use strict';
|
31933 |
|
31934 | var ExecutionEnvironment = require(31);
|
31935 | var escapeTextContentForBrowser = require(272);
|
31936 | var setInnerHTML = require(291);
|
31937 |
|
31938 |
|
31939 |
|
31940 |
|
31941 |
|
31942 |
|
31943 |
|
31944 |
|
31945 |
|
31946 |
|
31947 |
|
31948 | var setTextContent = function (node, text) {
|
31949 | node.textContent = text;
|
31950 | };
|
31951 |
|
31952 | if (ExecutionEnvironment.canUseDOM) {
|
31953 | if (!('textContent' in document.documentElement)) {
|
31954 | setTextContent = function (node, text) {
|
31955 | setInnerHTML(node, escapeTextContentForBrowser(text));
|
31956 | };
|
31957 | }
|
31958 | }
|
31959 |
|
31960 | module.exports = setTextContent;
|
31961 | },{"272":272,"291":291,"31":31}],293:[function(require,module,exports){
|
31962 |
|
31963 |
|
31964 |
|
31965 |
|
31966 |
|
31967 |
|
31968 |
|
31969 |
|
31970 |
|
31971 |
|
31972 |
|
31973 | 'use strict';
|
31974 |
|
31975 |
|
31976 |
|
31977 |
|
31978 |
|
31979 |
|
31980 |
|
31981 |
|
31982 |
|
31983 |
|
31984 |
|
31985 |
|
31986 |
|
31987 | function shouldUpdateReactComponent(prevElement, nextElement) {
|
31988 | var prevEmpty = prevElement === null || prevElement === false;
|
31989 | var nextEmpty = nextElement === null || nextElement === false;
|
31990 | if (prevEmpty || nextEmpty) {
|
31991 | return prevEmpty === nextEmpty;
|
31992 | }
|
31993 |
|
31994 | var prevType = typeof prevElement;
|
31995 | var nextType = typeof nextElement;
|
31996 | if (prevType === 'string' || prevType === 'number') {
|
31997 | return nextType === 'string' || nextType === 'number';
|
31998 | } else {
|
31999 | return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
|
32000 | }
|
32001 | }
|
32002 |
|
32003 | module.exports = shouldUpdateReactComponent;
|
32004 | },{}],294:[function(require,module,exports){
|
32005 | (function (process){
|
32006 |
|
32007 |
|
32008 |
|
32009 |
|
32010 |
|
32011 |
|
32012 |
|
32013 |
|
32014 |
|
32015 |
|
32016 |
|
32017 | 'use strict';
|
32018 |
|
32019 | var ReactCurrentOwner = require(194);
|
32020 | var ReactElement = require(218);
|
32021 |
|
32022 | var getIteratorFn = require(280);
|
32023 | var invariant = require(45);
|
32024 | var KeyEscapeUtils = require(181);
|
32025 | var warning = require(55);
|
32026 |
|
32027 | var SEPARATOR = '.';
|
32028 | var SUBSEPARATOR = ':';
|
32029 |
|
32030 |
|
32031 |
|
32032 |
|
32033 |
|
32034 |
|
32035 | var didWarnAboutMaps = false;
|
32036 |
|
32037 |
|
32038 |
|
32039 |
|
32040 |
|
32041 |
|
32042 |
|
32043 |
|
32044 | function getComponentKey(component, index) {
|
32045 |
|
32046 |
|
32047 | if (component && typeof component === 'object' && component.key != null) {
|
32048 |
|
32049 | return KeyEscapeUtils.escape(component.key);
|
32050 | }
|
32051 |
|
32052 | return index.toString(36);
|
32053 | }
|
32054 |
|
32055 |
|
32056 |
|
32057 |
|
32058 |
|
32059 |
|
32060 |
|
32061 |
|
32062 |
|
32063 | function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
32064 | var type = typeof children;
|
32065 |
|
32066 | if (type === 'undefined' || type === 'boolean') {
|
32067 |
|
32068 | children = null;
|
32069 | }
|
32070 |
|
32071 | if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
|
32072 | callback(traverseContext, children,
|
32073 |
|
32074 |
|
32075 | nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
32076 | return 1;
|
32077 | }
|
32078 |
|
32079 | var child;
|
32080 | var nextName;
|
32081 | var subtreeCount = 0;
|
32082 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
32083 |
|
32084 | if (Array.isArray(children)) {
|
32085 | for (var i = 0; i < children.length; i++) {
|
32086 | child = children[i];
|
32087 | nextName = nextNamePrefix + getComponentKey(child, i);
|
32088 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
32089 | }
|
32090 | } else {
|
32091 | var iteratorFn = getIteratorFn(children);
|
32092 | if (iteratorFn) {
|
32093 | var iterator = iteratorFn.call(children);
|
32094 | var step;
|
32095 | if (iteratorFn !== children.entries) {
|
32096 | var ii = 0;
|
32097 | while (!(step = iterator.next()).done) {
|
32098 | child = step.value;
|
32099 | nextName = nextNamePrefix + getComponentKey(child, ii++);
|
32100 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
32101 | }
|
32102 | } else {
|
32103 | if (process.env.NODE_ENV !== 'production') {
|
32104 | process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : void 0;
|
32105 | didWarnAboutMaps = true;
|
32106 | }
|
32107 |
|
32108 | while (!(step = iterator.next()).done) {
|
32109 | var entry = step.value;
|
32110 | if (entry) {
|
32111 | child = entry[1];
|
32112 | nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
32113 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
32114 | }
|
32115 | }
|
32116 | }
|
32117 | } else if (type === 'object') {
|
32118 | var addendum = '';
|
32119 | if (process.env.NODE_ENV !== 'production') {
|
32120 | addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
|
32121 | if (children._isReactElement) {
|
32122 | addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
|
32123 | }
|
32124 | if (ReactCurrentOwner.current) {
|
32125 | var name = ReactCurrentOwner.current.getName();
|
32126 | if (name) {
|
32127 | addendum += ' Check the render method of `' + name + '`.';
|
32128 | }
|
32129 | }
|
32130 | }
|
32131 | var childrenString = String(children);
|
32132 | !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : void 0;
|
32133 | }
|
32134 | }
|
32135 |
|
32136 | return subtreeCount;
|
32137 | }
|
32138 |
|
32139 |
|
32140 |
|
32141 |
|
32142 |
|
32143 |
|
32144 |
|
32145 |
|
32146 |
|
32147 |
|
32148 |
|
32149 |
|
32150 |
|
32151 |
|
32152 |
|
32153 |
|
32154 |
|
32155 | function traverseAllChildren(children, callback, traverseContext) {
|
32156 | if (children == null) {
|
32157 | return 0;
|
32158 | }
|
32159 |
|
32160 | return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
32161 | }
|
32162 |
|
32163 | module.exports = traverseAllChildren;
|
32164 | }).call(this,require(91))
|
32165 | },{"181":181,"194":194,"218":218,"280":280,"45":45,"55":55,"91":91}],295:[function(require,module,exports){
|
32166 | (function (process){
|
32167 |
|
32168 |
|
32169 |
|
32170 |
|
32171 |
|
32172 |
|
32173 |
|
32174 |
|
32175 |
|
32176 |
|
32177 |
|
32178 | 'use strict';
|
32179 |
|
32180 | var _assign = require(296);
|
32181 |
|
32182 | var emptyFunction = require(37);
|
32183 | var warning = require(55);
|
32184 |
|
32185 | var validateDOMNesting = emptyFunction;
|
32186 |
|
32187 | if (process.env.NODE_ENV !== 'production') {
|
32188 |
|
32189 |
|
32190 |
|
32191 |
|
32192 |
|
32193 |
|
32194 |
|
32195 |
|
32196 |
|
32197 |
|
32198 |
|
32199 |
|
32200 | var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
|
32201 |
|
32202 |
|
32203 | var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
|
32204 |
|
32205 |
|
32206 |
|
32207 |
|
32208 | 'foreignObject', 'desc', 'title'];
|
32209 |
|
32210 |
|
32211 | var buttonScopeTags = inScopeTags.concat(['button']);
|
32212 |
|
32213 |
|
32214 | var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
|
32215 |
|
32216 | var emptyAncestorInfo = {
|
32217 | current: null,
|
32218 |
|
32219 | formTag: null,
|
32220 | aTagInScope: null,
|
32221 | buttonTagInScope: null,
|
32222 | nobrTagInScope: null,
|
32223 | pTagInButtonScope: null,
|
32224 |
|
32225 | listItemTagAutoclosing: null,
|
32226 | dlItemTagAutoclosing: null
|
32227 | };
|
32228 |
|
32229 | var updatedAncestorInfo = function (oldInfo, tag, instance) {
|
32230 | var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
|
32231 | var info = { tag: tag, instance: instance };
|
32232 |
|
32233 | if (inScopeTags.indexOf(tag) !== -1) {
|
32234 | ancestorInfo.aTagInScope = null;
|
32235 | ancestorInfo.buttonTagInScope = null;
|
32236 | ancestorInfo.nobrTagInScope = null;
|
32237 | }
|
32238 | if (buttonScopeTags.indexOf(tag) !== -1) {
|
32239 | ancestorInfo.pTagInButtonScope = null;
|
32240 | }
|
32241 |
|
32242 |
|
32243 |
|
32244 | if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
|
32245 | ancestorInfo.listItemTagAutoclosing = null;
|
32246 | ancestorInfo.dlItemTagAutoclosing = null;
|
32247 | }
|
32248 |
|
32249 | ancestorInfo.current = info;
|
32250 |
|
32251 | if (tag === 'form') {
|
32252 | ancestorInfo.formTag = info;
|
32253 | }
|
32254 | if (tag === 'a') {
|
32255 | ancestorInfo.aTagInScope = info;
|
32256 | }
|
32257 | if (tag === 'button') {
|
32258 | ancestorInfo.buttonTagInScope = info;
|
32259 | }
|
32260 | if (tag === 'nobr') {
|
32261 | ancestorInfo.nobrTagInScope = info;
|
32262 | }
|
32263 | if (tag === 'p') {
|
32264 | ancestorInfo.pTagInButtonScope = info;
|
32265 | }
|
32266 | if (tag === 'li') {
|
32267 | ancestorInfo.listItemTagAutoclosing = info;
|
32268 | }
|
32269 | if (tag === 'dd' || tag === 'dt') {
|
32270 | ancestorInfo.dlItemTagAutoclosing = info;
|
32271 | }
|
32272 |
|
32273 | return ancestorInfo;
|
32274 | };
|
32275 |
|
32276 | |
32277 |
|
32278 |
|
32279 | var isTagValidWithParent = function (tag, parentTag) {
|
32280 |
|
32281 | switch (parentTag) {
|
32282 |
|
32283 | case 'select':
|
32284 | return tag === 'option' || tag === 'optgroup' || tag === '#text';
|
32285 | case 'optgroup':
|
32286 | return tag === 'option' || tag === '#text';
|
32287 |
|
32288 |
|
32289 | case 'option':
|
32290 | return tag === '#text';
|
32291 |
|
32292 |
|
32293 |
|
32294 |
|
32295 |
|
32296 |
|
32297 |
|
32298 | case 'tr':
|
32299 | return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
|
32300 |
|
32301 |
|
32302 | case 'tbody':
|
32303 | case 'thead':
|
32304 | case 'tfoot':
|
32305 | return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
|
32306 |
|
32307 |
|
32308 | case 'colgroup':
|
32309 | return tag === 'col' || tag === 'template';
|
32310 |
|
32311 |
|
32312 | case 'table':
|
32313 | return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
|
32314 |
|
32315 |
|
32316 | case 'head':
|
32317 | return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
|
32318 |
|
32319 |
|
32320 | case 'html':
|
32321 | return tag === 'head' || tag === 'body';
|
32322 | case '#document':
|
32323 | return tag === 'html';
|
32324 | }
|
32325 |
|
32326 |
|
32327 |
|
32328 |
|
32329 | switch (tag) {
|
32330 | case 'h1':
|
32331 | case 'h2':
|
32332 | case 'h3':
|
32333 | case 'h4':
|
32334 | case 'h5':
|
32335 | case 'h6':
|
32336 | return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
|
32337 |
|
32338 | case 'rp':
|
32339 | case 'rt':
|
32340 | return impliedEndTags.indexOf(parentTag) === -1;
|
32341 |
|
32342 | case 'body':
|
32343 | case 'caption':
|
32344 | case 'col':
|
32345 | case 'colgroup':
|
32346 | case 'frame':
|
32347 | case 'head':
|
32348 | case 'html':
|
32349 | case 'tbody':
|
32350 | case 'td':
|
32351 | case 'tfoot':
|
32352 | case 'th':
|
32353 | case 'thead':
|
32354 | case 'tr':
|
32355 |
|
32356 |
|
32357 |
|
32358 |
|
32359 | return parentTag == null;
|
32360 | }
|
32361 |
|
32362 | return true;
|
32363 | };
|
32364 |
|
32365 | |
32366 |
|
32367 |
|
32368 | var findInvalidAncestorForTag = function (tag, ancestorInfo) {
|
32369 | switch (tag) {
|
32370 | case 'address':
|
32371 | case 'article':
|
32372 | case 'aside':
|
32373 | case 'blockquote':
|
32374 | case 'center':
|
32375 | case 'details':
|
32376 | case 'dialog':
|
32377 | case 'dir':
|
32378 | case 'div':
|
32379 | case 'dl':
|
32380 | case 'fieldset':
|
32381 | case 'figcaption':
|
32382 | case 'figure':
|
32383 | case 'footer':
|
32384 | case 'header':
|
32385 | case 'hgroup':
|
32386 | case 'main':
|
32387 | case 'menu':
|
32388 | case 'nav':
|
32389 | case 'ol':
|
32390 | case 'p':
|
32391 | case 'section':
|
32392 | case 'summary':
|
32393 | case 'ul':
|
32394 |
|
32395 | case 'pre':
|
32396 | case 'listing':
|
32397 |
|
32398 | case 'table':
|
32399 |
|
32400 | case 'hr':
|
32401 |
|
32402 | case 'xmp':
|
32403 |
|
32404 | case 'h1':
|
32405 | case 'h2':
|
32406 | case 'h3':
|
32407 | case 'h4':
|
32408 | case 'h5':
|
32409 | case 'h6':
|
32410 | return ancestorInfo.pTagInButtonScope;
|
32411 |
|
32412 | case 'form':
|
32413 | return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
32414 |
|
32415 | case 'li':
|
32416 | return ancestorInfo.listItemTagAutoclosing;
|
32417 |
|
32418 | case 'dd':
|
32419 | case 'dt':
|
32420 | return ancestorInfo.dlItemTagAutoclosing;
|
32421 |
|
32422 | case 'button':
|
32423 | return ancestorInfo.buttonTagInScope;
|
32424 |
|
32425 | case 'a':
|
32426 |
|
32427 |
|
32428 | return ancestorInfo.aTagInScope;
|
32429 |
|
32430 | case 'nobr':
|
32431 | return ancestorInfo.nobrTagInScope;
|
32432 | }
|
32433 |
|
32434 | return null;
|
32435 | };
|
32436 |
|
32437 | |
32438 |
|
32439 |
|
32440 |
|
32441 | var findOwnerStack = function (instance) {
|
32442 | if (!instance) {
|
32443 | return [];
|
32444 | }
|
32445 |
|
32446 | var stack = [];
|
32447 | do {
|
32448 | stack.push(instance);
|
32449 | } while (instance = instance._currentElement._owner);
|
32450 | stack.reverse();
|
32451 | return stack;
|
32452 | };
|
32453 |
|
32454 | var didWarn = {};
|
32455 |
|
32456 | validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
|
32457 | ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
32458 | var parentInfo = ancestorInfo.current;
|
32459 | var parentTag = parentInfo && parentInfo.tag;
|
32460 |
|
32461 | var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
32462 | var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
32463 | var problematic = invalidParent || invalidAncestor;
|
32464 |
|
32465 | if (problematic) {
|
32466 | var ancestorTag = problematic.tag;
|
32467 | var ancestorInstance = problematic.instance;
|
32468 |
|
32469 | var childOwner = childInstance && childInstance._currentElement._owner;
|
32470 | var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
|
32471 |
|
32472 | var childOwners = findOwnerStack(childOwner);
|
32473 | var ancestorOwners = findOwnerStack(ancestorOwner);
|
32474 |
|
32475 | var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
|
32476 | var i;
|
32477 |
|
32478 | var deepestCommon = -1;
|
32479 | for (i = 0; i < minStackLen; i++) {
|
32480 | if (childOwners[i] === ancestorOwners[i]) {
|
32481 | deepestCommon = i;
|
32482 | } else {
|
32483 | break;
|
32484 | }
|
32485 | }
|
32486 |
|
32487 | var UNKNOWN = '(unknown)';
|
32488 | var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
|
32489 | return inst.getName() || UNKNOWN;
|
32490 | });
|
32491 | var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
|
32492 | return inst.getName() || UNKNOWN;
|
32493 | });
|
32494 | var ownerInfo = [].concat(
|
32495 |
|
32496 |
|
32497 | deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
|
32498 |
|
32499 | invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
|
32500 |
|
32501 | var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
|
32502 | if (didWarn[warnKey]) {
|
32503 | return;
|
32504 | }
|
32505 | didWarn[warnKey] = true;
|
32506 |
|
32507 | var tagDisplayName = childTag;
|
32508 | if (childTag !== '#text') {
|
32509 | tagDisplayName = '<' + childTag + '>';
|
32510 | }
|
32511 |
|
32512 | if (invalidParent) {
|
32513 | var info = '';
|
32514 | if (ancestorTag === 'table' && childTag === 'tr') {
|
32515 | info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
|
32516 | }
|
32517 | process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>. ' + 'See %s.%s', tagDisplayName, ancestorTag, ownerInfo, info) : void 0;
|
32518 | } else {
|
32519 | process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
|
32520 | }
|
32521 | }
|
32522 | };
|
32523 |
|
32524 | validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
|
32525 |
|
32526 |
|
32527 | validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
|
32528 | ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
32529 | var parentInfo = ancestorInfo.current;
|
32530 | var parentTag = parentInfo && parentInfo.tag;
|
32531 | return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
|
32532 | };
|
32533 | }
|
32534 |
|
32535 | module.exports = validateDOMNesting;
|
32536 | }).call(this,require(91))
|
32537 | },{"296":296,"37":37,"55":55,"91":91}],296:[function(require,module,exports){
|
32538 | arguments[4][77][0].apply(exports,arguments)
|
32539 | },{"77":77}],297:[function(require,module,exports){
|
32540 | 'use strict';
|
32541 |
|
32542 | module.exports = require(184);
|
32543 |
|
32544 | },{"184":184}],298:[function(require,module,exports){
|
32545 | 'use strict';
|
32546 |
|
32547 | exports.__esModule = true;
|
32548 |
|
32549 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
32550 |
|
32551 | var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
32552 |
|
32553 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
32554 |
|
32555 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
32556 |
|
32557 | function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32558 |
|
32559 | var _react = require(297);
|
32560 |
|
32561 | var _react2 = _interopRequireDefault(_react);
|
32562 |
|
32563 | var _reactRedux = require(100);
|
32564 |
|
32565 | var _reactRouter = require(136);
|
32566 |
|
32567 | var _routerStateEquals = require(308);
|
32568 |
|
32569 | var _routerStateEquals2 = _interopRequireDefault(_routerStateEquals);
|
32570 |
|
32571 | var _constants = require(301);
|
32572 |
|
32573 | var _actionCreators = require(299);
|
32574 |
|
32575 | function memoizeRouterStateSelector(selector) {
|
32576 | var previousRouterState = null;
|
32577 |
|
32578 | return function (state) {
|
32579 | var nextRouterState = selector(state);
|
32580 | if (_routerStateEquals2['default'](previousRouterState, nextRouterState)) {
|
32581 | return previousRouterState;
|
32582 | }
|
32583 | previousRouterState = nextRouterState;
|
32584 | return nextRouterState;
|
32585 | };
|
32586 | }
|
32587 |
|
32588 | function getRoutesFromProps(props) {
|
32589 | return props.routes || props.children;
|
32590 | }
|
32591 |
|
32592 | var ReduxRouter = (function (_Component) {
|
32593 | _inherits(ReduxRouter, _Component);
|
32594 |
|
32595 | _createClass(ReduxRouter, null, [{
|
32596 | key: 'propTypes',
|
32597 | value: {
|
32598 | children: _react.PropTypes.node
|
32599 | },
|
32600 | enumerable: true
|
32601 | }, {
|
32602 | key: 'contextTypes',
|
32603 | value: {
|
32604 | store: _react.PropTypes.object
|
32605 | },
|
32606 | enumerable: true
|
32607 | }]);
|
32608 |
|
32609 | function ReduxRouter(props, context) {
|
32610 | _classCallCheck(this, ReduxRouter);
|
32611 |
|
32612 | _Component.call(this, props, context);
|
32613 | context.store.dispatch(_actionCreators.initRoutes(getRoutesFromProps(props)));
|
32614 | }
|
32615 |
|
32616 | ReduxRouter.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
32617 | this.receiveRoutes(getRoutesFromProps(nextProps));
|
32618 | };
|
32619 |
|
32620 | ReduxRouter.prototype.receiveRoutes = function receiveRoutes(routes) {
|
32621 | if (!routes) return;
|
32622 |
|
32623 | var store = this.context.store;
|
32624 |
|
32625 | store.dispatch(_actionCreators.replaceRoutes(routes));
|
32626 | };
|
32627 |
|
32628 | ReduxRouter.prototype.render = function render() {
|
32629 | var store = this.context.store;
|
32630 |
|
32631 | if (!store) {
|
32632 | throw new Error('Redux store missing from context of <ReduxRouter>. Make sure you\'re ' + 'using a <Provider>');
|
32633 | }
|
32634 |
|
32635 | var history = store.history;
|
32636 | var routerStateSelector = store[_constants.ROUTER_STATE_SELECTOR];
|
32637 |
|
32638 | if (!history || !routerStateSelector) {
|
32639 | throw new Error('Redux store not configured properly for <ReduxRouter>. Make sure ' + 'you\'re using the reduxReactRouter() store enhancer.');
|
32640 | }
|
32641 |
|
32642 | return _react2['default'].createElement(ReduxRouterContext, _extends({
|
32643 | history: history,
|
32644 | routerStateSelector: memoizeRouterStateSelector(routerStateSelector)
|
32645 | }, this.props));
|
32646 | };
|
32647 |
|
32648 | return ReduxRouter;
|
32649 | })(_react.Component);
|
32650 |
|
32651 | var ReduxRouterContext = (function (_Component2) {
|
32652 | _inherits(ReduxRouterContext, _Component2);
|
32653 |
|
32654 | function ReduxRouterContext() {
|
32655 | _classCallCheck(this, _ReduxRouterContext);
|
32656 |
|
32657 | _Component2.apply(this, arguments);
|
32658 | }
|
32659 |
|
32660 | ReduxRouterContext.prototype.render = function render() {
|
32661 | var location = this.props.location;
|
32662 |
|
32663 | if (location === null || location === undefined) {
|
32664 | return null;
|
32665 | }
|
32666 |
|
32667 | var RoutingContext = this.props.RoutingContext || _reactRouter.RoutingContext;
|
32668 |
|
32669 | return _react2['default'].createElement(RoutingContext, this.props);
|
32670 | };
|
32671 |
|
32672 | _createClass(ReduxRouterContext, null, [{
|
32673 | key: 'propTypes',
|
32674 | value: {
|
32675 | location: _react.PropTypes.object,
|
32676 | RoutingContext: _react.PropTypes.element
|
32677 | },
|
32678 | enumerable: true
|
32679 | }]);
|
32680 |
|
32681 | var _ReduxRouterContext = ReduxRouterContext;
|
32682 | ReduxRouterContext = _reactRedux.connect(function (state, _ref) {
|
32683 | var routerStateSelector = _ref.routerStateSelector;
|
32684 | return routerStateSelector(state) || {};
|
32685 | })(ReduxRouterContext) || ReduxRouterContext;
|
32686 | return ReduxRouterContext;
|
32687 | })(_react.Component);
|
32688 |
|
32689 | exports['default'] = ReduxRouter;
|
32690 | module.exports = exports['default'];
|
32691 | },{"100":100,"136":136,"297":297,"299":299,"301":301,"308":308}],299:[function(require,module,exports){
|
32692 | 'use strict';
|
32693 |
|
32694 | exports.__esModule = true;
|
32695 | exports.routerDidChange = routerDidChange;
|
32696 | exports.initRoutes = initRoutes;
|
32697 | exports.replaceRoutes = replaceRoutes;
|
32698 | exports.historyAPI = historyAPI;
|
32699 |
|
32700 | var _constants = require(301);
|
32701 |
|
32702 |
|
32703 |
|
32704 |
|
32705 |
|
32706 |
|
32707 |
|
32708 |
|
32709 | function routerDidChange(state) {
|
32710 | return {
|
32711 | type: _constants.ROUTER_DID_CHANGE,
|
32712 | payload: state
|
32713 | };
|
32714 | }
|
32715 |
|
32716 |
|
32717 |
|
32718 |
|
32719 |
|
32720 |
|
32721 |
|
32722 | function initRoutes(routes) {
|
32723 | return {
|
32724 | type: _constants.INIT_ROUTES,
|
32725 | payload: routes
|
32726 | };
|
32727 | }
|
32728 |
|
32729 |
|
32730 |
|
32731 |
|
32732 |
|
32733 |
|
32734 |
|
32735 | function replaceRoutes(routes) {
|
32736 | return {
|
32737 | type: _constants.REPLACE_ROUTES,
|
32738 | payload: routes
|
32739 | };
|
32740 | }
|
32741 |
|
32742 |
|
32743 |
|
32744 |
|
32745 |
|
32746 |
|
32747 |
|
32748 |
|
32749 | function historyAPI(method) {
|
32750 | return function () {
|
32751 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
32752 | args[_key] = arguments[_key];
|
32753 | }
|
32754 |
|
32755 | return {
|
32756 | type: _constants.HISTORY_API,
|
32757 | payload: {
|
32758 | method: method,
|
32759 | args: args
|
32760 | }
|
32761 | };
|
32762 | };
|
32763 | }
|
32764 |
|
32765 | var pushState = historyAPI('pushState');
|
32766 | exports.pushState = pushState;
|
32767 | var push = historyAPI('push');
|
32768 | exports.push = push;
|
32769 | var replaceState = historyAPI('replaceState');
|
32770 | exports.replaceState = replaceState;
|
32771 | var replace = historyAPI('replace');
|
32772 | exports.replace = replace;
|
32773 | var setState = historyAPI('setState');
|
32774 | exports.setState = setState;
|
32775 | var go = historyAPI('go');
|
32776 | exports.go = go;
|
32777 | var goBack = historyAPI('goBack');
|
32778 | exports.goBack = goBack;
|
32779 | var goForward = historyAPI('goForward');
|
32780 | exports.goForward = goForward;
|
32781 | },{"301":301}],300:[function(require,module,exports){
|
32782 | 'use strict';
|
32783 |
|
32784 | exports.__esModule = true;
|
32785 |
|
32786 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
32787 |
|
32788 | var _redux = require(316);
|
32789 |
|
32790 | var _actionCreators = require(299);
|
32791 |
|
32792 | var _routerStateEquals = require(308);
|
32793 |
|
32794 | var _routerStateEquals2 = _interopRequireDefault(_routerStateEquals);
|
32795 |
|
32796 | var _reduxReactRouter = require(305);
|
32797 |
|
32798 | var _reduxReactRouter2 = _interopRequireDefault(_reduxReactRouter);
|
32799 |
|
32800 | var _useDefaults = require(310);
|
32801 |
|
32802 | var _useDefaults2 = _interopRequireDefault(_useDefaults);
|
32803 |
|
32804 | var _routeReplacement = require(307);
|
32805 |
|
32806 | var _routeReplacement2 = _interopRequireDefault(_routeReplacement);
|
32807 |
|
32808 | function historySynchronization(next) {
|
32809 | return function (options) {
|
32810 | return function (createStore) {
|
32811 | return function (reducer, initialState) {
|
32812 | var onError = options.onError;
|
32813 | var routerStateSelector = options.routerStateSelector;
|
32814 |
|
32815 | var store = next(options)(createStore)(reducer, initialState);
|
32816 | var history = store.history;
|
32817 |
|
32818 | var prevRouterState = undefined;
|
32819 | var routerState = undefined;
|
32820 |
|
32821 | history.listen(function (error, nextRouterState) {
|
32822 | if (error) {
|
32823 | onError(error);
|
32824 | return;
|
32825 | }
|
32826 |
|
32827 | if (!_routerStateEquals2['default'](routerState, nextRouterState)) {
|
32828 | prevRouterState = routerState;
|
32829 | routerState = nextRouterState;
|
32830 | store.dispatch(_actionCreators.routerDidChange(nextRouterState));
|
32831 | }
|
32832 | });
|
32833 |
|
32834 | store.subscribe(function () {
|
32835 | var nextRouterState = routerStateSelector(store.getState());
|
32836 |
|
32837 | if (nextRouterState && prevRouterState !== nextRouterState && !_routerStateEquals2['default'](routerState, nextRouterState)) {
|
32838 | routerState = nextRouterState;
|
32839 | var _nextRouterState$location = nextRouterState.location;
|
32840 | var state = _nextRouterState$location.state;
|
32841 | var pathname = _nextRouterState$location.pathname;
|
32842 | var query = _nextRouterState$location.query;
|
32843 |
|
32844 | history.replace({ state: state, pathname: pathname, query: query });
|
32845 | }
|
32846 | });
|
32847 |
|
32848 | return store;
|
32849 | };
|
32850 | };
|
32851 | };
|
32852 | }
|
32853 |
|
32854 | exports['default'] = _redux.compose(_useDefaults2['default'], _routeReplacement2['default'], historySynchronization)(_reduxReactRouter2['default']);
|
32855 | module.exports = exports['default'];
|
32856 | },{"299":299,"305":305,"307":307,"308":308,"310":310,"316":316}],301:[function(require,module,exports){
|
32857 |
|
32858 |
|
32859 |
|
32860 | 'use strict';
|
32861 |
|
32862 | exports.__esModule = true;
|
32863 | var ROUTER_DID_CHANGE = '@@reduxReactRouter/routerDidChange';
|
32864 |
|
32865 | exports.ROUTER_DID_CHANGE = ROUTER_DID_CHANGE;
|
32866 | var HISTORY_API = '@@reduxReactRouter/historyAPI';
|
32867 | exports.HISTORY_API = HISTORY_API;
|
32868 | var MATCH = '@@reduxReactRouter/match';
|
32869 | exports.MATCH = MATCH;
|
32870 | var INIT_ROUTES = '@@reduxReactRouter/initRoutes';
|
32871 | exports.INIT_ROUTES = INIT_ROUTES;
|
32872 | var REPLACE_ROUTES = '@@reduxReactRouter/replaceRoutes';
|
32873 |
|
32874 | exports.REPLACE_ROUTES = REPLACE_ROUTES;
|
32875 | var ROUTER_STATE_SELECTOR = '@@reduxReactRouter/routerStateSelector';
|
32876 |
|
32877 | exports.ROUTER_STATE_SELECTOR = ROUTER_STATE_SELECTOR;
|
32878 | var DOES_NEED_REFRESH = '@@reduxReactRouter/doesNeedRefresh';
|
32879 | exports.DOES_NEED_REFRESH = DOES_NEED_REFRESH;
|
32880 | },{}],302:[function(require,module,exports){
|
32881 | 'use strict';
|
32882 |
|
32883 | exports.__esModule = true;
|
32884 | exports['default'] = historyMiddleware;
|
32885 |
|
32886 | var _constants = require(301);
|
32887 |
|
32888 |
|
32889 |
|
32890 |
|
32891 |
|
32892 |
|
32893 | function historyMiddleware(history) {
|
32894 | return function () {
|
32895 | return function (next) {
|
32896 | return function (action) {
|
32897 | if (action.type === _constants.HISTORY_API) {
|
32898 | var _action$payload = action.payload;
|
32899 | var method = _action$payload.method;
|
32900 | var args = _action$payload.args;
|
32901 |
|
32902 | return history[method].apply(history, args);
|
32903 | }
|
32904 | return next(action);
|
32905 | };
|
32906 | };
|
32907 | };
|
32908 | }
|
32909 |
|
32910 | module.exports = exports['default'];
|
32911 | },{"301":301}],303:[function(require,module,exports){
|
32912 | 'use strict';
|
32913 |
|
32914 | exports.__esModule = true;
|
32915 |
|
32916 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
32917 |
|
32918 | var _routerStateReducer2 = require(309);
|
32919 |
|
32920 | var _routerStateReducer3 = _interopRequireDefault(_routerStateReducer2);
|
32921 |
|
32922 | exports.routerStateReducer = _routerStateReducer3['default'];
|
32923 |
|
32924 | var _ReduxRouter2 = require(298);
|
32925 |
|
32926 | var _ReduxRouter3 = _interopRequireDefault(_ReduxRouter2);
|
32927 |
|
32928 | exports.ReduxRouter = _ReduxRouter3['default'];
|
32929 |
|
32930 | var _client = require(300);
|
32931 |
|
32932 | var _client2 = _interopRequireDefault(_client);
|
32933 |
|
32934 | exports.reduxReactRouter = _client2['default'];
|
32935 |
|
32936 | var _isActive2 = require(304);
|
32937 |
|
32938 | var _isActive3 = _interopRequireDefault(_isActive2);
|
32939 |
|
32940 | exports.isActive = _isActive3['default'];
|
32941 |
|
32942 | var _actionCreators = require(299);
|
32943 |
|
32944 | exports.historyAPI = _actionCreators.historyAPI;
|
32945 | exports.pushState = _actionCreators.pushState;
|
32946 | exports.push = _actionCreators.push;
|
32947 | exports.replaceState = _actionCreators.replaceState;
|
32948 | exports.replace = _actionCreators.replace;
|
32949 | exports.setState = _actionCreators.setState;
|
32950 | exports.go = _actionCreators.go;
|
32951 | exports.goBack = _actionCreators.goBack;
|
32952 | exports.goForward = _actionCreators.goForward;
|
32953 | },{"298":298,"299":299,"300":300,"304":304,"309":309}],304:[function(require,module,exports){
|
32954 | 'use strict';
|
32955 |
|
32956 | exports.__esModule = true;
|
32957 | exports['default'] = isActive;
|
32958 |
|
32959 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
32960 |
|
32961 | var _reactRouterLibIsActive = require(137);
|
32962 |
|
32963 | var _reactRouterLibIsActive2 = _interopRequireDefault(_reactRouterLibIsActive);
|
32964 |
|
32965 |
|
32966 |
|
32967 |
|
32968 |
|
32969 |
|
32970 |
|
32971 |
|
32972 |
|
32973 |
|
32974 | function isActive(pathname, query) {
|
32975 | var indexOnly = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
|
32976 |
|
32977 | return function (state) {
|
32978 | if (!state) return false;
|
32979 | var location = state.location;
|
32980 | var params = state.params;
|
32981 | var routes = state.routes;
|
32982 |
|
32983 | return _reactRouterLibIsActive2['default'](pathname, query, indexOnly, location, routes, params);
|
32984 | };
|
32985 | }
|
32986 |
|
32987 | module.exports = exports['default'];
|
32988 | },{"137":137}],305:[function(require,module,exports){
|
32989 | 'use strict';
|
32990 |
|
32991 | exports.__esModule = true;
|
32992 | exports['default'] = reduxReactRouter;
|
32993 |
|
32994 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
32995 |
|
32996 | var _redux = require(316);
|
32997 |
|
32998 | var _reactRouter = require(136);
|
32999 |
|
33000 | var _historyMiddleware = require(302);
|
33001 |
|
33002 | var _historyMiddleware2 = _interopRequireDefault(_historyMiddleware);
|
33003 |
|
33004 | var _constants = require(301);
|
33005 |
|
33006 | function reduxReactRouter(_ref) {
|
33007 | var routes = _ref.routes;
|
33008 | var createHistory = _ref.createHistory;
|
33009 | var parseQueryString = _ref.parseQueryString;
|
33010 | var stringifyQuery = _ref.stringifyQuery;
|
33011 | var routerStateSelector = _ref.routerStateSelector;
|
33012 |
|
33013 | return function (createStore) {
|
33014 | return function (reducer, initialState) {
|
33015 |
|
33016 | var baseCreateHistory = undefined;
|
33017 | if (typeof createHistory === 'function') {
|
33018 | baseCreateHistory = createHistory;
|
33019 | } else if (createHistory) {
|
33020 | baseCreateHistory = function () {
|
33021 | return createHistory;
|
33022 | };
|
33023 | }
|
33024 |
|
33025 | var history = _reactRouter.useRoutes(baseCreateHistory)({
|
33026 | routes: routes,
|
33027 | parseQueryString: parseQueryString,
|
33028 | stringifyQuery: stringifyQuery
|
33029 | });
|
33030 |
|
33031 | ['pushState', 'push', 'replaceState', 'replace', 'setState', 'go', 'goBack', 'goForward', 'listen', 'createLocation', 'match'].forEach(function (funcName) {
|
33032 | if (!history.hasOwnProperty(funcName) && typeof history[funcName] === 'function') {
|
33033 | throw new Error('History API does not support function: ' + funcName);
|
33034 | }
|
33035 | });
|
33036 |
|
33037 | var store = _redux.applyMiddleware(_historyMiddleware2['default'](history))(createStore)(reducer, initialState);
|
33038 |
|
33039 | store.history = history;
|
33040 | store[_constants.ROUTER_STATE_SELECTOR] = routerStateSelector;
|
33041 |
|
33042 | return store;
|
33043 | };
|
33044 | };
|
33045 | }
|
33046 |
|
33047 | module.exports = exports['default'];
|
33048 | },{"136":136,"301":301,"302":302,"316":316}],306:[function(require,module,exports){
|
33049 | 'use strict';
|
33050 |
|
33051 | exports.__esModule = true;
|
33052 | exports['default'] = replaceRoutesMiddleware;
|
33053 |
|
33054 | var _constants = require(301);
|
33055 |
|
33056 | function replaceRoutesMiddleware(replaceRoutes) {
|
33057 | return function () {
|
33058 | return function (next) {
|
33059 | return function (action) {
|
33060 | var isInitRoutes = action.type === _constants.INIT_ROUTES;
|
33061 | if (isInitRoutes || action.type === _constants.REPLACE_ROUTES) {
|
33062 | replaceRoutes(action.payload, isInitRoutes);
|
33063 | }
|
33064 | return next(action);
|
33065 | };
|
33066 | };
|
33067 | };
|
33068 | }
|
33069 |
|
33070 | module.exports = exports['default'];
|
33071 | },{"301":301}],307:[function(require,module,exports){
|
33072 | 'use strict';
|
33073 |
|
33074 | exports.__esModule = true;
|
33075 |
|
33076 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
33077 |
|
33078 | exports['default'] = routeReplacement;
|
33079 |
|
33080 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
33081 |
|
33082 | var _redux = require(316);
|
33083 |
|
33084 | var _reactRouter = require(136);
|
33085 |
|
33086 | var _replaceRoutesMiddleware = require(306);
|
33087 |
|
33088 | var _replaceRoutesMiddleware2 = _interopRequireDefault(_replaceRoutesMiddleware);
|
33089 |
|
33090 | function routeReplacement(next) {
|
33091 | return function (options) {
|
33092 | return function (createStore) {
|
33093 | return function (reducer, initialState) {
|
33094 | var baseRoutes = options.routes;
|
33095 | var getRoutes = options.getRoutes;
|
33096 | var routerStateSelector = options.routerStateSelector;
|
33097 |
|
33098 | var store = undefined;
|
33099 |
|
33100 | var childRoutes = [];
|
33101 | var areChildRoutesResolved = false;
|
33102 | var childRoutesCallbacks = [];
|
33103 |
|
33104 | function replaceRoutes(r, isInit) {
|
33105 | childRoutes = _reactRouter.createRoutes(r);
|
33106 |
|
33107 | var routerState = routerStateSelector(store.getState());
|
33108 | if (routerState && !isInit) {
|
33109 | var _routerState$location = routerState.location;
|
33110 | var state = _routerState$location.state;
|
33111 | var pathname = _routerState$location.pathname;
|
33112 | var query = _routerState$location.query;
|
33113 |
|
33114 | store.history.replace({ state: state, pathname: pathname, query: query });
|
33115 | }
|
33116 |
|
33117 | if (!areChildRoutesResolved) {
|
33118 | areChildRoutesResolved = true;
|
33119 | childRoutesCallbacks.forEach(function (cb) {
|
33120 | return cb(null, childRoutes);
|
33121 | });
|
33122 | }
|
33123 | }
|
33124 |
|
33125 | var routes = undefined;
|
33126 | if (baseRoutes) {
|
33127 | routes = baseRoutes;
|
33128 | } else if (getRoutes) {
|
33129 | routes = getRoutes({
|
33130 | dispatch: function dispatch(action) {
|
33131 | return store.dispatch(action);
|
33132 | },
|
33133 | getState: function getState() {
|
33134 | return store.getState();
|
33135 | }
|
33136 | });
|
33137 | } else {
|
33138 | routes = [{
|
33139 | getChildRoutes: function getChildRoutes(location, cb) {
|
33140 | if (!areChildRoutesResolved) {
|
33141 | childRoutesCallbacks.push(cb);
|
33142 | return;
|
33143 | }
|
33144 |
|
33145 | cb(null, childRoutes);
|
33146 | }
|
33147 | }];
|
33148 | }
|
33149 |
|
33150 | store = _redux.compose(_redux.applyMiddleware(_replaceRoutesMiddleware2['default'](replaceRoutes)), next(_extends({}, options, {
|
33151 | routes: _reactRouter.createRoutes(routes)
|
33152 | })))(createStore)(reducer, initialState);
|
33153 |
|
33154 | return store;
|
33155 | };
|
33156 | };
|
33157 | };
|
33158 | }
|
33159 |
|
33160 | module.exports = exports['default'];
|
33161 | },{"136":136,"306":306,"316":316}],308:[function(require,module,exports){
|
33162 | 'use strict';
|
33163 |
|
33164 | exports.__esModule = true;
|
33165 | exports['default'] = routerStateEquals;
|
33166 |
|
33167 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
33168 |
|
33169 | var _deepEqual = require(14);
|
33170 |
|
33171 | var _deepEqual2 = _interopRequireDefault(_deepEqual);
|
33172 |
|
33173 | var _constants = require(301);
|
33174 |
|
33175 |
|
33176 |
|
33177 |
|
33178 |
|
33179 |
|
33180 | function routerStateEquals(a, b) {
|
33181 | if (!a && !b) return true;
|
33182 | if (a && !b || !a && b) return false;
|
33183 | if (a[_constants.DOES_NEED_REFRESH] || b[_constants.DOES_NEED_REFRESH]) return false;
|
33184 |
|
33185 | return a.location.pathname === b.location.pathname && a.location.search === b.location.search && _deepEqual2['default'](a.location.state, b.location.state);
|
33186 | }
|
33187 |
|
33188 | module.exports = exports['default'];
|
33189 | },{"14":14,"301":301}],309:[function(require,module,exports){
|
33190 | 'use strict';
|
33191 |
|
33192 | exports.__esModule = true;
|
33193 |
|
33194 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
33195 |
|
33196 | exports['default'] = routerStateReducer;
|
33197 |
|
33198 | var _constants = require(301);
|
33199 |
|
33200 |
|
33201 |
|
33202 |
|
33203 |
|
33204 |
|
33205 |
|
33206 |
|
33207 |
|
33208 | function routerStateReducer(state, action) {
|
33209 | if (state === undefined) state = null;
|
33210 |
|
33211 | var _extends2;
|
33212 |
|
33213 | switch (action.type) {
|
33214 | case _constants.ROUTER_DID_CHANGE:
|
33215 | return action.payload;
|
33216 | case _constants.REPLACE_ROUTES:
|
33217 | if (!state) return state;
|
33218 | return _extends({}, state, (_extends2 = {}, _extends2[_constants.DOES_NEED_REFRESH] = true, _extends2));
|
33219 | default:
|
33220 | return state;
|
33221 | }
|
33222 | }
|
33223 |
|
33224 | module.exports = exports['default'];
|
33225 | },{"301":301}],310:[function(require,module,exports){
|
33226 | 'use strict';
|
33227 |
|
33228 | exports.__esModule = true;
|
33229 |
|
33230 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
33231 |
|
33232 | exports['default'] = useDefaults;
|
33233 | var defaults = {
|
33234 | onError: function onError(error) {
|
33235 | throw error;
|
33236 | },
|
33237 | routerStateSelector: function routerStateSelector(state) {
|
33238 | return state.router;
|
33239 | }
|
33240 | };
|
33241 |
|
33242 | function useDefaults(next) {
|
33243 | return function (options) {
|
33244 | return function (createStore) {
|
33245 | return function (reducer, initialState) {
|
33246 | var optionsWithDefaults = _extends({}, defaults, options);
|
33247 |
|
33248 | var baseCreateHistory = optionsWithDefaults.createHistory;
|
33249 | var baseHistory = optionsWithDefaults.history;
|
33250 |
|
33251 | var createHistory = undefined;
|
33252 | if (typeof baseCreateHistory === 'function') {
|
33253 | createHistory = baseCreateHistory;
|
33254 | } else if (baseHistory) {
|
33255 | createHistory = function () {
|
33256 | return baseHistory;
|
33257 | };
|
33258 | } else {
|
33259 | createHistory = null;
|
33260 | }
|
33261 |
|
33262 | return next(_extends({}, optionsWithDefaults, {
|
33263 | createHistory: createHistory
|
33264 | }))(createStore)(reducer, initialState);
|
33265 | };
|
33266 | };
|
33267 | };
|
33268 | }
|
33269 |
|
33270 | module.exports = exports['default'];
|
33271 | },{}],311:[function(require,module,exports){
|
33272 | 'use strict';
|
33273 |
|
33274 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
33275 |
|
33276 | exports.__esModule = true;
|
33277 | exports["default"] = applyMiddleware;
|
33278 |
|
33279 | var _compose = require(314);
|
33280 |
|
33281 | var _compose2 = _interopRequireDefault(_compose);
|
33282 |
|
33283 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
33284 |
|
33285 |
|
33286 |
|
33287 |
|
33288 |
|
33289 |
|
33290 |
|
33291 |
|
33292 |
|
33293 |
|
33294 |
|
33295 |
|
33296 |
|
33297 |
|
33298 |
|
33299 |
|
33300 |
|
33301 | function applyMiddleware() {
|
33302 | for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
|
33303 | middlewares[_key] = arguments[_key];
|
33304 | }
|
33305 |
|
33306 | return function (createStore) {
|
33307 | return function (reducer, initialState, enhancer) {
|
33308 | var store = createStore(reducer, initialState, enhancer);
|
33309 | var _dispatch = store.dispatch;
|
33310 | var chain = [];
|
33311 |
|
33312 | var middlewareAPI = {
|
33313 | getState: store.getState,
|
33314 | dispatch: function dispatch(action) {
|
33315 | return _dispatch(action);
|
33316 | }
|
33317 | };
|
33318 | chain = middlewares.map(function (middleware) {
|
33319 | return middleware(middlewareAPI);
|
33320 | });
|
33321 | _dispatch = _compose2["default"].apply(undefined, chain)(store.dispatch);
|
33322 |
|
33323 | return _extends({}, store, {
|
33324 | dispatch: _dispatch
|
33325 | });
|
33326 | };
|
33327 | };
|
33328 | }
|
33329 | },{"314":314}],312:[function(require,module,exports){
|
33330 | 'use strict';
|
33331 |
|
33332 | exports.__esModule = true;
|
33333 | exports["default"] = bindActionCreators;
|
33334 | function bindActionCreator(actionCreator, dispatch) {
|
33335 | return function () {
|
33336 | return dispatch(actionCreator.apply(undefined, arguments));
|
33337 | };
|
33338 | }
|
33339 |
|
33340 |
|
33341 |
|
33342 |
|
33343 |
|
33344 |
|
33345 |
|
33346 |
|
33347 |
|
33348 |
|
33349 |
|
33350 |
|
33351 |
|
33352 |
|
33353 |
|
33354 |
|
33355 |
|
33356 |
|
33357 |
|
33358 |
|
33359 |
|
33360 |
|
33361 | function bindActionCreators(actionCreators, dispatch) {
|
33362 | if (typeof actionCreators === 'function') {
|
33363 | return bindActionCreator(actionCreators, dispatch);
|
33364 | }
|
33365 |
|
33366 | if (typeof actionCreators !== 'object' || actionCreators === null) {
|
33367 | throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
|
33368 | }
|
33369 |
|
33370 | var keys = Object.keys(actionCreators);
|
33371 | var boundActionCreators = {};
|
33372 | for (var i = 0; i < keys.length; i++) {
|
33373 | var key = keys[i];
|
33374 | var actionCreator = actionCreators[key];
|
33375 | if (typeof actionCreator === 'function') {
|
33376 | boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
33377 | }
|
33378 | }
|
33379 | return boundActionCreators;
|
33380 | }
|
33381 | },{}],313:[function(require,module,exports){
|
33382 | (function (process){
|
33383 | 'use strict';
|
33384 |
|
33385 | exports.__esModule = true;
|
33386 | exports["default"] = combineReducers;
|
33387 |
|
33388 | var _createStore = require(315);
|
33389 |
|
33390 | var _isPlainObject = require(320);
|
33391 |
|
33392 | var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
|
33393 |
|
33394 | var _warning = require(317);
|
33395 |
|
33396 | var _warning2 = _interopRequireDefault(_warning);
|
33397 |
|
33398 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
33399 |
|
33400 | function getUndefinedStateErrorMessage(key, action) {
|
33401 | var actionType = action && action.type;
|
33402 | var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
|
33403 |
|
33404 | return 'Reducer "' + key + '" returned undefined handling ' + actionName + '. ' + 'To ignore an action, you must explicitly return the previous state.';
|
33405 | }
|
33406 |
|
33407 | function getUnexpectedStateShapeWarningMessage(inputState, reducers, action) {
|
33408 | var reducerKeys = Object.keys(reducers);
|
33409 | var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'initialState argument passed to createStore' : 'previous state received by the reducer';
|
33410 |
|
33411 | if (reducerKeys.length === 0) {
|
33412 | return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
33413 | }
|
33414 |
|
33415 | if (!(0, _isPlainObject2["default"])(inputState)) {
|
33416 | return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
|
33417 | }
|
33418 |
|
33419 | var unexpectedKeys = Object.keys(inputState).filter(function (key) {
|
33420 | return !reducers.hasOwnProperty(key);
|
33421 | });
|
33422 |
|
33423 | if (unexpectedKeys.length > 0) {
|
33424 | return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
|
33425 | }
|
33426 | }
|
33427 |
|
33428 | function assertReducerSanity(reducers) {
|
33429 | Object.keys(reducers).forEach(function (key) {
|
33430 | var reducer = reducers[key];
|
33431 | var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
|
33432 |
|
33433 | if (typeof initialState === 'undefined') {
|
33434 | throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.');
|
33435 | }
|
33436 |
|
33437 | var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
|
33438 | if (typeof reducer(undefined, { type: type }) === 'undefined') {
|
33439 | throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.');
|
33440 | }
|
33441 | });
|
33442 | }
|
33443 |
|
33444 |
|
33445 |
|
33446 |
|
33447 |
|
33448 |
|
33449 |
|
33450 |
|
33451 |
|
33452 |
|
33453 |
|
33454 |
|
33455 |
|
33456 |
|
33457 |
|
33458 |
|
33459 |
|
33460 | function combineReducers(reducers) {
|
33461 | var reducerKeys = Object.keys(reducers);
|
33462 | var finalReducers = {};
|
33463 | for (var i = 0; i < reducerKeys.length; i++) {
|
33464 | var key = reducerKeys[i];
|
33465 | if (typeof reducers[key] === 'function') {
|
33466 | finalReducers[key] = reducers[key];
|
33467 | }
|
33468 | }
|
33469 | var finalReducerKeys = Object.keys(finalReducers);
|
33470 |
|
33471 | var sanityError;
|
33472 | try {
|
33473 | assertReducerSanity(finalReducers);
|
33474 | } catch (e) {
|
33475 | sanityError = e;
|
33476 | }
|
33477 |
|
33478 | return function combination() {
|
33479 | var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
33480 | var action = arguments[1];
|
33481 |
|
33482 | if (sanityError) {
|
33483 | throw sanityError;
|
33484 | }
|
33485 |
|
33486 | if (process.env.NODE_ENV !== 'production') {
|
33487 | var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action);
|
33488 | if (warningMessage) {
|
33489 | (0, _warning2["default"])(warningMessage);
|
33490 | }
|
33491 | }
|
33492 |
|
33493 | var hasChanged = false;
|
33494 | var nextState = {};
|
33495 | for (var i = 0; i < finalReducerKeys.length; i++) {
|
33496 | var key = finalReducerKeys[i];
|
33497 | var reducer = finalReducers[key];
|
33498 | var previousStateForKey = state[key];
|
33499 | var nextStateForKey = reducer(previousStateForKey, action);
|
33500 | if (typeof nextStateForKey === 'undefined') {
|
33501 | var errorMessage = getUndefinedStateErrorMessage(key, action);
|
33502 | throw new Error(errorMessage);
|
33503 | }
|
33504 | nextState[key] = nextStateForKey;
|
33505 | hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
33506 | }
|
33507 | return hasChanged ? nextState : state;
|
33508 | };
|
33509 | }
|
33510 | }).call(this,require(91))
|
33511 | },{"315":315,"317":317,"320":320,"91":91}],314:[function(require,module,exports){
|
33512 | "use strict";
|
33513 |
|
33514 | exports.__esModule = true;
|
33515 | exports["default"] = compose;
|
33516 |
|
33517 |
|
33518 |
|
33519 |
|
33520 |
|
33521 |
|
33522 |
|
33523 | function compose() {
|
33524 | for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
|
33525 | funcs[_key] = arguments[_key];
|
33526 | }
|
33527 |
|
33528 | return function () {
|
33529 | if (funcs.length === 0) {
|
33530 | return arguments.length <= 0 ? undefined : arguments[0];
|
33531 | }
|
33532 |
|
33533 | var last = funcs[funcs.length - 1];
|
33534 | var rest = funcs.slice(0, -1);
|
33535 |
|
33536 | return rest.reduceRight(function (composed, f) {
|
33537 | return f(composed);
|
33538 | }, last.apply(undefined, arguments));
|
33539 | };
|
33540 | }
|
33541 | },{}],315:[function(require,module,exports){
|
33542 | 'use strict';
|
33543 |
|
33544 | exports.__esModule = true;
|
33545 | exports.ActionTypes = undefined;
|
33546 | exports["default"] = createStore;
|
33547 |
|
33548 | var _isPlainObject = require(320);
|
33549 |
|
33550 | var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
|
33551 |
|
33552 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
33553 |
|
33554 |
|
33555 |
|
33556 |
|
33557 |
|
33558 |
|
33559 |
|
33560 | var ActionTypes = exports.ActionTypes = {
|
33561 | INIT: '@@redux/INIT'
|
33562 | };
|
33563 |
|
33564 |
|
33565 |
|
33566 |
|
33567 |
|
33568 |
|
33569 |
|
33570 |
|
33571 |
|
33572 |
|
33573 |
|
33574 |
|
33575 |
|
33576 |
|
33577 |
|
33578 |
|
33579 |
|
33580 |
|
33581 |
|
33582 |
|
33583 |
|
33584 |
|
33585 |
|
33586 |
|
33587 |
|
33588 |
|
33589 | function createStore(reducer, initialState, enhancer) {
|
33590 | if (typeof initialState === 'function' && typeof enhancer === 'undefined') {
|
33591 | enhancer = initialState;
|
33592 | initialState = undefined;
|
33593 | }
|
33594 |
|
33595 | if (typeof enhancer !== 'undefined') {
|
33596 | if (typeof enhancer !== 'function') {
|
33597 | throw new Error('Expected the enhancer to be a function.');
|
33598 | }
|
33599 |
|
33600 | return enhancer(createStore)(reducer, initialState);
|
33601 | }
|
33602 |
|
33603 | if (typeof reducer !== 'function') {
|
33604 | throw new Error('Expected the reducer to be a function.');
|
33605 | }
|
33606 |
|
33607 | var currentReducer = reducer;
|
33608 | var currentState = initialState;
|
33609 | var currentListeners = [];
|
33610 | var nextListeners = currentListeners;
|
33611 | var isDispatching = false;
|
33612 |
|
33613 | function ensureCanMutateNextListeners() {
|
33614 | if (nextListeners === currentListeners) {
|
33615 | nextListeners = currentListeners.slice();
|
33616 | }
|
33617 | }
|
33618 |
|
33619 | |
33620 |
|
33621 |
|
33622 |
|
33623 |
|
33624 | function getState() {
|
33625 | return currentState;
|
33626 | }
|
33627 |
|
33628 | |
33629 |
|
33630 |
|
33631 |
|
33632 |
|
33633 |
|
33634 |
|
33635 |
|
33636 |
|
33637 |
|
33638 |
|
33639 |
|
33640 |
|
33641 |
|
33642 |
|
33643 |
|
33644 |
|
33645 |
|
33646 |
|
33647 |
|
33648 |
|
33649 |
|
33650 |
|
33651 | function subscribe(listener) {
|
33652 | if (typeof listener !== 'function') {
|
33653 | throw new Error('Expected listener to be a function.');
|
33654 | }
|
33655 |
|
33656 | var isSubscribed = true;
|
33657 |
|
33658 | ensureCanMutateNextListeners();
|
33659 | nextListeners.push(listener);
|
33660 |
|
33661 | return function unsubscribe() {
|
33662 | if (!isSubscribed) {
|
33663 | return;
|
33664 | }
|
33665 |
|
33666 | isSubscribed = false;
|
33667 |
|
33668 | ensureCanMutateNextListeners();
|
33669 | var index = nextListeners.indexOf(listener);
|
33670 | nextListeners.splice(index, 1);
|
33671 | };
|
33672 | }
|
33673 |
|
33674 | |
33675 |
|
33676 |
|
33677 |
|
33678 |
|
33679 |
|
33680 |
|
33681 |
|
33682 |
|
33683 |
|
33684 |
|
33685 |
|
33686 |
|
33687 |
|
33688 |
|
33689 |
|
33690 |
|
33691 |
|
33692 |
|
33693 |
|
33694 |
|
33695 |
|
33696 |
|
33697 |
|
33698 |
|
33699 | function dispatch(action) {
|
33700 | if (!(0, _isPlainObject2["default"])(action)) {
|
33701 | throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
|
33702 | }
|
33703 |
|
33704 | if (typeof action.type === 'undefined') {
|
33705 | throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
|
33706 | }
|
33707 |
|
33708 | if (isDispatching) {
|
33709 | throw new Error('Reducers may not dispatch actions.');
|
33710 | }
|
33711 |
|
33712 | try {
|
33713 | isDispatching = true;
|
33714 | currentState = currentReducer(currentState, action);
|
33715 | } finally {
|
33716 | isDispatching = false;
|
33717 | }
|
33718 |
|
33719 | var listeners = currentListeners = nextListeners;
|
33720 | for (var i = 0; i < listeners.length; i++) {
|
33721 | listeners[i]();
|
33722 | }
|
33723 |
|
33724 | return action;
|
33725 | }
|
33726 |
|
33727 | |
33728 |
|
33729 |
|
33730 |
|
33731 |
|
33732 |
|
33733 |
|
33734 |
|
33735 |
|
33736 |
|
33737 | function replaceReducer(nextReducer) {
|
33738 | if (typeof nextReducer !== 'function') {
|
33739 | throw new Error('Expected the nextReducer to be a function.');
|
33740 | }
|
33741 |
|
33742 | currentReducer = nextReducer;
|
33743 | dispatch({ type: ActionTypes.INIT });
|
33744 | }
|
33745 |
|
33746 |
|
33747 |
|
33748 |
|
33749 | dispatch({ type: ActionTypes.INIT });
|
33750 |
|
33751 | return {
|
33752 | dispatch: dispatch,
|
33753 | subscribe: subscribe,
|
33754 | getState: getState,
|
33755 | replaceReducer: replaceReducer
|
33756 | };
|
33757 | }
|
33758 | },{"320":320}],316:[function(require,module,exports){
|
33759 | (function (process){
|
33760 | 'use strict';
|
33761 |
|
33762 | exports.__esModule = true;
|
33763 | exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
|
33764 |
|
33765 | var _createStore = require(315);
|
33766 |
|
33767 | var _createStore2 = _interopRequireDefault(_createStore);
|
33768 |
|
33769 | var _combineReducers = require(313);
|
33770 |
|
33771 | var _combineReducers2 = _interopRequireDefault(_combineReducers);
|
33772 |
|
33773 | var _bindActionCreators = require(312);
|
33774 |
|
33775 | var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
|
33776 |
|
33777 | var _applyMiddleware = require(311);
|
33778 |
|
33779 | var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
|
33780 |
|
33781 | var _compose = require(314);
|
33782 |
|
33783 | var _compose2 = _interopRequireDefault(_compose);
|
33784 |
|
33785 | var _warning = require(317);
|
33786 |
|
33787 | var _warning2 = _interopRequireDefault(_warning);
|
33788 |
|
33789 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
33790 |
|
33791 |
|
33792 |
|
33793 |
|
33794 |
|
33795 | function isCrushed() {}
|
33796 |
|
33797 | if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
|
33798 | (0, _warning2["default"])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
|
33799 | }
|
33800 |
|
33801 | exports.createStore = _createStore2["default"];
|
33802 | exports.combineReducers = _combineReducers2["default"];
|
33803 | exports.bindActionCreators = _bindActionCreators2["default"];
|
33804 | exports.applyMiddleware = _applyMiddleware2["default"];
|
33805 | exports.compose = _compose2["default"];
|
33806 | }).call(this,require(91))
|
33807 | },{"311":311,"312":312,"313":313,"314":314,"315":315,"317":317,"91":91}],317:[function(require,module,exports){
|
33808 | arguments[4][103][0].apply(exports,arguments)
|
33809 | },{"103":103}],318:[function(require,module,exports){
|
33810 | arguments[4][106][0].apply(exports,arguments)
|
33811 | },{"106":106}],319:[function(require,module,exports){
|
33812 |
|
33813 |
|
33814 |
|
33815 |
|
33816 |
|
33817 |
|
33818 |
|
33819 |
|
33820 |
|
33821 |
|
33822 |
|
33823 |
|
33824 |
|
33825 |
|
33826 |
|
33827 |
|
33828 |
|
33829 |
|
33830 |
|
33831 |
|
33832 |
|
33833 |
|
33834 |
|
33835 | function isObjectLike(value) {
|
33836 | return !!value && typeof value == 'object';
|
33837 | }
|
33838 |
|
33839 | module.exports = isObjectLike;
|
33840 |
|
33841 | },{}],320:[function(require,module,exports){
|
33842 | var isHostObject = require(318),
|
33843 | isObjectLike = require(319);
|
33844 |
|
33845 |
|
33846 | var objectTag = '[object Object]';
|
33847 |
|
33848 |
|
33849 | var objectProto = Object.prototype;
|
33850 |
|
33851 |
|
33852 | var funcToString = Function.prototype.toString;
|
33853 |
|
33854 |
|
33855 | var objectCtorString = funcToString.call(Object);
|
33856 |
|
33857 |
|
33858 |
|
33859 |
|
33860 |
|
33861 | var objectToString = objectProto.toString;
|
33862 |
|
33863 |
|
33864 | var getPrototypeOf = Object.getPrototypeOf;
|
33865 |
|
33866 |
|
33867 |
|
33868 |
|
33869 |
|
33870 |
|
33871 |
|
33872 |
|
33873 |
|
33874 |
|
33875 |
|
33876 |
|
33877 |
|
33878 |
|
33879 |
|
33880 |
|
33881 |
|
33882 |
|
33883 |
|
33884 |
|
33885 |
|
33886 |
|
33887 |
|
33888 |
|
33889 |
|
33890 |
|
33891 |
|
33892 |
|
33893 | function isPlainObject(value) {
|
33894 | if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
|
33895 | return false;
|
33896 | }
|
33897 | var proto = objectProto;
|
33898 | if (typeof value.constructor == 'function') {
|
33899 | proto = getPrototypeOf(value);
|
33900 | }
|
33901 | if (proto === null) {
|
33902 | return true;
|
33903 | }
|
33904 | var Ctor = proto.constructor;
|
33905 | return (typeof Ctor == 'function' &&
|
33906 | Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
|
33907 | }
|
33908 |
|
33909 | module.exports = isPlainObject;
|
33910 |
|
33911 | },{"318":318,"319":319}],321:[function(require,module,exports){
|
33912 |
|
33913 |
|
33914 |
|
33915 |
|
33916 |
|
33917 | var url = require(325);
|
33918 | var parser = require(328);
|
33919 | var Manager = require(322);
|
33920 | var debug = require(12)('socket.io-client');
|
33921 |
|
33922 |
|
33923 |
|
33924 |
|
33925 |
|
33926 | module.exports = exports = lookup;
|
33927 |
|
33928 |
|
33929 |
|
33930 |
|
33931 |
|
33932 | var cache = exports.managers = {};
|
33933 |
|
33934 |
|
33935 |
|
33936 |
|
33937 |
|
33938 |
|
33939 |
|
33940 |
|
33941 |
|
33942 |
|
33943 |
|
33944 |
|
33945 |
|
33946 |
|
33947 | function lookup(uri, opts) {
|
33948 | if (typeof uri == 'object') {
|
33949 | opts = uri;
|
33950 | uri = undefined;
|
33951 | }
|
33952 |
|
33953 | opts = opts || {};
|
33954 |
|
33955 | var parsed = url(uri);
|
33956 | var source = parsed.source;
|
33957 | var id = parsed.id;
|
33958 | var path = parsed.path;
|
33959 | var sameNamespace = cache[id] && path in cache[id].nsps;
|
33960 | var newConnection = opts.forceNew || opts['force new connection'] ||
|
33961 | false === opts.multiplex || sameNamespace;
|
33962 |
|
33963 | var io;
|
33964 |
|
33965 | if (newConnection) {
|
33966 | debug('ignoring socket cache for %s', source);
|
33967 | io = Manager(source, opts);
|
33968 | } else {
|
33969 | if (!cache[id]) {
|
33970 | debug('new io instance for %s', source);
|
33971 | cache[id] = Manager(source, opts);
|
33972 | }
|
33973 | io = cache[id];
|
33974 | }
|
33975 |
|
33976 | return io.socket(parsed.path);
|
33977 | }
|
33978 |
|
33979 |
|
33980 |
|
33981 |
|
33982 |
|
33983 |
|
33984 |
|
33985 | exports.protocol = parser.protocol;
|
33986 |
|
33987 |
|
33988 |
|
33989 |
|
33990 |
|
33991 |
|
33992 |
|
33993 |
|
33994 | exports.connect = lookup;
|
33995 |
|
33996 |
|
33997 |
|
33998 |
|
33999 |
|
34000 |
|
34001 |
|
34002 | exports.Manager = require(322);
|
34003 | exports.Socket = require(324);
|
34004 |
|
34005 | },{"12":12,"322":322,"324":324,"325":325,"328":328}],322:[function(require,module,exports){
|
34006 |
|
34007 |
|
34008 |
|
34009 |
|
34010 |
|
34011 | var eio = require(17);
|
34012 | var Socket = require(324);
|
34013 | var Emitter = require(326);
|
34014 | var parser = require(328);
|
34015 | var on = require(323);
|
34016 | var bind = require(9);
|
34017 | var debug = require(12)('socket.io-client:manager');
|
34018 | var indexOf = require(80);
|
34019 | var Backoff = require(5);
|
34020 |
|
34021 |
|
34022 |
|
34023 |
|
34024 |
|
34025 | var has = Object.prototype.hasOwnProperty;
|
34026 |
|
34027 |
|
34028 |
|
34029 |
|
34030 |
|
34031 | module.exports = Manager;
|
34032 |
|
34033 |
|
34034 |
|
34035 |
|
34036 |
|
34037 |
|
34038 |
|
34039 |
|
34040 |
|
34041 | function Manager(uri, opts){
|
34042 | if (!(this instanceof Manager)) return new Manager(uri, opts);
|
34043 | if (uri && ('object' == typeof uri)) {
|
34044 | opts = uri;
|
34045 | uri = undefined;
|
34046 | }
|
34047 | opts = opts || {};
|
34048 |
|
34049 | opts.path = opts.path || '/socket.io';
|
34050 | this.nsps = {};
|
34051 | this.subs = [];
|
34052 | this.opts = opts;
|
34053 | this.reconnection(opts.reconnection !== false);
|
34054 | this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
|
34055 | this.reconnectionDelay(opts.reconnectionDelay || 1000);
|
34056 | this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
|
34057 | this.randomizationFactor(opts.randomizationFactor || 0.5);
|
34058 | this.backoff = new Backoff({
|
34059 | min: this.reconnectionDelay(),
|
34060 | max: this.reconnectionDelayMax(),
|
34061 | jitter: this.randomizationFactor()
|
34062 | });
|
34063 | this.timeout(null == opts.timeout ? 20000 : opts.timeout);
|
34064 | this.readyState = 'closed';
|
34065 | this.uri = uri;
|
34066 | this.connecting = [];
|
34067 | this.lastPing = null;
|
34068 | this.encoding = false;
|
34069 | this.packetBuffer = [];
|
34070 | this.encoder = new parser.Encoder();
|
34071 | this.decoder = new parser.Decoder();
|
34072 | this.autoConnect = opts.autoConnect !== false;
|
34073 | if (this.autoConnect) this.open();
|
34074 | }
|
34075 |
|
34076 |
|
34077 |
|
34078 |
|
34079 |
|
34080 |
|
34081 |
|
34082 | Manager.prototype.emitAll = function() {
|
34083 | this.emit.apply(this, arguments);
|
34084 | for (var nsp in this.nsps) {
|
34085 | if (has.call(this.nsps, nsp)) {
|
34086 | this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);
|
34087 | }
|
34088 | }
|
34089 | };
|
34090 |
|
34091 |
|
34092 |
|
34093 |
|
34094 |
|
34095 |
|
34096 |
|
34097 | Manager.prototype.updateSocketIds = function(){
|
34098 | for (var nsp in this.nsps) {
|
34099 | if (has.call(this.nsps, nsp)) {
|
34100 | this.nsps[nsp].id = this.engine.id;
|
34101 | }
|
34102 | }
|
34103 | };
|
34104 |
|
34105 |
|
34106 |
|
34107 |
|
34108 |
|
34109 | Emitter(Manager.prototype);
|
34110 |
|
34111 |
|
34112 |
|
34113 |
|
34114 |
|
34115 |
|
34116 |
|
34117 |
|
34118 |
|
34119 | Manager.prototype.reconnection = function(v){
|
34120 | if (!arguments.length) return this._reconnection;
|
34121 | this._reconnection = !!v;
|
34122 | return this;
|
34123 | };
|
34124 |
|
34125 |
|
34126 |
|
34127 |
|
34128 |
|
34129 |
|
34130 |
|
34131 |
|
34132 |
|
34133 | Manager.prototype.reconnectionAttempts = function(v){
|
34134 | if (!arguments.length) return this._reconnectionAttempts;
|
34135 | this._reconnectionAttempts = v;
|
34136 | return this;
|
34137 | };
|
34138 |
|
34139 |
|
34140 |
|
34141 |
|
34142 |
|
34143 |
|
34144 |
|
34145 |
|
34146 |
|
34147 | Manager.prototype.reconnectionDelay = function(v){
|
34148 | if (!arguments.length) return this._reconnectionDelay;
|
34149 | this._reconnectionDelay = v;
|
34150 | this.backoff && this.backoff.setMin(v);
|
34151 | return this;
|
34152 | };
|
34153 |
|
34154 | Manager.prototype.randomizationFactor = function(v){
|
34155 | if (!arguments.length) return this._randomizationFactor;
|
34156 | this._randomizationFactor = v;
|
34157 | this.backoff && this.backoff.setJitter(v);
|
34158 | return this;
|
34159 | };
|
34160 |
|
34161 |
|
34162 |
|
34163 |
|
34164 |
|
34165 |
|
34166 |
|
34167 |
|
34168 |
|
34169 | Manager.prototype.reconnectionDelayMax = function(v){
|
34170 | if (!arguments.length) return this._reconnectionDelayMax;
|
34171 | this._reconnectionDelayMax = v;
|
34172 | this.backoff && this.backoff.setMax(v);
|
34173 | return this;
|
34174 | };
|
34175 |
|
34176 |
|
34177 |
|
34178 |
|
34179 |
|
34180 |
|
34181 |
|
34182 |
|
34183 | Manager.prototype.timeout = function(v){
|
34184 | if (!arguments.length) return this._timeout;
|
34185 | this._timeout = v;
|
34186 | return this;
|
34187 | };
|
34188 |
|
34189 |
|
34190 |
|
34191 |
|
34192 |
|
34193 |
|
34194 |
|
34195 |
|
34196 | Manager.prototype.maybeReconnectOnOpen = function() {
|
34197 |
|
34198 | if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {
|
34199 |
|
34200 | this.reconnect();
|
34201 | }
|
34202 | };
|
34203 |
|
34204 |
|
34205 |
|
34206 |
|
34207 |
|
34208 |
|
34209 |
|
34210 |
|
34211 |
|
34212 |
|
34213 | Manager.prototype.open =
|
34214 | Manager.prototype.connect = function(fn){
|
34215 | debug('readyState %s', this.readyState);
|
34216 | if (~this.readyState.indexOf('open')) return this;
|
34217 |
|
34218 | debug('opening %s', this.uri);
|
34219 | this.engine = eio(this.uri, this.opts);
|
34220 | var socket = this.engine;
|
34221 | var self = this;
|
34222 | this.readyState = 'opening';
|
34223 | this.skipReconnect = false;
|
34224 |
|
34225 |
|
34226 | var openSub = on(socket, 'open', function() {
|
34227 | self.onopen();
|
34228 | fn && fn();
|
34229 | });
|
34230 |
|
34231 |
|
34232 | var errorSub = on(socket, 'error', function(data){
|
34233 | debug('connect_error');
|
34234 | self.cleanup();
|
34235 | self.readyState = 'closed';
|
34236 | self.emitAll('connect_error', data);
|
34237 | if (fn) {
|
34238 | var err = new Error('Connection error');
|
34239 | err.data = data;
|
34240 | fn(err);
|
34241 | } else {
|
34242 |
|
34243 | self.maybeReconnectOnOpen();
|
34244 | }
|
34245 | });
|
34246 |
|
34247 |
|
34248 | if (false !== this._timeout) {
|
34249 | var timeout = this._timeout;
|
34250 | debug('connect attempt will timeout after %d', timeout);
|
34251 |
|
34252 |
|
34253 | var timer = setTimeout(function(){
|
34254 | debug('connect attempt timed out after %d', timeout);
|
34255 | openSub.destroy();
|
34256 | socket.close();
|
34257 | socket.emit('error', 'timeout');
|
34258 | self.emitAll('connect_timeout', timeout);
|
34259 | }, timeout);
|
34260 |
|
34261 | this.subs.push({
|
34262 | destroy: function(){
|
34263 | clearTimeout(timer);
|
34264 | }
|
34265 | });
|
34266 | }
|
34267 |
|
34268 | this.subs.push(openSub);
|
34269 | this.subs.push(errorSub);
|
34270 |
|
34271 | return this;
|
34272 | };
|
34273 |
|
34274 |
|
34275 |
|
34276 |
|
34277 |
|
34278 |
|
34279 |
|
34280 | Manager.prototype.onopen = function(){
|
34281 | debug('open');
|
34282 |
|
34283 |
|
34284 | this.cleanup();
|
34285 |
|
34286 |
|
34287 | this.readyState = 'open';
|
34288 | this.emit('open');
|
34289 |
|
34290 |
|
34291 | var socket = this.engine;
|
34292 | this.subs.push(on(socket, 'data', bind(this, 'ondata')));
|
34293 | this.subs.push(on(socket, 'ping', bind(this, 'onping')));
|
34294 | this.subs.push(on(socket, 'pong', bind(this, 'onpong')));
|
34295 | this.subs.push(on(socket, 'error', bind(this, 'onerror')));
|
34296 | this.subs.push(on(socket, 'close', bind(this, 'onclose')));
|
34297 | this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));
|
34298 | };
|
34299 |
|
34300 |
|
34301 |
|
34302 |
|
34303 |
|
34304 |
|
34305 |
|
34306 | Manager.prototype.onping = function(){
|
34307 | this.lastPing = new Date;
|
34308 | this.emitAll('ping');
|
34309 | };
|
34310 |
|
34311 |
|
34312 |
|
34313 |
|
34314 |
|
34315 |
|
34316 |
|
34317 | Manager.prototype.onpong = function(){
|
34318 | this.emitAll('pong', new Date - this.lastPing);
|
34319 | };
|
34320 |
|
34321 |
|
34322 |
|
34323 |
|
34324 |
|
34325 |
|
34326 |
|
34327 | Manager.prototype.ondata = function(data){
|
34328 | this.decoder.add(data);
|
34329 | };
|
34330 |
|
34331 |
|
34332 |
|
34333 |
|
34334 |
|
34335 |
|
34336 |
|
34337 | Manager.prototype.ondecoded = function(packet) {
|
34338 | this.emit('packet', packet);
|
34339 | };
|
34340 |
|
34341 |
|
34342 |
|
34343 |
|
34344 |
|
34345 |
|
34346 |
|
34347 | Manager.prototype.onerror = function(err){
|
34348 | debug('error', err);
|
34349 | this.emitAll('error', err);
|
34350 | };
|
34351 |
|
34352 |
|
34353 |
|
34354 |
|
34355 |
|
34356 |
|
34357 |
|
34358 |
|
34359 | Manager.prototype.socket = function(nsp){
|
34360 | var socket = this.nsps[nsp];
|
34361 | if (!socket) {
|
34362 | socket = new Socket(this, nsp);
|
34363 | this.nsps[nsp] = socket;
|
34364 | var self = this;
|
34365 | socket.on('connecting', onConnecting);
|
34366 | socket.on('connect', function(){
|
34367 | socket.id = self.engine.id;
|
34368 | });
|
34369 |
|
34370 | if (this.autoConnect) {
|
34371 |
|
34372 | onConnecting();
|
34373 | }
|
34374 | }
|
34375 |
|
34376 | function onConnecting() {
|
34377 | if (!~indexOf(self.connecting, socket)) {
|
34378 | self.connecting.push(socket);
|
34379 | }
|
34380 | }
|
34381 |
|
34382 | return socket;
|
34383 | };
|
34384 |
|
34385 |
|
34386 |
|
34387 |
|
34388 |
|
34389 |
|
34390 |
|
34391 | Manager.prototype.destroy = function(socket){
|
34392 | var index = indexOf(this.connecting, socket);
|
34393 | if (~index) this.connecting.splice(index, 1);
|
34394 | if (this.connecting.length) return;
|
34395 |
|
34396 | this.close();
|
34397 | };
|
34398 |
|
34399 |
|
34400 |
|
34401 |
|
34402 |
|
34403 |
|
34404 |
|
34405 |
|
34406 | Manager.prototype.packet = function(packet){
|
34407 | debug('writing packet %j', packet);
|
34408 | var self = this;
|
34409 |
|
34410 | if (!self.encoding) {
|
34411 |
|
34412 | self.encoding = true;
|
34413 | this.encoder.encode(packet, function(encodedPackets) {
|
34414 | for (var i = 0; i < encodedPackets.length; i++) {
|
34415 | self.engine.write(encodedPackets[i], packet.options);
|
34416 | }
|
34417 | self.encoding = false;
|
34418 | self.processPacketQueue();
|
34419 | });
|
34420 | } else {
|
34421 | self.packetBuffer.push(packet);
|
34422 | }
|
34423 | };
|
34424 |
|
34425 |
|
34426 |
|
34427 |
|
34428 |
|
34429 |
|
34430 |
|
34431 |
|
34432 | Manager.prototype.processPacketQueue = function() {
|
34433 | if (this.packetBuffer.length > 0 && !this.encoding) {
|
34434 | var pack = this.packetBuffer.shift();
|
34435 | this.packet(pack);
|
34436 | }
|
34437 | };
|
34438 |
|
34439 |
|
34440 |
|
34441 |
|
34442 |
|
34443 |
|
34444 |
|
34445 | Manager.prototype.cleanup = function(){
|
34446 | debug('cleanup');
|
34447 |
|
34448 | var sub;
|
34449 | while (sub = this.subs.shift()) sub.destroy();
|
34450 |
|
34451 | this.packetBuffer = [];
|
34452 | this.encoding = false;
|
34453 | this.lastPing = null;
|
34454 |
|
34455 | this.decoder.destroy();
|
34456 | };
|
34457 |
|
34458 |
|
34459 |
|
34460 |
|
34461 |
|
34462 |
|
34463 |
|
34464 | Manager.prototype.close =
|
34465 | Manager.prototype.disconnect = function(){
|
34466 | debug('disconnect');
|
34467 | this.skipReconnect = true;
|
34468 | this.reconnecting = false;
|
34469 | if ('opening' == this.readyState) {
|
34470 |
|
34471 |
|
34472 | this.cleanup();
|
34473 | }
|
34474 | this.backoff.reset();
|
34475 | this.readyState = 'closed';
|
34476 | if (this.engine) this.engine.close();
|
34477 | };
|
34478 |
|
34479 |
|
34480 |
|
34481 |
|
34482 |
|
34483 |
|
34484 |
|
34485 | Manager.prototype.onclose = function(reason){
|
34486 | debug('onclose');
|
34487 |
|
34488 | this.cleanup();
|
34489 | this.backoff.reset();
|
34490 | this.readyState = 'closed';
|
34491 | this.emit('close', reason);
|
34492 |
|
34493 | if (this._reconnection && !this.skipReconnect) {
|
34494 | this.reconnect();
|
34495 | }
|
34496 | };
|
34497 |
|
34498 |
|
34499 |
|
34500 |
|
34501 |
|
34502 |
|
34503 |
|
34504 | Manager.prototype.reconnect = function(){
|
34505 | if (this.reconnecting || this.skipReconnect) return this;
|
34506 |
|
34507 | var self = this;
|
34508 |
|
34509 | if (this.backoff.attempts >= this._reconnectionAttempts) {
|
34510 | debug('reconnect failed');
|
34511 | this.backoff.reset();
|
34512 | this.emitAll('reconnect_failed');
|
34513 | this.reconnecting = false;
|
34514 | } else {
|
34515 | var delay = this.backoff.duration();
|
34516 | debug('will wait %dms before reconnect attempt', delay);
|
34517 |
|
34518 | this.reconnecting = true;
|
34519 | var timer = setTimeout(function(){
|
34520 | if (self.skipReconnect) return;
|
34521 |
|
34522 | debug('attempting reconnect');
|
34523 | self.emitAll('reconnect_attempt', self.backoff.attempts);
|
34524 | self.emitAll('reconnecting', self.backoff.attempts);
|
34525 |
|
34526 |
|
34527 | if (self.skipReconnect) return;
|
34528 |
|
34529 | self.open(function(err){
|
34530 | if (err) {
|
34531 | debug('reconnect attempt error');
|
34532 | self.reconnecting = false;
|
34533 | self.reconnect();
|
34534 | self.emitAll('reconnect_error', err.data);
|
34535 | } else {
|
34536 | debug('reconnect success');
|
34537 | self.onreconnect();
|
34538 | }
|
34539 | });
|
34540 | }, delay);
|
34541 |
|
34542 | this.subs.push({
|
34543 | destroy: function(){
|
34544 | clearTimeout(timer);
|
34545 | }
|
34546 | });
|
34547 | }
|
34548 | };
|
34549 |
|
34550 |
|
34551 |
|
34552 |
|
34553 |
|
34554 |
|
34555 |
|
34556 | Manager.prototype.onreconnect = function(){
|
34557 | var attempt = this.backoff.attempts;
|
34558 | this.reconnecting = false;
|
34559 | this.backoff.reset();
|
34560 | this.updateSocketIds();
|
34561 | this.emitAll('reconnect', attempt);
|
34562 | };
|
34563 |
|
34564 | },{"12":12,"17":17,"323":323,"324":324,"326":326,"328":328,"5":5,"80":80,"9":9}],323:[function(require,module,exports){
|
34565 |
|
34566 |
|
34567 |
|
34568 |
|
34569 |
|
34570 | module.exports = on;
|
34571 |
|
34572 |
|
34573 |
|
34574 |
|
34575 |
|
34576 |
|
34577 |
|
34578 |
|
34579 |
|
34580 |
|
34581 | function on(obj, ev, fn) {
|
34582 | obj.on(ev, fn);
|
34583 | return {
|
34584 | destroy: function(){
|
34585 | obj.removeListener(ev, fn);
|
34586 | }
|
34587 | };
|
34588 | }
|
34589 |
|
34590 | },{}],324:[function(require,module,exports){
|
34591 |
|
34592 |
|
34593 |
|
34594 |
|
34595 |
|
34596 | var parser = require(328);
|
34597 | var Emitter = require(326);
|
34598 | var toArray = require(333);
|
34599 | var on = require(323);
|
34600 | var bind = require(9);
|
34601 | var debug = require(12)('socket.io-client:socket');
|
34602 | var hasBin = require(56);
|
34603 |
|
34604 |
|
34605 |
|
34606 |
|
34607 |
|
34608 | module.exports = exports = Socket;
|
34609 |
|
34610 |
|
34611 |
|
34612 |
|
34613 |
|
34614 |
|
34615 |
|
34616 |
|
34617 | var events = {
|
34618 | connect: 1,
|
34619 | connect_error: 1,
|
34620 | connect_timeout: 1,
|
34621 | connecting: 1,
|
34622 | disconnect: 1,
|
34623 | error: 1,
|
34624 | reconnect: 1,
|
34625 | reconnect_attempt: 1,
|
34626 | reconnect_failed: 1,
|
34627 | reconnect_error: 1,
|
34628 | reconnecting: 1,
|
34629 | ping: 1,
|
34630 | pong: 1
|
34631 | };
|
34632 |
|
34633 |
|
34634 |
|
34635 |
|
34636 |
|
34637 | var emit = Emitter.prototype.emit;
|
34638 |
|
34639 |
|
34640 |
|
34641 |
|
34642 |
|
34643 |
|
34644 |
|
34645 | function Socket(io, nsp){
|
34646 | this.io = io;
|
34647 | this.nsp = nsp;
|
34648 | this.json = this;
|
34649 | this.ids = 0;
|
34650 | this.acks = {};
|
34651 | this.receiveBuffer = [];
|
34652 | this.sendBuffer = [];
|
34653 | this.connected = false;
|
34654 | this.disconnected = true;
|
34655 | if (this.io.autoConnect) this.open();
|
34656 | }
|
34657 |
|
34658 |
|
34659 |
|
34660 |
|
34661 |
|
34662 | Emitter(Socket.prototype);
|
34663 |
|
34664 |
|
34665 |
|
34666 |
|
34667 |
|
34668 |
|
34669 |
|
34670 | Socket.prototype.subEvents = function() {
|
34671 | if (this.subs) return;
|
34672 |
|
34673 | var io = this.io;
|
34674 | this.subs = [
|
34675 | on(io, 'open', bind(this, 'onopen')),
|
34676 | on(io, 'packet', bind(this, 'onpacket')),
|
34677 | on(io, 'close', bind(this, 'onclose'))
|
34678 | ];
|
34679 | };
|
34680 |
|
34681 |
|
34682 |
|
34683 |
|
34684 |
|
34685 |
|
34686 |
|
34687 | Socket.prototype.open =
|
34688 | Socket.prototype.connect = function(){
|
34689 | if (this.connected) return this;
|
34690 |
|
34691 | this.subEvents();
|
34692 | this.io.open();
|
34693 | if ('open' == this.io.readyState) this.onopen();
|
34694 | this.emit('connecting');
|
34695 | return this;
|
34696 | };
|
34697 |
|
34698 |
|
34699 |
|
34700 |
|
34701 |
|
34702 |
|
34703 |
|
34704 |
|
34705 | Socket.prototype.send = function(){
|
34706 | var args = toArray(arguments);
|
34707 | args.unshift('message');
|
34708 | this.emit.apply(this, args);
|
34709 | return this;
|
34710 | };
|
34711 |
|
34712 |
|
34713 |
|
34714 |
|
34715 |
|
34716 |
|
34717 |
|
34718 |
|
34719 |
|
34720 |
|
34721 | Socket.prototype.emit = function(ev){
|
34722 | if (events.hasOwnProperty(ev)) {
|
34723 | emit.apply(this, arguments);
|
34724 | return this;
|
34725 | }
|
34726 |
|
34727 | var args = toArray(arguments);
|
34728 | var parserType = parser.EVENT;
|
34729 | if (hasBin(args)) { parserType = parser.BINARY_EVENT; }
|
34730 | var packet = { type: parserType, data: args };
|
34731 |
|
34732 | packet.options = {};
|
34733 | packet.options.compress = !this.flags || false !== this.flags.compress;
|
34734 |
|
34735 |
|
34736 | if ('function' == typeof args[args.length - 1]) {
|
34737 | debug('emitting packet with ack id %d', this.ids);
|
34738 | this.acks[this.ids] = args.pop();
|
34739 | packet.id = this.ids++;
|
34740 | }
|
34741 |
|
34742 | if (this.connected) {
|
34743 | this.packet(packet);
|
34744 | } else {
|
34745 | this.sendBuffer.push(packet);
|
34746 | }
|
34747 |
|
34748 | delete this.flags;
|
34749 |
|
34750 | return this;
|
34751 | };
|
34752 |
|
34753 |
|
34754 |
|
34755 |
|
34756 |
|
34757 |
|
34758 |
|
34759 |
|
34760 | Socket.prototype.packet = function(packet){
|
34761 | packet.nsp = this.nsp;
|
34762 | this.io.packet(packet);
|
34763 | };
|
34764 |
|
34765 |
|
34766 |
|
34767 |
|
34768 |
|
34769 |
|
34770 |
|
34771 | Socket.prototype.onopen = function(){
|
34772 | debug('transport is open - connecting');
|
34773 |
|
34774 |
|
34775 | if ('/' != this.nsp) {
|
34776 | this.packet({ type: parser.CONNECT });
|
34777 | }
|
34778 | };
|
34779 |
|
34780 |
|
34781 |
|
34782 |
|
34783 |
|
34784 |
|
34785 |
|
34786 |
|
34787 | Socket.prototype.onclose = function(reason){
|
34788 | debug('close (%s)', reason);
|
34789 | this.connected = false;
|
34790 | this.disconnected = true;
|
34791 | delete this.id;
|
34792 | this.emit('disconnect', reason);
|
34793 | };
|
34794 |
|
34795 |
|
34796 |
|
34797 |
|
34798 |
|
34799 |
|
34800 |
|
34801 |
|
34802 | Socket.prototype.onpacket = function(packet){
|
34803 | if (packet.nsp != this.nsp) return;
|
34804 |
|
34805 | switch (packet.type) {
|
34806 | case parser.CONNECT:
|
34807 | this.onconnect();
|
34808 | break;
|
34809 |
|
34810 | case parser.EVENT:
|
34811 | this.onevent(packet);
|
34812 | break;
|
34813 |
|
34814 | case parser.BINARY_EVENT:
|
34815 | this.onevent(packet);
|
34816 | break;
|
34817 |
|
34818 | case parser.ACK:
|
34819 | this.onack(packet);
|
34820 | break;
|
34821 |
|
34822 | case parser.BINARY_ACK:
|
34823 | this.onack(packet);
|
34824 | break;
|
34825 |
|
34826 | case parser.DISCONNECT:
|
34827 | this.ondisconnect();
|
34828 | break;
|
34829 |
|
34830 | case parser.ERROR:
|
34831 | this.emit('error', packet.data);
|
34832 | break;
|
34833 | }
|
34834 | };
|
34835 |
|
34836 |
|
34837 |
|
34838 |
|
34839 |
|
34840 |
|
34841 |
|
34842 |
|
34843 | Socket.prototype.onevent = function(packet){
|
34844 | var args = packet.data || [];
|
34845 | debug('emitting event %j', args);
|
34846 |
|
34847 | if (null != packet.id) {
|
34848 | debug('attaching ack callback to event');
|
34849 | args.push(this.ack(packet.id));
|
34850 | }
|
34851 |
|
34852 | if (this.connected) {
|
34853 | emit.apply(this, args);
|
34854 | } else {
|
34855 | this.receiveBuffer.push(args);
|
34856 | }
|
34857 | };
|
34858 |
|
34859 |
|
34860 |
|
34861 |
|
34862 |
|
34863 |
|
34864 |
|
34865 | Socket.prototype.ack = function(id){
|
34866 | var self = this;
|
34867 | var sent = false;
|
34868 | return function(){
|
34869 |
|
34870 | if (sent) return;
|
34871 | sent = true;
|
34872 | var args = toArray(arguments);
|
34873 | debug('sending ack %j', args);
|
34874 |
|
34875 | var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;
|
34876 | self.packet({
|
34877 | type: type,
|
34878 | id: id,
|
34879 | data: args
|
34880 | });
|
34881 | };
|
34882 | };
|
34883 |
|
34884 |
|
34885 |
|
34886 |
|
34887 |
|
34888 |
|
34889 |
|
34890 |
|
34891 | Socket.prototype.onack = function(packet){
|
34892 | var ack = this.acks[packet.id];
|
34893 | if ('function' == typeof ack) {
|
34894 | debug('calling ack %s with %j', packet.id, packet.data);
|
34895 | ack.apply(this, packet.data);
|
34896 | delete this.acks[packet.id];
|
34897 | } else {
|
34898 | debug('bad ack %s', packet.id);
|
34899 | }
|
34900 | };
|
34901 |
|
34902 |
|
34903 |
|
34904 |
|
34905 |
|
34906 |
|
34907 |
|
34908 | Socket.prototype.onconnect = function(){
|
34909 | this.connected = true;
|
34910 | this.disconnected = false;
|
34911 | this.emit('connect');
|
34912 | this.emitBuffered();
|
34913 | };
|
34914 |
|
34915 |
|
34916 |
|
34917 |
|
34918 |
|
34919 |
|
34920 |
|
34921 | Socket.prototype.emitBuffered = function(){
|
34922 | var i;
|
34923 | for (i = 0; i < this.receiveBuffer.length; i++) {
|
34924 | emit.apply(this, this.receiveBuffer[i]);
|
34925 | }
|
34926 | this.receiveBuffer = [];
|
34927 |
|
34928 | for (i = 0; i < this.sendBuffer.length; i++) {
|
34929 | this.packet(this.sendBuffer[i]);
|
34930 | }
|
34931 | this.sendBuffer = [];
|
34932 | };
|
34933 |
|
34934 |
|
34935 |
|
34936 |
|
34937 |
|
34938 |
|
34939 |
|
34940 | Socket.prototype.ondisconnect = function(){
|
34941 | debug('server disconnect (%s)', this.nsp);
|
34942 | this.destroy();
|
34943 | this.onclose('io server disconnect');
|
34944 | };
|
34945 |
|
34946 |
|
34947 |
|
34948 |
|
34949 |
|
34950 |
|
34951 |
|
34952 |
|
34953 |
|
34954 | Socket.prototype.destroy = function(){
|
34955 | if (this.subs) {
|
34956 |
|
34957 | for (var i = 0; i < this.subs.length; i++) {
|
34958 | this.subs[i].destroy();
|
34959 | }
|
34960 | this.subs = null;
|
34961 | }
|
34962 |
|
34963 | this.io.destroy(this);
|
34964 | };
|
34965 |
|
34966 |
|
34967 |
|
34968 |
|
34969 |
|
34970 |
|
34971 |
|
34972 |
|
34973 | Socket.prototype.close =
|
34974 | Socket.prototype.disconnect = function(){
|
34975 | if (this.connected) {
|
34976 | debug('performing disconnect (%s)', this.nsp);
|
34977 | this.packet({ type: parser.DISCONNECT });
|
34978 | }
|
34979 |
|
34980 |
|
34981 | this.destroy();
|
34982 |
|
34983 | if (this.connected) {
|
34984 |
|
34985 | this.onclose('io client disconnect');
|
34986 | }
|
34987 | return this;
|
34988 | };
|
34989 |
|
34990 |
|
34991 |
|
34992 |
|
34993 |
|
34994 |
|
34995 |
|
34996 |
|
34997 |
|
34998 | Socket.prototype.compress = function(compress){
|
34999 | this.flags = this.flags || {};
|
35000 | this.flags.compress = compress;
|
35001 | return this;
|
35002 | };
|
35003 |
|
35004 | },{"12":12,"323":323,"326":326,"328":328,"333":333,"56":56,"9":9}],325:[function(require,module,exports){
|
35005 | (function (global){
|
35006 |
|
35007 |
|
35008 |
|
35009 |
|
35010 |
|
35011 | var parseuri = require(89);
|
35012 | var debug = require(12)('socket.io-client:url');
|
35013 |
|
35014 |
|
35015 |
|
35016 |
|
35017 |
|
35018 | module.exports = url;
|
35019 |
|
35020 |
|
35021 |
|
35022 |
|
35023 |
|
35024 |
|
35025 |
|
35026 |
|
35027 |
|
35028 |
|
35029 | function url(uri, loc){
|
35030 | var obj = uri;
|
35031 |
|
35032 |
|
35033 | var loc = loc || global.location;
|
35034 | if (null == uri) uri = loc.protocol + '//' + loc.host;
|
35035 |
|
35036 |
|
35037 | if ('string' == typeof uri) {
|
35038 | if ('/' == uri.charAt(0)) {
|
35039 | if ('/' == uri.charAt(1)) {
|
35040 | uri = loc.protocol + uri;
|
35041 | } else {
|
35042 | uri = loc.host + uri;
|
35043 | }
|
35044 | }
|
35045 |
|
35046 | if (!/^(https?|wss?):\/\//.test(uri)) {
|
35047 | debug('protocol-less url %s', uri);
|
35048 | if ('undefined' != typeof loc) {
|
35049 | uri = loc.protocol + '//' + uri;
|
35050 | } else {
|
35051 | uri = 'https://' + uri;
|
35052 | }
|
35053 | }
|
35054 |
|
35055 |
|
35056 | debug('parse %s', uri);
|
35057 | obj = parseuri(uri);
|
35058 | }
|
35059 |
|
35060 |
|
35061 | if (!obj.port) {
|
35062 | if (/^(http|ws)$/.test(obj.protocol)) {
|
35063 | obj.port = '80';
|
35064 | }
|
35065 | else if (/^(http|ws)s$/.test(obj.protocol)) {
|
35066 | obj.port = '443';
|
35067 | }
|
35068 | }
|
35069 |
|
35070 | obj.path = obj.path || '/';
|
35071 |
|
35072 | var ipv6 = obj.host.indexOf(':') !== -1;
|
35073 | var host = ipv6 ? '[' + obj.host + ']' : obj.host;
|
35074 |
|
35075 |
|
35076 | obj.id = obj.protocol + '://' + host + ':' + obj.port;
|
35077 |
|
35078 | obj.href = obj.protocol + '://' + host + (loc && loc.port == obj.port ? '' : (':' + obj.port));
|
35079 |
|
35080 | return obj;
|
35081 | }
|
35082 |
|
35083 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
35084 | },{"12":12,"89":89}],326:[function(require,module,exports){
|
35085 |
|
35086 |
|
35087 |
|
35088 |
|
35089 |
|
35090 | module.exports = Emitter;
|
35091 |
|
35092 |
|
35093 |
|
35094 |
|
35095 |
|
35096 |
|
35097 |
|
35098 | function Emitter(obj) {
|
35099 | if (obj) return mixin(obj);
|
35100 | };
|
35101 |
|
35102 |
|
35103 |
|
35104 |
|
35105 |
|
35106 |
|
35107 |
|
35108 |
|
35109 |
|
35110 | function mixin(obj) {
|
35111 | for (var key in Emitter.prototype) {
|
35112 | obj[key] = Emitter.prototype[key];
|
35113 | }
|
35114 | return obj;
|
35115 | }
|
35116 |
|
35117 |
|
35118 |
|
35119 |
|
35120 |
|
35121 |
|
35122 |
|
35123 |
|
35124 |
|
35125 |
|
35126 | Emitter.prototype.on =
|
35127 | Emitter.prototype.addEventListener = function(event, fn){
|
35128 | this._callbacks = this._callbacks || {};
|
35129 | (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
|
35130 | .push(fn);
|
35131 | return this;
|
35132 | };
|
35133 |
|
35134 |
|
35135 |
|
35136 |
|
35137 |
|
35138 |
|
35139 |
|
35140 |
|
35141 |
|
35142 |
|
35143 |
|
35144 | Emitter.prototype.once = function(event, fn){
|
35145 | function on() {
|
35146 | this.off(event, on);
|
35147 | fn.apply(this, arguments);
|
35148 | }
|
35149 |
|
35150 | on.fn = fn;
|
35151 | this.on(event, on);
|
35152 | return this;
|
35153 | };
|
35154 |
|
35155 |
|
35156 |
|
35157 |
|
35158 |
|
35159 |
|
35160 |
|
35161 |
|
35162 |
|
35163 |
|
35164 |
|
35165 | Emitter.prototype.off =
|
35166 | Emitter.prototype.removeListener =
|
35167 | Emitter.prototype.removeAllListeners =
|
35168 | Emitter.prototype.removeEventListener = function(event, fn){
|
35169 | this._callbacks = this._callbacks || {};
|
35170 |
|
35171 |
|
35172 | if (0 == arguments.length) {
|
35173 | this._callbacks = {};
|
35174 | return this;
|
35175 | }
|
35176 |
|
35177 |
|
35178 | var callbacks = this._callbacks['$' + event];
|
35179 | if (!callbacks) return this;
|
35180 |
|
35181 |
|
35182 | if (1 == arguments.length) {
|
35183 | delete this._callbacks['$' + event];
|
35184 | return this;
|
35185 | }
|
35186 |
|
35187 |
|
35188 | var cb;
|
35189 | for (var i = 0; i < callbacks.length; i++) {
|
35190 | cb = callbacks[i];
|
35191 | if (cb === fn || cb.fn === fn) {
|
35192 | callbacks.splice(i, 1);
|
35193 | break;
|
35194 | }
|
35195 | }
|
35196 | return this;
|
35197 | };
|
35198 |
|
35199 |
|
35200 |
|
35201 |
|
35202 |
|
35203 |
|
35204 |
|
35205 |
|
35206 |
|
35207 | Emitter.prototype.emit = function(event){
|
35208 | this._callbacks = this._callbacks || {};
|
35209 | var args = [].slice.call(arguments, 1)
|
35210 | , callbacks = this._callbacks['$' + event];
|
35211 |
|
35212 | if (callbacks) {
|
35213 | callbacks = callbacks.slice(0);
|
35214 | for (var i = 0, len = callbacks.length; i < len; ++i) {
|
35215 | callbacks[i].apply(this, args);
|
35216 | }
|
35217 | }
|
35218 |
|
35219 | return this;
|
35220 | };
|
35221 |
|
35222 |
|
35223 |
|
35224 |
|
35225 |
|
35226 |
|
35227 |
|
35228 |
|
35229 |
|
35230 | Emitter.prototype.listeners = function(event){
|
35231 | this._callbacks = this._callbacks || {};
|
35232 | return this._callbacks['$' + event] || [];
|
35233 | };
|
35234 |
|
35235 |
|
35236 |
|
35237 |
|
35238 |
|
35239 |
|
35240 |
|
35241 |
|
35242 |
|
35243 | Emitter.prototype.hasListeners = function(event){
|
35244 | return !! this.listeners(event).length;
|
35245 | };
|
35246 |
|
35247 | },{}],327:[function(require,module,exports){
|
35248 | (function (global){
|
35249 |
|
35250 |
|
35251 |
|
35252 |
|
35253 |
|
35254 |
|
35255 | var isArray = require(82);
|
35256 | var isBuf = require(329);
|
35257 |
|
35258 |
|
35259 |
|
35260 |
|
35261 |
|
35262 |
|
35263 |
|
35264 |
|
35265 |
|
35266 |
|
35267 |
|
35268 | exports.deconstructPacket = function(packet){
|
35269 | var buffers = [];
|
35270 | var packetData = packet.data;
|
35271 |
|
35272 | function _deconstructPacket(data) {
|
35273 | if (!data) return data;
|
35274 |
|
35275 | if (isBuf(data)) {
|
35276 | var placeholder = { _placeholder: true, num: buffers.length };
|
35277 | buffers.push(data);
|
35278 | return placeholder;
|
35279 | } else if (isArray(data)) {
|
35280 | var newData = new Array(data.length);
|
35281 | for (var i = 0; i < data.length; i++) {
|
35282 | newData[i] = _deconstructPacket(data[i]);
|
35283 | }
|
35284 | return newData;
|
35285 | } else if ('object' == typeof data && !(data instanceof Date)) {
|
35286 | var newData = {};
|
35287 | for (var key in data) {
|
35288 | newData[key] = _deconstructPacket(data[key]);
|
35289 | }
|
35290 | return newData;
|
35291 | }
|
35292 | return data;
|
35293 | }
|
35294 |
|
35295 | var pack = packet;
|
35296 | pack.data = _deconstructPacket(packetData);
|
35297 | pack.attachments = buffers.length;
|
35298 | return {packet: pack, buffers: buffers};
|
35299 | };
|
35300 |
|
35301 |
|
35302 |
|
35303 |
|
35304 |
|
35305 |
|
35306 |
|
35307 |
|
35308 |
|
35309 |
|
35310 | exports.reconstructPacket = function(packet, buffers) {
|
35311 | var curPlaceHolder = 0;
|
35312 |
|
35313 | function _reconstructPacket(data) {
|
35314 | if (data && data._placeholder) {
|
35315 | var buf = buffers[data.num];
|
35316 | return buf;
|
35317 | } else if (isArray(data)) {
|
35318 | for (var i = 0; i < data.length; i++) {
|
35319 | data[i] = _reconstructPacket(data[i]);
|
35320 | }
|
35321 | return data;
|
35322 | } else if (data && 'object' == typeof data) {
|
35323 | for (var key in data) {
|
35324 | data[key] = _reconstructPacket(data[key]);
|
35325 | }
|
35326 | return data;
|
35327 | }
|
35328 | return data;
|
35329 | }
|
35330 |
|
35331 | packet.data = _reconstructPacket(packet.data);
|
35332 | packet.attachments = undefined;
|
35333 | return packet;
|
35334 | };
|
35335 |
|
35336 |
|
35337 |
|
35338 |
|
35339 |
|
35340 |
|
35341 |
|
35342 |
|
35343 |
|
35344 |
|
35345 |
|
35346 | exports.removeBlobs = function(data, callback) {
|
35347 | function _removeBlobs(obj, curKey, containingObject) {
|
35348 | if (!obj) return obj;
|
35349 |
|
35350 |
|
35351 | if ((global.Blob && obj instanceof Blob) ||
|
35352 | (global.File && obj instanceof File)) {
|
35353 | pendingBlobs++;
|
35354 |
|
35355 |
|
35356 | var fileReader = new FileReader();
|
35357 | fileReader.onload = function() {
|
35358 | if (containingObject) {
|
35359 | containingObject[curKey] = this.result;
|
35360 | }
|
35361 | else {
|
35362 | bloblessData = this.result;
|
35363 | }
|
35364 |
|
35365 |
|
35366 | if(! --pendingBlobs) {
|
35367 | callback(bloblessData);
|
35368 | }
|
35369 | };
|
35370 |
|
35371 | fileReader.readAsArrayBuffer(obj);
|
35372 | } else if (isArray(obj)) {
|
35373 | for (var i = 0; i < obj.length; i++) {
|
35374 | _removeBlobs(obj[i], i, obj);
|
35375 | }
|
35376 | } else if (obj && 'object' == typeof obj && !isBuf(obj)) {
|
35377 | for (var key in obj) {
|
35378 | _removeBlobs(obj[key], key, obj);
|
35379 | }
|
35380 | }
|
35381 | }
|
35382 |
|
35383 | var pendingBlobs = 0;
|
35384 | var bloblessData = data;
|
35385 | _removeBlobs(bloblessData);
|
35386 | if (!pendingBlobs) {
|
35387 | callback(bloblessData);
|
35388 | }
|
35389 | };
|
35390 |
|
35391 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
35392 | },{"329":329,"82":82}],328:[function(require,module,exports){
|
35393 |
|
35394 |
|
35395 |
|
35396 |
|
35397 |
|
35398 | var debug = require(12)('socket.io-parser');
|
35399 | var json = require(330);
|
35400 | var isArray = require(82);
|
35401 | var Emitter = require(10);
|
35402 | var binary = require(327);
|
35403 | var isBuf = require(329);
|
35404 |
|
35405 |
|
35406 |
|
35407 |
|
35408 |
|
35409 |
|
35410 |
|
35411 | exports.protocol = 4;
|
35412 |
|
35413 |
|
35414 |
|
35415 |
|
35416 |
|
35417 |
|
35418 |
|
35419 | exports.types = [
|
35420 | 'CONNECT',
|
35421 | 'DISCONNECT',
|
35422 | 'EVENT',
|
35423 | 'ACK',
|
35424 | 'ERROR',
|
35425 | 'BINARY_EVENT',
|
35426 | 'BINARY_ACK'
|
35427 | ];
|
35428 |
|
35429 |
|
35430 |
|
35431 |
|
35432 |
|
35433 |
|
35434 |
|
35435 | exports.CONNECT = 0;
|
35436 |
|
35437 |
|
35438 |
|
35439 |
|
35440 |
|
35441 |
|
35442 |
|
35443 | exports.DISCONNECT = 1;
|
35444 |
|
35445 |
|
35446 |
|
35447 |
|
35448 |
|
35449 |
|
35450 |
|
35451 | exports.EVENT = 2;
|
35452 |
|
35453 |
|
35454 |
|
35455 |
|
35456 |
|
35457 |
|
35458 |
|
35459 | exports.ACK = 3;
|
35460 |
|
35461 |
|
35462 |
|
35463 |
|
35464 |
|
35465 |
|
35466 |
|
35467 | exports.ERROR = 4;
|
35468 |
|
35469 |
|
35470 |
|
35471 |
|
35472 |
|
35473 |
|
35474 |
|
35475 | exports.BINARY_EVENT = 5;
|
35476 |
|
35477 |
|
35478 |
|
35479 |
|
35480 |
|
35481 |
|
35482 |
|
35483 | exports.BINARY_ACK = 6;
|
35484 |
|
35485 |
|
35486 |
|
35487 |
|
35488 |
|
35489 |
|
35490 |
|
35491 | exports.Encoder = Encoder;
|
35492 |
|
35493 |
|
35494 |
|
35495 |
|
35496 |
|
35497 |
|
35498 |
|
35499 | exports.Decoder = Decoder;
|
35500 |
|
35501 |
|
35502 |
|
35503 |
|
35504 |
|
35505 |
|
35506 |
|
35507 | function Encoder() {}
|
35508 |
|
35509 |
|
35510 |
|
35511 |
|
35512 |
|
35513 |
|
35514 |
|
35515 |
|
35516 |
|
35517 |
|
35518 |
|
35519 | Encoder.prototype.encode = function(obj, callback){
|
35520 | debug('encoding packet %j', obj);
|
35521 |
|
35522 | if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {
|
35523 | encodeAsBinary(obj, callback);
|
35524 | }
|
35525 | else {
|
35526 | var encoding = encodeAsString(obj);
|
35527 | callback([encoding]);
|
35528 | }
|
35529 | };
|
35530 |
|
35531 |
|
35532 |
|
35533 |
|
35534 |
|
35535 |
|
35536 |
|
35537 |
|
35538 |
|
35539 | function encodeAsString(obj) {
|
35540 | var str = '';
|
35541 | var nsp = false;
|
35542 |
|
35543 |
|
35544 | str += obj.type;
|
35545 |
|
35546 |
|
35547 | if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {
|
35548 | str += obj.attachments;
|
35549 | str += '-';
|
35550 | }
|
35551 |
|
35552 |
|
35553 |
|
35554 | if (obj.nsp && '/' != obj.nsp) {
|
35555 | nsp = true;
|
35556 | str += obj.nsp;
|
35557 | }
|
35558 |
|
35559 |
|
35560 | if (null != obj.id) {
|
35561 | if (nsp) {
|
35562 | str += ',';
|
35563 | nsp = false;
|
35564 | }
|
35565 | str += obj.id;
|
35566 | }
|
35567 |
|
35568 |
|
35569 | if (null != obj.data) {
|
35570 | if (nsp) str += ',';
|
35571 | str += json.stringify(obj.data);
|
35572 | }
|
35573 |
|
35574 | debug('encoded %j as %s', obj, str);
|
35575 | return str;
|
35576 | }
|
35577 |
|
35578 |
|
35579 |
|
35580 |
|
35581 |
|
35582 |
|
35583 |
|
35584 |
|
35585 |
|
35586 |
|
35587 |
|
35588 | function encodeAsBinary(obj, callback) {
|
35589 |
|
35590 | function writeEncoding(bloblessData) {
|
35591 | var deconstruction = binary.deconstructPacket(bloblessData);
|
35592 | var pack = encodeAsString(deconstruction.packet);
|
35593 | var buffers = deconstruction.buffers;
|
35594 |
|
35595 | buffers.unshift(pack);
|
35596 | callback(buffers);
|
35597 | }
|
35598 |
|
35599 | binary.removeBlobs(obj, writeEncoding);
|
35600 | }
|
35601 |
|
35602 |
|
35603 |
|
35604 |
|
35605 |
|
35606 |
|
35607 |
|
35608 |
|
35609 | function Decoder() {
|
35610 | this.reconstructor = null;
|
35611 | }
|
35612 |
|
35613 |
|
35614 |
|
35615 |
|
35616 |
|
35617 | Emitter(Decoder.prototype);
|
35618 |
|
35619 |
|
35620 |
|
35621 |
|
35622 |
|
35623 |
|
35624 |
|
35625 |
|
35626 |
|
35627 | Decoder.prototype.add = function(obj) {
|
35628 | var packet;
|
35629 | if ('string' == typeof obj) {
|
35630 | packet = decodeString(obj);
|
35631 | if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) {
|
35632 | this.reconstructor = new BinaryReconstructor(packet);
|
35633 |
|
35634 |
|
35635 | if (this.reconstructor.reconPack.attachments === 0) {
|
35636 | this.emit('decoded', packet);
|
35637 | }
|
35638 | } else {
|
35639 | this.emit('decoded', packet);
|
35640 | }
|
35641 | }
|
35642 | else if (isBuf(obj) || obj.base64) {
|
35643 | if (!this.reconstructor) {
|
35644 | throw new Error('got binary data when not reconstructing a packet');
|
35645 | } else {
|
35646 | packet = this.reconstructor.takeBinaryData(obj);
|
35647 | if (packet) {
|
35648 | this.reconstructor = null;
|
35649 | this.emit('decoded', packet);
|
35650 | }
|
35651 | }
|
35652 | }
|
35653 | else {
|
35654 | throw new Error('Unknown type: ' + obj);
|
35655 | }
|
35656 | };
|
35657 |
|
35658 |
|
35659 |
|
35660 |
|
35661 |
|
35662 |
|
35663 |
|
35664 |
|
35665 |
|
35666 | function decodeString(str) {
|
35667 | var p = {};
|
35668 | var i = 0;
|
35669 |
|
35670 |
|
35671 | p.type = Number(str.charAt(0));
|
35672 | if (null == exports.types[p.type]) return error();
|
35673 |
|
35674 |
|
35675 | if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {
|
35676 | var buf = '';
|
35677 | while (str.charAt(++i) != '-') {
|
35678 | buf += str.charAt(i);
|
35679 | if (i == str.length) break;
|
35680 | }
|
35681 | if (buf != Number(buf) || str.charAt(i) != '-') {
|
35682 | throw new Error('Illegal attachments');
|
35683 | }
|
35684 | p.attachments = Number(buf);
|
35685 | }
|
35686 |
|
35687 |
|
35688 | if ('/' == str.charAt(i + 1)) {
|
35689 | p.nsp = '';
|
35690 | while (++i) {
|
35691 | var c = str.charAt(i);
|
35692 | if (',' == c) break;
|
35693 | p.nsp += c;
|
35694 | if (i == str.length) break;
|
35695 | }
|
35696 | } else {
|
35697 | p.nsp = '/';
|
35698 | }
|
35699 |
|
35700 |
|
35701 | var next = str.charAt(i + 1);
|
35702 | if ('' !== next && Number(next) == next) {
|
35703 | p.id = '';
|
35704 | while (++i) {
|
35705 | var c = str.charAt(i);
|
35706 | if (null == c || Number(c) != c) {
|
35707 | --i;
|
35708 | break;
|
35709 | }
|
35710 | p.id += str.charAt(i);
|
35711 | if (i == str.length) break;
|
35712 | }
|
35713 | p.id = Number(p.id);
|
35714 | }
|
35715 |
|
35716 |
|
35717 | if (str.charAt(++i)) {
|
35718 | try {
|
35719 | p.data = json.parse(str.substr(i));
|
35720 | } catch(e){
|
35721 | return error();
|
35722 | }
|
35723 | }
|
35724 |
|
35725 | debug('decoded %s as %j', str, p);
|
35726 | return p;
|
35727 | }
|
35728 |
|
35729 |
|
35730 |
|
35731 |
|
35732 |
|
35733 |
|
35734 |
|
35735 | Decoder.prototype.destroy = function() {
|
35736 | if (this.reconstructor) {
|
35737 | this.reconstructor.finishedReconstruction();
|
35738 | }
|
35739 | };
|
35740 |
|
35741 |
|
35742 |
|
35743 |
|
35744 |
|
35745 |
|
35746 |
|
35747 |
|
35748 |
|
35749 |
|
35750 |
|
35751 | function BinaryReconstructor(packet) {
|
35752 | this.reconPack = packet;
|
35753 | this.buffers = [];
|
35754 | }
|
35755 |
|
35756 |
|
35757 |
|
35758 |
|
35759 |
|
35760 |
|
35761 |
|
35762 |
|
35763 |
|
35764 |
|
35765 |
|
35766 | BinaryReconstructor.prototype.takeBinaryData = function(binData) {
|
35767 | this.buffers.push(binData);
|
35768 | if (this.buffers.length == this.reconPack.attachments) {
|
35769 | var packet = binary.reconstructPacket(this.reconPack, this.buffers);
|
35770 | this.finishedReconstruction();
|
35771 | return packet;
|
35772 | }
|
35773 | return null;
|
35774 | };
|
35775 |
|
35776 |
|
35777 |
|
35778 |
|
35779 |
|
35780 |
|
35781 |
|
35782 | BinaryReconstructor.prototype.finishedReconstruction = function() {
|
35783 | this.reconPack = null;
|
35784 | this.buffers = [];
|
35785 | };
|
35786 |
|
35787 | function error(data){
|
35788 | return {
|
35789 | type: exports.ERROR,
|
35790 | data: 'parser error'
|
35791 | };
|
35792 | }
|
35793 |
|
35794 | },{"10":10,"12":12,"327":327,"329":329,"330":330,"82":82}],329:[function(require,module,exports){
|
35795 | (function (global){
|
35796 |
|
35797 | module.exports = isBuf;
|
35798 |
|
35799 |
|
35800 |
|
35801 |
|
35802 |
|
35803 |
|
35804 |
|
35805 | function isBuf(obj) {
|
35806 | return (global.Buffer && global.Buffer.isBuffer(obj)) ||
|
35807 | (global.ArrayBuffer && obj instanceof ArrayBuffer);
|
35808 | }
|
35809 |
|
35810 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
35811 | },{}],330:[function(require,module,exports){
|
35812 | (function (global){
|
35813 |
|
35814 | ;(function () {
|
35815 |
|
35816 |
|
35817 | var isLoader = typeof define === "function" && define.amd;
|
35818 |
|
35819 |
|
35820 | var objectTypes = {
|
35821 | "function": true,
|
35822 | "object": true
|
35823 | };
|
35824 |
|
35825 |
|
35826 | var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
|
35827 |
|
35828 |
|
35829 |
|
35830 |
|
35831 |
|
35832 | var root = objectTypes[typeof window] && window || this,
|
35833 | freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == "object" && global;
|
35834 |
|
35835 | if (freeGlobal && (freeGlobal["global"] === freeGlobal || freeGlobal["window"] === freeGlobal || freeGlobal["self"] === freeGlobal)) {
|
35836 | root = freeGlobal;
|
35837 | }
|
35838 |
|
35839 |
|
35840 |
|
35841 | function runInContext(context, exports) {
|
35842 | context || (context = root["Object"]());
|
35843 | exports || (exports = root["Object"]());
|
35844 |
|
35845 |
|
35846 | var Number = context["Number"] || root["Number"],
|
35847 | String = context["String"] || root["String"],
|
35848 | Object = context["Object"] || root["Object"],
|
35849 | Date = context["Date"] || root["Date"],
|
35850 | SyntaxError = context["SyntaxError"] || root["SyntaxError"],
|
35851 | TypeError = context["TypeError"] || root["TypeError"],
|
35852 | Math = context["Math"] || root["Math"],
|
35853 | nativeJSON = context["JSON"] || root["JSON"];
|
35854 |
|
35855 |
|
35856 | if (typeof nativeJSON == "object" && nativeJSON) {
|
35857 | exports.stringify = nativeJSON.stringify;
|
35858 | exports.parse = nativeJSON.parse;
|
35859 | }
|
35860 |
|
35861 |
|
35862 | var objectProto = Object.prototype,
|
35863 | getClass = objectProto.toString,
|
35864 | isProperty, forEach, undef;
|
35865 |
|
35866 |
|
35867 | var isExtended = new Date(-3509827334573292);
|
35868 | try {
|
35869 |
|
35870 |
|
35871 | isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&
|
35872 |
|
35873 |
|
35874 |
|
35875 | isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;
|
35876 | } catch (exception) {}
|
35877 |
|
35878 |
|
35879 |
|
35880 | function has(name) {
|
35881 | if (has[name] !== undef) {
|
35882 |
|
35883 | return has[name];
|
35884 | }
|
35885 | var isSupported;
|
35886 | if (name == "bug-string-char-index") {
|
35887 |
|
35888 |
|
35889 | isSupported = "a"[0] != "a";
|
35890 | } else if (name == "json") {
|
35891 |
|
35892 |
|
35893 | isSupported = has("json-stringify") && has("json-parse");
|
35894 | } else {
|
35895 | var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
|
35896 |
|
35897 | if (name == "json-stringify") {
|
35898 | var stringify = exports.stringify, stringifySupported = typeof stringify == "function" && isExtended;
|
35899 | if (stringifySupported) {
|
35900 |
|
35901 | (value = function () {
|
35902 | return 1;
|
35903 | }).toJSON = value;
|
35904 | try {
|
35905 | stringifySupported =
|
35906 |
|
35907 |
|
35908 | stringify(0) === "0" &&
|
35909 |
|
35910 |
|
35911 | stringify(new Number()) === "0" &&
|
35912 | stringify(new String()) == '""' &&
|
35913 |
|
35914 |
|
35915 |
|
35916 |
|
35917 | stringify(getClass) === undef &&
|
35918 |
|
35919 |
|
35920 | stringify(undef) === undef &&
|
35921 |
|
35922 |
|
35923 | stringify() === undef &&
|
35924 |
|
35925 |
|
35926 |
|
35927 |
|
35928 |
|
35929 | stringify(value) === "1" &&
|
35930 | stringify([value]) == "[1]" &&
|
35931 |
|
35932 |
|
35933 | stringify([undef]) == "[null]" &&
|
35934 |
|
35935 | stringify(null) == "null" &&
|
35936 |
|
35937 |
|
35938 |
|
35939 |
|
35940 | stringify([undef, getClass, null]) == "[null,null,null]" &&
|
35941 |
|
35942 |
|
35943 | stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized &&
|
35944 |
|
35945 | stringify(null, value) === "1" &&
|
35946 | stringify([1, 2], null, 1) == "[\n 1,\n 2\n]" &&
|
35947 |
|
35948 |
|
35949 | stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' &&
|
35950 |
|
35951 | stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' &&
|
35952 |
|
35953 |
|
35954 | stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
|
35955 |
|
35956 |
|
35957 | stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"';
|
35958 | } catch (exception) {
|
35959 | stringifySupported = false;
|
35960 | }
|
35961 | }
|
35962 | isSupported = stringifySupported;
|
35963 | }
|
35964 |
|
35965 | if (name == "json-parse") {
|
35966 | var parse = exports.parse;
|
35967 | if (typeof parse == "function") {
|
35968 | try {
|
35969 |
|
35970 |
|
35971 |
|
35972 | if (parse("0") === 0 && !parse(false)) {
|
35973 |
|
35974 | value = parse(serialized);
|
35975 | var parseSupported = value["a"].length == 5 && value["a"][0] === 1;
|
35976 | if (parseSupported) {
|
35977 | try {
|
35978 |
|
35979 | parseSupported = !parse('"\t"');
|
35980 | } catch (exception) {}
|
35981 | if (parseSupported) {
|
35982 | try {
|
35983 |
|
35984 |
|
35985 |
|
35986 | parseSupported = parse("01") !== 1;
|
35987 | } catch (exception) {}
|
35988 | }
|
35989 | if (parseSupported) {
|
35990 | try {
|
35991 |
|
35992 |
|
35993 |
|
35994 | parseSupported = parse("1.") !== 1;
|
35995 | } catch (exception) {}
|
35996 | }
|
35997 | }
|
35998 | }
|
35999 | } catch (exception) {
|
36000 | parseSupported = false;
|
36001 | }
|
36002 | }
|
36003 | isSupported = parseSupported;
|
36004 | }
|
36005 | }
|
36006 | return has[name] = !!isSupported;
|
36007 | }
|
36008 |
|
36009 | if (!has("json")) {
|
36010 |
|
36011 | var functionClass = "[object Function]",
|
36012 | dateClass = "[object Date]",
|
36013 | numberClass = "[object Number]",
|
36014 | stringClass = "[object String]",
|
36015 | arrayClass = "[object Array]",
|
36016 | booleanClass = "[object Boolean]";
|
36017 |
|
36018 |
|
36019 | var charIndexBuggy = has("bug-string-char-index");
|
36020 |
|
36021 |
|
36022 | if (!isExtended) {
|
36023 | var floor = Math.floor;
|
36024 |
|
36025 |
|
36026 | var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
|
36027 |
|
36028 |
|
36029 | var getDay = function (year, month) {
|
36030 | return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);
|
36031 | };
|
36032 | }
|
36033 |
|
36034 |
|
36035 |
|
36036 | if (!(isProperty = objectProto.hasOwnProperty)) {
|
36037 | isProperty = function (property) {
|
36038 | var members = {}, constructor;
|
36039 | if ((members.__proto__ = null, members.__proto__ = {
|
36040 |
|
36041 |
|
36042 | "toString": 1
|
36043 | }, members).toString != getClass) {
|
36044 |
|
36045 |
|
36046 | isProperty = function (property) {
|
36047 |
|
36048 |
|
36049 |
|
36050 | var original = this.__proto__, result = property in (this.__proto__ = null, this);
|
36051 |
|
36052 | this.__proto__ = original;
|
36053 | return result;
|
36054 | };
|
36055 | } else {
|
36056 |
|
36057 | constructor = members.constructor;
|
36058 | // Use the `constructor` property to simulate `Object#hasOwnProperty` in
|
36059 | // other environments.
|
36060 | isProperty = function (property) {
|
36061 | var parent = (this.constructor || constructor).prototype;
|
36062 | return property in this && !(property in parent && this[property] === parent[property]);
|
36063 | };
|
36064 | }
|
36065 | members = null;
|
36066 | return isProperty.call(this, property);
|
36067 | };
|
36068 | }
|
36069 |
|
36070 | // Internal: Normalizes the `for...in` iteration algorithm across
|
36071 | // environments. Each enumerated key is yielded to a `callback` function.
|
36072 | forEach = function (object, callback) {
|
36073 | var size = 0, Properties, members, property;
|
36074 |
|
36075 |
|
36076 |
|
36077 |
|
36078 | (Properties = function () {
|
36079 | this.valueOf = 0;
|
36080 | }).prototype.valueOf = 0;
|
36081 |
|
36082 |
|
36083 | members = new Properties();
|
36084 | for (property in members) {
|
36085 |
|
36086 | if (isProperty.call(members, property)) {
|
36087 | size++;
|
36088 | }
|
36089 | }
|
36090 | Properties = members = null;
|
36091 |
|
36092 |
|
36093 | if (!size) {
|
36094 |
|
36095 | members = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"];
|
36096 |
|
36097 |
|
36098 | forEach = function (object, callback) {
|
36099 | var isFunction = getClass.call(object) == functionClass, property, length;
|
36100 | var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;
|
36101 | for (property in object) {
|
36102 |
|
36103 |
|
36104 | if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) {
|
36105 | callback(property);
|
36106 | }
|
36107 | }
|
36108 |
|
36109 | for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));
|
36110 | };
|
36111 | } else if (size == 2) {
|
36112 |
|
36113 | forEach = function (object, callback) {
|
36114 |
|
36115 | var members = {}, isFunction = getClass.call(object) == functionClass, property;
|
36116 | for (property in object) {
|
36117 |
|
36118 |
|
36119 |
|
36120 | if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {
|
36121 | callback(property);
|
36122 | }
|
36123 | }
|
36124 | };
|
36125 | } else {
|
36126 |
|
36127 | forEach = function (object, callback) {
|
36128 | var isFunction = getClass.call(object) == functionClass, property, isConstructor;
|
36129 | for (property in object) {
|
36130 | if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) {
|
36131 | callback(property);
|
36132 | }
|
36133 | }
|
36134 |
|
36135 |
|
36136 | if (isConstructor || isProperty.call(object, (property = "constructor"))) {
|
36137 | callback(property);
|
36138 | }
|
36139 | };
|
36140 | }
|
36141 | return forEach(object, callback);
|
36142 | };
|
36143 |
|
36144 |
|
36145 |
|
36146 |
|
36147 |
|
36148 |
|
36149 |
|
36150 | if (!has("json-stringify")) {
|
36151 |
|
36152 | var Escapes = {
|
36153 | 92: "\\\\",
|
36154 | 34: '\\"',
|
36155 | 8: "\\b",
|
36156 | 12: "\\f",
|
36157 | 10: "\\n",
|
36158 | 13: "\\r",
|
36159 | 9: "\\t"
|
36160 | };
|
36161 |
|
36162 |
|
36163 |
|
36164 | var leadingZeroes = "000000";
|
36165 | var toPaddedString = function (width, value) {
|
36166 |
|
36167 |
|
36168 | return (leadingZeroes + (value || 0)).slice(-width);
|
36169 | };
|
36170 |
|
36171 |
|
36172 |
|
36173 |
|
36174 |
|
36175 | var unicodePrefix = "\\u00";
|
36176 | var quote = function (value) {
|
36177 | var result = '"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;
|
36178 | var symbols = useCharIndex && (charIndexBuggy ? value.split("") : value);
|
36179 | for (; index < length; index++) {
|
36180 | var charCode = value.charCodeAt(index);
|
36181 |
|
36182 |
|
36183 | switch (charCode) {
|
36184 | case 8: case 9: case 10: case 12: case 13: case 34: case 92:
|
36185 | result += Escapes[charCode];
|
36186 | break;
|
36187 | default:
|
36188 | if (charCode < 32) {
|
36189 | result += unicodePrefix + toPaddedString(2, charCode.toString(16));
|
36190 | break;
|
36191 | }
|
36192 | result += useCharIndex ? symbols[index] : value.charAt(index);
|
36193 | }
|
36194 | }
|
36195 | return result + '"';
|
36196 | };
|
36197 |
|
36198 |
|
36199 |
|
36200 | var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
|
36201 | var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;
|
36202 | try {
|
36203 |
|
36204 | value = object[property];
|
36205 | } catch (exception) {}
|
36206 | if (typeof value == "object" && value) {
|
36207 | className = getClass.call(value);
|
36208 | if (className == dateClass && !isProperty.call(value, "toJSON")) {
|
36209 | if (value > -1 / 0 && value < 1 / 0) {
|
36210 |
|
36211 |
|
36212 |
|
36213 | if (getDay) {
|
36214 |
|
36215 |
|
36216 |
|
36217 | date = floor(value / 864e5);
|
36218 | for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);
|
36219 | for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);
|
36220 | date = 1 + date - getDay(year, month);
|
36221 |
|
36222 |
|
36223 |
|
36224 |
|
36225 | time = (value % 864e5 + 864e5) % 864e5;
|
36226 |
|
36227 |
|
36228 | hours = floor(time / 36e5) % 24;
|
36229 | minutes = floor(time / 6e4) % 60;
|
36230 | seconds = floor(time / 1e3) % 60;
|
36231 | milliseconds = time % 1e3;
|
36232 | } else {
|
36233 | year = value.getUTCFullYear();
|
36234 | month = value.getUTCMonth();
|
36235 | date = value.getUTCDate();
|
36236 | hours = value.getUTCHours();
|
36237 | minutes = value.getUTCMinutes();
|
36238 | seconds = value.getUTCSeconds();
|
36239 | milliseconds = value.getUTCMilliseconds();
|
36240 | }
|
36241 |
|
36242 | value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +
|
36243 | "-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) +
|
36244 |
|
36245 |
|
36246 | "T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) +
|
36247 |
|
36248 | "." + toPaddedString(3, milliseconds) + "Z";
|
36249 | } else {
|
36250 | value = null;
|
36251 | }
|
36252 | } else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) {
|
36253 |
|
36254 |
|
36255 |
|
36256 |
|
36257 | value = value.toJSON(property);
|
36258 | }
|
36259 | }
|
36260 | if (callback) {
|
36261 |
|
36262 |
|
36263 | value = callback.call(object, property, value);
|
36264 | }
|
36265 | if (value === null) {
|
36266 | return "null";
|
36267 | }
|
36268 | className = getClass.call(value);
|
36269 | if (className == booleanClass) {
|
36270 |
|
36271 | return "" + value;
|
36272 | } else if (className == numberClass) {
|
36273 |
|
36274 |
|
36275 | return value > -1 / 0 && value < 1 / 0 ? "" + value : "null";
|
36276 | } else if (className == stringClass) {
|
36277 |
|
36278 | return quote("" + value);
|
36279 | }
|
36280 |
|
36281 | if (typeof value == "object") {
|
36282 |
|
36283 |
|
36284 | for (length = stack.length; length--;) {
|
36285 | if (stack[length] === value) {
|
36286 |
|
36287 | throw TypeError();
|
36288 | }
|
36289 | }
|
36290 |
|
36291 | stack.push(value);
|
36292 | results = [];
|
36293 |
|
36294 | prefix = indentation;
|
36295 | indentation += whitespace;
|
36296 | if (className == arrayClass) {
|
36297 |
|
36298 | for (index = 0, length = value.length; index < length; index++) {
|
36299 | element = serialize(index, value, callback, properties, whitespace, indentation, stack);
|
36300 | results.push(element === undef ? "null" : element);
|
36301 | }
|
36302 | result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]";
|
36303 | } else {
|
36304 |
|
36305 |
|
36306 |
|
36307 | forEach(properties || value, function (property) {
|
36308 | var element = serialize(property, value, callback, properties, whitespace, indentation, stack);
|
36309 | if (element !== undef) {
|
36310 |
|
36311 |
|
36312 |
|
36313 |
|
36314 |
|
36315 |
|
36316 | results.push(quote(property) + ":" + (whitespace ? " " : "") + element);
|
36317 | }
|
36318 | });
|
36319 | result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}";
|
36320 | }
|
36321 |
|
36322 | stack.pop();
|
36323 | return result;
|
36324 | }
|
36325 | };
|
36326 |
|
36327 |
|
36328 | exports.stringify = function (source, filter, width) {
|
36329 | var whitespace, callback, properties, className;
|
36330 | if (objectTypes[typeof filter] && filter) {
|
36331 | if ((className = getClass.call(filter)) == functionClass) {
|
36332 | callback = filter;
|
36333 | } else if (className == arrayClass) {
|
36334 |
|
36335 | properties = {};
|
36336 | for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));
|
36337 | }
|
36338 | }
|
36339 | if (width) {
|
36340 | if ((className = getClass.call(width)) == numberClass) {
|
36341 |
|
36342 |
|
36343 | if ((width -= width % 1) > 0) {
|
36344 | for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
|
36345 | }
|
36346 | } else if (className == stringClass) {
|
36347 | whitespace = width.length <= 10 ? width : width.slice(0, 10);
|
36348 | }
|
36349 | }
|
36350 |
|
36351 |
|
36352 |
|
36353 | return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []);
|
36354 | };
|
36355 | }
|
36356 |
|
36357 |
|
36358 | if (!has("json-parse")) {
|
36359 | var fromCharCode = String.fromCharCode;
|
36360 |
|
36361 |
|
36362 |
|
36363 | var Unescapes = {
|
36364 | 92: "\\",
|
36365 | 34: '"',
|
36366 | 47: "/",
|
36367 | 98: "\b",
|
36368 | 116: "\t",
|
36369 | 110: "\n",
|
36370 | 102: "\f",
|
36371 | 114: "\r"
|
36372 | };
|
36373 |
|
36374 |
|
36375 | var Index, Source;
|
36376 |
|
36377 |
|
36378 | var abort = function () {
|
36379 | Index = Source = null;
|
36380 | throw SyntaxError();
|
36381 | };
|
36382 |
|
36383 |
|
36384 |
|
36385 |
|
36386 | var lex = function () {
|
36387 | var source = Source, length = source.length, value, begin, position, isSigned, charCode;
|
36388 | while (Index < length) {
|
36389 | charCode = source.charCodeAt(Index);
|
36390 | switch (charCode) {
|
36391 | case 9: case 10: case 13: case 32:
|
36392 |
|
36393 |
|
36394 | Index++;
|
36395 | break;
|
36396 | case 123: case 125: case 91: case 93: case 58: case 44:
|
36397 |
|
36398 |
|
36399 | value = charIndexBuggy ? source.charAt(Index) : source[Index];
|
36400 | Index++;
|
36401 | return value;
|
36402 | case 34:
|
36403 |
|
36404 |
|
36405 |
|
36406 |
|
36407 | for (value = "@", Index++; Index < length;) {
|
36408 | charCode = source.charCodeAt(Index);
|
36409 | if (charCode < 32) {
|
36410 |
|
36411 |
|
36412 | abort();
|
36413 | } else if (charCode == 92) {
|
36414 |
|
36415 |
|
36416 |
|
36417 | charCode = source.charCodeAt(++Index);
|
36418 | switch (charCode) {
|
36419 | case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:
|
36420 |
|
36421 | value += Unescapes[charCode];
|
36422 | Index++;
|
36423 | break;
|
36424 | case 117:
|
36425 |
|
36426 |
|
36427 |
|
36428 | begin = ++Index;
|
36429 | for (position = Index + 4; Index < position; Index++) {
|
36430 | charCode = source.charCodeAt(Index);
|
36431 |
|
36432 |
|
36433 | if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
|
36434 |
|
36435 | abort();
|
36436 | }
|
36437 | }
|
36438 |
|
36439 | value += fromCharCode("0x" + source.slice(begin, Index));
|
36440 | break;
|
36441 | default:
|
36442 |
|
36443 | abort();
|
36444 | }
|
36445 | } else {
|
36446 | if (charCode == 34) {
|
36447 |
|
36448 |
|
36449 | break;
|
36450 | }
|
36451 | charCode = source.charCodeAt(Index);
|
36452 | begin = Index;
|
36453 |
|
36454 | while (charCode >= 32 && charCode != 92 && charCode != 34) {
|
36455 | charCode = source.charCodeAt(++Index);
|
36456 | }
|
36457 |
|
36458 | value += source.slice(begin, Index);
|
36459 | }
|
36460 | }
|
36461 | if (source.charCodeAt(Index) == 34) {
|
36462 |
|
36463 | Index++;
|
36464 | return value;
|
36465 | }
|
36466 |
|
36467 | abort();
|
36468 | default:
|
36469 |
|
36470 | begin = Index;
|
36471 |
|
36472 | if (charCode == 45) {
|
36473 | isSigned = true;
|
36474 | charCode = source.charCodeAt(++Index);
|
36475 | }
|
36476 |
|
36477 | if (charCode >= 48 && charCode <= 57) {
|
36478 |
|
36479 | if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {
|
36480 |
|
36481 | abort();
|
36482 | }
|
36483 | isSigned = false;
|
36484 |
|
36485 | for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);
|
36486 |
|
36487 |
|
36488 | if (source.charCodeAt(Index) == 46) {
|
36489 | position = ++Index;
|
36490 |
|
36491 | for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
|
36492 | if (position == Index) {
|
36493 |
|
36494 | abort();
|
36495 | }
|
36496 | Index = position;
|
36497 | }
|
36498 |
|
36499 |
|
36500 | charCode = source.charCodeAt(Index);
|
36501 | if (charCode == 101 || charCode == 69) {
|
36502 | charCode = source.charCodeAt(++Index);
|
36503 |
|
36504 |
|
36505 | if (charCode == 43 || charCode == 45) {
|
36506 | Index++;
|
36507 | }
|
36508 |
|
36509 | for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
|
36510 | if (position == Index) {
|
36511 |
|
36512 | abort();
|
36513 | }
|
36514 | Index = position;
|
36515 | }
|
36516 |
|
36517 | return +source.slice(begin, Index);
|
36518 | }
|
36519 |
|
36520 | if (isSigned) {
|
36521 | abort();
|
36522 | }
|
36523 |
|
36524 | if (source.slice(Index, Index + 4) == "true") {
|
36525 | Index += 4;
|
36526 | return true;
|
36527 | } else if (source.slice(Index, Index + 5) == "false") {
|
36528 | Index += 5;
|
36529 | return false;
|
36530 | } else if (source.slice(Index, Index + 4) == "null") {
|
36531 | Index += 4;
|
36532 | return null;
|
36533 | }
|
36534 |
|
36535 | abort();
|
36536 | }
|
36537 | }
|
36538 |
|
36539 |
|
36540 | return "$";
|
36541 | };
|
36542 |
|
36543 |
|
36544 | var get = function (value) {
|
36545 | var results, hasMembers;
|
36546 | if (value == "$") {
|
36547 |
|
36548 | abort();
|
36549 | }
|
36550 | if (typeof value == "string") {
|
36551 | if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") {
|
36552 |
|
36553 | return value.slice(1);
|
36554 | }
|
36555 |
|
36556 | if (value == "[") {
|
36557 |
|
36558 | results = [];
|
36559 | for (;; hasMembers || (hasMembers = true)) {
|
36560 | value = lex();
|
36561 |
|
36562 | if (value == "]") {
|
36563 | break;
|
36564 | }
|
36565 |
|
36566 |
|
36567 |
|
36568 | if (hasMembers) {
|
36569 | if (value == ",") {
|
36570 | value = lex();
|
36571 | if (value == "]") {
|
36572 |
|
36573 | abort();
|
36574 | }
|
36575 | } else {
|
36576 |
|
36577 | abort();
|
36578 | }
|
36579 | }
|
36580 |
|
36581 | if (value == ",") {
|
36582 | abort();
|
36583 | }
|
36584 | results.push(get(value));
|
36585 | }
|
36586 | return results;
|
36587 | } else if (value == "{") {
|
36588 |
|
36589 | results = {};
|
36590 | for (;; hasMembers || (hasMembers = true)) {
|
36591 | value = lex();
|
36592 |
|
36593 | if (value == "}") {
|
36594 | break;
|
36595 | }
|
36596 |
|
36597 |
|
36598 | if (hasMembers) {
|
36599 | if (value == ",") {
|
36600 | value = lex();
|
36601 | if (value == "}") {
|
36602 |
|
36603 | abort();
|
36604 | }
|
36605 | } else {
|
36606 |
|
36607 | abort();
|
36608 | }
|
36609 | }
|
36610 |
|
36611 |
|
36612 |
|
36613 | if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") {
|
36614 | abort();
|
36615 | }
|
36616 | results[value.slice(1)] = get(lex());
|
36617 | }
|
36618 | return results;
|
36619 | }
|
36620 | // Unexpected token encountered.
|
36621 | abort();
|
36622 | }
|
36623 | return value;
|
36624 | };
|
36625 |
|
36626 | // Internal: Updates a traversed object member.
|
36627 | var update = function (source, property, callback) {
|
36628 | var element = walk(source, property, callback);
|
36629 | if (element === undef) {
|
36630 | delete source[property];
|
36631 | } else {
|
36632 | source[property] = element;
|
36633 | }
|
36634 | };
|
36635 |
|
36636 |
|
36637 |
|
36638 |
|
36639 | var walk = function (source, property, callback) {
|
36640 | var value = source[property], length;
|
36641 | if (typeof value == "object" && value) {
|
36642 |
|
36643 |
|
36644 |
|
36645 | if (getClass.call(value) == arrayClass) {
|
36646 | for (length = value.length; length--;) {
|
36647 | update(value, length, callback);
|
36648 | }
|
36649 | } else {
|
36650 | forEach(value, function (property) {
|
36651 | update(value, property, callback);
|
36652 | });
|
36653 | }
|
36654 | }
|
36655 | return callback.call(source, property, value);
|
36656 | };
|
36657 |
|
36658 |
|
36659 | exports.parse = function (source, callback) {
|
36660 | var result, value;
|
36661 | Index = 0;
|
36662 | Source = "" + source;
|
36663 | result = get(lex());
|
36664 | // If a JSON string contains multiple tokens, it is invalid.
|
36665 | if (lex() != "$") {
|
36666 | abort();
|
36667 | }
|
36668 |
|
36669 | Index = Source = null;
|
36670 | return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result;
|
36671 | };
|
36672 | }
|
36673 | }
|
36674 |
|
36675 | exports["runInContext"] = runInContext;
|
36676 | return exports;
|
36677 | }
|
36678 |
|
36679 | if (freeExports && !isLoader) {
|
36680 |
|
36681 | runInContext(root, freeExports);
|
36682 | } else {
|
36683 |
|
36684 | var nativeJSON = root.JSON,
|
36685 | previousJSON = root["JSON3"],
|
36686 | isRestored = false;
|
36687 |
|
36688 | var JSON3 = runInContext(root, (root["JSON3"] = {
|
36689 |
|
36690 |
|
36691 | "noConflict": function () {
|
36692 | if (!isRestored) {
|
36693 | isRestored = true;
|
36694 | root.JSON = nativeJSON;
|
36695 | root["JSON3"] = previousJSON;
|
36696 | nativeJSON = previousJSON = null;
|
36697 | }
|
36698 | return JSON3;
|
36699 | }
|
36700 | }));
|
36701 |
|
36702 | root.JSON = {
|
36703 | "parse": JSON3.parse,
|
36704 | "stringify": JSON3.stringify
|
36705 | };
|
36706 | }
|
36707 |
|
36708 |
|
36709 | if (isLoader) {
|
36710 | define(function () {
|
36711 | return JSON3;
|
36712 | });
|
36713 | }
|
36714 | }).call(this);
|
36715 |
|
36716 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
36717 | },{}],331:[function(require,module,exports){
|
36718 | 'use strict';
|
36719 | module.exports = function (str) {
|
36720 | return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
36721 | return '%' + c.charCodeAt(0).toString(16).toUpperCase();
|
36722 | });
|
36723 | };
|
36724 |
|
36725 | },{}],332:[function(require,module,exports){
|
36726 | var minimist = require(85);
|
36727 |
|
36728 | module.exports = function parse (args, opts) {
|
36729 | var level = 0, index;
|
36730 | var args_ = [];
|
36731 |
|
36732 | for (var i = 0; i < args.length; i++) {
|
36733 | if (typeof args[i] === 'string' && /^\[/.test(args[i])) {
|
36734 | if (level ++ === 0) {
|
36735 | index = i;
|
36736 | }
|
36737 | }
|
36738 | if (typeof args[i] === 'string' && /\]$/.test(args[i])) {
|
36739 | if (-- level > 0) continue;
|
36740 |
|
36741 | var sub = args.slice(index, i + 1);
|
36742 | if (typeof sub[0] === 'string') {
|
36743 | sub[0] = sub[0].replace(/^\[/, '');
|
36744 | }
|
36745 | if (sub[0] === '') sub.shift();
|
36746 |
|
36747 | var n = sub.length - 1;
|
36748 | if (typeof sub[n] === 'string') {
|
36749 | sub[n] = sub[n].replace(/\]$/, '');
|
36750 | }
|
36751 | if (sub[n] === '') sub.pop();
|
36752 |
|
36753 | args_.push(parse(sub));
|
36754 | }
|
36755 | else if (level === 0) args_.push(args[i]);
|
36756 | }
|
36757 |
|
36758 | var argv = minimist(args_, opts);
|
36759 | return argv;
|
36760 | };
|
36761 |
|
36762 | },{"85":85}],333:[function(require,module,exports){
|
36763 | module.exports = toArray
|
36764 |
|
36765 | function toArray(list, index) {
|
36766 | var array = []
|
36767 |
|
36768 | index = index || 0
|
36769 |
|
36770 | for (var i = index || 0; i < list.length; i++) {
|
36771 | array[i - index] = list[i]
|
36772 | }
|
36773 |
|
36774 | return array
|
36775 | }
|
36776 |
|
36777 | },{}],334:[function(require,module,exports){
|
36778 |
|
36779 |
|
36780 |
|
36781 |
|
36782 |
|
36783 |
|
36784 |
|
36785 |
|
36786 |
|
36787 |
|
36788 |
|
36789 |
|
36790 |
|
36791 |
|
36792 |
|
36793 |
|
36794 |
|
36795 |
|
36796 |
|
36797 |
|
36798 |
|
36799 | 'use strict';
|
36800 |
|
36801 | var punycode = require(92);
|
36802 | var util = require(335);
|
36803 |
|
36804 | exports.parse = urlParse;
|
36805 | exports.resolve = urlResolve;
|
36806 | exports.resolveObject = urlResolveObject;
|
36807 | exports.format = urlFormat;
|
36808 |
|
36809 | exports.Url = Url;
|
36810 |
|
36811 | function Url() {
|
36812 | this.protocol = null;
|
36813 | this.slashes = null;
|
36814 | this.auth = null;
|
36815 | this.host = null;
|
36816 | this.port = null;
|
36817 | this.hostname = null;
|
36818 | this.hash = null;
|
36819 | this.search = null;
|
36820 | this.query = null;
|
36821 | this.pathname = null;
|
36822 | this.path = null;
|
36823 | this.href = null;
|
36824 | }
|
36825 |
|
36826 |
|
36827 |
|
36828 |
|
36829 |
|
36830 | var protocolPattern = /^([a-z0-9.+-]+:)/i,
|
36831 | portPattern = /:[0-9]*$/,
|
36832 |
|
36833 |
|
36834 | simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
36835 |
|
36836 |
|
36837 |
|
36838 | delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
|
36839 |
|
36840 |
|
36841 | unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
|
36842 |
|
36843 |
|
36844 | autoEscape = ['\''].concat(unwise),
|
36845 |
|
36846 |
|
36847 |
|
36848 |
|
36849 | nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
|
36850 | hostEndingChars = ['/', '?', '#'],
|
36851 | hostnameMaxLen = 255,
|
36852 | hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
|
36853 | hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
36854 |
|
36855 | unsafeProtocol = {
|
36856 | 'javascript': true,
|
36857 | 'javascript:': true
|
36858 | },
|
36859 |
|
36860 | hostlessProtocol = {
|
36861 | 'javascript': true,
|
36862 | 'javascript:': true
|
36863 | },
|
36864 |
|
36865 | slashedProtocol = {
|
36866 | 'http': true,
|
36867 | 'https': true,
|
36868 | 'ftp': true,
|
36869 | 'gopher': true,
|
36870 | 'file': true,
|
36871 | 'http:': true,
|
36872 | 'https:': true,
|
36873 | 'ftp:': true,
|
36874 | 'gopher:': true,
|
36875 | 'file:': true
|
36876 | },
|
36877 | querystring = require(96);
|
36878 |
|
36879 | function urlParse(url, parseQueryString, slashesDenoteHost) {
|
36880 | if (url && util.isObject(url) && url instanceof Url) return url;
|
36881 |
|
36882 | var u = new Url;
|
36883 | u.parse(url, parseQueryString, slashesDenoteHost);
|
36884 | return u;
|
36885 | }
|
36886 |
|
36887 | Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
36888 | if (!util.isString(url)) {
|
36889 | throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
|
36890 | }
|
36891 |
|
36892 |
|
36893 |
|
36894 |
|
36895 | var queryIndex = url.indexOf('?'),
|
36896 | splitter =
|
36897 | (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
|
36898 | uSplit = url.split(splitter),
|
36899 | slashRegex = /\\/g;
|
36900 | uSplit[0] = uSplit[0].replace(slashRegex, '/');
|
36901 | url = uSplit.join(splitter);
|
36902 |
|
36903 | var rest = url;
|
36904 |
|
36905 |
|
36906 |
|
36907 | rest = rest.trim();
|
36908 |
|
36909 | if (!slashesDenoteHost && url.split('#').length === 1) {
|
36910 |
|
36911 | var simplePath = simplePathPattern.exec(rest);
|
36912 | if (simplePath) {
|
36913 | this.path = rest;
|
36914 | this.href = rest;
|
36915 | this.pathname = simplePath[1];
|
36916 | if (simplePath[2]) {
|
36917 | this.search = simplePath[2];
|
36918 | if (parseQueryString) {
|
36919 | this.query = querystring.parse(this.search.substr(1));
|
36920 | } else {
|
36921 | this.query = this.search.substr(1);
|
36922 | }
|
36923 | } else if (parseQueryString) {
|
36924 | this.search = '';
|
36925 | this.query = {};
|
36926 | }
|
36927 | return this;
|
36928 | }
|
36929 | }
|
36930 |
|
36931 | var proto = protocolPattern.exec(rest);
|
36932 | if (proto) {
|
36933 | proto = proto[0];
|
36934 | var lowerProto = proto.toLowerCase();
|
36935 | this.protocol = lowerProto;
|
36936 | rest = rest.substr(proto.length);
|
36937 | }
|
36938 |
|
36939 |
|
36940 |
|
36941 |
|
36942 |
|
36943 | if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
36944 | var slashes = rest.substr(0, 2) === '//';
|
36945 | if (slashes && !(proto && hostlessProtocol[proto])) {
|
36946 | rest = rest.substr(2);
|
36947 | this.slashes = true;
|
36948 | }
|
36949 | }
|
36950 |
|
36951 | if (!hostlessProtocol[proto] &&
|
36952 | (slashes || (proto && !slashedProtocol[proto]))) {
|
36953 |
|
36954 |
|
36955 |
|
36956 |
|
36957 |
|
36958 |
|
36959 |
|
36960 |
|
36961 |
|
36962 |
|
36963 |
|
36964 |
|
36965 |
|
36966 |
|
36967 |
|
36968 |
|
36969 |
|
36970 | var hostEnd = -1;
|
36971 | for (var i = 0; i < hostEndingChars.length; i++) {
|
36972 | var hec = rest.indexOf(hostEndingChars[i]);
|
36973 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
36974 | hostEnd = hec;
|
36975 | }
|
36976 |
|
36977 |
|
36978 |
|
36979 | var auth, atSign;
|
36980 | if (hostEnd === -1) {
|
36981 |
|
36982 | atSign = rest.lastIndexOf('@');
|
36983 | } else {
|
36984 |
|
36985 |
|
36986 | atSign = rest.lastIndexOf('@', hostEnd);
|
36987 | }
|
36988 |
|
36989 |
|
36990 |
|
36991 | if (atSign !== -1) {
|
36992 | auth = rest.slice(0, atSign);
|
36993 | rest = rest.slice(atSign + 1);
|
36994 | this.auth = decodeURIComponent(auth);
|
36995 | }
|
36996 |
|
36997 |
|
36998 | hostEnd = -1;
|
36999 | for (var i = 0; i < nonHostChars.length; i++) {
|
37000 | var hec = rest.indexOf(nonHostChars[i]);
|
37001 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
37002 | hostEnd = hec;
|
37003 | }
|
37004 |
|
37005 | if (hostEnd === -1)
|
37006 | hostEnd = rest.length;
|
37007 |
|
37008 | this.host = rest.slice(0, hostEnd);
|
37009 | rest = rest.slice(hostEnd);
|
37010 |
|
37011 |
|
37012 | this.parseHost();
|
37013 |
|
37014 |
|
37015 |
|
37016 | this.hostname = this.hostname || '';
|
37017 |
|
37018 |
|
37019 |
|
37020 | var ipv6Hostname = this.hostname[0] === '[' &&
|
37021 | this.hostname[this.hostname.length - 1] === ']';
|
37022 |
|
37023 |
|
37024 | if (!ipv6Hostname) {
|
37025 | var hostparts = this.hostname.split(/\./);
|
37026 | for (var i = 0, l = hostparts.length; i < l; i++) {
|
37027 | var part = hostparts[i];
|
37028 | if (!part) continue;
|
37029 | if (!part.match(hostnamePartPattern)) {
|
37030 | var newpart = '';
|
37031 | for (var j = 0, k = part.length; j < k; j++) {
|
37032 | if (part.charCodeAt(j) > 127) {
|
37033 |
|
37034 |
|
37035 |
|
37036 | newpart += 'x';
|
37037 | } else {
|
37038 | newpart += part[j];
|
37039 | }
|
37040 | }
|
37041 |
|
37042 | if (!newpart.match(hostnamePartPattern)) {
|
37043 | var validParts = hostparts.slice(0, i);
|
37044 | var notHost = hostparts.slice(i + 1);
|
37045 | var bit = part.match(hostnamePartStart);
|
37046 | if (bit) {
|
37047 | validParts.push(bit[1]);
|
37048 | notHost.unshift(bit[2]);
|
37049 | }
|
37050 | if (notHost.length) {
|
37051 | rest = '/' + notHost.join('.') + rest;
|
37052 | }
|
37053 | this.hostname = validParts.join('.');
|
37054 | break;
|
37055 | }
|
37056 | }
|
37057 | }
|
37058 | }
|
37059 |
|
37060 | if (this.hostname.length > hostnameMaxLen) {
|
37061 | this.hostname = '';
|
37062 | } else {
|
37063 |
|
37064 | this.hostname = this.hostname.toLowerCase();
|
37065 | }
|
37066 |
|
37067 | if (!ipv6Hostname) {
|
37068 |
|
37069 |
|
37070 |
|
37071 |
|
37072 | this.hostname = punycode.toASCII(this.hostname);
|
37073 | }
|
37074 |
|
37075 | var p = this.port ? ':' + this.port : '';
|
37076 | var h = this.hostname || '';
|
37077 | this.host = h + p;
|
37078 | this.href += this.host;
|
37079 |
|
37080 |
|
37081 |
|
37082 | if (ipv6Hostname) {
|
37083 | this.hostname = this.hostname.substr(1, this.hostname.length - 2);
|
37084 | if (rest[0] !== '/') {
|
37085 | rest = '/' + rest;
|
37086 | }
|
37087 | }
|
37088 | }
|
37089 |
|
37090 |
|
37091 |
|
37092 | if (!unsafeProtocol[lowerProto]) {
|
37093 |
|
37094 |
|
37095 |
|
37096 |
|
37097 | for (var i = 0, l = autoEscape.length; i < l; i++) {
|
37098 | var ae = autoEscape[i];
|
37099 | if (rest.indexOf(ae) === -1)
|
37100 | continue;
|
37101 | var esc = encodeURIComponent(ae);
|
37102 | if (esc === ae) {
|
37103 | esc = escape(ae);
|
37104 | }
|
37105 | rest = rest.split(ae).join(esc);
|
37106 | }
|
37107 | }
|
37108 |
|
37109 |
|
37110 |
|
37111 | var hash = rest.indexOf('#');
|
37112 | if (hash !== -1) {
|
37113 |
|
37114 | this.hash = rest.substr(hash);
|
37115 | rest = rest.slice(0, hash);
|
37116 | }
|
37117 | var qm = rest.indexOf('?');
|
37118 | if (qm !== -1) {
|
37119 | this.search = rest.substr(qm);
|
37120 | this.query = rest.substr(qm + 1);
|
37121 | if (parseQueryString) {
|
37122 | this.query = querystring.parse(this.query);
|
37123 | }
|
37124 | rest = rest.slice(0, qm);
|
37125 | } else if (parseQueryString) {
|
37126 |
|
37127 | this.search = '';
|
37128 | this.query = {};
|
37129 | }
|
37130 | if (rest) this.pathname = rest;
|
37131 | if (slashedProtocol[lowerProto] &&
|
37132 | this.hostname && !this.pathname) {
|
37133 | this.pathname = '/';
|
37134 | }
|
37135 |
|
37136 |
|
37137 | if (this.pathname || this.search) {
|
37138 | var p = this.pathname || '';
|
37139 | var s = this.search || '';
|
37140 | this.path = p + s;
|
37141 | }
|
37142 |
|
37143 |
|
37144 | this.href = this.format();
|
37145 | return this;
|
37146 | };
|
37147 |
|
37148 |
|
37149 | function urlFormat(obj) {
|
37150 |
|
37151 |
|
37152 |
|
37153 |
|
37154 | if (util.isString(obj)) obj = urlParse(obj);
|
37155 | if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
|
37156 | return obj.format();
|
37157 | }
|
37158 |
|
37159 | Url.prototype.format = function() {
|
37160 | var auth = this.auth || '';
|
37161 | if (auth) {
|
37162 | auth = encodeURIComponent(auth);
|
37163 | auth = auth.replace(/%3A/i, ':');
|
37164 | auth += '@';
|
37165 | }
|
37166 |
|
37167 | var protocol = this.protocol || '',
|
37168 | pathname = this.pathname || '',
|
37169 | hash = this.hash || '',
|
37170 | host = false,
|
37171 | query = '';
|
37172 |
|
37173 | if (this.host) {
|
37174 | host = auth + this.host;
|
37175 | } else if (this.hostname) {
|
37176 | host = auth + (this.hostname.indexOf(':') === -1 ?
|
37177 | this.hostname :
|
37178 | '[' + this.hostname + ']');
|
37179 | if (this.port) {
|
37180 | host += ':' + this.port;
|
37181 | }
|
37182 | }
|
37183 |
|
37184 | if (this.query &&
|
37185 | util.isObject(this.query) &&
|
37186 | Object.keys(this.query).length) {
|
37187 | query = querystring.stringify(this.query);
|
37188 | }
|
37189 |
|
37190 | var search = this.search || (query && ('?' + query)) || '';
|
37191 |
|
37192 | if (protocol && protocol.substr(-1) !== ':') protocol += ':';
|
37193 |
|
37194 |
|
37195 |
|
37196 | if (this.slashes ||
|
37197 | (!protocol || slashedProtocol[protocol]) && host !== false) {
|
37198 | host = '//' + (host || '');
|
37199 | if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
|
37200 | } else if (!host) {
|
37201 | host = '';
|
37202 | }
|
37203 |
|
37204 | if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
|
37205 | if (search && search.charAt(0) !== '?') search = '?' + search;
|
37206 |
|
37207 | pathname = pathname.replace(/[?#]/g, function(match) {
|
37208 | return encodeURIComponent(match);
|
37209 | });
|
37210 | search = search.replace('#', '%23');
|
37211 |
|
37212 | return protocol + host + pathname + search + hash;
|
37213 | };
|
37214 |
|
37215 | function urlResolve(source, relative) {
|
37216 | return urlParse(source, false, true).resolve(relative);
|
37217 | }
|
37218 |
|
37219 | Url.prototype.resolve = function(relative) {
|
37220 | return this.resolveObject(urlParse(relative, false, true)).format();
|
37221 | };
|
37222 |
|
37223 | function urlResolveObject(source, relative) {
|
37224 | if (!source) return relative;
|
37225 | return urlParse(source, false, true).resolveObject(relative);
|
37226 | }
|
37227 |
|
37228 | Url.prototype.resolveObject = function(relative) {
|
37229 | if (util.isString(relative)) {
|
37230 | var rel = new Url();
|
37231 | rel.parse(relative, false, true);
|
37232 | relative = rel;
|
37233 | }
|
37234 |
|
37235 | var result = new Url();
|
37236 | var tkeys = Object.keys(this);
|
37237 | for (var tk = 0; tk < tkeys.length; tk++) {
|
37238 | var tkey = tkeys[tk];
|
37239 | result[tkey] = this[tkey];
|
37240 | }
|
37241 |
|
37242 |
|
37243 |
|
37244 | result.hash = relative.hash;
|
37245 |
|
37246 |
|
37247 | if (relative.href === '') {
|
37248 | result.href = result.format();
|
37249 | return result;
|
37250 | }
|
37251 |
|
37252 |
|
37253 | if (relative.slashes && !relative.protocol) {
|
37254 |
|
37255 | var rkeys = Object.keys(relative);
|
37256 | for (var rk = 0; rk < rkeys.length; rk++) {
|
37257 | var rkey = rkeys[rk];
|
37258 | if (rkey !== 'protocol')
|
37259 | result[rkey] = relative[rkey];
|
37260 | }
|
37261 |
|
37262 |
|
37263 | if (slashedProtocol[result.protocol] &&
|
37264 | result.hostname && !result.pathname) {
|
37265 | result.path = result.pathname = '/';
|
37266 | }
|
37267 |
|
37268 | result.href = result.format();
|
37269 | return result;
|
37270 | }
|
37271 |
|
37272 | if (relative.protocol && relative.protocol !== result.protocol) {
|
37273 |
|
37274 |
|
37275 |
|
37276 |
|
37277 |
|
37278 |
|
37279 |
|
37280 |
|
37281 | if (!slashedProtocol[relative.protocol]) {
|
37282 | var keys = Object.keys(relative);
|
37283 | for (var v = 0; v < keys.length; v++) {
|
37284 | var k = keys[v];
|
37285 | result[k] = relative[k];
|
37286 | }
|
37287 | result.href = result.format();
|
37288 | return result;
|
37289 | }
|
37290 |
|
37291 | result.protocol = relative.protocol;
|
37292 | if (!relative.host && !hostlessProtocol[relative.protocol]) {
|
37293 | var relPath = (relative.pathname || '').split('/');
|
37294 | while (relPath.length && !(relative.host = relPath.shift()));
|
37295 | if (!relative.host) relative.host = '';
|
37296 | if (!relative.hostname) relative.hostname = '';
|
37297 | if (relPath[0] !== '') relPath.unshift('');
|
37298 | if (relPath.length < 2) relPath.unshift('');
|
37299 | result.pathname = relPath.join('/');
|
37300 | } else {
|
37301 | result.pathname = relative.pathname;
|
37302 | }
|
37303 | result.search = relative.search;
|
37304 | result.query = relative.query;
|
37305 | result.host = relative.host || '';
|
37306 | result.auth = relative.auth;
|
37307 | result.hostname = relative.hostname || relative.host;
|
37308 | result.port = relative.port;
|
37309 |
|
37310 | if (result.pathname || result.search) {
|
37311 | var p = result.pathname || '';
|
37312 | var s = result.search || '';
|
37313 | result.path = p + s;
|
37314 | }
|
37315 | result.slashes = result.slashes || relative.slashes;
|
37316 | result.href = result.format();
|
37317 | return result;
|
37318 | }
|
37319 |
|
37320 | var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
|
37321 | isRelAbs = (
|
37322 | relative.host ||
|
37323 | relative.pathname && relative.pathname.charAt(0) === '/'
|
37324 | ),
|
37325 | mustEndAbs = (isRelAbs || isSourceAbs ||
|
37326 | (result.host && relative.pathname)),
|
37327 | removeAllDots = mustEndAbs,
|
37328 | srcPath = result.pathname && result.pathname.split('/') || [],
|
37329 | relPath = relative.pathname && relative.pathname.split('/') || [],
|
37330 | psychotic = result.protocol && !slashedProtocol[result.protocol];
|
37331 |
|
37332 |
|
37333 |
|
37334 |
|
37335 |
|
37336 |
|
37337 | if (psychotic) {
|
37338 | result.hostname = '';
|
37339 | result.port = null;
|
37340 | if (result.host) {
|
37341 | if (srcPath[0] === '') srcPath[0] = result.host;
|
37342 | else srcPath.unshift(result.host);
|
37343 | }
|
37344 | result.host = '';
|
37345 | if (relative.protocol) {
|
37346 | relative.hostname = null;
|
37347 | relative.port = null;
|
37348 | if (relative.host) {
|
37349 | if (relPath[0] === '') relPath[0] = relative.host;
|
37350 | else relPath.unshift(relative.host);
|
37351 | }
|
37352 | relative.host = null;
|
37353 | }
|
37354 | mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
|
37355 | }
|
37356 |
|
37357 | if (isRelAbs) {
|
37358 |
|
37359 | result.host = (relative.host || relative.host === '') ?
|
37360 | relative.host : result.host;
|
37361 | result.hostname = (relative.hostname || relative.hostname === '') ?
|
37362 | relative.hostname : result.hostname;
|
37363 | result.search = relative.search;
|
37364 | result.query = relative.query;
|
37365 | srcPath = relPath;
|
37366 |
|
37367 | } else if (relPath.length) {
|
37368 |
|
37369 |
|
37370 | if (!srcPath) srcPath = [];
|
37371 | srcPath.pop();
|
37372 | srcPath = srcPath.concat(relPath);
|
37373 | result.search = relative.search;
|
37374 | result.query = relative.query;
|
37375 | } else if (!util.isNullOrUndefined(relative.search)) {
|
37376 |
|
37377 |
|
37378 |
|
37379 | if (psychotic) {
|
37380 | result.hostname = result.host = srcPath.shift();
|
37381 |
|
37382 |
|
37383 |
|
37384 | var authInHost = result.host && result.host.indexOf('@') > 0 ?
|
37385 | result.host.split('@') : false;
|
37386 | if (authInHost) {
|
37387 | result.auth = authInHost.shift();
|
37388 | result.host = result.hostname = authInHost.shift();
|
37389 | }
|
37390 | }
|
37391 | result.search = relative.search;
|
37392 | result.query = relative.query;
|
37393 |
|
37394 | if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
37395 | result.path = (result.pathname ? result.pathname : '') +
|
37396 | (result.search ? result.search : '');
|
37397 | }
|
37398 | result.href = result.format();
|
37399 | return result;
|
37400 | }
|
37401 |
|
37402 | if (!srcPath.length) {
|
37403 |
|
37404 |
|
37405 | result.pathname = null;
|
37406 |
|
37407 | if (result.search) {
|
37408 | result.path = '/' + result.search;
|
37409 | } else {
|
37410 | result.path = null;
|
37411 | }
|
37412 | result.href = result.format();
|
37413 | return result;
|
37414 | }
|
37415 |
|
37416 |
|
37417 |
|
37418 |
|
37419 | var last = srcPath.slice(-1)[0];
|
37420 | var hasTrailingSlash = (
|
37421 | (result.host || relative.host || srcPath.length > 1) &&
|
37422 | (last === '.' || last === '..') || last === '');
|
37423 |
|
37424 |
|
37425 |
|
37426 | var up = 0;
|
37427 | for (var i = srcPath.length; i >= 0; i--) {
|
37428 | last = srcPath[i];
|
37429 | if (last === '.') {
|
37430 | srcPath.splice(i, 1);
|
37431 | } else if (last === '..') {
|
37432 | srcPath.splice(i, 1);
|
37433 | up++;
|
37434 | } else if (up) {
|
37435 | srcPath.splice(i, 1);
|
37436 | up--;
|
37437 | }
|
37438 | }
|
37439 |
|
37440 |
|
37441 | if (!mustEndAbs && !removeAllDots) {
|
37442 | for (; up--; up) {
|
37443 | srcPath.unshift('..');
|
37444 | }
|
37445 | }
|
37446 |
|
37447 | if (mustEndAbs && srcPath[0] !== '' &&
|
37448 | (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
|
37449 | srcPath.unshift('');
|
37450 | }
|
37451 |
|
37452 | if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
|
37453 | srcPath.push('');
|
37454 | }
|
37455 |
|
37456 | var isAbsolute = srcPath[0] === '' ||
|
37457 | (srcPath[0] && srcPath[0].charAt(0) === '/');
|
37458 |
|
37459 |
|
37460 | if (psychotic) {
|
37461 | result.hostname = result.host = isAbsolute ? '' :
|
37462 | srcPath.length ? srcPath.shift() : '';
|
37463 |
|
37464 |
|
37465 |
|
37466 | var authInHost = result.host && result.host.indexOf('@') > 0 ?
|
37467 | result.host.split('@') : false;
|
37468 | if (authInHost) {
|
37469 | result.auth = authInHost.shift();
|
37470 | result.host = result.hostname = authInHost.shift();
|
37471 | }
|
37472 | }
|
37473 |
|
37474 | mustEndAbs = mustEndAbs || (result.host && srcPath.length);
|
37475 |
|
37476 | if (mustEndAbs && !isAbsolute) {
|
37477 | srcPath.unshift('');
|
37478 | }
|
37479 |
|
37480 | if (!srcPath.length) {
|
37481 | result.pathname = null;
|
37482 | result.path = null;
|
37483 | } else {
|
37484 | result.pathname = srcPath.join('/');
|
37485 | }
|
37486 |
|
37487 |
|
37488 | if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
37489 | result.path = (result.pathname ? result.pathname : '') +
|
37490 | (result.search ? result.search : '');
|
37491 | }
|
37492 | result.auth = relative.auth || result.auth;
|
37493 | result.slashes = result.slashes || relative.slashes;
|
37494 | result.href = result.format();
|
37495 | return result;
|
37496 | };
|
37497 |
|
37498 | Url.prototype.parseHost = function() {
|
37499 | var host = this.host;
|
37500 | var port = portPattern.exec(host);
|
37501 | if (port) {
|
37502 | port = port[0];
|
37503 | if (port !== ':') {
|
37504 | this.port = port.substr(1);
|
37505 | }
|
37506 | host = host.substr(0, host.length - port.length);
|
37507 | }
|
37508 | if (host) this.hostname = host;
|
37509 | };
|
37510 |
|
37511 | },{"335":335,"92":92,"96":96}],335:[function(require,module,exports){
|
37512 | 'use strict';
|
37513 |
|
37514 | module.exports = {
|
37515 | isString: function(arg) {
|
37516 | return typeof(arg) === 'string';
|
37517 | },
|
37518 | isObject: function(arg) {
|
37519 | return typeof(arg) === 'object' && arg !== null;
|
37520 | },
|
37521 | isNull: function(arg) {
|
37522 | return arg === null;
|
37523 | },
|
37524 | isNullOrUndefined: function(arg) {
|
37525 | return arg == null;
|
37526 | }
|
37527 | };
|
37528 |
|
37529 | },{}],336:[function(require,module,exports){
|
37530 | (function (global){
|
37531 |
|
37532 | ;(function(root) {
|
37533 |
|
37534 |
|
37535 | var freeExports = typeof exports == 'object' && exports;
|
37536 |
|
37537 |
|
37538 | var freeModule = typeof module == 'object' && module &&
|
37539 | module.exports == freeExports && module;
|
37540 |
|
37541 |
|
37542 |
|
37543 | var freeGlobal = typeof global == 'object' && global;
|
37544 | if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
37545 | root = freeGlobal;
|
37546 | }
|
37547 |
|
37548 |
|
37549 |
|
37550 | var stringFromCharCode = String.fromCharCode;
|
37551 |
|
37552 |
|
37553 | function ucs2decode(string) {
|
37554 | var output = [];
|
37555 | var counter = 0;
|
37556 | var length = string.length;
|
37557 | var value;
|
37558 | var extra;
|
37559 | while (counter < length) {
|
37560 | value = string.charCodeAt(counter++);
|
37561 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
37562 |
|
37563 | extra = string.charCodeAt(counter++);
|
37564 | if ((extra & 0xFC00) == 0xDC00) {
|
37565 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
37566 | } else {
|
37567 |
|
37568 |
|
37569 | output.push(value);
|
37570 | counter--;
|
37571 | }
|
37572 | } else {
|
37573 | output.push(value);
|
37574 | }
|
37575 | }
|
37576 | return output;
|
37577 | }
|
37578 |
|
37579 |
|
37580 | function ucs2encode(array) {
|
37581 | var length = array.length;
|
37582 | var index = -1;
|
37583 | var value;
|
37584 | var output = '';
|
37585 | while (++index < length) {
|
37586 | value = array[index];
|
37587 | if (value > 0xFFFF) {
|
37588 | value -= 0x10000;
|
37589 | output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
|
37590 | value = 0xDC00 | value & 0x3FF;
|
37591 | }
|
37592 | output += stringFromCharCode(value);
|
37593 | }
|
37594 | return output;
|
37595 | }
|
37596 |
|
37597 | function checkScalarValue(codePoint) {
|
37598 | if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
|
37599 | throw Error(
|
37600 | 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
|
37601 | ' is not a scalar value'
|
37602 | );
|
37603 | }
|
37604 | }
|
37605 |
|
37606 |
|
37607 | function createByte(codePoint, shift) {
|
37608 | return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
|
37609 | }
|
37610 |
|
37611 | function encodeCodePoint(codePoint) {
|
37612 | if ((codePoint & 0xFFFFFF80) == 0) {
|
37613 | return stringFromCharCode(codePoint);
|
37614 | }
|
37615 | var symbol = '';
|
37616 | if ((codePoint & 0xFFFFF800) == 0) {
|
37617 | symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
|
37618 | }
|
37619 | else if ((codePoint & 0xFFFF0000) == 0) {
|
37620 | checkScalarValue(codePoint);
|
37621 | symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
|
37622 | symbol += createByte(codePoint, 6);
|
37623 | }
|
37624 | else if ((codePoint & 0xFFE00000) == 0) {
|
37625 | symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
|
37626 | symbol += createByte(codePoint, 12);
|
37627 | symbol += createByte(codePoint, 6);
|
37628 | }
|
37629 | symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
|
37630 | return symbol;
|
37631 | }
|
37632 |
|
37633 | function utf8encode(string) {
|
37634 | var codePoints = ucs2decode(string);
|
37635 | var length = codePoints.length;
|
37636 | var index = -1;
|
37637 | var codePoint;
|
37638 | var byteString = '';
|
37639 | while (++index < length) {
|
37640 | codePoint = codePoints[index];
|
37641 | byteString += encodeCodePoint(codePoint);
|
37642 | }
|
37643 | return byteString;
|
37644 | }
|
37645 |
|
37646 |
|
37647 |
|
37648 | function readContinuationByte() {
|
37649 | if (byteIndex >= byteCount) {
|
37650 | throw Error('Invalid byte index');
|
37651 | }
|
37652 |
|
37653 | var continuationByte = byteArray[byteIndex] & 0xFF;
|
37654 | byteIndex++;
|
37655 |
|
37656 | if ((continuationByte & 0xC0) == 0x80) {
|
37657 | return continuationByte & 0x3F;
|
37658 | }
|
37659 |
|
37660 |
|
37661 | throw Error('Invalid continuation byte');
|
37662 | }
|
37663 |
|
37664 | function decodeSymbol() {
|
37665 | var byte1;
|
37666 | var byte2;
|
37667 | var byte3;
|
37668 | var byte4;
|
37669 | var codePoint;
|
37670 |
|
37671 | if (byteIndex > byteCount) {
|
37672 | throw Error('Invalid byte index');
|
37673 | }
|
37674 |
|
37675 | if (byteIndex == byteCount) {
|
37676 | return false;
|
37677 | }
|
37678 |
|
37679 |
|
37680 | byte1 = byteArray[byteIndex] & 0xFF;
|
37681 | byteIndex++;
|
37682 |
|
37683 |
|
37684 | if ((byte1 & 0x80) == 0) {
|
37685 | return byte1;
|
37686 | }
|
37687 |
|
37688 |
|
37689 | if ((byte1 & 0xE0) == 0xC0) {
|
37690 | var byte2 = readContinuationByte();
|
37691 | codePoint = ((byte1 & 0x1F) << 6) | byte2;
|
37692 | if (codePoint >= 0x80) {
|
37693 | return codePoint;
|
37694 | } else {
|
37695 | throw Error('Invalid continuation byte');
|
37696 | }
|
37697 | }
|
37698 |
|
37699 |
|
37700 | if ((byte1 & 0xF0) == 0xE0) {
|
37701 | byte2 = readContinuationByte();
|
37702 | byte3 = readContinuationByte();
|
37703 | codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
|
37704 | if (codePoint >= 0x0800) {
|
37705 | checkScalarValue(codePoint);
|
37706 | return codePoint;
|
37707 | } else {
|
37708 | throw Error('Invalid continuation byte');
|
37709 | }
|
37710 | }
|
37711 |
|
37712 |
|
37713 | if ((byte1 & 0xF8) == 0xF0) {
|
37714 | byte2 = readContinuationByte();
|
37715 | byte3 = readContinuationByte();
|
37716 | byte4 = readContinuationByte();
|
37717 | codePoint = ((byte1 & 0x0F) << 0x12) | (byte2 << 0x0C) |
|
37718 | (byte3 << 0x06) | byte4;
|
37719 | if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
|
37720 | return codePoint;
|
37721 | }
|
37722 | }
|
37723 |
|
37724 | throw Error('Invalid UTF-8 detected');
|
37725 | }
|
37726 |
|
37727 | var byteArray;
|
37728 | var byteCount;
|
37729 | var byteIndex;
|
37730 | function utf8decode(byteString) {
|
37731 | byteArray = ucs2decode(byteString);
|
37732 | byteCount = byteArray.length;
|
37733 | byteIndex = 0;
|
37734 | var codePoints = [];
|
37735 | var tmp;
|
37736 | while ((tmp = decodeSymbol()) !== false) {
|
37737 | codePoints.push(tmp);
|
37738 | }
|
37739 | return ucs2encode(codePoints);
|
37740 | }
|
37741 |
|
37742 |
|
37743 |
|
37744 | var utf8 = {
|
37745 | 'version': '2.0.0',
|
37746 | 'encode': utf8encode,
|
37747 | 'decode': utf8decode
|
37748 | };
|
37749 |
|
37750 |
|
37751 |
|
37752 | if (
|
37753 | typeof define == 'function' &&
|
37754 | typeof define.amd == 'object' &&
|
37755 | define.amd
|
37756 | ) {
|
37757 | define(function() {
|
37758 | return utf8;
|
37759 | });
|
37760 | } else if (freeExports && !freeExports.nodeType) {
|
37761 | if (freeModule) {
|
37762 | freeModule.exports = utf8;
|
37763 | } else {
|
37764 | var object = {};
|
37765 | var hasOwnProperty = object.hasOwnProperty;
|
37766 | for (var key in utf8) {
|
37767 | hasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);
|
37768 | }
|
37769 | }
|
37770 | } else {
|
37771 | root.utf8 = utf8;
|
37772 | }
|
37773 |
|
37774 | }(this));
|
37775 |
|
37776 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
37777 | },{}],337:[function(require,module,exports){
|
37778 | (function (process){
|
37779 |
|
37780 |
|
37781 |
|
37782 |
|
37783 |
|
37784 |
|
37785 |
|
37786 |
|
37787 |
|
37788 | 'use strict';
|
37789 |
|
37790 |
|
37791 |
|
37792 |
|
37793 |
|
37794 |
|
37795 |
|
37796 |
|
37797 | var warning = function() {};
|
37798 |
|
37799 | if (process.env.NODE_ENV !== 'production') {
|
37800 | warning = function(condition, format, args) {
|
37801 | var len = arguments.length;
|
37802 | args = new Array(len > 2 ? len - 2 : 0);
|
37803 | for (var key = 2; key < len; key++) {
|
37804 | args[key - 2] = arguments[key];
|
37805 | }
|
37806 | if (format === undefined) {
|
37807 | throw new Error(
|
37808 | '`warning(condition, format, ...args)` requires a warning ' +
|
37809 | 'message argument'
|
37810 | );
|
37811 | }
|
37812 |
|
37813 | if (format.length < 10 || (/^[s\W]*$/).test(format)) {
|
37814 | throw new Error(
|
37815 | 'The warning format should be able to uniquely identify this ' +
|
37816 | 'warning. Please, use a more descriptive format than: ' + format
|
37817 | );
|
37818 | }
|
37819 |
|
37820 | if (!condition) {
|
37821 | var argIndex = 0;
|
37822 | var message = 'Warning: ' +
|
37823 | format.replace(/%s/g, function() {
|
37824 | return args[argIndex++];
|
37825 | });
|
37826 | if (typeof console !== 'undefined') {
|
37827 | console.error(message);
|
37828 | }
|
37829 | try {
|
37830 |
|
37831 |
|
37832 | throw new Error(message);
|
37833 | } catch(x) {}
|
37834 | }
|
37835 | };
|
37836 | }
|
37837 |
|
37838 | module.exports = warning;
|
37839 |
|
37840 | }).call(this,require(91))
|
37841 | },{"91":91}],338:[function(require,module,exports){
|
37842 | 'use strict';
|
37843 |
|
37844 | var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')
|
37845 | , length = 64
|
37846 | , map = {}
|
37847 | , seed = 0
|
37848 | , i = 0
|
37849 | , prev;
|
37850 |
|
37851 |
|
37852 |
|
37853 |
|
37854 |
|
37855 |
|
37856 |
|
37857 |
|
37858 | function encode(num) {
|
37859 | var encoded = '';
|
37860 |
|
37861 | do {
|
37862 | encoded = alphabet[num % length] + encoded;
|
37863 | num = Math.floor(num / length);
|
37864 | } while (num > 0);
|
37865 |
|
37866 | return encoded;
|
37867 | }
|
37868 |
|
37869 |
|
37870 |
|
37871 |
|
37872 |
|
37873 |
|
37874 |
|
37875 |
|
37876 | function decode(str) {
|
37877 | var decoded = 0;
|
37878 |
|
37879 | for (i = 0; i < str.length; i++) {
|
37880 | decoded = decoded * length + map[str.charAt(i)];
|
37881 | }
|
37882 |
|
37883 | return decoded;
|
37884 | }
|
37885 |
|
37886 |
|
37887 |
|
37888 |
|
37889 |
|
37890 |
|
37891 |
|
37892 | function yeast() {
|
37893 | var now = encode(+new Date());
|
37894 |
|
37895 | if (now !== prev) return seed = 0, prev = now;
|
37896 | return now +'.'+ encode(seed++);
|
37897 | }
|
37898 |
|
37899 |
|
37900 |
|
37901 |
|
37902 | for (; i < length; i++) map[alphabet[i]] = i;
|
37903 |
|
37904 |
|
37905 |
|
37906 |
|
37907 | yeast.encode = encode;
|
37908 | yeast.decode = decode;
|
37909 | module.exports = yeast;
|
37910 |
|
37911 | },{}],339:[function(require,module,exports){
|
37912 | 'use strict';
|
37913 |
|
37914 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
37915 |
|
37916 | Object.defineProperty(exports, "__esModule", {
|
37917 | value: true
|
37918 | });
|
37919 |
|
37920 | var _react = require(297);
|
37921 |
|
37922 | var _react2 = _interopRequireDefault(_react);
|
37923 |
|
37924 | var _url = require(334);
|
37925 |
|
37926 | var _url2 = _interopRequireDefault(_url);
|
37927 |
|
37928 | var _lodash = require(84);
|
37929 |
|
37930 | var _lodash2 = _interopRequireDefault(_lodash);
|
37931 |
|
37932 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
37933 |
|
37934 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
37935 |
|
37936 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
37937 |
|
37938 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
37939 |
|
37940 | var Bookmark = function (_Component) {
|
37941 | _inherits(Bookmark, _Component);
|
37942 |
|
37943 | function Bookmark() {
|
37944 | _classCallCheck(this, Bookmark);
|
37945 |
|
37946 | return _possibleConstructorReturn(this, Object.getPrototypeOf(Bookmark).apply(this, arguments));
|
37947 | }
|
37948 |
|
37949 | _createClass(Bookmark, [{
|
37950 | key: 'destroyBookmark',
|
37951 | value: function destroyBookmark(evt) {
|
37952 | evt.preventDefault();
|
37953 |
|
37954 | if (typeof window !== 'undefined') {
|
37955 | window.app.socket.emit('destroy-bookmark', {
|
37956 | id: this.props.bookmark.id
|
37957 | });
|
37958 | }
|
37959 | }
|
37960 | }, {
|
37961 | key: 'getTimeString',
|
37962 | value: function getTimeString() {
|
37963 | var months = {
|
37964 | 0: 'January',
|
37965 | 1: 'February',
|
37966 | 2: 'March',
|
37967 | 3: 'April',
|
37968 | 4: 'May',
|
37969 | 5: 'June',
|
37970 | 6: 'July',
|
37971 | 7: 'August',
|
37972 | 8: 'September',
|
37973 | 9: 'October',
|
37974 | 10: 'November',
|
37975 | 11: 'December'
|
37976 | };
|
37977 | var date = new Date(this.props.bookmark.createdOn);
|
37978 | var month = months[date.getMonth()];
|
37979 | var day = date.getDate();
|
37980 | var year = date.getFullYear();
|
37981 |
|
37982 | return month + ' ' + day + ', ' + year;
|
37983 | }
|
37984 | }, {
|
37985 | key: 'getWebsite',
|
37986 | value: function getWebsite() {
|
37987 | var bookmarkURL = this.props.bookmark.url;
|
37988 |
|
37989 | var rootUrl = bookmarkURL;
|
37990 | var name = _url2.default.parse(bookmarkURL).hostname;
|
37991 |
|
37992 | return {
|
37993 | name: name,
|
37994 | url: rootUrl
|
37995 | };
|
37996 | }
|
37997 | }, {
|
37998 | key: 'render',
|
37999 | value: function render() {
|
38000 | return _react2.default.createElement(
|
38001 | 'li',
|
38002 | null,
|
38003 | _react2.default.createElement(
|
38004 | 'a',
|
38005 | { href: this.props.bookmark.url, target: '_blank' },
|
38006 | _react2.default.createElement(
|
38007 | 'h2',
|
38008 | { className: 'bookmark-name' },
|
38009 | (0, _lodash2.default)(this.props.bookmark.title)
|
38010 | )
|
38011 | ),
|
38012 | _react2.default.createElement(
|
38013 | 'span',
|
38014 | { className: 'date' },
|
38015 | this.getTimeString()
|
38016 | ),
|
38017 | _react2.default.createElement(
|
38018 | 'a',
|
38019 | { href: this.getWebsite().url, target: '_blank', className: 'website' },
|
38020 | this.getWebsite().name
|
38021 | ),
|
38022 | _react2.default.createElement(
|
38023 | 'a',
|
38024 | { href: '/api/destroy/' + this.props.bookmark.id, onClick: this.destroyBookmark.bind(this), className: 'destroy' },
|
38025 | 'destroy'
|
38026 | )
|
38027 | );
|
38028 | }
|
38029 | }]);
|
38030 |
|
38031 | return Bookmark;
|
38032 | }(_react.Component);
|
38033 |
|
38034 | Bookmark.propTypes = {
|
38035 | bookmark: _react.PropTypes.object.isRequired,
|
38036 | dispatch: _react.PropTypes.func.isRequired
|
38037 | };
|
38038 | exports.default = Bookmark;
|
38039 |
|
38040 | },{"297":297,"334":334,"84":84}],340:[function(require,module,exports){
|
38041 | 'use strict';
|
38042 |
|
38043 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
38044 |
|
38045 | Object.defineProperty(exports, "__esModule", {
|
38046 | value: true
|
38047 | });
|
38048 | exports.Bookmarks = undefined;
|
38049 |
|
38050 | var _react = require(297);
|
38051 |
|
38052 | var _react2 = _interopRequireDefault(_react);
|
38053 |
|
38054 | var _reactRedux = require(100);
|
38055 |
|
38056 | var _reactRouter = require(136);
|
38057 |
|
38058 | var _bookmark = require(339);
|
38059 |
|
38060 | var _bookmark2 = _interopRequireDefault(_bookmark);
|
38061 |
|
38062 | var _actions = require(346);
|
38063 |
|
38064 | var _actionTypes = require(345);
|
38065 |
|
38066 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38067 |
|
38068 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
38069 |
|
38070 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
38071 |
|
38072 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
38073 |
|
38074 | var Bookmarks = exports.Bookmarks = function (_Component) {
|
38075 | _inherits(Bookmarks, _Component);
|
38076 |
|
38077 | function Bookmarks() {
|
38078 | _classCallCheck(this, Bookmarks);
|
38079 |
|
38080 | return _possibleConstructorReturn(this, Object.getPrototypeOf(Bookmarks).apply(this, arguments));
|
38081 | }
|
38082 |
|
38083 | _createClass(Bookmarks, [{
|
38084 | key: 'getMoreBookmarks',
|
38085 | value: function getMoreBookmarks(evt) {
|
38086 | var _this2 = this;
|
38087 |
|
38088 | if (this.props.networkState !== _actionTypes.REQUEST_LOADING) {
|
38089 | (function () {
|
38090 | var action = undefined;
|
38091 | var pageIncrementer = 0;
|
38092 |
|
38093 | if (evt) {
|
38094 | action = evt.target.getAttribute('data-hook');
|
38095 |
|
38096 | if (action === 'previous' && _this2.props.page !== 1) {
|
38097 | pageIncrementer = -1;
|
38098 | } else if (action === 'next' && !_this2.props.endOfBookmarks) {
|
38099 | pageIncrementer = 1;
|
38100 | }
|
38101 | }
|
38102 |
|
38103 | _this2.props.dispatch((0, _actions.requestLoading)());
|
38104 |
|
38105 | if (typeof window !== 'undefined') {
|
38106 | window.app.socket.emit('get-bookmarks', {
|
38107 | page: _this2.props.page + pageIncrementer
|
38108 | });
|
38109 |
|
38110 | window.app.socket.on('old-bookmarks', function (data) {
|
38111 | _this2.props.dispatch((0, _actions.requestFinished)());
|
38112 | _this2.props.dispatch((0, _actions.updateBookmarks)(data.bookmarks));
|
38113 | _this2.props.dispatch((0, _actions.changePage)(_this2.props.page + pageIncrementer));
|
38114 | _this2.props.dispatch((0, _actions.endOfBookmarks)(data.endOfBookmarks));
|
38115 |
|
38116 | pageIncrementer = 0;
|
38117 | });
|
38118 | }
|
38119 | })();
|
38120 | }
|
38121 | }
|
38122 | }, {
|
38123 | key: 'pagination',
|
38124 | value: function pagination() {
|
38125 | return _react2.default.createElement(
|
38126 | 'div',
|
38127 | { className: 'pagination' },
|
38128 | _react2.default.createElement(
|
38129 | _reactRouter.Link,
|
38130 | { to: this.props.page === 1 ? 'javascript:void(0)' : '/?page=' + (this.props.page - 1),
|
38131 | className: this.props.page === 1 ? 'pagination__link disabled' : 'pagination__link',
|
38132 | onClick: this.props.page === 1 ? function () {} : this.getMoreBookmarks,
|
38133 | disabled: this.props.page === 1,
|
38134 | 'data-hook': 'previous'
|
38135 | },
|
38136 | '❮ Previous'
|
38137 | ),
|
38138 | _react2.default.createElement(
|
38139 | _reactRouter.Link,
|
38140 | { to: this.props.endOfBookmarks ? 'javascript:void(0)' : '/?page=' + (this.props.page + 1),
|
38141 | className: this.props.endOfBookmarks ? 'pagination__link disabled' : 'pagination__link',
|
38142 | onClick: this.props.endOfBookmarks ? function () {} : this.getMoreBookmarks,
|
38143 | disabled: this.props.endOfBookmarks,
|
38144 | 'data-hook': 'next'
|
38145 | },
|
38146 | 'Next ❯'
|
38147 | )
|
38148 | );
|
38149 | }
|
38150 | }, {
|
38151 | key: 'componentDidUpdate',
|
38152 | value: function componentDidUpdate() {
|
38153 | document.documentElement.scrollTop = 0;
|
38154 | document.body.scrollTop = 0;
|
38155 | }
|
38156 | }, {
|
38157 | key: 'componentWillMount',
|
38158 | value: function componentWillMount() {
|
38159 | this.getMoreBookmarks();
|
38160 | }
|
38161 | }, {
|
38162 | key: 'componentWillUnmount',
|
38163 | value: function componentWillUnmount() {
|
38164 | this.props.dispatch((0, _actions.changePage)(1));
|
38165 | }
|
38166 | }, {
|
38167 | key: 'render',
|
38168 | value: function render() {
|
38169 | var _this3 = this;
|
38170 |
|
38171 | if (typeof window !== 'undefined') {
|
38172 | window.app.socket.on('new-bookmark', function (data) {
|
38173 | _this3.props.dispatch((0, _actions.addBookmark)(data.bookmark));
|
38174 | });
|
38175 |
|
38176 | window.app.socket.on('bookmark-destroyed', function (data) {
|
38177 | _this3.props.dispatch((0, _actions.destroyBookmark)(data.id));
|
38178 | });
|
38179 | }
|
38180 |
|
38181 | if (this.props.bookmarks.length) {
|
38182 | return _react2.default.createElement(
|
38183 | 'section',
|
38184 | { className: 'bookmarks' },
|
38185 | _react2.default.createElement(
|
38186 | 'ul',
|
38187 | null,
|
38188 | this.props.bookmarks.sort(function (a, b) {
|
38189 | var dateA = new Date(a.createdOn);
|
38190 | var dateB = new Date(b.createdOn);
|
38191 |
|
38192 | if (dateA < dateB) {
|
38193 | return 1;
|
38194 | } else if (dateA > dateB) {
|
38195 | return -1;
|
38196 | } else {
|
38197 | return 0;
|
38198 | }
|
38199 | }).map(function (bookmark) {
|
38200 | return _react2.default.createElement(_bookmark2.default, { key: bookmark.id, bookmark: bookmark, dispatch: _this3.props.dispatch });
|
38201 | })
|
38202 | ),
|
38203 | this.pagination()
|
38204 | );
|
38205 | } else {
|
38206 | return _react2.default.createElement(
|
38207 | 'section',
|
38208 | { className: 'bookmarks' },
|
38209 | _react2.default.createElement(
|
38210 | 'h2',
|
38211 | { className: 'h2' },
|
38212 | 'No bookmarks yet! Place the script in your bookmarks bar and start bookmarking.'
|
38213 | )
|
38214 | );
|
38215 | }
|
38216 | }
|
38217 | }]);
|
38218 |
|
38219 | return Bookmarks;
|
38220 | }(_react.Component);
|
38221 |
|
38222 | Bookmarks.propTypes = {
|
38223 | bookmarks: _react.PropTypes.array.isRequired,
|
38224 | dispatch: _react.PropTypes.func.isRequired,
|
38225 | networkState: _react.PropTypes.string.isRequired,
|
38226 | page: _react.PropTypes.number.isRequired,
|
38227 | endOfBookmarks: _react.PropTypes.bool.isRequired
|
38228 | };
|
38229 | exports.default = (0, _reactRedux.connect)(function (state) {
|
38230 | return {
|
38231 | bookmarks: state.bookmarks,
|
38232 | networkState: state.networkState,
|
38233 | page: state.page,
|
38234 | endOfBookmarks: state.endOfBookmarks
|
38235 | };
|
38236 | })(Bookmarks);
|
38237 |
|
38238 | },{"100":100,"136":136,"297":297,"339":339,"345":345,"346":346}],341:[function(require,module,exports){
|
38239 | 'use strict';
|
38240 |
|
38241 | Object.defineProperty(exports, "__esModule", {
|
38242 | value: true
|
38243 | });
|
38244 |
|
38245 | var _react = require(297);
|
38246 |
|
38247 | var _react2 = _interopRequireDefault(_react);
|
38248 |
|
38249 | var _snippet = require(348);
|
38250 |
|
38251 | var _snippet2 = _interopRequireDefault(_snippet);
|
38252 |
|
38253 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38254 |
|
38255 | exports.default = function () {
|
38256 | return _react2.default.createElement(
|
38257 | 'div',
|
38258 | { className: 'colophon' },
|
38259 | _react2.default.createElement(
|
38260 | 'h2',
|
38261 | { className: 'h2' },
|
38262 | 'Colophon'
|
38263 | ),
|
38264 | _react2.default.createElement(
|
38265 | 'p',
|
38266 | null,
|
38267 | 'bkmrkd was created by ',
|
38268 | _react2.default.createElement(
|
38269 | 'a',
|
38270 | { href: 'https://github.com/mike-engel' },
|
38271 | 'Mike Engel'
|
38272 | ),
|
38273 | ' as an experiment in creating a service tied to a bookmarklet. Since then it\'s been rewritten in ',
|
38274 | _react2.default.createElement(
|
38275 | 'a',
|
38276 | { href: 'https://nodejs.org' },
|
38277 | 'Node'
|
38278 | ),
|
38279 | ' and ',
|
38280 | _react2.default.createElement(
|
38281 | 'a',
|
38282 | { href: 'https://facebook.github.io/react/index.html' },
|
38283 | 'React'
|
38284 | ),
|
38285 | '. It\'s used as a playground for new web dev techniques such as isomorphic rendering, service worker, etc.'
|
38286 | ),
|
38287 | _react2.default.createElement(
|
38288 | 'p',
|
38289 | null,
|
38290 | 'To add bookmarks here, simply drag this ',
|
38291 | _react2.default.createElement(
|
38292 | 'a',
|
38293 | { href: _snippet2.default },
|
38294 | 'bookmarklet'
|
38295 | ),
|
38296 | ' to your bookmarks bar (or favorites bar or whatever) and click it when you\'re on a page you want to bookmark.'
|
38297 | ),
|
38298 | _react2.default.createElement(
|
38299 | 'p',
|
38300 | null,
|
38301 | 'You can view the code on ',
|
38302 | _react2.default.createElement(
|
38303 | 'a',
|
38304 | { href: 'https://github.com/mike-engel/bkmrkd' },
|
38305 | 'Github'
|
38306 | ),
|
38307 | ', and file ',
|
38308 | _react2.default.createElement(
|
38309 | 'a',
|
38310 | { href: 'https://github.com/mike-engel/bkmrkd/issues' },
|
38311 | 'issues'
|
38312 | ),
|
38313 | ' there too.'
|
38314 | )
|
38315 | );
|
38316 | };
|
38317 |
|
38318 | },{"297":297,"348":348}],342:[function(require,module,exports){
|
38319 | 'use strict';
|
38320 |
|
38321 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
38322 |
|
38323 | Object.defineProperty(exports, "__esModule", {
|
38324 | value: true
|
38325 | });
|
38326 | exports.Search = undefined;
|
38327 |
|
38328 | var _react = require(297);
|
38329 |
|
38330 | var _react2 = _interopRequireDefault(_react);
|
38331 |
|
38332 | var _reactRedux = require(100);
|
38333 |
|
38334 | var _bookmark = require(339);
|
38335 |
|
38336 | var _bookmark2 = _interopRequireDefault(_bookmark);
|
38337 |
|
38338 | var _actions = require(346);
|
38339 |
|
38340 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38341 |
|
38342 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
38343 |
|
38344 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
38345 |
|
38346 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
38347 |
|
38348 | var Search = exports.Search = function (_Component) {
|
38349 | _inherits(Search, _Component);
|
38350 |
|
38351 | function Search() {
|
38352 | _classCallCheck(this, Search);
|
38353 |
|
38354 | return _possibleConstructorReturn(this, Object.getPrototypeOf(Search).apply(this, arguments));
|
38355 | }
|
38356 |
|
38357 | _createClass(Search, [{
|
38358 | key: 'componentWillMount',
|
38359 | value: function componentWillMount() {
|
38360 | var _this2 = this;
|
38361 |
|
38362 | if (typeof window !== 'undefined') {
|
38363 | this.props.dispatch((0, _actions.requestLoading)());
|
38364 |
|
38365 | window.app.socket.emit('search', {
|
38366 | term: this.props.searchTerm
|
38367 | });
|
38368 |
|
38369 | window.app.socket.on('search-results', function (data) {
|
38370 | _this2.props.dispatch((0, _actions.requestFinished)());
|
38371 |
|
38372 | _this2.props.dispatch((0, _actions.updateBookmarks)(data.bookmarks));
|
38373 | });
|
38374 | }
|
38375 | }
|
38376 | }, {
|
38377 | key: 'render',
|
38378 | value: function render() {
|
38379 | var _this3 = this;
|
38380 |
|
38381 | if (this.props.bookmarks.length) {
|
38382 | return _react2.default.createElement(
|
38383 | 'section',
|
38384 | { className: 'bookmarks search-results' },
|
38385 | _react2.default.createElement(
|
38386 | 'ul',
|
38387 | null,
|
38388 | this.props.bookmarks.sort(function (a, b) {
|
38389 | var dateA = new Date(a.createdOn);
|
38390 | var dateB = new Date(b.createdOn);
|
38391 |
|
38392 | if (dateA < dateB) {
|
38393 | return 1;
|
38394 | } else if (dateA > dateB) {
|
38395 | return -1;
|
38396 | } else {
|
38397 | return 0;
|
38398 | }
|
38399 | }).map(function (bookmark) {
|
38400 | return _react2.default.createElement(_bookmark2.default, { key: bookmark.id, bookmark: bookmark, dispatch: _this3.props.dispatch });
|
38401 | })
|
38402 | )
|
38403 | );
|
38404 | } else {
|
38405 | return _react2.default.createElement(
|
38406 | 'section',
|
38407 | { className: 'bookmarks search-results' },
|
38408 | _react2.default.createElement(
|
38409 | 'h2',
|
38410 | { className: 'h2' },
|
38411 | 'Couldn\'t find anything for ',
|
38412 | this.props.searchTerm,
|
38413 | '.'
|
38414 | )
|
38415 | );
|
38416 | }
|
38417 | }
|
38418 | }]);
|
38419 |
|
38420 | return Search;
|
38421 | }(_react.Component);
|
38422 |
|
38423 | Search.propTypes = {
|
38424 | bookmarks: _react.PropTypes.array.isRequired,
|
38425 | dispatch: _react.PropTypes.func.isRequired,
|
38426 | networkState: _react.PropTypes.string.isRequired,
|
38427 | searchTerm: _react.PropTypes.string.isRequired
|
38428 | };
|
38429 | exports.default = (0, _reactRedux.connect)(function (state) {
|
38430 | return {
|
38431 | bookmarks: state.bookmarks,
|
38432 | networkState: state.networkState,
|
38433 | searchTerm: state.searchTerm
|
38434 | };
|
38435 | })(Search);
|
38436 |
|
38437 | },{"100":100,"297":297,"339":339,"346":346}],343:[function(require,module,exports){
|
38438 | 'use strict';
|
38439 |
|
38440 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
38441 |
|
38442 | Object.defineProperty(exports, "__esModule", {
|
38443 | value: true
|
38444 | });
|
38445 | exports.SearchForm = undefined;
|
38446 |
|
38447 | var _react = require(297);
|
38448 |
|
38449 | var _react2 = _interopRequireDefault(_react);
|
38450 |
|
38451 | var _actions = require(346);
|
38452 |
|
38453 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38454 |
|
38455 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
38456 |
|
38457 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
38458 |
|
38459 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
38460 |
|
38461 | var SearchForm = exports.SearchForm = function (_Component) {
|
38462 | _inherits(SearchForm, _Component);
|
38463 |
|
38464 | function SearchForm() {
|
38465 | _classCallCheck(this, SearchForm);
|
38466 |
|
38467 | return _possibleConstructorReturn(this, Object.getPrototypeOf(SearchForm).apply(this, arguments));
|
38468 | }
|
38469 |
|
38470 | _createClass(SearchForm, [{
|
38471 | key: 'handleSubmit',
|
38472 | value: function handleSubmit(evt) {
|
38473 | evt.preventDefault();
|
38474 |
|
38475 | var term = evt.target.querySelector('#search-term').value;
|
38476 |
|
38477 | this.props.dispatch((0, _actions.setSearchTerm)(term));
|
38478 |
|
38479 | this.props.history.push('/search?term=' + term);
|
38480 | }
|
38481 | }, {
|
38482 | key: 'render',
|
38483 | value: function render() {
|
38484 | return _react2.default.createElement(
|
38485 | 'form',
|
38486 | { className: 'form search-form',
|
38487 | action: 'search',
|
38488 | method: 'GET',
|
38489 | role: 'form',
|
38490 | onSubmit: this.handleSubmit.bind(this)
|
38491 | },
|
38492 | _react2.default.createElement(
|
38493 | 'label',
|
38494 | { htmlFor: 'search-term' },
|
38495 | 'Search'
|
38496 | ),
|
38497 | _react2.default.createElement('input', { type: 'search', name: 'term', id: 'search-term', placeholder: this.props.searchTerm || 'search' })
|
38498 | );
|
38499 | }
|
38500 | }]);
|
38501 |
|
38502 | return SearchForm;
|
38503 | }(_react.Component);
|
38504 |
|
38505 | SearchForm.propTypes = {
|
38506 | dispatch: _react.PropTypes.func.isRequired,
|
38507 | history: _react.PropTypes.object.isRequired,
|
38508 | searchTerm: _react.PropTypes.string
|
38509 | };
|
38510 |
|
38511 | },{"297":297,"346":346}],344:[function(require,module,exports){
|
38512 | 'use strict';
|
38513 |
|
38514 | Object.defineProperty(exports, "__esModule", {
|
38515 | value: true
|
38516 | });
|
38517 | exports.Bkmrkd = Bkmrkd;
|
38518 |
|
38519 | var _react = require(297);
|
38520 |
|
38521 | var _react2 = _interopRequireDefault(_react);
|
38522 |
|
38523 | var _reactRouter = require(136);
|
38524 |
|
38525 | var _reactRedux = require(100);
|
38526 |
|
38527 | var _searchForm = require(343);
|
38528 |
|
38529 | var _snippet = require(348);
|
38530 |
|
38531 | var _snippet2 = _interopRequireDefault(_snippet);
|
38532 |
|
38533 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38534 |
|
38535 | function Bkmrkd(props) {
|
38536 | return _react2.default.createElement(
|
38537 | 'div',
|
38538 | { className: 'app container' },
|
38539 | _react2.default.createElement(
|
38540 | 'header',
|
38541 | { className: 'main-nav' },
|
38542 | _react2.default.createElement(
|
38543 | 'h1',
|
38544 | { className: 'h1' },
|
38545 | 'bkmrkd'
|
38546 | ),
|
38547 | _react2.default.createElement(_searchForm.SearchForm, { dispatch: props.dispatch,
|
38548 | history: props.history,
|
38549 | searchTerm: props.searchTerm
|
38550 | }),
|
38551 | _react2.default.createElement(
|
38552 | 'nav',
|
38553 | null,
|
38554 | _react2.default.createElement(
|
38555 | 'ul',
|
38556 | null,
|
38557 | _react2.default.createElement(
|
38558 | 'li',
|
38559 | null,
|
38560 | _react2.default.createElement(
|
38561 | _reactRouter.IndexLink,
|
38562 | { to: '/', activeClassName: 'active' },
|
38563 | 'bkmrkd'
|
38564 | )
|
38565 | ),
|
38566 | _react2.default.createElement(
|
38567 | 'li',
|
38568 | null,
|
38569 | _react2.default.createElement(
|
38570 | _reactRouter.Link,
|
38571 | { to: '/colophon', activeClassName: 'active' },
|
38572 | 'colophon'
|
38573 | )
|
38574 | ),
|
38575 | _react2.default.createElement(
|
38576 | 'li',
|
38577 | null,
|
38578 | _react2.default.createElement(
|
38579 | _reactRouter.Link,
|
38580 | { to: _snippet2.default },
|
38581 | 'bookmarklet'
|
38582 | )
|
38583 | )
|
38584 | )
|
38585 | )
|
38586 | ),
|
38587 | props.children
|
38588 | );
|
38589 | }
|
38590 |
|
38591 | Bkmrkd.propTypes = {
|
38592 | children: _react.PropTypes.node,
|
38593 | dispatch: _react.PropTypes.func.isRequired,
|
38594 | history: _react.PropTypes.object.isRequired,
|
38595 | searchTerm: _react.PropTypes.string
|
38596 | };
|
38597 |
|
38598 | exports.default = (0, _reactRedux.connect)(function (state) {
|
38599 | return {
|
38600 | dispatch: state.dispatch,
|
38601 | searchTerm: state.searchTerm
|
38602 | };
|
38603 | })(Bkmrkd);
|
38604 |
|
38605 | },{"100":100,"136":136,"297":297,"343":343,"348":348}],345:[function(require,module,exports){
|
38606 | 'use strict';
|
38607 |
|
38608 | Object.defineProperty(exports, "__esModule", {
|
38609 | value: true
|
38610 | });
|
38611 | var ADD_BOOKMARK = exports.ADD_BOOKMARK = 'ADD_BOOKMARK';
|
38612 | var ADD_TOAST = exports.ADD_TOAST = 'ADD_TOAST';
|
38613 | var CHANGE_PAGE = exports.CHANGE_PAGE = 'CHANGE_PAGE';
|
38614 | var DESTROY_BOOKMARK = exports.DESTROY_BOOKMARK = 'DESTROY_BOOKMARK';
|
38615 | var END_OF_BOOKMARKS = exports.END_OF_BOOKMARKS = 'END_OF_BOOKMARKS';
|
38616 | var REQUEST_LOADING = exports.REQUEST_LOADING = 'REQUEST_LOADING';
|
38617 | var REQUEST_FINISHED = exports.REQUEST_FINISHED = 'REQUEST_FINISHED';
|
38618 | var SEARCH_TERM = exports.SEARCH_TERM = 'SEARCH_TERM';
|
38619 | var UPDATE_BOOKMARKS = exports.UPDATE_BOOKMARKS = 'UPDATE_BOOKMARKS';
|
38620 |
|
38621 | },{}],346:[function(require,module,exports){
|
38622 | 'use strict';
|
38623 |
|
38624 | Object.defineProperty(exports, "__esModule", {
|
38625 | value: true
|
38626 | });
|
38627 | exports.addBookmark = addBookmark;
|
38628 | exports.addToast = addToast;
|
38629 | exports.changePage = changePage;
|
38630 | exports.destroyBookmark = destroyBookmark;
|
38631 | exports.endOfBookmarks = endOfBookmarks;
|
38632 | exports.requestLoading = requestLoading;
|
38633 | exports.requestFinished = requestFinished;
|
38634 | exports.updateBookmarks = updateBookmarks;
|
38635 | exports.setSearchTerm = setSearchTerm;
|
38636 |
|
38637 | var _actionTypes = require(345);
|
38638 |
|
38639 | function addBookmark(bookmark) {
|
38640 | return {
|
38641 | type: _actionTypes.ADD_BOOKMARK,
|
38642 | bookmark: bookmark
|
38643 | };
|
38644 | }
|
38645 |
|
38646 | function addToast(_ref) {
|
38647 | var message = _ref.message;
|
38648 | var style = _ref.style;
|
38649 |
|
38650 | return {
|
38651 | type: _actionTypes.ADD_TOAST,
|
38652 | message: message,
|
38653 | style: style
|
38654 | };
|
38655 | }
|
38656 |
|
38657 | function changePage(page) {
|
38658 | return {
|
38659 | type: _actionTypes.CHANGE_PAGE,
|
38660 | page: page
|
38661 | };
|
38662 | }
|
38663 |
|
38664 | function destroyBookmark(bookmarkID) {
|
38665 | return {
|
38666 | type: _actionTypes.DESTROY_BOOKMARK,
|
38667 | bookmarkID: bookmarkID
|
38668 | };
|
38669 | }
|
38670 |
|
38671 | function endOfBookmarks(end) {
|
38672 | return {
|
38673 | type: _actionTypes.END_OF_BOOKMARKS,
|
38674 | end: end
|
38675 | };
|
38676 | }
|
38677 |
|
38678 | function requestLoading() {
|
38679 | return {
|
38680 | type: _actionTypes.REQUEST_LOADING
|
38681 | };
|
38682 | }
|
38683 |
|
38684 | function requestFinished() {
|
38685 | return {
|
38686 | type: _actionTypes.REQUEST_FINISHED
|
38687 | };
|
38688 | }
|
38689 |
|
38690 | function updateBookmarks(bookmarks) {
|
38691 | return {
|
38692 | type: _actionTypes.UPDATE_BOOKMARKS,
|
38693 | bookmarks: bookmarks
|
38694 | };
|
38695 | }
|
38696 |
|
38697 | function setSearchTerm(term) {
|
38698 | return {
|
38699 | type: _actionTypes.SEARCH_TERM,
|
38700 | term: term
|
38701 | };
|
38702 | }
|
38703 |
|
38704 | },{"345":345}],347:[function(require,module,exports){
|
38705 | 'use strict';
|
38706 |
|
38707 | Object.defineProperty(exports, "__esModule", {
|
38708 | value: true
|
38709 | });
|
38710 | exports.bookmarks = bookmarks;
|
38711 | exports.endOfBookmarks = endOfBookmarks;
|
38712 | exports.networkState = networkState;
|
38713 | exports.page = page;
|
38714 | exports.searchTerm = searchTerm;
|
38715 | exports.toaster = toaster;
|
38716 |
|
38717 | var _actionTypes = require(345);
|
38718 |
|
38719 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
38720 |
|
38721 | function bookmarks() {
|
38722 | var state = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
|
38723 | var action = arguments[1];
|
38724 |
|
38725 | switch (action.type) {
|
38726 | case _actionTypes.ADD_BOOKMARK:
|
38727 | return [action.bookmark].concat(_toConsumableArray(state));
|
38728 | case _actionTypes.UPDATE_BOOKMARKS:
|
38729 | return action.bookmarks;
|
38730 | case _actionTypes.DESTROY_BOOKMARK:
|
38731 | var bookmarkIdx = -1;
|
38732 |
|
38733 | state.forEach(function (bookmark, idx) {
|
38734 | if (bookmark.id === action.bookmarkID) {
|
38735 | bookmarkIdx = idx;
|
38736 | }
|
38737 | });
|
38738 |
|
38739 | if (bookmarkIdx === -1) {
|
38740 | return state;
|
38741 | }
|
38742 |
|
38743 | return [].concat(_toConsumableArray(state.slice(0, bookmarkIdx)), _toConsumableArray(state.slice(bookmarkIdx + 1)));
|
38744 | default:
|
38745 | return state;
|
38746 | }
|
38747 | }
|
38748 |
|
38749 | function endOfBookmarks() {
|
38750 | var state = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
|
38751 | var action = arguments[1];
|
38752 |
|
38753 | switch (action.type) {
|
38754 | case _actionTypes.END_OF_BOOKMARKS:
|
38755 | return action.end;
|
38756 | default:
|
38757 | return state;
|
38758 | }
|
38759 | }
|
38760 |
|
38761 | function networkState() {
|
38762 | var state = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
|
38763 | var action = arguments[1];
|
38764 |
|
38765 | switch (action.type) {
|
38766 | case _actionTypes.REQUEST_LOADING:
|
38767 | return _actionTypes.REQUEST_LOADING;
|
38768 | case _actionTypes.REQUEST_FINISHED:
|
38769 | return '';
|
38770 | default:
|
38771 | return state;
|
38772 | }
|
38773 | }
|
38774 |
|
38775 | function page() {
|
38776 | var state = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];
|
38777 | var action = arguments[1];
|
38778 |
|
38779 | switch (action.type) {
|
38780 | case _actionTypes.CHANGE_PAGE:
|
38781 | return action.page;
|
38782 | default:
|
38783 | return state;
|
38784 | }
|
38785 | }
|
38786 |
|
38787 | function searchTerm() {
|
38788 | var state = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
|
38789 | var action = arguments[1];
|
38790 |
|
38791 | switch (action.type) {
|
38792 | case _actionTypes.SEARCH_TERM:
|
38793 | return action.term;
|
38794 | default:
|
38795 | return state;
|
38796 | }
|
38797 | }
|
38798 |
|
38799 | function toaster() {
|
38800 | var state = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
|
38801 | var action = arguments[1];
|
38802 |
|
38803 | switch (action.type) {
|
38804 | case _actionTypes.ADD_TOAST:
|
38805 | return [].concat(_toConsumableArray(state), [{
|
38806 | style: action.style,
|
38807 | message: action.message
|
38808 | }]);
|
38809 | default:
|
38810 | return state;
|
38811 | }
|
38812 | }
|
38813 |
|
38814 | },{"345":345}],348:[function(require,module,exports){
|
38815 | (function (process){
|
38816 | 'use strict';
|
38817 |
|
38818 | Object.defineProperty(exports, "__esModule", {
|
38819 | value: true
|
38820 | });
|
38821 |
|
38822 | var _config = require(2);
|
38823 |
|
38824 | var _config2 = _interopRequireDefault(_config);
|
38825 |
|
38826 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38827 |
|
38828 | var env = process.env.NODE_ENV || 'development';
|
38829 | var snippetURL = 'javascript:function bkmrk(){var a=document.createElement("script"),b=window.location,c=document.title,d="' + (typeof window !== 'undefined' ? window.location.origin : _config2.default[env].snippetHost) + '/api/create?title="+c+"&url="+encodeURIComponent(b.href);try{/https/i.test(b.protocol)?window.open(d+"&action=close","_blank","width=100,height=100"):(document.title="Bookmarking "+c,a.setAttribute("src",d),a.setAttribute("async",""),document.body.appendChild(a),document.title=c)}catch(e){alert("Please wait until the page has loaded.")}}bkmrk();void 0;';
|
38830 |
|
38831 | exports.default = snippetURL;
|
38832 |
|
38833 | }).call(this,require(91))
|
38834 | },{"2":2,"91":91}],349:[function(require,module,exports){
|
38835 | 'use strict';
|
38836 |
|
38837 | Object.defineProperty(exports, "__esModule", {
|
38838 | value: true
|
38839 | });
|
38840 |
|
38841 | var _react = require(297);
|
38842 |
|
38843 | var _react2 = _interopRequireDefault(_react);
|
38844 |
|
38845 | var _reactDom = require(97);
|
38846 |
|
38847 | var _reactRedux = require(100);
|
38848 |
|
38849 | var _reactRouter = require(136);
|
38850 |
|
38851 | var _redux = require(316);
|
38852 |
|
38853 | var _reduxRouter = require(303);
|
38854 |
|
38855 | var _reducers = require(347);
|
38856 |
|
38857 | var _history = require(72);
|
38858 |
|
38859 | var _socket = require(321);
|
38860 |
|
38861 | var _socket2 = _interopRequireDefault(_socket);
|
38862 |
|
38863 | var _bkmrkd = require(344);
|
38864 |
|
38865 | var _bkmrkd2 = _interopRequireDefault(_bkmrkd);
|
38866 |
|
38867 | var _colophon = require(341);
|
38868 |
|
38869 | var _colophon2 = _interopRequireDefault(_colophon);
|
38870 |
|
38871 | var _bookmarks = require(340);
|
38872 |
|
38873 | var _bookmarks2 = _interopRequireDefault(_bookmarks);
|
38874 |
|
38875 | var _actions = require(346);
|
38876 |
|
38877 | var _search = require(342);
|
38878 |
|
38879 | var _search2 = _interopRequireDefault(_search);
|
38880 |
|
38881 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38882 |
|
38883 | var routes = _react2.default.createElement(
|
38884 | _reactRouter.Route,
|
38885 | { path: '/', component: _bkmrkd2.default },
|
38886 | _react2.default.createElement(_reactRouter.IndexRoute, { component: _bookmarks2.default }),
|
38887 | _react2.default.createElement(_reactRouter.Route, { path: '/colophon', component: _colophon2.default }),
|
38888 | _react2.default.createElement(_reactRouter.Route, { path: '/search', component: _search2.default })
|
38889 | );
|
38890 |
|
38891 | if (typeof window !== 'undefined') {
|
38892 | (function () {
|
38893 | window.app.socket = _socket2.default.connect(window.location.protocol + '//' + window.location.host);
|
38894 |
|
38895 | window.app.__initialState = window.app.__initialState || {
|
38896 | bookmarks: [],
|
38897 | networkState: '',
|
38898 | toaster: [],
|
38899 | page: 1,
|
38900 | endOfBookmarks: false,
|
38901 | searchTerm: ''
|
38902 | };
|
38903 |
|
38904 | var reducer = (0, _redux.combineReducers)({
|
38905 | router: _reduxRouter.routerStateReducer,
|
38906 | bookmarks: _reducers.bookmarks,
|
38907 | networkState: _reducers.networkState,
|
38908 | toaster: _reducers.toaster,
|
38909 | page: _reducers.page,
|
38910 | endOfBookmarks: _reducers.endOfBookmarks,
|
38911 | searchTerm: _reducers.searchTerm
|
38912 | });
|
38913 | var store = (0, _redux.compose)((0, _reduxRouter.reduxReactRouter)({
|
38914 | routes: routes,
|
38915 | createHistory: _history.createHistory
|
38916 | }))(_redux.createStore)(reducer, window.app.__initialState);
|
38917 |
|
38918 | window.app.socket.on('connect_error', function () {
|
38919 | store.dispatch((0, _actions.addToast)({
|
38920 | message: 'bkmrkd couldn\'nt connect to the server. You won\'t receive updates. You can try refreshing the page.',
|
38921 | style: 'error'
|
38922 | }));
|
38923 | });
|
38924 |
|
38925 | window.app.socket.on('connect_timeout', function () {
|
38926 | store.dispatch((0, _actions.addToast)({
|
38927 | message: 'bkmrkd couldn\'nt connect to the server. You won\'t receive updates. You can try refreshing the page.',
|
38928 | style: 'error'
|
38929 | }));
|
38930 | });
|
38931 |
|
38932 | window.app.socket.on('reconnecting', function () {
|
38933 | store.dispatch((0, _actions.addToast)({
|
38934 | message: 'Trying to reconnect to the bkrmrkd server...',
|
38935 | style: 'warning'
|
38936 | }));
|
38937 | });
|
38938 |
|
38939 | window.app.socket.on('reconnect', function () {
|
38940 | store.dispatch((0, _actions.addToast)({
|
38941 | message: 'Reconnected to the bkmrkd server',
|
38942 | style: 'success'
|
38943 | }));
|
38944 | });
|
38945 |
|
38946 | window.app.socket.on('reconnect_error', function () {
|
38947 | store.dispatch((0, _actions.addToast)({
|
38948 | message: 'bkmrkd couldn\'nt connect to the server. You won\'t receive updates. You can try refreshing the page.',
|
38949 | style: 'error'
|
38950 | }));
|
38951 | });
|
38952 |
|
38953 | window.app.socket.on('reconnect_failed', function () {
|
38954 | store.dispatch((0, _actions.addToast)({
|
38955 | message: 'bkmrkd couldn\'nt connect to the server. You won\'t receive updates. You can try refreshing the page.',
|
38956 | style: 'error'
|
38957 | }));
|
38958 | });
|
38959 |
|
38960 | window.app.socket.on('error', function (data) {
|
38961 | store.dispatch((0, _actions.addToast)({
|
38962 | message: 'Socket error: ' + data.message,
|
38963 | style: 'error'
|
38964 | }));
|
38965 | });
|
38966 |
|
38967 | (0, _reactDom.render)(_react2.default.createElement(
|
38968 | _reactRedux.Provider,
|
38969 | { store: store },
|
38970 | _react2.default.createElement(
|
38971 | _reactRouter.Router,
|
38972 | { history: _reactRouter.browserHistory },
|
38973 | routes
|
38974 | )
|
38975 | ), document.body.querySelector('[data-hook="app"]'));
|
38976 | })();
|
38977 | }
|
38978 |
|
38979 | exports.default = routes;
|
38980 |
|
38981 | },{"100":100,"136":136,"297":297,"303":303,"316":316,"321":321,"340":340,"341":341,"342":342,"344":344,"346":346,"347":347,"72":72,"97":97}]},{},[349])(349)
|
38982 | });
|
38983 |
|