Professional Documents
Culture Documents
Webpacs Javascript
Webpacs Javascript
/******/
var parentHotUpdateCallback = this["webpackHotUpdate"];
/******/
this["webpackHotUpdate"] =
/******/
function webpackHotUpdateCallback(chunkId, moreModules) { // esl
int-disable-line no-unused-vars
/******/
hotAddUpdateChunk(chunkId, moreModules);
/******/
if(parentHotUpdateCallback) parentHotUpdateCallback(chun
kId, moreModules);
/******/
}
/******/
/******/
function hotDownloadUpdateChunk(chunkId) { // eslint-disable-lin
e no-unused-vars
/******/
var head = document.getElementsByTagName("head")[0];
/******/
var script = document.createElement("script");
/******/
script.type = "text/javascript";
/******/
script.charset = "utf-8";
/******/
script.src = __webpack_require__.p + "" + chunkId + "."
+ hotCurrentHash + ".hot-update.js";
/******/
head.appendChild(script);
/******/
}
/******/
/******/
function hotDownloadManifest(callback) { // eslint-disable-line
no-unused-vars
/******/
if(typeof XMLHttpRequest === "undefined")
/******/
return callback(new Error("No browser support"))
;
/******/
try {
/******/
var request = new XMLHttpRequest();
/******/
var requestPath = __webpack_require__.p + "" + h
otCurrentHash + ".hot-update.json";
/******/
request.open("GET", requestPath, true);
/******/
request.timeout = 10000;
/******/
request.send(null);
/******/
} catch(err) {
/******/
return callback(err);
/******/
}
/******/
request.onreadystatechange = function() {
/******/
if(request.readyState !== 4) return;
/******/
if(request.status === 0) {
/******/
// timeout
/******/
callback(new Error("Manifest request to
" + requestPath + " timed out."));
/******/
} else if(request.status === 404) {
/******/
// no update available
/******/
callback();
/******/
} else if(request.status !== 200 && request.stat
us !== 304) {
/******/
// other failure
/******/
callback(new Error("Manifest request to
" + requestPath + " failed."));
/******/
} else {
/******/
// success
/******/
try {
/******/
var update = JSON.parse(request.
responseText);
/******/
} catch(e) {
/******/
callback(e);
/******/
return;
/******/
}
/******/
callback(null, update);
/******/
/******/
/******/
}
};
}
/******/
/******/
/******/
// Copied from https://github.com/facebook/react/blob/bef45b0/sr
c/shared/utils/canDefineProperty.js
/******/
var canDefineProperty = false;
/******/
try {
/******/
Object.defineProperty({}, "x", {
/******/
get: function() {}
/******/
});
/******/
canDefineProperty = true;
/******/
} catch(x) {
/******/
// IE will fail on defineProperty
/******/
}
/******/
/******/
var hotApplyOnUpdate = true;
/******/
var hotCurrentHash = "7cbb39fcecfbc718cc17"; // eslint-disable-l
ine no-unused-vars
/******/
var hotCurrentModuleData = {};
/******/
var hotCurrentParents = []; // eslint-disable-line no-unused-var
s
/******/
/******/
function hotCreateRequire(moduleId) { // eslint-disable-line nounused-vars
/******/
var me = installedModules[moduleId];
/******/
if(!me) return __webpack_require__;
/******/
var fn = function(request) {
/******/
if(me.hot.active) {
/******/
if(installedModules[request]) {
/******/
if(installedModules[request].par
ents.indexOf(moduleId) < 0)
/******/
installedModules[request
].parents.push(moduleId);
/******/
if(me.children.indexOf(request)
< 0)
/******/
me.children.push(request
);
/******/
} else hotCurrentParents = [moduleId];
/******/
} else {
/******/
console.warn("[HMR] unexpected require("
+ request + ") from disposed module " + moduleId);
/******/
hotCurrentParents = [];
/******/
}
/******/
return __webpack_require__(request);
/******/
};
/******/
for(var name in __webpack_require__) {
/******/
if(Object.prototype.hasOwnProperty.call(__webpac
k_require__, name)) {
/******/
if(canDefineProperty) {
/******/
Object.defineProperty(fn, name,
(function(name) {
/******/
return {
/******/
configurable: tr
ue,
/******/
enumerable: true
,
/******/
get: function()
{
/******/
return _
_webpack_require__[name];
/******/
},
/******/
set: function(va
lue) {
/******/
__webpac
k_require__[name] = value;
/******/
}
/******/
};
/******/
}(name)));
/******/
} else {
/******/
fn[name] = __webpack_require__[n
ame];
/******/
}
/******/
}
/******/
}
/******/
/******/
function ensure(chunkId, callback) {
/******/
if(hotStatus === "ready")
/******/
hotSetStatus("prepare");
/******/
hotChunksLoading++;
/******/
__webpack_require__.e(chunkId, function() {
/******/
try {
/******/
callback.call(null, fn);
/******/
} finally {
/******/
finishChunkLoading();
/******/
}
/******/
/******/
function finishChunkLoading() {
/******/
hotChunksLoading--;
/******/
if(hotStatus === "prepare") {
/******/
if(!hotWaitingFilesMap[c
hunkId]) {
/******/
hotEnsureUpdateC
hunk(chunkId);
/******/
}
/******/
if(hotChunksLoading ===
0 && hotWaitingFiles === 0) {
/******/
hotUpdateDownloa
ded();
/******/
}
/******/
}
/******/
}
/******/
});
/******/
}
/******/
if(canDefineProperty) {
/******/
Object.defineProperty(fn, "e", {
/******/
enumerable: true,
/******/
value: ensure
/******/
});
/******/
} else {
/******/
fn.e = ensure;
/******/
}
/******/
return fn;
/******/
}
/******/
/******/
function hotCreateModule(moduleId) { // eslint-disable-line no-u
nused-vars
/******/
var hot = {
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
++)
/******/
s[dep[i]] = callback;
/******/
/******/
callback;
/******/
/******/
/******/
/******/
/******/
/******/
true;
/******/
/******/
++)
/******/
s[dep[i]] = true;
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
allback);
/******/
(idx, 1);
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
// private stuff
_acceptedDependencies: {},
_declinedDependencies: {},
_selfAccepted: false,
_selfDeclined: false,
_disposeHandlers: [],
// Module API
active: true,
accept: function(dep, callback) {
if(typeof dep === "undefined")
hot._selfAccepted = true;
else if(typeof dep === "function")
hot._selfAccepted = dep;
else if(typeof dep === "object")
for(var i = 0; i < dep.length; i
hot._acceptedDependencie
else
hot._acceptedDependencies[dep] =
},
decline: function(dep) {
if(typeof dep === "undefined")
hot._selfDeclined = true;
else if(typeof dep === "number")
hot._declinedDependencies[dep] =
else
for(var i = 0; i < dep.length; i
hot._declinedDependencie
},
dispose: function(callback) {
hot._disposeHandlers.push(callback);
},
addDisposeHandler: function(callback) {
hot._disposeHandlers.push(callback);
},
removeDisposeHandler: function(callback) {
var idx = hot._disposeHandlers.indexOf(c
if(idx >= 0) hot._disposeHandlers.splice
},
// Management API
check: hotCheck,
apply: hotApply,
status: function(l) {
if(!l) return hotStatus;
hotStatusHandlers.push(l);
},
addStatusHandler: function(l) {
hotStatusHandlers.push(l);
},
removeStatusHandler: function(l) {
var idx = hotStatusHandlers.indexOf(l);
/******/
if(idx >= 0) hotStatusHandlers.splice(id
x, 1);
/******/
},
/******/
/******/
//inherit from previous dispose call
/******/
data: hotCurrentModuleData[moduleId]
/******/
};
/******/
return hot;
/******/
}
/******/
/******/
var hotStatusHandlers = [];
/******/
var hotStatus = "idle";
/******/
/******/
function hotSetStatus(newStatus) {
/******/
hotStatus = newStatus;
/******/
for(var i = 0; i < hotStatusHandlers.length; i++)
/******/
hotStatusHandlers[i].call(null, newStatus);
/******/
}
/******/
/******/
// while downloading
/******/
var hotWaitingFiles = 0;
/******/
var hotChunksLoading = 0;
/******/
var hotWaitingFilesMap = {};
/******/
var hotRequestedFilesMap = {};
/******/
var hotAvailibleFilesMap = {};
/******/
var hotCallback;
/******/
/******/
// The update info
/******/
var hotUpdate, hotUpdateNewHash;
/******/
/******/
function toModuleId(id) {
/******/
var isNumber = (+id) + "" === id;
/******/
return isNumber ? +id : id;
/******/
}
/******/
/******/
function hotCheck(apply, callback) {
/******/
if(hotStatus !== "idle") throw new Error("check() is onl
y allowed in idle status");
/******/
if(typeof apply === "function") {
/******/
hotApplyOnUpdate = false;
/******/
callback = apply;
/******/
} else {
/******/
hotApplyOnUpdate = apply;
/******/
callback = callback || function(err) {
/******/
if(err) throw err;
/******/
};
/******/
}
/******/
hotSetStatus("check");
/******/
hotDownloadManifest(function(err, update) {
/******/
if(err) return callback(err);
/******/
if(!update) {
/******/
hotSetStatus("idle");
/******/
callback(null, null);
/******/
return;
/******/
}
/******/
/******/
hotRequestedFilesMap = {};
/******/
hotAvailibleFilesMap = {};
/******/
hotWaitingFilesMap = {};
/******/
for(var i = 0; i < update.c.length; i++)
/******/
hotAvailibleFilesMap[update.c[i]] = true
;
/******/
hotUpdateNewHash = update.h;
/******/
/******/
hotSetStatus("prepare");
/******/
hotCallback = callback;
/******/
hotUpdate = {};
/******/
var chunkId = 0;
/******/
{ // eslint-disable-line no-lone-blocks
/******/
/*globals chunkId */
/******/
hotEnsureUpdateChunk(chunkId);
/******/
}
/******/
if(hotStatus === "prepare" && hotChunksLoading =
== 0 && hotWaitingFiles === 0) {
/******/
hotUpdateDownloaded();
/******/
}
/******/
});
/******/
}
/******/
/******/
function hotAddUpdateChunk(chunkId, moreModules) { // eslint-dis
able-line no-unused-vars
/******/
if(!hotAvailibleFilesMap[chunkId] || !hotRequestedFilesM
ap[chunkId])
/******/
return;
/******/
hotRequestedFilesMap[chunkId] = false;
/******/
for(var moduleId in moreModules) {
/******/
if(Object.prototype.hasOwnProperty.call(moreModu
les, moduleId)) {
/******/
hotUpdate[moduleId] = moreModules[module
Id];
/******/
}
/******/
}
/******/
if(--hotWaitingFiles === 0 && hotChunksLoading === 0) {
/******/
hotUpdateDownloaded();
/******/
}
/******/
}
/******/
/******/
function hotEnsureUpdateChunk(chunkId) {
/******/
if(!hotAvailibleFilesMap[chunkId]) {
/******/
hotWaitingFilesMap[chunkId] = true;
/******/
} else {
/******/
hotRequestedFilesMap[chunkId] = true;
/******/
hotWaitingFiles++;
/******/
hotDownloadUpdateChunk(chunkId);
/******/
}
/******/
}
/******/
/******/
function hotUpdateDownloaded() {
/******/
hotSetStatus("ready");
/******/
var callback = hotCallback;
/******/
hotCallback = null;
/******/
if(!callback) return;
/******/
if(hotApplyOnUpdate) {
/******/
hotApply(hotApplyOnUpdate, callback);
/******/
} else {
/******/
var outdatedModules = [];
/******/
for(var id in hotUpdate) {
/******/
if(Object.prototype.hasOwnProperty.call(
hotUpdate, id)) {
/******/
outdatedModules.push(toModuleId(
id));
/******/
}
/******/
}
/******/
callback(null, outdatedModules);
/******/
}
/******/
}
/******/
/******/
function hotApply(options, callback) {
/******/
if(hotStatus !== "ready") throw new Error("apply() is on
ly allowed in ready status");
/******/
if(typeof options === "function") {
/******/
callback = options;
/******/
options = {};
/******/
} else if(options && typeof options === "object") {
/******/
callback = callback || function(err) {
/******/
if(err) throw err;
/******/
};
/******/
} else {
/******/
options = {};
/******/
callback = callback || function(err) {
/******/
if(err) throw err;
/******/
};
/******/
}
/******/
/******/
function getAffectedStuff(module) {
/******/
var outdatedModules = [module];
/******/
var outdatedDependencies = {};
/******/
/******/
var queue = outdatedModules.slice();
/******/
while(queue.length > 0) {
/******/
var moduleId = queue.pop();
/******/
var module = installedModules[moduleId];
/******/
if(!module || module.hot._selfAccepted)
/******/
continue;
/******/
if(module.hot._selfDeclined) {
/******/
return new Error("Aborted becaus
e of self decline: " + moduleId);
/******/
}
/******/
if(moduleId === 0) {
/******/
return;
/******/
}
/******/
for(var i = 0; i < module.parents.length
; i++) {
/******/
var parentId = module.parents[i]
;
/******/
var parent = installedModules[pa
rentId];
/******/
if(parent.hot._declinedDependenc
ies[moduleId]) {
/******/
return new Error("Aborte
d because of declined dependency: " + moduleId + " in " + parentId);
/******/
}
/******/
if(outdatedModules.indexOf(paren
tId) >= 0) continue;
/******/
if(parent.hot._acceptedDependenc
ies[moduleId]) {
/******/
if(!outdatedDependencies
[parentId])
/******/
outdatedDependen
cies[parentId] = [];
/******/
addAllToSet(outdatedDepe
ndencies[parentId], [moduleId]);
/******/
continue;
/******/
}
/******/
delete outdatedDependencies[pare
ntId];
/******/
outdatedModules.push(parentId);
/******/
queue.push(parentId);
/******/
}
/******/
}
/******/
/******/
return [outdatedModules, outdatedDependencies];
/******/
}
/******/
/******/
function addAllToSet(a, b) {
/******/
for(var i = 0; i < b.length; i++) {
/******/
var item = b[i];
/******/
if(a.indexOf(item) < 0)
/******/
a.push(item);
/******/
}
/******/
}
/******/
/******/
// at begin all updates modules are outdated
/******/
// the "outdated" status can propagate to parents if the
y don't accept the children
/******/
var outdatedDependencies = {};
/******/
var outdatedModules = [];
/******/
var appliedUpdate = {};
/******/
for(var id in hotUpdate) {
/******/
if(Object.prototype.hasOwnProperty.call(hotUpdat
e, id)) {
/******/
var moduleId = toModuleId(id);
/******/
var result = getAffectedStuff(moduleId);
/******/
if(!result) {
/******/
if(options.ignoreUnaccepted)
/******/
continue;
/******/
hotSetStatus("abort");
/******/
return callback(new Error("Abort
ed because " + moduleId + " is not accepted"));
/******/
}
/******/
if(result instanceof Error) {
/******/
hotSetStatus("abort");
/******/
return callback(result);
/******/
}
/******/
appliedUpdate[moduleId] = hotUpdate[modu
leId];
/******/
addAllToSet(outdatedModules, result[0]);
/******/
for(var moduleId in result[1]) {
/******/
if(Object.prototype.hasOwnProper
ty.call(result[1], moduleId)) {
/******/
if(!outdatedDependencies
[moduleId])
/******/
outdatedDependen
cies[moduleId] = [];
/******/
addAllToSet(outdatedDepe
ndencies[moduleId], result[1][moduleId]);
/******/
}
/******/
}
/******/
}
/******/
}
/******/
/******/
// Store self accepted outdated modules to require them
later by the module system
/******/
var outdatedSelfAcceptedModules = [];
/******/
for(var i = 0; i < outdatedModules.length; i++) {
/******/
var moduleId = outdatedModules[i];
/******/
if(installedModules[moduleId] && installedModule
s[moduleId].hot._selfAccepted)
/******/
outdatedSelfAcceptedModules.push({
/******/
module: moduleId,
/******/
errorHandler: installedModules[m
oduleId].hot._selfAccepted
/******/
});
/******/
}
/******/
/******/
// Now in "dispose" phase
/******/
hotSetStatus("dispose");
/******/
var queue = outdatedModules.slice();
/******/
while(queue.length > 0) {
/******/
var moduleId = queue.pop();
/******/
var module = installedModules[moduleId];
/******/
if(!module) continue;
/******/
/******/
var data = {};
/******/
/******/
// Call dispose handlers
/******/
var disposeHandlers = module.hot._disposeHandler
s;
/******/
for(var j = 0; j < disposeHandlers.length; j++)
{
/******/
var cb = disposeHandlers[j];
/******/
cb(data);
/******/
}
/******/
hotCurrentModuleData[moduleId] = data;
/******/
/******/
// disable module (this disables requires from t
his module)
/******/
module.hot.active = false;
/******/
/******/
// remove module from cache
/******/
delete installedModules[moduleId];
/******/
/******/
// remove "parents" references from all children
/******/
for(var j = 0; j < module.children.length; j++)
{
/******/
var child = installedModules[module.chil
dren[j]];
/******/
if(!child) continue;
/******/
var idx = child.parents.indexOf(moduleId
);
/******/
if(idx >= 0) {
/******/
child.parents.splice(idx, 1);
/******/
}
/******/
}
/******/
}
/******/
/******/
// remove outdated dependency from module children
/******/
for(var moduleId in outdatedDependencies) {
/******/
if(Object.prototype.hasOwnProperty.call(outdated
Dependencies, moduleId)) {
/******/
var module = installedModules[moduleId];
/******/
var moduleOutdatedDependencies = outdate
dDependencies[moduleId];
/******/
for(var j = 0; j < moduleOutdatedDepende
ncies.length; j++) {
/******/
var dependency = moduleOutdatedD
ependencies[j];
/******/
var idx = module.children.indexO
f(dependency);
/******/
if(idx >= 0) module.children.spl
ice(idx, 1);
/******/
}
/******/
}
/******/
}
/******/
/******/
// Not in "apply" phase
/******/
hotSetStatus("apply");
/******/
/******/
hotCurrentHash = hotUpdateNewHash;
/******/
/******/
// insert new code
/******/
for(var moduleId in appliedUpdate) {
/******/
if(Object.prototype.hasOwnProperty.call(appliedU
pdate, moduleId)) {
/******/
modules[moduleId] = appliedUpdate[module
Id];
/******/
}
/******/
}
/******/
/******/
// call accept handlers
/******/
var error = null;
/******/
for(var moduleId in outdatedDependencies) {
/******/
if(Object.prototype.hasOwnProperty.call(outdated
Dependencies, moduleId)) {
/******/
var module = installedModules[moduleId];
/******/
var moduleOutdatedDependencies = outdate
dDependencies[moduleId];
/******/
var callbacks = [];
/******/
for(var i = 0; i < moduleOutdatedDepende
ncies.length; i++) {
/******/
var dependency = moduleOutdatedD
ependencies[i];
/******/
var cb = module.hot._acceptedDep
endencies[dependency];
/******/
if(callbacks.indexOf(cb) >= 0) c
ontinue;
/******/
callbacks.push(cb);
/******/
}
/******/
for(var i = 0; i < callbacks.length; i++
) {
/******/
var cb = callbacks[i];
/******/
try {
/******/
cb(outdatedDependencies)
;
/******/
} catch(err) {
/******/
if(!error)
/******/
error = err;
/******/
}
/******/
}
/******/
}
/******/
/******/
/******/
/******/
++) {
/******/
/******/
/******/
/******/
/******/
/******/
/******/
n") {
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
dule load
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
// Execute the module function
/******/
modules[moduleId].call(module.exports, module, module.ex
ports, hotCreateRequire(moduleId));
/******/
/******/
module.loaded = true;
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
/******/
// __webpack_public_path__
__webpack_require__.p = "/";
/******/
/******/
// __webpack_hash__
__webpack_require__.h = function() { return hotCurrentHash; };
/******/
// Load entry module and return exports
/******/
return hotCreateRequire(0)(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(1);
__webpack_require__(74);
module.exports = __webpack_require__(76);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(__resourceQuery) {var url = __webpa
ck_require__(2);
var SockJS = __webpack_require__(8);
var stripAnsi = __webpack_require__(72);
var scriptElements = document.getElementsByTagName("script");
var scriptHost = scriptElements[scriptElements.length-1].getAttribute("s
rc").replace(/\/[^\/]+$/, "");
// If this bundle is inlined, use the resource query to get the correct
url.
// Else, get the url from the <script> this file was called with.
var urlParts = url.parse( true ?
__resourceQuery.substr(1) :
(scriptHost ? scriptHost : "/")
);
var
var
var
var
sock = null;
hot = false;
initial = true;
currentHash = "";
var onSocketMsg = {
hot: function() {
hot = true;
rmit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be includ
ed
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE
SS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLA
IM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var punycode = __webpack_require__(3);
exports.parse = urlParse;
exports.resolve = urlResolve;
exports.resolveObject = urlResolveObject;
exports.format = urlFormat;
exports.Url = Url;
function Url() {
this.protocol = null;
this.slashes = null;
this.auth = null;
this.host = null;
this.port = null;
this.hostname = null;
this.hash = null;
this.search = null;
this.query = null;
this.pathname = null;
this.path = null;
this.href = null;
}
// Reference: RFC 3986, RFC 1808, RFC 2396
// define these here so at least they only have to be
// compiled once on the first module load.
var protocolPattern = /^([a-z0-9.+-]+:)/i,
portPattern = /:[0-9]*$/,
// RFC 2396: characters reserved for delimiting URLs.
// We actually just auto-escape these.
delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
// RFC 2396: characters not allowed for various reasons.
unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
// Allowed by RFCs, but cause of XSS attacks. Always escape these.
autoEscape = ['\''].concat(unwise),
// Characters that are never ever allowed in a hostname.
// Note that any invalid chars are also handled, but these
// are the ones that are *expected* to be seen, so we fast-path
// them.
nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
hostEndingChars = ['/', '?', '#'],
hostnameMaxLen = 255,
hostnamePartPattern = /^[a-z0-9A-Z_-]{0,63}$/,
hostnamePartStart = /^([a-z0-9A-Z_-]{0,63})(.*)$/,
// protocols that can allow "unsafe" and "unwise" chars.
unsafeProtocol = {
'javascript': true,
'javascript:': true
},
// protocols that never have a hostname.
hostlessProtocol = {
'javascript': true,
'javascript:': true
},
// protocols that always contain a // bit.
slashedProtocol = {
'http': true,
'https': true,
'ftp': true,
'gopher': true,
'file': true,
'http:': true,
'https:': true,
'ftp:': true,
'gopher:': true,
'file:': true
},
querystring = __webpack_require__(5);
function urlParse(url, parseQueryString, slashesDenoteHost) {
if (url && isObject(url) && url instanceof Url) return url;
var u = new Url;
u.parse(url, parseQueryString, slashesDenoteHost);
return u;
}
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost)
{
if (!isString(url)) {
throw new TypeError("Parameter 'url' must be a string, not " + typeo
f url);
}
var rest = url;
// trim before proceeding.
// This is to support parse stuff like " http://foo.com \n"
rest = rest.trim();
var proto = protocolPattern.exec(rest);
if (proto) {
proto = proto[0];
var lowerProto = proto.toLowerCase();
this.protocol = lowerProto;
rest = rest.substr(proto.length);
}
//
//
//
//
if
{
var slashes = rest.substr(0, 2) === '//';
if (slashes && !(proto && hostlessProtocol[proto])) {
rest = rest.substr(2);
this.slashes = true;
}
}
if (!hostlessProtocol[proto] &&
(slashes || (proto && !slashedProtocol[proto]))) {
// there's a hostname.
// the first instance of /, ?, ;, or # ends the host.
//
// If there is an @ in the hostname, then non-host chars *are* allow
ed
// to the left of the last @ sign, unless some host-ending character
// comes *before* the @-sign.
//
//
//
//
//
}
var p = this.port ? ':' + this.port : '';
var h = this.hostname || '';
this.host = h + p;
this.href += this.host;
// strip [ and ] from the hostname
// the host field still retains them, though
if (ipv6Hostname) {
this.hostname = this.hostname.substr(1, this.hostname.length - 2);
if (rest[0] !== '/') {
rest = '/' + rest;
}
}
}
// now rest is set to the post-host stuff.
// chop off any delim chars.
if (!unsafeProtocol[lowerProto]) {
// First, make 100% sure that any "autoEscape" chars get
// escaped, even if encodeURIComponent doesn't think they
// need to be.
for (var i = 0, l = autoEscape.length; i < l; i++) {
var ae = autoEscape[i];
var esc = encodeURIComponent(ae);
if (esc === ae) {
esc = escape(ae);
}
rest = rest.split(ae).join(esc);
}
}
// chop off from the tail first.
var hash = rest.indexOf('#');
if (hash !== -1) {
// got a fragment string.
this.hash = rest.substr(hash);
rest = rest.slice(0, hash);
}
var qm = rest.indexOf('?');
if (qm !== -1) {
this.search = rest.substr(qm);
this.query = rest.substr(qm + 1);
if (parseQueryString) {
this.query = querystring.parse(this.query);
}
rest = rest.slice(0, qm);
} else if (parseQueryString) {
// no query string, but parseQueryString still requested
this.search = '';
this.query = {};
}
if (rest) this.pathname = rest;
if (slashedProtocol[lowerProto] &&
this.hostname && !this.pathname) {
this.pathname = '/';
}
if (k !== 'protocol')
result[k] = relative[k];
});
//urlParse appends trailing / to urls like http://www.example.com
if (slashedProtocol[result.protocol] &&
result.hostname && !result.pathname) {
result.path = result.pathname = '/';
}
result.href = result.format();
return result;
}
if (relative.protocol && relative.protocol !== result.protocol) {
// if it's a known url protocol, then changing
// the protocol does weird things
// first, if it's not file:, then we MUST have a host,
// and if there was a path
// to begin with, then we MUST have a path.
// if it is file:, then the host is dropped,
// because that's known to be hostless.
// anything else is assumed to be absolute.
if (!slashedProtocol[relative.protocol]) {
Object.keys(relative).forEach(function(k) {
result[k] = relative[k];
});
result.href = result.format();
return result;
}
result.protocol = relative.protocol;
if (!relative.host && !hostlessProtocol[relative.protocol]) {
var relPath = (relative.pathname || '').split('/');
while (relPath.length && !(relative.host = relPath.shift()));
if (!relative.host) relative.host = '';
if (!relative.hostname) relative.hostname = '';
if (relPath[0] !== '') relPath.unshift('');
if (relPath.length < 2) relPath.unshift('');
result.pathname = relPath.join('/');
} else {
result.pathname = relative.pathname;
}
result.search = relative.search;
result.query = relative.query;
result.host = relative.host || '';
result.auth = relative.auth;
result.hostname = relative.hostname || relative.host;
result.port = relative.port;
// to support http.request
if (result.pathname || result.search) {
var p = result.pathname || '';
var s = result.search || '';
result.path = p + s;
}
result.slashes = result.slashes || relative.slashes;
result.href = result.format();
return result;
}
}
if (isRelAbs) {
// it's absolute.
result.host = (relative.host || relative.host === '') ?
relative.host : result.host;
result.hostname = (relative.hostname || relative.hostname === '') ?
relative.hostname : result.hostname;
result.search = relative.search;
result.query = relative.query;
srcPath = relPath;
// fall through to the dot-handling below.
} else if (relPath.length) {
// it's relative
// throw away the existing file, and take the new path instead.
if (!srcPath) srcPath = [];
srcPath.pop();
srcPath = srcPath.concat(relPath);
result.search = relative.search;
result.query = relative.query;
} else if (!isNullOrUndefined(relative.search)) {
// just pull out the search.
// like href='?foo'.
// Put this after the other two cases because it simplifies the bool
eans
if (psychotic) {
result.hostname = result.host = srcPath.shift();
//occationaly the auth can get stuck only in host
//this especialy happens in cases like
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
var authInHost = result.host && result.host.indexOf('@') > 0 ?
result.host.split('@') : false;
if (authInHost) {
result.auth = authInHost.shift();
result.host = result.hostname = authInHost.shift();
}
}
result.search = relative.search;
result.query = relative.query;
//to support http.request
if (!isNull(result.pathname) || !isNull(result.search)) {
result.path = (result.pathname ? result.pathname : '') +
(result.search ? result.search : '');
}
result.href = result.format();
return result;
}
if (!srcPath.length) {
// no path at all. easy.
// we've already handled the other stuff above.
result.pathname = null;
//to support http.request
if (result.search) {
result.path = '/' + result.search;
} else {
result.path = null;
}
result.href = result.format();
return result;
}
// if a url ENDs in . or .., then it must get a trailing slash.
// however, if it ends in anything else non-slashy,
// then it must NOT get a trailing slash.
var last = srcPath.slice(-1)[0];
var hasTrailingSlash = (
(result.host || relative.host) && (last === '.' || last === '..')
||
last === '');
// strip single dots, resolve double dots to parent dir
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = srcPath.length; i >= 0; i--) {
last = srcPath[i];
if (last == '.') {
srcPath.splice(i, 1);
} else if (last === '..') {
srcPath.splice(i, 1);
up++;
} else if (up) {
srcPath.splice(i, 1);
up--;
}
}
// if the path is allowed to go above the root, restore leading ..s
if (!mustEndAbs && !removeAllDots) {
for (; up--; up) {
srcPath.unshift('..');
}
}
if (mustEndAbs && srcPath[0] !== '' &&
(!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
srcPath.unshift('');
}
if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
srcPath.push('');
}
var isAbsolute = srcPath[0] === '' ||
(srcPath[0] && srcPath[0].charAt(0) === '/');
// put the host back
if (psychotic) {
result.hostname = result.host = isAbsolute ? '' :
srcPath.length ? srcPath.shift() : '
';
//occationaly the auth can get stuck only in host
//this especialy happens in cases like
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
var authInHost = result.host && result.host.indexOf('@') > 0 ?
result.host.split('@') : false;
if (authInHost) {
result.auth = authInHost.shift();
result.host = result.hostname = authInHost.shift();
}
}
mustEndAbs = mustEndAbs || (result.host && srcPath.length);
if (mustEndAbs && !isAbsolute) {
srcPath.unshift('');
}
if (!srcPath.length) {
result.pathname = null;
result.path = null;
} else {
result.pathname = srcPath.join('/');
}
//to support request.http
if (!isNull(result.pathname) || !isNull(result.search)) {
result.path = (result.pathname ? result.pathname : '') +
(result.search ? result.search : '');
}
result.auth = relative.auth || result.auth;
result.slashes = result.slashes || relative.slashes;
result.href = result.format();
return result;
};
Url.prototype.parseHost = function() {
var host = this.host;
var port = portPattern.exec(host);
if (port) {
port = port[0];
if (port !== ':') {
this.port = port.substr(1);
}
host = host.substr(0, host.length - port.length);
}
if (host) this.hostname = host;
};
function isString(arg) {
return typeof arg === "string";
}
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
function
return
}
function
return
}
isNull(arg) {
arg === null;
isNullOrUndefined(arg) {
arg == null;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(m
odule, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */
;(function(root) {
/** Detect free variables */
var freeExports = typeof exports == 'object' && exports &&
!exports.nodeType && exports;
var freeModule = typeof module == 'object' && module &&
!module.nodeType && module;
var freeGlobal = typeof global == 'object' && global;
if (
freeGlobal.global === freeGlobal ||
freeGlobal.window === freeGlobal ||
freeGlobal.self === freeGlobal
) {
root = freeGlobal;
}
/**
* The `punycode` object.
* @name punycode
* @type Object
*/
var punycode,
*/
function map(array, fn) {
var length = array.length;
var result = [];
while (length--) {
result[length] = fn(array[length]);
}
return result;
}
/**
* A simple `Array#map`-like wrapper to work with domain name st
rings or email
*
*
*
*
addresses.
@private
@param {String} domain The domain name or email address.
@param {Function} callback The function that gets called for
every
* character.
* @returns {Array} A new string of characters returned by the c
allback
* function.
*/
function mapDomain(string, fn) {
var parts = string.split('@');
var result = '';
if (parts.length > 1) {
// In email addresses, only the domain name shou
ld be punycoded. Leave
// the local part (i.e. everything up to `@`) in
tact.
result = parts[0] + '@';
string = parts[1];
}
// Avoid `split(regex)` for IE8 compatibility. See #17.
string = string.replace(regexSeparators, '\x2E');
var labels = string.split('.');
var encoded = map(labels, fn).join('.');
return result + encoded;
}
/**
* Creates an array containing the numeric code points of each U
nicode
* character in the string. While JavaScript uses UCS-2 internal
ly,
* this function will convert a pair of surrogate halves (each o
f which
* UCS-2 exposes as separate characters) into a single code poin
t,
* matching UTF-16.
* @see `punycode.ucs2.encode`
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode.ucs2
* @name decode
* @param {String} string The Unicode input string (UCS-2).
* @returns {Array} The new array of code points.
*/
function ucs2decode(string) {
var output = [],
counter = 0,
length = string.length,
value,
extra;
while (counter < length) {
value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counte
r < length) {
// high surrogate, and there is a next c
haracter
extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) { // low
surrogate
output.push(((value & 0x3FF) <<
10) + (extra & 0x3FF) + 0x10000);
} else {
// unmatched surrogate; only app
end this code unit, in case the next
// code unit is the high surroga
te of a surrogate pair
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
/**
* Creates a string based on an array of numeric code points.
* @see `punycode.ucs2.decode`
* @memberOf punycode.ucs2
* @name encode
* @param {Array} codePoints The array of numeric code points.
* @returns {String} The new Unicode string (UCS-2).
*/
function ucs2encode(array) {
return map(array, function(value) {
var output = '';
if (value > 0xFFFF) {
value -= 0x10000;
output += stringFromCharCode(value >>> 1
0 & 0x3FF | 0xD800);
value = 0xDC00 | value & 0x3FF;
}
output += stringFromCharCode(value);
return output;
}).join('');
}
/**
* Converts a basic code point into a digit/integer.
* @see `digitToBasic()`
* @private
* @param {Number} codePoint The basic numeric code point value.
* @returns {Number} The numeric value of a basic code point (fo
r use in
* representing integers) in the range `0` to `base - 1`, or `ba
se` if
* the code point does not represent a value.
*/
function basicToDigit(codePoint) {
if (codePoint - 48 < 10) {
return codePoint - 22;
}
if (codePoint - 65 < 26) {
return codePoint - 65;
}
if (codePoint - 97 < 26) {
return codePoint - 97;
}
return base;
}
/**
* Converts a digit/integer into a basic code point.
* @see `basicToDigit()`
* @private
* @param {Number} digit The numeric value of a basic code point
.
* @returns {Number} The basic code point whose value (when used
for
* representing integers) is `digit`, which needs to be in the r
ange
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form
is
* used; else, the lowercase form is used. The behavior is undef
ined
* if `flag` is non-zero and `digit` has no uppercase form.
*/
function digitToBasic(digit, flag) {
// 0..25 map to ASCII a..z or A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26) - ((flag != 0) <<
5);
}
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* http://tools.ietf.org/html/rfc3492#section-3.4
* @private
*/
function adapt(delta, numPoints, firstTime) {
var k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
for (/* no initialization */; delta > baseMinusTMin * tM
ax >> 1; k += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k + (baseMinusTMin + 1) * delta / (delta +
skew));
}
/**
* Converts a Punycode string of ASCII-only symbols to a string
of Unicode
* symbols.
* @memberOf punycode
* @param {String} input The Punycode string of ASCII-only symbo
ls.
* @returns {String} The resulting string of Unicode symbols.
*/
function decode(input) {
// Don't use UCS-2
var output = [],
inputLength = input.length,
out,
i = 0,
n = initialN,
bias = initialBias,
basic,
j,
index,
oldi,
w,
k,
digit,
t,
/** Cached calculation results */
baseMinusT;
// Handle the basic code points: let `basic` be the numb
er of input code
// points before the last delimiter, or `0` if there is
none, then copy
// the first basic code points to the output.
basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (j = 0; j < basic; ++j) {
// if it's not a basic code point
if (input.charCodeAt(j) >= 0x80) {
error('not-basic');
}
output.push(input.charCodeAt(j));
}
// Main decoding loop: start just after the last delimit
er if any basic code
// points were copied; start at the beginning otherwise.
for (index = basic > 0 ? basic + 1 : 0; index < inputLen
gth; /* no final expression */) {
// `index` is the index of the next character to
be consumed.
// Decode a generalized variable-length integer
into `delta`,
// which gets added to `i`. The overflow checkin
g is easier
// if we increase `i` as we go, then subtract of
f its starting
// value at the end to obtain `delta`.
for (oldi = i, w = 1, k = base; /* no condition
*/; k += base) {
if (index >= inputLength) {
error('invalid-input');
}
digit = basicToDigit(input.charCodeAt(in
dex++));
if (digit >= base || digit > floor((maxI
nt - i) / w)) {
error('overflow');
}
i += digit * w;
t = k <= bias ? tMin : (k >= bias + tMax
? tMax : k - bias);
if (digit < t) {
break;
}
baseMinusT = base - t;
if (w > floor(maxInt / baseMinusT)) {
error('overflow');
}
w *= baseMinusT;
}
out = output.length + 1;
bias = adapt(i - oldi, out, oldi == 0);
// `i` was supposed to wrap around from `out` to
`0`,
// incrementing `n` each time, so we'll fix that
now:
if (floor(i / out) > maxInt - n) {
error('overflow');
}
n += floor(i / out);
i %= out;
// Insert `n` at position `i` of the output
output.splice(i++, 0, n);
}
return ucs2encode(output);
}
/**
* Converts a string of Unicode symbols (e.g. a domain name labe
l) to a
*
*
*
*
symbols.
*/
function encode(input) {
var n,
delta,
handledCPCount,
basicLength,
bias,
j,
m,
q,
k,
t,
currentValue,
output = [],
/** `inputLength` will hold the number of code point
s in `input`. */
inputLength,
/** Cached calculation results */
handledCPCountPlusOne,
baseMinusT,
qMinusT;
// Convert the input in UCS-2 to Unicode
input = ucs2decode(input);
// Cache the length
inputLength = input.length;
// Initialize the state
n = initialN;
delta = 0;
bias = initialBias;
// Handle the basic code points
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < 0x80) {
output.push(stringFromCharCode(currentVa
lue));
}
}
handledCPCount = basicLength = output.length;
// `handledCPCount` is the number of code points that ha
ve been handled;
// `basicLength` is the number of basic code points.
// Finish the basic string - if it is not empty - with a
delimiter
if (basicLength) {
output.push(delimiter);
}
// Main encoding loop:
while (handledCPCount < inputLength) {
// All non-basic code points < n have been handl
ed already. Find the next
// larger one:
for (m = maxInt, j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue >= n && currentValue <
m) {
m = currentValue;
}
}
// Increase `delta` enough to advance the decode
r's <n,i> state to <m,0>,
// but guard against overflow
handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) / handledCPCo
untPlusOne)) {
error('overflow');
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < n && ++delta > maxInt
) {
error('overflow');
}
if (currentValue == n) {
// Represent delta as a generali
zed variable-length integer
for (q = delta, k = base; /* no
condition */; k += base) {
t = k <= bias ? tMin : (
k >= bias + tMax ? tMax : k - bias);
if (q < t) {
break;
}
qMinusT = q - t;
baseMinusT = base - t;
output.push(
stringFromCharCo
de(digitToBasic(t + qMinusT % baseMinusT, 0))
);
q = floor(qMinusT / base
MinusT);
}
output.push(stringFromCharCode(d
igitToBasic(q, 0)));
bias = adapt(delta, handledCPCou
ntPlusOne, handledCPCount == basicLength);
delta = 0;
++handledCPCount;
}
}
++delta;
++n;
}
return output.join('');
}
/**
* Converts a Punycode string representing a domain name or an e
mail address
* to Unicode. Only the Punycoded parts of the input will be con
verted, i.e.
* it doesn't matter if you call it on a string that has already
been
* converted to Unicode.
* @memberOf punycode
* @param {String} input The Punycoded domain name or email addr
ess to
* convert to Unicode.
* @returns {String} The Unicode representation of the given Pun
ycode
* string.
*/
function toUnicode(input) {
return mapDomain(input, function(string) {
return regexPunycode.test(string)
? decode(string.slice(4).toLowerCase())
: string;
});
}
/**
* Converts a Unicode string representing a domain name or an em
ail address to
* Punycode. Only the non-ASCII parts of the domain name will be
converted,
* i.e. it doesn't matter if you call it with a domain that's al
ready in
* ASCII.
* @memberOf punycode
* @param {String} input The domain name or email address to con
vert, as a
* Unicode string.
* @returns {String} The Punycode representation of the given do
main name or
* email address.
*/
function toASCII(input) {
return mapDomain(input, function(string) {
return regexNonASCII.test(string)
? 'xn--' + encode(string)
: string;
});
}
/*-------------------------------------------------------------------------*/
/** Define the public API */
punycode = {
/**
* A string representing the current Punycode.js version
number.
* @memberOf punycode
* @type String
*/
'version': '1.3.2',
/**
* An object of methods to convert from JavaScript's int
ernal character
* representation (UCS-2) to Unicode code points, and ba
ck.
* @see <https://mathiasbynens.be/notes/javascript-encod
ing>
* @memberOf punycode
* @type Object
*/
'ucs2': {
'decode': ucs2decode,
'encode': ucs2encode
},
'decode': decode,
'encode': encode,
'toASCII': toASCII,
'toUnicode': toUnicode
};
/** Expose `punycode` */
// Some AMD build optimizers, like r.js, check for specific cond
ition patterns
// like the following:
if (
true
) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return punycode;
}.call(exports, __webpack_require__, exports, module), _
_WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DE
FINE_RESULT__));
} else if (freeExports && freeModule) {
if (module.exports == freeExports) { // in Node.js or Ri
ngoJS v0.8.0+
freeModule.exports = punycode;
} else { // in Narwhal or RingoJS v0.7.0for (key in punycode) {
punycode.hasOwnProperty(key) && (freeExp
orts[key] = punycode[key]);
}
}
} else { // in Rhino or a web browser
root.punycode = punycode;
}
}(this));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)(module
), (function() { return this; }())))
/***/ },
/* 4 */
/***/ function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.decode = exports.parse = __webpack_require__(6);
exports.encode = exports.stringify = __webpack_require__(7);
/***/ },
/* 6 */
/***/ function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining
a
//
//
//
//
rmit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be includ
ed
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE
SS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLA
IM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
// If obj.hasOwnProperty has been overridden, then calling
// obj.hasOwnProperty(prop) will break.
// See: https://github.com/joyent/node/issues/1707
function hasOwnProperty(obj, prop) {
//
// Permission is hereby granted, free of charge, to any person obtaining
a
//
//
//
//
rmit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be includ
ed
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE
SS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLA
IM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
var stringifyPrimitive = function(v) {
switch (typeof v) {
case 'string':
return v;
case 'boolean':
return v ? 'true' : 'false';
case 'number':
return isFinite(v) ? v : '';
default:
return '';
}
};
module.exports = function(obj, sep, eq, name) {
sep = sep || '&';
eq = eq || '=';
if (obj === null) {
obj = undefined;
}
if (typeof obj === 'object') {
return Object.keys(obj).map(function(k) {
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
if (Array.isArray(obj[k])) {
return obj[k].map(function(v) {
return ks + encodeURIComponent(stringifyPrimitive(v));
}).join(sep);
} else {
return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
}
}).join(sep);
}
if (!name) return '';
return encodeURIComponent(stringifyPrimitive(name)) + eq +
encodeURIComponent(stringifyPrimitive(obj));
};
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
var transportList = __webpack_require__(9);
module.exports = __webpack_require__(56)(transportList);
// TODO can't get rid of this until all servers do
if ('_sockjs_onload' in global) {
setTimeout(global._sockjs_onload, 1);
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = [
// streaming transports
__webpack_require__(10)
, __webpack_require__(27)
, __webpack_require__(37)
, __webpack_require__(39)
, __webpack_require__(42)(__webpack_require__(39))
// polling transports
, __webpack_require__(49)
, __webpack_require__(42)(__webpack_require__(49))
, __webpack_require__(51)
, __webpack_require__(52)
, __webpack_require__(42)(__webpack_require__(51))
, __webpack_require__(53)
];
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var
,
,
,
,
;
utils = __webpack_require__(12)
urlUtils = __webpack_require__(15)
inherits = __webpack_require__(23)
EventEmitter = __webpack_require__(24).EventEmitter
WebsocketDriver = __webpack_require__(26)
debug('send', msg);
this.ws.send(msg);
};
WebSocketTransport.prototype.close = function() {
debug('close');
if (this.ws) {
this.ws.close();
}
this._cleanup();
};
WebSocketTransport.prototype._cleanup = function() {
debug('_cleanup');
var ws = this.ws;
if (ws) {
ws.onmessage = ws.onclose = ws.onerror = null;
}
utils.unloadDel(this.unloadRef);
this.unloadRef = this.ws = null;
this.removeAllListeners();
};
WebSocketTransport.enabled = function() {
debug('enabled');
return !!WebsocketDriver;
};
WebSocketTransport.transportName = 'websocket';
// In theory, ws should require 1 round trip. But in chrome, this is
// not very stable over SSL. Most likely a ws connection requires a
// separate SSL connection, in which case 2 round trips are an
// absolute minumum.
WebSocketTransport.roundTrips = 2;
module.exports = WebSocketTransport;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 11 */
/***/ function(module, exports) {
// shim for using process in browser
var
var
var
var
var
function cleanUpNextTick() {
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
clearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
setTimeout(drainQueue, 0);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd =
process.chdir
throw new
};
process.umask
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
var random = __webpack_require__(13);
var onUnload = {}
, afterUnload = false
// detect google chrome packaged apps because they don't allow the '
unload' event
, isChromePackagedApp = global.chrome && global.chrome.app && global.c
hrome.app.runtime
;
module.exports = {
attachEvent: function(event, listener) {
if (typeof global.addEventListener !== 'undefined') {
global.addEventListener(event, listener, false);
} else if (global.document && global.attachEvent) {
// IE quirks.
// According to: http://stevesouders.com/misc/test-postmessage.php
// the message gets delivered only to 'document', not 'window'.
global.document.attachEvent('on' + event, listener);
// I get 'window' for ie8.
global.attachEvent('on' + event, listener);
}
}
, detachEvent: function(event, listener) {
if (typeof global.addEventListener !== 'undefined') {
global.removeEventListener(event, listener, false);
} else if (global.document && global.detachEvent) {
global.document.detachEvent('on' + event, listener);
global.detachEvent('on' + event, listener);
}
}
, unloadAdd: function(listener) {
if (isChromePackagedApp) {
return null;
}
return ret.join('');
}
, number: function(max) {
return Math.floor(Math.random() * max);
}
, numberString:
var t = (''
var p = new
return (p +
}
};
function(max) {
+ (max - 1)).length;
Array(t + 1).join('0');
this.number(max)).slice(-t);
/***/ },
/* 14 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
if (global.crypto && global.crypto.getRandomValues) {
module.exports.randomBytes = function(length) {
var bytes = new Uint8Array(length);
global.crypto.getRandomValues(bytes);
return bytes;
};
} else {
module.exports.randomBytes = function(length) {
var bytes = new Array(length);
for (var i = 0; i < length; i++) {
bytes[i] = Math.floor(Math.random() * 256);
}
return bytes;
};
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var URL = __webpack_require__(16);
var debug = function() {};
if (process.env.NODE_ENV !== 'production') {
debug = __webpack_require__(20)('sockjs-client:utils:url');
}
module.exports = {
getOrigin: function(url) {
if (!url) {
return null;
}
var p = new URL(url);
relative = relativere.test(address)
parse, instruction, index, key
type = typeof location
url = this
, i = 0;
//
// The following if statements allows this module two have compatibili
ty with
// 2 different API:
//
// 1. Node.js's `url.parse` api which accepts a URL, boolean as argume
nts
//
where the boolean indicates that the query string should also be
parsed.
//
// 2. The `URL` interface of the browser which accepts a URL, object a
s
//
fall-back
//
for relative paths.
//
if ('object' !== type && 'string' !== type) {
parser = location;
location = null;
}
if (parser && 'function' !== typeof parser) {
parser = qs.parse;
}
location = lolcation(location);
// extract protocol information before running the instructions
var extracted = extractProtocol(address);
url.protocol = extracted.protocol || location.protocol || '';
url.slashes = extracted.slashes || location.slashes;
address = extracted.rest;
for (; i < instructions.length; i++) {
instruction = instructions[i];
parse = instruction[0];
key = instruction[1];
if (parse !== parse) {
url[key] = address;
} else if ('string' === typeof parse) {
if (~(index = address.indexOf(parse))) {
if ('number' === typeof instruction[2]) {
url[key] = address.slice(0, index);
address = address.slice(index + instruction[2]);
} else {
url[key] = address.slice(index);
address = address.slice(0, index);
}
}
} else if (index = parse.exec(address)) {
url[key] = index[1];
address = address.slice(0, address.length - index[0].length);
}
url[key] = url[key] || (instruction[3] || ('port' === key && relativ
e) ? location[key] || '' : '');
//
// Hostname, host and protocol should be lowercased so they can be u
sed to
// create a proper `origin`.
//
if (instruction[4]) {
url[key] = url[key].toLowerCase();
}
}
//
// Also parse the supplied query string in to an object. If we're supp
lied
// with a custom parser as function use that instead of the default bu
ild-in
// parser.
//
if (parser) url.query = parser(url.query);
//
// We should not add port numbers if they are already the default port
number
// for a given protocol. As the host also contains the port number we'
re going
// override it with the hostname which contains no port number.
//
if (!required(url.port, url.protocol)) {
url.host = url.hostname;
url.port = '';
}
//
// Parse down the `auth` for the username and password.
//
url.username = url.password = '';
if (url.auth) {
instruction = url.auth.split(':');
url.username = instruction[0] || '';
url.password = instruction[1] || '';
}
//
// The href is just the compiled result.
//
url.href = url.toString();
}
/**
* This is convenience method for changing properties in the URL instanc
e to
* insure that they all propagate correctly.
*
* @param {String} prop
Property we need to adjust.
* @param {Mixed} value
The newly assigned value.
* @param {Boolean|Function} fn When setting the query, it will be the
function used to parse
*
the query.
*
When setting the protocol, double slash
will be removed from
*
the final url if it is true.
* @returns {URL}
* @api public
*/
URL.prototype.set = function set(part, value, fn) {
var url = this;
if ('query' === part) {
if ('string' === typeof value && value.length) {
value = (fn || qs.parse)(value);
}
url[part] = value;
} else if ('port' === part) {
url[part] = value;
if (!required(value, url.protocol)) {
url.host = url.hostname;
url[part] = '';
} else if (value) {
url.host = url.hostname +':'+ value;
}
} else if ('hostname' === part) {
url[part] = value;
if (url.port) value += ':'+ url.port;
url.host = value;
} else if ('host' === part) {
url[part] = value;
if (/\:\d+/.test(value)) {
value = value.split(':');
url.hostname = value[0];
url.port = value[1];
}
} else if ('protocol' === part) {
url.protocol = value;
url.slashes = !fn;
} else {
url[part] = value;
}
url.href = url.toString();
return url;
};
/**
* Transform the properties back in to a valid and full URL string.
*
* @param {Function} stringify Optional query stringify function.
* @returns {String}
* @api public
*/
URL.prototype.toString = function toString(stringify) {
if (!stringify || 'function' !== typeof stringify) stringify = qs.stri
ngify;
var query
, url = this
, protocol = url.protocol;
case 'https':
case 'wss':
return port !== 443;
case 'ftp':
return port !== 21;
case 'gopher':
return port !== 70;
case 'file':
return false;
}
return port !== 0;
};
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
var slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//;
/**
* These properties should not be copied or inherited from. This is only
needed
* for all non blob URL's as a blob URL does not include a hash, only th
e
* origin.
*
* @type {Object}
* @private
*/
var ignore = { hash: 1, query: 1 }
, URL;
/**
* The location object differs when your code is loaded through a normal
page,
* Worker or through a worker using a blob. And with the blobble begins
the
* trouble as the location object will contain the URL of the blob, not
the
* location of the page where our code is loaded in. The actual origin i
s
* encoded in the `pathname` so we can thankfully generate a good "defau
lt"
* location from it so we can generate proper relative URL's again.
*
* @param {Object|String} loc Optional default location object.
* @returns {Object} lolcation object.
* @api public
*/
module.exports = function lolcation(loc) {
loc = loc || global.location || {};
URL = URL || __webpack_require__(16);
var finaldestination = {}
, type = typeof loc
, key;
if ('blob:' === loc.protocol) {
finaldestination = new URL(unescape(loc.pathname), {});
} else if ('string' === type) {
finaldestination = new URL(loc, {});
for (key in ignore) delete finaldestination[key];
} else if ('object' === type) {
for (key in loc) {
if (key in ignore) continue;
finaldestination[key] = loc[key];
}
if (finaldestination.slashes === undefined) {
finaldestination.slashes = slashes.test(loc.href);
}
}
return finaldestination;
};
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 19 */
/***/ function(module, exports) {
'use strict';
var has = Object.prototype.hasOwnProperty;
/**
* Simple query string parser.
*
* @param {String} query The query string that needs to be parsed.
* @returns {Object}
* @api public
*/
function querystring(query) {
var parser = /([^=?&]+)=([^&]*)/g
, result = {}
, part;
//
// Little nifty parsing hack, leverage the fact that RegExp.exec incre
ments
// the lastIndex property so we can continue executing this loop until
we've
// parsed all results.
//
for (;
part = parser.exec(query);
result[decodeURIComponent(part[1])] = decodeURIComponent(part[2])
);
return result;
}
/**
* Transform a query string to an object.
*
* @param {Object} obj Object that should be transformed.
* @param {String} prefix Optional prefix.
* @returns {String}
* @api public
*/
function querystringify(obj, prefix) {
prefix = prefix || '';
var pairs = [];
//
// Optionally prefix with a '?' if needed
//
if ('string' !== typeof prefix) prefix = '?';
for (var key in obj) {
if (has.call(obj, key)) {
pairs.push(encodeURIComponent(key) +'='+ encodeURIComponent(obj[ke
y]));
}
}
return pairs.length ? prefix + pairs.join('&') : '';
}
//
// Expose the module.
//
exports.stringify = querystringify;
exports.parse = querystring;
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
/**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = __webpack_require__(21);
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
&& 'undefined' != typeof chrome.storage
? chrome.storage.local
: localstorage();
/**
* Colors.
*/
exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colo
rs
*/
function useColors() {
// is webkit? http://stackoverflow.com/a/16459606/376773
return ('WebkitAppearance' in document.documentElement.style) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(window.console && (console.firebug || (console.exception && console
.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Stylin
g_messages
(navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseI
nt(RegExp.$1, 10) >= 31);
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by defa
ult.
*/
exports.formatters.j = function(v) {
return JSON.stringify(v);
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs() {
var args = arguments;
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
var r;
try {
r = exports.storage.debug;
} catch(e) {}
return r;
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage(){
try {
return window.localStorage;
} catch (e) {}
}
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = debug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = __webpack_require__(22);
/**
* The currently active debug mode names, and names to skip.
*/
exports.names = [];
exports.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argume
nt.
*
* Valid key names are a single, lowercased letter, i.e. "n".
*/
exports.formatters = {};
/**
* Previously assigned color.
*/
var prevColor = 0;
/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.
*
* @return {Number}
* @api private
*/
function selectColor() {
return exports.colors[prevColor++ % exports.colors.length];
}
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function debug(namespace) {
// define the `disabled` version
function disabled() {
}
disabled.enabled = false;
// define the `enabled` version
function enabled() {
var self = enabled;
// set `diff` timestamp
var curr = +new Date();
var ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
// add the `color` if not set
if (null == self.useColors) self.useColors = exports.useColors();
if (null == self.color && self.useColors) self.color = selectColor()
;
var args = Array.prototype.slice.call(arguments);
args[0] = exports.coerce(args[0]);
if ('string' !== typeof args[0]) {
// anything else let's inspect with %o
args = ['%o'].concat(args);
}
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
// if we encounter an escaped % then don't increase the array inde
x
if (match === '%%') return match;
index++;
var formatter = exports.formatters[format];
if ('function' === typeof formatter) {
var val = args[index];
match = formatter.call(self, val);
// now we need to remove `args[index]` since it's inlined in the
`format`
args.splice(index, 1);
index--;
}
return match;
});
if ('function' === typeof exports.formatArgs) {
args = exports.formatArgs.apply(self, args);
}
var logFn = enabled.log || exports.log || console.log.bind(console);
logFn.apply(self, args);
}
enabled.enabled = true;
var fn = exports.enabled(namespace) ? enabled : disabled;
fn.namespace = namespace;
return fn;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
exports.save(namespaces);
var split = (namespaces || '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
exports.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @api public
*/
function disable() {
exports.enable('');
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
/***/ },
/* 22 */
/***/ function(module, exports) {
/**
* Helpers.
*/
var
var
var
var
var
s
m
h
d
y
=
=
=
=
=
1000;
s * 60;
m * 60;
h * 24;
d * 365.25;
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} options
* @return {String|Number}
* @api public
*/
module.exports = function(val, options){
options = options || {};
if ('string' == typeof val) return parse(val);
return options.long
? long(val)
: short(val);
};
/**
* Parse the given `str` and return milliseconds.
*
* @param {String} str
* @return {Number}
* @api private
*/
function parse(str) {
str = '' + str;
if (str.length > 10000) return;
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs
?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
if (!match) return;
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
}
}
/**
* Short format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function
if (ms
if (ms
if (ms
if (ms
return
}
short(ms) {
>= d) return
>= h) return
>= m) return
>= s) return
ms + 'ms';
Math.round(ms
Math.round(ms
Math.round(ms
Math.round(ms
/**
* Long format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function long(ms) {
return plural(ms, d, 'day')
|| plural(ms, h, 'hour')
/
/
/
/
d)
h)
m)
s)
+
+
+
+
'd';
'h';
'm';
's';
|| plural(ms, m, 'minute')
|| plural(ms, s, 'second')
|| ms + ' ms';
}
/**
* Pluralization helper.
*/
function
if (ms
if (ms
return
}
plural(ms, n, name) {
< n) return;
< n * 1.5) return Math.floor(ms / n) + ' ' + name;
Math.ceil(ms / n) + ' ' + name + 's';
/***/ },
/* 23 */
/***/ function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var inherits = __webpack_require__(23)
, EventTarget = __webpack_require__(25)
;
function EventEmitter() {
EventTarget.call(this);
}
inherits(EventEmitter, EventTarget);
EventEmitter.prototype.removeAllListeners = function(type) {
if (type) {
delete this._listeners[type];
} else {
this._listeners = {};
}
};
EventEmitter.prototype.once = function(type, listener) {
var self = this
, fired = false;
function g() {
self.removeListener(type, g);
if (!fired) {
fired = true;
listener.apply(this, arguments);
}
}
this.on(type, g);
};
EventEmitter.prototype.emit = function() {
var type = arguments[0];
var listeners = this._listeners[type];
if (!listeners) {
return;
}
// equivalent of Array.prototype.slice.call(arguments, 1);
var l = arguments.length;
var args = new Array(l - 1);
for (var ai = 1; ai < l; ai++) {
args[ai - 1] = arguments[ai];
}
for (var i = 0; i < listeners.length; i++) {
listeners[i].apply(this, args);
}
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener = EventTa
rget.prototype.addEventListener;
EventEmitter.prototype.removeListener = EventTarget.prototype.removeEven
tListener;
module.exports.EventEmitter = EventEmitter;
/***/ },
/* 25 */
/***/ function(module, exports) {
'use strict';
/* Simplified implementation of DOM2 EventTarget.
* http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTar
get
*/
function EventTarget() {
this._listeners = {};
}
EventTarget.prototype.addEventListener = function(eventType, listener) {
if (!(eventType in this._listeners)) {
this._listeners[eventType] = [];
}
var arr = this._listeners[eventType];
// #4
if (arr.indexOf(listener) === -1) {
// Make a copy so as not to interfere with a current dispatchEvent.
arr = arr.concat([listener]);
}
this._listeners[eventType] = arr;
};
EventTarget.prototype.removeEventListener = function(eventType, listener
) {
var arr = this._listeners[eventType];
if (!arr) {
return;
}
var idx = arr.indexOf(listener);
if (idx !== -1) {
if (arr.length > 1) {
// Make a copy so as not to interfere with a current dispatchEvent
.
this._listeners[eventType] = arr.slice(0, idx).concat(arr.slice(id
x + 1));
} else {
delete this._listeners[eventType];
}
return;
}
};
EventTarget.prototype.dispatchEvent = function() {
var event = arguments[0];
var t = event.type;
// equivalent of Array.prototype.slice.call(arguments, 0);
var args = arguments.length === 1 ? [event] : Array.apply(null, argume
nts);
//
//
//
//
if
TODO: This doesn't match the real behavior; per spec, onfoo get
their place in line from the /first/ time they're set from
non-null. Although WebKit bumps it to the end every time it's
set.
(this['on' + t]) {
this['on' + t].apply(this, args);
}
if (t in this._listeners) {
// Grab a reference to the listeners list. removeEventListener may a
lter the list.
var listeners = this._listeners[t];
for (var i = 0; i < listeners.length; i++) {
listeners[i].apply(this, args);
}
}
};
module.exports = EventTarget;
/***/ },
/* 26 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {module.exports = global.We
bSocket || global.MozWebSocket;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
var
,
,
,
,
,
;
inherits = __webpack_require__(23)
AjaxBasedTransport = __webpack_require__(28)
XhrReceiver = __webpack_require__(32)
XHRCorsObject = __webpack_require__(33)
XHRLocalObject = __webpack_require__(35)
browser = __webpack_require__(36)
function XhrStreamingTransport(transUrl) {
if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {
throw new Error('Transport created when disabled');
}
AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver,
XHRCorsObject);
}
inherits(XhrStreamingTransport, AjaxBasedTransport);
XhrStreamingTransport.enabled = function(info) {
if (info.nullOrigin) {
return false;
}
// Opera doesn't support xhr-streaming #60
// But it might be able to #92
if (browser.isOpera()) {
return false;
}
return XHRCorsObject.enabled;
};
XhrStreamingTransport.transportName = 'xhr-streaming';
XhrStreamingTransport.roundTrips = 2; // preflight, ajax
// Safari gets confused when a streaming ajax request is started
// before onload. This causes the load indicator to spin indefinetely.
// Only require body when used in a browser
XhrStreamingTransport.needBody = !!global.document;
module.exports = XhrStreamingTransport;
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var
,
,
,
;
inherits = __webpack_require__(23)
urlUtils = __webpack_require__(15)
BufferedSender = __webpack_require__(30)
Polling = __webpack_require__(31)
poll.on('message', function(msg) {
debug('message', msg);
self.emit('message', msg);
});
poll.once('close', function(code, reason) {
debug('close', code, reason, self.pollIsClosing);
self.poll = poll = null;
if (!self.pollIsClosing) {
if (reason === 'network') {
self._scheduleReceiver();
} else {
self.emit('close', code || 1006, reason);
self.removeAllListeners();
}
}
});
};
Polling.prototype.abort = function() {
debug('abort');
this.removeAllListeners();
this.pollIsClosing = true;
if (this.poll) {
this.poll.abort();
}
};
module.exports = Polling;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var inherits = __webpack_require__(23)
, EventEmitter = __webpack_require__(24).EventEmitter
;
var debug = function() {};
if (process.env.NODE_ENV !== 'production') {
debug = __webpack_require__(20)('sockjs-client:receiver:xhr');
}
function XhrReceiver(url, AjaxObject) {
debug(url);
EventEmitter.call(this);
var self = this;
this.bufferPosition = 0;
this.xo = new AjaxObject('POST', url, null);
this.xo.on('chunk', this._chunkHandler.bind(this));
this.xo.once('finish', function(status, text) {
debug('finish', status, text);
self._chunkHandler(status, text);
self.xo = null;
var reason = status === 200 ? 'network' : 'permanent';
debug('close', reason);
self.emit('close', null, reason);
self._cleanup();
});
}
inherits(XhrReceiver, EventEmitter);
XhrReceiver.prototype._chunkHandler = function(status, text) {
debug('_chunkHandler', status);
if (status !== 200 || !text) {
return;
}
for (var idx = -1; ; this.bufferPosition += idx + 1) {
var buf = text.slice(this.bufferPosition);
idx = buf.indexOf('\n');
if (idx === -1) {
break;
}
var msg = buf.slice(0, idx);
if (msg) {
debug('message', msg);
this.emit('message', msg);
}
}
};
XhrReceiver.prototype._cleanup = function() {
debug('_cleanup');
this.removeAllListeners();
};
XhrReceiver.prototype.abort = function() {
debug('abort');
if (this.xo) {
this.xo.close();
debug('close');
this.emit('close', null, 'user');
this.xo = null;
}
this._cleanup();
};
module.exports = XhrReceiver;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var inherits = __webpack_require__(23)
, XhrDriver = __webpack_require__(34)
;
EventEmitter = __webpack_require__(24).EventEmitter
inherits = __webpack_require__(23)
utils = __webpack_require__(12)
urlUtils = __webpack_require__(15)
XHR = global.XMLHttpRequest
AbstractXHRObject.prototype.close = function() {
debug('close');
this._cleanup(true);
};
AbstractXHRObject.enabled = !!XHR;
// override XMLHttpRequest for IE6/7
// obfuscate to avoid firewalls
var axo = ['Active'].concat('Object').join('X');
if (!AbstractXHRObject.enabled && (axo in global)) {
debug('overriding xmlhttprequest');
XHR = function() {
try {
return new global[axo]('Microsoft.XMLHTTP');
} catch (e) {
return null;
}
};
AbstractXHRObject.enabled = !!new XHR();
}
var cors = false;
try {
cors = 'withCredentials' in new XHR();
} catch (ignored) {
// intentionally empty
}
AbstractXHRObject.supportsCORS = cors;
module.exports = AbstractXHRObject;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
)), __webpack_require__(11)))
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var inherits = __webpack_require__(23)
, XhrDriver = __webpack_require__(34)
;
function XHRLocalObject(method, url, payload /*, opts */) {
XhrDriver.call(this, method, url, payload, {
noCredentials: true
});
}
inherits(XHRLocalObject, XhrDriver);
XHRLocalObject.enabled = XhrDriver.enabled;
module.exports = XHRLocalObject;
/***/ },
/* 36 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
module.exports = {
isOpera: function() {
return global.navigator &&
/opera/i.test(global.navigator.userAgent);
}
, isKonqueror: function() {
return global.navigator &&
/konqueror/i.test(global.navigator.userAgent);
}
// #187 wrap document.domain in try/catch because of WP8 from file:///
, hasDomain: function () {
// non-browser client always has a domain
if (!global.document) {
return true;
}
try {
return !!global.document.domain;
} catch (e) {
return false;
}
}
};
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var
,
,
,
;
inherits = __webpack_require__(23)
AjaxBasedTransport = __webpack_require__(28)
XhrReceiver = __webpack_require__(32)
XDRObject = __webpack_require__(38)
// According to:
// http://stackoverflow.com/questions/1641507/detect-browser-support-f
or-cross-domain-xmlhttprequests
// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cor
s/
function XdrStreamingTransport(transUrl) {
if (!XDRObject.enabled) {
throw new Error('Transport created when disabled');
}
AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver,
XDRObject);
}
inherits(XdrStreamingTransport, AjaxBasedTransport);
XdrStreamingTransport.enabled = function(info) {
if (info.cookie_needed || info.nullOrigin) {
return false;
}
return XDRObject.enabled && info.sameScheme;
};
XdrStreamingTransport.transportName = 'xdr-streaming';
XdrStreamingTransport.roundTrips = 2; // preflight, ajax
module.exports = XdrStreamingTransport;
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process, global) {'use strict';
var
,
,
,
,
;
EventEmitter = __webpack_require__(24).EventEmitter
inherits = __webpack_require__(23)
eventUtils = __webpack_require__(12)
browser = __webpack_require__(36)
urlUtils = __webpack_require__(15)
xdr.ontimeout = function() {
debug('ontimeout');
self._error();
};
xdr.onprogress = function() {
debug('progress', xdr.responseText);
self.emit('chunk', 200, xdr.responseText);
};
xdr.onload = function() {
debug('load');
self.emit('finish', 200, xdr.responseText);
self._cleanup(false);
};
this.xdr = xdr;
this.unloadRef = eventUtils.unloadAdd(function() {
self._cleanup(true);
});
try {
// Fails with AccessDenied if port number is bogus
this.xdr.open(method, url);
if (this.timeout) {
this.xdr.timeout = this.timeout;
}
this.xdr.send(payload);
} catch (x) {
this._error();
}
};
XDRObject.prototype._error = function() {
this.emit('finish', 0, '');
this._cleanup(false);
};
XDRObject.prototype._cleanup = function(abort) {
debug('cleanup', abort);
if (!this.xdr) {
return;
}
this.removeAllListeners();
eventUtils.unloadDel(this.unloadRef);
this.xdr.ontimeout = this.xdr.onerror = this.xdr.onprogress = this.xdr
.onload = null;
if (abort) {
try {
this.xdr.abort();
} catch (x) {
// intentionally empty
}
}
this.unloadRef = this.xdr = null;
};
XDRObject.prototype.close = function() {
debug('close');
this._cleanup(true);
};
// IE 8/9 if the request target uses the same scheme - #79
inherits = __webpack_require__(23)
AjaxBasedTransport = __webpack_require__(28)
EventSourceReceiver = __webpack_require__(40)
XHRCorsObject = __webpack_require__(33)
EventSourceDriver = __webpack_require__(41)
function EventSourceTransport(transUrl) {
if (!EventSourceTransport.enabled()) {
throw new Error('Transport created when disabled');
}
AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceRec
eiver, XHRCorsObject);
}
inherits(EventSourceTransport, AjaxBasedTransport);
EventSourceTransport.enabled = function() {
return !!EventSourceDriver;
};
EventSourceTransport.transportName = 'eventsource';
EventSourceTransport.roundTrips = 2;
module.exports = EventSourceTransport;
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var inherits = __webpack_require__(23)
, EventEmitter = __webpack_require__(24).EventEmitter
, EventSourceDriver = __webpack_require__(41)
;
var debug = function() {};
if (process.env.NODE_ENV !== 'production') {
debug = __webpack_require__(20)('sockjs-client:receiver:eventsource');
}
function EventSourceReceiver(url) {
debug(url);
EventEmitter.call(this);
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
var inherits = __webpack_require__(23)
, IframeTransport = __webpack_require__(43)
, objectUtils = __webpack_require__(48)
;
module.exports = function(transport) {
function IframeWrapTransport(transUrl, baseUrl) {
IframeTransport.call(this, transport.transportName, transUrl, baseUr
l);
}
inherits(IframeWrapTransport, IframeTransport);
IframeWrapTransport.enabled = function(url, info) {
if (!global.document) {
return false;
}
var iframeInfo = objectUtils.extend({}, info);
iframeInfo.sameOrigin = true;
return transport.enabled(iframeInfo) && IframeTransport.enabled();
};
IframeWrapTransport.transportName = 'iframe-' + transport.transportNam
e;
IframeWrapTransport.needBody = true;
IframeWrapTransport.roundTrips = IframeTransport.roundTrips + transpor
t.roundTrips - 1; // html, javascript (2) + transport - no CORS (1)
IframeWrapTransport.facadeTransport = transport;
return IframeWrapTransport;
};
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
//
//
//
//
//
//
//
,
,
,
,
,
,
,
;
JSON3 = __webpack_require__(44)
EventEmitter = __webpack_require__(24).EventEmitter
version = __webpack_require__(46)
urlUtils = __webpack_require__(15)
iframeUtils = __webpack_require__(47)
eventUtils = __webpack_require__(12)
random = __webpack_require__(13)
IframeTransport.prototype._message = function(e) {
debug('message', e.data);
if (!urlUtils.isOriginEqual(e.origin, this.origin)) {
debug('not same origin', e.origin, this.origin);
return;
}
var iframeMessage;
try {
iframeMessage = JSON3.parse(e.data);
} catch (ignored) {
debug('bad json', e.data);
return;
}
if (iframeMessage.windowId !== this.windowId) {
debug('mismatched window id', iframeMessage.windowId, this.windowId)
;
return;
}
switch (iframeMessage.type) {
case 's':
this.iframeObj.loaded();
// window global dependency
this.postMessage('s', JSON3.stringify([
version
, this.transport
, this.transUrl
, this.baseUrl
]));
break;
case 't':
this.emit('message', iframeMessage.data);
break;
case 'c':
var cdata;
try {
cdata = JSON3.parse(iframeMessage.data);
} catch (ignored) {
debug('bad json', iframeMessage.data);
return;
}
this.emit('close', cdata[0], cdata[1]);
this.close();
break;
}
};
IframeTransport.prototype.postMessage = function(type, data) {
debug('postMessage', type, data);
this.iframeObj.post(JSON3.stringify({
windowId: this.windowId
, type: type
, data: data || ''
}), this.origin);
};
IframeTransport.prototype.send = function(message) {
debug('send', message);
this.postMessage('m', message);
};
IframeTransport.enabled = function() {
return iframeUtils.iframeEnabled;
};
IframeTransport.transportName = 'iframe';
IframeTransport.roundTrips = 2;
module.exports = IframeTransport;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 44 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(m
odule, global) {/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 20
12-2014, Kit Cambridge | http://kit.mit-license.org */
;(function () {
// Detect the `define` function exposed by asynchronous module loaders
. The
// strict `define` check is necessary for compatibility with `r.js`.
var isLoader = "function" === "function" && __webpack_require__(45);
// A set of types used to distinguish objects from primitives.
var objectTypes = {
"function": true,
"object": true
};
// Detect the `exports` object exposed by CommonJS implementations.
var freeExports = objectTypes[typeof exports] && exports && !exports.n
odeType && exports;
// Use the `global` object exposed by Node (including Browserify via
// `insert-module-globals`), Narwhal, and Ringo as the default context
,
// and the `window` object in browsers. Rhino exports a `global` funct
ion
// instead.
var root = objectTypes[typeof window] && window || this,
freeGlobal = freeExports && objectTypes[typeof module] && module &
& !module.nodeType && typeof global == "object" && global;
if (freeGlobal && (freeGlobal["global"] === freeGlobal || freeGlobal["
window"] === freeGlobal || freeGlobal["self"] === freeGlobal)) {
root = freeGlobal;
}
// Public: Initializes JSON 3 using the given `context` object, attach
ing the
// `stringify` and `parse` functions to the specified `exports` object
.
function runInContext(context, exports) {
context || (context = root["Object"]());
exports || (exports = root["Object"]());
// Test `JSON.stringify`.
if (name == "json-stringify") {
var stringify = exports.stringify, stringifySupported = typeof
stringify == "function" && isExtended;
if (stringifySupported) {
// A test function object with a custom `toJSON` method.
(value = function () {
return 1;
}).toJSON = value;
try {
stringifySupported =
// Firefox 3.1b1 and b2 serialize string, number, and bo
olean
// primitives as object literals.
stringify(0) === "0" &&
// FF 3.1b1, b2, and JSON 2 serialize wrapped primitives
as object
// literals.
stringify(new Number()) === "0" &&
stringify(new String()) == '""' &&
// FF 3.1b1, 2 throw an error if the value is `null`, `u
ndefined`, or
// does not define a canonical JSON representation (this
applies to
// objects with `toJSON` properties as well, *unless* th
ey are nested
// within an object or array).
stringify(getClass) === undef &&
// IE 8 serializes `undefined` as `"undefined"`. Safari
<= 5.1.7 and
// FF 3.1b3 pass this test.
stringify(undef) === undef &&
// Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `Type
Error`s,
// respectively, if the value is omitted entirely.
stringify() === undef &&
// FF 3.1b1, 2 throw an error if the given value is not
a number,
// string, array, object, Boolean, or `null` literal. Th
is applies to
// objects with custom `toJSON` methods as well, unless
they are nested
// inside object or array literals. YUI 3.0.0b1 ignores
custom `toJSON`
// methods entirely.
stringify(value) === "1" &&
stringify([value]) == "[1]" &&
// Prototype <= 1.6.1 serializes `[undefined]` as `"[]"`
instead of
// `"[null]"`.
stringify([undef]) == "[null]" &&
// YUI 3.0.0b1 fails to serialize `null` literals.
stringify(null) == "null" &&
// FF 3.1b1, 2 halts serialization if an array contains
a function:
// `[1, true, getClass, 1]` serializes as "[1,true,],".
FF 3.1b3
// elides non-JSON values from objects and arrays, unles
s they
// define custom `toJSON` methods.
};
}
// Internal: Determines if a property is a direct property of the
given
// object. Delegates to the native `Object#hasOwnProperty` method.
if (!(isProperty = objectProto.hasOwnProperty)) {
isProperty = function (property) {
var members = {}, constructor;
if ((members.__proto__ = null, members.__proto__ = {
// The *proto* property cannot be set multiple times in rece
nt
// versions of Firefox and SeaMonkey.
"toString": 1
}, members).toString != getClass) {
// Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`
, but
// supports the mutable *proto* property.
isProperty = function (property) {
// Capture and break the object's prototype chain (see sec
tion 8.6.2
// of the ES 5.1 spec). The parenthesized expression preve
nts an
// unsafe transformation by the Closure Compiler.
var original = this.__proto__, result = property in (this.
__proto__ = null, this);
// Restore the original prototype chain.
this.__proto__ = original;
return result;
};
} else {
// Capture a reference to the top-level `Object` constructor
.
constructor = members.constructor;
// Use the `constructor` property to simulate `Object#hasOwn
Property` in
// other environments.
isProperty = function (property) {
var parent = (this.constructor || constructor).prototype;
return property in this && !(property in parent && this[pr
operty] === parent[property]);
};
}
members = null;
return isProperty.call(this, property);
};
}
// Internal: Normalizes the `for...in` iteration algorithm across
// environments. Each enumerated key is yielded to a `callback` fu
nction.
forEach = function (object, callback) {
var size = 0, Properties, members, property;
// Tests for bugs in the current environment's `for...in` algori
thm. The
// `valueOf` property inherits the non-enumerable flag from
// `Object.prototype` in older versions of IE, Netscape, and Moz
illa.
(Properties = function () {
this.valueOf = 0;
}).prototype.valueOf = 0;
// Iterate over a new instance of the `Properties` class.
members = new Properties();
for (property in members) {
// Ignore all properties inherited from `Object.prototype`.
if (isProperty.call(members, property)) {
size++;
}
}
Properties = members = null;
// Normalize the iteration algorithm.
if (!size) {
// A list of non-enumerable properties inherited from `Object.
prototype`.
members = ["valueOf", "toString", "toLocaleString", "propertyI
sEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"];
// IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed nonenumerable
// properties.
forEach = function (object, callback) {
var isFunction = getClass.call(object) == functionClass, pro
perty, length;
var hasProperty = !isFunction && typeof object.constructor !
= "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProper
ty || isProperty;
for (property in object) {
// Gecko <= 1.0 enumerates the `prototype` property of fun
ctions under
// certain conditions; IE does not.
if (!(isFunction && property == "prototype") && hasPropert
y.call(object, property)) {
callback(property);
}
}
// Manually invoke the callback for each non-enumerable prop
erty.
for (length = members.length; property = members[--length];
hasProperty.call(object, property) && callback(property));
};
} else if (size == 2) {
// Safari <= 2.0.4 enumerates shadowed properties twice.
forEach = function (object, callback) {
// Create a set of iterated properties.
var members = {}, isFunction = getClass.call(object) == func
tionClass, property;
for (property in object) {
// Store each property name to prevent double enumeration.
The
// `prototype` property of functions is not enumerated due
to cross// environment inconsistencies.
if (!(isFunction && property == "prototype") && !isPropert
y.call(members, property) && (members[property] = 1) && isProperty.call(object,
property)) {
callback(property);
}
}
};
} else {
// No bugs detected; use the standard `for...in` algorithm.
forEach = function (object, callback) {
var isFunction = getClass.call(object) == functionClass, pro
perty, isConstructor;
for (property in object) {
if (!(isFunction && property == "prototype") && isProperty
.call(object, property) && !(isConstructor = property === "constructor")) {
callback(property);
}
}
// Manually invoke the callback for the `constructor` proper
ty due to
// cross-environment inconsistencies.
if (isConstructor || isProperty.call(object, (property = "co
nstructor"))) {
callback(property);
}
};
}
return forEach(object, callback);
};
// Public: Serializes a JavaScript `value` as a JSON string. The o
ptional
// `filter` argument may specify either a function that alters how
object and
// array members are serialized, or an array of strings and number
s that
// indicates which properties should be serialized. The optional `
width`
// argument may be either a string or number that specifies the in
dentation
// level of the output.
if (!has("json-stringify")) {
// Internal: A map of control characters and their escaped equiv
alents.
var Escapes = {
92: "\\\\",
34: '\\"',
8: "\\b",
12: "\\f",
10: "\\n",
13: "\\r",
9: "\\t"
};
// Internal: Converts `value` into a zero-padded string such tha
t its
// length is at least equal to `width`. The `width` must be <= 6
.
var leadingZeroes = "000000";
var toPaddedString = function (width, value) {
// The `|| 0` expression is necessary to work around a bug in
// Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`.
return (leadingZeroes + (value || 0)).slice(-width);
};
// Internal: Double-quotes a string `value`, replacing all ASCII
control
// characters (characters with code unit values between 0 and 31
) with
// their escaped equivalents. This is an implementation of the
// `Quote(value)` operation defined in ES 5.1 section 15.12.3.
var unicodePrefix = "\\u00";
var quote = function (value) {
var result = '"', index = 0, length = value.length, useCharInd
ex = !charIndexBuggy || length > 10;
var symbols = useCharIndex && (charIndexBuggy ? value.split(""
) : value);
for (; index < length; index++) {
var charCode = value.charCodeAt(index);
// If the character is a control character, append its Unico
de or
// shorthand escape sequence; otherwise, append the characte
r as-is.
switch (charCode) {
case 8: case 9: case 10: case 12: case 13: case 34: case 9
2:
result += Escapes[charCode];
break;
default:
if (charCode < 32) {
result += unicodePrefix + toPaddedString(2, charCode.t
oString(16));
break;
}
result += useCharIndex ? symbols[index] : value.charAt(i
ndex);
}
}
return result + '"';
};
// Internal: Recursively serializes an object. Implements the
// `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.
var serialize = function (property, object, callback, properties
, whitespace, indentation, stack) {
var value, className, year, month, date, time, hours, minutes,
seconds, milliseconds, results, element, index, length, prefix, result;
try {
// Necessary for host object support.
value = object[property];
} catch (exception) {}
if (typeof value == "object" && value) {
className = getClass.call(value);
if (className == dateClass && !isProperty.call(value, "toJSO
N")) {
if (value > -1 / 0 && value < 1 / 0) {
// Dates are serialized according to the `Date#toJSON` m
ethod
// specified in ES 5.1 section 15.9.5.44. See section 15
.9.1.15
// for the ISO 8601 date time string format.
if (getDay) {
// Manually compute the year, month, date, hours, minu
tes,
// seconds, and milliseconds if the `getUTC*` methods
are
}
}
if (callback) {
// If a replacement function was provided, call it to obtain
the value
// for serialization.
value = callback.call(object, property, value);
}
if (value === null) {
return "null";
}
className = getClass.call(value);
if (className == booleanClass) {
// Booleans are represented literally.
return "" + value;
} else if (className == numberClass) {
// JSON numbers must be finite. `Infinity` and `NaN` are ser
ialized as
// `"null"`.
return value > -1 / 0 && value < 1 / 0 ? "" + value : "null"
;
} else if (className == stringClass) {
// Strings are double-quoted and escaped.
return quote("" + value);
}
// Recursively serialize objects and arrays.
if (typeof value == "object") {
// Check for cyclic structures. This is a linear search; per
formance
// is inversely proportional to the number of unique nested
objects.
for (length = stack.length; length--;) {
if (stack[length] === value) {
// Cyclic structures cannot be serialized by `JSON.strin
gify`.
throw TypeError();
}
}
// Add the object to the stack of traversed objects.
stack.push(value);
results = [];
// Save the current indentation level and indent one additio
nal level.
prefix = indentation;
indentation += whitespace;
if (className == arrayClass) {
// Recursively serialize array elements.
for (index = 0, length = value.length; index < length; ind
ex++) {
element = serialize(index, value, callback, properties,
whitespace, indentation, stack);
results.push(element === undef ? "null" : element);
}
result = results.length ? (whitespace ? "[\n" + indentatio
n + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.joi
n(",") + "]")) : "[]";
} else {
// Recursively serialize object members. Members are selec
ted from
// either a user-specified list of property names, or the
object
// itself.
forEach(properties || value, function (property) {
var element = serialize(property, value, callback, prope
rties, whitespace, indentation, stack);
if (element !== undef) {
// According to ES 5.1 section 15.12.3: "If `gap` {whi
tespace}
// is not the empty string, let `member` {quote(proper
ty) + ":"}
// be the concatenation of `member` and the `space` ch
aracter."
// The "`space` character" refers to the literal space
// character, not the `space` {width} argument provide
d to
// `JSON.stringify`.
results.push(quote(property) + ":" + (whitespace ? " "
: "") + element);
}
});
result = results.length ? (whitespace ? "{\n" + indentatio
n + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.joi
n(",") + "}")) : "{}";
}
// Remove the object from the traversed object stack.
stack.pop();
return result;
}
};
// Public: `JSON.stringify`. See ES 5.1 section 15.12.3.
exports.stringify = function (source, filter, width) {
var whitespace, callback, properties, className;
if (objectTypes[typeof filter] && filter) {
if ((className = getClass.call(filter)) == functionClass) {
callback = filter;
} else if (className == arrayClass) {
// Convert the property names array into a makeshift set.
properties = {};
for (var index = 0, length = filter.length, value; index <
length; value = filter[index++], ((className = getClass.call(value)), className
== stringClass || className == numberClass) && (properties[value] = 1));
}
}
if (width) {
if ((className = getClass.call(width)) == numberClass) {
// Convert the `width` to an integer and create a string c
ontaining
// `width` number of space characters.
if ((width -= width % 1) > 0) {
for (whitespace = "", width > 10 && (width = 10); whites
pace.length < width; whitespace += " ");
}
} else if (className == stringClass) {
whitespace = width.length <= 10 ? width : width.slice(0, 1
0);
}
}
// Opera <= 7.54u2 discards the values associated with empty s
tring keys
case 34:
// `"` delimits a JSON string; advance to the next chara
cter and
// begin parsing the string. String tokens are prefixed
with the
// sentinel `@` character to distinguish them from punct
uators and
// end-of-string tokens.
for (value = "@", Index++; Index < length;) {
charCode = source.charCodeAt(Index);
if (charCode < 32) {
// Unescaped ASCII control characters (those with a
code unit
// less than the space character) are not permitted.
abort();
} else if (charCode == 92) {
// A reverse solidus (`\`) marks the beginning of an
escaped
// control character (including `"`, `\`, and `/`) o
r Unicode
// escape sequence.
charCode = source.charCodeAt(++Index);
switch (charCode) {
case 92: case 34: case 47: case 98: case 116: case
110: case 102: case 114:
// Revive escaped control characters.
value += Unescapes[charCode];
Index++;
break;
case 117:
// `\u` marks the beginning of a Unicode escape
sequence.
// Advance to the first character and validate t
he
// four-digit code point.
begin = ++Index;
for (position = Index + 4; Index < position; Ind
ex++) {
charCode = source.charCodeAt(Index);
// A valid sequence comprises four hexdigits (
case// insensitive) that form a single hexadecimal
value.
if (!(charCode >= 48 && charCode <= 57 || char
Code >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
// Invalid Unicode escape sequence.
abort();
}
}
// Revive the escaped character.
value += fromCharCode("0x" + source.slice(begin,
Index));
break;
default:
// Invalid escape sequence.
abort();
}
} else {
if (charCode == 34) {
// An unescaped double-quote character marks the e
nd of the
// string.
break;
}
charCode = source.charCodeAt(Index);
begin = Index;
// Optimize for the common case where a string is va
lid.
while (charCode >= 32 && charCode != 92 && charCode
!= 34) {
charCode = source.charCodeAt(++Index);
}
// Append the string as-is.
value += source.slice(begin, Index);
}
}
if (source.charCodeAt(Index) == 34) {
// Advance to the next character and return the revive
d string.
Index++;
return value;
}
// Unterminated string.
abort();
default:
// Parse numbers and literals.
begin = Index;
// Advance past the negative sign, if one is specified.
if (charCode == 45) {
isSigned = true;
charCode = source.charCodeAt(++Index);
}
// Parse an integer or floating-point value.
if (charCode >= 48 && charCode <= 57) {
// Leading zeroes are interpreted as octal literals.
if (charCode == 48 && ((charCode = source.charCodeAt(I
ndex + 1)), charCode >= 48 && charCode <= 57)) {
// Illegal octal literal.
abort();
}
isSigned = false;
// Parse the integer component.
for (; Index < length && ((charCode = source.charCodeA
t(Index)), charCode >= 48 && charCode <= 57); Index++);
// Floats cannot contain a leading decimal point; howe
ver, this
// case is already accounted for by the parser.
if (source.charCodeAt(Index) == 46) {
position = ++Index;
// Parse the decimal component.
for (; position < length && ((charCode = source.char
CodeAt(position)), charCode >= 48 && charCode <= 57); position++);
if (position == Index) {
// Illegal trailing decimal.
abort();
}
Index = position;
}
// Parse exponents. The `e` denoting the exponent is
// case-insensitive.
charCode = source.charCodeAt(Index);
if (charCode == 101 || charCode == 69) {
charCode = source.charCodeAt(++Index);
// Skip past the sign following the exponent, if one
is
// specified.
if (charCode == 43 || charCode == 45) {
Index++;
}
// Parse the exponential component.
for (position = Index; position < length && ((charCo
de = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++
);
if (position == Index) {
// Illegal empty exponent.
abort();
}
Index = position;
}
// Coerce the parsed value to a JavaScript number.
return +source.slice(begin, Index);
}
// A negative sign may only precede numbers.
if (isSigned) {
abort();
}
// `true`, `false`, and `null` literals.
if (source.slice(Index, Index + 4) == "true") {
Index += 4;
return true;
} else if (source.slice(Index, Index + 5) == "false") {
Index += 5;
return false;
} else if (source.slice(Index, Index + 4) == "null") {
Index += 4;
return null;
}
// Unrecognized token.
abort();
}
}
// Return the sentinel `$` character if the parser has reached
the end
// of the source string.
return "$";
};
// Internal: Parses a JSON `value` token.
var get = function (value) {
var results, hasMembers;
if (value == "$") {
// Unexpected end of input.
abort();
}
if (typeof value == "string") {
if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") {
// Remove the sentinel `@` character.
return value.slice(1);
}
// Parse object and array literals.
if (value == "[") {
// Parses a JSON array, returning a new JavaScript array.
results = [];
for (;; hasMembers || (hasMembers = true)) {
value = lex();
// A closing square bracket marks the end of the array l
iteral.
if (value == "]") {
break;
}
// If the array literal contains elements, the current t
oken
// should be a comma separating the previous element fro
m the
// next.
if (hasMembers) {
if (value == ",") {
value = lex();
if (value == "]") {
// Unexpected trailing `,` in array literal.
abort();
}
} else {
// A `,` must separate each array element.
abort();
}
}
// Elisions and leading commas are not permitted.
if (value == ",") {
abort();
}
results.push(get(value));
}
return results;
} else if (value == "{") {
// Parses a JSON object, returning a new JavaScript object
.
results = {};
for (;; hasMembers || (hasMembers = true)) {
value = lex();
// A closing curly brace marks the end of the object lit
eral.
if (value == "}") {
break;
}
// If the object literal contains members, the current t
oken
// should be a comma separator.
if (hasMembers) {
if (value == ",") {
value = lex();
if (value == "}") {
// Unexpected trailing `,` in object literal.
abort();
}
} else {
// A `,` must separate each object member.
abort();
}
}
Index = 0;
Source = "" + source;
result = get(lex());
// If a JSON string contains multiple tokens, it is invalid.
if (lex() != "$") {
abort();
}
// Reset the parser state.
Index = Source = null;
return callback && getClass.call(callback) == functionClass ?
walk((value = {}, value[""] = result, value), "", callback) : result;
};
}
}
exports["runInContext"] = runInContext;
return exports;
}
if (freeExports && !isLoader) {
// Export for CommonJS environments.
runInContext(root, freeExports);
} else {
// Export for web browsers and JavaScript engines.
var nativeJSON = root.JSON,
previousJSON = root["JSON3"],
isRestored = false;
var JSON3 = runInContext(root, (root["JSON3"] = {
// Public: Restores the original value of the global `JSON` object
and
// returns a reference to the `JSON3` object.
"noConflict": function () {
if (!isRestored) {
isRestored = true;
root.JSON = nativeJSON;
root["JSON3"] = previousJSON;
nativeJSON = previousJSON = null;
}
return JSON3;
}
}));
root.JSON = {
"parse": JSON3.parse,
"stringify": JSON3.stringify
};
}
// Export for asynchronous module loaders.
if (isLoader) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
return JSON3;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD
_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT_
_));
}
}).call(this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)(module
debug('unattach');
clearTimeout(tref);
// Explorer had problems with that.
try {
iframe.onload = null;
} catch (x) {
// intentionally empty
}
iframe.onerror = null;
};
var cleanup = function() {
debug('cleanup');
if (iframe) {
unattach();
// This timeout makes chrome fire onbeforeunload event
// within iframe. Without the timeout it goes straight to
// onunload.
setTimeout(function() {
if (iframe) {
iframe.parentNode.removeChild(iframe);
}
iframe = null;
}, 0);
eventUtils.unloadDel(unloadRef);
}
};
var onerror = function(err) {
debug('onerror', err);
if (iframe) {
cleanup();
errorCallback(err);
}
};
var post = function(msg, origin) {
debug('post', msg, origin);
try {
// When the iframe is not loaded, IE raises an exception
// on 'contentWindow'.
setTimeout(function() {
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage(msg, origin);
}
}, 0);
} catch (x) {
// intentionally empty
}
};
iframe.src = iframeUrl;
iframe.style.display = 'none';
iframe.style.position = 'absolute';
iframe.onerror = function() {
onerror('onerror');
};
iframe.onload = function() {
debug('onload');
// `onload` is triggered before scripts on the iframe are
// executed. Give it few seconds to actually load stuff.
clearTimeout(tref);
tref = setTimeout(function() {
onerror('onload timeout');
}, 2000);
};
global.document.body.appendChild(iframe);
tref = setTimeout(function() {
onerror('timeout');
}, 15000);
unloadRef = eventUtils.unloadAdd(cleanup);
return {
post: post
, cleanup: cleanup
, loaded: unattach
};
}
/* jshint undef: false, newcap: false */
/* eslint no-undef: 0, new-cap: 0 */
, createHtmlfile: function(iframeUrl, errorCallback) {
var axo = ['Active'].concat('Object').join('X');
var doc = new global[axo]('htmlfile');
var tref, unloadRef;
var iframe;
var unattach = function() {
clearTimeout(tref);
iframe.onerror = null;
};
var cleanup = function() {
if (doc) {
unattach();
eventUtils.unloadDel(unloadRef);
iframe.parentNode.removeChild(iframe);
iframe = doc = null;
CollectGarbage();
}
};
var onerror = function(r) {
debug('onerror', r);
if (doc) {
cleanup();
errorCallback(r);
}
};
var post = function(msg, origin) {
try {
// When the iframe is not loaded, IE raises an exception
// on 'contentWindow'.
setTimeout(function() {
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage(msg, origin);
}
}, 0);
} catch (x) {
// intentionally empty
}
};
doc.open();
doc.write('<html><s' + 'cript>' +
'document.domain="' + global.document.domain + '";' +
'</s' + 'cript></html>');
doc.close();
doc.parentWindow[module.exports.WPrefix] = global[module.exports.WPr
efix];
var c = doc.createElement('div');
doc.body.appendChild(c);
iframe = doc.createElement('iframe');
c.appendChild(iframe);
iframe.src = iframeUrl;
iframe.onerror = function() {
onerror('onerror');
};
tref = setTimeout(function() {
onerror('timeout');
}, 15000);
unloadRef = eventUtils.unloadAdd(cleanup);
return {
post: post
, cleanup: cleanup
, loaded: unattach
};
}
};
module.exports.iframeEnabled = false;
if (global.document) {
// postMessage misbehaves in konqueror 4.6.5 - the messages are delive
red with
// huge delay, or not at all.
module.exports.iframeEnabled = (typeof global.postMessage === 'functio
n' ||
typeof global.postMessage === 'object') && (!browser.isKonqueror());
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11), (fun
ction() { return this; }())))
/***/ },
/* 48 */
/***/ function(module, exports) {
'use strict';
module.exports = {
isObject: function(obj) {
var type = typeof obj;
return type === 'function' || type === 'object' && !!obj;
}
, extend: function(obj) {
if (!this.isObject(obj)) {
return obj;
}
var source, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
source = arguments[i];
for (prop in source) {
if (Object.prototype.hasOwnProperty.call(source, prop)) {
obj[prop] = source[prop];
}
}
}
return obj;
}
};
/***/ },
/* 49 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var
,
,
,
;
inherits = __webpack_require__(23)
HtmlfileReceiver = __webpack_require__(50)
XHRLocalObject = __webpack_require__(35)
AjaxBasedTransport = __webpack_require__(28)
function HtmlFileTransport(transUrl) {
if (!HtmlfileReceiver.enabled) {
throw new Error('Transport created when disabled');
}
AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver,
XHRLocalObject);
}
inherits(HtmlFileTransport, AjaxBasedTransport);
HtmlFileTransport.enabled = function(info) {
return HtmlfileReceiver.enabled && info.sameOrigin;
};
HtmlFileTransport.transportName = 'htmlfile';
HtmlFileTransport.roundTrips = 2;
module.exports = HtmlFileTransport;
/***/ },
/* 50 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process, global) {'use strict';
var
,
,
,
,
;
inherits = __webpack_require__(23)
iframeUtils = __webpack_require__(47)
urlUtils = __webpack_require__(15)
EventEmitter = __webpack_require__(24).EventEmitter
random = __webpack_require__(13)
iframeUtils.polluteGlobalNamespace();
this.id = 'a' + random.string(6);
url = urlUtils.addQuery(url, 'c=' + decodeURIComponent(iframeUtils.WPr
efix + '.' + this.id));
debug('using htmlfile', HtmlfileReceiver.htmlfileEnabled);
var constructFunc = HtmlfileReceiver.htmlfileEnabled ?
iframeUtils.createHtmlfile : iframeUtils.createIframe;
global[iframeUtils.WPrefix][this.id] = {
start: function() {
debug('start');
self.iframeObj.loaded();
}
, message: function(data) {
debug('message', data);
self.emit('message', data);
}
, stop: function() {
debug('stop');
self._cleanup();
self._close('network');
}
};
this.iframeObj = constructFunc(url, function() {
debug('callback');
self._cleanup();
self._close('permanent');
});
}
inherits(HtmlfileReceiver, EventEmitter);
HtmlfileReceiver.prototype.abort = function() {
debug('abort');
this._cleanup();
this._close('user');
};
HtmlfileReceiver.prototype._cleanup = function() {
debug('_cleanup');
if (this.iframeObj) {
this.iframeObj.cleanup();
this.iframeObj = null;
}
delete global[iframeUtils.WPrefix][this.id];
};
HtmlfileReceiver.prototype._close = function(reason) {
debug('_close', reason);
this.emit('close', null, reason);
this.removeAllListeners();
};
HtmlfileReceiver.htmlfileEnabled = false;
// obfuscate to avoid firewalls
var axo = ['Active'].concat('Object').join('X');
if (axo in global) {
try {
HtmlfileReceiver.htmlfileEnabled = !!new global[axo]('htmlfile');
} catch (x) {
// intentionally empty
}
}
HtmlfileReceiver.enabled = HtmlfileReceiver.htmlfileEnabled || iframeUti
ls.iframeEnabled;
module.exports = HtmlfileReceiver;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11), (fun
ction() { return this; }())))
/***/ },
/* 51 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var
,
,
,
,
;
inherits = __webpack_require__(23)
AjaxBasedTransport = __webpack_require__(28)
XhrReceiver = __webpack_require__(32)
XHRCorsObject = __webpack_require__(33)
XHRLocalObject = __webpack_require__(35)
function XhrPollingTransport(transUrl) {
if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {
throw new Error('Transport created when disabled');
}
AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XHRCorsOb
ject);
}
inherits(XhrPollingTransport, AjaxBasedTransport);
XhrPollingTransport.enabled = function(info) {
if (info.nullOrigin) {
return false;
}
if (XHRLocalObject.enabled && info.sameOrigin) {
return true;
}
return XHRCorsObject.enabled;
};
XhrPollingTransport.transportName = 'xhr-polling';
XhrPollingTransport.roundTrips = 2; // preflight, ajax
module.exports = XhrPollingTransport;
/***/ },
/* 52 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var
,
,
,
,
;
inherits = __webpack_require__(23)
AjaxBasedTransport = __webpack_require__(28)
XdrStreamingTransport = __webpack_require__(37)
XhrReceiver = __webpack_require__(32)
XDRObject = __webpack_require__(38)
function XdrPollingTransport(transUrl) {
if (!XDRObject.enabled) {
throw new Error('Transport created when disabled');
}
AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XDRObject
);
}
inherits(XdrPollingTransport, AjaxBasedTransport);
XdrPollingTransport.enabled = XdrStreamingTransport.enabled;
XdrPollingTransport.transportName = 'xdr-polling';
XdrPollingTransport.roundTrips = 2; // preflight, ajax
module.exports = XdrPollingTransport;
/***/ },
/* 53 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
// The simplest and most robust transport, using the well-know cross
// domain hack - JSONP. This transport is quite inefficient - one
// message could use up to one http request. But at least it works almos
t
// everywhere.
// Known limitations:
// o you will get a spinning cursor
// o for Konqueror a dumb timer is needed to detect errors
var
,
,
,
;
inherits = __webpack_require__(23)
SenderReceiver = __webpack_require__(29)
JsonpReceiver = __webpack_require__(54)
jsonpSender = __webpack_require__(55)
function JsonPTransport(transUrl) {
if (!JsonPTransport.enabled()) {
throw new Error('Transport created when disabled');
}
SenderReceiver.call(this, transUrl, '/jsonp', jsonpSender, JsonpReceiv
er);
}
inherits(JsonPTransport, SenderReceiver);
JsonPTransport.enabled = function() {
return !!global.document;
};
JsonPTransport.transportName = 'jsonp-polling';
JsonPTransport.roundTrips = 1;
JsonPTransport.needBody = true;
module.exports = JsonPTransport;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 54 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process, global) {'use strict';
var
,
,
,
,
,
;
utils = __webpack_require__(47)
random = __webpack_require__(13)
browser = __webpack_require__(36)
urlUtils = __webpack_require__(15)
inherits = __webpack_require__(23)
EventEmitter = __webpack_require__(24).EventEmitter
JsonpReceiver.timeout = 35000;
JsonpReceiver.scriptErrorTimeout = 1000;
JsonpReceiver.prototype._callback = function(data) {
debug('_callback', data);
this._cleanup();
if (this.aborting) {
return;
}
if (data) {
debug('message', data);
this.emit('message', data);
}
this.emit('close', null, 'network');
this.removeAllListeners();
};
JsonpReceiver.prototype._abort = function(err) {
debug('_abort', err);
this._cleanup();
this.aborting = true;
this.emit('close', err.code, err.message);
this.removeAllListeners();
};
JsonpReceiver.prototype._cleanup = function() {
debug('_cleanup');
clearTimeout(this.timeoutId);
if (this.script2) {
this.script2.parentNode.removeChild(this.script2);
this.script2 = null;
}
if (this.script) {
var script = this.script;
// Unfortunately, you can't really abort script loading of
// the script.
script.parentNode.removeChild(script);
script.onreadystatechange = script.onerror =
script.onload = script.onclick = null;
this.script = null;
}
delete global[utils.WPrefix][this.id];
};
JsonpReceiver.prototype._scriptError = function() {
debug('_scriptError');
var self = this;
if (this.errorTimer) {
return;
}
this.errorTimer = setTimeout(function() {
if (!self.loadedOkay) {
self._abort(new Error('JSONP script loaded abnormally (onerror)'))
;
}
}, JsonpReceiver.scriptErrorTimeout);
};
JsonpReceiver.prototype._createScript = function(url) {
debug('_createScript', url);
var self = this;
var script = this.script = global.document.createElement('script');
var script2; // Opera synchronous load trick.
script.id = 'a' + random.string(8);
script.src = url;
script.type = 'text/javascript';
script.charset = 'UTF-8';
script.onerror = this._scriptError.bind(this);
script.onload = function() {
debug('onload');
self._abort(new Error('JSONP script loaded abnormally (onload)'));
};
// IE9 fires 'error' event after onreadystatechange or before, in rand
om order.
// Use loadedOkay to determine if actually errored
script.onreadystatechange = function() {
debug('onreadystatechange', script.readyState);
if (/loaded|closed/.test(script.readyState)) {
if (script && script.htmlFor && script.onclick) {
self.loadedOkay = true;
try {
// In IE, actually execute the script.
script.onclick();
} catch (x) {
// intentionally empty
}
}
if (script) {
self._abort(new Error('JSONP script loaded abnormally (onreadyst
atechange)'));
}
}
};
// IE: event/htmlFor/onclick trick.
// One can't rely on proper order for onreadystatechange. In order to
// make sure, set a 'htmlFor' and 'event' properties, so that
// script code will be installed as 'onclick' handler for the
// script object. Later, onreadystatechange, manually execute this
// code. FF and Chrome doesn't work with 'event' and 'htmlFor'
// set. For reference see:
// http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.
html
// Also, read on that about script ordering:
// http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
if (typeof script.async === 'undefined' && global.document.attachEvent
) {
// According to mozilla docs, in recent browsers script.async defaul
ts
// to 'true', so we may use it to detect a good browser:
// https://developer.mozilla.org/en/HTML/Element/script
if (!browser.isOpera()) {
// Naively assume we're in IE
try {
script.htmlFor = script.id;
script.event = 'onclick';
} catch (x) {
// intentionally empty
}
script.async = true;
} else {
// Opera, second sync script hack
script2 = this.script2 = global.document.createElement('script');
script2.text = "try{var a = document.getElementById('" + script.id
+ "'); if(a)a.onerror();}catch(x){};";
script.async = script2.async = false;
}
}
if (typeof script.async !== 'undefined') {
script.async = true;
}
var head = global.document.getElementsByTagName('head')[0];
head.insertBefore(script, head.firstChild);
if (script2) {
head.insertBefore(script2, head.firstChild);
}
};
module.exports = JsonpReceiver;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11), (fun
ction() { return this; }())))
/***/ },
/* 55 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process, global) {'use strict';
var random = __webpack_require__(13)
, urlUtils = __webpack_require__(15)
;
var debug = function() {};
if (process.env.NODE_ENV !== 'production') {
debug = __webpack_require__(20)('sockjs-client:sender:jsonp');
}
var form, area;
function createIframe(id) {
debug('createIframe', id);
try {
// ie6 dynamic iframes with target="" support (thanks Chris Lambache
r)
return global.document.createElement('<iframe name="' + id + '">');
} catch (x) {
var iframe = global.document.createElement('iframe');
iframe.name = id;
return iframe;
}
}
function createForm() {
debug('createForm');
form = global.document.createElement('form');
form.style.display = 'none';
form.style.position = 'absolute';
form.method = 'POST';
form.enctype = 'application/x-www-form-urlencoded';
form.acceptCharset = 'UTF-8';
area = global.document.createElement('textarea');
area.name = 'd';
form.appendChild(area);
global.document.body.appendChild(form);
}
module.exports = function(url, payload, callback) {
debug(url, payload);
if (!form) {
createForm();
}
var id = 'a' + random.string(8);
form.target = id;
form.action = urlUtils.addQuery(urlUtils.addPath(url, '/jsonp_send'),
'i=' + id);
var iframe = createIframe(id);
iframe.id = id;
iframe.style.display = 'none';
form.appendChild(iframe);
try {
area.value = payload;
} catch (e) {
// seriously broken browsers get here
}
form.submit();
var completed = function(err) {
debug('completed', id, err);
if (!iframe.onerror) {
return;
}
iframe.onreadystatechange = iframe.onerror = iframe.onload = null;
// Opera mini doesn't like if we GC iframe
// immediately, thus this timeout.
setTimeout(function() {
debug('cleaning up', id);
iframe.parentNode.removeChild(iframe);
iframe = null;
}, 500);
area.value = '';
// It is not possible to detect if the iframe succeeded or
// failed to submit our form.
callback(err);
};
iframe.onerror = function() {
debug('onerror', id);
completed();
};
iframe.onload = function() {
debug('onload', id);
completed();
};
iframe.onreadystatechange = function(e) {
debug('onreadystatechange', id, iframe.readyState, e);
if (iframe.readyState === 'complete') {
completed();
}
};
return function() {
debug('aborted', id);
completed(new Error('Aborted'));
};
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11), (fun
ction() { return this; }())))
/***/ },
/* 56 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process, global) {'use strict';
__webpack_require__(57);
var
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
;
URL = __webpack_require__(16)
inherits = __webpack_require__(23)
JSON3 = __webpack_require__(44)
random = __webpack_require__(13)
escape = __webpack_require__(58)
urlUtils = __webpack_require__(15)
eventUtils = __webpack_require__(12)
transport = __webpack_require__(59)
objectUtils = __webpack_require__(48)
browser = __webpack_require__(36)
log = __webpack_require__(60)
Event = __webpack_require__(61)
EventTarget = __webpack_require__(25)
loc = __webpack_require__(62)
CloseEvent = __webpack_require__(63)
TransportMessageEvent = __webpack_require__(64)
InfoReceiver = __webpack_require__(65)
sortedProtocols.forEach(function(proto, i) {
if (!proto) {
throw new SyntaxError("The protocols entry '" + proto + "' is inva
lid.");
}
if (i < (sortedProtocols.length - 1) && proto === sortedProtocols[i
+ 1]) {
throw new SyntaxError("The protocols entry '" + proto + "' is dupl
icated.");
}
});
// Step 6 - convert origin
var o = urlUtils.getOrigin(loc.href);
this._origin = o ? o.toLowerCase() : null;
// remove the trailing slash
parsedUrl.set('pathname', parsedUrl.pathname.replace(/\/+$/, ''));
// store the sanitized url
this.url = parsedUrl.href;
debug('using url', this.url);
// Step 7 - start connection in background
// obtain server info
// http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#
section-26
this._urlInfo = {
nullOrigin: !browser.hasDomain()
, sameOrigin: urlUtils.isOriginEqual(this.url, loc.href)
, sameScheme: urlUtils.isSchemeEqual(this.url, loc.href)
};
this._ir = new InfoReceiver(this.url, this._urlInfo);
this._ir.once('finish', this._receiveInfo.bind(this));
}
inherits(SockJS, EventTarget);
function userSetCode(code) {
return code === 1000 || (code >= 3000 && code <= 4999);
}
SockJS.prototype.close = function(code, reason) {
// Step 1
if (code && !userSetCode(code)) {
throw new Error('InvalidAccessError: Invalid code');
}
// Step 2.4 states the max is 123 bytes, but we are just checking leng
th
if (reason && reason.length > 123) {
throw new SyntaxError('reason argument has an invalid length');
}
// Step 3.1
if (this.readyState === SockJS.CLOSING || this.readyState === SockJS.C
LOSED) {
return;
}
// connection.
this._close(1006, 'Server lost session');
}
};
SockJS.prototype._close = function(code, reason, wasClean) {
debug('_close', this.transport, code, reason, wasClean, this.readyStat
e);
var forceFail = false;
if (this._ir) {
forceFail = true;
this._ir.close();
this._ir = null;
}
if (this._transport) {
this._transport.close();
this._transport = null;
this.transport = null;
}
if (this.readyState === SockJS.CLOSED) {
throw new Error('InvalidStateError: SockJS has already been closed')
;
}
this.readyState = SockJS.CLOSING;
setTimeout(function() {
this.readyState = SockJS.CLOSED;
if (forceFail) {
this.dispatchEvent(new Event('error'));
}
var e = new CloseEvent('close');
e.wasClean = wasClean || false;
e.code = code || 1000;
e.reason = reason;
this.dispatchEvent(e);
this.onmessage = this.onclose = this.onerror = null;
debug('disconnected');
}.bind(this), 0);
};
// See: http://www.erg.abdn.ac.uk/~gerrit/dccp/notes/ccid2/rto_estimator
/
// and RFC 2988.
SockJS.prototype.countRTO = function(rtt) {
// In a local environment, when using IE8/9 and the `jsonp-polling`
// transport the time needed to establish a connection (the time that
pass
// from the opening of the transport to the call of `_dispatchOpen`) i
s
// around 200msec (the lower bound used in the article above) and this
// causes spurious timeouts. For this reason we calculate a value slig
htly
// larger than that used in the article.
if (rtt > 100) {
return 4 * rtt; // rto > 400msec
}
return 300 + rtt; // 300msec < rto <= 400msec
};
module.exports = function(availableTransports) {
transports = transport(availableTransports);
__webpack_require__(70)(SockJS, availableTransports);
return SockJS;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11), (fun
ction() { return this; }())))
/***/ },
/* 57 */
/***/ function(module, exports) {
/* eslint-disable */
/* jscs: disable */
'use strict';
// pulled specific shims from https://github.com/es-shims/es5-shim
var
var
var
var
var
ArrayPrototype = Array.prototype;
ObjectPrototype = Object.prototype;
FunctionPrototype = Function.prototype;
StringPrototype = String.prototype;
array_slice = ArrayPrototype.slice;
});
};
} else {
defineProperty = function (object, name, method, forceAssign) {
if (!forceAssign && (name in object)) { return; }
object[name] = method;
};
}
var defineProperties = function (object, map, forceAssign) {
for (var name in map) {
if (ObjectPrototype.hasOwnProperty.call(map, name)) {
defineProperty(object, name, map[name], forceAssign);
}
}
};
var toObject = function (o) {
if (o == null) { // this matches both null and undefined
throw new TypeError("can't convert " + o + ' to object');
}
return Object(o);
};
//
// Util
// ======
//
// ES5 9.4
// http://es5.github.com/#x9.4
// http://jsperf.com/to-integer
function toInteger(num) {
var n = +num;
if (n !== n) { // isNaN
n = 0;
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
return n;
}
function ToUint32(x) {
return x >>> 0;
}
//
// Function
// ========
//
// ES-5 15.3.4.5
// http://es5.github.com/#x15.3.4.5
function Empty() {}
defineProperties(FunctionPrototype, {
bind: function bind(that) { // .length is 1
// 1. Let Target be the this value.
var target = this;
me
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Construct]] int
ernal
//
} else {
// 15.3.4.5.1 [[Call]]
// When the [[Call]] internal method of a function objec
t, F,
// which was created using the bind function is called w
ith a
// this value and a list of arguments ExtraArgs, the fol
lowing
// steps are taken:
// 1. Let boundArgs be the value of F's [[BoundArgs]] in
ternal
// property.
// 2. Let boundThis be the value of F's [[BoundThis]] in
ternal
// property.
// 3. Let target be the value of F's [[TargetFunction]]
internal
// property.
// 4. Let args be a new list containing the same values
as the
//
me
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Call]] internal
method
//
//
//
h of A.
chever is
//
larger.
// 16. Else set the length own property of F to 0.
var boundLength = Math.max(0, target.length - args.length);
// 17. Set the attributes of the length own property of F to the
values
// specified in 15.3.5.1.
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
// XXX Build a dynamic function with desired amount of arguments
is the only
// way to set the length property of a function.
nd
// false.
// 21. Call the [[DefineOwnProperty]] internal method of F with
// arguments "arguments", PropertyDescriptor {[[Get]]: thrower
,
//
//
and false.
false},
// TODO
// NOTE Function objects created using Function.prototype.bind d
o not
// have a prototype property or the [[Code]], [[FormalParameters
]], and
// [[Scope]] internal properties.
// XXX can't delete prototype in pure-js.
// 22. Return F.
return bound;
}
});
//
// Array
// =====
//
// ES5 15.4.3.2
// http://es5.github.com/#x15.4.3.2
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/
Array/isArray
defineProperties(Array, { isArray: isArray });
if (!length) {
return -1;
}
var i = 0;
if (arguments.length > 1) {
i = toInteger(arguments[1]);
}
// handle negative indices
i = i >= 0 ? i : Math.max(0, length + i);
for (; i < length; i++) {
if (i in self && self[i] === sought) {
return i;
}
}
return -1;
}
}, hasFirefox2IndexOfBug);
//
// String
// ======
//
// ES5 15.5.4.14
// http://es5.github.com/#x15.5.4.14
//
//
//
//
//
//
//
//
//
//
//
ot
}
// If `separator` is not a regex, use native split
if (_toString.call(separator) !== '[object RegExp]') {
return string_split.call(this, separator, limit);
}
var output = [],
flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.extended ? 'x' : '') + // Proposed
for ES6
(separator.sticky
? 'y' : ''), // Firefox 3+
lastLastIndex = 0,
// Make `global` and avoid `lastIndex` issues by working
with a copy
separator2, match, lastIndex, lastLength;
separator = new RegExp(separator.source, flags + 'g');
string += ''; // Type-convert
if (!compliantExecNpcg) {
// Doesn't need flags gy, but they don't hurt
separator2 = new RegExp('^' + separator.source + '$(?!\\
s)', flags);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // Math.pow(2, 32) - 1
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit
> 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limi
t))
* If other: Type-convert, then use the above rules
*/
limit = limit === void 0 ?
-1 >>> 0 : // Math.pow(2, 32) - 1
ToUint32(limit);
while (match = separator.exec(string)) {
// `separator.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0].length;
if (lastIndex > lastLastIndex) {
output.push(string.slice(lastLastIndex, match.index)
);
// Fix browsers whose `exec` methods don't consisten
tly return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1) {
match[0].replace(separator2, function () {
for (var i = 1; i < arguments.length - 2; i+
+) {
if (arguments[i] === void 0) {
match[i] = void 0;
}
}
});
}
if (match.length > 1 && match.index < string.length)
{
ArrayPrototype.push.apply(output, match.slice(1)
);
}
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= limit) {
break;
}
}
if (separator.lastIndex === match.index) {
separator.lastIndex++; // Avoid an infinite loop
}
}
if (lastLastIndex === string.length) {
if (lastLength || !separator.test('')) {
output.push('');
}
} else {
output.push(string.slice(lastLastIndex));
}
return output.length > limit ? output.slice(0, limit) : outp
ut;
};
}());
// [bugfix, chrome]
// If separator is undefined, then the result array contains just one St
ring,
// which is the this value (converted to a String). If limit is not unde
fined,
// then the output array is truncated so that it contains no more than l
imit
// elements.
// "0".split(undefined, 0) -> []
} else if ('0'.split(void 0, 0).length) {
StringPrototype.split = function split(separator, limit) {
if (separator === void 0 && limit === 0) { return []; }
return string_split.call(this, separator, limit);
};
}
// ES5 15.5.4.20
// whitespace from: http://es5.github.io/#x15.5.4.20
var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u20
03' +
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028'
+
'\u2029\uFEFF';
var zeroWidth = '\u200b';
var wsRegexChars = '[' + ws + ']';
var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*'
);
var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWi
dth.trim());
defineProperties(StringPrototype, {
// http://blog.stevenlevithan.com/archives/faster-trim-javascript
// http://perfectionkills.com/whitespace-deviations/
trim: function trim() {
if (this === void 0 || this === null) {
throw new TypeError("can't convert " + this + ' to object');
}
return String(this).replace(trimBeginRegexp, '').replace(trimEnd
Regexp, '');
}
}, hasTrimWhitespaceBug);
//
//
//
//
//
IE
var string_substr = StringPrototype.substr;
var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
defineProperties(StringPrototype, {
substr: function substr(start, length) {
return string_substr.call(
this,
start < 0 ? ((start = this.length + start) < 0 ? 0 : start)
: start,
length
);
}
}, hasNegativeSubstrBug);
/***/ },
/* 58 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var JSON3 = __webpack_require__(44);
// Some extra characters that Chrome gets wrong, and substitutes with
// something else on the wire.
var extraEscapable = /[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u
033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u038
7\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\
u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u074
3\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a
59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0
f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u
1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u
1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1
ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b
\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\uf
a1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\
ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uf
fff]/g
, extraLookup;
// This may be quite slow, so let's delay until user actually uses bad
// characters.
var unrollLookup = function(escapable) {
var i;
var unrolled = {};
var c = [];
for (i = 0; i < 65536; i++) {
c.push( String.fromCharCode(i) );
}
escapable.lastIndex = 0;
c.join('').replace(escapable, function(a) {
unrolled[ a ] = '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slic
e(-4);
return '';
});
escapable.lastIndex = 0;
return unrolled;
};
// Quote string, also taking care of unicode characters that browsers
// often break. Especially, take care of unicode surrogates:
// http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Surrogates
module.exports = {
quote: function(string) {
var quoted = JSON3.stringify(string);
// In most cases this should be very fast and good enough.
extraEscapable.lastIndex = 0;
if (!extraEscapable.test(quoted)) {
return quoted;
}
if (!extraLookup) {
extraLookup = unrollLookup(extraEscapable);
}
return quoted.replace(extraEscapable, function(a) {
return extraLookup[a];
});
}
};
/***/ },
/* 59 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var debug = function() {};
if (process.env.NODE_ENV !== 'production') {
debug = __webpack_require__(20)('sockjs-client:utils:transport');
}
module.exports = function(availableTransports) {
return {
filterToEnabled: function(transportsWhitelist, info) {
var transports = {
main: []
, facade: []
};
if (!transportsWhitelist) {
transportsWhitelist = [];
} else if (typeof transportsWhitelist === 'string') {
transportsWhitelist = [transportsWhitelist];
}
availableTransports.forEach(function(trans) {
if (!trans) {
return;
}
if (trans.transportName === 'websocket' && info.websocket === fa
lse) {
debug('disabled from server', 'websocket');
return;
}
if (transportsWhitelist.length &&
transportsWhitelist.indexOf(trans.transportName) === -1) {
debug('not in whitelist', trans.transportName);
return;
}
if (trans.enabled(info)) {
debug('enabled', trans.transportName);
transports.main.push(trans);
if (trans.facadeTransport) {
transports.facade.push(trans.facadeTransport);
}
} else {
debug('disabled', trans.transportName);
}
});
return transports;
}
};
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 60 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
var logObject = {};
['log', 'debug', 'warn'].forEach(function (level) {
var levelExists;
try {
levelExists = global.console && global.console[level] && global.cons
ole[level].apply;
} catch(e) {
// do nothing
}
logObject[level] = levelExists ? function () {
return global.console[level].apply(global.console, arguments);
} : (level === 'log' ? function () {} : logObject.log);
});
module.exports = logObject;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }(
))))
/***/ },
/* 61 */
}
inherits(CloseEvent, Event);
module.exports = CloseEvent;
/***/ },
/* 64 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var inherits = __webpack_require__(23)
, Event = __webpack_require__(61)
;
function TransportMessageEvent(data) {
Event.call(this);
this.initEvent('message', false, false);
this.data = data;
}
inherits(TransportMessageEvent, Event);
module.exports = TransportMessageEvent;
/***/ },
/* 65 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var
,
,
,
,
,
,
,
,
;
EventEmitter = __webpack_require__(24).EventEmitter
inherits = __webpack_require__(23)
urlUtils = __webpack_require__(15)
XDR = __webpack_require__(38)
XHRCors = __webpack_require__(33)
XHRLocal = __webpack_require__(35)
XHRFake = __webpack_require__(66)
InfoIframe = __webpack_require__(67)
InfoAjax = __webpack_require__(69)
inherits(InfoReceiver, EventEmitter);
// TODO this is currently ignoring the list of available transports and
the whitelist
InfoReceiver._getReceiver = function(baseUrl, url, urlInfo) {
// determine method of CORS support (if needed)
if (urlInfo.sameOrigin) {
return new InfoAjax(url, XHRLocal);
}
if (XHRCors.enabled) {
return new InfoAjax(url, XHRCors);
}
if (XDR.enabled && urlInfo.sameScheme) {
return new InfoAjax(url, XDR);
}
if (InfoIframe.enabled()) {
return new InfoIframe(baseUrl, url);
}
return new InfoAjax(url, XHRFake);
};
InfoReceiver.prototype.doXhr = function(baseUrl, urlInfo) {
var self = this
, url = urlUtils.addPath(baseUrl, '/info')
;
debug('doXhr', url);
this.xo = InfoReceiver._getReceiver(baseUrl, url, urlInfo);
this.timeoutRef = setTimeout(function() {
debug('timeout');
self._cleanup(false);
self.emit('finish');
}, InfoReceiver.timeout);
this.xo.once('finish', function(info, rtt) {
debug('finish', info, rtt);
self._cleanup(true);
self.emit('finish', info, rtt);
});
};
InfoReceiver.prototype._cleanup = function(wasClean) {
debug('_cleanup');
clearTimeout(this.timeoutRef);
this.timeoutRef = null;
if (!wasClean && this.xo) {
this.xo.close();
}
this.xo = null;
};
InfoReceiver.prototype.close = function() {
debug('close');
this.removeAllListeners();
this._cleanup(false);
};
InfoReceiver.timeout = 8000;
module.exports = InfoReceiver;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 66 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var EventEmitter = __webpack_require__(24).EventEmitter
, inherits = __webpack_require__(23)
;
function XHRFake(/* method, url, payload, opts */) {
var self = this;
EventEmitter.call(this);
this.to = setTimeout(function() {
self.emit('finish', 200, '{}');
}, XHRFake.timeout);
}
inherits(XHRFake, EventEmitter);
XHRFake.prototype.close = function() {
clearTimeout(this.to);
};
XHRFake.timeout = 2000;
module.exports = XHRFake;
/***/ },
/* 67 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process, global) {'use strict';
var
,
,
,
,
,
;
EventEmitter = __webpack_require__(24).EventEmitter
inherits = __webpack_require__(23)
JSON3 = __webpack_require__(44)
utils = __webpack_require__(12)
IframeTransport = __webpack_require__(43)
InfoReceiverIframe = __webpack_require__(68)
,
,
,
,
;
EventEmitter = __webpack_require__(24).EventEmitter
JSON3 = __webpack_require__(44)
XHRLocalObject = __webpack_require__(35)
InfoAjax = __webpack_require__(69)
function InfoReceiverIframe(transUrl) {
var self = this;
EventEmitter.call(this);
this.ir = new InfoAjax(transUrl, XHRLocalObject);
this.ir.once('finish', function(info, rtt) {
self.ir = null;
self.emit('message', JSON3.stringify([info, rtt]));
});
}
inherits(InfoReceiverIframe, EventEmitter);
InfoReceiverIframe.transportName = 'iframe-info-receiver';
InfoReceiverIframe.prototype.close = function() {
if (this.ir) {
this.ir.close();
this.ir = null;
}
this.removeAllListeners();
};
module.exports = InfoReceiverIframe;
/***/ },
/* 69 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var
,
,
,
;
EventEmitter = __webpack_require__(24).EventEmitter
inherits = __webpack_require__(23)
JSON3 = __webpack_require__(44)
objectUtils = __webpack_require__(48)
if (text) {
try {
info = JSON3.parse(text);
} catch (e) {
debug('bad json', text);
}
}
if (!objectUtils.isObject(info)) {
info = {};
}
}
self.emit('finish', info, rtt);
self.removeAllListeners();
});
}
inherits(InfoAjax, EventEmitter);
InfoAjax.prototype.close = function() {
this.removeAllListeners();
this.xo.close();
};
module.exports = InfoAjax;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var
,
,
,
,
,
,
;
urlUtils = __webpack_require__(15)
eventUtils = __webpack_require__(12)
JSON3 = __webpack_require__(44)
FacadeJS = __webpack_require__(71)
InfoIframeReceiver = __webpack_require__(68)
iframeUtils = __webpack_require__(47)
loc = __webpack_require__(62)
var parentOrigin;
/* eslint-disable camelcase */
SockJS.bootstrap_iframe = function() {
/* eslint-enable camelcase */
var facade;
iframeUtils.currentWindowId = loc.hash.slice(1);
var onMessage = function(e) {
if (e.source !== parent) {
return;
}
if (typeof parentOrigin === 'undefined') {
parentOrigin = e.origin;
}
if (e.origin !== parentOrigin) {
return;
}
var iframeMessage;
try {
iframeMessage = JSON3.parse(e.data);
} catch (ignored) {
debug('bad json', e.data);
return;
}
if (iframeMessage.windowId !== iframeUtils.currentWindowId) {
return;
}
switch (iframeMessage.type) {
case 's':
var p;
try {
p = JSON3.parse(iframeMessage.data);
} catch (ignored) {
debug('bad json', iframeMessage.data);
break;
}
var version = p[0];
var transport = p[1];
var transUrl = p[2];
var baseUrl = p[3];
debug(version, transport, transUrl, baseUrl);
// change this to semver logic
if (version !== SockJS.version) {
throw new Error('Incompatible SockJS! Main site uses:' +
' "' + version + '", the iframe:' +
' "' + SockJS.version + '".');
}
if (!urlUtils.isOriginEqual(transUrl, loc.href) ||
!urlUtils.isOriginEqual(baseUrl, loc.href)) {
throw new Error('Can\'t connect to different domain from withi
n an ' +
'iframe. (' + loc.href + ', ' + transUrl + ', ' + ba
seUrl + ')');
}
facade = new FacadeJS(new transportMap[transport](transUrl, base
Url));
break;
case 'm':
facade._send(iframeMessage.data);
break;
case 'c':
if (facade) {
facade._close();
}
facade = null;
break;
}
};
eventUtils.attachEvent('message', onMessage);
// Start
iframeUtils.postMessage('s');
};
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 71 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var JSON3 = __webpack_require__(44)
, iframeUtils = __webpack_require__(47)
;
function FacadeJS(transport) {
this._transport = transport;
transport.on('message', this._transportMessage.bind(this));
transport.on('close', this._transportClose.bind(this));
}
FacadeJS.prototype._transportClose = function(code, reason) {
iframeUtils.postMessage('c', JSON3.stringify([code, reason]));
};
FacadeJS.prototype._transportMessage = function(frame) {
iframeUtils.postMessage('t', frame);
};
FacadeJS.prototype._send = function(data) {
this._transport.send(data);
};
FacadeJS.prototype._close = function() {
this._transport.close();
this._transport.removeAllListeners();
};
module.exports = FacadeJS;
/***/ },
/* 72 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var ansiRegex = __webpack_require__(73)();
}, function(err, renewedModules) {
if(err) {
if(module.hot.status() in {
abort: 1,
fail: 1
}) {
console.warn("[HMR] Cann
ot apply update. Need to do a full reload!");
console.warn("[HMR] " +
err.stack || err.message);
} else {
console.warn("[HMR] Upda
te failed: " + err.stack || err.message);
}
return;
}
if(!upToDate()) {
check();
}
__webpack_require__(75)(updatedModules,
renewedModules);
if(upToDate()) {
console.log("[HMR] App is up to
date.");
}
});
});
};
var addEventListener = window.addEventListener ? function(eventN
ame, listener) {
window.addEventListener(eventName, listener, false);
} : function(eventName, listener) {
window.attachEvent("on" + eventName, listener);
};
addEventListener("message", function(event) {
if(typeof event.data === "string" && event.data.indexOf(
"webpackHotUpdate") === 0) {
lastData = event.data;
if(!upToDate() && module.hot.status() === "idle"
) {
console.log("[HMR] Checking for updates
on the server...");
check();
}
}
});
console.log("[HMR] Waiting for update signal from WDS...");
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
}
/***/ },
/* 75 */
/***/ function(module, exports) {
/*
/***/ },
/* 80 */
/***/ function(module, exports) {
'use strict';
/**
* Returns a function that establishes the first prototype passed to it
* as the "source of truth" and patches its methods on subsequent invoca
tions,
* also patching current and previous prototypes to forward calls to it.
*/
module.exports = function makeAssimilatePrototype() {
var storedPrototype,
knownPrototypes = [];
function wrapMethod(key) {
return function () {
if (storedPrototype[key]) {
return storedPrototype[key].apply(this, arguments);
}
};
}
function patchProperty(proto, key) {
proto[key] = storedPrototype[key];
if (typeof proto[key] !== 'function' ||
key === 'type' ||
key === 'constructor') {
return;
}
proto[key] = wrapMethod(key);
if (storedPrototype[key].isReactClassApproved) {
proto[key].isReactClassApproved = storedPrototype[key].isReactClas
sApproved;
}
if (proto.__reactAutoBindMap && proto.__reactAutoBindMap[key]) {
proto.__reactAutoBindMap[key] = proto[key];
}
}
function updateStoredPrototype(freshPrototype) {
storedPrototype = {};
Object.getOwnPropertyNames(freshPrototype).forEach(function (key) {
storedPrototype[key] = freshPrototype[key];
});
}
function reconcileWithStoredPrototypes(freshPrototype) {
knownPrototypes.push(freshPrototype);
knownPrototypes.forEach(function (proto) {
Object.getOwnPropertyNames(storedPrototype).forEach(function (key)
{
patchProperty(proto, key);
});
});
}
return function assimilatePrototype(freshPrototype) {
if (Object.prototype.hasOwnProperty.call(freshPrototype, '__isAssimi
latedByReactHotAPI')) {
return;
}
updateStoredPrototype(freshPrototype);
reconcileWithStoredPrototypes(freshPrototype);
freshPrototype.__isAssimilatedByReactHotAPI = true;
};
};
/***/ },
/* 81 */
/***/ function(module, exports, __webpack_require__) {
var deepForceUpdate = __webpack_require__(82);
var isRequestPending = false;
module.exports = function requestForceUpdateAll(getRootInstances, React)
{
if (isRequestPending) {
return;
}
/**
* Forces deep re-render of all mounted React components.
* Hats off to Omar Skalli (@Chetane) for suggesting this approach:
* https://gist.github.com/Chetane/9a230a9fdcdca21a4e29
*/
function forceUpdateAll() {
isRequestPending = false;
var rootInstances = getRootInstances(),
rootInstance;
for (var key in rootInstances) {
if (rootInstances.hasOwnProperty(key)) {
rootInstance = rootInstances[key];
// `|| rootInstance` for React 0.12 and earlier
rootInstance = rootInstance._reactInternalInstance || rootInstan
ce;
deepForceUpdate(rootInstance, React);
}
}
}
setTimeout(forceUpdateAll);
};
/***/ },
/* 82 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var bindAutoBindMethods = __webpack_require__(83);
var traverseRenderedChildren = __webpack_require__(84);
function setPendingForceUpdate(internalInstance) {
if (internalInstance._pendingForceUpdate === false) {
internalInstance._pendingForceUpdate = true;
}
}
function forceUpdateIfPending(internalInstance, React) {
if (internalInstance._pendingForceUpdate === true) {
// `|| internalInstance` for React 0.12 and earlier
var instance = internalInstance._instance || internalInstance;
if (instance.forceUpdate) {
instance.forceUpdate();
} else if (React && React.Component) {
React.Component.prototype.forceUpdate.call(instance);
}
}
}
/**
* Updates a React component recursively, so even if children define fun
ky
* `shouldComponentUpdate`, they are forced to re-render.
* Makes sure that any newly added methods are properly auto-bound.
*/
function deepForceUpdate(internalInstance, React) {
traverseRenderedChildren(internalInstance, bindAutoBindMethods);
traverseRenderedChildren(internalInstance, setPendingForceUpdate);
traverseRenderedChildren(internalInstance, forceUpdateIfPending, React
);
}
module.exports = deepForceUpdate;
/***/ },
/* 83 */
/***/ function(module, exports) {
'use strict';
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName,
_bind = boundMethod.bind;
boundMethod.bind = function (newThis) {
var args = Array.prototype.slice.call(arguments, 1);
if (newThis !== component && newThis !== null) {
console.warn(
'use strict';
function traverseRenderedChildren(internalInstance, callback, argument)
{
callback(internalInstance, argument);
if (internalInstance._renderedComponent) {
traverseRenderedChildren(
internalInstance._renderedComponent,
callback,
argument
);
} else {
for (var key in internalInstance._renderedChildren) {
traverseRenderedChildren(
internalInstance._renderedChildren[key],
callback,
argument
);
}
}
}
module.exports = traverseRenderedChildren;
/***/ },
/* 85 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var getRootInstancesFromReactMount = __webpack_require__(86);
var injectedProvider = null,
didWarn = false;
function warnOnce() {
if (!didWarn) {
console.warn(
'It appears that React Hot Loader isn\'t configured correctly. ' +
'If you\'re using NPM, make sure your dependencies don\'t drag dup
licate React distributions into their node_modules and that require("react") cor
responds to the React instance you render your app with.',
'If you\'re using a precompiled version of React, see https://gith
ub.com/gaearon/react-hot-loader/tree/master/docs#usage-with-external-react for i
ntegration instructions.'
);
}
didWarn = true;
}
var RootInstanceProvider = {
injection: {
injectProvider: function (provider) {
injectedProvider = provider;
}
},
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactMount
*/
'use strict';
var
var
var
var
var
var
var
var
var
var
DOMLazyTree = __webpack_require__(88);
DOMProperty = __webpack_require__(94);
ReactBrowserEventEmitter = __webpack_require__(96);
ReactCurrentOwner = __webpack_require__(112);
ReactDOMComponentTree = __webpack_require__(113);
ReactDOMContainerInfo = __webpack_require__(115);
ReactDOMFeatureFlags = __webpack_require__(117);
ReactElement = __webpack_require__(118);
ReactFeatureFlags = __webpack_require__(120);
ReactInstrumentation = __webpack_require__(121);
var
var
var
var
var
ReactMarkupChecksum = __webpack_require__(124);
ReactPerf = __webpack_require__(126);
ReactReconciler = __webpack_require__(127);
ReactUpdateQueue = __webpack_require__(130);
ReactUpdates = __webpack_require__(132);
var
var
var
var
var
var
emptyObject = __webpack_require__(136);
instantiateReactComponent = __webpack_require__(137);
invariant = __webpack_require__(95);
setInnerHTML = __webpack_require__(93);
shouldUpdateReactComponent = __webpack_require__(143);
warning = __webpack_require__(105);
*/
function unmountComponentFromNode(instance, container, safely) {
ReactReconciler.unmountComponent(instance, safely);
if (container.nodeType === DOC_NODE_TYPE) {
container = container.documentElement;
}
// http://jsperf.com/emptying-a-node
while (container.lastChild) {
container.removeChild(container.lastChild);
}
}
/**
* True if the supplied DOM node has a direct React-rendered child that
is
*
*
*
*
*
t was
* rendered by React but is not a root element.
* @internal
*/
function hasNonRootReactChild(container) {
var rootEl = getReactRootElementInContainer(container);
if (rootEl) {
var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
return !!(inst && inst._nativeParent);
}
}
function getNativeRootInstanceInContainer(container) {
var rootEl = getReactRootElementInContainer(container);
var prevNativeInstance = rootEl && ReactDOMComponentTree.getInstanceFr
omNode(rootEl);
return prevNativeInstance && !prevNativeInstance._nativeParent ? prevN
ativeInstance : null;
}
function getTopLevelWrapperInContainer(container) {
var root = getNativeRootInstanceInContainer(container);
return root ? root._nativeContainerInfo._topLevelWrapper : null;
}
/**
* Temporary (?) hack so that we can store all top-level pending updates
on
* composites instead of having to worry about different types of compon
ents
* here.
*/
var topLevelRootCounter = 1;
var TopLevelWrapper = function () {
this.rootID = topLevelRootCounter++;
};
TopLevelWrapper.prototype.isReactComponent = {};
if (process.env.NODE_ENV !== 'production') {
TopLevelWrapper.displayName = 'TopLevelWrapper';
}
TopLevelWrapper.prototype.render = function () {
// this.props is actually a ReactElement
return this.props;
};
/**
* Mounting is the process of initializing a React component by creating
its
* representative DOM elements and inserting them into a supplied `conta
iner`.
* Any prior content inside `container` is destroyed in the process.
*
* ReactMount.render(
*
component,
*
document.getElementById('container')
* );
*
* <div id="container">
<-- Supplied `container`.
*
<div data-reactid=".3">
<-- Rendered reactRoot of Re
act
*
// ...
component.
*
</div>
* </div>
*
* Inside of `container`, the first element rendered is the "reactRoot".
*/
var ReactMount = {
TopLevelWrapper: TopLevelWrapper,
/**
* Used by devtools. The keys are not important.
*/
_instancesByReactRootID: instancesByReactRootID,
/**
* This is a hook provided to support rendering React components while
* ensuring that the apparent scroll position of its `container` does
not
* change.
*
* @param {DOMElement} container The `container` being rendered into.
* @param {function} renderCallback This must be called once to do the
render.
*/
scrollMonitor: function (container, renderCallback) {
renderCallback();
},
/**
* Take a component that's already mounted into the DOM and replace it
s props
* @param {ReactComponent} prevComponent component instance already in
the DOM
* @param {ReactElement} nextElement component instance to render
* @param {DOMElement} container container to render into
* @param {?function} callback function triggered on completion
*/
ertion
* @return {ReactComponent} nextComponent
*/
_renderNewRootComponent: function (nextElement, container, shouldReuse
Markup, context) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nes
ted;
// verify that that's the case.
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.cu
rrent == null, '_renderNewRootComponent(): Render methods should be a pure funct
ion ' + 'of props and state; triggering nested component updates from ' + 'rende
r is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdat
e. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwn
er.current.getName() || 'ReactCompositeComponent') : void 0;
!(container && (container.nodeType === ELEMENT_NODE_TYPE || containe
r.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TY
PE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerCompon
ent(...): Target container is not a DOM element.') : invariant(false) : void 0;
ReactBrowserEventEmitter.ensureScrollValueMonitoring();
var componentInstance = instantiateReactComponent(nextElement);
// The initial render is synchronous but any updates that happen dur
ing
// rendering, in componentWillMount or componentDidMount, will be ba
tched
// according to the current batching strategy.
ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, component
Instance, container, shouldReuseMarkup, context);
var wrapperID = componentInstance._instance.rootID;
instancesByReactRootID[wrapperID] = componentInstance;
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onMountRootComponent(componentInsta
nce);
}
return componentInstance;
},
/**
* Renders a React component into the DOM in the supplied `container`.
*
* If the React component was previously rendered into `container`, th
is will
* perform an update on it and only mutate the DOM as necessary to ref
lect the
* latest React component.
*
* @param {ReactComponent} parentComponent The conceptual parent of th
is render tree.
* @param {ReactElement} nextElement Component element to render.
* @param {DOMElement} container DOM element to render into.
* @param {?function} callback function triggered on completion
* @return {ReactComponent} Component instance rendered in `container`
.
*/
renderSubtreeIntoContainer: function (parentComponent, nextElement, co
ntainer, callback) {
!(parentComponent != null && parentComponent._reactInternalInstance
!= null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentCompo
nent must be a valid React Component') : invariant(false) : void 0;
return ReactMount._renderSubtreeIntoContainer(parentComponent, nextE
lement, container, callback);
},
_renderSubtreeIntoContainer: function (parentComponent, nextElement, c
ontainer, callback) {
ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
!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 />.' :
// Check if it quacks like an element
nextElement != null && nextElement.props !== undefined ? ' This may
be caused by unintentionally loading two independent ' + 'copies of React.' : ''
) : invariant(false) : void 0;
process.env.NODE_ENV !== 'production' ? warning(!container || !conta
iner.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 m
ay lead to subtle ' + 'reconciliation issues. Try rendering into a container ele
ment created ' + 'for your app.') : void 0;
var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, n
ull, null, null, nextElement);
var prevComponent = getTopLevelWrapperInContainer(container);
if (prevComponent) {
var prevWrappedElement = prevComponent._currentElement;
var prevElement = prevWrappedElement.props;
if (shouldUpdateReactComponent(prevElement, nextElement)) {
*
*
*
*
*
.
*/
render: function (nextElement, container, callback) {
return ReactMount._renderSubtreeIntoContainer(null, nextElement, con
tainer, callback);
},
/**
* Unmounts and destroys the React component rendered in the `containe
r`.
*
* @param {DOMElement} container DOM element containing a React compon
ent.
* @return {boolean} True if a component was found in and unmounted fr
om
*
`container`
*/
unmountComponentAtNode: function (container) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nes
ted;
// verify that that's the case. (Strictly speaking, unmounting won't
cause a
// render but we still don't expect to be in a render call here.)
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.cu
rrent == null, 'unmountComponentAtNode(): Render methods should be a pure functi
on ' + '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 && ReactCurrentOwne
r.current.getName() || 'ReactCompositeComponent') : void 0;
!(container && (container.nodeType === ELEMENT_NODE_TYPE || containe
r.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TY
PE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponen
tAtNode(...): Target container is not a DOM element.') : invariant(false) : void
0;
var prevComponent = getTopLevelWrapperInContainer(container);
if (!prevComponent) {
// Check if the node being unmounted was rendered by React, but is
n't a
// root node.
var containerHasNonRootReactChild = hasNonRootReactChild(container
);
// Check if the container itself is a React root node.
var isContainerReactRoot = container.nodeType === 1 && container.h
asAttribute(ROOT_ATTR_NAME);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!containerHasNon
RootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmoun
t ' + 'was rendered by React and is not a top-level container. %s', isContainerR
eactRoot ? 'You may have accidentally passed in a React root node instead ' + 'o
f its container.' : 'Instead, have the parent component update its state and ' +
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule DOMLazyTree
*/
'use strict';
var createMicrosoftUnsafeLocalFunction = __webpack_require__(89);
var setTextContent = __webpack_require__(90);
/**
* In IE (8-11) and Edge, appending nodes with no children is dramatical
ly
* faster than appending a full subtree, so we essentially queue up the
* .appendChild calls here and apply them so each node is added to its p
arent
* before any children are added.
*
* In other browsers, doing so is slower or neutral compared to the othe
r order
* (in Firefox, twice as slow) so we only do this inversion in IE.
*
* See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode
.
*/
var enableLazy = typeof document !== 'undefined' && typeof document.docu
mentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.us
erAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
function insertTreeChildren(tree) {
if (!enableLazy) {
return;
}
var node = tree.node;
var children = tree.children;
if (children.length) {
for (var i = 0; i < children.length; i++) {
insertTreeBefore(node, children[i], null);
}
} else if (tree.html != null) {
node.innerHTML = tree.html;
} else if (tree.text != null) {
setTextContent(node, tree.text);
}
}
var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (pare
ntNode, tree, referenceNode) {
// DocumentFragments aren't actually part of the DOM after insertion s
o
// appending children won't update the DOM. We need to ensure the frag
ment
// is properly populated first, breaking out of our lazy approach for
just
// this level.
if (tree.node.nodeType === 11) {
insertTreeChildren(tree);
parentNode.insertBefore(tree.node, referenceNode);
} else {
parentNode.insertBefore(tree.node, referenceNode);
insertTreeChildren(tree);
}
});
function replaceChildWithTree(oldNode, newTree) {
oldNode.parentNode.replaceChild(newTree.node, oldNode);
insertTreeChildren(newTree);
}
function queueChild(parentTree, childTree) {
if (enableLazy) {
parentTree.children.push(childTree);
} else {
parentTree.node.appendChild(childTree.node);
}
}
function queueHTML(tree, html) {
if (enableLazy) {
tree.html = html;
} else {
tree.node.innerHTML = html;
}
}
function queueText(tree, text) {
if (enableLazy) {
tree.text = text;
} else {
setTextContent(tree.node, text);
}
}
function DOMLazyTree(node) {
return {
node: node,
children: [],
html: null,
text: null
};
}
DOMLazyTree.insertTreeBefore = insertTreeBefore;
DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
DOMLazyTree.queueChild = queueChild;
DOMLazyTree.queueHTML = queueHTML;
DOMLazyTree.queueText = queueText;
module.exports = DOMLazyTree;
/***/ },
/* 89 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule setInnerHTML
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(91);
var WHITESPACE_TEST = /^[ \r\n\t\f]/;
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\
/>]/;
var createMicrosoftUnsafeLocalFunction = __webpack_require__(89);
/**
* Set the innerHTML property of a node, ensuring that whitespace is pre
served
* even in IE8.
*
* @param {DOMElement} node
* @param {string} html
* @internal
*/
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, ht
ml) {
node.innerHTML = html;
});
if (ExecutionEnvironment.canUseDOM) {
// IE8: When updating a just created node with innerHTML only leading
// whitespace is removed. When updating an existing node with innerHTM
L
// whitespace in root TextNodes is also collapsed.
// @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.htm
l
// Feature detection; only IE8 is known to behave improperly like this
.
var testElement = document.createElement('div');
testElement.innerHTML = ' ';
if (testElement.innerHTML === '') {
setInnerHTML = function (node, html) {
// Magic theory: IE8 supposedly differentiates between added and u
pdated
// nodes when processing innerHTML, innerHTML on updated nodes suf
fers
// from worse whitespace behavior. Re-adding a node like this trig
gers
// the initial and more favorable whitespace behavior.
// TODO: What to do on a detached node?
if (node.parentNode) {
node.parentNode.replaceChild(node, node);
}
// We also implement a workaround for non-visible tags disappearin
g into
// thin air on IE8, this only happens if there is no visible text
// in-front of the non-visible tags. Piggyback on the whitespace f
ix
// and simply check if any non-visible tags appear in the source.
if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TE
ST.test(html)) {
// Recover leading whitespace by temporarily prepending any char
acter.
// \uFEFF has the potential advantage of being zero-width/invisi
ble.
// UglifyJS drops U+FEFF chars when parsing, so use String.fromC
harCode
// in hopes that this is preserved even if "\uFEFF" is transform
ed to
// the actual Unicode character (by Babel, for example).
// https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js
#L216
node.innerHTML = String.fromCharCode(0xFEFF) + html;
// deleteData leaves an empty `TextNode` which offsets the index
of all
// children. Definitely want to avoid this.
var textNode = node.firstChild;
if (textNode.data.length === 1) {
node.removeChild(textNode);
} else {
textNode.deleteData(0, 1);
}
} else {
node.innerHTML = html;
}
};
}
testElement = null;
}
module.exports = setInnerHTML;
/***/ },
/* 94 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule DOMProperty
*/
'use strict';
var invariant = __webpack_require__(95);
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
}
var DOMPropertyInjection = {
/**
* Mapping from normalized, camelcased property names to a configurati
on that
* specifies how the associated DOM property should be accessed or ren
dered.
*/
MUST_USE_PROPERTY: 0x1,
HAS_SIDE_EFFECTS: 0x2,
HAS_BOOLEAN_VALUE: 0x4,
HAS_NUMERIC_VALUE: 0x8,
HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
/**
* Inject some specialized knowledge about the DOM. This takes a confi
g object
* with the following properties:
*
* isCustomAttribute: function that given an attribute name will retur
n true
* if it can be inserted into the DOM verbatim. Useful for data-* or a
ria-*
*
*
*
*
*
*
*
*
*
*
*
*
here,
DOMAttributeNames: object mapping React attribute name to the DOM
attribute name. Attribute names not specified use the **lowercase**
normalized name.
DOMAttributeNamespaces: object mapping React attribute name to the
DOM
* attribute namespace URL. (Attribute names not specified use no name
space.)
*
* DOMPropertyNames: similar to DOMAttributeNames but for DOM properti
es.
* Property names not specified use the normalized name.
*
* DOMMutationMethods: Properties that require special mutation method
s. If
* `value` is undefined, the mutation method should unset the property
.
*
* @param {object} domPropertyConfig the config as described above.
*/
* attributeNamespace
* propertyName:
* Used on DOM node instances. (This includes properties that mutate
due to
* external factors.)
* mutationMethod:
* If non-null, used instead of the property or `setAttribute()` aft
er
* initial render.
* mustUseProperty:
* Whether the property must be accessed and mutated as an object pr
operty.
* hasSideEffects:
* Whether or not setting a value causes side effects such as trigge
ring
*
the DOM before updating to ensure that the value is only set if i
d from
t has
* changed.
* hasBooleanValue:
* Whether the property should be removed when set to a falsey value
.
* hasNumericValue:
* Whether the property must be numeric or parse as a numeric and sh
ould be
* removed when set to a falsey value.
* hasPositiveNumericValue:
* Whether the property must be positive numeric or parse as a posit
ive
* numeric and should be removed when set to a falsey value.
* hasOverloadedBooleanValue:
* Whether the property can be used as a flag as well as with a valu
e.
*
n
* strictly equal to true; present with a value otherwise.
*/
properties: {},
/**
* Mapping from lowercase property names to the properly cased version
, used
* to warn in the case of missing properties. Available only in __DEV_
_.
* @type {Object}
*/
getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} :
null,
/**
* All of the isCustomAttribute() functions that have been injected.
*/
_isCustomAttributeFunctions: [],
/**
* Checks whether a property name is a custom attribute.
* @method
*/
isCustomAttribute: function (attributeName) {
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true
.
*
*
*
*
*
*
nt
* will remain to ensure logic does not differ in production.
*/
function invariant(condition, format, a, b, c, d, e, f) {
if (process.env.NODE_ENV !== 'production') {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
}
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minifi
ed dev environment ' + 'for the full error message and additional helpful warnin
gs.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
module.exports = invariant;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 96 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactBrowserEventEmitter
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
EventConstants = __webpack_require__(98);
EventPluginRegistry = __webpack_require__(100);
ReactEventEmitterMixin = __webpack_require__(101);
ViewportMetrics = __webpack_require__(109);
event sources. This is the only work that occurs in the main threa
uggable
d.
*
* - We normalize and de-duplicate events to account for browser quirks
. This
*
may be done in the worker thread.
*
* - Forward these native events (with the associated top-level type us
ed to
*
ey want
*
to extract any synthetic events.
*
* - The `EventPluginHub` will then process each event by annotating th
em with
*
event.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
.
.
.
.
.
.
.
.
.
.
.
.
.
+-----------+
+--------+|SimpleEvent|
|
|Plugin
|
v
+-----------+
+--------------+
+---------
---+
* |
+-----------.--->|EventPluginHub|
Event
|
* |
+-----------+ | Propagat
* | ReactEvent |
|TapEvent
* | Emitter
|<---+|Plugin
* |
+-----------+ | utiliti
+-----------.--->|
+---------
ors|
| |---------
---|
| |other plu
gin|
es |
* |
---+
* |
|
|
* +-----|------+
*
|
*
+
* +-------------+
* | application |
* |-------------|
* |
|
* |
|
* +-------------+
*
*
React Core
*/
.
+--------------+
.
^
+-----------+
.
|
|Enter/Leave|
.
+-------+|Plugin
|
.
+-----------+
.
.
.
.
.
.
. General Purpose Event Plugin System
var hasEventPageXY;
var alreadyListeningTo = {};
var isMonitoringScrollValue = false;
var reactTopListenersCounter = 0;
// For events like 'submit' which don't consistently bubble (which we tr
ap at a
// lower node than `document`), binding at `document` would cause duplic
ate
// events so we don't include them here
var topEventMapping = {
topAbort: 'abort',
topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animat
ionend',
topAnimationIteration: getVendorPrefixedEventName('animationiteration'
) || 'animationiteration',
topAnimationStart: getVendorPrefixedEventName('animationstart') || 'an
imationstart',
topBlur: 'blur',
topCanPlay: 'canplay',
topCanPlayThrough: 'canplaythrough',
topChange: 'change',
topClick: 'click',
topCompositionEnd: 'compositionend',
topCompositionStart: 'compositionstart',
topCompositionUpdate: 'compositionupdate',
topContextMenu: 'contextmenu',
topCopy: 'copy',
topCut: 'cut',
topDoubleClick: 'dblclick',
topDrag: 'drag',
topDragEnd: 'dragend',
topDragEnter: 'dragenter',
topDragExit: 'dragexit',
topDragLeave: 'dragleave',
topDragOver: 'dragover',
topDragStart: 'dragstart',
topDrop: 'drop',
topDurationChange: 'durationchange',
topEmptied: 'emptied',
topEncrypted: 'encrypted',
topEnded: 'ended',
topError: 'error',
topFocus: 'focus',
topInput: 'input',
topKeyDown: 'keydown',
topKeyPress: 'keypress',
topKeyUp: 'keyup',
topLoadedData: 'loadeddata',
topLoadedMetadata: 'loadedmetadata',
topLoadStart: 'loadstart',
topMouseDown: 'mousedown',
topMouseMove: 'mousemove',
topMouseOut: 'mouseout',
topMouseOver: 'mouseover',
topMouseUp: 'mouseup',
topPaste: 'paste',
topPause: 'pause',
topPlay: 'play',
topPlaying: 'playing',
topProgress: 'progress',
topRateChange: 'ratechange',
topScroll: 'scroll',
topSeeked: 'seeked',
topSeeking: 'seeking',
topSelectionChange: 'selectionchange',
topStalled: 'stalled',
topSuspend: 'suspend',
topTextInput: 'textInput',
topTimeUpdate: 'timeupdate',
topTouchCancel: 'touchcancel',
topTouchEnd: 'touchend',
topTouchMove: 'touchmove',
topTouchStart: 'touchstart',
topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'tran
sitionend',
topVolumeChange: 'volumechange',
topWaiting: 'waiting',
topWheel: 'wheel'
};
/**
* To ensure no conflicts with other potential React instances on the pa
ge
*/
var topListenersIDKey = '_reactListenersID' + String(Math.random()).slic
e(2);
function getListeningForDocument(mountAt) {
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty
`
// directly.
if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey))
{
mountAt[topListenersIDKey] = reactTopListenersCounter++;
alreadyListeningTo[mountAt[topListenersIDKey]] = {};
}
return alreadyListeningTo[mountAt[topListenersIDKey]];
}
/**
* `ReactBrowserEventEmitter` is used to attach top-level event listener
s. For
* example:
*
* EventPluginHub.putListener('myID', 'onClick', myFunction);
*
* This would allocate a "registration" of `('onClick', myFunction)` on
'myID'.
*
* @internal
*/
var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
/**
* Injectable event backend
*/
ReactEventListener: null,
injection: {
/**
* @param {object} ReactEventListener
*/
registrationName];
var topLevelTypes = EventConstants.topLevelTypes;
for (var i = 0; i < dependencies.length; i++) {
var dependency = dependencies[i];
if (!(isListening.hasOwnProperty(dependency) && isListening[depend
ency])) {
if (dependency === topLevelTypes.topWheel) {
if (isEventSupported('wheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent
(topLevelTypes.topWheel, 'wheel', mountAt);
} else if (isEventSupported('mousewheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent
(topLevelTypes.topWheel, 'mousewheel', mountAt);
} else {
// Firefox needs to capture a different mouse scroll event.
// @see http://www.quirksmode.org/dom/events/tests/scroll.ht
ml
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent
(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
}
} else if (dependency === topLevelTypes.topScroll) {
if (isEventSupported('scroll', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEven
t(topLevelTypes.topScroll, 'scroll', mountAt);
} else {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent
(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.
WINDOW_HANDLE);
}
} else if (dependency === topLevelTypes.topFocus || dependency =
== topLevelTypes.topBlur) {
if (isEventSupported('focus', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEven
t(topLevelTypes.topFocus, 'focus', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEven
t(topLevelTypes.topBlur, 'blur', mountAt);
} else if (isEventSupported('focusin')) {
// IE has `focusin` and `focusout` events which bubble.
// @see http://www.quirksmode.org/blog/archives/2008/04/dele
gating_the.html
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent
(topLevelTypes.topFocus, 'focusin', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent
(topLevelTypes.topBlur, 'focusout', mountAt);
}
// to make sure blur and focus event listeners are only attach
ed once
isListening[topLevelTypes.topBlur] = true;
isListening[topLevelTypes.topFocus] = true;
} else if (topEventMapping.hasOwnProperty(dependency)) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(d
ependency, topEventMapping[dependency], mountAt);
}
isListening[dependency] = true;
}
}
},
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
topLevelType, handlerBaseName, handle);
},
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent
(topLevelType, handlerBaseName, handle);
},
/**
* Listens to window scroll and resize events. We cache scroll values
so that
* application code can access them without triggering reflows.
*
* ViewportMetrics is only used by SyntheticMouse/TouchEvent and only
when
* pageX/pageY isn't supported (legacy browsers).
*
* NOTE: Scroll events do not bubble.
*
* @see http://www.quirksmode.org/dom/events/scroll.html
*/
ensureScrollValueMonitoring: function () {
if (hasEventPageXY === undefined) {
hasEventPageXY = document.createEvent && 'pageX' in document.creat
eEvent('MouseEvent');
}
if (!hasEventPageXY && !isMonitoringScrollValue) {
var refresh = ViewportMetrics.refreshScrollValues;
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(ref
resh);
isMonitoringScrollValue = true;
}
}
});
module.exports = ReactBrowserEventEmitter;
/***/ },
/* 97 */
/***/ function(module, exports) {
'use strict';
/* eslint-disable no-unused-vars */
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with
null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 v
ersions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(funct
ion (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (lette
r) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (e) {
// We don't expect any of the above to throw, but better
to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, s
ource) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[
i])) {
to[symbols[i]] = from[symbols[i]
];
}
}
}
}
return to;
};
/***/ },
/* 98 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule EventConstants
*/
'use strict';
var keyMirror = __webpack_require__(99);
var PropagationPhases = keyMirror({ bubbled: null, captured: null });
/**
* Types of raw signals from the browser caught at the top level.
*/
var topLevelTypes = keyMirror({
topAbort: null,
topAnimationEnd: null,
topAnimationIteration: null,
topAnimationStart: null,
topBlur: null,
topCanPlay: null,
topCanPlayThrough: null,
topChange: null,
topClick: null,
topCompositionEnd: null,
topCompositionStart: null,
topCompositionUpdate: null,
topContextMenu: null,
topCopy: null,
topCut: null,
topDoubleClick: null,
topDrag: null,
topDragEnd: null,
topDragEnter: null,
topDragExit: null,
topDragLeave: null,
topDragOver: null,
topDragStart: null,
topDrop: null,
topDurationChange: null,
topEmptied: null,
topEncrypted: null,
topEnded: null,
topError: null,
topFocus: null,
topInput: null,
topInvalid: null,
topKeyDown: null,
topKeyPress: null,
topKeyUp: null,
topLoad: null,
topLoadedData: null,
topLoadedMetadata: null,
topLoadStart: null,
topMouseDown: null,
topMouseMove: null,
topMouseOut: null,
topMouseOver: null,
topMouseUp: null,
topPaste: null,
topPause: null,
topPlay: null,
topPlaying: null,
topProgress: null,
topRateChange: null,
topReset: null,
topScroll: null,
topSeeked: null,
topSeeking: null,
topSelectionChange: null,
topStalled: null,
topSubmit: null,
topSuspend: null,
topTextInput: null,
topTimeUpdate: null,
topTouchCancel: null,
topTouchEnd: null,
topTouchMove: null,
topTouchStart: null,
topTransitionEnd: null,
topVolumeChange: null,
topWaiting: null,
topWheel: null
});
var EventConstants = {
topLevelTypes: topLevelTypes,
PropagationPhases: PropagationPhases
};
module.exports = EventConstants;
/***/ },
/* 99 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks static-only
*/
'use strict';
var invariant = __webpack_require__(95);
/**
* Constructs an enumeration with keys equal to their value.
*
* For example:
*
* var COLORS = keyMirror({blue: null, red: null});
* var myColor = COLORS.blue;
* var isColorValid = !!COLORS[myColor];
*
* The last line could not be performed if the values of the generated e
num were
* not equal to their keys.
*
* Input: {key1: val1, key2: val2}
* Output: {key1: key1, key2: key2}
*
* @param {object} obj
* @return {object}
*/
var keyMirror = function (obj) {
var ret = {};
var key;
!(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV
!== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object
.') : invariant(false) : void 0;
for (key in obj) {
if (!obj.hasOwnProperty(key)) {
continue;
}
ret[key] = key;
}
return ret;
};
module.exports = keyMirror;
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule EventPluginRegistry
*/
'use strict';
var invariant = __webpack_require__(95);
/**
* Injectable ordering of event plugins.
*/
var EventPluginOrder = null;
/**
* Injectable mapping from names to event plugin modules.
*/
var namesToPlugins = {};
/**
* Recomputes the plugin list using the injected plugins and plugin orde
ring.
*
* @private
*/
function recomputePluginOrdering() {
if (!EventPluginOrder) {
// Wait until an `EventPluginOrder` is injected.
return;
}
for (var pluginName in namesToPlugins) {
var PluginModule = namesToPlugins[pluginName];
var pluginIndex = EventPluginOrder.indexOf(pluginName);
!(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invari
ant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist i
n ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : void 0;
if (EventPluginRegistry.plugins[pluginIndex]) {
continue;
}
!PluginModule.extractEvents ? process.env.NODE_ENV !== 'production'
? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extrac
tEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : void
0;
EventPluginRegistry.plugins[pluginIndex] = PluginModule;
var publishedEvents = PluginModule.eventTypes;
for (var eventName in publishedEvents) {
!publishEventForPlugin(publishedEvents[eventName], PluginModule, e
ventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPlugi
nRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName
) : invariant(false) : void 0;
}
}
}
/**
* Publishes an event so that it can be dispatched by the supplied plugi
n.
*
* @param {object} dispatchConfig Dispatch configuration for the event.
* @param {object} PluginModule Plugin publishing the event.
* @return {boolean} True if the event was successfully published.
* @private
*/
function publishEventForPlugin(dispatchConfig, PluginModule, eventName)
{
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventNam
e) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: M
ore than one plugin attempted to publish the same ' + 'event name, `%s`.', event
Name) : invariant(false) : void 0;
EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConf
ig;
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
if (phasedRegistrationNames) {
for (var phaseName in phasedRegistrationNames) {
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
var phasedRegistrationName = phasedRegistrationNames[phaseName];
publishRegistrationName(phasedRegistrationName, PluginModule, ev
entName);
}
}
return true;
} else if (dispatchConfig.registrationName) {
publishRegistrationName(dispatchConfig.registrationName, PluginModul
e, eventName);
return true;
}
return false;
}
/**
* Publishes a registration name that is used to identify dispatched eve
nts and
* can be used with `EventPluginHub.putListener` to register listeners.
*
* @param {string} registrationName Registration name to add.
* @param {object} PluginModule Plugin publishing the event.
* @private
*/
function publishRegistrationName(registrationName, PluginModule, eventNa
me) {
!!EventPluginRegistry.registrationNameModules[registrationName] ? proc
ess.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than
one plugin attempted to publish the same ' + 'registration name, `%s`.', registr
ationName) : invariant(false) : void 0;
EventPluginRegistry.registrationNameModules[registrationName] = Plugin
Module;
EventPluginRegistry.registrationNameDependencies[registrationName] = P
luginModule.eventTypes[eventName].dependencies;
if (process.env.NODE_ENV !== 'production') {
var lowerCasedName = registrationName.toLowerCase();
EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = regi
strationName;
}
}
/**
* Registers plugins so that they can extract and dispatch events.
*
* @see {EventPluginHub}
*/
var EventPluginRegistry = {
/**
* Ordered list of injected plugins.
*/
plugins: [],
/**
* Mapping from event name to dispatch config
*/
eventNameDispatchConfigs: {},
/**
* Mapping from registration name to plugin module
*/
registrationNameModules: {},
/**
* Mapping from registration name to event name
*/
registrationNameDependencies: {},
/**
* Mapping from lowercase registration names to the properly cased ver
sion,
* used to warn in the case of missing event handlers. Available
* only in __DEV__.
* @type {Object}
*/
possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {}
: null,
/**
* Injects an ordering of plugins (by plugin name). This allows the or
dering
* to be decoupled from injection of the actual plugins so that orderi
ng is
* always deterministic regardless of packaging, on-the-fly injection,
etc.
*
* @param {array} InjectedEventPluginOrder
* @internal
* @see {EventPluginHub.injection.injectEventPluginOrder}
*/
if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase))
{
continue;
}
var PluginModule = EventPluginRegistry.registrationNameModules[dis
patchConfig.phasedRegistrationNames[phase]];
if (PluginModule) {
return PluginModule;
}
}
return null;
},
/**
* Exposed for unit testing.
* @private
*/
_resetEventPlugins: function () {
EventPluginOrder = null;
for (var pluginName in namesToPlugins) {
if (namesToPlugins.hasOwnProperty(pluginName)) {
delete namesToPlugins[pluginName];
}
}
EventPluginRegistry.plugins.length = 0;
var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatch
Configs;
for (var eventName in eventNameDispatchConfigs) {
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
delete eventNameDispatchConfigs[eventName];
}
}
var registrationNameModules = EventPluginRegistry.registrationNameMo
dules;
for (var registrationName in registrationNameModules) {
if (registrationNameModules.hasOwnProperty(registrationName)) {
delete registrationNameModules[registrationName];
}
}
if (process.env.NODE_ENV !== 'production') {
var possibleRegistrationNames = EventPluginRegistry.possibleRegist
rationNames;
for (var lowerCasedName in possibleRegistrationNames) {
if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
delete possibleRegistrationNames[lowerCasedName];
}
}
}
}
};
module.exports = EventPluginRegistry;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 101 */
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule EventPluginHub
*/
'use strict';
stration
*
*
*
*
must
Names`.
. By
*
default, the listener is simply invoked.
*
* Each plugin that is injected into `EventsPluginHub` is immediately op
erable.
*
* @public
*/
var EventPluginHub = {
/**
* Methods for injecting dependencies.
*/
injection: {
/**
* @param {array} InjectedEventPluginOrder
* @public
*/
injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
/**
* @param {object} injectedNamesToPlugins Map from names to plugin m
odules.
*/
injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByNa
me
},
/**
* Stores `listener` at `listenerBank[registrationName][id]`. Is idemp
otent.
*
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {function} listener The callback to store.
*/
putListener: function (inst, registrationName, listener) {
!(typeof listener === 'function') ? process.env.NODE_ENV !== 'produc
tion' ? invariant(false, 'Expected %s listener to be a function, instead got typ
e %s', registrationName, typeof listener) : invariant(false) : void 0;
var bankForRegistrationName = listenerBank[registrationName] || (lis
tenerBank[registrationName] = {});
bankForRegistrationName[inst._rootNodeID] = listener;
var PluginModule = EventPluginRegistry.registrationNameModules[regis
trationName];
if (PluginModule && PluginModule.didPutListener) {
PluginModule.didPutListener(inst, registrationName, listener);
}
},
/**
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @return {?function} The stored callback.
*/
getListener: function (inst, registrationName) {
var bankForRegistrationName = listenerBank[registrationName];
return bankForRegistrationName && bankForRegistrationName[inst._root
NodeID];
},
/**
* Deletes a listener from the registration bank.
*
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
*/
deleteListener: function (inst, registrationName) {
var PluginModule = EventPluginRegistry.registrationNameModules[regis
trationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(inst, registrationName);
}
var bankForRegistrationName = listenerBank[registrationName];
// TODO: This should never be null -- when is it?
if (bankForRegistrationName) {
delete bankForRegistrationName[inst._rootNodeID];
}
},
/**
* Deletes all listeners for the DOM element with the supplied ID.
*
* @param {object} inst The instance, which is the source of events.
*/
deleteAllListeners: function (inst) {
for (var registrationName in listenerBank) {
if (!listenerBank[registrationName][inst._rootNodeID]) {
continue;
}
var PluginModule = EventPluginRegistry.registrationNameModules[reg
istrationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(inst, registrationName);
}
delete listenerBank[registrationName][inst._rootNodeID];
}
},
/**
* Allows registered plugins an opportunity to extract events from top
-level
* native browser events.
*
* @return {*} An accumulation of synthetic events.
* @internal
*/
extractEvents: function (topLevelType, targetInst, nativeEvent, native
EventTarget) {
var events;
var plugins = EventPluginRegistry.plugins;
for (var i = 0; i < plugins.length; i++) {
// Not every plugin in the ordering may be loaded at runtime.
var possiblePlugin = plugins[i];
if (possiblePlugin) {
var extractedEvents = possiblePlugin.extractEvents(topLevelType,
targetInst, nativeEvent, nativeEventTarget);
if (extractedEvents) {
events = accumulateInto(events, extractedEvents);
}
}
}
return events;
},
/**
* Enqueues a synthetic event that should be dispatched when
* `processEventQueue` is invoked.
*
* @param {*} events An accumulation of synthetic events.
* @internal
*/
enqueueEvents: function (events) {
if (events) {
eventQueue = accumulateInto(eventQueue, events);
}
},
/**
* Dispatches all synthetic events on the event queue.
*
* @internal
*/
processEventQueue: function (simulated) {
// Set `eventQueue` to null before processing it so that we can tell
if more
// events get enqueued while processing.
var processingEventQueue = eventQueue;
eventQueue = null;
if (simulated) {
forEachAccumulated(processingEventQueue, executeDispatchesAndRelea
seSimulated);
} else {
forEachAccumulated(processingEventQueue, executeDispatchesAndRelea
seTopLevel);
}
!!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(fal
se, 'processEventQueue(): Additional events were enqueued while processing ' + '
an event queue. Support for this has not yet been implemented.') : invariant(fal
se) : void 0;
// This would be a good time to rethrow if any of the event handlers
threw.
ReactErrorUtils.rethrowCaughtError();
},
/**
* These are needed for tests only. Do not use!
*/
__purge: function () {
listenerBank = {};
},
__getListenerBank: function () {
return listenerBank;
}
};
module.exports = EventPluginHub;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 103 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule EventPluginUtils
*/
'use strict';
var EventConstants = __webpack_require__(98);
var ReactErrorUtils = __webpack_require__(104);
var invariant = __webpack_require__(95);
var warning = __webpack_require__(105);
/**
* Injected dependencies:
*/
/**
* - `ComponentTree`: [required] Module that can convert between React i
nstances
* and actual node references.
*/
var ComponentTree;
var TreeTraversal;
var injection = {
injectComponentTree: function (Injected) {
ComponentTree = Injected;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(Injected && Inject
ed.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.inject
ion.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstanc
e or getInstanceFromNode.') : void 0;
}
},
injectTreeTraversal: function (Injected) {
TreeTraversal = Injected;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(Injected && Inject
ed.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.i
njectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowest
CommonAncestor.') : void 0;
}
}
};
var topLevelTypes = EventConstants.topLevelTypes;
function isEndish(topLevelType) {
return topLevelType === topLevelTypes.topMouseUp || topLevelType === t
opLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
}
function isMoveish(topLevelType) {
return topLevelType === topLevelTypes.topMouseMove || topLevelType ===
topLevelTypes.topTouchMove;
}
function isStartish(topLevelType) {
return topLevelType === topLevelTypes.topMouseDown || topLevelType ===
topLevelTypes.topTouchStart;
}
var validateEventDispatches;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches = function (event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
var listenersIsArr = Array.isArray(dispatchListeners);
var listenersLen = listenersIsArr ? dispatchListeners.length : dispa
tchListeners ? 1 : 0;
var instancesIsArr = Array.isArray(dispatchInstances);
var instancesLen = instancesIsArr ? dispatchInstances.length : dispa
tchInstances ? 1 : 0;
process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === l
istenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `even
t`.') : void 0;
};
}
/**
* Dispatch the event to the listener.
* @param {SyntheticEvent} event SyntheticEvent to handle
* @param {boolean} simulated If the event is simulated (changes exn beh
avior)
* @param {function} listener Application-level callback
* @param {*} inst Internal component instance
*/
function executeDispatch(event, simulated, listener, inst) {
var type = event.type || 'unknown-event';
event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
if (simulated) {
ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event
);
} else {
ReactErrorUtils.invokeGuardedCallback(type, listener, event);
}
event.currentTarget = null;
}
/**
* Standard/simple iteration through an event's collected dispatches.
*/
function executeDispatchesInOrder(event, simulated) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and Instances are two parallel arrays that are always
in sync.
executeDispatch(event, simulated, dispatchListeners[i], dispatchIn
stances[i]);
}
} else if (dispatchListeners) {
executeDispatch(event, simulated, dispatchListeners, dispatchInstanc
es);
}
event._dispatchListeners = null;
event._dispatchInstances = null;
}
/**
* Standard/simple iteration through an event's collected dispatches, bu
t stops
* at the first dispatch execution returning true, and returns that id.
*
* @return {?string} id of the first dispatch execution who's listener r
eturns
* true, or null if no listener returned true.
*/
function executeDispatchesInOrderStopAtTrueImpl(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and Instances are two parallel arrays that are always
in sync.
if (dispatchListeners[i](event, dispatchInstances[i])) {
return dispatchInstances[i];
}
}
} else if (dispatchListeners) {
if (dispatchListeners(event, dispatchInstances)) {
return dispatchInstances;
}
}
return null;
}
/**
* @see executeDispatchesInOrderStopAtTrueImpl
*/
function executeDispatchesInOrderStopAtTrue(event) {
var ret = executeDispatchesInOrderStopAtTrueImpl(event);
event._dispatchInstances = null;
event._dispatchListeners = null;
return ret;
}
/**
* Execution of a "direct" dispatch - there must be at most one dispatch
* accumulated on the event or it is considered an error. It doesn't rea
lly make
* sense for an event with multiple dispatches (bubbled) to keep track o
f the
* return values at each dispatch execution, but it does tend to make se
nse when
* dealing with "direct" dispatches.
*
* @return {*} The return value of executing the single dispatch.
*/
function executeDirectDispatch(event) {
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
var dispatchListener = event._dispatchListeners;
var dispatchInstance = event._dispatchInstances;
!!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'producti
on' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invaria
nt(false) : void 0;
event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromI
nstance(dispatchInstance) : null;
var res = dispatchListener ? dispatchListener(event) : null;
event.currentTarget = null;
event._dispatchListeners = null;
event._dispatchInstances = null;
return res;
}
/**
* @param {SyntheticEvent} event
* @return {boolean} True iff number of dispatches accumulated is greate
r than 0.
*/
function hasDispatches(event) {
return !!event._dispatchListeners;
}
/**
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactErrorUtils
*/
'use strict';
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
*/
'use strict';
var emptyFunction = __webpack_require__(106);
/**
* Similar to invariant but only logs a warning if the condition is not
met.
* This can be used to log issues in development environments in critica
l
* paths. Removing the logging code for production environments will kee
p the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
warning = function (condition, format) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 :
0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a
warning ' + 'message argument');
}
if (format.indexOf('Failed Composite propType: ') === 0) {
return; // Ignore CompositeComponent proptype check.
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React --// This error was thrown as a convenience so that you can use th
is stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
}
};
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 106 */
/***/ function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. Th
is is
* primarily useful idiomatically for overridable function endpoints whi
ch
* always need to be callable, since JS lacks a null-call idiom ala Coco
a.
*/
function emptyFunction() {}
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
/***/ },
/* 107 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule accumulateInto
*/
'use strict';
var invariant = __webpack_require__(95);
/**
*
* Accumulates items that must not be null or undefined into the first o
ne. This
* is used to conserve memory by avoiding array allocations, and thus sa
crifices
* API cleanness. Since `current` can be null before being passed in and
not
* null after this function, make sure to assign it back to `current`:
*
* `a = accumulateInto(a, b);`
*
* This API should be sparingly used. Try `accumulate` for something cle
aner.
*
* @return {*|array<*>} An accumulation of items.
*/
function accumulateInto(current, next) {
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(fa
lse, 'accumulateInto(...): Accumulated items must not be null or undefined.') :
invariant(false) : void 0;
if (current == null) {
return next;
}
// Both are not empty. Warning: Never call x.concat(y) when you are no
t
// certain that x is an Array (x could be a string with concat method)
.
}
};
module.exports = forEachAccumulated;
/***/ },
/* 109 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ViewportMetrics
*/
'use strict';
var ViewportMetrics = {
currentScrollLeft: 0,
currentScrollTop: 0,
refreshScrollValues: function (scrollPosition) {
ViewportMetrics.currentScrollLeft = scrollPosition.x;
ViewportMetrics.currentScrollTop = scrollPosition.y;
}
};
module.exports = ViewportMetrics;
/***/ },
/* 110 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule getVendorPrefixedEventName
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(91);
/**
* Generate a mapping of standard vendor prefixes using the defined styl
e property and event name.
*
* @param {string} styleProp
* @param {string} eventName
* @returns {object}
*/
function makePrefixMap(styleProp, eventName) {
var prefixes = {};
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
prefixes['Moz' + styleProp] = 'moz' + eventName;
prefixes['ms' + styleProp] = 'MS' + eventName;
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
return prefixes;
}
/**
* A list of event names to a configurable list of vendor prefixes.
*/
var vendorPrefixes = {
animationend: makePrefixMap('Animation', 'AnimationEnd'),
animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
animationstart: makePrefixMap('Animation', 'AnimationStart'),
transitionend: makePrefixMap('Transition', 'TransitionEnd')
};
/**
* Event names that have already been detected and prefixed (if applicab
le).
*/
var prefixedEventNames = {};
/**
* Element to check for prefixes on.
*/
var style = {};
/**
* Bootstrap if a DOM exists.
*/
if (ExecutionEnvironment.canUseDOM) {
style = document.createElement('div').style;
// On some platforms, in particular some releases of Android 4.x,
// the un-prefixed "animation" and "transition" properties are defined
on the
// style object but the events that fire will still be prefixed, so we
need
// to check if the un-prefixed events are usable, and if not remove th
em from the map.
if (!('AnimationEvent' in window)) {
delete vendorPrefixes.animationend.animation;
delete vendorPrefixes.animationiteration.animation;
delete vendorPrefixes.animationstart.animation;
}
// Same as above
if (!('TransitionEvent' in window)) {
delete vendorPrefixes.transitionend.transition;
}
}
/**
* Attempts to determine the correct vendor prefixed event name.
*
* @param {string} eventName
* @returns {string}
*/
function getVendorPrefixedEventName(eventName) {
if (prefixedEventNames[eventName]) {
return prefixedEventNames[eventName];
} else if (!vendorPrefixes[eventName]) {
return eventName;
}
var prefixMap = vendorPrefixes[eventName];
for (var styleProp in prefixMap) {
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
return prefixedEventNames[eventName] = prefixMap[styleProp];
}
}
return '';
}
module.exports = getVendorPrefixedEventName;
/***/ },
/* 111 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule isEventSupported
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(91);
var useHasFeature;
if (ExecutionEnvironment.canUseDOM) {
useHasFeature = document.implementation && document.implementation.has
Feature &&
// always returns true in newer browsers as per the standard.
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
document.implementation.hasFeature('', '') !== true;
}
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `ch
ange`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function isEventSupported(eventNameSuffix, capture) {
if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener'
in document)) {
return false;
}
var eventName = 'on' + eventNameSuffix;
var isSupported = eventName in document;
if (!isSupported) {
var element = document.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
// This is the only way to test support for the `wheel` event in IE9
+.
isSupported = document.implementation.hasFeature('Events.wheel', '3.
0');
}
return isSupported;
}
module.exports = isEventSupported;
/***/ },
/* 112 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactCurrentOwner
*/
'use strict';
/**
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that
are
* currently being constructed.
*/
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
module.exports = ReactCurrentOwner;
/***/ },
/* 113 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMComponentTree
*/
'use strict';
var DOMProperty = __webpack_require__(94);
var ReactDOMComponentFlags = __webpack_require__(114);
var invariant = __webpack_require__(95);
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var Flags = ReactDOMComponentFlags;
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toS
tring(36).slice(2);
/**
* Drill down (through composites and empty components) until we get a n
ative or
* native text component.
*
* This is pretty polymorphic but unavoidable with the current structure
we have
* for `_renderedChildren`.
*/
function getRenderedNativeOrTextFromComponent(component) {
var rendered;
while (rendered = component._renderedComponent) {
component = rendered;
}
return component;
}
/**
* Populate `_nativeNode` on the rendered native/text component with the
given
* DOM node. The passed `inst` can be a composite.
*/
function precacheNode(inst, node) {
var nativeInst = getRenderedNativeOrTextFromComponent(inst);
nativeInst._nativeNode = node;
node[internalInstanceKey] = nativeInst;
}
function uncacheNode(inst) {
var node = inst._nativeNode;
if (node) {
delete node[internalInstanceKey];
inst._nativeNode = null;
}
}
/**
* Populate `_nativeNode` on each child of `inst`, assuming that the chi
ldren
* match up with the DOM (element) children of `node`.
*
* We cache entire levels at once to avoid an n^2 problem where we acces
s the
* children of a node sequentially and have to walk from the start to ou
r target
* node every time.
*
* Since we update `_renderedChildren` and the actual DOM at (slightly)
* different times, we could race here and see a newer `_renderedChildre
n` than
* the DOM nodes we see. To avoid this, ReactMultiChild calls
* `prepareToManageChildren` before we change `_renderedChildren`, at wh
ich
* time the container's child nodes are always cached (until it unmounts
).
*/
function precacheChildNodes(inst, node) {
if (inst._flags & Flags.hasCachedChildNodes) {
return;
}
var children = inst._renderedChildren;
var childNode = node.firstChild;
outer: for (var name in children) {
if (!children.hasOwnProperty(name)) {
continue;
}
var childInst = children[name];
return closest;
}
/**
* Given a DOM node, return the ReactDOMComponent or ReactDOMTextCompone
nt
* instance, or null if the node was not rendered by this React.
*/
function getInstanceFromNode(node) {
var inst = getClosestInstanceFromNode(node);
if (inst != null && inst._nativeNode === node) {
return inst;
} else {
return null;
}
}
/**
* Given a ReactDOMComponent or ReactDOMTextComponent, return the corres
ponding
* DOM node.
*/
function getNodeFromInstance(inst) {
// Without this first invariant, passing a non-DOM-component triggers
the next
// invariant for a missing parent, which is super confusing.
!(inst._nativeNode !== undefined) ? process.env.NODE_ENV !== 'producti
on' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(fal
se) : void 0;
if (inst._nativeNode) {
return inst._nativeNode;
}
// Walk up the tree until we find an ancestor whose DOM node we have c
ached.
var parents = [];
while (!inst._nativeNode) {
parents.push(inst);
!inst._nativeParent ? process.env.NODE_ENV !== 'production' ? invari
ant(false, 'React DOM tree root should always have a node reference.') : invaria
nt(false) : void 0;
inst = inst._nativeParent;
}
// Now parents contains each ancestor that does *not* have a cached na
tive
// node, and `inst` is the deepest ancestor that does.
for (; parents.length; inst = parents.pop()) {
precacheChildNodes(inst, inst._nativeNode);
}
return inst._nativeNode;
}
var ReactDOMComponentTree = {
getClosestInstanceFromNode: getClosestInstanceFromNode,
getInstanceFromNode: getInstanceFromNode,
getNodeFromInstance: getNodeFromInstance,
precacheChildNodes: precacheChildNodes,
precacheNode: precacheNode,
uncacheNode: uncacheNode
};
module.exports = ReactDOMComponentTree;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 114 */
/***/ function(module, exports) {
/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMComponentFlags
*/
'use strict';
var ReactDOMComponentFlags = {
hasCachedChildNodes: 1 << 0
};
module.exports = ReactDOMComponentFlags;
/***/ },
/* 115 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMContainerInfo
*/
'use strict';
var validateDOMNesting = __webpack_require__(116);
var DOC_NODE_TYPE = 9;
function ReactDOMContainerInfo(topLevelWrapper, node) {
var info = {
_topLevelWrapper: topLevelWrapper,
_idCounter: 1,
_ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node
.ownerDocument : null,
_node: node,
_tag: node ? node.nodeName.toLowerCase() : null,
_namespaceURI: node ? node.namespaceURI : null
};
if (process.env.NODE_ENV !== 'production') {
info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(n
ull, info._tag, null) : null;
}
return info;
}
module.exports = ReactDOMContainerInfo;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 116 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule validateDOMNesting
*/
'use strict';
var _assign = __webpack_require__(97);
var emptyFunction = __webpack_require__(106);
var warning = __webpack_require__(105);
var validateDOMNesting = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
// This validation code was written based on the HTML5 parsing spec:
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-i
n-scope
//
// Note: this does not catch all invalid nesting, nor does it try to (
as it's
// not clear what practical benefit doing so provides); instead, we wa
rn only
// for cases where the parser will give a parse tree differing from wh
at React
// intended. For example, <b><div></div></b> is invalid but we don't w
arn
// because it still parses correctly; we do warn for other cases like
nested
// <p> tags where the beginning of the second element implicitly close
s the
// first, causing a confusing mess.
// https://html.spec.whatwg.org/multipage/syntax.html#special
var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'b
ase', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'c
enter', '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', 'th
ead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-i
n-scope
var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', '
marquee', 'object', 'template',
// https://html.spec.whatwg.org/multipage/syntax.html#html-integration
-point
// TODO: Distinguish by namespace here -- for <title>, including it he
re
// errs on the side of fewer warnings
'foreignObject', 'desc', 'title'];
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-i
n-button-scope
var buttonScopeTags = inScopeTags.concat(['button']);
// https://html.spec.whatwg.org/multipage/syntax.html#generate-implied
-end-tags
var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp
', 'rt'];
var emptyAncestorInfo = {
current: null,
formTag: null,
aTagInScope: null,
buttonTagInScope: null,
nobrTagInScope: null,
pTagInButtonScope: null,
listItemTagAutoclosing: null,
dlItemTagAutoclosing: null
};
var updatedAncestorInfo = function (oldInfo, tag, instance) {
var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
var info = { tag: tag, instance: instance };
if (inScopeTags.indexOf(tag) !== -1) {
ancestorInfo.aTagInScope = null;
ancestorInfo.buttonTagInScope = null;
ancestorInfo.nobrTagInScope = null;
}
if (buttonScopeTags.indexOf(tag) !== -1) {
ancestorInfo.pTagInButtonScope = null;
}
// See rules for 'li', 'dd', 'dt' start tags in
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-i
nbody
if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !==
'div' && tag !== 'p') {
ancestorInfo.listItemTagAutoclosing = null;
ancestorInfo.dlItemTagAutoclosing = null;
}
ancestorInfo.current = info;
if (tag === 'form') {
ancestorInfo.formTag = info;
}
if (tag === 'a') {
ancestorInfo.aTagInScope = info;
}
if (tag === 'button') {
ancestorInfo.buttonTagInScope = info;
}
if (tag === 'nobr') {
ancestorInfo.nobrTagInScope = info;
}
if (tag === 'p') {
ancestorInfo.pTagInButtonScope = info;
}
if (tag === 'li') {
ancestorInfo.listItemTagAutoclosing = info;
}
if (tag === 'dd' || tag === 'dt') {
ancestorInfo.dlItemTagAutoclosing = info;
}
return ancestorInfo;
};
/**
* Returns whether
*/
var isTagValidWithParent = function (tag, parentTag) {
// First, let's check if we're in an unusual parsing mode...
switch (parentTag) {
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-inselect
case 'select':
return tag === 'option' || tag === 'optgroup' || tag === '#text'
;
case 'optgroup':
return tag === 'option' || tag === '#text';
// Strictly speaking, seeing an <option> doesn't mean we're in a <
select>
// but
case 'option':
return tag === '#text';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-intd
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-incaption
// No special behavior since these rules fall back to "in body" mo
de for
// all except special table nodes which cause bad parsing behavior
anyway.
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-intr
case 'tr':
return tag === 'th' || tag === 'td' || tag === 'style' || tag ==
= 'script' || tag === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-intbody
case 'tbody':
case 'thead':
case 'tfoot':
return tag === 'tr' || tag === 'style' || tag === 'script' || ta
g === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-incolgroup
case 'colgroup':
return tag === 'col' || tag === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-intable
case 'table':
return tag === 'caption' || tag === 'colgroup' || tag === 'tbody
' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' |
| tag === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main
-inhead
case 'head':
return tag === 'base' || tag === 'basefont' || tag === 'bgsound'
|| tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' ||
tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'
;
// https://html.spec.whatwg.org/multipage/semantics.html#the-htmlelement
case 'html':
return tag === 'head' || tag === 'body';
case '#document':
return tag === 'html';
}
// Probably in the "in body" parsing mode, so we outlaw only tag com
bos
// where the parsing rules cause implicit opens or closes to be adde
d.
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-i
nbody
switch (tag) {
case 'h1':
case 'h2':
case 'h3':
case 'h4':
case 'h5':
case 'h6':
return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !==
'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
case 'rp':
case 'rt':
return impliedEndTags.indexOf(parentTag) === -1;
case
case
case
case
case
case
case
case
case
case
case
case
case
//
'body':
'caption':
'col':
'colgroup':
'frame':
'head':
'html':
'tbody':
'td':
'tfoot':
'th':
'thead':
'tr':
These tags are only valid with a few parents that have specia
l child
// parsing rules -- if we're down here, then none of those match
ed and
// so we allow it only if we don't know what the parent is, as a
ll other
// cases are invalid.
return parentTag == null;
}
return true;
};
/**
* Returns whether
*/
var findInvalidAncestorForTag = function (tag, ancestorInfo) {
switch (tag) {
case 'address':
case 'article':
case 'aside':
case 'blockquote':
case 'center':
case 'details':
case 'dialog':
case 'dir':
case 'div':
case 'dl':
case 'fieldset':
case 'figcaption':
case 'figure':
case 'footer':
case 'header':
case 'hgroup':
case 'main':
case 'menu':
case 'nav':
case 'ol':
case 'p':
case 'section':
case 'summary':
case 'ul':
case 'pre':
case 'listing':
case 'table':
case 'hr':
case 'xmp':
case 'h1':
case 'h2':
case 'h3':
case 'h4':
case 'h5':
case 'h6':
return ancestorInfo.pTagInButtonScope;
case 'form':
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
case 'li':
return ancestorInfo.listItemTagAutoclosing;
case 'dd':
case 'dt':
return ancestorInfo.dlItemTagAutoclosing;
case 'button':
return ancestorInfo.buttonTagInScope;
case 'a':
// Spec says something about storing a list of markers, but it s
ounds
// equivalent to this check.
return ancestorInfo.aTagInScope;
case 'nobr':
return ancestorInfo.nobrTagInScope;
}
return null;
};
/**
* Given a ReactCompositeComponent instance, return a list of its recu
rsive
* owners, starting at the root and ending with the instance itself.
*/
var findOwnerStack = function (instance) {
if (!instance) {
return [];
}
var stack = [];
do {
stack.push(instance);
} while (instance = instance._currentElement._owner);
stack.reverse();
return stack;
};
var didWarn = {};
validateDOMNesting = function (childTag, childInstance, ancestorInfo)
{
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null
: parentInfo;
var invalidAncestor = invalidParent ? null : findInvalidAncestorForT
ag(childTag, ancestorInfo);
var problematic = invalidParent || invalidAncestor;
if (problematic) {
var ancestorTag = problematic.tag;
var ancestorInstance = problematic.instance;
var childOwner = childInstance && childInstance._currentElement._o
wner;
var ancestorOwner = ancestorInstance && ancestorInstance._currentE
lement._owner;
var childOwners = findOwnerStack(childOwner);
var ancestorOwners = findOwnerStack(ancestorOwner);
var minStackLen = Math.min(childOwners.length, ancestorOwners.leng
th);
var i;
var deepestCommon = -1;
for (i = 0; i < minStackLen; i++) {
if (childOwners[i] === ancestorOwners[i]) {
deepestCommon = i;
} else {
break;
}
}
var UNKNOWN = '(unknown)';
var childOwnerNames = childOwners.slice(deepestCommon + 1).map(fun
ction (inst) {
return inst.getName() || UNKNOWN;
});
var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).m
ap(function (inst) {
return inst.getName() || UNKNOWN;
});
var ownerInfo = [].concat(
// If the parent and child instances have a common owner ancestor,
start
// with that -- otherwise we just start with the parent's owners.
deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNK
NOWN : [], ancestorOwnerNames, ancestorTag,
// If we're warning about an invalid (non-parent) ancestry, add '.
..'
invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join('
> ');
* @providesModule ReactDOMFeatureFlags
*/
'use strict';
var ReactDOMFeatureFlags = {
useCreateElement: true
};
module.exports = ReactDOMFeatureFlags;
/***/ },
/* 118 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactElement
*/
'use strict';
var _assign = __webpack_require__(97);
var ReactCurrentOwner = __webpack_require__(112);
var warning = __webpack_require__(105);
var canDefineProperty = __webpack_require__(119);
// The Symbol used to tag the ReactElement type. If there is no native S
ymbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] &
& Symbol['for']('react.element') || 0xeac7;
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown;
/**
* Factory method to create a new React element. This no longer adheres
to
* the class pattern, so do not use new to call it. Also, no instanceof
check
* will work. Instead test $$typeof field against Symbol.for('react.elem
ent') to check
* if something is a React Element.
*
*
*
*
*
*
t we
* can warn. We want to get rid of owner and replace string `ref`s with
arrow
* functions, and as long as `this` and owner are the same, there will b
e no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or othe
rwise)
* indicating filename, line number, and/or other information.
* @param {*} owner
* @param {*} props
* @internal
*/
var ReactElement = function (type, key, ref, self, source, owner, props)
{
var element = {
// This tag allow us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type: type,
key: key,
ref: ref,
props: props,
// Record the component responsible for creating this element.
_owner: owner
};
if (process.env.NODE_ENV !== 'production') {
// The validation flag is currently mutative. We put it on
// an external backing store so that we can freeze the whole object.
// This can be replaced with a WeakMap once they are implemented in
// commonly used development environments.
element._store = {};
// To make comparing ReactElements easier for testing purposes, we m
ake
//
//
//
if
});
// Two elements created in two different places should be consider
ed
// equal for testing purposes and therefore we hide it from enumer
ation.
Object.defineProperty(element, '_source', {
configurable: false,
enumerable: false,
writable: false,
value: source
});
} else {
element._store.validated = false;
element._self = self;
element._source = source;
}
if (Object.freeze) {
Object.freeze(element.props);
Object.freeze(element);
}
}
return element;
};
ReactElement.createElement = function (type, config, children) {
var propName;
// Reserved names are extracted
var props = {};
var
var
var
var
key = null;
ref = null;
self = null;
source = null;
if (config != null) {
if (process.env.NODE_ENV !== 'production') {
ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescri
ptor(config, 'ref').get ? null : config.ref;
key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescri
ptor(config, 'key').get ? null : '' + config.key;
} else {
ref = config.ref === undefined ? null : config.ref;
key = config.key === undefined ? null : '' + config.key;
}
self = config.__self === undefined ? null : config.__self;
source = config.__source === undefined ? null : config.__source;
// Remaining properties are added to a new props object
for (propName in config) {
if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnPrope
rty(propName)) {
props[propName] = config[propName];
}
}
}
// Children can be more than one argument, and those are transferred o
nto
// the newly allocated props object.
}
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.cu
rrent, props);
};
ReactElement.createFactory = function (type) {
var factory = ReactElement.createElement.bind(null, type);
// Expose the type on the factory and the prototype so that it can be
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
// This should not be named `constructor` since this may not be the fu
nction
// that created the element, and it may not even be a constructor.
// Legacy hook TODO: Warn if this is accessed
factory.type = type;
return factory;
};
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref,
oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
return newElement;
};
ReactElement.cloneElement = function (element, config, children) {
var propName;
// Original props are copied
var props = _assign({}, element.props);
// Reserved names are extracted
var key = element.key;
var ref = element.ref;
// Self is preserved since the owner is preserved.
var self = element._self;
// Source is preserved since cloneElement is unlikely to be targeted b
y a
// transpiler, and the original source is probably a better indicator
of the
// true owner.
var source = element._source;
// Owner will be preserved, unless ref is overridden
var owner = element._owner;
if (config != null) {
if (config.ref !== undefined) {
// Silently steal the ref from the parent.
ref = config.ref;
owner = ReactCurrentOwner.current;
}
if (config.key !== undefined) {
key = '' + config.key;
}
// Remaining properties override existing props
var defaultProps;
if (element.type && element.type.defaultProps) {
defaultProps = element.type.defaultProps;
}
for (propName in config) {
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule canDefineProperty
*/
'use strict';
var canDefineProperty = false;
if (process.env.NODE_ENV !== 'production') {
try {
Object.defineProperty({}, 'x', { get: function () {} });
canDefineProperty = true;
} catch (x) {
// IE will fail on defineProperty
}
}
module.exports = canDefineProperty;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 120 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactFeatureFlags
*/
'use strict';
var ReactFeatureFlags = {
// When true, call console.time() before and .timeEnd() after each top
-level
// render (both initial renders and updates). Useful when looking at p
rod-mode
// timeline profiles in Chrome, for example.
logTopLevelRenders: false
};
module.exports = ReactFeatureFlags;
/***/ },
/* 121 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactInstrumentation
*/
'use strict';
var ReactDebugTool = __webpack_require__(122);
module.exports = { debugTool: ReactDebugTool };
/***/ },
/* 122 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDebugTool
*/
'use strict';
var ReactInvalidSetStateWarningDevTool = __webpack_require__(123);
var warning = __webpack_require__(105);
var eventHandlers = [];
var handlerDoesThrowForEvent = {};
function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
if (process.env.NODE_ENV !== 'production') {
eventHandlers.forEach(function (handler) {
try {
if (handler[handlerFunctionName]) {
handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
}
} catch (e) {
process.env.NODE_ENV !== 'production' ? warning(!handlerDoesThro
wForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s:
%s', handlerFunctionName, e.message) : void 0;
handlerDoesThrowForEvent[handlerFunctionName] = true;
}
});
}
}
var ReactDebugTool = {
addDevtool: function (devtool) {
eventHandlers.push(devtool);
},
removeDevtool: function (devtool) {
for (var i = 0; i < eventHandlers.length; i++) {
if (eventHandlers[i] === devtool) {
eventHandlers.splice(i, 1);
i--;
}
}
},
onBeginProcessingChildContext: function () {
emitEvent('onBeginProcessingChildContext');
},
onEndProcessingChildContext: function () {
emitEvent('onEndProcessingChildContext');
},
onSetState: function () {
emitEvent('onSetState');
},
onMountRootComponent: function (internalInstance) {
emitEvent('onMountRootComponent', internalInstance);
},
onMountComponent: function (internalInstance) {
emitEvent('onMountComponent', internalInstance);
},
onUpdateComponent: function (internalInstance) {
emitEvent('onUpdateComponent', internalInstance);
},
onUnmountComponent: function (internalInstance) {
emitEvent('onUnmountComponent', internalInstance);
}
};
ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
module.exports = ReactDebugTool;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 123 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactInvalidSetStateWarningDevTool
*/
'use strict';
var warning = __webpack_require__(105);
if (process.env.NODE_ENV !== 'production') {
var processingChildContext = false;
var warnInvalidSetState = function () {
process.env.NODE_ENV !== 'production' ? warning(!processingChildCont
ext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
};
}
var ReactInvalidSetStateWarningDevTool = {
onBeginProcessingChildContext: function () {
processingChildContext = true;
},
onEndProcessingChildContext: function () {
processingChildContext = false;
},
onSetState: function () {
warnInvalidSetState();
}
};
module.exports = ReactInvalidSetStateWarningDevTool;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 124 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactMarkupChecksum
*/
'use strict';
var adler32 = __webpack_require__(125);
var TAG_END = /\/?>/;
var COMMENT_START = /^<\!\-\-/;
var ReactMarkupChecksum = {
CHECKSUM_ATTR_NAME: 'data-react-checksum',
/**
* @param {string} markup Markup string
* @return {string} Markup string with checksum attribute attached
*/
addChecksumToMarkup: function (markup) {
var checksum = adler32(markup);
// Add checksum (handle both parent tags, comments and self-closing
tags)
if (COMMENT_START.test(markup)) {
return markup;
} else {
return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_
ATTR_NAME + '="' + checksum + '"$&');
}
},
/**
* @param {string} markup to use
* @param {DOMElement} element root React element
* @returns {boolean} whether or not the markup is the same
*/
canReuseMarkup: function (markup, element) {
var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHEC
KSUM_ATTR_NAME);
existingChecksum = existingChecksum && parseInt(existingChecksum, 10
);
var markupChecksum = adler32(markup);
return markupChecksum === existingChecksum;
}
};
module.exports = ReactMarkupChecksum;
/***/ },
/* 125 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule adler32
*/
'use strict';
var MOD = 65521;
// adler32 is not cryptographically strong, and is only used to sanity c
heck that
// markup generated on the server matches the markup generated on the cl
ient.
// This implementation (a modified version of the SheetJS version) has b
een optimized
// for our use case, at the expense of conforming to the adler32 specifi
cation
// for non-ascii inputs.
function adler32(data) {
var a = 1;
var b = 0;
var i = 0;
var l = data.length;
var m = l & ~0x3;
while (i < m) {
var n = Math.min(i + 4096, m);
for (; i < n; i += 4) {
b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (
a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
}
a %= MOD;
b %= MOD;
}
for (; i < l; i++) {
b += a += data.charCodeAt(i);
}
a %= MOD;
b %= MOD;
return a | b << 16;
}
module.exports = adler32;
/***/ },
/* 126 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactPerf
*/
'use strict';
/**
* ReactPerf is a general AOP system designed to measure performance. Th
is
* module only has the hooks: see ReactDefaultPerf for the analysis tool
.
*/
var ReactPerf = {
/**
* Boolean to enable/disable measurement. Set to false by default to p
revent
* accidental logging and perf loss.
*/
enableMeasure: false,
/**
* Holds onto the measure function in use. By default, don't measure
* anything, but we'll override this if we inject a measure function.
*/
storedMeasure: _noMeasure,
/**
* @param {object} object
* @param {string} objectName
* @param {object<string>} methodNames
*/
measureMethods: function (object, objectName, methodNames) {
if (process.env.NODE_ENV !== 'production') {
for (var key in methodNames) {
if (!methodNames.hasOwnProperty(key)) {
continue;
}
object[key] = ReactPerf.measure(objectName, methodNames[key], ob
ject[key]);
}
}
},
/**
* Use this to wrap methods you want to measure. Zero overhead in prod
uction.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
measure: function (objName, fnName, func) {
if (process.env.NODE_ENV !== 'production') {
var measuredFunc = null;
var wrapper = function () {
if (ReactPerf.enableMeasure) {
if (!measuredFunc) {
measuredFunc = ReactPerf.storedMeasure(objName, fnName, func
);
}
return measuredFunc.apply(this, arguments);
}
return func.apply(this, arguments);
};
wrapper.displayName = objName + '_' + fnName;
return wrapper;
}
return func;
},
injection: {
/**
* @param {function} measure
*/
injectMeasure: function (measure) {
ReactPerf.storedMeasure = measure;
}
}
};
/**
* Simply passes through the measured function, without measuring it.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
function _noMeasure(objName, fnName, func) {
return func;
}
module.exports = ReactPerf;
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactReconciler
*/
'use strict';
var ReactRef = __webpack_require__(128);
var ReactInstrumentation = __webpack_require__(121);
/**
* Helper to call ReactRef.attachRefs with this composite component, spl
it out
* to avoid allocations in the transaction mount-ready queue.
*/
function attachRefs() {
ReactRef.attachRefs(this, this._currentElement);
}
var ReactReconciler = {
/**
* Initializes the component, renders markup, and registers event list
eners.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction}
transaction
* @param {?object} the containing native component instance
* @param {?object} info about the native container
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (internalInstance, transaction, nativeParent,
nativeContainerInfo, context) {
var markup = internalInstance.mountComponent(transaction, nativePare
nt, nativeContainerInfo, context);
if (internalInstance._currentElement && internalInstance._currentEle
ment.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInsta
nce);
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onMountComponent(internalInstance);
}
return markup;
},
/**
* Returns a value that can be passed to
* ReactComponentEnvironment.replaceNodeWithMarkup.
*/
getNativeNode: function (internalInstance) {
return internalInstance.getNativeNode();
},
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function (internalInstance, safely) {
ReactRef.detachRefs(internalInstance, internalInstance._currentEleme
nt);
internalInstance.unmountComponent(safely);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onUnmountComponent(internalInstance
);
}
},
/**
* Update a component using a new element.
*
* @param {ReactComponent} internalInstance
* @param {ReactElement} nextElement
* @param {ReactReconcileTransaction} transaction
* @param {object} context
* @internal
*/
receiveComponent: function (internalInstance, nextElement, transaction
, context) {
var prevElement = internalInstance._currentElement;
if (nextElement === prevElement && context === internalInstance._con
text) {
// Since elements are immutable after the owner is rendered,
// we can do a cheap identity compare here to determine if this is
a
// superfluous reconcile. It's possible for state to be mutable bu
t such
// change should trigger an update of the owner which would recrea
te
// the element. We explicitly check for the existence of an owner
since
// it's possible for an element created outside a composite to be
// deeply mutated and reused.
// TODO: Bailing out early is just a perf optimization right?
// TODO: Removing the return statement should affect correctness?
return;
}
var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement
);
if (refsChanged) {
ReactRef.detachRefs(internalInstance, prevElement);
}
internalInstance.receiveComponent(nextElement, transaction, context)
;
if (refsChanged && internalInstance._currentElement && internalInsta
nce._currentElement.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInsta
nce);
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance)
;
}
},
/**
* Flush any dirty changes in a component.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (internalInstance, transaction) {
internalInstance.performUpdateIfNecessary(transaction);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance)
;
}
}
};
module.exports = ReactReconciler;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 128 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactRef
*/
'use strict';
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactOwner
*/
'use strict';
var invariant = __webpack_require__(95);
/**
* ReactOwners are capable of storing references to owned components.
*
* All components are capable of //being// referenced by owner component
s, but
* only ReactOwner components are capable of //referencing// owned compo
nents.
* The named reference is known as a "ref".
*
* Refs are available when mounted and updated during reconciliation.
*
* var MyComponent = React.createClass({
*
render: function() {
*
return (
*
<div onClick={this.handleClick}>
*
<CustomComponent ref="custom" />
*
</div>
*
);
*
},
*
handleClick: function() {
*
this.refs.custom.handleClick();
*
},
*
componentDidMount: function() {
*
this.refs.custom.initialize();
*
}
* });
*
* Refs should rarely be used. When refs are used, they should only be d
one to
* control data that is not handled by React's data flow.
*
* @class ReactOwner
*/
var ReactOwner = {
/**
* @param {?object} object
* @return {boolean} True if `object` is a valid owner.
* @final
*/
isValidOwner: function (object) {
return !!(object && typeof object.attachRef === 'function' && typeof
object.detachRef === 'function');
},
/**
* Adds a component by ref to an owner component.
*
* @param {ReactComponent} component Component to reference.
* @param {string} ref Name by which to refer to the component.
* @param {ReactOwner} owner Component on which to record the ref.
* @final
* @internal
*/
addComponentAsRefTo: function (component, ref, owner) {
!ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'producti
on' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have ref
s. You might ' + 'be adding a ref to a component that was not created inside a c
omponent\'s ' + '`render` method, or you have multiple copies of React loaded '
+ '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : v
oid 0;
owner.attachRef(ref, component);
},
/**
* Removes a component by ref from an owner component.
*
* @param {ReactComponent} component Component to dereference.
* @param {string} ref Name of the ref to remove.
* @param {ReactOwner} owner Component on which the ref is recorded.
* @final
* @internal
*/
removeComponentAsRefFrom: function (component, ref, owner) {
!ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'producti
on' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can hav
e refs. You might ' + 'be removing a ref to a component that was not created ins
ide a component\'s ' + '`render` method, or you have multiple copies of React lo
aded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(fal
se) : void 0;
var ownerPublicInstance = owner.getPublicInstance();
// Check that `component`'s owner is still alive and that `component
` is still the current ref
// because we do not want to detach the ref if another component sto
le it.
if (ownerPublicInstance && ownerPublicInstance.refs[ref] === compone
nt.getPublicInstance()) {
owner.detachRef(ref);
}
}
};
module.exports = ReactOwner;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 130 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactUpdateQueue
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(112);
var ReactInstanceMap = __webpack_require__(131);
var ReactUpdates = __webpack_require__(132);
var invariant = __webpack_require__(95);
var warning = __webpack_require__(105);
function enqueueUpdate(internalInstance) {
ReactUpdates.enqueueUpdate(internalInstance);
}
function formatUnexpectedArgument(arg) {
var type = typeof arg;
if (type !== 'object') {
return type;
}
var displayName = arg.constructor && arg.constructor.name || type;
var keys = Object.keys(arg);
if (keys.length > 0 && keys.length < 20) {
return displayName + ' (keys: ' + keys.join(', ') + ')';
}
return displayName;
}
function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
var internalInstance = ReactInstanceMap.get(publicInstance);
if (!internalInstance) {
if (process.env.NODE_ENV !== 'production') {
// Only warn when we have a callerName. Otherwise we should be sil
ent.
// We're probably calling from enqueueCallback. We don't want to w
arn
// there because we already warned for the corresponding lifecycle
method.
process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(.
..): Can only update a mounted or mounting component. ' + 'This usually means yo
u 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;
}
return null;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.cu
rrent == 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 a
re an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName)
: void 0;
}
return internalInstance;
}
/**
* ReactUpdateQueue allows for state updates to be scheduled into a late
r
* reconciliation step.
*/
var ReactUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
if (process.env.NODE_ENV !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null) {
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAbo
utRefsInRender, '%s is accessing isMounted inside its render() function. ' + 're
nder() 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.', own
er.getName() || 'A component') : void 0;
owner._warnedAboutRefsInRender = true;
}
}
var internalInstance = ReactInstanceMap.get(publicInstance);
if (internalInstance) {
// During componentWillMount and render this will still be null bu
t after
// that will always render to something. At least for now. So we c
an use
// this hack.
return !!internalInstance._renderedComponent;
} else {
return false;
}
},
/**
* Enqueue a callback that will be executed after all the pending upda
tes
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` co
ntext.
* @param {?function} callback Called after state is updated.
* @param {string} callerName Name of the calling function in the publ
ic API.
* @internal
*/
enqueueCallback: function (publicInstance, callback, callerName) {
ReactUpdateQueue.validateCallback(callback, callerName);
var internalInstance = getInternalInstanceReadyForUpdate(publicInsta
nce);
// Previously we would throw an error if we didn't have an internal
// instance. Since we want to make it a no-op instead, we mirror the
same
//
//
//
if
}
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
// TODO: The callback here is ignored when setState is called from
// componentWillMount. Either fix it or disallow doing so completely
in
// favor of getInitialState. Alternatively, we can disallow
// componentWillMount during server-side rendering.
enqueueUpdate(internalInstance);
},
enqueueCallbackInternal: function (internalInstance, callback) {
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
enqueueUpdate(internalInstance);
},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of
the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
tate.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInsta
nce, 'setState');
if (!internalInstance) {
return;
}
var queue = internalInstance._pendingStateQueue || (internalInstance
._pendingStateQueue = []);
queue.push(partialState);
enqueueUpdate(internalInstance);
},
enqueueElementInternal: function (internalInstance, newElement) {
internalInstance._pendingElement = newElement;
enqueueUpdate(internalInstance);
},
validateCallback: function (callback, callerName) {
!(!callback || typeof callback === 'function') ? process.env.NODE_EN
V !== 'production' ? invariant(false, '%s(...): Expected the last optional `call
back` argument to be a ' + 'function. Instead received: %s.', callerName, format
UnexpectedArgument(callback)) : invariant(false) : void 0;
}
};
module.exports = ReactUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 131 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactInstanceMap
*/
'use strict';
/**
* `ReactInstanceMap` maintains a mapping from a public facing stateful
* instance (key) and the internal representation (value). This allows p
ublic
* methods to accept the user facing instance as an argument and map the
m back
* to internal methods.
*/
// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
var ReactInstanceMap = {
/**
* This API should be called `delete` but we'd have to make sure to al
ways
* transform these to strings for IE support. When this transform is f
ully
* supported we can rename it.
*/
remove: function (key) {
key._reactInternalInstance = undefined;
},
get: function (key) {
return key._reactInternalInstance;
},
has: function (key) {
return key._reactInternalInstance !== undefined;
},
set: function (key, value) {
key._reactInternalInstance = value;
}
};
module.exports = ReactInstanceMap;
/***/ },
/* 132 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactUpdates
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
var
CallbackQueue = __webpack_require__(133);
PooledClass = __webpack_require__(134);
ReactFeatureFlags = __webpack_require__(120);
ReactPerf = __webpack_require__(126);
ReactReconciler = __webpack_require__(127);
_assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
destructor: function () {
this.dirtyComponentsLength = null;
CallbackQueue.release(this.callbackQueue);
this.callbackQueue = null;
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransac
tion);
this.reconcileTransaction = null;
},
perform: function (method, scope, a) {
// Essentially calls `this.reconcileTransaction.perform(method, scop
e, a)`
// with this transaction's wrappers around it.
return Transaction.Mixin.perform.call(this, this.reconcileTransactio
n.perform, this.reconcileTransaction, method, scope, a);
}
});
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
function batchedUpdates(callback, a, b, c, d, e) {
ensureInjected();
batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
}
/**
* Array comparator for ReactComponents by mount ordering.
*
* @param {ReactComponent} c1 first component you're comparing
* @param {ReactComponent} c2 second component you're comparing
* @return {number} Return value usable by Array.prototype.sort().
*/
function mountOrderComparator(c1, c2) {
return c1._mountOrder - c2._mountOrder;
}
function runBatchedUpdates(transaction) {
var len = transaction.dirtyComponentsLength;
!(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'producti
on' ? invariant(false, 'Expected flush transaction\'s stored dirty-components le
ngth (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponen
ts.length) : invariant(false) : void 0;
// Since reconciling a component higher in the owner hierarchy usually
(not
// always -- see shouldComponentUpdate()) will reconcile children, rec
oncile
// them before their children by sorting the array.
dirtyComponents.sort(mountOrderComparator);
for (var i = 0; i < len; i++) {
// If a component is unmounted before pending changes apply, it will
still
// be here, but we assume that it has cleared its _pendingCallbacks
and
};
flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpd
ates', flushBatchedUpdates);
/**
* Mark a component as needing a rerender, adding an optional callback t
o a
* list of functions which will be executed once the rerender occurs.
*/
function enqueueUpdate(component) {
ensureInjected();
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't neste
d;
// verify that that's the case. (This is called by each top-level upda
te
// function, like setProps, setState, forceUpdate, etc.; creation and
// destruction of top-level components is guarded in ReactMount.)
if (!batchingStrategy.isBatchingUpdates) {
batchingStrategy.batchedUpdates(enqueueUpdate, component);
return;
}
dirtyComponents.push(component);
}
/**
* Enqueue a callback to be run at the end of the current batching cycle
. Throws
* if no updates are currently being performed.
*/
function asap(callback, context) {
!batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'produc
tion' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in
a context where' + 'updates are not being batched.') : invariant(false) : void 0
;
asapCallbackQueue.enqueue(callback, context);
asapEnqueued = true;
}
var ReactUpdatesInjection = {
injectReconcileTransaction: function (ReconcileTransaction) {
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? inva
riant(false, 'ReactUpdates: must provide a reconcile transaction class') : invar
iant(false) : void 0;
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
},
injectBatchingStrategy: function (_batchingStrategy) {
!_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invaria
nt(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) :
void 0;
!(typeof _batchingStrategy.batchedUpdates === 'function') ? process.
env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a b
atchedUpdates() function') : invariant(false) : void 0;
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? proces
s.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a
n isBatchingUpdates boolean attribute') : invariant(false) : void 0;
batchingStrategy = _batchingStrategy;
}
};
var ReactUpdates = {
/**
* React references `ReactReconcileTransaction` using this property in
order
* to allow dependency injection.
*
* @internal
*/
ReactReconcileTransaction: null,
batchedUpdates: batchedUpdates,
enqueueUpdate: enqueueUpdate,
flushBatchedUpdates: flushBatchedUpdates,
injection: ReactUpdatesInjection,
asap: asap
};
module.exports = ReactUpdates;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 133 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule CallbackQueue
*/
'use strict';
var _assign = __webpack_require__(97);
var PooledClass = __webpack_require__(134);
var invariant = __webpack_require__(95);
/**
* A specialized pseudo-event module to help keep track of components wa
iting to
* be notified when their DOM representations are available for use.
*
* This implements `PooledClass`, so you should never need to instantiat
e this.
* Instead, use `CallbackQueue.getPooled()`.
*
* @class ReactMountReady
* @implements PooledClass
* @internal
*/
function CallbackQueue() {
this._callbacks = null;
this._contexts = null;
}
_assign(CallbackQueue.prototype, {
/**
* Enqueues a callback to be invoked when `notifyAll` is invoked.
*
* @param {function} callback Invoked when `notifyAll` is invoked.
* @param {?object} context Context to call `callback` with.
* @internal
*/
enqueue: function (callback, context) {
this._callbacks = this._callbacks || [];
this._contexts = this._contexts || [];
this._callbacks.push(callback);
this._contexts.push(context);
},
/**
* Invokes all enqueued callbacks and clears the queue. This is invoke
d after
* the DOM representation of a component has been created or updated.
*
* @internal
*/
notifyAll: function () {
var callbacks = this._callbacks;
var contexts = this._contexts;
if (callbacks) {
!(callbacks.length === contexts.length) ? process.env.NODE_ENV !==
'production' ? invariant(false, 'Mismatched list of contexts in callback queue'
) : invariant(false) : void 0;
this._callbacks = null;
this._contexts = null;
for (var i = 0; i < callbacks.length; i++) {
callbacks[i].call(contexts[i]);
}
callbacks.length = 0;
contexts.length = 0;
}
},
checkpoint: function () {
return this._callbacks ? this._callbacks.length : 0;
},
rollback: function (len) {
if (this._callbacks) {
this._callbacks.length = len;
this._contexts.length = len;
}
},
/**
* Resets the internal queue.
*
* @internal
*/
reset: function () {
this._callbacks = null;
this._contexts = null;
},
/**
* `PooledClass` looks for this.
*/
destructor: function () {
this.reset();
}
});
PooledClass.addPoolingTo(CallbackQueue);
module.exports = CallbackQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 134 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule PooledClass
*/
'use strict';
var invariant = __webpack_require__(95);
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but woul
d
* require accessing the `arguments` object. In each of these, `this` re
fers to
* the Class itself, not an instance. If any others are needed, simply a
dd them
* here, or in their own files.
*/
var oneArgumentPooler = function (copyFieldsFrom) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, copyFieldsFrom);
return instance;
} else {
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule Transaction
*/
'use strict';
var invariant = __webpack_require__(95);
/**
* `Transaction` creates a black box that is able to wrap any method suc
h that
* certain invariants are maintained before and after the method is invo
ked
* (Even if an exception is thrown while invoking the wrapped method). W
hoever
* instantiates a transaction can provide enforcers of the invariants at
* creation time. The `Transaction` class itself will supply one additio
nal
* automatic invariant for you - the invariant that any transaction inst
ance
* should not be run while it is already being run. You would typically
create a
* single instance of a `Transaction` for reuse multiple times, that pot
entially
* is used to wrap several different methods. Wrappers are extremely sim
ple * they only require implementing two methods.
*
* <pre>
*
wrappers (injected at creation time)
*
+
+
*
|
|
*
+-----------------|--------|--------------+
*
|
v
|
|
*
|
+---------------+ |
|
*
| +--|
wrapper1 |---|----+
|
*
| | +---------------+ v
|
|
*
| |
+-------------+ |
|
*
| |
+----| wrapper2 |--------+ |
*
| |
|
+-------------+ |
| |
*
| |
|
|
| |
*
| v
v
v
v | wrappe
r
*
| +---+ +---+
+---------+
ants
* perform(anyMethod) | |
| |
| |
| | mainta
ined
* +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|------->
*
*
*
*
*
*
*
*
*
*
*
*
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| +---+ +---+ +---------+ +---+ +---+ |
| initialize
close
|
+-----------------------------------------+
</pre>
Use cases:
- Preserving the input selection ranges before/after reconciliation.
Restoring selection even in the event of an unexpected error.
- Deactivating events while rearranging the DOM, preventing blurs/foc
uses,
*
.
* - Flushing a queue of collected DOM mutations to the main UI thread a
fter a
* reconciliation takes place in a worker thread.
* - Invoking any collected `componentDidUpdate` callbacks after renderi
ng new
*
content.
need
* to bind in many cases.
*
* @param {function} method Member of scope to call.
* @param {Object} scope Scope to invoke from.
* @param {Object?=} a Argument to pass to the method.
* @param {Object?=} b Argument to pass to the method.
* @param {Object?=} c Argument to pass to the method.
* @param {Object?=} d Argument to pass to the method.
* @param {Object?=} e Argument to pass to the method.
* @param {Object?=} f Argument to pass to the method.
*
* @return {*} Return value from `method`.
*/
perform: function (method, scope, a, b, c, d, e, f) {
!!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? i
nvariant(false, 'Transaction.perform(...): Cannot initialize a transaction when
there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;
var errorThrown;
var ret;
try {
this._isInTransaction = true;
// Catching errors makes debugging more difficult, so we start wit
h
// errorThrown set to true before setting it to false after callin
g
// close -- if it's still set to true in the finally block, it mea
ns
// one of these calls threw.
errorThrown = true;
this.initializeAll(0);
ret = method.call(scope, a, b, c, d, e, f);
errorThrown = false;
} finally {
try {
if (errorThrown) {
// If `method` throws, prefer to show that stack trace over an
y thrown
// by invoking `closeAll`.
try {
this.closeAll(0);
} catch (err) {}
} else {
// Since `method` didn't throw, we don't want to silence the e
xception
// here.
this.closeAll(0);
}
} finally {
this._isInTransaction = false;
}
}
return ret;
},
initializeAll: function (startIndex) {
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
try {
t the
// first error is the one to bubble up.
try {
this.closeAll(i + 1);
} catch (e) {}
}
}
}
this.wrapperInitData.length = 0;
}
};
var Transaction = {
Mixin: Mixin,
/**
* Token to look for to determine if an error occurred.
*/
OBSERVED_ERROR: {}
};
module.exports = Transaction;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 136 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
*/
'use strict';
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 137 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule instantiateReactComponent
*/
'use strict';
var _assign = __webpack_require__(97);
var ReactCompositeComponent = __webpack_require__(138);
var ReactEmptyComponent = __webpack_require__(144);
var ReactNativeComponent = __webpack_require__(145);
var invariant = __webpack_require__(95);
var warning = __webpack_require__(105);
// To avoid a cyclic dependency, we create the final class in this modul
e
var ReactCompositeComponentWrapper = function (element) {
this.construct(element);
};
_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponen
t.Mixin, {
_instantiateReactComponent: instantiateReactComponent
});
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Check if the type reference is a known internal type. I.e. not a user
* provided composite type.
*
* @param {function} type
* @return {boolean} Returns true if this is a valid internal type.
*/
function isInternalComponentType(type) {
return typeof type === 'function' && typeof type.prototype !== 'undefi
ned' && typeof type.prototype.mountComponent === 'function' && typeof type.proto
type.receiveComponent === 'function';
}
/**
* Given a ReactNode, create an instance that will actually be mounted.
*
* @param {ReactNode} node
* @return {object} A new instance of the element's constructor.
* @protected
*/
function instantiateReactComponent(node) {
var instance;
if (node === null || node === false) {
instance = ReactEmptyComponent.create(instantiateReactComponent);
} else if (typeof node === 'object') {
var element = node;
!(element && (typeof element.type === 'function' || typeof element.t
ype === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'E
lement type is invalid: expected a string (for built-in components) ' + 'or a cl
ass/function (for composite components) but got: %s.%s', element.type == null ?
element.type : typeof element.type, getDeclarationErrorAddendum(element._owner))
: invariant(false) : void 0;
// Special case string values
if (typeof element.type === 'string') {
instance = ReactNativeComponent.createInternalComponent(element);
} else if (isInternalComponentType(element.type)) {
// This is temporarily available for custom components that are no
t string
// representations. I.e. ART. Once those are updated to use the st
ring
// representation, we can drop this code path.
instance = new element.type(element);
} else {
instance = new ReactCompositeComponentWrapper(element);
}
} else if (typeof node === 'string' || typeof node === 'number') {
instance = ReactNativeComponent.createInstanceForText(node);
} else {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'En
countered invalid React node of type %s', typeof node) : invariant(false) : void
0;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(typeof instance.moun
tComponent === 'function' && typeof instance.receiveComponent === 'function' &&
typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent
=== 'function', 'Only React Components can be mounted.') : void 0;
}
// These two fields are used by the DOM and ART diffing algorithms
// respectively. Instead of using expandos on components, we should be
// storing the state needed by the diffing algorithms elsewhere.
instance._mountIndex = 0;
instance._mountImage = null;
if (process.env.NODE_ENV !== 'production') {
instance._isOwnerNecessary = false;
instance._warnedAboutRefsInRender = false;
}
// Internal instances should fully constructed at this point, so they
should
// not get any new fields added to them at this point.
if (process.env.NODE_ENV !== 'production') {
if (Object.preventExtensions) {
Object.preventExtensions(instance);
}
}
return instance;
}
module.exports = instantiateReactComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 138 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactCompositeComponent
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
var
var
var
var
var
var
var
var
ReactComponentEnvironment = __webpack_require__(139);
ReactCurrentOwner = __webpack_require__(112);
ReactElement = __webpack_require__(118);
ReactErrorUtils = __webpack_require__(104);
ReactInstanceMap = __webpack_require__(131);
ReactInstrumentation = __webpack_require__(121);
ReactNodeTypes = __webpack_require__(140);
ReactPerf = __webpack_require__(126);
ReactPropTypeLocations = __webpack_require__(141);
ReactPropTypeLocationNames = __webpack_require__(142);
ReactReconciler = __webpack_require__(127);
ReactUpdateQueue = __webpack_require__(130);
var
var
var
var
emptyObject = __webpack_require__(136);
invariant = __webpack_require__(95);
shouldUpdateReactComponent = __webpack_require__(143);
warning = __webpack_require__(105);
function getDeclarationErrorAddendum(component) {
var owner = component._currentElement._owner || null;
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
function StatelessComponent(Component) {}
StatelessComponent.prototype.render = function () {
var Component = ReactInstanceMap.get(this)._currentElement.type;
var element = Component(this.props, this.context, this.updater);
warnIfInvalidElement(Component, element);
return element;
};
function warnIfInvalidElement(Component, element) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(element === null ||
element === false || ReactElement.isValidElement(element), '%s(...): A valid Rea
ct 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;
}
}
function shouldConstruct(Component) {
return Component.prototype && Component.prototype.isReactComponent;
}
/**
* ------------------ The Life-Cycle of a Composite Component ----------------*
* - constructor: Initialization of state. The instance is now retained.
* - componentWillMount
* - render
* - [children's constructors]
*
- [children's componentWillMount and render]
*
- [children's componentDidMount]
*
- componentDidMount
*
*
Update Phases:
*
- componentWillReceiveProps (only called if parent updated)
*
- shouldComponentUpdate
*
- componentWillUpdate
*
- render
*
- [children's constructors or receive props phases]
*
- componentDidUpdate
*
*
- componentWillUnmount
*
- [children's componentWillUnmount]
* - [children destroyed]
* - (destroyed): The instance is now blank, released by React and ready
for GC.
*
* ---------------------------------------------------------------------------*/
/**
* An incrementing ID assigned to each component when it is mounted. Thi
s is
* used to enforce the order in which `ReactUpdates` updates dirty compo
nents.
*
* @private
*/
var nextMountID = 1;
/**
* @lends {ReactCompositeComponent.prototype}
*/
var ReactCompositeComponentMixin = {
/**
* Base constructor for all composite component.
*
* @param {ReactElement} element
* @final
* @internal
*/
construct: function (element) {
this._currentElement = element;
this._rootNodeID = null;
this._instance = null;
this._nativeParent = null;
this._nativeContainerInfo = null;
// See ReactUpdateQueue
this._pendingElement = null;
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
this._renderedNodeType = null;
this._renderedComponent = null;
this._context = null;
this._mountOrder = 0;
this._topLevelWrapper = null;
// See ReactUpdates and ReactUpdateQueue.
this._pendingCallbacks = null;
// ComponentWillUnmount shall only be called once
this._calledComponentWillUnmount = false;
},
/**
* Initializes the component, renders markup, and registers event list
eners.
*
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction}
transaction
* @param {?object} nativeParent
* @param {?object} nativeContainerInfo
* @param {?object} context
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (transaction, nativeParent, nativeContainerIn
fo, context) {
this._context = context;
this._mountOrder = nextMountID++;
this._nativeParent = nativeParent;
this._nativeContainerInfo = nativeContainerInfo;
var publicProps = this._processProps(this._currentElement.props);
to
// catch them here, at initialization time, instead.
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialSt
ate || inst.getInitialState.isReactClassApproved, 'getInitialState was defined o
n %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;
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultPr
ops || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined o
n %s, a plain JavaScript class. ' + 'This is only supported for classes created
using React.createClass. ' + 'Use a static property to define defaultProps inste
ad.', this.getName() || 'a component') : void 0;
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;
process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes
, 'contextTypes was defined as an instance property on %s. Use a ' + 'static pro
perty to define contextTypes instead.', this.getName() || 'a component') : void
0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.compon
entShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpda
te(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a questi
on because the function is ' + 'expected to return a value.', this.getName() ||
'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.compon
entDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount()
. But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount(
)?', this.getName() || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.compon
entWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRe
cieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A c
omponent') : void 0;
}
var initialState = inst.state;
if (initialState === undefined) {
inst.state = initialState = null;
}
!(typeof initialState === 'object' && !Array.isArray(initialState))
? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be se
t to an object or null', this.getName() || 'ReactCompositeComponent') : invarian
t(false) : void 0;
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
var markup;
if (inst.unstable_handleError) {
markup = this.performInitialMountWithErrorHandling(renderedElement
, nativeParent, nativeContainerInfo, transaction, context);
} else {
markup = this.performInitialMount(renderedElement, nativeParent, n
ativeContainerInfo, transaction, context);
}
if (inst.componentDidMount) {
transaction.getReactMountReady().enqueue(inst.componentDidMount, i
nst);
}
return markup;
},
_constructComponent: function (publicProps, publicContext) {
if (process.env.NODE_ENV !== 'production') {
ReactCurrentOwner.current = this;
try {
return this._constructComponentWithoutOwner(publicProps, publicC
ontext);
} finally {
ReactCurrentOwner.current = null;
}
} else {
return this._constructComponentWithoutOwner(publicProps, publicCon
text);
}
},
_constructComponentWithoutOwner: function (publicProps, publicContext)
{
var Component = this._currentElement.type;
if (shouldConstruct(Component)) {
return new Component(publicProps, publicContext, ReactUpdateQueue)
;
} else {
return Component(publicProps, publicContext, ReactUpdateQueue);
}
},
performInitialMountWithErrorHandling: function (renderedElement, nativ
eParent, nativeContainerInfo, transaction, context) {
var markup;
var checkpoint = transaction.checkpoint();
try {
markup = this.performInitialMount(renderedElement, nativeParent, n
ativeContainerInfo, transaction, context);
} catch (e) {
// Roll back to checkpoint, handle error (which may add items to t
he transaction), and take a new checkpoint
transaction.rollback(checkpoint);
this._instance.unstable_handleError(e);
if (this._pendingStateQueue) {
this._instance.state = this._processPendingState(this._instance.
props, this._instance.context);
}
checkpoint = transaction.checkpoint();
this._renderedComponent.unmountComponent(true);
transaction.rollback(checkpoint);
// Try again - we've informed the component about the error, so th
ey can render an error message this time.
// If this throws again, the error will bubble up (and can be caug
ht by a higher error boundary).
markup = this.performInitialMount(renderedElement, nativeParent, n
ativeContainerInfo, transaction, context);
}
return markup;
},
ReactReconciler.unmountComponent(this._renderedComponent, safely);
this._renderedNodeType = null;
this._renderedComponent = null;
this._instance = null;
}
// Reset pending fields
// Even if this component is scheduled for another update in ReactUp
dates,
// it would still be ignored because these fields are reset.
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
this._pendingCallbacks = null;
this._pendingElement = null;
// These fields do not really need to be reset since this object is
no
// longer accessible.
this._context = null;
this._rootNodeID = null;
this._topLevelWrapper = null;
// Delete the reference from the instance to this internal represent
ation
// which allow the internals to be properly cleaned up even if the u
ser
// leaks a reference to the public instance.
ReactInstanceMap.remove(inst);
// Some existing components rely on inst.props even after they've be
en
//
//
//
//
},
/**
* Filters the context object to only contain keys specified in
* `contextTypes`
*
* @param {object} context
* @return {?object}
* @private
*/
_maskContext: function (context) {
var Component = this._currentElement.type;
var contextTypes = Component.contextTypes;
if (!contextTypes) {
return emptyObject;
}
var maskedContext = {};
for (var contextName in contextTypes) {
maskedContext[contextName] = context[contextName];
}
return maskedContext;
},
/**
}
},
receiveComponent: function (nextElement, transaction, nextContext) {
var prevElement = this._currentElement;
var prevContext = this._context;
this._pendingElement = null;
this.updateComponent(transaction, prevElement, nextElement, prevCont
ext, nextContext);
},
/**
* If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForc
eUpdate`
* is set, update the component.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (transaction) {
if (this._pendingElement != null) {
ReactReconciler.receiveComponent(this, this._pendingElement, trans
action, this._context);
}
if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
this.updateComponent(transaction, this._currentElement, this._curr
entElement, this._context, this._context);
}
},
/**
* Perform an update to a mounted component. The componentWillReceiveP
rops and
* shouldComponentUpdate methods are called, then (assuming the update
isn't
* skipped) the remaining update lifecycle methods are called and the
DOM
* representation is updated.
*
* By default, this implements React's rendering and reconciliation al
gorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevParentElement
* @param {ReactElement} nextParentElement
* @internal
* @overridable
*/
updateComponent: function (transaction, prevParentElement, nextParentE
lement, prevUnmaskedContext, nextUnmaskedContext) {
var inst = this._instance;
var willReceive = false;
var nextContext;
var nextProps;
// Determine if the context has changed or not
}
var nextState = this._processPendingState(nextProps, nextContext);
var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponent
Update || inst.shouldComponentUpdate(nextProps, nextState, nextContext);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== u
ndefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'bool
ean value. Make sure to return true or false.', this.getName() || 'ReactComposit
eComponent') : void 0;
}
if (shouldUpdate) {
this._pendingForceUpdate = false;
// Will set `this.props`, `this.state` and `this.context`.
this._performComponentUpdate(nextParentElement, nextProps, nextSta
te, nextContext, transaction, nextUnmaskedContext);
} else {
// If it's determined that a component should not update, we still
want
// to set props and state but we shortcut the rest of the update.
this._currentElement = nextParentElement;
this._context = nextUnmaskedContext;
inst.props = nextProps;
inst.state = nextState;
inst.context = nextContext;
}
},
_processPendingState: function (props, context) {
var inst = this._instance;
var queue = this._pendingStateQueue;
var replace = this._pendingReplaceState;
this._pendingReplaceState = false;
this._pendingStateQueue = null;
if (!queue) {
return inst.state;
}
if (replace && queue.length === 1) {
return queue[0];
}
var nextState = _assign({}, replace ? queue[0] : inst.state);
for (var i = replace ? 1 : 0; i < queue.length; i++) {
var partial = queue[i];
_assign(nextState, typeof partial === 'function' ? partial.call(in
st, nextState, props, context) : partial);
}
return nextState;
},
/**
* Merges new props and state, notifies delegate methods of update and
* performs update.
*
* @param {ReactElement} nextElement Next element
* @param {object} nextProps Next public object to set as properties.
* @param {?object} nextState Next object to set as state.
* @param {?object} nextContext Next public object to set as context.
* @param {ReactReconcileTransaction} transaction
* @param {?object} unmaskedContext
* @private
*/
_performComponentUpdate: function (nextElement, nextProps, nextState,
nextContext, transaction, unmaskedContext) {
var inst = this._instance;
var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
var prevProps;
var prevState;
var prevContext;
if (hasComponentDidUpdate) {
prevProps = inst.props;
prevState = inst.state;
prevContext = inst.context;
}
if (inst.componentWillUpdate) {
inst.componentWillUpdate(nextProps, nextState, nextContext);
}
this._currentElement = nextElement;
this._context = unmaskedContext;
inst.props = nextProps;
inst.state = nextState;
inst.context = nextContext;
this._updateRenderedComponent(transaction, unmaskedContext);
if (hasComponentDidUpdate) {
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.b
ind(inst, prevProps, prevState, prevContext), inst);
}
},
/**
* Call the component's `render` method and update the DOM accordingly
.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
_updateRenderedComponent: function (transaction, context) {
var prevComponentInstance = this._renderedComponent;
var prevRenderedElement = prevComponentInstance._currentElement;
var nextRenderedElement = this._renderValidatedComponent();
if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElem
ent)) {
ReactReconciler.receiveComponent(prevComponentInstance, nextRender
edElement, transaction, this._processChildContext(context));
} else {
var oldNativeNode = ReactReconciler.getNativeNode(prevComponentIns
tance);
ReactReconciler.unmountComponent(prevComponentInstance, false);
this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElemen
t);
this._renderedComponent = this._instantiateReactComponent(nextRend
eredElement);
var nextMarkup = ReactReconciler.mountComponent(this._renderedComp
onent, transaction, this._nativeParent, this._nativeContainerInfo, this._process
ChildContext(context));
this._replaceNodeWithMarkup(oldNativeNode, nextMarkup);
}
},
/**
* Overridden in shallow rendering.
*
* @protected
*/
_replaceNodeWithMarkup: function (oldNativeNode, nextMarkup) {
ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextM
arkup);
},
/**
* @protected
*/
_renderValidatedComponentWithoutOwnerOrContext: function () {
var inst = this._instance;
var renderedComponent = inst.render();
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (renderedComponent === undefined && inst.render._isMockFunction
) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
renderedComponent = null;
}
}
return renderedComponent;
},
/**
* @private
*/
_renderValidatedComponent: function () {
var renderedComponent;
ReactCurrentOwner.current = this;
try {
renderedComponent = this._renderValidatedComponentWithoutOwnerOrCo
ntext();
} finally {
ReactCurrentOwner.current = null;
}
!(
// TODO: An `isValidNode` function would probably be more appropriat
e
renderedComponent === null || renderedComponent === false || ReactEl
ement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production'
? invariant(false, '%s.render(): A valid React element (or null) must be return
ed. You may have ' + 'returned undefined, an array or some other invalid object.
', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
return renderedComponent;
},
/**
* Lazily allocates the refs object and stores `component` as `ref`.
*
* @param {string} ref Reference name.
* @param {component} component Component to store as `ref`.
* @final
* @private
*/
attachRef: function (ref, component) {
var inst = this.getPublicInstance();
!(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(
false, 'Stateless function components cannot have refs.') : invariant(false) : v
oid 0;
var publicComponentInstance = component.getPublicInstance();
if (process.env.NODE_ENV !== 'production') {
var componentName = component && component.getName ? component.get
Name() : 'a component';
process.env.NODE_ENV !== 'production' ? warning(publicComponentIns
tance != null, 'Stateless function components cannot be given refs ' + '(See ref
"%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, c
omponentName, this.getName()) : void 0;
}
var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
refs[ref] = publicComponentInstance;
},
/**
* Detaches a reference name.
*
* @param {string} ref Name to dereference.
* @final
* @private
*/
detachRef: function (ref) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactComponentEnvironment
*/
'use strict';
var invariant = __webpack_require__(95);
var injected = false;
var ReactComponentEnvironment = {
/**
* Optionally injectable environment dependent cleanup hook. (server v
s.
* browser etc). Example: A browser system caches DOM nodes based on c
omponent
* ID and must remove that cache entry when this instance is unmounted
.
*/
unmountIDFromEnvironment: null,
/**
* Optionally injectable hook for swapping out mount images in the mid
dle of
* the tree.
*/
replaceNodeWithMarkup: null,
/**
* Optionally injectable hook for processing a queue of child updates.
Will
* later move into MultiChildComponents.
*/
processChildrenUpdates: null,
injection: {
injectEnvironment: function (environment) {
!!injected ? process.env.NODE_ENV !== 'production' ? invariant(fal
se, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : i
nvariant(false) : void 0;
ReactComponentEnvironment.unmountIDFromEnvironment = environment.u
nmountIDFromEnvironment;
ReactComponentEnvironment.replaceNodeWithMarkup = environment.repl
aceNodeWithMarkup;
ReactComponentEnvironment.processChildrenUpdates = environment.pro
cessChildrenUpdates;
injected = true;
}
}
};
module.exports = ReactComponentEnvironment;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 140 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactNodeTypes
*/
'use strict';
var ReactElement = __webpack_require__(118);
var invariant = __webpack_require__(95);
var ReactNodeTypes = {
NATIVE: 0,
COMPOSITE: 1,
EMPTY: 2,
getType: function (node) {
if (node === null || node === false) {
return ReactNodeTypes.EMPTY;
} else if (ReactElement.isValidElement(node)) {
if (typeof node.type === 'function') {
return ReactNodeTypes.COMPOSITE;
} else {
return ReactNodeTypes.NATIVE;
}
}
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Un
expected node: %s', node) : invariant(false) : void 0;
}
};
module.exports = ReactNodeTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 141 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactPropTypeLocations
*/
'use strict';
var keyMirror = __webpack_require__(99);
var ReactPropTypeLocations = keyMirror({
prop: null,
context: null,
childContext: null
});
module.exports = ReactPropTypeLocations;
/***/ },
/* 142 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactPropTypeLocationNames
*/
'use strict';
var ReactPropTypeLocationNames = {};
if (process.env.NODE_ENV !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 143 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule shouldUpdateReactComponent
*/
'use strict';
/**
* Given a `prevElement` and `nextElement`, determines if the existing
* instance should be updated as opposed to being destroyed or replaced
by a new
* instance. Both arguments are elements. This ensures that this logic c
an
* operate on stateless trees without any backing instance.
*
* @param {?object} prevElement
* @param {?object} nextElement
* @return {boolean} True if the existing instance should be updated.
* @protected
*/
function shouldUpdateReactComponent(prevElement, nextElement) {
var prevEmpty = prevElement === null || prevElement === false;
var nextEmpty = nextElement === null || nextElement === false;
if (prevEmpty || nextEmpty) {
return prevEmpty === nextEmpty;
}
var prevType = typeof prevElement;
var nextType = typeof nextElement;
if (prevType === 'string' || prevType === 'number') {
return nextType === 'string' || nextType === 'number';
} else {
return nextType === 'object' && prevElement.type === nextElement.typ
e && prevElement.key === nextElement.key;
}
}
module.exports = shouldUpdateReactComponent;
/***/ },
/* 144 */
/***/ function(module, exports) {
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactEmptyComponent
*/
'use strict';
var emptyComponentFactory;
var ReactEmptyComponentInjection = {
injectEmptyComponentFactory: function (factory) {
emptyComponentFactory = factory;
}
};
var ReactEmptyComponent = {
create: function (instantiate) {
return emptyComponentFactory(instantiate);
}
};
ReactEmptyComponent.injection = ReactEmptyComponentInjection;
module.exports = ReactEmptyComponent;
/***/ },
/* 145 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactNativeComponent
*/
'use strict';
var _assign = __webpack_require__(97);
var invariant = __webpack_require__(95);
var autoGenerateWrapperClass = null;
var genericComponentClass = null;
// This registry keeps track of wrapper classes around native tags.
var tagToComponentClass = {};
var textComponentClass = null;
var ReactNativeComponentInjection = {
// This accepts a class that receives the tag string. This is a catch
all
// that can render any kind of tag.
injectGenericComponentClass: function (componentClass) {
genericComponentClass = componentClass;
},
// This accepts a text component class that takes the text string to b
e
// rendered as props.
injectTextComponentClass: function (componentClass) {
textComponentClass = componentClass;
},
// This accepts a keyed object with classes as values. Each key repres
ents a
// tag. That particular tag will use this class instead of the generic
one.
injectComponentClasses: function (componentClasses) {
_assign(tagToComponentClass, componentClasses);
}
};
/**
* Get a composite component wrapper class for a specific tag.
*
* @param {ReactElement} element The tag for which to get the class.
* @return {function} The React class constructor function.
*/
function getComponentClassForElement(element) {
if (typeof element.type === 'function') {
return element.type;
}
var tag = element.type;
var componentClass = tagToComponentClass[tag];
if (componentClass == null) {
tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass
(tag);
}
return componentClass;
}
/**
* Get a native internal component class for a specific tag.
*
* @param {ReactElement} element The element to create.
* @return {function} The internal class constructor function.
*/
function createInternalComponent(element) {
!genericComponentClass ? process.env.NODE_ENV !== 'production' ? invar
iant(false, 'There is no registered component for the tag %s', element.type) : i
nvariant(false) : void 0;
return new genericComponentClass(element);
}
/**
* @param {ReactText} text
* @return {ReactComponent}
*/
function createInstanceForText(text) {
return new textComponentClass(text);
}
/**
* @param {ReactComponent} component
* @return {boolean}
*/
function isTextComponent(component) {
return component instanceof textComponentClass;
}
var ReactNativeComponent = {
getComponentClassForElement: getComponentClassForElement,
createInternalComponent: createInternalComponent,
createInstanceForText: createInstanceForText,
isTextComponent: isTextComponent,
injection: ReactNativeComponentInjection
};
module.exports = ReactNativeComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 146 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(147);
/***/ },
/* 147 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule React
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
var
var
var
var
ReactChildren = __webpack_require__(148);
ReactComponent = __webpack_require__(152);
ReactClass = __webpack_require__(154);
ReactDOMFactories = __webpack_require__(156);
ReactElement = __webpack_require__(118);
ReactElementValidator = __webpack_require__(157);
ReactPropTypes = __webpack_require__(159);
ReactVersion = __webpack_require__(160);
createFactory = ReactElementValidator.createFactory;
cloneElement = ReactElementValidator.cloneElement;
}
var __spread = _assign;
if (process.env.NODE_ENV !== 'production') {
var warned = false;
__spread = function () {
process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spr
ead is deprecated and should not be used. Use ' + 'Object.assign directly or ano
ther 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;
warned = true;
return _assign.apply(null, arguments);
};
}
var React = {
// Modern
Children: {
map: ReactChildren.map,
forEach: ReactChildren.forEach,
count: ReactChildren.count,
toArray: ReactChildren.toArray,
only: onlyChild
},
Component: ReactComponent,
createElement: createElement,
cloneElement: cloneElement,
isValidElement: ReactElement.isValidElement,
// Classic
PropTypes: ReactPropTypes,
createClass: ReactClass.createClass,
createFactory: createFactory,
createMixin: function (mixin) {
// Currently a noop. Will be used to validate and trace mixins.
return mixin;
},
// This looks DOM specific but these are actually isomorphic helpers
// since they are just generating DOM strings.
DOM: ReactDOMFactories,
version: ReactVersion,
// Deprecated hook for JSX spread, don't use this for anything.
__spread: __spread
};
module.exports = React;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 148 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactChildren
*/
'use strict';
var PooledClass = __webpack_require__(134);
var ReactElement = __webpack_require__(118);
var emptyFunction = __webpack_require__(106);
var traverseAllChildren = __webpack_require__(149);
var twoArgumentPooler = PooledClass.twoArgumentPooler;
var fourArgumentPooler = PooledClass.fourArgumentPooler;
var userProvidedKeyEscapeRegex = /\/+/g;
function escapeUserProvidedKey(text) {
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
}
/**
* PooledClass representing the bookkeeping associated with performing a
child
* traversal. Allows avoiding binding callbacks.
*
* @constructor ForEachBookKeeping
* @param {!function} forEachFunction Function to perform traversal with
.
* @param {?*} forEachContext Context to perform context with.
*/
function ForEachBookKeeping(forEachFunction, forEachContext) {
this.func = forEachFunction;
this.context = forEachContext;
this.count = 0;
}
ForEachBookKeeping.prototype.destructor = function () {
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
function forEachSingleChild(bookKeeping, child, name) {
var func = bookKeeping.func;
var context = bookKeeping.context;
func.call(context, child, bookKeeping.count++);
}
/**
* Iterates through children that are typically specified as `props.chil
dren`.
*
* The provided forEachFunc(child, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} forEachFunc
* @param {*} forEachContext Context for forEachContext.
*/
function forEachChildren(children, forEachFunc, forEachContext) {
if (children == null) {
return children;
}
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEac
hContext);
traverseAllChildren(children, forEachSingleChild, traverseContext);
ForEachBookKeeping.release(traverseContext);
}
/**
* PooledClass representing the bookkeeping associated with performing a
child
* mapping. Allows avoiding binding callbacks.
*
* @constructor MapBookKeeping
* @param {!*} mapResult Object containing the ordered map of results.
* @param {!function} mapFunction Function to perform mapping with.
* @param {?*} mapContext Context to perform mapping with.
*/
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
this.result = mapResult;
this.keyPrefix = keyPrefix;
this.func = mapFunction;
this.context = mapContext;
this.count = 0;
}
MapBookKeeping.prototype.destructor = function () {
this.result = null;
this.keyPrefix = null;
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
var result = bookKeeping.result;
var keyPrefix = bookKeeping.keyPrefix;
var func = bookKeeping.func;
var context = bookKeeping.context;
var mappedChild = func.call(context, child, bookKeeping.count++);
if (Array.isArray(mappedChild)) {
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFun
ction.thatReturnsArgument);
/**
* Flatten a children object (typically specified as `props.children`) a
nd
* return an array with appropriately re-keyed children.
*/
function toArray(children) {
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.tha
tReturnsArgument);
return result;
}
var ReactChildren = {
forEach: forEachChildren,
map: mapChildren,
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
count: countChildren,
toArray: toArray
};
module.exports = ReactChildren;
/***/ },
/* 149 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule traverseAllChildren
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(112);
var ReactElement = __webpack_require__(118);
var
var
var
var
getIteratorFn = __webpack_require__(150);
invariant = __webpack_require__(95);
KeyEscapeUtils = __webpack_require__(151);
warning = __webpack_require__(105);
/**
* Generate a key string that identifies a component within a set.
*
* @param {*} component A component that could contain a manual key.
* @param {number} index Index that is used if a manual key is not provi
ded.
* @return {string}
*/
function getComponentKey(component, index) {
// Do some typechecking here since we call this blindly. We want to en
sure
// that we don't block potential future ES APIs.
if (component && typeof component === 'object' && component.key != nul
l) {
// Explicit key
return KeyEscapeUtils.escape(component.key);
}
// Implicit key determined by the index in the set
return index.toString(36);
}
/**
* @param {?*} children Children tree container.
* @param {!string} nameSoFar Name of the key path so far.
* @param {!function} callback Callback to invoke with each child found.
* @param {?*} traverseContext Used to pass information throughout the t
raversal
* process.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildrenImpl(children, nameSoFar, callback, traverse
Context) {
var type = typeof children;
if (type === 'undefined' || type === 'boolean') {
// All of the above are perceived as null.
children = null;
}
if (children === null || type === 'string' || type === 'number' || Rea
ctElement.isValidElement(children)) {
callback(traverseContext, children,
// If it's the only child, treat the name as if it was wrapped in an
array
// so that it's consistent if the number of children grows.
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSo
Far);
return 1;
}
var child;
var nextName;
var subtreeCount = 0; // Count of children found in the current subtre
e.
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEP
ARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
}
return subtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`,
but
*
*
*
*
*
*
the
* entire traversal. It can be used to store accumulations or anything e
lse that
* the callback might find relevant.
*
* @param {?*} children Children tree object.
* @param {!function} callback To invoke upon traversing each child.
* @param {?*} traverseContext Context for traversal.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, '', callback, traverseContext
);
}
module.exports = traverseAllChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 150 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule getIteratorFn
*/
'use strict';
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object
.
*
* Be sure to invoke the function with the iterable as context:
*
*
var iteratorFn = getIteratorFn(myIterable);
*
if (iteratorFn) {
*
var iterator = iteratorFn.call(myIterable);
*
...
*
}
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[IT
ERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
module.exports = getIteratorFn;
/***/ },
/* 151 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule KeyEscapeUtils
*/
'use strict';
/**
* Escape and wrap key so it is safe to use as a reactid
*
* @param {*} key to be escaped.
* @return {string} the escaped key.
*/
function escape(key) {
var escapeRegex = /[=:]/g;
var escaperLookup = {
'=': '=0',
':': '=2'
};
var escapedString = ('' + key).replace(escapeRegex, function (match) {
return escaperLookup[match];
});
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactComponent
*/
'use strict';
var ReactNoopUpdateQueue = __webpack_require__(153);
var ReactInstrumentation = __webpack_require__(121);
var
var
var
var
canDefineProperty = __webpack_require__(119);
emptyObject = __webpack_require__(136);
invariant = __webpack_require__(95);
warning = __webpack_require__(105);
/**
* Base class helpers for the updating state of a component.
*/
function ReactComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by
the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
ReactComponent.prototype.isReactComponent = {};
/**
* Sets a subset of the state. Always use this to mutate
* state. You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated,
so
* accessing `this.state` after calling this method may return the old v
alue.
*
* There is no guarantee that calls to `setState` will run synchronously
,
* as they may eventually be batched together. You can provide an optio
nal
* callback that will be executed when the call to setState is actually
* completed.
*
* When a function is provided to setState, it will be called at some po
int in
* the future (not synchronously). It will be called with the up to date
* component arguments (state, props, context). These values can be diff
erent
* from this.* because your function may be called after receiveProps bu
t before
* shouldComponentUpdate, and this new state, props, and context will no
t yet be
* assigned to this.
*
* @param {object|function} partialState Next partial state or function
to
*
produce next partial state to be merged with current state.
* @param {?function} callback Called after state is updated.
* @final
* @protected
*/
ReactComponent.prototype.setState = function (partialState, callback) {
!(typeof partialState === 'object' || typeof partialState === 'functio
n' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(
false, 'setState(...): takes an object of state variables to update or a ' + 'fu
nction which returns an object of state variables.') : invariant(false) : void 0
;
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetState();
process.env.NODE_ENV !== 'production' ? warning(partialState != null
, 'setState(...): You passed an undefined or null state object; ' + 'instead, us
e forceUpdate().') : void 0;
}
this.updater.enqueueSetState(this, partialState);
if (callback) {
this.updater.enqueueCallback(this, callback, 'setState');
}
};
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of th
e
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {?function} callback Called after update is complete.
* @final
* @protected
*/
ReactComponent.prototype.forceUpdate = function (callback) {
this.updater.enqueueForceUpdate(this);
if (callback) {
this.updater.enqueueCallback(this, callback, 'forceUpdate');
}
};
/**
* Deprecated APIs. These APIs used to exist on classic React classes bu
t since
* we would like to deprecate them, we're not going to move them over to
this
* modern base class. Instead, we define a getter that warns if it's acc
essed.
*/
if (process.env.NODE_ENV !== 'production') {
var deprecatedAPIs = {
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptio
ns and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
replaceState: ['replaceState', 'Refactor your code to use setState i
nstead (see ' + 'https://github.com/facebook/react/issues/3236).']
};
var defineDeprecationWarning = function (methodName, info) {
if (canDefineProperty) {
Object.defineProperty(ReactComponent.prototype, methodName, {
get: function () {
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...
) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void
0;
return undefined;
}
});
}
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
module.exports = ReactComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 153 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactNoopUpdateQueue
*/
'use strict';
var warning = __webpack_require__(105);
function warnTDZ(publicInstance, callerName) {
if (process.env.NODE_ENV !== 'production') {
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 && publi
cInstance.constructor.displayName || '') : void 0;
}
}
/**
* This is the abstract API for an update queue.
*/
var ReactNoopUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
return false;
},
/**
* Enqueue a callback that will be executed after all the pending upda
tes
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` co
ntext.
* @param {?function} callback Called after state is updated.
* @internal
*/
enqueueCallback: function (publicInstance, callback) {},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of
the
*
*
*
*
*
*
r.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
warnTDZ(publicInstance, 'forceUpdate');
},
/**
* Replaces all of the state. Always use this or `setState` to mutate
state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated
, so
* accessing `this.state` after calling this method may return the old
value.
*
* @param {ReactClass} publicInstance The instance that should rerende
r.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
warnTDZ(publicInstance, 'replaceState');
},
/**
* Sets a subset of the state. This only exists because _pendingState
is
* internal. This provides a merging strategy that is not available to
deep
* properties which is confusing. TODO: Expose pendingState or don't u
se it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerende
r.
* @param {object} partialState Next partial state to be merged with s
tate.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
warnTDZ(publicInstance, 'setState');
}
};
module.exports = ReactNoopUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 154 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactClass
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
var
ReactComponent = __webpack_require__(152);
ReactElement = __webpack_require__(118);
ReactPropTypeLocations = __webpack_require__(141);
ReactPropTypeLocationNames = __webpack_require__(142);
ReactNoopUpdateQueue = __webpack_require__(153);
var
var
var
var
var
emptyObject = __webpack_require__(136);
invariant = __webpack_require__(95);
keyMirror = __webpack_require__(99);
keyOf = __webpack_require__(155);
warning = __webpack_require__(105);
*
* @type {object}
* @optional
*/
propTypes: SpecPolicy.DEFINE_MANY,
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: SpecPolicy.DEFINE_MANY,
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: SpecPolicy.DEFINE_MANY,
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will b
e set on
* `this.props` if that prop is not specified (i.e. using an `in` chec
k).
*
* This method is invoked before `getInitialState` and therefore canno
t rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
/**
* Invoked once before the component is mounted. The return value will
be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
*
return {
*
isOn: false,
*
fooBaz: new BazFoo()
*
}
* }
*
* @return {object}
* @optional
*/
getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
/**
* @return {object}
* @optional
*/
getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
/**
* Uses props from `this.props` and state from `this.state` to render
the
* structure of the component.
*
* No guarantees are made about when or how often this method is invok
ed, so
* it must not have side effects.
*
* render: function() {
*
var name = this.props.name;
*
return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @nosideeffects
* @required
*/
render: SpecPolicy.DEFINE_ONCE,
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mou
nted.
* This may have side effects, but any external subscriptions or data
created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component has been mounted and has a DOM represent
ation.
* However, there is no guarantee that the DOM node is in the document
.
*
* Use this as an opportunity to operate on the DOM when the component
has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component
.
* @optional
*/
componentDidMount: SpecPolicy.DEFINE_MANY,
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updatin
g the
* state using `this.setState`. Current props are accessed via `this.p
rops`.
*
*
*
this.setState({
*
likesIncreasing: nextProps.likeCount > this.props.likeCount
*
});
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incomi
ng prop
* transition may cause a state change, but the opposite is not true.
If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
/**
* Invoked while deciding if the component should be updated as a resu
lt of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain th
at the
* transition to the new props/state/context will not require a compon
ent
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext
) {
*
return !equal(nextProps, this.props) ||
*
!equal(nextState, this.state) ||
*
!equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
/**
* Invoked when the component is about to update due to a transition f
rom
* `this.props`, `this.state` and `this.context` to `nextProps`, `next
State`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update
occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component
has
*
*
*
*
*
*
been updated.
@param
@param
@param
@param
{object} prevProps
{?object} prevState
{?object} prevContext
{DOMElement} rootNode DOM element representing the component
.
* @optional
*/
componentDidUpdate: SpecPolicy.DEFINE_MANY,
/**
* Invoked when the component is about to be removed from its parent a
nd have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will h
ave been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: SpecPolicy.DEFINE_MANY,
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation al
gorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: SpecPolicy.OVERRIDE_BASE
};
/**
* Mapping from class specification keys to special processing functions
.
*
* Although these are declared like instance properties in the specifica
tion
* when defining classes using `React.createClass`, they are actually st
atic
* and are accessible on the constructor instead of the prototype. Despi
te
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function (Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function (Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function (Constructor, childContextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocat
ions.childContext);
}
Constructor.childContextTypes = _assign({}, Constructor.childContext
Types, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.
context);
}
Constructor.contextTypes = _assign({}, Constructor.contextTypes, con
textTypes);
},
/**
* Special case getDefaultProps which should move into statics but req
uires
* automatic merging.
*/
getDefaultProps: function (Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(Construct
or.getDefaultProps, getDefaultProps);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function (Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.pro
p);
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes
);
},
statics: function (Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function () {} };
// noop
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = name in RESERVED_SPEC_KEYS;
!!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(fal
se, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, th
at shouldn\'t be on the "statics" key. Define it ' + 'as an instance property in
stead; it will still be accessible on the ' + 'constructor.', name) : invariant(
false) : void 0;
var isInherited = name in Constructor;
!!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(fa
lse, '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;
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything
in two.
*/
function mergeIntoWithNoDuplicateKeys(one, two) {
!(one && two && typeof one === 'object' && typeof two === 'object') ?
process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplica
teKeys(): Cannot merge non-objects.') : invariant(false) : void 0;
for (var key in two) {
if (two.hasOwnProperty(key)) {
!(one[key] === undefined) ? process.env.NODE_ENV !== 'production'
? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two obje
cts with the same key: `%s`. This conflict ' + 'may be due to a mixin; in partic
ular, this may be caused by two ' + 'getInitialState() or getDefaultProps() meth
ods returning objects ' + 'with clashing keys.', key) : invariant(false) : void
0;
one[key] = two[key];
}
}
return one;
}
/**
* Creates a function that invokes two functions and merges their return
values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
var c = {};
mergeIntoWithNoDuplicateKeys(c, a);
mergeIntoWithNoDuplicateKeys(c, b);
return c;
};
}
/**
* Creates a function that invokes two functions and ignores their retur
n vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* Binds a method to the component.
*
* @param {object} component Component whose method is going to be bound
.
* @param {function} method Method to be bound.
* @return {function} The bound method.
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
if (process.env.NODE_ENV !== 'production') {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
boundMethod.bind = function (newThis) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1
}
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function () {
return this.updater.isMounted(this);
}
};
var ReactClassComponent = function () {};
_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactCl
assMixin);
/**
* Module for creating composite components.
*
* @class ReactClass
*/
var ReactClass = {
/**
* Creates a composite component class given a class specification.
*
* @param {object} spec Class specification (which must define `render
`).
* @return {function} Component constructor function.
* @public
*/
createClass: function (spec) {
var Constructor = function (props, context, updater) {
// This constructor gets overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if (process.env.NODE_ENV !== 'production') {
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;
}
// Wire up auto-binding
if (this.__reactAutoBindPairs.length) {
bindAutoBindMethods(this);
}
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
this.state = null;
// ReactClasses doesn't have constructors. Instead, they use the
// getInitialState and componentWillMount methods for initializati
on.
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMFactories
*/
'use strict';
var ReactElement = __webpack_require__(118);
var ReactElementValidator = __webpack_require__(157);
var mapObject = __webpack_require__(158);
/**
* Create a factory that creates HTML tag elements.
*
* @param {string} tag Tag name (e.g. `div`).
* @private
*/
function createDOMFactory(tag) {
if (process.env.NODE_ENV !== 'production') {
return ReactElementValidator.createFactory(tag);
}
return ReactElement.createFactory(tag);
}
/**
* Creates a mapping from supported HTML tags to `ReactDOMComponent` cla
sses.
* This is also accessible via `React.DOM`.
*
* @public
*/
var ReactDOMFactories = mapObject({
a: 'a',
abbr: 'abbr',
address: 'address',
area: 'area',
article: 'article',
aside: 'aside',
audio: 'audio',
b: 'b',
base: 'base',
bdi: 'bdi',
bdo: 'bdo',
big: 'big',
blockquote: 'blockquote',
body: 'body',
br: 'br',
button: 'button',
canvas: 'canvas',
caption: 'caption',
cite: 'cite',
code: 'code',
col: 'col',
colgroup: 'colgroup',
data: 'data',
datalist: 'datalist',
dd: 'dd',
del: 'del',
details: 'details',
dfn: 'dfn',
dialog: 'dialog',
div: 'div',
dl: 'dl',
dt: 'dt',
em: 'em',
embed: 'embed',
fieldset: 'fieldset',
figcaption: 'figcaption',
figure: 'figure',
footer: 'footer',
form: 'form',
h1: 'h1',
h2: 'h2',
h3: 'h3',
h4: 'h4',
h5: 'h5',
h6: 'h6',
head: 'head',
header: 'header',
hgroup: 'hgroup',
hr: 'hr',
html: 'html',
i: 'i',
iframe: 'iframe',
img: 'img',
input: 'input',
ins: 'ins',
kbd: 'kbd',
keygen: 'keygen',
label: 'label',
legend: 'legend',
li: 'li',
link: 'link',
main: 'main',
map: 'map',
mark: 'mark',
menu: 'menu',
menuitem: 'menuitem',
meta: 'meta',
meter: 'meter',
nav: 'nav',
noscript: 'noscript',
object: 'object',
ol: 'ol',
optgroup: 'optgroup',
option: 'option',
output: 'output',
p: 'p',
param: 'param',
picture: 'picture',
pre: 'pre',
progress: 'progress',
q: 'q',
rp: 'rp',
rt: 'rt',
ruby: 'ruby',
s: 's',
samp: 'samp',
script: 'script',
section: 'section',
select: 'select',
small: 'small',
source: 'source',
span: 'span',
strong: 'strong',
style: 'style',
sub: 'sub',
summary: 'summary',
sup: 'sup',
table: 'table',
tbody: 'tbody',
td: 'td',
textarea: 'textarea',
tfoot: 'tfoot',
th: 'th',
thead: 'thead',
time: 'time',
title: 'title',
tr: 'tr',
track: 'track',
u: 'u',
ul: 'ul',
'var': 'var',
video: 'video',
wbr: 'wbr',
// SVG
circle: 'circle',
clipPath: 'clipPath',
defs: 'defs',
ellipse: 'ellipse',
g: 'g',
image: 'image',
line: 'line',
linearGradient: 'linearGradient',
mask: 'mask',
path: 'path',
pattern: 'pattern',
polygon: 'polygon',
polyline: 'polyline',
radialGradient: 'radialGradient',
rect: 'rect',
stop: 'stop',
svg: 'svg',
text: 'text',
tspan: 'tspan'
}, createDOMFactory);
module.exports = ReactDOMFactories;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 157 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactElementValidator
*/
/**
* ReactElementValidator provides a wrapper around a element factory
* which validates the props passed to the element. This is intended to
be
* used only in DEV and could be replaced by a static type checker for l
anguages
* that support it.
*/
'use strict';
var
var
var
var
ReactElement = __webpack_require__(118);
ReactPropTypeLocations = __webpack_require__(141);
ReactPropTypeLocationNames = __webpack_require__(142);
ReactCurrentOwner = __webpack_require__(112);
var
var
var
var
canDefineProperty = __webpack_require__(119);
getIteratorFn = __webpack_require__(150);
invariant = __webpack_require__(95);
warning = __webpack_require__(105);
function getDeclarationErrorAddendum() {
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
}
} else if (node) {
var iteratorFn = getIteratorFn(node);
// Entry iterators provide implicit keys.
if (iteratorFn) {
if (iteratorFn !== node.entries) {
var iterator = iteratorFn.call(node);
var step;
while (!(step = iterator.next()).done) {
if (ReactElement.isValidElement(step.value)) {
validateExplicitKey(step.value, parentType);
}
}
}
}
}
}
/**
* Assert that the props are valid
*
* @param {string} componentName Name of the component for error message
s.
* @param {object} propTypes Map of prop name to a ReactPropType
* @param {object} props
* @param {string} location e.g. "prop", "context", "child context"
* @private
*/
function checkPropTypes(componentName, propTypes, props, location) {
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error;
// Prop type validation may throw. In case they do, we don't want
to
// fail the render phase where it didn't fail before. So we log it
.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the
same
// behavior as without this statement except with a better messa
ge.
!(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;
error = propTypes[propName](props, propName, componentName, loca
tion);
} catch (ex) {
error = ex;
}
process.env.NODE_ENV !== 'production' ? warning(!error || error in
stanceof 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 h
ave forgotten to pass an argument to the type checker ' + 'creator (arrayOf, ins
tanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).',
componentName || 'React class', ReactPropTypeLocationNames[location], propName,
typeof error) : void 0;
if (error instanceof Error && !(error.message in loggedTypeFailure
s)) {
// Skip key warning if the type isn't valid since our key validation
logic
// doesn't expect a non-string/function type and can throw confusing
errors.
// We don't want exception behavior to differ between dev and prod.
// (Rendering will throw with a helpful message and as soon as the t
ype is
// fixed, the key warnings will appear.)
if (validType) {
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], type);
}
}
validatePropTypes(element);
return element;
},
createFactory: function (type) {
var validatedFactory = ReactElementValidator.createElement.bind(null
, type);
// Legacy hook TODO: Warn if this is accessed
validatedFactory.type = type;
if (process.env.NODE_ENV !== 'production') {
if (canDefineProperty) {
Object.defineProperty(validatedFactory, 'type', {
enumerable: false,
get: function () {
process.env.NODE_ENV !== 'production' ? warning(false, 'Fact
ory.type is deprecated. Access the class directly ' + 'before passing it to crea
teFactory.') : void 0;
Object.defineProperty(this, 'type', {
value: type
});
return type;
}
});
}
}
return validatedFactory;
},
cloneElement: function (element, props, children) {
var newElement = ReactElement.cloneElement.apply(this, arguments);
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], newElement.type);
}
validatePropTypes(newElement);
return newElement;
}
};
module.exports = ReactElementValidator;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 158 */
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
*/
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* Executes the provided `callback` once for each enumerable own propert
y in the
* object and constructs a new object from the results. The `callback` i
s
* invoked with three arguments:
*
* - the property value
* - the property name
* - the object being traversed
*
* Properties that are added after the call to `mapObject` will not be v
isited
* by `callback`. If the values of existing properties are changed, the
value
* passed to `callback` will be the value at the time `mapObject` visits
them.
* Properties that are deleted before being visited are not visited.
*
* @grep function objectMap()
* @grep function objMap()
*
* @param {?object} object
* @param {function} callback
* @param {*} context
* @return {?object}
*/
function mapObject(object, callback, context) {
if (!object) {
return null;
}
var result = {};
for (var name in object) {
if (hasOwnProperty.call(object, name)) {
result[name] = callback.call(context, object[name], name, object);
}
}
return result;
}
module.exports = mapObject;
/***/ },
/* 159 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactPropTypes
*/
'use strict';
var ReactElement = __webpack_require__(118);
var ReactPropTypeLocationNames = __webpack_require__(142);
var emptyFunction = __webpack_require__(106);
var getIteratorFn = __webpack_require__(150);
/**
* Collection of methods that allow declaration and validation of props
that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
*
propTypes: {
*
// An optional string prop named "description".
*
description: Props.string,
*
*
// A required enum prop named "category".
*
category: Props.oneOf(['News','Photos']).isRequired,
*
*
// A prop named "dialog" that requires an instance of Dialog.
*
dialog: Props.instanceOf(Dialog).isRequired
*
},
*
render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceO
f(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signatur
e. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
*
propTypes: {
*
// An optional string or URI prop named "href".
*
href: function(props, propName, componentName) {
*
var propValue = props[propName];
*
if (propValue != null && typeof propValue !== 'string' &&
*
!(propValue instanceof URI)) {
*
return new Error(
*
'Expected a string or an URI for ' + propName + ' in ' +
*
componentName
*
);
*
}
*
}
*
},
*
render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* inlined Object.is polyfill to avoid requiring consumers ship their ow
n
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Glo
bal_Objects/Object/is
*/
/*eslint-disable no-self-compare*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/*eslint-enable no-self-compare*/
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, locatio
n, propFullName) {
'` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expect
ed an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, pro
pFullName + '[' + i + ']');
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullNa
me) {
if (!ReactElement.isValidElement(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName +
'` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.')
);
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullNa
me) {
if (!(props[propName] instanceof expectedClass)) {
var locationName = ReactPropTypeLocationNames[location];
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new Error('Invalid ' + locationName + ' `' + propFullName +
'` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`,
expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
return createChainableTypeChecker(function () {
return new Error('Invalid argument supplied to oneOf, expected an
instance of array.');
});
}
function validate(props, propName, componentName, location, propFullNa
me) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var locationName = ReactPropTypeLocationNames[location];
var valuesString = JSON.stringify(expectedValues);
return new Error('Invalid ' + locationName + ' `' + propFullName + '
` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expect
ed one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullNa
me) {
if (typeof typeChecker !== 'function') {
return new Error('Property `' + propFullName + '` of component `'
+ componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName +
'` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expect
ed an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location,
propFullName + '.' + key);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
return createChainableTypeChecker(function () {
return new Error('Invalid argument supplied to oneOfType, expected
an instance of array.');
});
}
function validate(props, propName, componentName, location, propFullNa
me) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName
) == null) {
return null;
}
}
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values
.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
// Equivalent of `typeof` but with special handling for array and regexp
.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather
than
// 'object' for typeof a RegExp. We'll normalize this here so that /
bla/
// passes PropTypes.object.
return 'object';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messa
ges.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule onlyChild
*/
'use strict';
var ReactElement = __webpack_require__(118);
var invariant = __webpack_require__(95);
/**
* Returns the first child in a collection of children and verifies that
there
* is only one child in the collection. The current implementation of th
is
* function assumes that a single child gets passed without a wrapper, b
ut the
* purpose of this helper function is to abstract away the particular st
ructure
* of children.
*
* @param {?object} children Child collection structure.
* @return {ReactElement} The first and only `ReactElement` contained in
the
* structure.
*/
function onlyChild(children) {
!ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'pro
duction' ? invariant(false, 'onlyChild must be passed a children with exactly on
e child.') : invariant(false) : void 0;
return children;
}
module.exports = onlyChild;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 162 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(163);
/***/ },
/* 163 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOM
*/
/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
'use strict';
var
var
var
var
ReactDOMComponentTree = __webpack_require__(113);
ReactDefaultInjection = __webpack_require__(164);
ReactMount = __webpack_require__(87);
ReactPerf = __webpack_require__(126);
findDOMNode = __webpack_require__(250);
getNativeComponentFromComposite = __webpack_require__(251);
renderSubtreeIntoContainer = __webpack_require__(252);
warning = __webpack_require__(105);
ReactDefaultInjection.inject();
var render = ReactPerf.measure('React', 'render', ReactMount.render);
var React = {
findDOMNode: findDOMNode,
render: render,
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
version: ReactVersion,
/* eslint-disable camelcase */
unstable_batchedUpdates: ReactUpdates.batchedUpdates,
unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
};
// Inject the runtime into a devtools global hook regardless of browser.
// Allows for debugging when the hook is injected on the page.
/* eslint-enable camelcase */
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __RE
ACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
ComponentTree: {
getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstan
ceFromNode,
getNodeFromInstance: function (inst) {
// inst is an internal instance (but could be a composite)
if (inst._renderedComponent) {
inst = getNativeComponentFromComposite(inst);
}
if (inst) {
return ReactDOMComponentTree.getNodeFromInstance(inst);
} else {
return null;
}
}
},
Mount: ReactMount,
Reconciler: ReactReconciler
});
}
if (process.env.NODE_ENV !== 'production') {
var ExecutionEnvironment = __webpack_require__(91);
if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
// First check if devtools is not installed
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
// If we're in Chrome or Firefox, provide a download link if not i
nstalled.
if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAg
ent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
// Firefox does not have the issue with devtools loaded over fil
e://
var showFileUrlMessage = window.location.protocol.indexOf('http'
) === -1 && navigator.userAgent.indexOf('Firefox') === -1;
console.debug('Download the React DevTools ' + (showFileUrlMessa
ge ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better de
velopment experience: ' + 'https://fb.me/react-devtools');
}
}
var testFunc = function testFn() {};
process.env.NODE_ENV !== 'production' ? warning((testFunc.name || te
stFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a mini
fied copy of the development build ' + 'of React. When deploying React apps to p
roduction, make sure to use ' + 'the production build which skips development wa
rnings and is faster. ' + 'See https://fb.me/react-minification for more details
.') : void 0;
// If we're in IE8, check to see if we are in compatibility mode and
provide
// information on preventing compatibility mode
var ieCompatibilityMode = document.documentMode && document.document
Mode < 8;
process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode
, 'Internet Explorer is running in compatibility mode; please add the ' + 'follo
wing tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-U
A-Compatible" content="IE=edge" />') : void 0;
var expectedFeatures = [
// shims
Array.isArray, Array.prototype.every, Array.prototype.forEach, Array
.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Obje
ct.keys, String.prototype.split, String.prototype.trim];
for (var i = 0; i < expectedFeatures.length; i++) {
if (!expectedFeatures[i]) {
process.env.NODE_ENV !== 'production' ? warning(false, 'One or m
ore ES5 shims expected by React are not available: ' + 'https://fb.me/react-warn
ing-polyfills') : void 0;
break;
}
}
}
}
module.exports = React;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 164 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDefaultInjection
*/
'use strict';
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
BeforeInputEventPlugin = __webpack_require__(165);
ChangeEventPlugin = __webpack_require__(172);
DefaultEventPluginOrder = __webpack_require__(175);
EnterLeaveEventPlugin = __webpack_require__(176);
ExecutionEnvironment = __webpack_require__(91);
HTMLDOMPropertyConfig = __webpack_require__(180);
ReactComponentBrowserEnvironment = __webpack_require__(181);
ReactDOMComponent = __webpack_require__(189);
ReactDOMComponentTree = __webpack_require__(113);
ReactDOMEmptyComponent = __webpack_require__(217);
ReactDOMTreeTraversal = __webpack_require__(218);
ReactDOMTextComponent = __webpack_require__(219);
ReactDefaultBatchingStrategy = __webpack_require__(220);
ReactEventListener = __webpack_require__(221);
ReactInjection = __webpack_require__(224);
ReactReconcileTransaction = __webpack_require__(225);
SVGDOMPropertyConfig = __webpack_require__(233);
SelectEventPlugin = __webpack_require__(234);
SimpleEventPlugin = __webpack_require__(235);
ReactInjection.EventPluginHub.injectEventPluginsByName({
SimpleEventPlugin: SimpleEventPlugin,
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
ChangeEventPlugin: ChangeEventPlugin,
SelectEventPlugin: SelectEventPlugin,
BeforeInputEventPlugin: BeforeInputEventPlugin
});
ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMCom
ponent);
ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextCo
mponent);
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConf
ig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfi
g);
ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (in
stantiate) {
return new ReactDOMEmptyComponent(instantiate);
});
ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransa
ction);
ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStra
tegy);
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnviro
nment);
if (process.env.NODE_ENV !== 'production') {
var url = ExecutionEnvironment.canUseDOM && window.location.href ||
'';
if (/[?&]react_perf\b/.test(url)) {
var ReactDefaultPerf = __webpack_require__(246);
ReactDefaultPerf.start();
}
}
}
module.exports = {
inject: inject
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 165 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule BeforeInputEventPlugin
*/
'use strict';
var
var
var
var
var
var
EventConstants = __webpack_require__(98);
EventPropagators = __webpack_require__(166);
ExecutionEnvironment = __webpack_require__(91);
FallbackCompositionState = __webpack_require__(167);
SyntheticCompositionEvent = __webpack_require__(169);
SyntheticInputEvent = __webpack_require__(171);
},
dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKey
Press, topLevelTypes.topTextInput, topLevelTypes.topPaste]
},
compositionEnd: {
phasedRegistrationNames: {
bubbled: keyOf({ onCompositionEnd: null }),
captured: keyOf({ onCompositionEndCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEn
d, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp,
topLevelTypes.topMouseDown]
},
compositionStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onCompositionStart: null }),
captured: keyOf({ onCompositionStartCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionSt
art, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp
, topLevelTypes.topMouseDown]
},
compositionUpdate: {
phasedRegistrationNames: {
bubbled: keyOf({ onCompositionUpdate: null }),
captured: keyOf({ onCompositionUpdateCapture: null })
},
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUp
date, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyU
p, topLevelTypes.topMouseDown]
}
};
// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;
/**
* Return whether a native keypress event is assumed to be a command.
* This is required because Firefox fires `keypress` events for key comm
ands
* (cut, copy, select-all, etc.) even though no character is inserted.
*/
function isKeypressCommand(nativeEvent) {
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaK
ey) &&
// ctrlKey && altKey is equivalent to AltGr, and is not a command.
!(nativeEvent.ctrlKey && nativeEvent.altKey);
}
/**
* Translate native top level events into event types.
*
* @param {string} topLevelType
* @return {object}
*/
function getCompositionEventType(topLevelType) {
switch (topLevelType) {
case topLevelTypes.topCompositionStart:
return eventTypes.compositionStart;
case topLevelTypes.topCompositionEnd:
return eventTypes.compositionEnd;
case topLevelTypes.topCompositionUpdate:
return eventTypes.compositionUpdate;
}
}
/**
* Does our fallback best-guess model think this event signifies that
* composition has begun?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionStart(topLevelType, nativeEvent) {
return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCod
e === START_KEYCODE;
}
/**
* Does our fallback mode think that this event is the end of compositio
n?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
switch (topLevelType) {
case topLevelTypes.topKeyUp:
// Command keys insert or clear IME input.
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
case topLevelTypes.topKeyDown:
// Expect IME keyCode on each keydown. If we get any other
// code we must have exited earlier.
return nativeEvent.keyCode !== START_KEYCODE;
case topLevelTypes.topKeyPress:
case topLevelTypes.topMouseDown:
case topLevelTypes.topBlur:
// Events are not possible without cancelling IME.
return true;
default:
return false;
}
}
/**
* Google Input Tools provides composition data via a CustomEvent,
* with the `data` property populated in the `detail` object. If this
* is available on the event object, use it. If not, this is a plain
* composition event and we have nothing special to extract.
*
* @param {object} nativeEvent
* @return {?string}
*/
function getDataFromCustomEvent(nativeEvent) {
var detail = nativeEvent.detail;
if (typeof detail === 'object' && 'data' in detail) {
return detail.data;
}
return null;
}
// Track the current IME composition fallback object, if any.
var currentComposition = null;
/**
* @return {?object} A SyntheticCompositionEvent.
*/
function extractCompositionEvent(topLevelType, targetInst, nativeEvent,
nativeEventTarget) {
var eventType;
var fallbackData;
if (canUseCompositionEvent) {
eventType = getCompositionEventType(topLevelType);
} else if (!currentComposition) {
if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionStart;
}
} else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionEnd;
}
if (!eventType) {
return null;
}
if (useFallbackCompositionData) {
// The current composition is stored statically and must not be
// overwritten while composition continues.
if (!currentComposition && eventType === eventTypes.compositionStart
) {
currentComposition = FallbackCompositionState.getPooled(nativeEven
tTarget);
} else if (eventType === eventTypes.compositionEnd) {
if (currentComposition) {
fallbackData = currentComposition.getData();
}
}
}
var event = SyntheticCompositionEvent.getPooled(eventType, targetInst,
nativeEvent, nativeEventTarget);
if (fallbackData) {
// Inject data generated from fallback path into the synthetic event
.
// This matches the property of native CompositionEventInterface.
event.data = fallbackData;
} else {
var customData = getDataFromCustomEvent(nativeEvent);
if (customData !== null) {
event.data = customData;
}
}
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The string corresponding to this `beforeInput` even
t.
*/
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
switch (topLevelType) {
case topLevelTypes.topCompositionEnd:
return getDataFromCustomEvent(nativeEvent);
case topLevelTypes.topKeyPress:
/**
* If native `textInput` events are available, our goal is to make
* use of them. However, there is a special case: the spacebar key
.
*
*
*
*
*
*
*
*
*
`
* event is available.
*/
var which = nativeEvent.which;
if (which !== SPACEBAR_CODE) {
return null;
}
hasSpaceKeypress = true;
return SPACEBAR_CHAR;
case topLevelTypes.topTextInput:
// Record the characters to be added to the DOM.
var chars = nativeEvent.data;
// If it's a spacebar character, assume that we have already handl
ed
// it at the keypress level and bail immediately. Android Chrome
// doesn't give us keycodes, so we need to blacklist it.
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
return null;
}
return chars;
default:
// For other native event types, do nothing.
return null;
}
}
/**
* For browsers that do not provide the `textInput` event, extract the
* appropriate string to use for SyntheticInputEvent.
*
module.exports = BeforeInputEventPlugin;
/***/ },
/* 166 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule EventPropagators
*/
'use strict';
var EventConstants = __webpack_require__(98);
var EventPluginHub = __webpack_require__(102);
var EventPluginUtils = __webpack_require__(103);
var accumulateInto = __webpack_require__(107);
var forEachAccumulated = __webpack_require__(108);
var warning = __webpack_require__(105);
var PropagationPhases = EventConstants.PropagationPhases;
var getListener = EventPluginHub.getListener;
/**
* Some event types have a notion of different registration names for di
fferent
* "phases" of propagation. This finds listeners by a given phase.
*/
function listenerAtPhase(inst, event, propagationPhase) {
var registrationName = event.dispatchConfig.phasedRegistrationNames[pr
opagationPhase];
return getListener(inst, registrationName);
}
/**
* Tags a `SyntheticEvent` with dispatched listeners. Creating this func
tion
* here, allows us to not have to bind or create functions for each even
t.
* Mutating the event's members allows us to not have to create a wrappi
ng
* "dispatch" object that pairs the event with the listener.
*/
function accumulateDirectionalDispatches(inst, upwards, event) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching i
nst must not be null') : void 0;
}
var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.ca
ptured;
var listener = listenerAtPhase(inst, event, phase);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners,
listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances,
inst);
}
}
/**
* Collect dispatches (must be entirely collected before dispatching - s
ee unit
* tests). Lazily allocate the array to conserve memory. We must loop t
hrough
* each event and perform the traversal for each one. We cannot perform
a
* single traversal for the entire collection of events because each eve
nt may
* have a different target.
*/
function accumulateTwoPhaseDispatchesSingle(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirec
tionalDispatches, event);
}
}
/**
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targ
etID.
*/
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
var targetInst = event._targetInst;
var parentInst = targetInst ? EventPluginUtils.getParentInstance(tar
getInst) : null;
EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalD
ispatches, event);
}
}
/**
* Accumulates without regard to direction, does not look for phased
* registration names. Same as `accumulateDirectDispatchesSingle` but wi
thout
* requiring that the `dispatchMarker` be the same as the dispatched ID.
*/
function accumulateDispatches(inst, ignoredDirection, event) {
if (event && event.dispatchConfig.registrationName) {
var registrationName = event.dispatchConfig.registrationName;
var listener = getListener(inst, registrationName);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners
, listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances
, inst);
}
}
}
/**
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule FallbackCompositionState
*/
'use strict';
var _assign = __webpack_require__(97);
var PooledClass = __webpack_require__(134);
var getTextContentAccessor = __webpack_require__(168);
/**
* This helper class stores information about text content of a target n
ode,
*
*
*
*
*
an
* use its position to find its replacement.
*
* @param {DOMEventTarget} root
*/
function FallbackCompositionState(root) {
this._root = root;
this._startText = this.getText();
this._fallbackText = null;
}
_assign(FallbackCompositionState.prototype, {
destructor: function () {
this._root = null;
this._startText = null;
this._fallbackText = null;
},
/**
* Get current text of input.
*
* @return {string}
*/
getText: function () {
if ('value' in this._root) {
return this._root.value;
}
return this._root[getTextContentAccessor()];
},
/**
start;
startValue = this._startText;
startLength = startValue.length;
end;
endValue = this.getText();
endLength = endValue.length;
eEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativ
eEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventI
nterface);
module.exports = SyntheticCompositionEvent;
/***/ },
/* 170 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticEvent
*/
'use strict';
var _assign = __webpack_require__(97);
var PooledClass = __webpack_require__(134);
var emptyFunction = __webpack_require__(106);
var warning = __webpack_require__(105);
var didWarnForAddedNewProperty = false;
var isProxySupported = typeof Proxy === 'function';
var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nati
veEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_
dispatchInstances'];
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var EventInterface = {
type: null,
target: null,
// currentTarget is set when dispatching; no use in copying it here
currentTarget: emptyFunction.thatReturnsNull,
eventPhase: null,
bubbles: null,
cancelable: null,
timeStamp: function (event) {
return event.timeStamp || Date.now();
},
defaultPrevented: null,
isTrusted: null
};
/**
* Synthetic events are dispatched by event plugins, typically in respon
se to a
* top-level event delegation handler.
*
* These systems should generally use pooling to reduce the frequency of
garbage
* collection. The system should check `isPersistent` to determine wheth
er the
* event should be released into the pool after being dispatched. Users
that
* need a persisted event should invoke `persist`.
*
* Synthetic events (and subclasses) implement the DOM Level 3 Events AP
I by
* normalizing browser quirks. Subclasses do not necessarily have to imp
lement a
* DOM interface; custom application-specific events can also subclass t
his.
*
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {*} targetInst Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @param {DOMEventTarget} nativeEventTarget Target node.
*/
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeE
ventTarget) {
if (process.env.NODE_ENV !== 'production') {
// these have a getter/setter for warnings
delete this.nativeEvent;
delete this.preventDefault;
delete this.stopPropagation;
}
this.dispatchConfig = dispatchConfig;
this._targetInst = targetInst;
this.nativeEvent = nativeEvent;
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (!Interface.hasOwnProperty(propName)) {
continue;
}
if (process.env.NODE_ENV !== 'production') {
delete this[propName]; // this has a getter/setter for warnings
}
var normalize = Interface[propName];
if (normalize) {
this[propName] = normalize(nativeEvent);
} else {
if (propName === 'target') {
this.target = nativeEventTarget;
} else {
this[propName] = nativeEvent[propName];
}
}
}
isPersistent: emptyFunction.thatReturnsFalse,
/**
* `PooledClass` looks for `destructor` on each instance it releases.
*/
destructor: function () {
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (process.env.NODE_ENV !== 'production') {
Object.defineProperty(this, propName, getPooledWarningPropertyDe
finition(propName, Interface[propName]));
} else {
this[propName] = null;
}
}
for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
this[shouldBeReleasedProperties[i]] = null;
}
if (process.env.NODE_ENV !== 'production') {
var noop = __webpack_require__(106);
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropert
yDefinition('nativeEvent', null));
Object.defineProperty(this, 'preventDefault', getPooledWarningProp
ertyDefinition('preventDefault', noop));
Object.defineProperty(this, 'stopPropagation', getPooledWarningPro
pertyDefinition('stopPropagation', noop));
}
}
});
SyntheticEvent.Interface = EventInterface;
if (process.env.NODE_ENV !== 'production') {
if (isProxySupported) {
/*eslint-disable no-func-assign */
SyntheticEvent = new Proxy(SyntheticEvent, {
construct: function (target, args) {
return this.apply(target, Object.create(target.prototype), args)
;
},
apply: function (constructor, that, args) {
return new Proxy(constructor.apply(that, args), {
set: function (target, prop, value) {
if (prop !== 'isPersistent' && !target.constructor.Interface
.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
process.env.NODE_ENV !== 'production' ? warning(didWarnFor
AddedNewProperty || target.isPersistent(), 'This synthetic event is reused for p
erformance reasons. If you\'re ' + 'seeing this, you\'re adding a new property i
n the synthetic event object. ' + 'The property is never released. See ' + 'http
s://fb.me/react-event-pooling for more information.') : void 0;
didWarnForAddedNewProperty = true;
}
target[prop] = value;
return true;
}
});
}
});
/*eslint-enable no-func-assign */
}
}
/**
* Helper to reduce boilerplate when creating subclasses.
*
* @param {function} Class
* @param {?object} Interface
*/
SyntheticEvent.augmentClass = function (Class, Interface) {
var Super = this;
var E = function () {};
E.prototype = Super.prototype;
var prototype = new E();
_assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;
Class.Interface = _assign({}, Super.Interface, Interface);
Class.augmentClass = Super.augmentClass;
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
};
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler)
;
module.exports = SyntheticEvent;
/**
* Helper to nullify syntheticEvent instance properties when destructin
g
*
* @param {object} SyntheticEvent
* @param {String} propName
* @return {object} defineProperty object
*/
function getPooledWarningPropertyDefinition(propName, getVal) {
var isFunction = typeof getVal === 'function';
return {
configurable: true,
set: set,
get: get
};
function set(val) {
var action = isFunction ? 'setting the method' : 'setting the proper
ty';
warn(action, 'This is effectively a no-op');
return val;
}
function get() {
var action = isFunction ? 'accessing the method' : 'accessing the pr
operty';
var result = isFunction ? 'This is a no-op function' : 'This is set
to null';
warn(action, result);
return getVal;
}
function warn(action, result) {
var warningCondition = false;
process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'T
his 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 mus
t keep the original synthetic event around, use event.persist(). ' + 'See https:
//fb.me/react-event-pooling for more information.', action, propName, result) :
void 0;
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 171 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticInputEvent
*/
'use strict';
var SyntheticEvent = __webpack_require__(170);
/**
* @interface Event
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
*
/#events-inputevents
*/
var InputEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent
, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativ
eEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
module.exports = SyntheticInputEvent;
/***/ },
/* 172 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ChangeEventPlugin
*/
'use strict';
var
var
var
var
var
var
var
EventConstants = __webpack_require__(98);
EventPluginHub = __webpack_require__(102);
EventPropagators = __webpack_require__(166);
ExecutionEnvironment = __webpack_require__(91);
ReactDOMComponentTree = __webpack_require__(113);
ReactUpdates = __webpack_require__(132);
SyntheticEvent = __webpack_require__(170);
var
var
var
var
getEventTarget = __webpack_require__(173);
isEventSupported = __webpack_require__(111);
isTextInputElement = __webpack_require__(174);
keyOf = __webpack_require__(155);
return nodeName === 'select' || nodeName === 'input' && elem.type ===
'file';
}
var doesChangeEventBubble = false;
if (ExecutionEnvironment.canUseDOM) {
// See `handleChange` comment below
doesChangeEventBubble = isEventSupported('change') && (!('documentMode
' in document) || document.documentMode > 8);
}
function manualDispatchChangeEvent(nativeEvent) {
var event = SyntheticEvent.getPooled(eventTypes.change, activeElementI
nst, nativeEvent, getEventTarget(nativeEvent));
EventPropagators.accumulateTwoPhaseDispatches(event);
// If change and propertychange bubbled, we'd just bind to it like all
the
// other events and have it go through ReactBrowserEventEmitter. Since
it
// doesn't, we manually listen for the events and so we have to enqueu
e and
// process the abstract event manually.
//
// Batching is necessary here in order to ensure that all event handle
rs run
// before the next rerender (including event handlers attached to ance
stor
// elements instead of directly on the input). Without this, controlle
d
// components don't work properly in conjunction with event bubbling b
ecause
// the component is rerendered and the value reverted before all the e
vent
// handlers can run. See https://github.com/facebook/react/issues/708.
ReactUpdates.batchedUpdates(runEventInBatch, event);
}
function runEventInBatch(event) {
EventPluginHub.enqueueEvents(event);
EventPluginHub.processEventQueue(false);
}
function startWatchingForChangeEventIE8(target, targetInst) {
activeElement = target;
activeElementInst = targetInst;
activeElement.attachEvent('onchange', manualDispatchChangeEvent);
}
function stopWatchingForChangeEventIE8() {
if (!activeElement) {
return;
}
activeElement.detachEvent('onchange', manualDispatchChangeEvent);
activeElement = null;
activeElementInst = null;
}
function getTargetInstForChangeEvent(topLevelType, targetInst) {
if (topLevelType === topLevelTypes.topChange) {
return targetInst;
}
}
function handleEventsForChangeEventIE8(topLevelType, target, targetInst)
{
if (topLevelType === topLevelTypes.topFocus) {
// stopWatching() should be a noop here but we call it just in case
we
// missed a blur event somehow.
stopWatchingForChangeEventIE8();
startWatchingForChangeEventIE8(target, targetInst);
} else if (topLevelType === topLevelTypes.topBlur) {
stopWatchingForChangeEventIE8();
}
}
/**
* SECTION: handle `input` event
*/
var isInputEventSupported = false;
if (ExecutionEnvironment.canUseDOM) {
// IE9 claims to support the input event but fails to trigger it when
// deleting text, so we ignore its input events.
// IE10+ fire input events to often, such when a placeholder
// changes or when an input with a placeholder is focused.
isInputEventSupported = isEventSupported('input') && (!('documentMode'
in document) || document.documentMode > 11);
}
/**
* (For IE <=11) Replacement getter/setter for the `value` property that
gets
* set on the active element.
*/
var newValueProp = {
get: function () {
return activeElementValueProp.get.call(this);
},
set: function (val) {
// Cast to a string so we can do equality checks.
activeElementValue = '' + val;
activeElementValueProp.set.call(this, val);
}
};
/**
* (For IE <=11) Starts tracking propertychange events on the passed-in
element
* and override the value property so that we can distinguish user event
s from
* value changes in JS.
*/
function startWatchingForValueChange(target, targetInst) {
activeElement = target;
activeElementInst = targetInst;
activeElementValue = target.value;
activeElementValueProp = Object.getOwnPropertyDescriptor(target.constr
uctor.prototype, 'value');
// Not guarded in a canDefineProperty check: IE8 supports defineProper
ty only
// on DOM elements
Object.defineProperty(activeElement, 'value', newValueProp);
if (activeElement.attachEvent) {
activeElement.attachEvent('onpropertychange', handlePropertyChange);
} else {
activeElement.addEventListener('propertychange', handlePropertyChang
e, false);
}
}
/**
* (For IE <=11) Removes the event listeners from the currently-tracked
element,
* if any exists.
*/
function stopWatchingForValueChange() {
if (!activeElement) {
return;
}
// delete restores the original property definition
delete activeElement.value;
if (activeElement.detachEvent) {
activeElement.detachEvent('onpropertychange', handlePropertyChange);
} else {
activeElement.removeEventListener('propertychange', handlePropertyCh
ange, false);
}
activeElement = null;
activeElementInst = null;
activeElementValue = null;
activeElementValueProp = null;
}
/**
* (For IE <=11) Handles a propertychange event, sending a `change` even
t if
* the value of the active element has changed.
*/
function handlePropertyChange(nativeEvent) {
if (nativeEvent.propertyName !== 'value') {
return;
}
var value = nativeEvent.srcElement.value;
if (value === activeElementValue) {
return;
}
activeElementValue = value;
manualDispatchChangeEvent(nativeEvent);
}
/**
* If a `change` event should be fired, returns the target's ID.
*/
function getTargetInstForInputEvent(topLevelType, targetInst) {
if (topLevelType === topLevelTypes.topInput) {
// In modern browsers (i.e., not IE8 or IE9), the input event is exa
ctly
// what we want so fall through here and trigger an abstract event
return targetInst;
}
}
function handleEventsForInputEventIE(topLevelType, target, targetInst) {
if (topLevelType === topLevelTypes.topFocus) {
// In IE8, we can capture almost all .value changes by adding a
// propertychange handler and looking for events with propertyName
// equal to 'value'
// In IE9-11, propertychange fires for most input events but is bugg
y and
// doesn't fire when text is deleted, but conveniently, selectioncha
nge
// appears to fire in all of the remaining cases so we catch those a
nd
// forward the event if the value has changed
// In either case, we don't want to call the event handler if the va
lue
// is changed from JS so we redefine a setter for `.value` that upda
tes
// our activeElementValue variable, allowing us to ignore those chan
ges
//
// stopWatching() should be a noop here but we call it just in case
we
// missed a blur event somehow.
stopWatchingForValueChange();
startWatchingForValueChange(target, targetInst);
} else if (topLevelType === topLevelTypes.topBlur) {
stopWatchingForValueChange();
}
}
// For IE8 and IE9.
function getTargetInstForInputEventIE(topLevelType, targetInst) {
if (topLevelType === topLevelTypes.topSelectionChange || topLevelType
=== topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
// On the selectionchange event, the target is just document which i
sn't
// helpful for us so just check activeElement instead.
//
// 99% of the time, keydown and keyup aren't necessary. IE8 fails to
fire
// propertychange on the first input event after setting `value` fro
m a
// script and fires only keydown, keypress, keyup. Catching keyup us
ually
// gets it and catching keydown lets us fire an event for the first
// keystroke if user does a key repeat (it'll be a little delayed: r
ight
// before the second keystroke). Other input methods (e.g., paste) s
eem to
// fire selectionchange normally.
if (activeElement && activeElement.value !== activeElementValue) {
activeElementValue = activeElement.value;
return activeElementInst;
}
}
}
/**
* SECTION: handle `click` event
*/
function shouldUseClickEvent(elem) {
// Use the `click` event to detect changes to checkbox and radio input
s.
// This approach works across all browsers, whereas `change` does not
fire
// until `blur` in IE8.
return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (el
em.type === 'checkbox' || elem.type === 'radio');
}
function getTargetInstForClickEvent(topLevelType, targetInst) {
if (topLevelType === topLevelTypes.topClick) {
return targetInst;
}
}
/**
* This plugin creates an `onChange` event that normalizes change events
* across form elements. This event fires at a time when it's possible t
o
* change the element's value without seeing a flicker.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - select
*/
var ChangeEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, native
EventTarget) {
var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInsta
nce(targetInst) : window;
var getTargetInstFunc, handleEventFunc;
if (shouldUseChangeEvent(targetNode)) {
if (doesChangeEventBubble) {
getTargetInstFunc = getTargetInstForChangeEvent;
} else {
handleEventFunc = handleEventsForChangeEventIE8;
}
} else if (isTextInputElement(targetNode)) {
if (isInputEventSupported) {
getTargetInstFunc = getTargetInstForInputEvent;
} else {
getTargetInstFunc = getTargetInstForInputEventIE;
handleEventFunc = handleEventsForInputEventIE;
}
} else if (shouldUseClickEvent(targetNode)) {
getTargetInstFunc = getTargetInstForClickEvent;
}
if (getTargetInstFunc) {
var inst = getTargetInstFunc(topLevelType, targetInst);
if (inst) {
var event = SyntheticEvent.getPooled(eventTypes.change, inst, na
tiveEvent, nativeEventTarget);
event.type = 'change';
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(topLevelType, targetNode, targetInst);
}
}
};
module.exports = ChangeEventPlugin;
/***/ },
/* 173 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule getEventTarget
*/
'use strict';
/**
* Gets the target node from a native browser event by accounting for
* inconsistencies in browser DOM APIs.
*
* @param {object} nativeEvent Native browser event.
* @return {DOMEventTarget} Target node.
*/
function getEventTarget(nativeEvent) {
var target = nativeEvent.target || nativeEvent.srcElement || window;
// Normalize SVG <use> element events #4963
if (target.correspondingUseElement) {
target = target.correspondingUseElement;
}
// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
// @see http://www.quirksmode.org/js/events_properties.html
return target.nodeType === 3 ? target.parentNode : target;
}
module.exports = getEventTarget;
/***/ },
/* 174 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule isTextInputElement
*/
'use strict';
/**
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/theinput-element.html#input-type-attr-summary
*/
var supportedInputTypes = {
'color': true,
'date': true,
'datetime': true,
'datetime-local': true,
'email': true,
'month': true,
'number': true,
'password': true,
'range': true,
'search': true,
'tel': true,
'text': true,
'time': true,
'url': true,
'week': true
};
function isTextInputElement(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
return nodeName && (nodeName === 'input' && supportedInputTypes[elem.t
ype] || nodeName === 'textarea');
}
module.exports = isTextInputElement;
/***/ },
/* 175 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule DefaultEventPluginOrder
*/
'use strict';
var keyOf = __webpack_require__(155);
/**
* Module that is injectable into `EventPluginHub`, that specifies a
* deterministic ordering of `EventPlugin`s. A convenient way to reason
about
* plugins, without having to package every one of them. This is better
than
* having plugins be ordered in the same order that they are injected be
cause
* that ordering would be influenced by the packaging order.
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
* preventing default on events is convenient in `SimpleEventPlugin` han
dlers.
*/
var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), ke
yOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ Enter
LeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEve
ntPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
module.exports = DefaultEventPluginOrder;
/***/ },
/* 176 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule EnterLeaveEventPlugin
*/
'use strict';
var
var
var
var
EventConstants = __webpack_require__(98);
EventPropagators = __webpack_require__(166);
ReactDOMComponentTree = __webpack_require__(113);
SyntheticMouseEvent = __webpack_require__(177);
var eventTypes = {
mouseEnter: {
registrationName: keyOf({ onMouseEnter: null }),
dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver
]
},
mouseLeave: {
registrationName: keyOf({ onMouseLeave: null }),
dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver
]
}
};
var EnterLeaveEventPlugin = {
eventTypes: eventTypes,
/**
* For almost every interaction we care about, there will be both a to
p-level
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` s
o that
* we do not extract duplicate events. However, moving the mouse into
the
* browser from outside will not fire a `mouseout` event. In this case
, we use
* the `mouseover` top-level event.
*/
extractEvents: function (topLevelType, targetInst, nativeEvent, native
EventTarget) {
if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.rela
tedTarget || nativeEvent.fromElement)) {
return null;
}
if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== t
opLevelTypes.topMouseOver) {
// Must not be a mouse in or mouse out - ignoring.
return null;
}
var win;
if (nativeEventTarget.window === nativeEventTarget) {
// `nativeEventTarget` is probably a window object.
win = nativeEventTarget;
} else {
// TODO: Figure out why `ownerDocument` is sometimes undefined in
IE8.
var doc = nativeEventTarget.ownerDocument;
if (doc) {
win = doc.defaultView || doc.parentWindow;
} else {
win = window;
}
}
var from;
var to;
if (topLevelType === topLevelTypes.topMouseOut) {
from = targetInst;
}
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
module.exports = SyntheticMouseEvent;
/***/ },
/* 178 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticUIEvent
*/
'use strict';
var SyntheticEvent = __webpack_require__(170);
var getEventTarget = __webpack_require__(173);
/**
* @interface UIEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var UIEventInterface = {
view: function (event) {
if (event.view) {
return event.view;
}
var target = getEventTarget(event);
if (target != null && target.window === target) {
// target is a window object
return target;
}
var doc = target.ownerDocument;
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE
8.
if (doc) {
return doc.defaultView || doc.parentWindow;
} else {
return window;
}
},
detail: function (event) {
return event.detail || 0;
}
};
/**
cellPadding: 0,
cellSpacing: 0,
charSet: 0,
challenge: 0,
checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
cite: 0,
classID: 0,
className: 0,
cols: HAS_POSITIVE_NUMERIC_VALUE,
colSpan: 0,
content: 0,
contentEditable: 0,
contextMenu: 0,
controls: HAS_BOOLEAN_VALUE,
coords: 0,
crossOrigin: 0,
data: 0, // For `<object />` acts as `src`.
dateTime: 0,
'default': HAS_BOOLEAN_VALUE,
defer: HAS_BOOLEAN_VALUE,
dir: 0,
disabled: HAS_BOOLEAN_VALUE,
download: HAS_OVERLOADED_BOOLEAN_VALUE,
draggable: 0,
encType: 0,
form: 0,
formAction: 0,
formEncType: 0,
formMethod: 0,
formNoValidate: HAS_BOOLEAN_VALUE,
formTarget: 0,
frameBorder: 0,
headers: 0,
height: 0,
hidden: HAS_BOOLEAN_VALUE,
high: 0,
href: 0,
hrefLang: 0,
htmlFor: 0,
httpEquiv: 0,
icon: 0,
id: 0,
inputMode: 0,
integrity: 0,
is: 0,
keyParams: 0,
keyType: 0,
kind: 0,
label: 0,
lang: 0,
list: 0,
loop: HAS_BOOLEAN_VALUE,
low: 0,
manifest: 0,
marginHeight: 0,
marginWidth: 0,
max: 0,
maxLength: 0,
media: 0,
mediaGroup: 0,
method: 0,
min: 0,
minLength: 0,
// Caution; `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`.
multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
name: 0,
nonce: 0,
noValidate: HAS_BOOLEAN_VALUE,
open: HAS_BOOLEAN_VALUE,
optimum: 0,
pattern: 0,
placeholder: 0,
poster: 0,
preload: 0,
profile: 0,
radioGroup: 0,
readOnly: HAS_BOOLEAN_VALUE,
rel: 0,
required: HAS_BOOLEAN_VALUE,
reversed: HAS_BOOLEAN_VALUE,
role: 0,
rows: HAS_POSITIVE_NUMERIC_VALUE,
rowSpan: HAS_NUMERIC_VALUE,
sandbox: 0,
scope: 0,
scoped: HAS_BOOLEAN_VALUE,
scrolling: 0,
seamless: HAS_BOOLEAN_VALUE,
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
shape: 0,
size: HAS_POSITIVE_NUMERIC_VALUE,
sizes: 0,
span: HAS_POSITIVE_NUMERIC_VALUE,
spellCheck: 0,
src: 0,
srcDoc: 0,
srcLang: 0,
srcSet: 0,
start: HAS_NUMERIC_VALUE,
step: 0,
style: 0,
summary: 0,
tabIndex: 0,
target: 0,
title: 0,
// Setting .type throws on non-<input> tags
type: 0,
useMap: 0,
value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
width: 0,
wmode: 0,
wrap: 0,
/**
* RDFa Properties
*/
about: 0,
datatype: 0,
inlist: 0,
prefix: 0,
// property is also supported for OpenGraph in meta tags.
property: 0,
resource: 0,
'typeof': 0,
vocab: 0,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autoCapitalize: 0,
autoCorrect: 0,
// autoSave allows WebKit/Blink to persist values of input fields on
page reloads
autoSave: 0,
// color is for Safari mask-icon link
color: 0,
// itemProp, itemScope, itemType are for
// Microdata support. See http://schema.org/docs/gs.html
itemProp: 0,
itemScope: HAS_BOOLEAN_VALUE,
itemType: 0,
// itemID and itemRef are for Microdata support as well but
// only specified in the WHATWG spec document. See
// https://html.spec.whatwg.org/multipage/microdata.html#microdata-d
om-api
itemID: 0,
itemRef: 0,
// results show looking glass icon and recent searches on input
// search fields in WebKit/Blink
results: 0,
// IE-only attribute that specifies security restrictions on an ifra
me
// as an alternative to the sandbox attribute on IE<10
security: 0,
// IE-only attribute that controls focus behavior
unselectable: 0
},
DOMAttributeNames: {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv'
},
DOMPropertyNames: {}
};
module.exports = HTMLDOMPropertyConfig;
/***/ },
/* 181 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactComponentBrowserEnvironment
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(182);
var ReactDOMIDOperations = __webpack_require__(188);
var ReactPerf = __webpack_require__(126);
/**
* Abstracts away all functionality of the reconciler that requires know
ledge of
* the browser context. TODO: These callers should be refactored to avoi
d the
* need for this injection.
*/
var ReactComponentBrowserEnvironment = {
processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildre
nUpdates,
replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWit
hMarkup,
/**
* If a particular environment requires that some resources be cleaned
up,
* specify this in the injected Mixin. In the DOM, we would likely wan
t to
* purge any cached node ID lookups.
*
* @private
*/
unmountIDFromEnvironment: function (rootNodeID) {}
};
ReactPerf.measureMethods(ReactComponentBrowserEnvironment, 'ReactCompone
ntBrowserEnvironment', {
replaceNodeWithMarkup: 'replaceNodeWithMarkup'
});
module.exports = ReactComponentBrowserEnvironment;
/***/ },
/* 182 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule DOMChildrenOperations
*/
'use strict';
var
var
var
var
DOMLazyTree = __webpack_require__(88);
Danger = __webpack_require__(183);
ReactMultiChildUpdateTypes = __webpack_require__(187);
ReactPerf = __webpack_require__(126);
if (Array.isArray(childNode)) {
var closingComment = childNode[1];
childNode = childNode[0];
removeDelimitedText(parentNode, childNode, closingComment);
parentNode.removeChild(closingComment);
}
parentNode.removeChild(childNode);
}
function moveDelimitedText(parentNode, openingComment, closingComment, r
eferenceNode) {
var node = openingComment;
while (true) {
var nextNode = node.nextSibling;
insertChildAt(parentNode, node, referenceNode);
if (node === closingComment) {
break;
}
node = nextNode;
}
}
function removeDelimitedText(parentNode, startNode, closingComment) {
while (true) {
var node = startNode.nextSibling;
if (node === closingComment) {
// The closing comment is removed by ReactMultiChild.
break;
} else {
parentNode.removeChild(node);
}
}
}
function replaceDelimitedText(openingComment, closingComment, stringText
) {
var parentNode = openingComment.parentNode;
var nodeAfterComment = openingComment.nextSibling;
if (nodeAfterComment === closingComment) {
// There are no text nodes between the opening and closing comments;
insert
// a new one if stringText isn't empty.
if (stringText) {
insertChildAt(parentNode, document.createTextNode(stringText), nod
eAfterComment);
}
} else {
if (stringText) {
// Set the text content of the first node after the opening commen
t, and
// remove all following nodes up until the closing comment.
setTextContent(nodeAfterComment, stringText);
removeDelimitedText(parentNode, nodeAfterComment, closingComment);
} else {
removeDelimitedText(parentNode, openingComment, closingComment);
}
}
}
/**
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule Danger
*/
'use strict';
var DOMLazyTree = __webpack_require__(88);
var ExecutionEnvironment = __webpack_require__(91);
var
var
var
var
createNodesFromMarkup = __webpack_require__(184);
emptyFunction = __webpack_require__(106);
getMarkupWrap = __webpack_require__(186);
invariant = __webpack_require__(95);
module.exports = Danger;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 184 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks
*/
/*eslint-disable fb-www/unsafe-html*/
var ExecutionEnvironment = __webpack_require__(91);
var createArrayFromMixed = __webpack_require__(185);
var getMarkupWrap = __webpack_require__(186);
var invariant = __webpack_require__(95);
/**
* Dummy container used to render all markup.
*/
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement(
'div') : null;
/**
* Pattern used by `getNodeName`.
*/
var nodeNamePattern = /^\s*<(\w+)/;
/**
* Extracts the `nodeName` of the first element in a string of markup.
*
* @param {string} markup String of markup.
* @return {?string} Node name of the supplied markup.
*/
function getNodeName(markup) {
var nodeNameMatch = markup.match(nodeNamePattern);
return nodeNameMatch && nodeNameMatch[1].toLowerCase();
}
/**
* Creates an array containing the nodes rendered from the supplied mark
up. The
* optionally supplied `handleScript` function will be invoked once for
each
* <script> element that is rendered. If no `handleScript` function is s
upplied,
* an exception is thrown if any <script> elements are rendered.
*
* @param {string} markup A string of valid HTML markup.
* @param {?function} handleScript Invoked once for each rendered <scrip
t>.
* @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
*/
function createNodesFromMarkup(markup, handleScript) {
var node = dummyNode;
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false
, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
var nodeName = getNodeName(markup);
var wrap = nodeName && getMarkupWrap(nodeName);
if (wrap) {
node.innerHTML = wrap[1] + markup + wrap[2];
var wrapDepth = wrap[0];
while (wrapDepth--) {
node = node.lastChild;
}
} else {
node.innerHTML = markup;
}
var scripts = node.getElementsByTagName('script');
if (scripts.length) {
!handleScript ? process.env.NODE_ENV !== 'production' ? invariant(fa
lse, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : inva
riant(false) : void 0;
createArrayFromMixed(scripts).forEach(handleScript);
}
var nodes = Array.from(node.childNodes);
while (node.lastChild) {
node.removeChild(node.lastChild);
}
return nodes;
}
module.exports = createNodesFromMarkup;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 185 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks
*/
*/
function createArrayFromMixed(obj) {
if (!hasArrayNature(obj)) {
return [obj];
} else if (Array.isArray(obj)) {
return obj.slice();
} else {
return toArray(obj);
}
}
module.exports = createArrayFromMixed;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 186 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
*/
/*eslint-disable fb-www/unsafe-html */
var ExecutionEnvironment = __webpack_require__(91);
var invariant = __webpack_require__(95);
/**
* Dummy container used to detect which wraps are necessary.
*/
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement(
'div') : null;
/**
* Some browsers cannot use `innerHTML` to render certain elements stand
alone,
* so we wrap them, render the wrapped nodes, then extract the desired n
ode.
*
* In IE8, certain elements cannot render alone, so wrap all elements ('
*').
*/
var shouldWrap = {};
var selectWrap = [1, '<select multiple="true">', '</select>'];
var tableWrap = [1, '<table>', '</table>'];
var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
*
* @providesModule ReactDOMIDOperations
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(182);
var ReactDOMComponentTree = __webpack_require__(113);
var ReactPerf = __webpack_require__(126);
/**
* Operations used to process updates to DOM nodes.
*/
var ReactDOMIDOperations = {
/**
* Updates a component's children by processing a series of updates.
*
* @param {array<object>} updates List of update configurations.
* @internal
*/
dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
DOMChildrenOperations.processUpdates(node, updates);
}
};
ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
});
module.exports = ReactDOMIDOperations;
/***/ },
/* 189 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMComponent
*/
/* global hasOwnProperty:true */
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
AutoFocusUtils = __webpack_require__(190);
CSSPropertyOperations = __webpack_require__(192);
DOMLazyTree = __webpack_require__(88);
DOMNamespaces = __webpack_require__(200);
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
DOMProperty = __webpack_require__(94);
DOMPropertyOperations = __webpack_require__(201);
EventConstants = __webpack_require__(98);
EventPluginHub = __webpack_require__(102);
EventPluginRegistry = __webpack_require__(100);
ReactBrowserEventEmitter = __webpack_require__(96);
ReactComponentBrowserEnvironment = __webpack_require__(181);
ReactDOMButton = __webpack_require__(206);
ReactDOMComponentFlags = __webpack_require__(114);
ReactDOMComponentTree = __webpack_require__(113);
ReactDOMInput = __webpack_require__(208);
ReactDOMOption = __webpack_require__(210);
ReactDOMSelect = __webpack_require__(211);
ReactDOMTextarea = __webpack_require__(212);
ReactMultiChild = __webpack_require__(213);
ReactPerf = __webpack_require__(126);
var
var
var
var
var
var
var
escapeTextContentForBrowser = __webpack_require__(92);
invariant = __webpack_require__(95);
isEventSupported = __webpack_require__(111);
keyOf = __webpack_require__(155);
shallowEqual = __webpack_require__(216);
validateDOMNesting = __webpack_require__(116);
warning = __webpack_require__(105);
var
var
var
var
var
Flags = ReactDOMComponentFlags;
deleteListener = EventPluginHub.deleteListener;
getNode = ReactDOMComponentTree.getNodeFromInstance;
listenTo = ReactBrowserEventEmitter.listenTo;
registrationNameModules = EventPluginRegistry.registrationNameModule
s;
// For quickly matching children type, to test if can be treated as cont
ent.
var CONTENT_TYPES = { 'string': true, 'number': true };
var STYLE = keyOf({ style: null });
var HTML = keyOf({ __html: null });
var RESERVED_PROPS = {
children: null,
dangerouslySetInnerHTML: null,
suppressContentEditableWarning: null
};
// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
var DOC_FRAGMENT_TYPE = 11;
function getDeclarationErrorAddendum(internalInstance) {
if (internalInstance) {
var owner = internalInstance._currentElement._owner || null;
if (owner) {
var name = owner.getName();
if (name) {
return ' This DOM node was rendered by `' + name + '`.';
}
}
}
return '';
}
function friendlyStringify(obj) {
if (typeof obj === 'object') {
if (Array.isArray(obj)) {
return '[' + obj.map(friendlyStringify).join(', ') + ']';
} else {
var pairs = [];
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.st
ringify(key);
pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
}
}
return '{' + pairs.join(', ') + '}';
}
} else if (typeof obj === 'string') {
return JSON.stringify(obj);
} else if (typeof obj === 'function') {
return '[function object]';
}
// Differs from JSON.stringify in that undefined because undefined and
that
// inf and nan don't become null
return String(obj);
}
var styleMutationWarning = {};
function checkAndWarnForMutatedStyle(style1, style2, component) {
if (style1 == null || style2 == null) {
return;
}
if (shallowEqual(style1, style2)) {
return;
}
var componentName = component._tag;
var owner = component._currentElement._owner;
var ownerName;
if (owner) {
ownerName = owner.getName();
}
var hash = ownerName + '|' + componentName;
if (styleMutationWarning.hasOwnProperty(hash)) {
return;
}
styleMutationWarning[hash] = true;
process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passe
d a style object that has previously been mutated. ' + 'Mutating `style` is depr
ecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous sty
le: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : '
using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(sty
le2)) : void 0;
}
/**
'keygen': true,
'link': true,
'meta': true,
'param': true,
'source': true,
'track': true,
'wbr': true
};
// NOTE: menuitem's close tag should be omitted, but that causes problem
s.
var newlineEatingTags = {
'listing': true,
'pre': true,
'textarea': true
};
// For HTML, certain tags cannot have children. This has the same purpos
e as
// `omittedCloseTags` except that `menuitem` should still have its closi
ng tag.
var voidElementTags = _assign({
'menuitem': true
}, omittedCloseTags);
// We accept any tag to be rendered but since this gets injected into ar
bitrary
// HTML, we want to make sure that it's a safe tag.
// http://www.w3.org/TR/REC-xml/#NT-Name
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subse
t
var validatedTagCache = {};
var hasOwnProperty = {}.hasOwnProperty;
function validateDangerousTag(tag) {
if (!hasOwnProperty.call(validatedTagCache, tag)) {
!VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ?
invariant(false, 'Invalid tag: %s', tag) : invariant(false) : void 0;
validatedTagCache[tag] = true;
}
}
function isCustomComponent(tagName, props) {
return tagName.indexOf('-') >= 0 || props.is != null;
}
var globalIdCounter = 1;
/**
* Creates a new React class that is idempotent and capable of containin
g other
* React components. It accepts event listeners and DOM properties that
are
* valid according to `DOMProperty`.
*
* - Event listeners: `onClick`, `onMouseDown`, etc.
* - DOM properties: `className`, `name`, `title`, etc.
*
* The `style` property functions differently from the DOM API. It accep
ts an
* object mapping of style properties to values.
*
* @constructor ReactDOMComponent
* @extends ReactMultiChild
*/
function ReactDOMComponent(element) {
var tag = element.type;
validateDangerousTag(tag);
this._currentElement = element;
this._tag = tag.toLowerCase();
this._namespaceURI = null;
this._renderedChildren = null;
this._previousStyle = null;
this._previousStyleCopy = null;
this._nativeNode = null;
this._nativeParent = null;
this._rootNodeID = null;
this._domID = null;
this._nativeContainerInfo = null;
this._wrapperState = null;
this._topLevelWrapper = null;
this._flags = 0;
if (process.env.NODE_ENV !== 'production') {
this._ancestorInfo = null;
}
}
ReactDOMComponent.displayName = 'ReactDOMComponent';
ReactDOMComponent.Mixin = {
/**
* Generates root tag markup then recurses. This method has side effec
ts and
* is not idempotent.
*
* @internal
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction}
transaction
* @param {?ReactDOMComponent} the containing DOM component instance
* @param {?object} info about the native container
* @param {object} context
* @return {string} The computed markup.
*/
mountComponent: function (transaction, nativeParent, nativeContainerIn
fo, context) {
this._rootNodeID = globalIdCounter++;
this._domID = nativeContainerInfo._idCounter++;
this._nativeParent = nativeParent;
this._nativeContainerInfo = nativeContainerInfo;
var props = this._currentElement.props;
switch
case
case
case
case
(this._tag) {
'iframe':
'object':
'img':
'form':
case 'video':
case 'audio':
this._wrapperState = {
listeners: null
};
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal,
this);
break;
case 'button':
props = ReactDOMButton.getNativeProps(this, props, nativeParent)
;
break;
case 'input':
ReactDOMInput.mountWrapper(this, props, nativeParent);
props = ReactDOMInput.getNativeProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal,
this);
break;
case 'option':
ReactDOMOption.mountWrapper(this, props, nativeParent);
props = ReactDOMOption.getNativeProps(this, props);
break;
case 'select':
ReactDOMSelect.mountWrapper(this, props, nativeParent);
props = ReactDOMSelect.getNativeProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal,
this);
break;
case 'textarea':
ReactDOMTextarea.mountWrapper(this, props, nativeParent);
props = ReactDOMTextarea.getNativeProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal,
this);
break;
}
assertValidProps(this, props);
// We create tags in the namespace of their parent container, except
HTML
// tags get no namespace.
var namespaceURI;
var parentTag;
if (nativeParent != null) {
namespaceURI = nativeParent._namespaceURI;
parentTag = nativeParent._tag;
} else if (nativeContainerInfo._tag) {
namespaceURI = nativeContainerInfo._namespaceURI;
parentTag = nativeContainerInfo._tag;
}
if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && pa
rentTag === 'foreignobject') {
namespaceURI = DOMNamespaces.html;
}
if (namespaceURI === DOMNamespaces.html) {
if (this._tag === 'svg') {
namespaceURI = DOMNamespaces.svg;
} else if (this._tag === 'math') {
namespaceURI = DOMNamespaces.mathml;
}
}
this._namespaceURI = namespaceURI;
if (process.env.NODE_ENV !== 'production') {
var parentInfo;
if (nativeParent != null) {
parentInfo = nativeParent._ancestorInfo;
} else if (nativeContainerInfo._tag) {
parentInfo = nativeContainerInfo._ancestorInfo;
}
if (parentInfo) {
// parentInfo should always be present except for the top-level
// component when server rendering
validateDOMNesting(this._tag, this, parentInfo);
}
this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parent
Info, this._tag, this);
}
var mountImage;
if (transaction.useCreateElement) {
var ownerDocument = nativeContainerInfo._ownerDocument;
var el;
if (namespaceURI === DOMNamespaces.html) {
if (this._tag === 'script') {
// Create the script via .innerHTML so its "parser-inserted" f
lag is
// set to true and it does not execute
var div = ownerDocument.createElement('div');
var type = this._currentElement.type;
div.innerHTML = '<' + type + '></' + type + '>';
el = div.removeChild(div.firstChild);
} else {
el = ownerDocument.createElement(this._currentElement.type);
}
} else {
el = ownerDocument.createElementNS(namespaceURI, this._currentEl
ement.type);
}
ReactDOMComponentTree.precacheNode(this, el);
this._flags |= Flags.hasCachedChildNodes;
if (!this._nativeParent) {
DOMPropertyOperations.setAttributeForRoot(el);
}
this._updateDOMProperties(null, props, transaction);
var lazyTree = DOMLazyTree(el);
this._createInitialChildren(transaction, props, context, lazyTree)
;
mountImage = lazyTree;
} else {
var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction
, props);
var tagContent = this._createContentMarkup(transaction, props, con
text);
if (!tagContent && omittedCloseTags[this._tag]) {
mountImage = tagOpen + '/>';
} else {
mountImage = tagOpen + '>' + tagContent + '</' + this._currentEl
ement.type + '>';
}
}
switch
case
case
case
case
if
(this._tag) {
'button':
'input':
'select':
'textarea':
(props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusD
OMComponent, this);
}
break;
case 'option':
transaction.getReactMountReady().enqueue(optionPostMount, this);
}
return mountImage;
},
/**
* Creates markup for the open tag and all attributes.
*
* This method has side effects because events get registered.
*
* Iterating over object properties is faster than iterating over arra
ys.
* @see http://jsperf.com/obj-vs-arr-iteration
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction}
transaction
* @param {object} props
* @return {string} Markup of opening tag.
*/
_createOpenTagMarkupAndPutListeners: function (transaction, props) {
var ret = '<' + this._currentElement.type;
for (var propKey in props) {
if (!props.hasOwnProperty(propKey)) {
continue;
}
var propValue = props[propKey];
if (propValue == null) {
continue;
}
if (registrationNameModules.hasOwnProperty(propKey)) {
if (propValue) {
enqueuePutListener(this, propKey, propValue, transaction);
}
} else {
if (propKey === STYLE) {
if (propValue) {
if (process.env.NODE_ENV !== 'production') {
// See `_updateDOMProperties`. style block
this._previousStyle = propValue;
}
propValue = this._previousStyleCopy = _assign({}, props.styl
e);
}
propValue = CSSPropertyOperations.createMarkupForStyles(propVa
lue, this);
}
var markup = null;
if (this._tag != null && isCustomComponent(this._tag, props)) {
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
markup = DOMPropertyOperations.createMarkupForCustomAttribut
e(propKey, propValue);
}
} else {
markup = DOMPropertyOperations.createMarkupForProperty(propKey
, propValue);
}
if (markup) {
ret += ' ' + markup;
}
}
}
// For static pages, no need to put React ID and checksum. Saves lot
s of
// bytes.
if (transaction.renderToStaticMarkup) {
return ret;
}
if (!this._nativeParent) {
ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
}
ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
return ret;
},
/**
* Creates markup for the content between the tags.
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction}
transaction
* @param {object} props
* @param {object} context
* @return {string} Content markup.
*/
_createContentMarkup: function (transaction, props, context) {
var ret = '';
// Intentional use of != to avoid catching zero/false.
var innerHTML = props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
ret = innerHTML.__html;
}
} else {
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.ch
ildren : null;
var childrenToUse = contentToUse != null ? null : props.children;
if (contentToUse != null) {
// TODO: Validate that text is allowed as a child of this node
ret = escapeTextContentForBrowser(contentToUse);
} else if (childrenToUse != null) {
var mountImages = this.mountChildren(childrenToUse, transaction,
context);
ret = mountImages.join('');
}
}
if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
// text/html ignores the first character in these tags if it's a n
ewline
// Prefer to break application/xml over text/html (for now) by add
ing
// a newline specifically to get eaten by the parser. (Alternately
for
// textareas, replacing "^\n" with "\r\n" doesn't get eaten, and t
he first
// \r is normalized out by HTMLTextAreaElement#value.)
// See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textareaand-pre>
// See: <http://www.w3.org/TR/html5/syntax.html#element-restrictio
ns>
// See: <http://www.w3.org/TR/html5/syntax.html#newlines>
// See: Parsing of "textarea" "listing" and "pre" elements
// from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbo
dy>
return '\n' + ret;
} else {
return ret;
}
},
_createInitialChildren: function (transaction, props, context, lazyTre
e) {
// Intentional use of != to avoid catching zero/false.
var innerHTML = props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
}
} else {
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.ch
ildren : null;
var childrenToUse = contentToUse != null ? null : props.children;
if (contentToUse != null) {
// TODO: Validate that text is allowed as a child of this node
DOMLazyTree.queueText(lazyTree, contentToUse);
} else if (childrenToUse != null) {
var mountImages = this.mountChildren(childrenToUse, transaction,
context);
for (var i = 0; i < mountImages.length; i++) {
DOMLazyTree.queueChild(lazyTree, mountImages[i]);
}
}
}
},
/**
* Receives a next element and updates the component.
*
* @internal
* @param {ReactElement} nextElement
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction}
transaction
},
/**
* Reconciles the properties by detecting differences in property valu
es and
* updating the DOM as necessary. This function is probably the single
most
* critical path for performance optimization.
*
* TODO: Benchmark whether checking for changed values in memory actua
lly
*
ts).
* TODO: Benchmark the effects of putting this at the top since 99% of
props
*
do not change for a given reconciliation.
* TODO: Benchmark areas that can be improved with caching.
*
* @private
* @param {object} lastProps
* @param {object} nextProps
* @param {?DOMElement} node
*/
_updateDOMProperties: function (lastProps, nextProps, transaction) {
var propKey;
var styleName;
var styleUpdates;
for (propKey in lastProps) {
if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty
(propKey) || lastProps[propKey] == null) {
continue;
}
if (propKey === STYLE) {
var lastStyle = this._previousStyleCopy;
for (styleName in lastStyle) {
if (lastStyle.hasOwnProperty(styleName)) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
this._previousStyleCopy = null;
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (lastProps[propKey]) {
// Only call deleteListener if there was a listener previously
or
// else willDeleteListener gets called when there wasn't actua
lly a
// listener (e.g., onClick={null})
deleteListener(this, propKey);
}
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustom
Attribute(propKey)) {
DOMPropertyOperations.deleteValueForProperty(getNode(this), prop
Key);
}
}
for (propKey in nextProps) {
var nextProp = nextProps[propKey];
var lastProp = propKey === STYLE ? this._previousStyleCopy : lastP
rops != null ? lastProps[propKey] : undefined;
DOMPropertyOperations.deleteValueForProperty(node, propKey);
}
}
}
if (styleUpdates) {
CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdate
s, this);
}
},
/**
* Reconciles the children with the various properties that affect the
* children content.
*
* @param {object} lastProps
* @param {object} nextProps
* @param {ReactReconcileTransaction} transaction
* @param {object} context
*/
_updateDOMChildren: function (lastProps, nextProps, transaction, conte
xt) {
var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastPro
ps.children : null;
var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextPro
ps.children : null;
var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.danger
ouslySetInnerHTML.__html;
var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.danger
ouslySetInnerHTML.__html;
// Note the use of `!=` which checks for null or undefined.
var lastChildren = lastContent != null ? null : lastProps.children;
var nextChildren = nextContent != null ? null : nextProps.children;
// If we're switching from children to content/html or vice versa, r
emove
// the old content
var lastHasContentOrHtml = lastContent != null || lastHtml != null;
var nextHasContentOrHtml = nextContent != null || nextHtml != null;
if (lastChildren != null && nextChildren == null) {
this.updateChildren(null, transaction, context);
} else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
this.updateTextContent('');
}
if (nextContent != null) {
if (lastContent !== nextContent) {
this.updateTextContent('' + nextContent);
}
} else if (nextHtml != null) {
if (lastHtml !== nextHtml) {
this.updateMarkup('' + nextHtml);
}
} else if (nextChildren != null) {
this.updateChildren(nextChildren, transaction, context);
}
},
getNativeNode: function () {
return getNode(this);
},
/**
* Destroys all event registrations for this instance. Does not remove
from
* the DOM. That must be done by the parent.
*
* @internal
*/
unmountComponent: function (safely) {
switch (this._tag) {
case 'iframe':
case 'object':
case 'img':
case 'form':
case 'video':
case 'audio':
var listeners = this._wrapperState.listeners;
if (listeners) {
for (var i = 0; i < listeners.length; i++) {
listeners[i].remove();
}
}
break;
case 'html':
case 'head':
case 'body':
/**
* Components like <html> <head> and <body> can't be removed or
added
* easily in a cross-browser way, however it's valuable to be ab
le to
* take advantage of React's reconciliation for styling and <tit
le>
* management. So we just document it and throw in dangerous cas
es.
*/
true ? process.env.NODE_ENV !== 'production' ? invariant(false,
'<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible t
o unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliabl
y and efficiently. To fix this, have a ' + 'single top-level component that neve
r unmounts render these ' + 'elements.', this._tag) : invariant(false) : void 0;
break;
}
this.unmountChildren(safely);
ReactDOMComponentTree.uncacheNode(this);
EventPluginHub.deleteAllListeners(this);
ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._root
NodeID);
this._rootNodeID = null;
this._domID = null;
this._wrapperState = null;
},
getPublicInstance: function () {
return getNode(this);
}
};
ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', {
mountComponent: 'mountComponent',
receiveComponent: 'receiveComponent'
});
_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMulti
Child.Mixin);
module.exports = ReactDOMComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 190 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule AutoFocusUtils
*/
'use strict';
var ReactDOMComponentTree = __webpack_require__(113);
var focusNode = __webpack_require__(191);
var AutoFocusUtils = {
focusDOMComponent: function () {
focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
}
};
module.exports = AutoFocusUtils;
/***/ },
/* 191 */
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
*/
'use strict';
/**
* @param {DOMElement} node input/textarea to focus
*/
function focusNode(node) {
// IE8 can throw "Can't move focus to the control because it is invisi
ble,
// not enabled, or of a type that does not accept the focus." for all
kinds of
// reasons that are too expensive and fragile to test.
try {
node.focus();
} catch (e) {}
}
module.exports = focusNode;
/***/ },
/* 192 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule CSSPropertyOperations
*/
'use strict';
var CSSProperty = __webpack_require__(193);
var ExecutionEnvironment = __webpack_require__(91);
var ReactPerf = __webpack_require__(126);
var
var
var
var
var
camelizeStyleName = __webpack_require__(194);
dangerousStyleValue = __webpack_require__(196);
hyphenateStyleName = __webpack_require__(197);
memoizeStringOnly = __webpack_require__(199);
warning = __webpack_require__(105);
} catch (e) {
hasShorthandPropertyBug = true;
}
// IE8 only supports accessing cssFloat (standard) as styleFloat
if (document.documentElement.style.cssFloat === undefined) {
styleFloatAccessor = 'styleFloat';
}
}
if (process.env.NODE_ENV !== 'production') {
// 'msTransform' is correct, but the other prefixes should be capitali
zed
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
// style values shouldn't contain a semicolon
var badStyleValueWithSemicolonPattern = /;\s*$/;
var warnedStyleNames = {};
var warnedStyleValues = {};
var warnedForNaNValue = false;
var warnHyphenatedStyleName = function (name, owner) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name])
{
return;
}
warnedStyleNames[name] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported
style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRend
erMessage(owner)) : void 0;
};
var warnBadVendoredStyleName = function (name, owner) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name])
{
return;
}
warnedStyleNames[name] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported
vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toU
pperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
};
var warnStyleValueWithSemicolon = function (name, value, owner) {
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[val
ue]) {
return;
}
warnedStyleValues[value] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Style proper
ty values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRe
nderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, ''))
: void 0;
};
var warnStyleValueIsNaN = function (name, value, owner) {
if (warnedForNaNValue) {
return;
}
warnedForNaNValue = true;
process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an
invalid value for the `%s` css style property.%s', name, checkRenderMessage(owne
r)) : void 0;
};
var checkRenderMessage = function (owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
};
/**
* @param {string} name
* @param {*} value
* @param {ReactDOMComponent} component
*/
var warnValidStyle = function (name, value, component) {
var owner;
if (component) {
owner = component._currentElement._owner;
}
if (name.indexOf('-') > -1) {
warnHyphenatedStyleName(name, owner);
} else if (badVendoredStyleNamePattern.test(name)) {
warnBadVendoredStyleName(name, owner);
} else if (badStyleValueWithSemicolonPattern.test(value)) {
warnStyleValueWithSemicolon(name, value, owner);
}
if (typeof value === 'number' && isNaN(value)) {
warnStyleValueIsNaN(name, value, owner);
}
};
}
/**
* Operations for dealing with CSS properties.
*/
var CSSPropertyOperations = {
/**
* Serializes a mapping of style properties for use as inline styles:
*
* > createMarkupForStyles({width: '200px', height: 0})
* "width:200px;height:0;"
*
* Undefined values are ignored so that declarative programming is eas
ier.
* The result should be HTML-escaped before insertion into the DOM.
*
* @param {object} styles
* @param {ReactDOMComponent} component
* @return {?string}
*/
createMarkupForStyles: function (styles, component) {
var serialized = '';
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
var styleValue = styles[styleName];
if (process.env.NODE_ENV !== 'production') {
warnValidStyle(styleName, styleValue, component);
}
if (styleValue != null) {
serialized += processStyleName(styleName) + ':';
serialized += dangerousStyleValue(styleName, styleValue, compone
nt) + ';';
}
}
return serialized || null;
},
/**
* Sets the value for multiple styles on a node. If a value is specif
ied as
* '' (empty string), the corresponding style property will be unset.
*
* @param {DOMElement} node
* @param {object} styles
* @param {ReactDOMComponent} component
*/
setValueForStyles: function (node, styles, component) {
var style = node.style;
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
if (process.env.NODE_ENV !== 'production') {
warnValidStyle(styleName, styles[styleName], component);
}
var styleValue = dangerousStyleValue(styleName, styles[styleName],
component);
if (styleName === 'float' || styleName === 'cssFloat') {
styleName = styleFloatAccessor;
}
if (styleValue) {
style[styleName] = styleValue;
} else {
var expansion = hasShorthandPropertyBug && CSSProperty.shorthand
PropertyExpansions[styleName];
if (expansion) {
// Shorthand property that IE8 won't like unsetting, so unset
each
// component to placate it
for (var individualStyleName in expansion) {
style[individualStyleName] = '';
}
} else {
style[styleName] = '';
}
}
}
}
};
ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations',
{
setValueForStyles: 'setValueForStyles'
});
module.exports = CSSPropertyOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 193 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule CSSProperty
*/
'use strict';
/**
* CSS properties which accept numbers but are not in units of "px".
*/
var isUnitlessNumber = {
animationIterationCount: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridRow: true,
gridColumn: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
/**
* @param {string} prefix vendor-specific prefix, eg: Webkit
* @param {string} key style name, eg: transitionDuration
* @return {string} style name prefixed with `prefix`, properly camelCas
ed, eg:
* WebkitTransitionDuration
*/
function prefixKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
/**
* Support style names that may come passed in prefixed by adding permut
ations
* of vendor prefixes.
*/
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go
into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function (prop) {
prefixes.forEach(function (prefix) {
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
});
});
/**
* Most style properties can be unset by doing .style[prop] = '' but IE8
* doesn't like doing that with shorthand properties so for the properti
es that
* IE8 breaks on, which are listed here, we instead unset each of the
* individual properties. See http://bugs.jquery.com/ticket/12385.
* The 4-value 'clock' properties like margin, padding, border-width see
m to
* behave without any problems. Curiously, list-style works too without
any
* special prodding.
*/
var shorthandPropertyExpansions = {
background: {
backgroundAttachment: true,
backgroundColor: true,
backgroundImage: true,
backgroundPositionX: true,
backgroundPositionY: true,
backgroundRepeat: true
},
backgroundPosition: {
backgroundPositionX: true,
backgroundPositionY: true
},
border: {
borderWidth: true,
borderStyle: true,
borderColor: true
},
borderBottom: {
borderBottomWidth: true,
borderBottomStyle: true,
borderBottomColor: true
},
borderLeft: {
borderLeftWidth: true,
borderLeftStyle: true,
borderLeftColor: true
},
borderRight: {
borderRightWidth: true,
borderRightStyle: true,
borderRightColor: true
},
borderTop: {
borderTopWidth: true,
borderTopStyle: true,
borderTopColor: true
},
font: {
fontStyle: true,
fontVariant: true,
fontWeight: true,
fontSize: true,
lineHeight: true,
fontFamily: true
},
outline: {
outlineWidth: true,
outlineStyle: true,
outlineColor: true
}
};
var CSSProperty = {
isUnitlessNumber: isUnitlessNumber,
shorthandPropertyExpansions: shorthandPropertyExpansions
};
module.exports = CSSProperty;
/***/ },
/* 194 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule dangerousStyleValue
*/
'use strict';
var CSSProperty = __webpack_require__(193);
var warning = __webpack_require__(105);
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
var styleWarnings = {};
/**
* Convert a value into the proper css writable value. The style name `n
ame`
* should be logical (no hyphens), as specified
* in `CSSProperty.isUnitlessNumber`.
*
* @param {string} name CSS property name such as `topMargin`.
* @param {*} value CSS property value such as `10px`.
* @param {ReactDOMComponent} component
* @return {string} Normalized style value with dimensions applied.
*/
function dangerousStyleValue(name, value, component) {
// Note that we've removed escapeTextForBrowser() calls here since the
// whole string will be escaped when the attribute is injected into
// the markup. If you provide unsafe user data here they can inject
// arbitrary CSS which may be problematic (I couldn't repro this):
//
//
//
//
//
https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
This is not an XSS hole but instead a potential CSS injection issue
which has lead to a greater discussion about how we're going to
trust URLs moving forward. See #2115901
var isEmpty = value == null || typeof value === 'boolean' || value ===
'';
if (isEmpty) {
return '';
}
var isNonNumeric = isNaN(value);
if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(nam
e) && isUnitlessNumber[name]) {
return '' + value; // cast to string
}
if (typeof value === 'string') {
if (process.env.NODE_ENV !== 'production') {
if (component) {
var owner = component._currentElement._owner;
var ownerName = owner ? owner.getName() : null;
if (ownerName && !styleWarnings[ownerName]) {
styleWarnings[ownerName] = {};
}
var warned = false;
if (ownerName) {
var warnings = styleWarnings[ownerName];
warned = warnings[name];
if (!warned) {
warnings[name] = true;
}
}
if (!warned) {
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 versio
n of React.', component._currentElement.type, ownerName || 'unknown', name, valu
e) : void 0;
}
}
}
value = value.trim();
}
return value + 'px';
}
module.exports = dangerousStyleValue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 197 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
*
* > hyphenate('backgroundColor')
* < "background-color"
*
* For CSS style names, use `hyphenateStyleName` instead which works pro
perly
* with all vendor prefixes, including `ms`.
*
* @param {string} string
* @return {string}
*/
function hyphenate(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
module.exports = hyphenate;
/***/ },
/* 199 */
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks static-only
*/
'use strict';
/**
* Memoizes the return value of a function that accepts one string argum
ent.
*
* @param {function} callback
* @return {function}
*/
function memoizeStringOnly(callback) {
var cache = {};
return function (string) {
if (!cache.hasOwnProperty(string)) {
cache[string] = callback.call(this, string);
}
return cache[string];
};
}
module.exports = memoizeStringOnly;
/***/ },
/* 200 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule DOMNamespaces
*/
'use strict';
var DOMNamespaces = {
html: 'http://www.w3.org/1999/xhtml',
mathml: 'http://www.w3.org/1998/Math/MathML',
svg: 'http://www.w3.org/2000/svg'
};
module.exports = DOMNamespaces;
/***/ },
/* 201 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule DOMPropertyOperations
*/
'use strict';
var DOMProperty = __webpack_require__(94);
var ReactDOMInstrumentation = __webpack_require__(202);
var ReactPerf = __webpack_require__(126);
var quoteAttributeValueForBrowser = __webpack_require__(205);
var warning = __webpack_require__(105);
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE
_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
return true;
}
if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
return false;
}
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
validatedAttributeNameCache[attributeName] = true;
return true;
}
illegalAttributeNameCache[attributeName] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attrib
ute name: `%s`', attributeName) : void 0;
return false;
}
function shouldIgnoreValue(propertyInfo, value) {
return value == null || propertyInfo.hasBooleanValue && !value || prop
ertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue
&& value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
}
/**
* Operations for dealing with DOM properties.
*/
var DOMPropertyOperations = {
/**
* Creates markup for the ID property.
*
* @param {string} id Unescaped ID.
* @return {string} Markup string.
*/
createMarkupForID: function (id) {
return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForB
rowser(id);
},
setAttributeForID: function (node, id) {
node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
},
createMarkupForRoot: function () {
return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
},
setAttributeForRoot: function (node) {
node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
},
/**
* Creates markup for a property.
*
* @param {string} name
* @param {*} value
* @return {?string} Markup string, or null if the property was invali
d.
*/
createMarkupForProperty: function (name, value) {
if (process.env.NODE_ENV !== 'production') {
ReactDOMInstrumentation.debugTool.onCreateMarkupForProperty(name,
value);
}
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOM
Property.properties[name] : null;
if (propertyInfo) {
if (shouldIgnoreValue(propertyInfo, value)) {
return '';
}
var attributeName = propertyInfo.attributeName;
if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBool
eanValue && value === true) {
return attributeName + '=""';
}
return attributeName + '=' + quoteAttributeValueForBrowser(value);
} else if (DOMProperty.isCustomAttribute(name)) {
if (value == null) {
return '';
}
return name + '=' + quoteAttributeValueForBrowser(value);
}
return null;
},
/**
* Creates markup for a custom property.
*
* @param {string} name
* @param {*} value
* @return {string} Markup string, or empty string if the property was
invalid.
*/
createMarkupForCustomAttribute: function (name, value) {
if (!isAttributeNameSafe(name) || value == null) {
return '';
}
return name + '=' + quoteAttributeValueForBrowser(value);
},
/**
* Sets the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
* @param {*} value
*/
setValueForProperty: function (node, name, value) {
if (process.env.NODE_ENV !== 'production') {
ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name
, value);
}
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOM
Property.properties[name] : null;
if (propertyInfo) {
var mutationMethod = propertyInfo.mutationMethod;
if (mutationMethod) {
mutationMethod(node, value);
} else if (shouldIgnoreValue(propertyInfo, value)) {
this.deleteValueForProperty(node, name);
} else if (propertyInfo.mustUseProperty) {
var propName = propertyInfo.propertyName;
// Must explicitly cast values for HAS_SIDE_EFFECTS-properties t
o the
// property type before comparing; only `value` does and is stri
ng.
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMDebugTool
*/
'use strict';
var ReactDOMUnknownPropertyDevtool = __webpack_require__(204);
var warning = __webpack_require__(105);
var eventHandlers = [];
var handlerDoesThrowForEvent = {};
function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
if (process.env.NODE_ENV !== 'production') {
eventHandlers.forEach(function (handler) {
try {
if (handler[handlerFunctionName]) {
handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
}
} catch (e) {
process.env.NODE_ENV !== 'production' ? warning(!handlerDoesThro
wForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s:
%s', handlerFunctionName, e.message) : void 0;
handlerDoesThrowForEvent[handlerFunctionName] = true;
}
});
}
}
var ReactDOMDebugTool = {
addDevtool: function (devtool) {
eventHandlers.push(devtool);
},
removeDevtool: function (devtool) {
for (var i = 0; i < eventHandlers.length; i++) {
if (eventHandlers[i] === devtool) {
eventHandlers.splice(i, 1);
i--;
}
}
},
onCreateMarkupForProperty: function (name, value) {
emitEvent('onCreateMarkupForProperty', name, value);
},
onSetValueForProperty: function (node, name, value) {
emitEvent('onSetValueForProperty', node, name, value);
},
onDeleteValueForProperty: function (node, name) {
emitEvent('onDeleteValueForProperty', node, name);
}
};
ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
module.exports = ReactDOMDebugTool;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 204 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMUnknownPropertyDevtool
*/
'use strict';
var DOMProperty = __webpack_require__(94);
var EventPluginRegistry = __webpack_require__(100);
var warning = __webpack_require__(105);
if (process.env.NODE_ENV !== 'production') {
var reactProps = {
children: true,
dangerouslySetInnerHTML: true,
key: true,
ref: true
};
var warnedProperties = {};
var warnUnknownProperty = function (name) {
if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCus
tomAttribute(name)) {
return;
}
if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedPro
perties.hasOwnProperty(name) && warnedProperties[name]) {
return;
}
warnedProperties[name] = true;
var lowerCasedName = name.toLowerCase();
// data-* attributes should be lowercase; suggest the lowercase vers
ion
var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? l
owerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedNam
e) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
// For now, only warn when we have a suggested correction. This prev
ents
// logging too much when using transferPropsTo.
process.env.NODE_ENV !== 'production' ? warning(standardName == null
, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : void 0;
var registrationName = EventPluginRegistry.possibleRegistrationNames
.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[
lowerCasedName] : null;
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMButton
*/
'use strict';
var DisabledInputUtils = __webpack_require__(207);
/**
* Implements a <button> native component that does not receive mouse ev
ents
* when `disabled` is set.
*/
var ReactDOMButton = {
getNativeProps: DisabledInputUtils.getNativeProps
};
module.exports = ReactDOMButton;
/***/ },
/* 207 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule DisabledInputUtils
*/
'use strict';
var disableableMouseListenerNames = {
onClick: true,
onDoubleClick: true,
onMouseDown: true,
onMouseMove: true,
onMouseUp: true,
onClickCapture: true,
onDoubleClickCapture: true,
onMouseDownCapture: true,
onMouseMoveCapture: true,
onMouseUpCapture: true
};
/**
* Implements a native component that does not receive mouse events
* when `disabled` is set.
*/
var DisabledInputUtils = {
getNativeProps: function (inst, props) {
if (!props.disabled) {
return props;
}
// Copy the props, except the mouse listeners
var nativeProps = {};
for (var key in props) {
if (!disableableMouseListenerNames[key] && props.hasOwnProperty(ke
y)) {
nativeProps[key] = props[key];
}
}
return nativeProps;
}
};
module.exports = DisabledInputUtils;
/***/ },
/* 208 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMInput
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
var
DisabledInputUtils = __webpack_require__(207);
DOMPropertyOperations = __webpack_require__(201);
LinkedValueUtils = __webpack_require__(209);
ReactDOMComponentTree = __webpack_require__(113);
ReactUpdates = __webpack_require__(132);
didWarnValueLink = false;
didWarnCheckedLink = false;
didWarnValueNull = false;
didWarnValueDefaultValue = false;
didWarnCheckedDefaultChecked = false;
});
return nativeProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('input', props, inst._currentEleme
nt._owner);
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLi
nk` prop on `input` is deprecated; set `value` and `onChange` instead.') : void
0;
didWarnValueLink = true;
}
if (props.checkedLink !== undefined && !didWarnCheckedLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`checked
Link` prop on `input` is deprecated; set `value` and `onChange` instead.') : voi
d 0;
didWarnCheckedLink = true;
}
if (props.checked !== undefined && props.defaultChecked !== undefi
ned && !didWarnCheckedDefaultChecked) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Input el
ements must be either controlled or uncontrolled ' + '(specify either the checke
d prop, or the defaultChecked prop, but not ' + 'both). Decide between using a c
ontrolled or uncontrolled input ' + 'element and remove one of these props. More
info: ' + 'https://fb.me/react-controlled-components') : void 0;
didWarnCheckedDefaultChecked = true;
}
if (props.value !== undefined && props.defaultValue !== undefined
&& !didWarnValueDefaultValue) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Input el
ements must be either controlled or uncontrolled ' + '(specify either the value
prop, or the defaultValue prop, but not ' + 'both). Decide between using a contr
olled or uncontrolled input ' + 'element and remove one of these props. More inf
o: ' + 'https://fb.me/react-controlled-components') : void 0;
didWarnValueDefaultValue = true;
}
warnIfValueIsNull(props);
}
var defaultValue = props.defaultValue;
inst._wrapperState = {
initialChecked: props.defaultChecked || false,
initialValue: defaultValue != null ? defaultValue : null,
listeners: null,
onChange: _handleChange.bind(inst)
};
if (process.env.NODE_ENV !== 'production') {
inst._wrapperState.controlled = props.checked !== undefined || pro
ps.value !== undefined;
}
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
eld should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange`
or `readOnly`.');
},
checked: function (props, propName, componentName) {
if (!props[propName] || props.onChange || props.readOnly || props.di
sabled) {
return null;
}
return new Error('You provided a `checked` prop to a form field with
out an ' + '`onChange` handler. This will render a read-only field. If ' + 'the
field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChan
ge` or `readOnly`.');
},
onChange: ReactPropTypes.func
};
var loggedTypeFailures = {};
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Provide a linked `value` attribute for controlled forms. You should n
ot use
* this outside of the ReactDOM controlled form components.
*/
var LinkedValueUtils = {
checkPropTypes: function (tagName, props, owner) {
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error = propTypes[propName](props, propName, tagName, ReactP
ropTypeLocations.prop);
}
if (error instanceof Error && !(error.message in loggedTypeFailure
s)) {
// Only monitor this failure once because there tends to be a lo
t of the
// same error.
loggedTypeFailures[error.message] = true;
var addendum = getDeclarationErrorAddendum(owner);
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed f
orm propType: %s%s', error.message, addendum) : void 0;
}
}
},
/**
* @param {object} inputProps Props for form component
* @return {*} current value of the input either from value prop or li
nk.
*/
getValue: function (inputProps) {
if (inputProps.valueLink) {
_assertValueLink(inputProps);
return inputProps.valueLink.value;
}
return inputProps.value;
},
/**
* @param {object} inputProps Props for form component
* @return {*} current checked status of the input either from checked
prop
*
or link.
*/
getChecked: function (inputProps) {
if (inputProps.checkedLink) {
_assertCheckedLink(inputProps);
return inputProps.checkedLink.value;
}
return inputProps.checked;
},
/**
* @param {object} inputProps Props for form component
* @param {SyntheticEvent} event change event to handle
*/
executeOnChange: function (inputProps, event) {
if (inputProps.valueLink) {
_assertValueLink(inputProps);
return inputProps.valueLink.requestChange(event.target.value);
} else if (inputProps.checkedLink) {
_assertCheckedLink(inputProps);
return inputProps.checkedLink.requestChange(event.target.checked);
} else if (inputProps.onChange) {
return inputProps.onChange.call(undefined, event);
}
}
};
module.exports = LinkedValueUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 210 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMOption
*/
'use strict';
var _assign = __webpack_require__(97);
if (props.value != null) {
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
node.setAttribute('value', props.value);
}
},
getNativeProps: function (inst, props) {
var nativeProps = _assign({ selected: undefined, children: undefined
}, props);
// Read state only from initial mount because <select> updates value
// manually; we need the initial state only for server rendering
if (inst._wrapperState.selected != null) {
nativeProps.selected = inst._wrapperState.selected;
}
var content = '';
// Flatten children and warn if they aren't strings or numbers;
// invalid types are ignored.
ReactChildren.forEach(props.children, function (child) {
if (child == null) {
return;
}
if (typeof child === 'string' || typeof child === 'number') {
content += child;
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'Only str
ings and numbers are supported as <option> children.') : void 0;
}
});
if (content) {
nativeProps.children = content;
}
return nativeProps;
}
};
module.exports = ReactDOMOption;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 211 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMSelect
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
DisabledInputUtils = __webpack_require__(207);
LinkedValueUtils = __webpack_require__(209);
ReactDOMComponentTree = __webpack_require__(113);
ReactUpdates = __webpack_require__(132);
}
/**
* Implements a <select> native component that allows optionally setting
the
* props `value` and `defaultValue`. If `multiple` is false, the prop mu
st be a
* stringable. If `multiple` is true, the prop must be an array of strin
gables.
*
* If `value` is not supplied (or null/undefined), user actions that cha
nge the
* selected option will trigger updates to the rendered options.
*
* If it is supplied (and not null/undefined), the rendered options will
not
* update in response to user actions. Instead, the `value` prop must ch
ange in
* order for the rendered options to update.
*
* If `defaultValue` is provided, any options with the supplied values w
ill be
* selected.
*/
var ReactDOMSelect = {
getNativeProps: function (inst, props) {
return _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
onChange: inst._wrapperState.onChange,
value: undefined
});
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
checkSelectPropTypes(inst, props);
warnIfValueIsNull(props);
}
var value = LinkedValueUtils.getValue(props);
inst._wrapperState = {
pendingUpdate: false,
initialValue: value != null ? value : props.defaultValue,
listeners: null,
onChange: _handleChange.bind(inst),
wasMultiple: Boolean(props.multiple)
};
if (props.value !== undefined && props.defaultValue !== undefined &&
!didWarnValueDefaultValue) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Select ele
ments must be either controlled or uncontrolled ' + '(specify either the value p
rop, or the defaultValue prop, but not ' + 'both). Decide between using a contro
lled or uncontrolled select ' + 'element and remove one of these props. More inf
o: ' + 'https://fb.me/react-controlled-components') : void 0;
didWarnValueDefaultValue = true;
}
},
getSelectValueContext: function (inst) {
// ReactDOMOption looks at this initial value so the initial generat
ed
// markup has correct `selected` attributes
return inst._wrapperState.initialValue;
},
postUpdateWrapper: function (inst) {
var props = inst._currentElement.props;
if (process.env.NODE_ENV !== 'production') {
warnIfValueIsNull(props);
}
// After the initial mount, we control selected-ness manually so don
't pass
// this value down
inst._wrapperState.initialValue = undefined;
var wasMultiple = inst._wrapperState.wasMultiple;
inst._wrapperState.wasMultiple = Boolean(props.multiple);
var value = LinkedValueUtils.getValue(props);
if (value != null) {
inst._wrapperState.pendingUpdate = false;
updateOptions(inst, Boolean(props.multiple), value);
} else if (wasMultiple !== Boolean(props.multiple)) {
// For simplicity, reapply `defaultValue` if `multiple` is toggled
.
if (props.defaultValue != null) {
updateOptions(inst, Boolean(props.multiple), props.defaultValue)
;
} else {
// Revert the select back to its default unselected state.
updateOptions(inst, Boolean(props.multiple), props.multiple ? []
: '');
}
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
if (this._rootNodeID) {
this._wrapperState.pendingUpdate = true;
}
ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
return returnValue;
}
module.exports = ReactDOMSelect;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 212 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMTextarea
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
var
DisabledInputUtils = __webpack_require__(207);
DOMPropertyOperations = __webpack_require__(201);
LinkedValueUtils = __webpack_require__(209);
ReactDOMComponentTree = __webpack_require__(113);
ReactUpdates = __webpack_require__(132);
* The rendered element will be initialized with an empty value, the pro
p
* `defaultValue` if specified, or the children content (deprecated).
*/
var ReactDOMTextarea = {
getNativeProps: function (inst, props) {
!(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !==
'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense o
n <textarea>.') : invariant(false) : void 0;
// Always set children to the same thing. In IE9, the selection rang
e will
// get reset if `textContent` is mutated.
var nativeProps = _assign({}, DisabledInputUtils.getNativeProps(inst
, props), {
defaultValue: undefined,
value: undefined,
children: inst._wrapperState.initialValue,
onChange: inst._wrapperState.onChange
});
return nativeProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('textarea', props, inst._currentEl
ement._owner);
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLi
nk` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : vo
id 0;
didWarnValueLink = true;
}
if (props.value !== undefined && props.defaultValue !== undefined
&& !didWarnValDefaultVal) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea
elements must be either controlled or uncontrolled ' + '(specify either the val
ue prop, or the defaultValue prop, but not ' + 'both). Decide between using a co
ntrolled or uncontrolled textarea ' + 'and remove one of these props. More info:
' + 'https://fb.me/react-controlled-components') : void 0;
didWarnValDefaultVal = true;
}
warnIfValueIsNull(props);
}
var defaultValue = props.defaultValue;
// TODO (yungsters): Remove support for children content in <textare
a>.
var children = props.children;
if (children != null) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'Use the
`defaultValue` or `value` props instead of setting ' + 'children on <textarea>.'
) : void 0;
}
!(defaultValue == null) ? process.env.NODE_ENV !== 'production' ?
invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass chil
dren.') : invariant(false) : void 0;
if (Array.isArray(children)) {
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactMultiChild
*/
'use strict';
var ReactComponentEnvironment = __webpack_require__(139);
var ReactMultiChildUpdateTypes = __webpack_require__(187);
var ReactCurrentOwner = __webpack_require__(112);
var ReactReconciler = __webpack_require__(127);
var ReactChildReconciler = __webpack_require__(214);
var flattenChildren = __webpack_require__(215);
var invariant = __webpack_require__(95);
/**
* Make an update for markup to be rendered and inserted at a supplied i
ndex.
*
* @param {string} markup Markup that renders into an element.
* @param {number} toIndex Destination index.
* @private
*/
function makeInsertMarkup(markup, afterNode, toIndex) {
// NOTE: Null values reduce hidden classes.
return {
type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
content: markup,
fromIndex: null,
fromNode: null,
toIndex: toIndex,
afterNode: afterNode
};
}
/**
* Make an update for moving an existing element to another index.
*
* @param {number} fromIndex Source index of the existing element.
* @param {number} toIndex Destination index of the element.
* @private
*/
function makeMove(child, afterNode, toIndex) {
// NOTE: Null values reduce hidden classes.
return {
type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
content: null,
fromIndex: child._mountIndex,
fromNode: ReactReconciler.getNativeNode(child),
toIndex: toIndex,
afterNode: afterNode
};
}
/**
* Make an update for removing an element at an index.
*
* @param {number} fromIndex Index of the element to remove.
* @private
*/
function makeRemove(child, node) {
// NOTE: Null values reduce hidden classes.
return {
type: ReactMultiChildUpdateTypes.REMOVE_NODE,
content: null,
fromIndex: child._mountIndex,
fromNode: node,
toIndex: null,
afterNode: null
};
}
/**
* Make an update for setting the markup of a node.
*
* @param {string} markup Markup that renders into an element.
* @private
*/
function makeSetMarkup(markup) {
// NOTE: Null values reduce hidden classes.
return {
type: ReactMultiChildUpdateTypes.SET_MARKUP,
content: markup,
fromIndex: null,
fromNode: null,
toIndex: null,
afterNode: null
};
}
/**
* Make an update for setting the text content.
*
* @param {string} textContent Text content to set.
* @private
*/
function makeTextContent(textContent) {
// NOTE: Null values reduce hidden classes.
return {
type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
content: textContent,
fromIndex: null,
fromNode: null,
toIndex: null,
afterNode: null
};
}
/**
* Push an update, if any, onto the queue. Creates a new queue if none i
s
* passed and always returns the queue. Mutative.
*/
function enqueue(queue, update) {
if (update) {
queue = queue || [];
queue.push(update);
}
return queue;
}
/**
* Processes any enqueued updates.
*
* @private
*/
function processQueue(inst, updateQueue) {
ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
}
/**
* ReactMultiChild are capable of reconciling multiple children.
*
* @class ReactMultiChild
* @internal
*/
var ReactMultiChild = {
/**
* Provides common functionality for components that must reconcile mu
ltiple
* children. This is used by `ReactDOMComponent` to mount, update, and
* unmount child components.
*
* @lends {ReactMultiChild.prototype}
*/
Mixin: {
_reconcilerInstantiateChildren: function (nestedChildren, transactio
n, context) {
if (process.env.NODE_ENV !== 'production') {
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
return ReactChildReconciler.instantiateChildren(nestedChildr
en, transaction, context);
} finally {
ReactCurrentOwner.current = null;
}
}
}
return ReactChildReconciler.instantiateChildren(nestedChildren, tr
ansaction, context);
},
_reconcilerUpdateChildren: function (prevChildren, nextNestedChildre
nElements, removedNodes, transaction, context) {
var nextChildren;
if (process.env.NODE_ENV !== 'production') {
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
nextChildren = flattenChildren(nextNestedChildrenElements);
} finally {
ReactCurrentOwner.current = null;
}
ReactChildReconciler.updateChildren(prevChildren, nextChildren
, removedNodes, transaction, context);
return nextChildren;
}
}
nextChildren = flattenChildren(nextNestedChildrenElements);
ReactChildReconciler.updateChildren(prevChildren, nextChildren, re
movedNodes, transaction, context);
return nextChildren;
},
/**
* Generates a "mount image" for each of the supplied children. In t
he case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildren Nested child maps.
* @return {array} An array of mounted representations.
* @internal
*/
mountChildren: function (nestedChildren, transaction, context) {
var children = this._reconcilerInstantiateChildren(nestedChildren,
transaction, context);
this._renderedChildren = children;
var mountImages = [];
var index = 0;
for (var name in children) {
if (children.hasOwnProperty(name)) {
var child = children[name];
var mountImage = ReactReconciler.mountComponent(child, transac
tion, this, this._nativeContainerInfo, context);
child._mountIndex = index++;
mountImages.push(mountImage);
}
}
return mountImages;
},
/**
* Replaces any rendered children with a text content string.
*
* @param {string} nextContent String of content.
* @internal
*/
updateTextContent: function (nextContent) {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
ReactChildReconciler.unmountChildren(prevChildren, false);
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
true ? process.env.NODE_ENV !== 'production' ? invariant(fals
e, 'updateTextContent called on non-empty component.') : invariant(false) : void
0;
}
}
// Set new text content.
var updates = [makeTextContent(nextContent)];
processQueue(this, updates);
},
/**
* Replaces any rendered children with a markup string.
*
* @param {string} nextMarkup String of markup.
* @internal
*/
updateMarkup: function (nextMarkup) {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
ReactChildReconciler.unmountChildren(prevChildren, false);
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
true ? process.env.NODE_ENV !== 'production' ? invariant(fals
e, 'updateTextContent called on non-empty component.') : invariant(false) : void
0;
}
}
var updates = [makeSetMarkup(nextMarkup)];
processQueue(this, updates);
},
/**
* Updates the rendered children with new children.
*
* @param {?object} nextNestedChildrenElements Nested child element
maps.
* @param {ReactReconcileTransaction} transaction
* @internal
*/
updateChildren: function (nextNestedChildrenElements, transaction, c
ontext) {
// Hook used by React ART
this._updateChildren(nextNestedChildrenElements, transaction, cont
ext);
},
/**
* @param {?object} nextNestedChildrenElements Nested child element
maps.
* @param {ReactReconcileTransaction} transaction
* @final
* @protected
*/
_updateChildren: function (nextNestedChildrenElements, transaction,
context) {
var prevChildren = this._renderedChildren;
var removedNodes = {};
var nextChildren = this._reconcilerUpdateChildren(prevChildren, ne
xtNestedChildrenElements, removedNodes, transaction, context);
if (!nextChildren && !prevChildren) {
return;
}
var updates = null;
var name;
// `nextIndex` will increment for each child in `nextChildren`, bu
t
// `lastIndex` will be the last index visited in `prevChildren`.
var lastIndex = 0;
var nextIndex = 0;
var lastPlacedNode = null;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
var prevChild = prevChildren && prevChildren[name];
var nextChild = nextChildren[name];
if (prevChild === nextChild) {
updates = enqueue(updates, this.moveChild(prevChild, lastPlace
dNode, nextIndex, lastIndex));
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
prevChild._mountIndex = nextIndex;
} else {
if (prevChild) {
// Update `lastIndex` before `_mountIndex` gets unset by unm
ounting.
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
// The `removedNodes` loop below will actually remove the ch
ild.
}
// The child must be instantiated before it's mounted.
updates = enqueue(updates, this._mountChildAtIndex(nextChild,
lastPlacedNode, nextIndex, transaction, context));
}
nextIndex++;
lastPlacedNode = ReactReconciler.getNativeNode(nextChild);
}
// Remove children that are no longer present.
for (name in removedNodes) {
if (removedNodes.hasOwnProperty(name)) {
updates = enqueue(updates, this._unmountChild(prevChildren[nam
e], removedNodes[name]));
}
}
if (updates) {
processQueue(this, updates);
}
this._renderedChildren = nextChildren;
},
/**
* Unmounts all rendered children. This should be used to clean up c
hildren
* when this component is unmounted. It does not actually perform an
y
* backend operations.
*
* @internal
*/
unmountChildren: function (safely) {
var renderedChildren = this._renderedChildren;
ReactChildReconciler.unmountChildren(renderedChildren, safely);
this._renderedChildren = null;
},
/**
* Moves a child component to the supplied index.
*
* @param {ReactComponent} child Component to move.
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactChildReconciler
*/
'use strict';
var ReactReconciler = __webpack_require__(127);
var
var
var
var
var
instantiateReactComponent = __webpack_require__(137);
KeyEscapeUtils = __webpack_require__(151);
shouldUpdateReactComponent = __webpack_require__(143);
traverseAllChildren = __webpack_require__(149);
warning = __webpack_require__(105);
/**
* ReactChildReconciler provides helpers for initializing or updating a
set of
* children. Its output is suitable for passing it onto ReactMultiChild
which
* does diffed reordering and insertion.
*/
var ReactChildReconciler = {
/**
* Generates a "mount image" for each of the supplied children. In the
case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildNodes Nested child maps.
* @return {?object} A set of child instances.
* @internal
*/
instantiateChildren: function (nestedChildNodes, transaction, context)
{
if (nestedChildNodes == null) {
return null;
}
var childInstances = {};
traverseAllChildren(nestedChildNodes, instantiateChild, childInstanc
es);
return childInstances;
},
/**
* Updates the rendered children and returns a new set of children.
*
* @param {?object} prevChildren Previously initialized set of childre
n.
* @param {?object} nextChildren Flat child element maps.
* @param {ReactReconcileTransaction} transaction
* @param {object} context
* @return {?object} A new set of child instances.
* @internal
*/
updateChildren: function (prevChildren, nextChildren, removedNodes, tr
ansaction, context) {
// We currently don't have a way to track moves here but if we use i
terators
// instead of for..in we can zip the iterators and check if an item
has
// moved.
// TODO: If nothing has changed, return the prevChildren object so t
hat we
// can quickly bailout if nothing has changed.
if (!nextChildren && !prevChildren) {
return;
}
var name;
var prevChild;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
prevChild = prevChildren && prevChildren[name];
var prevElement = prevChild && prevChild._currentElement;
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule flattenChildren
*/
'use strict';
var KeyEscapeUtils = __webpack_require__(151);
var traverseAllChildren = __webpack_require__(149);
var warning = __webpack_require__(105);
/**
* @param {function} traverseContext Context passed through traversal.
* @param {?ReactComponent} child React child component.
* @param {!string} name String name of key path to child.
*/
function flattenSingleChildIntoContext(traverseContext, child, name) {
// We found a component instance.
var result = traverseContext;
var keyUnique = result[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenC
hildren(...): 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;
}
if (keyUnique && child != null) {
result[name] = child;
}
}
/**
* Flattens children that are typically specified as `props.children`. A
ny null
* children will not be included in the resulting object.
* @return {!object} flattened children keyed by name.
*/
function flattenChildren(children) {
if (children == null) {
return children;
}
var result = {};
traverseAllChildren(children, flattenSingleChildIntoContext, result);
return result;
}
module.exports = flattenChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 216 */
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
[keysA[i]])) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ },
/* 217 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMEmptyComponent
*/
'use strict';
var _assign = __webpack_require__(97);
var DOMLazyTree = __webpack_require__(88);
var ReactDOMComponentTree = __webpack_require__(113);
var ReactDOMEmptyComponent = function (instantiate) {
// ReactCompositeComponent uses this:
this._currentElement = null;
// ReactDOMComponentTree uses these:
this._nativeNode = null;
this._nativeParent = null;
this._nativeContainerInfo = null;
this._domID = null;
};
_assign(ReactDOMEmptyComponent.prototype, {
mountComponent: function (transaction, nativeParent, nativeContainerIn
fo, context) {
var domID = nativeContainerInfo._idCounter++;
this._domID = domID;
this._nativeParent = nativeParent;
this._nativeContainerInfo = nativeContainerInfo;
var nodeValue = ' react-empty: ' + this._domID + ' ';
if (transaction.useCreateElement) {
var ownerDocument = nativeContainerInfo._ownerDocument;
var node = ownerDocument.createComment(nodeValue);
ReactDOMComponentTree.precacheNode(this, node);
return DOMLazyTree(node);
} else {
if (transaction.renderToStaticMarkup) {
// Normally we'd insert a comment node, but since this is a situ
ation
// where React won't take over (static pages), we can simply ret
urn
// nothing.
return '';
}
return '<!--' + nodeValue + '-->';
}
},
receiveComponent: function () {},
getNativeNode: function () {
return ReactDOMComponentTree.getNodeFromInstance(this);
},
unmountComponent: function () {
ReactDOMComponentTree.uncacheNode(this);
}
});
module.exports = ReactDOMEmptyComponent;
/***/ },
/* 218 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMTreeTraversal
*/
'use strict';
var invariant = __webpack_require__(95);
/**
* Return the lowest common ancestor of A and B, or null if they are in
* different trees.
*/
function getLowestCommonAncestor(instA, instB) {
!('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? in
variant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : vo
id 0;
!('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? in
variant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : vo
id 0;
var depthA = 0;
for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
depthA++;
}
var depthB = 0;
for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
depthB++;
}
// If A is deeper, crawl up.
while (depthA - depthB > 0) {
instA = instA._nativeParent;
depthA--;
}
// If B is deeper, crawl up.
while (depthB - depthA > 0) {
instB = instB._nativeParent;
depthB--;
}
// Walk in lockstep until we find a match.
var depth = depthA;
while (depth--) {
if (instA === instB) {
return instA;
}
instA = instA._nativeParent;
instB = instB._nativeParent;
}
return null;
}
/**
* Return if A is an ancestor of B.
*/
function isAncestor(instA, instB) {
!('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? in
variant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
!('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? in
variant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
while (instB) {
if (instB === instA) {
return true;
}
instB = instB._nativeParent;
}
return false;
}
/**
* Return the parent instance of the passed-in instance.
*/
function getParentInstance(inst) {
!('_nativeNode' in inst) ? process.env.NODE_ENV !== 'production' ? inv
ariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void
0;
return inst._nativeParent;
}
/**
* Simulates the traversal of a two-phase, capture/bubble event dispatch
.
*/
function traverseTwoPhase(inst, fn, arg) {
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMTextComponent
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
DOMChildrenOperations = __webpack_require__(182);
DOMLazyTree = __webpack_require__(88);
ReactDOMComponentTree = __webpack_require__(113);
ReactPerf = __webpack_require__(126);
have
* any features besides containing text content.
*
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction}
transaction
* @return {string} Markup for this text node.
* @internal
*/
mountComponent: function (transaction, nativeParent, nativeContainerIn
fo, context) {
if (process.env.NODE_ENV !== 'production') {
var parentInfo;
if (nativeParent != null) {
parentInfo = nativeParent._ancestorInfo;
} else if (nativeContainerInfo != null) {
parentInfo = nativeContainerInfo._ancestorInfo;
}
if (parentInfo) {
// parentInfo should always be present except for the top-level
// component when server rendering
validateDOMNesting('#text', this, parentInfo);
}
}
var domID = nativeContainerInfo._idCounter++;
var openingValue = ' react-text: ' + domID + ' ';
var closingValue = ' /react-text ';
this._domID = domID;
this._nativeParent = nativeParent;
if (transaction.useCreateElement) {
var ownerDocument = nativeContainerInfo._ownerDocument;
var openingComment = ownerDocument.createComment(openingValue);
var closingComment = ownerDocument.createComment(closingValue);
var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment())
;
DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
if (this._stringText) {
DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.creat
eTextNode(this._stringText)));
}
DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
ReactDOMComponentTree.precacheNode(this, openingComment);
this._closingComment = closingComment;
return lazyTree;
} else {
var escapedText = escapeTextContentForBrowser(this._stringText);
if (transaction.renderToStaticMarkup) {
// Normally we'd wrap this between comment nodes for the reasons
stated
// above, but since this is a situation where React won't take o
ver
// (static pages), we can simply return the text as it is.
return escapedText;
}
return '<!--' + openingValue + '-->' + escapedText + '<!--' + clos
ingValue + '-->';
}
},
/**
* Updates this component by updating the text content.
*
* @param {ReactText} nextText The next text content
* @param {ReactReconcileTransaction} transaction
* @internal
*/
receiveComponent: function (nextText, transaction) {
if (nextText !== this._currentElement) {
this._currentElement = nextText;
var nextStringText = '' + nextText;
if (nextStringText !== this._stringText) {
// TODO: Save this as pending props and use performUpdateIfNeces
sary
// and/or updateComponent to do the actual update for consistenc
y with
// other component types?
this._stringText = nextStringText;
var commentNodes = this.getNativeNode();
DOMChildrenOperations.replaceDelimitedText(commentNodes[0], comm
entNodes[1], nextStringText);
}
}
},
getNativeNode: function () {
var nativeNode = this._commentNodes;
if (nativeNode) {
return nativeNode;
}
if (!this._closingComment) {
var openingComment = ReactDOMComponentTree.getNodeFromInstance(thi
s);
var node = openingComment.nextSibling;
while (true) {
!(node != null) ? process.env.NODE_ENV !== 'production' ? invari
ant(false, 'Missing closing comment for text component %s', this._domID) : invar
iant(false) : void 0;
if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
this._closingComment = node;
break;
}
node = node.nextSibling;
}
}
nativeNode = [this._nativeNode, this._closingComment];
this._commentNodes = nativeNode;
return nativeNode;
},
unmountComponent: function () {
this._closingComment = null;
this._commentNodes = null;
ReactDOMComponentTree.uncacheNode(this);
}
});
ReactPerf.measureMethods(ReactDOMTextComponent.prototype, 'ReactDOMTextC
omponent', {
mountComponent: 'mountComponent',
receiveComponent: 'receiveComponent'
});
module.exports = ReactDOMTextComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 220 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDefaultBatchingStrategy
*/
'use strict';
var _assign = __webpack_require__(97);
var ReactUpdates = __webpack_require__(132);
var Transaction = __webpack_require__(135);
var emptyFunction = __webpack_require__(106);
var RESET_BATCHED_UPDATES = {
initialize: emptyFunction,
close: function () {
ReactDefaultBatchingStrategy.isBatchingUpdates = false;
}
};
var FLUSH_BATCHED_UPDATES = {
initialize: emptyFunction,
close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
};
var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES
];
function ReactDefaultBatchingStrategyTransaction() {
this.reinitializeTransaction();
}
_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.M
ixin, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
}
});
EventListener = __webpack_require__(222);
ExecutionEnvironment = __webpack_require__(91);
PooledClass = __webpack_require__(134);
ReactDOMComponentTree = __webpack_require__(113);
ReactUpdates = __webpack_require__(132);
e
* passed-in instance (for use when entire React trees are nested within
each
* other). If React trees are not nested, returns null.
*/
function findParent(inst) {
// TODO: It may be a good idea to cache this to prevent unnecessary DO
M
// traversal, but caching is difficult to do correctly without using a
// mutation observer to listen for all DOM changes.
while (inst._nativeParent) {
inst = inst._nativeParent;
}
var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
var container = rootNode.parentNode;
return ReactDOMComponentTree.getClosestInstanceFromNode(container);
}
// Used to store ancestor hierarchy in top level callback
function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
this.topLevelType = topLevelType;
this.nativeEvent = nativeEvent;
this.ancestors = [];
}
_assign(TopLevelCallbackBookKeeping.prototype, {
destructor: function () {
this.topLevelType = null;
this.nativeEvent = null;
this.ancestors.length = 0;
}
});
PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArg
umentPooler);
function handleTopLevelImpl(bookKeeping) {
var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nati
veEventTarget);
// Loop through the hierarchy, in case there's any nested components.
// It's important that we build the array of ancestors before calling
any
// event handlers, because event handlers can modify the DOM, leading
to
// inconsistencies with ReactMount's node cache. See #1105.
var ancestor = targetInst;
do {
bookKeeping.ancestors.push(ancestor);
ancestor = ancestor && findParent(ancestor);
} while (ancestor);
for (var i = 0; i < bookKeeping.ancestors.length; i++) {
targetInst = bookKeeping.ancestors[i];
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetI
nst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
}
}
function scrollValueMonitor(cb) {
var scrollPosition = getUnboundedScrollPosition(window);
cb(scrollPosition);
}
var ReactEventListener = {
_enabled: true,
_handleTopLevel: null,
WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
setHandleTopLevel: function (handleTopLevel) {
ReactEventListener._handleTopLevel = handleTopLevel;
},
setEnabled: function (enabled) {
ReactEventListener._enabled = !!enabled;
},
isEnabled: function () {
return ReactEventListener._enabled;
},
/**
* Traps top-level events by using event bubbling.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} handle Element on which to attach listener.
* @return {?object} An object with a remove function which will force
fully
*
remove the listener.
* @internal
*/
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
var element = handle;
if (!element) {
return null;
}
return EventListener.listen(element, handlerBaseName, ReactEventList
ener.dispatchEvent.bind(null, topLevelType));
},
/**
* Traps a top-level event by using event capturing.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} handle Element on which to attach listener.
* @return {?object} An object with a remove function which will force
fully
*
remove the listener.
* @internal
*/
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
var element = handle;
if (!element) {
return null;
}
return EventListener.capture(element, handlerBaseName, ReactEventLis
tener.dispatchEvent.bind(null, topLevelType));
},
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
listen: function (target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
return {
remove: function () {
target.removeEventListener(eventType, callback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent('on' + eventType, callback);
return {
remove: function () {
target.detachEvent('on' + eventType, callback);
}
};
}
},
/**
* Listen to DOM events during the capture phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
capture: function (target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, true);
return {
remove: function () {
target.removeEventListener(eventType, callback, true);
}
};
} else {
if (process.env.NODE_ENV !== 'production') {
console.error('Attempted to listen to events during the capture
phase on a ' + 'browser that does not support the capture phase. Your applicatio
n ' + 'will not receive some events.');
}
return {
remove: emptyFunction
};
}
},
registerDefault: function () {}
};
module.exports = EventListener;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 223 */
*/
'use strict';
var
var
var
var
var
var
var
var
var
var
DOMProperty = __webpack_require__(94);
EventPluginHub = __webpack_require__(102);
EventPluginUtils = __webpack_require__(103);
ReactComponentEnvironment = __webpack_require__(139);
ReactClass = __webpack_require__(154);
ReactEmptyComponent = __webpack_require__(144);
ReactBrowserEventEmitter = __webpack_require__(96);
ReactNativeComponent = __webpack_require__(145);
ReactPerf = __webpack_require__(126);
ReactUpdates = __webpack_require__(132);
var ReactInjection = {
Component: ReactComponentEnvironment.injection,
Class: ReactClass.injection,
DOMProperty: DOMProperty.injection,
EmptyComponent: ReactEmptyComponent.injection,
EventPluginHub: EventPluginHub.injection,
EventPluginUtils: EventPluginUtils.injection,
EventEmitter: ReactBrowserEventEmitter.injection,
NativeComponent: ReactNativeComponent.injection,
Perf: ReactPerf.injection,
Updates: ReactUpdates.injection
};
module.exports = ReactInjection;
/***/ },
/* 225 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactReconcileTransaction
*/
'use strict';
var _assign = __webpack_require__(97);
var
var
var
var
var
CallbackQueue = __webpack_require__(133);
PooledClass = __webpack_require__(134);
ReactBrowserEventEmitter = __webpack_require__(96);
ReactInputSelection = __webpack_require__(226);
Transaction = __webpack_require__(135);
/**
* Ensures that, when possible, the selection range (currently selected
text
this.reactMountReady.notifyAll();
}
};
/**
* Executed within the scope of the `Transaction` instance. Consider the
se as
* being member methods, but with an implied ordering while being isolat
ed from
* each other.
*/
var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON
_DOM_READY_QUEUEING];
/**
* Currently:
* - The order that these are listed in the transaction is critical:
* - Suppresses events.
* - Restores selection range.
*
* Future:
* - Restore document/overflow scroll positions that were unintentionall
y
* modified via DOM insertions above the top viewport boundary.
* - Implement/integrate with customized constraint based layout system
and keep
* track of which dimensions must be remeasured.
*
* @class ReactReconcileTransaction
*/
function ReactReconcileTransaction(useCreateElement) {
this.reinitializeTransaction();
// Only server-side rendering really needs this option (see
// `ReactServerRendering`), but server-side uses
// `ReactServerRenderingTransaction` instead. This option is here so t
hat it's
// accessible and defaults to false when `ReactDOMComponent` and
// `ReactTextComponent` checks it in `mountComponent`.`
this.renderToStaticMarkup = false;
this.reactMountReady = CallbackQueue.getPooled(null);
this.useCreateElement = useCreateElement;
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array<object>} List of operation wrap procedures.
* TODO: convert to array<TransactionWrapper>
*/
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function () {
return this.reactMountReady;
},
/**
* Save current transaction state -- if the return value from this met
hod is
* passed to `rollback`, the transaction will be reset to that state.
*/
checkpoint: function () {
// reactMountReady is the our only stateful wrapper
return this.reactMountReady.checkpoint();
},
rollback: function (checkpoint) {
this.reactMountReady.rollback(checkpoint);
},
/**
* `PooledClass` looks for this, and will invoke this before allowing
this
* instance to be reused.
*/
destructor: function () {
CallbackQueue.release(this.reactMountReady);
this.reactMountReady = null;
}
};
_assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
PooledClass.addPoolingTo(ReactReconcileTransaction);
module.exports = ReactReconcileTransaction;
/***/ },
/* 226 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactInputSelection
*/
'use strict';
var ReactDOMSelection = __webpack_require__(227);
var containsNode = __webpack_require__(229);
var focusNode = __webpack_require__(191);
var getActiveElement = __webpack_require__(232);
function isInDocument(node) {
return containsNode(document.documentElement, node);
}
/**
* @ReactInputSelection: React input selection module. Based on Selectio
n.js,
* but modified to be suitable for react and has a couple of bug fixes (
doesn't
* assume buttons have range selections allowed).
* Input selection module for React.
*/
var ReactInputSelection = {
hasSelectionCapabilities: function (elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
return nodeName && (nodeName === 'input' && elem.type === 'text' ||
nodeName === 'textarea' || elem.contentEditable === 'true');
},
getSelectionInformation: function () {
var focusedElem = getActiveElement();
return {
focusedElem: focusedElem,
selectionRange: ReactInputSelection.hasSelectionCapabilities(focus
edElem) ? ReactInputSelection.getSelection(focusedElem) : null
};
},
/**
* @restoreSelection: If any selection information was potentially los
t,
* restore it. This is useful when performing operations that could re
move dom
* nodes and place them back in, resulting in focus being lost.
*/
restoreSelection: function (priorSelectionInformation) {
var curFocusedElem = getActiveElement();
var priorFocusedElem = priorSelectionInformation.focusedElem;
var priorSelectionRange = priorSelectionInformation.selectionRange;
if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocused
Elem)) {
if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)
) {
ReactInputSelection.setSelection(priorFocusedElem, priorSelectio
nRange);
}
focusNode(priorFocusedElem);
}
},
/**
* @getSelection: Gets the selection bounds of a focused textarea, inp
ut or
* contentEditable node.
* -@input: Look up selection bounds of this input
* -@return {start: selectionStart, end: selectionEnd}
*/
getSelection: function (input) {
var selection;
if ('selectionStart' in input) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDOMSelection
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(91);
var getNodeForCharacterOffset = __webpack_require__(228);
var getTextContentAccessor = __webpack_require__(168);
/**
* While `isCollapsed` is available on the Selection object and `collaps
ed`
* is available on the Range object, IE11 sometimes gets them wrong.
* If the anchor/focus nodes and offsets are the same, the range is coll
apsed.
*/
function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
return anchorNode === focusNode && anchorOffset === focusOffset;
}
/**
* Get the appropriate anchor and focus node/offset pairs for IE.
*
* The catch here is that IE's selection API doesn't provide information
* about whether the selection is forward or backward, so we have to
* behave as though it's always forward.
*
* IE text differs from modern selection in that it behaves as though
* block elements end with a new line. This means character offsets will
* differ between the two APIs.
*
* @param {DOMElement} node
* @return {object}
*/
function getIEOffsets(node) {
var selection = document.selection;
var selectedRange = selection.createRange();
var selectedLength = selectedRange.text.length;
// Duplicate selection so we can move range without breaking user sele
ction.
var fromStart = selectedRange.duplicate();
fromStart.moveToElementText(node);
fromStart.setEndPoint('EndToStart', selectedRange);
var startOffset = fromStart.text.length;
var endOffset = startOffset + selectedLength;
return {
start: startOffset,
end: endOffset
};
}
/**
* @param {DOMElement} node
* @return {?object}
*/
function getModernOffsets(node) {
var selection = window.getSelection && window.getSelection();
if (!selection || selection.rangeCount === 0) {
return null;
}
var
var
var
var
anchorNode = selection.anchorNode;
anchorOffset = selection.anchorOffset;
focusNode = selection.focusNode;
focusOffset = selection.focusOffset;
);
var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempR
ange.startOffset, tempRange.endContainer, tempRange.endOffset);
var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
var end = start + rangeLength;
// Detect whether the selection is backward.
var detectionRange = document.createRange();
detectionRange.setStart(anchorNode, anchorOffset);
detectionRange.setEnd(focusNode, focusOffset);
var isBackward = detectionRange.collapsed;
return {
start: isBackward ? end : start,
end: isBackward ? start : end
};
}
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setIEOffsets(node, offsets) {
var range = document.selection.createRange().duplicate();
var start, end;
if (offsets.end === undefined) {
start = offsets.start;
end = start;
} else if (offsets.start > offsets.end) {
start = offsets.end;
end = offsets.start;
} else {
start = offsets.start;
end = offsets.end;
}
range.moveToElementText(node);
range.moveStart('character', start);
range.setEndPoint('EndToStart', range);
range.moveEnd('character', end - start);
range.select();
}
/**
* In modern non-IE browsers, we can support both forward and backward
* selections.
*
* Note: IE10+ supports the Selection object, but it does not support
* the `extend` method, which means that even in modern IE, it's not pos
sible
* to programmatically create a backward selection. Thus, for all IE
* versions, we use the old IE API to create our selections.
*
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setModernOffsets(node, offsets) {
if (!window.getSelection) {
return;
}
var
var
var
var
selection = window.getSelection();
length = node[getTextContentAccessor()].length;
start = Math.min(offsets.start, length);
end = offsets.end === undefined ? start : Math.min(offsets.end, le
ngth);
// IE 11 uses modern selection, but doesn't support the extend method.
// Flip backward selections, so we can set with a single range.
if (!selection.extend && start > end) {
var temp = end;
end = start;
start = temp;
}
var startMarker = getNodeForCharacterOffset(node, start);
var endMarker = getNodeForCharacterOffset(node, end);
if (startMarker && endMarker) {
var range = document.createRange();
range.setStart(startMarker.node, startMarker.offset);
selection.removeAllRanges();
if (start > end) {
selection.addRange(range);
selection.extend(endMarker.node, endMarker.offset);
} else {
range.setEnd(endMarker.node, endMarker.offset);
selection.addRange(range);
}
}
}
var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in docu
ment && !('getSelection' in window);
var ReactDOMSelection = {
/**
* @param {DOMElement} node
*/
getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
};
module.exports = ReactDOMSelection;
/***/ },
/* 228 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
return {
node: node,
offset: offset - nodeStart
};
}
nodeStart = nodeEnd;
}
node = getLeafNode(getSiblingNode(node));
}
}
module.exports = getNodeForCharacterOffset;
/***/ },
/* 229 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks
*/
var isTextNode = __webpack_require__(230);
/*eslint-disable no-bitwise */
/**
* Checks if a given DOM node contains or is another DOM node.
*
* @param {?DOMNode} outerNode Outer DOM node.
* @param {?DOMNode} innerNode Inner DOM node.
* @return {boolean} True if `outerNode` contains or is `innerNode`.
*/
function containsNode(outerNode, innerNode) {
if (!outerNode || !innerNode) {
return false;
} else if (outerNode === innerNode) {
return true;
} else if (isTextNode(outerNode)) {
return false;
} else if (isTextNode(innerNode)) {
return containsNode(outerNode, innerNode.parentNode);
} else if (outerNode.contains) {
return outerNode.contains(innerNode);
} else if (outerNode.compareDocumentPosition) {
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
} else {
return false;
}
}
module.exports = containsNode;
/***/ },
/* 230 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks
*/
var isNode = __webpack_require__(231);
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM text node.
*/
function isTextNode(object) {
return isNode(object) && object.nodeType == 3;
}
module.exports = isTextNode;
/***/ },
/* 231 */
/***/ function(module, exports) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
function isNode(object) {
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SVGDOMPropertyConfig
*/
'use strict';
var NS = {
xlink: 'http://www.w3.org/1999/xlink',
xml: 'http://www.w3.org/XML/1998/namespace'
};
// We use attributes for everything SVG so let's avoid some duplication
and run
// code instead.
// The following are all specified in the HTML config already so we excl
ude here.
// - class (as className)
// - color
// - height
// - id
// - lang
// - max
// - media
// - method
// - min
// - name
// - style
// - target
// - type
// - width
var ATTRS = {
accentHeight: 'accent-height',
accumulate: 0,
additive: 0,
alignmentBaseline: 'alignment-baseline',
allowReorder: 'allowReorder',
alphabetic: 0,
amplitude: 0,
arabicForm: 'arabic-form',
ascent: 0,
attributeName: 'attributeName',
attributeType: 'attributeType',
autoReverse: 'autoReverse',
azimuth: 0,
baseFrequency: 'baseFrequency',
baseProfile: 'baseProfile',
baselineShift: 'baseline-shift',
bbox: 0,
begin: 0,
bias: 0,
by: 0,
calcMode: 'calcMode',
capHeight: 'cap-height',
clip: 0,
clipPath: 'clip-path',
clipRule: 'clip-rule',
clipPathUnits: 'clipPathUnits',
colorInterpolation: 'color-interpolation',
colorInterpolationFilters: 'color-interpolation-filters',
colorProfile: 'color-profile',
colorRendering: 'color-rendering',
contentScriptType: 'contentScriptType',
contentStyleType: 'contentStyleType',
cursor: 0,
cx: 0,
cy: 0,
d: 0,
decelerate: 0,
descent: 0,
diffuseConstant: 'diffuseConstant',
direction: 0,
display: 0,
divisor: 0,
dominantBaseline: 'dominant-baseline',
dur: 0,
dx: 0,
dy: 0,
edgeMode: 'edgeMode',
elevation: 0,
enableBackground: 'enable-background',
end: 0,
exponent: 0,
externalResourcesRequired: 'externalResourcesRequired',
fill: 0,
fillOpacity: 'fill-opacity',
fillRule: 'fill-rule',
filter: 0,
filterRes: 'filterRes',
filterUnits: 'filterUnits',
floodColor: 'flood-color',
floodOpacity: 'flood-opacity',
focusable: 0,
fontFamily: 'font-family',
fontSize: 'font-size',
fontSizeAdjust: 'font-size-adjust',
fontStretch: 'font-stretch',
fontStyle: 'font-style',
fontVariant: 'font-variant',
fontWeight: 'font-weight',
format: 0,
from: 0,
fx: 0,
fy: 0,
g1: 0,
g2: 0,
glyphName: 'glyph-name',
glyphOrientationHorizontal: 'glyph-orientation-horizontal',
glyphOrientationVertical: 'glyph-orientation-vertical',
glyphRef: 'glyphRef',
gradientTransform: 'gradientTransform',
gradientUnits: 'gradientUnits',
hanging: 0,
horizAdvX: 'horiz-adv-x',
horizOriginX: 'horiz-origin-x',
ideographic: 0,
imageRendering: 'image-rendering',
'in': 0,
in2: 0,
intercept: 0,
k: 0,
k1: 0,
k2: 0,
k3: 0,
k4: 0,
kernelMatrix: 'kernelMatrix',
kernelUnitLength: 'kernelUnitLength',
kerning: 0,
keyPoints: 'keyPoints',
keySplines: 'keySplines',
keyTimes: 'keyTimes',
lengthAdjust: 'lengthAdjust',
letterSpacing: 'letter-spacing',
lightingColor: 'lighting-color',
limitingConeAngle: 'limitingConeAngle',
local: 0,
markerEnd: 'marker-end',
markerMid: 'marker-mid',
markerStart: 'marker-start',
markerHeight: 'markerHeight',
markerUnits: 'markerUnits',
markerWidth: 'markerWidth',
mask: 0,
maskContentUnits: 'maskContentUnits',
maskUnits: 'maskUnits',
mathematical: 0,
mode: 0,
numOctaves: 'numOctaves',
offset: 0,
opacity: 0,
operator: 0,
order: 0,
orient: 0,
orientation: 0,
origin: 0,
overflow: 0,
overlinePosition: 'overline-position',
overlineThickness: 'overline-thickness',
paintOrder: 'paint-order',
panose1: 'panose-1',
pathLength: 'pathLength',
patternContentUnits: 'patternContentUnits',
patternTransform: 'patternTransform',
patternUnits: 'patternUnits',
pointerEvents: 'pointer-events',
points: 0,
pointsAtX: 'pointsAtX',
pointsAtY: 'pointsAtY',
pointsAtZ: 'pointsAtZ',
preserveAlpha: 'preserveAlpha',
preserveAspectRatio: 'preserveAspectRatio',
primitiveUnits: 'primitiveUnits',
r: 0,
radius: 0,
refX: 'refX',
refY: 'refY',
renderingIntent: 'rendering-intent',
repeatCount: 'repeatCount',
repeatDur: 'repeatDur',
requiredExtensions: 'requiredExtensions',
requiredFeatures: 'requiredFeatures',
restart: 0,
result: 0,
rotate: 0,
rx: 0,
ry: 0,
scale: 0,
seed: 0,
shapeRendering: 'shape-rendering',
slope: 0,
spacing: 0,
specularConstant: 'specularConstant',
specularExponent: 'specularExponent',
speed: 0,
spreadMethod: 'spreadMethod',
startOffset: 'startOffset',
stdDeviation: 'stdDeviation',
stemh: 0,
stemv: 0,
stitchTiles: 'stitchTiles',
stopColor: 'stop-color',
stopOpacity: 'stop-opacity',
strikethroughPosition: 'strikethrough-position',
strikethroughThickness: 'strikethrough-thickness',
string: 0,
stroke: 0,
strokeDasharray: 'stroke-dasharray',
strokeDashoffset: 'stroke-dashoffset',
strokeLinecap: 'stroke-linecap',
strokeLinejoin: 'stroke-linejoin',
strokeMiterlimit: 'stroke-miterlimit',
strokeOpacity: 'stroke-opacity',
strokeWidth: 'stroke-width',
surfaceScale: 'surfaceScale',
systemLanguage: 'systemLanguage',
tableValues: 'tableValues',
targetX: 'targetX',
targetY: 'targetY',
textAnchor: 'text-anchor',
textDecoration: 'text-decoration',
textRendering: 'text-rendering',
textLength: 'textLength',
to: 0,
transform: 0,
u1: 0,
u2: 0,
underlinePosition: 'underline-position',
underlineThickness: 'underline-thickness',
unicode: 0,
unicodeBidi: 'unicode-bidi',
unicodeRange: 'unicode-range',
unitsPerEm: 'units-per-em',
vAlphabetic: 'v-alphabetic',
vHanging: 'v-hanging',
vIdeographic: 'v-ideographic',
vMathematical: 'v-mathematical',
values: 0,
vectorEffect: 'vector-effect',
version: 0,
vertAdvY: 'vert-adv-y',
vertOriginX: 'vert-origin-x',
vertOriginY: 'vert-origin-y',
viewBox: 'viewBox',
viewTarget: 'viewTarget',
visibility: 0,
widths: 0,
wordSpacing: 'word-spacing',
writingMode: 'writing-mode',
x: 0,
xHeight: 'x-height',
x1: 0,
x2: 0,
xChannelSelector: 'xChannelSelector',
xlinkActuate: 'xlink:actuate',
xlinkArcrole: 'xlink:arcrole',
xlinkHref: 'xlink:href',
xlinkRole: 'xlink:role',
xlinkShow: 'xlink:show',
xlinkTitle: 'xlink:title',
xlinkType: 'xlink:type',
xmlBase: 'xml:base',
xmlLang: 'xml:lang',
xmlSpace: 'xml:space',
y: 0,
y1: 0,
y2: 0,
yChannelSelector: 'yChannelSelector',
z: 0,
zoomAndPan: 'zoomAndPan'
};
var SVGDOMPropertyConfig = {
Properties: {},
DOMAttributeNamespaces: {
xlinkActuate: NS.xlink,
xlinkArcrole: NS.xlink,
xlinkHref: NS.xlink,
xlinkRole: NS.xlink,
xlinkShow: NS.xlink,
xlinkTitle: NS.xlink,
xlinkType: NS.xlink,
xmlBase: NS.xml,
xmlLang: NS.xml,
xmlSpace: NS.xml
},
DOMAttributeNames: {}
};
Object.keys(ATTRS).forEach(function (key) {
SVGDOMPropertyConfig.Properties[key] = 0;
if (ATTRS[key]) {
SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
}
});
module.exports = SVGDOMPropertyConfig;
/***/ },
/* 234 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SelectEventPlugin
*/
'use strict';
var
var
var
var
var
var
EventConstants = __webpack_require__(98);
EventPropagators = __webpack_require__(166);
ExecutionEnvironment = __webpack_require__(91);
ReactDOMComponentTree = __webpack_require__(113);
ReactInputSelection = __webpack_require__(226);
SyntheticEvent = __webpack_require__(170);
var
var
var
var
getActiveElement = __webpack_require__(232);
isTextInputElement = __webpack_require__(174);
keyOf = __webpack_require__(155);
shallowEqual = __webpack_require__(216);
activeElement = null;
activeElementInst = null;
lastSelection = null;
mouseDown = false;
*
* The return value will not be consistent across nodes or browsers, but
* two identical selections on the same node will return identical objec
ts.
*
* @param {DOMElement} node
* @return {object}
*/
function getSelection(node) {
if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabi
lities(node)) {
return {
start: node.selectionStart,
end: node.selectionEnd
};
} else if (window.getSelection) {
var selection = window.getSelection();
return {
anchorNode: selection.anchorNode,
anchorOffset: selection.anchorOffset,
focusNode: selection.focusNode,
focusOffset: selection.focusOffset
};
} else if (document.selection) {
var range = document.selection.createRange();
return {
parentElement: range.parentElement(),
text: range.text,
top: range.boundingTop,
left: range.boundingLeft
};
}
}
/**
* Poll selection to see whether it's changed.
*
* @param {object} nativeEvent
* @return {?SyntheticEvent}
*/
function constructSelectEvent(nativeEvent, nativeEventTarget) {
// Ensure we have the right element, and that the user is not dragging
a
// selection (this matches native `select` event behavior). In HTML5,
select
// fires only on input and textarea thus if there's no focused element
we
// won't dispatch.
if (mouseDown || activeElement == null || activeElement !== getActiveE
lement()) {
return null;
}
// Only fire when selection has actually changed.
var currentSelection = getSelection(activeElement);
if (!lastSelection || !shallowEqual(lastSelection, currentSelection))
{
lastSelection = currentSelection;
var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, act
case topLevelTypes.topMouseDown:
mouseDown = true;
break;
case topLevelTypes.topContextMenu:
case topLevelTypes.topMouseUp:
mouseDown = false;
return constructSelectEvent(nativeEvent, nativeEventTarget);
// Chrome and IE fire non-standard event when selection is changed
(and
// sometimes when it hasn't). IE's event fires out of order with r
espect
// to key and input events on deletion, so we discard it.
//
// Firefox doesn't support selectionchange, so check selection sta
tus
// after each key entry. The selection changes after keydown and b
efore
// keyup, but we check on keydown as well in the case of holding d
own a
// key, when multiple keydown events are fired but only one keyup
is.
// This is also our approach for IE handling, for the reason above
.
case topLevelTypes.topSelectionChange:
if (skipSelectionChangeEvent) {
break;
}
// falls through
case topLevelTypes.topKeyDown:
case topLevelTypes.topKeyUp:
return constructSelectEvent(nativeEvent, nativeEventTarget);
}
return null;
},
didPutListener: function (inst, registrationName, listener) {
if (registrationName === ON_SELECT_KEY) {
hasListener = true;
}
}
};
module.exports = SelectEventPlugin;
/***/ },
/* 235 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SimpleEventPlugin
*/
'use strict';
var
var
var
var
var
var
var
var
var
var
var
var
var
var
var
EventConstants = __webpack_require__(98);
EventListener = __webpack_require__(222);
EventPropagators = __webpack_require__(166);
ReactDOMComponentTree = __webpack_require__(113);
SyntheticAnimationEvent = __webpack_require__(236);
SyntheticClipboardEvent = __webpack_require__(237);
SyntheticEvent = __webpack_require__(170);
SyntheticFocusEvent = __webpack_require__(238);
SyntheticKeyboardEvent = __webpack_require__(239);
SyntheticMouseEvent = __webpack_require__(177);
SyntheticDragEvent = __webpack_require__(242);
SyntheticTouchEvent = __webpack_require__(243);
SyntheticTransitionEvent = __webpack_require__(244);
SyntheticUIEvent = __webpack_require__(178);
SyntheticWheelEvent = __webpack_require__(245);
var
var
var
var
emptyFunction = __webpack_require__(106);
getEventCharCode = __webpack_require__(240);
invariant = __webpack_require__(95);
keyOf = __webpack_require__(155);
phasedRegistrationNames: {
bubbled: keyOf({ onCanPlay: true }),
captured: keyOf({ onCanPlayCapture: true })
}
},
canPlayThrough: {
phasedRegistrationNames: {
bubbled: keyOf({ onCanPlayThrough: true }),
captured: keyOf({ onCanPlayThroughCapture: true })
}
},
click: {
phasedRegistrationNames: {
bubbled: keyOf({ onClick: true }),
captured: keyOf({ onClickCapture: true })
}
},
contextMenu: {
phasedRegistrationNames: {
bubbled: keyOf({ onContextMenu: true }),
captured: keyOf({ onContextMenuCapture: true })
}
},
copy: {
phasedRegistrationNames: {
bubbled: keyOf({ onCopy: true }),
captured: keyOf({ onCopyCapture: true })
}
},
cut: {
phasedRegistrationNames: {
bubbled: keyOf({ onCut: true }),
captured: keyOf({ onCutCapture: true })
}
},
doubleClick: {
phasedRegistrationNames: {
bubbled: keyOf({ onDoubleClick: true }),
captured: keyOf({ onDoubleClickCapture: true })
}
},
drag: {
phasedRegistrationNames: {
bubbled: keyOf({ onDrag: true }),
captured: keyOf({ onDragCapture: true })
}
},
dragEnd: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragEnd: true }),
captured: keyOf({ onDragEndCapture: true })
}
},
dragEnter: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragEnter: true }),
captured: keyOf({ onDragEnterCapture: true })
}
},
dragExit: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragExit: true }),
captured: keyOf({ onDragExitCapture: true })
}
},
dragLeave: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragLeave: true }),
captured: keyOf({ onDragLeaveCapture: true })
}
},
dragOver: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragOver: true }),
captured: keyOf({ onDragOverCapture: true })
}
},
dragStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onDragStart: true }),
captured: keyOf({ onDragStartCapture: true })
}
},
drop: {
phasedRegistrationNames: {
bubbled: keyOf({ onDrop: true }),
captured: keyOf({ onDropCapture: true })
}
},
durationChange: {
phasedRegistrationNames: {
bubbled: keyOf({ onDurationChange: true }),
captured: keyOf({ onDurationChangeCapture: true })
}
},
emptied: {
phasedRegistrationNames: {
bubbled: keyOf({ onEmptied: true }),
captured: keyOf({ onEmptiedCapture: true })
}
},
encrypted: {
phasedRegistrationNames: {
bubbled: keyOf({ onEncrypted: true }),
captured: keyOf({ onEncryptedCapture: true })
}
},
ended: {
phasedRegistrationNames: {
bubbled: keyOf({ onEnded: true }),
captured: keyOf({ onEndedCapture: true })
}
},
error: {
phasedRegistrationNames: {
bubbled: keyOf({ onError: true }),
captured: keyOf({ onErrorCapture: true })
}
},
focus: {
phasedRegistrationNames: {
bubbled: keyOf({ onFocus: true }),
captured: keyOf({ onFocusCapture: true })
}
},
input: {
phasedRegistrationNames: {
bubbled: keyOf({ onInput: true }),
captured: keyOf({ onInputCapture: true })
}
},
invalid: {
phasedRegistrationNames: {
bubbled: keyOf({ onInvalid: true }),
captured: keyOf({ onInvalidCapture: true })
}
},
keyDown: {
phasedRegistrationNames: {
bubbled: keyOf({ onKeyDown: true }),
captured: keyOf({ onKeyDownCapture: true })
}
},
keyPress: {
phasedRegistrationNames: {
bubbled: keyOf({ onKeyPress: true }),
captured: keyOf({ onKeyPressCapture: true })
}
},
keyUp: {
phasedRegistrationNames: {
bubbled: keyOf({ onKeyUp: true }),
captured: keyOf({ onKeyUpCapture: true })
}
},
load: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoad: true }),
captured: keyOf({ onLoadCapture: true })
}
},
loadedData: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoadedData: true }),
captured: keyOf({ onLoadedDataCapture: true })
}
},
loadedMetadata: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoadedMetadata: true }),
captured: keyOf({ onLoadedMetadataCapture: true })
}
},
loadStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onLoadStart: true }),
captured: keyOf({ onLoadStartCapture: true })
}
},
// Note: We do not allow listening to mouseOver events. Instead, use t
he
// onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
mouseDown: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseDown: true }),
captured: keyOf({ onMouseDownCapture: true })
}
},
mouseMove: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseMove: true }),
captured: keyOf({ onMouseMoveCapture: true })
}
},
mouseOut: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseOut: true }),
captured: keyOf({ onMouseOutCapture: true })
}
},
mouseOver: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseOver: true }),
captured: keyOf({ onMouseOverCapture: true })
}
},
mouseUp: {
phasedRegistrationNames: {
bubbled: keyOf({ onMouseUp: true }),
captured: keyOf({ onMouseUpCapture: true })
}
},
paste: {
phasedRegistrationNames: {
bubbled: keyOf({ onPaste: true }),
captured: keyOf({ onPasteCapture: true })
}
},
pause: {
phasedRegistrationNames: {
bubbled: keyOf({ onPause: true }),
captured: keyOf({ onPauseCapture: true })
}
},
play: {
phasedRegistrationNames: {
bubbled: keyOf({ onPlay: true }),
captured: keyOf({ onPlayCapture: true })
}
},
playing: {
phasedRegistrationNames: {
bubbled: keyOf({ onPlaying: true }),
captured: keyOf({ onPlayingCapture: true })
}
},
progress: {
phasedRegistrationNames: {
bubbled: keyOf({ onProgress: true }),
captured: keyOf({ onProgressCapture: true })
}
},
rateChange: {
phasedRegistrationNames: {
bubbled: keyOf({ onRateChange: true }),
captured: keyOf({ onRateChangeCapture: true })
}
},
reset: {
phasedRegistrationNames: {
bubbled: keyOf({ onReset: true }),
captured: keyOf({ onResetCapture: true })
}
},
scroll: {
phasedRegistrationNames: {
bubbled: keyOf({ onScroll: true }),
captured: keyOf({ onScrollCapture: true })
}
},
seeked: {
phasedRegistrationNames: {
bubbled: keyOf({ onSeeked: true }),
captured: keyOf({ onSeekedCapture: true })
}
},
seeking: {
phasedRegistrationNames: {
bubbled: keyOf({ onSeeking: true }),
captured: keyOf({ onSeekingCapture: true })
}
},
stalled: {
phasedRegistrationNames: {
bubbled: keyOf({ onStalled: true }),
captured: keyOf({ onStalledCapture: true })
}
},
submit: {
phasedRegistrationNames: {
bubbled: keyOf({ onSubmit: true }),
captured: keyOf({ onSubmitCapture: true })
}
},
suspend: {
phasedRegistrationNames: {
bubbled: keyOf({ onSuspend: true }),
captured: keyOf({ onSuspendCapture: true })
}
},
timeUpdate: {
phasedRegistrationNames: {
bubbled: keyOf({ onTimeUpdate: true }),
captured: keyOf({ onTimeUpdateCapture: true })
}
},
touchCancel: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchCancel: true }),
captured: keyOf({ onTouchCancelCapture: true })
}
},
touchEnd: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchEnd: true }),
captured: keyOf({ onTouchEndCapture: true })
}
},
touchMove: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchMove: true }),
captured: keyOf({ onTouchMoveCapture: true })
}
},
touchStart: {
phasedRegistrationNames: {
bubbled: keyOf({ onTouchStart: true }),
captured: keyOf({ onTouchStartCapture: true })
}
},
transitionEnd: {
phasedRegistrationNames: {
bubbled: keyOf({ onTransitionEnd: true }),
captured: keyOf({ onTransitionEndCapture: true })
}
},
volumeChange: {
phasedRegistrationNames: {
bubbled: keyOf({ onVolumeChange: true }),
captured: keyOf({ onVolumeChangeCapture: true })
}
},
waiting: {
phasedRegistrationNames: {
bubbled: keyOf({ onWaiting: true }),
captured: keyOf({ onWaitingCapture: true })
}
},
wheel: {
phasedRegistrationNames: {
bubbled: keyOf({ onWheel: true }),
captured: keyOf({ onWheelCapture: true })
}
}
};
var topLevelEventsToDispatchConfig = {
topAbort: eventTypes.abort,
topAnimationEnd: eventTypes.animationEnd,
topAnimationIteration: eventTypes.animationIteration,
topAnimationStart: eventTypes.animationStart,
topBlur: eventTypes.blur,
topCanPlay: eventTypes.canPlay,
topCanPlayThrough: eventTypes.canPlayThrough,
topClick: eventTypes.click,
topContextMenu: eventTypes.contextMenu,
topCopy: eventTypes.copy,
topCut: eventTypes.cut,
topDoubleClick: eventTypes.doubleClick,
topDrag: eventTypes.drag,
topDragEnd: eventTypes.dragEnd,
topDragEnter: eventTypes.dragEnter,
topDragExit: eventTypes.dragExit,
topDragLeave: eventTypes.dragLeave,
topDragOver: eventTypes.dragOver,
topDragStart: eventTypes.dragStart,
topDrop: eventTypes.drop,
topDurationChange: eventTypes.durationChange,
topEmptied: eventTypes.emptied,
topEncrypted: eventTypes.encrypted,
topEnded: eventTypes.ended,
topError: eventTypes.error,
topFocus: eventTypes.focus,
topInput: eventTypes.input,
topInvalid: eventTypes.invalid,
topKeyDown: eventTypes.keyDown,
topKeyPress: eventTypes.keyPress,
topKeyUp: eventTypes.keyUp,
topLoad: eventTypes.load,
topLoadedData: eventTypes.loadedData,
topLoadedMetadata: eventTypes.loadedMetadata,
topLoadStart: eventTypes.loadStart,
topMouseDown: eventTypes.mouseDown,
topMouseMove: eventTypes.mouseMove,
topMouseOut: eventTypes.mouseOut,
topMouseOver: eventTypes.mouseOver,
topMouseUp: eventTypes.mouseUp,
topPaste: eventTypes.paste,
topPause: eventTypes.pause,
topPlay: eventTypes.play,
topPlaying: eventTypes.playing,
topProgress: eventTypes.progress,
topRateChange: eventTypes.rateChange,
topReset: eventTypes.reset,
topScroll: eventTypes.scroll,
topSeeked: eventTypes.seeked,
topSeeking: eventTypes.seeking,
topStalled: eventTypes.stalled,
topSubmit: eventTypes.submit,
topSuspend: eventTypes.suspend,
topTimeUpdate: eventTypes.timeUpdate,
topTouchCancel: eventTypes.touchCancel,
topTouchEnd: eventTypes.touchEnd,
topTouchMove: eventTypes.touchMove,
topTouchStart: eventTypes.touchStart,
topTransitionEnd: eventTypes.transitionEnd,
topVolumeChange: eventTypes.volumeChange,
topWaiting: eventTypes.waiting,
topWheel: eventTypes.wheel
};
for (var type in topLevelEventsToDispatchConfig) {
topLevelEventsToDispatchConfig[type].dependencies = [type];
}
var ON_CLICK_KEY = keyOf({ onClick: null });
var onClickListeners = {};
var SimpleEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, native
EventTarget) {
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
if (!dispatchConfig) {
return null;
}
var EventConstructor;
switch (topLevelType) {
case topLevelTypes.topAbort:
case topLevelTypes.topCanPlay:
case topLevelTypes.topCanPlayThrough:
case topLevelTypes.topDurationChange:
case topLevelTypes.topEmptied:
case topLevelTypes.topEncrypted:
case topLevelTypes.topEnded:
case topLevelTypes.topError:
case topLevelTypes.topInput:
case topLevelTypes.topInvalid:
case topLevelTypes.topLoad:
case topLevelTypes.topLoadedData:
case topLevelTypes.topLoadedMetadata:
case topLevelTypes.topLoadStart:
case topLevelTypes.topPause:
case topLevelTypes.topPlay:
case topLevelTypes.topPlaying:
case topLevelTypes.topProgress:
case topLevelTypes.topRateChange:
case topLevelTypes.topReset:
case topLevelTypes.topSeeked:
case topLevelTypes.topSeeking:
case topLevelTypes.topStalled:
case topLevelTypes.topSubmit:
case topLevelTypes.topSuspend:
case topLevelTypes.topTimeUpdate:
case topLevelTypes.topVolumeChange:
case topLevelTypes.topWaiting:
// HTML Events
// @see http://www.w3.org/TR/html5/index.html#events-0
EventConstructor = SyntheticEvent;
break;
case topLevelTypes.topKeyPress:
// Firefox creates a keypress event for function keys too. This
removes
// the unwanted keypress events. Enter is however both printable
and
// non-printable. One would expect Tab to be as well (but it isn
't).
if (getEventCharCode(nativeEvent) === 0) {
return null;
}
/* falls through */
case topLevelTypes.topKeyDown:
case topLevelTypes.topKeyUp:
EventConstructor = SyntheticKeyboardEvent;
break;
case topLevelTypes.topBlur:
case topLevelTypes.topFocus:
EventConstructor = SyntheticFocusEvent;
break;
case topLevelTypes.topClick:
// Firefox creates a click event on right mouse clicks. This rem
oves the
// unwanted click events.
if (nativeEvent.button === 2) {
return null;
}
/* falls through */
case topLevelTypes.topContextMenu:
case topLevelTypes.topDoubleClick:
case topLevelTypes.topMouseDown:
case topLevelTypes.topMouseMove:
case topLevelTypes.topMouseOut:
case topLevelTypes.topMouseOver:
case topLevelTypes.topMouseUp:
EventConstructor = SyntheticMouseEvent;
break;
case topLevelTypes.topDrag:
case topLevelTypes.topDragEnd:
case topLevelTypes.topDragEnter:
case topLevelTypes.topDragExit:
case topLevelTypes.topDragLeave:
case topLevelTypes.topDragOver:
case topLevelTypes.topDragStart:
case topLevelTypes.topDrop:
EventConstructor = SyntheticDragEvent;
break;
case topLevelTypes.topTouchCancel:
case topLevelTypes.topTouchEnd:
case topLevelTypes.topTouchMove:
case topLevelTypes.topTouchStart:
EventConstructor = SyntheticTouchEvent;
break;
case topLevelTypes.topAnimationEnd:
case topLevelTypes.topAnimationIteration:
case topLevelTypes.topAnimationStart:
EventConstructor = SyntheticAnimationEvent;
break;
case topLevelTypes.topTransitionEnd:
EventConstructor = SyntheticTransitionEvent;
break;
case topLevelTypes.topScroll:
EventConstructor = SyntheticUIEvent;
break;
case topLevelTypes.topWheel:
EventConstructor = SyntheticWheelEvent;
break;
case topLevelTypes.topCopy:
case topLevelTypes.topCut:
case topLevelTypes.topPaste:
EventConstructor = SyntheticClipboardEvent;
break;
}
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invarian
t(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invar
iant(false) : void 0;
var event = EventConstructor.getPooled(dispatchConfig, targetInst, n
ativeEvent, nativeEventTarget);
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
},
didPutListener: function (inst, registrationName, listener) {
// Mobile Safari does not fire properly bubble click events on
// non-interactive elements, which means delegated click listeners d
o not
// fire. The workaround for this bug involves attaching an empty cli
ck
// listener on the target node.
if (registrationName === ON_CLICK_KEY) {
var id = inst._rootNodeID;
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
if (!onClickListeners[id]) {
onClickListeners[id] = EventListener.listen(node, 'click', empty
Function);
}
}
},
willDeleteListener: function (inst, registrationName) {
if (registrationName === ON_CLICK_KEY) {
var id = inst._rootNodeID;
onClickListeners[id].remove();
delete onClickListeners[id];
}
}
};
module.exports = SimpleEventPlugin;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 236 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticAnimationEvent
*/
'use strict';
var SyntheticEvent = __webpack_require__(170);
/**
* @interface Event
* @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
*/
var AnimationEventInterface = {
animationName: null,
elapsedTime: null,
pseudoElement: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeE
vent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativ
eEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInter
face);
module.exports = SyntheticAnimationEvent;
/***/ },
/* 237 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticClipboardEvent
*/
'use strict';
var SyntheticEvent = __webpack_require__(170);
/**
* @interface Event
* @see http://www.w3.org/TR/clipboard-apis/
*/
var ClipboardEventInterface = {
clipboardData: function (event) {
return 'clipboardData' in event ? event.clipboardData : window.clipb
oardData;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeE
vent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativ
eEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInter
face);
module.exports = SyntheticClipboardEvent;
/***/ },
/* 238 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticFocusEvent
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(178);
/**
* @interface FocusEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var FocusEventInterface = {
relatedTarget: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent
, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nat
iveEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
module.exports = SyntheticFocusEvent;
/***/ },
/* 239 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticKeyboardEvent
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(178);
var getEventCharCode = __webpack_require__(240);
var getEventKey = __webpack_require__(241);
var getEventModifierState = __webpack_require__(179);
/**
* @interface KeyboardEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var KeyboardEventInterface = {
key: getEventKey,
location: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
repeat: null,
locale: null,
getModifierState: getEventModifierState,
// Legacy Interface
charCode: function (event) {
// `charCode` is the result of a KeyPress event and represents the v
alue of
// the actual printable character.
// KeyPress is deprecated, but its replacement is not yet final and
not
// implemented in any major browser. Only KeyPress has charCode.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
return 0;
},
keyCode: function (event) {
// `keyCode` is the result of a KeyDown/Up event and represents the
value of
// physical keyboard key.
// The actual meaning of the value depends on the users' keyboard la
yout
// which cannot be detected. Assuming that it is a US keyboard layou
t
// provides a surprisingly accurate mapping for US and European user
s.
// Due to this, it is left to the user to implement at this time.
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
},
which: function (event) {
// `which` is an alias for either `keyCode` or `charCode` depending
on the
// type of the event.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEv
ent, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nat
iveEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInter
face);
module.exports = SyntheticKeyboardEvent;
/***/ },
/* 240 */
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule getEventCharCode
*/
'use strict';
/**
* `charCode` represents the actual "character code" and is safe to use
with
* `String.fromCharCode`. As such, only keys that correspond to printabl
e
* characters produce a valid `charCode`, the only exception to this is
Enter.
* The Tab-key is considered non-printable and does not have a `charCode
`,
* presumably because it does not produce a tab-character in browsers.
*
* @param {object} nativeEvent Native browser event.
* @return {number} Normalized `charCode` property.
*/
function getEventCharCode(nativeEvent) {
var charCode;
var keyCode = nativeEvent.keyCode;
if ('charCode' in nativeEvent) {
charCode = nativeEvent.charCode;
// FF does not set `charCode` for the Enter-key, check against `keyC
ode`.
if (charCode === 0 && keyCode === 13) {
charCode = 13;
}
} else {
// IE8 does not implement `charCode`, but `keyCode` has the correct
value.
charCode = keyCode;
}
// Some non-printable keys are reported in `charCode`/`keyCode`, disca
rd them.
// Must not discard the (non-)printable Enter-key.
if (charCode >= 32 || charCode === 13) {
return charCode;
}
return 0;
}
module.exports = getEventCharCode;
/***/ },
/* 241 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule getEventKey
*/
'use strict';
var getEventCharCode = __webpack_require__(240);
/**
* Normalization of deprecated HTML5 `key` values
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#K
ey_names
*/
var normalizeKey = {
'Esc': 'Escape',
'Spacebar': ' ',
'Left': 'ArrowLeft',
'Up': 'ArrowUp',
'Right': 'ArrowRight',
'Down': 'ArrowDown',
'Del': 'Delete',
'Win': 'OS',
'Menu': 'ContextMenu',
'Apps': 'ContextMenu',
'Scroll': 'ScrollLock',
'MozPrintableKey': 'Unidentified'
};
/**
* Translation from legacy `keyCode` to HTML5 `key`
* Only special keys supported, all others depend on keyboard layout or
browser
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#K
ey_names
*/
var translateToKey = {
8: 'Backspace',
9: 'Tab',
12: 'Clear',
13: 'Enter',
16: 'Shift',
17: 'Control',
18: 'Alt',
19: 'Pause',
20: 'CapsLock',
27: 'Escape',
32: ' ',
33: 'PageUp',
34: 'PageDown',
35: 'End',
36: 'Home',
37: 'ArrowLeft',
38: 'ArrowUp',
39: 'ArrowRight',
40: 'ArrowDown',
45: 'Insert',
46: 'Delete',
112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
144: 'NumLock',
145: 'ScrollLock',
224: 'Meta'
};
/**
* @param {object} nativeEvent Native browser event.
* @return {string} Normalized `key` property.
*/
function getEventKey(nativeEvent) {
if (nativeEvent.key) {
// Normalize inconsistent values reported by browsers due to
// implementations of a working draft specification.
// FireFox implements `key` but returns `MozPrintableKey` for all
// printable characters (normalized to `Unidentified`), ignore it.
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
if (key !== 'Unidentified') {
return key;
}
}
// Browser does not implement `key`, polyfill as much of it as we can.
if (nativeEvent.type === 'keypress') {
var charCode = getEventCharCode(nativeEvent);
// The enter-key is technically both printable and non-printable and
can
// thus be captured by `keypress`, no other non-printable key should
.
return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
}
if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
// While user keyboard layout determines the actual meaning of each
// `keyCode` value, almost all function keys have a universal value.
return translateToKey[nativeEvent.keyCode] || 'Unidentified';
}
return '';
}
module.exports = getEventKey;
/***/ },
/* 242 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticDragEvent
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(177);
/**
* @interface DragEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var DragEventInterface = {
dataTransfer: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent,
nativeEventTarget) {
return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker,
nativeEvent, nativeEventTarget);
}
SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface)
;
module.exports = SyntheticDragEvent;
/***/ },
/* 243 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticTouchEvent
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(178);
var getEventModifierState = __webpack_require__(179);
/**
* @interface TouchEvent
* @see http://www.w3.org/TR/touch-events/
*/
var TouchEventInterface = {
touches: null,
targetTouches: null,
changedTouches: null,
altKey: null,
metaKey: null,
ctrlKey: null,
shiftKey: null,
getModifierState: getEventModifierState
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent
, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nat
iveEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
module.exports = SyntheticTouchEvent;
/***/ },
/* 244 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticTransitionEvent
*/
'use strict';
var SyntheticEvent = __webpack_require__(170);
/**
* @interface Event
* @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transiti
on-events* @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
*/
var TransitionEventInterface = {
propertyName: null,
elapsedTime: null,
pseudoElement: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, native
Event, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativ
eEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInt
erface);
module.exports = SyntheticTransitionEvent;
/***/ },
/* 245 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule SyntheticWheelEvent
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(177);
/**
* @interface WheelEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var WheelEventInterface = {
deltaX: function (event) {
return 'deltaX' in event ? event.deltaX :
// Fallback to `wheelDeltaX` for Webkit and normalize (right is posi
tive).
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
},
deltaY: function (event) {
return 'deltaY' in event ? event.deltaY :
// Fallback to `wheelDeltaY` for Webkit and normalize (down is posit
ive).
'wheelDeltaY' in event ? -event.wheelDeltaY :
// Fallback to `wheelDelta` for IE<9 and normalize (down is positive
).
'wheelDelta' in event ? -event.wheelDelta : 0;
},
deltaZ: null,
// Browsers without "deltaMode" is reporting in raw wheel delta where
one
// notch on the scroll is always +/- 120, roughly equivalent to pixels
.
// A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size o
r
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
deltaMode: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this ev
ent.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticMouseEvent}
*/
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent
, nativeEventTarget) {
return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker,
nativeEvent, nativeEventTarget);
}
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterfac
e);
module.exports = SyntheticWheelEvent;
/***/ },
/* 246 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDefaultPerf
*/
'use strict';
var
var
var
var
var
DOMProperty = __webpack_require__(94);
ReactDOMComponentTree = __webpack_require__(113);
ReactDefaultPerfAnalysis = __webpack_require__(247);
ReactMount = __webpack_require__(87);
ReactPerf = __webpack_require__(126);
our own
var compositeIDMap;
var compositeIDCounter = 17000;
function getIDOfComposite(inst) {
if (!compositeIDMap) {
compositeIDMap = new WeakMap();
}
if (compositeIDMap.has(inst)) {
return compositeIDMap.get(inst);
} else {
var id = compositeIDCounter++;
compositeIDMap.set(inst, id);
return id;
}
}
function getID(inst) {
if (inst.hasOwnProperty('_rootNodeID')) {
return inst._rootNodeID;
} else {
return getIDOfComposite(inst);
}
}
function stripComplexValues(key, value) {
if (typeof value !== 'object' || Array.isArray(value) || value == null
) {
return value;
}
var prototype = Object.getPrototypeOf(value);
if (!prototype || prototype === Object.prototype) {
return value;
}
return '<not serializable>';
}
// This implementation of ReactPerf is going away some time mid 15.x.
// While we plan to keep most of the API, the actual format of measureme
nts
// will change dramatically. To signal this, we wrap them into an opaque
-ish
// object to discourage reaching into it until the API stabilizes.
function wrapLegacyMeasurements(measurements) {
return { __unstable_this_format_will_change: measurements };
}
function unwrapLegacyMeasurements(measurements) {
return measurements && measurements.__unstable_this_format_will_change
|| measurements;
}
var warnedAboutPrintDOM = false;
var warnedAboutGetMeasurementsSummaryMap = false;
var ReactDefaultPerf = {
_allMeasurements: [], // last item in the list is the current one
_mountStack: [0],
_compositeStack: [],
_injected: false,
start: function () {
if (!ReactDefaultPerf._injected) {
ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
}
ReactDefaultPerf._allMeasurements.length = 0;
ReactPerf.enableMeasure = true;
},
stop: function () {
ReactPerf.enableMeasure = false;
},
getLastMeasurements: function () {
return wrapLegacyMeasurements(ReactDefaultPerf._allMeasurements);
},
printExclusive: function (measurements) {
measurements = unwrapLegacyMeasurements(measurements || ReactDefault
Perf._allMeasurements);
var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measureme
nts);
console.table(summary.map(function (item) {
return {
'Component class name': item.componentName,
'Total inclusive time (ms)': roundFloat(item.inclusive),
'Exclusive mount time (ms)': roundFloat(item.exclusive),
'Exclusive render time (ms)': roundFloat(item.render),
'Mount time per instance (ms)': roundFloat(item.exclusive / item
.count),
'Render time per instance (ms)': roundFloat(item.render / item.c
ount),
'Instances': item.count
};
}));
// TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the
correct
// number.
},
printInclusive: function (measurements) {
measurements = unwrapLegacyMeasurements(measurements || ReactDefault
Perf._allMeasurements);
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measureme
nts);
console.table(summary.map(function (item) {
return {
'Owner > component': item.componentName,
'Inclusive time (ms)': roundFloat(item.time),
'Instances': item.count
};
}));
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(mea
surements).toFixed(2) + ' ms');
},
getMeasurementsSummaryMap: function (measurements) {
process.env.NODE_ENV !== 'production' ? warning(warnedAboutGetMeasur
ementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use
' + '`ReactPerf.getWasted(...)` instead.') : void 0;
warnedAboutGetMeasurementsSummaryMap = true;
return ReactDefaultPerf.getWasted(measurements);
},
getWasted: function (measurements) {
measurements = unwrapLegacyMeasurements(measurements);
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measureme
nts, true);
return summary.map(function (item) {
return {
'Owner > component': item.componentName,
'Wasted time (ms)': item.time,
'Instances': item.count
};
});
},
printWasted: function (measurements) {
measurements = unwrapLegacyMeasurements(measurements || ReactDefault
Perf._allMeasurements);
console.table(ReactDefaultPerf.getWasted(measurements));
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(mea
surements).toFixed(2) + ' ms');
},
printDOM: function (measurements) {
process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM,
'`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(.
..)` instead.') : void 0;
warnedAboutPrintDOM = true;
return ReactDefaultPerf.printOperations(measurements);
},
printOperations: function (measurements) {
measurements = unwrapLegacyMeasurements(measurements || ReactDefault
Perf._allMeasurements);
var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
console.table(summary.map(function (item) {
var result = {};
result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
result.type = item.type;
result.args = JSON.stringify(item.args, stripComplexValues);
return result;
}));
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(mea
surements).toFixed(2) + ' ms');
},
_recordWrite: function (id, fnName, totalTime, args) {
// TODO: totalTime isn't that useful since it doesn't count paints/r
eflows
var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allM
easurements.length - 1];
var writes = entry.writes;
writes[id] = writes[id] || [];
writes[id].push({
type: fnName,
time: totalTime,
args: args
});
},
}
ReactDefaultPerf._recordWrite(args[0]._rootNodeID, update.ty
pe, totalTime, writeArgs);
});
} else {
// basic format
var id = args[0];
if (moduleName === 'EventPluginHub') {
id = id._rootNodeID;
} else if (fnName === 'replaceNodeWithMarkup') {
// Old node is already unmounted; can't get its instance
id = ReactDOMComponentTree.getInstanceFromNode(args[1].node)
._rootNodeID;
} else if (fnName === 'replaceDelimitedText') {
id = getID(ReactDOMComponentTree.getInstanceFromNode(args[0]
));
} else if (typeof id === 'object') {
id = getID(ReactDOMComponentTree.getInstanceFromNode(args[0]
));
}
ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.pro
totype.slice.call(args, 1));
}
return rv;
} else if (moduleName === 'ReactCompositeComponent' && (fnName ===
'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()
?
fnName === '_renderValidatedComponent')) {
if (this._currentElement.type === ReactMount.TopLevelWrapper) {
return func.apply(this, args);
}
var rootNodeID = getIDOfComposite(this);
var isRender = fnName === '_renderValidatedComponent';
var isMount = fnName === 'mountComponent';
var mountStack = ReactDefaultPerf._mountStack;
if (isRender) {
addValue(entry.counts, rootNodeID, 1);
} else if (isMount) {
entry.created[rootNodeID] = true;
mountStack.push(0);
}
ReactDefaultPerf._compositeStack.push(rootNodeID);
start = performanceNow();
rv = func.apply(this, args);
totalTime = performanceNow() - start;
ReactDefaultPerf._compositeStack.pop();
if (isRender) {
addValue(entry.render, rootNodeID, totalTime);
} else if (isMount) {
var subMountTime = mountStack.pop();
mountStack[mountStack.length - 1] += totalTime;
addValue(entry.exclusive, rootNodeID, totalTime - subMountTime
);
addValue(entry.inclusive, rootNodeID, totalTime);
} else {
addValue(entry.inclusive, rootNodeID, totalTime);
}
entry.displayNames[rootNodeID] = {
current: this.getName(),
owner: this._currentElement._owner ? this._currentElement._own
er.getName() : '<root>'
};
return rv;
} else if ((moduleName === 'ReactDOMComponent' || moduleName === '
ReactDOMTextComponent') && (fnName === 'mountComponent' || fnName === 'receiveCo
mponent')) {
rv = func.apply(this, args);
entry.hierarchy[getID(this)] = ReactDefaultPerf._compositeStack.
slice();
return rv;
} else {
return func.apply(this, args);
}
};
}
};
module.exports = ReactDefaultPerf;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11)))
/***/ },
/* 247 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule ReactDefaultPerfAnalysis
*/
'use strict';
// Don't try to save users less than 1.2ms (a number I made up)
var _assign = __webpack_require__(97);
var DONT_CARE_THRESHOLD = 1.2;
var DOM_OPERATION_TYPES = {
'_mountImageIntoNode': 'set innerHTML',
INSERT_MARKUP: 'set innerHTML',
MOVE_EXISTING: 'move',
REMOVE_NODE: 'remove',
}
if (measurement.exclusive[id]) {
candidates[displayName].exclusive += measurement.exclusive[id];
}
if (measurement.inclusive[id]) {
candidates[displayName].inclusive += measurement.inclusive[id];
}
if (measurement.counts[id]) {
candidates[displayName].count += measurement.counts[id];
}
}
}
// Now make a sorted array with the results.
var arr = [];
for (displayName in candidates) {
if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
arr.push(candidates[displayName]);
}
}
arr.sort(function (a, b) {
return b.exclusive - a.exclusive;
});
return arr;
}
function getInclusiveSummary(measurements, onlyClean) {
var candidates = {};
var inclusiveKey;
for (var i = 0; i < measurements.length; i++) {
var measurement = measurements[i];
var allIDs = _assign({}, measurement.exclusive, measurement.inclusiv
e);
var cleanComponents;
if (onlyClean) {
cleanComponents = getUnchangedComponents(measurement);
}
for (var id in allIDs) {
if (onlyClean && !cleanComponents[id]) {
continue;
}
var displayName = measurement.displayNames[id];
// Inclusive time is not useful for many components without knowin
g where
// they are instantiated. So we aggregate inclusive time with both
the
// owner and current displayName as the key.
inclusiveKey = displayName.owner + ' > ' + displayName.current;
candidates[inclusiveKey] = candidates[inclusiveKey] || {
componentName: inclusiveKey,
time: 0,
count: 0
};
if (measurement.inclusive[id]) {
candidates[inclusiveKey].time += measurement.inclusive[id];
}
if (measurement.counts[id]) {
candidates[inclusiveKey].count += measurement.counts[id];
}
}
}
// Now make a sorted array with the results.
var arr = [];
for (inclusiveKey in candidates) {
if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
arr.push(candidates[inclusiveKey]);
}
}
arr.sort(function (a, b) {
return b.time - a.time;
});
return arr;
}
function getUnchangedComponents(measurement) {
// For a given reconcile, look at which components did not actually
// render anything to the DOM and return a mapping of their ID to
// the amount of time it took to render the entire subtree.
var cleanComponents = {};
var writes = measurement.writes;
var hierarchy = measurement.hierarchy;
var dirtyComposites = {};
Object.keys(writes).forEach(function (id) {
writes[id].forEach(function (write) {
// Root mounting (innerHTML set) is recorded with an ID of ''
if (id !== '' && hierarchy.hasOwnProperty(id)) {
hierarchy[id].forEach(function (c) {
return dirtyComposites[c] = true;
});
}
});
});
var allIDs = _assign({}, measurement.exclusive, measurement.inclusive)
;
for (var id in allIDs) {
var isDirty = false;
// See if any of the DOM operations applied to this component's subt
ree.
if (dirtyComposites[id]) {
isDirty = true;
}
// check if component newly created
if (measurement.created[id]) {
isDirty = true;
}
if (!isDirty && measurement.counts[id] > 0) {
cleanComponents[id] = true;
}
}
return cleanComponents;
}
var ReactDefaultPerfAnalysis = {
getExclusiveSummary: getExclusiveSummary,
getInclusiveSummary: getInclusiveSummary,
getDOMSummary: getDOMSummary,
getTotalTime: getTotalTime
};
module.exports = ReactDefaultPerfAnalysis;
/***/ },
/* 248 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks
*/
var performance = __webpack_require__(249);
var performanceNow;
/**
* Detect if we can use `window.performance.now()` and gracefully fallba
ck to
* `Date.now()` if it doesn't exist. We need to support Firefox < 15 for
now
* because of Facebook's testing infrastructure.
*/
if (performance.now) {
performanceNow = function () {
return performance.now();
};
} else {
performanceNow = function () {
return Date.now();
};
}
module.exports = performanceNow;
/***/ },
/* 249 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @typechecks
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(91);
var performance;
if (ExecutionEnvironment.canUseDOM) {
performance = window.performance || window.msPerformance || window.web
kitPerformance;
}
module.exports = performance || {};
/***/ },
/* 250 */
/***/ function(module, exports, __webpack_require__) {
/*
*
*
*
*
*
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule findDOMNode
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(112);
var ReactDOMComponentTree = __webpack_require__(113);
var ReactInstanceMap = __webpack_require__(131);
var getNativeComponentFromComposite = __webpack_require__(251);
var invariant = __webpack_require__(95);
var warning = __webpack_require__(105);
/**
* Returns the DOM node rendered by this element.
*
* @param {ReactComponent|DOMElement} componentOrElement
* @return {?DOMElement} The root node of this element.
*/
function findDOMNode(componentOrElement) {
function getNativeComponentFromComposite(inst) {
var type;
while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
inst = inst._renderedComponent;
}
if (type === ReactNodeTypes.NATIVE) {
return inst._renderedComponent;
} else if (type === ReactNodeTypes.EMPTY) {
return null;
}
}
module.exports = getNativeComponentFromComposite;
/***/ },
/* 252 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional
grant
* of patent rights can be found in the PATENTS file in the same directo
ry.
*
* @providesModule renderSubtreeIntoContainer
*/
'use strict';
var ReactMount = __webpack_require__(87);
module.exports = ReactMount.renderSubtreeIntoContainer;
/***/ },
/* 253 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {/* REACT HOT LOADER */ if
(true) { (function () { var ReactHotAPI = __webpack_require__(77), RootInstanceP
rovider = __webpack_require__(85), ReactMount = __webpack_require__(87), React =
__webpack_require__(146); module.makeHot = module.hot.data ? module.hot.data.ma
keHot : ReactHotAPI(function () { return RootInstanceProvider.getRootInstances(R
eactMount); }, React); })(); } try { (function () {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props
) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descript
or.enumerable = descriptor.enumerable || false; descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(tar
// });
exports.default = Detail;
/* REACT HOT LOADER */ }).call(this); } finally { if (true) { (function
() { var foundReactClasses = module.hot.data && module.hot.data.foundReactClasse
s || false; if (module.exports && module.makeHot) { var makeExportsHot = __webpa
ck_require__(254); if (makeExportsHot(module, __webpack_require__(146))) { found
ReactClasses = true; } var shouldAcceptModule = true && foundReactClasses; if (s
houldAcceptModule) { module.hot.accept(function (err) { if (err) { console.error
("Cannot not apply hot update to " + "Detail.js" + ": " + err.message); } }); }
} module.hot.dispose(function (data) { data.makeHot = module.makeHot; data.found
ReactClasses = foundReactClasses; }); })(); } }
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)(module
)))
/***/ },
/* 254 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var isReactClassish = __webpack_require__(255),
isReactElementish = __webpack_require__(256);
function makeExportsHot(m, React) {
if (isReactElementish(m.exports, React)) {
// React elements are never valid React classes
return false;
}
var freshExports = m.exports,
exportsReactClass = isReactClassish(m.exports, React),
foundReactClasses = false;
if (exportsReactClass) {
m.exports = m.makeHot(m.exports, '__MODULE_EXPORTS');
foundReactClasses = true;
}
for (var key in m.exports) {
if (!Object.prototype.hasOwnProperty.call(freshExports, key)) {
continue;
}
if (exportsReactClass && key === 'type') {
// React 0.12 also puts classes under `type` property for compat.
// Skip to avoid updating twice.
continue;
}
var value;
try {
value = freshExports[key];
} catch (err) {
continue;
}
if (!isReactClassish(value, React)) {
continue;
}
if (Object.getOwnPropertyDescriptor(m.exports, key).writable) {
m.exports[key] = m.makeHot(value, '__MODULE_EXPORTS_' + key);
foundReactClasses = true;
} else {
console.warn("Can't make class " + key + " hot reloadable due to b
eing read-only. To fix this you can try two solutions. First, you can exclude fi
les or directories (for example, /node_modules/) using 'exclude' option in loade
r configuration. Second, if you are using Babel, you can enable loose mode for `
es6.modules` using the 'loose' option. See: http://babeljs.io/docs/advanced/loos
e/ and http://babeljs.io/docs/usage/options/");
}
}
return foundReactClasses;
}
module.exports = makeExportsHot;
/***/ },
/* 255 */
/***/ function(module, exports) {
function hasRender(Class) {
var prototype = Class.prototype;
if (!prototype) {
return false;
}
return typeof prototype.render === 'function';
}
function descendsFromReactComponent(Class, React) {
if (!React.Component) {
return false;
}
var Base = Object.getPrototypeOf(Class);
while (Base) {
if (Base === React.Component) {
return true;
}
Base = Object.getPrototypeOf(Base);
}
return false;
}
function isReactClassish(Class, React) {
if (typeof Class !== 'function') {
return false;
}
// React 0.13
if (hasRender(Class) || descendsFromReactComponent(Class, React)) {
return true;
}