text
stringlengths 3
1.05M
|
|---|
var messageName, canvas, ctx, images, img, nutSack, sourceImg, width, height;
nutSack = document.createElement('img');
nutSack.src = safari.extension.baseURI + 'nutsack.png';
function handleMessage(msgEvent) {
messageName = msgEvent.name;
if (messageName === "nutsack") {
images = document.getElementsByTagName('img');
for (var ix = 0; ix < images.length; ix++) {
sourceImg = images[ix];
width = sourceImg.clientWidth;
height = sourceImg.clientHeight;
if (width >= 100) {
canvas = document.createElement('canvas');
canvas.setAttribute('width', width.toString());
canvas.setAttribute('height', height.toString());
ctx = canvas.getContext('2d');
ctx.drawImage(sourceImg, 0, 0, width, height);
ctx.drawImage(nutSack, 0, 0, width, height);
sourceImg.parentNode.replaceChild(canvas, sourceImg);
// the images list is LIVE so we need to decrement the counter after the img is replaced by the canvas
ix--;
}
}
}
}
safari.self.addEventListener("message", handleMessage, false);
|
var humanInterval = module.exports = function humanInterval(time) {
if(!time) return time;
if(typeof time == 'number') return time;
time = swapLanguageToDecimals(time);
time = time.replace(/(second|minute|hour|day|week|month|year)s?(?! ?(s )?and |s?$)/, '$1,');
return time.split(/and|,/).reduce(function(sum, group) {
return sum + (group != "" ? processUnits(group) : 0);
}, 0);
};
humanInterval.languageMap = {
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9,
'ten': 10
};
function swapLanguageToDecimals(time) {
var language = humanInterval.languageMap;
var languageMapRegex = new RegExp('(' + Object.keys(language).join('|') + ')', 'g');
var matches = time.match(languageMapRegex);
if(!matches) return time;
matches.forEach(function(match) {
var matchStr = language[match] > 1 ? language[match] : language[match].toString().slice(1);
time = time.replace(match, matchStr);
});
return time;
}
function processUnits(time) {
var num = parseFloat(time, 10),
unit = time.match(/(second|minute|hour|day|week|month|year)s?/)[1];
if(!num) num = 1;
switch(unit) {
case 'second': unit = 1000; break;
case 'minute': unit = 1000 * 60; break;
case 'hour': unit = 1000 * 60 * 60; break;
case 'day': unit = 1000 * 60 * 60 * 24; break;
case 'week': unit = 1000 * 60 * 60 * 24 * 7; break;
case 'month': unit = 1000 * 60 * 60 * 24 * 30; break;
case 'year': unit = 1000 * 60 * 60 * 24 * 365; break;
}
return unit * num;
}
|
import React from "react"
import { Link } from "gatsby"
import Layout from "../components/layout"
import Image from "../components/image"
import SEO from "../components/seo"
import Card from "../components/Card";
import Section from "../components/Section";
import Wave from "../components/Wave";
import staticdata from "../../staticdata.json"
import Cell from "../components/Cell";
import styled from 'styled-components'
const SectionCaption = styled.p`
font-weight: 600;
font-size: 18px;
text-transform: uppercase;
color: #94A4BA;
text-align: center;
`
const SectionCellGroup = styled.div`
max-width: 800px;
margin: 0 auto 100px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20px;
grid-column-gap: 20px;
padding: 0 20px;
@media (max-width: 800px) {
grid-template-columns: repeat(1, 1fr);
}
`
const IndexPage = () => (
<Layout>
<SEO title="Home" keywords={[`gatsby`, `application`, `react`]} />
<div className="Hero">
<div className="HeroGroup">
<h1>Learn to <br />design and code React apps</h1>
<p>Complete courses about the best tools and design systems. Prototype and build apps with React and Swift.</p>
<Link to="/page-2/">Watch the video</Link>
<div className="Logos">
<img src={require('../images/logo-sketch.png')} width="50" />
<img src={require('../images/logo-figma.png')} width="50" />
<img src={require('../images/logo-studio.png')} width="50" />
<img src={require('../images/logo-framer.png')} width="50" />
<img src={require('../images/logo-react.png')} width="50" />
<img src={require('../images/logo-swift.png')} width="50" />
</div>
<Wave />
</div>
</div>
<div className="Cards">
<h2>11 courses, more coming</h2>
<div className="CardGroup">
<Card
title="React for Designers"
text= "12 sections"
image={require('../images/wallpaper.jpg')} />
<Card
title="React for Designers"
text= "10 sections"
image={require('../images/wallpaper2.jpg')} />
<Card
title="React for Designers"
text= "5 sections"
image={require('../images/wallpaper3.jpg')} />
<Card
title="React for Designers"
text= "10 sections"
image={require('../images/wallpaper4.jpg')} />
</div>
</div>
<Section
image={require('../images/wallpaper2.jpg')}
logo={require('../images/logo-react.png')}
title="React for Designers"
text="Learn how to build a modern site using React and the most efficient libraries to get your site/product online. Get familiar with components, Grid CSS, animations, interactions, dynamic data with Contentful and deploying your site with Netlify."
/>
<SectionCaption>12 sections - 6 hours</SectionCaption>
<SectionCellGroup>
{staticdata.cells.map(cell => (
<Cell
title={cell.title}
image={cell.image} />
))}
</SectionCellGroup>
</Layout>
)
export default IndexPage
|
module.exports = require('./dist/async');
|
/* eslint no-use-before-define: ["error", { "variables": false }] */
import PropTypes from 'prop-types';
import React from 'react';
import { StyleSheet, Text, View, ViewPropTypes } from 'react-native';
import moment from 'moment';
import Color from './Color';
import { TIME_FORMAT } from './Constant';
export default function Time({ position, containerStyle, currentMessage, timeFormat }, context) {
return (
<View style={[styles[position].container, containerStyle[position]]}>
<Text style={[styles[position].text, textStyle[position]]}>
{moment(currentMessage.createdAt)
.locale(context.getLocale())
.format(timeFormat)}
</Text>
</View>
);
}
const containerStyle = {
marginLeft: 10,
marginRight: 10,
marginBottom: 5,
};
const textStyle = {
fontSize: 10,
backgroundColor: 'transparent',
textAlign: 'right',
};
const styles = {
left: StyleSheet.create({
container: {
...containerStyle,
},
text: {
color: Color.timeTextColor,
...textStyle,
},
}),
right: StyleSheet.create({
container: {
...containerStyle,
},
text: {
color: Color.white,
...textStyle,
},
}),
};
Time.contextTypes = {
getLocale: PropTypes.func,
};
Time.defaultProps = {
position: 'left',
currentMessage: {
createdAt: null,
},
containerStyle: {},
textStyle: {},
timeFormat: TIME_FORMAT,
};
Time.propTypes = {
position: PropTypes.oneOf(['left', 'right']),
currentMessage: PropTypes.object,
containerStyle: PropTypes.shape({
left: ViewPropTypes.style,
right: ViewPropTypes.style,
}),
textStyle: PropTypes.shape({
left: Text.propTypes.style,
right: Text.propTypes.style,
}),
timeFormat: PropTypes.string,
};
|
module.exports = require('../../images/2/1f639.png');
|
/**
* angular-strap
* @version v2.1.7 - 2015-10-19
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
'use strict';
angular.module('mgcrea.ngStrap.helpers.parseOptions', [])
.provider('$parseOptions', function() {
var defaults = this.defaults = {
regexp: /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/
};
this.$get = ["$parse", "$q", function($parse, $q) {
function ParseOptionsFactory(attr, config) {
var $parseOptions = {};
// Common vars
var options = angular.extend({}, defaults, config);
$parseOptions.$values = [];
// Private vars
var match, displayFn, valueName, keyName, groupByFn, valueFn, valuesFn;
$parseOptions.init = function() {
$parseOptions.$match = match = attr.match(options.regexp);
displayFn = $parse(match[2] || match[1]),
valueName = match[4] || match[6],
keyName = match[5],
groupByFn = $parse(match[3] || ''),
valueFn = $parse(match[2] ? match[1] : valueName),
valuesFn = $parse(match[7]);
};
$parseOptions.valuesFn = function(scope, controller) {
return $q.when(valuesFn(scope, controller))
.then(function(values) {
$parseOptions.$values = values ? parseValues(values, scope) : {};
return $parseOptions.$values;
});
};
$parseOptions.displayValue = function(modelValue) {
var scope = {};
scope[valueName] = modelValue;
return displayFn(scope);
};
// Private functions
function parseValues(values, scope) {
return values.map(function(match, index) {
var locals = {}, label, value;
locals[valueName] = match;
label = displayFn(scope, locals);
value = valueFn(scope, locals);
return {label: label, value: value, index: index};
});
}
$parseOptions.init();
return $parseOptions;
}
return ParseOptionsFactory;
}];
});
|
#
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This application is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This application is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The presence of this file turns this directory into a Python package
'''
This is the GNU Radio MANUAL64TO7 module. Place your Python package
description here (python/__init__.py).
'''
# import swig generated symbols into the manual64to7 namespace
try:
# this might fail if the module is python-only
from manual64to7_swig import *
except ImportError:
pass
# import any pure python here
#
|
import React from 'react'
import { configure, mount } from 'enzyme'
import Adapter from '@wojtekmaj/enzyme-adapter-react-17'
import renderer from 'react-test-renderer';
import CInputGroupText from '../CInputGroupText'
configure({ adapter: new Adapter() })
describe('CInputGroupText', () => {
it('renders basic wrapper correctly', () => {
const component = renderer.create(<CInputGroupText/>);
let tree = component.toJSON();
expect(tree).toMatchSnapshot()
})
it('renders customized wrapper correctly', () => {
const componentCustomized = renderer.create(
<CInputGroupText
className='class-name'
>
CInputGroupText
</CInputGroupText>
);
let tree = componentCustomized.toJSON();
expect(tree).toMatchSnapshot()
})
})
|
/*!
* AngularJS Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.8-master-c62282f
*/
!function(n,e,i){"use strict";function t(n,e){return["$mdUtil","$window",function(i,t){return{restrict:"A",multiElement:!0,link:function(o,r,a){var d=o.$on("$md-resize-enable",function(){d();var c=r[0],u=c.nodeType===t.Node.ELEMENT_NODE?t.getComputedStyle(c):{};o.$watch(a[n],function(n){if(!!n===e){i.nextTick(function(){o.$broadcast("$md-resize")});var t={cachedTransitionStyles:u};i.dom.animator.waitTransitionEnd(r,t).then(function(){o.$broadcast("$md-resize")})}})})}}}]}e.module("material.components.showHide",["material.core"]).directive("ngShow",t("ngShow",!0)).directive("ngHide",t("ngHide",!1))}(window,window.angular);
|
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.24/esri/copyright.txt for details.
//>>built
define("esri/layers/vectorTiles/views/2d/tiling/LODInfo",["require","exports","../../../geometry/support/spatialReferenceUtils","./TileKey"],function(r,t,p,q){function l(c,a,d){c[0]=a;c[1]=d;return c}var b=new q("0/0/0/0");return function(){function c(a,d,c,e,b,f,h,k,m,n,l,p){this.level=a;this.resolution=d;this.scale=c;this.origin=e;this.first=b;this.last=f;this.size=h;this.norm=k;this.worldStart=m;this.worldEnd=n;this.worldSize=l;this.wrap=p}c.create=function(a,d,b){var e=p.getInfo(a.spatialReference),
g=[a.origin.x,a.origin.y],f=[a.size[0]*d.resolution,a.size[1]*d.resolution],h=[-Infinity,-Infinity],k=[Infinity,Infinity],m=[Infinity,Infinity];b&&(l(h,Math.max(0,Math.floor((b.xmin-g[0])/f[0])),Math.max(0,Math.floor((g[1]-b.ymax)/f[1]))),l(k,Math.max(0,Math.floor((b.xmax-g[0])/f[0])),Math.max(0,Math.floor((g[1]-b.ymin)/f[1]))),l(m,k[0]-h[0]+1,k[1]-h[1]+1));var n;a.isWrappable?(a=[Math.ceil(Math.round(2*e.origin[1]/d.resolution)/a.size[0]),m[1]],e=[Math.floor((e.origin[0]-g[0])/f[0]),h[1]],b=[a[0]+
e[0]-1,k[1]],n=!0):(e=h,b=k,a=m,n=!1);return new c(d.level,d.resolution,d.scale,g,h,k,m,f,e,b,a,n)};c.prototype.normalizeCol=function(a){if(!this.wrap)return a;var b=this.worldSize[0];return 0>a?b-1-Math.abs((a+1)%b):a%b};c.prototype.denormalizeCol=function(a,b){return this.wrap?this.worldSize[0]*b+a:a};c.prototype.getWorldForColumn=function(a){return this.wrap?Math.floor(a/this.worldSize[0]):0};c.prototype.getFirstColumnForWorld=function(a){return a*this.worldSize[0]+this.first[0]};c.prototype.getLastColumnForWorld=
function(a){return a*this.worldSize[0]+this.first[0]+this.size[0]-1};c.prototype.getColumnForX=function(a){return(a-this.origin[0])/this.norm[0]};c.prototype.getXForColumn=function(a){return this.origin[0]+a*this.norm[0]};c.prototype.getRowForY=function(a){return(this.origin[1]-a)/this.norm[1]};c.prototype.getYForRow=function(a){return this.origin[1]-a*this.norm[1]};c.prototype.getTileBounds=function(a,c){b.set(c);var d=this.denormalizeCol(b.col,b.world),e=b.row,g=this.getXForColumn(d),f=this.getYForRow(e+
1),d=this.getXForColumn(d+1),e=this.getYForRow(e);a[0]=g;a[1]=f;a[2]=d;a[3]=e;return a};c.prototype.getTileCoords=function(a,c){b.set(c);Array.isArray(a)?l(a,this.getXForColumn(this.denormalizeCol(b.col,b.world)),this.getYForRow(b.row)):(a.x=this.getXForColumn(this.denormalizeCol(b.col,b.world)),a.y=this.getYForRow(b.row));return a};return c}()});
|
const router = require("express").Router();
const usersController = require("../../controllers/usersController");
// Matches with "/api/users"
router.route("/")
.get(usersController.findAll)
.post(usersController.create);
// Matches with "/api/users/:id"
router
.route("/:id")
.get(usersController.findById)
.put(usersController.update)
.delete(usersController.remove);
module.exports = router;
|
# Copyright (c) 2011 Florian Mounier
# Copyright (c) 2012 Tycho Andersen
# Copyright (c) 2014 Sean Vig
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit 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 included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 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 CLAIM, 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.
import pytest
from libqtile import config, ipc, resources
from libqtile.command.interface import IPCCommandInterface
from libqtile.confreader import Config
from libqtile.layout import Max
from libqtile.sh import QSh
class ShConfig(Config):
keys = []
mouse = []
groups = [
config.Group("a"),
config.Group("b"),
]
layouts = [
Max(),
]
floating_layout = resources.default_config.floating_layout
screens = [
config.Screen()
]
sh_config = pytest.mark.parametrize("manager", [ShConfig], indirect=True)
@sh_config
def test_columnize(manager):
client = ipc.Client(manager.sockfile)
command = IPCCommandInterface(client)
sh = QSh(command)
assert sh.columnize(["one", "two"]) == "one two"
sh.termwidth = 1
assert sh.columnize(["one", "two"], update_termwidth=False) == "one\ntwo"
sh.termwidth = 15
v = sh.columnize(["one", "two", "three", "four", "five"], update_termwidth=False)
assert v == 'one two \nthree four \nfive '
@sh_config
def test_ls(manager):
client = ipc.Client(manager.sockfile)
command = IPCCommandInterface(client)
sh = QSh(command)
assert sh.do_ls(None) == "bar/ group/ layout/ screen/ widget/ window/ core/ "
assert sh.do_ls("") == "bar/ group/ layout/ screen/ widget/ window/ core/ "
assert sh.do_ls("layout") == "layout/group/ layout/window/ layout/screen/ layout[0]/ "
assert sh.do_cd("layout") == "layout"
assert sh.do_ls(None) == "group/ window/ screen/"
assert sh.do_ls("screen") == "screen/layout/ screen/window/ screen/bar/ screen/widget/ screen/group/ "
@sh_config
def test_do_cd(manager):
client = ipc.Client(manager.sockfile)
command = IPCCommandInterface(client)
sh = QSh(command)
assert sh.do_cd("layout") == 'layout'
assert sh.do_cd("../layout/0") == 'layout[0]'
assert sh.do_cd("..") == '/'
assert sh.do_cd("layout") == 'layout'
assert sh.do_cd("../layout0/wibble") == 'No such path.'
assert sh.do_cd(None) == '/'
@sh_config
def test_call(manager):
client = ipc.Client(manager.sockfile)
command = IPCCommandInterface(client)
sh = QSh(command)
assert sh.process_line("status()") == "OK"
v = sh.process_line("nonexistent()")
assert v == "Command does not exist: nonexistent"
v = sh.process_line("status(((")
assert v == "Invalid command: status((("
v = sh.process_line("status(1)")
assert v.startswith("Caught command exception")
@sh_config
def test_complete(manager):
client = ipc.Client(manager.sockfile)
command = IPCCommandInterface(client)
sh = QSh(command)
assert sh._complete("c", "c") == [
"cd",
"change_vt",
"commands",
"critical",
]
assert sh._complete("cd l", "l") == ["layout/"]
assert sh._complete("cd layout/", "layout/") == [
"layout/" + x for x in ["group", "window", "screen", "0"]
]
assert sh._complete("cd layout/", "layout/g") == ["layout/group/"]
@sh_config
def test_help(manager):
client = ipc.Client(manager.sockfile)
command = IPCCommandInterface(client)
sh = QSh(command)
assert sh.do_help("nonexistent").startswith("No such command")
assert sh.do_help("help")
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""create SolarBISlice II
Revision ID: 38a0be6d52df
Revises: 57ba23f5db72
Create Date: 2019-09-25 10:24:54.602970
"""
# revision identifiers, used by Alembic.
revision = '38a0be6d52df'
down_revision = '57ba23f5db72'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('annotation', schema=None) as batch_op:
batch_op.alter_column('layer_id',
existing_type=sa.INTEGER(),
nullable=False)
with op.batch_alter_table('clusters', schema=None) as batch_op:
batch_op.add_column(sa.Column('broker_pass', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=True))
batch_op.add_column(sa.Column('broker_user', sa.String(length=255), nullable=True))
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.create_unique_constraint(None, ['verbose_name'])
with op.batch_alter_table('columns', schema=None) as batch_op:
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('column_name',
existing_type=sa.VARCHAR(length=255),
nullable=False)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
with op.batch_alter_table('css_templates', schema=None) as batch_op:
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
with op.batch_alter_table('dashboard_slices', schema=None) as batch_op:
batch_op.create_unique_constraint(None, ['dashboard_id', 'slice_id'])
with op.batch_alter_table('dashboards', schema=None) as batch_op:
batch_op.add_column(sa.Column('published', sa.Boolean(), nullable=True))
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.create_unique_constraint(None, ['slug'])
with op.batch_alter_table('datasources', schema=None) as batch_op:
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('datasource_name',
existing_type=sa.VARCHAR(length=255),
nullable=False)
batch_op.create_foreign_key(None, 'ab_user', ['created_by_fk'], ['id'])
with op.batch_alter_table('dbs', schema=None) as batch_op:
batch_op.alter_column('allow_csv_upload',
existing_type=sa.BOOLEAN(),
nullable=True,
existing_server_default=sa.text('1'))
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.create_unique_constraint(None, ['verbose_name'])
with op.batch_alter_table('metrics', schema=None) as batch_op:
batch_op.alter_column('json',
existing_type=sa.TEXT(),
nullable=False)
batch_op.alter_column('metric_name',
existing_type=sa.VARCHAR(length=255),
nullable=False)
batch_op.create_foreign_key(None, 'ab_user', ['created_by_fk'], ['id'])
batch_op.create_foreign_key(None, 'ab_user', ['changed_by_fk'], ['id'])
with op.batch_alter_table('query', schema=None) as batch_op:
batch_op.drop_column('limit_used')
with op.batch_alter_table('slices', schema=None) as batch_op:
batch_op.add_column(sa.Column('data_type', sa.String(length=200), nullable=True))
batch_op.add_column(sa.Column('end_date', sa.DateTime(), nullable=True))
batch_op.add_column(sa.Column('query_id', sa.Integer(), nullable=True))
batch_op.add_column(sa.Column('query_status', sa.String(length=200), nullable=True))
batch_op.add_column(sa.Column('resolution', sa.String(length=200), nullable=True))
batch_op.add_column(sa.Column('start_date', sa.DateTime(), nullable=True))
batch_op.add_column(sa.Column('valid_date', sa.DateTime(), nullable=True))
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
with op.batch_alter_table('sql_metrics', schema=None) as batch_op:
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('expression',
existing_type=sa.TEXT(),
nullable=False)
batch_op.alter_column('metric_name',
existing_type=sa.VARCHAR(length=512),
nullable=False)
batch_op.create_unique_constraint(None, ['table_id', 'metric_name'])
with op.batch_alter_table('table_columns', schema=None) as batch_op:
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('column_name',
existing_type=sa.VARCHAR(length=255),
nullable=False)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.create_unique_constraint(None, ['table_id', 'column_name'])
batch_op.drop_column('database_expression')
with op.batch_alter_table('tables', schema=None) as batch_op:
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.drop_constraint('uq_table_in_db_schema', type_='unique')
batch_op.create_unique_constraint(None, ['database_id', 'table_name'])
with op.batch_alter_table('url', schema=None) as batch_op:
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('url', schema=None) as batch_op:
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
with op.batch_alter_table('tables', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
batch_op.create_unique_constraint('uq_table_in_db_schema', ['database_id', 'schema', 'table_name'])
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
with op.batch_alter_table('table_columns', schema=None) as batch_op:
batch_op.add_column(sa.Column('database_expression', sa.VARCHAR(length=255), nullable=True))
batch_op.drop_constraint(None, type_='unique')
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('column_name',
existing_type=sa.VARCHAR(length=255),
nullable=True)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
with op.batch_alter_table('sql_metrics', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
batch_op.alter_column('metric_name',
existing_type=sa.VARCHAR(length=512),
nullable=True)
batch_op.alter_column('expression',
existing_type=sa.TEXT(),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
with op.batch_alter_table('slices', schema=None) as batch_op:
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.drop_column('valid_date')
batch_op.drop_column('start_date')
batch_op.drop_column('resolution')
batch_op.drop_column('query_status')
batch_op.drop_column('query_id')
batch_op.drop_column('end_date')
batch_op.drop_column('data_type')
with op.batch_alter_table('query', schema=None) as batch_op:
batch_op.add_column(sa.Column('limit_used', sa.BOOLEAN(), nullable=True))
with op.batch_alter_table('metrics', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.alter_column('metric_name',
existing_type=sa.VARCHAR(length=255),
nullable=True)
batch_op.alter_column('json',
existing_type=sa.TEXT(),
nullable=True)
with op.batch_alter_table('dbs', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('allow_csv_upload',
existing_type=sa.BOOLEAN(),
nullable=False,
existing_server_default=sa.text('1'))
with op.batch_alter_table('datasources', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.alter_column('datasource_name',
existing_type=sa.VARCHAR(length=255),
nullable=True)
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
with op.batch_alter_table('dashboards', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.drop_column('published')
with op.batch_alter_table('dashboard_slices', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
with op.batch_alter_table('css_templates', schema=None) as batch_op:
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
with op.batch_alter_table('columns', schema=None) as batch_op:
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('column_name',
existing_type=sa.VARCHAR(length=255),
nullable=True)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
with op.batch_alter_table('clusters', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
batch_op.alter_column('created_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.alter_column('changed_on',
existing_type=sa.DATETIME(),
nullable=False)
batch_op.drop_column('broker_user')
batch_op.drop_column('broker_pass')
with op.batch_alter_table('annotation', schema=None) as batch_op:
batch_op.alter_column('layer_id',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
|
!function (doc, app) {
var el;
el = doc.getElementById('main');
app.main = {
open: function (animate) {
el.classList[animate ? 'add' : 'remove']('animate');
el.classList.remove('hide');
},
close: function (animate) {
el.classList[animate ? 'add' : 'remove']('animate');
el.classList.add('hide');
}
};
}(document, slangbook);
|
# -*- coding: utf-8 -*-
"""
Unit : tests.features.steps
description : Define the steps of test
developer : Alcindo Schleder
version : 1.0.0
"""
import os
from argparse import Namespace
from behave import given, when, then
@given('Aplicação é iniciada para o arquivo {fn}')
def instance_initial_application_class(context, fn):
context.filename = f'{context.data_path}/{fn}'
@when('Configura a classe InitializeProgram._parser')
def prepare_app(context):
context.parser = context.app._configure_parser()
if context.parser is not None:
context.parser.parse_args(['--input', context.filename])
context.app._parser = context.parser
context.app._args = Namespace(input=context.filename)
context.app.testing = True
@then("Verifica se existe o arquivo")
def check_file_exists(context):
assert os.path.exists(context.filename)
@then('Inicia o processamento das Transaçoes do arquivo')
def start_file_processing(context):
assert context.app.start()
|
import axios from 'axios';
import { now } from 'moment';
var authAxios = axios.create({
baseURL: 'https://localhost:44392/api/',
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token')}`
}
});
var test = -1;
if (localStorage.getItem('access_token') != null) {
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
}
});
failedQueue = [];
};
authAxios.interceptors.response.use(
response => {
return response;
},
err => {
const originalRequest = err.config;
if (err.response.status === 401 && !originalRequest._retry) {
if (isRefreshing) {
return new Promise(function (resolve, reject) {
failedQueue.push({ resolve, reject });
})
.then(token => {
authAxios.defaults.headers.common['Authorization'] = 'Bearer ' + token;
originalRequest.headers['Authorization'] = 'Bearer ' + token;
return authAxios(originalRequest);
})
.catch(err => {
return Promise.reject(err);
});
}
originalRequest._retry = true;
isRefreshing = true;
return new Promise(function (resolve, reject) {
axios
.post('https://localhost:44392/api/Authentication/refresh', {
access_token: localStorage.getItem("access_token"),
refresh_token: localStorage.getItem("refresh_token")
})
.then(({ data }) => {
authAxios.defaults.headers.common['Authorization'] = 'Bearer ' + data.token;
console.log(authAxios.defaults.headers.common['Authorization']);
originalRequest.headers['Authorization'] = 'Bearer ' + data.token;
localStorage.setItem("access_token", data.token)
localStorage.setItem("refresh_token", data.refreshToken)
authAxios = axios.create({
baseURL: 'https://localhost:44392/api/',
headers: {
Authorization: `Bearer ${data.token}`
}
});
processQueue(null, data.token);
resolve(authAxios(originalRequest));
})
.catch(err => {
processQueue(err, null);
// store.dispatch(showMessage({ message: 'Expired Token' }));
reject(err);
})
.then(() => {
isRefreshing = false;
});
});
}
return Promise.reject(err);
}
);}
export default authAxios;
|
/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/license
*/
CKEDITOR.lang['ms']={"editor":"Rich Text Editor","editorPanel":"Rich Text Editor panel","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protokol","upload":"Muat Naik","uploadSubmit":"Hantar ke Server","image":"Gambar","flash":"Flash","form":"Borang","checkbox":"Checkbox","radio":"Butang Radio","textField":"Text Field","textarea":"Textarea","hiddenField":"Field Tersembunyi","button":"Butang","select":"Field Pilihan","imageButton":"Butang Bergambar","notSet":"<tidak di set>","id":"Id","name":"Nama","langDir":"Arah Tulisan","langDirLtr":"Kiri ke Kanan (LTR)","langDirRtl":"Kanan ke Kiri (RTL)","langCode":"Kod Bahasa","longDescr":"Butiran Panjang URL","cssClass":"Kelas-kelas Stylesheet","advisoryTitle":"Tajuk Makluman","cssStyle":"Stail","ok":"OK","cancel":"Batal","close":"Tutup","preview":"Prebiu","resize":"Resize","generalTab":"Umum","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"You have changed some options. Are you sure you want to close the dialog window?","options":"Options","target":"Sasaran","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Kiri ke Kanan (LTR)","langDirRTL":"Kanan ke Kiri (RTL)","styles":"Stail","cssClasses":"Kelas-kelas Stylesheet","width":"Lebar","height":"Tinggi","align":"Jajaran","left":"Kiri","right":"Kanan","center":"Tengah","justify":"Jajaran Blok","alignLeft":"Jajaran Kiri","alignRight":"Jajaran Kanan","alignCenter":"Align Center","alignTop":"Atas","alignMiddle":"Pertengahan","alignBottom":"Bawah","alignNone":"None","invalidValue":"Nilai tidak sah.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidLength":"Value specified for the \"%1\" field must be a positive number with or without a valid measurement unit (%2).","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>","keyboard":{"8":"Backspace","13":"Enter","16":"Shift","17":"Ctrl","18":"Alt","32":"Space","35":"End","36":"Home","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","124":"F13","125":"F14","126":"F15","127":"F16","128":"F17","129":"F18","130":"F19","131":"F20","132":"F21","133":"F22","134":"F23","135":"F24","224":"Command"},"keyboardShortcut":"Keyboard shortcut","optionDefault":"Default"},"about":{"copy":"Copyright © $1. All rights reserved.","dlgTitle":"About CKEditor 4","moreInfo":"For licensing information please visit our web site:"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strike Through","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"bidi":{"ltr":"Text direction from left to right","rtl":"Text direction from right to left"},"blockquote":{"toolbar":"Block Quote"},"notification":{"closed":"Notification closed."},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"clipboard":{"copy":"Salin","copyError":"Keselamatan perisian browser anda tidak membenarkan operasi salinan text/imej. Sila gunakan papan kekunci (Ctrl/Cmd+C).","cut":"Potong","cutError":"Keselamatan perisian browser anda tidak membenarkan operasi suntingan text/imej. Sila gunakan papan kekunci (Ctrl/Cmd+X).","paste":"Tampal","pasteNotification":"Press %1 to paste. Your browser doesn‘t support pasting with the toolbar button or context menu option.","pasteArea":"Paste Area","pasteMsg":"Paste your content inside the area below and press OK."},"colorbutton":{"auto":"Otomatik","bgColorTitle":"Warna Latarbelakang","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White","1ABC9C":"Strong Cyan","2ECC71":"Emerald","3498DB":"Bright Blue","9B59B6":"Amethyst","4E5F70":"Grayish Blue","F1C40F":"Vivid Yellow","16A085":"Dark Cyan","27AE60":"Dark Emerald","2980B9":"Strong Blue","8E44AD":"Dark Violet","2C3E50":"Desaturated Blue","F39C12":"Orange","E67E22":"Carrot","E74C3C":"Pale Red","ECF0F1":"Bright Silver","95A5A6":"Light Grayish Cyan","DDD":"Light Gray","D35400":"Pumpkin","C0392B":"Strong Red","BDC3C7":"Silver","7F8C8D":"Grayish Cyan","999":"Dark Gray"},"more":"Warna lain-lain...","panelTitle":"Colors","textColorTitle":"Warna Text"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"contextmenu":{"options":"Context Menu Options"},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Advisory Title","cssClassInputLabel":"Stylesheet Classes","edit":"Edit Div","inlineStyleInputLabel":"Inline Style","langDirLTRLabel":"Left to Right (LTR)","langDirLabel":"Language Direction","langDirRTLLabel":"Right to Left (RTL)","languageCodeInputLabel":" Language Code","remove":"Remove Div","styleSelectLabel":"Style","title":"Create Div Container","toolbar":"Create Div Container"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"filetools":{"loadError":"Error occurred during file read.","networkError":"Network error occurred during file upload.","httpError404":"HTTP error occurred during file upload (404: File not found).","httpError403":"HTTP error occurred during file upload (403: Forbidden).","httpError":"HTTP error occurred during file upload (error status: %1).","noUrlError":"Upload URL is not defined.","responseError":"Incorrect server response."},"find":{"find":"Cari","findOptions":"Find Options","findWhat":"Perkataan yang dicari:","matchCase":"Padanan case huruf","matchCyclic":"Match cyclic","matchWord":"Padana Keseluruhan perkataan","notFoundMsg":"Text yang dicari tidak dijumpai.","replace":"Ganti","replaceAll":"Ganti semua","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Diganti dengan:","title":"Find and Replace"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"flash":{"access":"Script Access","accessAlways":"Always","accessNever":"Never","accessSameDomain":"Same domain","alignAbsBottom":"Bawah Mutlak","alignAbsMiddle":"Pertengahan Mutlak","alignBaseline":"Garis Dasar","alignTextTop":"Atas Text","bgcolor":"Warna Latarbelakang","chkFull":"Allow Fullscreen","chkLoop":"Loop","chkMenu":"Enable Flash Menu","chkPlay":"Auto Play","flashvars":"Variables for Flash","hSpace":"Ruang Melintang","properties":"Flash Properties","propertiesTab":"Properties","quality":"Quality","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"Scale","scaleAll":"Show all","scaleFit":"Exact Fit","scaleNoBorder":"No Border","title":"Flash Properties","vSpace":"Ruang Menegak","validateHSpace":"HSpace must be a number.","validateSrc":"Sila taip sambungan URL","validateVSpace":"VSpace must be a number.","windowMode":"Window mode","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"font":{"fontSize":{"label":"Saiz","voiceLabel":"Font Size","panelTitle":"Saiz"},"label":"Font","panelTitle":"Font","voiceLabel":"Font"},"format":{"label":"Format","panelTitle":"Format","tag_address":"Alamat","tag_div":"Perenggan (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Telah Diformat"},"horizontalrule":{"toolbar":"Masukkan Garisan Membujur"},"iframe":{"border":"Show frame border","noUrl":"Please type the iframe URL","scrolling":"Enable scrollbars","title":"IFrame Properties","toolbar":"IFrame"},"image":{"alt":"Text Alternatif","border":"Border","btnUpload":"Hantar ke Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"Ruang Melintang","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Info Imej","linkTab":"Sambungan","lockRatio":"Tetapkan Nisbah","menu":"Ciri-ciri Imej","resetSize":"Saiz Set Semula","title":"Ciri-ciri Imej","titleButton":"Ciri-ciri Butang Bergambar","upload":"Muat Naik","urlMissing":"Image source URL is missing.","vSpace":"Ruang Menegak","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"indent":{"indent":"Tambahkan Inden","outdent":"Kurangkan Inden"},"smiley":{"options":"Smiley Options","title":"Masukkan Smiley","toolbar":"Smiley"},"language":{"button":"Set language","remove":"Remove language"},"link":{"acccessKey":"Kunci Akses","advanced":"Advanced","advisoryContentType":"Jenis Kandungan Makluman","advisoryTitle":"Tajuk Makluman","anchor":{"toolbar":"Masukkan/Sunting Pautan","menu":"Ciri-ciri Pautan","title":"Ciri-ciri Pautan","name":"Nama Pautan","errorName":"Sila taip nama pautan","remove":"Remove Anchor"},"anchorId":"dengan menggunakan ID elemen","anchorName":"dengan menggunakan nama pautan","charset":"Linked Resource Charset","cssClasses":"Kelas-kelas Stylesheet","download":"Force Download","displayText":"Display Text","emailAddress":"Alamat E-Mail","emailBody":"Isi Kandungan Mesej","emailSubject":"Subjek Mesej","id":"Id","info":"Butiran Sambungan","langCode":"Arah Tulisan","langDir":"Arah Tulisan","langDirLTR":"Kiri ke Kanan (LTR)","langDirRTL":"Kanan ke Kiri (RTL)","menu":"Sunting Sambungan","name":"Nama","noAnchors":"(Tiada pautan terdapat dalam dokumen ini)","noEmail":"Sila taip alamat e-mail","noUrl":"Sila taip sambungan URL","noTel":"Please type the phone number","other":"<lain>","phoneNumber":"Phone number","popupDependent":"Bergantungan (Netscape)","popupFeatures":"Ciri Tetingkap Popup","popupFullScreen":"Skrin Penuh (IE)","popupLeft":"Posisi Kiri","popupLocationBar":"Bar Lokasi","popupMenuBar":"Bar Menu","popupResizable":"Resizable","popupScrollBars":"Bar-bar skrol","popupStatusBar":"Bar Status","popupToolbar":"Toolbar","popupTop":"Posisi Atas","rel":"Relationship","selectAnchor":"Sila pilih pautan","styles":"Stail","tabIndex":"Indeks Tab ","target":"Sasaran","targetFrame":"<bingkai>","targetFrameName":"Nama Bingkai Sasaran","targetPopup":"<tetingkap popup>","targetPopupName":"Nama Tetingkap Popup","title":"Sambungan","toAnchor":"Pautan dalam muka surat ini","toEmail":"E-Mail","toUrl":"URL","toPhone":"Phone","toolbar":"Masukkan/Sunting Sambungan","type":"Jenis Sambungan","unlink":"Buang Sambungan","upload":"Muat Naik"},"list":{"bulletedlist":"Senarai tidak bernombor","numberedlist":"Senarai bernombor"},"liststyle":{"bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","disc":"Disc","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"<not set>","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"magicline":{"title":"Insert paragraph here"},"maximize":{"maximize":"Maximize","minimize":"Minimize"},"newpage":{"toolbar":"Helaian Baru"},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"pastetext":{"button":"Tampal sebagai text biasa","pasteNotification":"Press %1 to paste. Your browser doesn‘t support pasting with the toolbar button or context menu option.","title":"Tampal sebagai text biasa"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Tampal dari Word","toolbar":"Tampal dari Word"},"preview":{"preview":"Prebiu"},"print":{"toolbar":"Cetak"},"removeformat":{"toolbar":"Buang Format"},"save":{"toolbar":"Simpan"},"selectall":{"toolbar":"Pilih Semua"},"showblocks":{"toolbar":"Show Blocks"},"sourcearea":{"toolbar":"Sumber"},"specialchar":{"options":"Special Character Options","title":"Sila pilih huruf istimewa","toolbar":"Masukkan Huruf Istimewa"},"scayt":{"btn_about":"About SCAYT","btn_dictionaries":"Dictionaries","btn_disable":"Disable SCAYT","btn_enable":"Enable SCAYT","btn_langs":"Languages","btn_options":"Options","text_title":"Spell Check As You Type"},"stylescombo":{"label":"Stail","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"table":{"border":"Saiz Border","caption":"Keterangan","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Buangkan Sel-sel","merge":"Cantumkan Sel-sel","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Tambahan Ruang Sel","cellSpace":"Ruangan Antara Sel","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Buangkan Lajur"},"columns":"Jaluran","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","heightUnit":"height unit","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Ciri-ciri Jadual","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Buangkan Baris"},"rows":"Barisan","summary":"Summary","title":"Ciri-ciri Jadual","toolbar":"Jadual","widthPc":"peratus","widthPx":"piksel-piksel","widthUnit":"width unit"},"undo":{"redo":"Ulangkan","undo":"Batalkan"},"widget":{"move":"Click and drag to move","label":"%1 widget"},"uploadwidget":{"abort":"Upload aborted by the user.","doneOne":"File successfully uploaded.","doneMany":"Successfully uploaded %1 files.","uploadOne":"Uploading file ({percentage}%)...","uploadMany":"Uploading files, {current} of {max} done ({percentage}%)..."},"wsc":{"btnIgnore":"Biar","btnIgnoreAll":"Biarkan semua","btnReplace":"Ganti","btnReplaceAll":"Gantikan Semua","btnUndo":"Batalkan","changeTo":"Tukarkan kepada","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Pemeriksa ejaan tidak dipasang. Adakah anda mahu muat turun sekarang?","manyChanges":"Pemeriksaan ejaan siap: %1 perkataan diubah","noChanges":"Pemeriksaan ejaan siap: Tiada perkataan diubah","noMispell":"Pemeriksaan ejaan siap: Tiada salah ejaan","noSuggestions":"- Tiada cadangan -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"Tidak terdapat didalam kamus","oneChange":"Pemeriksaan ejaan siap: Satu perkataan telah diubah","progress":"Pemeriksaan ejaan sedang diproses...","title":"Spell Checker","toolbar":"Semak Ejaan"},"image2":{"alt":"Text Alternatif","btnUpload":"Hantar ke Server","captioned":"Captioned image","captionPlaceholder":"Caption","infoTab":"Info Imej","lockRatio":"Tetapkan Nisbah","menu":"Ciri-ciri Imej","pathName":"image","pathNameCaption":"caption","resetSize":"Saiz Set Semula","resizer":"Click and drag to resize","title":"Ciri-ciri Imej","uploadTab":"Muat Naik","urlMissing":"Image source URL is missing.","altMissing":"Alternative text is missing."},"sourcedialog":{"toolbar":"Sumber","title":"Sumber"},"emoji":{"searchPlaceholder":"Search emoji…","searchLabel":"Input field responsible for searching and filtering emoji inside panel.","navigationLabel":"Groups navigation for emoji sections.","title":"Emoji List","groups":{"people":"People","nature":"Nature and animals","food":"Food and drinks","travel":"Travel and places","activities":"Activities","objects":"Objects","symbols":"Symbols","flags":"Flags"}},"placeholder":{"title":"Placeholder Properties","toolbar":"Placeholder","name":"Placeholder Name","invalidName":"The placeholder can not be empty and can not contain any of following characters: [, ], <, >","pathName":"placeholder"}};
|
export default function breedReducer(state = "", action) {
if (action.type === "SET_BREED") {
return action.payload;
} else if (action.type === "SET_ANIMAL") {
return "";
} else {
return state;
}
}
|
from django.contrib import admin
from myapp.models import Foo
admin.site.register(Foo)
|
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module level imports for tfx_bsl.beam."""
from tfx_bsl.public.beam.run_inference import RunInference
|
import json
import os
import re
from shishito.runtime.shishito_support import ShishitoSupport
from shishito.ui.selenium_support import SeleniumTest
class ShishitoControlTest(object):
""" Base class for ControlTest objects. """
def __init__(self):
self.shishito_support = ShishitoSupport()
# create control environment object
control_env_obj = self.shishito_support.get_module('test_environment')
self.test_environment = control_env_obj(self.shishito_support)
self.drivers = []
def start_browser(self, base_url = None):
""" Webdriver startup function.
:return: initialized webdriver
"""
config_section = self.shishito_support.get_opt('environment_configuration')
# call browser from proper environment
driver = self.test_environment.call_browser(config_section)
self.drivers.append(driver)
# load init url
if not base_url:
base_url = self.shishito_support.get_opt('base_url')
if base_url:
self.test_init(driver, base_url)
else:
self.test_init(driver)
return driver
def start_test(self, reload_page=None):
""" To be executed before every test-case (test function).
:param reload_page:
"""
def stop_browser(self):
""" Webdriver termination function. """
for driver in self.drivers:
driver.quit() # Cleanup the driver info
del self.drivers[:]
def stop_test(self, test_info, debug_events=None):
""" To be executed after every test-case (test function). If test failed, function saves
screenshots created during test.
:param test_info: information about test
"""
if test_info.test_status not in ('passed', None):
# save screenshot in case test fails
test_name = re.sub('[^A-Za-z0-9_.]+', '_', test_info.test_name)
# Capture screenshot and debug info from driver(s)
for driver in self.drivers:
if(self.shishito_support.test_platform == 'mobile'):
browser_name = 'appium'
else:
browser_name = driver.name
file_name = browser_name + '_' + test_name
ts = SeleniumTest(driver)
ts.save_screenshot(name=file_name)
#Save debug info to file
if debug_events is not None:
debugevent_folder = os.path.join(self.shishito_support.project_root, 'debug_events')
if not os.path.exists(debugevent_folder):
os.makedirs(debugevent_folder)
with open(os.path.join(debugevent_folder, file_name + '.json'), 'w') as logfile:
json.dump(debug_events, logfile)
def test_init(self, driver, url=None):
""" Executed only once after browser starts.
Suitable for general pre-test logic that do not need to run before every individual test-case.
:param WebDriver driver: driver instance to set up
:param str url: initial URL
"""
|
"""
ORY Hydra
Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here. # noqa: E501
The version of the OpenAPI document: v1.9.1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
import nulltype # noqa: F401
from ory_hydra_client.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
class PluginConfigRootfs(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
}
additional_properties_type = None
_nullable = False
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'diff_ids': ([str],), # noqa: E501
'type': (str,), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {
'diff_ids': 'diff_ids', # noqa: E501
'type': 'type', # noqa: E501
}
_composed_schemas = {}
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""PluginConfigRootfs - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
diff_ids ([str]): diff ids. [optional] # noqa: E501
type (str): type. [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
|
from __future__ import division, print_function
from openmdao.api import ExplicitComponent
class Equilibrium(ExplicitComponent):
"""
Lift = weight constraint.
Note that we add information from each lifting surface.
Parameters
----------
L : float
Total lift for the lifting surface.
structural_weight : float
Total weight of the structural spar.
fuelburn : float
Computed fuel burn in kg based on the Breguet range equation.
Returns
-------
L_equals_W : float
Equality constraint for lift = total weight. L_equals_W = 0 for the constraint to be satisfied.
total_weight : float
Total weight of the entire aircraft, including W0, all structural weights,
and fuel.
"""
def initialize(self):
self.options.declare('surfaces', types=list)
def setup(self):
for surface in self.options['surfaces']:
name = surface['name']
self.add_input(name + '_structural_weight', val=1., units='N')
self.declare_partials('L_equals_W',name+'_structural_weight')
self.declare_partials('total_weight',name+'_structural_weight')
self.add_input('fuelburn', val=123., units='kg')
self.add_input('W0', val=1000., units='kg')
self.add_input('load_factor', val=1.05)
self.add_input('CL', val=0.7)
self.add_input('S_ref_total', val=15., units='m**2')
self.add_input('v', val=100., units='m/s')
self.add_input('rho', val=1.2, units='kg/m**3')
self.add_output('L_equals_W', val=1.)
self.add_output('total_weight', val=1., units='N')
self.declare_partials('L_equals_W','CL')
self.declare_partials('L_equals_W','S_ref_total')
self.declare_partials('L_equals_W','W0')
self.declare_partials('L_equals_W','fuelburn')
self.declare_partials('L_equals_W','load_factor')
self.declare_partials('L_equals_W','rho')
self.declare_partials('L_equals_W','v')
self.declare_partials('total_weight','W0')
self.declare_partials('total_weight','fuelburn')
self.declare_partials('total_weight','load_factor')
def compute(self, inputs, outputs):
g = 9.80665 * inputs['load_factor']
W0 = inputs['W0'] * g
rho = inputs['rho']
v = inputs['v']
structural_weight = 0.
symmetry = False
for surface in self.options['surfaces']:
name = surface['name']
structural_weight += inputs[name + '_structural_weight']
if surface['symmetry']:
symmetry = True
S_ref_tot = inputs['S_ref_total']
tot_weight = structural_weight * inputs['load_factor'] + inputs['fuelburn'] * g + W0
outputs['total_weight'] = tot_weight
outputs['L_equals_W'] = 1 - (0.5 * rho * v**2 * S_ref_tot) * inputs['CL'] / tot_weight
def compute_partials(self, inputs, partials):
g = 9.80665 * inputs['load_factor']
W0 = inputs['W0'] * g
rho = inputs['rho']
v = inputs['v']
structural_weight = 0.
for surface in self.options['surfaces']:
name = surface['name']
structural_weight += inputs[name + '_structural_weight']
S_ref_tot = inputs['S_ref_total']
tot_weight = structural_weight * inputs['load_factor'] + inputs['fuelburn'] * g + W0
L = inputs['CL'] * (0.5 * rho * v**2 * S_ref_tot)
partials['total_weight', 'fuelburn'] = g
partials['total_weight', 'W0'] = g
partials['total_weight', 'load_factor'] = (inputs['fuelburn'] + inputs['W0']) * 9.80665 \
+ structural_weight
partials['L_equals_W', 'fuelburn'] = L / tot_weight**2 * g
partials['L_equals_W', 'W0'] = L / tot_weight**2 * g
partials['L_equals_W', 'load_factor'] = L / tot_weight**2 * (inputs['fuelburn'] * 9.80665 + inputs['W0'] * 9.80665 + structural_weight)
partials['L_equals_W', 'rho'] = -.5 * S_ref_tot * v**2 * inputs['CL'] / tot_weight
partials['L_equals_W', 'v'] = - rho * S_ref_tot * v * inputs['CL'] / tot_weight
partials['L_equals_W', 'CL'] = - .5 * rho * v**2 * S_ref_tot / tot_weight
partials['L_equals_W', 'S_ref_total'] = - .5 * rho * v**2 * inputs['CL'] / tot_weight
for surface in self.options['surfaces']:
name = surface['name']
partials['total_weight', name + '_structural_weight'] = 1.0 * inputs['load_factor']
partials['L_equals_W', name + '_structural_weight'] = L / tot_weight**2 * inputs['load_factor']
|
var searchData=
[
['smartfactory_5fmqttcommunication_113',['SmartFactory_MQTTCommunication',['../md__c_1__semesterarbeit__smart_factory__sortic_00__code_1__code_neu__smart_factory__m_q_t_t_communication__r_e_a_d_m_e.html',1,'']]]
];
|
/*! firebase-admin v7.1.0 */
"use strict";
/*!
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var validator = require("./validator");
/**
* Renames properties on an object given a mapping from old to new property names.
*
* For example, this can be used to map underscore_cased properties to camelCase.
*
* @param {object} obj The object whose properties to rename.
* @param {object} keyMap The mapping from old to new property names.
*/
function renameProperties(obj, keyMap) {
Object.keys(keyMap).forEach(function (oldKey) {
if (oldKey in obj) {
var newKey = keyMap[oldKey];
// The old key's value takes precedence over the new key's value.
obj[newKey] = obj[oldKey];
delete obj[oldKey];
}
});
}
exports.renameProperties = renameProperties;
/**
* Defines a new read-only property directly on an object and returns the object.
*
* @param {object} obj The object on which to define the property.
* @param {string} prop The name of the property to be defined or modified.
* @param {any} value The value associated with the property.
*/
function addReadonlyGetter(obj, prop, value) {
Object.defineProperty(obj, prop, {
value: value,
// Make this property read-only.
writable: false,
// Include this property during enumeration of obj's properties.
enumerable: true,
});
}
exports.addReadonlyGetter = addReadonlyGetter;
/**
* Determines the Google Cloud project ID associated with a Firebase app by examining
* the Firebase app options, credentials and the local environment in that order.
*
* @param {FirebaseApp} app A Firebase app to get the project ID from.
*
* @return {string} A project ID string or null.
*/
function getProjectId(app) {
var options = app.options;
if (validator.isNonEmptyString(options.projectId)) {
return options.projectId;
}
var cert = options.credential.getCertificate();
if (cert != null && validator.isNonEmptyString(cert.projectId)) {
return cert.projectId;
}
var projectId = process.env.GOOGLE_CLOUD_PROJECT || process.env.GCLOUD_PROJECT;
if (validator.isNonEmptyString(projectId)) {
return projectId;
}
return null;
}
exports.getProjectId = getProjectId;
/**
* Encodes data using web-safe-base64.
*
* @param {Buffer} data The raw data byte input.
* @return {string} The base64-encoded result.
*/
function toWebSafeBase64(data) {
return data.toString('base64').replace(/\//g, '_').replace(/\+/g, '-');
}
exports.toWebSafeBase64 = toWebSafeBase64;
/**
* Formats a string of form 'project/{projectId}/{api}' and replaces
* with corresponding arguments {projectId: '1234', api: 'resource'}
* and returns output: 'project/1234/resource'.
*
* @param {string} str The original string where the param need to be
* replaced.
* @param {object=} params The optional parameters to replace in the
* string.
* @return {string} The resulting formatted string.
*/
function formatString(str, params) {
var formatted = str;
Object.keys(params || {}).forEach(function (key) {
formatted = formatted.replace(new RegExp('{' + key + '}', 'g'), params[key]);
});
return formatted;
}
exports.formatString = formatString;
|
const { app } = require("../app");
const { ErrCode } = require("../const");
const { CodeError } = require("../util/CodeError");
class NetMgr {
static listen(method, route, func) {
app.http.listen(method, route, (req, res, params, body) => {
const run = async () => {
let code = ErrCode.EC_OK;
let data = {};
try {
data = await func(req, res, params, body);
} catch (e) {
if (e instanceof CodeError) {
code = e.code;
console.error(e.message);
} else {
code = ErrCode.EC_INNER_ERROR;
console.error(route, params, body, e);
}
} finally {
res.json({
code,
data,
});
}
};
run();
});
}
}
module.exports = {
NetMgr,
};
|
import React from "react";
const Result = ({score, playAgain}) => (
<div className="score-board">
<div className="score">You scored {score} / 5 correct answers!</div>
<button className="playBtn" onClick={playAgain}>
Play again!
</button>
</div>
);
export default Result;
|
var searchData=
[
['test_2ecpp_189',['test.cpp',['../test_8cpp.html',1,'']]],
['test0_2ecpp_190',['test0.cpp',['../test0_8cpp.html',1,'']]],
['test16_2ecpp_191',['test16.cpp',['../test16_8cpp.html',1,'']]],
['test32_2ecpp_192',['test32.cpp',['../test32_8cpp.html',1,'']]],
['test_5fissue_5f29_2ecpp_193',['test_issue_29.cpp',['../test__issue__29_8cpp.html',1,'']]],
['test_5fmatch_2ecpp_194',['test_match.cpp',['../test__match_8cpp.html',1,'']]],
['test_5fmatch2_2ecpp_195',['test_match2.cpp',['../test__match2_8cpp.html',1,'']]],
['test_5fpthread_2ecpp_196',['test_pthread.cpp',['../test__pthread_8cpp.html',1,'']]],
['test_5freplace_2ecpp_197',['test_replace.cpp',['../test__replace_8cpp.html',1,'']]],
['test_5freplace2_2ecpp_198',['test_replace2.cpp',['../test__replace2_8cpp.html',1,'']]],
['test_5fshorts_2ecpp_199',['test_shorts.cpp',['../test__shorts_8cpp.html',1,'']]],
['testcovme_2ecpp_200',['testcovme.cpp',['../testcovme_8cpp.html',1,'']]],
['testio_2ecpp_201',['testio.cpp',['../testio_8cpp.html',1,'']]],
['testmd_2ecpp_202',['testmd.cpp',['../testmd_8cpp.html',1,'']]],
['testme_2ecpp_203',['testme.cpp',['../testme_8cpp.html',1,'']]],
['teststdthread_2ecpp_204',['teststdthread.cpp',['../teststdthread_8cpp.html',1,'']]]
];
|
module.exports={D:{"4":0,"5":0,"6":0,"7":0,"8":0.003853,"9":0,"10":0,"11":0.034677,"12":0.003853,"13":0,"14":0.003853,"15":0,"16":0.007706,"17":0,"18":0.007706,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0.003853,"25":0,"26":0,"27":0.003853,"28":0,"29":0,"30":0.019265,"31":0.042383,"32":0,"33":0,"34":0.003853,"35":0.007706,"36":0.003853,"37":0,"38":0.003853,"39":0,"40":0.019265,"41":0.003853,"42":0.003853,"43":0.003853,"44":0.034677,"45":0.003853,"46":0.003853,"47":0.011559,"48":0,"49":0.204209,"50":0.007706,"51":0.007706,"52":0,"53":0.007706,"54":0.003853,"55":0.003853,"56":0.084766,"57":0.050089,"58":0.019265,"59":0.034677,"60":0.007706,"61":0.007706,"62":0.03853,"63":0.119443,"64":0.011559,"65":0.007706,"66":0.200356,"67":0.104031,"68":0.304387,"69":0.227327,"70":7.852414,"71":0,"72":0.003853,"73":0},C:{"2":0,"3":0,"4":0,"5":0.003853,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0.080913,"31":0,"32":0,"33":0,"34":0,"35":0.003853,"36":0,"37":0,"38":0,"39":0,"40":0.007706,"41":0,"42":0,"43":0.007706,"44":0.023118,"45":0,"46":0.011559,"47":0.015412,"48":0.030824,"49":0,"50":0,"51":0.003853,"52":0.061648,"53":0.003853,"54":0,"55":0,"56":0.003853,"57":0.003853,"58":0.007706,"59":0.003853,"60":0.023118,"61":0.019265,"62":0.046236,"63":0.593362,"64":0,"65":0,"3.5":0,"3.6":0},F:{"9":0,"11":0,"12":0.007706,"15":0,"16":0.003853,"17":0.003853,"18":0.007706,"19":0.003853,"20":0.007706,"21":0.007706,"22":0.003853,"23":0,"24":0,"25":0.007706,"26":0,"27":0,"28":0.011559,"29":0.003853,"30":0.015412,"31":0,"32":0,"33":0.003853,"34":0,"35":0.023118,"36":0.011559,"37":0.023118,"38":0,"39":0.003853,"40":0,"41":0,"42":0.003853,"43":0.003853,"44":0,"45":0.003853,"46":0.003853,"47":0,"48":0.003853,"49":0,"50":0,"51":0,"52":0.003853,"53":0.007706,"54":0.007706,"55":0.003853,"56":0.890043,"57":0,"9.5-9.6":0,"10.0-10.1":0.003853,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0.034677,"12.1":0.061648},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0.003853,"11":0.03853,"12":0.050089,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0.003853,"10.1":0.046236,"11.1":0.015412},G:{"8":0.064582557190033,"3.2":0.0003986577604323,"4.0-4.1":0,"4.2-4.3":0.0003986577604323,"5.0-5.1":0.0047838931251876,"6.0-6.1":0.0023919465625938,"7.0-7.1":0.009169128489943,"8.1-8.4":0.022324834584209,"9.0-9.2":0.012757048333834,"9.3":0.092089942659862,"10.0-10.2":0.10803625307715,"10.3":0.13953021615131,"11.0-11.2":0.25195170459322,"11.3-11.4":0.67054235304713,"12.0-12.1":2.6048298066647},I:{"3":0.0042819739413681,"4":0.53524674267101,_:"67","2.1":0,"2.2":0.0042819739413681,"2.3":0.11989527035831,"4.1":0.20981672312704,"4.2-4.3":1.0148278241042,"4.4":0,"4.4.3-4.4.4":2.0553474918567},B:{"12":0.003853,"13":0.003853,"14":0.061648,"15":0.007706,"16":0.007706,"17":0.127149,_:"18"},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.019265,"9":0.050089,"10":0.007706,"11":0.104031,"5.5":0},P:{"4":3.3283845243243,"5":0.38678474594595,"6.2":0.47839165945946,_:"7.2"},N:{"10":0.048005142857143,"11":0.20402185714286},J:{"7":0,"10":0},R:{_:"0"},M:{"0":0.024588},O:{"0":5.765886},Q:{_:"1.2"},H:{"0":20.874842335052},L:{"0":30.948292}};
|
/*
* (c) 2011-2019 Corporate Web Solutions Ltd.
* All client side / JavaScript code may not be used in any way without a valid JSCharting license.
* To license JSCharting for your own use, please visit www.JSCharting.com
* */
JSC.maps()['th']={"type":"Topology","transform":{"scale":[0.00003836891335019133,0.000017361698615769864],"translate":[-193.34360462099997,-90]},"objects":{"countries":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","properties":{"name":"Thailand","iso_a3":"THA","iso_n3":"764","continent":"Asia","hasc":"TH","cent":[101.33066367487868,16.081235693994387],"bbox":[97.37285571923096,5.637646016310157,8.278131424217179,14.80638645180224],"nameAlt":"THA"},"arcs":[[[16208]],[[16259]],[[-16261]],[[16209]],[[16210]],[[16269]],[[16211]],[[16251]],[[16252]],[[16212]],[[16232]],[[-16232]],[[16233]],[[16213]],[[16234]],[[16235]],[[16214]],[[16240]],[[16241]],[[16245]],[[-16247]],[[16247]],[[16242]],[[16250]],[[16215]],[[16216]],[[16398]],[[16217]],[[-16400]],[[16218]],[[11843,11842,11841,11795,11804,11803,11802,11820,11893,11892,11891,11890,11889,11888,-16244,-16239,-16254,-16271,-16263,12292,12291,12285,12288,12275,12274,12300,-16437,-16438,-16265,-16258,-16269,-16226,-16249,-16225,-16367,-16365,-16374,-16373,-16358,-16370,-16389,-16386,-16398,-16394,-16401,9779,9785,9771,9797,9796,9769,9768,9765,9764,9795,9794,9790,9789,9822,9825,10138,10143,10150,10149,10148,10147,10182,10178,10177,10176,10155,10154,10158,10135,10134,10133,10132,10131,10130,10123]]]}]},"provinces":{"type":"GeometryCollection","geometries":[{"id":"TH.MH","type":"Polygon","arcs":[[11841,11795,11804,-16220,-16221]],"properties":{"name":"Mae Hong Son","fips":"TH01","postal":"MH","hasc":"TH.MH","region":"Northern","bbox":[97.37285571923096,17.554872201462132,1.26383363684198,2.2481142686601885],"cent":[98.18674089847451,19.353363616390283]}},{"id":"TH.CP","type":"Polygon","arcs":[[-16222,11889,-16223,-16224,-16225]],"properties":{"name":"Chumphon","fips":"TH58","postal":"CP","hasc":"TH.CP","region":"Southern","bbox":[98.64102504328153,9.60116555500288,0.870552275002467,1.4382431133303726],"cent":[99.19792088176939,10.809289770200392]}},{"id":"TH.NT","type":"Polygon","arcs":[[-16226,-16227,-16228,-16229,-16230,-16231]],"properties":{"name":"Nakhon Si Thammarat","nameAlt":"Nakhon Thammarat|Nagara Sridharmaraj|Nakhon Sri Thammarat|Nakhornsrithamrat|Nakornsrithamaraj","fips":"TH64","postal":"NT","hasc":"TH.NT","region":"Southern","bbox":[99.26605464175614,7.801712301971406,1.0763631262128683,1.5105719497636727],"cent":[99.71018631848754,8.632526874341426]}},{"id":"TH.PU","type":"Polygon","arcs":[[-16232]],"properties":{"name":"Phuket","fips":"TH62","postal":"PU","hasc":"TH.PU","region":"Southern","bbox":[98.25415128997153,7.767735457780347,0.18562880278824423,0.4219413614590479],"cent":[98.349727457858,7.97448672489528]}},{"id":"TH.PG","type":"MultiPolygon","arcs":[[[16232]],[[16233]],[[16234]],[[16235]],[[-16237,-16238,-16239,-16240]],[[16240]],[[16241]]],"properties":{"name":"Phangnga","fips":"TH59","postal":"PG","hasc":"TH.PG","region":"Southern","bbox":[97.87614075564542,8.10252109218824,0.837132951474473,1.34245862206717],"cent":[98.44533204995157,8.499062288572421]}},{"id":"TH.RN","type":"MultiPolygon","arcs":[[[16242]],[[16222,11888,-16244,16237,-16245]]],"properties":{"name":"Ranong","fips":"TH59","postal":"RN","hasc":"TH.RN","region":"Southern","bbox":[98.38959355409767,9.306433359301565,0.5845887638035379,1.4817688917601117],"cent":[98.77112463958808,10.062135494099222]}},{"id":"TH.ST","type":"MultiPolygon","arcs":[[[16245]],[[-16247]],[[16247]],[[-16249,16223,16244,16236,-16250,16226]],[[16250]]],"properties":{"name":"Surat Thani","fips":"TH60","postal":"ST","hasc":"TH.ST","region":"Southern","bbox":[98.45873433595474,8.313552538862922,1.627225615181601,1.4837134020050797],"cent":[99.10999072555015,9.037611588997445]}},{"id":"TH.KR","type":"MultiPolygon","arcs":[[[16251]],[[16252]],[[16249,16239,-16254,-16255,16227]]],"properties":{"name":"Krabi","fips":"TH63","postal":"KR","hasc":"TH.KR","region":"Southern","bbox":[98.64923599073845,7.479201388484867,0.6918298766173052,1.1941897158884984],"cent":[99.01962204301041,8.184591230480873]}},{"id":"TH.PL","type":"Polygon","arcs":[[16229,-16256,-16257,-16258,-16259]],"properties":{"name":"Phatthalung","fips":"TH66","postal":"PL","hasc":"TH.PL","region":"Southern","bbox":[99.74428477775288,7.091740360476734,0.6344683511587732,0.8120066442595544],"cent":[100.13391239336754,7.327222287312005]}},{"id":"TH.SA","type":"MultiPolygon","arcs":[[[16259]],[[-16261]],[[-16262,-16263,12292,-16264]]],"properties":{"name":"Satun","fips":"TH67","postal":"SA","hasc":"TH.SA","region":"Southern","bbox":[99.2478294079148,6.442291300356629,0.965553704457534,0.6873670098969455],"cent":[99.94679204720813,6.895953526888613]}},{"id":"TH.SG","type":"MultiPolygon","arcs":[[[-16265,16256,-16266,16263,12291,12285,-16267,-16268]],[[-16269,16230,16258]]],"properties":{"name":"Songkhla","fips":"TH68","postal":"SG","hasc":"TH.SG","region":"Southern","bbox":[100.03063197808538,6.29860588261252,1.070531051383682,1.6401770299303848],"cent":[100.64352822208238,6.753644718227747]}},{"id":"TH.TG","type":"MultiPolygon","arcs":[[[16269]],[[16228,16254,-16271,16261,16265,16255]]],"properties":{"name":"Trang","nameAlt":"Tab Tiang","fips":"TH65","postal":"TG","hasc":"TH.TG","region":"Southern","bbox":[99.25676936472539,7.063423430034405,0.7896706056602625,0.9156733466943194],"cent":[99.5497213270661,7.557887037249337]}},{"id":"TH.YL","type":"Polygon","arcs":[[-16272,16266,12288,12275,-16273]],"properties":{"name":"Yala","fips":"TH70","postal":"YL","hasc":"TH.YL","region":"Southern","bbox":[100.82371741703386,5.637646016310157,0.7779680870884818,1.0002248189531144],"cent":[101.1360748620788,6.3278011413878055]}},{"id":"TH.CR","type":"Polygon","arcs":[[11843,-16274,-16275,-16276,10130,10123]],"properties":{"name":"Chiang Rai","fips":"TH03","postal":"CR","hasc":"TH.CR","region":"Northern","bbox":[99.27054380461809,18.998427994568942,1.2781452415215995,1.4456044735434546],"cent":[99.8757118986695,19.75014232081154]}},{"id":"TH.CM","type":"Polygon","arcs":[[16273,11842,16220,-16277,-16278,-16279]],"properties":{"name":"Chiang Mai","fips":"TH02","postal":"CM","hasc":"TH.CM","region":"Northern","bbox":[98.08348636338988,17.28814442562806,1.5067472272619966,2.8646629099034158],"cent":[98.73327266816203,18.86370902607494]}},{"id":"TH.LG","type":"Polygon","arcs":[[16274,16278,-16280,-16281,-16282,-16283,-16284]],"properties":{"name":"Lampang","fips":"TH06","postal":"LG","hasc":"TH.LG","region":"Northern","bbox":[99.0120908042912,17.2268576295144,1.1123531669354065,2.2449544395121137],"cent":[99.72939133257522,18.64117892640703]}},{"id":"TH.LN","type":"Polygon","arcs":[[16277,-16285,16279]],"properties":{"name":"Lamphun","nameAlt":"Hariphunchai|Lampoon","fips":"TH05","postal":"LN","hasc":"TH.LN","region":"Northern","bbox":[98.68092871316568,17.485269151711506,0.6338160796318562,1.2210135402498707],"cent":[98.94097954807734,18.37660903609391]}},{"id":"TH.NA","type":"Polygon","arcs":[[10132,-16286,-16287,-16288]],"properties":{"name":"Nan","fips":"TH04","postal":"NA","hasc":"TH.NA","region":"Northern","bbox":[100.3525471610935,18.01594683160114,0.9653234909774824,1.596963762075731],"cent":[100.79907432973812,18.766519799776734]}},{"id":"TH.PY","type":"Polygon","arcs":[[10131,16275,16283,-16289,16285]],"properties":{"name":"Phayao","fips":"TH41","postal":"PY","hasc":"TH.PY","region":"Northern","bbox":[99.68738367925457,18.81173764935356,0.9384268827189999,0.9126524111351699],"cent":[100.16168394256385,19.24068428258709]}},{"id":"TH.PR","type":"Polygon","arcs":[[16288,16282,-16290,-16291,16286]],"properties":{"name":"Phrae","fips":"TH07","postal":"PR","hasc":"TH.PR","region":"Northern","bbox":[99.31543543323781,17.72312442274756,1.2147981655804188,1.0919466727402352],"cent":[99.99968996655366,18.007030557660023]}},{"id":"TH.PS","type":"Polygon","arcs":[[-16292,-16293,-16294,-16295,-16296,-16297,10134]],"properties":{"name":"Phitsanulok","nameAlt":"Bisnulok|Phisanulauk|Phitsnulok|Pitsanuloke","fips":"TH12","postal":"PS","hasc":"TH.PS","region":"Central","bbox":[99.90443662207659,16.347018828763026,1.1885538288489101,1.3605147886275688],"cent":[100.5594282979725,16.918435039986605]}},{"id":"TH.SO","type":"Polygon","arcs":[[16289,16281,-16298,-16299,16292,-16300]],"properties":{"name":"Sukhothai","nameAlt":"Sawankhalokt|Sukhotai|Sukothai|Svargalok","fips":"TH09","postal":"SO","hasc":"TH.SO","region":"Central","bbox":[99.281709158403,16.688124121467055,0.8501783820135529,1.1187010503071377],"cent":[99.68934680185643,16.990173405049983]}},{"id":"TH.UD","type":"Polygon","arcs":[[10133,16287,16290,16299,16291]],"properties":{"name":"Uttaradit","fips":"TH10","postal":"UD","hasc":"TH.UD","region":"Northern","bbox":[99.89657099483983,17.16564028019519,1.2685913820973838,1.2059783092486072],"cent":[100.33534423133928,17.551553339154744]}},{"id":"TH.KN","type":"Polygon","arcs":[[-16301,11802,11820,11893,-16302,-16303,-16304,-16305]],"properties":{"name":"Kanchanaburi","nameAlt":"Kan Buri|Park Prag","fips":"TH50","postal":"KN","hasc":"TH.KN","region":"Western","bbox":[98.19122627207722,13.7236661679202,1.6968651929121847,1.9514375627139202],"cent":[99.15575858721243,14.484726817378629]}},{"id":"TH.KP","type":"Polygon","arcs":[[16298,-16306,-16307,-16308,16293]],"properties":{"name":"Kamphaeng Phet","nameAlt":"Gampheang Phet|Kambhengbhej","fips":"TH11","postal":"KP","hasc":"TH.KP","region":"Central","bbox":[99.00618199163526,15.78463868720101,1.0259847429841216,1.1032491385390983],"cent":[99.49165542793693,16.270068308158216]}},{"id":"TH.PC","type":"Polygon","arcs":[[16294,16307,-16309,-16310]],"properties":{"name":"Phichit","fips":"TH13","postal":"PC","hasc":"TH.PC","region":"Central","bbox":[99.99460356844955,15.930633210861018,0.7605102315141608,0.6628696531500964],"cent":[100.34935502822816,16.29521152009357]}},{"id":"TH.PH","type":"Polygon","arcs":[[-16311,16295,16309,-16312,-16313,-16314,-16315]],"properties":{"name":"Phetchabun","fips":"TH14","postal":"PH","hasc":"TH.PH","region":"Central","bbox":[100.63233327724308,15.302018189079831,1.158204018388858,1.813967633074256],"cent":[101.33825924044694,16.753192295539236]}},{"id":"TH.SH","type":"Polygon","arcs":[[-16316,16303,-16317,-16318,-16319,-16320,-16321]],"properties":{"name":"Suphan Buri","fips":"TH51","postal":"SH","hasc":"TH.SH","region":"Central","bbox":[99.27998255730225,14.061785248462314,1.0021576477936378,0.9380004911141953],"cent":[99.75847122999286,14.85908566590938]}},{"id":"TH.TK","type":"Polygon","arcs":[[16284,16276,16219,11803,16300,-16322,-16323,16305,16297,16280]],"properties":{"name":"Tak","fips":"TH08","postal":"TK","hasc":"TH.TK","region":"Western","bbox":[97.90798695372612,15.220626545969111,1.4380285034517897,2.5355545509428765],"cent":[98.77901555239112,17.173003550195126]}},{"id":"TH.UT","type":"Polygon","arcs":[[-16324,16321,16304,16315,-16325]],"properties":{"name":"Uthai Thani","fips":"TH15","postal":"UT","hasc":"TH.UT","region":"Central","bbox":[98.98039808186397,14.961173321855043,1.0772072423065993,0.8086384747280988],"cent":[99.53561508109522,15.446356406691901]}},{"id":"TH.AT","type":"Polygon","arcs":[[-16326,16318,-16327,-16328]],"properties":{"name":"Ang Thong","fips":"TH35","postal":"AT","hasc":"TH.AT","region":"Central","bbox":[100.19665426615168,14.455479126273516,0.318999145593466,0.3343689536411034],"cent":[100.35628305334313,14.605945155412012]}},{"id":"TH.CN","type":"Polygon","arcs":[[-16329,16324,16320,-16330]],"properties":{"name":"Chai Nat","nameAlt":"Chainat","fips":"TH32","postal":"CN","hasc":"TH.CN","region":"Central","bbox":[99.71823228558813,14.90901877921327,0.591073110159698,0.5106596413856437],"cent":[100.05305186163922,15.10817603935367]}},{"id":"TH.LB","type":"Polygon","arcs":[[16312,-16331,-16332,16327,-16333,-16334,-16335]],"properties":{"name":"Lop Buri","fips":"TH34","postal":"LB","hasc":"TH.LB","region":"Central","bbox":[100.44290595203321,14.655919936792571,1.0041144623745026,0.8416604254952915],"cent":[100.91749399368425,15.0262505240105]}},{"id":"TH.NN","type":"Polygon","arcs":[[-16336,-16337,-16338,-16339,-16340]],"properties":{"name":"Nakhon Nayok","nameAlt":"Nakon Nayok","fips":"TH43","postal":"NN","hasc":"TH.NN","region":"Eastern","bbox":[100.90528972681633,13.955358035947654,0.6102575668347754,0.5244274683879411],"cent":[101.23206692583176,14.290991615715937]}},{"id":"TH.PB","type":"Polygon","arcs":[[-16341,16339,-16342,-16343]],"properties":{"name":"Prachin Buri","fips":"TH74","postal":"PB","hasc":"TH.PB","region":"Eastern","bbox":[101.14083648587317,13.72314531696172,0.911952332507326,0.708739260892969],"cent":[101.52153656201914,13.9570292730564]}},{"id":"TH.NS","type":"Polygon","arcs":[[16308,16306,16322,16323,16328,-16344,16330,16311]],"properties":{"name":"Nakhon Sawan","fips":"TH16","postal":"NS","hasc":"TH.NS","region":"Central","bbox":[99.07877597569384,15.060378067745546,1.7537662914105567,1.277491145846966],"cent":[99.99286207066484,15.737448375044437]}},{"id":"TH.PA","type":"Polygon","arcs":[[16332,16326,16317,-16345,-16346,-16347,-16348]],"properties":{"name":"Phra Nakhon Si Ayutthaya","nameAlt":"Phranakhon Si Ayutthaya|Ayudhya|Ayutthaya|Phranakhornsri-ayuthaya","fips":"TH36","postal":"PA","hasc":"TH.PA","region":"Central","bbox":[100.22098015721568,14.113036982776066,0.601778036984399,0.5728666075259525],"cent":[100.53478340762419,14.31926896148541]}},{"id":"TH.PT","type":"Polygon","arcs":[[-16349,16346,-16350,-16351,-16352,16337]],"properties":{"name":"Pathum Thani","fips":"TH39","postal":"PT","hasc":"TH.PT","region":"Central","bbox":[100.35028339520582,13.947857782145633,0.5621429494936478,0.2939335575649835],"cent":[100.63204896545471,14.044855856142078]}},{"id":"TH.SB","type":"Polygon","arcs":[[16343,16329,16319,16325,16331]],"properties":{"name":"Sing Buri","fips":"TH33","postal":"SB","hasc":"TH.SB","region":"Central","bbox":[100.21150303561816,14.724793795201336,0.26555124929672047,0.4427580380993561],"cent":[100.34115157278276,14.87975910853611]}},{"id":"TH.SR","type":"Polygon","arcs":[[16333,16347,16348,16336,-16353]],"properties":{"name":"Saraburi","nameAlt":"Sara Buri","fips":"TH37","postal":"SR","hasc":"TH.SR","region":"Central","bbox":[100.59400273280622,14.213908451733687,0.6489334314917983,0.6686510987891552],"cent":[100.90274547854548,14.655218176934529]}},{"id":"TH.BM","type":"Polygon","arcs":[[-16354,16350,-16355,-16356,-16357,-16358,-16359]],"properties":{"name":"Bangkok Metropolis","nameAlt":"Bangkok|Krung Thep|Krung Thep Maha Nakhon|Phra Nakhon-Thonburi","fips":"TH40","postal":"BM","hasc":"TH.BM","region":"Central","bbox":[100.33175121005766,13.490637449099339,0.5924927599537,0.45916484329126206],"cent":[100.60332763165695,13.724811519177884]}},{"id":"TH.NO","type":"Polygon","arcs":[[16345,-16360,16354,16349]],"properties":{"name":"Nonthaburi","fips":"TH38","postal":"NO","hasc":"TH.NO","region":"Central","bbox":[100.28317616575632,13.798095769886004,0.2683521799712594,0.31811840373674727],"cent":[100.42675140254968,13.912618395231233]}},{"id":"TH.NP","type":"Polygon","arcs":[[16344,16316,16302,-16361,-16362,16355,16359]],"properties":{"name":"Nakhon Pathom","fips":"TH53","postal":"NP","hasc":"TH.NP","region":"Central","bbox":[99.81150711394244,13.661302946492356,0.5241577252769503,0.5158507892717523],"cent":[100.08208819849898,13.981130435840843]}},{"id":"TH.PE","type":"Polygon","arcs":[[-16363,11891,-16364,-16365,-16366]],"properties":{"name":"Phetchaburi","nameAlt":"Phetcha Buri|Bejraburi|Petchburi|Phet Buri|Tetchburit","fips":"TH56","postal":"PE","hasc":"TH.PE","region":"Western","bbox":[99.10210427501076,12.545258236073437,1.0022343856203406,0.7863807771026785],"cent":[99.61283898957853,12.938448624624776]}},{"id":"TH.PK","type":"Polygon","arcs":[[-16367,16363,11890,16221]],"properties":{"name":"Prachuap Khiri Khan","nameAlt":"Korh Luxk|Prachuab Girikhand|Prachuapkirikhan|Prachut Khirikhan","fips":"TH57","postal":"PK","hasc":"TH.PK","region":"Western","bbox":[99.14093361532113,10.964753364285443,0.879108542679603,1.671428087438784],"cent":[99.72955664966923,11.817181688879222]}},{"id":"TH.RT","type":"Polygon","arcs":[[16360,16301,11892,16362,-16368,-16369]],"properties":{"name":"Ratchaburi","fips":"TH52","postal":"RT","hasc":"TH.RT","region":"Western","bbox":[99.14676569015037,13.14640705064447,0.9319041674494315,0.798117285366942],"cent":[99.60869603015087,13.609315076157296]}},{"id":"TH.SP","type":"Polygon","arcs":[[16358,-16370,-16371]],"properties":{"name":"Samut Prakan","nameAlt":"Pak Nam|Samudh Prakarn|Samudraprakar|Samut Phrakhan","fips":"TH42","postal":"SP","hasc":"TH.SP","region":"Central","bbox":[100.46696326070375,13.478189111191824,0.4792660966572271,0.21379195675459073],"cent":[100.71137153217862,13.61074012437967]}},{"id":"TH.SS","type":"Polygon","arcs":[[16356,16361,16368,-16372,-16373]],"properties":{"name":"Samut Sakhon","nameAlt":"Krokkrak Maha Chai|Mahachai|Samudrasagara","fips":"TH55","postal":"SS","hasc":"TH.SS","region":"Central","bbox":[100.03792207162192,13.425965121755596,0.36285481355275806,0.30412487465244453],"cent":[100.21483706186058,13.587151305321392]}},{"id":"TH.SM","type":"Polygon","arcs":[[16367,16365,-16374,16371]],"properties":{"name":"Samut Songkhram","nameAlt":"Mae Klong|Samudrasonggram","fips":"TH54","postal":"SM","hasc":"TH.SM","region":"Central","bbox":[99.85870087736319,13.291568212770912,0.23025184901450757,0.21804557291545734],"cent":[99.98977102131289,13.426756467978496]}},{"id":"TH.SI","type":"Polygon","arcs":[[-16375,-16376,-16377,9789,9822,-16378]],"properties":{"name":"Si Sa Ket","nameAlt":"Sisaket|Khukhan|Khukhandh|Srisaket","fips":"TH30","postal":"SI","hasc":"TH.SI","region":"Northeastern","bbox":[103.9328655725399,14.357038295122095,0.982742977638452,1.207488777028189],"cent":[104.45253043111572,14.731359816000833]}},{"id":"TH.UR","type":"Polygon","arcs":[[10150,-16379,-16380,16377,9825,10138,10143]],"properties":{"name":"Ubon Ratchathani","fips":"TH75","postal":"UR","hasc":"TH.UR","region":"Northeastern","bbox":[104.4036905082601,14.214064707021237,1.247296635188036,1.8817824278674493],"cent":[104.95487577971707,15.361951988020381]}},{"id":"TH.AC","type":"Polygon","arcs":[[10149,-16381,-16382,16378]],"properties":{"name":"Amnat Charoen","fips":"TH77","postal":"AC","hasc":"TH.AC","region":"Northeastern","bbox":[104.42460156603593,15.47386428197872,0.6823527550197923,0.8200971958145118],"cent":[104.7408105223042,15.851108992053396]}},{"id":"TH.YS","type":"Polygon","arcs":[[-16383,-16384,16374,16379,16381]],"properties":{"name":"Yasothon","fips":"TH72","postal":"YS","hasc":"TH.YS","region":"Northeastern","bbox":[104.01002545728713,15.284795384052998,0.8028311429393966,1.0570670202211403],"cent":[104.22907576037237,15.82389956436578]}},{"id":"TH.CB","type":"Polygon","arcs":[[-16385,-16386,-16387,-16388]],"properties":{"name":"Chon Buri","fips":"TH46","postal":"CB","hasc":"TH.CB","region":"Eastern","bbox":[100.83741511909986,12.639601706351527,0.880221241166737,0.9497543610770691],"cent":[101.30012003393162,13.199956779386998]}},{"id":"TH.CC","type":"Polygon","arcs":[[16338,16351,16353,16370,-16389,16384,-16390,-16391,16341]],"properties":{"name":"Chachoengsao","nameAlt":"Chaxerngsao|Pad Rew|Paed Riu|Petrieu|Shajeun Dhrao","fips":"TH44","postal":"CC","hasc":"TH.CC","region":"Eastern","bbox":[100.84098342804143,13.17172040722626,1.1543671270538312,0.7967109877790648],"cent":[101.37975239665111,13.681615439404862]}},{"id":"TH.CT","type":"Polygon","arcs":[[-16392,16389,16387,-16393,-16394,-16395,9796,9769]],"properties":{"name":"Chanthaburi","nameAlt":"Chantaburi|Muang Chan","fips":"TH48","postal":"CT","hasc":"TH.CT","region":"Eastern","bbox":[101.69261982876228,12.323670876640364,0.8025625605459368,1.012516901573079],"cent":[102.15304512158889,12.910930679552749]}},{"id":"TH.SK","type":"Polygon","arcs":[[-16396,16342,16390,16391,9768,9765,-16397]],"properties":{"name":"Sa Kaeo","nameAlt":"Srakaeo","fips":"TH80","postal":"SK","hasc":"TH.SK","region":"Eastern","bbox":[101.8762534480563,13.161372834851264,1.0376872615559023,1.0242534098373426],"cent":[102.33954843400183,13.919320358130896]}},{"id":"TH.RY","type":"Polygon","arcs":[[16386,-16398,16392]],"properties":{"name":"Rayong","fips":"TH47","postal":"RY","hasc":"TH.RY","region":"Eastern","bbox":[100.97803718652833,12.624826900829504,0.845765956978255,0.509149173606076],"cent":[101.43205373503517,12.848852537216178]}},{"id":"TH.TT","type":"MultiPolygon","arcs":[[[16398]],[[-16400]],[[9771,9797,16394,-16401,9779,9785]]],"properties":{"name":"Trat","fips":"TH49","postal":"TT","hasc":"TH.TT","region":"Eastern","bbox":[102.26320393919295,11.645904886077943,0.6505832947658519,1.1001240327882584],"cent":[102.53416378761557,12.338983026734546]}},{"id":"TH.BR","type":"Polygon","arcs":[[-16402,-16403,-16404,16396,9764,9795,-16405]],"properties":{"name":"Buri Ram","nameAlt":"Buri Rum","fips":"TH28","postal":"BR","hasc":"TH.BR","region":"Northeastern","bbox":[102.4445737925993,14.148663188335632,1.0553753306103886,1.64055898729994],"cent":[102.96317913500627,14.837697963001606]}},{"id":"TH.CY","type":"Polygon","arcs":[[16313,-16406,-16407]],"properties":{"name":"Chaiyaphum","fips":"TH26","postal":"CY","hasc":"TH.CY","region":"Northeastern","bbox":[101.3004127964966,15.215400674685768,1.1527556326931858,1.4598931515042324],"cent":[101.81176892792118,16.10593549710335]}},{"id":"TH.KK","type":"Polygon","arcs":[[-16408,-16409,-16410,16314,16406,-16411,16402,-16412,-16413]],"properties":{"name":"Khon Kaen","fips":"TH22","postal":"KK","hasc":"TH.KK","region":"Northeastern","bbox":[101.7514393729281,15.636543398008484,1.4290118088145505,1.377095210805635],"cent":[102.46127123324388,16.683135758220764]}},{"id":"TH.KL","type":"Polygon","arcs":[[-16414,16412,-16415,-16416,-16417,-16418]],"properties":{"name":"Kalasin","fips":"TH23","postal":"KL","hasc":"TH.KL","region":"Northeastern","bbox":[103.11311373881304,16.19171843464497,1.1311923033903781,0.8527719126093842],"cent":[103.68066194018505,16.61810439094966]}},{"id":"TH.MS","type":"Polygon","arcs":[[16414,16411,16401,-16419,-16420]],"properties":{"name":"Maha Sarakham","fips":"TH24","postal":"MS","hasc":"TH.MS","region":"Northeastern","bbox":[102.85485258305292,15.401726424230205,0.6707269742747144,1.241708684999864],"cent":[103.18285219636529,15.99774659303014]}},{"id":"TH.NR","type":"Polygon","arcs":[[16405,16334,16352,16335,16340,16395,16403,16410]],"properties":{"name":"Nakhon Ratchasima","nameAlt":"Khorat|Nagara Rajasima|Nakaun Rachasima","fips":"TH32","postal":"NR","hasc":"TH.NR","region":"Northeastern","bbox":[101.19313331476948,14.137794765002155,1.825324314808654,1.6680425562087038],"cent":[102.05488960447796,15.105259447603203]}},{"id":"TH.RE","type":"Polygon","arcs":[[-16421,16415,16419,-16422,16375,16383]],"properties":{"name":"Roi Et","fips":"TH25","postal":"RE","hasc":"TH.RE","region":"Northeastern","bbox":[103.32824823596755,15.410251018250548,1.0275962373448237,1.046979873325384],"cent":[103.7676903211606,15.630116791648879]}},{"id":"TH.SU","type":"Polygon","arcs":[[16418,16404,9794,9790,16376,16421]],"properties":{"name":"Surin","fips":"TH29","postal":"SU","hasc":"TH.SU","region":"Northeastern","bbox":[103.11576119383423,14.341933617326376,0.9549255154595357,1.1403510884809975],"cent":[103.61259079834535,15.379653107844083]}},{"id":"TH.LE","type":"Polygon","arcs":[[10154,10158,10135,16296,16310,16409,-16423,-16424,-16425]],"properties":{"name":"Loei","fips":"TH18","postal":"LE","hasc":"TH.LE","region":"Northeastern","bbox":[100.92282432021736,16.76649482901864,1.223738122391012,1.4458822607213193],"cent":[101.47010376549682,17.34484773330717]}},{"id":"TH.NK","type":"Polygon","arcs":[[-16426,10176,10155,16424,-16427,-16428]],"properties":{"name":"Nong Khai","fips":"TH17","postal":"NK","hasc":"TH.NK","region":"Northeastern","bbox":[102.05839067972963,17.600238319945134,1.3772905136185045,0.6949367104934225],"cent":[102.66433033175521,17.767023130463556]}},{"id":"TH.SN","type":"Polygon","arcs":[[-16429,16427,-16430,16417,-16431,-16432]],"properties":{"name":"Sakon Nakhon","fips":"TH20","postal":"SN","hasc":"TH.SN","region":"Northeastern","bbox":[103.26981238093524,16.780054315637557,1.1743956998226395,1.2816579535147525],"cent":[103.8537837349385,17.292717497043455]}},{"id":"TH.UN","type":"Polygon","arcs":[[16426,16423,-16433,16407,16413,16429]],"properties":{"name":"Udon Thani","fips":"TH76","postal":"UN","hasc":"TH.UN","region":"Northeastern","bbox":[102.02512483185504,16.827764263433693,1.6250002182072762,1.2606329364910493],"cent":[103.05084173630529,17.117709838826634]}},{"id":"TH.NB","type":"Polygon","arcs":[[16432,16422,16408]],"properties":{"name":"Nong Bua Lam Phu","nameAlt":"Nong Bua Lamphu","fips":"TH79","postal":"NB","hasc":"TH.NB","region":"Northeastern","bbox":[101.9463534527471,16.770036615536256,0.7294697806138402,0.8519385510758326],"cent":[102.31208984513333,17.085253879434312]}},{"id":"TH.NF","type":"Polygon","arcs":[[10178,-16434,16431,-16435,10147,10182]],"properties":{"name":"Nakhon Phanom","fips":"TH73","postal":"NF","hasc":"TH.NF","region":"Northeastern","bbox":[104.00565140116518,16.814378393800936,0.8107735080029101,1.2042595010856445],"cent":[104.37493193375356,17.488763714408897]}},{"id":"TH.MD","type":"Polygon","arcs":[[16434,16430,16416,16420,16382,16380,10148]],"properties":{"name":"Mukdahan","fips":"TH78","postal":"MD","hasc":"TH.MD","region":"Northeastern","bbox":[104.07283536844139,16.190642009330787,0.9151753212287872,0.7055447083476594],"cent":[104.4667301072306,16.677467858090672]}},{"id":"TH.NW","type":"Polygon","arcs":[[-16436,16272,12274,12300,-16437]],"properties":{"name":"Narathiwat","fips":"TH31","postal":"NW","hasc":"TH.NW","region":"Southern","bbox":[101.3823304264993,5.739906421157045,0.6907555470434659,0.8345074056655903],"cent":[101.72700309343968,6.207230568329775]}},{"id":"TH.PI","type":"Polygon","arcs":[[-16438,16267,16271,16435]],"properties":{"name":"Pattani","fips":"TH69","postal":"PI","hasc":"TH.PI","region":"Southern","bbox":[101.06805065724788,6.5516700016359835,0.6554177778479584,0.3976176216983589],"cent":[101.34864631646664,6.754454988702147]}},{"id":"TH.BK","type":"Polygon","arcs":[[10177,16425,16428,16433]],"properties":{"name":"Bueng Kan","nameAlt":"บึงกาฬ","fips":"TH81","postal":"NK","hasc":"TH.BK","region":"Northeastern","bbox":[103.26075731738459,17.80118261972406,0.9425323564474297,0.6402299981551351],"cent":[103.73175711042029,18.172516018654036]}}]}},"arcs":[16219,[[7601107,6203074],[-10285,-8123]],[[7605672,6318830],[3401,-13370],[-505,-15524],[1246,-8568],[-4668,-2762],[-7858,7946],[-1892,-18132],[834,-16739],[2413,-4649],[-2818,-6840],[66,-21467],[3659,-7723],[1557,-7928]],[[7622956,5819673],[2481,-4300],[6966,1860]],[[7612762,5736833],[-2835,10650],[6836,13317],[1229,18644],[-1226,4791],[1844,9858],[-2476,11111]],[[7623061,5747780],[-9449,-6544],[-850,-4403]],2,[[7626217,5664282],[562,8349],[4162,6600],[2095,13911],[4130,4902],[2497,10766],[-264,11384]],[[7628093,5641331],[-1876,22951]],[[7638681,5636022],[93,7297],[-3680,86],[-1759,-5770],[-5242,3696]],[[7648724,5633188],[-4436,5877],[-5607,-3043]],[[7654270,5641083],[-4879,-3707],[-667,-4188]],5,[[7606539,5719857],[-1363,-24149],[3678,-5179],[-480,-9796],[3436,-121]],[[7603374,5722074],[3165,-2217]],1,[[7611810,5680612],[-1669,-14765]],4,[[7612762,5736833],[-2002,-14035],[-4221,-2941]],4,[[7626217,5664282],[-9107,-1613],[255,14140],[-4069,6586],[-1486,-2783]],4,[[7628093,5641331],[79,-11257],[-2197,-5333]],[[7646144,5592295],[-1708,4911],[-4404,24551],[-1351,14265]],[[7655217,5604855],[-2584,-5991],[-6489,-6569]],1,[[7648724,5633188],[1857,-1693]],2,[[7638716,5594479],[7840,-3815]],1,[[7646556,5590664],[4351,-10262],[-370,-10704]],1,[[7646556,5590664],[-412,1631]],[[7674045,5566153],[-1881,-9265],[-5350,-10276]],[[7673182,5578817],[863,-12664]],3,[[7674045,5566153],[6046,-4965],[6999,214]],[[7687090,5561402],[-4322,-8222],[-1395,-12446],[2762,-8727],[310,-8775]],[[7629704,6278097],[-2359,10822],[850,5099],[-1861,22213],[3839,9016],[634,8959],[2892,-3289],[967,5319],[-2124,8351]],[[7637198,6302943],[-2545,2420],[-1459,-22978],[-3490,-4288]],[[7655511,6319911],[-5312,-6317],[-2738,-10651],[-4407,-1786],[-73,4829],[-5783,-3043]],[[7611735,6206546],[-2573,-5233],[-2050,-11306],[776,-10419],[-5880,747],[-901,22739]],[[7627486,6251105],[-3604,10165],[-4322,-2224],[-2191,-7981],[-5905,-6132],[-497,-6983],[2599,-2794],[604,-14515],[2781,-10503],[-1863,-5942],[-3353,2350]],[[7629704,6278097],[-2218,-26992]],[[7619598,6198163],[3978,11605],[-3894,24777],[2331,1801],[5473,14759]],[[7627555,6178004],[-1238,7582],[-2533,-3315],[-3319,2691],[-867,13201]],[[7631621,6204977],[-1413,-9440],[539,-19479],[-3192,1946]],[[7648498,6267344],[91,-11996],[-3150,-11439],[-4953,-10666],[-2338,-8571],[-2908,-1985],[-7736,-17519],[4117,-191]],[[7637198,6302943],[574,-11561],[3482,-13151],[2289,-881],[4955,-10006]],[[7619598,6198163],[-7578,-7221],[-285,15604]],[[7654534,6267536],[3281,13570],[3841,4176],[-453,11123],[-2511,4179],[1633,6883]],[[7656347,6221508],[-434,6636],[2549,8345],[703,11470],[-3171,1247],[-1460,18330]],[[7673339,6241994],[-4030,-7008],[-4141,-12896],[-8821,-582]],[[7654534,6267536],[-6036,-192]],[[7642650,6209283],[-4073,-4641],[-4963,4821],[-1993,-4486]],[[7656347,6221508],[-2229,-6960],[-1254,3677],[-4145,-5859],[-6069,-3083]],[[7644898,6172532],[5803,1811],[2314,9772],[7631,3322],[7547,16260],[2065,47]],[[7642855,6145028],[1336,10192],[4592,5262],[-5330,9555],[1445,2495]],[[7646184,6133972],[-3329,11056]],[[7662761,6125381],[-3118,10346],[-6816,-948],[-1374,4799],[-5269,-5606]],[[7673118,6157587],[-4432,-8094],[-2714,-17981],[-3211,-6131]],[[7669786,6194986],[-389,-13054],[4435,-5886],[-1781,-13049],[1067,-5410]],[[7628301,6156534],[-1676,2295],[930,19175]],[[7642855,6145028],[-5508,2526],[-4276,8240],[-4770,740]],[[7642650,6209283],[1892,-5696],[-1031,-7237],[2350,-6072],[-963,-17746]],[[7607399,6086680],[3118,-3276],[5905,-19516],[2350,-3385]],[[7642220,5987002],[-2164,-7443],[-6494,-3223],[-1800,2158],[-8654,-4213]],[[7640433,5993756],[1787,-6754]],[[7626580,6047783],[102,-7553],[4563,-10245],[2228,6059],[3485,-102],[5471,-13065],[-1641,-2823],[-355,-26298]],[[7618772,6060503],[2597,-12024],[5211,-696]],[[7621336,6097844],[-1371,9282],[-521,25915],[6077,3525],[2780,19968]],[[7645205,6124854],[-2735,-15290],[-5863,-16575],[-3110,7461],[-12161,-2606]],[[7646184,6133972],[-979,-9118]],[[7665026,6101398],[-15216,1369],[-4605,22087]],[[7662761,6125381],[780,-5498],[-1715,-11546],[3200,-6939]],[[7673118,6157587],[3754,12085],[6749,-2478],[2568,-4603],[2092,2851],[1859,-15495],[1872,-405]],[[7664621,6076455],[2423,7367],[-2018,17576]],[[7679238,6065191],[-8523,10408],[-6094,856]],[[7690993,6144004],[-6280,285],[43,-7309],[-3476,-10989],[-1428,-16241],[1565,-7054],[-1411,-11503],[1718,-3149],[-667,-16847],[-1819,-6006]],[[7692012,6149542],[-1019,-5538]],[[7626580,6047783],[11624,-2224]],[[7651105,6000401],[-6118,-1818],[-4554,-4827]],[[7651967,6018218],[732,-4827],[-1594,-12990]],[[7651402,6035691],[-931,-12701],[1496,-4772]],[[7650858,6045208],[544,-9517]],[[7638204,6045559],[6358,-3004],[6296,2653]],[[7622447,6092135],[-1982,-12412],[304,-9042],[-1997,-10178]],[[7621336,6097844],[1111,-5709]],[[7622447,6092135],[10153,-12065],[5632,6871],[3268,-2512],[1594,-6895],[3753,-5566]],[[7646847,6071968],[-182,-8943],[-7560,3039],[-1103,-2679],[2360,-10517],[-2158,-7309]],[[7651402,6035691],[6377,-3747]],[[7658785,6029704],[-426,-13272],[-6392,1786]],[[7657779,6031944],[1006,-2240]],[[7646847,6071968],[5343,-7559],[1217,-6963]],[[7653407,6057446],[-153,-9970],[-2396,-2268]],[[7656889,6051273],[3017,11609],[4416,8948],[299,4625]],[[7657779,6031944],[-890,19329]],[[7660827,6027977],[-2042,1727]],[[7676442,6033737],[-1740,4974],[-6453,-3696],[-1287,6016],[-6135,-13054]],[[7679238,6065191],[-515,-12345],[2462,-1347],[1874,-11680],[-4486,-7597],[-2131,1515]],[[7677740,6017832],[4336,-3168]],[[7669126,6002518],[3736,10913],[2756,-3204],[2122,7605]],[[7668940,5987626],[186,14892]],[[7675079,5988379],[-6139,-753]],[[7682076,6014664],[2769,-6824],[-5272,-8053],[340,-5731],[-4834,-5677]],[[7682076,6014664],[5487,409],[3357,-6620],[3863,4379],[4064,-11943]],[[7694246,5974251],[-3140,4509],[-5386,-1783],[-5085,5154],[-5010,-537],[-546,6785]],[[7698847,6000889],[-3805,-9463],[-796,-17175]],[[7656889,6051273],[-3482,6173]],[[7652726,5996891],[-1621,3510]],[[7654475,5996747],[-1749,144]],[[7666789,6004124],[-7001,-7416],[-5313,39]],[[7660827,6027977],[781,-6301],[3814,862],[1367,-18414]],[[7666789,6004124],[2337,-1606]],[[7659720,5987194],[-4992,3194],[-253,6359]],[[7668927,5987306],[-9207,-112]],[[7668940,5987626],[-13,-320]],[[7676442,6033737],[1298,-15905]],[[7668927,5987306],[507,-7619],[-1795,-7231]],[[7654094,5978604],[3980,-36],[1646,8626]],[[7653992,5974651],[102,3953]],[[7655791,5960859],[-1799,13792]],1,[[7667639,5972456],[-9243,-1432],[-880,-9874]],[[7654094,5978604],[-1368,18287]],[[7647396,5971978],[-3402,3556],[-1774,11468]],[[7653992,5974651],[-1887,-3962],[-4709,1289]],[[7624143,5944785],[2171,-3753],[2006,4666],[2739,-2643],[5503,1842],[2468,6804],[2633,-186]],[[7644324,5911644],[-8761,-5237],[-5732,1249]],1,[[7641663,5951515],[2663,-2122]],1,[[7646334,5961657],[-3115,295],[-1556,-10437]],[[7647396,5971978],[-1062,-10321]],1,[[7667639,5972456],[2368,-3593],[-2743,-8721]],[[7647664,5957134],[-1330,4523]],2,[[7752971,6080311],[3248,-11324],[4279,-4788]],[[7749232,6071425],[3739,8886]],[[7750788,6010776],[322,17664],[-3263,13551],[2213,8033],[-1190,7818],[2569,9693],[-2207,3890]],[[7760498,6064199],[6904,-2281],[1398,-4246],[-1108,-11514],[3497,-6321],[2249,-11922],[-2131,-5457],[2153,-9612]],[[7762943,6081397],[4498,2623],[5837,-8931],[5169,35825]],[[7760498,6064199],[-380,14030],[2825,3168]],[[7770782,6116374],[4565,5951]],[[7762943,6081397],[-2280,7942],[1080,11027],[3916,11973],[5123,4035]],[[7758871,6124020],[3682,1064],[3496,-7281],[4733,-1429]],[[7752971,6080311],[2131,2418],[-2071,10439],[-3173,612],[238,10248],[8775,19992]],[[7670905,5959263],[4499,7282],[9580,-10842],[5128,-13213]],1,[[7689460,5940316],[-8028,-6454],[-5387,3103],[-2394,-3071],[191,-6842],[-2366,-6351],[-640,-8860]],[[7690112,5942490],[-652,-2174]],1,[[7697350,5951963],[-7238,-9473]],[[7694246,5974251],[3104,-22288]],[[7697350,5951963],[1134,-10069],[7567,6408]],[[7691974,5915196],[905,11268],[-3419,13852]],1,[[7710377,5917971],[-4315,-10893],[675,-11439]],[[7698847,6000889],[2941,-2755],[11169,626]],[[7712957,5998760],[8334,938]],4,[[7722139,6093253],[4412,-17679]],[[7718041,6084630],[2067,-171],[2031,8794]],[[7712957,5998760],[600,7896],[-3424,16700],[-1075,14997],[3413,90],[-1055,7526],[5703,960],[2753,9939],[3216,2087],[927,14472],[-4724,3622],[-1250,7581]],[[7726551,6075574],[3683,-9822],[2864,2359],[3466,-3042],[-1435,-6561],[-16,-14276],[-4073,-9677],[-1433,-9910],[267,-14753]],[[7706115,6094210],[-7594,-8476],[-4049,-15766],[-11950,-9766],[-3284,4989]],[[7690993,6144004],[5330,-2153],[3270,-7490],[3476,-46],[6213,-5491],[-1226,-9407],[-3627,-9804],[3271,-5152],[-1585,-10251]],[[7715085,6159748],[2908,4029],[1193,-7934],[3187,-2006],[4109,4133]],[[7699329,6156391],[5838,-396],[1077,-3378],[7171,-2871],[1670,10002]],[[7692012,6149542],[7317,6849]],[[7718041,6084630],[-2524,4606],[-7085,-1296],[-2317,6270]],[[7727772,6142454],[-1859,-7507],[-3927,-3893],[-2235,-9644],[256,-12748],[2132,-15409]],[[7726482,6157970],[1755,-3125],[-465,-12391]],[[7726482,6157970],[3235,2839],[5115,-7738],[1910,12483],[3736,-36]],[[7737232,6117474],[-1892,-1038],[-3945,12022],[-3111,-1577],[-512,15573]],[[7755964,6130326],[-11433,1403],[-2552,-4167],[491,-9414],[-5238,-674]],[[7751495,6153349],[2908,-9551],[1561,-13472]],[[7740478,6165518],[7490,-15195],[3527,3026]],[[7734415,6072440],[-1935,-1506],[-5929,4640]],[[7737232,6117474],[-1509,-7577],[728,-8455],[-1473,-12085],[-2605,-2166],[-284,-7277],[2326,-7474]],[[7755964,6130326],[2907,-6306]],[[7749232,6071425],[-2383,3408],[-12434,-2393]],[[7700630,6196585],[526,-4291],[-3858,-3402],[748,-7543],[-1973,-6939],[5218,-10536],[-1962,-7483]],[[7698993,6225681],[-867,-20451],[2504,-8645]],[[7700270,6232822],[-1277,-7141]],[[7731256,6237591],[1973,-6107],[-1304,-6435],[2964,-5033]],[[7733948,6212896],[-3504,713],[-2607,-4393],[-2851,4844],[-4449,-76],[-591,-9150],[-3296,-7270],[-7034,9022],[-1735,7142],[-8888,11953]],[[7734889,6220016],[-941,-7120]],[[7734889,6220016],[2758,4128],[6678,-11368],[5541,-3638]],[[7740478,6165518],[-4563,9968],[-5349,2880],[280,12073],[3009,6908],[93,15549]],[[7755826,6157012],[-4331,-3663]],[[7749866,6209138],[1714,-7268],[-1722,-11870],[1274,-4775],[9241,2010],[801,-9884],[-1299,-12203],[-4049,-8136]],[[7715085,6159748],[-4242,10908],[-3720,28160],[-6493,-2231]],[[7749866,6209138],[-122,7032],[2745,-3301],[2406,8794]],[[7769350,6152560],[-5678,-260],[-7846,4712]],[[7687090,5561402],[3174,1096]]],"version":"2.9"};
|
/*! ramp-pcar 13-02-2015 19:04:10 : v. 5.0.1
*
* RAMP GIS viewer - Elk; Sample of an implementation of RAMP
**/
define(["esri/geometry/Extent"],function(a){"use strict";function b(a,b,c){"function"!=typeof a.prototype[b]&&(a.prototype[b]=c)}function c(a,b,c){"function"!=typeof a[b]&&(a[b]=c)}function d(){b(Array,"remove",function(){for(var a,b,c=arguments,d=c.length;d&&this.length;)for(a=c[--d];-1!==(b=this.indexOf(a));)this.splice(b,1);return this}),b(Array,"append",function(a){this.push.apply(this,a)}),b(Array,"sum",function(){var a,b;for(a=0,b=0;a<this.length;++a)b+=this[a];return b}),b(Array,"isEmpty",function(){return 0===this.length}),b(Array,"last",function(){return this[this.length-1]}),b(Array,"contains",function(a){return this.indexOf(a)>-1}),c(Array,"flatten",function a(b){var c,d,e,f=[];for(c=0,d=b.length;d>c;c++)e=Object.prototype.toString.call(b[c]).split(" ").pop().split("]").shift().toLowerCase(),e&&(f=f.concat(/^(array|collection|arguments|object)$/.test(e)?a.call(b[c]):b[c]));return f}),c(Array,"max",function(a){return Math.max.apply(Math,a)}),c(Array,"min",function(a){return Math.min.apply(Math,a)})}function e(){c(Object,"create",function(a){function b(){}return b.prototype=a,new b})}function f(){c(String,"format",function(){var a,b,c=arguments[0];for(a=0;a<arguments.length-1;a++)b=new RegExp("\\{"+a+"\\}","gm"),c=c.replace(b,arguments[a+1]);return c}),b(String,"replaceAll",function(a,b){return this.toString().split(a).join(b)}),String.prototype.endsWith||Object.defineProperty(String.prototype,"endsWith",{value:function(a,b){var c=this.toString();(void 0===b||b>c.length)&&(b=c.length),b-=a.length;var d=c.indexOf(a,b);return-1!==d&&d===b}})}function g(){b(a,"clone",function(){return new a(this.xmin,this.ymin,this.xmax,this.ymax,this.spatialReference)}),b(a,"width",function(){return Math.abs(this.xmin-this.xmax)}),b(a,"height",function(){return Math.abs(this.ymin-this.ymax)}),b(a,"xyAspectFactor",function(){return this.width()/this.height()}),b(a,"centerX",function(){return(this.xmin+this.xmax)/2}),b(a,"centerY",function(){return(this.ymin+this.ymax)/2}),b(a,"center",function(){return{X:this.centerX,Y:this.centerY}}),b(a,"pan",function(b,c){var d=this.centerX()-b,e=this.centerY()-c;return new a(this.xmin-d,this.ymin-e,this.xmax-d,this.ymax-e,this.spatialReference)})}function h(){$.fn.findInputLabel=function(){return this.map(function(){return $(this).parent().find("label[for='"+this.id+"']")[0]})},$.fn.isOverflowed=function(){var a,b=$(this),c=b.clone().css({display:"inline",width:"auto",visibility:"hidden","font-size":b.css("font-size")}).appendTo("body");return a=c.width()>b.width()||b.width()>b.parent().width(),c.remove(),a},$.fn.forceStyle=function(a){var b=$(this);for(var c in a)a.hasOwnProperty(c)&&(b[0].style.cssText+=";"+c+":"+a[c]+" !important");return b}}return f(),e(),d(),g(),h(),{load:function(a,b,c){c()}}});
|
# Copyright 2016 Vijayaditya Peddinti.
# 2016 Vimal Manohar
# Apache 2.0.
""" This is a module with methods which will be used by scripts for training of
deep neural network acoustic model with chain objective.
"""
import logging
import math
import os
import sys
import libs.common as common_lib
import libs.nnet3.train.common as common_train_lib
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
def create_phone_lm(dir, tree_dir, run_opts, lm_opts=None):
"""Create a phone LM for chain training
This method trains a phone LM for chain training using the alignments
in "tree_dir"
"""
try:
f = open(tree_dir + "/num_jobs", 'r')
num_ali_jobs = int(f.readline())
assert num_ali_jobs > 0
except:
raise Exception("""There was an error getting the number of alignment
jobs from {0}/num_jobs""".format(tree_dir))
alignments=' '.join(['{0}/ali.{1}.gz'.format(tree_dir, job)
for job in range(1, num_ali_jobs + 1)])
common_lib.execute_command(
"""{command} {dir}/log/make_phone_lm.log \
gunzip -c {alignments} \| \
ali-to-phones {tree_dir}/final.mdl ark:- ark:- \| \
chain-est-phone-lm {lm_opts} ark:- {dir}/phone_lm.fst""".format(
command=run_opts.command, dir=dir,
alignments=alignments,
lm_opts=lm_opts if lm_opts is not None else '',
tree_dir=tree_dir))
def create_denominator_fst(dir, tree_dir, run_opts):
common_lib.execute_command(
"""copy-transition-model {tree_dir}/final.mdl \
{dir}/0.trans_mdl""".format(dir=dir, tree_dir=tree_dir))
common_lib.execute_command(
"""{command} {dir}/log/make_den_fst.log \
chain-make-den-fst {dir}/tree {dir}/0.trans_mdl \
{dir}/phone_lm.fst \
{dir}/den.fst {dir}/normalization.fst""".format(
dir=dir, command=run_opts.command))
def generate_chain_egs(dir, data, lat_dir, egs_dir,
left_context, right_context,
run_opts, stage=0,
left_tolerance=None, right_tolerance=None,
left_context_initial=-1, right_context_final=-1,
frame_subsampling_factor=3,
alignment_subsampling_factor=3,
online_ivector_dir=None,
frames_per_iter=20000, frames_per_eg_str="20", srand=0,
egs_opts=None, cmvn_opts=None, transform_dir=None):
"""Wrapper for steps/nnet3/chain/get_egs.sh
See options in that script.
"""
common_lib.execute_command(
"""steps/nnet3/chain/get_egs.sh {egs_opts} \
--cmd "{command}" \
--cmvn-opts "{cmvn_opts}" \
--transform-dir "{transform_dir}" \
--online-ivector-dir "{ivector_dir}" \
--left-context {left_context} \
--right-context {right_context} \
--left-context-initial {left_context_initial} \
--right-context-final {right_context_final} \
--left-tolerance '{left_tolerance}' \
--right-tolerance '{right_tolerance}' \
--frame-subsampling-factor {frame_subsampling_factor} \
--alignment-subsampling-factor {alignment_subsampling_factor} \
--stage {stage} \
--frames-per-iter {frames_per_iter} \
--frames-per-eg {frames_per_eg_str} \
--srand {srand} \
{data} {dir} {lat_dir} {egs_dir}""".format(
command=run_opts.command,
cmvn_opts=cmvn_opts if cmvn_opts is not None else '',
transform_dir=(transform_dir
if transform_dir is not None
else ''),
ivector_dir=(online_ivector_dir
if online_ivector_dir is not None
else ''),
left_context=left_context,
right_context=right_context,
left_context_initial=left_context_initial,
right_context_final=right_context_final,
left_tolerance=(left_tolerance
if left_tolerance is not None
else ''),
right_tolerance=(right_tolerance
if right_tolerance is not None
else ''),
frame_subsampling_factor=frame_subsampling_factor,
alignment_subsampling_factor=alignment_subsampling_factor,
stage=stage, frames_per_iter=frames_per_iter,
frames_per_eg_str=frames_per_eg_str, srand=srand,
data=data, lat_dir=lat_dir, dir=dir, egs_dir=egs_dir,
egs_opts=egs_opts if egs_opts is not None else ''))
def train_new_models(dir, iter, srand, num_jobs,
num_archives_processed, num_archives,
raw_model_string, egs_dir,
apply_deriv_weights,
min_deriv_time, max_deriv_time_relative,
l2_regularize, xent_regularize, leaky_hmm_coefficient,
momentum, max_param_change,
shuffle_buffer_size, num_chunk_per_minibatch_str,
frame_subsampling_factor, run_opts,
backstitch_training_scale=0.0, backstitch_training_interval=1):
"""
Called from train_one_iteration(), this method trains new models
with 'num_jobs' jobs, and
writes files like exp/tdnn_a/24.{1,2,3,..<num_jobs>}.raw
We cannot easily use a single parallel SGE job to do the main training,
because the computation of which archive and which --frame option
to use for each job is a little complex, so we spawn each one separately.
this is no longer true for RNNs as we use do not use the --frame option
but we use the same script for consistency with FF-DNN code
"""
deriv_time_opts = []
if min_deriv_time is not None:
deriv_time_opts.append("--optimization.min-deriv-time={0}".format(
min_deriv_time))
if max_deriv_time_relative is not None:
deriv_time_opts.append("--optimization.max-deriv-time-relative={0}".format(
int(max_deriv_time_relative)))
threads = []
# the GPU timing info is only printed if we use the --verbose=1 flag; this
# slows down the computation slightly, so don't accumulate it on every
# iteration. Don't do it on iteration 0 either, because we use a smaller
# than normal minibatch size, and people may get confused thinking it's
# slower for iteration 0 because of the verbose option.
verbose_opt = ("--verbose=1" if iter % 20 == 0 and iter > 0 else "")
for job in range(1, num_jobs+1):
# k is a zero-based index that we will derive the other indexes from.
k = num_archives_processed + job - 1
# work out the 1-based archive index.
archive_index = (k % num_archives) + 1
# previous : frame_shift = (k/num_archives) % frame_subsampling_factor
frame_shift = ((archive_index + k/num_archives)
% frame_subsampling_factor)
cache_io_opts = (("--read-cache={dir}/cache.{iter}".format(dir=dir,
iter=iter)
if iter > 0 else "") +
(" --write-cache={0}/cache.{1}".format(dir, iter + 1)
if job == 1 else ""))
thread = common_lib.background_command(
"""{command} {train_queue_opt} {dir}/log/train.{iter}.{job}.log \
nnet3-chain-train {parallel_train_opts} {verbose_opt} \
--apply-deriv-weights={app_deriv_wts} \
--l2-regularize={l2} --leaky-hmm-coefficient={leaky} \
{cache_io_opts} --xent-regularize={xent_reg} \
{deriv_time_opts} \
--print-interval=10 --momentum={momentum} \
--max-param-change={max_param_change} \
--backstitch-training-scale={backstitch_training_scale} \
--backstitch-training-interval={backstitch_training_interval} \
--srand={srand} \
"{raw_model}" {dir}/den.fst \
"ark,bg:nnet3-chain-copy-egs \
--frame-shift={fr_shft} \
ark:{egs_dir}/cegs.{archive_index}.ark ark:- | \
nnet3-chain-shuffle-egs --buffer-size={buf_size} \
--srand={srand} ark:- ark:- | nnet3-chain-merge-egs \
--minibatch-size={num_chunk_per_mb} ark:- ark:- |" \
{dir}/{next_iter}.{job}.raw""".format(
command=run_opts.command,
train_queue_opt=run_opts.train_queue_opt,
dir=dir, iter=iter, srand=iter + srand,
next_iter=iter + 1, job=job,
deriv_time_opts=" ".join(deriv_time_opts),
app_deriv_wts=apply_deriv_weights,
fr_shft=frame_shift, l2=l2_regularize,
xent_reg=xent_regularize, leaky=leaky_hmm_coefficient,
cache_io_opts=cache_io_opts,
parallel_train_opts=run_opts.parallel_train_opts,
verbose_opt=verbose_opt,
momentum=momentum, max_param_change=max_param_change,
backstitch_training_scale=backstitch_training_scale,
backstitch_training_interval=backstitch_training_interval,
raw_model=raw_model_string,
egs_dir=egs_dir, archive_index=archive_index,
buf_size=shuffle_buffer_size,
num_chunk_per_mb=num_chunk_per_minibatch_str),
require_zero_status=True)
threads.append(thread)
for thread in threads:
thread.join()
def train_one_iteration(dir, iter, srand, egs_dir,
num_jobs, num_archives_processed, num_archives,
learning_rate, shrinkage_value,
num_chunk_per_minibatch_str,
apply_deriv_weights, min_deriv_time,
max_deriv_time_relative,
l2_regularize, xent_regularize,
leaky_hmm_coefficient,
momentum, max_param_change, shuffle_buffer_size,
frame_subsampling_factor,
run_opts, dropout_edit_string="",
backstitch_training_scale=0.0, backstitch_training_interval=1):
""" Called from steps/nnet3/chain/train.py for one iteration for
neural network training with LF-MMI objective
"""
# Set off jobs doing some diagnostics, in the background.
# Use the egs dir from the previous iteration for the diagnostics
# check if different iterations use the same random seed
if os.path.exists('{0}/srand'.format(dir)):
try:
saved_srand = int(open('{0}/srand'.format(dir)).readline().strip())
except (IOError, ValueError):
logger.error("Exception while reading the random seed "
"for training")
raise
if srand != saved_srand:
logger.warning("The random seed provided to this iteration "
"(srand={0}) is different from the one saved last "
"time (srand={1}). Using srand={0}.".format(
srand, saved_srand))
else:
with open('{0}/srand'.format(dir), 'w') as f:
f.write(str(srand))
# Sets off some background jobs to compute train and
# validation set objectives
compute_train_cv_probabilities(
dir=dir, iter=iter, egs_dir=egs_dir,
l2_regularize=l2_regularize, xent_regularize=xent_regularize,
leaky_hmm_coefficient=leaky_hmm_coefficient, run_opts=run_opts)
if iter > 0:
# Runs in the background
compute_progress(dir, iter, run_opts)
do_average = (iter > 0)
raw_model_string = ("nnet3-am-copy --raw=true --learning-rate={0} "
"--scale={1} {2}/{3}.mdl - |".format(
learning_rate, shrinkage_value, dir, iter))
if do_average:
cur_num_chunk_per_minibatch_str = num_chunk_per_minibatch_str
cur_max_param_change = max_param_change
else:
# on iteration zero, use a smaller minibatch size (and we will later
# choose the output of just one of the jobs): the model-averaging isn't
# always helpful when the model is changing too fast (i.e. it can worsen
# the objective function), and the smaller minibatch size will help to
# keep the update stable.
cur_num_chunk_per_minibatch_str = common_train_lib.halve_minibatch_size_str(
num_chunk_per_minibatch_str)
cur_max_param_change = float(max_param_change) / math.sqrt(2)
raw_model_string = raw_model_string + dropout_edit_string
train_new_models(dir=dir, iter=iter, srand=srand, num_jobs=num_jobs,
num_archives_processed=num_archives_processed,
num_archives=num_archives,
raw_model_string=raw_model_string,
egs_dir=egs_dir,
apply_deriv_weights=apply_deriv_weights,
min_deriv_time=min_deriv_time,
max_deriv_time_relative=max_deriv_time_relative,
l2_regularize=l2_regularize,
xent_regularize=xent_regularize,
leaky_hmm_coefficient=leaky_hmm_coefficient,
momentum=momentum,
max_param_change=cur_max_param_change,
shuffle_buffer_size=shuffle_buffer_size,
num_chunk_per_minibatch_str=cur_num_chunk_per_minibatch_str,
frame_subsampling_factor=frame_subsampling_factor,
run_opts=run_opts,
# linearly increase backstitch_training_scale during the
# first few iterations (hard-coded as 15)
backstitch_training_scale=(backstitch_training_scale *
iter / 15 if iter < 15 else backstitch_training_scale),
backstitch_training_interval=backstitch_training_interval)
[models_to_average, best_model] = common_train_lib.get_successful_models(
num_jobs, '{0}/log/train.{1}.%.log'.format(dir, iter))
nnets_list = []
for n in models_to_average:
nnets_list.append("{0}/{1}.{2}.raw".format(dir, iter + 1, n))
if do_average:
# average the output of the different jobs.
common_train_lib.get_average_nnet_model(
dir=dir, iter=iter,
nnets_list=" ".join(nnets_list),
run_opts=run_opts)
else:
# choose the best model from different jobs
common_train_lib.get_best_nnet_model(
dir=dir, iter=iter,
best_model_index=best_model,
run_opts=run_opts)
try:
for i in range(1, num_jobs + 1):
os.remove("{0}/{1}.{2}.raw".format(dir, iter + 1, i))
except OSError:
raise Exception("Error while trying to delete the raw models")
new_model = "{0}/{1}.mdl".format(dir, iter + 1)
if not os.path.isfile(new_model):
raise Exception("Could not find {0}, at the end of "
"iteration {1}".format(new_model, iter))
elif os.stat(new_model).st_size == 0:
raise Exception("{0} has size 0. Something went wrong in "
"iteration {1}".format(new_model, iter))
if os.path.exists("{0}/cache.{1}".format(dir, iter)):
os.remove("{0}/cache.{1}".format(dir, iter))
def check_for_required_files(feat_dir, tree_dir, lat_dir):
files = ['{0}/feats.scp'.format(feat_dir), '{0}/ali.1.gz'.format(tree_dir),
'{0}/final.mdl'.format(tree_dir), '{0}/tree'.format(tree_dir),
'{0}/lat.1.gz'.format(lat_dir), '{0}/final.mdl'.format(lat_dir),
'{0}/num_jobs'.format(lat_dir), '{0}/splice_opts'.format(lat_dir)]
for file in files:
if not os.path.isfile(file):
raise Exception('Expected {0} to exist.'.format(file))
def compute_preconditioning_matrix(dir, egs_dir, num_lda_jobs, run_opts,
max_lda_jobs=None, rand_prune=4.0,
lda_opts=None):
""" Function to estimate and write LDA matrix from cegs
This function is exactly similar to the version in module
libs.nnet3.train.frame_level_objf.common except this uses cegs instead of
egs files.
"""
if max_lda_jobs is not None:
if num_lda_jobs > max_lda_jobs:
num_lda_jobs = max_lda_jobs
# Write stats with the same format as stats for LDA.
common_lib.execute_command(
"""{command} JOB=1:{num_lda_jobs} {dir}/log/get_lda_stats.JOB.log \
nnet3-chain-acc-lda-stats --rand-prune={rand_prune} \
{dir}/init.raw "ark:{egs_dir}/cegs.JOB.ark" \
{dir}/JOB.lda_stats""".format(
command=run_opts.command,
num_lda_jobs=num_lda_jobs,
dir=dir,
egs_dir=egs_dir,
rand_prune=rand_prune))
# the above command would have generated dir/{1..num_lda_jobs}.lda_stats
lda_stat_files = map(lambda x: '{0}/{1}.lda_stats'.format(dir, x),
range(1, num_lda_jobs + 1))
common_lib.execute_command(
"""{command} {dir}/log/sum_transform_stats.log \
sum-lda-accs {dir}/lda_stats {lda_stat_files}""".format(
command=run_opts.command,
dir=dir, lda_stat_files=" ".join(lda_stat_files)))
for file in lda_stat_files:
try:
os.remove(file)
except OSError:
raise Exception("There was error while trying to remove "
"lda stat files.")
# this computes a fixed affine transform computed in the way we described
# in Appendix C.6 of http://arxiv.org/pdf/1410.7455v6.pdf; it's a scaled
# variant of an LDA transform but without dimensionality reduction.
common_lib.execute_command(
"""{command} {dir}/log/get_transform.log \
nnet-get-feature-transform {lda_opts} {dir}/lda.mat \
{dir}/lda_stats""".format(
command=run_opts.command, dir=dir,
lda_opts=lda_opts if lda_opts is not None else ""))
common_lib.force_symlink("../lda.mat", "{0}/configs/lda.mat".format(dir))
def prepare_initial_acoustic_model(dir, run_opts, srand=-1, input_model=None):
""" This function adds the first layer; It will also prepare the acoustic
model with the transition model.
If 'input_model' is specified, no initial network preparation(adding
the first layer) is done and this model is used as initial 'raw' model
instead of '0.raw' model to prepare '0.mdl' as acoustic model by adding the
transition model.
"""
if input_model is None:
common_train_lib.prepare_initial_network(dir, run_opts,
srand=srand)
# The model-format for a 'chain' acoustic model is just the transition
# model and then the raw nnet, so we can use 'cat' to create this, as
# long as they have the same mode (binary or not binary).
# We ensure that they have the same mode (even if someone changed the
# script to make one or both of them text mode) by copying them both
# before concatenating them.
common_lib.execute_command(
"""{command} {dir}/log/init_mdl.log \
nnet3-am-init {dir}/0.trans_mdl {raw_mdl} \
{dir}/0.mdl""".format(command=run_opts.command, dir=dir,
raw_mdl=(input_model if input_model is not None
else '{0}/0.raw'.format(dir))))
def compute_train_cv_probabilities(dir, iter, egs_dir, l2_regularize,
xent_regularize, leaky_hmm_coefficient,
run_opts):
model = '{0}/{1}.mdl'.format(dir, iter)
common_lib.background_command(
"""{command} {dir}/log/compute_prob_valid.{iter}.log \
nnet3-chain-compute-prob --l2-regularize={l2} \
--leaky-hmm-coefficient={leaky} --xent-regularize={xent_reg} \
"nnet3-am-copy --raw=true {model} - |" {dir}/den.fst \
"ark,bg:nnet3-chain-copy-egs ark:{egs_dir}/valid_diagnostic.cegs \
ark:- | nnet3-chain-merge-egs --minibatch-size=1:64 ark:- ark:- |" \
""".format(command=run_opts.command, dir=dir, iter=iter, model=model,
l2=l2_regularize, leaky=leaky_hmm_coefficient,
xent_reg=xent_regularize,
egs_dir=egs_dir))
common_lib.background_command(
"""{command} {dir}/log/compute_prob_train.{iter}.log \
nnet3-chain-compute-prob --l2-regularize={l2} \
--leaky-hmm-coefficient={leaky} --xent-regularize={xent_reg} \
"nnet3-am-copy --raw=true {model} - |" {dir}/den.fst \
"ark,bg:nnet3-chain-copy-egs ark:{egs_dir}/train_diagnostic.cegs \
ark:- | nnet3-chain-merge-egs --minibatch-size=1:64 ark:- ark:- |" \
""".format(command=run_opts.command, dir=dir, iter=iter, model=model,
l2=l2_regularize, leaky=leaky_hmm_coefficient,
xent_reg=xent_regularize,
egs_dir=egs_dir))
def compute_progress(dir, iter, run_opts):
prev_model = '{0}/{1}.mdl'.format(dir, iter - 1)
model = '{0}/{1}.mdl'.format(dir, iter)
common_lib.background_command(
"""{command} {dir}/log/progress.{iter}.log \
nnet3-am-info {model} '&&' \
nnet3-show-progress --use-gpu=no \
"nnet3-am-copy --raw=true {prev_model} - |" \
"nnet3-am-copy --raw=true {model} - |"
""".format(command=run_opts.command,
dir=dir,
iter=iter,
model=model,
prev_model=prev_model))
def combine_models(dir, num_iters, models_to_combine, num_chunk_per_minibatch_str,
egs_dir, leaky_hmm_coefficient, l2_regularize,
xent_regularize, run_opts,
sum_to_one_penalty=0.0):
""" Function to do model combination
In the nnet3 setup, the logic
for doing averaging of subsets of the models in the case where
there are too many models to reliably esetimate interpolation
factors (max_models_combine) is moved into the nnet3-combine.
"""
raw_model_strings = []
logger.info("Combining {0} models.".format(models_to_combine))
models_to_combine.add(num_iters)
# TODO: if it turns out the sum-to-one-penalty code is not useful,
# remove support for it.
for iter in sorted(models_to_combine):
model_file = '{0}/{1}.mdl'.format(dir, iter)
if os.path.exists(model_file):
# we used to copy them with nnet3-am-copy --raw=true, but now
# the raw-model-reading code discards the other stuff itself.
raw_model_strings.append(model_file)
else:
print("{0}: warning: model file {1} does not exist "
"(final combination)".format(sys.argv[0], model_file))
# We reverse the order of the raw model strings so that the freshest one
# goes first. This is important for systems that include batch
# normalization-- it means that the freshest batch-norm stats are used.
# Since the batch-norm stats are not technically parameters, they are not
# combined in the combination code, they are just obtained from the first
# model.
raw_model_strings = list(reversed(raw_model_strings))
common_lib.execute_command(
"""{command} {combine_queue_opt} {dir}/log/combine.log \
nnet3-chain-combine --num-iters={opt_iters} \
--l2-regularize={l2} --leaky-hmm-coefficient={leaky} \
--separate-weights-per-component={separate_weights} \
--enforce-sum-to-one={hard_enforce} \
--sum-to-one-penalty={penalty} \
--enforce-positive-weights=true \
--verbose=3 {dir}/den.fst {raw_models} \
"ark,bg:nnet3-chain-copy-egs ark:{egs_dir}/combine.cegs ark:- | \
nnet3-chain-merge-egs --minibatch-size={num_chunk_per_mb} \
ark:- ark:- |" - \| \
nnet3-am-copy --set-raw-nnet=- {dir}/{num_iters}.mdl \
{dir}/final.mdl""".format(
command=run_opts.command,
combine_queue_opt=run_opts.combine_queue_opt,
opt_iters=(20 if sum_to_one_penalty <= 0 else 80),
separate_weights=(sum_to_one_penalty > 0),
l2=l2_regularize, leaky=leaky_hmm_coefficient,
dir=dir, raw_models=" ".join(raw_model_strings),
hard_enforce=(sum_to_one_penalty <= 0),
penalty=sum_to_one_penalty,
num_chunk_per_mb=num_chunk_per_minibatch_str,
num_iters=num_iters,
egs_dir=egs_dir))
# Compute the probability of the final, combined model with
# the same subset we used for the previous compute_probs, as the
# different subsets will lead to different probs.
compute_train_cv_probabilities(
dir=dir, iter='final', egs_dir=egs_dir,
l2_regularize=l2_regularize, xent_regularize=xent_regularize,
leaky_hmm_coefficient=leaky_hmm_coefficient,
run_opts=run_opts)
|
import axios from 'axios';
/*
let baseURL = `http://${window.location.hostname}:8000/api/`; */
let baseURL;
if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') {
baseURL = `http://${window.location.hostname}:8000/api/`;
} else {
baseURL = 'https://auroracomputing.herokuapp.com/api/';
}
const axiosInstance = axios.create({
baseURL,
timeout: 5000,
headers: {
Authorization: localStorage.getItem('access_token') ? `JWT ${localStorage.getItem('access_token')}` : null,
'Content-Type': 'application/json',
accept: 'application/json'
}
});
axiosInstance.interceptors.response.use(
(response) => response,
async (error) => {
const originalRequest = error.config;
if (typeof error.response === 'undefined') {
alert('A server/network error occurred. Looks like CORS might be the problem. Sorry about this - we will get it fixed shortly.');
return Promise.reject(error);
}
if (error.response.status === 401 && originalRequest.url === `${baseURL}token/refresh/`) {
window.location.href = '/login/';
return Promise.reject(error);
}
if (error.response.data.code === 'token_not_valid' && error.response.status === 401 && error.response.statusText === 'Unauthorized') {
const refreshToken = localStorage.getItem('refresh_token');
if (refreshToken) {
const tokenParts = JSON.parse(atob(refreshToken.split('.')[1]));
// exp date in token is expressed in seconds, while now() returns milliseconds:
const now = Math.ceil(Date.now() / 1000);
console.log(tokenParts.exp);
if (tokenParts.exp > now) {
console.log('--- refresh ---');
/* return axiosInstance
.post('/token/refresh/', { refresh: refreshToken })
.then((response) => {
localStorage.setItem('access_token', response.data.access);
localStorage.setItem('refresh_token', response.data.refresh);
axiosInstance.defaults.headers['Authorization'] =
'JWT ' + response.data.access;
originalRequest.headers['Authorization'] =
'JWT ' + response.data.access;
return axiosInstance(originalRequest);
})
.catch((err) => {
console.log(err);
}); */
} else {
console.log('Refresh token is expired', tokenParts.exp, now);
localStorage.removeItem('access_token');
localStorage.removeItem('refresh_token');
axiosInstance.defaults.headers.Authorization = null;
window.location.href = '/';
}
} else {
console.log('Refresh token not available.');
window.location.href = '/login/';
}
}
// specific error handling done elsewhere
return Promise.reject(error);
}
);
export default axiosInstance;
|
var searchData=
[
['gdd_360',['gdd',['../structmodel__domain_1_1model__domain__t.html#aa4520d05be92eda88c3178127f80b8f1',1,'model_domain::model_domain_t']]],
['gdd_5fbase_361',['gdd_base',['../namespacegrowing__degree__day.html#aacfa259bbbe00271e8a8cd7b974c7b1d',1,'growing_degree_day::gdd_base()'],['../namespacegrowing__degree__day__baskerville__emin.html#a7468f06218936a314c13f9b2e5248634',1,'growing_degree_day_baskerville_emin::gdd_base()']]],
['gdd_5fmax_362',['gdd_max',['../namespacegrowing__degree__day.html#a60c068934a808d9c7d004029ba044f66',1,'growing_degree_day::gdd_max()'],['../namespacegrowing__degree__day__baskerville__emin.html#acb8a7b23e8bf6765f9b2220ac7013225',1,'growing_degree_day_baskerville_emin::gdd_max()']]],
['gdd_5freset_5fdate_363',['gdd_reset_date',['../namespacegrowing__degree__day.html#a7d529916dac673917aba382d0f40fecc',1,'growing_degree_day::gdd_reset_date()'],['../namespacegrowing__degree__day__baskerville__emin.html#a0dc27f2f486b5f60973cc35340248324',1,'growing_degree_day_baskerville_emin::gdd_reset_date()']]],
['general_5fgrid_5ft_364',['general_grid_t',['../structgrid_1_1general__grid__t.html',1,'grid']]],
['get_5fcell_5findex_365',['get_cell_index',['../namespacerouting____d8.html#ab2737c06c2bbfe695e55cf1fdc6451df',1,'routing__d8']]],
['get_5fclimate_5fdata_366',['get_climate_data',['../structmodel__domain_1_1model__domain__t.html#a881485bacecfcc56588aa02526e037da',1,'model_domain::model_domain_t::get_climate_data()'],['../namespacemodel__domain.html#ae63c4494244fd9d3d491ef2540510d0a',1,'model_domain::get_climate_data()']]],
['get_5felapsed_367',['get_elapsed',['../structtimer_1_1timer__t.html#adad7f6c92e3004e9676659be41d61b4e',1,'timer::timer_t']]],
['get_5felapsed_5fseconds_5ffn_368',['get_elapsed_seconds_fn',['../structtimer_1_1timer__t.html#af9ae268a0efa8b1f7ec15272ab1aa3a0',1,'timer::timer_t::get_elapsed_seconds_fn()'],['../namespacetimer.html#aad549547ca5c4f0b060fe4203dbedeb9',1,'timer::get_elapsed_seconds_fn()']]],
['get_5fentry_369',['get_entry',['../structdictionary_1_1dict__t.html#ad55b43f81c8490e82d790a8151a1bcd2',1,'dictionary::dict_t']]],
['get_5ffiletype_370',['get_filetype',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a141b05d165f1aa4090d2f328d28c1318',1,'data_catalog_entry::data_catalog_entry_t']]],
['get_5fmaximum_5fair_5ftemperature_5fdata_371',['get_maximum_air_temperature_data',['../structmodel__domain_1_1model__domain__t.html#a1151ce53c004c8fe04302248aef82ecf',1,'model_domain::model_domain_t']]],
['get_5fminimum_5fair_5ftemperature_5fdata_372',['get_minimum_air_temperature_data',['../structmodel__domain_1_1model__domain__t.html#a1f1fd4bff452bca85838c720c45b2ada',1,'model_domain::model_domain_t']]],
['get_5fnext_5fentry_373',['get_next_entry',['../structdictionary_1_1dict__t.html#ac3fa38fd067c1f1f05ad7d9e2981bd31',1,'dictionary::dict_t']]],
['get_5fparameter_5ftable_5ffloat_374',['get_parameter_table_float',['../structparameters_1_1parameters__t.html#ad8077bcea47ce6b4a92b49e8ddcfee42',1,'parameters::parameters_t']]],
['get_5fparameter_5fvalues_5ffloat_375',['get_parameter_values_float',['../structparameters_1_1parameters__t.html#a26ec9b1bff1c5ccd9306454937d3636e',1,'parameters::parameters_t']]],
['get_5fparameter_5fvalues_5fint_376',['get_parameter_values_int',['../structparameters_1_1parameters__t.html#a406a0bad8b25652f2e06564c3654867b',1,'parameters::parameters_t']]],
['get_5fparameter_5fvalues_5flogical_377',['get_parameter_values_logical',['../structparameters_1_1parameters__t.html#a229fb3ee1892757f18bb05e152ec2416',1,'parameters::parameters_t']]],
['get_5fparameter_5fvalues_5fstring_5flist_378',['get_parameter_values_string_list',['../structparameters_1_1parameters__t.html#a234f5434db1fe6690627932f2ad31aca',1,'parameters::parameters_t']]],
['get_5fparameters_379',['get_parameters',['../structparameters_1_1parameters__t.html#a20e2a60b90ab605f84883fcea64f185e',1,'parameters::parameters_t']]],
['get_5fprecipitation_5fdata_380',['get_precipitation_data',['../structmodel__domain_1_1model__domain__t.html#a77240340ccbd20208ffb88253e258074',1,'model_domain::model_domain_t']]],
['get_5fpretty_381',['get_pretty',['../structtimer_1_1timer__t.html#a97fd65764438a5cc02a24094089c6346',1,'timer::timer_t']]],
['get_5fsort_5forder_382',['get_sort_order',['../namespacerouting____d8.html#a96f63f977068f87f9c9e6a55b761f029',1,'routing__d8']]],
['get_5fsplit_383',['get_split',['../structtimer_1_1timer__t.html#aed1b95f0d413439ca481681109471a32',1,'timer::timer_t']]],
['get_5fsplit_5fseconds_5ffn_384',['get_split_seconds_fn',['../structtimer_1_1timer__t.html#a91c5efd26f01f2f515684aead68bd623',1,'timer::timer_t::get_split_seconds_fn()'],['../namespacetimer.html#a122895be2f663c032c82260a27ed25cd',1,'timer::get_split_seconds_fn()']]],
['get_5ftarget_5findex_385',['get_target_index',['../namespacerouting____d8.html#a8c054640f102f6f4324d6998254b0c62',1,'routing__d8']]],
['get_5ftimer_5fpretty_5ffn_386',['get_timer_pretty_fn',['../structtimer_1_1timer__t.html#aaa02090f87dc364f5b88f362267431d0',1,'timer::timer_t::get_timer_pretty_fn()'],['../namespacetimer.html#a1e09bc3d9a563017a982f964e6c28c19',1,'timer::get_timer_pretty_fn()']]],
['get_5funique_5fint_387',['get_unique_int',['../structswbstats2__support_1_1swbstats__t.html#a334493b3df8c954c2fed85fba3ea47a7',1,'swbstats2_support::swbstats_t::get_unique_int()'],['../namespaceswbstats2__support.html#a93676f9e03da9d3a3ffc9b3b5dd5c10e',1,'swbstats2_support::get_unique_int()']]],
['get_5fvalue_388',['get_value',['../structdictionary_1_1dict__t.html#a3142f8a16c4adb177a31c43efcdc8097',1,'dictionary::dict_t']]],
['get_5fvalue_5ffloat_5fsub_389',['get_value_float_sub',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a068e0347560f60d1a94b26ab5ee5a4d3',1,'data_catalog_entry::data_catalog_entry_t']]],
['get_5fvalue_5fint_5fsub_390',['get_value_int_sub',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#afa14af7ced442a712cc74acf1e45604b',1,'data_catalog_entry::data_catalog_entry_t']]],
['get_5fvalues_391',['get_values',['../structdictionary_1_1dict__t.html#afed6eb1d680dda759cf65f0a9c4f79f1',1,'dictionary::dict_t']]],
['getdayofyear_392',['getdayofyear',['../structdatetime_1_1datetime__t.html#ace996ed5874d151e7543638c4b4d326a',1,'datetime::datetime_t']]],
['getfractionofday_393',['getfractionofday',['../structdatetime_1_1datetime__t.html#a3f406b5c486df9d1a1568f699c42e6a6',1,'datetime::datetime_t']]],
['getjulianday_394',['getjulianday',['../structdatetime_1_1datetime__t.html#a25acc980c2700a3e78ab14422a257d5e',1,'datetime::datetime_t']]],
['getvalue_395',['getvalue',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a76cc81aab428ea209cc7672797bfd09d',1,'data_catalog_entry::data_catalog_entry_t']]],
['getvalues_396',['getvalues',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a18af742c6ad98fc9071873115ab1b119',1,'data_catalog_entry::data_catalog_entry_t']]],
['getvalues_5fconstant_397',['getvalues_constant',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#ad10d05af4c651624ca051af69b096005',1,'data_catalog_entry::data_catalog_entry_t']]],
['getvalues_5fdynamic_5fnetcdf_5fsub_398',['getvalues_dynamic_netcdf_sub',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a30ced44192259cf78a9b69e76dc1eb67',1,'data_catalog_entry::data_catalog_entry_t']]],
['getvalues_5fgridded_399',['getvalues_gridded',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a25fb795b26782deb3a8348faf5ef5336',1,'data_catalog_entry::data_catalog_entry_t']]],
['getvalues_5fnetcdf_400',['getvalues_netcdf',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a0d94bf12e38619f040a3b218d8583ebd',1,'data_catalog_entry::data_catalog_entry_t']]],
['getvalues_5fstatic_5fnetcdf_5fsub_401',['getvalues_static_netcdf_sub',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a929869e11a13c8d2492d49240ac2da80',1,'data_catalog_entry::data_catalog_entry_t']]],
['graph_402',['graph',['../namespacegraph.html',1,'']]],
['graph_2ef90_403',['graph.F90',['../graph_8_f90.html',1,'']]],
['grd_5fcomparison_404',['grd_comparison',['../structswbstats2__support_1_1swbstats__t.html#a525b38f48f5da291adb3eae2c4a3ef66',1,'swbstats2_support::swbstats_t']]],
['grd_5fdelta_405',['grd_delta',['../structswbstats2__support_1_1swbstats__t.html#aa98397747974ece599219ac1a2f45c30',1,'swbstats2_support::swbstats_t']]],
['grd_5fdelta2_406',['grd_delta2',['../structswbstats2__support_1_1swbstats__t.html#a87456c1732cb1cc646940b0f2b6383a7',1,'swbstats2_support::swbstats_t']]],
['grd_5fnative_407',['grd_native',['../structswbstats2__support_1_1swbstats__t.html#a5bfb790c4d975a2b82e93ff8e5fea039',1,'swbstats2_support::swbstats_t']]],
['grd_5fzone_408',['grd_zone',['../structswbstats2__support_1_1swbstats__t.html#a41ce8109307290031cfa6438435f0cb9',1,'swbstats2_support::swbstats_t']]],
['grd_5fzone2_409',['grd_zone2',['../structswbstats2__support_1_1swbstats__t.html#ac9ec34ca12aba7c1e5cc3a0c307bd661',1,'swbstats2_support::swbstats_t']]],
['gregorian_5fdate_410',['gregorian_date',['../namespacedatetime.html#aff55d6a290d6b501799acd4b32aff1dc',1,'datetime']]],
['grep_5fkeys_411',['grep_keys',['../structdictionary_1_1dict__t.html#a731eec4a44241a71642e52756bcecfcc',1,'dictionary::dict_t']]],
['grep_5fname_412',['grep_name',['../structparameters_1_1parameters__t.html#a96150755b97e6d3f373232120baea3fb',1,'parameters::parameters_t']]],
['grid_413',['grid',['../namespacegrid.html',1,'']]],
['grid_2ef90_414',['grid.F90',['../grid_8_f90.html',1,'']]],
['grid_5factive_5fcell_415',['grid_active_cell',['../namespacegrid.html#a3952feed675471167198f992a76916fe',1,'grid']]],
['grid_5fbounds_5fbase_416',['grid_bounds_base',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#a9abd2b75c269d421919120ae21bbeb69',1,'data_catalog_entry::data_catalog_entry_t']]],
['grid_5fbounds_5fnative_417',['grid_bounds_native',['../structdata__catalog__entry_1_1data__catalog__entry__t.html#abc7e32a945dabb41db87ba6edc64ae1e',1,'data_catalog_entry::data_catalog_entry_t']]],
['grid_5fbounds_5ft_418',['grid_bounds_t',['../structgrid_1_1grid__bounds__t.html',1,'grid']]],
['grid_5fcell_5farea_5fsq_5fmeters_419',['grid_cell_area_sq_meters',['../structswbstats2__support_1_1swbstats__t.html#a3b567191e68cbb53bc899bf20b43de0b',1,'swbstats2_support::swbstats_t']]],
['grid_5fcheckforproj4error_420',['grid_checkforproj4error',['../namespacegrid.html#a4e234a7e1a3a1ba76a7c92bab7114bf7',1,'grid']]],
['grid_5fcompletelycover_421',['grid_completelycover',['../namespacegrid.html#a8d5ec2fb102cf676b3ce131320b96efe',1,'grid']]],
['grid_5fconform_422',['grid_conform',['../namespacegrid.html#a0e04889a0d90268296a0669cd504cd7a',1,'grid']]],
['grid_5fcoordinatesfallinsidegrid_423',['grid_coordinatesfallinsidegrid',['../namespacegrid.html#a8637bf67d49a78af1ebe7a48c957a984',1,'grid']]],
['grid_5fcreatecomplete_424',['grid_createcomplete',['../namespacegrid.html#af369ce9317f22895cb21c5dcb0f37750',1,'grid']]],
['grid_5fcreatesimple_425',['grid_createsimple',['../namespacegrid.html#ae32d60f8b34151de401aa784e0a88741',1,'grid']]],
['grid_5fdatatype_5fdouble_426',['grid_datatype_double',['../namespacegrid.html#aedc9fb9576632b6bf549f326f2fc96e3',1,'grid']]],
['grid_5fdatatype_5fint_427',['grid_datatype_int',['../namespacegrid.html#a6f3edd9dfab0cf1847f6126835444fa6',1,'grid']]],
['grid_5fdatatype_5freal_428',['grid_datatype_real',['../namespacegrid.html#a95e2f2513fb7f2d11d0130f643931676',1,'grid']]],
['grid_5fdestroy_429',['grid_destroy',['../namespacegrid.html#adfcb9064d9b58a49eb61093cd4809a43',1,'grid']]],
['grid_5fdumpgridextent_430',['grid_dumpgridextent',['../namespacegrid.html#ae9708204ef8c71a8d02e9e77e48e23ff',1,'grid']]],
['grid_5fgetgridcolnum_431',['grid_getgridcolnum',['../namespacegrid.html#a7db2a3045400dd2b44b7dd7c5bbeb1e3',1,'grid']]],
['grid_5fgetgridrownum_432',['grid_getgridrownum',['../namespacegrid.html#a439bc8b1195ce5e772d2c13da4904ba3',1,'grid']]],
['grid_5fgetgridx_433',['grid_getgridx',['../namespacegrid.html#a298988aa9ab8da8e3cf0645c69af03c5',1,'grid']]],
['grid_5fgetgridy_434',['grid_getgridy',['../namespacegrid.html#a28548dc2d711e437906544b840b0a8d3',1,'grid']]],
['grid_5fgridtogrid_5fint_435',['grid_gridtogrid_int',['../namespacegrid.html#afa350ce941557d82c522ed95e7758c44',1,'grid']]],
['grid_5fgridtogrid_5fsgl_436',['grid_gridtogrid_sgl',['../namespacegrid.html#a5d46ebd32a7a83ebf0ba59757bbf754a',1,'grid']]],
['grid_5finterpolate_437',['grid_interpolate',['../namespacegrid.html#abadb2fac77f48ce1b47635a1e7af9e30',1,'grid']]],
['grid_5fnodata_5fdouble_438',['grid_nodata_double',['../namespacegrid.html#a7db264619d440b0ffe4957b4d158a533',1,'grid']]],
['grid_5fnodata_5fint_439',['grid_nodata_int',['../namespacegrid.html#a93f96949287e2fc24c4a94033e5173af',1,'grid']]],
['grid_5fnodata_5freal_440',['grid_nodata_real',['../namespacegrid.html#a1842368fbcc3fc0f6cabc0b58b8916bd',1,'grid']]],
['grid_5fpopulatexy_441',['grid_populatexy',['../namespacegrid.html#ace8ea960868faf40cf79d5303f881ed8',1,'grid']]],
['grid_5fptr_442',['grid_ptr',['../structswbstats2__support_1_1file__collection__t.html#a12a29be72bb4d042c9a90eb2adc5310e',1,'swbstats2_support::file_collection_t']]],
['grid_5fread_443',['grid_read',['../namespacegrid.html#a6668cfaf4657e4e5ebc2d49d0cdbb204',1,'grid']]],
['grid_5freadexisting_444',['grid_readexisting',['../namespacegrid.html#a82580ae20a6d538ff34ef5d2263bf679',1,'grid']]],
['grid_5frowcolfallsinsidegrid_445',['grid_rowcolfallsinsidegrid',['../namespacegrid.html#ac78f3a2b0a6823acea0b8fea03d41fea',1,'grid']]],
['grid_5fset_5fnodata_5fvalue_446',['grid_set_nodata_value',['../namespacegrid.html#a78fee133c83724e5371d3c66244ea35c',1,'grid']]],
['grid_5fset_5foutput_5fdirectory_5fname_447',['grid_set_output_directory_name',['../namespacegrid.html#a2868684f9170be201939b5faa62da7e3',1,'grid']]],
['grid_5ftransform_448',['grid_transform',['../namespacegrid.html#a6eb75c46ff6156376f88e567ac0e5271',1,'grid']]],
['grid_5fwritearcgrid_449',['grid_writearcgrid',['../namespacegrid.html#a02803f7fe27d0354d3d16a15bd1338da',1,'grid']]],
['grid_5fwritegrid_450',['grid_writegrid',['../namespacegrid.html#a4374d71b08027790c6fc307de2751bec',1,'grid']]],
['grid_5fwritesurfergrid_451',['grid_writesurfergrid',['../namespacegrid.html#a702f49b2f5d9aeaef8a6409e535fb5d6',1,'grid']]],
['gridcellsize_452',['gridcellsize',['../structmodel__domain_1_1model__domain__t.html#a8f1f898b6fb1a36aa327f08c81e676e8',1,'model_domain::model_domain_t']]],
['gross_5fprecip_453',['gross_precip',['../structmodel__domain_1_1model__domain__t.html#a5c0176b8db2436055b17007fff5863ab',1,'model_domain::model_domain_t']]],
['growing_5fdegree_5fday_454',['growing_degree_day',['../namespacegrowing__degree__day.html',1,'']]],
['growing_5fdegree_5fday_2ef90_455',['growing_degree_day.F90',['../growing__degree__day_8_f90.html',1,'']]],
['growing_5fdegree_5fday_5fbaskerville_5femin_456',['growing_degree_day_baskerville_emin',['../namespacegrowing__degree__day__baskerville__emin.html',1,'']]],
['growing_5fdegree_5fday_5fbaskerville_5femin_2ef90_457',['growing_degree_day_baskerville_emin.F90',['../growing__degree__day__baskerville__emin_8_f90.html',1,'']]],
['growing_5fdegree_5fday_5fbe_5fcalculate_458',['growing_degree_day_be_calculate',['../namespacegrowing__degree__day__baskerville__emin.html#a18c8df3d8a49da80c030a3db6f866087',1,'growing_degree_day_baskerville_emin']]],
['growing_5fdegree_5fday_5fbe_5finitialize_459',['growing_degree_day_be_initialize',['../namespacegrowing__degree__day__baskerville__emin.html#a8a586df56bed960952294f175d44e5b9',1,'growing_degree_day_baskerville_emin']]],
['growing_5fdegree_5fday_5fcalculate_460',['growing_degree_day_calculate',['../namespacegrowing__degree__day.html#abc82faafeb151dc1c5699503dd9b9d32',1,'growing_degree_day']]],
['growing_5fdegree_5fday_5finitialize_461',['growing_degree_day_initialize',['../namespacegrowing__degree__day.html#a0e7f6a6149d6eb2f4aa96cadc1dc86de',1,'growing_degree_day']]],
['growing_5fseason_462',['growing_season',['../namespacegrowing__season.html',1,'']]],
['growing_5fseason_2ef90_463',['growing_season.F90',['../growing__season_8_f90.html',1,'']]],
['growing_5fseason_5finitialize_464',['growing_season_initialize',['../namespacegrowing__season.html#add2a4f3df5a65bcd0406e7a24f8493f7',1,'growing_season']]],
['growing_5fseason_5fupdate_465',['growing_season_update',['../namespacegrowing__season.html#ad7cb4c245fb91db0be4abc2c702c6d5c',1,'growing_season']]],
['growth_5fstage_5fdate_466',['growth_stage_date',['../namespacecrop__coefficients____fao56.html#ac65046b44c2a3ce959c663cfcecc9bf3',1,'crop_coefficients__fao56']]],
['growth_5fstage_5flength_5fin_5fdays_467',['growth_stage_length_in_days',['../namespacecrop__coefficients____fao56.html#a531c0e3a3889cc1bc0ff7ce91e304131',1,'crop_coefficients__fao56']]]
];
|
const path = require('path')
const jsDocParser = require('jsdoc-to-markdown')
module.exports = getConstants
function getConstants() {
return jsDocParser
.getJsdocDataSync({
files: path.resolve(process.cwd(), 'src/constants/index.ts'),
'no-cache': true,
})
.filter((c) => c.kind === 'constant' && !c.undocumented)
}
|
//---------------------------------------------------------------------
// NOC.core.ModelApplication
//---------------------------------------------------------------------
// Copyright (C) 2007-2020 The NOC Project
// See LICENSE for details
//---------------------------------------------------------------------
console.debug("Defining NOC.core.ModelApplication");
Ext.define("NOC.core.ModelApplication", {
extend: "NOC.core.Application",
requires: [
"NOC.core.ModelStore",
"NOC.core.InlineModelStore",
"NOC.core.InlineGrid",
"NOC.core.TreeFilterToolbar",
"NOC.core.modelfilter.Base",
"NOC.core.modelfilter.Boolean",
"NOC.core.modelfilter.Choices",
"NOC.core.modelfilter.Lookup",
"NOC.core.modelfilter.List",
"NOC.core.modelfilter.VCFilter",
"NOC.core.modelfilter.AFI",
"NOC.core.modelfilter.VC",
"NOC.core.modelfilter.Tag",
"NOC.core.modelfilter.Label",
"NOC.core.modelfilter.Favorites",
"NOC.core.modelfilter.Tree",
"Ext.ux.grid.column.GlyphAction"
],
mixins: [
"NOC.core.Export"
],
layout: "card",
search: false,
searchPlaceholder: undefined,
searchTooltip: undefined,
recordReload: false,
filters: null,
gridToolbar: [], // Additional grid toolbar buttons
formToolbar: [], // Additional form toolbar buttons
currentRecord: null,
appTitle: null,
createTitle: __("Create") + " {0}",
cloneTitle: __("Clone") + " {0}",
changeTitle: __("Edit") + " {0}",
groupChangeTitle: __("Edit") + " {0} {1}",
rowClassField: undefined,
actions: undefined,
previewIcon: "icon_magnifier",
preview: null,
treeFilter: null,
formLayout: "anchor",
formMinWidth: undefined,
formMaxWidth: undefined,
helpId: undefined,
listHelpId: undefined,
formHelpId: undefined,
//
navTooltipTemplate: new Ext.XTemplate(
'<tpl if="data.name">',
'{data.name} - ',
'</tpl>{title}'
),
initComponent: function() {
var me = this;
// set base_url
var n = me.self.getName().split(".");
me.base_url = "/" + n[1] + "/" + n[2] + "/";
me.appName = n[1] + "." + n[2];
// Variables
me.currentQuery = me.currentQuery || {};
// Create store
var bs = Math.ceil(screen.height / 24);
me.store = Ext.create("NOC.core.ModelStore", {
model: me.model,
customFields: me.noc.cust_model_fields || [],
autoLoad: false,
pageSize: bs,
leadingBufferZone: bs,
numFromEdge: Math.ceil(bs / 2),
trailingBufferZone: bs
});
me.store.on("beforeload", me.onBeforeLoad, me);
me.store.on("load", me.onLoad, me);
me.store.on("exception", me.onLoadError, me);
me.idField = me.store.idProperty;
// Generate persistent field names
me.persistentFields = {};
Ext.each(me.store.model.getFields(), function(f) {
if(f.persist) {
me.persistentFields[f.name] = true;
}
});
//
me.hasGroupEdit = me.checkGroupEdit();
// Create GRID card
me.ITEM_GRID = me.registerItem(me.createGrid());
// Create FORM card
me.ITEM_FORM = me.registerItem(me.createForm());
// Create Group Edit form when necessary
if(me.hasGroupEdit) {
me.ITEM_GROUP_FORM = me.registerItem(me.createGroupForm())
}
//
Ext.apply(me, {
items: me.getRegisteredItems(),
activeItem: me.ITEM_GRID
});
// Initialize component
me.callParent();
me.currentRecord = null;
// Process commands
switch(me.getCmd()) {
case "open":
me.loadById(me.noc.cmd.id);
break;
case "history":
me.restoreHistory(me.noc.cmd.args);
return;
case "new":
me.newRecord(me.noc.cmd.args);
break;
}
// Finally, load the store
if(Ext.Object.isEmpty(me.currentQuery)) {
me.loadStore();
} else {
Ext.each(me.filterSetters, function(set) {
set(me.currentQuery);
});
me.reloadStore();
}
},
//
createGrid: function() {
var me = this;
// Setup Grid toolbar
var gridToolbar = [];
if(me.levelFilter) {
me.upButton = Ext.create("Ext.button.Button", {
glyph: NOC.glyph.level_up,
tooltip: __("Level Up"),
scope: me,
handler: me.onLevelUp
});
gridToolbar.push(me.upButton);
}
me.searchField = Ext.create("Ext.ux.form.SearchField", {
name: "search_field",
hideLabel: true,
width: 400,
typeAhead: false,
typeAheadDelay: 500,
emptyText: me.searchPlaceholder,
tooltip: me.searchTooltip,
hasAccess: function(app) {
return app.search === true;
},
scope: me,
handler: me.onSearch,
listeners: {
render: me.addTooltip
}
});
me.refreshButton = Ext.create("Ext.button.Button", {
glyph: NOC.glyph.refresh,
tooltip: __("Refresh"),
scope: me,
handler: me.onRefresh
});
me.createButton = Ext.create("Ext.button.Button", {
itemId: "create",
text: __("Add"),
glyph: NOC.glyph.plus,
tooltip: __("Add new record"),
hasAccess: NOC.hasPermission("create"),
scope: me,
handler: me.onNewRecord
});
me.exportButton = Ext.create("Ext.button.Button", {
itemId: "export",
text: __("Export"),
glyph: NOC.glyph.arrow_down,
tooltip: __("Save screen"),
scope: me,
handler: function() {
var date = "_" + Ext.Date.format(new Date(), "YmdHis"),
filename = this.appId.replace(/\./g, "_") + date + ".csv";
this.save(this.grid, filename);
}
});
gridToolbar.push(me.searchField, me.refreshButton, me.createButton, me.exportButton);
// admin actions
if(me.actions || me.hasGroupEdit) {
gridToolbar.push(me.createActionMenu());
}
gridToolbar = gridToolbar.concat(me.gridToolbar);
gridToolbar.push("->");
me.totalField = Ext.create("Ext.button.Button", {});
gridToolbar.push(me.totalField);
if(NOC.settings.enableHelp && (me.helpId || me.listHelpId)) {
me.listHelpButton = Ext.create("Ext.button.Button", {
itemId: "listHelp",
glyph: NOC.glyph.question_circle,
tooltip: __("Application Help"),
scope: me,
handler: NOC.helpOpener(me.listHelpId || me.helpId)
});
gridToolbar = gridToolbar.concat("-", me.listHelpButton);
}
// Initialize panels
// Filters
var grid_rbar = null;
me.filterGetters = [];
me.filterSetters = [];
if(me.filters) {
var fh = Ext.bind(me.onFilter, me),
filters = [{
title: __("Favorites"),
name: "fav_status",
ftype: "favorites"
}].concat(me.filters),
baseField = Ext.create("NOC.core.modelfilter.Base");
grid_rbar = {
xtype: "form",
autoScroll: true,
itemId: "filters",
width: baseField.width + Ext.getScrollbarSize().width + 10,
title: __("Filter"),
bodyPadding: 4,
tools: [
{
type: "close",
tooltip: __("Reset filters"),
scope: me,
handler: me.onResetFilters
}
],
items: filters.map(function(f) {
// @todo: Smarter solution using Ext.Class.alias
var ft = {
boolean: "NOC.core.modelfilter.Boolean",
choices: "NOC.core.modelfilter.Choices",
lookup: "NOC.core.modelfilter.Lookup",
list: "NOC.core.modelfilter.List",
vcfilter: "NOC.core.modelfilter.VCFilter",
afi: "NOC.core.modelfilter.AFI",
vc: "NOC.core.modelfilter.VC",
tag: "NOC.core.modelfilter.Tag",
label: "NOC.core.modelfilter.Label",
favorites: "NOC.core.modelfilter.Favorites",
tree: "NOC.core.modelfilter.Tree",
geoaddress: "NOC.core.modelfilter.GeoAddress"
}[f.ftype];
var fc = Ext.Object.merge(f, {
referrer: me.appName,
itemId: f.name
});
var fg = Ext.create(ft, fc);
fg.handler = fh;
me.filterGetters = me.filterGetters.concat(
Ext.bind(fg.getFilter, fg)
);
me.filterSetters = me.filterSetters.concat(
Ext.bind(fg.setFilter, fg)
);
return fg;
})
};
}
// Grid
var cust_columns = me.noc.cust_grid_columns || [];
Ext.each(cust_columns, function(c) {
if(c.renderer && Ext.isString(c.renderer)) {
c.renderer = eval(c.renderer);
}
});
var selModel = Ext.create("Ext.selection.CheckboxModel", {
preventFocus: true
});
if(me.actions) {
selModel.on("selectionchange", me.onActionSelectionChange, me);
}
var rowItems = [
{
glyph: NOC.glyph.star,
tooltip: __("Mark/Unmark"),
scope: me,
getColor: function(cls, meta, r) {
return r.get("fav_status") ? NOC.colors.starred : NOC.colors.unstarred;
},
handler: me.onFavItem
},
{
glyph: NOC.glyph.edit,
color: NOC.colors.edit,
tooltip: __("Edit"),
scope: me,
isDisabled: function() {
var me = this;
return !me.hasPermission("read") && !me.hasPermission("update");
},
handler: function(grid, rowIndex, colIndex) {
var me = this,
record = me.store.getAt(rowIndex);
me.onEditRecord(record);
}
}
];
if(me.openDashboard) {
rowItems = rowItems.concat([
{
glyph: me.openDashboard.icon,
color: me.openDashboard.color,
tooltip: me.openDashboard.tooltip,
scope: me,
handler: function(grid, rowIndex) {
var me = this,
record = me.store.getAt(rowIndex);
var url = '/ui/grafana/dashboard/script/noc.js?dashboard=' + me.openDashboard.type + '&id=' + record.get('managed_object');
if('ipsla' === me.openDashboard.type) {
url += '&var-probe=' + record.get('name')
}
window.open(url);
}
}
]);
}
if(me.levelFilter) {
rowItems = rowItems.concat([
{
glyph: me.levelFilter.icon,
color: me.levelFilter.color,
tooltip: me.levelFilter.tooltip,
scope: me,
handler: function(grid, rowIndex) {
var me = this,
record = me.store.getAt(rowIndex);
me.currentQuery[me.levelFilter.filter] = record.id;
me.store.setFilterParams(me.currentQuery);
Ext.each(me.filterSetters, function(set) {
set(me.currentQuery);
});
me.reloadStore();
}
}
]);
}
// @todo: Replace with preview api
if(me.onPreview) {
rowItems = rowItems.concat([
{
glyph: NOC.glyph.search,
color: NOC.colors.preview,
tooltip: __("Preview"),
scope: me,
handler: function(grid, rowIndex, colIndex) {
var me = this;
me.onPreview(me.store.getAt(rowIndex));
}
}
]);
}
if(me.preview) {
// @todo: Detect panel instances
var config = {
app: me,
xtype: "Ext.panel.Panel"
};
Ext.apply(config, me.preview);
me.ITEM_PREVIEW = me.registerItem(
Ext.create(config.xtype, config)
);
rowItems = rowItems.concat([
{
glyph: NOC.glyph.search,
color: NOC.colors.preview,
tooltip: __("Preview"),
scope: me,
handler: function(grid, rowIndex, colIndex) {
var me = this;
me.showPreview(me.store.getAt(rowIndex));
}
}
]);
}
var gridColumns = me.columns.concat(cust_columns);
// Set up tooltips
Ext.each(gridColumns, function(c) {
if(!c.listeners) {
c.listeners = {};
}
c.listeners.afterrender = function() {
Ext.create("Ext.ToolTip", {
target: this.getEl(),
anchor: "top",
trackMouse: true,
html: this.tooltip || this.text
});
}
});
//
var gridToolbars = [
{
xtype: "toolbar",
items: me.applyPermissions(gridToolbar)
}
];
//
if(me.treeFilter) {
var treeFilterToolbar = Ext.create("NOC.core.TreeFilterToolbar", {
field: me.treeFilter,
url: me.base_url + "tree_lookup/",
listeners: {
scope: me,
select: me.onFilter
}
});
gridToolbars.push(treeFilterToolbar);
me.filterGetters.push(
Ext.bind(treeFilterToolbar.getFilter, treeFilterToolbar)
);
}
//
var gridPanel = Ext.create("Ext.grid.Panel", {
itemId: "grid",
store: me.store,
emptyText: __("No records"),
columns: [
{
xtype: "glyphactioncolumn",
width: 20 * rowItems.length,
sortable: false,
items: rowItems,
stateId: "rowaction"
},
{
text: __("ID"),
dataIndex: me.idField,
hidden: true
}
].concat(gridColumns),
border: false,
autoScroll: true,
stateful: true,
stateId: me.appName + "-grid",
plugins: [
// {
// ptype: "bufferedrenderer"
// //trailingBufferZone: 50,
// //leadingBufferZone: 50
// }
],
selModel: selModel,
dockedItems: gridToolbars,
rbar: grid_rbar,
viewConfig: {
enableTextSelection: true,
getRowClass: Ext.bind(me.getRowClass, me),
listeners: {
scope: me,
cellclick: me.onCellClick
}
},
listeners: {
scope: me,
itemdblclick: function(grid, record) {
this.onEditRecord(record);
}
}
});
// Shortcuts
me.grid = gridPanel;
if(me.filters) {
me.filterPanel = me.grid.getComponent("filters");
}
return gridPanel;
},
//
createForm: function() {
var me = this,
focusField = null,
autoFocusFields;
//
me.saveButton = Ext.create("Ext.button.Button", {
itemId: "save",
text: __("Save"),
tooltip: __("Save changes"),
glyph: NOC.glyph.save,
formBind: true,
disabled: true,
scope: me,
// @todo: check access
handler: me.onSave
});
//
me.closeButton = Ext.create("Ext.button.Button", {
itemId: "close",
text: __("Close"),
tooltip: __("Close without saving"),
glyph: NOC.glyph.arrow_left,
scope: me,
handler: me.onClose
});
//
me.resetButton = Ext.create("Ext.button.Button", {
itemId: "reset",
text: __("Reset"),
tooltip: __("Reset to default values"),
glyph: NOC.glyph.undo,
disabled: true,
scope: me,
handler: me.onReset
});
//
me.deleteButton = Ext.create("Ext.button.Button", {
itemId: "delete",
text: __("Delete"),
tooltip: __("Delete object"),
glyph: NOC.glyph.times,
disabled: true,
hasAccess: NOC.hasPermission("delete"),
scope: me,
handler: me.onDelete
});
//
me.cloneButton = Ext.create("Ext.button.Button", {
itemId: "clone",
text: __("Clone"),
tooltip: __("Copy existing values to a new object"),
glyph: NOC.glyph.copy,
disabled: true,
hasAccess: NOC.hasPermission("create"),
scope: me,
handler: me.onClone
});
//
// Default toolbar items
var formToolbar = [
me.saveButton,
me.closeButton,
"-",
me.resetButton,
me.deleteButton,
"-",
me.cloneButton
];
// Add View button
if(me.onPreview) {
formToolbar.push({
text: __("View"),
tooltip: __("Preview"),
glyph: NOC.glyph.eye,
// hasAccess:
scope: me,
handler: function() {
var me = this;
me.onPreview(me.currentRecord)
}
});
}
if(me.formToolbar && me.formToolbar.length) {
formToolbar.push("-");
}
formToolbar = formToolbar.concat(me.formToolbar);
//
if(NOC.settings.enableHelp && (me.helpId || me.formHelpId)) {
me.formHelpButton = Ext.create("Ext.button.Button", {
itemId: "formHelp",
glyph: NOC.glyph.question_circle,
tooltip: __("Form Help"),
scope: me,
handler: NOC.helpOpener(me.formHelpId || me.helpId)
}
);
formToolbar = formToolbar.concat("->", me.formHelpButton);
}
// Prepare inlines grid
var formInlines = [];
me.inlineStores = [];
if(me.inlines) {
for(var i = 0; i < me.inlines.length; i++) {
var inline = me.inlines[i],
istore = Ext.create("NOC.core.InlineModelStore", {
model: inline.model
}),
gp = {
xtype: "inlinegrid",
columns: inline.columns,
store: istore
};
formInlines.push({
xtype: "fieldset",
anchor: "100%",
minHeight: 130,
minWidth: me.formMinWidth,
maxWidth: me.formMaxWidth,
title: inline.title,
collapsible: true,
collapsed: inline.collapsed,
items: [gp]
});
me.inlineStores.push(istore);
}
}
me.formTitle = Ext.create("Ext.container.Container", {
minWidth: me.formMinWidth,
maxWidth: me.formMaxWidth,
html: "Title",
itemId: "form_title",
padding: "0 0 4 0"
});
// Build form fields
var formFields = [me.formTitle];
// Append configured fields
formFields = formFields.concat(me.fields);
// Append custom fields
if(me.noc.cust_form_fields) {
formFields = formFields.concat(me.noc.cust_form_fields);
}
formFields = formFields.concat(formInlines);
// process protected fields
if(me.noc.hasOwnProperty("protected_field")) {
Ext.Object.each(me.noc.protected_field, function(fieldName, value) {
var find = function(object) {
if(object.hasOwnProperty("name") && object.name === fieldName) {
switch(value) {
case 0:
object.hidden = true;
break;
case 1:
case 2:
object.disabled = true;
break;
}
return;
}
if(object.hasOwnProperty("items")) {
Ext.Array.each(object.items, find);
}
};
Ext.Array.each(formFields, find);
});
}
me.formPanel = Ext.create("Ext.container.Container", {
itemId: "form",
layout: "fit",
items: {
xtype: 'form',
layout: me.formLayout,
border: true,
padding: 4,
bodyPadding: me.themeBodyPadding,
autoScroll: true,
defaults: {
anchor: "100%",
enableKeyEvents: true,
listeners: {
specialkey: {
scope: me,
fn: me.onFormSpecialKey
}
}
},
items: formFields,
dockedItems: {
xtype: "toolbar",
dock: "top",
layout: {
overflowHandler: "Menu"
},
items: me.applyPermissions(formToolbar)
}
},
getDefaultFocus: function() {
return focusField;
}
});
me.form = me.formPanel.items.first().getForm();
// detect autofocus field
autoFocusFields = Ext.ComponentQuery.query("[autoFocus=true]", me.formPanel);
if(autoFocusFields && autoFocusFields.length > 0) {
focusField = autoFocusFields[0];
} else {
focusField = me.form.getFields().items[1];
}
me.restoreFilter(me.noc.filterValuesUrl);
return me.formPanel;
},
// Show grid
showGrid: function() {
var me = this;
me.showItem(me.ITEM_GRID);
me.setHistoryHash();
},
// Show Form
showForm: function() {
var me = this;
me.showItem(me.ITEM_FORM);
if(me.formPanel && me.formPanel.getDefaultFocus) {
var df = me.formPanel.getDefaultFocus();
if(df) {
df.focus();
}
}
},
//
showPreview: function(record) {
var me = this,
item = me.showItem(me.ITEM_PREVIEW);
if(item !== undefined) {
item.preview(record, me.ITEM_GRID);
}
},
// Save changed data
saveRecord: function(data) {
var me = this,
Model = me.store.getModel(),
record = new Model(data),
mv = record.validate(),
result = {};
if(!mv.isValid()) {
// @todo: Error report
NOC.error(__("Invalid data!"));
return;
}
// Normalize
data = record.getData();
for(var name in data) {
if(me.persistentFields[name]) {
result[name] = data[name];
}
}
if(me.currentRecord) {
result[me.idField] = me.currentRecord.get(me.idField);
}
me.inlineStores
.filter(function(store) {
return store.hasOwnProperty("isLocal") && store.isLocal;
})
.forEach(function(store) {
result[store.rootProperty] = store.getData().items.map(function(item) {
var obj = {};
obj[store.parentField] = item.get(store.parentField);
return obj;
});
});
me.mask("Saving ...");
// Save data
Ext.Ajax.request({
url: me.base_url + (me.currentRecord ? result[me.idField] + "/" : ""),
method: me.currentRecord ? "PUT" : "POST",
scope: me,
jsonData: result,
success: function(response) {
// Process result
var data = Ext.decode(response.responseText);
// @todo: Update current record with data
if(me.currentQuery[me.idField]) {
delete me.currentQuery[me.idField];
}
me.showGrid();
me.reloadStore();
me.saveInlines(
data[me.idField],
me.inlineStores.filter(function(store) {
return !(store.hasOwnProperty("isLocal") && store.isLocal);
}));
me.unmask();
NOC.msg.complete(__("Saved"));
},
failure: function(response) {
var message = "Error saving record";
if(response.responseText) {
try {
message = Ext.decode(response.responseText).message;
} catch(err) {
console.log(response.responseText);
}
}
NOC.error(message);
me.unmask();
}
});
},
//
saveInlines: function(parentId, stores) {
var me = this;
if(stores.length > 0) {
var istore = stores[0];
if(parentId) {
istore.setParent(parentId);
}
// Save inline
istore.sync({
scope: me,
success: function() {
// Save next
me.saveInlines(parentId, stores.slice(1));
},
failure: function(response, op, status) {
me.showOpError("save", op, status);
}
});
} else {
me.showGrid();
}
},
// Show Form
onEditRecord: function(record) {
var me = this;
// Check permissions
if(!me.hasPermission("read") && !me.hasPermission("update"))
return;
if(me.recordReload) {
Ext.Ajax.request({
url: me.base_url + record.get(me.idField) + "/",
method: "GET",
scope: me,
success: function(response) {
var data = Ext.decode(response.responseText);
me.editRecord(Ext.create(this.model, data));
},
failure: function() {
NOC.error(__("Record reload error."));
}
});
} else {
me.editRecord(record);
}
},
// New record. Hide grid and open form
newRecord: function(defaults) {
var me = this,
fv = {};
me.form.reset();
// Calculate form field values
Ext.merge(fv, me.store.defaultValues);
Ext.merge(fv, defaults || {});
me.form.setValues(fv);
//
me.currentRecord = null;
me.resetInlines(defaults);
me.setFormTitle(me.createTitle, "NEW");
me.showForm();
// Activate delete button
me.deleteButton.setDisabled(true);
me.saveButton.setDisabled(!me.hasPermission("create"));
me.resetButton.setDisabled(!me.hasPermission("create"));
me.cloneButton.setDisabled(true);
// Disable custom form toolbar
me.activateCustomFormToolbar(false);
},
//
onNewRecord: function() {
var me = this;
me.newRecord();
},
// Edit record. Hide grid and open form
editRecord: function(record) {
var me = this,
r = {},
field,
data;
me.currentRecord = record;
me.setNavTabTooltip({data: me.currentRecord.data});
me.setFormTitle(me.changeTitle, me.currentRecord.get(me.idField));
// Process lookup fields
data = record.getData();
Ext.iterate(data, function(v) {
if(v.indexOf("__") !== -1) {
return
}
// hack to get instance of .TreeCombo class
field = me.fields.filter(function(e) {
return v === e.name && Ext.String.endsWith(e.xtype, '.TreeCombo')
});
if(field.length === 1) {
field[0].restoreById(data[v]);
} else {
field = me.form.findField(v);
if(!field) {
return;
}
if(Ext.isFunction(field.cleanValue)) {
r[v] = field.cleanValue(
me.currentRecord,
me.store.rest_url
)
} else {
r[v] = data[v];
}
}
});
// Show edit form
me.showForm();
// Load records
me.form.reset();
me.form.setValues(r);
me.loadInlines();
// Activate delete button
me.deleteButton.setDisabled(!me.hasPermission("delete"));
me.saveButton.setDisabled(!me.hasPermission("update"));
me.resetButton.setDisabled(!me.hasPermission("update"));
me.cloneButton.setDisabled(!me.hasPermission("create"));
// Enable custom form toolbar
me.activateCustomFormToolbar(true);
//
me.setHistoryHash(me.currentRecord.get(me.idField));
},
// Delete record
deleteRecord: function() {
var me = this;
pollProgress = function(url) {
Ext.Ajax.request({
url: url,
method: "GET",
scope: me,
success: onSuccess,
failure: onFailure
});
},
onSuccess = function(response) {
if(response.status === 202) {
// Future in progress
Ext.Function.defer(
pollProgress, 1000, me,
[response.getResponseHeader("Location")]
);
} else {
// Process result
me.currentRecord = null;
me.reloadStore();
me.showGrid();
me.unmask();
}
},
onFailure = function(response) {
var message;
try {
message = Ext.decode(response.responseText).message;
} catch(err) {
message = "Internal error";
}
NOC.error(message);
me.unmask();
};
if(me.currentRecord) {
me.mask("Deleting ...");
Ext.Ajax.request({
url: me.base_url + me.currentRecord.get(me.idField) + "/",
method: "DELETE",
scope: me,
success: onSuccess,
failure: onFailure
});
}
},
// Reload store with current query
reloadStore: function() {
var me = this;
me.store.setFilterParams(me.currentQuery);
me.saveFilterToUrl(me.currentQuery);
// Reload store
// ExtJS 5.0.0 WARNING:
// me.store.reload() sometimes leaves empty grid
// so we must use load() instead
me.loadStore();
},
// Search
onSearch: function(query) {
var me = this;
if(query && query.length > 0) {
me.currentQuery.__query = query;
} else {
delete me.currentQuery.__query;
}
me.reloadStore();
},
saveFilterToUrl: function(filter) {
var params = Ext.Object.toQueryString(filter, true)
, currentHash = Ext.History.getHash()
, index = currentHash.indexOf('?')
, app;
if(index === -1) {
app = currentHash;
} else {
app = currentHash.substr(0, index);
}
if(params) {
Ext.History.add(app + '?' + params);
} else {
Ext.History.add(app);
}
},
// Filter
onFilter: function() {
var me = this,
fexp = {};
Ext.each(me.filterGetters, function(g) {
fexp = Ext.Object.merge(fexp, g());
});
if(me.currentQuery.__query) {
fexp.__query = me.currentQuery.__query;
}
me.currentQuery = fexp;
me.reloadStore();
},
// Returns form data
getFormData: function() {
var me = this,
fields = me.form.getFields().items.filter(function(item) {
return !(item.hasOwnProperty("isListForm") && item.isListForm)
}),
f, field, data, name,
fLen = fields.length,
values = {};
for(f = 0; f < fLen; f++) {
// hack to get instance of .TreeCombo class
if(Ext.String.endsWith(fields[f].xtype, '.TreeCombo')) {
field = me.fields[f];
} else {
field = fields[f];
}
if(field.inEditor) {
// Skip grid inline editors
// WARNING: Will skip other inline editors
continue;
}
if(!Ext.isFunction(field.getModelData)){
// Skip fields without data, e.g. FieldSet
continue;
}
data = field.getModelData();
if(Ext.isObject(data)) {
name = field.getName();
if(data.hasOwnProperty(name)) {
values[name] = data[name];
}
}
}
return values;
},
//
cleanData: function(v) {
},
// Save button pressed
onSave: function() {
var me = this;
if(!me.form.isValid()) {
NOC.error(__("Error in data"));
return;
}
var v = me.getFormData();
if(!me.currentRecord && v[me.idField] !== undefined) {
delete v[me.idField];
}
//
me.cleanData(v);
// Fetch comboboxes labels
me.form.getFields().each(function(field) {
if(Ext.isDefined(field.getLookupData)) {
v[field.name + "__label"] = field.getLookupData();
}
});
me.saveRecord(v);
},
// Reset button pressed
onReset: function() {
var me = this;
me.form.reset();
},
// Delete button pressed
onDelete: function() {
var me = this;
Ext.Msg.show({
title: __("Delete record?"),
msg: __("Do you wish to delete record? This operation cannot be undone!"),
buttons: Ext.Msg.YESNO,
icon: Ext.window.MessageBox.QUESTION,
modal: true,
fn: function(button) {
if(button == "yes")
me.deleteRecord();
}
});
},
// Form hotkeys processing
onFormSpecialKey: function(field, key) {
var me = this;
if(field.xtype != "textfield")
return;
switch(key.getKey()) {
case Ext.EventObject.ENTER:
key.stopEvent();
me.onSave();
break;
case Ext.EventObject.ESC:
key.stopEvent();
me.onReset();
break;
}
},
// Set form title
setFormTitle: function(tpl, itemId) {
var me = this,
t;
if(me.formTitle) {
t = "<b>" + Ext.String.format(tpl, me.appTitle) + "</b>";
if(itemId !== "NEW" && itemId !== "CLONE") {
itemId = "<b>ID: </b>" + itemId;
} else {
itemId = "<b>" + itemId + "</b>";
}
t += "<span style='float:right'>" + itemId + "</span>";
me.formTitle.update(t);
}
},
//
activateCustomFormToolbar: function(status) {
var me = this,
tb = me.saveButton.ownerCt,
afterSep = false;
tb.items.each(function(i) {
if(afterSep) {
if(i.setDisabled) {
i.setDisabled(!status);
}
} else {
if(i.itemId === "custom_sep") {
afterSep = true;
}
}
});
},
//
onResetFilters: function() {
var me = this;
me.filterPanel.getForm().reset();
Ext.each(me.filterPanel.query(".button[enableToggle]"),
function(b) {
b.toggle(false);
b.fireHandler();
});
me.onFilter();
},
//
showOpError: function(action, op, status) {
var text = Ext.String.format("Failed to {0}", action);
if(status) {
var m = status.message;
if(status.status === 400) {
m = status.traceback;
}
text = Ext.String.format("Failed to {0}!<br>{1}",
action, m);
}
NOC.error(text);
},
// "close" button pressed
onClose: function() {
var me = this,
toReload = me.idField in me.currentQuery;
if(toReload) {
// Remove filter set by loadById
delete me.currentQuery[me.idField];
}
me.clearNavTabTooltip();
// Apply updated filter
me.store.setFilterParams(me.currentQuery);
me.showGrid();
if(toReload) {
me.reloadStore();
}
},
// "clone" button pressed
onClone: function() {
var me = this;
if(me.currentRecord) {
// Reset UUID
if(me.currentRecord.get("uuid")) {
me.currentRecord.set("uuid", null);
me.form.setValues({uuid: null});
}
// Reset bi_id
if(me.currentRecord.get("bi_id")) {
me.currentRecord.set("bi_id", null);
me.form.setValues({bi_id: null});
}
}
// Reset parents of inline stores
Ext.each(me.inlineStores, function(s) {
s.cloneData();
});
me.currentRecord = null; // Mark record as new
me.setFormTitle(me.cloneTitle, "CLONE");
me.cloneButton.setDisabled(true);
},
// Return Grid's row classes
getRowClass: function(record, index, params, store) {
var me = this;
if(me.rowClassField) {
var c = record.get(me.rowClassField);
if(c) {
return c;
} else {
return "";
}
} else {
return "";
}
},
//
onCellClick: function(view, cell, cellIndex, record, row,
rowIndex, e) {
var me = this;
if(e.target.tagName == "A") {
var header = view.panel.headerCt.getHeaderAtIndex(cellIndex);
if(header.onClick) {
header.onClick.apply(me, [record]);
}
}
},
//
onFavItem: function(grid, rowIndex, colIndex) {
var me = this,
r = me.store.getAt(rowIndex),
id = r.get(me.idField),
action = r.get("fav_status") ? "reset" : "set",
url = me.base_url + "favorites/item/" + id + "/" + action + "/";
Ext.Ajax.request({
url: url,
method: "POST",
scope: me,
success: function() {
// Invert current status
r.set("fav_status", !r.get("fav_status"));
grid.refresh();
}
});
},
//
resetInlines: function(defaults) {
// preload default values
var me = this;
Ext.each(me.inlineStores, function(istore) {
var value = [];
if(istore.hasOwnProperty("rootProperty") && this.hasOwnProperty(istore.rootProperty)) {
value = this[istore.rootProperty];
}
istore.loadData(value);
}, defaults || {});
},
// Load inline stores
loadInlines: function() {
var me = this;
// Do not load store on new record
if(!me.currentRecord || !me.inlineStores.length)
return;
var parentId = me.currentRecord.get(me.idField);
Ext.each(me.inlineStores, function(istore) {
istore.setParent(parentId);
istore.load();
});
},
// Admin action selected
onAction: function(menu, item, e) {
var me = this,
records = me.grid.getSelectionModel().getSelection().map(function(o) {
return o.get(me.idField)
});
if(me.hasGroupEdit && item.itemId === "group_edit") {
me.showGroupEditForm(records);
return;
}
if(Ext.isFunction(item.run) || Ext.isFunction(me[item.run])) {
if(typeof item.run === 'string') {
item.run = me[item.run];
}
item.run(
me.grid.getSelectionModel().getSelection()
.map(function(o) {
return {object: o.get(me.idField), object__label: o.get('name')}
}));
return;
}
if(item.form) {
me.showActionForm(item, records);
} else {
me.runAction(item, {ids: records});
}
},
//
runAction: function(action, params) {
var me = this;
Ext.Ajax.request({
url: me.base_url + "actions/" + action.itemId + "/",
method: "POST",
scope: me,
jsonData: params,
success: function(response) {
var r = Ext.decode(response.responseText) || "OK";
if(action.resultTemplate) {
var d = action.resultTemplate.apply(r);
Ext.create("Ext.Window", {
html: d,
width: 600,
height: 400,
autoScroll: true,
layout: "fit",
maximizable: true,
title: Ext.String.format("Result: {0}", action.text)
}).show();
} else {
NOC.info(r);
}
me.reloadStore();
},
failure: function() {
NOC.error(__("Failed"));
}
});
},
//
showActionForm: function(action, records) {
var me = this,
w = Ext.create("Ext.Window", {
modal: true,
autoShow: true,
layout: "fit",
items: [{
xtype: "form",
items: action.form
}],
title: Ext.String.format("{0} on {1} records",
action.text,
records.length),
buttons: [{
text: __("Run"),
glyph: NOC.glyph.play,
handler: function() {
var form = w.items.first().getForm();
if(!form.isValid()) {
NOC.error(__("Error"));
return;
}
var params = form.getValues();
params.ids = records;
w.close();
me.runAction(action, params);
}
}]
});
},
onActionSelectionChange: function(o, selected, opts) {
var me = this;
me.actionMenu.setDisabled(!selected.length);
},
//
// Override with
// onPreview: function(record)
// to create item preview
//
onPreview: undefined,
//
// Load record by id and call callback
// Callback is the function(record)
//
loadById: function(id, callback) {
var me = this,
fp = {};
fp[me.idField] = id;
me.currentQuery[me.idField] = id;
me.store.setFilterParams(fp);
me.store.load({
scope: me,
callback: function(records, operation, success) {
if(operation.success && records.length === 1) {
Ext.callback(callback, me, [records[0]]);
}
me.checkStoreLoad(operation);
}
});
},
//
restoreHistory: function(args) {
var me = this;
if(args.length === 1) {
me.loadById(args[0], function(record) {
me.onEditRecord(record);
});
}
},
//
onBeforeLoad: function() {
var me = this;
if(me.rendered) {
me.refreshButton.setDisabled(true);
}
},
//
onLoad: function() {
var me = this,
total = me.store.getTotalCount();
me.totalField.setText(__("Total: ") + total);
if(me.rendered) {
me.refreshButton.setDisabled(false);
}
},
//
onLoadError: function() {
var me = this;
if(me.rendered) {
me.refreshButton.setDisabled(false);
}
},
//
onRefresh: function() {
var me = this;
me.reloadStore();
},
// Returns true if form has at least one groupEdit: true
checkGroupEdit: function() {
var me = this,
check = function(seq) {
if(!seq) {
return false;
}
for(var i = 0; i < seq.length; i++) {
var v = seq[i];
if(!v) {
continue;
}
if(v.groupEdit === true) {
return true;
}
if(v.items && v.items.length && check(v.items)) {
return true;
}
}
return false;
};
return me.hasPermission("update") && check(me.fields);
},
//
createGroupForm: function() {
var me = this,
form,
getFormItems = function(fields) {
var items = [];
Ext.each(fields, function(v) {
var x, xtype = v.xtype.indexOf("LookupField") !== -1 ? "combobox" : v.xtype;
v.allowBlank = true;
switch(xtype) {
case "fieldset":
case "container":
x = {
xtype: v.xtype,
title: v.title,
items: getFormItems(v.items)
};
if(v.layout) {
x.layout = v.layout;
}
if(v.defaults) {
x.defaults = v.defaults;
}
if(v.border || v.border === false) {
x.border = v.border;
}
if(v.padding || v.padding === 0) {
x.padding = v.padding;
}
items.push(x);
break;
case "checkbox":
case "checkboxfield":
if(v.groupEdit === true) {
x = {
xtype: "combobox",
fieldLabel: v.fieldLabel,
name: v.name,
store: [
["Leave unchanged", "Leave unchanged"],
[true, "Set"],
[false, "Reset"]
],
// fix catch changeDirty
listeners: {
scope: me,
change: function() {
this.saveGroupButton.setDisabled(false);
}
}
}
} else {
x = v.cloneConfig ? v.cloneConfig() : v;
if(x.setDisabled) {
x.setDisabled(true);
} else {
x.disabled = true;
}
}
items.push(x);
me.groupCheckboxFields[v.name] = true;
break;
case "combobox":
x = v.cloneConfig ? v.cloneConfig() : v;
x.triggers = {
clear: {
weight: 1,
cls: Ext.baseCSSPrefix + "form-clear-trigger",
tooltip: __("to default value"),
hidden: true,
handler: me.toDefaultValueString,
scope: me
},
picker: {
weight: 2,
// ToDo use onTriggerClick
handler: function() {
var me = this;
if(!me.readOnly && !me.disabled) {
if(me.isExpanded) {
me.collapse();
} else {
if(me.triggerAction === "all") {
me.doQuery(me.allQuery, true);
} else if(me.triggerAction === "last") {
me.doQuery(me.lastQuery, true);
} else {
me.doQuery(me.getRawValue(), false, true);
}
}
}
}
}
};
x.listeners = {
focus: function(field) {
if(field.value === "Leave unchanged") {
field.setValue("");
}
},
render: me.clearTriggerToolTip
};
x.updateValue = function() {
// ToDo use this.callParent(arguments)
var self = this,
selectedRecords = self.valueCollection.getRange(),
len = selectedRecords.length,
valueArray = [],
displayTplData = self.displayTplData || (self.displayTplData = []),
inputEl = self.inputEl,
i, record;
displayTplData.length = 0;
for(i = 0; i < len; i++) {
record = selectedRecords[i];
displayTplData.push(self.getRecordDisplayData(record));
if(record !== self.valueNotFoundRecord) {
valueArray.push(record.get(self.valueField));
}
}
self.setHiddenValue(valueArray);
self.value = self.multiSelect ? valueArray : valueArray[0];
if(!Ext.isDefined(self.value)) {
self.value = undefined;
}
self.displayTplData = displayTplData;
if(inputEl && self.emptyText && !Ext.isEmpty(self.value)) {
inputEl.removeCls(self.emptyCls);
}
self.setRawValue(self.getDisplayValue());
self.checkChange();
self.applyEmptyText();
me.showClearTrigger(this);
// this.callParent(arguments);
};
if(x.setDisabled) {
x.setDisabled(x.groupEdit !== true);
} else {
x.disabled = x.groupEdit !== true;
}
items.push(x);
break;
case "textfield":
x = v.cloneConfig ? v.cloneConfig() : v;
x.triggers = {
clear: {
weight: 1,
cls: Ext.baseCSSPrefix + "form-clear-trigger",
hidden: true,
handler: me.toDefaultValueString,
scope: me
}
};
x.listeners = {
focus: function(field) {
if(field.value === "Leave unchanged") {
field.setValue("");
}
},
render: me.clearTriggerToolTip
};
x.publishValue = function() {
me.showClearTrigger(this);
// this.callParent();
};
if(x.setDisabled) {
x.setDisabled(x.groupEdit !== true);
} else {
x.disabled = x.groupEdit !== true;
}
items.push(x);
break;
default:
x = v.cloneConfig ? v.cloneConfig() : v;
if(x.setDisabled) {
x.setDisabled(x.groupEdit !== true);
} else {
x.disabled = x.groupEdit !== true;
}
items.push(x);
break;
}
});
return items;
};
me.saveGroupButton = Ext.create("Ext.button.Button", {
text: __("Save"),
glyph: NOC.glyph.save,
disabled: true,
scope: me,
// @todo: check access
handler: me.onGroupSave
});
me.groupCheckboxFields = {};
me.groupFormTitle = Ext.create("Ext.container.Container", {
html: "Title",
padding: 4,
style: {
fontWeight: "bold"
}
});
form = Ext.create("Ext.form.Panel", {
padding: 4,
bodyPadding: me.themeBodyPadding,
autoScroll: true,
listeners: {
dirtychange: function(form, dirty) {
me.saveGroupButton.setDisabled(!dirty);
}
},
items: [me.groupFormTitle].concat(getFormItems(me.fields)),
dockedItems: [
{
xtype: "toolbar",
dock: "top",
items: [
me.saveGroupButton,
{
text: __("Close"),
glyph: NOC.glyph.arrow_left,
scope: me,
handler: me.onGroupClose
}
]
}
]
});
me.groupForm = form.getForm();
return form;
},
//
createActionMenu: function() {
var me = this,
items = [];
// Group edit
if(me.hasGroupEdit) {
items.push({
text: __("Group Edit"),
itemId: "group_edit",
glyph: NOC.glyph.edit
});
}
// Other items
if(me.actions) {
items = items.concat(me.actions.map(function(o) {
return {
text: o.title,
itemId: o.action,
form: o.form,
glyph: o.glyph,
run: o.run,
resultTemplate: o.resultTemplate
}
}));
}
me.actionMenu = Ext.create("Ext.button.Button", {
glyph: NOC.glyph.download,
tooltip: __("Group actions"),
hasAccess: NOC.hasPermission("update"),
itemId: "action_menu",
disabled: true,
menu: {
xtype: "menu",
plain: true,
items: items,
listeners: {
click: {
scope: me,
fn: me.onAction
}
}
}
});
return me.actionMenu;
},
//
showGroupEditForm: function(items) {
var me = this;
me.groupEditItems = items;
me.groupFormTitle.update(Ext.String.format(
me.groupChangeTitle, items.length, me.appTitle
));
var selection = me.grid.getSelectionModel().getSelection();
var r = Ext.clone(selection[0].data);
for(var i = 1; i < selection.length; i++) {
Ext.Object.each(selection[i].data, function(key, value) {
if(r.hasOwnProperty(key)) {
if(r[key] !== value) {
r[key] = "Leave unchanged";
}
} else {
r[key] = "Leave unchanged";
}
});
}
me.groupForm.getFields().items.forEach(function(field) {
if(r && r.hasOwnProperty(field.name)) {
field.value = r[field.name];
} else {
field.value = "";
}
field.initValue();
}, me);
me.saveGroupButton.setDisabled(true);
me.showItem(me.ITEM_GROUP_FORM);
},
//
toDefaultValueString: function(field) {
var me = this;
field.setValue(this.store.defaultValues[field.name]);
me.saveGroupButton.setDisabled(false);
},
//
showClearTrigger: function(field) {
var me = this, newValue = field.getValue() || "";
if(me.store.defaultValues.hasOwnProperty(field.name)) {
var defaultValue = me.store.defaultValues[field.name] || "";
if(field.getTrigger('clear').hidden && newValue !== defaultValue) {
field.getTrigger('clear').show();
field.updateLayout();
}
if(newValue === defaultValue) {
field.getTrigger('clear').hide();
field.updateLayout();
}
} else {
if(newValue) {
field.getTrigger('clear').show();
field.updateLayout();
} else {
field.getTrigger('clear').hide();
field.updateLayout();
}
}
me.saveGroupButton.setDisabled(!field.isDirty());
},
//
onGroupClose: function() {
var me = this;
me.showGrid();
},
//
onGroupSave: function() {
var me = this,
values = {},
valuesTxt = "";
// @todo: Form validation
Ext.Array.each(me.groupForm.getFields().items, function(field) {
if(Ext.isFunction(field.isDirty) && field.isDirty()) {
valuesTxt += (field.fieldLabel || field.name) + ": '";
if(Ext.isFunction(field.getDisplayValue)) {
valuesTxt += field.getDisplayValue();
} else {
valuesTxt += field.getValue();
}
valuesTxt += "'</br>";
if(field.getValue() !== "Leave unchanged") {
values[field.name] = field.getValue();
}
}
});
if(!Ext.Object.isEmpty(values)) {
values.ids = me.groupEditItems;
var message = Ext.String.format("Do you wish to change {0} record(s): <br/><br/>{1}<br/>This operation cannot be undone!", values.ids.length, valuesTxt);
Ext.Msg.show({
title: __("Change records?"),
msg: message,
buttons: Ext.Msg.YESNO,
icon: Ext.window.MessageBox.QUESTION,
modal: true,
fn: function(button) {
if(button === "yes") {
Ext.Ajax.request({
url: me.base_url + "actions/group_edit/",
method: "POST",
scope: me,
jsonData: values,
success: function() {
NOC.info(__("Records has been updated"));
me.showGrid();
me.reloadStore();
},
failure: function() {
NOC.error(__("Failed"));
}
});
}
}
});
} else {
me.showGrid();
}
},
//
clearTriggerToolTip: function() {
var triggerEl = this.getTrigger('clear').el;
triggerEl.dom.setAttribute("data-qtip", __("to default value"));
},
//
onMetrics: function(record) {
var me = this;
me.showItem(me.ITEM_METRIC_SETTINGS).preview(record);
},
//
restoreFilter: function(currentHash) {
var me = this,
filterStr,
index,
queryString;
if(!currentHash) {
return;
}
index = currentHash.indexOf('?');
if(index !== -1) {
queryString = currentHash.substr(index + 1);
filterStr = Ext.Object.fromQueryString(queryString, true);
Ext.each(me.filterSetters, function(set) {
set(filterStr);
});
if('__query' in filterStr) {
me.searchField.setValue(filterStr['__query'])
}
me.currentQuery = filterStr;
me.store.setFilterParams(me.currentQuery);
}
},
//
onLevelUp: function() {
var me = this,
filter = me.grid.getComponent("filters").getComponent(me.levelFilter.filter),
currentFilter = me.currentQuery[me.levelFilter.filter];
if(currentFilter) {
Ext.Ajax.request({
method: "GET",
url: filter.tree.restUrl + "/" + currentFilter + "/get_path/",
scope: me,
success: function(response) {
var data = Ext.decode(response.responseText).data,
newRoot;
if(data.length <= 1) {
newRoot = "_root_"
} else {
newRoot = data[data.length - 2].id
}
filter.tree.restoreById(newRoot)
}
})
}
},
//
addTooltip: function(element) {
if(element.tooltip) {
Ext.create('Ext.tip.ToolTip', {
target: element.getEl(),
html: element.tooltip
});
}
},
loadStore: function() {
var me = this;
me.store.load({
callback: function(records, operation) {
me.checkStoreLoad(operation)
}
});
},
checkStoreLoad: function(operation) {
if(operation.success === false) {
var message = operation.getError() || __("Failed to load data");
if(Ext.isObject(message)) {
message = message.statusText;
}
NOC.error(message);
return
}
if(operation.getResponse().status >= 300) {
NOC.error(__("HTTP status : ") + operation.getResponse().status);
}
}
});
|
from dataclasses import dataclass
from typing import List
from achi.util.ints import uint8, uint32
from achi.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class WalletInfo(Streamable):
"""
This object represents the wallet data as it is stored in DB.
ID: Main wallet (Standard) is stored at index 1, every wallet created after done has auto incremented id.
Name: can be a user provided or default generated name. (can be modified)
Type: is specified during wallet creation and should never be changed.
Data: this filed is intended to be used for storing any wallet specific information required for it.
(RL wallet stores origin_id, admin/user pubkey, rate limit, etc.)
This data should be json encoded string.
"""
id: uint32
name: str
type: uint8 # WalletType(type)
data: str
@dataclass(frozen=True)
@streamable
class WalletInfoBackup(Streamable):
"""
Used for transforming list of WalletInfo objects into bytes.
"""
wallet_list: List[WalletInfo]
|
import sys, os
import unittest
import win32rcparser
import win32con
import tempfile
class TestParser(unittest.TestCase):
def setUp(self):
rc_file = os.path.join(os.path.dirname(__file__), "win32rcparser", "test.rc")
self.resources = win32rcparser.Parse(rc_file)
def testStrings(self):
for sid, expected in [
("IDS_TEST_STRING4", "Test 'single quoted' string"),
("IDS_TEST_STRING1", 'Test "quoted" string'),
("IDS_TEST_STRING3", 'String with single " quote'),
("IDS_TEST_STRING2", 'Test string'),
]:
got = self.resources.stringTable[sid].value
self.assertEqual(got, expected)
def testStandardIds(self):
for idc in "IDOK IDCANCEL".split():
correct = getattr(win32con, idc)
self.assertEqual(self.resources.names[correct], idc)
self.assertEqual(self.resources.ids[idc], correct)
def testTabStop(self):
d = self.resources.dialogs["IDD_TEST_DIALOG2"]
tabstop_names = ["IDC_EDIT1", "IDOK"] # should have WS_TABSTOP
tabstop_ids = [self.resources.ids[name] for name in tabstop_names]
notabstop_names = ["IDC_EDIT2"] # should have WS_TABSTOP
notabstop_ids = [self.resources.ids[name] for name in notabstop_names]
num_ok = 0
for cdef in d[1:]: # skip dlgdef
#print cdef
cid = cdef[2]
style = cdef[-2]
styleex = cdef[-1]
if cid in tabstop_ids:
self.failUnlessEqual(style & win32con.WS_TABSTOP, win32con.WS_TABSTOP)
num_ok += 1
elif cid in notabstop_ids:
self.failUnlessEqual(style & win32con.WS_TABSTOP, 0)
num_ok += 1
self.failUnlessEqual(num_ok, len(tabstop_ids) + len(notabstop_ids))
class TestGenerated(TestParser):
def setUp(self):
# don't call base!
rc_file = os.path.join(os.path.dirname(__file__), "win32rcparser", "test.rc")
py_file = tempfile.mktemp('test_win32rcparser.py')
try:
win32rcparser.GenerateFrozenResource(rc_file, py_file)
py_source = open(py_file).read()
finally:
if os.path.isfile(py_file):
os.unlink(py_file)
# poor-man's import :)
globs = {}
exec(py_source, globs, globs)
self.resources = globs["FakeParser"]()
if __name__=='__main__':
unittest.main()
|
const Spot = require('../models/Spot');
module.exports = {
async show(req, res) {
const { user_id } = req.headers;
const spots = await Spot.find({ user: user_id });
return res.json(spots);
}
};
|
/*
* ! ${copyright}
*/
sap.ui.define([
"sap/ui/base/Object",
"sap/ui/mdc/p13n/PersistenceProvider"
], function (BaseObject, PersistenceProvider) {
"use strict";
var ERROR_INSTANCING = "DefaultProviderRegistry: This class is a singleton and should not be used without an AdaptationProvider. Please use 'sap.ui.mdc.p13n.Engine.getInstance().defaultProviderRegistry' instead";
//Singleton storage
var oDefaultProviderRegistry;
/**
* Constructor for a new DefaultProviderRegistry.
* This registry creates and manages default persistence providers for each persistence mode.
* It is intended for use cases where no dedicated provider can or should be created by an application.
* The DefaultProviderRegistry currently resides in the Engine and must never be called separately.
*
* @class
* @extends sap.ui.base.Object
*
* @author SAP SE
* @version ${version}
*
* @private
* @ui5-restricted sap.ui.mdc
* @experimental As of version 1.89
* @since 1.89
* @alias sap.ui.mdc.p13n.DefaultProviderRegistry
*/
var DefaultProviderRegistry = BaseObject.extend("sap.ui.mdc.p13n.modules.DefaultProviderRegistry", {
constructor: function() {
if (oDefaultProviderRegistry) {
throw Error(ERROR_INSTANCING);
}
BaseObject.call(this);
this._mDefaultProviders = {};
}
});
/**
* @override
* @inheritDoc
*/
DefaultProviderRegistry.prototype.destroy = function() {
Object.keys(this._mDefaultProviders).forEach(function (sProviderName) {
this._mDefaultProviders[sProviderName].destroy();
delete this._mDefaultProviders[sProviderName];
}.bind(this));
BaseObject.prototype.destroy.apply(this, arguments);
};
/**
* @private
* @ui5-restricted sap.ui.mdc
*
* Attaches a control to a default persistence provider held inside the DefaultProviderRegistry for the given <code>PersistenceMode</code>
*
* @param {sap.ui.mdc.Control|string} vControl The control instance or a control id.
* @param {sap.ui.mdc.enum.PersistenceMode} sPersistenceMode Desired persistence mode for the retrieved persistence provider
* @returns {sap.ui.mdc.p13n.PersistenceProvider} Returns a persistence provider instance, if possible
*/
DefaultProviderRegistry.prototype.attach = function (vControl, sPersistenceMode) {
if (vControl.getEngine().isRegisteredForModification(vControl)) { // Modification settings for a registered control are only determined once in the Engine
throw new Error("DefaultProviderRegistry: You must not change the modificationSettings for an already registered control");
}
var oDefaultProvider = this._retrieveDefaultProvider(sPersistenceMode);
var sControlId = typeof vControl === "string" ? vControl : vControl.getId();
if (oDefaultProvider.getFor().indexOf(sControlId) === -1) {
oDefaultProvider.addFor(vControl);
}
return oDefaultProvider;
};
/**
* @private
* @ui5-restricted sap.ui.mdc
*
* Detaches a control from any existing default persistence provider
*
* @param {sap.ui.mdc.Control|string} vControl The control instance or a control id.
*/
DefaultProviderRegistry.prototype.detach = function (vControl) {
Object.keys(this._mDefaultProviders).forEach(function (sMode) {
var oDefaultProvider = this._mDefaultProviders[sMode];
oDefaultProvider.removeFor(vControl);
}.bind(this));
};
/**
* @private
* @ui5-restricted sap.ui.mdc
*
* Returns a promise resolving a default persistence provider for the given <code>Control</code> and <code>PersistenceMode</code>.
*
* @param {sap.ui.mdc.enum.PersistenceMode} sPersistenceMode Desired persistence mode for the retrieved persistence provider
* @returns {Promise} Returns a <code>Promise</code> returning a persistence provider instance, if possible
*/
DefaultProviderRegistry.prototype._retrieveDefaultProvider = function (sPersistenceMode) {
this._mDefaultProviders[sPersistenceMode] = this._mDefaultProviders[sPersistenceMode] || new PersistenceProvider({mode: sPersistenceMode});
return this._mDefaultProviders[sPersistenceMode];
};
/**
* @private
* @ui5-restricted sap.ui.mdc
*
* This method is the central point of access to the DefaultProviderRegistry Singleton.
*/
DefaultProviderRegistry.getInstance = function() {
if (!oDefaultProviderRegistry) {
oDefaultProviderRegistry = new DefaultProviderRegistry();
}
return oDefaultProviderRegistry;
};
return DefaultProviderRegistry;
});
|
/*
* thrust
*
* Copyright (C) 2018 AbbeyCat (abbeycatuk@gmail.com)
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
/* global environment, ship, ball, landscape, context, images, canvas, audio_bing, audio_thrust, audio_explosion, particle_type, game_state */
preload_graphics( function() { init(); state_machine( game_state.PRESS_FIRE_TO_PLAY ); } );
function init() {
input_init();
graphics_init();
audio_init();
environment_init();
}
|
//setup password user studio
$("#setup-pw").on("click",function(e){
e.preventDefault();
var formData=new FormData();
formData.append("password1",$("#password1").val());
formData.append("password2",$("#password2").val());
formData.append("user_code",$("#user_code").val());
for (var pair of formData.entries()) {
console.log(pair[0]+ ', ' + pair[1]);
}
$.ajax({
type:'POST',
url:'../setpassword',
cache:false,
contentType: false,
processData: false,
data: formData,
success:function(data){
if(data.success){
console.log(data.success);
window.location = "../login";
}
else if(data.error){
console.log(data.error);
}
},
error:function(data) {
/*$('#message ul').empty();
if( data.status == 422 ) {
var errors = $.parseJSON(data.responseText);
$.each(errors, function (key, value) {
$('#message').addClass("alert alert-danger");
if($.isPlainObject(value)) {
$.each(value, function (key, value) {
console.log(key+ " " +value);
$('#message ul').append("<li>"+value+"</li>");
});
}
});
}*/
}
});
});
|
import {
addNodeViewTitleAndText,
customFieldView,
externalReferencesView
} from "../basic.js";
export const LOCATION_TYPE = "location";
export function getLocationView(titleId, contentId, typeId, locationSDO) {
document.getElementById(titleId).innerHTML += locationSDO.name;
document.getElementById(typeId).innerHTML += "Location";
let el = document.getElementById(contentId);
const locationDIV = document.createElement("div");
locationDIV.id = "location";
if (locationSDO?.description) addNodeViewTitleAndText(locationDIV, "Description:", locationSDO.description);
if (locationSDO?.latitude) addNodeViewTitleAndText(locationDIV, "Latitude:", locationSDO.latitude.toString());
if (locationSDO?.longitude) addNodeViewTitleAndText(locationDIV, "Longitude:", locationSDO.longitude.toString());
if (locationSDO?.precision) addNodeViewTitleAndText(locationDIV, "Precision:", locationSDO.precision.toString());
if (locationSDO?.region) addNodeViewTitleAndText(locationDIV, "Region:", locationSDO.region);
if (locationSDO?.country) addNodeViewTitleAndText(locationDIV, "Country:", locationSDO.country);
if (locationSDO?.administrative_area) addNodeViewTitleAndText(locationDIV, "Administrative Area:",
locationSDO.administrative_area);
if (locationSDO?.city) addNodeViewTitleAndText(locationDIV, "City:", locationSDO.city);
if (locationSDO?.street_address) addNodeViewTitleAndText(locationDIV, "Street Address:",
locationSDO.street_address);
if (locationSDO?.postal_code) addNodeViewTitleAndText(locationDIV, "Postal Code:", locationSDO.postal_code);
el.appendChild(locationDIV);
customFieldView(locationDIV.id, locationSDO);
if (locationSDO?.external_references) {
externalReferencesView(locationDIV, locationSDO.external_references);
}
}
|
Blockly.Msg.ACTUAL = "çağır";
Blockly.Msg.ADD = "Ekle";
Blockly.Msg.ADD_COMMENT = "Yorum Ekle";
Blockly.Msg.ADD_PARAMETER = "Parametre ekle";
Blockly.Msg.CANCEL = "İptal";
Blockly.Msg.CHANGE_VALUE_TITLE = "Değeri değiştir:";
Blockly.Msg.CLOSE = "Kapat";
Blockly.Msg.COLLAPSE_ALL = "Blokları Daralt";
Blockly.Msg.COLLAPSE_BLOCK = "Blok'u Daralt";
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "renk 1";
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "renk 2";
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/";
Blockly.Msg.COLOUR_BLEND_RATIO = "oran";
Blockly.Msg.COLOUR_BLEND_TITLE = "karıştır";
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "İki rengi verilen bir oranda(0.0 - 1.0) karıştırır.";
Blockly.Msg.COLOUR_PICKER_HELPURL = "http://en.wikipedia.org/wiki/Color";
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Paletten bir renk seçiniz.";
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com";
Blockly.Msg.COLOUR_RANDOM_TITLE = "rastgele renk";
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Rastgele bir renk seçer.";
Blockly.Msg.COLOUR_RGB_BLUE = "mavi";
Blockly.Msg.COLOUR_RGB_GREEN = "yeşil";
Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html";
Blockly.Msg.COLOUR_RGB_RED = "kırmızı";
Blockly.Msg.COLOUR_RGB_TITLE = "renklendir";
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Belirtilen miktarlarda kırmızı, yeşil ve mavi ile bir renk oluşturur. Tüm değerler 0 ile 100 arasında olmalıdır.";
Blockly.Msg.CONFIRM_CREATE_VARIABLE = "Oluştur";
Blockly.Msg.CONFIRM_DELETE_FUNCTION_MESSAGE = "Uyarı! %1 öğesini silmek istediğinizden emin misiniz?";
Blockly.Msg.CONFIRM_RENAME_VARIABLE = "Yeniden adlandır";
Blockly.Msg.CONTRACT_EDITOR_HEADER = "Tasarım Tarifi";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://code.google.com/p/blockly/wiki/Loops#Loop_Termination_Blocks";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "döngüden çık";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "Döngünün sonraki adımından devam et";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "İçeren döngüden çık.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Bu döngünün geri kalanını atlayın ve sonraki adım ile devam edin.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Uyarı: Bu blok sadece bir döngü içinde kullanılabilir.";
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://code.google.com/p/blockly/wiki/Loops#for_each";
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST = "için";
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST_TAIL = "";
Blockly.Msg.CONTROLS_FOREACH_INPUT_ITEM = "listedeki her bir";
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Listedeki her öğeyi '%1' değişkenine ver ve komutu yerine getir.";
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://code.google.com/p/blockly/wiki/Loops#count_with";
Blockly.Msg.CONTROLS_FOR_INPUT_COUNTER = "for %1 from %2 to %3 count by %4";
Blockly.Msg.CONTROLS_FOR_INPUT_FROM_TO_BY = "%1 den %2 ye, her adımda %3 değişim";
Blockly.Msg.CONTROLS_FOR_INPUT_WITH = "şununla say";
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "%1 değişkenini başlangıç numarasından bitiş numarasına kadar belirtilen farkla değerler verirken belirtilen blokları gerçekleştirir.";
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "If (eğer) bloğuna bir koşul ekleyin.";
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "If (eğer) bloğuna kalan durumları \"yakalayan\" bir son ekle.";
Blockly.Msg.CONTROLS_IF_HELPURL = "http://code.google.com/p/blockly/wiki/If_Then";
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "If (eğer) bloğunu düzenlemek için bölümleri ekle, kaldır veya yeniden sırala.";
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "ya da";
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "eğer değilse";
Blockly.Msg.CONTROLS_IF_MSG_IF = "eğer";
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Eğer değer doğruysa ardından gelen işlemleri yapar.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Eğer değer doğru ise ilk bloktaki işlemleri yapar. Aksi halde ikinci bloktaki işlemleri yapar.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Eğer ilk değer doğru ise ilk blok içerisindeki işlem(ler)i yapar. İlk değer doğru değil ve ikinci değer doğru ise, ikinci bloktaki işlem(ler)i yapar.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Eğer ilk değer doğru ise ilk bloktaki işlem(ler)i gerçekleştirir. İlk değer doğru değil ve ikinci değer doğru ise, ikinci bloktaki işlem(ler)i gerçekleştirir. Eğer değerlerin hiçbiri doğru değil ise son bloktaki işlem(ler)i gerçekleştirir.";
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "http://en.wikipedia.org/wiki/For_loop Döngü";
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "yap";
Blockly.Msg.CONTROLS_REPEAT_TITLE = "%1 kez tekrarla";
Blockly.Msg.CONTROLS_REPEAT_TITLE_REPEAT = "bu işlemleri";
Blockly.Msg.CONTROLS_REPEAT_TITLE_TIMES = "kez tekrarla";
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "İşlemleri birden fazla kez yapar.";
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "http://code.google.com/p/blockly/wiki/Repeat";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "kadar tekrarla";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "şu doğruyken tekrarla:";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Bir değer yanlış olduğu sürece işlemleri yapar.";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Bir değer doğru olduğu sürece işlemleri yapar.";
Blockly.Msg.DEFINE_HEADER_DEFINITION = "Tanım";
Blockly.Msg.DEFINE_FUNCTION_DEFINE = "Tanımla";
Blockly.Msg.DEFINE_FUNCTION_FOR_EXAMPLE = "Aşağıdaki işlevi tanımlayın ve yeniden deneyin.";
Blockly.Msg.DELETE = "Sil";
Blockly.Msg.DELETE_BLOCK = "Blok'u Sil";
Blockly.Msg.DELETE_PARAMETER = "Değer sil...";
Blockly.Msg.DELETE_PARAMETER_TITLE = "Bu komut, tüm '%1' değeleri siler. Emin misiniz?";
Blockly.Msg.DELETE_X_BLOCKS = "%1 Bloğu Sil";
Blockly.Msg.DISABLE_BLOCK = "Bloğu Devre Dışı Bırak";
Blockly.Msg.DUPLICATE_BLOCK = "Çoğalt";
Blockly.Msg.ENABLE_BLOCK = "Bloğu Etkinleştir";
Blockly.Msg.EXAMPLE = "Örnek";
Blockly.Msg.EXAMPLE_DESCRIPTION = "Beklenen ve fiili davranışları ile örnek tanımlar";
Blockly.Msg.EXPAND_ALL = "Blokları Genişlet";
Blockly.Msg.EXPAND_BLOCK = "Bloğu Genişlet";
Blockly.Msg.EXPECTED = "sonuç";
Blockly.Msg.EXTERNAL_INPUTS = "Harici Girişler";
Blockly.Msg.FUNCTION_CREATE = "Bir fonksiyon oluştur";
Blockly.Msg.FUNCTION_EDIT = "düzenle";
Blockly.Msg.FUNCTION_NAME_LABEL = "Fonksiyonuna isim ver:";
Blockly.Msg.FUNCTION_DESCRIPTION_LABEL = "Fonksiyonunun ne yapması gerekiyor?";
Blockly.Msg.FUNCTION_PARAMETERS_LABEL = "Fonksiyonun hangi parametreleri alıyor?";
Blockly.Msg.FUNCTION_HEADER = "Fonksiyon";
Blockly.Msg.FUNCTIONAL_CREATE = "Yeni blok";
Blockly.Msg.FUNCTIONAL_EDIT = "düzenle";
Blockly.Msg.FUNCTIONAL_NAME_LABEL = "İsim";
Blockly.Msg.FUNCTIONAL_TYPE_LABEL = "Türü seç...";
Blockly.Msg.FUNCTIONAL_DESCRIPTION_LABEL = "Tanım";
Blockly.Msg.FUNCTIONAL_DOMAIN_LABEL = "Alan";
Blockly.Msg.FUNCTIONAL_PROCEDURE_DEFINE_TOOLTIP = "Fonksiyonel yöntemi tanımlayın";
Blockly.Msg.FUNCTIONAL_RANGE_LABEL = "Aralık";
Blockly.Msg.FUNCTIONAL_VARIABLE_CREATE = "Değişken yarat";
Blockly.Msg.FUNCTIONAL_VARIABLE_HEADER = "Değişken";
Blockly.Msg.FUNCTIONAL_VARIABLE_TYPE = "Tür";
Blockly.Msg.HELP = "Yardım";
Blockly.Msg.INLINE_INPUTS = "Satır içi girdi";
Blockly.Msg.KEEP = "Sakla";
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "http://en.wikipedia.org/wiki/Linked_list#Empty_lists";
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "boş liste oluştur";
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Veri kaydı içermeyen, uzunluğu 0 olan bir liste verir";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "liste";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Bu liste bloğunu yeniden yapılandırmak için bölüm ekle, kaldır veya yeniden sırala.";
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "Şunlarla liste oluştur:";
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Listeye bir nesne ekle.";
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Herhangi bir sayıda nesne içeren liste oluştur.";
Blockly.Msg.LISTS_GET_INDEX_FIRST = "ilk";
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "sondan #";
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#";
Blockly.Msg.LISTS_GET_INDEX_GET = "değer al";
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "değer al ve kaldır";
Blockly.Msg.LISTS_GET_INDEX_LAST = "Sonuncu";
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "gelişigüzel";
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "kaldır";
Blockly.Msg.LISTS_GET_INDEX_TAIL = "";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Listedeki ilk öğeyi verir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_END = "Listede belirtilen pozisyondaki öğeyi verir. #1 son öğedir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_START = "Listede belirtilen pozisyondaki öğeyi verir.#1 ilk öğedir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Listedeki son öğeyi verir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Listeden rastgele bir öğe verir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Kaldırır ve ilk öğeyi listeye dönüştürür.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_END = "Belirtilen konumdaki öğeyi kaldırır ve listeye dönüştürür #1 son öğedir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_START = "Belirtilen konumdaki öğeyi kaldırır ve listeye dönüştürür. #1 ilk ögedir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Son öğeyi kaldırır ve listeye dönüştürür.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Listedeki rastgele bir öğeyi kaldırır ve geri getirir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Listedeki ilk nesneyi kaldırır.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_END = "Belirtilen sıradaki öğeyi listeden kaldırır. #1 son öğedir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_START = "Bir liste içerisinde tanımlanan pozisyondaki ögeyi kaldırır. #1 ilk ögedir.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Listedeki son nesneyi kaldırır.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Listedeki rastgele bir nesneyi kaldırır.";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "Sondan #'a kadar";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "#'a";
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "Sona kadar";
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#Getting_a_sublist";
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "ilk öğeden alt liste al";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "sondan # kadar bir parça için alt liste al";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "# dan alt liste al";
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = "";
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Listenin belirli bir kısmının kopyasını oluşturur.";
Blockly.Msg.LISTS_INDEX_OF_FIRST = "öğenin ilk varolduğu yeri bul";
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#Getting_Items_from_a_List";
Blockly.Msg.LISTS_INDEX_OF_LAST = "Öğenin son bulunduğu yeri bul";
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Öğenin listede ilk/son görüldüğü konumu döndürür. Öğe bulunamazsa 0 döndürür.";
Blockly.Msg.LISTS_INLIST = "için";
Blockly.Msg.LISTS_IS_EMPTY_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#is_empty Boş Listeler";
Blockly.Msg.LISTS_IS_EMPTY_TITLE = "%1 boş";
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#length_of Uzunluk Listeleri";
Blockly.Msg.LISTS_LENGTH_INPUT_LENGTH = "uzunluğu";
Blockly.Msg.LISTS_LENGTH_TITLE = "%1'in uzunluğu";
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Listenin uzunluğunu döndürür.";
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#create_list_with";
Blockly.Msg.LISTS_REPEAT_TITLE = "%1 nesnenin %2 kez tekrarlandığı bir liste yarat";
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Verilen bir değerin belirli bir sayıda tekrarlanmasından oluşan bir liste yaratır.";
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#in_list_..._set";
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "olarak";
Blockly.Msg.LISTS_SET_INDEX_INSERT = "e yerleştir";
Blockly.Msg.LISTS_SET_INDEX_SET = "atamak";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Nesneyi listenin başlangıcına ekler.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_END = "Nesneyi belirtilen pozisyona göre listeye yerleştirir. #1 son nesnedir.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_START = "Nesneyi belirtilen pozisyona göre listeye yerleştirir. #1 ilk nesnedir.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Ögeyi listenin sonuna ekle .";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Nesneyi bir listeye rastgele yerleştirir.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Bir listedeki ilk nesneyi belirler.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Bir ögeyi belirtilen yere göre listeden seçer. #1 son ögedir.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Bir ögeyi belirtilen yere göre listeden seçer. #1 ilk ögedir.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Bir listedeki son ögeyi seçer.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Listeye rastgele bir öge yerleştirir.";
Blockly.Msg.LISTS_TOOLTIP = "Eğer liste boş ise true değeri geri döner.";
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "false";
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "http://code.google.com/p/blockly/wiki/True_False";
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Doğru yada yanlış değerini verir.";
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "doğru";
Blockly.Msg.LOGIC_COMPARE_HELPURL = "http://en.wikipedia.org/wiki/Inequality_(mathematics)";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Girilen iki değer birbirine eşitse doğru değeri verir.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Girilen ilk değer ikinci değerden daha büyükse doğru değeri verir.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Girilen ilk değer ikinci değerden büyük veya eşitse doğru değeri verir.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Girilen ilk değer ikinci değerden küçükse doğru değeri verir.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Girilen ilk değer ikinci değerden küçük veya eşitse doğru değeri verir.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Girilen iki değerde birbirine eşit değilse doğru değeri verir.";
Blockly.Msg.LOGIC_NEGATE_HELPURL = "http://code.google.com/p/blockly/wiki/Not";
Blockly.Msg.LOGIC_NEGATE_TITLE = "%1 değil";
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Girilen değer yanlışsa doğru değerini verir. Girilen değer doğruysa yanlış değerini verir.";
Blockly.Msg.LOGIC_NULL = "boş";
Blockly.Msg.LOGIC_NULL_HELPURL = "http://en.wikipedia.org/wiki/Nullable_type";
Blockly.Msg.LOGIC_NULL_TOOLTIP = "boş değer verir.";
Blockly.Msg.LOGIC_OPERATION_AND = "ve";
Blockly.Msg.LOGIC_OPERATION_HELPURL = "http://code.google.com/p/blockly/wiki/And_Or";
Blockly.Msg.LOGIC_OPERATION_OR = "veya";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Girilen iki değerde doğruysa doğru değeri verir.";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Girilen iki değerden en az biri doğruysa doğru değeri verir.";
Blockly.Msg.LOGIC_TERNARY_CONDITION = "dene";
Blockly.Msg.LOGIC_TERNARY_HELPURL = "http://en.wikipedia.org/wiki/%3F:";
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "yanlış ise";
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "doğru ise";
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = " 'dene'deki şartı dener. Eğer şart doğru ise 'doğru ise'deki değeri verir, aksi halde 'yanlış ise'deki değeri verir.";
Blockly.Msg.MATH_ADDITION_SYMBOL = "+";
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "http://tr.wikipedia.org/wiki/Arithmetic";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "İki rakamın toplamını verir.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "İki sayının bölümünü verir.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "İki sayını farkını verir.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "İki sayının çarpımını verir.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "İlk sayının ikincinin kuvvetine yükseltilmişini verir.";
Blockly.Msg.MATH_CHANGE_HELPURL = "";
Blockly.Msg.MATH_CHANGE_INPUT_BY = "'in değerini şu kadar:";
Blockly.Msg.MATH_CHANGE_TITLE_CHANGE = "değiştirin";
Blockly.Msg.MATH_CHANGE_TOOLTIP = "'%1' değişkenine bir sayı ekle.";
Blockly.Msg.MATH_CONSTANT_HELPURL = "";
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Yaygın sabitlerden birini verir: π (3.141…), e (2.718…), φ (1.618…), karekök(2) (1.414…), karekök(½) (0.707…), veya ∞ (sonsuz).";
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "";
Blockly.Msg.MATH_CONSTRAIN_TITLE = "%1'i en düşük %2 en yüksek %3 ile sınırla";
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Bir sayıyı belirli iki sayı arasında sınırlandır.(sınır noktalar dahil).";
Blockly.Msg.MATH_DIVISION_SYMBOL = "÷";
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "bölünebilir mi";
Blockly.Msg.MATH_IS_EVEN = "çift mi";
Blockly.Msg.MATH_IS_NEGATIVE = "negatif mi";
Blockly.Msg.MATH_IS_ODD = "tek mi";
Blockly.Msg.MATH_IS_POSITIVE = "pozitif mi";
Blockly.Msg.MATH_IS_PRIME = "asal mı";
Blockly.Msg.MATH_IS_TOOLTIP = "Bir sayının çift mi, tek mi , tam mı, asal mı, pozitif mi, negatif mi, veya tam bir sayıyla bölünebilirliğini kontrol eder. Doğru veya yanlış değeri verir.";
Blockly.Msg.MATH_IS_WHOLE = "Bütün mü";
Blockly.Msg.MATH_MODULO_HELPURL = "";
Blockly.Msg.MATH_MODULO_TITLE = "%1 ÷ %2 nin kalanı";
Blockly.Msg.MATH_MODULO_TOOLTIP = "İki sayının bölümünden kalanı döndür.";
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "x";
Blockly.Msg.MATH_NUMBER_HELPURL = "";
Blockly.Msg.MATH_NUMBER_TOOLTIP = "Bir sayı.";
Blockly.Msg.MATH_ONLIST_HELPURL = "";
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "listenin ortalaması";
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "listenin en büyüğü";
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "listenin medyanı";
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "listenin en küçüğü";
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "listenin modları";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "listenin rastgele öğesi";
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "listenin standart sapması";
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "listenin toplamı";
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Listedeki sayısal değerlerin ortalamasını (aritmetik ortalama) döndür.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Listenin en büyük sayısını döndür.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Listenin medyan sayısını döndür.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Listenin en küçük sayısını döndür.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Listedeki en sık tekrarlanan öge veya ögelerin listesini döndür.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Listeden rastgele bir eleman döndür.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Listenin standart sapmasını döndür.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Listedeki tüm sayıların toplamını döndür.";
Blockly.Msg.MATH_POWER_SYMBOL = "üs alma";
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "http://en.wikipedia.org/wiki/Random_number_generation Rast gele sayı üretme";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "rastgele kesir";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "0.0 (dahil) ve 1.0 (hariç) sayıları arasından rastgele bir kesir döndür.";
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "http://en.wikipedia.org/wiki/Random_number_generation Rast gele sayı üretme";
Blockly.Msg.MATH_RANDOM_INT_TITLE = "%1 ile %2 arasında rastgele tam sayı";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Belirlenen iki sayı arasında, bu sayılar da dahil olmak üzere, rastgele bir tam sayı döndür.";
Blockly.Msg.MATH_ROUND_HELPURL = "http://en.wikipedia.org/wiki/Rounding Yuvarlama";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "yuvarla";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "aşağı yuvarla";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "yukarı yuvarla";
Blockly.Msg.MATH_ROUND_TOOLTIP = "Bir sayıyı yukarı ya da aşağı yuvarla .";
Blockly.Msg.MATH_SINGLE_HELPURL = "http://en.wikipedia.org/wiki/Square_root Kare kök";
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "mutlak";
Blockly.Msg.MATH_SINGLE_OP_ROOT = "Kare kök";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Bir sayının mutlak değerini döndür.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Bir sayının e ' inci kuvvetini döndür .";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Bir sayının doğal logaritmasını döndür .";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Bir sayının 10 tabanındaki logaritmasına döndür.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Sayıyı negatif haline döndür.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Bir sayının 10. kuvvetini döndür .";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Bir sayının karekökünü döndür .";
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-";
Blockly.Msg.MATH_TRIG_ACOS = "acos";
Blockly.Msg.MATH_TRIG_ASIN = "asin";
Blockly.Msg.MATH_TRIG_ATAN = "atan";
Blockly.Msg.MATH_TRIG_COS = "cos";
Blockly.Msg.MATH_TRIG_HELPURL = "http://en.wikipedia.org/wiki/Trigonometric_functions Trigonometrik fonksiyonlar ";
Blockly.Msg.MATH_TRIG_SIN = "Sin";
Blockly.Msg.MATH_TRIG_TAN = "tan";
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Bir sayının ters kosinüsünü verir.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Bir sayının ters sinüsünü verir.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Bir sayının ters tanjantını verir.";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Bir açının kosinüsünü verir(radyan olarak değil).";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Bir açının sinüsünü verir(radyan olarak değil).";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Bir açının tanjantını verir(radyan olarak değil).";
Blockly.Msg.NEW_VARIABLE = "Yeni değişken...";
Blockly.Msg.NEW_VARIABLE_TITLE = "Yeni değişken ismi:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = "";
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "ile:";
Blockly.Msg.PROCEDURES_CALLNORETURN_CALL = "";
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Kullanıcı tanımlı '%1' fonksiyonunu çalıştır.";
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Kullanıcı tanımlı '%1' fonksiyonunu çalıştır ve sonucunu kullan.";
Blockly.Msg.PROCEDURES_CREATE_DO = "'%1' oluştur.";
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = "";
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "bir şeyler yap";
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "Şunu yapmak için:";
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Sonuç vermeyen bir fonksiyon oluşturur.";
Blockly.Msg.PROCEDURES_DEFRETURN_DO = "";
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = "bir şeyler yap";
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = "Şunu yapmak için:";
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "geri dönme";
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Sonuç veren bir fonksiyon oluşturur.";
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Uyarı: Bu fonksiyonda yinelenen parametreler var.";
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Fonksiyon tanımını vurgula";
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Bir değer doğruysa, ikinci bir değer verir.";
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Uyarı: Bu blok yalnızca bir fonksiyon içinde kullanılır.";
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "girdi adı:";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "girdiler";
Blockly.Msg.REMOVE_COMMENT = "Yorumu sil";
Blockly.Msg.RENAME_ALL = "Rename all %1";
Blockly.Msg.RENAME_PARAMETER = "Parametreyi yeniden adlandır...";
Blockly.Msg.RENAME_PARAMETER_TITLE = "Tüm '%1' parametrelerini şu şekilde adlandır:";
Blockly.Msg.RENAME_THIS = "Rename this %1";
Blockly.Msg.RENAME_VARIABLE = "Değişkeni yeniden adlandır...";
Blockly.Msg.RENAME_VARIABLE_TITLE = "Tüm '%1' değişkenlerini şu şekilde adlandır:";
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "metin ekle";
Blockly.Msg.TEXT_APPEND_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_modification Yazı değişimi";
Blockly.Msg.TEXT_APPEND_TO = "e";
Blockly.Msg.TEXT_APPEND_TOOLTIP = "Değişken '%1' e bazı metinler ekleyin.";
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Adjusting_text_case";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "küçük harfe";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "Baş Harfler Büyük";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "BÜYÜK HARFE";
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Metnin bir kopyasını farklı bir harf durumunda (HEPSİ BÜYÜK - hepsi küçük) getirir.";
Blockly.Msg.TEXT_CHARAT_FIRST = "İlk harfini al";
Blockly.Msg.TEXT_CHARAT_FROM_END = "sondan # harfini al";
Blockly.Msg.TEXT_CHARAT_FROM_START = "# harfini al";
Blockly.Msg.TEXT_CHARAT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Extracting_text";
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "metinde";
Blockly.Msg.TEXT_CHARAT_LAST = "son harfi al";
Blockly.Msg.TEXT_CHARAT_RANDOM = "rastgele harf al";
Blockly.Msg.TEXT_CHARAT_TAIL = "";
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Belirli pozisyonda harfi döndürür.";
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Metne bir öğe ekle.";
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "katılın";
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Bu metin bloğunu düzenlemek için bölüm ekle, sil veya yeniden görevlendir.";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "Sondan # harfe";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "# harfine";
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "son harfe";
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "";
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "metinde";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "ilk harften başlayarak metnin alt dizesini al";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "# inci harften sona kadar metnin parçasını al";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "#. harften başlayarak metnin alt dizesini al";
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = "";
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Metinin belirli bir kısmını döndürür.";
Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Finding_text";
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "metinde";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "metnin ilk geçtiği yeri bul";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "metnin son bulunduğu yeri bul";
Blockly.Msg.TEXT_INDEXOF_TAIL = "";
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "İlk metnin, ikinci metnin içindeki ilk/son görülüşlerinin indeksini verir. Metin bulunamadıysa 0 verir.";
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Checking_for_empty_text";
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 boş";
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Verilen metin boşsa true(doğru) değerini verir.";
Blockly.Msg.TEXT_JOIN_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_creation";
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "ile metin oluştur";
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Herhangi bir sayıda ki öğeleri bir araya getirerek metnin bir parçasını oluştur.";
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_modification Yazı değişimi";
Blockly.Msg.TEXT_LENGTH_TITLE = "%1'in uzunluğu";
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Yazı içerisinde verilen harflerin ( harf arasındaki boşluklar dahil) sayısını verir .";
Blockly.Msg.TEXT_PRINT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Printing_text Yazıyı yazdırmak ";
Blockly.Msg.TEXT_PRINT_TITLE = "%1 ' i Yaz";
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Belirli bir metni,sayıyı veya başka bir değeri yaz.";
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Getting_input_from_the_user Kullanıcıdan veri almak ";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Kullanıcıdan sayı al.";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Kullanıcı için metin isteği.";
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "İstek mesajı göstererek kullanıcıdan sayı al.";
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "İstek mesajıyla kullanıcıdan metin al.";
Blockly.Msg.TEXT_TEXT_HELPURL = "http://en.wikipedia.org/wiki/String_(computer_science)";
Blockly.Msg.TEXT_TEXT_TOOLTIP = "Metnin bir harfi, kelimesi veya satırı.";
Blockly.Msg.TEXT_TRIM_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Trimming_%28removing%29_spaces";
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "Her iki taraftaki boşlukları kırp";
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "Soldaki boşlukları kırp";
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "Sağdaki boşlukları kırp";
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Metnin bir veya her iki ucundan da boşlukları silinmiş şekilde kopyasını verir.";
Blockly.Msg.UNUSED_CODE = "Kullanılmayan kod";
Blockly.Msg.VARIABLE = "variable";
Blockly.Msg.VARIABLES_DEFAULT_NAME = "öge";
Blockly.Msg.VARIABLES_GET_CREATE_SET = "'%1'e ayarla' oluştur";
Blockly.Msg.VARIABLES_GET_HELPURL = "http://code.google.com/p/blockly/wiki/Variables#Get";
Blockly.Msg.VARIABLES_GET_TAIL = "";
Blockly.Msg.VARIABLES_GET_TITLE = "";
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Bu değişkenin değerini verir.";
Blockly.Msg.VARIABLES_SET_CREATE_GET = "' %1 al' oluştur";
Blockly.Msg.VARIABLES_SET_HELPURL = "http://code.google.com/p/blockly/wiki/Variables#Set";
Blockly.Msg.VARIABLES_SET_TAIL = "Şunu yapmak için";
Blockly.Msg.VARIABLES_SET_TITLE = "atamak";
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Bu değişkeni girdiye eşitler.";
|
import { LightningElement, api, track, wire } from 'lwc';
import getRelatedSpaces from '@salesforce/apex/marketServices.getRelatedSpaces';
import { NavigationMixin } from 'lightning/navigation';
export default class RelatedSpaces extends NavigationMixin(LightningElement) {
@api recordId;
@track records;
_records = [];
@track errorMsg;
@track msgForUser;
@track noRecords = false;
@wire(getRelatedSpaces, { recordId: '$recordId' })
wiredSpaces({ error, data }) {
if (error) {
this.errorMsg = error;
this.msgForUser = 'There was an issue loading related market data.';
} else if (data) {
if (data.length) {
this.records = data.map(record => {
return { record, muted: false };
});
this.noRecords = false;
} else {
this.noRecords = true;
}
}
}
handleItemSelect(event) {
event.stopPropagation();
if (event.detail.recordId) {
this[NavigationMixin.Navigate]({
type: 'standard__recordPage',
attributes: {
recordId: event.detail.recordId,
objectApiName: 'Space__c',
actionName: 'view'
}
});
}
}
}
|
/**
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* Code generated by @carbon/icon-build-helpers. DO NOT EDIT.
*/
'use strict';
var Icon = require('../Icon-1083255b.js');
var React = require('react');
require('@carbon/icon-helpers');
require('prop-types');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var _path, _path2;
var CheckmarkOutlineWarning16 = /*#__PURE__*/React__default['default'].forwardRef(function CheckmarkOutlineWarning16(_ref, ref) {
var children = _ref.children,
rest = Icon._objectWithoutProperties(_ref, ["children"]);
return /*#__PURE__*/React__default['default'].createElement(Icon.Icon, Icon._extends({
width: 16,
height: 16,
viewBox: "0 0 32 32",
xmlns: "http://www.w3.org/2000/svg",
fill: "currentColor",
ref: ref
}, rest), _path || (_path = /*#__PURE__*/React__default['default'].createElement("path", {
d: "M14,24A10,10,0,1,1,24,14h2A12,12,0,1,0,14,26Z"
})), _path2 || (_path2 = /*#__PURE__*/React__default['default'].createElement("path", {
d: "M12 15.59L9.41 13 8 14.41 12 18.41 19 11.41 17.59 10 12 15.59zM27.38 28H20.6178L24 21.2358zM24 18a1 1 0 00-.8947.5527l-5 10A1.0005 1.0005 0 0019 30H29a1 1 0 00.9214-1.3892L24.8946 18.5527A1 1 0 0024 18z"
})), children);
});
module.exports = CheckmarkOutlineWarning16;
|
const log = console.log;
const chalk = require('chalk');
const questions = require('./questions.js');
/*****************************************
* cli
*
* This function is the driver for all
* CLI related stuff.
****************************************/
async function cli() {
let flag = false;
let firstFlag = false;
let userObj;
while (!flag) {
userObj = await prompt(firstFlag);
displayObj(userObj);
let results = await questions.promptRedo();
if (results.redo) flag = true;
firstFlag = true;
}
return userObj;
}
/*****************************************
* prompt
* @param {Boolean} val
* @return {Object} both source and dest
*
* This function prompts for both source
* and destination.
****************************************/
async function prompt(val) {
log(chalk.yellow(`${val ? '\n' : ''}Enter ${chalk.bold('source course OU')} to cross list from (Enter 0 to finish):`));
let sourceOUs = await getSource();
log(chalk.yellow(`\nEnter ${chalk.bold('destination course OU')} to cross list source OUs to:`));
let destinationOU = await getDestination();
return {
sourceOUs,
destinationOU
};
}
/*****************************************
* displayObj
* @param {Object} obj
*
* This displays the object in a pretty
* way.
****************************************/
function displayObj(obj) {
log(chalk.bold('Source OU(s):'), chalk.bold(displayArray(obj.sourceOUs)));
log(chalk.bold(`Destination OU: ${obj.destinationOU}`));
}
/*****************************************
* displayArray
* @param {Array} arr
* @returns {String} final string to
* print out
*
* This displays the Array with commas
* and the word and between second to last
* and the last word.
****************************************/
function displayArray(arr) {
return [arr.slice(0, -1).join(', '), arr.slice(-1)[0]].join(arr.length < 2 ? '' : ' and ');
}
/*****************************************
* getSource
*
* This gets all of the source OUs. There
* can be one or more source OU.
****************************************/
async function getSource() {
let sourceOUs = [];
flag = false;
while (!flag) {
let answer = await questions.promptSource();
answer = parseInt(answer.sourceOU, 10);
if (answer !== 0) sourceOUs.push(answer);
if (answer === 0) flag = true;
}
return sourceOUs;
}
/*****************************************
* getDestination
*
* This gets the destination OU. There is
* only one destination OU.
****************************************/
async function getDestination() {
let answer = await questions.promptDestination();
return answer.destinationOU;
}
module.exports = {
cli
}
|
import React from 'react'
import { Table, Button } from 'antd'
import { Link } from 'react-router-dom'
import styles from './List.less'
const List = ({ ...tableProps },key) => {
const columns = [
{
title: 'Image',
dataIndex: 'image',
className: styles.image,
width: 64,
render: text => <img alt="Feture" width={26} src={text} />,
}, {
title: 'Model Name',
dataIndex: 'title',
render: (text, record) => <Link to={`post/${record.id}`}>{text}</Link>,
}, {
title: 'Author',
dataIndex: 'author',
}, {
title: 'Categories',
dataIndex: 'categories',
}, {
title: 'Tags',
dataIndex: 'tags',
}, {
title: 'Visibility',
dataIndex: 'visibility',
}, {
title: 'Environment',
dataIndex: 'environment',
render: (text, record) => <Link to={`post/${record.id}`}>{text}</Link>,
}, {
title: 'Date',
dataIndex: 'date',
}, {
title: 'Operation',
key: 'operation',
width: 100,
render: (text, record) => {
if (tableProps.publish === true) {
return <Button type="primary" size="small" ghost>Match</Button>
} else {
return <Button type="primary" size="small" ghost>Encapsulation</Button>
}
},
},
]
return (
<div>
<Table
{...tableProps}
bordered
scroll={{ x: 1200 }}
columns={columns}
simple
className={styles.table}
rowKey={record => record.id}
/>
</div>
)
}
export default List
|
/*
Edtended handling of date, time and datetime-local type fields.
Works with both string and integer data types. (default only support string type)
Has optional support for using flatpickr datepicker.
All flatpickr options is supported with a few minor differences.
- "enableTime" and "noCalendar" are set automatically, based on the data type.
- Extra config option "errorDateFormat". If this is set, it will replace the format displayed in error messages.
- It is not possible to use "inline" and "wrap" options together.
- When using the "wrap" option, "toggle" and "clear" buttons are automatically added to markup. 2 extra boolean options ("showToggleButton" and "showClearButton") are available to control which buttons to display. Note: not all frameworks supports this. (Works in: Bootstrap and Foundation)
- When using the "inline" option, an extra boolean option ("inlineHideInput") is available to hide the original input field.
- If "mode" is set to either "multiple" or "range", only string data type is supported. Also the result from these is returned as a string not an array.
ToDo:
- Improve Handling of flatpicker "multiple" and "range" modes. (Currently the values are just added as string values, but the optimal scenario would be to save those as array if possible)
*/
JSONEditor.defaults.editors.datetime = JSONEditor.defaults.editors.string.extend({
build: function () {
this._super();
if(!this.input) return;
if(window.flatpickr && typeof this.options.flatpickr == 'object') {
// Make sure that flatpickr settings matches the input type
this.options.flatpickr.enableTime = this.schema.format == 'date' ? false : true;
this.options.flatpickr.noCalendar = this.schema.format == 'time' ? true : false;
// Curently only string can contain range or multiple values
if (this.schema.type == 'integer') this.options.flatpickr.mode = 'single';
// Attribute for flatpicker
this.input.setAttribute('data-input','');
var input = this.input;
if (this.options.flatpickr.wrap === true) {
// Create buttons for input group
var buttons = [];
if (this.options.flatpickr.showToggleButton !== false) {
var toggleButton = this.getButton('',this.schema.format == 'time' ? 'time' :'calendar', this.translate('flatpickr_toggle_button'));
// Attribute for flatpicker
toggleButton.setAttribute('data-toggle','');
buttons.push(toggleButton);
}
if (this.options.flatpickr.showClearButton !== false) {
var clearButton = this.getButton('','clear', this.translate('flatpickr_clear_button'));
// Attribute for flatpicker
clearButton.setAttribute('data-clear','');
buttons.push(clearButton);
}
// Save position of input field
var parentNode = this.input.parentNode, nextSibling = this.input.nextSibling;
var buttonContainer = this.theme.getInputGroup(this.input, buttons);
if (buttonContainer !== undefined) {
// Make sure "inline" option is turned off
this.options.flatpickr.inline = false;
// Insert container at same position as input field
parentNode.insertBefore(buttonContainer, nextSibling);
input = buttonContainer;
}
else {
this.options.flatpickr.wrap = false;
}
}
this.flatpickr = window.flatpickr(input, this.options.flatpickr);
if (this.options.flatpickr.inline === true && this.options.flatpickr.inlineHideInput === true) {
this.input.setAttribute('type','hidden');
}
}
},
getValue: function() {
if (!this.dependenciesFulfilled) {
return undefined;
}
if (this.schema.type == 'string') {
return this.value;
}
if (this.value === '' || this.value === undefined) {
return undefined;
}
var value = this.schema.format == 'time' ? '1970-01-01 ' + this.value : this.value;
return parseInt(new Date(value).getTime() / 1000);
},
setValue: function(value, initial, from_template) {
if (this.schema.type == 'string') {
this._super(value, initial, from_template);
}
else if (value > 0) {
var dateValue, dateObj = new Date(value * 1000),
year = dateObj.getFullYear(),
month = this.zeroPad(dateObj.getMonth() + 1),
day = this.zeroPad(dateObj.getDate()),
hour = this.zeroPad(dateObj.getHours()),
min = this.zeroPad(dateObj.getMinutes()),
sec = this.zeroPad(dateObj.getSeconds()),
date = [year, month, day].join('-'),
time = [hour, min, sec].join(':');
if (this.schema.format == 'date') dateValue = date;
else if (this.schema.format == 'time') dateValue = time;
else dateValue = date + ' ' + time;
this.input.value = dateValue;
}
},
destroy: function() {
if (this.flatpickr) this.flatpickr.destroy();
this.flatpickr = null;
this._super();
},
// helper function
zeroPad: function(value) {
return ('0' + value).slice(-2);
}
});
|
import { createUtil } from "../util";
const underline = createUtil({ textDecoration: "underline" });
const lineThrough = createUtil({ textDecoration: "line-through" });
const noUnderline = createUtil({ textDecoration: "none" });
export { underline, lineThrough, noUnderline };
//# sourceMappingURL=text-decoration.js.map
|
# AUTOGENERATED! DO NOT EDIT! File to edit: 04_event.ipynb (unless otherwise specified).
__all__ = ['GhEvent', 'load_sample_events', 'save_sample_events', 'full_type', 'evt_emojis', 'description', 'emoji',
'text', 'described_evts']
# Cell
from fastcore.utils import *
from fastcore.foundation import *
from fastcore.meta import *
from .core import *
from .page import *
from .actions import *
import time,json,gzip
from itertools import islice
# Cell
def _list_events(g, username=None, org=None, owner=None, repo=None):
if (username or org or owner) and \
not (bool(username) ^ bool(org) ^ bool(owner)): raise Exception('Can not pass more than one of username, org, and owner')
if (owner and not repo): owner,repo = repo.split('/')
if owner: return g.list_public_events_for_repo_network,{'owner':owner,'repo':repo}
if org: return g.list_public_org_events,{'org':org}
if username: return g.list_public_events_for_user,{'username':username}
return g.list_public_events,{}
# Cell
def _id2int(x):
x.id = int(x.id)
return x
# Cell
@patch
@delegates(_list_events)
def list_events(self:GhApi, per_page=30, page=1, **kwargs):
"Fetch public events for repo network, org, user, or all"
oper,kw = _list_events(self.activity, **kwargs)
return oper(per_page=per_page, page=page, **kw).map(_id2int)
# Cell
@patch
@delegates(_list_events)
def list_events_parallel(self:GhApi, per_page=30, n_pages=8, **kwargs):
"Fetch as many events from `list_events` in parallel as available"
oper,kw = _list_events(self.activity, **kwargs)
return pages(oper, n_pages, per_page=per_page, **kw).concat().map(_id2int)
# Cell
_bot_re = re.compile('b[o0]t')
def _want_evt(o, types, incl_bot):
if not incl_bot and _bot_re.search(nested_attr(o, 'actor.login') or ''): return False
if types and o.type not in types: return False
return True
# Cell
class GhEvent(AttrDict):
"Class for events returned from `fetch_events"
pass
for o in Event: exec(f'class {snake2camel(o)}Event(GhEvent):pass')
# Cell
_all_ = [
'PageBuildEvent', 'ContentReferenceEvent', 'RepositoryImportEvent', 'CreateEvent', 'WorkflowRunEvent', 'DeleteEvent', 'OrganizationEvent',
'SponsorshipEvent', 'ProjectColumnEvent', 'PushEvent', 'ContextEvent', 'MilestoneEvent', 'ProjectCardEvent', 'ProjectEvent', 'PackageEvent',
'PullRequestEvent', 'RepositoryDispatchEvent', 'TeamAddEvent', 'WorkflowDispatchEvent', 'MemberEvent', 'MetaEvent', 'CodeScanningAlertEvent',
'PublicEvent', 'NeedsEvent', 'CheckRunEvent', 'SecurityAdvisoryEvent', 'PullRequestReviewCommentEvent', 'OrgBlockEvent',
'CommitCommentEvent', 'WatchEvent', 'MarketplacePurchaseEvent', 'StarEvent', 'InstallationRepositoriesEvent', 'CheckSuiteEvent',
'GithubAppAuthorizationEvent', 'TeamEvent', 'StatusEvent', 'RepositoryVulnerabilityAlertEvent', 'PullRequestReviewEvent', 'LabelEvent',
'InstallationEvent', 'ReleaseEvent', 'IssuesEvent', 'RepositoryEvent', 'GollumEvent', 'MembershipEvent', 'DeploymentEvent', 'DeployKeyEvent',
'IssueCommentEvent', 'PingEvent', 'DeploymentStatusEvent', 'ForkEvent', 'ScheduleEvent']
# Cell
def _cast_evt(o): return globals()[o.type](o)
# Cell
@patch
@delegates(_list_events)
def fetch_events(self:GhApi, n_pages=3, pause=0.4, per_page=30, types=None, incl_bot=False, **kwargs):
"Generate an infinite stream of events, optionally filtered to `types, with `pause` seconds between requests"
seen = set()
if types: types=setify(types or None)
g = globals()
while True:
evts = self.list_events_parallel(n_pages=n_pages, per_page=per_page, **kwargs)
new_evts = L(_cast_evt(o) for o in evts if o.id not in seen and _want_evt(o, types, incl_bot))
seen.update(new_evts.attrgot('id'))
yield from new_evts
if pause: time.sleep(pause)
# Cell
def load_sample_events():
"Load sample events, downloading if needed"
name = 'sample_evts.json.gz'
url = f'https://raw.githubusercontent.com/fastai/ghapi/master/examples/{name}'
try: path = Path(__file__).parent
except NameError: path = Path()/'examples'
path = path/name
if not path.exists():path.write_bytes(urlread(url, decode=False))
return dict2obj(json.load(open_file(path))).map(_cast_evt)
# Cell
def save_sample_events(n=5000):
"Save the most recent `n` events as compressed JSON"
evts = list(islice(api.fetch_events(incl_bot=True), n))
with gzip.open('sample_evts.json.gz', 'wt') as f: json.dump(obj2dict(evts), f)
# Cell
#hide
@patch(as_prop=True)
def full_type(self:GhEvent):
"Concatenation of `type` and `payload.action` (if available)"
act = getattr(self.payload, 'action', '')
return f'{self.type}_{act}' if act else self.type
# Cell
_all_ = [
'PageBuildEvent', 'ContentReferenceEvent', 'RepositoryImportEvent', 'CreateEvent', 'WorkflowRunEvent', 'DeleteEvent', 'OrganizationEvent',
'SponsorshipEvent', 'ProjectColumnEvent', 'PushEvent', 'ContextEvent', 'MilestoneEvent', 'ProjectCardEvent', 'ProjectEvent', 'PackageEvent',
'PullRequestEvent', 'RepositoryDispatchEvent', 'TeamAddEvent', 'WorkflowDispatchEvent', 'MemberEvent', 'MetaEvent', 'CodeScanningAlertEvent',
'PublicEvent', 'NeedsEvent', 'CheckRunEvent', 'SecurityAdvisoryEvent', 'PullRequestReviewCommentEvent', 'OrgBlockEvent',
'CommitCommentEvent', 'WatchEvent', 'MarketplacePurchaseEvent', 'StarEvent', 'InstallationRepositoriesEvent', 'CheckSuiteEvent',
'GithubAppAuthorizationEvent', 'TeamEvent', 'StatusEvent', 'RepositoryVulnerabilityAlertEvent', 'PullRequestReviewEvent', 'LabelEvent',
'InstallationEvent', 'ReleaseEvent', 'IssuesEvent', 'RepositoryEvent', 'GollumEvent', 'MembershipEvent', 'DeploymentEvent', 'DeployKeyEvent',
'IssueCommentEvent', 'PingEvent', 'DeploymentStatusEvent', 'ForkEvent', 'ScheduleEvent']
# Cell
evt_emojis = dict(
PushEvent= '⭐',
CreateEvent= '🏭',
IssueCommentEvent_created= '💬',
WatchEvent_started= '👀',
PullRequestEvent_closed= '📪',
PullRequestReviewEvent_created= '💌',
PullRequestEvent_opened= '📬',
PullRequestReviewCommentEvent_created= '🗨',
DeleteEvent= '✂',
ForkEvent= '🍽',
IssuesEvent_opened= '🐛',
IssuesEvent_closed= '🎁',
ReleaseEvent_published= '🚀',
MemberEvent_added= '💃',
CommitCommentEvent= '🎉',
GollumEvent= '📚',
PublicEvent= '♥',
IssuesEvent_reopened= '🔁',
PullRequestEvent_reopened= '🔁'
)
# Cell
def _ref(pay, pre=''): return f'{pre} "{pay.ref.split("/")[-1]}"' if pay.ref else ''
def _ref_detl(pay): return pay.ref_type + _ref(pay)
def _action(self):
pay = self.payload
det = (f'issue #{pay.issue.number} on' if isinstance(self,IssuesEvent) else
f'PR #{pay.number} on' if isinstance(self,PullRequestEvent) else
f'member {pay.member.login} in' if isinstance(self,MemberEvent) else
f'review comment on PR #{pay.pull_request.number} in' if isinstance(self,PullRequestReviewCommentEvent) else
f'comment on issue #{pay.issue.number} in' if isinstance(self,IssueCommentEvent) else
f'release {pay.release.tag_name} in' if isinstance(self,ReleaseEvent) else
'PR review in' if isinstance(self,PullRequestReviewEvent) else
'watching' if isinstance(self,WatchEvent) else '')
if det: return f'{pay.action} {det}'
# Cell
#hide
@patch(as_prop=True)
def description(self:GhEvent):
"Description of event"
act,pay,cls,repo = self.actor,self.payload,type(self),self.repo
res = _action(self)
return res if res else (
f'deleted {_ref_detl(pay)} in' if isinstance(self,DeleteEvent) else
f'created {_ref_detl(pay)} in' if isinstance(self,CreateEvent) else
f'pushed {len(pay.commits)} commits{_ref(pay," to")} in' if isinstance(self,PushEvent) else
f'created commint comment in' if isinstance(self,CommitCommentEvent) else
f'{pay.pages[0].action} wiki page in' if isinstance(self,GollumEvent) else
f'forked' if isinstance(self,ForkEvent) else
f'made public repo ' if isinstance(self,PublicEvent) else
remove_suffix(self.type, "Event")
)
#export
@patch(as_prop=True)
def emoji(self:GhEvent):
"Emoji for event from `evt_emojis`"
return evt_emojis.get(self.full_type, '❌')
# Cell
#hide
described_evts = (PushEvent,DeleteEvent,CreateEvent,PullRequestEvent,MemberEvent,PublicEvent,PullRequestReviewCommentEvent,ForkEvent,
CommitCommentEvent,WatchEvent,PullRequestReviewEvent,ReleaseEvent,IssuesEvent,GollumEvent,IssueCommentEvent)
_text_keys = dict(
CreateEvent = "description",
PullRequestEvent = "pull_request.title",
PullRequestReviewCommentEvent = "comment.body",
ForkEvent = "forkee.description",
CommitCommentEvent = "comment.body",
PullRequestReviewEvent = "review.body",
ReleaseEvent = "release.body",
IssuesEvent = "issue.title",
IssueCommentEvent = "comment.body"
)
@patch(as_prop=True)
def text(self:GhEvent):
"Text (e.g. body or title) of event, if exists"
return nested_idx(self.payload, *_text_keys.get(self.type, '').split('.')) or ''
|
Prism.languages.insertBefore("objectivec", "string", {
// Add types with a framework prefix.
builtin: /\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\w+/
});
// Add `_Nonnull`, `_Nullable`, `_Null_unspecified`.
Prism.languages.objectivec.keyword = /\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector|_Nonnull|_Nullable|_Null_unspecified)\b/;
|
import React from 'react'; // eslint-disable-line no-unused-vars
import { observer } from 'mobx-react';
import uuid from 'uuid/v4';
import modelStore from '../../stores/modelStore';
class CompareTechAdd extends React.Component {
constructor(props) {
super(props);
this.state = {
value: '',
};
this.valueChanged = this.valueChanged.bind(this);
this.addTechnology = this.addTechnology.bind(this);
}
componentDidMount() {
modelStore.loadTechnologies();
}
valueChanged(event) {
// eslint-disable-next-line prefer-destructuring
const value = event.target.value;
const technology = modelStore.technologies
.find(t => t.name === value);
const id = technology && technology.technologyId;
this.setState({
value,
id,
});
}
addTechnology() {
if (this.state.id) {
this.props.compareTechnologiesStore.addTechnology(this.state.id);
this.setState({
value: '',
id: null,
});
}
}
render() {
const listId = uuid();
const options = modelStore.technologies
.map(t => <option key={t.technologyId}>{t.name}</option>);
return <div className="Compare-tech-column Compare-tech-add-column">
<div>
<input list={listId} autoComplete="off"
value={this.state.value}
placeholder="Add technology..."
onChange={this.valueChanged}
onKeyPress={(event) => { if (event.key === 'Enter') this.addTechnology(); }} />
<datalist id={listId}>
{options}
</datalist>
<input type="button" value="+"
disabled={!this.state.id}
onClick={this.addTechnology}
/>
</div>
<div></div>
</div>;
}
}
export default observer(CompareTechAdd);
|
var fs = require('fs'),
util = require('util'),
xml2js = require('xml2js'),
iconv = require('iconv-lite');
var parser = new xml2js.Parser();
var reg = undefined;
var regionIDList = ['pha', 'stk', 'jck', 'plk', 'kvk', 'ulk', 'lbk', 'khk', 'pak', 'vys', 'jmk', 'olk', 'zlk', 'msk']
var partiesFile = new Promise (function (resolve, reject) {
fs.readFile('../zdroje/current/utf/kzrkl-utf8.xml', function(err, content) {
parser.parseString(content, function (err, json) {
resolve(json);
});
});
});
function betterURL (url) {
var newURL = url;
var repl = [[' ', '-'],['+', '-'],['.', '-'],[',', '-'],['–', '-'],['?', ''],['!', ''],['(', ''],[')', ''],['á', 'a'],['č', 'c'],['ď', 'd'],['é', 'e'],['ě', 'e'],['í', 'i'],['ľ', 'l'],['ň', 'n'],['ó', 'o'],['ř', 'r'],['š', 's'],['ť', 't'],['ú', 'u'],['ů', 'u'],['ý', 'y'],['ž', 'z']];
newURL = newURL.toLowerCase();
repl.forEach(r => newURL = newURL.split(r[0]).join(r[1]));
return newURL;
}
Promise.all([partiesFile]).then(function (values) {
values[0].KZ_RKL.KZ_RKL_ROW.forEach((item, index) => {
var reg = Number(item.VSTRANA[0]);
var short = item.ZKRATKAK8 ? item.ZKRATKAK8[0] : item.ZKRATKAK30[0];
var name = item.NAZEVCELK[0];
var hash = betterURL(name);
var region = regionIDList[Number(item.KRZAST[0])];
// console.log(index, reg);
var o = {reg};
var lookup = "../data/volby/kv/2020/data/" + region + '/' + reg + ".json";
try {
o = JSON.parse(fs.readFileSync(lookup))
} catch (e) {
o = {
reg: reg
};
}
o.name = name;
o.hash = hash;
o.short = short;
o.no = Number(item.KSTRANA[0])
if (item.SLOZENI[0].split(',').length > 1) {
o.coalition = item.SLOZENI[0].split(",").map(it => Number(it));
}
// if (!lookup) {
fs.writeFileSync(lookup, JSON.stringify(o, null, 2));
// }
});
});
return;
|
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
# Values from CODATA 2014.
c = '299792458. * m / s' # speed of light (exact)
mu0 = '4.e-7 * pi * N / A**2' # permeability of vacuum
Grav = '6.67408e-11 * m**3 / kg / s**2' # gravitational constant
hplanck = '6.626070040e-34 * J * s' # Planck constant
e = '1.6021766208e-19 * C' # elementary charge
me = '9.10938356e-31 * kg' # electron mass
mp = '1.672621898e-27 * kg' # proton mass
Nav = '6.022140857e23 / mol' # Avogadro number
k = '1.38064852e-23 * J / K' # Boltzmann constant
amu = '1.660539040e-27 * kg' # atomic mass unit
# Values from various other places.
tsp = '4.92892159375 * ml' # teaspoon
galUK = '4.54609 * l' # British gallon
oz = '28.349523125 * g' # ounce
cal = '4.184 * J' # thermochemical kilocalorie
cali = '4.1868 * J' # international calorie
Btu = '1055.05585262 * J' # British thermal unit
hp = '745.699872 * W' # horsepower
atm = '101325. * Pa' # standard atmosphere pressure
psi = '6894.75729317 * Pa' # pounds per square inch
# defC and defF
|
//Получить общую сумму баланса (поле balance) всех пользователей.
import users from "./users.js";
const calculateTotalBalance = (users) => users.reduce((acc, users) =>
acc + users.balance, 0)
console.log(calculateTotalBalance(users)); // 20916
|
import { NotImplementedError } from '../extensions/index.js';
const MODERN_ACTIVITY = 15;
const HALF_LIFE_PERIOD = 5730;
/**
* Determine the age of archeological find by using
* given MODERN_ACTIVITY and HALF_LIFE_PERIOD values
*
* @param {String} sampleActivity string representation of current activity
* @return {Number | Boolean} calculated age in years or false
* in case of incorrect sampleActivity
*
* @example
*
* dateSample('1') => 22387
* dateSample('WOOT!') => false
*
*/
export default function dateSample(sampleActivity ) {
if(typeof sampleActivity === "string" && typeof +sampleActivity === "number" && +sampleActivity > 0 && +sampleActivity < MODERN_ACTIVITY) {
return Math.ceil(Math.log(MODERN_ACTIVITY/(+sampleActivity))/ (Math.log(2).toFixed(6)/HALF_LIFE_PERIOD));
} else {
return false;
}
}
|
# -*- coding: utf-8 -*-
# Copyright (c) 2019, ericklopez and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class stado_cap(Document):
pass
|
"""
Reads and edits Windows Firewall using netsh. May switch over to
registry based changes to avoid excess console windows.
"""
import subprocess
RULE_IN = "Block Internet In"
RULE_OUT = "Block Internet Out"
def rule_enabled(rule_name):
process = subprocess.run(["netsh", "advfirewall", "firewall", "show", "rule", f"name={rule_name}"],
universal_newlines=True,
stdout=subprocess.PIPE)
output = process.stdout.splitlines()
try:
return parse_check_output(output)
except ValueError as e:
raise e
def toggle_rule(rule_name, toggle):
toggle_arg = "yes" if toggle else "no"
subprocess.run(
["netsh", "advfirewall", "firewall", "set", "rule", f"name={rule_name}", "new", f"enable={toggle_arg}"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
def parse_check_output(output):
for line in output:
if line.find("Enabled:") > -1:
if line.find("Yes") > -1:
return True
if line.find("No") > -1:
return False
else:
raise ValueError("Unexpected console output")
def enable_rules():
try:
toggle_rule(RULE_IN, True)
toggle_rule(RULE_OUT, True)
enabled_in = rule_enabled(RULE_IN)
enabled_out = rule_enabled(RULE_OUT)
return enabled_in and enabled_out
except ValueError as e:
print(e)
return False
def disable_rules():
try:
toggle_rule(RULE_IN, False)
toggle_rule(RULE_OUT, False)
enabled_in = rule_enabled(RULE_IN)
enabled_out = rule_enabled(RULE_OUT)
return not enabled_in and not enabled_out
except ValueError as e:
print(e)
return False
|
import React, { Component } from 'react'
//ui
import { DetailsList } from '@fluentui/react';
import { PrimaryButton, DefaultButton } from 'office-ui-fabric-react/lib/Button';
import { Dropdown } from 'office-ui-fabric-react/lib/Dropdown'
import { mergeStyleSets, Modal, getTheme, FontWeights, Stack } from 'office-ui-fabric-react';
import { Query, gql, Mutation } from '@apollo/react-components'
//styles
const theme = getTheme();
const contentStyles = mergeStyleSets({
container: {
display: 'flex',
flexFlow: 'column nowrap',
alignItems: 'stretch',
},
header: [
theme.fonts.xLargePlus,
{
flex: '1 1 auto',
borderTop: `4px solid ${theme.palette.themePrimary}`,
color: theme.palette.neutralPrimary,
display: 'flex',
alignItems: 'center',
fontWeight: FontWeights.semibold,
padding: '12px 12px 14px 24px',
},
],
body: {
flex: '4 4 auto',
padding: '0 24px 24px 24px',
overflowY: 'hidden',
selectors: {
p: { margin: '14px 0' },
'p:first-child': { marginTop: 0 },
'p:last-child': { marginBottom: 0 },
},
},
});
const stackTokens = { childrenGap: 20 };
export class TableRO extends Component {
constructor(props) {
super(props)
this.state = {
isModalOpen: false,
id:"",
inspectorId: "",
inspectorName:"",
}
}
onChange = (event,option) => {
this.setState({
inspectorId: option.key,
inspectorName: option.name
})
}
onDismiss = () => {
this.setState({
isModalOpen: false
})
}
onItemInvoked = (item) => {
if(item.inspector==="Unassigned") {
this.setState({
id: item.id,
isModalOpen: true
})
}
}
aerodromeInspector = (i) => {
if(i===null) {
return 'Unassigned'
}
console.log(i);
return i.name
}
render() {
//rows
//columns blueprint
const columns = [
{ key: 'column1', iconName: 'Airplane' ,name: 'Name', fieldName: 'airport', minWidth: 100, maxWidth: 250, isResizable: true },
{ key: 'column2', name: 'City', fieldName: 'city', minWidth: 100, maxWidth: 150, isResizable: true },
{ key: 'column3', name: 'State', fieldName: 'state', minWidth: 100, maxWidth: 150, isResizable: true },
{ key: 'column4', name: 'Owner', fieldName: 'owner', minWidth: 100, maxWidth: 150, isResizable: true },
{ key: 'column5', name: 'Inspector', fieldName: 'inspector', minWidth: 100, maxWidth: 150, isResizable: true },
{ key: 'column6', name: 'Status', fieldName: 'status', minWidth: 100, maxWidth: 150, isResizable: true },
]
return (
<div>
<Query query={LIST_OF_LICENSE} variables={{ status: this.props.status }}>
{({ loading, error, data}) => {
if(loading) return`Loading`
if(error) return 'error'
if(data.licenses.length!==0) {
return (
<DetailsList
items={data.licenses.map(i => ({ id: i.id ,airport: i.aerodrome.placeName, city: i.aerodrome.city, state: i.aerodrome.state, inspector: this.aerodromeInspector(i.inspector), owner: i.aerodrome.owner.name, status: i.status}))}
columns={columns}
onItemInvoked={this.onItemInvoked}
selectionMode={0}
/>
)
}
return (
<h1>No Licenses Pending</h1>
)
}
}
</Query>
<Mutation mutation={ASSIGN_INSCPECTOR}>
{(assignInspector, {loading, error, data}) => {
if(loading) return 'loading'
if(error) console.log(error);
return (
<Modal
onDismiss={this.onDismiss}
isOpen={this.state.isModalOpen}
containerClassName={contentStyles.container}
>
<div className={contentStyles.header}>
<span>Select Inspector</span>
</div>
<div className={contentStyles.body}>
<div style={{paddingTop: "20px",paddingBottom: "30px"}}>
<Query query={LIST_OF_INSPECTOR} variables={{ role: "AerodromeInspector" }}>
{({ loading, error, data}) => {
if(loading) return`Loading`
if(error) return 'error'
return (
<Dropdown
placeholder="Select"
label="Enter Inspector"
onChange={this.onChange}
options={data.users.map((i) =>({key: i.id, text: i.name}))}
/>
)
}
}
</Query>
</div>
<Stack horizontal tokens={stackTokens}>
<PrimaryButton
text="Assign"
onClick={() => {
assignInspector({ variables: { id: this.state.id, inspectorId: this.state.inspectorId }})
}}
allowDisabledFocus />
<DefaultButton text="Close" onClick={this.onDismiss} allowDisabledFocus />
</Stack>
</div>
</Modal>
);
}}
</Mutation>
</div>
)
}
}
export default TableRO;
const LIST_OF_LICENSE = gql`
query Licenses($status: String){
licenses(filter: {
status: $status
}) {
id
status
operator {
id
name
}
inspector {
id
name
}
aerodrome {
placeName
state
city
owner {
name
}
}
}
}
`;
const LIST_OF_INSPECTOR = gql`
query Users($role: Roles){
users(role: $role) {
id
name
}
}`
;
const ASSIGN_INSCPECTOR = gql`
mutation AssignInspector($id: String!, $inspectorId: String!) {
assignInspector(id: $id, inspectorId: $inspectorId)
}
`;
|
/**
* @license
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
goog.provide('GoogleSmartCard.ConnectorApp.BackgroundMain');
goog.require('GoogleSmartCard.ConnectorApp.Background.MainWindowManaging');
goog.require('GoogleSmartCard.EmscriptenModule');
goog.require('GoogleSmartCard.ExecutableModule');
goog.require('GoogleSmartCard.Libusb.ChromeLoginStateHook');
goog.require('GoogleSmartCard.Libusb.ChromeUsbBackend');
goog.require('GoogleSmartCard.LogBufferForwarder');
goog.require('GoogleSmartCard.Logging');
goog.require('GoogleSmartCard.MessageChannelPair');
goog.require('GoogleSmartCard.MessageChannelPool');
goog.require('GoogleSmartCard.MessagingCommon');
goog.require('GoogleSmartCard.NaclModule');
goog.require('GoogleSmartCard.Packaging');
goog.require('GoogleSmartCard.PcscLiteServer.ReaderTracker');
goog.require('GoogleSmartCard.PcscLiteServerClientsManagement.ClientHandler');
goog.require('GoogleSmartCard.PcscLiteServerClientsManagement.ReadinessTracker');
goog.require('GoogleSmartCard.PortMessageChannel');
goog.require('GoogleSmartCard.SingleMessageBasedChannel');
goog.require('goog.asserts');
goog.require('goog.log');
goog.require('goog.log.Logger');
goog.require('goog.messaging.AbstractChannel');
goog.scope(function() {
const GSC = GoogleSmartCard;
const JS_LOGS_HANDLER_MESSAGE_TYPE = 'js_logs_handler';
/** @type {!goog.log.Logger} */
const logger = GSC.Logging.getScopedLogger('ConnectorApp.BackgroundMain');
/**
* Returns a forwarder for the JS logs, or null if there's none.
* @return {GSC.LogBufferForwarder?}
*/
function maybeCreateLogBufferForwarder() {
if (GSC.ExecutableModule.TOOLCHAIN !== GSC.ExecutableModule.Toolchain.PNACL)
return null;
// Used to forward logs collected on the JS side to the NaCl module's stdout,
// in order to simplify accessing them in some configurations.
return new GSC.LogBufferForwarder(
GSC.Logging.getLogBuffer(), JS_LOGS_HANDLER_MESSAGE_TYPE);
}
// Note that this object needs to be created as early as possible, in order to
// not miss any important log.
const logBufferForwarderToNaclModule = maybeCreateLogBufferForwarder();
const extensionManifest = chrome.runtime.getManifest();
goog.log.info(
logger,
`The Smart Card Connector app (id "${chrome.runtime.id}", version ` +
`${extensionManifest.version}) background script started. Browser ` +
`version: "${window.navigator.appVersion}".`);
/**
* Loads the binary executable module depending on the toolchain configuration.
* @return {!GSC.ExecutableModule}
*/
function createExecutableModule() {
switch (GSC.ExecutableModule.TOOLCHAIN) {
case GSC.ExecutableModule.Toolchain.PNACL:
return new GSC.NaclModule(
'executable_module.nmf', GSC.NaclModule.Type.PNACL);
case GSC.ExecutableModule.Toolchain.EMSCRIPTEN:
return new GSC.EmscriptenModule('executable_module');
}
GSC.Logging.fail(
`Cannot load executable module: unknown toolchain ` +
`${GSC.ExecutableModule.TOOLCHAIN}`);
goog.asserts.fail();
}
/**
* The binary executable module that contains the actual smart card client code.
* @type {!GSC.ExecutableModule}
*/
const executableModule = createExecutableModule();
executableModule.addOnDisposeCallback(executableModuleDisposedListener);
if (logBufferForwarderToNaclModule) {
executableModule.getLoadPromise().then(() => {
// Skip forwarding logs that were received from the NaCl module or generated
// while sending messages to it, in order to avoid duplication and/or
// infinite recursion.
logBufferForwarderToNaclModule.ignoreLogger(
executableModule.logMessagesReceiver.logger.getName());
// Start forwarding all future log messages collected on the JS side, but
// also immediately post the messages that have been accumulated so far.
logBufferForwarderToNaclModule.startForwarding(
executableModule.getMessageChannel());
}, () => {});
}
const libusbChromeUsbBackend =
new GSC.Libusb.ChromeUsbBackend(executableModule.getMessageChannel());
const chromeLoginStateHook = new GSC.Libusb.ChromeLoginStateHook();
libusbChromeUsbBackend.addRequestSuccessHook(
chromeLoginStateHook.getRequestSuccessHook());
// Start the backend regardless of whether the hook initialization succeeded.
chromeLoginStateHook.getHookReadyPromise()
.then(() => {}, () => {})
.then(function() {
libusbChromeUsbBackend.startProcessingEvents();
});
const pcscLiteReadinessTracker =
new GSC.PcscLiteServerClientsManagement.ReadinessTracker(
executableModule.getMessageChannel());
const messageChannelPool = new GSC.MessageChannelPool;
const readerTrackerMessageChannelPair = new GSC.MessageChannelPair;
createClientHandler(readerTrackerMessageChannelPair.getFirst(), undefined);
const readerTracker = new GSC.PcscLiteServer.ReaderTracker(
executableModule.getMessageChannel(),
readerTrackerMessageChannelPair.getSecond(), executableModule.getLogger());
executableModule.startLoading();
// Launching is only possible for an app; in case of the extension packaging
// mode, the user should click on the browser action icon next to the address
// bar.
if (GSC.Packaging.MODE == GSC.Packaging.Mode.APP)
chrome.app.runtime.onLaunched.addListener(launchedListener);
chrome.runtime.onConnect.addListener(connectionListener);
chrome.runtime.onConnectExternal.addListener(externalConnectionListener);
chrome.runtime.onMessageExternal.addListener(externalMessageListener);
/**
* Called when the executable module is disposed of.
*/
function executableModuleDisposedListener() {
if (!goog.DEBUG) {
// Trigger the fatal error in the Release mode, that will emit an error
// message and trigger the app reload.
GSC.Logging.failWithLogger(logger, 'Executable module was disposed of');
}
}
/**
* Called when the onLaunched event is received (that is, when the user clicks
* on the app in the Chrome OS app launcher).
*/
function launchedListener() {
goog.log.fine(logger, 'Received onLaunched event, opening window...');
GSC.ConnectorApp.Background.MainWindowManaging.openWindowDueToUserRequest(
makeDataForMainWindow());
}
/**
* Called when the onConnect event is received.
* @param {!Port} port
*/
function connectionListener(port) {
goog.log.fine(logger, 'Received onConnect event');
const portMessageChannel = new GSC.PortMessageChannel(port);
createClientHandler(portMessageChannel, undefined);
}
/**
* Called when the onConnectExternal event is received.
* @param {!Port} port
*/
function externalConnectionListener(port) {
goog.log.fine(logger, 'Received onConnectExternal event');
const portMessageChannel = new GSC.PortMessageChannel(port);
if (portMessageChannel.extensionId === null) {
goog.log.warning(
logger,
'Ignoring the external connection as there is no sender ' +
'extension id specified');
return;
}
messageChannelPool.addChannel(
portMessageChannel.extensionId, portMessageChannel);
GSC.MessagingCommon.setNonFatalDefaultServiceCallback(portMessageChannel);
createClientHandler(portMessageChannel, portMessageChannel.extensionId);
}
/**
* Called when the onMessageExternal event is received.
* @param {*} message
* @param {!MessageSender} sender
*/
function externalMessageListener(message, sender) {
goog.log.fine(logger, 'Received onMessageExternal event');
if (sender.id === undefined) {
goog.log.warning(
logger,
'Ignoring the external message as there is no sender ' +
'extension id specified');
return;
}
let channel = getOrCreateSingleMessageBasedChannel(sender.id);
if (!channel)
return;
channel.deliverMessage(message);
if (channel.isDisposed()) {
// The channel could get disposed of due to the detected client reload. So
// here an attempt is made to deliver the same message again to a freshly
// created message channel, so that the message from the reloaded client has
// a chance to be handled.
channel = getOrCreateSingleMessageBasedChannel(sender.id);
if (!channel)
return;
channel.deliverMessage(message);
}
}
/**
* Returns a single message based channel instance that talks to the specified
* extension - either returns an existing instance if there's one, or creates a
* new one otherwise. May return null if the channel becomes immediately
* disposed of due to some error.
* @param {string} clientExtensionId
* @return {GSC.SingleMessageBasedChannel?}
*/
function getOrCreateSingleMessageBasedChannel(clientExtensionId) {
const existingChannel =
messageChannelPool.getChannels(clientExtensionId).find(function(channel) {
return channel instanceof GSC.SingleMessageBasedChannel;
});
if (existingChannel)
return /** @type {!GSC.SingleMessageBasedChannel} */ (existingChannel);
const newChannel =
new GSC.SingleMessageBasedChannel(clientExtensionId, undefined, true);
messageChannelPool.addChannel(clientExtensionId, newChannel);
GSC.MessagingCommon.setNonFatalDefaultServiceCallback(newChannel);
createClientHandler(newChannel, clientExtensionId);
if (newChannel.isDisposed())
return null;
return newChannel;
}
/**
* Creates a PC/SC-Lite client handler for the specified message channel and the
* client extension.
* @param {!goog.messaging.AbstractChannel} clientMessageChannel
* @param {string|undefined} clientExtensionId
*/
function createClientHandler(clientMessageChannel, clientExtensionId) {
GSC.Logging.checkWithLogger(logger, !clientMessageChannel.isDisposed());
const clientTitleForLog = clientExtensionId !== undefined ?
'app "' + clientExtensionId + '"' :
'own app';
if (executableModule.isDisposed() ||
executableModule.getMessageChannel().isDisposed()) {
goog.log.warning(
logger,
'Could not create PC/SC-Lite client handler for ' + clientTitleForLog +
' as the server is disposed. Disposing of the client message ' +
'channel...');
clientMessageChannel.dispose();
return;
}
// Note: the reference to the created client handler is not stored anywhere,
// because it manages its lifetime itself, based on the lifetimes of the
// passed message channels.
const clientHandler = new GSC.PcscLiteServerClientsManagement.ClientHandler(
executableModule.getMessageChannel(), pcscLiteReadinessTracker,
clientMessageChannel, clientExtensionId);
const logMessage = 'Created a new PC/SC-Lite client handler for ' +
clientTitleForLog + ' (handler id ' + clientHandler.id + ')';
if (clientExtensionId !== undefined)
goog.log.info(logger, logMessage);
else
goog.log.fine(logger, logMessage);
}
/**
* Creates data for passing into the opened main window.
* @return {!Object}
*/
function makeDataForMainWindow() {
return {
'clientAppListUpdateSubscriber':
messageChannelPool.addOnUpdateListener.bind(messageChannelPool),
'readerTrackerSubscriber':
readerTracker.addOnUpdateListener.bind(readerTracker),
'readerTrackerUnsubscriber':
readerTracker.removeOnUpdateListener.bind(readerTracker)
};
}
}); // goog.scope
|
import logo from './logo.svg';
import './App.css';
import FunctionQuery from "./FunctionQuery.js"
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<FunctionQuery />
</header>
</div>
);
}
export default App;
|
function add_master(form,modal,title,url)
{
save_method = 'add';
$('#'+form)[0].reset(); // reset form on modals
$('#'+modal).modal('show'); // show bootstrap modal
$('.modal-title').text(title); // Set Title to Bootstrap modal title
$('#'+form).attr('action',url);
}
////////////////////////////////////// TRAYEK //////////////////////////////////////////
function edit_trayek(id)
{
$.ajax({
url : "index.php/master/get_data/trayek/"+id+"/id_trayek",
type: "GET",
dataType: "JSON",
success: function(data)
{
//$('[name="id_trayek"]').attr('readonly', 'readonly');
$('[name="nama_trayek"]').val(data.nama_trayek);
$('[name="tarif"]').val(data.tarif);
$('#pool').find("option[value='"+data.id_pool+"']").attr("selected", true);
$('#group').find("option[value='"+data.id_group+"']").attr("selected", true);
// $('#tahun_perolehan').find("option[value='"+data.tahun_perolehan+"']").attr("selected", true);
$("#formAddMaster").attr('action','index.php/master/save_trayek/edit/'+data.id_trayek);
$('#modal_form_master').modal('show'); // show bootstrap modal
$('.modal-title').text('Edit Master Data'); // Set Title to Bootstrap modal title
},
error: function (jqXHR, textStatus, errorThrown)
{
alert(errorThrown);
}
});
}
function delete_trayek(id)
{
$('#modal_confirm_delete').modal('show'); // show bootstrap modal
$('.modal-title').text('Confirmation Box'); // Set Title to Bootstrap modal title
$("#yes").click(function(e) {
$(".btn").attr("disabled", true);
$.ajax({
url : 'index.php/Master/delete_data/trayek/id_trayek/'+id,
dataType: "json",
success: function(data)
{
document.location.reload();
},
error: function (jqXHR, textStatus, errorThrown)
{
alert(errorThrown);
}
});
});
}
////////////////////////////////////// TRAYEK //////////////////////////////////////////
////////////////////////////////////// TERMINAL //////////////////////////////////////////
function edit_terminal(id)
{
$.ajax({
url : "index.php/master/get_data/terminal/"+id+"/id_terminal",
type: "GET",
dataType: "JSON",
success: function(data)
{
$('[name="nama_terminal"]').val(data.nama_terminal);
$('[name="gm"]').val(data.gm);
$('[name="nik_gm"]').val(data.gm_nik);
$('[name="staf"]').val(data.staf);
$('[name="nik_staf"]').val(data.staf_nik);
$('#comp').find("option[value='"+data.id_comp+"']").attr("selected", true);
$("#formAddSupir").attr('action','index.php/master/save_terminal/edit/'+id);
$('#modal_form_supir').modal('show'); // show bootstrap modal
$('.modal-title').text('Edit Master Data'); // Set Title to Bootstrap modal title
},
error: function (jqXHR, textStatus, errorThrown)
{
alert(errorThrown);
}
});
}
function delete_terminal(id)
{
$('#modal_confirm_delete').modal('show'); // show bootstrap modal
$('.modal-title').text('Confirmation Box'); // Set Title to Bootstrap modal title
$("#yes").click(function(e) {
$(".btn").attr("disabled", true);
$.ajax({
url : 'index.php/Master/delete_data/terminal/id_terminal/'+id,
dataType: "json",
success: function(data)
{
document.location.reload();
},
error: function (jqXHR, textStatus, errorThrown)
{
alert(errorThrown);
}
});
});
}
////////////////////////////////////// TREMINAL //////////////////////////////////////////
function view_master(id)
{
window.location.href="index.php/master/detail/"+id;
//alert(id);
}
function reply_save(id)
{
var value = CKEDITOR.instances['editor2'].getData();
var value2 = decodeURI(value);
var data = document.getElementById('reply').value = value;
$.ajax({
cache: true,
url : "index.php/master/save_reply/"+id,
type: "POST",
data: $('#form_reply').serialize(),
success: function(result)
{
$("#list_reply").html(result);
},
error: function (jqXHR, textStatus, errorThrown)
{
alert(errorThrown);
}
});
}
/*function reply_save(id)
{
var value = CKEDITOR.instances['editor1'].getData();
alert (value);
} */
function close_master(id, req_type)
{
$.ajax({
url : "index.php/master/add_master_close/"+id+"/"+req_type,
type: "GET",
success: function(result)
{
$("#master_detail").html(result);
},
error: function (jqXHR, textStatus, errorThrown)
{
alert(textStatus);
}
});
}
function alertFilename()
{
var thefile = document.getElementById('attachment');
var namefile = (thefile.value);
$.ajax({
url: "index.php/master/attach/"+namefile,
type: "GET",
success: function(result){
$("#attach").html(result);
}});
}
|
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS PUB 180-1
* Version 2.1 Copyright Paul Johnston 2000 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
var hexcase = 0;
var b64pad = "";
var chrsz = 8;
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
function sha1_vm_test()
{
return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
}
function core_sha1(x, len)
{
x[len >> 5] |= 0x80 << (24 - len % 32);
x[((len + 64 >> 9) << 4) + 15] = len;
var w = Array(80);
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
var e = -1009589776;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
var olde = e;
for(var j = 0; j < 80; j++)
{
if(j < 16) w[j] = x[i + j];
else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
safe_add(safe_add(e, w[j]), sha1_kt(j)));
e = d;
d = c;
c = rol(b, 30);
b = a;
a = t;
}
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
e = safe_add(e, olde);
}
return Array(a, b, c, d, e);
}
function sha1_ft(t, b, c, d)
{
if(t < 20) return (b & c) | ((~b) & d);
if(t < 40) return b ^ c ^ d;
if(t < 60) return (b & c) | (b & d) | (c & d);
return b ^ c ^ d;
}
function sha1_kt(t)
{
return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
(t < 60) ? -1894007588 : -899497514;
}
function core_hmac_sha1(key, data)
{
var bkey = str2binb(key);
if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
return core_sha1(opad.concat(hash), 512 + 160);
}
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
function rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
function str2binb(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32);
return bin;
}
function binb2str(bin)
{
var str = "";
var mask = (1 << chrsz) - 1;
for(var i = 0; i < bin.length * 32; i += chrsz)
str += String.fromCharCode((bin[i>>5] >>> (24 - i%32)) & mask);
return str;
}
function binb2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
}
return str;
}
function binb2b64(binarray)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
for(var i = 0; i < binarray.length * 4; i += 3)
{
var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
| (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
| ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
}
}
return str;
}
|
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.default = crudCollection;
var _redux = require('redux');
var _lodash = require('lodash');
var _actionTypesFor = require('./actionTypesFor');
var _actionTypesFor2 = _interopRequireDefault(_actionTypesFor);
var _crudItem = require('./crudItem');
var _crudItem2 = _interopRequireDefault(_crudItem);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function crudCollection(forType) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var crudItem = (0, _crudItem2.default)(forType);
var unique = function unique(items) {
return !options.uniqueBy ? items : (0, _lodash.uniqBy)(items, function (i) {
return i.data ? i.data[options.uniqueBy] : i[options.uniqueBy];
});
};
var mergeNew = function mergeNew(oldItems, newItems) {
return [].concat(_toConsumableArray(newItems.map(function (s) {
return { data: s };
}).reverse()), _toConsumableArray(oldItems.reverse()));
};
var actions = (0, _actionTypesFor2.default)(forType);
var statusReducer = function statusReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? 'none' : arguments[0];
var action = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
switch (action.type) {
case actions.pend:
return 'pending';
case actions.add:
case actions.replace:
return 'success';
case actions.failedToAdd:
return 'error';
default:
return state;
}
};
var validReducer = function validReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
var action = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
switch (action.type) {
case actions.add:
case actions.replace:
return true;
case actions.invalidate:
return false;
default:
return state;
}
};
var errorReducer = function errorReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
var action = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
switch (action.type) {
case actions.pend:
return null;
case actions.add:
case actions.replace:
return null;
case actions.failedToAdd:
return action.error;
default:
return state;
}
};
var creatingReducer = function creatingReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? 'success' : arguments[0];
var action = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
switch (action.type) {
case actions.pendCreation:
return 'pending';
case actions.create:
return 'success';
case actions.failedToCreate:
return 'error';
default:
return state;
}
};
var failedCreationsReducer = function failedCreationsReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
var action = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
switch (action.type) {
case actions.failedToCreate:
return [].concat(_toConsumableArray(state), _toConsumableArray(action.items.map(function (i) {
return { data: i, error: action.error };
})));
default:
return state.map(function (s) {
return crudItem(s, action);
});
}
};
var itemsReducer = function itemsReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
var action = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
switch (action.type) {
case actions.add:
case actions.create:
return unique(mergeNew(state, action.items)).reverse().map(function (s) {
return crudItem(s, action);
});
case actions.replace:
var newItems = unique(action.items.map(function (s) {
return { data: s };
}));
return newItems.map(function (s) {
return crudItem(s, action);
});
case actions.pendDeletion:
return state.map(function (s) {
var filterOut = options.uniqueBy ? s.data[options.uniqueBy] : s.cid;
return action.items.indexOf(filterOut) === -1 ? s : crudItem(s, action);
});
case actions.delete:
return state.filter(function (s) {
var filterOut = options.uniqueBy ? s.data[options.uniqueBy] : s.cid;
return action.items.indexOf(filterOut) === -1;
});
case actions.pendUpdate:
case actions.update:
if (action.noArgs) return state.map(function (s) {
return crudItem(s, _extends({}, action));
});
if (action.items.length === 0) return state;
var cruddy = action.items[0].__cruddy;
return state.map(function (s) {
if (cruddy) {
var itemUpdate = (0, _lodash.find)(action.items, { cid: s.cid });
if (!itemUpdate) return s;
return crudItem(s, _extends({}, action, { update: itemUpdate.data }));
} else {
var dataUpdate = (0, _lodash.find)(action.items, function (i) {
return i[options.uniqueBy] === s.data[options.uniqueBy];
});
if (!dataUpdate) return s;
return crudItem(s, _extends({}, action, { update: dataUpdate }));
}
});
case actions.empty:
return [];
default:
return state.map(function (s) {
return crudItem(s, action);
});
}
};
return (0, _redux.combineReducers)({
status: statusReducer,
valid: validReducer,
error: errorReducer,
creating: creatingReducer,
failedCreations: failedCreationsReducer,
items: itemsReducer
});
}
|
from __future__ import print_function, division
import os
import sys
import subprocess
def class_process(dir_path, class_name):
class_path = os.path.join(dir_path, class_name)
if not os.path.isdir(class_path):
return
for file_name in os.listdir(class_path):
video_dir_path = os.path.join(class_path, file_name)
image_indices = []
for image_file_name in os.listdir(video_dir_path):
if 'image' not in image_file_name:
continue
image_indices.append(int(image_file_name[6:11]))
if len(image_indices) == 0:
print('no image files', video_dir_path)
n_frames = 0
else:
image_indices.sort(reverse=True)
n_frames = image_indices[0]
print(video_dir_path, n_frames)
with open(os.path.join(video_dir_path, 'n_frames'), 'w') as dst_file:
dst_file.write(str(n_frames))
if __name__=="__main__":
dir_path = sys.argv[1]
for class_name in os.listdir(dir_path):
class_process(dir_path, class_name)
class_name = 'test'
class_process(dir_path, class_name)
|
(function() {
'use strict';
angular
.module('app.contact')
.run(appRun);
appRun.$inject = ['routerHelper'];
/* @ngInject */
function appRun(routerHelper) {
routerHelper.configureStates(getStates());
}
function getStates() {
return [
{
state: 'contact',
config: {
url: '/contact',
templateUrl: 'app/contact/contact.html',
controller: 'ContactController',
controllerAs: 'vm',
title: 'contact',
settings: {
nav: 3,
content: '<i class="fa fa-dashboard"></i> Contact'
}
}
}
];
}
})();
|
import * as React from "react";
import { render, screen, fireEvent } from "@testing-library/react";
import Comp from "./";
const spyScrollTo = jest.fn();
describe("Comp without props", () => {
it("should render with default 'Title not set'", async () => {
render(
<React.Suspense fallback={<div>loading</div>}>
<Comp />
</React.Suspense>
);
const res = await screen.findAllByText(/Title not set/i);
expect(res.length).toEqual(1);
});
});
describe("Comp with props", () => {
beforeEach(() => {
Object.defineProperty(global.window, "scrollTo", { value: spyScrollTo });
Object.defineProperty(global.window, "scrollY", { value: 1 });
spyScrollTo.mockClear();
});
it("should render with prop 'app' to set the title", async () => {
render(
<React.Suspense fallback={<div>loading</div>}>
<Comp app={{ config: { title: "nice title" } }} />
</React.Suspense>
);
const res = await screen.findAllByText(/nice title/i);
expect(res.length).toEqual(1);
});
it("should render link to home", async () => {
render(
<React.Suspense fallback={<div>loading</div>}>
<Comp />
</React.Suspense>
);
const res = await screen.findAllByRole("link");
expect(res.length).toEqual(1);
expect(res[0].href).toEqual("http://localhost/#");
});
it("should have correct aria-label", async () => {
render(
<React.Suspense fallback={<div>loading</div>}>
<Comp />
</React.Suspense>
);
const res = await screen.findAllByRole("link");
expect(res[0].hasAttribute("aria-label")).toEqual(true);
expect(res[0].getAttribute("aria-label")).toEqual("Go back home");
});
it("should use passed in aria-label", async () => {
render(
<React.Suspense fallback={<div>loading</div>}>
<Comp label="test" />
</React.Suspense>
);
const res = await screen.findAllByRole("link");
expect(res[0].hasAttribute("aria-label")).toEqual(true);
expect(res[0].getAttribute("aria-label")).toEqual("test");
});
it("should render with custom title", async () => {
render(
<React.Suspense fallback={<div>loading</div>}>
<Comp label="test" app={{ config: { title: "mytitle" } }} />
</React.Suspense>
);
const res = await screen.findAllByRole("link");
fireEvent.click(res[0]);
});
it("should scroll home on click", async () => {
render(
<React.Suspense fallback={<div>loading</div>}>
<Comp label="test" app={{ config: { title: "mytitle" } }} />
</React.Suspense>
);
const res = await screen.findAllByRole("link");
fireEvent.click(res[0]);
expect(spyScrollTo).toHaveBeenCalledWith(0, 0);
});
});
|
export function performLoginOperation(userCredential) {
return (dispatch) => {
//ajax call
var url = '/api/console.php/login/username/password'
//tempory send UserId, token for testing
var parameters = "";
var callback = function(res){
var response = JSON.parse(res);
/*response = {
"success" : 212,
"perms" : {"1001":{"roles":[{"id":"8","role":"ADMIN"}}
}*/
//check for error
if(response.hasOwnProperty('error')){
// throw error
// toastr.error(ServerErrorMessages.getError(response.error).message, ServerErrorMessages.getError(response.error).title);
dispatch({
type: "LOGIN_FAIL"
});
}else if(response.hasOwnProperty('info')){
//check for message
// toastr.warning(ServerInfoMessages.getInfo(response.info).message, ServerInfoMessages.getInfo(response.info).title);
dispatch({
type: "LOGIN_FAIL"
});
}else if(response.hasOwnProperty('success')){
//get result
//toastr.success(ServerSuccessMessages.getSuccess(response.success).message, ServerSuccessMessages.getSuccess(response.success).title);
dispatch({
type:"LOGIN_SUCCESS",
payload:{
'userID': userCredential.userid,
'perms': JSON.parse(response.perms),
'firstName': response.firstName,
'lastName': response.lastName,
'email': response.email,
'Image': response.Image
}
});
}
}
makePOSTAjaxCall(url, parameters, callback , true);
}
}
|
console.log( 42 );
|
/*!
* jquery.sumoselect - v3.0.3
* http://hemantnegi.github.io/jquery.sumoselect
* 2016-12-12
*
* Copyright 2015 Hemant Negi
* Email : hemant.frnz@gmail.com
* Compressor http://refresh-sf.com/
*/
(function(factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof exports !== 'undefined') {
module.exports = factory(require('jquery'));
} else {
factory(jQuery);
}
})(function($) {
'namespace sumo';
$.fn.SumoSelect = function(options) {
// This is the easiest way to have default options.
var settings = $.extend({
placeholder: 'Select Here', // Dont change it here.
csvDispCount: 3, // display no. of items in multiselect. 0 to display all.
captionFormat: '{0} Selected', // format of caption text. you can set your locale.
captionFormatAllSelected: '{0} all selected!', // format of caption text when all elements are selected. set null to use captionFormat. It will not work if there are disabled elements in select.
floatWidth: 400, // Screen width of device at which the list is rendered in floating popup fashion.
forceCustomRendering: false, // force the custom modal on all devices below floatWidth resolution.
nativeOnDevice: ['Android', 'BlackBerry', 'iPhone', 'iPad', 'iPod', 'Opera Mini', 'IEMobile', 'Silk'], //
outputAsCSV: false, // true to POST data as csv ( false for Html control array ie. default select )
csvSepChar: ',', // separation char in csv mode
okCancelInMulti: false, // display ok cancel buttons in desktop mode multiselect also.
isClickAwayOk: false, // for okCancelInMulti=true. sets whether click outside will trigger Ok or Cancel (default is cancel).
triggerChangeCombined: true, // im multi select mode whether to trigger change event on individual selection or combined selection.
selectAll: false, // to display select all button in multiselect mode.|| also select all will not be available on mobile devices.
search: false, // to display input for filtering content. selectAlltext will be input text placeholder
searchText: 'Search...', // placeholder for search input
noMatch: 'No matches for "{0}"',
prefix: '', // some prefix usually the field name. eg. '<b>Hello</b>'
locale: ['OK', 'Cancel', 'Select All'], // all text that is used. don't change the index.
up: false, // set true to open upside.
showTitle: true // set to false to prevent title (tooltip) from appearing
}, options);
var ret = this.each(function() {
var selObj = this; // the original select object.
if (this.sumo || !$(this).is('select')) return; //already initialized
this.sumo = {
E: $(selObj), //the jquery object of original select element.
is_multi: $(selObj).attr('multiple'), //if its a multiple select
select: '',
caption: '',
placeholder: '',
optDiv: '',
CaptionCont: '',
ul: '',
is_floating: false,
is_opened: false,
//backdrop: '',
mob: false, // if to open device default select
Pstate: [],
createElems: function() {
var O = this;
O.E.wrap('<div class="SumoSelect" tabindex="0" role="button" aria-expanded="false">');
O.select = O.E.parent();
O.caption = $('<span>');
O.CaptionCont = $('<p class="CaptionCont SelectBox" ><label><i></i></label></p>')
.attr('style', O.E.attr('style'))
.prepend(O.caption);
O.select.append(O.CaptionCont);
// default turn off if no multiselect
if (!O.is_multi) settings.okCancelInMulti = false
if (O.E.attr('disabled'))
O.select.addClass('disabled').removeAttr('tabindex');
//if output as csv and is a multiselect.
if (settings.outputAsCSV && O.is_multi && O.E.attr('name')) {
//create a hidden field to store csv value.
O.select.append($('<input class="HEMANT123" type="hidden" />').attr('name', O.E.attr('name')).val(O.getSelStr()));
// so it can not post the original select.
O.E.removeAttr('name');
}
//break for mobile rendring.. if forceCustomRendering is false
if (O.isMobile() && !settings.forceCustomRendering) {
O.setNativeMobile();
return;
}
// if there is a name attr in select add a class to container div
if (O.E.attr('name')) O.select.addClass('sumo_' + O.E.attr('name').replace(/\[\]/, ''))
//hide original select
O.E.addClass('SumoUnder').attr('tabindex', '-1');
//## Creating the list...
O.optDiv = $('<div class="optWrapper ' + (settings.up ? 'up' : '') + '">');
//branch for floating list in low res devices.
O.floatingList();
//Creating the markup for the available options
O.ul = $('<ul class="options">');
O.optDiv.append(O.ul);
// Select all functionality
if (settings.selectAll && O.is_multi) O.SelAll();
// search functionality
if (settings.search) O.Search();
O.ul.append(O.prepItems(O.E.children()));
//if multiple then add the class multiple and add OK / CANCEL button
if (O.is_multi) O.multiSelelect();
O.select.append(O.optDiv);
O.basicEvents();
O.selAllState();
},
prepItems: function(opts, d) {
var lis = [],
O = this;
$(opts).each(function(i, opt) { // parsing options to li
opt = $(opt);
lis.push(opt.is('optgroup') ?
$('<li class="group ' + (opt[0].disabled ? 'disabled' : '') + '"><label>' + opt.attr('label') + '</label><ul></ul></li>')
.find('ul')
.append(O.prepItems(opt.children(), opt[0].disabled))
.end() :
O.createLi(opt, d)
);
});
return lis;
},
//## Creates a LI element from a given option and binds events to it
//## returns the jquery instance of li (not inserted in dom)
createLi: function(opt, d) {
var O = this;
if (!opt.attr('value')) opt.attr('value', opt.val());
var li = $('<li class="opt"><label>' + opt.text() + '</label></li>');
li.data('opt', opt); // store a direct reference to option.
opt.data('li', li); // store a direct reference to list item.
if (O.is_multi) li.prepend('<span><i></i></span>');
if (opt[0].disabled || d)
li = li.addClass('disabled');
O.onOptClick(li);
if (opt[0].selected)
li.addClass('selected');
if (opt.attr('class'))
li.addClass(opt.attr('class'));
if (opt.attr('title'))
li.attr('title', opt.attr('title'));
return li;
},
//## Returns the selected items as string in a Multiselect.
getSelStr: function() {
// get the pre selected items.
sopt = [];
this.E.find('option:selected').each(function() { sopt.push($(this).val()); });
return sopt.join(settings.csvSepChar);
},
//## THOSE OK/CANCEL BUTTONS ON MULTIPLE SELECT.
multiSelelect: function() {
var O = this;
O.optDiv.addClass('multiple');
O.okbtn = $('<p tabindex="0" class="btnOk">' + settings.locale[0] + '</p>').click(function() {
//if combined change event is set.
O._okbtn();
O.hideOpts();
});
O.cancelBtn = $('<p tabindex="0" class="btnCancel">' + settings.locale[1] + '</p>').click(function() {
O._cnbtn();
O.hideOpts();
});
var btns = O.okbtn.add(O.cancelBtn);
O.optDiv.append($('<div class="MultiControls">').append(btns));
// handling keyboard navigation on ok cancel buttons.
btns.on('keydown.sumo', function(e) {
var el = $(this);
switch (e.which) {
case 32: // space
case 13: // enter
el.trigger('click');
break;
case 9: //tab
if (el.hasClass('btnOk')) return;
case 27: // esc
O._cnbtn();
O.hideOpts();
return;
}
e.stopPropagation();
e.preventDefault();
});
},
_okbtn: function() {
var O = this,
cg = 0;
//if combined change event is set.
if (settings.triggerChangeCombined) {
//check for a change in the selection.
if (O.E.find('option:selected').length != O.Pstate.length) {
cg = 1;
} else {
O.E.find('option').each(function(i, e) {
if (e.selected && O.Pstate.indexOf(i) < 0) cg = 1;
});
}
if (cg) {
O.callChange();
O.setText();
}
}
},
_cnbtn: function() {
var O = this;
//remove all selections
O.E.find('option:selected').each(function() { this.selected = false; });
O.optDiv.find('li.selected').removeClass('selected')
//restore selections from saved state.
for (var i = 0; i < O.Pstate.length; i++) {
O.E.find('option')[O.Pstate[i]].selected = true;
O.ul.find('li.opt').eq(O.Pstate[i]).addClass('selected');
}
O.selAllState();
},
SelAll: function() {
var O = this;
if (!O.is_multi) return;
O.selAll = $('<p class="select-all"><span><i></i></span><label>' + settings.locale[2] + '</label></p>');
O.optDiv.addClass('selall');
O.selAll.on('click', function() {
O.selAll.toggleClass('selected');
O.toggSelAll(O.selAll.hasClass('selected'), 1);
//O.selAllState();
});
O.optDiv.prepend(O.selAll);
},
// search module (can be removed if not required.)
Search: function() {
var O = this,
cc = O.CaptionCont.addClass('search'),
P = $('<p class="no-match">');
O.ftxt = $('<input type="text" class="search-txt" value="" placeholder="' + settings.searchText + '">')
.on('click', function(e) {
e.stopPropagation();
});
cc.append(O.ftxt);
O.optDiv.children('ul').after(P);
O.ftxt.on('keyup.sumo', function() {
var hid = O.optDiv.find('ul.options li.opt').each(function(ix, e) {
var e = $(e),
opt = e.data('opt')[0];
opt.hidden = e.text().toLowerCase().indexOf(O.ftxt.val().toLowerCase()) < 0;
e.toggleClass('hidden', opt.hidden);
}).not('.hidden');
P.html(settings.noMatch.replace(/\{0\}/g, '<em></em>')).toggle(!hid.length);
P.find('em').text(O.ftxt.val());
O.selAllState();
});
},
selAllState: function() {
var O = this;
if (settings.selectAll && O.is_multi) {
var sc = 0,
vc = 0;
O.optDiv.find('li.opt').not('.hidden').each(function(ix, e) {
if ($(e).hasClass('selected')) sc++;
if (!$(e).hasClass('disabled')) vc++;
});
//select all checkbox state change.
if (sc == vc) O.selAll.removeClass('partial').addClass('selected');
else if (sc == 0) O.selAll.removeClass('selected partial');
else O.selAll.addClass('partial') //.removeClass('selected');
}
},
showOpts: function() {
var O = this;
if (O.E.attr('disabled')) return; // if select is disabled then retrun
O.E.trigger('sumo:opening', O);
O.is_opened = true;
O.select.addClass('open').attr('aria-expanded', 'true');
O.E.trigger('sumo:opened', O);
if (O.ftxt) O.ftxt.focus();
else O.select.focus();
// hide options on click outside.
$(document).on('click.sumo', function(e) {
if (!O.select.is(e.target) // if the target of the click isn't the container...
&&
O.select.has(e.target).length === 0) { // ... nor a descendant of the container
if (!O.is_opened) return;
O.hideOpts();
if (settings.okCancelInMulti) {
if (settings.isClickAwayOk)
O._okbtn();
else
O._cnbtn();
}
}
});
if (O.is_floating) {
H = O.optDiv.children('ul').outerHeight() + 2; // +2 is clear fix
if (O.is_multi) H = H + parseInt(O.optDiv.css('padding-bottom'));
O.optDiv.css('height', H);
$('body').addClass('sumoStopScroll');
}
O.setPstate();
},
//maintain state when ok/cancel buttons are available storing the indexes.
setPstate: function() {
var O = this;
if (O.is_multi && (O.is_floating || settings.okCancelInMulti)) {
O.Pstate = [];
// assuming that find returns elements in tree order
O.E.find('option').each(function(i, e) { if (e.selected) O.Pstate.push(i); });
}
},
callChange: function() {
this.E.trigger('change').trigger('click');
},
hideOpts: function() {
var O = this;
if (O.is_opened) {
O.E.trigger('sumo:closing', O);
O.is_opened = false;
O.select.removeClass('open').attr('aria-expanded', 'true').find('ul li.sel').removeClass('sel');
O.E.trigger('sumo:closed', O);
$(document).off('click.sumo');
O.select.focus();
$('body').removeClass('sumoStopScroll');
// clear the search
if (settings.search) {
O.ftxt.val('');
O.ftxt.trigger('keyup.sumo');
}
}
},
setOnOpen: function() {
var O = this,
li = O.optDiv.find('li.opt:not(.hidden)').eq(settings.search ? 0 : O.E[0].selectedIndex);
if (li.hasClass('disabled')) {
li = li.next(':not(disabled)')
if (!li.length) return;
}
O.optDiv.find('li.sel').removeClass('sel');
li.addClass('sel');
O.showOpts();
},
nav: function(up) {
var O = this,
c,
s = O.ul.find('li.opt:not(.disabled, .hidden)'),
sel = O.ul.find('li.opt.sel:not(.hidden)'),
idx = s.index(sel);
if (O.is_opened && sel.length) {
if (up && idx > 0)
c = s.eq(idx - 1);
else if (!up && idx < s.length - 1 && idx > -1)
c = s.eq(idx + 1);
else return; // if no items before or after
sel.removeClass('sel');
sel = c.addClass('sel');
// setting sel item to visible view.
var ul = O.ul,
st = ul.scrollTop(),
t = sel.position().top + st;
if (t >= st + ul.height() - sel.outerHeight())
ul.scrollTop(t - ul.height() + sel.outerHeight());
if (t < st)
ul.scrollTop(t);
} else
O.setOnOpen();
},
basicEvents: function() {
var O = this;
O.CaptionCont.click(function(evt) {
O.E.trigger('click');
if (O.is_opened) O.hideOpts();
else O.showOpts();
evt.stopPropagation();
});
O.select.on('keydown.sumo', function(e) {
switch (e.which) {
case 38: // up
O.nav(true);
break;
case 40: // down
O.nav(false);
break;
case 65: // shortcut ctrl + a to select all and ctrl + shift + a to unselect all.
if (O.is_multi && e.ctrlKey) {
O.toggSelAll(!e.shiftKey, 1);
break;
} else
return;
case 32: // space
if (settings.search && O.ftxt.is(e.target)) return;
case 13: // enter
if (O.is_opened)
O.optDiv.find('ul li.sel').trigger('click');
else
O.setOnOpen();
break;
case 9: //tab
if (!settings.okCancelInMulti)
O.hideOpts();
return;
case 27: // esc
if (settings.okCancelInMulti) O._cnbtn();
O.hideOpts();
return;
default:
return; // exit this handler for other keys
}
e.preventDefault(); // prevent the default action (scroll / move caret)
});
$(window).on('resize.sumo', function() {
O.floatingList();
});
},
onOptClick: function(li) {
var O = this;
li.click(function() {
var li = $(this);
if (li.hasClass('disabled')) return;
var txt = "";
if (O.is_multi) {
li.toggleClass('selected');
li.data('opt')[0].selected = li.hasClass('selected');
O.selAllState();
} else {
li.parent().find('li.selected').removeClass('selected'); //if not multiselect then remove all selections from this list
li.toggleClass('selected');
li.data('opt')[0].selected = true;
}
//branch for combined change event.
if (!(O.is_multi && settings.triggerChangeCombined && (O.is_floating || settings.okCancelInMulti))) {
O.setText();
O.callChange();
}
if (!O.is_multi) O.hideOpts(); //if its not a multiselect then hide on single select.
});
},
setText: function() {
var O = this;
O.placeholder = "";
if (O.is_multi) {
sels = O.E.find(':selected').not(':disabled'); //selected options.
for (i = 0; i < sels.length; i++) {
if (i + 1 >= settings.csvDispCount && settings.csvDispCount) {
if (sels.length == O.E.find('option').length && settings.captionFormatAllSelected) {
O.placeholder = settings.captionFormatAllSelected.replace(/\{0\}/g, sels.length) + ',';
} else {
O.placeholder = settings.captionFormat.replace(/\{0\}/g, sels.length) + ',';
}
break;
} else O.placeholder += $(sels[i]).text() + ", ";
}
O.placeholder = O.placeholder.replace(/,([^,]*)$/, '$1'); //remove unexpected "," from last.
} else {
O.placeholder = O.E.find(':selected').not(':disabled').text();
}
var is_placeholder = false;
if (!O.placeholder) {
is_placeholder = true;
O.placeholder = O.E.attr('placeholder');
if (!O.placeholder) //if placeholder is there then set it
O.placeholder = O.E.find('option:disabled:selected').text();
}
O.placeholder = O.placeholder ? (settings.prefix + ' ' + O.placeholder) : settings.placeholder
//set display text
O.caption.html(O.placeholder);
if (settings.showTitle) O.CaptionCont.attr('title', O.placeholder);
//set the hidden field if post as csv is true.
var csvField = O.select.find('input.HEMANT123');
if (csvField.length) csvField.val(O.getSelStr());
//add class placeholder if its a placeholder text.
if (is_placeholder) O.caption.addClass('placeholder');
else O.caption.removeClass('placeholder');
return O.placeholder;
},
isMobile: function() {
// Adapted from http://www.detectmobilebrowsers.com
var ua = navigator.userAgent || navigator.vendor || window.opera;
// Checks for iOs, Android, Blackberry, Opera Mini, and Windows mobile devices
for (var i = 0; i < settings.nativeOnDevice.length; i++)
if (ua.toString().toLowerCase().indexOf(settings.nativeOnDevice[i].toLowerCase()) > 0) return settings.nativeOnDevice[i];
return false;
},
setNativeMobile: function() {
var O = this;
O.E.addClass('SelectClass') //.css('height', O.select.outerHeight());
O.mob = true;
O.E.change(function() {
O.setText();
});
},
floatingList: function() {
var O = this;
//called on init and also on resize.
//O.is_floating = true if window width is < specified float width
O.is_floating = $(window).width() <= settings.floatWidth;
//set class isFloating
O.optDiv.toggleClass('isFloating', O.is_floating);
//remove height if not floating
if (!O.is_floating) O.optDiv.css('height', '');
//toggle class according to okCancelInMulti flag only when it is not floating
O.optDiv.toggleClass('okCancelInMulti', settings.okCancelInMulti && !O.is_floating);
},
//HELPERS FOR OUTSIDERS
// validates range of given item operations
vRange: function(i) {
var O = this;
var opts = O.E.find('option');
if (opts.length <= i || i < 0) throw "index out of bounds"
return O;
},
//toggles selection on c as boolean.
toggSel: function(c, i) {
var O = this;
var opt;
if (typeof(i) === "number") {
O.vRange(i);
opt = O.E.find('option')[i];
} else {
opt = O.E.find('option[value="' + i + '"]')[0] || 0;
}
if (!opt || opt.disabled)
return;
if (opt.selected != c) {
opt.selected = c;
if (!O.mob) $(opt).data('li').toggleClass('selected', c);
O.callChange();
O.setPstate();
O.setText();
O.selAllState();
}
},
//toggles disabled on c as boolean.
toggDis: function(c, i) {
var O = this.vRange(i);
O.E.find('option')[i].disabled = c;
if (c) O.E.find('option')[i].selected = false;
if (!O.mob) O.optDiv.find('ul.options li').eq(i).toggleClass('disabled', c).removeClass('selected');
O.setText();
},
// toggle disable/enable on complete select control
toggSumo: function(val) {
var O = this;
O.enabled = val;
O.select.toggleClass('disabled', val);
if (val) {
O.E.attr('disabled', 'disabled');
O.select.removeAttr('tabindex');
} else {
O.E.removeAttr('disabled');
O.select.attr('tabindex', '0');
}
return O;
},
// toggles all option on c as boolean.
// set direct=false/0 bypasses okCancelInMulti behaviour.
toggSelAll: function(c, direct) {
var O = this;
O.E.find('option:not(:disabled,:hidden)')
.each(function(ix, e) {
var is_selected = e.selected,
e = $(e).data('li');
if (e.hasClass('hidden')) return;
if (!!c) {
if (!is_selected) e.trigger('click');
} else {
if (is_selected) e.trigger('click');
}
});
if (!direct) {
if (!O.mob && O.selAll) O.selAll.removeClass('partial').toggleClass('selected', !!c);
O.callChange();
O.setText();
O.setPstate();
}
},
/* outside accessibility options
which can be accessed from the element instance.
*/
reload: function() {
var elm = this.unload();
return $(elm).SumoSelect(settings);
},
unload: function() {
var O = this;
O.select.before(O.E);
O.E.show();
if (settings.outputAsCSV && O.is_multi && O.select.find('input.HEMANT123').length) {
O.E.attr('name', O.select.find('input.HEMANT123').attr('name')); // restore the name;
}
O.select.remove();
delete selObj.sumo;
return selObj;
},
//## add a new option to select at a given index.
add: function(val, txt, i) {
if (typeof val == "undefined") throw "No value to add"
var O = this;
opts = O.E.find('option')
if (typeof txt == "number") {
i = txt;
txt = val;
}
if (typeof txt == "undefined") { txt = val; }
opt = $("<option></option>").val(val).html(txt);
if (opts.length < i) throw "index out of bounds"
if (typeof i == "undefined" || opts.length == i) { // add it to the last if given index is last no or no index provides.
O.E.append(opt);
if (!O.mob) O.ul.append(O.createLi(opt));
} else {
opts.eq(i).before(opt);
if (!O.mob) O.ul.find('li.opt').eq(i).before(O.createLi(opt));
}
return selObj;
},
//## removes an item at a given index.
remove: function(i) {
var O = this.vRange(i);
O.E.find('option').eq(i).remove();
if (!O.mob) O.optDiv.find('ul.options li').eq(i).remove();
O.setText();
},
//## Select an item at a given index.
selectItem: function(i) { this.toggSel(true, i); },
//## UnSelect an iten at a given index.
unSelectItem: function(i) { this.toggSel(false, i); },
//## Select all items of the select.
selectAll: function() { this.toggSelAll(true); },
//## UnSelect all items of the select.
unSelectAll: function() { this.toggSelAll(false); },
//## Disable an iten at a given index.
disableItem: function(i) { this.toggDis(true, i) },
//## Removes disabled an iten at a given index.
enableItem: function(i) { this.toggDis(false, i) },
//## New simple methods as getter and setter are not working fine in ie8-
//## variable to check state of control if enabled or disabled.
enabled: true,
//## Enables the control
enable: function() { return this.toggSumo(false) },
//## Disables the control
disable: function() { return this.toggSumo(true) },
init: function() {
var O = this;
O.createElems();
O.setText();
return O
}
};
selObj.sumo.init();
});
return ret.length == 1 ? ret[0] : ret;
};
});
|
# coding: utf-8
# AUTOGENERATED BY gen_script.sh from kpony4.py
# Copyright (C) Nyimbi Odero, Sun May 21 00:15:29 EAT 2017
from sqlalchemy import func
from flask_appbuilder import Model
from flask_appbuilder.models.mixins import AuditMixin, FileColumn, ImageColumn, UserExtensionMixin
from flask_appbuilder.models.decorators import renders
from flask_appbuilder.filemanager import ImageManager
from sqlalchemy_utils import aggregated
from sqlalchemy.orm import relationship, query, defer, deferred
from sqlalchemy import (Column, Integer, String, ForeignKey,
Sequence, Float, Text, BigInteger, Date,
DateTime, Time, Boolean, CheckConstraint,
UniqueConstraint, Numeric, LargeBinary , Table)
from datetime import timedelta, datetime, date
from sqlalchemy.dialects.postgresql import *
from .mixins import *
# Here is how to extend the User model
#class UserExtended(Model, UserExtensionMixin):
# contact_group_id = Column(Integer, ForeignKey('contact_group.id'), nullable=True)
# contact_group = relationship('ContactGroup')
class Gender(AuditMixin, Model):
id = Column(Integer, primary_key=True)
name = Column(String(50), unique = True, nullable=False)
def __repr__(self):
return self.name
class Attorney(PersonMixin, ContactMixin, AuditMixin, Model):
__tablename__ = 'attorney'
def photo_img(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
def photo_img_thumbnail(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url_thumbnail(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
id = Column(Integer, primary_key=True, autoincrement=True)
law_firm = Column(ForeignKey(u'lawfirm.id'), index=True)
barnumber = Column(String(20))
lawfirm = relationship(u'Lawfirm', primaryjoin='Attorney.law_firm == Lawfirm.id', backref=u'attorneys')
hearing = relationship(u'Hearing', secondary='attorney_hearing', backref=u'attorneys')
attorney_hearing = Table(
'attorney_hearing', Model.metadata,
Column('attorney', ForeignKey(u'attorney.id'), primary_key=True, nullable=False),
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False, index=True)
)
class Bail(AuditMixin, Model):
__tablename__ = 'bail'
id = Column(Integer, primary_key=True, autoincrement=True)
hearing = Column(ForeignKey(u'hearing.id'), nullable=False, index=True)
defendant = Column(ForeignKey(u'defendant.id'), nullable=False, index=True)
amountgranted = Column(Float(53), nullable=False)
noofsureties = Column(Integer, nullable=False)
paid = Column(Boolean, nullable=False)
paydate = Column(Date, nullable=False)
receiptno = Column(String(100), nullable=False)
defendant1 = relationship(u'Defendant', primaryjoin='Bail.defendant == Defendant.id', backref=u'bails')
hearing1 = relationship(u'Hearing', primaryjoin='Bail.hearing == Hearing.id', backref=u'bails')
surety = relationship(u'Surety', secondary='bail_surety', backref=u'bails')
bail_surety = Table(
'bail_surety', Model.metadata,
Column('bail', ForeignKey(u'bail.id'), primary_key=True, nullable=False),
Column('surety', ForeignKey(u'surety.id'), primary_key=True, nullable=False, index=True)
)
class Case(AuditMixin, Model):
__tablename__ = 'case'
id = Column(Integer, primary_key=True, autoincrement=True)
casename = Column(String(200), nullable=False)
docketnumber = Column(String(100))
investigationassigmentdate = Column(DateTime)
investigationassignmentnote = Column(Text, nullable=False)
investigationplan = Column(Text, nullable=False)
initialreport = Column(Text, nullable=False)
priority = Column(Integer, nullable=False)
investigationsummary = Column(Text, nullable=False)
agadvicerequested = Column(Boolean, nullable=False)
sendtotrial = Column(Boolean, nullable=False)
chargedate = Column(DateTime)
agadvice = Column(Text, nullable=False)
taketotrial = Column(Boolean, nullable=False)
caseclosed = Column(Boolean, nullable=False)
judgement = Column(Text, nullable=False)
closeddate = Column(Date, nullable=False)
sentencelength = Column(Integer, nullable=False)
sentencestartdate = Column(Date, nullable=False)
sentenceexpirydate = Column(Date, nullable=False)
fineamount = Column(Float(53), nullable=False)
caseappealed = Column(Boolean, nullable=False)
appealdate = Column(DateTime, nullable=False)
natureofsuit = relationship(u'Natureofsuit', secondary='case_natureofsuit', backref=u'cases')
plaintiff = relationship(u'Plaintiff', secondary='case_plaintiff', backref=u'cases')
policeman = relationship(u'Policeman', secondary='case_policeman_2', backref=u'policeman_cases')
prosecutor = relationship(u'Prosecutor', secondary='case_prosecutor', backref=u'cases')
witness = relationship(u'Witnes', secondary='case_witness', backref=u'cases')
policeman1 = relationship(u'Policeman', secondary='case_policeman', backref=u'policeman_cases_0')
policestation = relationship(u'Policestation', secondary='case_policestation', backref=u'cases')
defendant = relationship(u'Defendant', secondary='case_defendant', backref=u'cases')
causeofaction = relationship(u'Causeofaction', secondary='case_causeofaction', backref=u'cases')
case_causeofaction = Table(
'case_causeofaction', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('causeofaction', ForeignKey(u'causeofaction.id'), primary_key=True, nullable=False, index=True)
)
case_defendant = Table(
'case_defendant', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('defendant', ForeignKey(u'defendant.id'), primary_key=True, nullable=False, index=True)
)
case_natureofsuit = Table(
'case_natureofsuit', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('natureofsuit', ForeignKey(u'natureofsuit.id'), primary_key=True, nullable=False, index=True)
)
case_plaintiff = Table(
'case_plaintiff', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('plaintiff', ForeignKey(u'plaintiff.id'), primary_key=True, nullable=False, index=True)
)
case_policeman = Table(
'case_policeman', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('policeman', ForeignKey(u'policeman.id'), primary_key=True, nullable=False, index=True)
)
case_policeman_2 = Table(
'case_policeman_2', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('policeman', ForeignKey(u'policeman.id'), primary_key=True, nullable=False, index=True)
)
case_policestation = Table(
'case_policestation', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('policestation', ForeignKey(u'policestation.id'), primary_key=True, nullable=False, index=True)
)
case_prosecutor = Table(
'case_prosecutor', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('prosecutor', ForeignKey(u'prosecutor.id'), primary_key=True, nullable=False, index=True)
)
case_witness = Table(
'case_witness', Model.metadata,
Column('case', ForeignKey(u'case.id'), primary_key=True, nullable=False),
Column('witness', ForeignKey(u'witness.id'), primary_key=True, nullable=False, index=True)
)
class Causeofaction(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'causeofaction'
id = Column(Integer, primary_key=True, autoincrement=True)
criminal = Column(Boolean, nullable=False)
parent_coa = Column(ForeignKey(u'causeofaction.id'), index=True)
parent = relationship(u'Causeofaction', remote_side=[id], primaryjoin='Causeofaction.parent_coa == Causeofaction.id', backref=u'causeofactions')
filing = relationship(u'Filing', secondary='causeofaction_filing', backref=u'causeofactions')
hearing = relationship(u'Hearing', secondary='causeofaction_hearing', backref=u'causeofactions')
causeofaction_filing = Table(
'causeofaction_filing', Model.metadata,
Column('causeofaction', ForeignKey(u'causeofaction.id'), primary_key=True, nullable=False),
Column('filing', ForeignKey(u'filing.id'), primary_key=True, nullable=False, index=True)
)
causeofaction_hearing = Table(
'causeofaction_hearing', Model.metadata,
Column('causeofaction', ForeignKey(u'causeofaction.id'), primary_key=True, nullable=False),
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False, index=True)
)
class Constituency(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'constituency'
id = Column(Integer, primary_key=True, autoincrement=True)
county = Column(ForeignKey(u'county.id'), nullable=False, index=True)
town = Column(ForeignKey(u'town.id'), index=True)
county1 = relationship(u'County', primaryjoin='Constituency.county == County.id', backref=u'constituencies')
town1 = relationship(u'Town', primaryjoin='Constituency.town == Town.id', backref=u'constituencies')
class County(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'county'
id = Column(Integer, primary_key=True, autoincrement=True)
class Court(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'court'
id = Column(Integer, primary_key=True, autoincrement=True)
town = Column(ForeignKey(u'town.id'), nullable=False, index=True)
residentmagistrate = Column(String(100))
registrar = Column(String(100), nullable=False)
court_level = Column(ForeignKey(u'courtlevel.id'), nullable=False, index=True)
courtlevel = relationship(u'Courtlevel', primaryjoin='Court.court_level == Courtlevel.id', backref=u'courts')
town1 = relationship(u'Town', primaryjoin='Court.town == Town.id', backref=u'courts')
class Courtlevel(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'courtlevel'
id = Column(Integer, primary_key=True, autoincrement=True)
class Defendant(BiometricMixin, EmploymentMixin, PersonMixin, ContactMixin, AuditMixin, Model):
__tablename__ = 'defendant'
def photo_img(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
def photo_img_thumbnail(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url_thumbnail(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
id = Column(Integer, primary_key=True, autoincrement=True)
hearing = relationship(u'Hearing', secondary='defendant_hearing', backref=u'defendants')
defendant_hearing = Table(
'defendant_hearing', Model.metadata,
Column('defendant', ForeignKey(u'defendant.id'), primary_key=True, nullable=False),
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False, index=True)
)
class Doctemplate(DocMixin, RefTypeMixin, AuditMixin, Model):
__tablename__ = 'doctemplate'
id = Column(Integer, primary_key=True, autoincrement=True)
class Document(DocMixin, AuditMixin, Model):
__tablename__ = 'document'
id = Column(Integer, primary_key=True, autoincrement=True)
doc_template = Column(ForeignKey(u'doctemplate.id'), index=True)
doctemplate = relationship(u'Doctemplate', primaryjoin='Document.doc_template == Doctemplate.id', backref=u'documents')
filing = relationship(u'Filing', secondary='document_filing', backref=u'documents')
document_filing = Table(
'document_filing', Model.metadata,
Column('document', ForeignKey(u'document.id'), primary_key=True, nullable=False),
Column('filing', ForeignKey(u'filing.id'), primary_key=True, nullable=False, index=True)
)
class Filing(AuditMixin, Model):
__tablename__ = 'filing'
id = Column(Integer, primary_key=True, autoincrement=True)
filedate = Column(DateTime, nullable=False)
totalfees = Column(Float(53), nullable=False)
filing_attorney = Column(ForeignKey(u'attorney.id'), nullable=False, index=True)
filing_prosecutor = Column(ForeignKey(u'prosecutor.id'), nullable=False, index=True)
receiptnumber = Column(Text)
receiptverified = Column(Boolean, nullable=False)
amountpaid = Column(Float(53), nullable=False)
feebalance = Column(Float(53), nullable=False)
paymenthistory = Column(Text, nullable=False)
attorney = relationship(u'Attorney', primaryjoin='Filing.filing_attorney == Attorney.id', backref=u'filings')
prosecutor = relationship(u'Prosecutor', primaryjoin='Filing.filing_prosecutor == Prosecutor.id', backref=u'filings')
filingtype = relationship(u'Filingtype', secondary='filing_filingtype', backref=u'filings')
hearing = relationship(u'Hearing', secondary='filing_hearing', backref=u'filings')
filing_filingtype = Table(
'filing_filingtype', Model.metadata,
Column('filing', ForeignKey(u'filing.id'), primary_key=True, nullable=False),
Column('filingtype', ForeignKey(u'filingtype.id'), primary_key=True, nullable=False, index=True)
)
filing_hearing = Table(
'filing_hearing', Model.metadata,
Column('filing', ForeignKey(u'filing.id'), primary_key=True, nullable=False),
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False, index=True)
)
class Filingtype(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'filingtype'
id = Column(Integer, primary_key=True, autoincrement=True)
cost = Column(Float(53), nullable=False)
perpagecost = Column(Float(53), nullable=False)
class Hearing(ActivityMixin, AuditMixin, Model):
__tablename__ = 'hearing'
id = Column(Integer, primary_key=True, autoincrement=True)
hearingdate = Column(DateTime, nullable=False)
adjourned = Column(Boolean, nullable=False)
case = Column(ForeignKey(u'case.id'), nullable=False, index=True)
court = Column(ForeignKey(u'court.id'), nullable=False, index=True)
hearing_type = Column(ForeignKey(u'hearingtype.id'), nullable=False, index=True)
remandwarrant = Column(Text, nullable=False)
remandlength = Column(Integer)
remanddate = Column(Date, nullable=False)
remandwarrantexpirydate = Column(Date, nullable=False)
nexthearingdate = Column(Date)
finalhearing = Column(Boolean, nullable=False)
transcript = Column(Text, nullable=False)
audio = Column(ImageColumn, nullable=False)
video = Column(ImageColumn, nullable=False)
case1 = relationship(u'Case', primaryjoin='Hearing.case == Case.id', backref=u'hearings')
court1 = relationship(u'Court', primaryjoin='Hearing.court == Court.id', backref=u'hearings')
hearingtype = relationship(u'Hearingtype', primaryjoin='Hearing.hearing_type == Hearingtype.id', backref=u'hearings')
witness = relationship(u'Witnes', secondary='hearing_witness', backref=u'hearings')
prosecutor = relationship(u'Prosecutor', secondary='hearing_prosecutor', backref=u'hearings')
judge = relationship(u'Judge', secondary='hearing_judge', backref=u'hearings')
policeman = relationship(u'Policeman', secondary='hearing_policeman', backref=u'hearings')
hearing_judge = Table(
'hearing_judge', Model.metadata,
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False),
Column('judge', ForeignKey(u'judge.id'), primary_key=True, nullable=False, index=True)
)
hearing_policeman = Table(
'hearing_policeman', Model.metadata,
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False),
Column('policeman', ForeignKey(u'policeman.id'), primary_key=True, nullable=False, index=True)
)
hearing_prosecutor = Table(
'hearing_prosecutor', Model.metadata,
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False),
Column('prosecutor', ForeignKey(u'prosecutor.id'), primary_key=True, nullable=False, index=True)
)
hearing_witness = Table(
'hearing_witness', Model.metadata,
Column('hearing', ForeignKey(u'hearing.id'), primary_key=True, nullable=False),
Column('witness', ForeignKey(u'witness.id'), primary_key=True, nullable=False, index=True)
)
class Hearingtype(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'hearingtype'
id = Column(Integer, primary_key=True, autoincrement=True)
class Investigation(AuditMixin, Model):
__tablename__ = 'investigation'
id = Column(Integer, primary_key=True, autoincrement=True)
case = Column(ForeignKey(u'case.id'), nullable=False, index=True)
actiondate = Column(DateTime, nullable=False)
evidence = Column(Text, nullable=False)
narrative = Column(Text, nullable=False)
weather = Column(Text, nullable=False)
location = Column(Text, nullable=False)
case1 = relationship(u'Case', primaryjoin='Investigation.case == Case.id', backref=u'investigations')
policeman = relationship(u'Policeman', secondary='investigation_policeman', backref=u'investigations')
witness = relationship(u'Witnes', secondary='investigation_witness', backref=u'investigations')
investigation_policeman = Table(
'investigation_policeman', Model.metadata,
Column('investigation', ForeignKey(u'investigation.id'), primary_key=True, nullable=False),
Column('policeman', ForeignKey(u'policeman.id'), primary_key=True, nullable=False, index=True)
)
investigation_witness = Table(
'investigation_witness', Model.metadata,
Column('investigation', ForeignKey(u'investigation.id'), primary_key=True, nullable=False),
Column('witness', ForeignKey(u'witness.id'), primary_key=True, nullable=False, index=True)
)
class Judge(PersonMixin, ContactMixin, AuditMixin, Model):
__tablename__ = 'judge'
def photo_img(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
def photo_img_thumbnail(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url_thumbnail(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
id = Column(Integer, primary_key=True, autoincrement=True)
court = Column(ForeignKey(u'court.id'), nullable=False, index=True)
court1 = relationship(u'Court', primaryjoin='Judge.court == Court.id', backref=u'judges')
class Lawfirm(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'lawfirm'
id = Column(Integer, primary_key=True, autoincrement=True)
class Natureofsuit(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'natureofsuit'
id = Column(Integer, primary_key=True, autoincrement=True)
class Plaintiff(PersonMixin, ContactMixin, AuditMixin, Model):
__tablename__ = 'plaintiff'
def photo_img(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
def photo_img_thumbnail(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url_thumbnail(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
id = Column(Integer, primary_key=True, autoincrement=True)
class Policeman(PersonMixin, ContactMixin, AuditMixin, Model):
__tablename__ = 'policeman'
def photo_img(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
def photo_img_thumbnail(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url_thumbnail(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
id = Column(Integer, primary_key=True, autoincrement=True)
policerole = relationship(u'Policerole', secondary='policerole_policeman', backref=u'policemen')
class Policerole(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'policerole'
id = Column(Integer, primary_key=True, autoincrement=True)
policerole_policeman = Table(
'policerole_policeman', Model.metadata,
Column('policerole', ForeignKey(u'policerole.id'), primary_key=True, nullable=False),
Column('policeman', ForeignKey(u'policeman.id'), primary_key=True, nullable=False, index=True)
)
class Policestation(AuditMixin, Model):
__tablename__ = 'policestation'
id = Column(Integer, primary_key=True, autoincrement=True)
town = Column(ForeignKey(u'town.id'), nullable=False, index=True)
officercommanding = Column(String(100))
town1 = relationship(u'Town', primaryjoin='Policestation.town == Town.id', backref=u'policestations')
class Prison(AuditMixin, Model):
__tablename__ = 'prison'
id = Column(Integer, primary_key=True, autoincrement=True)
town = Column(ForeignKey(u'town.id'), nullable=False, index=True)
warden = Column(String(100))
capacity = Column(Integer, nullable=False)
population = Column(Integer, nullable=False)
town1 = relationship(u'Town', primaryjoin='Prison.town == Town.id', backref=u'prisons')
class Prisonremand(AuditMixin, Model):
__tablename__ = 'prisonremand'
prison = Column(ForeignKey(u'prison.id'), primary_key=True, nullable=False)
warrantno = Column(String(100), primary_key=True, nullable=False)
hearing = Column(ForeignKey(u'hearing.id'), nullable=False, index=True)
defendant = Column(ForeignKey(u'defendant.id'), nullable=False, index=True)
warrantduration = Column(Integer, nullable=False)
warrantdate = Column(DateTime, nullable=False)
warrant = Column(Text, nullable=False)
warrantexpiry = Column(DateTime, nullable=False)
history = Column(Text, nullable=False)
defendant1 = relationship(u'Defendant', primaryjoin='Prisonremand.defendant == Defendant.id', backref=u'prisonremands')
hearing1 = relationship(u'Hearing', primaryjoin='Prisonremand.hearing == Hearing.id', backref=u'prisonremands')
prison1 = relationship(u'Prison', primaryjoin='Prisonremand.prison == Prison.id', backref=u'prisonremands')
class Prosecutor(PersonMixin, ContactMixin, AuditMixin, Model):
__tablename__ = 'prosecutor'
def photo_img(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
def photo_img_thumbnail(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url_thumbnail(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
id = Column(Integer, primary_key=True, autoincrement=True)
prosecutorteam = relationship(u'Prosecutorteam', secondary='prosecutor_prosecutorteam', backref=u'prosecutors')
prosecutor_prosecutorteam = Table(
'prosecutor_prosecutorteam', Model.metadata,
Column('prosecutor', ForeignKey(u'prosecutor.id'), primary_key=True, nullable=False),
Column('prosecutorteam', ForeignKey(u'prosecutorteam.id'), primary_key=True, nullable=False, index=True)
)
class Prosecutorteam(AuditMixin, Model):
__tablename__ = 'prosecutorteam'
id = Column(Integer, primary_key=True, autoincrement=True)
class Subcounty(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'subcounty'
id = Column(Integer, primary_key=True, autoincrement=True)
county = Column(ForeignKey(u'county.id'), nullable=False, index=True)
county1 = relationship(u'County', primaryjoin='Subcounty.county == County.id', backref=u'subcounties')
class Surety(PersonMixin, ContactMixin, AuditMixin, Model):
__tablename__ = 'surety'
def photo_img(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
def photo_img_thumbnail(self):
im = ImageManager()
vn = self.ViewName()
if self.photo:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="' + im.get_url_thumbnail(self.photo) +
'" alt="Photo" class="img-rounded img-responsive"></a>')
else:
return Markup('<a href="' + url_for(vn, pk=str(self.id)) +
'" class="thumbnail"><img src="//:0" alt="Photo" class="img-responsive"></a>')
id = Column(Integer, primary_key=True, autoincrement=True)
class Town(RefTypeMixin, AuditMixin, Model):
__tablename__ = 'town'
id = Column(Integer, primary_key=True, autoincrement=True)
subcounty = Column(ForeignKey(u'subcounty.id'), nullable=False, index=True)
subcounty1 = relationship(u'Subcounty', primaryjoin='Town.subcounty == Subcounty.id', backref=u'towns')
class Witnes(AuditMixin, Model):
__tablename__ = 'witness'
id = Column(Integer, primary_key=True, autoincrement=True)
fordefense = Column(Boolean, nullable=False)
|
#
# Copyright(c) 2020-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import os
import time
import pytest
import re
from api.cas import casadm
from api.cas.cache_config import CacheMode, CacheModeTrait, CleaningPolicy
from core.test_run import TestRun
from test_tools import fs_utils
from test_tools.disk_utils import Filesystem
from test_utils import os_utils
from test_utils.size import Size, Unit
from test_tools.fio.fio import Fio
from test_tools.blktrace import BlkTrace, BlkTraceMask, RwbsKind
from test_tools.fio.fio_param import ReadWrite, IoEngine
from storage_devices.disk import DiskType, DiskTypeSet
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand]))
def test_trim_start_discard():
"""
title: Check discarding cache device at cache start
description: |
Create 2 partitions on trim-supporting device, write pattern to both partitions,
start blktrace against first one, start cache on first partition and check if discard
requests were sent at all and only to the first partition.
pass_criteria:
- Partition used for cache is discarded.
- Second partition is untouched - written pattern is preserved.
"""
with TestRun.step("Clearing dmesg"):
TestRun.executor.run_expect_success("dmesg -C")
with TestRun.step("Preparing cache device"):
dev = TestRun.disks['cache']
dev.create_partitions([Size(500, Unit.MebiByte), Size(500, Unit.MebiByte)])
cas_part = dev.partitions[0]
non_cas_part = dev.partitions[1]
with TestRun.step("Writing different pattern on partitions"):
cas_fio = write_pattern(cas_part.path)
non_cas_fio = write_pattern(non_cas_part.path)
cas_fio.run()
non_cas_fio.run()
# TODO add blktracing for non-cas part
with TestRun.step("Starting blktrace against first (cache) partition"):
blktrace = BlkTrace(cas_part, BlkTraceMask.discard)
blktrace.start_monitoring()
with TestRun.step("Starting cache"):
cache = casadm.start_cache(cas_part, force=True)
metadata_size = get_metadata_size_from_dmesg()
with TestRun.step("Stop blktrace and check if discard requests were issued"):
cache_reqs = blktrace.stop_monitoring()
cache_part_start = cas_part.begin
# CAS should discard cache device during cache start
if len(cache_reqs) == 0:
TestRun.fail("No discard requests issued to the cas partition!")
non_meta_sector = (cache_part_start + metadata_size).get_value(Unit.Blocks512)
non_meta_size = (cas_part.size - metadata_size).get_value(Unit.Byte)
for req in cache_reqs:
if req.sector_number != non_meta_sector:
TestRun.fail(f"Discard request issued to wrong sector: {req.sector_number}, "
f"expected: {non_meta_sector}")
if req.byte_count != non_meta_size:
TestRun.fail(f"Discard request issued with wrong bytes count: {req.byte_count}, "
f"expected: {non_meta_size} bytes")
cas_fio.read_write(ReadWrite.read)
non_cas_fio.read_write(ReadWrite.read)
cas_fio.verification_with_pattern("0x00")
cas_fio.offset(metadata_size)
cas_fio.run()
non_cas_fio.run()
with TestRun.step("Stopping cache"):
cache.stop()
@pytest.mark.parametrizex("cache_mode", CacheMode.with_traits(CacheModeTrait.InsertWrite))
@pytest.mark.parametrizex("filesystem", Filesystem)
@pytest.mark.parametrizex("cleaning_policy", CleaningPolicy)
@pytest.mark.parametrizex("trim_support_cache_core", [(False, True), (True, False), (True, True)])
@pytest.mark.require_disk("ssd1", DiskTypeSet([DiskType.optane, DiskType.nand]))
@pytest.mark.require_disk("ssd2", DiskTypeSet([DiskType.optane, DiskType.nand]))
@pytest.mark.require_disk("hdd", DiskTypeSet([DiskType.hdd, DiskType.hdd4k]))
def test_trim_device_discard_support(
trim_support_cache_core, cache_mode, filesystem, cleaning_policy):
"""
title: Trim requests supported on various cache and core devices.
description: |
Handling trim requests support when various combination of SSD and HDD are used as
cache and core.
pass_criteria:
- No system crash.
- Discards detected on CAS.
- Discards detected on SSD device when it is used as core.
- Discards not detected on HDD device used as cache or core.
- Discards not detected on cache device.
"""
mount_point = "/mnt"
with TestRun.step(f"Create partitions on SSD and HDD devices."):
TestRun.disks["ssd1"].create_partitions([Size(1, Unit.GibiByte)])
TestRun.disks["ssd2"].create_partitions([Size(1, Unit.GibiByte)])
TestRun.disks["hdd"].create_partitions([Size(1, Unit.GibiByte)])
ssd1_dev = TestRun.disks["ssd1"].partitions[0]
ssd2_dev = TestRun.disks["ssd2"].partitions[0]
hdd_dev = TestRun.disks["hdd"].partitions[0]
with TestRun.step(f"Start cache and add core."):
cache_dev = ssd1_dev if trim_support_cache_core[0] else hdd_dev
core_dev = ssd2_dev if trim_support_cache_core[1] else hdd_dev
cache = casadm.start_cache(cache_dev, cache_mode, force=True)
cache.set_cleaning_policy(cleaning_policy)
core = cache.add_core(core_dev)
with TestRun.step("Make filesystem and mount it with discard option."):
core.create_filesystem(filesystem)
core.mount(mount_point, ["discard"])
with TestRun.step("Create random file."):
test_file = fs_utils.create_random_test_file(os.path.join(mount_point, "test_file"),
core_dev.size * 0.9)
occupancy_before = core.get_occupancy()
TestRun.LOGGER.info(str(core.get_statistics()))
with TestRun.step("Start blktrace monitoring on all devices."):
blktraces = start_monitoring(core_dev, cache_dev, core)
with TestRun.step("Remove file."):
os_utils.sync()
os_utils.drop_caches()
test_file.remove()
with TestRun.step(
"Ensure that discards were detected by blktrace on proper devices."):
discard_expected = {"core": trim_support_cache_core[1], "cache": False, "cas": True}
stop_monitoring_and_check_discards(blktraces, discard_expected)
with TestRun.step("Ensure occupancy reduced."):
occupancy_after = core.get_occupancy()
TestRun.LOGGER.info(str(core.get_statistics()))
if occupancy_after >= occupancy_before:
TestRun.LOGGER.error("Occupancy on core after removing test file greater than before.")
else:
TestRun.LOGGER.info("Occupancy on core after removing test file smaller than before.")
with TestRun.step("Check CAS sysfs properties values."):
check_sysfs_properties(cache, cache_dev, core, core_dev.parent_device,
core_supporting_discards=trim_support_cache_core[1])
def check_sysfs_properties(cache, cache_dev, core, core_disk, core_supporting_discards):
expected_discard_max_bytes = int(core_disk.get_discard_max_bytes()) \
if core_supporting_discards else int(cache_dev.size.get_value())
cas_discard_max_bytes = int(core.get_discard_max_bytes())
compare_properties(cas_discard_max_bytes, expected_discard_max_bytes, "discard_max_bytes")
expected_discard_granularity = int(core_disk.get_discard_granularity()) \
if core_supporting_discards else int(cache.get_cache_line_size())
cas_discard_granularity = int(core.get_discard_granularity())
compare_properties(
cas_discard_granularity, expected_discard_granularity, "discard_granularity")
cas_discard_zeroes_data = int(core.get_discard_zeroes_data())
if cas_discard_zeroes_data == 0:
TestRun.LOGGER.info("CAS discard_zeroes_data value equals 0 as expected.")
else:
TestRun.LOGGER.error(f"CAS discard_zeroes_data value equals {cas_discard_zeroes_data}. "
"Expected value for this property is 0.")
def compare_properties(value, expected_value, property_name):
if expected_value == value:
TestRun.LOGGER.info(f"CAS {property_name} value is correct.")
return
TestRun.LOGGER.error(f"CAS property {property_name} value equals {value} and differs "
f"from expected value: {expected_value}.")
def stop_monitoring_and_check_discards(blktraces, discard_support):
time.sleep(10)
os_utils.sync()
os_utils.drop_caches()
time.sleep(2)
discard_flag = RwbsKind.D # Discard
for key in blktraces.keys():
output = blktraces[key].stop_monitoring()
discard_messages = [h for h in output if discard_flag in h.rwbs]
check_discards(len(discard_messages), blktraces[key].device, discard_support[key])
def check_discards(discards_count, device, discards_expected):
if discards_expected:
if discards_count > 0:
TestRun.LOGGER.info(
f"{discards_count} TRIM instructions generated for {device.path}")
else:
TestRun.LOGGER.error(f"No TRIM instructions found in requests to {device.path}")
else:
if discards_count > 0:
TestRun.LOGGER.error(
f"{discards_count} TRIM instructions generated for {device.path}")
else:
TestRun.LOGGER.info(f"No TRIM instructions found in requests to {device.path}")
def start_monitoring(core_dev, cache_dev, cas_dev):
blktrace_core_dev = BlkTrace(core_dev, BlkTraceMask.discard)
blktrace_cache_dev = BlkTrace(cache_dev, BlkTraceMask.discard)
blktrace_cas = BlkTrace(cas_dev, BlkTraceMask.discard)
blktrace_core_dev.start_monitoring()
blktrace_cache_dev.start_monitoring()
blktrace_cas.start_monitoring()
return {"core": blktrace_core_dev, "cache": blktrace_cache_dev, "cas": blktrace_cas}
def write_pattern(device):
return (Fio().create_command()
.io_engine(IoEngine.libaio)
.read_write(ReadWrite.write)
.target(device)
.direct()
.verification_with_pattern()
)
def get_metadata_size_from_dmesg():
dmesg_out = TestRun.executor.run_expect_success("dmesg").stdout
for s in dmesg_out.split("\n"):
if "Hash offset" in s:
offset = re.search("[0-9]* kiB", s).group()
offset = Size(int(re.search("[0-9]*", offset).group()), Unit.KibiByte)
if "Hash size" in s:
size = re.search("[0-9]* kiB", s).group()
size = Size(int(re.search("[0-9]*", size).group()), Unit.KibiByte)
# Metadata is 128KiB aligned
return (offset + size).align_up(128 * Unit.KibiByte.value)
|
const fs = require('fs')
// const book = {
// title: '7 Mares',
// author: 'Tim Maia'
// }
// // fs.writeFileSync('1.json.json', JSON.stringify(book))
// const dataBuffer = fs.readFileSync('1.json.json')
// console.log(dataBuffer);
// console.log(dataBuffer.toString());
const data = fs.readFileSync('1-json.json').toString()
const parsedData = JSON.parse(data)
console.log(parsedData);
parsedData.name = 'Heitor'
parsedData.age = Number(19)
console.log(parsedData);
const stringifyedParsedData = JSON.stringify(parsedData)
console.log(stringifyedParsedData);
fs.writeFileSync('1-json.json', stringifyedParsedData)
|
import * as React from 'react';
function SvgChat(props) {
return (
<svg
width="1em"
height="1em"
viewBox="0 0 20 21"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M10 0c5.523 0 10 4.477 10 10s-4.477 10-10 10a9.96 9.96 0 01-4.587-1.112l-3.826 1.067a1.25 1.25 0 01-1.54-1.54l1.068-3.823A9.96 9.96 0 010 10C0 4.477 4.477 0 10 0zm0 1.5A8.5 8.5 0 001.5 10c0 1.47.373 2.883 1.073 4.137l.15.27-1.112 3.984 3.987-1.112.27.15A8.5 8.5 0 1010 1.5zM6.75 11h4.498a.75.75 0 01.102 1.493l-.102.007H6.75a.75.75 0 01-.102-1.493L6.75 11h4.498H6.75zm0-3.5h6.505a.75.75 0 01.101 1.493L13.255 9H6.75a.75.75 0 01-.102-1.493L6.75 7.5h6.505H6.75z"
fill="currentColor"
/>
</svg>
);
}
export default SvgChat;
|
const config = require('../config.json');
const server = require('./lib/server');
config.PORT = process.env.PORT || config.PORT;
server.run(config);
|
import React, { useContext } from "react";
import { AuthContext } from "./../context/AuthContext";
const AuthStateItem = ({ title, value }) => (
<div className="text-sm">
<p className="font-bold mb-2">{title}</p>
<pre className="whitespace-pre-wrap bg-gray-100 p-2 rounded">
<code className="break-all">{value}</code>
</pre>
</div>
);
const AuthDebugger = () => {
const authContext = useContext(AuthContext);
const {
authState: { token, expiresAt, userInfo },
isAuthenticated,
} = authContext;
return (
<section className="rounded-lg shadow bg-white p-4">
<div className="mb-2">
<AuthStateItem
title="IsAuthenticated"
value={isAuthenticated() ? "True" : "False"}
/>
</div>
<div className="mb-2">
<AuthStateItem title="Token" value={token} />
</div>
<div className="mb-2">
<AuthStateItem title="Expiry" value={expiresAt} />
</div>
<div className="mb-2">
<AuthStateItem title="User Info" value={JSON.stringify(userInfo, null, 2)} />
</div>
</section>
);
};
export default AuthDebugger;
|
import {datetime, Datetime} from "./core/class";
import "./plugins/buddhist"
import "./plugins/calendar"
import "./plugins/century"
import "./plugins/compare"
import "./plugins/dayofyear"
import "./plugins/daysin"
import "./plugins/decade"
import "./plugins/from"
import "./plugins/hour12"
import "./plugins/isleapyear"
import "./plugins/iso"
import "./plugins/max"
import "./plugins/min"
import "./plugins/quarter"
import "./plugins/sort"
import "./plugins/strftime"
import "./plugins/timezone"
import "./plugins/today"
import "./plugins/tomorrow"
import "./plugins/transform"
import "./plugins/unix"
import "./plugins/weeknumber"
import "./plugins/yesterday"
import "./plugins/time-lapse"
import "./i18n/ru"
import "./i18n/de"
import "./i18n/ua"
globalThis.Datetime = Datetime
globalThis.datetime = datetime
if (!globalThis.date) {
globalThis.date = datetime
}
|
#!/usr/bin/env python3
# Copyright (c) 2020-2021 Pieter Wuille
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Reference implementation for Bech32/Bech32m and segwit addresses."""
import unittest
from enum import Enum
CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
BECH32_CONST = 1
BECH32M_CONST = 0x2bc830a3
class Encoding(Enum):
"""Enumeration type to list the various supported encodings."""
BECH32 = 1
BECH32M = 2
def bech32_polymod(values):
"""Internal function that computes the Bech32 checksum."""
generator = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]
chk = 1
for value in values:
top = chk >> 25
chk = (chk & 0x1ffffff) << 5 ^ value
for i in range(5):
chk ^= generator[i] if ((top >> i) & 1) else 0
return chk
def bech32_hrp_expand(hrp):
"""Expand the HRP into values for checksum computation."""
return [ord(x) >> 5 for x in hrp] + [0] + [ord(x) & 31 for x in hrp]
def bech32_verify_checksum(hrp, data):
"""Verify a checksum given HRP and converted data characters."""
check = bech32_polymod(bech32_hrp_expand(hrp) + data)
if check == BECH32_CONST:
return Encoding.BECH32
elif check == BECH32M_CONST:
return Encoding.BECH32M
else:
return None
def bech32_create_checksum(encoding, hrp, data):
"""Compute the checksum values given HRP and data."""
values = bech32_hrp_expand(hrp) + data
const = BECH32M_CONST if encoding == Encoding.BECH32M else BECH32_CONST
polymod = bech32_polymod(values + [0, 0, 0, 0, 0, 0]) ^ const
return [(polymod >> 5 * (5 - i)) & 31 for i in range(6)]
def bech32_encode(encoding, hrp, data):
"""Compute a Bech32 or Bech32m string given HRP and data values."""
combined = data + bech32_create_checksum(encoding, hrp, data)
return hrp + '1' + ''.join([CHARSET[d] for d in combined])
def bech32_decode(bech):
"""Validate a Bech32/Bech32m string, and determine HRP and data."""
if ((any(ord(x) < 33 or ord(x) > 126 for x in bech)) or
(bech.lower() != bech and bech.upper() != bech)):
return (None, None, None)
bech = bech.lower()
pos = bech.rfind('1')
if pos < 1 or pos + 7 > len(bech) or len(bech) > 90:
return (None, None, None)
if not all(x in CHARSET for x in bech[pos+1:]):
return (None, None, None)
hrp = bech[:pos]
data = [CHARSET.find(x) for x in bech[pos+1:]]
encoding = bech32_verify_checksum(hrp, data)
if encoding is None:
return (None, None, None)
return (encoding, hrp, data[:-6])
def convertbits(data, frombits, tobits, pad=True):
"""General power-of-2 base conversion."""
acc = 0
bits = 0
ret = []
maxv = (1 << tobits) - 1
max_acc = (1 << (frombits + tobits - 1)) - 1
for value in data:
if value < 0 or (value >> frombits):
return None
acc = ((acc << frombits) | value) & max_acc
bits += frombits
while bits >= tobits:
bits -= tobits
ret.append((acc >> bits) & maxv)
if pad:
if bits:
ret.append((acc << (tobits - bits)) & maxv)
elif bits >= frombits or ((acc << (tobits - bits)) & maxv):
return None
return ret
def decode_segwit_address(hrp, addr):
"""Decode a segwit address."""
encoding, hrpgot, data = bech32_decode(addr)
if hrpgot != hrp:
return (None, None)
decoded = convertbits(data[1:], 5, 8, False)
if decoded is None or len(decoded) < 2 or len(decoded) > 40:
return (None, None)
if data[0] > 16:
return (None, None)
if data[0] == 0 and len(decoded) != 20 and len(decoded) != 32:
return (None, None)
if (data[0] == 0 and encoding != Encoding.BECH32) or (data[0] != 0 and encoding != Encoding.BECH32M):
return (None, None)
return (data[0], decoded)
def encode_segwit_address(hrp, witver, witprog):
"""Encode a segwit address."""
encoding = Encoding.BECH32 if witver == 0 else Encoding.BECH32M
ret = bech32_encode(encoding, hrp, [witver] + convertbits(witprog, 8, 5))
if decode_segwit_address(hrp, ret) == (None, None):
return None
return ret
class TestFrameworkScript(unittest.TestCase):
def test_segwit_encode_decode(self):
def test_python_bech32(addr):
hrp = addr[:4]
self.assertEqual(hrp, "bcrt")
(witver, witprog) = decode_segwit_address(hrp, addr)
self.assertEqual(encode_segwit_address(hrp, witver, witprog), addr)
# P2WPKH
test_python_bech32('bcrt1qthmht0k2qnh3wy7336z05lu2km7emzfpm3wg46')
# P2WSH
test_python_bech32('bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj')
test_python_bech32('bcrt1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqseac85')
# P2TR
test_python_bech32('bcrt1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqc8gma6')
|
const TreeTraversing = require('./../../common/tree-traversing');
const traversing = new TreeTraversing();
const BaseChecker = require('./../base-checker');
class ExternalCallChecker extends BaseChecker {
constructor(reporter) {
super(reporter);
}
exitExpression(ctx) {
this.validateSend(ctx);
this.validateCallValue(ctx);
}
validateSend(ctx) {
if (ctx.getText().startsWith('send(')) {
const hasVarDeclaration = traversing.statementNotContains(ctx, 'VariableDeclarationContext');
const hasIfStatement = traversing.statementNotContains(ctx, 'IfStatementContext');
if (!hasIfStatement && !hasVarDeclaration) {
this.error(ctx, 'check-send-result', 'Check result of "send" call');
}
}
}
validateCallValue(ctx) {
if (ctx.getText().includes('.call.value(')) {
this.error(ctx, 'avoid-call-value', 'Avoid to use ".call.value()()"');
}
}
}
module.exports = ExternalCallChecker;
|
# JavascriptベースのレーティングバトルのログにBattleStatusを追加する
import argparse
import json
import re
import numpy as np
from pokeai.util import json_load, pickle_load, ROOT_DIR, DATASET_DIR, json_dump
from collections import defaultdict
from pokeai.sim.battle_stream_processor import BattleStreamProcessor
from pokeai.ai.action_policy import ActionPolicy
from pokeai.ai.common import get_possible_actions
players = ["p1", "p2"]
def _extractUpdateForSide(side: str, chunk_data: str):
# Pokemon-Showdown/sim/battle.ts の移植
if side == 'omniscient':
# 全データ取得
return re.sub('\n\\|split\\|p[1234]\n([^\n]*)\n(?:[^\n]*)', '\n\\1', chunk_data)
# 各プレイヤーごとの秘密情報を、他のプレイヤー向けには削除する
# '|split|p1'の次の行は、p1にのみ送る(他のプレイヤーの場合削除)
if side.startswith('p'):
chunk_data = re.sub('\n\\|split\\|' + side + '\n([^\n]*)\n(?:[^\n]*)', '\n\\1', chunk_data)
return re.sub('\n\\|split\\|(?:[^\n]*)\n(?:[^\n]*)\n\n?', '\n', chunk_data) # 対象でない秘密データ削除
def process_one_battle(orig_log):
bsps = {k: BattleStreamProcessor() for k in players}
for k, bsp in bsps.items():
bsp.set_policy(ActionPolicy()) # 実際にactionを要求するとNotImplementedになる
bsp.start_battle(k, orig_log["agents"][k]["party"])
for entry in orig_log["events"]:
if entry["type"] == "choice":
player = entry["choice"]["player"]
pas = get_possible_actions(bsps[player], entry["choice"]["request"])
entry["choice"]["battle_status"] = json.loads(bsps[player].battle_status.json_dumps())
entry["choice"]["possible_actions"] = [pa._asdict() for pa in pas]
slog = entry["choice"].get("searchLog")
q_func = None
# 思考経過ログから、q関数相当の値を抽出
if isinstance(slog, list) and len(slog) > 0:
slogentry = slog[-1]
if slogentry["type"] == "MC":
q_values = [wr["winrate"] for wr in slogentry["payload"]["winrates"]]
action = int(np.argmax(q_values))
q_func = {"q_func": q_values, "action": action}
entry["choice"]["q_func"] = q_func
elif entry["type"] == "update":
for k, bsp in bsps.items():
bsp.process_chunk("update", _extractUpdateForSide(k, "\n".join(entry["update"])))
return orig_log
def main():
parser = argparse.ArgumentParser()
parser.add_argument("src")
parser.add_argument("dst")
args = parser.parse_args()
with open(args.src) as f:
with open(args.dst, "w") as fw:
for line in f:
assigned = process_one_battle(json.loads(line))
fw.write(json.dumps(assigned) + "\n")
if __name__ == '__main__':
main()
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
function _templateObject() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-weight: 400;\n font-size: 1rem;\n line-height: 1.25;\n display: block;\n color: #6f777b;\n @media print {\n font-family: sans-serif;\n }\n @media (min-width: 40.0625em) {\n font-size: 1.1875rem;\n line-height: 1.31579;\n }\n @media print {\n font-size: 14pt;\n line-height: 1.15;\n }\n margin-top: 0px;\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
var StyledSpan = _styledComponents["default"].span(_templateObject());
var CaptionM = function CaptionM(_ref) {
var children = _ref.children;
return _react["default"].createElement(StyledSpan, null, children !== undefined ? children : _react["default"].createElement(_react["default"].Fragment, null, "Example text"));
};
var _default = CaptionM;
exports["default"] = _default;
|
import torch
import torch.nn as nn
from pointnet import PointNetVanilla
class pointcloud_encoder(nn.Module):
def __init__(self,mlp_dims,fc_dims,mlp_dolastReLU=False):
assert(mlp_dims[-1]==fc_dims[0])
super(pointcloud_encoder,self).__init__()
self.PointNet=PointNetVanilla(mlp_dims,fc_dims,mlp_dolastReLU)
def forward(self,x):
# B*N*3
f=self.PointNet.forward(x) # B*K
f=f.unsqueeze(1) # B*1*512
return f
if __name__ == '__main__':
b,n=64,1024
x = torch.ones((b,n,3))
MLP_dims = (3, 64, 64, 64, 128, 1024)
FC_dims = (1024, 512, 512)
model=pointcloud_encoder(MLP_dims,FC_dims)
out=model(x)
print(out.shape)
|
import React, { useEffect, useState } from "react";
import Forecast from "./Forecast";
import HourlyWeather from "./HourlyWeather";
import moment from "moment";
function WeatherDetails({ weather }) {
const [defaultBtn, setDefaultBtn] = useState("hourly-btn");
console.log(weather);
//higher order function that first checks which button is being clicked, and arrow function updates the defaultBtn to the which is selected.
const onBtnClick = (which) => {
return () => {
setDefaultBtn(which);
};
};
// causes a re-render when location.name updates, and it updates defaultBtn back to Hourly
useEffect(() => {
setDefaultBtn("hourly-btn");
}, [weather.location.name]);
return (
<div className="container lg:space-x-4 2xl:space-x-16 lg:inline-flex text-sm md:text-md xl:text-lg ">
<div
className="container lg:w-3/5 text-blue-800 border-2 border-white dark:text-white border-opacity-25 shadow-md bg-indigo-200 dark:bg-gray-500 dark:border-gray-600
dark:border-opacity-25 rounded-lg p-8 space-y-2 mb-6 text-center"
>
<p className="font-bold">
{weather.location.name}, {weather.location.country}
</p>
<p>{weather.current.condition.text}</p>
<p>
{moment(weather.location.localtime, "YYYY-MM-DD H:mm").format(
"LLLL "
)}
</p>
<div className="grid grid-rows-2 space-y-2">
<div className="flex inline-flex justify-center space-x-4">
<div>
<span className="font-bold"> Current: </span>
<p className="text-center">
{Math.round(weather.current.temp_f)}°F /{" "}
{Math.round(weather.current.temp_c)}°C
</p>
</div>
<div>
<span className="font-bold">Feels like:</span>
<p className="text-center">
{Math.round(weather.current.feelslike_f)}°F /{" "}
{Math.round(weather.current.feelslike_c)}°C
</p>
</div>
</div>
<div className="flex inline-flex justify-center space-x-4">
<div>
<span className="font-bold">Humidity:</span>
<p>{weather.current.humidity}%</p>
</div>
<div>
<span className="font-bold ">Wind:</span>
<p>
{weather.current.wind_dir}{" "}
{Math.round(weather.current.wind_mph)} mph
</p>
</div>
</div>
</div>
<div className="flex flex-row justify-center pt-4 space-x-8">
<button
className="py-2 px-2 font-semibold rounded-lg shadow-md text-white bg-indigo-600 bg-opacity-25 hover:bg-indigo-200 active:bg-indigo-300 dark:bg-gray-300 dark:bg-opacity-25 dark:hover:bg-gray-200 dark:hover:bg-opacity-25 dark:active:bg-gray-300 text-center sm:text-left focus:outline-none "
type="submit"
onClick={onBtnClick("hourly-btn")}
>
Hourly
</button>
<button
className="py-2 px-2 font-semibold rounded-lg shadow-md text-white bg-indigo-600 bg-opacity-25 hover:bg-indigo-200 active:bg-indigo-300
dark:bg-gray-300 dark:bg-opacity-25 dark:hover:bg-gray-200 dark:hover:bg-opacity-25 dark:active:bg-gray-300 text-center sm:text-left focus:outline-none"
type="submit"
onClick={onBtnClick("day-btn")}
>
3 Day
</button>
</div>
</div>
{defaultBtn === "hourly-btn" ? <HourlyWeather weather={weather} /> : null}
{defaultBtn === "day-btn" ? <Forecast weather={weather} /> : null}
</div>
);
}
export default WeatherDetails;
|
(this["webpackJsonp@visa/vds-react"]=this["webpackJsonp@visa/vds-react"]||[]).push([[86],{1598:function(s,t,i){s.exports=i.p+"static/media/illustration-hero-notebook-pencils-light-bulb.4e33c33a.svg"}}]);
//# sourceMappingURL=86.aaacd842.chunk.js.map
|
/*global define*/
define([
'./Cartesian3',
'./Cartographic',
'./defaultValue',
'./defined',
'./DeveloperError',
'./Ellipsoid',
'./GeographicProjection',
'./Intersect',
'./Interval',
'./Matrix3',
'./Matrix4',
'./Rectangle'
], function(
Cartesian3,
Cartographic,
defaultValue,
defined,
DeveloperError,
Ellipsoid,
GeographicProjection,
Intersect,
Interval,
Matrix3,
Matrix4,
Rectangle) {
'use strict';
/**
* A bounding sphere with a center and a radius.
* @alias BoundingSphere
* @constructor
*
* @param {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere.
* @param {Number} [radius=0.0] The radius of the bounding sphere.
*
* @see AxisAlignedBoundingBox
* @see BoundingRectangle
* @see Packable
*/
function BoundingSphere(center, radius) {
/**
* The center point of the sphere.
* @type {Cartesian3}
* @default {@link Cartesian3.ZERO}
*/
this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));
/**
* The radius of the sphere.
* @type {Number}
* @default 0.0
*/
this.radius = defaultValue(radius, 0.0);
}
var fromPointsXMin = new Cartesian3();
var fromPointsYMin = new Cartesian3();
var fromPointsZMin = new Cartesian3();
var fromPointsXMax = new Cartesian3();
var fromPointsYMax = new Cartesian3();
var fromPointsZMax = new Cartesian3();
var fromPointsCurrentPos = new Cartesian3();
var fromPointsScratch = new Cartesian3();
var fromPointsRitterCenter = new Cartesian3();
var fromPointsMinBoxPt = new Cartesian3();
var fromPointsMaxBoxPt = new Cartesian3();
var fromPointsNaiveCenterScratch = new Cartesian3();
/**
* Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.
* The bounding sphere is computed by running two algorithms, a naive algorithm and
* Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.
*
* @param {Cartesian3[]} positions An array of points that the bounding sphere will enclose. Each point must have <code>x</code>, <code>y</code>, and <code>z</code> properties.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
*
* @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}
*/
BoundingSphere.fromPoints = function(positions, result) {
if (!defined(result)) {
result = new BoundingSphere();
}
if (!defined(positions) || positions.length === 0) {
result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);
result.radius = 0.0;
return result;
}
var currentPos = Cartesian3.clone(positions[0], fromPointsCurrentPos);
var xMin = Cartesian3.clone(currentPos, fromPointsXMin);
var yMin = Cartesian3.clone(currentPos, fromPointsYMin);
var zMin = Cartesian3.clone(currentPos, fromPointsZMin);
var xMax = Cartesian3.clone(currentPos, fromPointsXMax);
var yMax = Cartesian3.clone(currentPos, fromPointsYMax);
var zMax = Cartesian3.clone(currentPos, fromPointsZMax);
var numPositions = positions.length;
for (var i = 1; i < numPositions; i++) {
Cartesian3.clone(positions[i], currentPos);
var x = currentPos.x;
var y = currentPos.y;
var z = currentPos.z;
// Store points containing the the smallest and largest components
if (x < xMin.x) {
Cartesian3.clone(currentPos, xMin);
}
if (x > xMax.x) {
Cartesian3.clone(currentPos, xMax);
}
if (y < yMin.y) {
Cartesian3.clone(currentPos, yMin);
}
if (y > yMax.y) {
Cartesian3.clone(currentPos, yMax);
}
if (z < zMin.z) {
Cartesian3.clone(currentPos, zMin);
}
if (z > zMax.z) {
Cartesian3.clone(currentPos, zMax);
}
}
// Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).
var xSpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(xMax, xMin, fromPointsScratch));
var ySpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(yMax, yMin, fromPointsScratch));
var zSpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(zMax, zMin, fromPointsScratch));
// Set the diameter endpoints to the largest span.
var diameter1 = xMin;
var diameter2 = xMax;
var maxSpan = xSpan;
if (ySpan > maxSpan) {
maxSpan = ySpan;
diameter1 = yMin;
diameter2 = yMax;
}
if (zSpan > maxSpan) {
maxSpan = zSpan;
diameter1 = zMin;
diameter2 = zMax;
}
// Calculate the center of the initial sphere found by Ritter's algorithm
var ritterCenter = fromPointsRitterCenter;
ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
// Calculate the radius of the initial sphere found by Ritter's algorithm
var radiusSquared = Cartesian3.magnitudeSquared(Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch));
var ritterRadius = Math.sqrt(radiusSquared);
// Find the center of the sphere found using the Naive method.
var minBoxPt = fromPointsMinBoxPt;
minBoxPt.x = xMin.x;
minBoxPt.y = yMin.y;
minBoxPt.z = zMin.z;
var maxBoxPt = fromPointsMaxBoxPt;
maxBoxPt.x = xMax.x;
maxBoxPt.y = yMax.y;
maxBoxPt.z = zMax.z;
var naiveCenter = Cartesian3.multiplyByScalar(Cartesian3.add(minBoxPt, maxBoxPt, fromPointsScratch), 0.5, fromPointsNaiveCenterScratch);
// Begin 2nd pass to find naive radius and modify the ritter sphere.
var naiveRadius = 0;
for (i = 0; i < numPositions; i++) {
Cartesian3.clone(positions[i], currentPos);
// Find the furthest point from the naive center to calculate the naive radius.
var r = Cartesian3.magnitude(Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch));
if (r > naiveRadius) {
naiveRadius = r;
}
// Make adjustments to the Ritter Sphere to include all points.
var oldCenterToPointSquared = Cartesian3.magnitudeSquared(Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch));
if (oldCenterToPointSquared > radiusSquared) {
var oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
// Calculate new radius to include the point that lies outside
ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
radiusSquared = ritterRadius * ritterRadius;
// Calculate center of new Ritter sphere
var oldToNew = oldCenterToPoint - ritterRadius;
ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
}
}
if (ritterRadius < naiveRadius) {
Cartesian3.clone(ritterCenter, result.center);
result.radius = ritterRadius;
} else {
Cartesian3.clone(naiveCenter, result.center);
result.radius = naiveRadius;
}
return result;
};
var defaultProjection = new GeographicProjection();
var fromRectangle2DLowerLeft = new Cartesian3();
var fromRectangle2DUpperRight = new Cartesian3();
var fromRectangle2DSouthwest = new Cartographic();
var fromRectangle2DNortheast = new Cartographic();
/**
* Computes a bounding sphere from an rectangle projected in 2D.
*
* @param {Rectangle} rectangle The rectangle around which to create a bounding sphere.
* @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.fromRectangle2D = function(rectangle, projection, result) {
return BoundingSphere.fromRectangleWithHeights2D(rectangle, projection, 0.0, 0.0, result);
};
/**
* Computes a bounding sphere from an rectangle projected in 2D. The bounding sphere accounts for the
* object's minimum and maximum heights over the rectangle.
*
* @param {Rectangle} rectangle The rectangle around which to create a bounding sphere.
* @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.
* @param {Number} [minimumHeight=0.0] The minimum height over the rectangle.
* @param {Number} [maximumHeight=0.0] The maximum height over the rectangle.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.fromRectangleWithHeights2D = function(rectangle, projection, minimumHeight, maximumHeight, result) {
if (!defined(result)) {
result = new BoundingSphere();
}
if (!defined(rectangle)) {
result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);
result.radius = 0.0;
return result;
}
projection = defaultValue(projection, defaultProjection);
Rectangle.southwest(rectangle, fromRectangle2DSouthwest);
fromRectangle2DSouthwest.height = minimumHeight;
Rectangle.northeast(rectangle, fromRectangle2DNortheast);
fromRectangle2DNortheast.height = maximumHeight;
var lowerLeft = projection.project(fromRectangle2DSouthwest, fromRectangle2DLowerLeft);
var upperRight = projection.project(fromRectangle2DNortheast, fromRectangle2DUpperRight);
var width = upperRight.x - lowerLeft.x;
var height = upperRight.y - lowerLeft.y;
var elevation = upperRight.z - lowerLeft.z;
result.radius = Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;
var center = result.center;
center.x = lowerLeft.x + width * 0.5;
center.y = lowerLeft.y + height * 0.5;
center.z = lowerLeft.z + elevation * 0.5;
return result;
};
var fromRectangle3DScratch = [];
/**
* Computes a bounding sphere from an rectangle in 3D. The bounding sphere is created using a subsample of points
* on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
*
* @param {Rectangle} rectangle The valid rectangle used to create a bounding sphere.
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.
* @param {Number} [surfaceHeight=0.0] The height above the surface of the ellipsoid.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.fromRectangle3D = function(rectangle, ellipsoid, surfaceHeight, result) {
ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
surfaceHeight = defaultValue(surfaceHeight, 0.0);
var positions;
if (defined(rectangle)) {
positions = Rectangle.subsample(rectangle, ellipsoid, surfaceHeight, fromRectangle3DScratch);
}
return BoundingSphere.fromPoints(positions, result);
};
/**
* Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
* stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two
* algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
* ensure a tight fit.
*
* @param {Number[]} positions An array of points that the bounding sphere will enclose. Each point
* is formed from three elements in the array in the order X, Y, Z.
* @param {Cartesian3} [center=Cartesian3.ZERO] The position to which the positions are relative, which need not be the
* origin of the coordinate system. This is useful when the positions are to be used for
* relative-to-center (RTC) rendering.
* @param {Number} [stride=3] The number of array elements per vertex. It must be at least 3, but it may
* be higher. Regardless of the value of this parameter, the X coordinate of the first position
* is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index
* 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If
* the stride is 5, however, two array elements are skipped and the next position begins at array
* index 5.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
*
* @example
* // Compute the bounding sphere from 3 positions, each specified relative to a center.
* // In addition to the X, Y, and Z coordinates, the points array contains two additional
* // elements per point which are ignored for the purpose of computing the bounding sphere.
* var center = new Cesium.Cartesian3(1.0, 2.0, 3.0);
* var points = [1.0, 2.0, 3.0, 0.1, 0.2,
* 4.0, 5.0, 6.0, 0.1, 0.2,
* 7.0, 8.0, 9.0, 0.1, 0.2];
* var sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);
*
* @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}
*/
BoundingSphere.fromVertices = function(positions, center, stride, result) {
if (!defined(result)) {
result = new BoundingSphere();
}
if (!defined(positions) || positions.length === 0) {
result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);
result.radius = 0.0;
return result;
}
center = defaultValue(center, Cartesian3.ZERO);
stride = defaultValue(stride, 3);
//>>includeStart('debug', pragmas.debug);
if (stride < 3) {
throw new DeveloperError('stride must be 3 or greater.');
}
//>>includeEnd('debug');
var currentPos = fromPointsCurrentPos;
currentPos.x = positions[0] + center.x;
currentPos.y = positions[1] + center.y;
currentPos.z = positions[2] + center.z;
var xMin = Cartesian3.clone(currentPos, fromPointsXMin);
var yMin = Cartesian3.clone(currentPos, fromPointsYMin);
var zMin = Cartesian3.clone(currentPos, fromPointsZMin);
var xMax = Cartesian3.clone(currentPos, fromPointsXMax);
var yMax = Cartesian3.clone(currentPos, fromPointsYMax);
var zMax = Cartesian3.clone(currentPos, fromPointsZMax);
var numElements = positions.length;
for (var i = 0; i < numElements; i += stride) {
var x = positions[i] + center.x;
var y = positions[i + 1] + center.y;
var z = positions[i + 2] + center.z;
currentPos.x = x;
currentPos.y = y;
currentPos.z = z;
// Store points containing the the smallest and largest components
if (x < xMin.x) {
Cartesian3.clone(currentPos, xMin);
}
if (x > xMax.x) {
Cartesian3.clone(currentPos, xMax);
}
if (y < yMin.y) {
Cartesian3.clone(currentPos, yMin);
}
if (y > yMax.y) {
Cartesian3.clone(currentPos, yMax);
}
if (z < zMin.z) {
Cartesian3.clone(currentPos, zMin);
}
if (z > zMax.z) {
Cartesian3.clone(currentPos, zMax);
}
}
// Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).
var xSpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(xMax, xMin, fromPointsScratch));
var ySpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(yMax, yMin, fromPointsScratch));
var zSpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(zMax, zMin, fromPointsScratch));
// Set the diameter endpoints to the largest span.
var diameter1 = xMin;
var diameter2 = xMax;
var maxSpan = xSpan;
if (ySpan > maxSpan) {
maxSpan = ySpan;
diameter1 = yMin;
diameter2 = yMax;
}
if (zSpan > maxSpan) {
maxSpan = zSpan;
diameter1 = zMin;
diameter2 = zMax;
}
// Calculate the center of the initial sphere found by Ritter's algorithm
var ritterCenter = fromPointsRitterCenter;
ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
// Calculate the radius of the initial sphere found by Ritter's algorithm
var radiusSquared = Cartesian3.magnitudeSquared(Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch));
var ritterRadius = Math.sqrt(radiusSquared);
// Find the center of the sphere found using the Naive method.
var minBoxPt = fromPointsMinBoxPt;
minBoxPt.x = xMin.x;
minBoxPt.y = yMin.y;
minBoxPt.z = zMin.z;
var maxBoxPt = fromPointsMaxBoxPt;
maxBoxPt.x = xMax.x;
maxBoxPt.y = yMax.y;
maxBoxPt.z = zMax.z;
var naiveCenter = Cartesian3.multiplyByScalar(Cartesian3.add(minBoxPt, maxBoxPt, fromPointsScratch), 0.5, fromPointsNaiveCenterScratch);
// Begin 2nd pass to find naive radius and modify the ritter sphere.
var naiveRadius = 0;
for (i = 0; i < numElements; i += stride) {
currentPos.x = positions[i] + center.x;
currentPos.y = positions[i + 1] + center.y;
currentPos.z = positions[i + 2] + center.z;
// Find the furthest point from the naive center to calculate the naive radius.
var r = Cartesian3.magnitude(Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch));
if (r > naiveRadius) {
naiveRadius = r;
}
// Make adjustments to the Ritter Sphere to include all points.
var oldCenterToPointSquared = Cartesian3.magnitudeSquared(Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch));
if (oldCenterToPointSquared > radiusSquared) {
var oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
// Calculate new radius to include the point that lies outside
ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
radiusSquared = ritterRadius * ritterRadius;
// Calculate center of new Ritter sphere
var oldToNew = oldCenterToPoint - ritterRadius;
ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
}
}
if (ritterRadius < naiveRadius) {
Cartesian3.clone(ritterCenter, result.center);
result.radius = ritterRadius;
} else {
Cartesian3.clone(naiveCenter, result.center);
result.radius = naiveRadius;
}
return result;
};
/**
* Computes a tight-fitting bounding sphere enclosing a list of {@link EncodedCartesian3}s, where the points are
* stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two
* algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
* ensure a tight fit.
*
* @param {Number[]} positionsHigh An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point
* is formed from three elements in the array in the order X, Y, Z.
* @param {Number[]} positionsLow An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point
* is formed from three elements in the array in the order X, Y, Z.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
*
* @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}
*/
BoundingSphere.fromEncodedCartesianVertices = function(positionsHigh, positionsLow, result) {
if (!defined(result)) {
result = new BoundingSphere();
}
if (!defined(positionsHigh) || !defined(positionsLow) || positionsHigh.length !== positionsLow.length || positionsHigh.length === 0) {
result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);
result.radius = 0.0;
return result;
}
var currentPos = fromPointsCurrentPos;
currentPos.x = positionsHigh[0] + positionsLow[0];
currentPos.y = positionsHigh[1] + positionsLow[1];
currentPos.z = positionsHigh[2] + positionsLow[2];
var xMin = Cartesian3.clone(currentPos, fromPointsXMin);
var yMin = Cartesian3.clone(currentPos, fromPointsYMin);
var zMin = Cartesian3.clone(currentPos, fromPointsZMin);
var xMax = Cartesian3.clone(currentPos, fromPointsXMax);
var yMax = Cartesian3.clone(currentPos, fromPointsYMax);
var zMax = Cartesian3.clone(currentPos, fromPointsZMax);
var numElements = positionsHigh.length;
for (var i = 0; i < numElements; i += 3) {
var x = positionsHigh[i] + positionsLow[i];
var y = positionsHigh[i + 1] + positionsLow[i + 1];
var z = positionsHigh[i + 2] + positionsLow[i + 2];
currentPos.x = x;
currentPos.y = y;
currentPos.z = z;
// Store points containing the the smallest and largest components
if (x < xMin.x) {
Cartesian3.clone(currentPos, xMin);
}
if (x > xMax.x) {
Cartesian3.clone(currentPos, xMax);
}
if (y < yMin.y) {
Cartesian3.clone(currentPos, yMin);
}
if (y > yMax.y) {
Cartesian3.clone(currentPos, yMax);
}
if (z < zMin.z) {
Cartesian3.clone(currentPos, zMin);
}
if (z > zMax.z) {
Cartesian3.clone(currentPos, zMax);
}
}
// Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).
var xSpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(xMax, xMin, fromPointsScratch));
var ySpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(yMax, yMin, fromPointsScratch));
var zSpan = Cartesian3.magnitudeSquared(Cartesian3.subtract(zMax, zMin, fromPointsScratch));
// Set the diameter endpoints to the largest span.
var diameter1 = xMin;
var diameter2 = xMax;
var maxSpan = xSpan;
if (ySpan > maxSpan) {
maxSpan = ySpan;
diameter1 = yMin;
diameter2 = yMax;
}
if (zSpan > maxSpan) {
maxSpan = zSpan;
diameter1 = zMin;
diameter2 = zMax;
}
// Calculate the center of the initial sphere found by Ritter's algorithm
var ritterCenter = fromPointsRitterCenter;
ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
// Calculate the radius of the initial sphere found by Ritter's algorithm
var radiusSquared = Cartesian3.magnitudeSquared(Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch));
var ritterRadius = Math.sqrt(radiusSquared);
// Find the center of the sphere found using the Naive method.
var minBoxPt = fromPointsMinBoxPt;
minBoxPt.x = xMin.x;
minBoxPt.y = yMin.y;
minBoxPt.z = zMin.z;
var maxBoxPt = fromPointsMaxBoxPt;
maxBoxPt.x = xMax.x;
maxBoxPt.y = yMax.y;
maxBoxPt.z = zMax.z;
var naiveCenter = Cartesian3.multiplyByScalar(Cartesian3.add(minBoxPt, maxBoxPt, fromPointsScratch), 0.5, fromPointsNaiveCenterScratch);
// Begin 2nd pass to find naive radius and modify the ritter sphere.
var naiveRadius = 0;
for (i = 0; i < numElements; i += 3) {
currentPos.x = positionsHigh[i] + positionsLow[i];
currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];
currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];
// Find the furthest point from the naive center to calculate the naive radius.
var r = Cartesian3.magnitude(Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch));
if (r > naiveRadius) {
naiveRadius = r;
}
// Make adjustments to the Ritter Sphere to include all points.
var oldCenterToPointSquared = Cartesian3.magnitudeSquared(Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch));
if (oldCenterToPointSquared > radiusSquared) {
var oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
// Calculate new radius to include the point that lies outside
ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
radiusSquared = ritterRadius * ritterRadius;
// Calculate center of new Ritter sphere
var oldToNew = oldCenterToPoint - ritterRadius;
ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
}
}
if (ritterRadius < naiveRadius) {
Cartesian3.clone(ritterCenter, result.center);
result.radius = ritterRadius;
} else {
Cartesian3.clone(naiveCenter, result.center);
result.radius = naiveRadius;
}
return result;
};
/**
* Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
* tighly and fully encompases the box.
*
* @param {Cartesian3} [corner] The minimum height over the rectangle.
* @param {Cartesian3} [oppositeCorner] The maximum height over the rectangle.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*
* @example
* // Create a bounding sphere around the unit cube
* var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));
*/
BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(corner) || !defined(oppositeCorner)) {
throw new DeveloperError('corner and oppositeCorner are required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
result = new BoundingSphere();
}
var center = result.center;
Cartesian3.add(corner, oppositeCorner, center);
Cartesian3.multiplyByScalar(center, 0.5, center);
result.radius = Cartesian3.distance(center, oppositeCorner);
return result;
};
/**
* Creates a bounding sphere encompassing an ellipsoid.
*
* @param {Ellipsoid} ellipsoid The ellipsoid around which to create a bounding sphere.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*
* @example
* var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
*/
BoundingSphere.fromEllipsoid = function(ellipsoid, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(ellipsoid)) {
throw new DeveloperError('ellipsoid is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
result = new BoundingSphere();
}
Cartesian3.clone(Cartesian3.ZERO, result.center);
result.radius = ellipsoid.maximumRadius;
return result;
};
var fromBoundingSpheresScratch = new Cartesian3();
/**
* Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.
*
* @param {BoundingSphere[]} boundingSpheres The array of bounding spheres.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.fromBoundingSpheres = function(boundingSpheres, result) {
if (!defined(result)) {
result = new BoundingSphere();
}
if (!defined(boundingSpheres) || boundingSpheres.length === 0) {
result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);
result.radius = 0.0;
return result;
}
var length = boundingSpheres.length;
if (length === 1) {
return BoundingSphere.clone(boundingSpheres[0], result);
}
if (length === 2) {
return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);
}
var positions = [];
for (var i = 0; i < length; i++) {
positions.push(boundingSpheres[i].center);
}
result = BoundingSphere.fromPoints(positions, result);
var center = result.center;
var radius = result.radius;
for (i = 0; i < length; i++) {
var tmp = boundingSpheres[i];
radius = Math.max(radius, Cartesian3.distance(center, tmp.center, fromBoundingSpheresScratch) + tmp.radius);
}
result.radius = radius;
return result;
};
var fromOrientedBoundingBoxScratchU = new Cartesian3();
var fromOrientedBoundingBoxScratchV = new Cartesian3();
var fromOrientedBoundingBoxScratchW = new Cartesian3();
/**
* Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.
*
* @param {OrientedBoundingBox} orientedBoundingBox The oriented bounding box.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.fromOrientedBoundingBox = function(orientedBoundingBox, result) {
if (!defined(result)) {
result = new BoundingSphere();
}
var halfAxes = orientedBoundingBox.halfAxes;
var u = Matrix3.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);
var v = Matrix3.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);
var w = Matrix3.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);
var uHalf = Cartesian3.magnitude(u);
var vHalf = Cartesian3.magnitude(v);
var wHalf = Cartesian3.magnitude(w);
result.center = Cartesian3.clone(orientedBoundingBox.center, result.center);
result.radius = Math.max(uHalf, vHalf, wHalf);
return result;
};
/**
* Duplicates a BoundingSphere instance.
*
* @param {BoundingSphere} sphere The bounding sphere to duplicate.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)
*/
BoundingSphere.clone = function(sphere, result) {
if (!defined(sphere)) {
return undefined;
}
if (!defined(result)) {
return new BoundingSphere(sphere.center, sphere.radius);
}
result.center = Cartesian3.clone(sphere.center, result.center);
result.radius = sphere.radius;
return result;
};
/**
* The number of elements used to pack the object into an array.
* @type {Number}
*/
BoundingSphere.packedLength = 4;
/**
* Stores the provided instance into the provided array.
*
* @param {BoundingSphere} value The value to pack.
* @param {Number[]} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @returns {Number[]} The array that was packed into
*/
BoundingSphere.pack = function(value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
if (!defined(value)) {
throw new DeveloperError('value is required');
}
if (!defined(array)) {
throw new DeveloperError('array is required');
}
//>>includeEnd('debug');
startingIndex = defaultValue(startingIndex, 0);
var center = value.center;
array[startingIndex++] = center.x;
array[startingIndex++] = center.y;
array[startingIndex++] = center.z;
array[startingIndex] = value.radius;
return array;
};
/**
* Retrieves an instance from a packed array.
*
* @param {Number[]} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {BoundingSphere} [result] The object into which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
*/
BoundingSphere.unpack = function(array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(array)) {
throw new DeveloperError('array is required');
}
//>>includeEnd('debug');
startingIndex = defaultValue(startingIndex, 0);
if (!defined(result)) {
result = new BoundingSphere();
}
var center = result.center;
center.x = array[startingIndex++];
center.y = array[startingIndex++];
center.z = array[startingIndex++];
result.radius = array[startingIndex];
return result;
};
var unionScratch = new Cartesian3();
var unionScratchCenter = new Cartesian3();
/**
* Computes a bounding sphere that contains both the left and right bounding spheres.
*
* @param {BoundingSphere} left A sphere to enclose in a bounding sphere.
* @param {BoundingSphere} right A sphere to enclose in a bounding sphere.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.union = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required.');
}
if (!defined(right)) {
throw new DeveloperError('right is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
result = new BoundingSphere();
}
var leftCenter = left.center;
var leftRadius = left.radius;
var rightCenter = right.center;
var rightRadius = right.radius;
var toRightCenter = Cartesian3.subtract(rightCenter, leftCenter, unionScratch);
var centerSeparation = Cartesian3.magnitude(toRightCenter);
if (leftRadius >= (centerSeparation + rightRadius)) {
// Left sphere wins.
left.clone(result);
return result;
}
if (rightRadius >= (centerSeparation + leftRadius)) {
// Right sphere wins.
right.clone(result);
return result;
}
// There are two tangent points, one on far side of each sphere.
var halfDistanceBetweenTangentPoints = (leftRadius + centerSeparation + rightRadius) * 0.5;
// Compute the center point halfway between the two tangent points.
var center = Cartesian3.multiplyByScalar(toRightCenter,
(-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation, unionScratchCenter);
Cartesian3.add(center, leftCenter, center);
Cartesian3.clone(center, result.center);
result.radius = halfDistanceBetweenTangentPoints;
return result;
};
var expandScratch = new Cartesian3();
/**
* Computes a bounding sphere by enlarging the provided sphere to contain the provided point.
*
* @param {BoundingSphere} sphere A sphere to expand.
* @param {Cartesian3} point A point to enclose in a bounding sphere.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.expand = function(sphere, point, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
if (!defined(point)) {
throw new DeveloperError('point is required.');
}
//>>includeEnd('debug');
result = BoundingSphere.clone(sphere, result);
var radius = Cartesian3.magnitude(Cartesian3.subtract(point, result.center, expandScratch));
if (radius > result.radius) {
result.radius = radius;
}
return result;
};
/**
* Determines which side of a plane a sphere is located.
*
* @param {BoundingSphere} sphere The bounding sphere to test.
* @param {Plane} plane The plane to test against.
* @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
* on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
* intersects the plane.
*/
BoundingSphere.intersectPlane = function(sphere, plane) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
if (!defined(plane)) {
throw new DeveloperError('plane is required.');
}
//>>includeEnd('debug');
var center = sphere.center;
var radius = sphere.radius;
var normal = plane.normal;
var distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;
if (distanceToPlane < -radius) {
// The center point is negative side of the plane normal
return Intersect.OUTSIDE;
} else if (distanceToPlane < radius) {
// The center point is positive side of the plane, but radius extends beyond it; partial overlap
return Intersect.INTERSECTING;
}
return Intersect.INSIDE;
};
/**
* Applies a 4x4 affine transformation matrix to a bounding sphere.
*
* @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.
* @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.transform = function(sphere, transform, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
if (!defined(transform)) {
throw new DeveloperError('transform is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
result = new BoundingSphere();
}
result.center = Matrix4.multiplyByPoint(transform, sphere.center, result.center);
result.radius = Matrix4.getMaximumScale(transform) * sphere.radius;
return result;
};
var distanceSquaredToScratch = new Cartesian3();
/**
* Computes the estimated distance squared from the closest point on a bounding sphere to a point.
*
* @param {BoundingSphere} sphere The sphere.
* @param {Cartesian3} cartesian The point
* @returns {Number} The estimated distance squared from the bounding sphere to the point.
*
* @example
* // Sort bounding spheres from back to front
* spheres.sort(function(a, b) {
* return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);
* });
*/
BoundingSphere.distanceSquaredTo = function(sphere, cartesian) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required.');
}
//>>includeEnd('debug');
var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch);
return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius;
};
/**
* Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale
* The transformation matrix is not verified to have a uniform scale of 1.
* This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.
*
* @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.
* @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*
* @example
* var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);
* var boundingSphere = new Cesium.BoundingSphere();
* var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);
*/
BoundingSphere.transformWithoutScale = function(sphere, transform, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
if (!defined(transform)) {
throw new DeveloperError('transform is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
result = new BoundingSphere();
}
result.center = Matrix4.multiplyByPoint(transform, sphere.center, result.center);
result.radius = sphere.radius;
return result;
};
var scratchCartesian3 = new Cartesian3();
/**
* The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
* plus/minus the radius of the bounding sphere.
* <br>
* If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
* closest and farthest planes from position that intersect the bounding sphere.
*
* @param {BoundingSphere} sphere The bounding sphere to calculate the distance to.
* @param {Cartesian3} position The position to calculate the distance from.
* @param {Cartesian3} direction The direction from position.
* @param {Interval} [result] A Interval to store the nearest and farthest distances.
* @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.
*/
BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
if (!defined(position)) {
throw new DeveloperError('position is required.');
}
if (!defined(direction)) {
throw new DeveloperError('direction is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
result = new Interval();
}
var toCenter = Cartesian3.subtract(sphere.center, position, scratchCartesian3);
var mag = Cartesian3.dot(direction, toCenter);
result.start = mag - sphere.radius;
result.stop = mag + sphere.radius;
return result;
};
var projectTo2DNormalScratch = new Cartesian3();
var projectTo2DEastScratch = new Cartesian3();
var projectTo2DNorthScratch = new Cartesian3();
var projectTo2DWestScratch = new Cartesian3();
var projectTo2DSouthScratch = new Cartesian3();
var projectTo2DCartographicScratch = new Cartographic();
var projectTo2DPositionsScratch = new Array(8);
for (var n = 0; n < 8; ++n) {
projectTo2DPositionsScratch[n] = new Cartesian3();
}
var projectTo2DProjection = new GeographicProjection();
/**
* Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.
*
* @param {BoundingSphere} sphere The bounding sphere to transform to 2D.
* @param {Object} [projection=GeographicProjection] The projection to 2D.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.projectTo2D = function(sphere, projection, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
//>>includeEnd('debug');
projection = defaultValue(projection, projectTo2DProjection);
var ellipsoid = projection.ellipsoid;
var center = sphere.center;
var radius = sphere.radius;
var normal = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);
var east = Cartesian3.cross(Cartesian3.UNIT_Z, normal, projectTo2DEastScratch);
Cartesian3.normalize(east, east);
var north = Cartesian3.cross(normal, east, projectTo2DNorthScratch);
Cartesian3.normalize(north, north);
Cartesian3.multiplyByScalar(normal, radius, normal);
Cartesian3.multiplyByScalar(north, radius, north);
Cartesian3.multiplyByScalar(east, radius, east);
var south = Cartesian3.negate(north, projectTo2DSouthScratch);
var west = Cartesian3.negate(east, projectTo2DWestScratch);
var positions = projectTo2DPositionsScratch;
// top NE corner
var corner = positions[0];
Cartesian3.add(normal, north, corner);
Cartesian3.add(corner, east, corner);
// top NW corner
corner = positions[1];
Cartesian3.add(normal, north, corner);
Cartesian3.add(corner, west, corner);
// top SW corner
corner = positions[2];
Cartesian3.add(normal, south, corner);
Cartesian3.add(corner, west, corner);
// top SE corner
corner = positions[3];
Cartesian3.add(normal, south, corner);
Cartesian3.add(corner, east, corner);
Cartesian3.negate(normal, normal);
// bottom NE corner
corner = positions[4];
Cartesian3.add(normal, north, corner);
Cartesian3.add(corner, east, corner);
// bottom NW corner
corner = positions[5];
Cartesian3.add(normal, north, corner);
Cartesian3.add(corner, west, corner);
// bottom SW corner
corner = positions[6];
Cartesian3.add(normal, south, corner);
Cartesian3.add(corner, west, corner);
// bottom SE corner
corner = positions[7];
Cartesian3.add(normal, south, corner);
Cartesian3.add(corner, east, corner);
var length = positions.length;
for (var i = 0; i < length; ++i) {
var position = positions[i];
Cartesian3.add(center, position, position);
var cartographic = ellipsoid.cartesianToCartographic(position, projectTo2DCartographicScratch);
projection.project(cartographic, position);
}
result = BoundingSphere.fromPoints(positions, result);
// swizzle center components
center = result.center;
var x = center.x;
var y = center.y;
var z = center.z;
center.x = z;
center.y = x;
center.z = y;
return result;
};
/**
* Determines whether or not a sphere is hidden from view by the occluder.
*
* @param {BoundingSphere} sphere The bounding sphere surrounding the occludee object.
* @param {Occluder} occluder The occluder.
* @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
*/
BoundingSphere.isOccluded = function(sphere, occluder) {
//>>includeStart('debug', pragmas.debug);
if (!defined(sphere)) {
throw new DeveloperError('sphere is required.');
}
if (!defined(occluder)) {
throw new DeveloperError('occluder is required.');
}
//>>includeEnd('debug');
return !occluder.isBoundingSphereVisible(sphere);
};
/**
* Compares the provided BoundingSphere componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {BoundingSphere} [left] The first BoundingSphere.
* @param {BoundingSphere} [right] The second BoundingSphere.
* @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
*/
BoundingSphere.equals = function(left, right) {
return (left === right) ||
((defined(left)) &&
(defined(right)) &&
Cartesian3.equals(left.center, right.center) &&
left.radius === right.radius);
};
/**
* Determines which side of a plane the sphere is located.
*
* @param {Plane} plane The plane to test against.
* @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
* on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
* intersects the plane.
*/
BoundingSphere.prototype.intersectPlane = function(plane) {
return BoundingSphere.intersectPlane(this, plane);
};
/**
* Computes the estimated distance squared from the closest point on a bounding sphere to a point.
*
* @param {Cartesian3} cartesian The point
* @returns {Number} The estimated distance squared from the bounding sphere to the point.
*
* @example
* // Sort bounding spheres from back to front
* spheres.sort(function(a, b) {
* return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
* });
*/
BoundingSphere.prototype.distanceSquaredTo = function(cartesian) {
return BoundingSphere.distanceSquaredTo(this, cartesian);
};
/**
* The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
* plus/minus the radius of the bounding sphere.
* <br>
* If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
* closest and farthest planes from position that intersect the bounding sphere.
*
* @param {Cartesian3} position The position to calculate the distance from.
* @param {Cartesian3} direction The direction from position.
* @param {Interval} [result] A Interval to store the nearest and farthest distances.
* @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.
*/
BoundingSphere.prototype.computePlaneDistances = function(position, direction, result) {
return BoundingSphere.computePlaneDistances(this, position, direction, result);
};
/**
* Determines whether or not a sphere is hidden from view by the occluder.
*
* @param {Occluder} occluder The occluder.
* @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
*/
BoundingSphere.prototype.isOccluded = function(occluder) {
return BoundingSphere.isOccluded(this, occluder);
};
/**
* Compares this BoundingSphere against the provided BoundingSphere componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {BoundingSphere} [right] The right hand side BoundingSphere.
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
BoundingSphere.prototype.equals = function(right) {
return BoundingSphere.equals(this, right);
};
/**
* Duplicates this BoundingSphere instance.
*
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
BoundingSphere.prototype.clone = function(result) {
return BoundingSphere.clone(this, result);
};
return BoundingSphere;
});
|
#!C:\Users\aschuele\PycharmProjects\GenerateJavaDoc\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==19.0.3', 'console_scripts', 'pip3')()
)
|
//render this via backend
window.IEWarningLocalizations ={
msg1: "您正在使用的浏览器是:",
msg2: "您使用的浏览器太过古老,浏览体验将会变得很差,建议您对浏览器进行升级或者更换",
msg2s: "您使用的浏览器还凑和,浏览体验将会有所折扣,建议您对浏览器进行升级或者更换",
msg3: "选择下列主流浏览器,点击浏览器图标进入下载",
vsg: "最新版本:",
br1: "49",
nme1: "谷歌(Chrome)",
br2: "54",
nme2: "火狐(Firefox)",
br3: "9",
nme3: "Safari",
br4: "36",
nme4: "欧朋(Opera)",
br5: "11",
nme5: "Internet Explorer",
br6: "11",
nme6: "Edge",
url1: "http://getchrome.sinaapp.com/",
url2: "http://www.mozilla.com/firefox/",
url3: "http://www.apple.com/safari/download/",
url4: "http://www.opera.com/download/",
url5: "http://windows.microsoft.com/zh-CN/internet-explorer/download-ie",
url6: "http://www.microsoft.com/zh-CN/windows/microsoft-edge"
};
|
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1);
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(37);
var _reactRouter = __webpack_require__(192);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var MainNavigation = function (_React$Component) {
_inherits(MainNavigation, _React$Component);
function MainNavigation() {
_classCallCheck(this, MainNavigation);
return _possibleConstructorReturn(this, (MainNavigation.__proto__ || Object.getPrototypeOf(MainNavigation)).apply(this, arguments));
}
_createClass(MainNavigation, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'nav',
{ className: 'navbar navbar-inverse navbar-fixed-top' },
_react2.default.createElement(
'div',
{ className: 'container' },
_react2.default.createElement(
'div',
{ className: 'navbar-header' },
_react2.default.createElement(
'button',
{ type: 'button', className: 'navbar-toggle collapsed', 'data-toggle': 'collapse', 'data-target': '#navbar', 'aria-expanded': 'false', 'aria-controls': 'navbar' },
_react2.default.createElement(
'span',
{ className: 'sr-only' },
'Toggle navigation'
),
_react2.default.createElement('span', { className: 'icon-bar' }),
_react2.default.createElement('span', { className: 'icon-bar' }),
_react2.default.createElement('span', { className: 'icon-bar' })
),
_react2.default.createElement(
'a',
{ className: 'navbar-brand', href: '/todo' },
'TodoList'
)
),
_react2.default.createElement(
'div',
{ id: 'navbar', className: 'collapse navbar-collapse' },
_react2.default.createElement(
'ul',
{ className: 'nav navbar-nav' },
_react2.default.createElement(
'li',
null,
_react2.default.createElement(
'a',
{ href: '/todo' },
'Home'
)
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement(
'a',
{ href: '/todo/create' },
'Add Todo'
)
)
)
)
)
);
}
}]);
return MainNavigation;
}(_react2.default.Component);
var ItemLister = function (_React$Component2) {
_inherits(ItemLister, _React$Component2);
function ItemLister() {
_classCallCheck(this, ItemLister);
var _this2 = _possibleConstructorReturn(this, (ItemLister.__proto__ || Object.getPrototypeOf(ItemLister)).call(this));
_this2.state = { items: [] };
return _this2;
}
_createClass(ItemLister, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _this3 = this;
fetch('http://localhost:8000/api/todos/getAll').then(function (result) {
return result.json();
}).then(function (items) {
return _this3.setState({ items: items.data });
});
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
'tbody',
null,
this.state.items.length ? this.state.items.map(function (todo) {
return _react2.default.createElement(TodoRow, { name: todo.name, id: todo.id, key: todo.id });
}) : _react2.default.createElement(
'tr',
null,
_react2.default.createElement(
'td',
{ colSpan: 3 },
'Loading'
)
)
);
}
}]);
return ItemLister;
}(_react2.default.Component);
var ListTodos = function (_React$Component3) {
_inherits(ListTodos, _React$Component3);
function ListTodos() {
_classCallCheck(this, ListTodos);
return _possibleConstructorReturn(this, (ListTodos.__proto__ || Object.getPrototypeOf(ListTodos)).apply(this, arguments));
}
_createClass(ListTodos, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'h2',
{ className: 'page-header' },
'Latest Todos'
),
_react2.default.createElement(
'table',
{ className: 'table table-striped' },
_react2.default.createElement(
'thead',
null,
_react2.default.createElement(
'tr',
null,
_react2.default.createElement(
'th',
null,
'#'
),
_react2.default.createElement(
'th',
null,
'Todo'
),
_react2.default.createElement(
'th',
null,
'\xA0'
)
)
),
_react2.default.createElement(ItemLister, null)
)
);
}
}]);
return ListTodos;
}(_react2.default.Component);
var TodoRow = function (_React$Component4) {
_inherits(TodoRow, _React$Component4);
function TodoRow() {
_classCallCheck(this, TodoRow);
return _possibleConstructorReturn(this, (TodoRow.__proto__ || Object.getPrototypeOf(TodoRow)).apply(this, arguments));
}
_createClass(TodoRow, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'tr',
null,
_react2.default.createElement(
'th',
{ scope: "row" },
this.props.id
),
_react2.default.createElement(
'td',
null,
this.props.name
),
_react2.default.createElement(
'td',
null,
_react2.default.createElement(
'a',
{ href: '/todo/details/' + this.props.id, className: 'btn btn-success' },
'View'
),
_react2.default.createElement(
'a',
{ href: '/todo/edit/' + this.props.id, className: 'btn btn-default' },
'Edit'
),
_react2.default.createElement(
'a',
{ href: '/todo/delete/' + this.props.id, className: 'btn btn-danger' },
'Delete'
)
)
);
}
}]);
return TodoRow;
}(_react2.default.Component);
var ListContainer = function (_React$Component5) {
_inherits(ListContainer, _React$Component5);
function ListContainer() {
_classCallCheck(this, ListContainer);
return _possibleConstructorReturn(this, (ListContainer.__proto__ || Object.getPrototypeOf(ListContainer)).apply(this, arguments));
}
_createClass(ListContainer, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
{ className: 'container', style: { marginTop: 70 + "px" } },
_react2.default.createElement(
'div',
{ className: 'row' },
_react2.default.createElement(
'div',
{ className: 'col-md-12' },
_react2.default.createElement(ListTodos, null)
)
)
);
}
}]);
return ListContainer;
}(_react2.default.Component);
var CreateTodoForm = function (_React$Component6) {
_inherits(CreateTodoForm, _React$Component6);
function CreateTodoForm() {
_classCallCheck(this, CreateTodoForm);
return _possibleConstructorReturn(this, (CreateTodoForm.__proto__ || Object.getPrototypeOf(CreateTodoForm)).apply(this, arguments));
}
_createClass(CreateTodoForm, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'h2',
{ className: 'page-header' },
'Add Todo'
),
_react2.default.createElement(
'form',
{ name: 'form', method: 'post' },
_react2.default.createElement(
'div',
{ id: 'form' },
_react2.default.createElement(
'div',
null,
_react2.default.createElement(
'label',
{ htmlFor: 'form_name', className: 'required' },
'Name'
),
_react2.default.createElement('input', { type: 'text', id: 'form_name', name: 'form[name]', required: 'required', className: 'form-control', style: { marginBottom: 15 + "px" } })
),
_react2.default.createElement(
'div',
null,
_react2.default.createElement(
'label',
{ htmlFor: 'form_category', className: 'required' },
'Category'
),
_react2.default.createElement('input', { type: 'text', id: 'form_category', name: 'form[category]', required: 'required', className: 'form-control', style: { marginBottom: 15 + "px" } })
),
_react2.default.createElement(
'div',
null,
_react2.default.createElement(
'label',
{ htmlFor: 'form_description', className: 'required' },
'Description'
),
_react2.default.createElement('textarea', { id: 'form_description', name: 'form[description]', required: 'required', className: 'form-control', style: { marginBottom: 15 + "px" } })
),
_react2.default.createElement(
'div',
null,
_react2.default.createElement(
'label',
{ htmlFor: 'form_priority', className: 'required' },
'Priority'
),
_react2.default.createElement(
'select',
{ id: 'form_priority', name: 'form[priority]', className: 'form-control', style: { marginBottom: 15 + "px" } },
_react2.default.createElement(
'option',
{ value: 'Low' },
'Low'
),
_react2.default.createElement(
'option',
{ value: 'Normal' },
'Normal'
),
_react2.default.createElement(
'option',
{ value: 'High' },
'High'
)
)
)
)
)
);
}
}]);
return CreateTodoForm;
}(_react2.default.Component);
var Homepage = function (_React$Component7) {
_inherits(Homepage, _React$Component7);
function Homepage() {
_classCallCheck(this, Homepage);
return _possibleConstructorReturn(this, (Homepage.__proto__ || Object.getPrototypeOf(Homepage)).apply(this, arguments));
}
_createClass(Homepage, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(MainNavigation, null),
_react2.default.createElement(ListContainer, null)
);
}
}]);
return Homepage;
}(_react2.default.Component);
var CreateTodoPage = function (_React$Component8) {
_inherits(CreateTodoPage, _React$Component8);
function CreateTodoPage() {
_classCallCheck(this, CreateTodoPage);
return _possibleConstructorReturn(this, (CreateTodoPage.__proto__ || Object.getPrototypeOf(CreateTodoPage)).apply(this, arguments));
}
_createClass(CreateTodoPage, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(MainNavigation, null),
_react2.default.createElement(
'div',
{ className: 'container', style: { marginTop: 70 + "px" } },
_react2.default.createElement(
'div',
{ className: 'row' },
_react2.default.createElement(
'div',
{ className: 'col-md-12' },
_react2.default.createElement(CreateTodoForm, null)
)
)
)
);
}
}]);
return CreateTodoPage;
}(_react2.default.Component);
var Homepage404 = function (_React$Component9) {
_inherits(Homepage404, _React$Component9);
function Homepage404() {
_classCallCheck(this, Homepage404);
return _possibleConstructorReturn(this, (Homepage404.__proto__ || Object.getPrototypeOf(Homepage404)).apply(this, arguments));
}
_createClass(Homepage404, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
'404'
);
}
}]);
return Homepage404;
}(_react2.default.Component);
(0, _reactDom.render)(_react2.default.createElement(
_reactRouter.Router,
{ history: _reactRouter.browserHistory },
_react2.default.createElement(
_reactRouter.Route,
{ path: '/' },
_react2.default.createElement(_reactRouter.IndexRoute, { component: Homepage }),
_react2.default.createElement(_reactRouter.Route, { path: 'hi', component: CreateTodoPage }),
_react2.default.createElement(_reactRouter.Route, { path: '*', component: Homepage404 })
)
), document.getElementById('app'));
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(3);
/***/ }),
/* 3 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(5);
var ReactChildren = __webpack_require__(6);
var ReactComponent = __webpack_require__(19);
var ReactPureComponent = __webpack_require__(22);
var ReactClass = __webpack_require__(23);
var ReactDOMFactories = __webpack_require__(25);
var ReactElement = __webpack_require__(10);
var ReactPropTypes = __webpack_require__(30);
var ReactVersion = __webpack_require__(35);
var onlyChild = __webpack_require__(36);
var warning = __webpack_require__(12);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if (process.env.NODE_ENV !== 'production') {
var canDefineProperty = __webpack_require__(14);
var ReactElementValidator = __webpack_require__(26);
var didWarnPropTypesDeprecated = false;
createElement = ReactElementValidator.createElement;
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.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
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,
PureComponent: ReactPureComponent,
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
};
// TODO: Fix tests so that this deprecation warning doesn't cause failures.
if (process.env.NODE_ENV !== 'production') {
if (canDefineProperty) {
Object.defineProperty(React, 'PropTypes', {
get: function () {
process.env.NODE_ENV !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0;
didWarnPropTypesDeprecated = true;
return ReactPropTypes;
}
});
}
}
module.exports = React;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 4 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(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;
runClearTimeout(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) {
runTimeout(drainQueue);
}
};
// 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.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 5 */
/***/ (function(module, exports) {
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
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 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
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(function (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 (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
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 (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 6 */
/***/ (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 directory.
*
*/
'use strict';
var PooledClass = __webpack_require__(7);
var ReactElement = __webpack_require__(10);
var emptyFunction = __webpack_require__(13);
var traverseAllChildren = __webpack_require__(16);
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,
context = bookKeeping.context;
func.call(context, child, bookKeeping.count++);
}
/**
* Iterates through children that are typically specified as `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
*
* 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, forEachContext);
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,
keyPrefix = bookKeeping.keyPrefix,
func = bookKeeping.func,
context = bookKeeping.context;
var mappedChild = func.call(context, child, bookKeeping.count++);
if (Array.isArray(mappedChild)) {
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
} else if (mappedChild != null) {
if (ReactElement.isValidElement(mappedChild)) {
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
// Keep both the (mapped) and old keys if they differ, just as
// traverseAllChildren used to do for objects as children
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
}
result.push(mappedChild);
}
}
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
var escapedPrefix = '';
if (prefix != null) {
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
}
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
MapBookKeeping.release(traverseContext);
}
/**
* Maps children that are typically specified as `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
*
* The provided mapFunction(child, key, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} func The map function.
* @param {*} context Context for mapFunction.
* @return {object} Object containing the ordered map of results.
*/
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
return result;
}
function forEachSingleChildDummy(traverseContext, child, name) {
return null;
}
/**
* Count the number of children that are typically specified as
* `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
*
* @param {?*} children Children tree container.
* @return {number} The number of children.
*/
function countChildren(children, context) {
return traverseAllChildren(children, forEachSingleChildDummy, null);
}
/**
* Flatten a children object (typically specified as `props.children`) and
* return an array with appropriately re-keyed children.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
*/
function toArray(children) {
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
return result;
}
var ReactChildren = {
forEach: forEachChildren,
map: mapChildren,
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
count: countChildren,
toArray: toArray
};
module.exports = ReactChildren;
/***/ }),
/* 7 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(8);
var invariant = __webpack_require__(9);
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but would
* require accessing the `arguments` object. In each of these, `this` refers to
* the Class itself, not an instance. If any others are needed, simply add 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 {
return new Klass(copyFieldsFrom);
}
};
var twoArgumentPooler = function (a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var threeArgumentPooler = function (a1, a2, a3) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3);
return instance;
} else {
return new Klass(a1, a2, a3);
}
};
var fourArgumentPooler = function (a1, a2, a3, a4) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3, a4);
return instance;
} else {
return new Klass(a1, a2, a3, a4);
}
};
var standardReleaser = function (instance) {
var Klass = this;
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = oneArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances.
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function (CopyConstructor, pooler) {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
oneArgumentPooler: oneArgumentPooler,
twoArgumentPooler: twoArgumentPooler,
threeArgumentPooler: threeArgumentPooler,
fourArgumentPooler: fourArgumentPooler
};
module.exports = PooledClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 8 */
/***/ (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 directory.
*
*
*/
'use strict';
/**
* WARNING: DO NOT manually require this module.
* This is a replacement for `invariant(...)` used by the error code system
* and will _only_ be required by the corresponding babel pass.
* It always throws.
*/
function reactProdInvariant(code) {
var argCount = arguments.length - 1;
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
for (var argIdx = 0; argIdx < argCount; argIdx++) {
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
}
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
var error = new Error(message);
error.name = 'Invariant Violation';
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
throw error;
}
module.exports = reactProdInvariant;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (process.env.NODE_ENV !== 'production') {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} 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__(4)))
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(5);
var ReactCurrentOwner = __webpack_require__(11);
var warning = __webpack_require__(12);
var canDefineProperty = __webpack_require__(14);
var hasOwnProperty = Object.prototype.hasOwnProperty;
var REACT_ELEMENT_TYPE = __webpack_require__(15);
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown;
function hasValidRef(config) {
if (process.env.NODE_ENV !== 'production') {
if (hasOwnProperty.call(config, 'ref')) {
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.ref !== undefined;
}
function hasValidKey(config) {
if (process.env.NODE_ENV !== 'production') {
if (hasOwnProperty.call(config, 'key')) {
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.key !== undefined;
}
function defineKeyPropWarningGetter(props, displayName) {
var warnAboutAccessingKey = function () {
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
}
};
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props, 'key', {
get: warnAboutAccessingKey,
configurable: true
});
}
function defineRefPropWarningGetter(props, displayName) {
var warnAboutAccessingRef = function () {
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
}
};
warnAboutAccessingRef.isReactWarning = true;
Object.defineProperty(props, 'ref', {
get: warnAboutAccessingRef,
configurable: true
});
}
/**
* 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.element') to check
* if something is a React Element.
*
* @param {*} type
* @param {*} key
* @param {string|object} ref
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that 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 be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* 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 make
// the validation flag non-enumerable (where possible, which should
// include every environment we run tests in), so the test framework
// ignores it.
if (canDefineProperty) {
Object.defineProperty(element._store, 'validated', {
configurable: false,
enumerable: false,
writable: true,
value: false
});
// self and source are DEV only properties.
Object.defineProperty(element, '_self', {
configurable: false,
enumerable: false,
writable: false,
value: self
});
// Two elements created in two different places should be considered
// equal for testing purposes and therefore we hide it from enumeration.
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;
};
/**
* Create and return a new ReactElement of the given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
*/
ReactElement.createElement = function (type, config, children) {
var propName;
// Reserved names are extracted
var props = {};
var key = null;
var ref = null;
var self = null;
var source = null;
if (config != null) {
if (hasValidRef(config)) {
ref = config.ref;
}
if (hasValidKey(config)) {
key = '' + 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 (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
if (process.env.NODE_ENV !== 'production') {
if (Object.freeze) {
Object.freeze(childArray);
}
}
props.children = childArray;
}
// Resolve default props
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
}
if (process.env.NODE_ENV !== 'production') {
if (key || ref) {
if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
if (key) {
defineKeyPropWarningGetter(props, displayName);
}
if (ref) {
defineRefPropWarningGetter(props, displayName);
}
}
}
}
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
};
/**
* Return a function that produces ReactElements of a given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
*/
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 function
// 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;
};
/**
* Clone and return a new ReactElement using element as the starting point.
* See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
*/
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 by 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 (hasValidRef(config)) {
// Silently steal the ref from the parent.
ref = config.ref;
owner = ReactCurrentOwner.current;
}
if (hasValidKey(config)) {
key = '' + config.key;
}
// Remaining properties override existing props
var defaultProps;
if (element.type && element.type.defaultProps) {
defaultProps = element.type.defaultProps;
}
for (propName in config) {
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
if (config[propName] === undefined && defaultProps !== undefined) {
// Resolve default props
props[propName] = defaultProps[propName];
} else {
props[propName] = config[propName];
}
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
props.children = childArray;
}
return ReactElement(element.type, key, ref, self, source, owner, props);
};
/**
* Verifies the object is a ReactElement.
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
* @param {?object} object
* @return {boolean} True if `object` is a valid component.
* @final
*/
ReactElement.isValidElement = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
module.exports = ReactElement;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 11 */
/***/ (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 directory.
*
*
*/
'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;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-2015, 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 directory.
*
*/
'use strict';
var emptyFunction = __webpack_require__(13);
/**
* 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 critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
(function () {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
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 this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
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) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
})();
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 13 */
/***/ (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 directory.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = 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;
/***/ }),
/* 14 */
/***/ (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 directory.
*
*
*/
'use strict';
var canDefineProperty = false;
if (process.env.NODE_ENV !== 'production') {
try {
// $FlowFixMe https://github.com/facebook/flow/issues/285
Object.defineProperty({}, 'x', { get: function () {} });
canDefineProperty = true;
} catch (x) {
// IE will fail on defineProperty
}
}
module.exports = canDefineProperty;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 15 */
/***/ (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 directory.
*
*
*/
'use strict';
// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
module.exports = REACT_ELEMENT_TYPE;
/***/ }),
/* 16 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(8);
var ReactCurrentOwner = __webpack_require__(11);
var REACT_ELEMENT_TYPE = __webpack_require__(15);
var getIteratorFn = __webpack_require__(17);
var invariant = __webpack_require__(9);
var KeyEscapeUtils = __webpack_require__(18);
var warning = __webpack_require__(12);
var SEPARATOR = '.';
var SUBSEPARATOR = ':';
/**
* This is inlined from ReactElement since this file is shared between
* isomorphic and renderers. We could extract this to a
*
*/
/**
* TODO: Test that a single child and an array with one item have the same key
* pattern.
*/
var didWarnAboutMaps = false;
/**
* 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 provided.
* @return {string}
*/
function getComponentKey(component, index) {
// Do some typechecking here since we call this blindly. We want to ensure
// that we don't block potential future ES APIs.
if (component && typeof component === 'object' && component.key != null) {
// 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 traversal
* process.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
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' ||
// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
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) : nameSoFar);
return 1;
}
var child;
var nextName;
var subtreeCount = 0; // Count of children found in the current subtree.
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
nextName = nextNamePrefix + getComponentKey(child, i);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
var iteratorFn = getIteratorFn(children);
if (iteratorFn) {
var iterator = iteratorFn.call(children);
var step;
if (iteratorFn !== children.entries) {
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getComponentKey(child, ii++);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
if (process.env.NODE_ENV !== 'production') {
var mapsAsChildrenAddendum = '';
if (ReactCurrentOwner.current) {
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
if (mapsAsChildrenOwnerName) {
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
}
}
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
didWarnAboutMaps = true;
}
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
child = entry[1];
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
}
}
} else if (type === 'object') {
var addendum = '';
if (process.env.NODE_ENV !== 'production') {
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
if (children._isReactElement) {
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
}
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
addendum += ' Check the render method of `' + name + '`.';
}
}
}
var childrenString = String(children);
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
}
}
return subtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`, but
* might also be specified through attributes:
*
* - `traverseAllChildren(this.props.children, ...)`
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
*
* The `traverseContext` is an optional argument that is passed through the
* entire traversal. It can be used to store accumulations or anything else 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__(4)))
/***/ }),
/* 17 */
/***/ (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 directory.
*
*
*/
'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[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
module.exports = getIteratorFn;
/***/ }),
/* 18 */
/***/ (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 directory.
*
*
*/
'use strict';
/**
* Escape and wrap key so it is safe to use as a reactid
*
* @param {string} 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];
});
return '$' + escapedString;
}
/**
* Unescape and unwrap key for human-readable display
*
* @param {string} key to unescape.
* @return {string} the unescaped key.
*/
function unescape(key) {
var unescapeRegex = /(=0|=2)/g;
var unescaperLookup = {
'=0': '=',
'=2': ':'
};
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
return ('' + keySubstring).replace(unescapeRegex, function (match) {
return unescaperLookup[match];
});
}
var KeyEscapeUtils = {
escape: escape,
unescape: unescape
};
module.exports = KeyEscapeUtils;
/***/ }),
/* 19 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(8);
var ReactNoopUpdateQueue = __webpack_require__(20);
var canDefineProperty = __webpack_require__(14);
var emptyObject = __webpack_require__(21);
var invariant = __webpack_require__(9);
var warning = __webpack_require__(12);
/**
* 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 value.
*
* There is no guarantee that calls to `setState` will run synchronously,
* as they may eventually be batched together. You can provide an optional
* 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 point in
* the future (not synchronously). It will be called with the up to date
* component arguments (state, props, context). These values can be different
* from this.* because your function may be called after receiveProps but before
* shouldComponentUpdate, and this new state, props, and context will not 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 === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : 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 the
* 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 but 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 accessed.
*/
if (process.env.NODE_ENV !== 'production') {
var deprecatedAPIs = {
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
replaceState: ['replaceState', 'Refactor your code to use setState instead (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__(4)))
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var warning = __webpack_require__(12);
function warnNoop(publicInstance, callerName) {
if (process.env.NODE_ENV !== 'production') {
var constructor = publicInstance.constructor;
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, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : 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 updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @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
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
warnNoop(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 rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
warnNoop(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 use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
warnNoop(publicInstance, 'setState');
}
};
module.exports = ReactNoopUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 22 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(5);
var ReactComponent = __webpack_require__(19);
var ReactNoopUpdateQueue = __webpack_require__(20);
var emptyObject = __webpack_require__(21);
/**
* Base class helpers for the updating state of a component.
*/
function ReactPureComponent(props, context, updater) {
// Duplicated from ReactComponent.
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;
}
function ComponentDummy() {}
ComponentDummy.prototype = ReactComponent.prototype;
ReactPureComponent.prototype = new ComponentDummy();
ReactPureComponent.prototype.constructor = ReactPureComponent;
// Avoid an extra prototype jump for these methods.
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
ReactPureComponent.prototype.isPureReactComponent = true;
module.exports = ReactPureComponent;
/***/ }),
/* 23 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(8),
_assign = __webpack_require__(5);
var ReactComponent = __webpack_require__(19);
var ReactElement = __webpack_require__(10);
var ReactPropTypeLocationNames = __webpack_require__(24);
var ReactNoopUpdateQueue = __webpack_require__(20);
var emptyObject = __webpack_require__(21);
var invariant = __webpack_require__(9);
var warning = __webpack_require__(12);
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return <div>Hello World</div>;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: 'DEFINE_MANY',
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: 'DEFINE_MANY',
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: 'DEFINE_MANY',
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: 'DEFINE_MANY',
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: 'DEFINE_MANY',
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: '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: 'DEFINE_MANY_MERGED',
/**
* @return {object}
* @optional
*/
getChildContext: '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 invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @required
*/
render: 'DEFINE_ONCE',
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: 'DEFINE_MANY',
/**
* Invoked when the component has been mounted and has a DOM representation.
* 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: 'DEFINE_MANY',
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming 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: 'DEFINE_MANY',
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* 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: 'DEFINE_ONCE',
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* 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: '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 {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: 'DEFINE_MANY',
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: 'DEFINE_MANY',
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: 'OVERRIDE_BASE'
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* 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, 'childContext');
}
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, 'context');
}
Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function (Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function (Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
statics: function (Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function () {} };
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an invariant so components
// don't show up in prod but only in __DEV__
process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
!(specPolicy === 'OVERRIDE_BASE') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0;
}
// Disallow defining methods more than once unless explicitly allowed.
if (isAlreadyDefined) {
!(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classes.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
if (process.env.NODE_ENV !== 'production') {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
}
return;
}
!(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
!!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
var proto = Constructor.prototype;
var autoBindPairs = proto.__reactAutoBindPairs;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
var isAlreadyDefined = proto.hasOwnProperty(name);
validateMethodOverride(isAlreadyDefined, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
!(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if (process.env.NODE_ENV !== 'production') {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
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(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0;
var isInherited = name in Constructor;
!!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : 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, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : 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 objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : 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 return 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 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
} else if (!args.length) {
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
var pairs = component.__reactAutoBindPairs;
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function (newState, callback) {
this.updater.enqueueReplaceState(this, newState);
if (callback) {
this.updater.enqueueCallback(this, callback, 'replaceState');
}
},
/**
* 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, ReactClassMixin);
var didWarnDeprecated = false;
/**
* Module for creating composite components.
*
* @class ReactClass
*/
var ReactClass = {
/**
* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
createClass: function (spec) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0;
didWarnDeprecated = true;
}
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(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 initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (initialState === undefined && this.getInitialState._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
this.state = initialState;
});
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
Constructor.prototype.__reactAutoBindPairs = [];
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, spec);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if (process.env.NODE_ENV !== 'production') {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
!Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
},
injection: {
injectMixin: function (mixin) {
injectedMixins.push(mixin);
}
}
};
module.exports = ReactClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 24 */
/***/ (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 directory.
*
*
*/
'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__(4)))
/***/ }),
/* 25 */
/***/ (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 directory.
*
*/
'use strict';
var ReactElement = __webpack_require__(10);
/**
* Create a factory that creates HTML tag elements.
*
* @private
*/
var createDOMFactory = ReactElement.createFactory;
if (process.env.NODE_ENV !== 'production') {
var ReactElementValidator = __webpack_require__(26);
createDOMFactory = ReactElementValidator.createFactory;
}
/**
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
* This is also accessible via `React.DOM`.
*
* @public
*/
var ReactDOMFactories = {
a: createDOMFactory('a'),
abbr: createDOMFactory('abbr'),
address: createDOMFactory('address'),
area: createDOMFactory('area'),
article: createDOMFactory('article'),
aside: createDOMFactory('aside'),
audio: createDOMFactory('audio'),
b: createDOMFactory('b'),
base: createDOMFactory('base'),
bdi: createDOMFactory('bdi'),
bdo: createDOMFactory('bdo'),
big: createDOMFactory('big'),
blockquote: createDOMFactory('blockquote'),
body: createDOMFactory('body'),
br: createDOMFactory('br'),
button: createDOMFactory('button'),
canvas: createDOMFactory('canvas'),
caption: createDOMFactory('caption'),
cite: createDOMFactory('cite'),
code: createDOMFactory('code'),
col: createDOMFactory('col'),
colgroup: createDOMFactory('colgroup'),
data: createDOMFactory('data'),
datalist: createDOMFactory('datalist'),
dd: createDOMFactory('dd'),
del: createDOMFactory('del'),
details: createDOMFactory('details'),
dfn: createDOMFactory('dfn'),
dialog: createDOMFactory('dialog'),
div: createDOMFactory('div'),
dl: createDOMFactory('dl'),
dt: createDOMFactory('dt'),
em: createDOMFactory('em'),
embed: createDOMFactory('embed'),
fieldset: createDOMFactory('fieldset'),
figcaption: createDOMFactory('figcaption'),
figure: createDOMFactory('figure'),
footer: createDOMFactory('footer'),
form: createDOMFactory('form'),
h1: createDOMFactory('h1'),
h2: createDOMFactory('h2'),
h3: createDOMFactory('h3'),
h4: createDOMFactory('h4'),
h5: createDOMFactory('h5'),
h6: createDOMFactory('h6'),
head: createDOMFactory('head'),
header: createDOMFactory('header'),
hgroup: createDOMFactory('hgroup'),
hr: createDOMFactory('hr'),
html: createDOMFactory('html'),
i: createDOMFactory('i'),
iframe: createDOMFactory('iframe'),
img: createDOMFactory('img'),
input: createDOMFactory('input'),
ins: createDOMFactory('ins'),
kbd: createDOMFactory('kbd'),
keygen: createDOMFactory('keygen'),
label: createDOMFactory('label'),
legend: createDOMFactory('legend'),
li: createDOMFactory('li'),
link: createDOMFactory('link'),
main: createDOMFactory('main'),
map: createDOMFactory('map'),
mark: createDOMFactory('mark'),
menu: createDOMFactory('menu'),
menuitem: createDOMFactory('menuitem'),
meta: createDOMFactory('meta'),
meter: createDOMFactory('meter'),
nav: createDOMFactory('nav'),
noscript: createDOMFactory('noscript'),
object: createDOMFactory('object'),
ol: createDOMFactory('ol'),
optgroup: createDOMFactory('optgroup'),
option: createDOMFactory('option'),
output: createDOMFactory('output'),
p: createDOMFactory('p'),
param: createDOMFactory('param'),
picture: createDOMFactory('picture'),
pre: createDOMFactory('pre'),
progress: createDOMFactory('progress'),
q: createDOMFactory('q'),
rp: createDOMFactory('rp'),
rt: createDOMFactory('rt'),
ruby: createDOMFactory('ruby'),
s: createDOMFactory('s'),
samp: createDOMFactory('samp'),
script: createDOMFactory('script'),
section: createDOMFactory('section'),
select: createDOMFactory('select'),
small: createDOMFactory('small'),
source: createDOMFactory('source'),
span: createDOMFactory('span'),
strong: createDOMFactory('strong'),
style: createDOMFactory('style'),
sub: createDOMFactory('sub'),
summary: createDOMFactory('summary'),
sup: createDOMFactory('sup'),
table: createDOMFactory('table'),
tbody: createDOMFactory('tbody'),
td: createDOMFactory('td'),
textarea: createDOMFactory('textarea'),
tfoot: createDOMFactory('tfoot'),
th: createDOMFactory('th'),
thead: createDOMFactory('thead'),
time: createDOMFactory('time'),
title: createDOMFactory('title'),
tr: createDOMFactory('tr'),
track: createDOMFactory('track'),
u: createDOMFactory('u'),
ul: createDOMFactory('ul'),
'var': createDOMFactory('var'),
video: createDOMFactory('video'),
wbr: createDOMFactory('wbr'),
// SVG
circle: createDOMFactory('circle'),
clipPath: createDOMFactory('clipPath'),
defs: createDOMFactory('defs'),
ellipse: createDOMFactory('ellipse'),
g: createDOMFactory('g'),
image: createDOMFactory('image'),
line: createDOMFactory('line'),
linearGradient: createDOMFactory('linearGradient'),
mask: createDOMFactory('mask'),
path: createDOMFactory('path'),
pattern: createDOMFactory('pattern'),
polygon: createDOMFactory('polygon'),
polyline: createDOMFactory('polyline'),
radialGradient: createDOMFactory('radialGradient'),
rect: createDOMFactory('rect'),
stop: createDOMFactory('stop'),
svg: createDOMFactory('svg'),
text: createDOMFactory('text'),
tspan: createDOMFactory('tspan')
};
module.exports = ReactDOMFactories;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
/**
* 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 languages
* that support it.
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(11);
var ReactComponentTreeHook = __webpack_require__(27);
var ReactElement = __webpack_require__(10);
var checkReactTypeSpec = __webpack_require__(28);
var canDefineProperty = __webpack_require__(14);
var getIteratorFn = __webpack_require__(17);
var warning = __webpack_require__(12);
function getDeclarationErrorAddendum() {
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
function getSourceInfoErrorAddendum(elementProps) {
if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
var source = elementProps.__source;
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
var lineNumber = source.lineNumber;
return ' Check your code at ' + fileName + ':' + lineNumber + '.';
}
return '';
}
/**
* Warn if there's no key explicitly set on dynamic arrays of children or
* object keys are not valid. This allows us to keep track of children between
* updates.
*/
var ownerHasKeyUseWarning = {};
function getCurrentComponentErrorInfo(parentType) {
var info = getDeclarationErrorAddendum();
if (!info) {
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
if (parentName) {
info = ' Check the top-level render call using <' + parentName + '>.';
}
}
return info;
}
/**
* Warn if the element doesn't have an explicit key assigned to it.
* This element is in an array. The array could grow and shrink or be
* reordered. All children that haven't already been validated are required to
* have a "key" property assigned to it. Error statuses are cached so a warning
* will only be shown once.
*
* @internal
* @param {ReactElement} element Element that requires a key.
* @param {*} parentType element's parent's type.
*/
function validateExplicitKey(element, parentType) {
if (!element._store || element._store.validated || element.key != null) {
return;
}
element._store.validated = true;
var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
if (memoizer[currentComponentErrorInfo]) {
return;
}
memoizer[currentComponentErrorInfo] = true;
// Usually the current owner is the offender, but if it accepts children as a
// property, it may be the creator of the child that's responsible for
// assigning it a key.
var childOwner = '';
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
// Give the component that originally created this child.
childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
}
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
}
/**
* Ensure that every element either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {ReactNode} node Statically passed child of any type.
* @param {*} parentType node's parent's type.
*/
function validateChildKeys(node, parentType) {
if (typeof node !== 'object') {
return;
}
if (Array.isArray(node)) {
for (var i = 0; i < node.length; i++) {
var child = node[i];
if (ReactElement.isValidElement(child)) {
validateExplicitKey(child, parentType);
}
}
} else if (ReactElement.isValidElement(node)) {
// This element was passed in a valid location.
if (node._store) {
node._store.validated = true;
}
} 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);
}
}
}
}
}
}
/**
* Given an element, validate that its props follow the propTypes definition,
* provided by the type.
*
* @param {ReactElement} element
*/
function validatePropTypes(element) {
var componentClass = element.type;
if (typeof componentClass !== 'function') {
return;
}
var name = componentClass.displayName || componentClass.name;
if (componentClass.propTypes) {
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
}
if (typeof componentClass.getDefaultProps === 'function') {
process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
}
}
var ReactElementValidator = {
createElement: function (type, props, children) {
var validType = typeof type === 'string' || typeof type === 'function';
// We warn in this case but don't throw. We expect the element creation to
// succeed and there will likely be errors in render.
if (!validType) {
if (typeof type !== 'function' && typeof type !== 'string') {
var info = '';
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
}
var sourceInfo = getSourceInfoErrorAddendum(props);
if (sourceInfo) {
info += sourceInfo;
} else {
info += getDeclarationErrorAddendum();
}
info += ReactComponentTreeHook.getCurrentStackAddendum();
process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
}
}
var element = ReactElement.createElement.apply(this, arguments);
// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if (element == null) {
return element;
}
// 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 type 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, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : 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__(4)))
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(8);
var ReactCurrentOwner = __webpack_require__(11);
var invariant = __webpack_require__(9);
var warning = __webpack_require__(12);
function isNative(fn) {
// Based on isNative() from Lodash
var funcToString = Function.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var reIsNative = RegExp('^' + funcToString
// Take an example native function source for comparison
.call(hasOwnProperty)
// Strip regex characters so we can use it for regex
.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
// Remove hasOwnProperty from the template to make it generic
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
try {
var source = funcToString.call(fn);
return reIsNative.test(source);
} catch (err) {
return false;
}
}
var canUseCollections =
// Array.from
typeof Array.from === 'function' &&
// Map
typeof Map === 'function' && isNative(Map) &&
// Map.prototype.keys
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
// Set
typeof Set === 'function' && isNative(Set) &&
// Set.prototype.keys
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
var setItem;
var getItem;
var removeItem;
var getItemIDs;
var addRoot;
var removeRoot;
var getRootIDs;
if (canUseCollections) {
var itemMap = new Map();
var rootIDSet = new Set();
setItem = function (id, item) {
itemMap.set(id, item);
};
getItem = function (id) {
return itemMap.get(id);
};
removeItem = function (id) {
itemMap['delete'](id);
};
getItemIDs = function () {
return Array.from(itemMap.keys());
};
addRoot = function (id) {
rootIDSet.add(id);
};
removeRoot = function (id) {
rootIDSet['delete'](id);
};
getRootIDs = function () {
return Array.from(rootIDSet.keys());
};
} else {
var itemByKey = {};
var rootByKey = {};
// Use non-numeric keys to prevent V8 performance issues:
// https://github.com/facebook/react/pull/7232
var getKeyFromID = function (id) {
return '.' + id;
};
var getIDFromKey = function (key) {
return parseInt(key.substr(1), 10);
};
setItem = function (id, item) {
var key = getKeyFromID(id);
itemByKey[key] = item;
};
getItem = function (id) {
var key = getKeyFromID(id);
return itemByKey[key];
};
removeItem = function (id) {
var key = getKeyFromID(id);
delete itemByKey[key];
};
getItemIDs = function () {
return Object.keys(itemByKey).map(getIDFromKey);
};
addRoot = function (id) {
var key = getKeyFromID(id);
rootByKey[key] = true;
};
removeRoot = function (id) {
var key = getKeyFromID(id);
delete rootByKey[key];
};
getRootIDs = function () {
return Object.keys(rootByKey).map(getIDFromKey);
};
}
var unmountedIDs = [];
function purgeDeep(id) {
var item = getItem(id);
if (item) {
var childIDs = item.childIDs;
removeItem(id);
childIDs.forEach(purgeDeep);
}
}
function describeComponentFrame(name, source, ownerName) {
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
}
function getDisplayName(element) {
if (element == null) {
return '#empty';
} else if (typeof element === 'string' || typeof element === 'number') {
return '#text';
} else if (typeof element.type === 'string') {
return element.type;
} else {
return element.type.displayName || element.type.name || 'Unknown';
}
}
function describeID(id) {
var name = ReactComponentTreeHook.getDisplayName(id);
var element = ReactComponentTreeHook.getElement(id);
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var ownerName;
if (ownerID) {
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
}
process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
return describeComponentFrame(name, element && element._source, ownerName);
}
var ReactComponentTreeHook = {
onSetChildren: function (id, nextChildIDs) {
var item = getItem(id);
!item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
item.childIDs = nextChildIDs;
for (var i = 0; i < nextChildIDs.length; i++) {
var nextChildID = nextChildIDs[i];
var nextChild = getItem(nextChildID);
!nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
!(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
!nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
if (nextChild.parentID == null) {
nextChild.parentID = id;
// TODO: This shouldn't be necessary but mounting a new root during in
// componentWillMount currently causes not-yet-mounted components to
// be purged from our tree data so their parent id is missing.
}
!(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
}
},
onBeforeMountComponent: function (id, element, parentID) {
var item = {
element: element,
parentID: parentID,
text: null,
childIDs: [],
isMounted: false,
updateCount: 0
};
setItem(id, item);
},
onBeforeUpdateComponent: function (id, element) {
var item = getItem(id);
if (!item || !item.isMounted) {
// We may end up here as a result of setState() in componentWillUnmount().
// In this case, ignore the element.
return;
}
item.element = element;
},
onMountComponent: function (id) {
var item = getItem(id);
!item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
item.isMounted = true;
var isRoot = item.parentID === 0;
if (isRoot) {
addRoot(id);
}
},
onUpdateComponent: function (id) {
var item = getItem(id);
if (!item || !item.isMounted) {
// We may end up here as a result of setState() in componentWillUnmount().
// In this case, ignore the element.
return;
}
item.updateCount++;
},
onUnmountComponent: function (id) {
var item = getItem(id);
if (item) {
// We need to check if it exists.
// `item` might not exist if it is inside an error boundary, and a sibling
// error boundary child threw while mounting. Then this instance never
// got a chance to mount, but it still gets an unmounting event during
// the error boundary cleanup.
item.isMounted = false;
var isRoot = item.parentID === 0;
if (isRoot) {
removeRoot(id);
}
}
unmountedIDs.push(id);
},
purgeUnmountedComponents: function () {
if (ReactComponentTreeHook._preventPurging) {
// Should only be used for testing.
return;
}
for (var i = 0; i < unmountedIDs.length; i++) {
var id = unmountedIDs[i];
purgeDeep(id);
}
unmountedIDs.length = 0;
},
isMounted: function (id) {
var item = getItem(id);
return item ? item.isMounted : false;
},
getCurrentStackAddendum: function (topElement) {
var info = '';
if (topElement) {
var name = getDisplayName(topElement);
var owner = topElement._owner;
info += describeComponentFrame(name, topElement._source, owner && owner.getName());
}
var currentOwner = ReactCurrentOwner.current;
var id = currentOwner && currentOwner._debugID;
info += ReactComponentTreeHook.getStackAddendumByID(id);
return info;
},
getStackAddendumByID: function (id) {
var info = '';
while (id) {
info += describeID(id);
id = ReactComponentTreeHook.getParentID(id);
}
return info;
},
getChildIDs: function (id) {
var item = getItem(id);
return item ? item.childIDs : [];
},
getDisplayName: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (!element) {
return null;
}
return getDisplayName(element);
},
getElement: function (id) {
var item = getItem(id);
return item ? item.element : null;
},
getOwnerID: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (!element || !element._owner) {
return null;
}
return element._owner._debugID;
},
getParentID: function (id) {
var item = getItem(id);
return item ? item.parentID : null;
},
getSource: function (id) {
var item = getItem(id);
var element = item ? item.element : null;
var source = element != null ? element._source : null;
return source;
},
getText: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (typeof element === 'string') {
return element;
} else if (typeof element === 'number') {
return '' + element;
} else {
return null;
}
},
getUpdateCount: function (id) {
var item = getItem(id);
return item ? item.updateCount : 0;
},
getRootIDs: getRootIDs,
getRegisteredIDs: getItemIDs
};
module.exports = ReactComponentTreeHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 28 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(8);
var ReactPropTypeLocationNames = __webpack_require__(24);
var ReactPropTypesSecret = __webpack_require__(29);
var invariant = __webpack_require__(9);
var warning = __webpack_require__(12);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(27);
}
var loggedTypeFailures = {};
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?object} element The React element that is being type-checked
* @param {?number} debugID The React component instance that is being type-checked
* @private
*/
function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
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 message.
!(typeof typeSpecs[typeSpecName] === '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], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var componentStackInfo = '';
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(27);
}
if (debugID !== null) {
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
} else if (element !== null) {
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
}
}
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
}
}
}
}
module.exports = checkReactTypeSpec;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 29 */
/***/ (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 directory.
*
*
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 30 */
/***/ (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 directory.
*
*/
'use strict';
var _require = __webpack_require__(10),
isValidElement = _require.isValidElement;
var factory = __webpack_require__(31);
module.exports = factory(isValidElement);
/***/ }),
/* 31 */
/***/ (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 directory.
*/
'use strict';
// React 15.5 references this module, and assumes PropTypes are still callable in production.
// Therefore we re-export development-only version with all the PropTypes checks here.
// However if one is migrating to the `prop-types` npm library, they will go through the
// `index.js` entry point, and it will branch depending on the environment.
var factory = __webpack_require__(32);
module.exports = function(isValidElement) {
// It is still allowed in 15.5.
var throwOnDirectAccess = false;
return factory(isValidElement, throwOnDirectAccess);
};
/***/ }),
/* 32 */
/***/ (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 directory.
*/
'use strict';
var emptyFunction = __webpack_require__(13);
var invariant = __webpack_require__(9);
var warning = __webpack_require__(12);
var ReactPropTypesSecret = __webpack_require__(33);
var checkPropTypes = __webpack_require__(34);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* 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[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* 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([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. 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>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
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 own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_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*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== 'production') {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
warning(
false,
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
'received %s at index %s.',
getPostfixForTypeWarning(checker),
i
);
return emptyFunction.thatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
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;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
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';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 33 */
/***/ (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 directory.
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 34 */
/***/ (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 directory.
*/
'use strict';
if (process.env.NODE_ENV !== 'production') {
var invariant = __webpack_require__(9);
var warning = __webpack_require__(12);
var ReactPropTypesSecret = __webpack_require__(33);
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (process.env.NODE_ENV !== 'production') {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
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 message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 35 */
/***/ (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 directory.
*
*/
'use strict';
module.exports = '15.5.4';
/***/ }),
/* 36 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(8);
var ReactElement = __webpack_require__(10);
var invariant = __webpack_require__(9);
/**
* Returns the first child in a collection of children and verifies that there
* is only one child in the collection.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
*
* The current implementation of this function assumes that a single child gets
* passed without a wrapper, but the purpose of this helper function is to
* abstract away the particular structure 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 !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
return children;
}
module.exports = onlyChild;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(38);
/***/ }),
/* 38 */
/***/ (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 directory.
*
*/
/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
'use strict';
var ReactDOMComponentTree = __webpack_require__(39);
var ReactDefaultInjection = __webpack_require__(44);
var ReactMount = __webpack_require__(180);
var ReactReconciler = __webpack_require__(68);
var ReactUpdates = __webpack_require__(65);
var ReactVersion = __webpack_require__(185);
var findDOMNode = __webpack_require__(186);
var getHostComponentFromComposite = __webpack_require__(187);
var renderSubtreeIntoContainer = __webpack_require__(188);
var warning = __webpack_require__(52);
ReactDefaultInjection.inject();
var ReactDOM = {
findDOMNode: findDOMNode,
render: ReactMount.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.
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
ComponentTree: {
getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
getNodeFromInstance: function (inst) {
// inst is an internal instance (but could be a composite)
if (inst._renderedComponent) {
inst = getHostComponentFromComposite(inst);
}
if (inst) {
return ReactDOMComponentTree.getNodeFromInstance(inst);
} else {
return null;
}
}
},
Mount: ReactMount,
Reconciler: ReactReconciler
});
}
if (process.env.NODE_ENV !== 'production') {
var ExecutionEnvironment = __webpack_require__(56);
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 installed.
if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
// Firefox does not have the issue with devtools loaded over file://
var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
}
}
var testFunc = function testFn() {};
process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
// 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.documentMode < 8;
process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
var expectedFeatures = [
// shims
Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];
for (var i = 0; i < expectedFeatures.length; i++) {
if (!expectedFeatures[i]) {
process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
break;
}
}
}
}
if (process.env.NODE_ENV !== 'production') {
var ReactInstrumentation = __webpack_require__(71);
var ReactDOMUnknownPropertyHook = __webpack_require__(189);
var ReactDOMNullInputValuePropHook = __webpack_require__(190);
var ReactDOMInvalidARIAHook = __webpack_require__(191);
ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
}
module.exports = ReactDOM;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 39 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var DOMProperty = __webpack_require__(41);
var ReactDOMComponentFlags = __webpack_require__(43);
var invariant = __webpack_require__(42);
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var Flags = ReactDOMComponentFlags;
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
/**
* Check if a given node should be cached.
*/
function shouldPrecacheNode(node, nodeID) {
return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
}
/**
* Drill down (through composites and empty components) until we get a host or
* host text component.
*
* This is pretty polymorphic but unavoidable with the current structure we have
* for `_renderedChildren`.
*/
function getRenderedHostOrTextFromComponent(component) {
var rendered;
while (rendered = component._renderedComponent) {
component = rendered;
}
return component;
}
/**
* Populate `_hostNode` on the rendered host/text component with the given
* DOM node. The passed `inst` can be a composite.
*/
function precacheNode(inst, node) {
var hostInst = getRenderedHostOrTextFromComponent(inst);
hostInst._hostNode = node;
node[internalInstanceKey] = hostInst;
}
function uncacheNode(inst) {
var node = inst._hostNode;
if (node) {
delete node[internalInstanceKey];
inst._hostNode = null;
}
}
/**
* Populate `_hostNode` on each child of `inst`, assuming that the children
* match up with the DOM (element) children of `node`.
*
* We cache entire levels at once to avoid an n^2 problem where we access the
* children of a node sequentially and have to walk from the start to our target
* node every time.
*
* Since we update `_renderedChildren` and the actual DOM at (slightly)
* different times, we could race here and see a newer `_renderedChildren` than
* the DOM nodes we see. To avoid this, ReactMultiChild calls
* `prepareToManageChildren` before we change `_renderedChildren`, at which
* 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];
var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
if (childID === 0) {
// We're currently unmounting this child in ReactMultiChild; skip it.
continue;
}
// We assume the child nodes are in the same order as the child instances.
for (; childNode !== null; childNode = childNode.nextSibling) {
if (shouldPrecacheNode(childNode, childID)) {
precacheNode(childInst, childNode);
continue outer;
}
}
// We reached the end of the DOM children without finding an ID match.
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
}
inst._flags |= Flags.hasCachedChildNodes;
}
/**
* Given a DOM node, return the closest ReactDOMComponent or
* ReactDOMTextComponent instance ancestor.
*/
function getClosestInstanceFromNode(node) {
if (node[internalInstanceKey]) {
return node[internalInstanceKey];
}
// Walk up the tree until we find an ancestor whose instance we have cached.
var parents = [];
while (!node[internalInstanceKey]) {
parents.push(node);
if (node.parentNode) {
node = node.parentNode;
} else {
// Top of the tree. This node must not be part of a React tree (or is
// unmounted, potentially).
return null;
}
}
var closest;
var inst;
for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
closest = inst;
if (parents.length) {
precacheChildNodes(inst, node);
}
}
return closest;
}
/**
* Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
* instance, or null if the node was not rendered by this React.
*/
function getInstanceFromNode(node) {
var inst = getClosestInstanceFromNode(node);
if (inst != null && inst._hostNode === node) {
return inst;
} else {
return null;
}
}
/**
* Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
* 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._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
if (inst._hostNode) {
return inst._hostNode;
}
// Walk up the tree until we find an ancestor whose DOM node we have cached.
var parents = [];
while (!inst._hostNode) {
parents.push(inst);
!inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
inst = inst._hostParent;
}
// Now parents contains each ancestor that does *not* have a cached native
// node, and `inst` is the deepest ancestor that does.
for (; parents.length; inst = parents.pop()) {
precacheChildNodes(inst, inst._hostNode);
}
return inst._hostNode;
}
var ReactDOMComponentTree = {
getClosestInstanceFromNode: getClosestInstanceFromNode,
getInstanceFromNode: getInstanceFromNode,
getNodeFromInstance: getNodeFromInstance,
precacheChildNodes: precacheChildNodes,
precacheNode: precacheNode,
uncacheNode: uncacheNode
};
module.exports = ReactDOMComponentTree;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 40 */
/***/ (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 directory.
*
*
*/
'use strict';
/**
* WARNING: DO NOT manually require this module.
* This is a replacement for `invariant(...)` used by the error code system
* and will _only_ be required by the corresponding babel pass.
* It always throws.
*/
function reactProdInvariant(code) {
var argCount = arguments.length - 1;
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
for (var argIdx = 0; argIdx < argCount; argIdx++) {
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
}
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
var error = new Error(message);
error.name = 'Invariant Violation';
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
throw error;
}
module.exports = reactProdInvariant;
/***/ }),
/* 41 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
}
var DOMPropertyInjection = {
/**
* Mapping from normalized, camelcased property names to a configuration that
* specifies how the associated DOM property should be accessed or rendered.
*/
MUST_USE_PROPERTY: 0x1,
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 config object
* with the following properties:
*
* isCustomAttribute: function that given an attribute name will return true
* if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
* attributes where it's impossible to enumerate all of the possible
* attribute names,
*
* Properties: object mapping DOM property name to one of the
* DOMPropertyInjection constants or null. If your attribute isn't in here,
* it won't get written to the DOM.
*
* 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 namespace.)
*
* DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
* Property names not specified use the normalized name.
*
* DOMMutationMethods: Properties that require special mutation methods. If
* `value` is undefined, the mutation method should unset the property.
*
* @param {object} domPropertyConfig the config as described above.
*/
injectDOMPropertyConfig: function (domPropertyConfig) {
var Injection = DOMPropertyInjection;
var Properties = domPropertyConfig.Properties || {};
var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
if (domPropertyConfig.isCustomAttribute) {
DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
}
for (var propName in Properties) {
!!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0;
var lowerCased = propName.toLowerCase();
var propConfig = Properties[propName];
var propertyInfo = {
attributeName: lowerCased,
attributeNamespace: null,
propertyName: propName,
mutationMethod: null,
mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
};
!(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
if (process.env.NODE_ENV !== 'production') {
DOMProperty.getPossibleStandardName[lowerCased] = propName;
}
if (DOMAttributeNames.hasOwnProperty(propName)) {
var attributeName = DOMAttributeNames[propName];
propertyInfo.attributeName = attributeName;
if (process.env.NODE_ENV !== 'production') {
DOMProperty.getPossibleStandardName[attributeName] = propName;
}
}
if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
}
if (DOMPropertyNames.hasOwnProperty(propName)) {
propertyInfo.propertyName = DOMPropertyNames[propName];
}
if (DOMMutationMethods.hasOwnProperty(propName)) {
propertyInfo.mutationMethod = DOMMutationMethods[propName];
}
DOMProperty.properties[propName] = propertyInfo;
}
}
};
/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
/* eslint-enable max-len */
/**
* DOMProperty exports lookup objects that can be used like functions:
*
* > DOMProperty.isValid['id']
* true
* > DOMProperty.isValid['foobar']
* undefined
*
* Although this may be confusing, it performs better in general.
*
* @see http://jsperf.com/key-exists
* @see http://jsperf.com/key-missing
*/
var DOMProperty = {
ID_ATTRIBUTE_NAME: 'data-reactid',
ROOT_ATTRIBUTE_NAME: 'data-reactroot',
ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
/**
* Map from property "standard name" to an object with info about how to set
* the property in the DOM. Each object contains:
*
* attributeName:
* Used when rendering markup or with `*Attribute()`.
* 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()` after
* initial render.
* mustUseProperty:
* Whether the property must be accessed and mutated as an object property.
* 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 should be
* removed when set to a falsey value.
* hasPositiveNumericValue:
* Whether the property must be positive numeric or parse as a positive
* 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 value.
* Removed when strictly equal to false; present without a value when
* 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__.
*
* autofocus is predefined, because adding it to the property whitelist
* causes unintended side effects.
*
* @type {Object}
*/
getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : null,
/**
* All of the isCustomAttribute() functions that have been injected.
*/
_isCustomAttributeFunctions: [],
/**
* Checks whether a property name is a custom attribute.
* @method
*/
isCustomAttribute: function (attributeName) {
for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
if (isCustomAttributeFn(attributeName)) {
return true;
}
}
return false;
},
injection: DOMPropertyInjection
};
module.exports = DOMProperty;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (process.env.NODE_ENV !== 'production') {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} 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__(4)))
/***/ }),
/* 43 */
/***/ (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 directory.
*
*/
'use strict';
var ReactDOMComponentFlags = {
hasCachedChildNodes: 1 << 0
};
module.exports = ReactDOMComponentFlags;
/***/ }),
/* 44 */
/***/ (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 directory.
*
*/
'use strict';
var ARIADOMPropertyConfig = __webpack_require__(45);
var BeforeInputEventPlugin = __webpack_require__(46);
var ChangeEventPlugin = __webpack_require__(64);
var DefaultEventPluginOrder = __webpack_require__(81);
var EnterLeaveEventPlugin = __webpack_require__(82);
var HTMLDOMPropertyConfig = __webpack_require__(87);
var ReactComponentBrowserEnvironment = __webpack_require__(88);
var ReactDOMComponent = __webpack_require__(101);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactDOMEmptyComponent = __webpack_require__(151);
var ReactDOMTreeTraversal = __webpack_require__(152);
var ReactDOMTextComponent = __webpack_require__(153);
var ReactDefaultBatchingStrategy = __webpack_require__(154);
var ReactEventListener = __webpack_require__(155);
var ReactInjection = __webpack_require__(158);
var ReactReconcileTransaction = __webpack_require__(159);
var SVGDOMPropertyConfig = __webpack_require__(167);
var SelectEventPlugin = __webpack_require__(168);
var SimpleEventPlugin = __webpack_require__(169);
var alreadyInjected = false;
function inject() {
if (alreadyInjected) {
// TODO: This is currently true because these injections are shared between
// the client and the server package. They should be built independently
// and not share any injection state. Then this problem will be solved.
return;
}
alreadyInjected = true;
ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
/**
* Inject modules for resolving DOM hierarchy and plugin ordering.
*/
ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
/**
* Some important event plugins included by default (without having to require
* them).
*/
ReactInjection.EventPluginHub.injectEventPluginsByName({
SimpleEventPlugin: SimpleEventPlugin,
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
ChangeEventPlugin: ChangeEventPlugin,
SelectEventPlugin: SelectEventPlugin,
BeforeInputEventPlugin: BeforeInputEventPlugin
});
ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
return new ReactDOMEmptyComponent(instantiate);
});
ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
}
module.exports = {
inject: inject
};
/***/ }),
/* 45 */
/***/ (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 directory.
*
*/
'use strict';
var ARIADOMPropertyConfig = {
Properties: {
// Global States and Properties
'aria-current': 0, // state
'aria-details': 0,
'aria-disabled': 0, // state
'aria-hidden': 0, // state
'aria-invalid': 0, // state
'aria-keyshortcuts': 0,
'aria-label': 0,
'aria-roledescription': 0,
// Widget Attributes
'aria-autocomplete': 0,
'aria-checked': 0,
'aria-expanded': 0,
'aria-haspopup': 0,
'aria-level': 0,
'aria-modal': 0,
'aria-multiline': 0,
'aria-multiselectable': 0,
'aria-orientation': 0,
'aria-placeholder': 0,
'aria-pressed': 0,
'aria-readonly': 0,
'aria-required': 0,
'aria-selected': 0,
'aria-sort': 0,
'aria-valuemax': 0,
'aria-valuemin': 0,
'aria-valuenow': 0,
'aria-valuetext': 0,
// Live Region Attributes
'aria-atomic': 0,
'aria-busy': 0,
'aria-live': 0,
'aria-relevant': 0,
// Drag-and-Drop Attributes
'aria-dropeffect': 0,
'aria-grabbed': 0,
// Relationship Attributes
'aria-activedescendant': 0,
'aria-colcount': 0,
'aria-colindex': 0,
'aria-colspan': 0,
'aria-controls': 0,
'aria-describedby': 0,
'aria-errormessage': 0,
'aria-flowto': 0,
'aria-labelledby': 0,
'aria-owns': 0,
'aria-posinset': 0,
'aria-rowcount': 0,
'aria-rowindex': 0,
'aria-rowspan': 0,
'aria-setsize': 0
},
DOMAttributeNames: {},
DOMPropertyNames: {}
};
module.exports = ARIADOMPropertyConfig;
/***/ }),
/* 46 */
/***/ (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 directory.
*
*/
'use strict';
var EventPropagators = __webpack_require__(47);
var ExecutionEnvironment = __webpack_require__(56);
var FallbackCompositionState = __webpack_require__(57);
var SyntheticCompositionEvent = __webpack_require__(61);
var SyntheticInputEvent = __webpack_require__(63);
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
var START_KEYCODE = 229;
var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
var documentMode = null;
if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
documentMode = document.documentMode;
}
// Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.
var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
// In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.
var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
/**
* Opera <= 12 includes TextEvent in window, but does not fire
* text input events. Rely on keypress instead.
*/
function isPresto() {
var opera = window.opera;
return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
}
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
// Events and their corresponding property names.
var eventTypes = {
beforeInput: {
phasedRegistrationNames: {
bubbled: 'onBeforeInput',
captured: 'onBeforeInputCapture'
},
dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']
},
compositionEnd: {
phasedRegistrationNames: {
bubbled: 'onCompositionEnd',
captured: 'onCompositionEndCapture'
},
dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
},
compositionStart: {
phasedRegistrationNames: {
bubbled: 'onCompositionStart',
captured: 'onCompositionStartCapture'
},
dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
},
compositionUpdate: {
phasedRegistrationNames: {
bubbled: 'onCompositionUpdate',
captured: 'onCompositionUpdateCapture'
},
dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', '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 commands
* (cut, copy, select-all, etc.) even though no character is inserted.
*/
function isKeypressCommand(nativeEvent) {
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
// 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 'topCompositionStart':
return eventTypes.compositionStart;
case 'topCompositionEnd':
return eventTypes.compositionEnd;
case '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 === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;
}
/**
* Does our fallback mode think that this event is the end of composition?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
switch (topLevelType) {
case 'topKeyUp':
// Command keys insert or clear IME input.
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
case 'topKeyDown':
// Expect IME keyCode on each keydown. If we get any other
// code we must have exited earlier.
return nativeEvent.keyCode !== START_KEYCODE;
case 'topKeyPress':
case 'topMouseDown':
case '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(nativeEventTarget);
} 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` event.
*/
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
switch (topLevelType) {
case 'topCompositionEnd':
return getDataFromCustomEvent(nativeEvent);
case 'topKeyPress':
/**
* If native `textInput` events are available, our goal is to make
* use of them. However, there is a special case: the spacebar key.
* In Webkit, preventing default on a spacebar `textInput` event
* cancels character insertion, but it *also* causes the browser
* to fall back to its default spacebar behavior of scrolling the
* page.
*
* Tracking at:
* https://code.google.com/p/chromium/issues/detail?id=355103
*
* To avoid this issue, use the keypress event as if no `textInput`
* event is available.
*/
var which = nativeEvent.which;
if (which !== SPACEBAR_CODE) {
return null;
}
hasSpaceKeypress = true;
return SPACEBAR_CHAR;
case '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 handled
// 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.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The fallback string for this `beforeInput` event.
*/
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
// If we are currently composing (IME) and using a fallback to do so,
// try to extract the composed characters from the fallback object.
// If composition event is available, we extract a string only at
// compositionevent, otherwise extract it at fallback events.
if (currentComposition) {
if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
var chars = currentComposition.getData();
FallbackCompositionState.release(currentComposition);
currentComposition = null;
return chars;
}
return null;
}
switch (topLevelType) {
case 'topPaste':
// If a paste event occurs after a keypress, throw out the input
// chars. Paste events should not lead to BeforeInput events.
return null;
case 'topKeyPress':
/**
* As of v27, Firefox may fire keypress events even when no character
* will be inserted. A few possibilities:
*
* - `which` is `0`. Arrow keys, Esc key, etc.
*
* - `which` is the pressed key code, but no char is available.
* Ex: 'AltGr + d` in Polish. There is no modified character for
* this key combination and no character is inserted into the
* document, but FF fires the keypress for char code `100` anyway.
* No `input` event will occur.
*
* - `which` is the pressed key code, but a command combination is
* being used. Ex: `Cmd+C`. No character is inserted, and no
* `input` event will occur.
*/
if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
return String.fromCharCode(nativeEvent.which);
}
return null;
case 'topCompositionEnd':
return useFallbackCompositionData ? null : nativeEvent.data;
default:
return null;
}
}
/**
* Extract a SyntheticInputEvent for `beforeInput`, based on either native
* `textInput` or fallback behavior.
*
* @return {?object} A SyntheticInputEvent.
*/
function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var chars;
if (canUseTextInputEvent) {
chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
} else {
chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
}
// If no characters are being inserted, no BeforeInput event should
// be fired.
if (!chars) {
return null;
}
var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
event.data = chars;
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
/**
* Create an `onBeforeInput` event to match
* http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
*
* This event plugin is based on the native `textInput` event
* available in Chrome, Safari, Opera, and IE. This event fires after
* `onKeyPress` and `onCompositionEnd`, but before `onInput`.
*
* `beforeInput` is spec'd but not implemented in any browsers, and
* the `input` event does not provide any useful information about what has
* actually been added, contrary to the spec. Thus, `textInput` is the best
* available event to identify the characters that have actually been inserted
* into the target node.
*
* This plugin is also responsible for emitting `composition` events, thus
* allowing us to share composition fallback code for both `beforeInput` and
* `composition` event types.
*/
var BeforeInputEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
}
};
module.exports = BeforeInputEventPlugin;
/***/ }),
/* 47 */
/***/ (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 directory.
*
*/
'use strict';
var EventPluginHub = __webpack_require__(48);
var EventPluginUtils = __webpack_require__(50);
var accumulateInto = __webpack_require__(54);
var forEachAccumulated = __webpack_require__(55);
var warning = __webpack_require__(52);
var getListener = EventPluginHub.getListener;
/**
* Some event types have a notion of different registration names for different
* "phases" of propagation. This finds listeners by a given phase.
*/
function listenerAtPhase(inst, event, propagationPhase) {
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
return getListener(inst, registrationName);
}
/**
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function
* here, allows us to not have to bind or create functions for each event.
* Mutating the event's members allows us to not have to create a wrapping
* "dispatch" object that pairs the event with the listener.
*/
function accumulateDirectionalDispatches(inst, phase, event) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
}
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 - see unit
* tests). Lazily allocate the array to conserve memory. We must loop through
* each event and perform the traversal for each one. We cannot perform a
* single traversal for the entire collection of events because each event may
* have a different target.
*/
function accumulateTwoPhaseDispatchesSingle(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
}
}
/**
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
*/
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
var targetInst = event._targetInst;
var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
}
}
/**
* Accumulates without regard to direction, does not look for phased
* registration names. Same as `accumulateDirectDispatchesSingle` but without
* 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);
}
}
}
/**
* Accumulates dispatches on an `SyntheticEvent`, but only for the
* `dispatchMarker`.
* @param {SyntheticEvent} event
*/
function accumulateDirectDispatchesSingle(event) {
if (event && event.dispatchConfig.registrationName) {
accumulateDispatches(event._targetInst, null, event);
}
}
function accumulateTwoPhaseDispatches(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}
function accumulateTwoPhaseDispatchesSkipTarget(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
}
function accumulateEnterLeaveDispatches(leave, enter, from, to) {
EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
}
function accumulateDirectDispatches(events) {
forEachAccumulated(events, accumulateDirectDispatchesSingle);
}
/**
* A small set of propagation patterns, each of which will accept a small amount
* of information, and generate a set of "dispatch ready event objects" - which
* are sets of events that have already been annotated with a set of dispatched
* listener functions/ids. The API is designed this way to discourage these
* propagation strategies from actually executing the dispatches, since we
* always want to collect the entire set of dispatches before executing event a
* single one.
*
* @constructor EventPropagators
*/
var EventPropagators = {
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
accumulateDirectDispatches: accumulateDirectDispatches,
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
};
module.exports = EventPropagators;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 48 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var EventPluginRegistry = __webpack_require__(49);
var EventPluginUtils = __webpack_require__(50);
var ReactErrorUtils = __webpack_require__(51);
var accumulateInto = __webpack_require__(54);
var forEachAccumulated = __webpack_require__(55);
var invariant = __webpack_require__(42);
/**
* Internal store for event listeners
*/
var listenerBank = {};
/**
* Internal queue of events that have accumulated their dispatches and are
* waiting to have their dispatches executed.
*/
var eventQueue = null;
/**
* Dispatches an event and releases it back into the pool, unless persistent.
*
* @param {?object} event Synthetic event to be dispatched.
* @param {boolean} simulated If the event is simulated (changes exn behavior)
* @private
*/
var executeDispatchesAndRelease = function (event, simulated) {
if (event) {
EventPluginUtils.executeDispatchesInOrder(event, simulated);
if (!event.isPersistent()) {
event.constructor.release(event);
}
}
};
var executeDispatchesAndReleaseSimulated = function (e) {
return executeDispatchesAndRelease(e, true);
};
var executeDispatchesAndReleaseTopLevel = function (e) {
return executeDispatchesAndRelease(e, false);
};
var getDictionaryKey = function (inst) {
// Prevents V8 performance issue:
// https://github.com/facebook/react/pull/7232
return '.' + inst._rootNodeID;
};
function isInteractive(tag) {
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}
function shouldPreventMouseEvent(name, type, props) {
switch (name) {
case 'onClick':
case 'onClickCapture':
case 'onDoubleClick':
case 'onDoubleClickCapture':
case 'onMouseDown':
case 'onMouseDownCapture':
case 'onMouseMove':
case 'onMouseMoveCapture':
case 'onMouseUp':
case 'onMouseUpCapture':
return !!(props.disabled && isInteractive(type));
default:
return false;
}
}
/**
* This is a unified interface for event plugins to be installed and configured.
*
* Event plugins can implement the following properties:
*
* `extractEvents` {function(string, DOMEventTarget, string, object): *}
* Required. When a top-level event is fired, this method is expected to
* extract synthetic events that will in turn be queued and dispatched.
*
* `eventTypes` {object}
* Optional, plugins that fire events must publish a mapping of registration
* names that are used to register listeners. Values of this mapping must
* be objects that contain `registrationName` or `phasedRegistrationNames`.
*
* `executeDispatch` {function(object, function, string)}
* Optional, allows plugins to override how an event gets dispatched. By
* default, the listener is simply invoked.
*
* Each plugin that is injected into `EventsPluginHub` is immediately operable.
*
* @public
*/
var EventPluginHub = {
/**
* Methods for injecting dependencies.
*/
injection: {
/**
* @param {array} InjectedEventPluginOrder
* @public
*/
injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
/**
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
*/
injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
},
/**
* Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
*
* @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 !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
var key = getDictionaryKey(inst);
var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
bankForRegistrationName[key] = listener;
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
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) {
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
// live here; needs to be moved to a better place soon
var bankForRegistrationName = listenerBank[registrationName];
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) {
return null;
}
var key = getDictionaryKey(inst);
return bankForRegistrationName && bankForRegistrationName[key];
},
/**
* 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[registrationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(inst, registrationName);
}
var bankForRegistrationName = listenerBank[registrationName];
// TODO: This should never be null -- when is it?
if (bankForRegistrationName) {
var key = getDictionaryKey(inst);
delete bankForRegistrationName[key];
}
},
/**
* 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) {
var key = getDictionaryKey(inst);
for (var registrationName in listenerBank) {
if (!listenerBank.hasOwnProperty(registrationName)) {
continue;
}
if (!listenerBank[registrationName][key]) {
continue;
}
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(inst, registrationName);
}
delete listenerBank[registrationName][key];
}
},
/**
* 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, nativeEventTarget) {
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, executeDispatchesAndReleaseSimulated);
} else {
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
}
!!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : 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__(4)))
/***/ }),
/* 49 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
/**
* 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 ordering.
*
* @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' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
if (EventPluginRegistry.plugins[pluginIndex]) {
continue;
}
!pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
EventPluginRegistry.plugins[pluginIndex] = pluginModule;
var publishedEvents = pluginModule.eventTypes;
for (var eventName in publishedEvents) {
!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
}
}
}
/**
* Publishes an event so that it can be dispatched by the supplied plugin.
*
* @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(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
if (phasedRegistrationNames) {
for (var phaseName in phasedRegistrationNames) {
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
var phasedRegistrationName = phasedRegistrationNames[phaseName];
publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
}
}
return true;
} else if (dispatchConfig.registrationName) {
publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
return true;
}
return false;
}
/**
* Publishes a registration name that is used to identify dispatched events 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, eventName) {
!!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
EventPluginRegistry.registrationNameModules[registrationName] = pluginModule;
EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
if (process.env.NODE_ENV !== 'production') {
var lowerCasedName = registrationName.toLowerCase();
EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
if (registrationName === 'onDoubleClick') {
EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
}
}
}
/**
* 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 version,
* used to warn in the case of missing event handlers. Available
* only in __DEV__.
* @type {Object}
*/
possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null,
// Trust the developer to only use possibleRegistrationNames in __DEV__
/**
* Injects an ordering of plugins (by plugin name). This allows the ordering
* to be decoupled from injection of the actual plugins so that ordering is
* always deterministic regardless of packaging, on-the-fly injection, etc.
*
* @param {array} InjectedEventPluginOrder
* @internal
* @see {EventPluginHub.injection.injectEventPluginOrder}
*/
injectEventPluginOrder: function (injectedEventPluginOrder) {
!!eventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0;
// Clone the ordering so it cannot be dynamically mutated.
eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
recomputePluginOrdering();
},
/**
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
* in the ordering injected by `injectEventPluginOrder`.
*
* Plugins can be injected as part of page initialization or on-the-fly.
*
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
* @internal
* @see {EventPluginHub.injection.injectEventPluginsByName}
*/
injectEventPluginsByName: function (injectedNamesToPlugins) {
var isOrderingDirty = false;
for (var pluginName in injectedNamesToPlugins) {
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
continue;
}
var pluginModule = injectedNamesToPlugins[pluginName];
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
!!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
namesToPlugins[pluginName] = pluginModule;
isOrderingDirty = true;
}
}
if (isOrderingDirty) {
recomputePluginOrdering();
}
},
/**
* Looks up the plugin for the supplied event.
*
* @param {object} event A synthetic event.
* @return {?object} The plugin that created the supplied event.
* @internal
*/
getPluginModuleForEvent: function (event) {
var dispatchConfig = event.dispatchConfig;
if (dispatchConfig.registrationName) {
return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
}
if (dispatchConfig.phasedRegistrationNames !== undefined) {
// pulling phasedRegistrationNames out of dispatchConfig helps Flow see
// that it is not undefined.
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
for (var phase in phasedRegistrationNames) {
if (!phasedRegistrationNames.hasOwnProperty(phase)) {
continue;
}
var pluginModule = EventPluginRegistry.registrationNameModules[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.eventNameDispatchConfigs;
for (var eventName in eventNameDispatchConfigs) {
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
delete eventNameDispatchConfigs[eventName];
}
}
var registrationNameModules = EventPluginRegistry.registrationNameModules;
for (var registrationName in registrationNameModules) {
if (registrationNameModules.hasOwnProperty(registrationName)) {
delete registrationNameModules[registrationName];
}
}
if (process.env.NODE_ENV !== 'production') {
var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
for (var lowerCasedName in possibleRegistrationNames) {
if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
delete possibleRegistrationNames[lowerCasedName];
}
}
}
}
};
module.exports = EventPluginRegistry;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 50 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var ReactErrorUtils = __webpack_require__(51);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
/**
* Injected dependencies:
*/
/**
* - `ComponentTree`: [required] Module that can convert between React instances
* 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 && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
}
},
injectTreeTraversal: function (Injected) {
TreeTraversal = Injected;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
}
}
};
function isEndish(topLevelType) {
return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel';
}
function isMoveish(topLevelType) {
return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
}
function isStartish(topLevelType) {
return topLevelType === 'topMouseDown' || topLevelType === '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 : dispatchListeners ? 1 : 0;
var instancesIsArr = Array.isArray(dispatchInstances);
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
};
}
/**
* Dispatch the event to the listener.
* @param {SyntheticEvent} event SyntheticEvent to handle
* @param {boolean} simulated If the event is simulated (changes exn behavior)
* @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], dispatchInstances[i]);
}
} else if (dispatchListeners) {
executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
}
event._dispatchListeners = null;
event._dispatchInstances = null;
}
/**
* Standard/simple iteration through an event's collected dispatches, but stops
* at the first dispatch execution returning true, and returns that id.
*
* @return {?string} id of the first dispatch execution who's listener returns
* 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 really make
* sense for an event with multiple dispatches (bubbled) to keep track of the
* return values at each dispatch execution, but it does tend to make sense 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 !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(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 greater than 0.
*/
function hasDispatches(event) {
return !!event._dispatchListeners;
}
/**
* General utilities that are useful in creating custom Event Plugins.
*/
var EventPluginUtils = {
isEndish: isEndish,
isMoveish: isMoveish,
isStartish: isStartish,
executeDirectDispatch: executeDirectDispatch,
executeDispatchesInOrder: executeDispatchesInOrder,
executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
hasDispatches: hasDispatches,
getInstanceFromNode: function (node) {
return ComponentTree.getInstanceFromNode(node);
},
getNodeFromInstance: function (node) {
return ComponentTree.getNodeFromInstance(node);
},
isAncestor: function (a, b) {
return TreeTraversal.isAncestor(a, b);
},
getLowestCommonAncestor: function (a, b) {
return TreeTraversal.getLowestCommonAncestor(a, b);
},
getParentInstance: function (inst) {
return TreeTraversal.getParentInstance(inst);
},
traverseTwoPhase: function (target, fn, arg) {
return TreeTraversal.traverseTwoPhase(target, fn, arg);
},
traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
},
injection: injection
};
module.exports = EventPluginUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 51 */
/***/ (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 directory.
*
*
*/
'use strict';
var caughtError = null;
/**
* Call a function while guarding against errors that happens within it.
*
* @param {String} name of the guard to use for logging or debugging
* @param {Function} func The function to invoke
* @param {*} a First argument
* @param {*} b Second argument
*/
function invokeGuardedCallback(name, func, a) {
try {
func(a);
} catch (x) {
if (caughtError === null) {
caughtError = x;
}
}
}
var ReactErrorUtils = {
invokeGuardedCallback: invokeGuardedCallback,
/**
* Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
* handler are sure to be rethrown by rethrowCaughtError.
*/
invokeGuardedCallbackWithCatch: invokeGuardedCallback,
/**
* During execution of guarded functions we will capture the first error which
* we will rethrow to be handled by the top level error handler.
*/
rethrowCaughtError: function () {
if (caughtError) {
var error = caughtError;
caughtError = null;
throw error;
}
}
};
if (process.env.NODE_ENV !== 'production') {
/**
* To help development we can get better devtools integration by simulating a
* real browser event.
*/
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
var fakeNode = document.createElement('react');
ReactErrorUtils.invokeGuardedCallback = function (name, func, a) {
var boundFunc = func.bind(null, a);
var evtType = 'react-' + name;
fakeNode.addEventListener(evtType, boundFunc, false);
var evt = document.createEvent('Event');
evt.initEvent(evtType, false, false);
fakeNode.dispatchEvent(evt);
fakeNode.removeEventListener(evtType, boundFunc, false);
};
}
}
module.exports = ReactErrorUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-2015, 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 directory.
*
*/
'use strict';
var emptyFunction = __webpack_require__(53);
/**
* 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 critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
(function () {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
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 this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
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) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
})();
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 53 */
/***/ (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 directory.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = 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;
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
/**
* Accumulates items that must not be null or undefined into the first one. This
* is used to conserve memory by avoiding array allocations, and thus sacrifices
* 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 cleaner.
*
* @return {*|array<*>} An accumulation of items.
*/
function accumulateInto(current, next) {
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
if (current == null) {
return next;
}
// Both are not empty. Warning: Never call x.concat(y) when you are not
// certain that x is an Array (x could be a string with concat method).
if (Array.isArray(current)) {
if (Array.isArray(next)) {
current.push.apply(current, next);
return current;
}
current.push(next);
return current;
}
if (Array.isArray(next)) {
// A bit too dangerous to mutate `next`.
return [current].concat(next);
}
return [current, next];
}
module.exports = accumulateInto;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 55 */
/***/ (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 directory.
*
*
*/
'use strict';
/**
* @param {array} arr an "accumulation" of items which is either an Array or
* a single item. Useful when paired with the `accumulate` module. This is a
* simple utility that allows us to reason about a collection of items, but
* handling the case when there is exactly one item (and we do not need to
* allocate an array).
*/
function forEachAccumulated(arr, cb, scope) {
if (Array.isArray(arr)) {
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
}
}
module.exports = forEachAccumulated;
/***/ }),
/* 56 */
/***/ (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 directory.
*
*/
'use strict';
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/**
* Simple, lightweight module assisting with the detection and context of
* Worker. Helps avoid circular dependencies and allows code to reason about
* whether or not they are in a Worker, even if they never include the main
* `ReactWorker` dependency.
*/
var ExecutionEnvironment = {
canUseDOM: canUseDOM,
canUseWorkers: typeof Worker !== 'undefined',
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
canUseViewport: canUseDOM && !!window.screen,
isInWorker: !canUseDOM // For now, this is true - might change in the future.
};
module.exports = ExecutionEnvironment;
/***/ }),
/* 57 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var PooledClass = __webpack_require__(59);
var getTextContentAccessor = __webpack_require__(60);
/**
* This helper class stores information about text content of a target node,
* allowing comparison of content before and after a given event.
*
* Identify the node where selection currently begins, then observe
* both its text content and its current position in the DOM. Since the
* browser may natively replace the target node during composition, we can
* 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()];
},
/**
* Determine the differing substring between the initially stored
* text content and the current content.
*
* @return {string}
*/
getData: function () {
if (this._fallbackText) {
return this._fallbackText;
}
var start;
var startValue = this._startText;
var startLength = startValue.length;
var end;
var endValue = this.getText();
var endLength = endValue.length;
for (start = 0; start < startLength; start++) {
if (startValue[start] !== endValue[start]) {
break;
}
}
var minEnd = startLength - start;
for (end = 1; end <= minEnd; end++) {
if (startValue[startLength - end] !== endValue[endLength - end]) {
break;
}
}
var sliceTail = end > 1 ? 1 - end : undefined;
this._fallbackText = endValue.slice(start, sliceTail);
return this._fallbackText;
}
});
PooledClass.addPoolingTo(FallbackCompositionState);
module.exports = FallbackCompositionState;
/***/ }),
/* 58 */
/***/ (function(module, exports) {
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
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 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
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(function (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 (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
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 (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 59 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but would
* require accessing the `arguments` object. In each of these, `this` refers to
* the Class itself, not an instance. If any others are needed, simply add 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 {
return new Klass(copyFieldsFrom);
}
};
var twoArgumentPooler = function (a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var threeArgumentPooler = function (a1, a2, a3) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3);
return instance;
} else {
return new Klass(a1, a2, a3);
}
};
var fourArgumentPooler = function (a1, a2, a3, a4) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3, a4);
return instance;
} else {
return new Klass(a1, a2, a3, a4);
}
};
var standardReleaser = function (instance) {
var Klass = this;
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = oneArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances.
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function (CopyConstructor, pooler) {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
oneArgumentPooler: oneArgumentPooler,
twoArgumentPooler: twoArgumentPooler,
threeArgumentPooler: threeArgumentPooler,
fourArgumentPooler: fourArgumentPooler
};
module.exports = PooledClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 60 */
/***/ (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 directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(56);
var contentKey = null;
/**
* Gets the key used to access text content on a DOM node.
*
* @return {?string} Key used to access text content.
* @internal
*/
function getTextContentAccessor() {
if (!contentKey && ExecutionEnvironment.canUseDOM) {
// Prefer textContent to innerText because many browsers support both but
// SVG <text> elements don't support innerText even when <div> does.
contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
}
return contentKey;
}
module.exports = getTextContentAccessor;
/***/ }),
/* 61 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(62);
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
*/
var CompositionEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
module.exports = SyntheticCompositionEvent;
/***/ }),
/* 62 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var PooledClass = __webpack_require__(59);
var emptyFunction = __webpack_require__(53);
var warning = __webpack_require__(52);
var didWarnForAddedNewProperty = false;
var isProxySupported = typeof Proxy === 'function';
var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', '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 response 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 whether 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 API by
* normalizing browser quirks. Subclasses do not necessarily have to implement a
* DOM interface; custom application-specific events can also subclass this.
*
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {*} targetInst Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @param {DOMEventTarget} nativeEventTarget Target node.
*/
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
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];
}
}
}
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
if (defaultPrevented) {
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
} else {
this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
}
this.isPropagationStopped = emptyFunction.thatReturnsFalse;
return this;
}
_assign(SyntheticEvent.prototype, {
preventDefault: function () {
this.defaultPrevented = true;
var event = this.nativeEvent;
if (!event) {
return;
}
if (event.preventDefault) {
event.preventDefault();
} else if (typeof event.returnValue !== 'unknown') {
// eslint-disable-line valid-typeof
event.returnValue = false;
}
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
},
stopPropagation: function () {
var event = this.nativeEvent;
if (!event) {
return;
}
if (event.stopPropagation) {
event.stopPropagation();
} else if (typeof event.cancelBubble !== 'unknown') {
// eslint-disable-line valid-typeof
// The ChangeEventPlugin registers a "propertychange" event for
// IE. This event does not support bubbling or cancelling, and
// any references to cancelBubble throw "Member not found". A
// typeof check of "unknown" circumvents this issue (and is also
// IE specific).
event.cancelBubble = true;
}
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
},
/**
* We release all dispatched `SyntheticEvent`s after each event loop, adding
* them back into the pool. This allows a way to hold onto a reference that
* won't be added back into the pool.
*/
persist: function () {
this.isPersistent = emptyFunction.thatReturnsTrue;
},
/**
* Checks if this event should be released back into the pool.
*
* @return {boolean} True if this should not be released, false otherwise.
*/
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, getPooledWarningPropertyDefinition(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') {
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
}
}
});
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(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
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 destructing
*
* @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 property';
warn(action, 'This is effectively a no-op');
return val;
}
function get() {
var action = isFunction ? 'accessing the method' : 'accessing the property';
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, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 63 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(62);
/**
* @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 event.
* @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, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
module.exports = SyntheticInputEvent;
/***/ }),
/* 64 */
/***/ (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 directory.
*
*/
'use strict';
var EventPluginHub = __webpack_require__(48);
var EventPropagators = __webpack_require__(47);
var ExecutionEnvironment = __webpack_require__(56);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactUpdates = __webpack_require__(65);
var SyntheticEvent = __webpack_require__(62);
var getEventTarget = __webpack_require__(78);
var isEventSupported = __webpack_require__(79);
var isTextInputElement = __webpack_require__(80);
var eventTypes = {
change: {
phasedRegistrationNames: {
bubbled: 'onChange',
captured: 'onChangeCapture'
},
dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
}
};
/**
* For IE shims
*/
var activeElement = null;
var activeElementInst = null;
var activeElementValue = null;
var activeElementValueProp = null;
/**
* SECTION: handle `change` event
*/
function shouldUseChangeEvent(elem) {
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}
var doesChangeEventBubble = false;
if (ExecutionEnvironment.canUseDOM) {
// See `handleChange` comment below
doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
}
function manualDispatchChangeEvent(nativeEvent) {
var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, 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 enqueue and
// process the abstract event manually.
//
// Batching is necessary here in order to ensure that all event handlers run
// before the next rerender (including event handlers attached to ancestor
// elements instead of directly on the input). Without this, controlled
// components don't work properly in conjunction with event bubbling because
// the component is rerendered and the value reverted before all the event
// 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 === 'topChange') {
return targetInst;
}
}
function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
if (topLevelType === '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 === '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') && (!document.documentMode || 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 events from
* value changes in JS.
*/
function startWatchingForValueChange(target, targetInst) {
activeElement = target;
activeElementInst = targetInst;
activeElementValue = target.value;
activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
// Not guarded in a canDefineProperty check: IE8 supports defineProperty only
// on DOM elements
Object.defineProperty(activeElement, 'value', newValueProp);
if (activeElement.attachEvent) {
activeElement.attachEvent('onpropertychange', handlePropertyChange);
} else {
activeElement.addEventListener('propertychange', handlePropertyChange, 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', handlePropertyChange, false);
}
activeElement = null;
activeElementInst = null;
activeElementValue = null;
activeElementValueProp = null;
}
/**
* (For IE <=11) Handles a propertychange event, sending a `change` event 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 === 'topInput') {
// In modern browsers (i.e., not IE8 or IE9), the input event is exactly
// what we want so fall through here and trigger an abstract event
return targetInst;
}
}
function handleEventsForInputEventIE(topLevelType, target, targetInst) {
if (topLevelType === '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 buggy and
// doesn't fire when text is deleted, but conveniently, selectionchange
// appears to fire in all of the remaining cases so we catch those and
// forward the event if the value has changed
// In either case, we don't want to call the event handler if the value
// is changed from JS so we redefine a setter for `.value` that updates
// our activeElementValue variable, allowing us to ignore those changes
//
// 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 === 'topBlur') {
stopWatchingForValueChange();
}
}
// For IE8 and IE9.
function getTargetInstForInputEventIE(topLevelType, targetInst) {
if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
// On the selectionchange event, the target is just document which isn'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` from a
// script and fires only keydown, keypress, keyup. Catching keyup usually
// 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: right
// before the second keystroke). Other input methods (e.g., paste) seem 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 inputs.
// This approach works across all browsers, whereas `change` does not fire
// until `blur` in IE8.
return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}
function getTargetInstForClickEvent(topLevelType, targetInst) {
if (topLevelType === 'topClick') {
return targetInst;
}
}
function handleControlledInputBlur(inst, node) {
// TODO: In IE, inst is occasionally null. Why?
if (inst == null) {
return;
}
// Fiber and ReactDOM keep wrapper state in separate places
var state = inst._wrapperState || node._wrapperState;
if (!state || !state.controlled || node.type !== 'number') {
return;
}
// If controlled, assign the value attribute to the current value on blur
var value = '' + node.value;
if (node.getAttribute('value') !== value) {
node.setAttribute('value', value);
}
}
/**
* This plugin creates an `onChange` event that normalizes change events
* across form elements. This event fires at a time when it's possible to
* 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, nativeEventTarget) {
var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(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, nativeEvent, nativeEventTarget);
event.type = 'change';
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(topLevelType, targetNode, targetInst);
}
// When blurring, set the value attribute for number inputs
if (topLevelType === 'topBlur') {
handleControlledInputBlur(targetInst, targetNode);
}
}
};
module.exports = ChangeEventPlugin;
/***/ }),
/* 65 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40),
_assign = __webpack_require__(58);
var CallbackQueue = __webpack_require__(66);
var PooledClass = __webpack_require__(59);
var ReactFeatureFlags = __webpack_require__(67);
var ReactReconciler = __webpack_require__(68);
var Transaction = __webpack_require__(77);
var invariant = __webpack_require__(42);
var dirtyComponents = [];
var updateBatchNumber = 0;
var asapCallbackQueue = CallbackQueue.getPooled();
var asapEnqueued = false;
var batchingStrategy = null;
function ensureInjected() {
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
}
var NESTED_UPDATES = {
initialize: function () {
this.dirtyComponentsLength = dirtyComponents.length;
},
close: function () {
if (this.dirtyComponentsLength !== dirtyComponents.length) {
// Additional updates were enqueued by componentDidUpdate handlers or
// similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
// these new updates so that if A's componentDidUpdate calls setState on
// B, B will update before the callback A's updater provided when calling
// setState.
dirtyComponents.splice(0, this.dirtyComponentsLength);
flushBatchedUpdates();
} else {
dirtyComponents.length = 0;
}
}
};
var UPDATE_QUEUEING = {
initialize: function () {
this.callbackQueue.reset();
},
close: function () {
this.callbackQueue.notifyAll();
}
};
var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
function ReactUpdatesFlushTransaction() {
this.reinitializeTransaction();
this.dirtyComponentsLength = null;
this.callbackQueue = CallbackQueue.getPooled();
this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
/* useCreateElement */true);
}
_assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
destructor: function () {
this.dirtyComponentsLength = null;
CallbackQueue.release(this.callbackQueue);
this.callbackQueue = null;
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
this.reconcileTransaction = null;
},
perform: function (method, scope, a) {
// Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
// with this transaction's wrappers around it.
return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
}
});
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
function batchedUpdates(callback, a, b, c, d, e) {
ensureInjected();
return 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 !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
// Since reconciling a component higher in the owner hierarchy usually (not
// always -- see shouldComponentUpdate()) will reconcile children, reconcile
// them before their children by sorting the array.
dirtyComponents.sort(mountOrderComparator);
// Any updates enqueued while reconciling must be performed after this entire
// batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
// C, B could update twice in a single batch if C's render enqueues an update
// to B (since B would have already updated, we should skip it, and the only
// way we can know to do so is by checking the batch counter).
updateBatchNumber++;
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
// that performUpdateIfNecessary is a noop.
var component = dirtyComponents[i];
// If performUpdateIfNecessary happens to enqueue any new updates, we
// shouldn't execute the callbacks until the next render happens, so
// stash the callbacks first
var callbacks = component._pendingCallbacks;
component._pendingCallbacks = null;
var markerName;
if (ReactFeatureFlags.logTopLevelRenders) {
var namedComponent = component;
// Duck type TopLevelWrapper. This is probably always true.
if (component._currentElement.type.isReactTopLevelWrapper) {
namedComponent = component._renderedComponent;
}
markerName = 'React update: ' + namedComponent.getName();
console.time(markerName);
}
ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
if (markerName) {
console.timeEnd(markerName);
}
if (callbacks) {
for (var j = 0; j < callbacks.length; j++) {
transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
}
}
}
}
var flushBatchedUpdates = function () {
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
// array and perform any updates enqueued by mount-ready handlers (i.e.,
// componentDidUpdate) but we need to check here too in order to catch
// updates enqueued by setState callbacks and asap calls.
while (dirtyComponents.length || asapEnqueued) {
if (dirtyComponents.length) {
var transaction = ReactUpdatesFlushTransaction.getPooled();
transaction.perform(runBatchedUpdates, null, transaction);
ReactUpdatesFlushTransaction.release(transaction);
}
if (asapEnqueued) {
asapEnqueued = false;
var queue = asapCallbackQueue;
asapCallbackQueue = CallbackQueue.getPooled();
queue.notifyAll();
CallbackQueue.release(queue);
}
}
};
/**
* Mark a component as needing a rerender, adding an optional callback to 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 nested;
// verify that that's the case. (This is called by each top-level update
// function, like 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);
if (component._updateBatchNumber == null) {
component._updateBatchNumber = updateBatchNumber + 1;
}
}
/**
* 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 !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
asapCallbackQueue.enqueue(callback, context);
asapEnqueued = true;
}
var ReactUpdatesInjection = {
injectReconcileTransaction: function (ReconcileTransaction) {
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
},
injectBatchingStrategy: function (_batchingStrategy) {
!_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
!(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : 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__(4)))
/***/ }),
/* 66 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PooledClass = __webpack_require__(59);
var invariant = __webpack_require__(42);
/**
* A specialized pseudo-event module to help keep track of components waiting to
* be notified when their DOM representations are available for use.
*
* This implements `PooledClass`, so you should never need to instantiate this.
* Instead, use `CallbackQueue.getPooled()`.
*
* @class ReactMountReady
* @implements PooledClass
* @internal
*/
var CallbackQueue = function () {
function CallbackQueue(arg) {
_classCallCheck(this, CallbackQueue);
this._callbacks = null;
this._contexts = null;
this._arg = arg;
}
/**
* 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
*/
CallbackQueue.prototype.enqueue = function enqueue(callback, context) {
this._callbacks = this._callbacks || [];
this._callbacks.push(callback);
this._contexts = this._contexts || [];
this._contexts.push(context);
};
/**
* Invokes all enqueued callbacks and clears the queue. This is invoked after
* the DOM representation of a component has been created or updated.
*
* @internal
*/
CallbackQueue.prototype.notifyAll = function notifyAll() {
var callbacks = this._callbacks;
var contexts = this._contexts;
var arg = this._arg;
if (callbacks && contexts) {
!(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
this._callbacks = null;
this._contexts = null;
for (var i = 0; i < callbacks.length; i++) {
callbacks[i].call(contexts[i], arg);
}
callbacks.length = 0;
contexts.length = 0;
}
};
CallbackQueue.prototype.checkpoint = function checkpoint() {
return this._callbacks ? this._callbacks.length : 0;
};
CallbackQueue.prototype.rollback = function rollback(len) {
if (this._callbacks && this._contexts) {
this._callbacks.length = len;
this._contexts.length = len;
}
};
/**
* Resets the internal queue.
*
* @internal
*/
CallbackQueue.prototype.reset = function reset() {
this._callbacks = null;
this._contexts = null;
};
/**
* `PooledClass` looks for this.
*/
CallbackQueue.prototype.destructor = function destructor() {
this.reset();
};
return CallbackQueue;
}();
module.exports = PooledClass.addPoolingTo(CallbackQueue);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 67 */
/***/ (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 directory.
*
*
*/
'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 prod-mode
// timeline profiles in Chrome, for example.
logTopLevelRenders: false
};
module.exports = ReactFeatureFlags;
/***/ }),
/* 68 */
/***/ (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 directory.
*
*/
'use strict';
var ReactRef = __webpack_require__(69);
var ReactInstrumentation = __webpack_require__(71);
var warning = __webpack_require__(52);
/**
* Helper to call ReactRef.attachRefs with this composite component, split 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 listeners.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?object} the containing host component instance
* @param {?object} info about the host container
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
) {
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
}
}
var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
}
}
return markup;
},
/**
* Returns a value that can be passed to
* ReactComponentEnvironment.replaceNodeWithMarkup.
*/
getHostNode: function (internalInstance) {
return internalInstance.getHostNode();
},
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function (internalInstance, safely) {
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
}
}
ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
internalInstance.unmountComponent(safely);
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
}
}
},
/**
* 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._context) {
// 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 but such
// change should trigger an update of the owner which would recreate
// 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;
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
}
}
var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
if (refsChanged) {
ReactRef.detachRefs(internalInstance, prevElement);
}
internalInstance.receiveComponent(nextElement, transaction, context);
if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
}
}
},
/**
* Flush any dirty changes in a component.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
if (internalInstance._updateBatchNumber !== updateBatchNumber) {
// The component's enqueued batch number should always be the current
// batch or the following one.
process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
return;
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
}
}
internalInstance.performUpdateIfNecessary(transaction);
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
}
}
}
};
module.exports = ReactReconciler;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 69 */
/***/ (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 directory.
*
*
*/
'use strict';
var ReactOwner = __webpack_require__(70);
var ReactRef = {};
function attachRef(ref, component, owner) {
if (typeof ref === 'function') {
ref(component.getPublicInstance());
} else {
// Legacy ref
ReactOwner.addComponentAsRefTo(component, ref, owner);
}
}
function detachRef(ref, component, owner) {
if (typeof ref === 'function') {
ref(null);
} else {
// Legacy ref
ReactOwner.removeComponentAsRefFrom(component, ref, owner);
}
}
ReactRef.attachRefs = function (instance, element) {
if (element === null || typeof element !== 'object') {
return;
}
var ref = element.ref;
if (ref != null) {
attachRef(ref, instance, element._owner);
}
};
ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
// If either the owner or a `ref` has changed, make sure the newest owner
// has stored a reference to `this`, and the previous owner (if different)
// has forgotten the reference to `this`. We use the element instead
// of the public this.props because the post processing cannot determine
// a ref. The ref conceptually lives on the element.
// TODO: Should this even be possible? The owner cannot change because
// it's forbidden by shouldUpdateReactComponent. The ref can change
// if you swap the keys of but not the refs. Reconsider where this check
// is made. It probably belongs where the key checking and
// instantiateReactComponent is done.
var prevRef = null;
var prevOwner = null;
if (prevElement !== null && typeof prevElement === 'object') {
prevRef = prevElement.ref;
prevOwner = prevElement._owner;
}
var nextRef = null;
var nextOwner = null;
if (nextElement !== null && typeof nextElement === 'object') {
nextRef = nextElement.ref;
nextOwner = nextElement._owner;
}
return prevRef !== nextRef ||
// If owner changes but we have an unchanged function ref, don't update refs
typeof nextRef === 'string' && nextOwner !== prevOwner;
};
ReactRef.detachRefs = function (instance, element) {
if (element === null || typeof element !== 'object') {
return;
}
var ref = element.ref;
if (ref != null) {
detachRef(ref, instance, element._owner);
}
};
module.exports = ReactRef;
/***/ }),
/* 70 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
/**
* @param {?object} object
* @return {boolean} True if `object` is a valid owner.
* @final
*/
function isValidOwner(object) {
return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
}
/**
* ReactOwners are capable of storing references to owned components.
*
* All components are capable of //being// referenced by owner components, but
* only ReactOwner components are capable of //referencing// owned components.
* 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 done to
* control data that is not handled by React's data flow.
*
* @class ReactOwner
*/
var ReactOwner = {
/**
* 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) {
!isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 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) {
!isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : 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 stole it.
if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
owner.detachRef(ref);
}
}
};
module.exports = ReactOwner;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*
*/
'use strict';
// Trust the developer to only use ReactInstrumentation with a __DEV__ check
var debugTool = null;
if (process.env.NODE_ENV !== 'production') {
var ReactDebugTool = __webpack_require__(72);
debugTool = ReactDebugTool;
}
module.exports = { debugTool: debugTool };
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*
*/
'use strict';
var ReactInvalidSetStateWarningHook = __webpack_require__(73);
var ReactHostOperationHistoryHook = __webpack_require__(74);
var ReactComponentTreeHook = __webpack_require__(27);
var ExecutionEnvironment = __webpack_require__(56);
var performanceNow = __webpack_require__(75);
var warning = __webpack_require__(52);
var hooks = [];
var didHookThrowForEvent = {};
function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
try {
fn.call(context, arg1, arg2, arg3, arg4, arg5);
} catch (e) {
process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
didHookThrowForEvent[event] = true;
}
}
function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
for (var i = 0; i < hooks.length; i++) {
var hook = hooks[i];
var fn = hook[event];
if (fn) {
callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
}
}
}
var isProfiling = false;
var flushHistory = [];
var lifeCycleTimerStack = [];
var currentFlushNesting = 0;
var currentFlushMeasurements = [];
var currentFlushStartTime = 0;
var currentTimerDebugID = null;
var currentTimerStartTime = 0;
var currentTimerNestedFlushDuration = 0;
var currentTimerType = null;
var lifeCycleTimerHasWarned = false;
function clearHistory() {
ReactComponentTreeHook.purgeUnmountedComponents();
ReactHostOperationHistoryHook.clearHistory();
}
function getTreeSnapshot(registeredIDs) {
return registeredIDs.reduce(function (tree, id) {
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var parentID = ReactComponentTreeHook.getParentID(id);
tree[id] = {
displayName: ReactComponentTreeHook.getDisplayName(id),
text: ReactComponentTreeHook.getText(id),
updateCount: ReactComponentTreeHook.getUpdateCount(id),
childIDs: ReactComponentTreeHook.getChildIDs(id),
// Text nodes don't have owners but this is close enough.
ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0,
parentID: parentID
};
return tree;
}, {});
}
function resetMeasurements() {
var previousStartTime = currentFlushStartTime;
var previousMeasurements = currentFlushMeasurements;
var previousOperations = ReactHostOperationHistoryHook.getHistory();
if (currentFlushNesting === 0) {
currentFlushStartTime = 0;
currentFlushMeasurements = [];
clearHistory();
return;
}
if (previousMeasurements.length || previousOperations.length) {
var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
flushHistory.push({
duration: performanceNow() - previousStartTime,
measurements: previousMeasurements || [],
operations: previousOperations || [],
treeSnapshot: getTreeSnapshot(registeredIDs)
});
}
clearHistory();
currentFlushStartTime = performanceNow();
currentFlushMeasurements = [];
}
function checkDebugID(debugID) {
var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (allowRoot && debugID === 0) {
return;
}
if (!debugID) {
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
}
}
function beginLifeCycleTimer(debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
if (currentTimerType && !lifeCycleTimerHasWarned) {
process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
lifeCycleTimerHasWarned = true;
}
currentTimerStartTime = performanceNow();
currentTimerNestedFlushDuration = 0;
currentTimerDebugID = debugID;
currentTimerType = timerType;
}
function endLifeCycleTimer(debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
lifeCycleTimerHasWarned = true;
}
if (isProfiling) {
currentFlushMeasurements.push({
timerType: timerType,
instanceID: debugID,
duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
});
}
currentTimerStartTime = 0;
currentTimerNestedFlushDuration = 0;
currentTimerDebugID = null;
currentTimerType = null;
}
function pauseCurrentLifeCycleTimer() {
var currentTimer = {
startTime: currentTimerStartTime,
nestedFlushStartTime: performanceNow(),
debugID: currentTimerDebugID,
timerType: currentTimerType
};
lifeCycleTimerStack.push(currentTimer);
currentTimerStartTime = 0;
currentTimerNestedFlushDuration = 0;
currentTimerDebugID = null;
currentTimerType = null;
}
function resumeCurrentLifeCycleTimer() {
var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),
startTime = _lifeCycleTimerStack$.startTime,
nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,
debugID = _lifeCycleTimerStack$.debugID,
timerType = _lifeCycleTimerStack$.timerType;
var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
currentTimerStartTime = startTime;
currentTimerNestedFlushDuration += nestedFlushDuration;
currentTimerDebugID = debugID;
currentTimerType = timerType;
}
var lastMarkTimeStamp = 0;
var canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
function shouldMark(debugID) {
if (!isProfiling || !canUsePerformanceMeasure) {
return false;
}
var element = ReactComponentTreeHook.getElement(debugID);
if (element == null || typeof element !== 'object') {
return false;
}
var isHostElement = typeof element.type === 'string';
if (isHostElement) {
return false;
}
return true;
}
function markBegin(debugID, markType) {
if (!shouldMark(debugID)) {
return;
}
var markName = debugID + '::' + markType;
lastMarkTimeStamp = performanceNow();
performance.mark(markName);
}
function markEnd(debugID, markType) {
if (!shouldMark(debugID)) {
return;
}
var markName = debugID + '::' + markType;
var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown';
// Chrome has an issue of dropping markers recorded too fast:
// https://bugs.chromium.org/p/chromium/issues/detail?id=640652
// To work around this, we will not report very small measurements.
// I determined the magic number by tweaking it back and forth.
// 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe.
// When the bug is fixed, we can `measure()` unconditionally if we want to.
var timeStamp = performanceNow();
if (timeStamp - lastMarkTimeStamp > 0.1) {
var measurementName = displayName + ' [' + markType + ']';
performance.measure(measurementName, markName);
}
performance.clearMarks(markName);
performance.clearMeasures(measurementName);
}
var ReactDebugTool = {
addHook: function (hook) {
hooks.push(hook);
},
removeHook: function (hook) {
for (var i = 0; i < hooks.length; i++) {
if (hooks[i] === hook) {
hooks.splice(i, 1);
i--;
}
}
},
isProfiling: function () {
return isProfiling;
},
beginProfiling: function () {
if (isProfiling) {
return;
}
isProfiling = true;
flushHistory.length = 0;
resetMeasurements();
ReactDebugTool.addHook(ReactHostOperationHistoryHook);
},
endProfiling: function () {
if (!isProfiling) {
return;
}
isProfiling = false;
resetMeasurements();
ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
},
getFlushHistory: function () {
return flushHistory;
},
onBeginFlush: function () {
currentFlushNesting++;
resetMeasurements();
pauseCurrentLifeCycleTimer();
emitEvent('onBeginFlush');
},
onEndFlush: function () {
resetMeasurements();
currentFlushNesting--;
resumeCurrentLifeCycleTimer();
emitEvent('onEndFlush');
},
onBeginLifeCycleTimer: function (debugID, timerType) {
checkDebugID(debugID);
emitEvent('onBeginLifeCycleTimer', debugID, timerType);
markBegin(debugID, timerType);
beginLifeCycleTimer(debugID, timerType);
},
onEndLifeCycleTimer: function (debugID, timerType) {
checkDebugID(debugID);
endLifeCycleTimer(debugID, timerType);
markEnd(debugID, timerType);
emitEvent('onEndLifeCycleTimer', debugID, timerType);
},
onBeginProcessingChildContext: function () {
emitEvent('onBeginProcessingChildContext');
},
onEndProcessingChildContext: function () {
emitEvent('onEndProcessingChildContext');
},
onHostOperation: function (operation) {
checkDebugID(operation.instanceID);
emitEvent('onHostOperation', operation);
},
onSetState: function () {
emitEvent('onSetState');
},
onSetChildren: function (debugID, childDebugIDs) {
checkDebugID(debugID);
childDebugIDs.forEach(checkDebugID);
emitEvent('onSetChildren', debugID, childDebugIDs);
},
onBeforeMountComponent: function (debugID, element, parentDebugID) {
checkDebugID(debugID);
checkDebugID(parentDebugID, true);
emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
markBegin(debugID, 'mount');
},
onMountComponent: function (debugID) {
checkDebugID(debugID);
markEnd(debugID, 'mount');
emitEvent('onMountComponent', debugID);
},
onBeforeUpdateComponent: function (debugID, element) {
checkDebugID(debugID);
emitEvent('onBeforeUpdateComponent', debugID, element);
markBegin(debugID, 'update');
},
onUpdateComponent: function (debugID) {
checkDebugID(debugID);
markEnd(debugID, 'update');
emitEvent('onUpdateComponent', debugID);
},
onBeforeUnmountComponent: function (debugID) {
checkDebugID(debugID);
emitEvent('onBeforeUnmountComponent', debugID);
markBegin(debugID, 'unmount');
},
onUnmountComponent: function (debugID) {
checkDebugID(debugID);
markEnd(debugID, 'unmount');
emitEvent('onUnmountComponent', debugID);
},
onTestEvent: function () {
emitEvent('onTestEvent');
}
};
// TODO remove these when RN/www gets updated
ReactDebugTool.addDevtool = ReactDebugTool.addHook;
ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
ReactDebugTool.addHook(ReactComponentTreeHook);
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
if (/[?&]react_perf\b/.test(url)) {
ReactDebugTool.beginProfiling();
}
module.exports = ReactDebugTool;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*
*/
'use strict';
var warning = __webpack_require__(52);
if (process.env.NODE_ENV !== 'production') {
var processingChildContext = false;
var warnInvalidSetState = function () {
process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
};
}
var ReactInvalidSetStateWarningHook = {
onBeginProcessingChildContext: function () {
processingChildContext = true;
},
onEndProcessingChildContext: function () {
processingChildContext = false;
},
onSetState: function () {
warnInvalidSetState();
}
};
module.exports = ReactInvalidSetStateWarningHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 74 */
/***/ (function(module, exports) {
/**
* 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 directory.
*
*
*/
'use strict';
var history = [];
var ReactHostOperationHistoryHook = {
onHostOperation: function (operation) {
history.push(operation);
},
clearHistory: function () {
if (ReactHostOperationHistoryHook._preventClearing) {
// Should only be used for tests.
return;
}
history = [];
},
getHistory: function () {
return history;
}
};
module.exports = ReactHostOperationHistoryHook;
/***/ }),
/* 75 */
/***/ (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 directory.
*
* @typechecks
*/
var performance = __webpack_require__(76);
var performanceNow;
/**
* Detect if we can use `window.performance.now()` and gracefully fallback 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 performanceNow() {
return performance.now();
};
} else {
performanceNow = function performanceNow() {
return Date.now();
};
}
module.exports = performanceNow;
/***/ }),
/* 76 */
/***/ (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 directory.
*
* @typechecks
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(56);
var performance;
if (ExecutionEnvironment.canUseDOM) {
performance = window.performance || window.msPerformance || window.webkitPerformance;
}
module.exports = performance || {};
/***/ }),
/* 77 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
var OBSERVED_ERROR = {};
/**
* `Transaction` creates a black box that is able to wrap any method such that
* certain invariants are maintained before and after the method is invoked
* (Even if an exception is thrown while invoking the wrapped method). Whoever
* instantiates a transaction can provide enforcers of the invariants at
* creation time. The `Transaction` class itself will supply one additional
* automatic invariant for you - the invariant that any transaction instance
* 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 potentially
* is used to wrap several different methods. Wrappers are extremely simple -
* they only require implementing two methods.
*
* <pre>
* wrappers (injected at creation time)
* + +
* | |
* +-----------------|--------|--------------+
* | v | |
* | +---------------+ | |
* | +--| wrapper1 |---|----+ |
* | | +---------------+ v | |
* | | +-------------+ | |
* | | +----| wrapper2 |--------+ |
* | | | +-------------+ | | |
* | | | | | |
* | v v v v | wrapper
* | +---+ +---+ +---------+ +---+ +---+ | invariants
* perform(anyMethod) | | | | | | | | | | | | maintained
* +----------------->|-|---|-|---|-->|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/focuses,
* while guaranteeing that afterwards, the event system is reactivated.
* - Flushing a queue of collected DOM mutations to the main UI thread after a
* reconciliation takes place in a worker thread.
* - Invoking any collected `componentDidUpdate` callbacks after rendering new
* content.
* - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
* to preserve the `scrollTop` (an automatic scroll aware DOM).
* - (Future use case): Layout calculations before and after DOM updates.
*
* Transactional plugin API:
* - A module that has an `initialize` method that returns any precomputation.
* - and a `close` method that accepts the precomputation. `close` is invoked
* when the wrapped process is completed, or has failed.
*
* @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
* that implement `initialize` and `close`.
* @return {Transaction} Single transaction for reuse in thread.
*
* @class Transaction
*/
var TransactionImpl = {
/**
* Sets up this instance so that it is prepared for collecting metrics. Does
* so such that this setup method may be used on an instance that is already
* initialized, in a way that does not consume additional memory upon reuse.
* That can be useful if you decide to make your subclass of this mixin a
* "PooledClass".
*/
reinitializeTransaction: function () {
this.transactionWrappers = this.getTransactionWrappers();
if (this.wrapperInitData) {
this.wrapperInitData.length = 0;
} else {
this.wrapperInitData = [];
}
this._isInTransaction = false;
},
_isInTransaction: false,
/**
* @abstract
* @return {Array<TransactionWrapper>} Array of transaction wrappers.
*/
getTransactionWrappers: null,
isInTransaction: function () {
return !!this._isInTransaction;
},
/**
* Executes the function within a safety window. Use this for the top level
* methods that result in large amounts of computation/mutations that would
* need to be safety checked. The optional arguments helps prevent the 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' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
var errorThrown;
var ret;
try {
this._isInTransaction = true;
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// 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 any thrown
// by invoking `closeAll`.
try {
this.closeAll(0);
} catch (err) {}
} else {
// Since `method` didn't throw, we don't want to silence the exception
// 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 {
// Catching errors makes debugging more difficult, so we start with the
// OBSERVED_ERROR state before overwriting it with the real return value
// of initialize -- if it's still set to OBSERVED_ERROR in the finally
// block, it means wrapper.initialize threw.
this.wrapperInitData[i] = OBSERVED_ERROR;
this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
} finally {
if (this.wrapperInitData[i] === OBSERVED_ERROR) {
// The initializer for wrapper i threw an error; initialize the
// remaining wrappers but silence any exceptions from them to ensure
// that the first error is the one to bubble up.
try {
this.initializeAll(i + 1);
} catch (err) {}
}
}
}
},
/**
* Invokes each of `this.transactionWrappers.close[i]` functions, passing into
* them the respective return values of `this.transactionWrappers.init[i]`
* (`close`rs that correspond to initializers that failed will not be
* invoked).
*/
closeAll: function (startIndex) {
!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
var initData = this.wrapperInitData[i];
var errorThrown;
try {
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// wrapper.close threw.
errorThrown = true;
if (initData !== OBSERVED_ERROR && wrapper.close) {
wrapper.close.call(this, initData);
}
errorThrown = false;
} finally {
if (errorThrown) {
// The closer for wrapper i threw an error; close the remaining
// wrappers but silence any exceptions from them to ensure that the
// first error is the one to bubble up.
try {
this.closeAll(i + 1);
} catch (e) {}
}
}
}
this.wrapperInitData.length = 0;
}
};
module.exports = TransactionImpl;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 78 */
/***/ (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 directory.
*
*/
'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;
/***/ }),
/* 79 */
/***/ (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 directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(56);
var useHasFeature;
if (ExecutionEnvironment.canUseDOM) {
useHasFeature = document.implementation && document.implementation.hasFeature &&
// 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 `change`,
* `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;
/***/ }),
/* 80 */
/***/ (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 directory.
*
*
*/
'use strict';
/**
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-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();
if (nodeName === 'input') {
return !!supportedInputTypes[elem.type];
}
if (nodeName === 'textarea') {
return true;
}
return false;
}
module.exports = isTextInputElement;
/***/ }),
/* 81 */
/***/ (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 directory.
*
*/
'use strict';
/**
* 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 because
* that ordering would be influenced by the packaging order.
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
*/
var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
module.exports = DefaultEventPluginOrder;
/***/ }),
/* 82 */
/***/ (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 directory.
*
*/
'use strict';
var EventPropagators = __webpack_require__(47);
var ReactDOMComponentTree = __webpack_require__(39);
var SyntheticMouseEvent = __webpack_require__(83);
var eventTypes = {
mouseEnter: {
registrationName: 'onMouseEnter',
dependencies: ['topMouseOut', 'topMouseOver']
},
mouseLeave: {
registrationName: 'onMouseLeave',
dependencies: ['topMouseOut', 'topMouseOver']
}
};
var EnterLeaveEventPlugin = {
eventTypes: eventTypes,
/**
* For almost every interaction we care about, there will be both a top-level
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so 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, nativeEventTarget) {
if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
return null;
}
if (topLevelType !== 'topMouseOut' && topLevelType !== '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 === 'topMouseOut') {
from = targetInst;
var related = nativeEvent.relatedTarget || nativeEvent.toElement;
to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
} else {
// Moving to a node from outside the window.
from = null;
to = targetInst;
}
if (from === to) {
// Nothing pertains to our managed components.
return null;
}
var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
leave.type = 'mouseleave';
leave.target = fromNode;
leave.relatedTarget = toNode;
var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
enter.type = 'mouseenter';
enter.target = toNode;
enter.relatedTarget = fromNode;
EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
return [leave, enter];
}
};
module.exports = EnterLeaveEventPlugin;
/***/ }),
/* 83 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(84);
var ViewportMetrics = __webpack_require__(85);
var getEventModifierState = __webpack_require__(86);
/**
* @interface MouseEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var MouseEventInterface = {
screenX: null,
screenY: null,
clientX: null,
clientY: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
getModifierState: getEventModifierState,
button: function (event) {
// Webkit, Firefox, IE9+
// which: 1 2 3
// button: 0 1 2 (standard)
var button = event.button;
if ('which' in event) {
return button;
}
// IE<9
// which: undefined
// button: 0 0 0
// button: 1 4 2 (onmouseup)
return button === 2 ? 2 : button === 4 ? 1 : 0;
},
buttons: null,
relatedTarget: function (event) {
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
},
// "Proprietary" Interface.
pageX: function (event) {
return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
},
pageY: function (event) {
return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
module.exports = SyntheticMouseEvent;
/***/ }),
/* 84 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(62);
var getEventTarget = __webpack_require__(78);
/**
* @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.window === target) {
// target is a window object
return target;
}
var doc = target.ownerDocument;
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
if (doc) {
return doc.defaultView || doc.parentWindow;
} else {
return window;
}
},
detail: function (event) {
return event.detail || 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
module.exports = SyntheticUIEvent;
/***/ }),
/* 85 */
/***/ (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 directory.
*
*/
'use strict';
var ViewportMetrics = {
currentScrollLeft: 0,
currentScrollTop: 0,
refreshScrollValues: function (scrollPosition) {
ViewportMetrics.currentScrollLeft = scrollPosition.x;
ViewportMetrics.currentScrollTop = scrollPosition.y;
}
};
module.exports = ViewportMetrics;
/***/ }),
/* 86 */
/***/ (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 directory.
*
*/
'use strict';
/**
* Translation from modifier key to the associated property in the event.
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
*/
var modifierKeyToProp = {
'Alt': 'altKey',
'Control': 'ctrlKey',
'Meta': 'metaKey',
'Shift': 'shiftKey'
};
// IE8 does not implement getModifierState so we simply map it to the only
// modifier keys exposed by the event itself, does not support Lock-keys.
// Currently, all major browsers except Chrome seems to support Lock-keys.
function modifierStateGetter(keyArg) {
var syntheticEvent = this;
var nativeEvent = syntheticEvent.nativeEvent;
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg];
return keyProp ? !!nativeEvent[keyProp] : false;
}
function getEventModifierState(nativeEvent) {
return modifierStateGetter;
}
module.exports = getEventModifierState;
/***/ }),
/* 87 */
/***/ (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 directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(41);
var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
var HTMLDOMPropertyConfig = {
isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
Properties: {
/**
* Standard Properties
*/
accept: 0,
acceptCharset: 0,
accessKey: 0,
action: 0,
allowFullScreen: HAS_BOOLEAN_VALUE,
allowTransparency: 0,
alt: 0,
// specifies target context for links with `preload` type
as: 0,
async: HAS_BOOLEAN_VALUE,
autoComplete: 0,
// autoFocus is polyfilled/normalized by AutoFocusUtils
// autoFocus: HAS_BOOLEAN_VALUE,
autoPlay: HAS_BOOLEAN_VALUE,
capture: HAS_BOOLEAN_VALUE,
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,
playsInline: HAS_BOOLEAN_VALUE,
poster: 0,
preload: 0,
profile: 0,
radioGroup: 0,
readOnly: HAS_BOOLEAN_VALUE,
referrerPolicy: 0,
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: 0,
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-dom-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 iframe
// 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: {},
DOMMutationMethods: {
value: function (node, value) {
if (value == null) {
return node.removeAttribute('value');
}
// Number inputs get special treatment due to some edge cases in
// Chrome. Let everything else assign the value attribute as normal.
// https://github.com/facebook/react/issues/7253#issuecomment-236074326
if (node.type !== 'number' || node.hasAttribute('value') === false) {
node.setAttribute('value', '' + value);
} else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {
// Don't assign an attribute if validation reports bad
// input. Chrome will clear the value. Additionally, don't
// operate on inputs that have focus, otherwise Chrome might
// strip off trailing decimal places and cause the user's
// cursor position to jump to the beginning of the input.
//
// In ReactDOMInput, we have an onBlur event that will trigger
// this function again when focus is lost.
node.setAttribute('value', '' + value);
}
}
}
};
module.exports = HTMLDOMPropertyConfig;
/***/ }),
/* 88 */
/***/ (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 directory.
*
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(89);
var ReactDOMIDOperations = __webpack_require__(100);
/**
* Abstracts away all functionality of the reconciler that requires knowledge of
* the browser context. TODO: These callers should be refactored to avoid the
* need for this injection.
*/
var ReactComponentBrowserEnvironment = {
processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
};
module.exports = ReactComponentBrowserEnvironment;
/***/ }),
/* 89 */
/***/ (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 directory.
*
*/
'use strict';
var DOMLazyTree = __webpack_require__(90);
var Danger = __webpack_require__(96);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactInstrumentation = __webpack_require__(71);
var createMicrosoftUnsafeLocalFunction = __webpack_require__(93);
var setInnerHTML = __webpack_require__(92);
var setTextContent = __webpack_require__(94);
function getNodeAfter(parentNode, node) {
// Special case for text components, which return [open, close] comments
// from getHostNode.
if (Array.isArray(node)) {
node = node[1];
}
return node ? node.nextSibling : parentNode.firstChild;
}
/**
* Inserts `childNode` as a child of `parentNode` at the `index`.
*
* @param {DOMElement} parentNode Parent node in which to insert.
* @param {DOMElement} childNode Child node to insert.
* @param {number} index Index at which to insert the child.
* @internal
*/
var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
// We rely exclusively on `insertBefore(node, null)` instead of also using
// `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
// we are careful to use `null`.)
parentNode.insertBefore(childNode, referenceNode);
});
function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
}
function moveChild(parentNode, childNode, referenceNode) {
if (Array.isArray(childNode)) {
moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
} else {
insertChildAt(parentNode, childNode, referenceNode);
}
}
function removeChild(parentNode, childNode) {
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, referenceNode) {
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), nodeAfterComment);
}
} else {
if (stringText) {
// Set the text content of the first node after the opening comment, and
// remove all following nodes up until the closing comment.
setTextContent(nodeAfterComment, stringText);
removeDelimitedText(parentNode, nodeAfterComment, closingComment);
} else {
removeDelimitedText(parentNode, openingComment, closingComment);
}
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
type: 'replace text',
payload: stringText
});
}
}
var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
if (process.env.NODE_ENV !== 'production') {
dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
if (prevInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: prevInstance._debugID,
type: 'replace with',
payload: markup.toString()
});
} else {
var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
if (nextInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: nextInstance._debugID,
type: 'mount',
payload: markup.toString()
});
}
}
};
}
/**
* Operations for updating with DOM children.
*/
var DOMChildrenOperations = {
dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
replaceDelimitedText: replaceDelimitedText,
/**
* Updates a component's children by processing a series of updates. The
* update configurations are each expected to have a `parentNode` property.
*
* @param {array<object>} updates List of update configurations.
* @internal
*/
processUpdates: function (parentNode, updates) {
if (process.env.NODE_ENV !== 'production') {
var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
}
for (var k = 0; k < updates.length; k++) {
var update = updates[k];
switch (update.type) {
case 'INSERT_MARKUP':
insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'insert child',
payload: { toIndex: update.toIndex, content: update.content.toString() }
});
}
break;
case 'MOVE_EXISTING':
moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'move child',
payload: { fromIndex: update.fromIndex, toIndex: update.toIndex }
});
}
break;
case 'SET_MARKUP':
setInnerHTML(parentNode, update.content);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'replace children',
payload: update.content.toString()
});
}
break;
case 'TEXT_CONTENT':
setTextContent(parentNode, update.content);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'replace text',
payload: update.content.toString()
});
}
break;
case 'REMOVE_NODE':
removeChild(parentNode, update.fromNode);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'remove child',
payload: { fromIndex: update.fromIndex }
});
}
break;
}
}
}
};
module.exports = DOMChildrenOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
/**
* 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 directory.
*
*/
'use strict';
var DOMNamespaces = __webpack_require__(91);
var setInnerHTML = __webpack_require__(92);
var createMicrosoftUnsafeLocalFunction = __webpack_require__(93);
var setTextContent = __webpack_require__(94);
var ELEMENT_NODE_TYPE = 1;
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
/**
* In IE (8-11) and Edge, appending nodes with no children is dramatically
* 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 parent
* before any children are added.
*
* In other browsers, doing so is slower or neutral compared to the other 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.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === '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) {
setInnerHTML(node, tree.html);
} else if (tree.text != null) {
setTextContent(node, tree.text);
}
}
var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
// DocumentFragments aren't actually part of the DOM after insertion so
// appending children won't update the DOM. We need to ensure the fragment
// is properly populated first, breaking out of our lazy approach for just
// this level. Also, some <object> plugins (like Flash Player) will read
// <param> nodes immediately upon insertion into the DOM, so <object>
// must also be populated prior to insertion into the DOM.
if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
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 {
setInnerHTML(tree.node, html);
}
}
function queueText(tree, text) {
if (enableLazy) {
tree.text = text;
} else {
setTextContent(tree.node, text);
}
}
function toString() {
return this.node.nodeName;
}
function DOMLazyTree(node) {
return {
node: node,
children: [],
html: null,
text: null,
toString: toString
};
}
DOMLazyTree.insertTreeBefore = insertTreeBefore;
DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
DOMLazyTree.queueChild = queueChild;
DOMLazyTree.queueHTML = queueHTML;
DOMLazyTree.queueText = queueText;
module.exports = DOMLazyTree;
/***/ }),
/* 91 */
/***/ (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 directory.
*
*/
'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;
/***/ }),
/* 92 */
/***/ (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 directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(56);
var DOMNamespaces = __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__(93);
// SVG temp container for IE lacking innerHTML
var reusableSVGContainer;
/**
* Set the innerHTML property of a node, ensuring that whitespace is preserved
* even in IE8.
*
* @param {DOMElement} node
* @param {string} html
* @internal
*/
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
// IE does not have innerHTML for SVG nodes, so instead we inject the
// new markup in a temp node and then move the child nodes across into
// the target node
if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
reusableSVGContainer = reusableSVGContainer || document.createElement('div');
reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
var svgNode = reusableSVGContainer.firstChild;
while (svgNode.firstChild) {
node.appendChild(svgNode.firstChild);
}
} else {
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 innerHTML
// whitespace in root TextNodes is also collapsed.
// @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
// 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 updated
// nodes when processing innerHTML, innerHTML on updated nodes suffers
// from worse whitespace behavior. Re-adding a node like this triggers
// 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 disappearing 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 fix
// and simply check if any non-visible tags appear in the source.
if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
// Recover leading whitespace by temporarily prepending any character.
// \uFEFF has the potential advantage of being zero-width/invisible.
// UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
// in hopes that this is preserved even if "\uFEFF" is transformed 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;
/***/ }),
/* 93 */
/***/ (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 directory.
*
*/
/* globals MSApp */
'use strict';
/**
* Create a function which has 'unsafe' privileges (required by windows8 apps)
*/
var createMicrosoftUnsafeLocalFunction = function (func) {
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
return function (arg0, arg1, arg2, arg3) {
MSApp.execUnsafeLocalFunction(function () {
return func(arg0, arg1, arg2, arg3);
});
};
} else {
return func;
}
};
module.exports = createMicrosoftUnsafeLocalFunction;
/***/ }),
/* 94 */
/***/ (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 directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(56);
var escapeTextContentForBrowser = __webpack_require__(95);
var setInnerHTML = __webpack_require__(92);
/**
* Set the textContent property of a node, ensuring that whitespace is preserved
* even in IE8. innerText is a poor substitute for textContent and, among many
* issues, inserts <br> instead of the literal newline chars. innerHTML behaves
* as it should.
*
* @param {DOMElement} node
* @param {string} text
* @internal
*/
var setTextContent = function (node, text) {
if (text) {
var firstChild = node.firstChild;
if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
firstChild.nodeValue = text;
return;
}
}
node.textContent = text;
};
if (ExecutionEnvironment.canUseDOM) {
if (!('textContent' in document.documentElement)) {
setTextContent = function (node, text) {
if (node.nodeType === 3) {
node.nodeValue = text;
return;
}
setInnerHTML(node, escapeTextContentForBrowser(text));
};
}
}
module.exports = setTextContent;
/***/ }),
/* 95 */
/***/ (function(module, exports) {
/**
* 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 directory.
*
* Based on the escape-html library, which is used under the MIT License below:
*
* Copyright (c) 2012-2013 TJ Holowaychuk
* Copyright (c) 2015 Andreas Lubbe
* Copyright (c) 2015 Tiancheng "Timothy" Gu
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* 'Software'), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit 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
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS 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
* CLAIM, 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';
// code copied and modified from escape-html
/**
* Module variables.
* @private
*/
var matchHtmlRegExp = /["'&<>]/;
/**
* Escape special characters in the given string of html.
*
* @param {string} string The string to escape for inserting into HTML
* @return {string}
* @public
*/
function escapeHtml(string) {
var str = '' + string;
var match = matchHtmlRegExp.exec(str);
if (!match) {
return str;
}
var escape;
var html = '';
var index = 0;
var lastIndex = 0;
for (index = match.index; index < str.length; index++) {
switch (str.charCodeAt(index)) {
case 34:
// "
escape = '"';
break;
case 38:
// &
escape = '&';
break;
case 39:
// '
escape = '''; // modified from escape-html; used to be '''
break;
case 60:
// <
escape = '<';
break;
case 62:
// >
escape = '>';
break;
default:
continue;
}
if (lastIndex !== index) {
html += str.substring(lastIndex, index);
}
lastIndex = index + 1;
html += escape;
}
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
}
// end code copied and modified from escape-html
/**
* Escapes text to prevent scripting attacks.
*
* @param {*} text Text value to escape.
* @return {string} An escaped string.
*/
function escapeTextContentForBrowser(text) {
if (typeof text === 'boolean' || typeof text === 'number') {
// this shortcircuit helps perf for types that we know will never have
// special characters, especially given that this function is used often
// for numeric dom ids.
return '' + text;
}
return escapeHtml(text);
}
module.exports = escapeTextContentForBrowser;
/***/ }),
/* 96 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var DOMLazyTree = __webpack_require__(90);
var ExecutionEnvironment = __webpack_require__(56);
var createNodesFromMarkup = __webpack_require__(97);
var emptyFunction = __webpack_require__(53);
var invariant = __webpack_require__(42);
var Danger = {
/**
* Replaces a node with a string of markup at its current position within its
* parent. The markup must render into a single root node.
*
* @param {DOMElement} oldChild Child node to replace.
* @param {string} markup Markup to render in place of the child node.
* @internal
*/
dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
!ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0;
!markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
!(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0;
if (typeof markup === 'string') {
var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
oldChild.parentNode.replaceChild(newChild, oldChild);
} else {
DOMLazyTree.replaceChildWithTree(oldChild, markup);
}
}
};
module.exports = Danger;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 97 */
/***/ (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 directory.
*
* @typechecks
*/
/*eslint-disable fb-www/unsafe-html*/
var ExecutionEnvironment = __webpack_require__(56);
var createArrayFromMixed = __webpack_require__(98);
var getMarkupWrap = __webpack_require__(99);
var invariant = __webpack_require__(42);
/**
* 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 markup. The
* optionally supplied `handleScript` function will be invoked once for each
* <script> element that is rendered. If no `handleScript` function is supplied,
* 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 <script>.
* @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(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(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__(4)))
/***/ }),
/* 98 */
/***/ (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 directory.
*
* @typechecks
*/
var invariant = __webpack_require__(42);
/**
* Convert array-like objects to arrays.
*
* This API assumes the caller knows the contents of the data type. For less
* well defined inputs use createArrayFromMixed.
*
* @param {object|function|filelist} obj
* @return {array}
*/
function toArray(obj) {
var length = obj.length;
// Some browsers builtin objects can report typeof 'function' (e.g. NodeList
// in old versions of Safari).
!(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
!(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
!(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
!(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
// Old IE doesn't give collections access to hasOwnProperty. Assume inputs
// without method will throw during the slice call and skip straight to the
// fallback.
if (obj.hasOwnProperty) {
try {
return Array.prototype.slice.call(obj);
} catch (e) {
// IE < 9 does not support Array#slice on collections objects
}
}
// Fall back to copying key by key. This assumes all keys have a value,
// so will not preserve sparsely populated inputs.
var ret = Array(length);
for (var ii = 0; ii < length; ii++) {
ret[ii] = obj[ii];
}
return ret;
}
/**
* Perform a heuristic test to determine if an object is "array-like".
*
* A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
* Joshu replied: "Mu."
*
* This function determines if its argument has "array nature": it returns
* true if the argument is an actual array, an `arguments' object, or an
* HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
*
* It will return false for other array-like objects like Filelist.
*
* @param {*} obj
* @return {boolean}
*/
function hasArrayNature(obj) {
return (
// not null/false
!!obj && (
// arrays are objects, NodeLists are functions in Safari
typeof obj == 'object' || typeof obj == 'function') &&
// quacks like an array
'length' in obj &&
// not window
!('setInterval' in obj) &&
// no DOM node should be considered an array-like
// a 'select' element has 'length' and 'item' properties on IE8
typeof obj.nodeType != 'number' && (
// a real array
Array.isArray(obj) ||
// arguments
'callee' in obj ||
// HTMLCollection/NodeList
'item' in obj)
);
}
/**
* Ensure that the argument is an array by wrapping it in an array if it is not.
* Creates a copy of the argument if it is already an array.
*
* This is mostly useful idiomatically:
*
* var createArrayFromMixed = require('createArrayFromMixed');
*
* function takesOneOrMoreThings(things) {
* things = createArrayFromMixed(things);
* ...
* }
*
* This allows you to treat `things' as an array, but accept scalars in the API.
*
* If you need to convert an array-like object, like `arguments`, into an array
* use toArray instead.
*
* @param {*} obj
* @return {array}
*/
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__(4)))
/***/ }),
/* 99 */
/***/ (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 directory.
*
*/
/*eslint-disable fb-www/unsafe-html */
var ExecutionEnvironment = __webpack_require__(56);
var invariant = __webpack_require__(42);
/**
* 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 standalone,
* so we wrap them, render the wrapped nodes, then extract the desired node.
*
* 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>'];
var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
var markupWrap = {
'*': [1, '?<div>', '</div>'],
'area': [1, '<map>', '</map>'],
'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
'legend': [1, '<fieldset>', '</fieldset>'],
'param': [1, '<object>', '</object>'],
'tr': [2, '<table><tbody>', '</tbody></table>'],
'optgroup': selectWrap,
'option': selectWrap,
'caption': tableWrap,
'colgroup': tableWrap,
'tbody': tableWrap,
'tfoot': tableWrap,
'thead': tableWrap,
'td': trWrap,
'th': trWrap
};
// Initialize the SVG elements since we know they'll always need to be wrapped
// consistently. If they are created inside a <div> they will be initialized in
// the wrong namespace (and will not display).
var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
svgElements.forEach(function (nodeName) {
markupWrap[nodeName] = svgWrap;
shouldWrap[nodeName] = true;
});
/**
* Gets the markup wrap configuration for the supplied `nodeName`.
*
* NOTE: This lazily detects which wraps are necessary for the current browser.
*
* @param {string} nodeName Lowercase `nodeName`.
* @return {?array} Markup wrap configuration, if applicable.
*/
function getMarkupWrap(nodeName) {
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
if (!markupWrap.hasOwnProperty(nodeName)) {
nodeName = '*';
}
if (!shouldWrap.hasOwnProperty(nodeName)) {
if (nodeName === '*') {
dummyNode.innerHTML = '<link />';
} else {
dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
}
shouldWrap[nodeName] = !dummyNode.firstChild;
}
return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
}
module.exports = getMarkupWrap;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 100 */
/***/ (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 directory.
*
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(89);
var ReactDOMComponentTree = __webpack_require__(39);
/**
* 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);
}
};
module.exports = ReactDOMIDOperations;
/***/ }),
/* 101 */
/***/ (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 directory.
*
*/
/* global hasOwnProperty:true */
'use strict';
var _prodInvariant = __webpack_require__(40),
_assign = __webpack_require__(58);
var AutoFocusUtils = __webpack_require__(102);
var CSSPropertyOperations = __webpack_require__(104);
var DOMLazyTree = __webpack_require__(90);
var DOMNamespaces = __webpack_require__(91);
var DOMProperty = __webpack_require__(41);
var DOMPropertyOperations = __webpack_require__(112);
var EventPluginHub = __webpack_require__(48);
var EventPluginRegistry = __webpack_require__(49);
var ReactBrowserEventEmitter = __webpack_require__(114);
var ReactDOMComponentFlags = __webpack_require__(43);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactDOMInput = __webpack_require__(117);
var ReactDOMOption = __webpack_require__(124);
var ReactDOMSelect = __webpack_require__(125);
var ReactDOMTextarea = __webpack_require__(126);
var ReactInstrumentation = __webpack_require__(71);
var ReactMultiChild = __webpack_require__(127);
var ReactServerRenderingTransaction = __webpack_require__(147);
var emptyFunction = __webpack_require__(53);
var escapeTextContentForBrowser = __webpack_require__(95);
var invariant = __webpack_require__(42);
var isEventSupported = __webpack_require__(79);
var shallowEqual = __webpack_require__(137);
var validateDOMNesting = __webpack_require__(150);
var warning = __webpack_require__(52);
var Flags = ReactDOMComponentFlags;
var deleteListener = EventPluginHub.deleteListener;
var getNode = ReactDOMComponentTree.getNodeFromInstance;
var listenTo = ReactBrowserEventEmitter.listenTo;
var registrationNameModules = EventPluginRegistry.registrationNameModules;
// For quickly matching children type, to test if can be treated as content.
var CONTENT_TYPES = { 'string': true, 'number': true };
var STYLE = 'style';
var HTML = '__html';
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.stringify(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 passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
}
/**
* @param {object} component
* @param {?object} props
*/
function assertValidProps(component, props) {
if (!props) {
return;
}
// Note the use of `==` which checks for null or undefined.
if (voidElementTags[component._tag]) {
!(props.children == null && props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
}
if (props.dangerouslySetInnerHTML != null) {
!(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
}
!(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
}
function enqueuePutListener(inst, registrationName, listener, transaction) {
if (transaction instanceof ReactServerRenderingTransaction) {
return;
}
if (process.env.NODE_ENV !== 'production') {
// IE8 has no API for event capturing and the `onScroll` event doesn't
// bubble.
process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
}
var containerInfo = inst._hostContainerInfo;
var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
listenTo(registrationName, doc);
transaction.getReactMountReady().enqueue(putListener, {
inst: inst,
registrationName: registrationName,
listener: listener
});
}
function putListener() {
var listenerToPut = this;
EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
}
function inputPostMount() {
var inst = this;
ReactDOMInput.postMountWrapper(inst);
}
function textareaPostMount() {
var inst = this;
ReactDOMTextarea.postMountWrapper(inst);
}
function optionPostMount() {
var inst = this;
ReactDOMOption.postMountWrapper(inst);
}
var setAndValidateContentChildDev = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev = function (content) {
var hasExistingContent = this._contentDebugID != null;
var debugID = this._debugID;
// This ID represents the inlined child that has no backing instance:
var contentDebugID = -debugID;
if (content == null) {
if (hasExistingContent) {
ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
}
this._contentDebugID = null;
return;
}
validateDOMNesting(null, String(content), this, this._ancestorInfo);
this._contentDebugID = contentDebugID;
if (hasExistingContent) {
ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
} else {
ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
}
};
}
// There are so many media events, it makes sense to just
// maintain a list rather than create a `trapBubbledEvent` for each
var mediaEvents = {
topAbort: 'abort',
topCanPlay: 'canplay',
topCanPlayThrough: 'canplaythrough',
topDurationChange: 'durationchange',
topEmptied: 'emptied',
topEncrypted: 'encrypted',
topEnded: 'ended',
topError: 'error',
topLoadedData: 'loadeddata',
topLoadedMetadata: 'loadedmetadata',
topLoadStart: 'loadstart',
topPause: 'pause',
topPlay: 'play',
topPlaying: 'playing',
topProgress: 'progress',
topRateChange: 'ratechange',
topSeeked: 'seeked',
topSeeking: 'seeking',
topStalled: 'stalled',
topSuspend: 'suspend',
topTimeUpdate: 'timeupdate',
topVolumeChange: 'volumechange',
topWaiting: 'waiting'
};
function trapBubbledEventsLocal() {
var inst = this;
// If a component renders to null or if another component fatals and causes
// the state of the tree to be corrupted, `node` here can be null.
!inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
var node = getNode(inst);
!node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
switch (inst._tag) {
case 'iframe':
case 'object':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
break;
case 'video':
case 'audio':
inst._wrapperState.listeners = [];
// Create listener for each media event
for (var event in mediaEvents) {
if (mediaEvents.hasOwnProperty(event)) {
inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node));
}
}
break;
case 'source':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)];
break;
case 'img':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
break;
case 'form':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)];
break;
case 'input':
case 'select':
case 'textarea':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)];
break;
}
}
function postUpdateSelectWrapper() {
ReactDOMSelect.postUpdateWrapper(this);
}
// For HTML, certain tags should omit their close tag. We keep a whitelist for
// those special-case tags.
var omittedCloseTags = {
'area': true,
'base': true,
'br': true,
'col': true,
'embed': true,
'hr': true,
'img': true,
'input': true,
'keygen': true,
'link': true,
'meta': true,
'param': true,
'source': true,
'track': true,
'wbr': true
};
var newlineEatingTags = {
'listing': true,
'pre': true,
'textarea': true
};
// For HTML, certain tags cannot have children. This has the same purpose as
// `omittedCloseTags` except that `menuitem` should still have its closing tag.
var voidElementTags = _assign({
'menuitem': true
}, omittedCloseTags);
// We accept any tag to be rendered but since this gets injected into arbitrary
// 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 subset
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) : _prodInvariant('65', tag) : 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 containing 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 accepts 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._hostNode = null;
this._hostParent = null;
this._rootNodeID = 0;
this._domID = 0;
this._hostContainerInfo = null;
this._wrapperState = null;
this._topLevelWrapper = null;
this._flags = 0;
if (process.env.NODE_ENV !== 'production') {
this._ancestorInfo = null;
setAndValidateContentChildDev.call(this, null);
}
}
ReactDOMComponent.displayName = 'ReactDOMComponent';
ReactDOMComponent.Mixin = {
/**
* Generates root tag markup then recurses. This method has side effects and
* is not idempotent.
*
* @internal
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?ReactDOMComponent} the parent component instance
* @param {?object} info about the host container
* @param {object} context
* @return {string} The computed markup.
*/
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
this._rootNodeID = globalIdCounter++;
this._domID = hostContainerInfo._idCounter++;
this._hostParent = hostParent;
this._hostContainerInfo = hostContainerInfo;
var props = this._currentElement.props;
switch (this._tag) {
case 'audio':
case 'form':
case 'iframe':
case 'img':
case 'link':
case 'object':
case 'source':
case 'video':
this._wrapperState = {
listeners: null
};
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
case 'input':
ReactDOMInput.mountWrapper(this, props, hostParent);
props = ReactDOMInput.getHostProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
case 'option':
ReactDOMOption.mountWrapper(this, props, hostParent);
props = ReactDOMOption.getHostProps(this, props);
break;
case 'select':
ReactDOMSelect.mountWrapper(this, props, hostParent);
props = ReactDOMSelect.getHostProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
case 'textarea':
ReactDOMTextarea.mountWrapper(this, props, hostParent);
props = ReactDOMTextarea.getHostProps(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 (hostParent != null) {
namespaceURI = hostParent._namespaceURI;
parentTag = hostParent._tag;
} else if (hostContainerInfo._tag) {
namespaceURI = hostContainerInfo._namespaceURI;
parentTag = hostContainerInfo._tag;
}
if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === '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 (hostParent != null) {
parentInfo = hostParent._ancestorInfo;
} else if (hostContainerInfo._tag) {
parentInfo = hostContainerInfo._ancestorInfo;
}
if (parentInfo) {
// parentInfo should always be present except for the top-level
// component when server rendering
validateDOMNesting(this._tag, null, this, parentInfo);
}
this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
}
var mountImage;
if (transaction.useCreateElement) {
var ownerDocument = hostContainerInfo._ownerDocument;
var el;
if (namespaceURI === DOMNamespaces.html) {
if (this._tag === 'script') {
// Create the script via .innerHTML so its "parser-inserted" flag 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 if (props.is) {
el = ownerDocument.createElement(this._currentElement.type, props.is);
} else {
// Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
// See discussion in https://github.com/facebook/react/pull/6896
// and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
el = ownerDocument.createElement(this._currentElement.type);
}
} else {
el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
}
ReactDOMComponentTree.precacheNode(this, el);
this._flags |= Flags.hasCachedChildNodes;
if (!this._hostParent) {
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, context);
if (!tagContent && omittedCloseTags[this._tag]) {
mountImage = tagOpen + '/>';
} else {
mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
}
}
switch (this._tag) {
case 'input':
transaction.getReactMountReady().enqueue(inputPostMount, this);
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'textarea':
transaction.getReactMountReady().enqueue(textareaPostMount, this);
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'select':
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'button':
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'option':
transaction.getReactMountReady().enqueue(optionPostMount, this);
break;
}
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 arrays.
* @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.style);
}
propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
}
var markup = null;
if (this._tag != null && isCustomComponent(this._tag, props)) {
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
}
} else {
markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
}
if (markup) {
ret += ' ' + markup;
}
}
}
// For static pages, no need to put React ID and checksum. Saves lots of
// bytes.
if (transaction.renderToStaticMarkup) {
return ret;
}
if (!this._hostParent) {
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.children : 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);
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, 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 newline
// Prefer to break application/xml over text/html (for now) by adding
// a newline specifically to get eaten by the parser. (Alternately for
// textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
// \r is normalized out by HTMLTextAreaElement#value.)
// See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
// See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
// 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-inbody>
return '\n' + ret;
} else {
return ret;
}
},
_createInitialChildren: function (transaction, props, context, lazyTree) {
// 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.children : null;
var childrenToUse = contentToUse != null ? null : props.children;
// TODO: Validate that text is allowed as a child of this node
if (contentToUse != null) {
// Avoid setting textContent when the text is empty. In IE11 setting
// textContent on a text area will cause the placeholder to not
// show within the textarea until it has been focused and blurred again.
// https://github.com/facebook/react/issues/6731#issuecomment-254874553
if (contentToUse !== '') {
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, contentToUse);
}
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
* @param {object} context
*/
receiveComponent: function (nextElement, transaction, context) {
var prevElement = this._currentElement;
this._currentElement = nextElement;
this.updateComponent(transaction, prevElement, nextElement, context);
},
/**
* Updates a DOM component after it has already been allocated and
* attached to the DOM. Reconciles the root DOM node, then recurses.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevElement
* @param {ReactElement} nextElement
* @internal
* @overridable
*/
updateComponent: function (transaction, prevElement, nextElement, context) {
var lastProps = prevElement.props;
var nextProps = this._currentElement.props;
switch (this._tag) {
case 'input':
lastProps = ReactDOMInput.getHostProps(this, lastProps);
nextProps = ReactDOMInput.getHostProps(this, nextProps);
break;
case 'option':
lastProps = ReactDOMOption.getHostProps(this, lastProps);
nextProps = ReactDOMOption.getHostProps(this, nextProps);
break;
case 'select':
lastProps = ReactDOMSelect.getHostProps(this, lastProps);
nextProps = ReactDOMSelect.getHostProps(this, nextProps);
break;
case 'textarea':
lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
break;
}
assertValidProps(this, nextProps);
this._updateDOMProperties(lastProps, nextProps, transaction);
this._updateDOMChildren(lastProps, nextProps, transaction, context);
switch (this._tag) {
case 'input':
// Update the wrapper around inputs *after* updating props. This has to
// happen after `_updateDOMProperties`. Otherwise HTML5 input validations
// raise warnings and prevent the new value from being assigned.
ReactDOMInput.updateWrapper(this);
break;
case 'textarea':
ReactDOMTextarea.updateWrapper(this);
break;
case 'select':
// <select> value update needs to occur after <option> children
// reconciliation
transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
break;
}
},
/**
* Reconciles the properties by detecting differences in property values 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 actually
* improves performance (especially statically positioned elements).
* 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 actually a
// listener (e.g., onClick={null})
deleteListener(this, propKey);
}
} else if (isCustomComponent(this._tag, lastProps)) {
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
}
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
}
}
for (propKey in nextProps) {
var nextProp = nextProps[propKey];
var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
continue;
}
if (propKey === STYLE) {
if (nextProp) {
if (process.env.NODE_ENV !== 'production') {
checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
this._previousStyle = nextProp;
}
nextProp = this._previousStyleCopy = _assign({}, nextProp);
} else {
this._previousStyleCopy = null;
}
if (lastProp) {
// Unset styles on `lastProp` but not on `nextProp`.
for (styleName in lastProp) {
if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
// Update styles that changed since `lastProp`.
for (styleName in nextProp) {
if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = nextProp[styleName];
}
}
} else {
// Relies on `updateStylesByID` not mutating `styleUpdates`.
styleUpdates = nextProp;
}
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp) {
enqueuePutListener(this, propKey, nextProp, transaction);
} else if (lastProp) {
deleteListener(this, propKey);
}
} else if (isCustomComponent(this._tag, nextProps)) {
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
}
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
var node = getNode(this);
// If we're updating to null or undefined, we should remove the property
// from the DOM node instead of inadvertently setting to a string. This
// brings us in line with the same behavior we have on initial render.
if (nextProp != null) {
DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
} else {
DOMPropertyOperations.deleteValueForProperty(node, propKey);
}
}
}
if (styleUpdates) {
CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, 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, context) {
var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__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, remove
// 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 (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
}
if (nextContent != null) {
if (lastContent !== nextContent) {
this.updateTextContent('' + nextContent);
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, nextContent);
}
}
} else if (nextHtml != null) {
if (lastHtml !== nextHtml) {
this.updateMarkup('' + nextHtml);
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
} else if (nextChildren != null) {
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, null);
}
this.updateChildren(nextChildren, transaction, context);
}
},
getHostNode: 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 'audio':
case 'form':
case 'iframe':
case 'img':
case 'link':
case 'object':
case 'source':
case 'video':
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 able to
* take advantage of React's reconciliation for styling and <title>
* management. So we just document it and throw in dangerous cases.
*/
true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0;
break;
}
this.unmountChildren(safely);
ReactDOMComponentTree.uncacheNode(this);
EventPluginHub.deleteAllListeners(this);
this._rootNodeID = 0;
this._domID = 0;
this._wrapperState = null;
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, null);
}
},
getPublicInstance: function () {
return getNode(this);
}
};
_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
module.exports = ReactDOMComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 102 */
/***/ (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 directory.
*
*/
'use strict';
var ReactDOMComponentTree = __webpack_require__(39);
var focusNode = __webpack_require__(103);
var AutoFocusUtils = {
focusDOMComponent: function () {
focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
}
};
module.exports = AutoFocusUtils;
/***/ }),
/* 103 */
/***/ (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 directory.
*
*/
'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 invisible,
// 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;
/***/ }),
/* 104 */
/***/ (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 directory.
*
*/
'use strict';
var CSSProperty = __webpack_require__(105);
var ExecutionEnvironment = __webpack_require__(56);
var ReactInstrumentation = __webpack_require__(71);
var camelizeStyleName = __webpack_require__(106);
var dangerousStyleValue = __webpack_require__(108);
var hyphenateStyleName = __webpack_require__(109);
var memoizeStringOnly = __webpack_require__(111);
var warning = __webpack_require__(52);
var processStyleName = memoizeStringOnly(function (styleName) {
return hyphenateStyleName(styleName);
});
var hasShorthandPropertyBug = false;
var styleFloatAccessor = 'cssFloat';
if (ExecutionEnvironment.canUseDOM) {
var tempStyle = document.createElement('div').style;
try {
// IE8 throws "Invalid argument." if resetting shorthand style properties.
tempStyle.font = '';
} 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 capitalized
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), checkRenderMessage(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).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
};
var warnStyleValueWithSemicolon = function (name, value, owner) {
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
return;
}
warnedStyleValues[value] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
};
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(owner)) : 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 easier.
* 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, component) + ';';
}
}
return serialized || null;
},
/**
* Sets the value for multiple styles on a node. If a value is specified as
* '' (empty string), the corresponding style property will be unset.
*
* @param {DOMElement} node
* @param {object} styles
* @param {ReactDOMComponent} component
*/
setValueForStyles: function (node, styles, component) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: component._debugID,
type: 'update styles',
payload: styles
});
}
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.shorthandPropertyExpansions[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] = '';
}
}
}
}
};
module.exports = CSSPropertyOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 105 */
/***/ (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 directory.
*
*/
'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 camelCased, 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 permutations
* 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 properties 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 seem 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;
/***/ }),
/* 106 */
/***/ (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 directory.
*
* @typechecks
*/
'use strict';
var camelize = __webpack_require__(107);
var msPattern = /^-ms-/;
/**
* Camelcases a hyphenated CSS property name, for example:
*
* > camelizeStyleName('background-color')
* < "backgroundColor"
* > camelizeStyleName('-moz-transition')
* < "MozTransition"
* > camelizeStyleName('-ms-transition')
* < "msTransition"
*
* As Andi Smith suggests
* (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
* is converted to lowercase `ms`.
*
* @param {string} string
* @return {string}
*/
function camelizeStyleName(string) {
return camelize(string.replace(msPattern, 'ms-'));
}
module.exports = camelizeStyleName;
/***/ }),
/* 107 */
/***/ (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 directory.
*
* @typechecks
*/
var _hyphenPattern = /-(.)/g;
/**
* Camelcases a hyphenated string, for example:
*
* > camelize('background-color')
* < "backgroundColor"
*
* @param {string} string
* @return {string}
*/
function camelize(string) {
return string.replace(_hyphenPattern, function (_, character) {
return character.toUpperCase();
});
}
module.exports = camelize;
/***/ }),
/* 108 */
/***/ (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 directory.
*
*/
'use strict';
var CSSProperty = __webpack_require__(105);
var warning = __webpack_require__(52);
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
var styleWarnings = {};
/**
* Convert a value into the proper css writable value. The style name `name`
* 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(name) && isUnitlessNumber[name]) {
return '' + value; // cast to string
}
if (typeof value === 'string') {
if (process.env.NODE_ENV !== 'production') {
// Allow '0' to pass through without warning. 0 is already special and
// doesn't require units, so we don't need to warn about it.
if (component && value !== '0') {
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 version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
}
}
}
value = value.trim();
}
return value + 'px';
}
module.exports = dangerousStyleValue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 109 */
/***/ (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 directory.
*
* @typechecks
*/
'use strict';
var hyphenate = __webpack_require__(110);
var msPattern = /^ms-/;
/**
* Hyphenates a camelcased CSS property name, for example:
*
* > hyphenateStyleName('backgroundColor')
* < "background-color"
* > hyphenateStyleName('MozTransition')
* < "-moz-transition"
* > hyphenateStyleName('msTransition')
* < "-ms-transition"
*
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
* is converted to `-ms-`.
*
* @param {string} string
* @return {string}
*/
function hyphenateStyleName(string) {
return hyphenate(string).replace(msPattern, '-ms-');
}
module.exports = hyphenateStyleName;
/***/ }),
/* 110 */
/***/ (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 directory.
*
* @typechecks
*/
var _uppercasePattern = /([A-Z])/g;
/**
* Hyphenates a camelcased string, for example:
*
* > hyphenate('backgroundColor')
* < "background-color"
*
* For CSS style names, use `hyphenateStyleName` instead which works properly
* with all vendor prefixes, including `ms`.
*
* @param {string} string
* @return {string}
*/
function hyphenate(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
module.exports = hyphenate;
/***/ }),
/* 111 */
/***/ (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 directory.
*
*
* @typechecks static-only
*/
'use strict';
/**
* Memoizes the return value of a function that accepts one string argument.
*/
function memoizeStringOnly(callback) {
var cache = {};
return function (string) {
if (!cache.hasOwnProperty(string)) {
cache[string] = callback.call(this, string);
}
return cache[string];
};
}
module.exports = memoizeStringOnly;
/***/ }),
/* 112 */
/***/ (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 directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(41);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactInstrumentation = __webpack_require__(71);
var quoteAttributeValueForBrowser = __webpack_require__(113);
var warning = __webpack_require__(52);
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 attribute name: `%s`', attributeName) : void 0;
return false;
}
function shouldIgnoreValue(propertyInfo, value) {
return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.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 + '=' + quoteAttributeValueForBrowser(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 invalid.
*/
createMarkupForProperty: function (name, value) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
if (shouldIgnoreValue(propertyInfo, value)) {
return '';
}
var attributeName = propertyInfo.attributeName;
if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && 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) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
var mutationMethod = propertyInfo.mutationMethod;
if (mutationMethod) {
mutationMethod(node, value);
} else if (shouldIgnoreValue(propertyInfo, value)) {
this.deleteValueForProperty(node, name);
return;
} else if (propertyInfo.mustUseProperty) {
// Contrary to `setAttribute`, object properties are properly
// `toString`ed by IE8/9.
node[propertyInfo.propertyName] = value;
} else {
var attributeName = propertyInfo.attributeName;
var namespace = propertyInfo.attributeNamespace;
// `setAttribute` with objects becomes only `[object]` in IE8/9,
// ('' + value) makes it output the correct toString()-value.
if (namespace) {
node.setAttributeNS(namespace, attributeName, '' + value);
} else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
node.setAttribute(attributeName, '');
} else {
node.setAttribute(attributeName, '' + value);
}
}
} else if (DOMProperty.isCustomAttribute(name)) {
DOMPropertyOperations.setValueForAttribute(node, name, value);
return;
}
if (process.env.NODE_ENV !== 'production') {
var payload = {};
payload[name] = value;
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'update attribute',
payload: payload
});
}
},
setValueForAttribute: function (node, name, value) {
if (!isAttributeNameSafe(name)) {
return;
}
if (value == null) {
node.removeAttribute(name);
} else {
node.setAttribute(name, '' + value);
}
if (process.env.NODE_ENV !== 'production') {
var payload = {};
payload[name] = value;
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'update attribute',
payload: payload
});
}
},
/**
* Deletes an attributes from a node.
*
* @param {DOMElement} node
* @param {string} name
*/
deleteValueForAttribute: function (node, name) {
node.removeAttribute(name);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'remove attribute',
payload: name
});
}
},
/**
* Deletes the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
*/
deleteValueForProperty: function (node, name) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
var mutationMethod = propertyInfo.mutationMethod;
if (mutationMethod) {
mutationMethod(node, undefined);
} else if (propertyInfo.mustUseProperty) {
var propName = propertyInfo.propertyName;
if (propertyInfo.hasBooleanValue) {
node[propName] = false;
} else {
node[propName] = '';
}
} else {
node.removeAttribute(propertyInfo.attributeName);
}
} else if (DOMProperty.isCustomAttribute(name)) {
node.removeAttribute(name);
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'remove attribute',
payload: name
});
}
}
};
module.exports = DOMPropertyOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 113 */
/***/ (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 directory.
*
*/
'use strict';
var escapeTextContentForBrowser = __webpack_require__(95);
/**
* Escapes attribute value to prevent scripting attacks.
*
* @param {*} value Value to escape.
* @return {string} An escaped string.
*/
function quoteAttributeValueForBrowser(value) {
return '"' + escapeTextContentForBrowser(value) + '"';
}
module.exports = quoteAttributeValueForBrowser;
/***/ }),
/* 114 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var EventPluginRegistry = __webpack_require__(49);
var ReactEventEmitterMixin = __webpack_require__(115);
var ViewportMetrics = __webpack_require__(85);
var getVendorPrefixedEventName = __webpack_require__(116);
var isEventSupported = __webpack_require__(79);
/**
* Summary of `ReactBrowserEventEmitter` event handling:
*
* - Top-level delegation is used to trap most native browser events. This
* may only occur in the main thread and is the responsibility of
* ReactEventListener, which is injected and can therefore support pluggable
* event sources. This is the only work that occurs in the main thread.
*
* - 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 used to
* trap it) to `EventPluginHub`, which in turn will ask plugins if they want
* to extract any synthetic events.
*
* - The `EventPluginHub` will then process each event by annotating them with
* "dispatches", a sequence of listeners and IDs that care about that event.
*
* - The `EventPluginHub` then dispatches the events.
*
* Overview of React and the event system:
*
* +------------+ .
* | DOM | .
* +------------+ .
* | .
* v .
* +------------+ .
* | ReactEvent | .
* | Listener | .
* +------------+ . +-----------+
* | . +--------+|SimpleEvent|
* | . | |Plugin |
* +-----|------+ . v +-----------+
* | | | . +--------------+ +------------+
* | +-----------.--->|EventPluginHub| | Event |
* | | . | | +-----------+ | Propagators|
* | ReactEvent | . | | |TapEvent | |------------|
* | Emitter | . | |<---+|Plugin | |other plugin|
* | | . | | +-----------+ | utilities |
* | +-----------.--->| | +------------+
* | | | . +--------------+
* +-----|------+ . ^ +-----------+
* | . | |Enter/Leave|
* + . +-------+|Plugin |
* +-------------+ . +-----------+
* | application | .
* |-------------| .
* | | .
* | | .
* +-------------+ .
* .
* React Core . 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 trap at a
// lower node than `document`), binding at `document` would cause duplicate
// events so we don't include them here
var topEventMapping = {
topAbort: 'abort',
topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
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') || 'transitionend',
topVolumeChange: 'volumechange',
topWaiting: 'waiting',
topWheel: 'wheel'
};
/**
* To ensure no conflicts with other potential React instances on the page
*/
var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(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 listeners. 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
*/
injectReactEventListener: function (ReactEventListener) {
ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
}
},
/**
* Sets whether or not any created callbacks should be enabled.
*
* @param {boolean} enabled True if callbacks should be enabled.
*/
setEnabled: function (enabled) {
if (ReactBrowserEventEmitter.ReactEventListener) {
ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
}
},
/**
* @return {boolean} True if callbacks are enabled.
*/
isEnabled: function () {
return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
},
/**
* We listen for bubbled touch events on the document object.
*
* Firefox v8.01 (and possibly others) exhibited strange behavior when
* mounting `onmousemove` events at some node that was not the document
* element. The symptoms were that if your mouse is not moving over something
* contained within that mount point (for example on the background) the
* top-level listeners for `onmousemove` won't be called. However, if you
* register the `mousemove` on the document object, then it will of course
* catch all `mousemove`s. This along with iOS quirks, justifies restricting
* top-level listeners to the document object only, at least for these
* movement types of events and possibly all events.
*
* @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
*
* Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
* they bubble to document.
*
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {object} contentDocumentHandle Document which owns the container
*/
listenTo: function (registrationName, contentDocumentHandle) {
var mountAt = contentDocumentHandle;
var isListening = getListeningForDocument(mountAt);
var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
for (var i = 0; i < dependencies.length; i++) {
var dependency = dependencies[i];
if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
if (dependency === 'topWheel') {
if (isEventSupported('wheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt);
} else if (isEventSupported('mousewheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt);
} else {
// Firefox needs to capture a different mouse scroll event.
// @see http://www.quirksmode.org/dom/events/tests/scroll.html
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);
}
} else if (dependency === 'topScroll') {
if (isEventSupported('scroll', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt);
} else {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
}
} else if (dependency === 'topFocus' || dependency === 'topBlur') {
if (isEventSupported('focus', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt);
} else if (isEventSupported('focusin')) {
// IE has `focusin` and `focusout` events which bubble.
// @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt);
}
// to make sure blur and focus event listeners are only attached once
isListening.topBlur = true;
isListening.topFocus = true;
} else if (topEventMapping.hasOwnProperty(dependency)) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, 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);
},
/**
* Protect against document.createEvent() returning null
* Some popup blocker extensions appear to do this:
* https://github.com/facebook/react/issues/6887
*/
supportsEventPageXY: function () {
if (!document.createEvent) {
return false;
}
var ev = document.createEvent('MouseEvent');
return ev != null && 'pageX' in ev;
},
/**
* 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 = ReactBrowserEventEmitter.supportsEventPageXY();
}
if (!hasEventPageXY && !isMonitoringScrollValue) {
var refresh = ViewportMetrics.refreshScrollValues;
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
isMonitoringScrollValue = true;
}
}
});
module.exports = ReactBrowserEventEmitter;
/***/ }),
/* 115 */
/***/ (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 directory.
*
*/
'use strict';
var EventPluginHub = __webpack_require__(48);
function runEventQueueInBatch(events) {
EventPluginHub.enqueueEvents(events);
EventPluginHub.processEventQueue(false);
}
var ReactEventEmitterMixin = {
/**
* Streams a fired top-level event to `EventPluginHub` where plugins have the
* opportunity to create `ReactEvent`s to be dispatched.
*/
handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
runEventQueueInBatch(events);
}
};
module.exports = ReactEventEmitterMixin;
/***/ }),
/* 116 */
/***/ (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 directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(56);
/**
* Generate a mapping of standard vendor prefixes using the defined style 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 applicable).
*/
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 them 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;
/***/ }),
/* 117 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40),
_assign = __webpack_require__(58);
var DOMPropertyOperations = __webpack_require__(112);
var LinkedValueUtils = __webpack_require__(118);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactUpdates = __webpack_require__(65);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
var didWarnValueLink = false;
var didWarnCheckedLink = false;
var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;
function forceUpdateIfMounted() {
if (this._rootNodeID) {
// DOM component is still mounted; update
ReactDOMInput.updateWrapper(this);
}
}
function isControlled(props) {
var usesChecked = props.type === 'checkbox' || props.type === 'radio';
return usesChecked ? props.checked != null : props.value != null;
}
/**
* Implements an <input> host component that allows setting these optional
* props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
*
* If `checked` or `value` are not supplied (or null/undefined), user actions
* that affect the checked state or value will trigger updates to the element.
*
* If they are supplied (and not null/undefined), the rendered element will not
* trigger updates to the element. Instead, the props must change in order for
* the rendered element to be updated.
*
* The rendered element will be initialized as unchecked (or `defaultChecked`)
* with an empty value (or `defaultValue`).
*
* @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
*/
var ReactDOMInput = {
getHostProps: function (inst, props) {
var value = LinkedValueUtils.getValue(props);
var checked = LinkedValueUtils.getChecked(props);
var hostProps = _assign({
// Make sure we set .type before any other properties (setting .value
// before .type means .value is lost in IE11 and below)
type: undefined,
// Make sure we set .step before .value (setting .value before .step
// means .value is rounded on mount, based upon step precision)
step: undefined,
// Make sure we set .min & .max before .value (to ensure proper order
// in corner cases such as min or max deriving from value, e.g. Issue #7170)
min: undefined,
max: undefined
}, props, {
defaultChecked: undefined,
defaultValue: undefined,
value: value != null ? value : inst._wrapperState.initialValue,
checked: checked != null ? checked : inst._wrapperState.initialChecked,
onChange: inst._wrapperState.onChange
});
return hostProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
var owner = inst._currentElement._owner;
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` 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, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
didWarnCheckedLink = true;
}
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnCheckedDefaultChecked = true;
}
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnValueDefaultValue = true;
}
}
var defaultValue = props.defaultValue;
inst._wrapperState = {
initialChecked: props.checked != null ? props.checked : props.defaultChecked,
initialValue: props.value != null ? props.value : defaultValue,
listeners: null,
onChange: _handleChange.bind(inst),
controlled: isControlled(props)
};
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
if (process.env.NODE_ENV !== 'production') {
var controlled = isControlled(props);
var owner = inst._currentElement._owner;
if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnUncontrolledToControlled = true;
}
if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnControlledToUncontrolled = true;
}
}
// TODO: Shouldn't this be getChecked(props)?
var checked = props.checked;
if (checked != null) {
DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
}
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
var value = LinkedValueUtils.getValue(props);
if (value != null) {
if (value === 0 && node.value === '') {
node.value = '0';
// Note: IE9 reports a number inputs as 'text', so check props instead.
} else if (props.type === 'number') {
// Simulate `input.valueAsNumber`. IE9 does not support it
var valueAsNumber = parseFloat(node.value, 10) || 0;
// eslint-disable-next-line
if (value != valueAsNumber) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
node.value = '' + value;
}
// eslint-disable-next-line
} else if (value != node.value) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
node.value = '' + value;
}
} else {
if (props.value == null && props.defaultValue != null) {
// In Chrome, assigning defaultValue to certain input types triggers input validation.
// For number inputs, the display value loses trailing decimal points. For email inputs,
// Chrome raises "The specified value <x> is not a valid email address".
//
// Here we check to see if the defaultValue has actually changed, avoiding these problems
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253
if (node.defaultValue !== '' + props.defaultValue) {
node.defaultValue = '' + props.defaultValue;
}
}
if (props.checked == null && props.defaultChecked != null) {
node.defaultChecked = !!props.defaultChecked;
}
}
},
postMountWrapper: function (inst) {
var props = inst._currentElement.props;
// This is in postMount because we need access to the DOM node, which is not
// available until after the component has mounted.
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
// Detach value from defaultValue. We won't do anything if we're working on
// submit or reset inputs as those values & defaultValues are linked. They
// are not resetable nodes so this operation doesn't matter and actually
// removes browser-default values (eg "Submit Query") when no value is
// provided.
switch (props.type) {
case 'submit':
case 'reset':
break;
case 'color':
case 'date':
case 'datetime':
case 'datetime-local':
case 'month':
case 'time':
case 'week':
// This fixes the no-show issue on iOS Safari and Android Chrome:
// https://github.com/facebook/react/issues/7233
node.value = '';
node.value = node.defaultValue;
break;
default:
node.value = node.value;
break;
}
// Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
// this is needed to work around a chrome bug where setting defaultChecked
// will sometimes influence the value of checked (even after detachment).
// Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
// We need to temporarily unset name to avoid disrupting radio button groups.
var name = node.name;
if (name !== '') {
node.name = '';
}
node.defaultChecked = !node.defaultChecked;
node.defaultChecked = !node.defaultChecked;
if (name !== '') {
node.name = name;
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
// Here we use asap to wait until all updates have propagated, which
// is important when using controlled components within layers:
// https://github.com/facebook/react/issues/1698
ReactUpdates.asap(forceUpdateIfMounted, this);
var name = props.name;
if (props.type === 'radio' && name != null) {
var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
var queryRoot = rootNode;
while (queryRoot.parentNode) {
queryRoot = queryRoot.parentNode;
}
// If `rootNode.form` was non-null, then we could try `form.elements`,
// but that sometimes behaves strangely in IE8. We could also try using
// `form.getElementsByName`, but that will only return direct children
// and won't include inputs that use the HTML5 `form=` attribute. Since
// the input might not even be in a form, let's just use the global
// `querySelectorAll` to ensure we don't miss anything.
var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
for (var i = 0; i < group.length; i++) {
var otherNode = group[i];
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
continue;
}
// This will throw if radio buttons rendered by different copies of React
// and the same name are rendered into the same form (same as #1939).
// That's probably okay; we don't support it just as we don't support
// mixing React radio buttons with non-React ones.
var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
!otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
// If this is a controlled radio button group, forcing the input that
// was previously checked to update will cause it to be come re-checked
// as appropriate.
ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
}
}
return returnValue;
}
module.exports = ReactDOMInput;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 118 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var ReactPropTypesSecret = __webpack_require__(119);
var propTypesFactory = __webpack_require__(120);
var React = __webpack_require__(3);
var PropTypes = propTypesFactory(React.isValidElement);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
var hasReadOnlyValue = {
'button': true,
'checkbox': true,
'image': true,
'hidden': true,
'radio': true,
'reset': true,
'submit': true
};
function _assertSingleLink(inputProps) {
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0;
}
function _assertValueLink(inputProps) {
_assertSingleLink(inputProps);
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0;
}
function _assertCheckedLink(inputProps) {
_assertSingleLink(inputProps);
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0;
}
var propTypes = {
value: function (props, propName, componentName) {
if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
return null;
}
return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
},
checked: function (props, propName, componentName) {
if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
return null;
}
return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
},
onChange: PropTypes.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 not 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, 'prop', null, ReactPropTypesSecret);
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var addendum = getDeclarationErrorAddendum(owner);
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form 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 link.
*/
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__(4)))
/***/ }),
/* 119 */
/***/ (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 directory.
*
*
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 120 */
/***/ (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 directory.
*/
'use strict';
// React 15.5 references this module, and assumes PropTypes are still callable in production.
// Therefore we re-export development-only version with all the PropTypes checks here.
// However if one is migrating to the `prop-types` npm library, they will go through the
// `index.js` entry point, and it will branch depending on the environment.
var factory = __webpack_require__(121);
module.exports = function(isValidElement) {
// It is still allowed in 15.5.
var throwOnDirectAccess = false;
return factory(isValidElement, throwOnDirectAccess);
};
/***/ }),
/* 121 */
/***/ (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 directory.
*/
'use strict';
var emptyFunction = __webpack_require__(53);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
var ReactPropTypesSecret = __webpack_require__(122);
var checkPropTypes = __webpack_require__(123);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* 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[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* 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([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. 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>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
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 own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_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*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== 'production') {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
warning(
false,
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
'received %s at index %s.',
getPostfixForTypeWarning(checker),
i
);
return emptyFunction.thatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
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;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
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';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 122 */
/***/ (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 directory.
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 123 */
/***/ (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 directory.
*/
'use strict';
if (process.env.NODE_ENV !== 'production') {
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
var ReactPropTypesSecret = __webpack_require__(122);
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (process.env.NODE_ENV !== 'production') {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
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 message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 124 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var React = __webpack_require__(3);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactDOMSelect = __webpack_require__(125);
var warning = __webpack_require__(52);
var didWarnInvalidOptionChildren = false;
function flattenChildren(children) {
var content = '';
// Flatten children and warn if they aren't strings or numbers;
// invalid types are ignored.
React.Children.forEach(children, function (child) {
if (child == null) {
return;
}
if (typeof child === 'string' || typeof child === 'number') {
content += child;
} else if (!didWarnInvalidOptionChildren) {
didWarnInvalidOptionChildren = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
}
});
return content;
}
/**
* Implements an <option> host component that warns when `selected` is set.
*/
var ReactDOMOption = {
mountWrapper: function (inst, props, hostParent) {
// TODO (yungsters): Remove support for `selected` in <option>.
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
}
// Look up whether this option is 'selected'
var selectValue = null;
if (hostParent != null) {
var selectParent = hostParent;
if (selectParent._tag === 'optgroup') {
selectParent = selectParent._hostParent;
}
if (selectParent != null && selectParent._tag === 'select') {
selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
}
}
// If the value is null (e.g., no specified value or after initial mount)
// or missing (e.g., for <datalist>), we don't change props.selected
var selected = null;
if (selectValue != null) {
var value;
if (props.value != null) {
value = props.value + '';
} else {
value = flattenChildren(props.children);
}
selected = false;
if (Array.isArray(selectValue)) {
// multiple
for (var i = 0; i < selectValue.length; i++) {
if ('' + selectValue[i] === value) {
selected = true;
break;
}
}
} else {
selected = '' + selectValue === value;
}
}
inst._wrapperState = { selected: selected };
},
postMountWrapper: function (inst) {
// value="" should make a value attribute (#6219)
var props = inst._currentElement.props;
if (props.value != null) {
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
node.setAttribute('value', props.value);
}
},
getHostProps: function (inst, props) {
var hostProps = _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) {
hostProps.selected = inst._wrapperState.selected;
}
var content = flattenChildren(props.children);
if (content) {
hostProps.children = content;
}
return hostProps;
}
};
module.exports = ReactDOMOption;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 125 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var LinkedValueUtils = __webpack_require__(118);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactUpdates = __webpack_require__(65);
var warning = __webpack_require__(52);
var didWarnValueLink = false;
var didWarnValueDefaultValue = false;
function updateOptionsIfPendingUpdateAndMounted() {
if (this._rootNodeID && this._wrapperState.pendingUpdate) {
this._wrapperState.pendingUpdate = false;
var props = this._currentElement.props;
var value = LinkedValueUtils.getValue(props);
if (value != null) {
updateOptions(this, Boolean(props.multiple), value);
}
}
}
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
var valuePropNames = ['value', 'defaultValue'];
/**
* Validation function for `value` and `defaultValue`.
* @private
*/
function checkSelectPropTypes(inst, props) {
var owner = inst._currentElement._owner;
LinkedValueUtils.checkPropTypes('select', props, owner);
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
didWarnValueLink = true;
}
for (var i = 0; i < valuePropNames.length; i++) {
var propName = valuePropNames[i];
if (props[propName] == null) {
continue;
}
var isArray = Array.isArray(props[propName]);
if (props.multiple && !isArray) {
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
} else if (!props.multiple && isArray) {
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
}
}
}
/**
* @param {ReactDOMComponent} inst
* @param {boolean} multiple
* @param {*} propValue A stringable (with `multiple`, a list of stringables).
* @private
*/
function updateOptions(inst, multiple, propValue) {
var selectedValue, i;
var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
if (multiple) {
selectedValue = {};
for (i = 0; i < propValue.length; i++) {
selectedValue['' + propValue[i]] = true;
}
for (i = 0; i < options.length; i++) {
var selected = selectedValue.hasOwnProperty(options[i].value);
if (options[i].selected !== selected) {
options[i].selected = selected;
}
}
} else {
// Do not set `select.value` as exact behavior isn't consistent across all
// browsers for all cases.
selectedValue = '' + propValue;
for (i = 0; i < options.length; i++) {
if (options[i].value === selectedValue) {
options[i].selected = true;
return;
}
}
if (options.length) {
options[0].selected = true;
}
}
}
/**
* Implements a <select> host component that allows optionally setting the
* props `value` and `defaultValue`. If `multiple` is false, the prop must be a
* stringable. If `multiple` is true, the prop must be an array of stringables.
*
* If `value` is not supplied (or null/undefined), user actions that change 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 change in
* order for the rendered options to update.
*
* If `defaultValue` is provided, any options with the supplied values will be
* selected.
*/
var ReactDOMSelect = {
getHostProps: function (inst, props) {
return _assign({}, props, {
onChange: inst._wrapperState.onChange,
value: undefined
});
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
checkSelectPropTypes(inst, 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 elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
didWarnValueDefaultValue = true;
}
},
getSelectValueContext: function (inst) {
// ReactDOMOption looks at this initial value so the initial generated
// markup has correct `selected` attributes
return inst._wrapperState.initialValue;
},
postUpdateWrapper: function (inst) {
var props = inst._currentElement.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__(4)))
/***/ }),
/* 126 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40),
_assign = __webpack_require__(58);
var LinkedValueUtils = __webpack_require__(118);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactUpdates = __webpack_require__(65);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
var didWarnValueLink = false;
var didWarnValDefaultVal = false;
function forceUpdateIfMounted() {
if (this._rootNodeID) {
// DOM component is still mounted; update
ReactDOMTextarea.updateWrapper(this);
}
}
/**
* Implements a <textarea> host component that allows setting `value`, and
* `defaultValue`. This differs from the traditional DOM API because value is
* usually set as PCDATA children.
*
* If `value` is not supplied (or null/undefined), user actions that affect the
* value will trigger updates to the element.
*
* If `value` is supplied (and not null/undefined), the rendered element will
* not trigger updates to the element. Instead, the `value` prop must change in
* order for the rendered element to be updated.
*
* The rendered element will be initialized with an empty value, the prop
* `defaultValue` if specified, or the children content (deprecated).
*/
var ReactDOMTextarea = {
getHostProps: function (inst, props) {
!(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
// Always set children to the same thing. In IE9, the selection range will
// get reset if `textContent` is mutated. We could add a check in setTextContent
// to only set the value if/when the value differs from the node value (which would
// completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
// The value can be a boolean or object so that's why it's forced to be a string.
var hostProps = _assign({}, props, {
value: undefined,
defaultValue: undefined,
children: '' + inst._wrapperState.initialValue,
onChange: inst._wrapperState.onChange
});
return hostProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 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 value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
didWarnValDefaultVal = true;
}
}
var value = LinkedValueUtils.getValue(props);
var initialValue = value;
// Only bother fetching default value if we're going to use it
if (value == null) {
var defaultValue = props.defaultValue;
// TODO (yungsters): Remove support for children content in <textarea>.
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 children.') : _prodInvariant('92') : void 0;
if (Array.isArray(children)) {
!(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
children = children[0];
}
defaultValue = '' + children;
}
if (defaultValue == null) {
defaultValue = '';
}
initialValue = defaultValue;
}
inst._wrapperState = {
initialValue: '' + initialValue,
listeners: null,
onChange: _handleChange.bind(inst)
};
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
var value = LinkedValueUtils.getValue(props);
if (value != null) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
var newValue = '' + value;
// To avoid side effects (such as losing text selection), only set value if changed
if (newValue !== node.value) {
node.value = newValue;
}
if (props.defaultValue == null) {
node.defaultValue = newValue;
}
}
if (props.defaultValue != null) {
node.defaultValue = props.defaultValue;
}
},
postMountWrapper: function (inst) {
// This is in postMount because we need access to the DOM node, which is not
// available until after the component has mounted.
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
var textContent = node.textContent;
// Only set node.value if textContent is equal to the expected
// initial value. In IE10/IE11 there is a bug where the placeholder attribute
// will populate textContent as well.
// https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
if (textContent === inst._wrapperState.initialValue) {
node.value = textContent;
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
ReactUpdates.asap(forceUpdateIfMounted, this);
return returnValue;
}
module.exports = ReactDOMTextarea;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 127 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var ReactComponentEnvironment = __webpack_require__(128);
var ReactInstanceMap = __webpack_require__(129);
var ReactInstrumentation = __webpack_require__(71);
var ReactCurrentOwner = __webpack_require__(11);
var ReactReconciler = __webpack_require__(68);
var ReactChildReconciler = __webpack_require__(130);
var emptyFunction = __webpack_require__(53);
var flattenChildren = __webpack_require__(146);
var invariant = __webpack_require__(42);
/**
* Make an update for markup to be rendered and inserted at a supplied index.
*
* @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: '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: 'MOVE_EXISTING',
content: null,
fromIndex: child._mountIndex,
fromNode: ReactReconciler.getHostNode(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: '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: '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: '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 is
* 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);
}
var setChildrenForInstrumentation = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
var getDebugID = function (inst) {
if (!inst._debugID) {
// Check for ART-like instances. TODO: This is silly/gross.
var internal;
if (internal = ReactInstanceMap.get(inst)) {
inst = internal;
}
}
return inst._debugID;
};
setChildrenForInstrumentation = function (children) {
var debugID = getDebugID(this);
// TODO: React Native empty components are also multichild.
// This means they still get into this method but don't have _debugID.
if (debugID !== 0) {
ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
return children[key]._debugID;
}) : []);
}
};
}
/**
* ReactMultiChild are capable of reconciling multiple children.
*
* @class ReactMultiChild
* @internal
*/
var ReactMultiChild = {
/**
* Provides common functionality for components that must reconcile multiple
* children. This is used by `ReactDOMComponent` to mount, update, and
* unmount child components.
*
* @lends {ReactMultiChild.prototype}
*/
Mixin: {
_reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
if (process.env.NODE_ENV !== 'production') {
var selfDebugID = getDebugID(this);
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
} finally {
ReactCurrentOwner.current = null;
}
}
}
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
},
_reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
var nextChildren;
var selfDebugID = 0;
if (process.env.NODE_ENV !== 'production') {
selfDebugID = getDebugID(this);
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
} finally {
ReactCurrentOwner.current = null;
}
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
return nextChildren;
}
}
nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
return nextChildren;
},
/**
* 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} 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 selfDebugID = 0;
if (process.env.NODE_ENV !== 'production') {
selfDebugID = getDebugID(this);
}
var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
child._mountIndex = index++;
mountImages.push(mountImage);
}
}
if (process.env.NODE_ENV !== 'production') {
setChildrenForInstrumentation.call(this, children);
}
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(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : 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(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : 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, context) {
// Hook used by React ART
this._updateChildren(nextNestedChildrenElements, transaction, context);
},
/**
* @param {?object} nextNestedChildrenElements Nested child element maps.
* @param {ReactReconcileTransaction} transaction
* @final
* @protected
*/
_updateChildren: function (nextNestedChildrenElements, transaction, context) {
var prevChildren = this._renderedChildren;
var removedNodes = {};
var mountImages = [];
var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
if (!nextChildren && !prevChildren) {
return;
}
var updates = null;
var name;
// `nextIndex` will increment for each child in `nextChildren`, but
// `lastIndex` will be the last index visited in `prevChildren`.
var nextIndex = 0;
var lastIndex = 0;
// `nextMountIndex` will increment for each newly mounted child.
var nextMountIndex = 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, lastPlacedNode, nextIndex, lastIndex));
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
prevChild._mountIndex = nextIndex;
} else {
if (prevChild) {
// Update `lastIndex` before `_mountIndex` gets unset by unmounting.
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
// The `removedNodes` loop below will actually remove the child.
}
// The child must be instantiated before it's mounted.
updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
nextMountIndex++;
}
nextIndex++;
lastPlacedNode = ReactReconciler.getHostNode(nextChild);
}
// Remove children that are no longer present.
for (name in removedNodes) {
if (removedNodes.hasOwnProperty(name)) {
updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
}
}
if (updates) {
processQueue(this, updates);
}
this._renderedChildren = nextChildren;
if (process.env.NODE_ENV !== 'production') {
setChildrenForInstrumentation.call(this, nextChildren);
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted. It does not actually perform any
* 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.
* @param {number} toIndex Destination index of the element.
* @param {number} lastIndex Last index visited of the siblings of `child`.
* @protected
*/
moveChild: function (child, afterNode, toIndex, lastIndex) {
// If the index of `child` is less than `lastIndex`, then it needs to
// be moved. Otherwise, we do not need to move it because a child will be
// inserted or moved before `child`.
if (child._mountIndex < lastIndex) {
return makeMove(child, afterNode, toIndex);
}
},
/**
* Creates a child component.
*
* @param {ReactComponent} child Component to create.
* @param {string} mountImage Markup to insert.
* @protected
*/
createChild: function (child, afterNode, mountImage) {
return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
},
/**
* Removes a child component.
*
* @param {ReactComponent} child Child to remove.
* @protected
*/
removeChild: function (child, node) {
return makeRemove(child, node);
},
/**
* Mounts a child with the supplied name.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to mount.
* @param {string} name Name of the child.
* @param {number} index Index at which to insert the child.
* @param {ReactReconcileTransaction} transaction
* @private
*/
_mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
child._mountIndex = index;
return this.createChild(child, afterNode, mountImage);
},
/**
* Unmounts a rendered child.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to unmount.
* @private
*/
_unmountChild: function (child, node) {
var update = this.removeChild(child, node);
child._mountIndex = null;
return update;
}
}
};
module.exports = ReactMultiChild;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
var injected = false;
var ReactComponentEnvironment = {
/**
* Optionally injectable hook for swapping out mount images in the middle 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(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
injected = true;
}
}
};
module.exports = ReactComponentEnvironment;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 129 */
/***/ (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 directory.
*
*/
'use strict';
/**
* `ReactInstanceMap` maintains a mapping from a public facing stateful
* instance (key) and the internal representation (value). This allows public
* methods to accept the user facing instance as an argument and map them 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 always
* transform these to strings for IE support. When this transform is fully
* 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;
/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var ReactReconciler = __webpack_require__(68);
var instantiateReactComponent = __webpack_require__(131);
var KeyEscapeUtils = __webpack_require__(142);
var shouldUpdateReactComponent = __webpack_require__(138);
var traverseAllChildren = __webpack_require__(143);
var warning = __webpack_require__(52);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(27);
}
function instantiateChild(childInstances, child, name, selfDebugID) {
// We found a component instance.
var keyUnique = childInstances[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(27);
}
if (!keyUnique) {
process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
}
}
if (child != null && keyUnique) {
childInstances[name] = instantiateReactComponent(child, true);
}
}
/**
* 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, selfDebugID // 0 in production and for roots
) {
if (nestedChildNodes == null) {
return null;
}
var childInstances = {};
if (process.env.NODE_ENV !== 'production') {
traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
return instantiateChild(childInsts, child, name, selfDebugID);
}, childInstances);
} else {
traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
}
return childInstances;
},
/**
* Updates the rendered children and returns a new set of children.
*
* @param {?object} prevChildren Previously initialized set of children.
* @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, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
) {
// We currently don't have a way to track moves here but if we use iterators
// 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 that 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;
var nextElement = nextChildren[name];
if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
nextChildren[name] = prevChild;
} else {
if (prevChild) {
removedNodes[name] = ReactReconciler.getHostNode(prevChild);
ReactReconciler.unmountComponent(prevChild, false);
}
// The child must be instantiated before it's mounted.
var nextChildInstance = instantiateReactComponent(nextElement, true);
nextChildren[name] = nextChildInstance;
// Creating mount image now ensures refs are resolved in right order
// (see https://github.com/facebook/react/pull/7101 for explanation).
var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
mountImages.push(nextChildMountImage);
}
}
// Unmount children that are no longer present.
for (name in prevChildren) {
if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
prevChild = prevChildren[name];
removedNodes[name] = ReactReconciler.getHostNode(prevChild);
ReactReconciler.unmountComponent(prevChild, false);
}
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted.
*
* @param {?object} renderedChildren Previously initialized set of children.
* @internal
*/
unmountChildren: function (renderedChildren, safely) {
for (var name in renderedChildren) {
if (renderedChildren.hasOwnProperty(name)) {
var renderedChild = renderedChildren[name];
ReactReconciler.unmountComponent(renderedChild, safely);
}
}
}
};
module.exports = ReactChildReconciler;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 131 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40),
_assign = __webpack_require__(58);
var ReactCompositeComponent = __webpack_require__(132);
var ReactEmptyComponent = __webpack_require__(139);
var ReactHostComponent = __webpack_require__(140);
var getNextDebugID = __webpack_require__(141);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
// To avoid a cyclic dependency, we create the final class in this module
var ReactCompositeComponentWrapper = function (element) {
this.construct(element);
};
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 !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
}
/**
* Given a ReactNode, create an instance that will actually be mounted.
*
* @param {ReactNode} node
* @param {boolean} shouldHaveDebugID
* @return {object} A new instance of the element's constructor.
* @protected
*/
function instantiateReactComponent(node, shouldHaveDebugID) {
var instance;
if (node === null || node === false) {
instance = ReactEmptyComponent.create(instantiateReactComponent);
} else if (typeof node === 'object') {
var element = node;
var type = element.type;
if (typeof type !== 'function' && typeof type !== 'string') {
var info = '';
if (process.env.NODE_ENV !== 'production') {
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
}
}
info += getDeclarationErrorAddendum(element._owner);
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
}
// Special case string values
if (typeof element.type === 'string') {
instance = ReactHostComponent.createInternalComponent(element);
} else if (isInternalComponentType(element.type)) {
// This is temporarily available for custom components that are not string
// representations. I.e. ART. Once those are updated to use the string
// representation, we can drop this code path.
instance = new element.type(element);
// We renamed this. Allow the old name for compat. :(
if (!instance.getHostNode) {
instance.getHostNode = instance.getNativeNode;
}
} else {
instance = new ReactCompositeComponentWrapper(element);
}
} else if (typeof node === 'string' || typeof node === 'number') {
instance = ReactHostComponent.createInstanceForText(node);
} else {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === '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._debugID = shouldHaveDebugID ? getNextDebugID() : 0;
}
// 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;
}
_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
_instantiateReactComponent: instantiateReactComponent
});
module.exports = instantiateReactComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 132 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40),
_assign = __webpack_require__(58);
var React = __webpack_require__(3);
var ReactComponentEnvironment = __webpack_require__(128);
var ReactCurrentOwner = __webpack_require__(11);
var ReactErrorUtils = __webpack_require__(51);
var ReactInstanceMap = __webpack_require__(129);
var ReactInstrumentation = __webpack_require__(71);
var ReactNodeTypes = __webpack_require__(133);
var ReactReconciler = __webpack_require__(68);
if (process.env.NODE_ENV !== 'production') {
var checkReactTypeSpec = __webpack_require__(134);
}
var emptyObject = __webpack_require__(136);
var invariant = __webpack_require__(42);
var shallowEqual = __webpack_require__(137);
var shouldUpdateReactComponent = __webpack_require__(138);
var warning = __webpack_require__(52);
var CompositeTypes = {
ImpureClass: 0,
PureClass: 1,
StatelessFunctional: 2
};
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 || React.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
}
}
function shouldConstruct(Component) {
return !!(Component.prototype && Component.prototype.isReactComponent);
}
function isPureComponent(Component) {
return !!(Component.prototype && Component.prototype.isPureReactComponent);
}
// Separated into a function to contain deoptimizations caused by try/finally.
function measureLifeCyclePerf(fn, debugID, timerType) {
if (debugID === 0) {
// Top-level wrappers (see ReactMount) and empty components (see
// ReactDOMEmptyComponent) are invisible to hooks and devtools.
// Both are implementation details that should go away in the future.
return fn();
}
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
try {
return fn();
} finally {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
}
}
/**
* ------------------ 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. This is
* used to enforce the order in which `ReactUpdates` updates dirty components.
*
* @private
*/
var nextMountID = 1;
/**
* @lends {ReactCompositeComponent.prototype}
*/
var ReactCompositeComponent = {
/**
* Base constructor for all composite component.
*
* @param {ReactElement} element
* @final
* @internal
*/
construct: function (element) {
this._currentElement = element;
this._rootNodeID = 0;
this._compositeType = null;
this._instance = null;
this._hostParent = null;
this._hostContainerInfo = null;
// See ReactUpdateQueue
this._updateBatchNumber = null;
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;
if (process.env.NODE_ENV !== 'production') {
this._warnedAboutRefsInRender = false;
}
},
/**
* Initializes the component, renders markup, and registers event listeners.
*
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?object} hostParent
* @param {?object} hostContainerInfo
* @param {?object} context
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
var _this = this;
this._context = context;
this._mountOrder = nextMountID++;
this._hostParent = hostParent;
this._hostContainerInfo = hostContainerInfo;
var publicProps = this._currentElement.props;
var publicContext = this._processContext(context);
var Component = this._currentElement.type;
var updateQueue = transaction.getUpdateQueue();
// Initialize the public class
var doConstruct = shouldConstruct(Component);
var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
var renderedElement;
// Support functional components
if (!doConstruct && (inst == null || inst.render == null)) {
renderedElement = inst;
warnIfInvalidElement(Component, renderedElement);
!(inst === null || inst === false || React.isValidElement(inst)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
inst = new StatelessComponent(Component);
this._compositeType = CompositeTypes.StatelessFunctional;
} else {
if (isPureComponent(Component)) {
this._compositeType = CompositeTypes.PureClass;
} else {
this._compositeType = CompositeTypes.ImpureClass;
}
}
if (process.env.NODE_ENV !== 'production') {
// This will throw later in _renderValidatedComponent, but add an early
// warning now to help debugging
if (inst.render == null) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
}
var propsMutated = inst.props !== publicProps;
var componentName = Component.displayName || Component.name || 'Component';
process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
}
// These should be set up in the constructor, but as a convenience for
// simpler class abstractions, we set them up after the fact.
inst.props = publicProps;
inst.context = publicContext;
inst.refs = emptyObject;
inst.updater = updateQueue;
this._instance = inst;
// Store a reference from the instance back to the internal representation
ReactInstanceMap.set(inst, this);
if (process.env.NODE_ENV !== 'production') {
// Since plain JS classes are defined without any special initialization
// logic, we can not catch common errors early. Therefore, we have to
// catch them here, at initialization time, instead.
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
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 property to define contextTypes instead.', this.getName() || 'a component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
}
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 set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
var markup;
if (inst.unstable_handleError) {
markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
} else {
markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
}
if (inst.componentDidMount) {
if (process.env.NODE_ENV !== 'production') {
transaction.getReactMountReady().enqueue(function () {
measureLifeCyclePerf(function () {
return inst.componentDidMount();
}, _this._debugID, 'componentDidMount');
});
} else {
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
}
}
return markup;
},
_constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
if (process.env.NODE_ENV !== 'production') {
ReactCurrentOwner.current = this;
try {
return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
} finally {
ReactCurrentOwner.current = null;
}
} else {
return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
}
},
_constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
var Component = this._currentElement.type;
if (doConstruct) {
if (process.env.NODE_ENV !== 'production') {
return measureLifeCyclePerf(function () {
return new Component(publicProps, publicContext, updateQueue);
}, this._debugID, 'ctor');
} else {
return new Component(publicProps, publicContext, updateQueue);
}
}
// This can still be an instance in case of factory components
// but we'll count this as time spent rendering as the more common case.
if (process.env.NODE_ENV !== 'production') {
return measureLifeCyclePerf(function () {
return Component(publicProps, publicContext, updateQueue);
}, this._debugID, 'render');
} else {
return Component(publicProps, publicContext, updateQueue);
}
},
performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
var markup;
var checkpoint = transaction.checkpoint();
try {
markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
} catch (e) {
// Roll back to checkpoint, handle error (which may add items to the 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 they can render an error message this time.
// If this throws again, the error will bubble up (and can be caught by a higher error boundary).
markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
}
return markup;
},
performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
var inst = this._instance;
var debugID = 0;
if (process.env.NODE_ENV !== 'production') {
debugID = this._debugID;
}
if (inst.componentWillMount) {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillMount();
}, debugID, 'componentWillMount');
} else {
inst.componentWillMount();
}
// When mounting, calls to `setState` by `componentWillMount` will set
// `this._pendingStateQueue` without triggering a re-render.
if (this._pendingStateQueue) {
inst.state = this._processPendingState(inst.props, inst.context);
}
}
// If not a stateless component, we now render
if (renderedElement === undefined) {
renderedElement = this._renderValidatedComponent();
}
var nodeType = ReactNodeTypes.getType(renderedElement);
this._renderedNodeType = nodeType;
var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
);
this._renderedComponent = child;
var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
if (process.env.NODE_ENV !== 'production') {
if (debugID !== 0) {
var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
}
}
return markup;
},
getHostNode: function () {
return ReactReconciler.getHostNode(this._renderedComponent);
},
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function (safely) {
if (!this._renderedComponent) {
return;
}
var inst = this._instance;
if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
inst._calledComponentWillUnmount = true;
if (safely) {
var name = this.getName() + '.componentWillUnmount()';
ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
} else {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillUnmount();
}, this._debugID, 'componentWillUnmount');
} else {
inst.componentWillUnmount();
}
}
}
if (this._renderedComponent) {
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 ReactUpdates,
// 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 = 0;
this._topLevelWrapper = null;
// Delete the reference from the instance to this internal representation
// which allow the internals to be properly cleaned up even if the user
// leaks a reference to the public instance.
ReactInstanceMap.remove(inst);
// Some existing components rely on inst.props even after they've been
// destroyed (in event handlers).
// TODO: inst.props = null;
// TODO: inst.state = null;
// TODO: inst.context = null;
},
/**
* 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;
},
/**
* Filters the context object to only contain keys specified in
* `contextTypes`, and asserts that they are valid.
*
* @param {object} context
* @return {?object}
* @private
*/
_processContext: function (context) {
var maskedContext = this._maskContext(context);
if (process.env.NODE_ENV !== 'production') {
var Component = this._currentElement.type;
if (Component.contextTypes) {
this._checkContextTypes(Component.contextTypes, maskedContext, 'context');
}
}
return maskedContext;
},
/**
* @param {object} currentContext
* @return {object}
* @private
*/
_processChildContext: function (currentContext) {
var Component = this._currentElement.type;
var inst = this._instance;
var childContext;
if (inst.getChildContext) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onBeginProcessingChildContext();
try {
childContext = inst.getChildContext();
} finally {
ReactInstrumentation.debugTool.onEndProcessingChildContext();
}
} else {
childContext = inst.getChildContext();
}
}
if (childContext) {
!(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
if (process.env.NODE_ENV !== 'production') {
this._checkContextTypes(Component.childContextTypes, childContext, 'child context');
}
for (var name in childContext) {
!(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
}
return _assign({}, currentContext, childContext);
}
return currentContext;
},
/**
* Assert that the context types are valid
*
* @param {object} typeSpecs Map of context field to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @private
*/
_checkContextTypes: function (typeSpecs, values, location) {
if (process.env.NODE_ENV !== 'production') {
checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
}
},
receiveComponent: function (nextElement, transaction, nextContext) {
var prevElement = this._currentElement;
var prevContext = this._context;
this._pendingElement = null;
this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
},
/**
* If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
* is set, update the component.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (transaction) {
if (this._pendingElement != null) {
ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
} else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
} else {
this._updateBatchNumber = null;
}
},
/**
* Perform an update to a mounted component. The componentWillReceiveProps 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 algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevParentElement
* @param {ReactElement} nextParentElement
* @internal
* @overridable
*/
updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
var inst = this._instance;
!(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
var willReceive = false;
var nextContext;
// Determine if the context has changed or not
if (this._context === nextUnmaskedContext) {
nextContext = inst.context;
} else {
nextContext = this._processContext(nextUnmaskedContext);
willReceive = true;
}
var prevProps = prevParentElement.props;
var nextProps = nextParentElement.props;
// Not a simple state update but a props update
if (prevParentElement !== nextParentElement) {
willReceive = true;
}
// An update here will schedule an update but immediately set
// _pendingStateQueue which will ensure that any state updates gets
// immediately reconciled instead of waiting for the next batch.
if (willReceive && inst.componentWillReceiveProps) {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillReceiveProps(nextProps, nextContext);
}, this._debugID, 'componentWillReceiveProps');
} else {
inst.componentWillReceiveProps(nextProps, nextContext);
}
}
var nextState = this._processPendingState(nextProps, nextContext);
var shouldUpdate = true;
if (!this._pendingForceUpdate) {
if (inst.shouldComponentUpdate) {
if (process.env.NODE_ENV !== 'production') {
shouldUpdate = measureLifeCyclePerf(function () {
return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
}, this._debugID, 'shouldComponentUpdate');
} else {
shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
}
} else {
if (this._compositeType === CompositeTypes.PureClass) {
shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
}
}
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
}
this._updateBatchNumber = null;
if (shouldUpdate) {
this._pendingForceUpdate = false;
// Will set `this.props`, `this.state` and `this.context`.
this._performComponentUpdate(nextParentElement, nextProps, nextState, 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(inst, 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 _this2 = this;
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) {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillUpdate(nextProps, nextState, nextContext);
}, this._debugID, 'componentWillUpdate');
} else {
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) {
if (process.env.NODE_ENV !== 'production') {
transaction.getReactMountReady().enqueue(function () {
measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
});
} else {
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(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();
var debugID = 0;
if (process.env.NODE_ENV !== 'production') {
debugID = this._debugID;
}
if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
} else {
var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
ReactReconciler.unmountComponent(prevComponentInstance, false);
var nodeType = ReactNodeTypes.getType(nextRenderedElement);
this._renderedNodeType = nodeType;
var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
);
this._renderedComponent = child;
var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
if (process.env.NODE_ENV !== 'production') {
if (debugID !== 0) {
var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
}
}
this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
}
},
/**
* Overridden in shallow rendering.
*
* @protected
*/
_replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
},
/**
* @protected
*/
_renderValidatedComponentWithoutOwnerOrContext: function () {
var inst = this._instance;
var renderedElement;
if (process.env.NODE_ENV !== 'production') {
renderedElement = measureLifeCyclePerf(function () {
return inst.render();
}, this._debugID, 'render');
} else {
renderedElement = inst.render();
}
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (renderedElement === undefined && inst.render._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
renderedElement = null;
}
}
return renderedElement;
},
/**
* @private
*/
_renderValidatedComponent: function () {
var renderedElement;
if (process.env.NODE_ENV !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
ReactCurrentOwner.current = this;
try {
renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
} finally {
ReactCurrentOwner.current = null;
}
} else {
renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
}
!(
// TODO: An `isValidNode` function would probably be more appropriate
renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
return renderedElement;
},
/**
* 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.') : _prodInvariant('110') : void 0;
var publicComponentInstance = component.getPublicInstance();
if (process.env.NODE_ENV !== 'production') {
var componentName = component && component.getName ? component.getName() : 'a component';
process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
}
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) {
var refs = this.getPublicInstance().refs;
delete refs[ref];
},
/**
* Get a text description of the component that can be used to identify it
* in error messages.
* @return {string} The name or null.
* @internal
*/
getName: function () {
var type = this._currentElement.type;
var constructor = this._instance && this._instance.constructor;
return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
},
/**
* Get the publicly accessible representation of this component - i.e. what
* is exposed by refs and returned by render. Can be null for stateless
* components.
*
* @return {ReactComponent} the public component instance.
* @internal
*/
getPublicInstance: function () {
var inst = this._instance;
if (this._compositeType === CompositeTypes.StatelessFunctional) {
return null;
}
return inst;
},
// Stub
_instantiateReactComponent: null
};
module.exports = ReactCompositeComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 133 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var React = __webpack_require__(3);
var invariant = __webpack_require__(42);
var ReactNodeTypes = {
HOST: 0,
COMPOSITE: 1,
EMPTY: 2,
getType: function (node) {
if (node === null || node === false) {
return ReactNodeTypes.EMPTY;
} else if (React.isValidElement(node)) {
if (typeof node.type === 'function') {
return ReactNodeTypes.COMPOSITE;
} else {
return ReactNodeTypes.HOST;
}
}
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
}
};
module.exports = ReactNodeTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 134 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var ReactPropTypeLocationNames = __webpack_require__(135);
var ReactPropTypesSecret = __webpack_require__(119);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(27);
}
var loggedTypeFailures = {};
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?object} element The React element that is being type-checked
* @param {?number} debugID The React component instance that is being type-checked
* @private
*/
function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
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 message.
!(typeof typeSpecs[typeSpecName] === '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], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var componentStackInfo = '';
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(27);
}
if (debugID !== null) {
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
} else if (element !== null) {
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
}
}
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
}
}
}
}
module.exports = checkReactTypeSpec;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 135 */
/***/ (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 directory.
*
*
*/
'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__(4)))
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 137 */
/***/ (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 directory.
*
* @typechecks
*
*/
/*eslint-disable no-self-compare */
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
// Added the nonzero y check to make Flow happy, but it is redundant
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ }),
/* 138 */
/***/ (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 directory.
*
*/
'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 can
* 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.type && prevElement.key === nextElement.key;
}
}
module.exports = shouldUpdateReactComponent;
/***/ }),
/* 139 */
/***/ (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 directory.
*
*/
'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;
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
var genericComponentClass = null;
var textComponentClass = null;
var ReactHostComponentInjection = {
// 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 be
// rendered as props.
injectTextComponentClass: function (componentClass) {
textComponentClass = componentClass;
}
};
/**
* Get a host 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' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : 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 ReactHostComponent = {
createInternalComponent: createInternalComponent,
createInstanceForText: createInstanceForText,
isTextComponent: isTextComponent,
injection: ReactHostComponentInjection
};
module.exports = ReactHostComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 141 */
/***/ (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 directory.
*
*
*/
'use strict';
var nextDebugID = 1;
function getNextDebugID() {
return nextDebugID++;
}
module.exports = getNextDebugID;
/***/ }),
/* 142 */
/***/ (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 directory.
*
*
*/
'use strict';
/**
* Escape and wrap key so it is safe to use as a reactid
*
* @param {string} 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];
});
return '$' + escapedString;
}
/**
* Unescape and unwrap key for human-readable display
*
* @param {string} key to unescape.
* @return {string} the unescaped key.
*/
function unescape(key) {
var unescapeRegex = /(=0|=2)/g;
var unescaperLookup = {
'=0': '=',
'=2': ':'
};
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
return ('' + keySubstring).replace(unescapeRegex, function (match) {
return unescaperLookup[match];
});
}
var KeyEscapeUtils = {
escape: escape,
unescape: unescape
};
module.exports = KeyEscapeUtils;
/***/ }),
/* 143 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var ReactCurrentOwner = __webpack_require__(11);
var REACT_ELEMENT_TYPE = __webpack_require__(144);
var getIteratorFn = __webpack_require__(145);
var invariant = __webpack_require__(42);
var KeyEscapeUtils = __webpack_require__(142);
var warning = __webpack_require__(52);
var SEPARATOR = '.';
var SUBSEPARATOR = ':';
/**
* This is inlined from ReactElement since this file is shared between
* isomorphic and renderers. We could extract this to a
*
*/
/**
* TODO: Test that a single child and an array with one item have the same key
* pattern.
*/
var didWarnAboutMaps = false;
/**
* 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 provided.
* @return {string}
*/
function getComponentKey(component, index) {
// Do some typechecking here since we call this blindly. We want to ensure
// that we don't block potential future ES APIs.
if (component && typeof component === 'object' && component.key != null) {
// 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 traversal
* process.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
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' ||
// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
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) : nameSoFar);
return 1;
}
var child;
var nextName;
var subtreeCount = 0; // Count of children found in the current subtree.
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
nextName = nextNamePrefix + getComponentKey(child, i);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
var iteratorFn = getIteratorFn(children);
if (iteratorFn) {
var iterator = iteratorFn.call(children);
var step;
if (iteratorFn !== children.entries) {
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getComponentKey(child, ii++);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
if (process.env.NODE_ENV !== 'production') {
var mapsAsChildrenAddendum = '';
if (ReactCurrentOwner.current) {
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
if (mapsAsChildrenOwnerName) {
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
}
}
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
didWarnAboutMaps = true;
}
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
child = entry[1];
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
}
}
} else if (type === 'object') {
var addendum = '';
if (process.env.NODE_ENV !== 'production') {
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
if (children._isReactElement) {
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
}
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
addendum += ' Check the render method of `' + name + '`.';
}
}
}
var childrenString = String(children);
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
}
}
return subtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`, but
* might also be specified through attributes:
*
* - `traverseAllChildren(this.props.children, ...)`
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
*
* The `traverseContext` is an optional argument that is passed through the
* entire traversal. It can be used to store accumulations or anything else 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__(4)))
/***/ }),
/* 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 directory.
*
*
*/
'use strict';
// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
module.exports = REACT_ELEMENT_TYPE;
/***/ }),
/* 145 */
/***/ (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 directory.
*
*
*/
'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[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
module.exports = getIteratorFn;
/***/ }),
/* 146 */
/***/ (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 directory.
*
*
*/
'use strict';
var KeyEscapeUtils = __webpack_require__(142);
var traverseAllChildren = __webpack_require__(143);
var warning = __webpack_require__(52);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(27);
}
/**
* @param {function} traverseContext Context passed through traversal.
* @param {?ReactComponent} child React child component.
* @param {!string} name String name of key path to child.
* @param {number=} selfDebugID Optional debugID of the current internal instance.
*/
function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
// We found a component instance.
if (traverseContext && typeof traverseContext === 'object') {
var result = traverseContext;
var keyUnique = result[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(27);
}
if (!keyUnique) {
process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
}
}
if (keyUnique && child != null) {
result[name] = child;
}
}
}
/**
* Flattens children that are typically specified as `props.children`. Any null
* children will not be included in the resulting object.
* @return {!object} flattened children keyed by name.
*/
function flattenChildren(children, selfDebugID) {
if (children == null) {
return children;
}
var result = {};
if (process.env.NODE_ENV !== 'production') {
traverseAllChildren(children, function (traverseContext, child, name) {
return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
}, result);
} else {
traverseAllChildren(children, flattenSingleChildIntoContext, result);
}
return result;
}
module.exports = flattenChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var PooledClass = __webpack_require__(59);
var Transaction = __webpack_require__(77);
var ReactInstrumentation = __webpack_require__(71);
var ReactServerUpdateQueue = __webpack_require__(148);
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [];
if (process.env.NODE_ENV !== 'production') {
TRANSACTION_WRAPPERS.push({
initialize: ReactInstrumentation.debugTool.onBeginFlush,
close: ReactInstrumentation.debugTool.onEndFlush
});
}
var noopCallbackQueue = {
enqueue: function () {}
};
/**
* @class ReactServerRenderingTransaction
* @param {boolean} renderToStaticMarkup
*/
function ReactServerRenderingTransaction(renderToStaticMarkup) {
this.reinitializeTransaction();
this.renderToStaticMarkup = renderToStaticMarkup;
this.useCreateElement = false;
this.updateQueue = new ReactServerUpdateQueue(this);
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array} Empty list of operation wrap procedures.
*/
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function () {
return noopCallbackQueue;
},
/**
* @return {object} The queue to collect React async events.
*/
getUpdateQueue: function () {
return this.updateQueue;
},
/**
* `PooledClass` looks for this, and will invoke this before allowing this
* instance to be reused.
*/
destructor: function () {},
checkpoint: function () {},
rollback: function () {}
};
_assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin);
PooledClass.addPoolingTo(ReactServerRenderingTransaction);
module.exports = ReactServerRenderingTransaction;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*
*/
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ReactUpdateQueue = __webpack_require__(149);
var warning = __webpack_require__(52);
function warnNoop(publicInstance, callerName) {
if (process.env.NODE_ENV !== 'production') {
var constructor = publicInstance.constructor;
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
}
}
/**
* This is the update queue used for server rendering.
* It delegates to ReactUpdateQueue while server rendering is in progress and
* switches to ReactNoopUpdateQueue after the transaction has completed.
* @class ReactServerUpdateQueue
* @param {Transaction} transaction
*/
var ReactServerUpdateQueue = function () {
function ReactServerUpdateQueue(transaction) {
_classCallCheck(this, ReactServerUpdateQueue);
this.transaction = transaction;
}
/**
* 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
*/
ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
return false;
};
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
}
};
/**
* 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
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueForceUpdate(publicInstance);
} else {
warnNoop(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 rerender.
* @param {object|function} completeState Next state.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
} else {
warnNoop(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 use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object|function} partialState Next partial state to be merged with state.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
} else {
warnNoop(publicInstance, 'setState');
}
};
return ReactServerUpdateQueue;
}();
module.exports = ReactServerUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var ReactCurrentOwner = __webpack_require__(11);
var ReactInstanceMap = __webpack_require__(129);
var ReactInstrumentation = __webpack_require__(71);
var ReactUpdates = __webpack_require__(65);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
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') {
var ctor = publicInstance.constructor;
// Only warn when we have a callerName. Otherwise we should be silent.
// We're probably calling from enqueueCallback. We don't want to warn
// 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 you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
}
return null;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
}
return internalInstance;
}
/**
* ReactUpdateQueue allows for state updates to be scheduled into a later
* 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._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
owner._warnedAboutRefsInRender = true;
}
}
var internalInstance = ReactInstanceMap.get(publicInstance);
if (internalInstance) {
// During componentWillMount and render this will still be null but after
// that will always render to something. At least for now. So we can use
// this hack.
return !!internalInstance._renderedComponent;
} else {
return false;
}
},
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @param {string} callerName Name of the calling function in the public API.
* @internal
*/
enqueueCallback: function (publicInstance, callback, callerName) {
ReactUpdateQueue.validateCallback(callback, callerName);
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
// 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
// behavior we have in other enqueue* methods.
// We also need to ignore callbacks in componentWillMount. See
// enqueueUpdates.
if (!internalInstance) {
return null;
}
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
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
if (!internalInstance) {
return;
}
internalInstance._pendingForceUpdate = true;
enqueueUpdate(internalInstance);
},
/**
* 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 rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState, callback) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
if (!internalInstance) {
return;
}
internalInstance._pendingStateQueue = [completeState];
internalInstance._pendingReplaceState = true;
// Future-proof 15.5
if (callback !== undefined && callback !== null) {
ReactUpdateQueue.validateCallback(callback, 'replaceState');
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
}
enqueueUpdate(internalInstance);
},
/**
* 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 use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
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, use forceUpdate().') : void 0;
}
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
if (!internalInstance) {
return;
}
var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
queue.push(partialState);
enqueueUpdate(internalInstance);
},
enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
internalInstance._pendingElement = nextElement;
// TODO: introduce _pendingContext instead of setting it directly.
internalInstance._context = nextContext;
enqueueUpdate(internalInstance);
},
validateCallback: function (callback, callerName) {
!(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
}
};
module.exports = ReactUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var emptyFunction = __webpack_require__(53);
var warning = __webpack_require__(52);
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-in-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 warn only
// for cases where the parser will give a parse tree differing from what React
// intended. For example, <b><div></div></b> is invalid but we don't warn
// because it still parses correctly; we do warn for other cases like nested
// <p> tags where the beginning of the second element implicitly closes the
// first, causing a confusing mess.
// https://html.spec.whatwg.org/multipage/syntax.html#special
var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-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 here
// errs on the side of fewer warnings
'foreignObject', 'desc', 'title'];
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-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-inbody
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" mode 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' || tag === '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-html-element
case 'html':
return tag === 'head' || tag === 'body';
case '#document':
return tag === 'html';
}
// Probably in the "in body" parsing mode, so we outlaw only tag combos
// where the parsing rules cause implicit opens or closes to be added.
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
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 'body':
case 'caption':
case 'col':
case 'colgroup':
case 'frame':
case 'head':
case 'html':
case 'tbody':
case 'td':
case 'tfoot':
case 'th':
case 'thead':
case 'tr':
// These tags are only valid with a few parents that have special child
// parsing rules -- if we're down here, then none of those matched and
// so we allow it only if we don't know what the parent is, as all 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 sounds
// equivalent to this check.
return ancestorInfo.aTagInScope;
case 'nobr':
return ancestorInfo.nobrTagInScope;
}
return null;
};
/**
* Given a ReactCompositeComponent instance, return a list of its recursive
* 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, childText, childInstance, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
if (childText != null) {
process.env.NODE_ENV !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
childTag = '#text';
}
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
var problematic = invalidParent || invalidAncestor;
if (problematic) {
var ancestorTag = problematic.tag;
var ancestorInstance = problematic.instance;
var childOwner = childInstance && childInstance._currentElement._owner;
var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
var childOwners = findOwnerStack(childOwner);
var ancestorOwners = findOwnerStack(ancestorOwner);
var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
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(function (inst) {
return inst.getName() || UNKNOWN;
});
var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(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() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
// If we're warning about an invalid (non-parent) ancestry, add '...'
invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
if (didWarn[warnKey]) {
return;
}
didWarn[warnKey] = true;
var tagDisplayName = childTag;
var whitespaceInfo = '';
if (childTag === '#text') {
if (/\S/.test(childText)) {
tagDisplayName = 'Text nodes';
} else {
tagDisplayName = 'Whitespace text nodes';
whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
}
} else {
tagDisplayName = '<' + childTag + '>';
}
if (invalidParent) {
var info = '';
if (ancestorTag === 'table' && childTag === 'tr') {
info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
}
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
}
}
};
validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
// For testing
validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
};
}
module.exports = validateDOMNesting;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 151 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var DOMLazyTree = __webpack_require__(90);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactDOMEmptyComponent = function (instantiate) {
// ReactCompositeComponent uses this:
this._currentElement = null;
// ReactDOMComponentTree uses these:
this._hostNode = null;
this._hostParent = null;
this._hostContainerInfo = null;
this._domID = 0;
};
_assign(ReactDOMEmptyComponent.prototype, {
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
var domID = hostContainerInfo._idCounter++;
this._domID = domID;
this._hostParent = hostParent;
this._hostContainerInfo = hostContainerInfo;
var nodeValue = ' react-empty: ' + this._domID + ' ';
if (transaction.useCreateElement) {
var ownerDocument = hostContainerInfo._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 situation
// where React won't take over (static pages), we can simply return
// nothing.
return '';
}
return '<!--' + nodeValue + '-->';
}
},
receiveComponent: function () {},
getHostNode: function () {
return ReactDOMComponentTree.getNodeFromInstance(this);
},
unmountComponent: function () {
ReactDOMComponentTree.uncacheNode(this);
}
});
module.exports = ReactDOMEmptyComponent;
/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var invariant = __webpack_require__(42);
/**
* Return the lowest common ancestor of A and B, or null if they are in
* different trees.
*/
function getLowestCommonAncestor(instA, instB) {
!('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
!('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
var depthA = 0;
for (var tempA = instA; tempA; tempA = tempA._hostParent) {
depthA++;
}
var depthB = 0;
for (var tempB = instB; tempB; tempB = tempB._hostParent) {
depthB++;
}
// If A is deeper, crawl up.
while (depthA - depthB > 0) {
instA = instA._hostParent;
depthA--;
}
// If B is deeper, crawl up.
while (depthB - depthA > 0) {
instB = instB._hostParent;
depthB--;
}
// Walk in lockstep until we find a match.
var depth = depthA;
while (depth--) {
if (instA === instB) {
return instA;
}
instA = instA._hostParent;
instB = instB._hostParent;
}
return null;
}
/**
* Return if A is an ancestor of B.
*/
function isAncestor(instA, instB) {
!('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
!('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
while (instB) {
if (instB === instA) {
return true;
}
instB = instB._hostParent;
}
return false;
}
/**
* Return the parent instance of the passed-in instance.
*/
function getParentInstance(inst) {
!('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
return inst._hostParent;
}
/**
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
*/
function traverseTwoPhase(inst, fn, arg) {
var path = [];
while (inst) {
path.push(inst);
inst = inst._hostParent;
}
var i;
for (i = path.length; i-- > 0;) {
fn(path[i], 'captured', arg);
}
for (i = 0; i < path.length; i++) {
fn(path[i], 'bubbled', arg);
}
}
/**
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
* should would receive a `mouseEnter` or `mouseLeave` event.
*
* Does not invoke the callback on the nearest common ancestor because nothing
* "entered" or "left" that element.
*/
function traverseEnterLeave(from, to, fn, argFrom, argTo) {
var common = from && to ? getLowestCommonAncestor(from, to) : null;
var pathFrom = [];
while (from && from !== common) {
pathFrom.push(from);
from = from._hostParent;
}
var pathTo = [];
while (to && to !== common) {
pathTo.push(to);
to = to._hostParent;
}
var i;
for (i = 0; i < pathFrom.length; i++) {
fn(pathFrom[i], 'bubbled', argFrom);
}
for (i = pathTo.length; i-- > 0;) {
fn(pathTo[i], 'captured', argTo);
}
}
module.exports = {
isAncestor: isAncestor,
getLowestCommonAncestor: getLowestCommonAncestor,
getParentInstance: getParentInstance,
traverseTwoPhase: traverseTwoPhase,
traverseEnterLeave: traverseEnterLeave
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 153 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40),
_assign = __webpack_require__(58);
var DOMChildrenOperations = __webpack_require__(89);
var DOMLazyTree = __webpack_require__(90);
var ReactDOMComponentTree = __webpack_require__(39);
var escapeTextContentForBrowser = __webpack_require__(95);
var invariant = __webpack_require__(42);
var validateDOMNesting = __webpack_require__(150);
/**
* Text nodes violate a couple assumptions that React makes about components:
*
* - When mounting text into the DOM, adjacent text nodes are merged.
* - Text nodes cannot be assigned a React root ID.
*
* This component is used to wrap strings between comment nodes so that they
* can undergo the same reconciliation that is applied to elements.
*
* TODO: Investigate representing React components in the DOM with text nodes.
*
* @class ReactDOMTextComponent
* @extends ReactComponent
* @internal
*/
var ReactDOMTextComponent = function (text) {
// TODO: This is really a ReactText (ReactNode), not a ReactElement
this._currentElement = text;
this._stringText = '' + text;
// ReactDOMComponentTree uses these:
this._hostNode = null;
this._hostParent = null;
// Properties
this._domID = 0;
this._mountIndex = 0;
this._closingComment = null;
this._commentNodes = null;
};
_assign(ReactDOMTextComponent.prototype, {
/**
* Creates the markup for this text node. This node is not intended to have
* any features besides containing text content.
*
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {string} Markup for this text node.
* @internal
*/
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
if (process.env.NODE_ENV !== 'production') {
var parentInfo;
if (hostParent != null) {
parentInfo = hostParent._ancestorInfo;
} else if (hostContainerInfo != null) {
parentInfo = hostContainerInfo._ancestorInfo;
}
if (parentInfo) {
// parentInfo should always be present except for the top-level
// component when server rendering
validateDOMNesting(null, this._stringText, this, parentInfo);
}
}
var domID = hostContainerInfo._idCounter++;
var openingValue = ' react-text: ' + domID + ' ';
var closingValue = ' /react-text ';
this._domID = domID;
this._hostParent = hostParent;
if (transaction.useCreateElement) {
var ownerDocument = hostContainerInfo._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.createTextNode(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 over
// (static pages), we can simply return the text as it is.
return escapedText;
}
return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
}
},
/**
* 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 performUpdateIfNecessary
// and/or updateComponent to do the actual update for consistency with
// other component types?
this._stringText = nextStringText;
var commentNodes = this.getHostNode();
DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
}
}
},
getHostNode: function () {
var hostNode = this._commentNodes;
if (hostNode) {
return hostNode;
}
if (!this._closingComment) {
var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
var node = openingComment.nextSibling;
while (true) {
!(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
this._closingComment = node;
break;
}
node = node.nextSibling;
}
}
hostNode = [this._hostNode, this._closingComment];
this._commentNodes = hostNode;
return hostNode;
},
unmountComponent: function () {
this._closingComment = null;
this._commentNodes = null;
ReactDOMComponentTree.uncacheNode(this);
}
});
module.exports = ReactDOMTextComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 154 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var ReactUpdates = __webpack_require__(65);
var Transaction = __webpack_require__(77);
var emptyFunction = __webpack_require__(53);
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, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
}
});
var transaction = new ReactDefaultBatchingStrategyTransaction();
var ReactDefaultBatchingStrategy = {
isBatchingUpdates: false,
/**
* Call the provided function in a context within which calls to `setState`
* and friends are batched such that components aren't updated unnecessarily.
*/
batchedUpdates: function (callback, a, b, c, d, e) {
var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
ReactDefaultBatchingStrategy.isBatchingUpdates = true;
// The code is written this way to avoid extra allocations
if (alreadyBatchingUpdates) {
return callback(a, b, c, d, e);
} else {
return transaction.perform(callback, null, a, b, c, d, e);
}
}
};
module.exports = ReactDefaultBatchingStrategy;
/***/ }),
/* 155 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var EventListener = __webpack_require__(156);
var ExecutionEnvironment = __webpack_require__(56);
var PooledClass = __webpack_require__(59);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactUpdates = __webpack_require__(65);
var getEventTarget = __webpack_require__(78);
var getUnboundedScrollPosition = __webpack_require__(157);
/**
* Find the deepest React component completely containing the root of the
* 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 DOM
// traversal, but caching is difficult to do correctly without using a
// mutation observer to listen for all DOM changes.
while (inst._hostParent) {
inst = inst._hostParent;
}
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.twoArgumentPooler);
function handleTopLevelImpl(bookKeeping) {
var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
// 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, targetInst, 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} element Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapBubbledEvent: function (topLevelType, handlerBaseName, element) {
if (!element) {
return null;
}
return EventListener.listen(element, handlerBaseName, ReactEventListener.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} element Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapCapturedEvent: function (topLevelType, handlerBaseName, element) {
if (!element) {
return null;
}
return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
},
monitorScrollValue: function (refresh) {
var callback = scrollValueMonitor.bind(null, refresh);
EventListener.listen(window, 'scroll', callback);
},
dispatchEvent: function (topLevelType, nativeEvent) {
if (!ReactEventListener._enabled) {
return;
}
var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
try {
// Event queue being processed in the same cycle allows
// `preventDefault`.
ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
} finally {
TopLevelCallbackBookKeeping.release(bookKeeping);
}
}
};
module.exports = ReactEventListener;
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @typechecks
*/
var emptyFunction = __webpack_require__(53);
/**
* Upstream version of event listener. Does not take into account specific
* nature of platform.
*/
var EventListener = {
/**
* Listen to DOM events during the bubble 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.
*/
listen: function listen(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
return {
remove: function remove() {
target.removeEventListener(eventType, callback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent('on' + eventType, callback);
return {
remove: function remove() {
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 capture(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, true);
return {
remove: function remove() {
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 application ' + 'will not receive some events.');
}
return {
remove: emptyFunction
};
}
},
registerDefault: function registerDefault() {}
};
module.exports = EventListener;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 157 */
/***/ (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 directory.
*
* @typechecks
*/
'use strict';
/**
* Gets the scroll position of the supplied element or window.
*
* The return values are unbounded, unlike `getScrollPosition`. This means they
* may be negative or exceed the element boundaries (which is possible using
* inertial scrolling).
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
function getUnboundedScrollPosition(scrollable) {
if (scrollable.Window && scrollable instanceof scrollable.Window) {
return {
x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft,
y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop
};
}
return {
x: scrollable.scrollLeft,
y: scrollable.scrollTop
};
}
module.exports = getUnboundedScrollPosition;
/***/ }),
/* 158 */
/***/ (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 directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(41);
var EventPluginHub = __webpack_require__(48);
var EventPluginUtils = __webpack_require__(50);
var ReactComponentEnvironment = __webpack_require__(128);
var ReactEmptyComponent = __webpack_require__(139);
var ReactBrowserEventEmitter = __webpack_require__(114);
var ReactHostComponent = __webpack_require__(140);
var ReactUpdates = __webpack_require__(65);
var ReactInjection = {
Component: ReactComponentEnvironment.injection,
DOMProperty: DOMProperty.injection,
EmptyComponent: ReactEmptyComponent.injection,
EventPluginHub: EventPluginHub.injection,
EventPluginUtils: EventPluginUtils.injection,
EventEmitter: ReactBrowserEventEmitter.injection,
HostComponent: ReactHostComponent.injection,
Updates: ReactUpdates.injection
};
module.exports = ReactInjection;
/***/ }),
/* 159 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(58);
var CallbackQueue = __webpack_require__(66);
var PooledClass = __webpack_require__(59);
var ReactBrowserEventEmitter = __webpack_require__(114);
var ReactInputSelection = __webpack_require__(160);
var ReactInstrumentation = __webpack_require__(71);
var Transaction = __webpack_require__(77);
var ReactUpdateQueue = __webpack_require__(149);
/**
* Ensures that, when possible, the selection range (currently selected text
* input) is not disturbed by performing the transaction.
*/
var SELECTION_RESTORATION = {
/**
* @return {Selection} Selection information.
*/
initialize: ReactInputSelection.getSelectionInformation,
/**
* @param {Selection} sel Selection information returned from `initialize`.
*/
close: ReactInputSelection.restoreSelection
};
/**
* Suppresses events (blur/focus) that could be inadvertently dispatched due to
* high level DOM manipulations (like temporarily removing a text input from the
* DOM).
*/
var EVENT_SUPPRESSION = {
/**
* @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
* the reconciliation.
*/
initialize: function () {
var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
ReactBrowserEventEmitter.setEnabled(false);
return currentlyEnabled;
},
/**
* @param {boolean} previouslyEnabled Enabled status of
* `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
* restores the previous value.
*/
close: function (previouslyEnabled) {
ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
}
};
/**
* Provides a queue for collecting `componentDidMount` and
* `componentDidUpdate` callbacks during the transaction.
*/
var ON_DOM_READY_QUEUEING = {
/**
* Initializes the internal `onDOMReady` queue.
*/
initialize: function () {
this.reactMountReady.reset();
},
/**
* After DOM is flushed, invoke all registered `onDOMReady` callbacks.
*/
close: function () {
this.reactMountReady.notifyAll();
}
};
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
if (process.env.NODE_ENV !== 'production') {
TRANSACTION_WRAPPERS.push({
initialize: ReactInstrumentation.debugTool.onBeginFlush,
close: ReactInstrumentation.debugTool.onEndFlush
});
}
/**
* 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 unintentionally
* 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 that it's
// accessible and defaults to false when `ReactDOMComponent` and
// `ReactDOMTextComponent` 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;
},
/**
* @return {object} The queue to collect React async events.
*/
getUpdateQueue: function () {
return ReactUpdateQueue;
},
/**
* Save current transaction state -- if the return value from this method 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);
PooledClass.addPoolingTo(ReactReconcileTransaction);
module.exports = ReactReconcileTransaction;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 160 */
/***/ (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 directory.
*
*/
'use strict';
var ReactDOMSelection = __webpack_require__(161);
var containsNode = __webpack_require__(163);
var focusNode = __webpack_require__(103);
var getActiveElement = __webpack_require__(166);
function isInDocument(node) {
return containsNode(document.documentElement, node);
}
/**
* @ReactInputSelection: React input selection module. Based on Selection.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(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
};
},
/**
* @restoreSelection: If any selection information was potentially lost,
* restore it. This is useful when performing operations that could remove 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(priorFocusedElem)) {
if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
}
focusNode(priorFocusedElem);
}
},
/**
* @getSelection: Gets the selection bounds of a focused textarea, input 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) {
// Modern browser with input or textarea.
selection = {
start: input.selectionStart,
end: input.selectionEnd
};
} else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
// IE8 input.
var range = document.selection.createRange();
// There can only be one selection per document in IE, so it must
// be in our element.
if (range.parentElement() === input) {
selection = {
start: -range.moveStart('character', -input.value.length),
end: -range.moveEnd('character', -input.value.length)
};
}
} else {
// Content editable or old IE textarea.
selection = ReactDOMSelection.getOffsets(input);
}
return selection || { start: 0, end: 0 };
},
/**
* @setSelection: Sets the selection bounds of a textarea or input and focuses
* the input.
* -@input Set selection bounds of this input or textarea
* -@offsets Object of same form that is returned from get*
*/
setSelection: function (input, offsets) {
var start = offsets.start;
var end = offsets.end;
if (end === undefined) {
end = start;
}
if ('selectionStart' in input) {
input.selectionStart = start;
input.selectionEnd = Math.min(end, input.value.length);
} else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
var range = input.createTextRange();
range.collapse(true);
range.moveStart('character', start);
range.moveEnd('character', end - start);
range.select();
} else {
ReactDOMSelection.setOffsets(input, offsets);
}
}
};
module.exports = ReactInputSelection;
/***/ }),
/* 161 */
/***/ (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 directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(56);
var getNodeForCharacterOffset = __webpack_require__(162);
var getTextContentAccessor = __webpack_require__(60);
/**
* While `isCollapsed` is available on the Selection object and `collapsed`
* is available on the Range object, IE11 sometimes gets them wrong.
* If the anchor/focus nodes and offsets are the same, the range is collapsed.
*/
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 selection.
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 anchorNode = selection.anchorNode;
var anchorOffset = selection.anchorOffset;
var focusNode = selection.focusNode;
var focusOffset = selection.focusOffset;
var currentRange = selection.getRangeAt(0);
// In Firefox, range.startContainer and range.endContainer can be "anonymous
// divs", e.g. the up/down buttons on an <input type="number">. Anonymous
// divs do not seem to expose properties, triggering a "Permission denied
// error" if any of its properties are accessed. The only seemingly possible
// way to avoid erroring is to access a property that typically works for
// non-anonymous divs and catch any error that may otherwise arise. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=208427
try {
/* eslint-disable no-unused-expressions */
currentRange.startContainer.nodeType;
currentRange.endContainer.nodeType;
/* eslint-enable no-unused-expressions */
} catch (e) {
return null;
}
// If the node and offset values are the same, the selection is collapsed.
// `Selection.isCollapsed` is available natively, but IE sometimes gets
// this value wrong.
var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
var tempRange = currentRange.cloneRange();
tempRange.selectNodeContents(node);
tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.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 possible
* 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 selection = window.getSelection();
var length = node[getTextContentAccessor()].length;
var start = Math.min(offsets.start, length);
var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
// 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 document && !('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;
/***/ }),
/* 162 */
/***/ (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 directory.
*
*/
'use strict';
/**
* Given any node return the first leaf node without children.
*
* @param {DOMElement|DOMTextNode} node
* @return {DOMElement|DOMTextNode}
*/
function getLeafNode(node) {
while (node && node.firstChild) {
node = node.firstChild;
}
return node;
}
/**
* Get the next sibling within a container. This will walk up the
* DOM if a node's siblings have been exhausted.
*
* @param {DOMElement|DOMTextNode} node
* @return {?DOMElement|DOMTextNode}
*/
function getSiblingNode(node) {
while (node) {
if (node.nextSibling) {
return node.nextSibling;
}
node = node.parentNode;
}
}
/**
* Get object describing the nodes which contain characters at offset.
*
* @param {DOMElement|DOMTextNode} root
* @param {number} offset
* @return {?object}
*/
function getNodeForCharacterOffset(root, offset) {
var node = getLeafNode(root);
var nodeStart = 0;
var nodeEnd = 0;
while (node) {
if (node.nodeType === 3) {
nodeEnd = nodeStart + node.textContent.length;
if (nodeStart <= offset && nodeEnd >= offset) {
return {
node: node,
offset: offset - nodeStart
};
}
nodeStart = nodeEnd;
}
node = getLeafNode(getSiblingNode(node));
}
}
module.exports = getNodeForCharacterOffset;
/***/ }),
/* 163 */
/***/ (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 directory.
*
*
*/
var isTextNode = __webpack_require__(164);
/*eslint-disable no-bitwise */
/**
* Checks if a given DOM node contains or is another DOM node.
*/
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 ('contains' in outerNode) {
return outerNode.contains(innerNode);
} else if (outerNode.compareDocumentPosition) {
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
} else {
return false;
}
}
module.exports = containsNode;
/***/ }),
/* 164 */
/***/ (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 directory.
*
* @typechecks
*/
var isNode = __webpack_require__(165);
/**
* @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;
/***/ }),
/* 165 */
/***/ (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 directory.
*
* @typechecks
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
function isNode(object) {
var doc = object ? object.ownerDocument || object : document;
var defaultView = doc.defaultView || window;
return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
}
module.exports = isNode;
/***/ }),
/* 166 */
/***/ (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 directory.
*
* @typechecks
*/
/* eslint-disable fb-www/typeof-undefined */
/**
* Same as document.activeElement but wraps in a try-catch block. In IE it is
* not safe to call document.activeElement if there is nothing focused.
*
* The activeElement will be null only if the document or document body is not
* yet defined.
*
* @param {?DOMDocument} doc Defaults to current document.
* @return {?DOMElement}
*/
function getActiveElement(doc) /*?DOMElement*/{
doc = doc || (typeof document !== 'undefined' ? document : undefined);
if (typeof doc === 'undefined') {
return null;
}
try {
return doc.activeElement || doc.body;
} catch (e) {
return doc.body;
}
}
module.exports = getActiveElement;
/***/ }),
/* 167 */
/***/ (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 directory.
*
*/
'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 exclude 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',
xmlns: 0,
xmlnsXlink: 'xmlns:xlink',
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;
/***/ }),
/* 168 */
/***/ (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 directory.
*
*/
'use strict';
var EventPropagators = __webpack_require__(47);
var ExecutionEnvironment = __webpack_require__(56);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactInputSelection = __webpack_require__(160);
var SyntheticEvent = __webpack_require__(62);
var getActiveElement = __webpack_require__(166);
var isTextInputElement = __webpack_require__(80);
var shallowEqual = __webpack_require__(137);
var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
var eventTypes = {
select: {
phasedRegistrationNames: {
bubbled: 'onSelect',
captured: 'onSelectCapture'
},
dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']
}
};
var activeElement = null;
var activeElementInst = null;
var lastSelection = null;
var mouseDown = false;
// Track whether a listener exists for this plugin. If none exist, we do
// not extract events. See #3639.
var hasListener = false;
/**
* Get an object which is a unique representation of the current selection.
*
* The return value will not be consistent across nodes or browsers, but
* two identical selections on the same node will return identical objects.
*
* @param {DOMElement} node
* @return {object}
*/
function getSelection(node) {
if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(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 !== getActiveElement()) {
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, activeElementInst, nativeEvent, nativeEventTarget);
syntheticEvent.type = 'select';
syntheticEvent.target = activeElement;
EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
return syntheticEvent;
}
return null;
}
/**
* This plugin creates an `onSelect` event that normalizes select events
* across form elements.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - contentEditable
*
* This differs from native browser implementations in the following ways:
* - Fires on contentEditable fields as well as inputs.
* - Fires for collapsed selection.
* - Fires after user input.
*/
var SelectEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
if (!hasListener) {
return null;
}
var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
switch (topLevelType) {
// Track the input node that has focus.
case 'topFocus':
if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
activeElement = targetNode;
activeElementInst = targetInst;
lastSelection = null;
}
break;
case 'topBlur':
activeElement = null;
activeElementInst = null;
lastSelection = null;
break;
// Don't fire the event while the user is dragging. This matches the
// semantics of the native select event.
case 'topMouseDown':
mouseDown = true;
break;
case 'topContextMenu':
case '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 respect
// to key and input events on deletion, so we discard it.
//
// Firefox doesn't support selectionchange, so check selection status
// after each key entry. The selection changes after keydown and before
// keyup, but we check on keydown as well in the case of holding down 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 'topSelectionChange':
if (skipSelectionChangeEvent) {
break;
}
// falls through
case 'topKeyDown':
case 'topKeyUp':
return constructSelectEvent(nativeEvent, nativeEventTarget);
}
return null;
},
didPutListener: function (inst, registrationName, listener) {
if (registrationName === 'onSelect') {
hasListener = true;
}
}
};
module.exports = SelectEventPlugin;
/***/ }),
/* 169 */
/***/ (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 directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var EventListener = __webpack_require__(156);
var EventPropagators = __webpack_require__(47);
var ReactDOMComponentTree = __webpack_require__(39);
var SyntheticAnimationEvent = __webpack_require__(170);
var SyntheticClipboardEvent = __webpack_require__(171);
var SyntheticEvent = __webpack_require__(62);
var SyntheticFocusEvent = __webpack_require__(172);
var SyntheticKeyboardEvent = __webpack_require__(173);
var SyntheticMouseEvent = __webpack_require__(83);
var SyntheticDragEvent = __webpack_require__(176);
var SyntheticTouchEvent = __webpack_require__(177);
var SyntheticTransitionEvent = __webpack_require__(178);
var SyntheticUIEvent = __webpack_require__(84);
var SyntheticWheelEvent = __webpack_require__(179);
var emptyFunction = __webpack_require__(53);
var getEventCharCode = __webpack_require__(174);
var invariant = __webpack_require__(42);
/**
* Turns
* ['abort', ...]
* into
* eventTypes = {
* 'abort': {
* phasedRegistrationNames: {
* bubbled: 'onAbort',
* captured: 'onAbortCapture',
* },
* dependencies: ['topAbort'],
* },
* ...
* };
* topLevelEventsToDispatchConfig = {
* 'topAbort': { sameConfig }
* };
*/
var eventTypes = {};
var topLevelEventsToDispatchConfig = {};
['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {
var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
var onEvent = 'on' + capitalizedEvent;
var topEvent = 'top' + capitalizedEvent;
var type = {
phasedRegistrationNames: {
bubbled: onEvent,
captured: onEvent + 'Capture'
},
dependencies: [topEvent]
};
eventTypes[event] = type;
topLevelEventsToDispatchConfig[topEvent] = type;
});
var onClickListeners = {};
function getDictionaryKey(inst) {
// Prevents V8 performance issue:
// https://github.com/facebook/react/pull/7232
return '.' + inst._rootNodeID;
}
function isInteractive(tag) {
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}
var SimpleEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
if (!dispatchConfig) {
return null;
}
var EventConstructor;
switch (topLevelType) {
case 'topAbort':
case 'topCanPlay':
case 'topCanPlayThrough':
case 'topDurationChange':
case 'topEmptied':
case 'topEncrypted':
case 'topEnded':
case 'topError':
case 'topInput':
case 'topInvalid':
case 'topLoad':
case 'topLoadedData':
case 'topLoadedMetadata':
case 'topLoadStart':
case 'topPause':
case 'topPlay':
case 'topPlaying':
case 'topProgress':
case 'topRateChange':
case 'topReset':
case 'topSeeked':
case 'topSeeking':
case 'topStalled':
case 'topSubmit':
case 'topSuspend':
case 'topTimeUpdate':
case 'topVolumeChange':
case 'topWaiting':
// HTML Events
// @see http://www.w3.org/TR/html5/index.html#events-0
EventConstructor = SyntheticEvent;
break;
case '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 'topKeyDown':
case 'topKeyUp':
EventConstructor = SyntheticKeyboardEvent;
break;
case 'topBlur':
case 'topFocus':
EventConstructor = SyntheticFocusEvent;
break;
case 'topClick':
// Firefox creates a click event on right mouse clicks. This removes the
// unwanted click events.
if (nativeEvent.button === 2) {
return null;
}
/* falls through */
case 'topDoubleClick':
case 'topMouseDown':
case 'topMouseMove':
case 'topMouseUp':
// TODO: Disabled elements should not respond to mouse events
/* falls through */
case 'topMouseOut':
case 'topMouseOver':
case 'topContextMenu':
EventConstructor = SyntheticMouseEvent;
break;
case 'topDrag':
case 'topDragEnd':
case 'topDragEnter':
case 'topDragExit':
case 'topDragLeave':
case 'topDragOver':
case 'topDragStart':
case 'topDrop':
EventConstructor = SyntheticDragEvent;
break;
case 'topTouchCancel':
case 'topTouchEnd':
case 'topTouchMove':
case 'topTouchStart':
EventConstructor = SyntheticTouchEvent;
break;
case 'topAnimationEnd':
case 'topAnimationIteration':
case 'topAnimationStart':
EventConstructor = SyntheticAnimationEvent;
break;
case 'topTransitionEnd':
EventConstructor = SyntheticTransitionEvent;
break;
case 'topScroll':
EventConstructor = SyntheticUIEvent;
break;
case 'topWheel':
EventConstructor = SyntheticWheelEvent;
break;
case 'topCopy':
case 'topCut':
case 'topPaste':
EventConstructor = SyntheticClipboardEvent;
break;
}
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, 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 do not
// fire. The workaround for this bug involves attaching an empty click
// listener on the target node.
// http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
var key = getDictionaryKey(inst);
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
if (!onClickListeners[key]) {
onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
}
}
},
willDeleteListener: function (inst, registrationName) {
if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
var key = getDictionaryKey(inst);
onClickListeners[key].remove();
delete onClickListeners[key];
}
}
};
module.exports = SimpleEventPlugin;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 170 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(62);
/**
* @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 event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
module.exports = SyntheticAnimationEvent;
/***/ }),
/* 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 directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(62);
/**
* @interface Event
* @see http://www.w3.org/TR/clipboard-apis/
*/
var ClipboardEventInterface = {
clipboardData: function (event) {
return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
module.exports = SyntheticClipboardEvent;
/***/ }),
/* 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 directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(84);
/**
* @interface FocusEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var FocusEventInterface = {
relatedTarget: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @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, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
module.exports = SyntheticFocusEvent;
/***/ }),
/* 173 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(84);
var getEventCharCode = __webpack_require__(174);
var getEventKey = __webpack_require__(175);
var getEventModifierState = __webpack_require__(86);
/**
* @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 value 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 layout
// which cannot be detected. Assuming that it is a US keyboard layout
// provides a surprisingly accurate mapping for US and European users.
// 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 event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
module.exports = SyntheticKeyboardEvent;
/***/ }),
/* 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 directory.
*
*/
'use strict';
/**
* `charCode` represents the actual "character code" and is safe to use with
* `String.fromCharCode`. As such, only keys that correspond to printable
* 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 `keyCode`.
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`, discard them.
// Must not discard the (non-)printable Enter-key.
if (charCode >= 32 || charCode === 13) {
return charCode;
}
return 0;
}
module.exports = getEventCharCode;
/***/ }),
/* 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 directory.
*
*/
'use strict';
var getEventCharCode = __webpack_require__(174);
/**
* Normalization of deprecated HTML5 `key` values
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_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#Key_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;
/***/ }),
/* 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 directory.
*
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(83);
/**
* @interface DragEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var DragEventInterface = {
dataTransfer: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @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;
/***/ }),
/* 177 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(84);
var getEventModifierState = __webpack_require__(86);
/**
* @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 event.
* @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, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
module.exports = SyntheticTouchEvent;
/***/ }),
/* 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 directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(62);
/**
* @interface Event
* @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-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 event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
module.exports = SyntheticTransitionEvent;
/***/ }),
/* 179 */
/***/ (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 directory.
*
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(83);
/**
* @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 positive).
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
},
deltaY: function (event) {
return 'deltaY' in event ? event.deltaY :
// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
'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 or
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
deltaMode: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @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, WheelEventInterface);
module.exports = SyntheticWheelEvent;
/***/ }),
/* 180 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var DOMLazyTree = __webpack_require__(90);
var DOMProperty = __webpack_require__(41);
var React = __webpack_require__(3);
var ReactBrowserEventEmitter = __webpack_require__(114);
var ReactCurrentOwner = __webpack_require__(11);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactDOMContainerInfo = __webpack_require__(181);
var ReactDOMFeatureFlags = __webpack_require__(182);
var ReactFeatureFlags = __webpack_require__(67);
var ReactInstanceMap = __webpack_require__(129);
var ReactInstrumentation = __webpack_require__(71);
var ReactMarkupChecksum = __webpack_require__(183);
var ReactReconciler = __webpack_require__(68);
var ReactUpdateQueue = __webpack_require__(149);
var ReactUpdates = __webpack_require__(65);
var emptyObject = __webpack_require__(136);
var instantiateReactComponent = __webpack_require__(131);
var invariant = __webpack_require__(42);
var setInnerHTML = __webpack_require__(92);
var shouldUpdateReactComponent = __webpack_require__(138);
var warning = __webpack_require__(52);
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
var ELEMENT_NODE_TYPE = 1;
var DOC_NODE_TYPE = 9;
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
var instancesByReactRootID = {};
/**
* Finds the index of the first character
* that's not common between the two given strings.
*
* @return {number} the index of the character where the strings diverge
*/
function firstDifferenceIndex(string1, string2) {
var minLen = Math.min(string1.length, string2.length);
for (var i = 0; i < minLen; i++) {
if (string1.charAt(i) !== string2.charAt(i)) {
return i;
}
}
return string1.length === string2.length ? -1 : minLen;
}
/**
* @param {DOMElement|DOMDocument} container DOM element that may contain
* a React component
* @return {?*} DOM element that may have the reactRoot ID, or null.
*/
function getReactRootElementInContainer(container) {
if (!container) {
return null;
}
if (container.nodeType === DOC_NODE_TYPE) {
return container.documentElement;
} else {
return container.firstChild;
}
}
function internalGetID(node) {
// If node is something like a window, document, or text node, none of
// which support attributes or a .getAttribute method, gracefully return
// the empty string, as if the attribute were missing.
return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
}
/**
* Mounts this component and inserts it into the DOM.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {DOMElement} container DOM element to mount into.
* @param {ReactReconcileTransaction} transaction
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
var markerName;
if (ReactFeatureFlags.logTopLevelRenders) {
var wrappedElement = wrapperInstance._currentElement.props.child;
var type = wrappedElement.type;
markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
console.time(markerName);
}
var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
);
if (markerName) {
console.timeEnd(markerName);
}
wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
}
/**
* Batched mount.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {DOMElement} container DOM element to mount into.
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
/* useCreateElement */
!shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
ReactUpdates.ReactReconcileTransaction.release(transaction);
}
/**
* Unmounts a component and removes it from the DOM.
*
* @param {ReactComponent} instance React component instance.
* @param {DOMElement} container DOM element to unmount from.
* @final
* @internal
* @see {ReactMount.unmountComponentAtNode}
*/
function unmountComponentFromNode(instance, container, safely) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onBeginFlush();
}
ReactReconciler.unmountComponent(instance, safely);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onEndFlush();
}
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
* not a React root element. Useful for warning in `render`,
* `unmountComponentAtNode`, etc.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM element contains a direct child that 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._hostParent);
}
}
/**
* True if the supplied DOM node is a React DOM element and
* it has been rendered by another copy of React.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM has been rendered by another copy of React
* @internal
*/
function nodeIsRenderedByOtherInstance(container) {
var rootEl = getReactRootElementInContainer(container);
return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
}
/**
* True if the supplied DOM node is a valid node element.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM is a valid DOM node.
* @internal
*/
function isValidContainer(node) {
return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
}
/**
* True if the supplied DOM node is a valid React node element.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM is a valid React DOM node.
* @internal
*/
function isReactNode(node) {
return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
}
function getHostRootInstanceInContainer(container) {
var rootEl = getReactRootElementInContainer(container);
var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
}
function getTopLevelWrapperInContainer(container) {
var root = getHostRootInstanceInContainer(container);
return root ? root._hostContainerInfo._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 components
* 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 () {
return this.props.child;
};
TopLevelWrapper.isReactTopLevelWrapper = true;
/**
* Mounting is the process of initializing a React component by creating its
* representative DOM elements and inserting them into a supplied `container`.
* 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 React
* // ... 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 its 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
*/
_updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
ReactMount.scrollMonitor(container, function () {
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
if (callback) {
ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
}
});
return prevComponent;
},
/**
* Render a new component into the DOM. Hooked by hooks!
*
* @param {ReactElement} nextElement element to render
* @param {DOMElement} container container to render into
* @param {boolean} shouldReuseMarkup if we should skip the markup insertion
* @return {ReactComponent} nextComponent
*/
_renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case.
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
ReactBrowserEventEmitter.ensureScrollValueMonitoring();
var componentInstance = instantiateReactComponent(nextElement, false);
// The initial render is synchronous but any updates that happen during
// rendering, in componentWillMount or componentDidMount, will be batched
// according to the current batching strategy.
ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
var wrapperID = componentInstance._instance.rootID;
instancesByReactRootID[wrapperID] = componentInstance;
return componentInstance;
},
/**
* Renders a React component into the DOM in the supplied `container`.
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @param {ReactComponent} parentComponent The conceptual parent of this 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, container, callback) {
!(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
},
_renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
!React.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.' : '') : _prodInvariant('39', 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 />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
var nextWrappedElement = React.createElement(TopLevelWrapper, { child: nextElement });
var nextContext;
if (parentComponent) {
var parentInst = ReactInstanceMap.get(parentComponent);
nextContext = parentInst._processChildContext(parentInst._context);
} else {
nextContext = emptyObject;
}
var prevComponent = getTopLevelWrapperInContainer(container);
if (prevComponent) {
var prevWrappedElement = prevComponent._currentElement;
var prevElement = prevWrappedElement.props.child;
if (shouldUpdateReactComponent(prevElement, nextElement)) {
var publicInst = prevComponent._renderedComponent.getPublicInstance();
var updatedCallback = callback && function () {
callback.call(publicInst);
};
ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
return publicInst;
} else {
ReactMount.unmountComponentAtNode(container);
}
}
var reactRootElement = getReactRootElementInContainer(container);
var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
var containerHasNonRootReactChild = hasNonRootReactChild(container);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
if (!containerHasReactMarkup || reactRootElement.nextSibling) {
var rootElementSibling = reactRootElement;
while (rootElementSibling) {
if (internalGetID(rootElementSibling)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
break;
}
rootElementSibling = rootElementSibling.nextSibling;
}
}
}
var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
if (callback) {
callback.call(component);
}
return component;
},
/**
* Renders a React component into the DOM in the supplied `container`.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @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`.
*/
render: function (nextElement, container, callback) {
return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
},
/**
* Unmounts and destroys the React component rendered in the `container`.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
*
* @param {DOMElement} container DOM element containing a React component.
* @return {boolean} True if a component was found in and unmounted from
* `container`
*/
unmountComponentAtNode: function (container) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// 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.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
}
var prevComponent = getTopLevelWrapperInContainer(container);
if (!prevComponent) {
// Check if the node being unmounted was rendered by React, but isn't a
// root node.
var containerHasNonRootReactChild = hasNonRootReactChild(container);
// Check if the container itself is a React root node.
var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
}
return false;
}
delete instancesByReactRootID[prevComponent._instance.rootID];
ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
return true;
},
_mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
if (shouldReuseMarkup) {
var rootElement = getReactRootElementInContainer(container);
if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
ReactDOMComponentTree.precacheNode(instance, rootElement);
return;
} else {
var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
var rootMarkup = rootElement.outerHTML;
rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
var normalizedMarkup = markup;
if (process.env.NODE_ENV !== 'production') {
// because rootMarkup is retrieved from the DOM, various normalizations
// will have occurred which will not be present in `markup`. Here,
// insert markup into a <div> or <iframe> depending on the container
// type to perform the same normalizations before comparing.
var normalizer;
if (container.nodeType === ELEMENT_NODE_TYPE) {
normalizer = document.createElement('div');
normalizer.innerHTML = markup;
normalizedMarkup = normalizer.innerHTML;
} else {
normalizer = document.createElement('iframe');
document.body.appendChild(normalizer);
normalizer.contentDocument.write(markup);
normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
document.body.removeChild(normalizer);
}
}
var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
}
}
}
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0;
if (transaction.useCreateElement) {
while (container.lastChild) {
container.removeChild(container.lastChild);
}
DOMLazyTree.insertTreeBefore(container, markup, null);
} else {
setInnerHTML(container, markup);
ReactDOMComponentTree.precacheNode(instance, container.firstChild);
}
if (process.env.NODE_ENV !== 'production') {
var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
if (hostNode._debugID !== 0) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: hostNode._debugID,
type: 'mount',
payload: markup.toString()
});
}
}
}
};
module.exports = ReactMount;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 181 */
/***/ (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 directory.
*
*/
'use strict';
var validateDOMNesting = __webpack_require__(150);
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(null, info._tag, null) : null;
}
return info;
}
module.exports = ReactDOMContainerInfo;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 182 */
/***/ (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 directory.
*
*/
'use strict';
var ReactDOMFeatureFlags = {
useCreateElement: true,
useFiber: false
};
module.exports = ReactDOMFeatureFlags;
/***/ }),
/* 183 */
/***/ (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 directory.
*
*/
'use strict';
var adler32 = __webpack_require__(184);
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.CHECKSUM_ATTR_NAME);
existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
var markupChecksum = adler32(markup);
return markupChecksum === existingChecksum;
}
};
module.exports = ReactMarkupChecksum;
/***/ }),
/* 184 */
/***/ (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 directory.
*
*
*/
'use strict';
var MOD = 65521;
// adler32 is not cryptographically strong, and is only used to sanity check that
// markup generated on the server matches the markup generated on the client.
// This implementation (a modified version of the SheetJS version) has been optimized
// for our use case, at the expense of conforming to the adler32 specification
// 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;
/***/ }),
/* 185 */
/***/ (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 directory.
*
*/
'use strict';
module.exports = '15.5.4';
/***/ }),
/* 186 */
/***/ (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 directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(40);
var ReactCurrentOwner = __webpack_require__(11);
var ReactDOMComponentTree = __webpack_require__(39);
var ReactInstanceMap = __webpack_require__(129);
var getHostComponentFromComposite = __webpack_require__(187);
var invariant = __webpack_require__(42);
var warning = __webpack_require__(52);
/**
* Returns the DOM node rendered by this element.
*
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
*
* @param {ReactComponent|DOMElement} componentOrElement
* @return {?DOMElement} The root node of this element.
*/
function findDOMNode(componentOrElement) {
if (process.env.NODE_ENV !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null) {
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
owner._warnedAboutRefsInRender = true;
}
}
if (componentOrElement == null) {
return null;
}
if (componentOrElement.nodeType === 1) {
return componentOrElement;
}
var inst = ReactInstanceMap.get(componentOrElement);
if (inst) {
inst = getHostComponentFromComposite(inst);
return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
}
if (typeof componentOrElement.render === 'function') {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
} else {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
}
}
module.exports = findDOMNode;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 187 */
/***/ (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 directory.
*
*/
'use strict';
var ReactNodeTypes = __webpack_require__(133);
function getHostComponentFromComposite(inst) {
var type;
while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
inst = inst._renderedComponent;
}
if (type === ReactNodeTypes.HOST) {
return inst._renderedComponent;
} else if (type === ReactNodeTypes.EMPTY) {
return null;
}
}
module.exports = getHostComponentFromComposite;
/***/ }),
/* 188 */
/***/ (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 directory.
*
*/
'use strict';
var ReactMount = __webpack_require__(180);
module.exports = ReactMount.renderSubtreeIntoContainer;
/***/ }),
/* 189 */
/***/ (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 directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(41);
var EventPluginRegistry = __webpack_require__(49);
var ReactComponentTreeHook = __webpack_require__(27);
var warning = __webpack_require__(52);
if (process.env.NODE_ENV !== 'production') {
var reactProps = {
children: true,
dangerouslySetInnerHTML: true,
key: true,
ref: true,
autoFocus: true,
defaultValue: true,
valueLink: true,
defaultChecked: true,
checkedLink: true,
innerHTML: true,
suppressContentEditableWarning: true,
onFocusIn: true,
onFocusOut: true
};
var warnedProperties = {};
var validateProperty = function (tagName, name, debugID) {
if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
return true;
}
if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
return true;
}
if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
return true;
}
warnedProperties[name] = true;
var lowerCasedName = name.toLowerCase();
// data-* attributes should be lowercase; suggest the lowercase version
var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
if (standardName != null) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
return true;
} else if (registrationName != null) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
return true;
} else {
// We were unable to guess which prop the user intended.
// It is likely that the user was just blindly spreading/forwarding props
// Components should be careful to only render valid props/attributes.
// Warning will be invoked in warnUnknownProperties to allow grouping.
return false;
}
};
}
var warnUnknownProperties = function (debugID, element) {
var unknownProps = [];
for (var key in element.props) {
var isValid = validateProperty(element.type, key, debugID);
if (!isValid) {
unknownProps.push(key);
}
}
var unknownPropString = unknownProps.map(function (prop) {
return '`' + prop + '`';
}).join(', ');
if (unknownProps.length === 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
} else if (unknownProps.length > 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
}
};
function handleElement(debugID, element) {
if (element == null || typeof element.type !== 'string') {
return;
}
if (element.type.indexOf('-') >= 0 || element.props.is) {
return;
}
warnUnknownProperties(debugID, element);
}
var ReactDOMUnknownPropertyHook = {
onBeforeMountComponent: function (debugID, element) {
handleElement(debugID, element);
},
onBeforeUpdateComponent: function (debugID, element) {
handleElement(debugID, element);
}
};
module.exports = ReactDOMUnknownPropertyHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 190 */
/***/ (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 directory.
*
*/
'use strict';
var ReactComponentTreeHook = __webpack_require__(27);
var warning = __webpack_require__(52);
var didWarnValueNull = false;
function handleElement(debugID, element) {
if (element == null) {
return;
}
if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
return;
}
if (element.props != null && element.props.value === null && !didWarnValueNull) {
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
didWarnValueNull = true;
}
}
var ReactDOMNullInputValuePropHook = {
onBeforeMountComponent: function (debugID, element) {
handleElement(debugID, element);
},
onBeforeUpdateComponent: function (debugID, element) {
handleElement(debugID, element);
}
};
module.exports = ReactDOMNullInputValuePropHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 191 */
/***/ (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 directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(41);
var ReactComponentTreeHook = __webpack_require__(27);
var warning = __webpack_require__(52);
var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
function validateProperty(tagName, name, debugID) {
if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
return true;
}
if (rARIA.test(name)) {
var lowerCasedName = name.toLowerCase();
var standardName = DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
// If this is an aria-* attribute, but is not listed in the known DOM
// DOM properties, then it is an invalid aria-* attribute.
if (standardName == null) {
warnedProperties[name] = true;
return false;
}
// aria-* attributes should be lowercase; suggest the lowercase version.
if (name !== standardName) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
warnedProperties[name] = true;
return true;
}
}
return true;
}
function warnInvalidARIAProps(debugID, element) {
var invalidProps = [];
for (var key in element.props) {
var isValid = validateProperty(element.type, key, debugID);
if (!isValid) {
invalidProps.push(key);
}
}
var unknownPropString = invalidProps.map(function (prop) {
return '`' + prop + '`';
}).join(', ');
if (invalidProps.length === 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
} else if (invalidProps.length > 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
}
}
function handleElement(debugID, element) {
if (element == null || typeof element.type !== 'string') {
return;
}
if (element.type.indexOf('-') >= 0 || element.props.is) {
return;
}
warnInvalidARIAProps(debugID, element);
}
var ReactDOMInvalidARIAHook = {
onBeforeMountComponent: function (debugID, element) {
if (process.env.NODE_ENV !== 'production') {
handleElement(debugID, element);
}
},
onBeforeUpdateComponent: function (debugID, element) {
if (process.env.NODE_ENV !== 'production') {
handleElement(debugID, element);
}
}
};
module.exports = ReactDOMInvalidARIAHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 192 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.createMemoryHistory = exports.hashHistory = exports.browserHistory = exports.applyRouterMiddleware = exports.formatPattern = exports.useRouterHistory = exports.match = exports.routerShape = exports.locationShape = exports.RouterContext = exports.createRoutes = exports.Route = exports.Redirect = exports.IndexRoute = exports.IndexRedirect = exports.withRouter = exports.IndexLink = exports.Link = exports.Router = undefined;
var _RouteUtils = __webpack_require__(193);
Object.defineProperty(exports, 'createRoutes', {
enumerable: true,
get: function get() {
return _RouteUtils.createRoutes;
}
});
var _PropTypes = __webpack_require__(194);
Object.defineProperty(exports, 'locationShape', {
enumerable: true,
get: function get() {
return _PropTypes.locationShape;
}
});
Object.defineProperty(exports, 'routerShape', {
enumerable: true,
get: function get() {
return _PropTypes.routerShape;
}
});
var _PatternUtils = __webpack_require__(203);
Object.defineProperty(exports, 'formatPattern', {
enumerable: true,
get: function get() {
return _PatternUtils.formatPattern;
}
});
var _Router2 = __webpack_require__(205);
var _Router3 = _interopRequireDefault(_Router2);
var _Link2 = __webpack_require__(228);
var _Link3 = _interopRequireDefault(_Link2);
var _IndexLink2 = __webpack_require__(229);
var _IndexLink3 = _interopRequireDefault(_IndexLink2);
var _withRouter2 = __webpack_require__(230);
var _withRouter3 = _interopRequireDefault(_withRouter2);
var _IndexRedirect2 = __webpack_require__(232);
var _IndexRedirect3 = _interopRequireDefault(_IndexRedirect2);
var _IndexRoute2 = __webpack_require__(234);
var _IndexRoute3 = _interopRequireDefault(_IndexRoute2);
var _Redirect2 = __webpack_require__(233);
var _Redirect3 = _interopRequireDefault(_Redirect2);
var _Route2 = __webpack_require__(235);
var _Route3 = _interopRequireDefault(_Route2);
var _RouterContext2 = __webpack_require__(224);
var _RouterContext3 = _interopRequireDefault(_RouterContext2);
var _match2 = __webpack_require__(236);
var _match3 = _interopRequireDefault(_match2);
var _useRouterHistory2 = __webpack_require__(250);
var _useRouterHistory3 = _interopRequireDefault(_useRouterHistory2);
var _applyRouterMiddleware2 = __webpack_require__(251);
var _applyRouterMiddleware3 = _interopRequireDefault(_applyRouterMiddleware2);
var _browserHistory2 = __webpack_require__(252);
var _browserHistory3 = _interopRequireDefault(_browserHistory2);
var _hashHistory2 = __webpack_require__(260);
var _hashHistory3 = _interopRequireDefault(_hashHistory2);
var _createMemoryHistory2 = __webpack_require__(238);
var _createMemoryHistory3 = _interopRequireDefault(_createMemoryHistory2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Router = _Router3.default; /* components */
exports.Link = _Link3.default;
exports.IndexLink = _IndexLink3.default;
exports.withRouter = _withRouter3.default;
/* components (configuration) */
exports.IndexRedirect = _IndexRedirect3.default;
exports.IndexRoute = _IndexRoute3.default;
exports.Redirect = _Redirect3.default;
exports.Route = _Route3.default;
/* utils */
exports.RouterContext = _RouterContext3.default;
exports.match = _match3.default;
exports.useRouterHistory = _useRouterHistory3.default;
exports.applyRouterMiddleware = _applyRouterMiddleware3.default;
/* histories */
exports.browserHistory = _browserHistory3.default;
exports.hashHistory = _hashHistory3.default;
exports.createMemoryHistory = _createMemoryHistory3.default;
/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.isReactChildren = isReactChildren;
exports.createRouteFromReactElement = createRouteFromReactElement;
exports.createRoutesFromReactChildren = createRoutesFromReactChildren;
exports.createRoutes = createRoutes;
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isValidChild(object) {
return object == null || _react2.default.isValidElement(object);
}
function isReactChildren(object) {
return isValidChild(object) || Array.isArray(object) && object.every(isValidChild);
}
function createRoute(defaultProps, props) {
return _extends({}, defaultProps, props);
}
function createRouteFromReactElement(element) {
var type = element.type;
var route = createRoute(type.defaultProps, element.props);
if (route.children) {
var childRoutes = createRoutesFromReactChildren(route.children, route);
if (childRoutes.length) route.childRoutes = childRoutes;
delete route.children;
}
return route;
}
/**
* Creates and returns a routes object from the given ReactChildren. JSX
* provides a convenient way to visualize how routes in the hierarchy are
* nested.
*
* import { Route, createRoutesFromReactChildren } from 'react-router'
*
* const routes = createRoutesFromReactChildren(
* <Route component={App}>
* <Route path="home" component={Dashboard}/>
* <Route path="news" component={NewsFeed}/>
* </Route>
* )
*
* Note: This method is automatically used when you provide <Route> children
* to a <Router> component.
*/
function createRoutesFromReactChildren(children, parentRoute) {
var routes = [];
_react2.default.Children.forEach(children, function (element) {
if (_react2.default.isValidElement(element)) {
// Component classes may have a static create* method.
if (element.type.createRouteFromReactElement) {
var route = element.type.createRouteFromReactElement(element, parentRoute);
if (route) routes.push(route);
} else {
routes.push(createRouteFromReactElement(element));
}
}
});
return routes;
}
/**
* Creates and returns an array of routes from the given object which
* may be a JSX route, a plain object route, or an array of either.
*/
function createRoutes(routes) {
if (isReactChildren(routes)) {
routes = createRoutesFromReactChildren(routes);
} else if (routes && !Array.isArray(routes)) {
routes = [routes];
}
return routes;
}
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.locationShape = exports.routerShape = undefined;
var _propTypes = __webpack_require__(195);
var routerShape = exports.routerShape = (0, _propTypes.shape)({
push: _propTypes.func.isRequired,
replace: _propTypes.func.isRequired,
go: _propTypes.func.isRequired,
goBack: _propTypes.func.isRequired,
goForward: _propTypes.func.isRequired,
setRouteLeaveHook: _propTypes.func.isRequired,
isActive: _propTypes.func.isRequired
});
var locationShape = exports.locationShape = (0, _propTypes.shape)({
pathname: _propTypes.string.isRequired,
search: _propTypes.string.isRequired,
state: _propTypes.object,
action: _propTypes.string.isRequired,
key: _propTypes.string
});
/***/ }),
/* 195 */
/***/ (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 directory.
*/
if (process.env.NODE_ENV !== 'production') {
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
Symbol.for &&
Symbol.for('react.element')) ||
0xeac7;
var isValidElement = function(object) {
return typeof object === 'object' &&
object !== null &&
object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = __webpack_require__(196)(isValidElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(202)();
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 196 */
/***/ (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 directory.
*/
'use strict';
var emptyFunction = __webpack_require__(197);
var invariant = __webpack_require__(198);
var warning = __webpack_require__(199);
var ReactPropTypesSecret = __webpack_require__(200);
var checkPropTypes = __webpack_require__(201);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* 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[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* 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([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. 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>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
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 own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_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*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== 'production') {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
warning(
false,
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
'received %s at index %s.',
getPostfixForTypeWarning(checker),
i
);
return emptyFunction.thatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
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;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
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';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 197 */
/***/ (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 directory.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = 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;
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (process.env.NODE_ENV !== 'production') {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} 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__(4)))
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-2015, 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 directory.
*
*/
'use strict';
var emptyFunction = __webpack_require__(197);
/**
* 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 critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
(function () {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
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 this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
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) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
})();
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 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 directory.
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 201 */
/***/ (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 directory.
*/
'use strict';
if (process.env.NODE_ENV !== 'production') {
var invariant = __webpack_require__(198);
var warning = __webpack_require__(199);
var ReactPropTypesSecret = __webpack_require__(200);
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (process.env.NODE_ENV !== 'production') {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
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 message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 202 */
/***/ (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 directory.
*/
'use strict';
var emptyFunction = __webpack_require__(197);
var invariant = __webpack_require__(198);
var ReactPropTypesSecret = __webpack_require__(200);
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
};
shim.isRequired = shim;
function getShim() {
return shim;
};
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim
};
ReactPropTypes.checkPropTypes = emptyFunction;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 203 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.compilePattern = compilePattern;
exports.matchPattern = matchPattern;
exports.getParamNames = getParamNames;
exports.getParams = getParams;
exports.formatPattern = formatPattern;
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
function _compilePattern(pattern) {
var regexpSource = '';
var paramNames = [];
var tokens = [];
var match = void 0,
lastIndex = 0,
matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)|\\\(|\\\)/g;
while (match = matcher.exec(pattern)) {
if (match.index !== lastIndex) {
tokens.push(pattern.slice(lastIndex, match.index));
regexpSource += escapeRegExp(pattern.slice(lastIndex, match.index));
}
if (match[1]) {
regexpSource += '([^/]+)';
paramNames.push(match[1]);
} else if (match[0] === '**') {
regexpSource += '(.*)';
paramNames.push('splat');
} else if (match[0] === '*') {
regexpSource += '(.*?)';
paramNames.push('splat');
} else if (match[0] === '(') {
regexpSource += '(?:';
} else if (match[0] === ')') {
regexpSource += ')?';
} else if (match[0] === '\\(') {
regexpSource += '\\(';
} else if (match[0] === '\\)') {
regexpSource += '\\)';
}
tokens.push(match[0]);
lastIndex = matcher.lastIndex;
}
if (lastIndex !== pattern.length) {
tokens.push(pattern.slice(lastIndex, pattern.length));
regexpSource += escapeRegExp(pattern.slice(lastIndex, pattern.length));
}
return {
pattern: pattern,
regexpSource: regexpSource,
paramNames: paramNames,
tokens: tokens
};
}
var CompiledPatternsCache = Object.create(null);
function compilePattern(pattern) {
if (!CompiledPatternsCache[pattern]) CompiledPatternsCache[pattern] = _compilePattern(pattern);
return CompiledPatternsCache[pattern];
}
/**
* Attempts to match a pattern on the given pathname. Patterns may use
* the following special characters:
*
* - :paramName Matches a URL segment up to the next /, ?, or #. The
* captured string is considered a "param"
* - () Wraps a segment of the URL that is optional
* - * Consumes (non-greedy) all characters up to the next
* character in the pattern, or to the end of the URL if
* there is none
* - ** Consumes (greedy) all characters up to the next character
* in the pattern, or to the end of the URL if there is none
*
* The function calls callback(error, matched) when finished.
* The return value is an object with the following properties:
*
* - remainingPathname
* - paramNames
* - paramValues
*/
function matchPattern(pattern, pathname) {
// Ensure pattern starts with leading slash for consistency with pathname.
if (pattern.charAt(0) !== '/') {
pattern = '/' + pattern;
}
var _compilePattern2 = compilePattern(pattern),
regexpSource = _compilePattern2.regexpSource,
paramNames = _compilePattern2.paramNames,
tokens = _compilePattern2.tokens;
if (pattern.charAt(pattern.length - 1) !== '/') {
regexpSource += '/?'; // Allow optional path separator at end.
}
// Special-case patterns like '*' for catch-all routes.
if (tokens[tokens.length - 1] === '*') {
regexpSource += '$';
}
var match = pathname.match(new RegExp('^' + regexpSource, 'i'));
if (match == null) {
return null;
}
var matchedPath = match[0];
var remainingPathname = pathname.substr(matchedPath.length);
if (remainingPathname) {
// Require that the match ends at a path separator, if we didn't match
// the full path, so any remaining pathname is a new path segment.
if (matchedPath.charAt(matchedPath.length - 1) !== '/') {
return null;
}
// If there is a remaining pathname, treat the path separator as part of
// the remaining pathname for properly continuing the match.
remainingPathname = '/' + remainingPathname;
}
return {
remainingPathname: remainingPathname,
paramNames: paramNames,
paramValues: match.slice(1).map(function (v) {
return v && decodeURIComponent(v);
})
};
}
function getParamNames(pattern) {
return compilePattern(pattern).paramNames;
}
function getParams(pattern, pathname) {
var match = matchPattern(pattern, pathname);
if (!match) {
return null;
}
var paramNames = match.paramNames,
paramValues = match.paramValues;
var params = {};
paramNames.forEach(function (paramName, index) {
params[paramName] = paramValues[index];
});
return params;
}
/**
* Returns a version of the given pattern with params interpolated. Throws
* if there is a dynamic segment of the pattern for which there is no param.
*/
function formatPattern(pattern, params) {
params = params || {};
var _compilePattern3 = compilePattern(pattern),
tokens = _compilePattern3.tokens;
var parenCount = 0,
pathname = '',
splatIndex = 0,
parenHistory = [];
var token = void 0,
paramName = void 0,
paramValue = void 0;
for (var i = 0, len = tokens.length; i < len; ++i) {
token = tokens[i];
if (token === '*' || token === '**') {
paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat;
!(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Missing splat #%s for path "%s"', splatIndex, pattern) : (0, _invariant2.default)(false) : void 0;
if (paramValue != null) pathname += encodeURI(paramValue);
} else if (token === '(') {
parenHistory[parenCount] = '';
parenCount += 1;
} else if (token === ')') {
var parenText = parenHistory.pop();
parenCount -= 1;
if (parenCount) parenHistory[parenCount - 1] += parenText;else pathname += parenText;
} else if (token === '\\(') {
pathname += '(';
} else if (token === '\\)') {
pathname += ')';
} else if (token.charAt(0) === ':') {
paramName = token.substring(1);
paramValue = params[paramName];
!(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Missing "%s" parameter for path "%s"', paramName, pattern) : (0, _invariant2.default)(false) : void 0;
if (paramValue == null) {
if (parenCount) {
parenHistory[parenCount - 1] = '';
var curTokenIdx = tokens.indexOf(token);
var tokensSubset = tokens.slice(curTokenIdx, tokens.length);
var nextParenIdx = -1;
for (var _i = 0; _i < tokensSubset.length; _i++) {
if (tokensSubset[_i] == ')') {
nextParenIdx = _i;
break;
}
}
!(nextParenIdx > 0) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Path "%s" is missing end paren at segment "%s"', pattern, tokensSubset.join('')) : (0, _invariant2.default)(false) : void 0;
// jump to ending paren
i = curTokenIdx + nextParenIdx - 1;
}
} else if (parenCount) parenHistory[parenCount - 1] += encodeURIComponent(paramValue);else pathname += encodeURIComponent(paramValue);
} else {
if (parenCount) parenHistory[parenCount - 1] += token;else pathname += token;
}
}
!(parenCount <= 0) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Path "%s" is missing end paren', pattern) : (0, _invariant2.default)(false) : void 0;
return pathname.replace(/\/+/g, '/');
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-2015, 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 directory.
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var invariant = function(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-minified dev environment ' +
'for the full error message and additional helpful warnings.'
);
} 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__(4)))
/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(195);
var _createTransitionManager2 = __webpack_require__(213);
var _createTransitionManager3 = _interopRequireDefault(_createTransitionManager2);
var _InternalPropTypes = __webpack_require__(223);
var _RouterContext = __webpack_require__(224);
var _RouterContext2 = _interopRequireDefault(_RouterContext);
var _RouteUtils = __webpack_require__(193);
var _RouterUtils = __webpack_require__(227);
var _routerWarning = __webpack_require__(214);
var _routerWarning2 = _interopRequireDefault(_routerWarning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var propTypes = {
history: _propTypes.object,
children: _InternalPropTypes.routes,
routes: _InternalPropTypes.routes, // alias for children
render: _propTypes.func,
createElement: _propTypes.func,
onError: _propTypes.func,
onUpdate: _propTypes.func,
// PRIVATE: For client-side rehydration of server match.
matchContext: _propTypes.object
};
/**
* A <Router> is a high-level API for automatically setting up
* a router that renders a <RouterContext> with all the props
* it needs each time the URL changes.
*/
var Router = (0, _createReactClass2.default)({
displayName: 'Router',
propTypes: propTypes,
getDefaultProps: function getDefaultProps() {
return {
render: function render(props) {
return _react2.default.createElement(_RouterContext2.default, props);
}
};
},
getInitialState: function getInitialState() {
return {
location: null,
routes: null,
params: null,
components: null
};
},
handleError: function handleError(error) {
if (this.props.onError) {
this.props.onError.call(this, error);
} else {
// Throw errors by default so we don't silently swallow them!
throw error; // This error probably occurred in getChildRoutes or getComponents.
}
},
createRouterObject: function createRouterObject(state) {
var matchContext = this.props.matchContext;
if (matchContext) {
return matchContext.router;
}
var history = this.props.history;
return (0, _RouterUtils.createRouterObject)(history, this.transitionManager, state);
},
createTransitionManager: function createTransitionManager() {
var matchContext = this.props.matchContext;
if (matchContext) {
return matchContext.transitionManager;
}
var history = this.props.history;
var _props = this.props,
routes = _props.routes,
children = _props.children;
!history.getCurrentLocation ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'You have provided a history object created with history v4.x or v2.x ' + 'and earlier. This version of React Router is only compatible with v3 ' + 'history objects. Please change to history v3.x.') : (0, _invariant2.default)(false) : void 0;
return (0, _createTransitionManager3.default)(history, (0, _RouteUtils.createRoutes)(routes || children));
},
componentWillMount: function componentWillMount() {
var _this = this;
this.transitionManager = this.createTransitionManager();
this.router = this.createRouterObject(this.state);
this._unlisten = this.transitionManager.listen(function (error, state) {
if (error) {
_this.handleError(error);
} else {
// Keep the identity of this.router because of a caveat in ContextUtils:
// they only work if the object identity is preserved.
(0, _RouterUtils.assignRouterState)(_this.router, state);
_this.setState(state, _this.props.onUpdate);
}
});
},
/* istanbul ignore next: sanity check */
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(nextProps.history === this.props.history, 'You cannot change <Router history>; it will be ignored') : void 0;
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)((nextProps.routes || nextProps.children) === (this.props.routes || this.props.children), 'You cannot change <Router routes>; it will be ignored') : void 0;
},
componentWillUnmount: function componentWillUnmount() {
if (this._unlisten) this._unlisten();
},
render: function render() {
var _state = this.state,
location = _state.location,
routes = _state.routes,
params = _state.params,
components = _state.components;
var _props2 = this.props,
createElement = _props2.createElement,
render = _props2.render,
props = _objectWithoutProperties(_props2, ['createElement', 'render']);
if (location == null) return null; // Async match
// Only forward non-Router-specific props to routing context, as those are
// the only ones that might be custom routing context props.
Object.keys(propTypes).forEach(function (propType) {
return delete props[propType];
});
return render(_extends({}, props, {
router: this.router,
location: location,
routes: routes,
params: params,
components: components,
createElement: createElement
}));
}
});
exports.default = Router;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 206 */
/***/ (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 directory.
*
*/
'use strict';
var React = __webpack_require__(2);
var factory = __webpack_require__(207);
// Hack to grab NoopUpdateQueue from isomorphic React
var ReactNoopUpdateQueue = new React.Component().updater;
module.exports = factory(
React.Component,
React.isValidElement,
ReactNoopUpdateQueue
);
/***/ }),
/* 207 */
/***/ (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 directory.
*
*/
'use strict';
var _assign = __webpack_require__(208);
var emptyObject = __webpack_require__(209);
var _invariant = __webpack_require__(210);
if (process.env.NODE_ENV !== 'production') {
var warning = __webpack_require__(211);
}
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
var ReactPropTypeLocationNames;
if (process.env.NODE_ENV !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context',
};
} else {
ReactPropTypeLocationNames = {};
}
function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return <div>Hello World</div>;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: 'DEFINE_MANY',
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: 'DEFINE_MANY',
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: 'DEFINE_MANY',
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: 'DEFINE_MANY',
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: 'DEFINE_MANY',
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: '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: 'DEFINE_MANY_MERGED',
/**
* @return {object}
* @optional
*/
getChildContext: '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 invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @nosideeffects
* @required
*/
render: 'DEFINE_ONCE',
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: 'DEFINE_MANY',
/**
* Invoked when the component has been mounted and has a DOM representation.
* 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: 'DEFINE_MANY',
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming 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: 'DEFINE_MANY',
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* 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: 'DEFINE_ONCE',
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* 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: '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 {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: 'DEFINE_MANY',
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: 'DEFINE_MANY',
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: 'OVERRIDE_BASE'
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* 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, 'childContext');
}
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, 'context');
}
Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function (Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function (Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
statics: function (Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function () {} };
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an _invariant so components
// don't show up in prod but only in __DEV__
process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
_invariant(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name);
}
// Disallow defining methods more than once unless explicitly allowed.
if (isAlreadyDefined) {
_invariant(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name);
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classes.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
if (process.env.NODE_ENV !== 'production') {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
}
return;
}
_invariant(typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.');
_invariant(!isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.');
var proto = Constructor.prototype;
var autoBindPairs = proto.__reactAutoBindPairs;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
var isAlreadyDefined = proto.hasOwnProperty(name);
validateMethodOverride(isAlreadyDefined, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
_invariant(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name);
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if (process.env.NODE_ENV !== 'production') {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
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;
_invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name);
var isInherited = name in Constructor;
_invariant(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name);
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) {
_invariant(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.');
for (var key in two) {
if (two.hasOwnProperty(key)) {
_invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key);
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 return 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 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
} else if (!args.length) {
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
var pairs = component.__reactAutoBindPairs;
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
var IsMountedMixin = {
componentDidMount: function () {
this.__isMounted = true;
},
componentWillUnmount: function () {
this.__isMounted = false;
}
};
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function (newState, callback) {
this.updater.enqueueReplaceState(this, newState, callback);
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function () {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component') : void 0;
this.__didWarnIsMounted = true;
}
return !!this.__isMounted;
}
};
var ReactClassComponent = function () {};
_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
/**
* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
function createClass(spec) {
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(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 initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (initialState === undefined && this.getInitialState._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
_invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent');
this.state = initialState;
});
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
Constructor.prototype.__reactAutoBindPairs = [];
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, IsMountedMixin);
mixSpecIntoComponent(Constructor, spec);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if (process.env.NODE_ENV !== 'production') {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
_invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.');
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
}
return createClass;
}
module.exports = factory;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 208 */
/***/ (function(module, exports) {
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
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 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
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(function (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 (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
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 (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 210 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* 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 directory.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (process.env.NODE_ENV !== 'production') {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} 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__(4)))
/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-2015, 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 directory.
*
*/
'use strict';
var emptyFunction = __webpack_require__(212);
/**
* 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 critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
(function () {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
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 this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
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) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
})();
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 212 */
/***/ (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 directory.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = 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;
/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.default = createTransitionManager;
var _routerWarning = __webpack_require__(214);
var _routerWarning2 = _interopRequireDefault(_routerWarning);
var _computeChangedRoutes2 = __webpack_require__(216);
var _computeChangedRoutes3 = _interopRequireDefault(_computeChangedRoutes2);
var _TransitionUtils = __webpack_require__(217);
var _TransitionUtils2 = _interopRequireDefault(_TransitionUtils);
var _isActive2 = __webpack_require__(219);
var _isActive3 = _interopRequireDefault(_isActive2);
var _getComponents = __webpack_require__(220);
var _getComponents2 = _interopRequireDefault(_getComponents);
var _matchRoutes = __webpack_require__(222);
var _matchRoutes2 = _interopRequireDefault(_matchRoutes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function hasAnyProperties(object) {
for (var p in object) {
if (Object.prototype.hasOwnProperty.call(object, p)) return true;
}return false;
}
function createTransitionManager(history, routes) {
var state = {};
var _getTransitionUtils = (0, _TransitionUtils2.default)(),
runEnterHooks = _getTransitionUtils.runEnterHooks,
runChangeHooks = _getTransitionUtils.runChangeHooks,
runLeaveHooks = _getTransitionUtils.runLeaveHooks;
// Signature should be (location, indexOnly), but needs to support (path,
// query, indexOnly)
function isActive(location, indexOnly) {
location = history.createLocation(location);
return (0, _isActive3.default)(location, indexOnly, state.location, state.routes, state.params);
}
var partialNextState = void 0;
function match(location, callback) {
if (partialNextState && partialNextState.location === location) {
// Continue from where we left off.
finishMatch(partialNextState, callback);
} else {
(0, _matchRoutes2.default)(routes, location, function (error, nextState) {
if (error) {
callback(error);
} else if (nextState) {
finishMatch(_extends({}, nextState, { location: location }), callback);
} else {
callback();
}
});
}
}
function finishMatch(nextState, callback) {
var _computeChangedRoutes = (0, _computeChangedRoutes3.default)(state, nextState),
leaveRoutes = _computeChangedRoutes.leaveRoutes,
changeRoutes = _computeChangedRoutes.changeRoutes,
enterRoutes = _computeChangedRoutes.enterRoutes;
runLeaveHooks(leaveRoutes, state);
// Tear down confirmation hooks for left routes
leaveRoutes.filter(function (route) {
return enterRoutes.indexOf(route) === -1;
}).forEach(removeListenBeforeHooksForRoute);
// change and enter hooks are run in series
runChangeHooks(changeRoutes, state, nextState, function (error, redirectInfo) {
if (error || redirectInfo) return handleErrorOrRedirect(error, redirectInfo);
runEnterHooks(enterRoutes, nextState, finishEnterHooks);
});
function finishEnterHooks(error, redirectInfo) {
if (error || redirectInfo) return handleErrorOrRedirect(error, redirectInfo);
// TODO: Fetch components after state is updated.
(0, _getComponents2.default)(nextState, function (error, components) {
if (error) {
callback(error);
} else {
// TODO: Make match a pure function and have some other API
// for "match and update state".
callback(null, null, state = _extends({}, nextState, { components: components }));
}
});
}
function handleErrorOrRedirect(error, redirectInfo) {
if (error) callback(error);else callback(null, redirectInfo);
}
}
var RouteGuid = 1;
function getRouteID(route) {
var create = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return route.__id__ || create && (route.__id__ = RouteGuid++);
}
var RouteHooks = Object.create(null);
function getRouteHooksForRoutes(routes) {
return routes.map(function (route) {
return RouteHooks[getRouteID(route)];
}).filter(function (hook) {
return hook;
});
}
function transitionHook(location, callback) {
(0, _matchRoutes2.default)(routes, location, function (error, nextState) {
if (nextState == null) {
// TODO: We didn't actually match anything, but hang
// onto error/nextState so we don't have to matchRoutes
// again in the listen callback.
callback();
return;
}
// Cache some state here so we don't have to
// matchRoutes() again in the listen callback.
partialNextState = _extends({}, nextState, { location: location });
var hooks = getRouteHooksForRoutes((0, _computeChangedRoutes3.default)(state, partialNextState).leaveRoutes);
var result = void 0;
for (var i = 0, len = hooks.length; result == null && i < len; ++i) {
// Passing the location arg here indicates to
// the user that this is a transition hook.
result = hooks[i](location);
}
callback(result);
});
}
/* istanbul ignore next: untestable with Karma */
function beforeUnloadHook() {
// Synchronously check to see if any route hooks want
// to prevent the current window/tab from closing.
if (state.routes) {
var hooks = getRouteHooksForRoutes(state.routes);
var message = void 0;
for (var i = 0, len = hooks.length; typeof message !== 'string' && i < len; ++i) {
// Passing no args indicates to the user that this is a
// beforeunload hook. We don't know the next location.
message = hooks[i]();
}
return message;
}
}
var unlistenBefore = void 0,
unlistenBeforeUnload = void 0;
function removeListenBeforeHooksForRoute(route) {
var routeID = getRouteID(route);
if (!routeID) {
return;
}
delete RouteHooks[routeID];
if (!hasAnyProperties(RouteHooks)) {
// teardown transition & beforeunload hooks
if (unlistenBefore) {
unlistenBefore();
unlistenBefore = null;
}
if (unlistenBeforeUnload) {
unlistenBeforeUnload();
unlistenBeforeUnload = null;
}
}
}
/**
* Registers the given hook function to run before leaving the given route.
*
* During a normal transition, the hook function receives the next location
* as its only argument and can return either a prompt message (string) to show the user,
* to make sure they want to leave the page; or `false`, to prevent the transition.
* Any other return value will have no effect.
*
* During the beforeunload event (in browsers) the hook receives no arguments.
* In this case it must return a prompt message to prevent the transition.
*
* Returns a function that may be used to unbind the listener.
*/
function listenBeforeLeavingRoute(route, hook) {
var thereWereNoRouteHooks = !hasAnyProperties(RouteHooks);
var routeID = getRouteID(route, true);
RouteHooks[routeID] = hook;
if (thereWereNoRouteHooks) {
// setup transition & beforeunload hooks
unlistenBefore = history.listenBefore(transitionHook);
if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook);
}
return function () {
removeListenBeforeHooksForRoute(route);
};
}
/**
* This is the API for stateful environments. As the location
* changes, we update state and call the listener. We can also
* gracefully handle errors and redirects.
*/
function listen(listener) {
function historyListener(location) {
if (state.location === location) {
listener(null, state);
} else {
match(location, function (error, redirectLocation, nextState) {
if (error) {
listener(error);
} else if (redirectLocation) {
history.replace(redirectLocation);
} else if (nextState) {
listener(null, nextState);
} else {
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(false, 'Location "%s" did not match any routes', location.pathname + location.search + location.hash) : void 0;
}
});
}
}
// TODO: Only use a single history listener. Otherwise we'll end up with
// multiple concurrent calls to match.
// Set up the history listener first in case the initial match redirects.
var unsubscribe = history.listen(historyListener);
if (state.location) {
// Picking up on a matchContext.
listener(null, state);
} else {
historyListener(history.getCurrentLocation());
}
return unsubscribe;
}
return {
isActive: isActive,
match: match,
listenBeforeLeavingRoute: listenBeforeLeavingRoute,
listen: listen
};
}
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = routerWarning;
exports._resetWarned = _resetWarned;
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var warned = {};
function routerWarning(falseToWarn, message) {
// Only issue deprecation warnings once.
if (message.indexOf('deprecated') !== -1) {
if (warned[message]) {
return;
}
warned[message] = true;
}
message = '[react-router] ' + message;
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
_warning2.default.apply(undefined, [falseToWarn, message].concat(args));
}
function _resetWarned() {
warned = {};
}
/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-2015, 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 directory.
*/
'use strict';
/**
* 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 critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (process.env.NODE_ENV !== 'production') {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var 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.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this 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__(4)))
/***/ }),
/* 216 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _PatternUtils = __webpack_require__(203);
function routeParamsChanged(route, prevState, nextState) {
if (!route.path) return false;
var paramNames = (0, _PatternUtils.getParamNames)(route.path);
return paramNames.some(function (paramName) {
return prevState.params[paramName] !== nextState.params[paramName];
});
}
/**
* Returns an object of { leaveRoutes, changeRoutes, enterRoutes } determined by
* the change from prevState to nextState. We leave routes if either
* 1) they are not in the next state or 2) they are in the next state
* but their params have changed (i.e. /users/123 => /users/456).
*
* leaveRoutes are ordered starting at the leaf route of the tree
* we're leaving up to the common parent route. enterRoutes are ordered
* from the top of the tree we're entering down to the leaf route.
*
* changeRoutes are any routes that didn't leave or enter during
* the transition.
*/
function computeChangedRoutes(prevState, nextState) {
var prevRoutes = prevState && prevState.routes;
var nextRoutes = nextState.routes;
var leaveRoutes = void 0,
changeRoutes = void 0,
enterRoutes = void 0;
if (prevRoutes) {
var parentIsLeaving = false;
leaveRoutes = prevRoutes.filter(function (route) {
if (parentIsLeaving) {
return true;
} else {
var isLeaving = nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState);
if (isLeaving) parentIsLeaving = true;
return isLeaving;
}
});
// onLeave hooks start at the leaf route.
leaveRoutes.reverse();
enterRoutes = [];
changeRoutes = [];
nextRoutes.forEach(function (route) {
var isNew = prevRoutes.indexOf(route) === -1;
var paramsChanged = leaveRoutes.indexOf(route) !== -1;
if (isNew || paramsChanged) enterRoutes.push(route);else changeRoutes.push(route);
});
} else {
leaveRoutes = [];
changeRoutes = [];
enterRoutes = nextRoutes;
}
return {
leaveRoutes: leaveRoutes,
changeRoutes: changeRoutes,
enterRoutes: enterRoutes
};
}
exports.default = computeChangedRoutes;
module.exports = exports['default'];
/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = getTransitionUtils;
var _AsyncUtils = __webpack_require__(218);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PendingHooks = function PendingHooks() {
var _this = this;
_classCallCheck(this, PendingHooks);
this.hooks = [];
this.add = function (hook) {
return _this.hooks.push(hook);
};
this.remove = function (hook) {
return _this.hooks = _this.hooks.filter(function (h) {
return h !== hook;
});
};
this.has = function (hook) {
return _this.hooks.indexOf(hook) !== -1;
};
this.clear = function () {
return _this.hooks = [];
};
};
function getTransitionUtils() {
var enterHooks = new PendingHooks();
var changeHooks = new PendingHooks();
function createTransitionHook(hook, route, asyncArity, pendingHooks) {
var isSync = hook.length < asyncArity;
var transitionHook = function transitionHook() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
hook.apply(route, args);
if (isSync) {
var callback = args[args.length - 1];
// Assume hook executes synchronously and
// automatically call the callback.
callback();
}
};
pendingHooks.add(transitionHook);
return transitionHook;
}
function getEnterHooks(routes) {
return routes.reduce(function (hooks, route) {
if (route.onEnter) hooks.push(createTransitionHook(route.onEnter, route, 3, enterHooks));
return hooks;
}, []);
}
function getChangeHooks(routes) {
return routes.reduce(function (hooks, route) {
if (route.onChange) hooks.push(createTransitionHook(route.onChange, route, 4, changeHooks));
return hooks;
}, []);
}
function runTransitionHooks(length, iter, callback) {
if (!length) {
callback();
return;
}
var redirectInfo = void 0;
function replace(location) {
redirectInfo = location;
}
(0, _AsyncUtils.loopAsync)(length, function (index, next, done) {
iter(index, replace, function (error) {
if (error || redirectInfo) {
done(error, redirectInfo); // No need to continue.
} else {
next();
}
});
}, callback);
}
/**
* Runs all onEnter hooks in the given array of routes in order
* with onEnter(nextState, replace, callback) and calls
* callback(error, redirectInfo) when finished. The first hook
* to use replace short-circuits the loop.
*
* If a hook needs to run asynchronously, it may use the callback
* function. However, doing so will cause the transition to pause,
* which could lead to a non-responsive UI if the hook is slow.
*/
function runEnterHooks(routes, nextState, callback) {
enterHooks.clear();
var hooks = getEnterHooks(routes);
return runTransitionHooks(hooks.length, function (index, replace, next) {
var wrappedNext = function wrappedNext() {
if (enterHooks.has(hooks[index])) {
next.apply(undefined, arguments);
enterHooks.remove(hooks[index]);
}
};
hooks[index](nextState, replace, wrappedNext);
}, callback);
}
/**
* Runs all onChange hooks in the given array of routes in order
* with onChange(prevState, nextState, replace, callback) and calls
* callback(error, redirectInfo) when finished. The first hook
* to use replace short-circuits the loop.
*
* If a hook needs to run asynchronously, it may use the callback
* function. However, doing so will cause the transition to pause,
* which could lead to a non-responsive UI if the hook is slow.
*/
function runChangeHooks(routes, state, nextState, callback) {
changeHooks.clear();
var hooks = getChangeHooks(routes);
return runTransitionHooks(hooks.length, function (index, replace, next) {
var wrappedNext = function wrappedNext() {
if (changeHooks.has(hooks[index])) {
next.apply(undefined, arguments);
changeHooks.remove(hooks[index]);
}
};
hooks[index](state, nextState, replace, wrappedNext);
}, callback);
}
/**
* Runs all onLeave hooks in the given array of routes in order.
*/
function runLeaveHooks(routes, prevState) {
for (var i = 0, len = routes.length; i < len; ++i) {
if (routes[i].onLeave) routes[i].onLeave.call(routes[i], prevState);
}
}
return {
runEnterHooks: runEnterHooks,
runChangeHooks: runChangeHooks,
runLeaveHooks: runLeaveHooks
};
}
module.exports = exports['default'];
/***/ }),
/* 218 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
exports.loopAsync = loopAsync;
exports.mapAsync = mapAsync;
function loopAsync(turns, work, callback) {
var currentTurn = 0,
isDone = false;
var sync = false,
hasNext = false,
doneArgs = void 0;
function done() {
isDone = true;
if (sync) {
// Iterate instead of recursing if possible.
doneArgs = [].concat(Array.prototype.slice.call(arguments));
return;
}
callback.apply(this, arguments);
}
function next() {
if (isDone) {
return;
}
hasNext = true;
if (sync) {
// Iterate instead of recursing if possible.
return;
}
sync = true;
while (!isDone && currentTurn < turns && hasNext) {
hasNext = false;
work.call(this, currentTurn++, next, done);
}
sync = false;
if (isDone) {
// This means the loop finished synchronously.
callback.apply(this, doneArgs);
return;
}
if (currentTurn >= turns && hasNext) {
isDone = true;
callback();
}
}
next();
}
function mapAsync(array, work, callback) {
var length = array.length;
var values = [];
if (length === 0) return callback(null, values);
var isDone = false,
doneCount = 0;
function done(index, error, value) {
if (isDone) return;
if (error) {
isDone = true;
callback(error);
} else {
values[index] = value;
isDone = ++doneCount === length;
if (isDone) callback(null, values);
}
}
array.forEach(function (item, index) {
work(item, index, function (error, value) {
done(index, error, value);
});
});
}
/***/ }),
/* 219 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.default = isActive;
var _PatternUtils = __webpack_require__(203);
function deepEqual(a, b) {
if (a == b) return true;
if (a == null || b == null) return false;
if (Array.isArray(a)) {
return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
return deepEqual(item, b[index]);
});
}
if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object') {
for (var p in a) {
if (!Object.prototype.hasOwnProperty.call(a, p)) {
continue;
}
if (a[p] === undefined) {
if (b[p] !== undefined) {
return false;
}
} else if (!Object.prototype.hasOwnProperty.call(b, p)) {
return false;
} else if (!deepEqual(a[p], b[p])) {
return false;
}
}
return true;
}
return String(a) === String(b);
}
/**
* Returns true if the current pathname matches the supplied one, net of
* leading and trailing slash normalization. This is sufficient for an
* indexOnly route match.
*/
function pathIsActive(pathname, currentPathname) {
// Normalize leading slash for consistency. Leading slash on pathname has
// already been normalized in isActive. See caveat there.
if (currentPathname.charAt(0) !== '/') {
currentPathname = '/' + currentPathname;
}
// Normalize the end of both path names too. Maybe `/foo/` shouldn't show
// `/foo` as active, but in this case, we would already have failed the
// match.
if (pathname.charAt(pathname.length - 1) !== '/') {
pathname += '/';
}
if (currentPathname.charAt(currentPathname.length - 1) !== '/') {
currentPathname += '/';
}
return currentPathname === pathname;
}
/**
* Returns true if the given pathname matches the active routes and params.
*/
function routeIsActive(pathname, routes, params) {
var remainingPathname = pathname,
paramNames = [],
paramValues = [];
// for...of would work here but it's probably slower post-transpilation.
for (var i = 0, len = routes.length; i < len; ++i) {
var route = routes[i];
var pattern = route.path || '';
if (pattern.charAt(0) === '/') {
remainingPathname = pathname;
paramNames = [];
paramValues = [];
}
if (remainingPathname !== null && pattern) {
var matched = (0, _PatternUtils.matchPattern)(pattern, remainingPathname);
if (matched) {
remainingPathname = matched.remainingPathname;
paramNames = [].concat(paramNames, matched.paramNames);
paramValues = [].concat(paramValues, matched.paramValues);
} else {
remainingPathname = null;
}
if (remainingPathname === '') {
// We have an exact match on the route. Just check that all the params
// match.
// FIXME: This doesn't work on repeated params.
return paramNames.every(function (paramName, index) {
return String(paramValues[index]) === String(params[paramName]);
});
}
}
}
return false;
}
/**
* Returns true if all key/value pairs in the given query are
* currently active.
*/
function queryIsActive(query, activeQuery) {
if (activeQuery == null) return query == null;
if (query == null) return true;
return deepEqual(query, activeQuery);
}
/**
* Returns true if a <Link> to the given pathname/query combination is
* currently active.
*/
function isActive(_ref, indexOnly, currentLocation, routes, params) {
var pathname = _ref.pathname,
query = _ref.query;
if (currentLocation == null) return false;
// TODO: This is a bit ugly. It keeps around support for treating pathnames
// without preceding slashes as absolute paths, but possibly also works
// around the same quirks with basenames as in matchRoutes.
if (pathname.charAt(0) !== '/') {
pathname = '/' + pathname;
}
if (!pathIsActive(pathname, currentLocation.pathname)) {
// The path check is necessary and sufficient for indexOnly, but otherwise
// we still need to check the routes.
if (indexOnly || !routeIsActive(pathname, routes, params)) {
return false;
}
}
return queryIsActive(query, currentLocation.query);
}
module.exports = exports['default'];
/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _AsyncUtils = __webpack_require__(218);
var _PromiseUtils = __webpack_require__(221);
function getComponentsForRoute(nextState, route, callback) {
if (route.component || route.components) {
callback(null, route.component || route.components);
return;
}
var getComponent = route.getComponent || route.getComponents;
if (getComponent) {
var componentReturn = getComponent.call(route, nextState, callback);
if ((0, _PromiseUtils.isPromise)(componentReturn)) componentReturn.then(function (component) {
return callback(null, component);
}, callback);
} else {
callback();
}
}
/**
* Asynchronously fetches all components needed for the given router
* state and calls callback(error, components) when finished.
*
* Note: This operation may finish synchronously if no routes have an
* asynchronous getComponents method.
*/
function getComponents(nextState, callback) {
(0, _AsyncUtils.mapAsync)(nextState.routes, function (route, index, callback) {
getComponentsForRoute(nextState, route, callback);
}, callback);
}
exports.default = getComponents;
module.exports = exports['default'];
/***/ }),
/* 221 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
exports.isPromise = isPromise;
function isPromise(obj) {
return obj && typeof obj.then === 'function';
}
/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.default = matchRoutes;
var _AsyncUtils = __webpack_require__(218);
var _PromiseUtils = __webpack_require__(221);
var _PatternUtils = __webpack_require__(203);
var _routerWarning = __webpack_require__(214);
var _routerWarning2 = _interopRequireDefault(_routerWarning);
var _RouteUtils = __webpack_require__(193);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getChildRoutes(route, location, paramNames, paramValues, callback) {
if (route.childRoutes) {
return [null, route.childRoutes];
}
if (!route.getChildRoutes) {
return [];
}
var sync = true,
result = void 0;
var partialNextState = {
location: location,
params: createParams(paramNames, paramValues)
};
var childRoutesReturn = route.getChildRoutes(partialNextState, function (error, childRoutes) {
childRoutes = !error && (0, _RouteUtils.createRoutes)(childRoutes);
if (sync) {
result = [error, childRoutes];
return;
}
callback(error, childRoutes);
});
if ((0, _PromiseUtils.isPromise)(childRoutesReturn)) childRoutesReturn.then(function (childRoutes) {
return callback(null, (0, _RouteUtils.createRoutes)(childRoutes));
}, callback);
sync = false;
return result; // Might be undefined.
}
function getIndexRoute(route, location, paramNames, paramValues, callback) {
if (route.indexRoute) {
callback(null, route.indexRoute);
} else if (route.getIndexRoute) {
var partialNextState = {
location: location,
params: createParams(paramNames, paramValues)
};
var indexRoutesReturn = route.getIndexRoute(partialNextState, function (error, indexRoute) {
callback(error, !error && (0, _RouteUtils.createRoutes)(indexRoute)[0]);
});
if ((0, _PromiseUtils.isPromise)(indexRoutesReturn)) indexRoutesReturn.then(function (indexRoute) {
return callback(null, (0, _RouteUtils.createRoutes)(indexRoute)[0]);
}, callback);
} else if (route.childRoutes || route.getChildRoutes) {
var onChildRoutes = function onChildRoutes(error, childRoutes) {
if (error) {
callback(error);
return;
}
var pathless = childRoutes.filter(function (childRoute) {
return !childRoute.path;
});
(0, _AsyncUtils.loopAsync)(pathless.length, function (index, next, done) {
getIndexRoute(pathless[index], location, paramNames, paramValues, function (error, indexRoute) {
if (error || indexRoute) {
var routes = [pathless[index]].concat(Array.isArray(indexRoute) ? indexRoute : [indexRoute]);
done(error, routes);
} else {
next();
}
});
}, function (err, routes) {
callback(null, routes);
});
};
var result = getChildRoutes(route, location, paramNames, paramValues, onChildRoutes);
if (result) {
onChildRoutes.apply(undefined, result);
}
} else {
callback();
}
}
function assignParams(params, paramNames, paramValues) {
return paramNames.reduce(function (params, paramName, index) {
var paramValue = paramValues && paramValues[index];
if (Array.isArray(params[paramName])) {
params[paramName].push(paramValue);
} else if (paramName in params) {
params[paramName] = [params[paramName], paramValue];
} else {
params[paramName] = paramValue;
}
return params;
}, params);
}
function createParams(paramNames, paramValues) {
return assignParams({}, paramNames, paramValues);
}
function matchRouteDeep(route, location, remainingPathname, paramNames, paramValues, callback) {
var pattern = route.path || '';
if (pattern.charAt(0) === '/') {
remainingPathname = location.pathname;
paramNames = [];
paramValues = [];
}
// Only try to match the path if the route actually has a pattern, and if
// we're not just searching for potential nested absolute paths.
if (remainingPathname !== null && pattern) {
try {
var matched = (0, _PatternUtils.matchPattern)(pattern, remainingPathname);
if (matched) {
remainingPathname = matched.remainingPathname;
paramNames = [].concat(paramNames, matched.paramNames);
paramValues = [].concat(paramValues, matched.paramValues);
} else {
remainingPathname = null;
}
} catch (error) {
callback(error);
}
// By assumption, pattern is non-empty here, which is the prerequisite for
// actually terminating a match.
if (remainingPathname === '') {
var match = {
routes: [route],
params: createParams(paramNames, paramValues)
};
getIndexRoute(route, location, paramNames, paramValues, function (error, indexRoute) {
if (error) {
callback(error);
} else {
if (Array.isArray(indexRoute)) {
var _match$routes;
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(indexRoute.every(function (route) {
return !route.path;
}), 'Index routes should not have paths') : void 0;
(_match$routes = match.routes).push.apply(_match$routes, indexRoute);
} else if (indexRoute) {
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(!indexRoute.path, 'Index routes should not have paths') : void 0;
match.routes.push(indexRoute);
}
callback(null, match);
}
});
return;
}
}
if (remainingPathname != null || route.childRoutes) {
// Either a) this route matched at least some of the path or b)
// we don't have to load this route's children asynchronously. In
// either case continue checking for matches in the subtree.
var onChildRoutes = function onChildRoutes(error, childRoutes) {
if (error) {
callback(error);
} else if (childRoutes) {
// Check the child routes to see if any of them match.
matchRoutes(childRoutes, location, function (error, match) {
if (error) {
callback(error);
} else if (match) {
// A child route matched! Augment the match and pass it up the stack.
match.routes.unshift(route);
callback(null, match);
} else {
callback();
}
}, remainingPathname, paramNames, paramValues);
} else {
callback();
}
};
var result = getChildRoutes(route, location, paramNames, paramValues, onChildRoutes);
if (result) {
onChildRoutes.apply(undefined, result);
}
} else {
callback();
}
}
/**
* Asynchronously matches the given location to a set of routes and calls
* callback(error, state) when finished. The state object will have the
* following properties:
*
* - routes An array of routes that matched, in hierarchical order
* - params An object of URL parameters
*
* Note: This operation may finish synchronously if no routes have an
* asynchronous getChildRoutes method.
*/
function matchRoutes(routes, location, callback, remainingPathname) {
var paramNames = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
var paramValues = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
if (remainingPathname === undefined) {
// TODO: This is a little bit ugly, but it works around a quirk in history
// that strips the leading slash from pathnames when using basenames with
// trailing slashes.
if (location.pathname.charAt(0) !== '/') {
location = _extends({}, location, {
pathname: '/' + location.pathname
});
}
remainingPathname = location.pathname;
}
(0, _AsyncUtils.loopAsync)(routes.length, function (index, next, done) {
matchRouteDeep(routes[index], location, remainingPathname, paramNames, paramValues, function (error, match) {
if (error || match) {
done(error, match);
} else {
next();
}
});
}, callback);
}
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 223 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.routes = exports.route = exports.components = exports.component = exports.history = undefined;
exports.falsy = falsy;
var _propTypes = __webpack_require__(195);
function falsy(props, propName, componentName) {
if (props[propName]) return new Error('<' + componentName + '> should not have a "' + propName + '" prop');
}
var history = exports.history = (0, _propTypes.shape)({
listen: _propTypes.func.isRequired,
push: _propTypes.func.isRequired,
replace: _propTypes.func.isRequired,
go: _propTypes.func.isRequired,
goBack: _propTypes.func.isRequired,
goForward: _propTypes.func.isRequired
});
var component = exports.component = (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.string]);
var components = exports.components = (0, _propTypes.oneOfType)([component, _propTypes.object]);
var route = exports.route = (0, _propTypes.oneOfType)([_propTypes.object, _propTypes.element]);
var routes = exports.routes = (0, _propTypes.oneOfType)([route, (0, _propTypes.arrayOf)(route)]);
/***/ }),
/* 224 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(195);
var _getRouteParams = __webpack_require__(225);
var _getRouteParams2 = _interopRequireDefault(_getRouteParams);
var _ContextUtils = __webpack_require__(226);
var _RouteUtils = __webpack_require__(193);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A <RouterContext> renders the component tree for a given router state
* and sets the history object and the current location in context.
*/
var RouterContext = (0, _createReactClass2.default)({
displayName: 'RouterContext',
mixins: [(0, _ContextUtils.ContextProvider)('router')],
propTypes: {
router: _propTypes.object.isRequired,
location: _propTypes.object.isRequired,
routes: _propTypes.array.isRequired,
params: _propTypes.object.isRequired,
components: _propTypes.array.isRequired,
createElement: _propTypes.func.isRequired
},
getDefaultProps: function getDefaultProps() {
return {
createElement: _react2.default.createElement
};
},
childContextTypes: {
router: _propTypes.object.isRequired
},
getChildContext: function getChildContext() {
return {
router: this.props.router
};
},
createElement: function createElement(component, props) {
return component == null ? null : this.props.createElement(component, props);
},
render: function render() {
var _this = this;
var _props = this.props,
location = _props.location,
routes = _props.routes,
params = _props.params,
components = _props.components,
router = _props.router;
var element = null;
if (components) {
element = components.reduceRight(function (element, components, index) {
if (components == null) return element; // Don't create new children; use the grandchildren.
var route = routes[index];
var routeParams = (0, _getRouteParams2.default)(route, params);
var props = {
location: location,
params: params,
route: route,
router: router,
routeParams: routeParams,
routes: routes
};
if ((0, _RouteUtils.isReactChildren)(element)) {
props.children = element;
} else if (element) {
for (var prop in element) {
if (Object.prototype.hasOwnProperty.call(element, prop)) props[prop] = element[prop];
}
}
if ((typeof components === 'undefined' ? 'undefined' : _typeof(components)) === 'object') {
var elements = {};
for (var key in components) {
if (Object.prototype.hasOwnProperty.call(components, key)) {
// Pass through the key as a prop to createElement to allow
// custom createElement functions to know which named component
// they're rendering, for e.g. matching up to fetched data.
elements[key] = _this.createElement(components[key], _extends({
key: key }, props));
}
}
return elements;
}
return _this.createElement(components, props);
}, element);
}
!(element === null || element === false || _react2.default.isValidElement(element)) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'The root route must render a single element') : (0, _invariant2.default)(false) : void 0;
return element;
}
});
exports.default = RouterContext;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 225 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _PatternUtils = __webpack_require__(203);
/**
* Extracts an object of params the given route cares about from
* the given params object.
*/
function getRouteParams(route, params) {
var routeParams = {};
if (!route.path) return routeParams;
(0, _PatternUtils.getParamNames)(route.path).forEach(function (p) {
if (Object.prototype.hasOwnProperty.call(params, p)) {
routeParams[p] = params[p];
}
});
return routeParams;
}
exports.default = getRouteParams;
module.exports = exports['default'];
/***/ }),
/* 226 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.ContextProvider = ContextProvider;
exports.ContextSubscriber = ContextSubscriber;
var _propTypes = __webpack_require__(195);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Works around issues with context updates failing to propagate.
// Caveat: the context value is expected to never change its identity.
// https://github.com/facebook/react/issues/2517
// https://github.com/reactjs/react-router/issues/470
var contextProviderShape = _propTypes2.default.shape({
subscribe: _propTypes2.default.func.isRequired,
eventIndex: _propTypes2.default.number.isRequired
});
function makeContextName(name) {
return '@@contextSubscriber/' + name;
}
function ContextProvider(name) {
var _childContextTypes, _ref2;
var contextName = makeContextName(name);
var listenersKey = contextName + '/listeners';
var eventIndexKey = contextName + '/eventIndex';
var subscribeKey = contextName + '/subscribe';
return _ref2 = {
childContextTypes: (_childContextTypes = {}, _childContextTypes[contextName] = contextProviderShape.isRequired, _childContextTypes),
getChildContext: function getChildContext() {
var _ref;
return _ref = {}, _ref[contextName] = {
eventIndex: this[eventIndexKey],
subscribe: this[subscribeKey]
}, _ref;
},
componentWillMount: function componentWillMount() {
this[listenersKey] = [];
this[eventIndexKey] = 0;
},
componentWillReceiveProps: function componentWillReceiveProps() {
this[eventIndexKey]++;
},
componentDidUpdate: function componentDidUpdate() {
var _this = this;
this[listenersKey].forEach(function (listener) {
return listener(_this[eventIndexKey]);
});
}
}, _ref2[subscribeKey] = function (listener) {
var _this2 = this;
// No need to immediately call listener here.
this[listenersKey].push(listener);
return function () {
_this2[listenersKey] = _this2[listenersKey].filter(function (item) {
return item !== listener;
});
};
}, _ref2;
}
function ContextSubscriber(name) {
var _contextTypes, _ref4;
var contextName = makeContextName(name);
var lastRenderedEventIndexKey = contextName + '/lastRenderedEventIndex';
var handleContextUpdateKey = contextName + '/handleContextUpdate';
var unsubscribeKey = contextName + '/unsubscribe';
return _ref4 = {
contextTypes: (_contextTypes = {}, _contextTypes[contextName] = contextProviderShape, _contextTypes),
getInitialState: function getInitialState() {
var _ref3;
if (!this.context[contextName]) {
return {};
}
return _ref3 = {}, _ref3[lastRenderedEventIndexKey] = this.context[contextName].eventIndex, _ref3;
},
componentDidMount: function componentDidMount() {
if (!this.context[contextName]) {
return;
}
this[unsubscribeKey] = this.context[contextName].subscribe(this[handleContextUpdateKey]);
},
componentWillReceiveProps: function componentWillReceiveProps() {
var _setState;
if (!this.context[contextName]) {
return;
}
this.setState((_setState = {}, _setState[lastRenderedEventIndexKey] = this.context[contextName].eventIndex, _setState));
},
componentWillUnmount: function componentWillUnmount() {
if (!this[unsubscribeKey]) {
return;
}
this[unsubscribeKey]();
this[unsubscribeKey] = null;
}
}, _ref4[handleContextUpdateKey] = function (eventIndex) {
if (eventIndex !== this.state[lastRenderedEventIndexKey]) {
var _setState2;
this.setState((_setState2 = {}, _setState2[lastRenderedEventIndexKey] = eventIndex, _setState2));
}
}, _ref4;
}
/***/ }),
/* 227 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.createRouterObject = createRouterObject;
exports.assignRouterState = assignRouterState;
function createRouterObject(history, transitionManager, state) {
var router = _extends({}, history, {
setRouteLeaveHook: transitionManager.listenBeforeLeavingRoute,
isActive: transitionManager.isActive
});
return assignRouterState(router, state);
}
function assignRouterState(router, _ref) {
var location = _ref.location,
params = _ref.params,
routes = _ref.routes;
router.location = location;
router.params = params;
router.routes = routes;
return router;
}
/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(195);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _PropTypes = __webpack_require__(194);
var _ContextUtils = __webpack_require__(226);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function isLeftClickEvent(event) {
return event.button === 0;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
// TODO: De-duplicate against hasAnyProperties in createTransitionManager.
function isEmptyObject(object) {
for (var p in object) {
if (Object.prototype.hasOwnProperty.call(object, p)) return false;
}return true;
}
function resolveToLocation(to, router) {
return typeof to === 'function' ? to(router.location) : to;
}
/**
* A <Link> is used to create an <a> element that links to a route.
* When that route is active, the link gets the value of its
* activeClassName prop.
*
* For example, assuming you have the following route:
*
* <Route path="/posts/:postID" component={Post} />
*
* You could use the following component to link to that route:
*
* <Link to={`/posts/${post.id}`} />
*/
var Link = (0, _createReactClass2.default)({
displayName: 'Link',
mixins: [(0, _ContextUtils.ContextSubscriber)('router')],
contextTypes: {
router: _PropTypes.routerShape
},
propTypes: {
to: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.object, _propTypes.func]),
activeStyle: _propTypes.object,
activeClassName: _propTypes.string,
onlyActiveOnIndex: _propTypes.bool.isRequired,
onClick: _propTypes.func,
target: _propTypes.string
},
getDefaultProps: function getDefaultProps() {
return {
onlyActiveOnIndex: false,
style: {}
};
},
handleClick: function handleClick(event) {
if (this.props.onClick) this.props.onClick(event);
if (event.defaultPrevented) return;
var router = this.context.router;
!router ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, '<Link>s rendered outside of a router context cannot navigate.') : (0, _invariant2.default)(false) : void 0;
if (isModifiedEvent(event) || !isLeftClickEvent(event)) return;
// If target prop is set (e.g. to "_blank"), let browser handle link.
/* istanbul ignore if: untestable with Karma */
if (this.props.target) return;
event.preventDefault();
router.push(resolveToLocation(this.props.to, router));
},
render: function render() {
var _props = this.props,
to = _props.to,
activeClassName = _props.activeClassName,
activeStyle = _props.activeStyle,
onlyActiveOnIndex = _props.onlyActiveOnIndex,
props = _objectWithoutProperties(_props, ['to', 'activeClassName', 'activeStyle', 'onlyActiveOnIndex']);
// Ignore if rendered outside the context of router to simplify unit testing.
var router = this.context.router;
if (router) {
// If user does not specify a `to` prop, return an empty anchor tag.
if (!to) {
return _react2.default.createElement('a', props);
}
var toLocation = resolveToLocation(to, router);
props.href = router.createHref(toLocation);
if (activeClassName || activeStyle != null && !isEmptyObject(activeStyle)) {
if (router.isActive(toLocation, onlyActiveOnIndex)) {
if (activeClassName) {
if (props.className) {
props.className += ' ' + activeClassName;
} else {
props.className = activeClassName;
}
}
if (activeStyle) props.style = _extends({}, props.style, activeStyle);
}
}
}
return _react2.default.createElement('a', _extends({}, props, { onClick: this.handleClick }));
}
});
exports.default = Link;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _Link = __webpack_require__(228);
var _Link2 = _interopRequireDefault(_Link);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An <IndexLink> is used to link to an <IndexRoute>.
*/
var IndexLink = (0, _createReactClass2.default)({
displayName: 'IndexLink',
render: function render() {
return _react2.default.createElement(_Link2.default, _extends({}, this.props, { onlyActiveOnIndex: true }));
}
});
exports.default = IndexLink;
module.exports = exports['default'];
/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.default = withRouter;
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _hoistNonReactStatics = __webpack_require__(231);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _ContextUtils = __webpack_require__(226);
var _PropTypes = __webpack_require__(194);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}
function withRouter(WrappedComponent, options) {
var withRef = options && options.withRef;
var WithRouter = (0, _createReactClass2.default)({
displayName: 'WithRouter',
mixins: [(0, _ContextUtils.ContextSubscriber)('router')],
contextTypes: { router: _PropTypes.routerShape },
propTypes: { router: _PropTypes.routerShape },
getWrappedInstance: function getWrappedInstance() {
!withRef ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'To access the wrapped instance, you need to specify ' + '`{ withRef: true }` as the second argument of the withRouter() call.') : (0, _invariant2.default)(false) : void 0;
return this.wrappedInstance;
},
render: function render() {
var _this = this;
var router = this.props.router || this.context.router;
if (!router) {
return _react2.default.createElement(WrappedComponent, this.props);
}
var params = router.params,
location = router.location,
routes = router.routes;
var props = _extends({}, this.props, { router: router, params: params, location: location, routes: routes });
if (withRef) {
props.ref = function (c) {
_this.wrappedInstance = c;
};
}
return _react2.default.createElement(WrappedComponent, props);
}
});
WithRouter.displayName = 'withRouter(' + getDisplayName(WrappedComponent) + ')';
WithRouter.WrappedComponent = WrappedComponent;
return (0, _hoistNonReactStatics2.default)(WithRouter, WrappedComponent);
}
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 231 */
/***/ (function(module, exports) {
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
arguments: true,
arity: true
};
var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
var keys = Object.getOwnPropertyNames(sourceComponent);
/* istanbul ignore else */
if (isGetOwnPropertySymbolsAvailable) {
keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));
}
for (var i = 0; i < keys.length; ++i) {
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {
try {
targetComponent[keys[i]] = sourceComponent[keys[i]];
} catch (error) {
}
}
}
}
return targetComponent;
};
/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(195);
var _routerWarning = __webpack_require__(214);
var _routerWarning2 = _interopRequireDefault(_routerWarning);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _Redirect = __webpack_require__(233);
var _Redirect2 = _interopRequireDefault(_Redirect);
var _InternalPropTypes = __webpack_require__(223);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An <IndexRedirect> is used to redirect from an indexRoute.
*/
/* eslint-disable react/require-render-return */
var IndexRedirect = (0, _createReactClass2.default)({
displayName: 'IndexRedirect',
statics: {
createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) {
/* istanbul ignore else: sanity check */
if (parentRoute) {
parentRoute.indexRoute = _Redirect2.default.createRouteFromReactElement(element);
} else {
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(false, 'An <IndexRedirect> does not make sense at the root of your route config') : void 0;
}
}
},
propTypes: {
to: _propTypes.string.isRequired,
query: _propTypes.object,
state: _propTypes.object,
onEnter: _InternalPropTypes.falsy,
children: _InternalPropTypes.falsy
},
/* istanbul ignore next: sanity check */
render: function render() {
true ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, '<IndexRedirect> elements are for router configuration only and should not be rendered') : (0, _invariant2.default)(false) : void 0;
}
});
exports.default = IndexRedirect;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(195);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _RouteUtils = __webpack_require__(193);
var _PatternUtils = __webpack_require__(203);
var _InternalPropTypes = __webpack_require__(223);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A <Redirect> is used to declare another URL path a client should
* be sent to when they request a given URL.
*
* Redirects are placed alongside routes in the route configuration
* and are traversed in the same manner.
*/
/* eslint-disable react/require-render-return */
var Redirect = (0, _createReactClass2.default)({
displayName: 'Redirect',
statics: {
createRouteFromReactElement: function createRouteFromReactElement(element) {
var route = (0, _RouteUtils.createRouteFromReactElement)(element);
if (route.from) route.path = route.from;
route.onEnter = function (nextState, replace) {
var location = nextState.location,
params = nextState.params;
var pathname = void 0;
if (route.to.charAt(0) === '/') {
pathname = (0, _PatternUtils.formatPattern)(route.to, params);
} else if (!route.to) {
pathname = location.pathname;
} else {
var routeIndex = nextState.routes.indexOf(route);
var parentPattern = Redirect.getRoutePattern(nextState.routes, routeIndex - 1);
var pattern = parentPattern.replace(/\/*$/, '/') + route.to;
pathname = (0, _PatternUtils.formatPattern)(pattern, params);
}
replace({
pathname: pathname,
query: route.query || location.query,
state: route.state || location.state
});
};
return route;
},
getRoutePattern: function getRoutePattern(routes, routeIndex) {
var parentPattern = '';
for (var i = routeIndex; i >= 0; i--) {
var route = routes[i];
var pattern = route.path || '';
parentPattern = pattern.replace(/\/*$/, '/') + parentPattern;
if (pattern.indexOf('/') === 0) break;
}
return '/' + parentPattern;
}
},
propTypes: {
path: _propTypes.string,
from: _propTypes.string, // Alias for path
to: _propTypes.string.isRequired,
query: _propTypes.object,
state: _propTypes.object,
onEnter: _InternalPropTypes.falsy,
children: _InternalPropTypes.falsy
},
/* istanbul ignore next: sanity check */
render: function render() {
true ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, '<Redirect> elements are for router configuration only and should not be rendered') : (0, _invariant2.default)(false) : void 0;
}
});
exports.default = Redirect;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(195);
var _routerWarning = __webpack_require__(214);
var _routerWarning2 = _interopRequireDefault(_routerWarning);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _RouteUtils = __webpack_require__(193);
var _InternalPropTypes = __webpack_require__(223);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An <IndexRoute> is used to specify its parent's <Route indexRoute> in
* a JSX route config.
*/
/* eslint-disable react/require-render-return */
var IndexRoute = (0, _createReactClass2.default)({
displayName: 'IndexRoute',
statics: {
createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) {
/* istanbul ignore else: sanity check */
if (parentRoute) {
parentRoute.indexRoute = (0, _RouteUtils.createRouteFromReactElement)(element);
} else {
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(false, 'An <IndexRoute> does not make sense at the root of your route config') : void 0;
}
}
},
propTypes: {
path: _InternalPropTypes.falsy,
component: _InternalPropTypes.component,
components: _InternalPropTypes.components,
getComponent: _propTypes.func,
getComponents: _propTypes.func
},
/* istanbul ignore next: sanity check */
render: function render() {
true ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, '<IndexRoute> elements are for router configuration only and should not be rendered') : (0, _invariant2.default)(false) : void 0;
}
});
exports.default = IndexRoute;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 235 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _createReactClass = __webpack_require__(206);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(195);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _RouteUtils = __webpack_require__(193);
var _InternalPropTypes = __webpack_require__(223);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A <Route> is used to declare which components are rendered to the
* page when the URL matches a given pattern.
*
* Routes are arranged in a nested tree structure. When a new URL is
* requested, the tree is searched depth-first to find a route whose
* path matches the URL. When one is found, all routes in the tree
* that lead to it are considered "active" and their components are
* rendered into the DOM, nested in the same order as in the tree.
*/
/* eslint-disable react/require-render-return */
var Route = (0, _createReactClass2.default)({
displayName: 'Route',
statics: {
createRouteFromReactElement: _RouteUtils.createRouteFromReactElement
},
propTypes: {
path: _propTypes.string,
component: _InternalPropTypes.component,
components: _InternalPropTypes.components,
getComponent: _propTypes.func,
getComponents: _propTypes.func
},
/* istanbul ignore next: sanity check */
render: function render() {
true ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, '<Route> elements are for router configuration only and should not be rendered') : (0, _invariant2.default)(false) : void 0;
}
});
exports.default = Route;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 236 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _Actions = __webpack_require__(237);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _createMemoryHistory = __webpack_require__(238);
var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory);
var _createTransitionManager = __webpack_require__(213);
var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
var _RouteUtils = __webpack_require__(193);
var _RouterUtils = __webpack_require__(227);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
/**
* A high-level API to be used for server-side rendering.
*
* This function matches a location to a set of routes and calls
* callback(error, redirectLocation, renderProps) when finished.
*
* Note: You probably don't want to use this in a browser unless you're using
* server-side rendering with async routes.
*/
function match(_ref, callback) {
var history = _ref.history,
routes = _ref.routes,
location = _ref.location,
options = _objectWithoutProperties(_ref, ['history', 'routes', 'location']);
!(history || location) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'match needs a history or a location') : (0, _invariant2.default)(false) : void 0;
history = history ? history : (0, _createMemoryHistory2.default)(options);
var transitionManager = (0, _createTransitionManager2.default)(history, (0, _RouteUtils.createRoutes)(routes));
if (location) {
// Allow match({ location: '/the/path', ... })
location = history.createLocation(location);
} else {
location = history.getCurrentLocation();
}
transitionManager.match(location, function (error, redirectLocation, nextState) {
var renderProps = void 0;
if (nextState) {
var router = (0, _RouterUtils.createRouterObject)(history, transitionManager, nextState);
renderProps = _extends({}, nextState, {
router: router,
matchContext: { transitionManager: transitionManager, router: router }
});
}
callback(error, redirectLocation && history.createLocation(redirectLocation, _Actions.REPLACE), renderProps);
});
}
exports.default = match;
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 237 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
/**
* Indicates that navigation was caused by a call to history.push.
*/
var PUSH = exports.PUSH = 'PUSH';
/**
* Indicates that navigation was caused by a call to history.replace.
*/
var REPLACE = exports.REPLACE = 'REPLACE';
/**
* Indicates that navigation was caused by some other action such
* as using a browser's back/forward buttons and/or manually manipulating
* the URL in a browser's location bar. This is the default.
*
* See https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate
* for more information.
*/
var POP = exports.POP = 'POP';
/***/ }),
/* 238 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = createMemoryHistory;
var _useQueries = __webpack_require__(239);
var _useQueries2 = _interopRequireDefault(_useQueries);
var _useBasename = __webpack_require__(246);
var _useBasename2 = _interopRequireDefault(_useBasename);
var _createMemoryHistory = __webpack_require__(247);
var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createMemoryHistory(options) {
// signatures and type checking differ between `useQueries` and
// `createMemoryHistory`, have to create `memoryHistory` first because
// `useQueries` doesn't understand the signature
var memoryHistory = (0, _createMemoryHistory2.default)(options);
var createHistory = function createHistory() {
return memoryHistory;
};
var history = (0, _useQueries2.default)((0, _useBasename2.default)(createHistory))(options);
return history;
}
module.exports = exports['default'];
/***/ }),
/* 239 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _queryString = __webpack_require__(240);
var _runTransitionHook = __webpack_require__(243);
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
var _LocationUtils = __webpack_require__(244);
var _PathUtils = __webpack_require__(245);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultStringifyQuery = function defaultStringifyQuery(query) {
return (0, _queryString.stringify)(query).replace(/%20/g, '+');
};
var defaultParseQueryString = _queryString.parse;
/**
* Returns a new createHistory function that may be used to create
* history objects that know how to handle URL queries.
*/
var useQueries = function useQueries(createHistory) {
return function () {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var history = createHistory(options);
var stringifyQuery = options.stringifyQuery,
parseQueryString = options.parseQueryString;
if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery;
if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString;
var decodeQuery = function decodeQuery(location) {
if (!location) return location;
if (location.query == null) location.query = parseQueryString(location.search.substring(1));
return location;
};
var encodeQuery = function encodeQuery(location, query) {
if (query == null) return location;
var object = typeof location === 'string' ? (0, _PathUtils.parsePath)(location) : location;
var queryString = stringifyQuery(query);
var search = queryString ? '?' + queryString : '';
return _extends({}, object, {
search: search
});
};
// Override all read methods with query-aware versions.
var getCurrentLocation = function getCurrentLocation() {
return decodeQuery(history.getCurrentLocation());
};
var listenBefore = function listenBefore(hook) {
return history.listenBefore(function (location, callback) {
return (0, _runTransitionHook2.default)(hook, decodeQuery(location), callback);
});
};
var listen = function listen(listener) {
return history.listen(function (location) {
return listener(decodeQuery(location));
});
};
// Override all write methods with query-aware versions.
var push = function push(location) {
return history.push(encodeQuery(location, location.query));
};
var replace = function replace(location) {
return history.replace(encodeQuery(location, location.query));
};
var createPath = function createPath(location) {
return history.createPath(encodeQuery(location, location.query));
};
var createHref = function createHref(location) {
return history.createHref(encodeQuery(location, location.query));
};
var createLocation = function createLocation(location) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var newLocation = history.createLocation.apply(history, [encodeQuery(location, location.query)].concat(args));
if (location.query) newLocation.query = (0, _LocationUtils.createQuery)(location.query);
return decodeQuery(newLocation);
};
return _extends({}, history, {
getCurrentLocation: getCurrentLocation,
listenBefore: listenBefore,
listen: listen,
push: push,
replace: replace,
createPath: createPath,
createHref: createHref,
createLocation: createLocation
});
};
};
exports.default = useQueries;
/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var strictUriEncode = __webpack_require__(241);
var objectAssign = __webpack_require__(242);
function encoderForArrayFormat(opts) {
switch (opts.arrayFormat) {
case 'index':
return function (key, value, index) {
return value === null ? [
encode(key, opts),
'[',
index,
']'
].join('') : [
encode(key, opts),
'[',
encode(index, opts),
']=',
encode(value, opts)
].join('');
};
case 'bracket':
return function (key, value) {
return value === null ? encode(key, opts) : [
encode(key, opts),
'[]=',
encode(value, opts)
].join('');
};
default:
return function (key, value) {
return value === null ? encode(key, opts) : [
encode(key, opts),
'=',
encode(value, opts)
].join('');
};
}
}
function parserForArrayFormat(opts) {
var result;
switch (opts.arrayFormat) {
case 'index':
return function (key, value, accumulator) {
result = /\[(\d*)\]$/.exec(key);
key = key.replace(/\[\d*\]$/, '');
if (!result) {
accumulator[key] = value;
return;
}
if (accumulator[key] === undefined) {
accumulator[key] = {};
}
accumulator[key][result[1]] = value;
};
case 'bracket':
return function (key, value, accumulator) {
result = /(\[\])$/.exec(key);
key = key.replace(/\[\]$/, '');
if (!result) {
accumulator[key] = value;
return;
} else if (accumulator[key] === undefined) {
accumulator[key] = [value];
return;
}
accumulator[key] = [].concat(accumulator[key], value);
};
default:
return function (key, value, accumulator) {
if (accumulator[key] === undefined) {
accumulator[key] = value;
return;
}
accumulator[key] = [].concat(accumulator[key], value);
};
}
}
function encode(value, opts) {
if (opts.encode) {
return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
}
return value;
}
function keysSorter(input) {
if (Array.isArray(input)) {
return input.sort();
} else if (typeof input === 'object') {
return keysSorter(Object.keys(input)).sort(function (a, b) {
return Number(a) - Number(b);
}).map(function (key) {
return input[key];
});
}
return input;
}
exports.extract = function (str) {
return str.split('?')[1] || '';
};
exports.parse = function (str, opts) {
opts = objectAssign({arrayFormat: 'none'}, opts);
var formatter = parserForArrayFormat(opts);
// Create an object with no prototype
// https://github.com/sindresorhus/query-string/issues/47
var ret = Object.create(null);
if (typeof str !== 'string') {
return ret;
}
str = str.trim().replace(/^(\?|#|&)/, '');
if (!str) {
return ret;
}
str.split('&').forEach(function (param) {
var parts = param.replace(/\+/g, ' ').split('=');
// Firefox (pre 40) decodes `%3D` to `=`
// https://github.com/sindresorhus/query-string/pull/37
var key = parts.shift();
var val = parts.length > 0 ? parts.join('=') : undefined;
// missing `=` should be `null`:
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
val = val === undefined ? null : decodeURIComponent(val);
formatter(decodeURIComponent(key), val, ret);
});
return Object.keys(ret).sort().reduce(function (result, key) {
var val = ret[key];
if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {
// Sort object keys, not values
result[key] = keysSorter(val);
} else {
result[key] = val;
}
return result;
}, Object.create(null));
};
exports.stringify = function (obj, opts) {
var defaults = {
encode: true,
strict: true,
arrayFormat: 'none'
};
opts = objectAssign(defaults, opts);
var formatter = encoderForArrayFormat(opts);
return obj ? Object.keys(obj).sort().map(function (key) {
var val = obj[key];
if (val === undefined) {
return '';
}
if (val === null) {
return encode(key, opts);
}
if (Array.isArray(val)) {
var result = [];
val.slice().forEach(function (val2) {
if (val2 === undefined) {
return;
}
result.push(formatter(key, val2, result.length));
});
return result.join('&');
}
return encode(key, opts) + '=' + encode(val, opts);
}).filter(function (x) {
return x.length > 0;
}).join('&') : '';
};
/***/ }),
/* 241 */
/***/ (function(module, exports) {
'use strict';
module.exports = function (str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase();
});
};
/***/ }),
/* 242 */
/***/ (function(module, exports) {
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
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 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
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(function (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 (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
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 (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var runTransitionHook = function runTransitionHook(hook, location, callback) {
var result = hook(location, callback);
if (hook.length < 2) {
// Assume the hook runs synchronously and automatically
// call the callback with the return value.
callback(result);
} else {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(result === undefined, 'You should not "return" in a transition hook with a callback argument; ' + 'call the callback instead') : void 0;
}
};
exports.default = runTransitionHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.locationsAreEqual = exports.statesAreEqual = exports.createLocation = exports.createQuery = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
var _PathUtils = __webpack_require__(245);
var _Actions = __webpack_require__(237);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createQuery = exports.createQuery = function createQuery(props) {
return _extends(Object.create(null), props);
};
var createLocation = exports.createLocation = function createLocation() {
var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/';
var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Actions.POP;
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var object = typeof input === 'string' ? (0, _PathUtils.parsePath)(input) : input;
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(!object.path, 'Location descriptor objects should have a `pathname`, not a `path`.') : void 0;
var pathname = object.pathname || '/';
var search = object.search || '';
var hash = object.hash || '';
var state = object.state;
return {
pathname: pathname,
search: search,
hash: hash,
state: state,
action: action,
key: key
};
};
var isDate = function isDate(object) {
return Object.prototype.toString.call(object) === '[object Date]';
};
var statesAreEqual = exports.statesAreEqual = function statesAreEqual(a, b) {
if (a === b) return true;
var typeofA = typeof a === 'undefined' ? 'undefined' : _typeof(a);
var typeofB = typeof b === 'undefined' ? 'undefined' : _typeof(b);
if (typeofA !== typeofB) return false;
!(typeofA !== 'function') ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'You must not store functions in location state') : (0, _invariant2.default)(false) : void 0;
// Not the same object, but same type.
if (typeofA === 'object') {
!!(isDate(a) && isDate(b)) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'You must not store Date objects in location state') : (0, _invariant2.default)(false) : void 0;
if (!Array.isArray(a)) {
var keysofA = Object.keys(a);
var keysofB = Object.keys(b);
return keysofA.length === keysofB.length && keysofA.every(function (key) {
return statesAreEqual(a[key], b[key]);
});
}
return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
return statesAreEqual(item, b[index]);
});
}
// All other serializable types (string, number, boolean)
// should be strict equal.
return false;
};
var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {
return a.key === b.key &&
// a.action === b.action && // Different action !== location change.
a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && statesAreEqual(a.state, b.state);
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.createPath = exports.parsePath = exports.getQueryStringValueFromPath = exports.stripQueryStringValueFromPath = exports.addQueryStringValueToPath = undefined;
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var addQueryStringValueToPath = exports.addQueryStringValueToPath = function addQueryStringValueToPath(path, key, value) {
var _parsePath = parsePath(path),
pathname = _parsePath.pathname,
search = _parsePath.search,
hash = _parsePath.hash;
return createPath({
pathname: pathname,
search: search + (search.indexOf('?') === -1 ? '?' : '&') + key + '=' + value,
hash: hash
});
};
var stripQueryStringValueFromPath = exports.stripQueryStringValueFromPath = function stripQueryStringValueFromPath(path, key) {
var _parsePath2 = parsePath(path),
pathname = _parsePath2.pathname,
search = _parsePath2.search,
hash = _parsePath2.hash;
return createPath({
pathname: pathname,
search: search.replace(new RegExp('([?&])' + key + '=[a-zA-Z0-9]+(&?)'), function (match, prefix, suffix) {
return prefix === '?' ? prefix : suffix;
}),
hash: hash
});
};
var getQueryStringValueFromPath = exports.getQueryStringValueFromPath = function getQueryStringValueFromPath(path, key) {
var _parsePath3 = parsePath(path),
search = _parsePath3.search;
var match = search.match(new RegExp('[?&]' + key + '=([a-zA-Z0-9]+)'));
return match && match[1];
};
var extractPath = function extractPath(string) {
var match = string.match(/^(https?:)?\/\/[^\/]*/);
return match == null ? string : string.substring(match[0].length);
};
var parsePath = exports.parsePath = function parsePath(path) {
var pathname = extractPath(path);
var search = '';
var hash = '';
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(path === pathname, 'A path must be pathname + search + hash only, not a full URL like "%s"', path) : void 0;
var hashIndex = pathname.indexOf('#');
if (hashIndex !== -1) {
hash = pathname.substring(hashIndex);
pathname = pathname.substring(0, hashIndex);
}
var searchIndex = pathname.indexOf('?');
if (searchIndex !== -1) {
search = pathname.substring(searchIndex);
pathname = pathname.substring(0, searchIndex);
}
if (pathname === '') pathname = '/';
return {
pathname: pathname,
search: search,
hash: hash
};
};
var createPath = exports.createPath = function createPath(location) {
if (location == null || typeof location === 'string') return location;
var basename = location.basename,
pathname = location.pathname,
search = location.search,
hash = location.hash;
var path = (basename || '') + pathname;
if (search && search !== '?') path += search;
if (hash) path += hash;
return path;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _runTransitionHook = __webpack_require__(243);
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
var _PathUtils = __webpack_require__(245);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var useBasename = function useBasename(createHistory) {
return function () {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var history = createHistory(options);
var basename = options.basename;
var addBasename = function addBasename(location) {
if (!location) return location;
if (basename && location.basename == null) {
if (location.pathname.toLowerCase().indexOf(basename.toLowerCase()) === 0) {
location.pathname = location.pathname.substring(basename.length);
location.basename = basename;
if (location.pathname === '') location.pathname = '/';
} else {
location.basename = '';
}
}
return location;
};
var prependBasename = function prependBasename(location) {
if (!basename) return location;
var object = typeof location === 'string' ? (0, _PathUtils.parsePath)(location) : location;
var pname = object.pathname;
var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/';
var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname;
var pathname = normalizedBasename + normalizedPathname;
return _extends({}, object, {
pathname: pathname
});
};
// Override all read methods with basename-aware versions.
var getCurrentLocation = function getCurrentLocation() {
return addBasename(history.getCurrentLocation());
};
var listenBefore = function listenBefore(hook) {
return history.listenBefore(function (location, callback) {
return (0, _runTransitionHook2.default)(hook, addBasename(location), callback);
});
};
var listen = function listen(listener) {
return history.listen(function (location) {
return listener(addBasename(location));
});
};
// Override all write methods with basename-aware versions.
var push = function push(location) {
return history.push(prependBasename(location));
};
var replace = function replace(location) {
return history.replace(prependBasename(location));
};
var createPath = function createPath(location) {
return history.createPath(prependBasename(location));
};
var createHref = function createHref(location) {
return history.createHref(prependBasename(location));
};
var createLocation = function createLocation(location) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return addBasename(history.createLocation.apply(history, [prependBasename(location)].concat(args)));
};
return _extends({}, history, {
getCurrentLocation: getCurrentLocation,
listenBefore: listenBefore,
listen: listen,
push: push,
replace: replace,
createPath: createPath,
createHref: createHref,
createLocation: createLocation
});
};
};
exports.default = useBasename;
/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _LocationUtils = __webpack_require__(244);
var _PathUtils = __webpack_require__(245);
var _createHistory = __webpack_require__(248);
var _createHistory2 = _interopRequireDefault(_createHistory);
var _Actions = __webpack_require__(237);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createStateStorage = function createStateStorage(entries) {
return entries.filter(function (entry) {
return entry.state;
}).reduce(function (memo, entry) {
memo[entry.key] = entry.state;
return memo;
}, {});
};
var createMemoryHistory = function createMemoryHistory() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (Array.isArray(options)) {
options = { entries: options };
} else if (typeof options === 'string') {
options = { entries: [options] };
}
var getCurrentLocation = function getCurrentLocation() {
var entry = entries[current];
var path = (0, _PathUtils.createPath)(entry);
var key = void 0,
state = void 0;
if (entry.key) {
key = entry.key;
state = readState(key);
}
var init = (0, _PathUtils.parsePath)(path);
return (0, _LocationUtils.createLocation)(_extends({}, init, { state: state }), undefined, key);
};
var canGo = function canGo(n) {
var index = current + n;
return index >= 0 && index < entries.length;
};
var go = function go(n) {
if (!n) return;
if (!canGo(n)) {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, 'Cannot go(%s) there is not enough history', n) : void 0;
return;
}
current += n;
var currentLocation = getCurrentLocation();
// Change action to POP
history.transitionTo(_extends({}, currentLocation, { action: _Actions.POP }));
};
var pushLocation = function pushLocation(location) {
current += 1;
if (current < entries.length) entries.splice(current);
entries.push(location);
saveState(location.key, location.state);
};
var replaceLocation = function replaceLocation(location) {
entries[current] = location;
saveState(location.key, location.state);
};
var history = (0, _createHistory2.default)(_extends({}, options, {
getCurrentLocation: getCurrentLocation,
pushLocation: pushLocation,
replaceLocation: replaceLocation,
go: go
}));
var _options = options,
entries = _options.entries,
current = _options.current;
if (typeof entries === 'string') {
entries = [entries];
} else if (!Array.isArray(entries)) {
entries = ['/'];
}
entries = entries.map(function (entry) {
return (0, _LocationUtils.createLocation)(entry);
});
if (current == null) {
current = entries.length - 1;
} else {
!(current >= 0 && current < entries.length) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Current index must be >= 0 and < %s, was %s', entries.length, current) : (0, _invariant2.default)(false) : void 0;
}
var storage = createStateStorage(entries);
var saveState = function saveState(key, state) {
return storage[key] = state;
};
var readState = function readState(key) {
return storage[key];
};
return _extends({}, history, {
canGo: canGo
});
};
exports.default = createMemoryHistory;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _AsyncUtils = __webpack_require__(249);
var _PathUtils = __webpack_require__(245);
var _runTransitionHook = __webpack_require__(243);
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
var _Actions = __webpack_require__(237);
var _LocationUtils = __webpack_require__(244);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createHistory = function createHistory() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var getCurrentLocation = options.getCurrentLocation,
getUserConfirmation = options.getUserConfirmation,
pushLocation = options.pushLocation,
replaceLocation = options.replaceLocation,
go = options.go,
keyLength = options.keyLength;
var currentLocation = void 0;
var pendingLocation = void 0;
var beforeListeners = [];
var listeners = [];
var allKeys = [];
var getCurrentIndex = function getCurrentIndex() {
if (pendingLocation && pendingLocation.action === _Actions.POP) return allKeys.indexOf(pendingLocation.key);
if (currentLocation) return allKeys.indexOf(currentLocation.key);
return -1;
};
var updateLocation = function updateLocation(nextLocation) {
var currentIndex = getCurrentIndex();
currentLocation = nextLocation;
if (currentLocation.action === _Actions.PUSH) {
allKeys = [].concat(allKeys.slice(0, currentIndex + 1), [currentLocation.key]);
} else if (currentLocation.action === _Actions.REPLACE) {
allKeys[currentIndex] = currentLocation.key;
}
listeners.forEach(function (listener) {
return listener(currentLocation);
});
};
var listenBefore = function listenBefore(listener) {
beforeListeners.push(listener);
return function () {
return beforeListeners = beforeListeners.filter(function (item) {
return item !== listener;
});
};
};
var listen = function listen(listener) {
listeners.push(listener);
return function () {
return listeners = listeners.filter(function (item) {
return item !== listener;
});
};
};
var confirmTransitionTo = function confirmTransitionTo(location, callback) {
(0, _AsyncUtils.loopAsync)(beforeListeners.length, function (index, next, done) {
(0, _runTransitionHook2.default)(beforeListeners[index], location, function (result) {
return result != null ? done(result) : next();
});
}, function (message) {
if (getUserConfirmation && typeof message === 'string') {
getUserConfirmation(message, function (ok) {
return callback(ok !== false);
});
} else {
callback(message !== false);
}
});
};
var transitionTo = function transitionTo(nextLocation) {
if (currentLocation && (0, _LocationUtils.locationsAreEqual)(currentLocation, nextLocation) || pendingLocation && (0, _LocationUtils.locationsAreEqual)(pendingLocation, nextLocation)) return; // Nothing to do
pendingLocation = nextLocation;
confirmTransitionTo(nextLocation, function (ok) {
if (pendingLocation !== nextLocation) return; // Transition was interrupted during confirmation
pendingLocation = null;
if (ok) {
// Treat PUSH to same path like REPLACE to be consistent with browsers
if (nextLocation.action === _Actions.PUSH) {
var prevPath = (0, _PathUtils.createPath)(currentLocation);
var nextPath = (0, _PathUtils.createPath)(nextLocation);
if (nextPath === prevPath && (0, _LocationUtils.statesAreEqual)(currentLocation.state, nextLocation.state)) nextLocation.action = _Actions.REPLACE;
}
if (nextLocation.action === _Actions.POP) {
updateLocation(nextLocation);
} else if (nextLocation.action === _Actions.PUSH) {
if (pushLocation(nextLocation) !== false) updateLocation(nextLocation);
} else if (nextLocation.action === _Actions.REPLACE) {
if (replaceLocation(nextLocation) !== false) updateLocation(nextLocation);
}
} else if (currentLocation && nextLocation.action === _Actions.POP) {
var prevIndex = allKeys.indexOf(currentLocation.key);
var nextIndex = allKeys.indexOf(nextLocation.key);
if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex); // Restore the URL
}
});
};
var push = function push(input) {
return transitionTo(createLocation(input, _Actions.PUSH));
};
var replace = function replace(input) {
return transitionTo(createLocation(input, _Actions.REPLACE));
};
var goBack = function goBack() {
return go(-1);
};
var goForward = function goForward() {
return go(1);
};
var createKey = function createKey() {
return Math.random().toString(36).substr(2, keyLength || 6);
};
var createHref = function createHref(location) {
return (0, _PathUtils.createPath)(location);
};
var createLocation = function createLocation(location, action) {
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createKey();
return (0, _LocationUtils.createLocation)(location, action, key);
};
return {
getCurrentLocation: getCurrentLocation,
listenBefore: listenBefore,
listen: listen,
transitionTo: transitionTo,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
createKey: createKey,
createPath: _PathUtils.createPath,
createHref: createHref,
createLocation: createLocation
};
};
exports.default = createHistory;
/***/ }),
/* 249 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
var loopAsync = exports.loopAsync = function loopAsync(turns, work, callback) {
var currentTurn = 0,
isDone = false;
var isSync = false,
hasNext = false,
doneArgs = void 0;
var done = function done() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
isDone = true;
if (isSync) {
// Iterate instead of recursing if possible.
doneArgs = args;
return;
}
callback.apply(undefined, args);
};
var next = function next() {
if (isDone) return;
hasNext = true;
if (isSync) return; // Iterate instead of recursing if possible.
isSync = true;
while (!isDone && currentTurn < turns && hasNext) {
hasNext = false;
work(currentTurn++, next, done);
}
isSync = false;
if (isDone) {
// This means the loop finished synchronously.
callback.apply(undefined, doneArgs);
return;
}
if (currentTurn >= turns && hasNext) {
isDone = true;
callback();
}
};
next();
};
/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = useRouterHistory;
var _useQueries = __webpack_require__(239);
var _useQueries2 = _interopRequireDefault(_useQueries);
var _useBasename = __webpack_require__(246);
var _useBasename2 = _interopRequireDefault(_useBasename);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function useRouterHistory(createHistory) {
return function (options) {
var history = (0, _useQueries2.default)((0, _useBasename2.default)(createHistory))(options);
return history;
};
}
module.exports = exports['default'];
/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _RouterContext = __webpack_require__(224);
var _RouterContext2 = _interopRequireDefault(_RouterContext);
var _routerWarning = __webpack_require__(214);
var _routerWarning2 = _interopRequireDefault(_routerWarning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
if (process.env.NODE_ENV !== 'production') {
middlewares.forEach(function (middleware, index) {
process.env.NODE_ENV !== 'production' ? (0, _routerWarning2.default)(middleware.renderRouterContext || middleware.renderRouteComponent, 'The middleware specified at index ' + index + ' does not appear to be ' + 'a valid React Router middleware.') : void 0;
});
}
var withContext = middlewares.map(function (middleware) {
return middleware.renderRouterContext;
}).filter(Boolean);
var withComponent = middlewares.map(function (middleware) {
return middleware.renderRouteComponent;
}).filter(Boolean);
var makeCreateElement = function makeCreateElement() {
var baseCreateElement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _react.createElement;
return function (Component, props) {
return withComponent.reduceRight(function (previous, renderRouteComponent) {
return renderRouteComponent(previous, props);
}, baseCreateElement(Component, props));
};
};
return function (renderProps) {
return withContext.reduceRight(function (previous, renderRouterContext) {
return renderRouterContext(previous, renderProps);
}, _react2.default.createElement(_RouterContext2.default, _extends({}, renderProps, {
createElement: makeCreateElement(renderProps.createElement)
})));
};
};
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createBrowserHistory = __webpack_require__(253);
var _createBrowserHistory2 = _interopRequireDefault(_createBrowserHistory);
var _createRouterHistory = __webpack_require__(259);
var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _createRouterHistory2.default)(_createBrowserHistory2.default);
module.exports = exports['default'];
/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _ExecutionEnvironment = __webpack_require__(254);
var _BrowserProtocol = __webpack_require__(255);
var BrowserProtocol = _interopRequireWildcard(_BrowserProtocol);
var _RefreshProtocol = __webpack_require__(258);
var RefreshProtocol = _interopRequireWildcard(_RefreshProtocol);
var _DOMUtils = __webpack_require__(256);
var _createHistory = __webpack_require__(248);
var _createHistory2 = _interopRequireDefault(_createHistory);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates and returns a history object that uses HTML5's history API
* (pushState, replaceState, and the popstate event) to manage history.
* This is the recommended method of managing history in browsers because
* it provides the cleanest URLs.
*
* Note: In browsers that do not support the HTML5 history API full
* page reloads will be used to preserve clean URLs. You can force this
* behavior using { forceRefresh: true } in options.
*/
var createBrowserHistory = function createBrowserHistory() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
!_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Browser history needs a DOM') : (0, _invariant2.default)(false) : void 0;
var useRefresh = options.forceRefresh || !(0, _DOMUtils.supportsHistory)();
var Protocol = useRefresh ? RefreshProtocol : BrowserProtocol;
var getUserConfirmation = Protocol.getUserConfirmation,
getCurrentLocation = Protocol.getCurrentLocation,
pushLocation = Protocol.pushLocation,
replaceLocation = Protocol.replaceLocation,
go = Protocol.go;
var history = (0, _createHistory2.default)(_extends({
getUserConfirmation: getUserConfirmation }, options, {
getCurrentLocation: getCurrentLocation,
pushLocation: pushLocation,
replaceLocation: replaceLocation,
go: go
}));
var listenerCount = 0,
stopListener = void 0;
var startListener = function startListener(listener, before) {
if (++listenerCount === 1) stopListener = BrowserProtocol.startListener(history.transitionTo);
var unlisten = before ? history.listenBefore(listener) : history.listen(listener);
return function () {
unlisten();
if (--listenerCount === 0) stopListener();
};
};
var listenBefore = function listenBefore(listener) {
return startListener(listener, true);
};
var listen = function listen(listener) {
return startListener(listener, false);
};
return _extends({}, history, {
listenBefore: listenBefore,
listen: listen
});
};
exports.default = createBrowserHistory;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 254 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.go = exports.replaceLocation = exports.pushLocation = exports.startListener = exports.getUserConfirmation = exports.getCurrentLocation = undefined;
var _LocationUtils = __webpack_require__(244);
var _DOMUtils = __webpack_require__(256);
var _DOMStateStorage = __webpack_require__(257);
var _PathUtils = __webpack_require__(245);
var _ExecutionEnvironment = __webpack_require__(254);
var PopStateEvent = 'popstate';
var HashChangeEvent = 'hashchange';
var needsHashchangeListener = _ExecutionEnvironment.canUseDOM && !(0, _DOMUtils.supportsPopstateOnHashchange)();
var _createLocation = function _createLocation(historyState) {
var key = historyState && historyState.key;
return (0, _LocationUtils.createLocation)({
pathname: window.location.pathname,
search: window.location.search,
hash: window.location.hash,
state: key ? (0, _DOMStateStorage.readState)(key) : undefined
}, undefined, key);
};
var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation() {
var historyState = void 0;
try {
historyState = window.history.state || {};
} catch (error) {
// IE 11 sometimes throws when accessing window.history.state
// See https://github.com/ReactTraining/history/pull/289
historyState = {};
}
return _createLocation(historyState);
};
var getUserConfirmation = exports.getUserConfirmation = function getUserConfirmation(message, callback) {
return callback(window.confirm(message));
}; // eslint-disable-line no-alert
var startListener = exports.startListener = function startListener(listener) {
var handlePopState = function handlePopState(event) {
if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) // Ignore extraneous popstate events in WebKit
return;
listener(_createLocation(event.state));
};
(0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);
var handleUnpoppedHashChange = function handleUnpoppedHashChange() {
return listener(getCurrentLocation());
};
if (needsHashchangeListener) {
(0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleUnpoppedHashChange);
}
return function () {
(0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);
if (needsHashchangeListener) {
(0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleUnpoppedHashChange);
}
};
};
var updateLocation = function updateLocation(location, updateState) {
var state = location.state,
key = location.key;
if (state !== undefined) (0, _DOMStateStorage.saveState)(key, state);
updateState({ key: key }, (0, _PathUtils.createPath)(location));
};
var pushLocation = exports.pushLocation = function pushLocation(location) {
return updateLocation(location, function (state, path) {
return window.history.pushState(state, null, path);
});
};
var replaceLocation = exports.replaceLocation = function replaceLocation(location) {
return updateLocation(location, function (state, path) {
return window.history.replaceState(state, null, path);
});
};
var go = exports.go = function go(n) {
if (n) window.history.go(n);
};
/***/ }),
/* 256 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {
return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);
};
var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {
return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);
};
/**
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
*
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
*/
var supportsHistory = exports.supportsHistory = function supportsHistory() {
var ua = window.navigator.userAgent;
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
return window.history && 'pushState' in window.history;
};
/**
* Returns false if using go(n) with hash history causes a full page reload.
*/
var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
return window.navigator.userAgent.indexOf('Firefox') === -1;
};
/**
* Returns true if browser fires popstate on hash change.
* IE10 and IE11 do not.
*/
var supportsPopstateOnHashchange = exports.supportsPopstateOnHashchange = function supportsPopstateOnHashchange() {
return window.navigator.userAgent.indexOf('Trident') === -1;
};
/**
* Returns true if a given popstate event is an extraneous WebKit event.
* Accounts for the fact that Chrome on iOS fires real popstate events
* containing undefined state when pressing the back button.
*/
var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
};
/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.readState = exports.saveState = undefined;
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var QuotaExceededErrors = {
QuotaExceededError: true,
QUOTA_EXCEEDED_ERR: true
};
var SecurityErrors = {
SecurityError: true
};
var KeyPrefix = '@@History/';
var createKey = function createKey(key) {
return KeyPrefix + key;
};
var saveState = exports.saveState = function saveState(key, state) {
if (!window.sessionStorage) {
// Session storage is not available or hidden.
// sessionStorage is undefined in Internet Explorer when served via file protocol.
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available') : void 0;
return;
}
try {
if (state == null) {
window.sessionStorage.removeItem(createKey(key));
} else {
window.sessionStorage.setItem(createKey(key), JSON.stringify(state));
}
} catch (error) {
if (SecurityErrors[error.name]) {
// Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any
// attempt to access window.sessionStorage.
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available due to security settings') : void 0;
return;
}
if (QuotaExceededErrors[error.name] && window.sessionStorage.length === 0) {
// Safari "private mode" throws QuotaExceededError.
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available in Safari private mode') : void 0;
return;
}
throw error;
}
};
var readState = exports.readState = function readState(key) {
var json = void 0;
try {
json = window.sessionStorage.getItem(createKey(key));
} catch (error) {
if (SecurityErrors[error.name]) {
// Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any
// attempt to access window.sessionStorage.
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to read state; sessionStorage is not available due to security settings') : void 0;
return undefined;
}
}
if (json) {
try {
return JSON.parse(json);
} catch (error) {
// Ignore invalid JSON.
}
}
return undefined;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.replaceLocation = exports.pushLocation = exports.getCurrentLocation = exports.go = exports.getUserConfirmation = undefined;
var _BrowserProtocol = __webpack_require__(255);
Object.defineProperty(exports, 'getUserConfirmation', {
enumerable: true,
get: function get() {
return _BrowserProtocol.getUserConfirmation;
}
});
Object.defineProperty(exports, 'go', {
enumerable: true,
get: function get() {
return _BrowserProtocol.go;
}
});
var _LocationUtils = __webpack_require__(244);
var _PathUtils = __webpack_require__(245);
var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation() {
return (0, _LocationUtils.createLocation)(window.location);
};
var pushLocation = exports.pushLocation = function pushLocation(location) {
window.location.href = (0, _PathUtils.createPath)(location);
return false; // Don't update location
};
var replaceLocation = exports.replaceLocation = function replaceLocation(location) {
window.location.replace((0, _PathUtils.createPath)(location));
return false; // Don't update location
};
/***/ }),
/* 259 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = createRouterHistory;
var _useRouterHistory = __webpack_require__(250);
var _useRouterHistory2 = _interopRequireDefault(_useRouterHistory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
function createRouterHistory(createHistory) {
var history = void 0;
if (canUseDOM) history = (0, _useRouterHistory2.default)(createHistory)();
return history;
}
module.exports = exports['default'];
/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createHashHistory = __webpack_require__(261);
var _createHashHistory2 = _interopRequireDefault(_createHashHistory);
var _createRouterHistory = __webpack_require__(259);
var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _createRouterHistory2.default)(_createHashHistory2.default);
module.exports = exports['default'];
/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(204);
var _invariant2 = _interopRequireDefault(_invariant);
var _ExecutionEnvironment = __webpack_require__(254);
var _DOMUtils = __webpack_require__(256);
var _HashProtocol = __webpack_require__(262);
var HashProtocol = _interopRequireWildcard(_HashProtocol);
var _createHistory = __webpack_require__(248);
var _createHistory2 = _interopRequireDefault(_createHistory);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DefaultQueryKey = '_k';
var addLeadingSlash = function addLeadingSlash(path) {
return path.charAt(0) === '/' ? path : '/' + path;
};
var HashPathCoders = {
hashbang: {
encodePath: function encodePath(path) {
return path.charAt(0) === '!' ? path : '!' + path;
},
decodePath: function decodePath(path) {
return path.charAt(0) === '!' ? path.substring(1) : path;
}
},
noslash: {
encodePath: function encodePath(path) {
return path.charAt(0) === '/' ? path.substring(1) : path;
},
decodePath: addLeadingSlash
},
slash: {
encodePath: addLeadingSlash,
decodePath: addLeadingSlash
}
};
var createHashHistory = function createHashHistory() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
!_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'Hash history needs a DOM') : (0, _invariant2.default)(false) : void 0;
var queryKey = options.queryKey,
hashType = options.hashType;
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(queryKey !== false, 'Using { queryKey: false } no longer works. Instead, just don\'t ' + 'use location state if you don\'t want a key in your URL query string') : void 0;
if (typeof queryKey !== 'string') queryKey = DefaultQueryKey;
if (hashType == null) hashType = 'slash';
if (!(hashType in HashPathCoders)) {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, 'Invalid hash type: %s', hashType) : void 0;
hashType = 'slash';
}
var pathCoder = HashPathCoders[hashType];
var getUserConfirmation = HashProtocol.getUserConfirmation;
var getCurrentLocation = function getCurrentLocation() {
return HashProtocol.getCurrentLocation(pathCoder, queryKey);
};
var pushLocation = function pushLocation(location) {
return HashProtocol.pushLocation(location, pathCoder, queryKey);
};
var replaceLocation = function replaceLocation(location) {
return HashProtocol.replaceLocation(location, pathCoder, queryKey);
};
var history = (0, _createHistory2.default)(_extends({
getUserConfirmation: getUserConfirmation }, options, {
getCurrentLocation: getCurrentLocation,
pushLocation: pushLocation,
replaceLocation: replaceLocation,
go: HashProtocol.go
}));
var listenerCount = 0,
stopListener = void 0;
var startListener = function startListener(listener, before) {
if (++listenerCount === 1) stopListener = HashProtocol.startListener(history.transitionTo, pathCoder, queryKey);
var unlisten = before ? history.listenBefore(listener) : history.listen(listener);
return function () {
unlisten();
if (--listenerCount === 0) stopListener();
};
};
var listenBefore = function listenBefore(listener) {
return startListener(listener, true);
};
var listen = function listen(listener) {
return startListener(listener, false);
};
var goIsSupportedWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();
var go = function go(n) {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(goIsSupportedWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;
history.go(n);
};
var createHref = function createHref(path) {
return '#' + pathCoder.encodePath(history.createHref(path));
};
return _extends({}, history, {
listenBefore: listenBefore,
listen: listen,
go: go,
createHref: createHref
});
};
exports.default = createHashHistory;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 262 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.replaceLocation = exports.pushLocation = exports.startListener = exports.getCurrentLocation = exports.go = exports.getUserConfirmation = undefined;
var _BrowserProtocol = __webpack_require__(255);
Object.defineProperty(exports, 'getUserConfirmation', {
enumerable: true,
get: function get() {
return _BrowserProtocol.getUserConfirmation;
}
});
Object.defineProperty(exports, 'go', {
enumerable: true,
get: function get() {
return _BrowserProtocol.go;
}
});
var _warning = __webpack_require__(215);
var _warning2 = _interopRequireDefault(_warning);
var _LocationUtils = __webpack_require__(244);
var _DOMUtils = __webpack_require__(256);
var _DOMStateStorage = __webpack_require__(257);
var _PathUtils = __webpack_require__(245);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var HashChangeEvent = 'hashchange';
var getHashPath = function getHashPath() {
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
var href = window.location.href;
var hashIndex = href.indexOf('#');
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
};
var pushHashPath = function pushHashPath(path) {
return window.location.hash = path;
};
var replaceHashPath = function replaceHashPath(path) {
var hashIndex = window.location.href.indexOf('#');
window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
};
var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation(pathCoder, queryKey) {
var path = pathCoder.decodePath(getHashPath());
var key = (0, _PathUtils.getQueryStringValueFromPath)(path, queryKey);
var state = void 0;
if (key) {
path = (0, _PathUtils.stripQueryStringValueFromPath)(path, queryKey);
state = (0, _DOMStateStorage.readState)(key);
}
var init = (0, _PathUtils.parsePath)(path);
init.state = state;
return (0, _LocationUtils.createLocation)(init, undefined, key);
};
var prevLocation = void 0;
var startListener = exports.startListener = function startListener(listener, pathCoder, queryKey) {
var handleHashChange = function handleHashChange() {
var path = getHashPath();
var encodedPath = pathCoder.encodePath(path);
if (path !== encodedPath) {
// Always be sure we have a properly-encoded hash.
replaceHashPath(encodedPath);
} else {
var currentLocation = getCurrentLocation(pathCoder, queryKey);
if (prevLocation && currentLocation.key && prevLocation.key === currentLocation.key) return; // Ignore extraneous hashchange events
prevLocation = currentLocation;
listener(currentLocation);
}
};
// Ensure the hash is encoded properly.
var path = getHashPath();
var encodedPath = pathCoder.encodePath(path);
if (path !== encodedPath) replaceHashPath(encodedPath);
(0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
return function () {
return (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
};
};
var updateLocation = function updateLocation(location, pathCoder, queryKey, updateHash) {
var state = location.state,
key = location.key;
var path = pathCoder.encodePath((0, _PathUtils.createPath)(location));
if (state !== undefined) {
path = (0, _PathUtils.addQueryStringValueToPath)(path, queryKey, key);
(0, _DOMStateStorage.saveState)(key, state);
}
prevLocation = location;
updateHash(path);
};
var pushLocation = exports.pushLocation = function pushLocation(location, pathCoder, queryKey) {
return updateLocation(location, pathCoder, queryKey, function (path) {
if (getHashPath() !== path) {
pushHashPath(path);
} else {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, 'You cannot PUSH the same path using hash history') : void 0;
}
});
};
var replaceLocation = exports.replaceLocation = function replaceLocation(location, pathCoder, queryKey) {
return updateLocation(location, pathCoder, queryKey, function (path) {
if (getHashPath() !== path) replaceHashPath(path);
});
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ })
/******/ ]);
|
/**
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* This file is licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License. A copy of
* the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
//snippet-sourcedescription:[sns_deletetopic.js demonstrates how to delete an Amazon SNS topic and all its subscriptions.]
//snippet-service:[sns]
//snippet-keyword:[JavaScript]
//snippet-sourcesyntax:[javascript]
//snippet-keyword:[Code Sample]
//snippet-keyword:[Amazon Simple Notification Service]
//snippet-sourcetype:[full-example]
//snippet-sourcedate:[2018-06-02]
//snippet-sourceauthor:[AWS-JSDG]
// ABOUT THIS NODE.JS SAMPLE: This sample is part of the SDK for JavaScript Developer Guide topic at
// https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sns-examples-managing-topics.html
// snippet-start:[sns.JavaScript.topics.deleteTopic]
// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
// Set region
AWS.config.update({region: 'REGION'});
// Create promise and SNS service object
var deleteTopicPromise = new AWS.SNS({apiVersion: '2010-03-31'}).deleteTopic({TopicArn: 'TOPIC_ARN'}).promise();
// Handle promise's fulfilled/rejected states
deleteTopicPromise.then(
function(data) {
console.log("Topic Deleted");
}).catch(
function(err) {
console.error(err, err.stack);
});
// snippet-end:[sns.JavaScript.topics.deleteTopic]
|
'use strict';"use strict";
var collection_1 = require('angular2/src/facade/collection');
var lang_1 = require('angular2/src/facade/lang');
var MOUSE_EVENT_PROPERTIES = [
"altKey",
"button",
"clientX",
"clientY",
"metaKey",
"movementX",
"movementY",
"offsetX",
"offsetY",
"region",
"screenX",
"screenY",
"shiftKey"
];
var KEYBOARD_EVENT_PROPERTIES = [
'altkey',
'charCode',
'code',
'ctrlKey',
'isComposing',
'key',
'keyCode',
'location',
'metaKey',
'repeat',
'shiftKey',
'which'
];
var TRANSITION_EVENT_PROPERTIES = ['propertyName', 'elapsedTime', 'pseudoElement'];
var EVENT_PROPERTIES = ['type', 'bubbles', 'cancelable'];
var NODES_WITH_VALUE = new collection_1.Set(["input", "select", "option", "button", "li", "meter", "progress", "param", "textarea"]);
function serializeGenericEvent(e) {
return serializeEvent(e, EVENT_PROPERTIES);
}
exports.serializeGenericEvent = serializeGenericEvent;
// TODO(jteplitz602): Allow users to specify the properties they need rather than always
// adding value and files #3374
function serializeEventWithTarget(e) {
var serializedEvent = serializeEvent(e, EVENT_PROPERTIES);
return addTarget(e, serializedEvent);
}
exports.serializeEventWithTarget = serializeEventWithTarget;
function serializeMouseEvent(e) {
return serializeEvent(e, MOUSE_EVENT_PROPERTIES);
}
exports.serializeMouseEvent = serializeMouseEvent;
function serializeKeyboardEvent(e) {
var serializedEvent = serializeEvent(e, KEYBOARD_EVENT_PROPERTIES);
return addTarget(e, serializedEvent);
}
exports.serializeKeyboardEvent = serializeKeyboardEvent;
function serializeTransitionEvent(e) {
var serializedEvent = serializeEvent(e, TRANSITION_EVENT_PROPERTIES);
return addTarget(e, serializedEvent);
}
exports.serializeTransitionEvent = serializeTransitionEvent;
// TODO(jteplitz602): #3374. See above.
function addTarget(e, serializedEvent) {
if (NODES_WITH_VALUE.has(e.target.tagName.toLowerCase())) {
var target = e.target;
serializedEvent['target'] = { 'value': target.value };
if (lang_1.isPresent(target.files)) {
serializedEvent['target']['files'] = target.files;
}
}
return serializedEvent;
}
function serializeEvent(e, properties) {
var serialized = {};
for (var i = 0; i < properties.length; i++) {
var prop = properties[i];
serialized[prop] = e[prop];
}
return serialized;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRfc2VyaWFsaXplci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImRpZmZpbmdfcGx1Z2luX3dyYXBwZXItb3V0cHV0X3BhdGgtQlJKZXIxSjkudG1wL2FuZ3VsYXIyL3NyYy93ZWJfd29ya2Vycy91aS9ldmVudF9zZXJpYWxpemVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwyQkFBa0IsZ0NBQWdDLENBQUMsQ0FBQTtBQUNuRCxxQkFBd0IsMEJBQTBCLENBQUMsQ0FBQTtBQUVuRCxJQUFNLHNCQUFzQixHQUFHO0lBQzdCLFFBQVE7SUFDUixRQUFRO0lBQ1IsU0FBUztJQUNULFNBQVM7SUFDVCxTQUFTO0lBQ1QsV0FBVztJQUNYLFdBQVc7SUFDWCxTQUFTO0lBQ1QsU0FBUztJQUNULFFBQVE7SUFDUixTQUFTO0lBQ1QsU0FBUztJQUNULFVBQVU7Q0FDWCxDQUFDO0FBRUYsSUFBTSx5QkFBeUIsR0FBRztJQUNoQyxRQUFRO0lBQ1IsVUFBVTtJQUNWLE1BQU07SUFDTixTQUFTO0lBQ1QsYUFBYTtJQUNiLEtBQUs7SUFDTCxTQUFTO0lBQ1QsVUFBVTtJQUNWLFNBQVM7SUFDVCxRQUFRO0lBQ1IsVUFBVTtJQUNWLE9BQU87Q0FDUixDQUFDO0FBRUYsSUFBTSwyQkFBMkIsR0FBRyxDQUFDLGNBQWMsRUFBRSxhQUFhLEVBQUUsZUFBZSxDQUFDLENBQUM7QUFFckYsSUFBTSxnQkFBZ0IsR0FBRyxDQUFDLE1BQU0sRUFBRSxTQUFTLEVBQUUsWUFBWSxDQUFDLENBQUM7QUFFM0QsSUFBTSxnQkFBZ0IsR0FBRyxJQUFJLGdCQUFHLENBQzVCLENBQUMsT0FBTyxFQUFFLFFBQVEsRUFBRSxRQUFRLEVBQUUsUUFBUSxFQUFFLElBQUksRUFBRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE9BQU8sRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBRTdGLCtCQUFzQyxDQUFRO0lBQzVDLE1BQU0sQ0FBQyxjQUFjLENBQUMsQ0FBQyxFQUFFLGdCQUFnQixDQUFDLENBQUM7QUFDN0MsQ0FBQztBQUZlLDZCQUFxQix3QkFFcEMsQ0FBQTtBQUVELHdGQUF3RjtBQUN4RiwrQkFBK0I7QUFDL0Isa0NBQXlDLENBQVE7SUFDL0MsSUFBSSxlQUFlLEdBQUcsY0FBYyxDQUFDLENBQUMsRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDO0lBQzFELE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLGVBQWUsQ0FBQyxDQUFDO0FBQ3ZDLENBQUM7QUFIZSxnQ0FBd0IsMkJBR3ZDLENBQUE7QUFFRCw2QkFBb0MsQ0FBYTtJQUMvQyxNQUFNLENBQUMsY0FBYyxDQUFDLENBQUMsRUFBRSxzQkFBc0IsQ0FBQyxDQUFDO0FBQ25ELENBQUM7QUFGZSwyQkFBbUIsc0JBRWxDLENBQUE7QUFFRCxnQ0FBdUMsQ0FBZ0I7SUFDckQsSUFBSSxlQUFlLEdBQUcsY0FBYyxDQUFDLENBQUMsRUFBRSx5QkFBeUIsQ0FBQyxDQUFDO0lBQ25FLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLGVBQWUsQ0FBQyxDQUFDO0FBQ3ZDLENBQUM7QUFIZSw4QkFBc0IseUJBR3JDLENBQUE7QUFFRCxrQ0FBeUMsQ0FBa0I7SUFDekQsSUFBSSxlQUFlLEdBQUcsY0FBYyxDQUFDLENBQUMsRUFBRSwyQkFBMkIsQ0FBQyxDQUFDO0lBQ3JFLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLGVBQWUsQ0FBQyxDQUFDO0FBQ3ZDLENBQUM7QUFIZSxnQ0FBd0IsMkJBR3ZDLENBQUE7QUFFRCx1Q0FBdUM7QUFDdkMsbUJBQW1CLENBQVEsRUFBRSxlQUFxQztJQUNoRSxFQUFFLENBQUMsQ0FBQyxnQkFBZ0IsQ0FBQyxHQUFHLENBQWUsQ0FBQyxDQUFDLE1BQU8sQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDeEUsSUFBSSxNQUFNLEdBQXFCLENBQUMsQ0FBQyxNQUFNLENBQUM7UUFDeEMsZUFBZSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUMsT0FBTyxFQUFFLE1BQU0sQ0FBQyxLQUFLLEVBQUMsQ0FBQztRQUNwRCxFQUFFLENBQUMsQ0FBQyxnQkFBUyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDNUIsZUFBZSxDQUFDLFFBQVEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUM7UUFDcEQsQ0FBQztJQUNILENBQUM7SUFDRCxNQUFNLENBQUMsZUFBZSxDQUFDO0FBQ3pCLENBQUM7QUFFRCx3QkFBd0IsQ0FBTSxFQUFFLFVBQW9CO0lBQ2xELElBQUksVUFBVSxHQUFHLEVBQUUsQ0FBQztJQUNwQixHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLFVBQVUsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQztRQUMzQyxJQUFJLElBQUksR0FBRyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDekIsVUFBVSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUM3QixDQUFDO0lBQ0QsTUFBTSxDQUFDLFVBQVUsQ0FBQztBQUNwQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtTZXR9IGZyb20gJ2FuZ3VsYXIyL3NyYy9mYWNhZGUvY29sbGVjdGlvbic7XG5pbXBvcnQge2lzUHJlc2VudH0gZnJvbSAnYW5ndWxhcjIvc3JjL2ZhY2FkZS9sYW5nJztcblxuY29uc3QgTU9VU0VfRVZFTlRfUFJPUEVSVElFUyA9IFtcbiAgXCJhbHRLZXlcIixcbiAgXCJidXR0b25cIixcbiAgXCJjbGllbnRYXCIsXG4gIFwiY2xpZW50WVwiLFxuICBcIm1ldGFLZXlcIixcbiAgXCJtb3ZlbWVudFhcIixcbiAgXCJtb3ZlbWVudFlcIixcbiAgXCJvZmZzZXRYXCIsXG4gIFwib2Zmc2V0WVwiLFxuICBcInJlZ2lvblwiLFxuICBcInNjcmVlblhcIixcbiAgXCJzY3JlZW5ZXCIsXG4gIFwic2hpZnRLZXlcIlxuXTtcblxuY29uc3QgS0VZQk9BUkRfRVZFTlRfUFJPUEVSVElFUyA9IFtcbiAgJ2FsdGtleScsXG4gICdjaGFyQ29kZScsXG4gICdjb2RlJyxcbiAgJ2N0cmxLZXknLFxuICAnaXNDb21wb3NpbmcnLFxuICAna2V5JyxcbiAgJ2tleUNvZGUnLFxuICAnbG9jYXRpb24nLFxuICAnbWV0YUtleScsXG4gICdyZXBlYXQnLFxuICAnc2hpZnRLZXknLFxuICAnd2hpY2gnXG5dO1xuXG5jb25zdCBUUkFOU0lUSU9OX0VWRU5UX1BST1BFUlRJRVMgPSBbJ3Byb3BlcnR5TmFtZScsICdlbGFwc2VkVGltZScsICdwc2V1ZG9FbGVtZW50J107XG5cbmNvbnN0IEVWRU5UX1BST1BFUlRJRVMgPSBbJ3R5cGUnLCAnYnViYmxlcycsICdjYW5jZWxhYmxlJ107XG5cbmNvbnN0IE5PREVTX1dJVEhfVkFMVUUgPSBuZXcgU2V0KFxuICAgIFtcImlucHV0XCIsIFwic2VsZWN0XCIsIFwib3B0aW9uXCIsIFwiYnV0dG9uXCIsIFwibGlcIiwgXCJtZXRlclwiLCBcInByb2dyZXNzXCIsIFwicGFyYW1cIiwgXCJ0ZXh0YXJlYVwiXSk7XG5cbmV4cG9ydCBmdW5jdGlvbiBzZXJpYWxpemVHZW5lcmljRXZlbnQoZTogRXZlbnQpOiB7W2tleTogc3RyaW5nXTogYW55fSB7XG4gIHJldHVybiBzZXJpYWxpemVFdmVudChlLCBFVkVOVF9QUk9QRVJUSUVTKTtcbn1cblxuLy8gVE9ETyhqdGVwbGl0ejYwMik6IEFsbG93IHVzZXJzIHRvIHNwZWNpZnkgdGhlIHByb3BlcnRpZXMgdGhleSBuZWVkIHJhdGhlciB0aGFuIGFsd2F5c1xuLy8gYWRkaW5nIHZhbHVlIGFuZCBmaWxlcyAjMzM3NFxuZXhwb3J0IGZ1bmN0aW9uIHNlcmlhbGl6ZUV2ZW50V2l0aFRhcmdldChlOiBFdmVudCk6IHtba2V5OiBzdHJpbmddOiBhbnl9IHtcbiAgdmFyIHNlcmlhbGl6ZWRFdmVudCA9IHNlcmlhbGl6ZUV2ZW50KGUsIEVWRU5UX1BST1BFUlRJRVMpO1xuICByZXR1cm4gYWRkVGFyZ2V0KGUsIHNlcmlhbGl6ZWRFdmVudCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzZXJpYWxpemVNb3VzZUV2ZW50KGU6IE1vdXNlRXZlbnQpOiB7W2tleTogc3RyaW5nXTogYW55fSB7XG4gIHJldHVybiBzZXJpYWxpemVFdmVudChlLCBNT1VTRV9FVkVOVF9QUk9QRVJUSUVTKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHNlcmlhbGl6ZUtleWJvYXJkRXZlbnQoZTogS2V5Ym9hcmRFdmVudCk6IHtba2V5OiBzdHJpbmddOiBhbnl9IHtcbiAgdmFyIHNlcmlhbGl6ZWRFdmVudCA9IHNlcmlhbGl6ZUV2ZW50KGUsIEtFWUJPQVJEX0VWRU5UX1BST1BFUlRJRVMpO1xuICByZXR1cm4gYWRkVGFyZ2V0KGUsIHNlcmlhbGl6ZWRFdmVudCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzZXJpYWxpemVUcmFuc2l0aW9uRXZlbnQoZTogVHJhbnNpdGlvbkV2ZW50KToge1trZXk6IHN0cmluZ106IGFueX0ge1xuICB2YXIgc2VyaWFsaXplZEV2ZW50ID0gc2VyaWFsaXplRXZlbnQoZSwgVFJBTlNJVElPTl9FVkVOVF9QUk9QRVJUSUVTKTtcbiAgcmV0dXJuIGFkZFRhcmdldChlLCBzZXJpYWxpemVkRXZlbnQpO1xufVxuXG4vLyBUT0RPKGp0ZXBsaXR6NjAyKTogIzMzNzQuIFNlZSBhYm92ZS5cbmZ1bmN0aW9uIGFkZFRhcmdldChlOiBFdmVudCwgc2VyaWFsaXplZEV2ZW50OiB7W2tleTogc3RyaW5nXTogYW55fSk6IHtba2V5OiBzdHJpbmddOiBhbnl9IHtcbiAgaWYgKE5PREVTX1dJVEhfVkFMVUUuaGFzKCg8SFRNTEVsZW1lbnQ+ZS50YXJnZXQpLnRhZ05hbWUudG9Mb3dlckNhc2UoKSkpIHtcbiAgICB2YXIgdGFyZ2V0ID0gPEhUTUxJbnB1dEVsZW1lbnQ+ZS50YXJnZXQ7XG4gICAgc2VyaWFsaXplZEV2ZW50Wyd0YXJnZXQnXSA9IHsndmFsdWUnOiB0YXJnZXQudmFsdWV9O1xuICAgIGlmIChpc1ByZXNlbnQodGFyZ2V0LmZpbGVzKSkge1xuICAgICAgc2VyaWFsaXplZEV2ZW50Wyd0YXJnZXQnXVsnZmlsZXMnXSA9IHRhcmdldC5maWxlcztcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHNlcmlhbGl6ZWRFdmVudDtcbn1cblxuZnVuY3Rpb24gc2VyaWFsaXplRXZlbnQoZTogYW55LCBwcm9wZXJ0aWVzOiBzdHJpbmdbXSk6IHtba2V5OiBzdHJpbmddOiBhbnl9IHtcbiAgdmFyIHNlcmlhbGl6ZWQgPSB7fTtcbiAgZm9yICh2YXIgaSA9IDA7IGkgPCBwcm9wZXJ0aWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgdmFyIHByb3AgPSBwcm9wZXJ0aWVzW2ldO1xuICAgIHNlcmlhbGl6ZWRbcHJvcF0gPSBlW3Byb3BdO1xuICB9XG4gIHJldHVybiBzZXJpYWxpemVkO1xufVxuIl19
|
import re
from w3af.plugins.attack.payloads.base_payload import Payload
from w3af.core.ui.console.tables import table
class apache_version(Payload):
"""
This payload shows Apache Version
"""
def api_read(self):
result = {}
result['version'] = []
def parse_apache_binary(binary):
version = re.search('(?<=/build/buildd/)(.*?)/', binary)
version2 = re.search('(?<=Apache)/(\d\.\d\.\d*)(.*?) ', binary)
if version and version2:
return [version.group(1), version2.group(1)]
elif version:
return [version.group(1)]
elif version2:
return [version2.group(1)]
else:
return ''
for version in parse_apache_binary(self.shell.read('/usr/sbin/apache2')):
result['version'].append(version)
for version in parse_apache_binary(self.shell.read('/usr/sbin/httpd')):
result['version'].append(version)
result['version'] = list(set(result['version']))
result['version'] = [p for p in result['version'] if p != '']
return result
def run_read(self):
api_result = self.api_read()
if not api_result['version']:
return 'Apache version not found.'
else:
rows = []
rows.append(['Version', ])
rows.append([])
for key_name in api_result:
for version in api_result[key_name]:
rows.append([version, ])
result_table = table(rows)
result_table.draw(80)
return rows
|
var book = {
"name": "Jesaja",
"numChapters": 66,
"chapters": {
"1": {
"1": "<span>1</span> Jesaja, Aamotsi poja nägemus, mida ta nägi Juuda ja Jeruusalemma kohta Juuda kuningate Ussija, Jootami, Aahase ja Hiskija päevil:",
"2": "<span>2</span> Kuule, taevas, ja maa, pane tähele, sest Issand kõneleb: Mina kasvatasin lapsi ja lasksin neil sirguda suureks, aga nemad astusid üles mu vastu.",
"3": "<span>3</span> Härg tunneb oma peremeest ja eesel oma isanda sõime, aga Iisrael ei tunne, mu rahvas ei taha mõista.",
"4": "<span>4</span> Häda patusele rahvale, süüga koormatud rahvale, kurjategijate soole, kõlvatuile lastele! Nad on jätnud maha Issanda, nad on põlanud Iisraeli Püha, nad on pööranud talle selja.",
"5": "<span>5</span> Kuhu tuleks teid veel lüüa teie tõrksuse jätkudes? Pea on üleni haige ja süda täiesti jõuetu.",
"6": "<span>6</span> Jalatallast pealaeni ei ole midagi tervet: aina vermed, muhud ja värsked haavad, mida ei ole puhastatud ega seotud ega õliga leevendatud.",
"7": "<span>7</span> Teie maa on laastatud, linnad tulega põletatud, võõrad söövad teie põllud tühjaks otse teie silme all. Kõik on laastatud otsekui segipaisatud Soodom.",
"8": "<span>8</span> Siioni tütar on jäänud üksi otsekui vahionn viinamäel, otsekui öömaja kurgipõllul, otsekui sissepiiratud linn.",
"9": "<span>9</span> Kui vägede Issand ei oleks meile jätnud pääsenuid, olgugi pisut, oleksime olnud nagu Soodom, Gomorra sarnased.",
"10": "<span>10</span> Kuulge Issanda sõna, Soodoma pealikud, pane tähele meie Jumala õpetust, Gomorra rahvas!",
"11": "<span>11</span> Milleks mulle teie tapaohvrite hulk? ütleb Issand. Ma olen küllastunud teie põletusohvrite jääradest ja nuumveiste rasvast. Härjavärsside, tallede ja sikkude veri ei meeldi mulle.",
"12": "<span>12</span> Kui te tulete vaatama mu palet, kes nõuab siis teilt mu õuede tallamist?",
"13": "<span>13</span> Ärge tooge enam tühiseid ande, ohvrisuits on mulle vastumeelt. Noorkuu ja hingamispäev, koguduse kokkukutsumine - ma ei salli nurjatust ja pühapidamist ühtaegu.",
"14": "<span>14</span> Mu hing vihkab teie noorkuid ja seatud pühi; need on mulle koormaks, ma olen tüdinud neid talumast.",
"15": "<span>15</span> Kui te käsi sirutate, peidan ma oma silmad teie eest, kui te ka palju palvetate, ei kuule ma mitte, sest teie käed on täis verd!",
"16": "<span>16</span> Peske endid, puhastage endid, saatke oma tegude kurjus mu silme eest, lakake paha tegemast!",
"17": "<span>17</span> Õppige tegema head, nõudke õigust, aidake rõhutut, mõistke vaeslapsele õigust, lahendage lesknaiste kohtuasju!",
"18": "<span>18</span> Tulge nüüd ja seletagem isekeskis, ütleb Issand. Kuigi teie patud on helepunased, saavad need lumivalgeks; kuigi need on purpurpunased, saavad need villa sarnaseks.",
"19": "<span>19</span> Kui te tahate ja kuulate, siis te saate süüa maa parimat vilja.",
"20": "<span>20</span> Aga kui te tõrgute ja panete vastu, siis sööb teid mõõk. Jah, Issanda suu on kõnelnud.",
"21": "<span>21</span> Kuidas küll sai hooraks ustav linn? Ta oli täis õigust, õiglus asus seal. Aga nüüd - tapjad!",
"22": "<span>22</span> Su hõbe on muutunud räbuks, su vein on veega lahjendatud.",
"23": "<span>23</span> Su vürstid on tõrksad ja varaste seltsimehed: igaüks armastab meelehead ja himustab kingitusi. Vaeslapsele ei tee nad õigust ja lesknaise kohtuasi ei jõua nende ette.",
"24": "<span>24</span> Seepärast ütleb Jumal, vägede Issand, Iisraeli Vägev: Ma tunnen rõõmu oma vastastest ja maksan kätte oma vaenlastele.",
"25": "<span>25</span> Ma pööran su vastu oma käe ja puhastan su räbu otsekui leelisega ning eraldan sinust kõik tina.",
"26": "<span>26</span> Siis ma annan sulle taas kohtumõistjaid nagu muistegi, ja nõuandjaid, nagu oli alguses. Seejärel hüütakse sind õigluse linnaks, ustavaks linnaks.",
"27": "<span>27</span> Siion lunastatakse kohtu ja tema pöördunud õigluse läbi.",
"28": "<span>28</span> Aga üleastujate ja patuste langus tuleb ühekorraga, ja need, kes hülgavad Issanda, hukkuvad.",
"29": "<span>29</span> Sest te peate häbenema tammede pärast, mida te ihaldasite, ja tundma piinlikkust rohuaedade pärast, mis te valisite.",
"30": "<span>30</span> Sest te saate tamme sarnaseks, mille lehed närtsivad, ja olete otsekui rohuaed, millel ei ole vett.",
"31": "<span>31</span> Tugev saab takuks ja tema tegu sädemeks: mõlemad põlevad üheskoos, aga kustutajat ei ole."
},
"2": {
"1": "<span>1</span> Kõne Jesaja, Aamotsi poja nägemusest Juuda ja Jeruusalemma kohta:",
"2": "<span>2</span> Aga viimseil päevil sünnib, et Issanda koja mägi seisab kindlana kui mägede tipp ja tõuseb kõrgemale küngastest ning kõik paganad voolavad ta juurde.",
"3": "<span>3</span> Ja paljud rahvad lähevad ning ütlevad: 'Tulge, mingem üles Issanda mäele, Jaakobi Jumala kotta, et ta meile õpetaks oma teid ja et võiksime käia tema radu: sest Siionist lähtub Seadus ja Jeruusalemmast Issanda sõna!'",
"4": "<span>4</span> Ja tema mõistab kohut paganate vahel ning juhatab paljusid rahvaid. Siis nad taovad oma mõõgad sahkadeks ja piigid sirpideks; rahvas ei tõsta mõõka rahva vastu ja nad ei õpi enam sõdimist.",
"5": "<span>5</span> Jaakobi sugu, tulge, käigem Issanda valguses!",
"6": "<span>6</span> Kuid sa oled hüljanud oma rahva, Jaakobi soo, sest nad on täis idamaa kombeid ja nõiuvad vilistite sarnaselt, nad löövad kätt võõramaa lastega.",
"7": "<span>7</span> Nende maa on täis hõbedat ja kulda, nende varandustel ei ole lõppu; nende maa on täis hobuseid ja nende sõjavankreid on otsatult.",
"8": "<span>8</span> Nende maa on täis ebajumalaid, nad kummardavad oma kätetööd, seda, mis nende sõrmed on teinud.",
"9": "<span>9</span> Aga inimene painutatakse ja mees heidetakse maha. Ära anna neile andeks!",
"10": "<span>10</span> Poe kalju sisse ja peida ennast põrmu Issanda kartuse pärast ja tema kõrge aupaistuse eest!",
"11": "<span>11</span> Inimeste suurelised silmad alandatakse ja meeste kõrkus painutatakse. Jah, sel päeval on Issand üksinda kõrge.",
"12": "<span>12</span> Sest vägede Issandal on päev: kõigi suureliste ja kõrkide jaoks, kõigi jaoks, kes kõrgele on tõusnud, et neid alandada,",
"13": "<span>13</span> kõigi Liibanoni kõrgete ja uhkete seedrite jaoks ja kõigi Baasani tammede jaoks,",
"14": "<span>14</span> kõigi kõrgete mägede jaoks ja kõigi kõrgemate küngaste jaoks,",
"15": "<span>15</span> kõigi kõrgete tornide jaoks ja kõigi tugevate müüride jaoks,",
"16": "<span>16</span> kõigi Tarsise laevade jaoks, kõigi toredate laevade jaoks.",
"17": "<span>17</span> Siis painutatakse inimeste ülbus ja alandatakse meeste kõrkus. Jah, sel päeval on Issand üksinda kõrge.",
"18": "<span>18</span> Ebajumalad aga kaovad täiesti.",
"19": "<span>19</span> Siis poetakse kaljulõhedesse ja muldkoobastesse Issanda kartuse pärast ja tema kõrge aupaistuse eest, kui ta tõuseb maad hirmutama.",
"20": "<span>20</span> Sel päeval viskavad inimesed oma hõbedased ja kuldsed ebajumalad, mis nad endile kummardamiseks on teinud, muttidele ja nahkhiirtele,",
"21": "<span>21</span> et aga saaks pugeda kaljupragudesse ja kivilõhedesse Issanda kartuse pärast ja tema kõrge aupaistuse eest, kui ta tõuseb maad hirmutama.",
"22": "<span>22</span> Seepärast lakake lootmast inimestele, kellel on ainult hingeõhk ninas, sest neid ei saa ju panna mikski!"
},
"3": {
"1": "<span>1</span> Sest vaata, Jumal, vägede Issand, võtab Jeruusalemmalt ja Juudalt toe ja toetuse, kõik leiva- ja veetoed,",
"2": "<span>2</span> sangari ja sõjamehe, kohtumõistja ja prohveti, ennustaja ja vanema,",
"3": "<span>3</span> viiekümnepealiku ja lugupeetud mehe, nõuniku, osava meistri ja lausuda oskaja.",
"4": "<span>4</span> Ja ma panen poisid neile vürstideks ning lapsed valitsevad nende üle.",
"5": "<span>5</span> Siis hakkab rahvas isekeskis rõhuma, üks ühte ja teine teist, noor tõuseb vana vastu ja vääritu auväärse vastu.",
"6": "<span>6</span> Kui vend haarab oma isakojas vennast: 'Sul on kuub, ole meile juhiks ja võta see rusuhunnik oma käe alla!',",
"7": "<span>7</span> siis tõstab too selsamal päeval häält, öeldes: 'Ei ole minust haavasidujat, mu kojas ei ole leiba ega kuube: ärge pange mind rahva juhiks!'",
"8": "<span>8</span> Sest Jeruusalemm komistab ja Juuda langeb, kuna nende keel ja teod on Issanda vastu, et trotsida Aulise silme ees.",
"9": "<span>9</span> Nende näoilme tunnistab nende endi vastu, nad kuulutavad oma pattu salgamata otsekui Soodom. Häda nende hingedele! Sest nad teevad iseendile kurja.",
"10": "<span>10</span> Öelge õigele, et tema käsi käib hästi, sest nad saavad süüa oma tegude vilja!",
"11": "<span>11</span> Häda õelale! Tema käsi käib halvasti, sest ta kätetöö tasutakse talle.",
"12": "<span>12</span> Mu rahva sundijaks on laps ja teda valitsevad naised. Mu rahvas! Su juhid on eksitajad, nad muudavad valeks su radade suuna.",
"13": "<span>13</span> Issand tõuseb nõutama õigust, ta asub kohut mõistma rahvastele.",
"14": "<span>14</span> Issand läheb kohtusse oma rahva vanemate ja vürstidega: Te olete laastanud viinamäed ja teie kodades on vaestelt röövitu.",
"15": "<span>15</span> Mida te ometi mõtlete, tallates mu rahvast ja rutjudes vaeste nägu? küsib Jumal, vägede Issand.",
"16": "<span>16</span> Ja Issand ütleb: Sellepärast et Siioni tütred on upsakad, käivad kange kaelaga ja pööritavad silmi, käies astuvad tippamisi ja kliristavad jalarõngaid,",
"17": "<span>17</span> teeb Issand Siioni tütarde pealae kärnaseks ja Issand paljastab nende häbeme.",
"18": "<span>18</span> Sel päeval võtab Issand ära toredad jalarõngad, laubaehted ja kaelakeed,",
"19": "<span>19</span> kõrvarõngad, käevõrud ja loorid,",
"20": "<span>20</span> peamähised, sammuahelakesed, rinnavööd, lõhnatoosid ja amuletid,",
"21": "<span>21</span> sõrmused ja ninarõngad,",
"22": "<span>22</span> riided, pealisrüüd, suurrätikud ja kukrud,",
"23": "<span>23</span> peeglid, särgid, peakatted ja hõlstid.",
"24": "<span>24</span> Ja siis sünnib, et palsamilõhna asemel on kõdunemise lehk, vöö asemel nöör, palmitud juuste asemel paljas pea, peene lõuendi asemel kotiriidest kate, ilu asemel põletusmärk.",
"25": "<span>25</span> Su mehed langevad mõõga läbi ja su sangarid sõjas.",
"26": "<span>26</span> Siis kurvastavad ja leinavad ta väravad, ta istub maa peal tühjaks tehtuna."
},
"4": {
"1": "<span>1</span> Sel päeval haaravad seitse naist kinni ühest mehest, öeldes: 'Me sööme omaenese leiba ja kanname omaenese riideid, kui meid ainult hüütaks sinu nime järgi. Võta ära meie teotus!'",
"2": "<span>2</span> Sel päeval on Issanda võsu iluks ja auks, ning maa vili on uhkuseks ja ehteks Iisraeli pääsenuile.",
"3": "<span>3</span> Ja kes Siionis alles jääb ning Jeruusalemmas järele jääb, seda hüütakse pühaks, igaühte, kes Jeruusalemmas on eluks kirja pandud,",
"4": "<span>4</span> siis kui Issand on ära pesnud Siioni tütarde saasta ja uhtunud Jeruusalemmast ta veresüü kohtu- ning põletusvaimuga.",
"5": "<span>5</span> Ja Issand loob kogu Siioni mäe asukoha ning sealse kogunemispaiga kohale pilve päevaks ning suitsu ja leekiva tulepaistuse ööseks, sest kõige kohale asub auhiilgus kaitsevarjuks.",
"6": "<span>6</span> Ja katus on varjuks päeva palavuse eest ja pelgupaigaks ning ulualuseks rajuilma ja vihma puhul."
},
"5": {
"1": "<span>1</span> Ma tahan nüüd laulda oma armsamast, mu armsama laulu tema viinamäest. Mu armsamal on viinamägi viljakal mäenõlvakul.",
"2": "<span>2</span> Ta kaevas ja puhastas kividest ning istutas häid viinapuid; ta ehitas selle keskele torni, ta raius sinna ka surutõrre. Siis ta ootas, et see kasvataks häid kobaraid, ent kängunud olid kobarad, mida see andis.",
"3": "<span>3</span> Ja nüüd, Jeruusalemma elanikud ja Juuda mehed, mõistke ometi kohut minu ja mu viinamäe vahel!",
"4": "<span>4</span> Kas oleks olnud vaja teha mu viinamäega veel midagi, mida olin jätnud tegemata? Miks ma ootasin, et ta kasvatab häid kobaraid, kuna ta andis kängunud kobaraid?",
"5": "<span>5</span> Aga nüüd tahan ma ometi teha teile teatavaks, mida ma teen oma viinamäega: ma kisun maha ta aia, ja ta jääb laastatavaks, ma lammutan ta müüri, ja ta jääb tallatavaks.",
"6": "<span>6</span> Nõnda ma hävitan ta. Teda ei kärbita ega rohita, ta kasvatab kibuvitsu ja ohakaid ja ma keelan pilvi temale vihma andmast.",
"7": "<span>7</span> Sest Iisraeli sugu on vägede Issanda viinamägi ja Juuda mehed tema lemmikistandik. Ta ootas õigust, aga vaata, tuli õigusetus; õiglust, aga vaata, tuli hädakisa.",
"8": "<span>8</span> Häda neile, kes reastavad koja kõrvale koja ja lisavad põllule põllu, kuni enam ei jää üle paikagi, vaid üksnes teie elate maal!",
"9": "<span>9</span> Mu kõrvus on: Vägede Issand, tõesti, paljud kojad jäävad tühjaks, suured ja kaunid elanikest lagedaks.",
"10": "<span>10</span> Sest kümme adramaad viinamäge annab ainult üheksa kannu ja viiest vakast seemnest saab pool vakka.",
"11": "<span>11</span> Häda neile, kes tõusevad hommikul vara, et jahtida vägijooki, kes viidavad aega hilja ööni, kuni vein paneb nad õhetama.",
"12": "<span>12</span> Kandled ja naablid, trummid ja viled ja vein on nende joominguil, aga Issanda tegusid nad ei märka ja tema kätetööd nad ei näe.",
"13": "<span>13</span> Sellepärast läheb mu rahvas ootamatult vangi, tema auväärsed mehed näevad nälga ja ta rahvahulgad närbuvad janust.",
"14": "<span>14</span> Sellepärast avab ennast surmavald ja ajab oma suu otsatult pärani: alla peab astuma niihästi hiilgus kui rüsin, niihästi lärm kui rõõmurõkatus.",
"15": "<span>15</span> Inimene painutatakse ja mees heidetakse maha ning suureliste silmad alandatakse.",
"16": "<span>16</span> Aga vägede Issand on kohtus kõrge ja Püha Jumal osutub pühaks õigluses.",
"17": "<span>17</span> Ja seal käivad talled karjas kui oma karjamaal ja rusude vahel söövad võõrad.",
"18": "<span>18</span> Häda neile, kes nööridega tõmbavad enese peale süüd ja otse vankriköitega pattu,",
"19": "<span>19</span> kes ütlevad: 'Tõtaku tema, tehku kiiresti, et me saaksime näha, ja liginegu ning tulgu Iisraeli Püha nõu, et me saaksime teada!'",
"20": "<span>20</span> Häda neile, kes hüüavad kurja heaks ja head kurjaks, kes teevad pimeduse valguseks ja valguse pimeduseks, kes teevad kibeda magusaks ja magusa kibedaks!",
"21": "<span>21</span> Häda neile, kes on iseenese silmis targad ja iseenese meelest arukad!",
"22": "<span>22</span> Häda neile, kes on vägevad veini jooma ja vahvad mehed vägijooki segama,",
"23": "<span>23</span> kes meelehea eest annavad õiguse süüdlastele ja võtavad õiguse õigetelt!",
"24": "<span>24</span> Sellepärast - nagu tulekeel sööb kõrsi ja kuluhein vajub kokku leegis, nõnda kõduneb nende juur ja nende õied muutuvad tolmuks, sest nad on hüljanud vägede Issanda Seaduse ja on põlanud Iisraeli Püha sõna.",
"25": "<span>25</span> Sellepärast on Issanda viha süttinud põlema oma rahva vastu: ta sirutas oma käe tema kohale ja lõi teda, nõnda et mäed vabisesid ja nende laibad olid otsekui sõnnik keset tänavaid. Selle kõige juures ei ole ta viha ära pöördunud ja ta käsi on alles välja sirutatud.",
"26": "<span>26</span> Ja ta tõstab lipu kaugele rahvale, vilistab teda maa äärest, ja vaata, see tuleb kiiresti tõtates.",
"27": "<span>27</span> Keegi neist ei ole väsinud ja keegi ei komista, ei tuku ega maga; kellelgi ei vallandu vöö vöölt ega katke jalatsipael.",
"28": "<span>28</span> Nende nooled on teritatud ja kõik nende ammud on vinnas; nende hobuste kabjad on nagu tulekivi ja nende rattad nagu tuulispea.",
"29": "<span>29</span> Nende möirgamine on otsekui emalõvi möirgamine, nad möirgavad nagu noored lõvid; nad urisevad ja haaravad saagi ning viivad oma teed, ja päästjat ei ole.",
"30": "<span>30</span> Ja sel päeval on tema kohal mürin otsekui meremüha, ja kui vaadata maale, ennäe, siis on seal ahastuse pimedus ja pilv pimendab valguse."
},
"6": {
"1": "<span>1</span> Sel aastal, kui kuningas Ussija suri, nägin ma Issandat istuvat suurel ja kõrgel aujärjel, ja tema kuue palistused ulatusid templi seinast seina.",
"2": "<span>2</span> Temast kõrgemal seisid seeravid; igaühel neist oli kuus tiiba: kahega ta kattis oma palet, kahega ta kattis oma jalgu ja kahega ta lendas.",
"3": "<span>3</span> Ja need hüüdsid üksteisele ning ütlesid: 'Püha, püha, püha on vägede Issand! Kogu maailm on täis tema au!'",
"4": "<span>4</span> Ja uksepiidad vabisesid hüüdjast häälest ning koda täitus suitsuga.",
"5": "<span>5</span> Ja ma ütlesin: 'Häda mulle, sest ma olen kadunud! Sellepärast et ma olen roojane mees huultelt ja elan roojaste huultega rahva keskel; sellepärast et mu silmad on näinud kuningat, vägede Issandat.'",
"6": "<span>6</span> Siis lendas mu juurde üks seeravitest ja tal oli käes elav süsi, mille ta oli pihtidega altarilt võtnud.",
"7": "<span>7</span> Ja ta puudutas mu suud ning ütles: 'Vaata, see puudutas sinu huuli ja su süü on lahkunud ning su patt lepitatud.'",
"8": "<span>8</span> Ja ma kuulsin Issanda häält küsivat: 'Keda ma läkitan? Kes meilt läheks?' Ja ma ütlesin: 'Vaata, siin ma olen, läkita mind!'",
"9": "<span>9</span> Ja tema ütles: 'Mine ja ütle sellele rahvale: Kuuldes kuulete ega mõista; nähes näete ega taipa!",
"10": "<span>10</span> Tee tuimaks selle rahva süda ja tee raskeks ta kõrvad ning sule ta silmad, et ta oma silmadega ei näeks ja kõrvadega ei kuuleks, oma südamega ei mõistaks ja ei pöörduks ega paraneks!'",
"11": "<span>11</span> Aga mina küsisin: 'Kui kauaks, Issand?' Ja tema vastas: 'Kuni linnad on rüüstatud, elanikest ilma, kojad inimtühjad, põllud laastatud kõrbeks",
"12": "<span>12</span> ja Issand on saatnud inimesed kaugele ning palju sööti on jäänud keset maad.",
"13": "<span>13</span> Ja kui seal veel alles jääb kümnes osa, siis seegi põletatakse ära, nagu terebint või tamm, millest langedes jääb järele känd. Aga ta känd on püha seeme.'"
},
"7": {
"1": "<span>1</span> Ja neil päevil, kui Juudas oli kuningaks Aahas, kes oli Ussija poja Jootami poeg, sündis, et Süüria kuningas Retsin ja Iisraeli kuningas Pekah, Remalja poeg, tulid sõdima Jeruusalemma vastu; aga nad ei suutnud seda vallutada.",
"2": "<span>2</span> Kui Taaveti kojale anti teada ja öeldi, et Süüria on liidus Efraimiga, siis vabises ta enese ja ta rahva süda, otsekui vabiseksid metsapuud tuule käes.",
"3": "<span>3</span> Ja Issand ütles Jesajale: 'Mine ometi Aahasele vastu, sina ja su poeg Sear-Jaasub, Ülatiigi veejuhtme otsa juurde, Vanutajavälja maanteele,",
"4": "<span>4</span> ja ütle temale: Hoia ennast ja ole rahulik, ära karda ja su süda ärgu mingu araks nende kahe suitseva tukiotsakese pärast - Süüria Retsini ja Remalja poja vihapalangu pärast!",
"5": "<span>5</span> Sellepärast et Süüria, Efraim ja Remalja poeg on pidanud sinu vastu kurja nõu, öeldes:",
"6": "<span>6</span> 'Läki üles Juuda vastu, tükeldagem see ja vallutagem endile ning tõstkem seal Taabali poeg kuningaks!' -",
"7": "<span>7</span> ütleb Issand Jumal nõnda: See ei lähe korda ega sünni!",
"8": "<span>8</span> Sest Süüria pea on Damaskus ja Damaskuse pea on Retsin. Ja veel kuuskümmend viis aastat - siis on Efraim kui rahvas purustatud.",
"9": "<span>9</span> Efraimi pea on Samaaria ja Samaaria pea on Remalja poeg. Kui te ei usu, siis te ei püsi!'",
"10": "<span>10</span> Ja Issand käskis öelda Aahasele veel seda:",
"11": "<span>11</span> 'Küsi enesele Issandalt, oma Jumalalt, tunnustäht sügavusest või kõrgusest!'",
"12": "<span>12</span> Aga Aahas vastas: 'Ma ei küsi ega kiusa Issandat!'",
"13": "<span>13</span> Siis Jesaja ütles: 'Kuulge ometi, Taaveti sugu! Ons teil veel vähe inimeste vaevamisest, et te ka mu Jumalat vaevate?",
"14": "<span>14</span> Sellepärast annab Issand ise teile tunnustähe: ennäe, neitsi jääb lapseootele ja toob poja ilmale ning paneb temale nimeks Immaanuel.",
"15": "<span>15</span> Ta sööb võid ja mett, kuni ta mõistab põlata halba ja valida head.",
"16": "<span>16</span> Sest enne kui poeglaps mõistab põlata halba ja valida head, laastatakse see maa, mille kahe kuninga ees sa tunned hirmu.",
"17": "<span>17</span> Issand laseb tulla sinule ja su rahvale ning su isa soole Assuri kuninga läbi päevi, milliseid ei ole olnud Efraimi Juudast lahkumise ajast.",
"18": "<span>18</span> Sel päeval vilistab Issand kärbseid Egiptuse jõgede lähteilt ja mesilasi Assuri maalt,",
"19": "<span>19</span> ja need kõik tulevad ning laskuvad järskudesse orgudesse ja kaljulõhedesse, kõigisse kibuvitsapõõsastesse ja kõigisse jootmispaikadesse.",
"20": "<span>20</span> Sel päeval lõikab Issand noaga, mis on palgatud teiselt poolt jõge, Assuri kuninga kaudu - teie pea- ja häbemekarvad maha ning rebib habemedki ära.",
"21": "<span>21</span> Sel päeval saab igaüks pidada ainult ühe noore lehma ja paar lammast,",
"22": "<span>22</span> ja nende piimaanni rohkuse tõttu on süüa võid, sest võid ja mett söövad kõik, kes maale alles jäävad.",
"23": "<span>23</span> Sel päeval jääb iga paik, kus oli tuhat viinapuud, tuhat hõbeseeklit väärt, kibuvitstele ja ohakaile.",
"24": "<span>24</span> Sinna minnakse noolte ja ambudega, sest kogu maa on täis kibuvitsu ja ohakaid.",
"25": "<span>25</span> Ja mitte ühelegi mäele, mida nüüd kõplaga rohitakse, ei minda enam kibuvitste ja ohakate kartuse pärast: need jäävad härgade uitepaigaks ja lammaste tallermaaks.'"
},
"8": {
"1": "<span>1</span> Ja Issand ütles mulle: 'Võta enesele suur tahvel ja kirjuta selle peale tavalise krihvliga: Maher-Saalal, Haas-Bas!",
"2": "<span>2</span> Ja ma võtan endale usaldusväärsed tunnistajad, preester Uurija ja Jeberekja poja Sakarja.'",
"3": "<span>3</span> Siis ma läksin prohveti naise juurde, ja tema jäi lapseootele ning tõi poja ilmale. Ja Issand ütles mulle: 'Pane temale nimeks Maher-Saalal, Haas-Bas!",
"4": "<span>4</span> Sest enne kui poiss oskab hüüda isa ja ema, viiakse Damaskuse varandus ja Samaaria saak Assuri kuninga ette.'",
"5": "<span>5</span> Ja Issand rääkis minuga veelgi, öeldes:",
"6": "<span>6</span> 'Sellepärast et see rahvas põlgab Siiloahi hiljukesi voolavaid vesi ning pelgab Retsinit ja Remalja poega,",
"7": "<span>7</span> vaata, sellepärast lasebki Issand tulla nende peale Frati jõe võimsad ja suured veed - Assuri kuninga ja kogu ta hiilguse -, mis tõuseb välja kõigist lammidest ja voolab üle kõigist kallastest,",
"8": "<span>8</span> tungib Juudasse, tulvab ja ujutab üle, kuni see ulatub kaelani. Ja tema tiibade sirutus täidab su maa kogu selle laiuses, Immaanuel.'",
"9": "<span>9</span> Möllake, rahvad, ja värisege, ja kuulge, kõik kauged maad: Varustuge sõjaks ja värisege! Varustuge sõjaks ja värisege!",
"10": "<span>10</span> Pidage nõu, aga see läheb tühja, kõnelge sõna, aga see ei täitu, sest Jumal on meiega!",
"11": "<span>11</span> Sest nõnda rääkis minuga Issand, kui ta käsi haaras mind ja hoiatas mind käimast selle rahva teed, öeldes:",
"12": "<span>12</span> 'Ärge nimetage vandenõuks kõike, mida see rahvas nimetab vandenõuks, ärge kartke, mida tema kardab, ja ärge tundke hirmu!",
"13": "<span>13</span> Pidage pühaks vägede Issandat, tema olgu teie kartus ja tema olgu teie hirm!",
"14": "<span>14</span> Tema on pühamuks, aga ka komistuskiviks ja pahanduskaljuks mõlemale Iisraeli kojale, lõksuks ja püüdepaelaks Jeruusalemma elanikele.",
"15": "<span>15</span> Paljud neist komistavad, kukuvad ja vigastavad endid, püütakse kinni ja võetakse vangi.",
"16": "<span>16</span> Seo kinni tunnistus, sulge pitseriga õpetus mu õpilastes!'",
"17": "<span>17</span> Mina aga ootan Issandat, kes peidab oma palge Jaakobi soo eest, ja loodan tema peale.",
"18": "<span>18</span> Vaata, mina ja lapsed, keda Issand mulle on andnud, oleme tunnustähtedeks ja endemärkideks Iisraelis vägede Issandalt, kes elab Siioni mäel.",
"19": "<span>19</span> Ja kui teile öeldakse: Küsitlege surnute vaime ja ennustajaid, kes sosistavad ja pomisevad, siis vastake: Kas rahvas ei peaks küsitlema oma Jumalat? Kas tuleb elavate pärast küsitleda surnuid?",
"20": "<span>20</span> Õpetuse ja tunnistuse juurde! Kui nõnda ei kõnelda, siis ei ole koitu.",
"21": "<span>21</span> Seal nad siis uitavad, vaevatud ja näljased. Aga nälga tundes nad vihastavad ja neavad oma kuningat ja Jumalat. Ja kui nad tõstavad pilgu üles",
"22": "<span>22</span> või vaatavad maha, siis - näe, on kitsikus ja pimedus, ahistuse süngus. Ollakse tõugatud pilkasesse pimedusse.",
"23": "<span>23</span> Aga ei jää pimedusse maa, kus on ahastus. Otsekui Jumal endisel ajal põlgas Sebulonimaad ja Naftalimaad, nõnda austab ta tulevikus mereäärset teed, Jordani-tagust maad, paganate Galilead."
},
"9": {
"1": "<span>1</span> Rahvas, kes käib pimeduses, näeb suurt valgust; kes elavad surmavarju maal, neile paistab valgus.",
"2": "<span>2</span> Sina teed rohkeks rahva, ja valmistad talle suure rõõmu: nad rõõmustavad sinu ees otsekui lõikusajal ollakse rõõmsad, otsekui saaki jagades hõisatakse.",
"3": "<span>3</span> Sest tema koorma ikke ja tema õla kepi, tema sundija vitsa sa murrad nagu Midjani päevil.",
"4": "<span>4</span> Sest iga sõjakäras sõtkutud saabas ja veres vettinud vammus põletatakse tuleroaks.",
"5": "<span>5</span> Sest meile sünnib laps, meile antakse poeg, kelle õlgadel on valitsus ja kellele pannakse nimeks Imeline Nõuandja, Vägev Jumal, Igavene Isa, Rahuvürst.",
"6": "<span>6</span> Suur on valitsus ja otsatu on rahu Taaveti aujärjel ja tema kuningriigi üle, et seda kinnitada ja toetada kohtu ja õigusega, sellest ajast ja igavesti. Vägede Issanda püha viha teeb seda.",
"7": "<span>7</span> Issand läkitab sõna Jaakobisse ja see langeb Iisraeli peale.",
"8": "<span>8</span> Seda saab tunda kogu rahvas, Efraim ja Samaaria elanikud, kes ütlevad upsakusest ja südame ülbusest:",
"9": "<span>9</span> 'Telliskivid on varisenud, aga meie ehitame tahutud kividest; metsviigipuud on maha raiutud, aga me paneme seedrid asemele.'",
"10": "<span>10</span> Ent Issand teeb tugevaks Retsini, ta vastase, ja kihutab üles ta vaenlased:",
"11": "<span>11</span> süürlased idast ja vilistid läänest, ja need söövad Iisraeli täie suuga. Selle kõige juures ei ole ta viha veel ära pöördunud ja ta käsi on alles välja sirutatud.",
"12": "<span>12</span> Sest rahvas ei ole pöördunud oma peksja poole ega ole nad otsinud vägede Issandat.",
"13": "<span>13</span> Seepärast lõikab Issand Iisraelilt ühel päeval pea ja saba, võrse ja varre.",
"14": "<span>14</span> Vana ja austatu on pea, aga valet õpetav prohvet on saba.",
"15": "<span>15</span> Selle rahva juhid on eksitajad ja nende poolt juhitavad on viidud segadusse.",
"16": "<span>16</span> Seepärast ei tunne Issand rõõmu ta noortest meestest ega halasta vaeslaste ja lesknaiste peale; sest kõik on jumalavallatud ja kurjategijad ja iga suu räägib jõledust. Selle kõige juures ei ole ta viha veel ära pöördunud ja ta käsi on alles välja sirutatud.",
"17": "<span>17</span> Sest ülekohus põleb otsekui tuli, mis põletab kibuvitsu ja ohakaid ning süütab metsarägastikud kerkiva suitsuna haihtuma.",
"18": "<span>18</span> Vägede Issanda raevust on maa kõrbenud ja rahvas on otsekui tuleroog: üks ei halasta teise peale.",
"19": "<span>19</span> Ahmivad paremalt, aga on näljased, söövad vasakult, ometi ei saa kõht täis. Igaüks sööb oma käsivarre liha:",
"20": "<span>20</span> Manasse Efraimi ja Efraim Manasset, mõlemad on üheskoos Juuda vastu. Selle kõige juures ei ole ta viha veel ära pöördunud ja ta käsi on alles välja sirutatud."
},
"10": {
"1": "<span>1</span> Häda neile, kes annavad nurjatuid seadusi, ja kirjutajaile, kes kirjutavad vääri otsuseid,",
"2": "<span>2</span> et väänata abitute õigust ja kiskuda kohus mu rahva viletsailt, et lesknaised saaksid neile saagiks ja et nad võiksid vaeslapsi paljaks riisuda!",
"3": "<span>3</span> Aga mida te teete katsumispäeval ja tormis, mis tuleb kaugelt? Kelle juurde te põgenete abi saama? Ja kuhu jätate oma varanduse?",
"4": "<span>4</span> Ei ole muud kui põlvitada vangide seltsi või langeda tapetute sekka. Selle kõige juures ei ole ta viha veel ära pöördunud ja ta käsi on alles välja sirutatud.",
"5": "<span>5</span> Häda Assurile, kes on mu viha vits ja kelle käes on mu sajatuse kepp!",
"6": "<span>6</span> Tema ma läkitan jumalavallatu rahva vastu ja teda ma käsin oma vihaaluse rahva pärast võtta noosi ja riisuda saaki ja tallata teda nagu tänavapori.",
"7": "<span>7</span> Aga tema ei kavatse nõnda ja nõnda ei mõtle ta süda, vaid temal on südames hävitada ja hukata rahvaid, ja mitte väheseid,",
"8": "<span>8</span> sest ta ütleb: 'Kas pole mu pealikud kõik kuningad?",
"9": "<span>9</span> Eks Kalnol käinud käsi nagu Karkemisel, eks Hamatil nagu Arpadil, eks Samaarial nagu Damaskusel?",
"10": "<span>10</span> Kuna mu käsi ulatus ebajumalate kuningriikideni, kus nikerdatud kujusid oli rohkem kui Jeruusalemmal ja Samaarial,",
"11": "<span>11</span> eks ma või siis talitada ka Jeruusalemma ja selle kujudega nõnda, nagu ma talitasin Samaaria ja selle ebajumalatega?'",
"12": "<span>12</span> Aga kui Issand on lõpetanud kõik oma töö Siioni mäel ja Jeruusalemmas, siis ta nuhtleb Assuri kuningat ta südame ülbuse vilja ja ta suureliste silmade kõrkuse pärast.",
"13": "<span>13</span> Sest too ütleb: 'Ma tegin seda oma käe rammuga ja oma tarkusest, sest ma olen taibukas. Ma nihutasin rahvaste piire, riisusin, mis kuulus neile. Oma vägevuses tõukasin ma valitsejaid troonilt.",
"14": "<span>14</span> Mu käsi leidis rahvaste vara otsekui linnupesa; ja nagu korjatakse mahajäetud mune, nõnda ma korjasin ära kõik maad, ja ei olnud kedagi, kes oleks lehvitanud tiibu või teinud noka lahti ja piiksatanud.'",
"15": "<span>15</span> Kas kiitleb kirves selle ees, kes temaga raiub, või suurustab saag saagija ees? Nagu viibutaks vits oma ülestõstjat, või nagu kergitaks kepp seda, kes ei ole puu.",
"16": "<span>16</span> Sellepärast läkitab Jumal, vägede Issand, tema priskete sekka kõhetustõve, ja tema toreduse all lahvatab tuli.",
"17": "<span>17</span> Iisraeli valgus muutub tuleks ja tema Püha leegiks, mis ühel päeval põletab ja neelab ta ohakad ja kibuvitsad.",
"18": "<span>18</span> Ja ta lõpetab tema metsa ja viljapuuaia toreduse koos ihu ja hingega. See on otsekui põdeja kidunemine.",
"19": "<span>19</span> Vähe jääb siis üle ta metsapuudest: poisike võib need kirja panna.",
"20": "<span>20</span> Ja sel päeval sünnib, et Iisraeli jääk ja Jaakobi soo pääsenu ei toetu enam oma peksjale, vaid toetub ustavalt Issandale, Iisraeli Pühale.",
"21": "<span>21</span> Jääk pöördub, Jaakobi jääk, vägeva Jumala poole.",
"22": "<span>22</span> Sest kuigi su rahvast, Iisrael, oleks otsekui mereliiva, pöördub sellest ainult jääk. Hävitus on otsustatud, õiglus ujutab üle.",
"23": "<span>23</span> Sest hävituse ja otsuse teeb Jumal, vägede Issand, teoks kogu maal.",
"24": "<span>24</span> Seepärast ütleb Jumal, vägede Issand, nõnda: Mu rahvas, kes sa elad Siionis, ära karda Assurit, kui ta peksab vitsaga ja Egiptuse kombel tõstab su kohale oma kepi!",
"25": "<span>25</span> Sest veel pisut-pisut, siis on mu sajatusel lõpp ja mu viha pöördub neid hävitama.",
"26": "<span>26</span> Siis keerutab vägede Issand ta kohal piitsa otsekui Midjani löömisel Oorebi kaljul, ja oma kepi, mis kord oli mere kohal, tõstab ta üles nagu tol korral Egiptuses.",
"27": "<span>27</span> Ja sel päeval sünnib, et tema koorem võetakse su õlgadelt ja tema ike su kaela pealt. Ta tuleb üles Samaariast,",
"28": "<span>28</span> tungib Ajjatisse, läbib Migroni, Mikmassi ta jätab oma varustuse.",
"29": "<span>29</span> Nad läbivad kuru: 'Gebas on meie öömaja!' Raama väriseb, Sauli Gibea põgeneb.",
"30": "<span>30</span> Hüüa kilavalt, Gallimi tütar! Kuulata, Laisa! Vasta, Anatot!",
"31": "<span>31</span> Madmena põgeneb, Geebimi elanikud poevad peitu.",
"32": "<span>32</span> Juba täna peatub ta Noobis, viibutab kätt Siioni tütre mäe, Jeruusalemma künka poole.",
"33": "<span>33</span> Vaata, Jumal, vägede Issand, laasib oksad vägeval jõul. Kõrgeks kasvanud raiutakse maha: kõrged peavad saama madalaks!",
"34": "<span>34</span> Metsarägastik laastatakse raudkirvega ja Liibanon langeb vägeva läbi."
},
"11": {
"1": "<span>1</span> Aga Iisai kännust tõuseb võrse ja võsu tema juurtest kannab vilja.",
"2": "<span>2</span> Ja tema peal hingab Issanda Vaim, tarkuse ja arukuse Vaim, nõu ja väe Vaim, Issanda tundmise ja kartuse Vaim.",
"3": "<span>3</span> Tema õndsus on Issanda kartuses. Ei ta mõista kohut oma silma nägemise ega otsusta oma kõrva kuulmise järgi,",
"4": "<span>4</span> vaid ta mõistab viletsaile kohut õiguses ja otsustab hädaliste asju maa peal õigluses; ta lööb oma suu vitsaga maad ja surmab oma huulte puhanguga õela.",
"5": "<span>5</span> Õigus on kui vöö tema niudeil ja ustavus kui rihm ta puusadel.",
"6": "<span>6</span> Siis elab hunt tallega üheskoos ja panter lesib kitsekese kõrval; vasikas, noor lõvi ja nuumveis on üheskoos ning pisike poiss ajab neid.",
"7": "<span>7</span> Lehm ja karu käivad karjamaal, nende pojad lesivad üheskoos, ja lõvi sööb õlgi nagu veis.",
"8": "<span>8</span> Imik mängib rästiku uru juures ja võõrutatu sirutab käe mürkmao koopasse.",
"9": "<span>9</span> Ei tehta paha ega kahju kogu mu pühal mäel, sest maa on täis Issanda tundmist - otsekui veed katavad merepõhja.",
"10": "<span>10</span> Sel päeval sünnib, et Iisai juurt, kes seisab rahvaile lipuks, otsivad paganad ja tema asupaik saab auliseks.",
"11": "<span>11</span> Ja sel päeval sirutab Issand veel teist korda käe, et lunastada oma rahva jääki, kes on järele jäänud Assurist ja Egiptusest, Patrosest, Etioopiast, Eelamist, Sinearist, Hamatist ja mere saartelt.",
"12": "<span>12</span> Ta tõstab rahvastele lipu, kogub Iisraeli hajutatud ja korjab kokku Juuda pillutatud neljast maailmakaarest.",
"13": "<span>13</span> Siis lakkab Efraimi kadestamine ja hävitatakse Juuda rõhujad. Efraim ei kadesta Juudat ja Juuda ei rõhu Efraimi.",
"14": "<span>14</span> Nad tormavad siis vilistite maale läände, nad riisuvad üheskoos idamaa poegi. Edom ja Moab on neile käealuseks, ammonlased on nende alamad.",
"15": "<span>15</span> Ja Issand lõhestab Egiptuse merelahe ning viipab käega, oma tugeva tuulega, üle Frati jõe ja lööb selle seitsmeks ojaks, et kuivijalu saab läbi minna.",
"16": "<span>16</span> Siis on maantee tema rahva jäägile, kes Assurist alles jääb, otsekui Iisraelil oli ta Egiptusemaalt tuleku päeval."
},
"12": {
"1": "<span>1</span> Sel päeval sa ütled: 'Ma tänan sind, Issand! Sa olid küll vihane minule, aga su viha pöördus ja sa trööstisid mind.",
"2": "<span>2</span> Vaata, Jumal on mu pääste! Ma olen julge ega karda, sest Issand Jumal on mu tugevus ja kiituslaul, ja tema oli mu päästja.'",
"3": "<span>3</span> Te ammutate rõõmuga vett päästeallikaist.",
"4": "<span>4</span> Ja sel päeval te ütlete: 'Tänage Issandat, kuulutage tema nime, tehke teatavaks rahvaste seas tema teod, tunnistage, et tema nimi on kõrge!",
"5": "<span>5</span> Ülistage Issandat, sest tema on teinud suuri asju, saagu see teatavaks kogu maal!",
"6": "<span>6</span> Hõiska ja rõkata rõõmust, Siioni elanik, sest Iisraeli Püha on teie keskel suur!'"
},
"13": {
"1": "<span>1</span> Ennustus Paabeli kohta, Jesaja, Aamotsi poja poolt nähtud:",
"2": "<span>2</span> Tõstke lipp lagedale mäele, hüüdke neile valjusti, viibake käega, et nad läheksid sisse suurte isandate väravaist!",
"3": "<span>3</span> Ma olen andnud käsu oma pühitsetuile, olen juba oma vihale appi kutsunud sangarid, kes võivad suurustada minu suurusest.",
"4": "<span>4</span> Kuule! Mägedes on mürin, rahvahulkade kõmin. Kuule! Kuningriikide, kogunenud paganate lärm. Vägede Issand vaatab üle sõjaväge.",
"5": "<span>5</span> Nad tulevad kaugelt maalt, taevarannalt, Issand ja tema sajatuse relvad, hävitama kogu maad.",
"6": "<span>6</span> Ulguge, sest Issanda päev on ligidal, see tuleb kui hävitus Kõigeväeliselt!",
"7": "<span>7</span> Seepärast lõtvuvad kõik käed ja kõik inimsüdamed löövad araks.",
"8": "<span>8</span> Nad kohkuvad. Vaevused ja valud haaravad neid, nad vaevlevad otsekui sünnitaja. Üks vaatab teisele jahmunult otsa, nende palged on tulipunased.",
"9": "<span>9</span> Vaata, Issanda päev tuleb hirmsana, raevu ja tulise vihaga, et tühjendada maa ja hävitada sealt patused.",
"10": "<span>10</span> Sest taevatähed, nende hulgas Vardatähed, ei kiirga enam valgust, päike on tõustes pime ja kuu ei anna oma valget.",
"11": "<span>11</span> Mina tasun ilmamaale ta kurjuse ja õelatele nende süü, mina lõpetan ülbete kõrkuse ja alandan võimutsejate upsakuse.",
"12": "<span>12</span> Mina teen inimesed kallimaks puhtast kullast, inimlapse kallimaks Oofiri kullast.",
"13": "<span>13</span> Seepärast ma panen taevad vankuma ja maa vappub paigast vägede Issanda raevus tema tulise viha päeval.",
"14": "<span>14</span> Ja otsekui peletatud gasell või kari, keda keegi ei aja kokku, pöördub igaüks oma rahva juurde ja põgeneb igaüks oma maale.",
"15": "<span>15</span> Kõik, keda leitakse, torgatakse läbi, ja iga põgenik langeb mõõga ees.",
"16": "<span>16</span> Nende lapsed rebitakse tükkideks nende eneste nähes, nende kojad rüüstatakse, nende naised teotatakse.",
"17": "<span>17</span> Vaata, ma kihutan nende vastu meedlased, kes ei hooli hõbedast ega himusta kulda.",
"18": "<span>18</span> Nende ammud purustavad poisse, neil ei ole halastust ihuvilja vastu, laste pärast nende silm ei kurvasta.",
"19": "<span>19</span> Ja Paabel, kuningriikide ehe, kaldealaste kõrk toredus, saab Soodoma ja Gomorra sarnaseks, mis Jumal segi paiskas.",
"20": "<span>20</span> Seda ei asustata enam iialgi ega elata seal põlvest põlve; ei löö sinna araablane telki üles ega puhka seal karjased karja.",
"21": "<span>21</span> Vaid seal lebavad kurjad vaimud ja nende kojad on täis öökulle; seal asuvad jaanalinnud ja karglevad sikujalgsed paharetid.",
"22": "<span>22</span> Ta tornides uluvad kurjad vaimud ja lusthooneis ðaakalid. Tema aeg on liginemas ja tema päevi ei pikendata."
},
"14": {
"1": "<span>1</span> Issand halastab Jaakobi peale, valib taas Iisraeli ja asustab nad nende oma maale; võõradki seltsivad nendega ja liituvad Jaakobi sooga.",
"2": "<span>2</span> Ja rahvad võtavad nad ning toovad nad nende pärispaika; aga Iisraeli sugu teeb nad Issanda pinnal enesele sulaseiks ja teenijaiks: nad võtavad vangi oma vangistajad ja valitsevad oma rõhujate üle.",
"3": "<span>3</span> Ja sel päeval, kui Issand annab sulle rahu vaevast ja ahistusest ning raskest tööst, mida sa pidid tegema,",
"4": "<span>4</span> hakkad sa laulma seda pilkelaulu Paabeli kuningast ja ütled: Kuidas on siis nüüd kallaletung lakanud, rõhumisele lõpp tulnud?",
"5": "<span>5</span> Issand on katki murdnud õelate kepi, võimutsejate vitsa,",
"6": "<span>6</span> mis lõi rahvaid raevus lõppemata löökidega, mis rahvusi valitses vihas lakkamatu jälitusega.",
"7": "<span>7</span> Kogu maa tõmbab hinge, puhkab, nad rõkatavad rõõmust.",
"8": "<span>8</span> Sinust tunnevad rõõmu ka küpressid ja Liibanoni seedrid: 'Sest ajast, kui sa lamad maas, ei tule keegi meid raiuma!'",
"9": "<span>9</span> Surmavald all on liikvel sinu pärast, et võtta vastu su tulekut: ta äratab sinu pärast surnute vaimud, kõik maa juhid, laseb nende aujärgedelt tõusta kõik rahvaste kuningad.",
"10": "<span>10</span> Need kõik kostavad ja ütlevad sulle: 'Sinagi oled jäänud jõuetuks nagu meie, oled saanud meie sarnaseks!'",
"11": "<span>11</span> Alla surmavalda on tõugatud su kõrkus, su naablite helinad; su alla on laotatud ussikesi ja sind katavad vaglad.",
"12": "<span>12</span> Kuidas sa ometi oled alla langenud taevast, helkjas hommikutäht, koidiku poeg, tükkidena paisatud maha, rahvaste alistaja?",
"13": "<span>13</span> Sina ütlesid oma südames: 'Mina tõusen taevasse, kõrgemale kui Jumala tähed tõstan ma oma aujärje ja istun kogunemismäele kaugel põhjamaal.",
"14": "<span>14</span> Ma lähen üles pilvede kõrgustikele, ma teen ennast Kõigekõrgema sarnaseks.'",
"15": "<span>15</span> Aga sind tõugati alla surmavalda, kõige sügavamasse hauda.",
"16": "<span>16</span> Kes sind nägid, silmitsevad sind, vaatavad sind üksisilmi: 'Kas see on mees, kes pani maa värisema, kuningriigid vabisema,",
"17": "<span>17</span> kes tegi ilmamaa kõrbe sarnaseks ja kiskus maha selle linnad, kes ei lasknud oma vange koju?'",
"18": "<span>18</span> Kõik rahvaste kuningad magavad auga, igaüks oma hauakambris,",
"19": "<span>19</span> sina aga oled nagu põlatud oks, eemale heidetud oma hauast, kaetud tapetutega, mõõgaga läbipistetutega, kes paisatakse alla kivimurdu purukstallatud laibana.",
"20": "<span>20</span> Sina ei ühine nendega hauas, sest sa oled hävitanud oma maa, tapnud oma rahva. Iialgi enam ei nimetata kurjategijate sugu.",
"21": "<span>21</span> Valmistage tema laste jaoks tapapink nende vanemate süü pärast, et nad ei tõuseks ega vallutaks maad ega täidaks ilmamaad linnadega.",
"22": "<span>22</span> Mina tõusen nende vastu, ütleb vägede Issand, ja ma kaotan Paabeli nime ja jäägi, järglased ja järelkasvu, ütleb Issand.",
"23": "<span>23</span> Ma teen ta siilide omandiks ja roolaugasteks, ja ma pühin ta ära hävitusluuaga, ütleb vägede Issand.",
"24": "<span>24</span> Vägede Issand on vandunud, öeldes: Tõesti, nagu ma olen mõelnud, nõnda sünnib, ja see, mida ma olen kavatsenud, läheb korda:",
"25": "<span>25</span> ma murran Assuri oma maal ja tallan teda oma mägedel; siis on nad tema ikkest lahti ja tema koorem võetakse nende õlgadelt.",
"26": "<span>26</span> See on nõu, peetud kogu maa kohta, ja see on käsi, sirutatud kõigi rahvaste kohale.",
"27": "<span>27</span> Sest vägede Issand on võtnud nõuks, kes teeb selle tühjaks? Tema käsi on välja sirutatud, kes pöörab selle tagasi?",
"28": "<span>28</span> Kuningas Aahase surma-aastal sündis see ennustus:",
"29": "<span>29</span> Ära rõõmusta, sina Vilistimaa, et murtud on vits, mis sind lõi! Sest mao juure seest tuleb välja rästik ja tema vili on lendav madu.",
"30": "<span>30</span> Siis karjatatakse viletsate esmikuid ja vaesed magavad muretult; aga sinu juure ma suretan näljaga ja su jääk tapetakse.",
"31": "<span>31</span> Ulu, värav, kisenda, linn! Vabise, kogu Vilistimaa, sest põhja poolt tuleb suits ja keegi tema väehulkades ei jää teistest maha.",
"32": "<span>32</span> Ja mida vastata paganate saadikuile? Seda, et Issand on rajanud Siioni ja seal leiavad varju tema rahva vaevatud."
},
"15": {
"1": "<span>1</span> Ennustus Moabi kohta: Tõesti, ühel ööl on Moabi Aar hävitatud, vaikima pandud. Tõesti, ühel ööl on Moabi Kiir hävitatud, vaikima pandud.",
"2": "<span>2</span> Ka Diibon läheb üles templisse, ohvriküngastele nutma, Nebol ja Meedebal ulub Moab. Kõigil on pead pöetud ja kõik habemed on ära aetud.",
"3": "<span>3</span> Tänavail pannakse kotiriie selga, katustel ja turgudel uluvad kõik, upuvad pisaraisse.",
"4": "<span>4</span> Hesbon ja Elaale kisendavad appi, Jahaseni kostab nende hääl; seepärast lõdisevad Moabi niuded, väriseb ta hing.",
"5": "<span>5</span> Mu süda kisendab Moabi pärast. Ta põgenikud põgenevad Soarini, Eglat-Selisijani. Jah, mööda Luuhiti tõusuteed minnakse nuttes üles, jah, Hooronaimi teel tõstetakse hädakisa hävingu pärast.",
"6": "<span>6</span> Sest Nimrimi veed muutuvad kõrbeks; jah, rohi kuivab, taimkate kaob, haljust ei ole enam.",
"7": "<span>7</span> Seepärast nad viivad oma kogutud vara ja nende poolt tallelepandu üle Remmelgajõe.",
"8": "<span>8</span> Jah, appihüüd kajab Moabimaal; ta hädakisa kostab Eglaimini, ta hädakisa kostab Beer-Eelimini.",
"9": "<span>9</span> Jah, Diimoni veed on täis verd. Aga veel muudki ma saadan Diimonile: lõvi Moabi pääsenute ja maale jäänute kallale."
},
"16": {
"1": "<span>1</span> Lähetage maavalitseja jäärad Selast kõrbe kaudu Siioni tütre mäele!",
"2": "<span>2</span> Nagu põgenevad linnud, peletatud pesakond, on Moabi tütred Arnoni koolmeil.",
"3": "<span>3</span> Anna nõu, tee otsus! Las olla su vari otsekui öö keskpäeval. Varja väljaaetuid, ära reeda põgenikku!",
"4": "<span>4</span> Anna enese juures asu Moabi pillutatuile, ole neile pelgupaigaks hävitaja ees! Kui rõhujal on lõpp, hävitus lakkab, tallajad kaovad maalt,",
"5": "<span>5</span> siis rajatakse armastuses aujärg ja sellel istub Taaveti telgis kindlalt kohtumõistja, kes nõuab õigust ja on osav õigluses.",
"6": "<span>6</span> Me oleme kuulnud Moabi kõrkusest - ta on väga ülbe; tema upsakusest ja uhkustamisest ning tema tühist hooplemist.",
"7": "<span>7</span> Seepärast ulub moab moabi pärast, kõik uluvad. Te leinate Kiir-Hareseti rosinakakkude pärast täiesti lööduina.",
"8": "<span>8</span> Sest rüüstatud on Hesbon, kolletanud Sibma viinapuud, rahvaste isandad on peksnud maha nende vääriskobarad. Need ulatusid Jaaserini, laiusid kõrbes, nende väädid lokkasid, tungisid üle mere.",
"9": "<span>9</span> Seepärast ma nutan koos Jaaseri nutuga Sibma viinapuude pärast; ma kastan sind oma silmaveega, Hesbon ja Elaale. Sest sinu suve ja lõikuse kohal on kõlanud vaenuhüüd.",
"10": "<span>10</span> Rõõm ja ilutsemine on võetud viljapuuaiast ja viinamägedes ei ole hõiskamist ega rõõmuhüüdeid. Veini surutõrtes ei sõtku tallaja, tööhõiked ma lõpetasin.",
"11": "<span>11</span> Seetõttu kaebleb mu hing otsekui kannel Moabi pärast, ja mu süda Kiir-Hareseti pärast.",
"12": "<span>12</span> Ja kui nüüd Moab ennast näitab, kui ta ennast ohvrikünkal väsitab ja läheb oma pühamusse palvetama, siis ta ei suuda midagi.",
"13": "<span>13</span> See on sõna, mis Issand Moabi kohta varem oli öelnud.",
"14": "<span>14</span> Aga nüüd kõneleb Issand ning ütleb: 'Kolme aasta pärast, palgalise aastate sarnaselt, muutub Moabi hiilgus koos kogu tema suure hulgaga väärtusetuks, ja jääk on pisike, tähtsusetu ja jõuetu.'"
},
"17": {
"1": "<span>1</span> Ennustus Damaskuse kohta: Vaata, Damaskus lakkab olemast linn ja muutub varemeks.",
"2": "<span>2</span> Aroeri linnad jäetakse maha, jäävad karjadele, kes seal lebavad, ilma et ükski neid peletaks.",
"3": "<span>3</span> Efraimist kaob kindel linn ja Damaskusest kuningriik; ja Süüria jäägiga sünnib nagu Iisraeli laste hiilgusegagi, ütleb vägede Issand.",
"4": "<span>4</span> Sel päeval jääb väikseks Jaakobi hiilgus ja lahjub tema ihu lihavus,",
"5": "<span>5</span> otsekui lõikaja lõikaks kasvavat vilja ja tema käsivars koristaks viljapäid, otsekui nopitaks viljapäid Refaimi orus.",
"6": "<span>6</span> Jääb ainult järelkoristus, otsekui õlipuud raputades: kaks, kolm marja ülal ladvas, neli, viis viljapuu okstel, ütleb Issand, Iisraeli Jumal.",
"7": "<span>7</span> Sel päeval vaatab inimene oma Looja peale ja ta silmad näevad Iisraeli Püha.",
"8": "<span>8</span> Ta ei vaata altareile, oma kätetööle, ega näe seda, mis ta sõrmed on teinud, ei viljakustulpi ega suitsutusaltareid.",
"9": "<span>9</span> Sel päeval on tema tugevad linnad otsekui mahajäetud metsad ja mäetipud, mis Iisraeli laste pärast maha jäeti, ja tühjus võtab maad.",
"10": "<span>10</span> Sest sa unustasid oma Pääste-Jumala ega tuletanud meelde oma kindlat kaljut. Seepärast sa siis istutad Adonise aedu ja juurutad võõraid pistikuid.",
"11": "<span>11</span> Istutamispäeval sa paned nad kasvama ja viid hommikuks oma külvi õitsema, kuid lõikus kaob tõve ja vaigistamatu valu päeval.",
"12": "<span>12</span> Häda! Paljude rahvaste möll. Need mühavad, otsekui mühaks meri. Rahvahõimude märatsus. Need kohavad, otsekui kohaksid võimsad veed.",
"13": "<span>13</span> Rahvahõimud kohavad, otsekui kohaksid suured veed. Aga tema sõitleb neid ja nad põgenevad kaugele ning neid aetakse taga, otsekui tuul puhub mägedel aganaid, otsekui torm keerutab tolmu.",
"14": "<span>14</span> Õhtul, vaata, on kabuhirm, hommiku tulles ei ole neid enam. See on meie rüüstajate osa ja meie riisujate liisk."
},
"18": {
"1": "<span>1</span> Häda tiivuliste ritsikate maale, mis on teisel pool Etioopia jõgesid,",
"2": "<span>2</span> kes läkitab saadikuid merele, pilliroopaatides üle vee. Minge, kiired käskjalad, pikakasvulise ja siledanahkse rahva juurde, rahva juurde, keda kardetakse ligidal ja kaugel, rahvas, kes on vägev ja vallutaja, kelle maad jõed uhuvad.",
"3": "<span>3</span> Kõik ilmamaa elanikud ja maa asustajad, vaadake, millal lipp tõstetakse mägedele, ja kuulge, kui puhutakse sarve.",
"4": "<span>4</span> Sest Issand on mulle öelnud nõnda: 'Mina olen vagusi ja vaatlen oma asupaigast otsekui kuumavirvendus päikesepaistel, otsekui kastepilv lõikusaja palavuses.'",
"5": "<span>5</span> Sest enne lõikust, kui õitsemine on lõppenud ja õied on valminud küpsevaiks marjadeks, lõigatakse sirpidega väädid ja kõrvaldatakse kitkudes lokkavad kasvud.",
"6": "<span>6</span> Need jäetakse üheskoos maha mägede röövlindudele ja maa loomadele; suviti on nende peal röövlinnud ja talviti kõik maa loomad.",
"7": "<span>7</span> Sel ajal tuuakse ande vägede Issandale pikakasvulise ja siledanahkse rahva poolt, rahva poolt, keda kardetakse ligidal ja kaugel, rahvas, kes on vägev ja vallutaja, kelle maad jõed uhuvad - vägede Issanda nime asupaika Siioni mäel."
},
"19": {
"1": "<span>1</span> Ennustus Egiptuse kohta: Vaata, Issand sõidab nobedal pilvel ja tuleb Egiptusesse. Siis vabisevad tema ees Egiptuse ebajumalad ja egiptlaste süda lööb araks.",
"2": "<span>2</span> Mina kihutan egiptlased egiptlaste vastu ja nad sõdivad isekeskis, sõber sõbra vastu, linn linna vastu, kuningriik kuningriigi vastu.",
"3": "<span>3</span> Egiptuse vaim satub segadusse ja ma eksitan tema nõu; siis nad küsitlevad ebajumalaid ja lausujaid, surnute vaime ja ennustajaid.",
"4": "<span>4</span> Ma annan egiptlased karmi isanda kätte ja nende üle hakkab valitsema kõvakäeline kuningas, ütleb Jumal, vägede Issand.",
"5": "<span>5</span> Veed lõpevad Niilusest, jõgi taheneb ja kuivab.",
"6": "<span>6</span> Jõed hakkavad haisema, kanalid kahanevad ja jäävad kuivaks, pilliroog ja kõrkjad närbuvad.",
"7": "<span>7</span> Kaislad Niiluse kaldal, Niiluse suudmes, ja kõik Niiluse külvimaad kuivavad, puhutakse laiali ja neid ei ole enam.",
"8": "<span>8</span> Kalamehed kurvastavad ja leinavad; kõik, kes heidavad õnge jõkke ja lasevad võrke vette, on rammetud.",
"9": "<span>9</span> Häbisse jäävad, kes lõugutavad linu, ja kudujad kahvatavad.",
"10": "<span>10</span> Ta kangrud lüüakse maha, kõigi palgatööliste meel on nukker.",
"11": "<span>11</span> Tõesti, Soani vürstid on meeletud, vaarao targad nõuandjad annavad rumalat nõu. Kuidas te võite öelda vaaraole: 'Mina olen tarkade poeg, muistsete kuningate järeltulija'?",
"12": "<span>12</span> Kus su targad siis on? Las nad nüüd jutustavad sulle, kui nad teavad, mida vägede Issand on otsustanud Egiptuse kohta.",
"13": "<span>13</span> Soani vürstid on muutunud juhmiks, Noofi vürste on narritud ja Egiptuse on pannud taaruma tema enese suguharude juhid.",
"14": "<span>14</span> Issand on seganud tema sekka pöörituse vaimu ja nad panevad Egiptuse taaruma kõigis ta tegudes, otsekui joobnu, kes taarub oma okses.",
"15": "<span>15</span> Ei lähe korda Egiptuse töö, tehku seda pea või saba, võrse või vars.",
"16": "<span>16</span> Sel päeval on egiptlased otsekui naised ning nad vabisevad ja värisevad vägede Issanda viibutava käe ees, mida ta viibutab nende kohal.",
"17": "<span>17</span> Ja Juudamaa saab Egiptusele häbistuseks; iga kord, kui temale seda meelde tuletatakse, väriseb ta vägede Issanda nõu ees, mida too on pidanud tema vastu.",
"18": "<span>18</span> Sel päeval on Egiptusemaal viis linna, kes räägivad kaanani keelt ja annavad vande vägede Issandale; ühte hüütakse Päikeselinnaks.",
"19": "<span>19</span> Sel päeval on Issanda altar keset Egiptusemaad ja selle piiri ääres on Issanda sammas,",
"20": "<span>20</span> märgiks ja tunnistuseks vägede Issandale Egiptusemaal. Kui nad rõhujate pärast kisendavad Issanda poole, siis läkitab tema neile päästja, kes nende eest võitleb ja nad vabastab.",
"21": "<span>21</span> Ja Issand ilmutab ennast egiptlastele ja egiptlased õpivad sel päeval Issandat tundma ja teenivad teda tapa- ja roaohvritega, ja nad annavad Issandale tõotusi ning viivad need täide.",
"22": "<span>22</span> Ja Issand lööb egiptlasi, lööb ja ravib; nad pöörduvad siis Issanda poole ja tema kuuleb nende palveid ning teeb nad terveks.",
"23": "<span>23</span> Sel päeval on maantee Egiptusest Assurisse: assüürlased tulevad Egiptusesse ja egiptlased Assurisse, ja egiptlased peavad jumalateenistust koos assüürlastega.",
"24": "<span>24</span> Sel päeval on Iisrael kolmandana Egiptuse ja Assuri kõrval, õnnistus on keset maad,",
"25": "<span>25</span> mida vägede Issand õnnistab, öeldes: 'Õnnistatud olgu Egiptus, mu rahvas, Assur, mu kätetöö, ja Iisrael, mu pärisosa!'"
},
"20": {
"1": "<span>1</span> Sel aastal kui väejuht, kelle Assuri kuningas Sargon läkitas, tuli Asdodi ja taples Asdodi vastu ning vallutas selle -",
"2": "<span>2</span> sel ajal kõneles Issand Jesaja, Aamotsi poja läbi, öeldes: 'Mine päästa kotiriie oma niudeilt valla ja võta jalatsid jalast!' Ja ta tegi nõnda: käis alasti ja paljajalu.",
"3": "<span>3</span> Siis ütles Issand: 'Otsekui mu sulane Jesaja on kolm aastat käinud alasti ja paljajalu, märgiks ja endeks Egiptusele ja Etioopiale,",
"4": "<span>4</span> nõnda ajab Assuri kuningas Egiptuse vange ja Etioopia asumiselesaadetuid, noori ja vanu, alasti ja paljajalu, istmik paljas, egiptlastele häbiks.",
"5": "<span>5</span> Siis nad ehmuvad ja häbenevad Etioopia pärast, kes oli nende lootus, ja Egiptuse pärast, kes oli nende uhkus.",
"6": "<span>6</span> Ja sel päeval ütlevad selle ranna elanikud: 'Vaata, nõnda läks meie lootusega, kuhu me põgenesime abi saama, et pääseda Assuri kuninga eest. Kuidas me nüüd pääseme?''"
},
"21": {
"1": "<span>1</span> Ennustus mereäärse kõrbe kohta: Otsekui Lõunamaal tormavad tuulehood, nõnda tuleb see kõrbest, kardetavalt maalt.",
"2": "<span>2</span> Mulle on ilmutatud karm nägemus: petis petab ja rüüstaja rüüstab. Mine üles, Eelam! Asu piirama, Meedia! Mina lõpetan kõik ohkamised.",
"3": "<span>3</span> Seepärast on mu niuded täis valu: mind on haaranud vaevused otsekui tuhud sünnitajat. Ma olen kuuldust segaduses, ma olen nähtust jahmunud.",
"4": "<span>4</span> Mu süda väriseb, lõdisemine kohutab mind, puhteaeg, mida igatsesin, sai mulle ängiks.",
"5": "<span>5</span> Lauda kaetakse, istejärjestust seatakse, süüakse, juuakse. Tõuske, vürstid, võidke kilpi!",
"6": "<span>6</span> Sest Issand on mulle öelnud nõnda: 'Mine, pane vahimees välja! Mida ta näeb, seda teatagu!",
"7": "<span>7</span> Kui ta näeb karavani, ratsanikke paarikaupa, eeslite rodu, kaamelite rodu, siis ta pangu hästi tähele, pangu hoolsasti tähele!'",
"8": "<span>8</span> Ja ta hüüdiski: 'Nägija vahitornis! Issand, ma seisan päevad läbi ja olen valves igal ööl.",
"9": "<span>9</span> Jah, vaata, sealt tuleb meeste rodu, ratsanikke paarikaupa.' Siis ta kostis ning ütles: 'Langenud, langenud on Paabel, ja kõik ta ebajumalate kujud on maha puruks löödud.'",
"10": "<span>10</span> Mu rehena pekstud ja tallatud rahvas! Mida ma kuulsin vägede Issandalt, Iisraeli Jumalalt, seda ma kuulutan teile!",
"11": "<span>11</span> Ennustus Duuma kohta: Mulle hüütakse Seirist: 'Vahimees, ons palju veel ööd? Vahimees, ons palju veel ööd?'",
"12": "<span>12</span> Vahimees vastab: 'Hommik tuleb, aga öö tuleb ka! Kui tahate küsida, küsige, tulge uuesti tagasi!'",
"13": "<span>13</span> Ennustus Araabia kohta: Ööbige Araabia tihnikuis, dedanlaste karavan!",
"14": "<span>14</span> Minge vastu janustele, viige neile vett! Teemamaa elanikud, astuge oma leivaga põgenike ligi!",
"15": "<span>15</span> Sest nad põgenevad mõõkade eest, paljastatud mõõga eest, vinnastatud ammu eest ja sõja raskuste eest.",
"16": "<span>16</span> Sest Issand ütles mulle nõnda: 'Veel aasta, palgalise aastate sarnaselt, ja kõik Keedari hiilgus on kadunud.",
"17": "<span>17</span> Jääk ammumeeste arvust, Keedari kangelaste arvust jääb väheseks. Jah, Issand, Iisraeli Jumal, on rääkinud.'"
},
"22": {
"1": "<span>1</span> Ennustus Nägemuseoru kohta: Mis sul siis nüüd on, et oled tervenisti läinud katustele,",
"2": "<span>2</span> sa kärarikas, rahutu linn, ülemeelik linnake? Su tapetuid ei tapeta mõõgaga ega sure nad sõjas.",
"3": "<span>3</span> Kõik su juhid põgenevad üheskoos, võetakse vangi ammutagi. Kõik, kes su omadest leitakse, võetakse üheskoos vangi, kuigi põgenevad kaugele.",
"4": "<span>4</span> Seepärast ma ütlen: Ärge vaadake mind, ma nutan kibedasti; ärge kippuge mind trööstima mu rahva tütre julma kohtlemise pärast!",
"5": "<span>5</span> Sest Jumalal, vägede Issandal, on Nägemuseorus jahmatuse, tallamise ja segaduse päev: müüride murdmine ja hädakisa mägedeni.",
"6": "<span>6</span> Eelam võtab nooletupe, sõjavankrite vooris on mehed ja ratsanikud, ja Kiir vabastab kilbi kattest.",
"7": "<span>7</span> Su ilusad orud täituvad vankritega ja ratsanikud asuvad otse väravate vastas.",
"8": "<span>8</span> Ta võtab ära Juuda kaitse ja sel päeval sa vaatad relvade poole Metsakojas.",
"9": "<span>9</span> Te näete, et Taaveti linnas on palju müürimurde, ja te kogute Alatiiki vett.",
"10": "<span>10</span> Te loete üle Jeruusalemma kojad ja kisute kodasid maha, et kindlustada müüri.",
"11": "<span>11</span> Ja te teete müüride vahele mahuti Vanatiigi vee jaoks. Aga te ei vaata selle poole, kes seda teeb, ega näe, kes seda ammu valmistas.",
"12": "<span>12</span> Jah, Jumal, vägede Issand, kutsub sel päeval nutma ja leinama, pead pügama ja kotiriiet ülle võtma.",
"13": "<span>13</span> Aga vaata, siis on lust ja rõõm: härgade tapp ja lammaste veristus, süüakse liha ja juuakse veini. 'Söögem ja joogem, sest homme me sureme!'",
"14": "<span>14</span> Kuid vägede Issand on mulle kõrva ilmutanud: Tõesti, seda süüd ei lepitata teile surmani, ütleb Jumal, vägede Issand.",
"15": "<span>15</span> Nõnda ütleb Jumal, vägede Issand: Tule, mine selle valitseja juurde, Sebna juurde, kes on kojaülemaks, ja ütle:",
"16": "<span>16</span> 'Mis sul siin asja on ja kes sul siin on, et sa siin raiud enesele hauda, raiud oma haua kõrgele, uuristad enesele elamu kaljusse?",
"17": "<span>17</span> Vaata, Issand viskab sind kaares kaugele vägeva mehe viskega, ja haarates sinust kõvasti kinni,",
"18": "<span>18</span> mässib ta sind koguni keraks ning virutab kui palli igati laiale maale: seal sa sured ja sinna jäävad su toredad vankrid, sina, oma isanda koja häbi.'",
"19": "<span>19</span> Mina tõukan sinu su ametist, ja sind aetakse ära su kohalt.",
"20": "<span>20</span> Ja sel päeval kutsun ma oma sulase Eljakimi, Hilkija poja,",
"21": "<span>21</span> panen temale selga sinu kuue, kinnitan talle vööle sinu vöö ja annan tema kätte sinu valitsuse: tema saab siis isandaks Jeruusalemma elanikele ja Juuda soole.",
"22": "<span>22</span> Ja ma panen Taaveti koja võtme temale õlale: tema avab ja ükski ei sule, tema suleb ja ükski ei ava.",
"23": "<span>23</span> Mina löön ta nagu varna kindlasse kohta ja ta saab aujärjeks oma isa soole.",
"24": "<span>24</span> Tema külge riputatakse kogu ta isa soo koorem: võrsed ja lehed, kõik väiksed asjadki, kausikestest kuni igasuguste kruusideni.",
"25": "<span>25</span> Siis, ütleb vägede Issand, annab järele kindlasse kohta löödud varn: see murdub ja langeb, ja koorem, mis selle küljes oli, puruneb. Jah, Issand on rääkinud."
},
"23": {
"1": "<span>1</span> Ennustus Tüürose kohta: Ulguge, Tarsise laevad, sest teie varjupaik hävitatakse! Kui nad tulevad kittide maalt, saab see neile teatavaks.",
"2": "<span>2</span> Vaikima peab rannarahvas, Siidoni kaupmees, kelle saadik sõidab merd.",
"3": "<span>3</span> Suurtel vetel oli Siihori külv ja Niiluse lõikus, temast sai rahvaste turg.",
"4": "<span>4</span> Häbene, Siidon, sa tugev linn, sest meri kõneleb: 'Ma pole olnud lapsevaevas ega ole sünnitanud; ma pole kasvatanud noori mehi ega ole lasknud sirguda neitseid.'",
"5": "<span>5</span> Kui Egiptuses sellest kuuldakse, siis nad värisevad nagu kuuldusest Tüürosegi kohta.",
"6": "<span>6</span> Tõtake Tarsisesse! Ulguge, rannarahvas!",
"7": "<span>7</span> On see teie rõõmus linn, mille algus on muistses ajas, keda jalad kandsid kaugele võõrana elama?",
"8": "<span>8</span> Kes on seda otsustanud kroonide jagaja Tüürose kohta, kelle kaupmehed on vürstid, kelle kaubitsejad on kõige auväärsemad maa peal?",
"9": "<span>9</span> Vägede Issand on otsustanud teotada kogu toreduse kõrkust, alandada kõiki auväärseid maal.",
"10": "<span>10</span> Käi oma maa läbi, Tarsise tütar, otsekui Niilus! Vööd ei ole enam!",
"11": "<span>11</span> Tema sirutab käe mere kohale, paneb kuningriigid värisema - Issand annab käsu Kaanani kohta ta kindluste hävitamiseks.",
"12": "<span>12</span> Ta ütleb: 'Ära ole enam ülemeelik, kurjasti koheldud neitsi, Siidoni tütar! Tõuse, siirdu kittide juurde, aga sealgi ei ole sul rahu!'",
"13": "<span>13</span> Vaata kittide maad! See on rahvas, keda ei olnud olemas, kes on siidonlaste rajatud: nemad püstitasid tema vahitornid, linnad ja paleed - tema teeb selle varemeiks.",
"14": "<span>14</span> Ulguge, Tarsise laevad, sest teie kindlus on hävitatud!",
"15": "<span>15</span> Ja sel ajal unustatakse Tüüros seitsmekümneks aastaks, ühe kuninga elupäevadeks. Seitsmekümne aasta pärast sünnib Tüürosega nagu hoora laulus:",
"16": "<span>16</span> 'Võta kannel, käi linnas ringi, sa unustatud hoor! Mängi ilusasti, laula usinasti, et sind meelde tuletataks!'",
"17": "<span>17</span> Seitsmekümne aasta pärast katsub Issand Tüürost ja see saab jälle hoorapalgale ning teeb hooratööd kõigi maailma kuningriikidega maa peal.",
"18": "<span>18</span> Aga tema tulu ja hoorapalk on pühitsetud Issandale; seda ei kuhjata ega talletata, sest see tulu saab neile, kes elavad Issanda ees, külluslikuks toiduseks ja kauneiks kehakatteiks.'"
},
"24": {
"1": "<span>1</span> Vaata, Issand laastab maa ja rüüstab selle, paiskab segi selle pinna ja pillutab elanikud.",
"2": "<span>2</span> Ja nagu rahvaga, nõnda sünnib preestriga, nagu sulasega, nõnda ta isandaga, nagu teenijaga, nõnda ta emandaga, nagu ostjaga, nõnda müüjaga, nagu laenuandjaga, nõnda laenajaga, nagu võlausaldajaga, nõnda võlgnikuga.",
"3": "<span>3</span> Maa laastatakse täiesti ja riisutakse sootuks, sest Issand on öelnud selle sõna.",
"4": "<span>4</span> Maa leinab, laostub, ilmamaa närbub, laostub, maa rahva ülikud rammestuvad.",
"5": "<span>5</span> Maa on rüvetunud oma elanike all, sest need on üle astunud Seadusest, muutnud seadlusi, murdnud igavese lepingu.",
"6": "<span>6</span> Seepärast neelab needus maa ja selle elanikud peavad kandma oma süüd; seepärast kahaneb maa elanike hulk ja vähe inimesi jääb järele.",
"7": "<span>7</span> Vein leinab, viinapuu kuivab, ägavad kõik, kes olid südamest rõõmsad.",
"8": "<span>8</span> Lõpeb trummide lõbu, lakkab hõiskajate lärm, kaob kandle rõõm.",
"9": "<span>9</span> Enam ei jooda lauldes veini, vägijook on joojale kibe.",
"10": "<span>10</span> Tühi linn purustatakse, kõik kojad suletakse, sissepääsu ei ole.",
"11": "<span>11</span> Tänavail karjutakse veini järele, kõik rõõm kaob, maa lust lahkub.",
"12": "<span>12</span> Linna jääb häving ja värav taotakse puruks.",
"13": "<span>13</span> Sest nõnda peab sündima keset maad, rahvaste keskel, otsekui õlipuu raputus, otsekui järelnoppimine pärast viinamarjalõikuse lõppu.",
"14": "<span>14</span> Need seal tõstavad häält, rõkatavad rõõmust, Issanda ülevuse tõttu hõiskavad lääne poolt:",
"15": "<span>15</span> 'Seepärast austage ka ida pool Issandat, mere saartel Issanda, Iisraeli Jumala nime.'",
"16": "<span>16</span> Maa äärest kuuleme kiituslaule: 'Austus õigele!' Aga mina ütlen: Kadu mulle, kadu mulle! Häda mulle, petised petavad, jah, petised petavad petise kombel!",
"17": "<span>17</span> Pelg, püügiauk ja püüdepael on su ees, maa elanik.",
"18": "<span>18</span> Kes siis põgeneb peletushüüu eest, langeb püügiauku; aga kes tuleb püügiaugust välja, selle püüab püüdepael. Sest kõrguse luugid avanevad ja maa alused vappuvad.",
"19": "<span>19</span> Maa põrub põrmuks, maa lõheneb lõhki, maa kõigub kõvasti.",
"20": "<span>20</span> Maa vaarub tugevasti, joobnu sarnaselt, ja vangub otsekui vahionn. Tema üleastumine lasub raskesti ta peal, ta langeb ega tõuse enam.",
"21": "<span>21</span> Sel päeval nuhtleb Issand kõrguse väehulki kõrgel ja maa kuningaid maa peal.",
"22": "<span>22</span> Need kogutakse kokku, kogutakse vangidena auku, suletakse vangitorni ja hulga aja pärast nuheldakse neid.",
"23": "<span>23</span> Siis on kuul häbi ja päike häbeneb, sest vägede Issand on kuningas Siioni mäel ja Jeruusalemmas, ja tema vanemate ees paistab auhiilgus."
},
"25": {
"1": "<span>1</span> Issand, sina oled mu Jumal, ma tahan sind ülistada, su nime kiita, sest sa oled teinud imet, su otsused muistsest ajast on õiged ja kindlad.",
"2": "<span>2</span> Sest sa tegid linna kivivaremeks ja kindlustatud linna rusuhunnikuks. Võõraste kants ei ole enam linn, seda ei ehitata iialgi üles.",
"3": "<span>3</span> Seepärast austab sind vägev rahvas, aga julmade paganate linnad kardavad sind.",
"4": "<span>4</span> Sest sa oled kindluseks viletsale ja pelgupaigaks vaesele ta kitsikuses, ulualuseks raju eest, varjuks palavuse eest; on ju julmade viha otsekui raju, mis raputab müüri,",
"5": "<span>5</span> otsekui lõõsk põuaajal. Sina vaigistad võõraste möllu, otsekui palavus pilve varjus vaikib julmade võidulaul.",
"6": "<span>6</span> Ja vägede Issand valmistab sellel mäel kõigile rahvaile võõruspeo rammusate roogadega, võõruspeo laagerdatud veiniga, üdirammusate roogadega, pärmi pealt selitatud veiniga.",
"7": "<span>7</span> Ta hävitab sel mäel loori, mis looritab kõiki rahvaid, ja katte, mis katab kõiki paganaid.",
"8": "<span>8</span> Ta neelab surma ära igaveseks ajaks. Ja Issand Jumal pühib pisarad kõigilt palgeilt ning kõrvaldab oma rahva teotuse kogu maalt. Jah, Issand on rääkinud!",
"9": "<span>9</span> Ja sel päeval öeldakse: 'Vaata, see on meie Jumal, keda me ootasime, et ta meid päästaks. See on Issand, keda me ootasime, hõisakem ja tundkem rõõmu tema päästest,",
"10": "<span>10</span> sest Issanda käsi viibib sellel mäel.' Aga Moab tallatakse maha ta omas paigas, otsekui tallataks õlekubu virtsalompi.",
"11": "<span>11</span> Ja kui ta selle sees sirutab oma käsi otsekui ujuja ujudes, alandatakse ta suurelisus ikkagi, hoolimata ta käte kunstist.",
"12": "<span>12</span> Jah, kindel linn, ta laseb langeda su kaitsvad müürid, alandab, paiskab maha põrmu."
},
"26": {
"1": "<span>1</span> Sel päeval lauldakse Juudamaal seda laulu: Meil on tugev linn, pääste on pandud müürideks ja kaitsevalliks.",
"2": "<span>2</span> Avage väravad, et saaks sisse minna õige rahvas, kes püsib usus!",
"3": "<span>3</span> Kindlameelsele sa hoiad rahu, rahu, sest ta loodab sinu peale.",
"4": "<span>4</span> Lootke alati Issanda peale, sest Issand Jumal on igavene kalju.",
"5": "<span>5</span> Sest tema langetab need, kes elavad kõrgel, ligipääsmatu linna; ta alandab seda, alandab maani, paiskab põrmu.",
"6": "<span>6</span> Seda tallab jalg, õnnetute jalad, viletsate sammud.",
"7": "<span>7</span> Õigete tee on tasane, sina sillutad siledaks õigete raja.",
"8": "<span>8</span> Issand! Me ootame sind ka su kohtumõistmiste teel, hing igatseb su nime ja su mälestust.",
"9": "<span>9</span> Mu hing igatseb sind öösel, vaimgi mu sees otsib sind, sest kui sinu kohtumõistmised tabavad maad, õpivad ilmamaa elanikud õiglust.",
"10": "<span>10</span> Leiab aga õel armu, ei õpi ta õiglust, õigusemaalgi teeb ta ülekohut ega näe Issanda kõrgust.",
"11": "<span>11</span> Issand, sinu käsi on tõstetud kõrgele, aga nad ei näe seda. Nähku nad siis su püha viha rahva pärast ja häbenegu! Jah, neelaku neid tuli kui sinu vaenlasi!",
"12": "<span>12</span> Issand, sina saadad meile rahu, sest kõik meie teodki oled sina teinud.",
"13": "<span>13</span> Issand, meie Jumal! Meid on valitsenud muud isandad peale sinu - me kiidame üksnes sind, sinu nime.",
"14": "<span>14</span> Surnud ei ärka ellu, kadunud ei tõuse üles. Sest sina nuhtlesid neid ja hävitasid nad ning kaotasid neist iga mälestuse.",
"15": "<span>15</span> Sina oled lisanud rahvast, Issand, oled lisanud rahvast, oled näidanud oma au, oled laiendanud kõik maa piirid.",
"16": "<span>16</span> Issand, nad otsisid sind kitsikuses, sosistasid lausumisi, kui sina neid karistasid.",
"17": "<span>17</span> Otsekui lapseootel olija, kel sünnitus ligineb, vaevleb ja kisendab oma valudes, nõnda olime meiegi sinu ees, Issand.",
"18": "<span>18</span> Me olime lapseootel, vaevlesime, aga otsekui oleksime sünnitanud tuult: päästet me maale ei toonud ja ilmamaa elanikke ei sündinud.",
"19": "<span>19</span> Aga sinu surnud ärkavad ellu, minu laibad tõusevad üles. Ärgake ja hõisake, põrmus lamajad! Sest sinu kaste on valguse kaste ja maa paiskab välja kadunud.",
"20": "<span>20</span> Tule, mu rahvas, mine oma kambritesse ja sule uksed enese tagant, peitu üürikeseks ajaks, kuni raev möödub.",
"21": "<span>21</span> Sest vaata, Issand väljub oma asupaigast nuhtlema maa elanikke nende ülekohtu pärast. Siis paljastab maa oma veresüü ega kata enam neid, kes ta peal on tapetud."
},
"27": {
"1": "<span>1</span> Sel päeval nuhtleb Issand oma terava, suure ja tugeva mõõgaga Leviatanit, põgenevat madu, ja Leviatanit, keerdunud madu, ja tapab meres oleva lohe.",
"2": "<span>2</span> Selsamal päeval öeldakse: 'Tore viinamägi, laulge sellest vastastikku!'",
"3": "<span>3</span> Mina, Issand, olen selle valvur, ma kastan seda igal hetkel, ma valvan öösel ja päeval, et sellele kahju ei tehtaks.",
"4": "<span>4</span> Viha mul enam ei ole. Ent oleks mul tarvis võidelda kibuvitste ja ohakatega, ma astuksin neile vastu, süütaksin kõik põlema.",
"5": "<span>5</span> Või olgu siis, et haaratakse kinni minu kaitsest, tehakse minuga rahu - jah, minuga tehakse rahu.",
"6": "<span>6</span> Tulevasil päevil juurdub Jaakob, Iisrael õitseb ning haljendab ja maailm on täis vilja.",
"7": "<span>7</span> Ons ta teda löönud, nõnda nagu ta lõi tema lööjat, või teda tapnud, nõnda nagu tapeti tema tapjad?",
"8": "<span>8</span> Mõõt mõõdu vastu! Ta lahendas temaga asja teda maapakku saates: ta pühkis ta ära oma tugeva rajuiiliga idatuule päeval.",
"9": "<span>9</span> Seepärast lepitatakse Jaakobi süü nõnda, ja niisugune olgu tema patukustutuse täielik vili: ta peab tegema kõik altarikivid pihustatud lubjakivide sarnaseks; ei tohi tõusta viljakustulpi ega suitsutussambaid.",
"10": "<span>10</span> Jah, kindel linn jääb üksi, tühjaks ja mahajäetud karjamaaks, kõrbe sarnaseks. Seal käib vasikas karjas, lebab seal ja näsib paljaks selle raod.",
"11": "<span>11</span> Kui selle oksad on kuivanud, siis murtakse need; naised tulevad, teevad nendega tuld. Sest see ei ole mõistlik rahvas: seepärast ta Looja ei halasta tema peale ja ta kujundaja ei anna temale armu.",
"12": "<span>12</span> Ja sel päeval sünnib, et Issand rabab viljapäid Frati jõest Egiptuseojani, ja teid, Iisraeli lapsed, korjatakse ükshaaval kokku.",
"13": "<span>13</span> Sel päeval puhutakse suurt sarve ja niihästi need, kes olid kadunud Assurimaale, kui ka need, kes olid pillutatud Egiptusemaale, tulevad ja kummardavad Issandat Jeruusalemmas pühal mäel."
},
"28": {
"1": "<span>1</span> Häda Efraimi joomarite toredale kroonile ja tema hiilgava ilu närtsinud õiele künkal keset veinist roidunute lopsakat orgu!",
"2": "<span>2</span> Vaata, Issandal on keegi vägev ja võimas, otsekui rahesadu, hävitav torm, võimsalt voolava veetulva sarnane, kes paiskab jõuga jalust.",
"3": "<span>3</span> Jalge alla tallatakse Efraimi joomarite tore kroon",
"4": "<span>4</span> ja tema hiilgava ilu närtsinud õiel, mis on künkal keset lopsakat orgu, käib käsi nagu varakult, enne lõikust küpsenud viigimarjal: kes seda iganes näeb, neelab selle alla, kui saab selle pihku.",
"5": "<span>5</span> Sel päeval on vägede Issand ilusaks krooniks ja kauniks pärjaks oma rahva jäägile",
"6": "<span>6</span> ja õiguse vaimuks kohtus istujale ning rammuks neile, kes tõrjuvad tapluse tagasi väravasse.",
"7": "<span>7</span> Aga needki siin vaaruvad veinist ja tuiguvad vägijoogist: preester ja prohvet vaaruvad vägijoogist, on segased veinist, tuiguvad vägijoogist, eksivad nägemuses, kõiguvad otsuses.",
"8": "<span>8</span> Sest kõik lauad on täis okset ja rooja, puhast paika ei olegi.",
"9": "<span>9</span> Kellele ta tahab õpetada tarkust ja kellele seletada ilmutust? Kas piimast võõrutatuile, rinnalt võetuile?",
"10": "<span>10</span> Sest see on: käsk käsu peale, käsu peale käsk, mõõdunöör mõõdunööri peale, mõõdunööri peale mõõdunöör, pisut siin, pisut seal.",
"11": "<span>11</span> Tõesti, kogelevate huultega ja võõras keeles kõneleb ta sellele rahvale,",
"12": "<span>12</span> tema, kes neile ütles: 'See on hingamispaik, laske väsinud hingata, see on kosutuskoht!' Ometi nad ei tahtnud kuulda.",
"13": "<span>13</span> Seepärast on Issanda sõna neile: Käsk käsu peale, käsu peale käsk, mõõdunöör mõõdunööri peale, mõõdunööri peale mõõdunöör, pisut siin, pisut seal, et nad läheksid ja kukuksid selili, vigastaksid endid ning laseksid endid püüda ja vangi võtta.",
"14": "<span>14</span> Seepärast kuulge Issanda sõna, te hooplejad mehed, pilkajad selle rahva hulgas, kes asub Jeruusalemmas,",
"15": "<span>15</span> sest te ütlete: 'Me oleme sõlminud surmaga lepingu ja loonud põrguhauaga liidu - tulgu või uputusetulv, meieni see ei ulatu, sest me valisime oma varjupaigaks vale ja pugesime pelgu pettusesse.'",
"16": "<span>16</span> Seepärast ütleb Issand Jumal nõnda: Vaata, see olen mina, kes paneb Siionis aluskivi, valitud kivi, kalli nurgakivi, kindla aluse: kes usub, see ei tunne rahutust.",
"17": "<span>17</span> Mina panen õiguse mõõdunööriks ja õigluse loodiks. Rahe hävitab vale varjupaiga ja veed uhuvad ulualuse.",
"18": "<span>18</span> Teie leping surmaga lõpeb ja teie liit põrguhauaga ei püsi: kui uputusetulv teist üle käib, muutute selle tallermaaks.",
"19": "<span>19</span> Alati, kui see üle käib, haarab see teid, sest see tuleb igal hommikul, päeval ja ööl, ja ilmutuse mõistmine muutub lausa hirmuks.",
"20": "<span>20</span> Sest voodi on sirutuseks lühike ja vaip katteks kitsas.",
"21": "<span>21</span> Sest nagu Peratsimi mäel tõuseb Issand; ta vihastab nagu Gibeoni orus, et teha oma tööd - hämmastav on tema töö! - ja et toimetada oma tegu - võõristav on tema tegu.",
"22": "<span>22</span> Nüüd aga ärge enam hoobelge, et teie kütked jääksid pingutamata, sest ma olen kuulnud Jumalalt, vägede Issandalt, otsusest ja hävitusest, mis tabab kogu maad.",
"23": "<span>23</span> Kuulatage ja kuulge mu häält, pange tähele ja kuulge mu kõnet!",
"24": "<span>24</span> Kas kündja kogu päeva külvi tarvis künnab, kobestab ja äestab oma põllumaad?",
"25": "<span>25</span> Eks ole nõnda: kui ta on pinna tasandanud, siis ta puistab tilli ja riputab köömneid, paneb paika nisu, hirsi ja odra ning äärele okasnisu?",
"26": "<span>26</span> Nõnda on temale juhatatud õige viis, tema Jumal õpetab teda.",
"27": "<span>27</span> Tilli ju ei peksta pahmareega ja köömnete peal ei veeretata vankriratast, vaid tilli klopitakse kepiga ja köömneid vitsaga.",
"28": "<span>28</span> Leivavili jahvatatakse peeneks, aga iial ei peksta seda lõpmata: pannakse liikuma oma vankriratas ja hobused, aga seda ei peksta puruks.",
"29": "<span>29</span> Ka see on tulnud vägede Issandalt; tema nõu on imeline ja tema tarkus suur."
},
"29": {
"1": "<span>1</span> Häda sulle, Ariel, Ariel, linn, kus Taavet leeri üles lõi! Lisandugu aastale aasta, tehku seatud pühad oma ringkäiku,",
"2": "<span>2</span> mina rõhun Arieli: tuleb kurbus ja kurvastus ja ta muutub mulle otsekui ohvrialtariks.",
"3": "<span>3</span> Ma löön su vastu üles ringikujulise leeri, ümbritsen sind valvega ja püstitan su vastu piiramisseadmed.",
"4": "<span>4</span> Siis sa räägid maa madalusest ja tasa kõlab põrmust su kõne; siis tuleb su hääl maa seest otsekui vaimul ja sa sosistad põrmust oma sõnu.",
"5": "<span>5</span> Su vaenlaste hulk on otsekui peenike tolm, rõhujate jõuk lendlevate aganate sarnane. Sest silmapilkselt, äkitselt sünnib,",
"6": "<span>6</span> et vägede Issandalt tuleb sulle katsumine äikese, maavärisemise ja suure mürinaga, tuulispea ja marutuulega ning hävitava tuleleegiga.",
"7": "<span>7</span> Ja nagu unenägu, öine nägemus, on kõigi Arieli vastu sõdivate rahvaste hulk, samuti kõik, kes sõdivad tema ja ta kindluste vastu ning ahistavad teda.",
"8": "<span>8</span> See on, nagu näeks näljane und, et vaata, ta sööb. Kui ta ärkab, siis on ta hing täitmata. Või nagu näeks janune und, et vaata, ta joob. Kui ta ärkab, vaata, siis on ta nõrk ja ta hing on närbunud. Samuti sünnib kõigi rahvaste hulkadega, kes sõdivad Siioni mäe vastu.",
"9": "<span>9</span> Pidage ja hämmastuge, saage pimedaks ja ärge nähke! Nad on joobnud, aga mitte veinist, nad vaaruvad, aga mitte vägijoogist.",
"10": "<span>10</span> Sest Issand on valanud teie peale unisuse vaimu ja on sulgenud teie silmad, prohvetid, ning katnud teie pead, nägijad.",
"11": "<span>11</span> Seepärast on kogu ilmutus teile nagu pitseeritud raamatu sõnad; kui see antakse mõnele, kes kirja tunneb, ja öeldakse: 'Loe ometi!', siis ta vastab: 'Ma ei saa, sest see on pitseriga kinni.'",
"12": "<span>12</span> Või kui raamat antakse sellele, kes kirja ei tunne, ja öeldakse: 'Loe ometi!', siis vastab see: 'Ma ei tunne kirja.'",
"13": "<span>13</span> Ja Issand ütleb: Kuna see rahvas ligineb mulle suuga ja austab mind huultega, aga ta süda on minust kaugel ja nende kartus minu ees on ainult päritud inimlik käsk,",
"14": "<span>14</span> siis vaata, ma teen sellele rahvale veel imet - imelikul ja kummalisel viisil: tema tarkade tarkus kaob ja tema arukate arukus peidetakse.",
"15": "<span>15</span> Häda neile, kes oma nõu Issanda eest sügavale ära peidavad, kelle teod sünnivad pimedas ja kes ütlevad: 'Kes meid näeb? Kes meid tunneb?'",
"16": "<span>16</span> Oh teie põikpäisust! Kas peetakse savi võrdseks potissepaga, kas ütleb töö oma tegijale: 'Tema ei ole mind teinud!' või ütleb kuju oma voolijale: 'Tema ei oska midagi!'?",
"17": "<span>17</span> Eks ole ju veel ainult pisut aega, kuni Liibanon muutub viljapuuaiaks ja viljapuuaeda hakatakse pidama metsaks?",
"18": "<span>18</span> Sel päeval kuulevad kurdid kirja sõnu ja pimedate silmad näevad pilkasest pimedusest.",
"19": "<span>19</span> Siis tunnevad alandlikud aina rõõmu Issandas ja kõige vaesemad inimesed hõiskavad Iisraeli Pühas.",
"20": "<span>20</span> Sest vägivaldsele tuleb lõpp ja pilkaja saab otsa, ja hävitatakse kõik, kes kavatsevad kurja,",
"21": "<span>21</span> kes teevad sõnaga inimese süüdlaseks, kes seavad püünise kohtumõistjale väravas ja tõrjuvad õige põhjuseta kõrvale.",
"22": "<span>22</span> Seepärast ütleb Issand, kes lunastas Aabrahami, Jaakobi soole nõnda: Jaakob ei jää nüüd enam häbisse ja ta pale ei kahvata enam.",
"23": "<span>23</span> Vaid kui ta näeb oma lapsi, mu kätetööd, enese keskel, siis nad pühitsevad minu nime ja peavad pühaks Jaakobi Püha ning kardavad Iisraeli Jumalat.",
"24": "<span>24</span> Ja need, kes olid eksivaimus, tulevad mõistusele ja nurisejad võtavad õpetust."
},
"30": {
"1": "<span>1</span> Häda kangekaelseile lastele, ütleb Issand, kes peavad nõu, aga ilma minuta, ja kes teevad liidu, aga ilma minu Vaimuta, lisades patule patu,",
"2": "<span>2</span> kes lähevad alla Egiptusesse, küsimata nõu minu suust, et põgeneda vaarao kaitse alla ja otsida varju Egiptuses.",
"3": "<span>3</span> Seepärast tuleb vaarao kaitse teile häbiks ja Egiptuse varju alla kippumine teotuseks.",
"4": "<span>4</span> Sest kuigi ta vürstid on Soanis ja ta käskjalad on jõudnud Haanessi,",
"5": "<span>5</span> jäävad kõik häbisse rahva pärast, kellest neil ei ole kasu, kes ei ole abiks ega kasuks, vaid häbiks ja koguni teotuseks.",
"6": "<span>6</span> Ennustus Lõunamaa Jõehobu kohta: Läbi häda ja viletsuse maa, kust on pärit ema- ja isalõvid, mürkmaod ja lendmaod, viivad nad eeslite seljas oma rikkused ja kaamelite küürudel varandused rahvale, kellest ei ole kasu.",
"7": "<span>7</span> Et Egiptuse abi on tühine ja asjatu, siis ma nimetan seda 'Paigalpüsiv tormakus'.",
"8": "<span>8</span> Nüüd mine kirjuta see nende nähes tahvlile ja märgi raamatusse, et see võiks jääda tulevasiks päeviks, ikka ja igavesti!",
"9": "<span>9</span> Sest nad on tõrges rahvas, valelikud lapsed, lapsed, kes ei taha kuulda Issanda õpetust,",
"10": "<span>10</span> kes ütlevad nägijaile: 'Ärge nähke!' ja ennustajaile: 'Ärge ennustage meile tõtt, kõnelge meile meelt mööda, ennustage pettepilte,",
"11": "<span>11</span> taganege teelt, lahkuge rajalt, jätke meid rahule Iisraeli Pühaga!'",
"12": "<span>12</span> Seepärast ütleb Iisraeli Püha nõnda: Kuna te põlgate seda sõna ning loodate vale ja riugaste peale, ja toetute nende peale,",
"13": "<span>13</span> siis on see süü teile otsekui väljavajunud müüriosa kõrges praoga müüris, mis variseb äkitselt, silmapilgu jooksul,",
"14": "<span>14</span> ja puruneb, nagu puruneb potissepa kruus, mis pekstakse armuta puruks, nõnda et tükkidest ei leidu kildu, millega võtta leest tuld või ammutada lombist vett.",
"15": "<span>15</span> Sest nõnda ütleb Issand Jumal, Iisraeli Püha: Pöördudes ja vaikseks jäädes te pääseksite, rahus ja lootuses oleks teie jõud, kuid te pole seda tahtnud,",
"16": "<span>16</span> vaid ütlete: Ei, me põgeneme hobuste seljas! - sellepärast peategi põgenema - ja: Nobedal ratsul tahame sõita! - sellepärast ongi teie jälitajad kärmed.",
"17": "<span>17</span> Tuhat põgeneb üheainsa ähvardaja eest, teie põgenete viie ähvardaja eest, kuni teist jääb jääk, mis on otsekui lipuvarras mäetipul või lipp künkal.",
"18": "<span>18</span> Ja ometi ootab Issand, et teile armu anda, ja jääb kõrgeks, et teie peale halastada, sest Issand on õiguse Jumal, õndsad on kõik, kes teda ootavad.",
"19": "<span>19</span> Jah, sina, rahvas Siionis, kes elad Jeruusalemmas, ära enam nuta! Tema on sulle tõesti armuline, kui sa appi hüüad. Seda kuuldes ta vastab sulle.",
"20": "<span>20</span> Issand annab teile küll hädaleiba ja viletsusevett, kuid su õpetajad ei jää enam kõrvale, vaid su silmad saavad näha su õpetajaid.",
"21": "<span>21</span> Ja su kõrvad kuulevad sõna, mis su tagant ütleb, kui te kaldute paremale või vasakule: 'See on tee, käige seda!'",
"22": "<span>22</span> Siis sa rüvetad oma hõbedaga kaetud nikerdatud kujud ja oma kullaga karratud valatud kujud: sa viskad need ära otsekui mingi jälkuse. 'Välja!' ütled sa neile.",
"23": "<span>23</span> Siis annab tema vihma su seemnele, mida sa külvad põllule, ja maa saagist leiba, mis on toitev ja rammus; sel päeval sööb su kari avaral karjamaal.",
"24": "<span>24</span> Härjad ja eeslid, kellega haritakse põldu, söövad oblikatega segatud toitu, mida on puistatud visklabida ja hanguga.",
"25": "<span>25</span> Ja igal kõrgemal mäel ja igal kerkival künkal on ojasid voolava veega suurel tapapäeval, kui tornid langevad.",
"26": "<span>26</span> Siis on kuu valgus nagu päikese valgus, ja päikese valgus on seitsmekordne otsekui seitsme päeva valgus, päeval, kui Issand seob oma rahva vigastusi ja parandab tema löögihaavu.",
"27": "<span>27</span> Vaata, Issanda nimi tuleb kaugelt, ta viha põleb ja suitsupilv on ränk; ta huuled on täis sajatust ja ta keel on otsekui hävitav tuli.",
"28": "<span>28</span> Tema hingus on tulvava jõe sarnane, mis ulatub kaelani, et lennutada paganaid õnnetusikkesse ja panna rahvaste lõuapäradesse eksiteele juhtivad suulised.",
"29": "<span>29</span> Siis te laulate otsekui püha pühitsemise ööl ja rõõmustate südamest otsekui vilepilliga käija, kes läheb Issanda mäele, Iisraeli Kalju juurde.",
"30": "<span>30</span> Ja Issand annab kuulda oma võimsat häält ja näha oma käsivarre laskumist maruvihas hävitava tuleleegina koos paduvihma ja äikese ning raheteradega.",
"31": "<span>31</span> Jah, Assur ehmub Issanda häälest, kui ta vitsaga peksab.",
"32": "<span>32</span> Ja iga määratud kepihoop, mis Issand laseb langeda tema peale, sünnib trummide ja kannelde saatel, kui ta ägedas võitluses tema vastu sõdib.",
"33": "<span>33</span> Sest ammusest ajast on valmis põletuspaik - see on ka kuninga jaoks. Sügavaks ja laiaks on see tehtud, tuleriidas on ohtrasti tuld ja puid; Issanda hingus, otsekui väävlijõgi, süütab selle."
},
"31": {
"1": "<span>1</span> Häda neile, kes lähevad Egiptusesse abi saama ja otsivad tuge hobustest ning loodavad sõjavankrite peale, sellepärast et neid on palju, ja ratsanike peale, sellepärast et nende hulk on väga suur, aga ei vaata Iisraeli Püha poole ega küsi nõu Issandalt!",
"2": "<span>2</span> Kuid temagi on tark ja laseb tulla õnnetuse ega võta tagasi oma sõnu, vaid tõuseb kurjategijate soo vastu ja nende abi vastu, kes teevad nurjatust.",
"3": "<span>3</span> Sest egiptlased on inimesed, aga mitte Jumal, ja nende hobused on liha, aga mitte vaim. Kui Issand sirutab käe, siis komistab aitaja ja langeb aidatav ja nad kõik hukkuvad üheskoos.",
"4": "<span>4</span> Sest Issand on mulle öelnud nõnda: Otsekui lõvi või noor lõvi, kes uriseb oma saagi kallal ja kelle vastu on kokku kutsutud karjaste jõuk, ei kohku nende hüüdeist ega lömita nende kisa pärast, nõnda astub alla vägede Issand sõdima Siioni mäel ja künkal.",
"5": "<span>5</span> Nagu linnud laotavad oma tiivad laiali, nõnda kaitseb vägede Issand Jeruusalemma, kaitseb ja päästab, säästab ja vabastab.",
"6": "<span>6</span> Pöörduge tagasi tema juurde, kellest te olete taganenud nii kaugele, Iisraeli lapsed!",
"7": "<span>7</span> Sest sel päeval viskab igaüks ära oma hõbedased ja kuldsed ebajumalad, mis teie käed on teinud teile patuks.",
"8": "<span>8</span> Ja Assur langeb, aga mitte mehe mõõga läbi, mitte inimese mõõk ei hävita teda. Ta peab põgenema mõõga eest ja ta noored mehed saavad orjadeks.",
"9": "<span>9</span> Tema kalju hääbub hirmu pärast ja ta vürstid ehmuvad võitluslipu ees, ütleb Issand, kellel on tuli Siionis ja põletusahi Jeruusalemmas."
},
"32": {
"1": "<span>1</span> Vaata, kuningas hakkab valitsema õigluses ja vürstid asuvad juhtima, nagu on kohus.",
"2": "<span>2</span> Siis on igaüks neist otsekui pelgupaik tuule või ulualune vihmahoo eest, otsekui veeojad põuases paigas, otsekui võimsa kalju vari märga igatseval maal.",
"3": "<span>3</span> Siis pole nägijate silmad suletud ja kuuljate kõrvad panevad tähele.",
"4": "<span>4</span> Läbematute süda õpib tundma tõde ja kogelejate keel ruttab selgesti rääkima.",
"5": "<span>5</span> Jõledat ei hüüta enam õilsaks ja petist ei nimetata auliseks.",
"6": "<span>6</span> Sest jõle räägib jõledust ja ta süda taotleb nurjatust, et teha jumalavallatust ja rääkida Issanda kohta valet, et näljast hinge lasta nälgida ja janusele keelata jooki.",
"7": "<span>7</span> Petise relvad on kurjad, ta kavatseb häbitegusid, et hävitada hädalisi valekõnega, isegi kui vaene räägib õigust.",
"8": "<span>8</span> Aga õilis kavatseb õilsaid asju ja jääb püsima õilsate asjade juurde.",
"9": "<span>9</span> Muretud naised, tõuske üles, kuulake mu häält; hooletud tütred, kuulake mu kõnet!",
"10": "<span>10</span> Veel aasta ja mõned päevad, siis te, hooletud, värisete, sest viinamarjalõikusel on lõpp, korjamist enam ei tule.",
"11": "<span>11</span> Vabisege, muretud, värisege, muretud, värisege, hooletud, riietuge lahti, võtke endid alasti ja vöötage niuded!",
"12": "<span>12</span> Siis lüüakse endile vastu rindu toredate põldude pärast, viljakate viinapuude pärast,",
"13": "<span>13</span> minu rahva põllumaa pärast, mis kasvatab kibuvitsu ja ohakaid, jah, kõigi lusthoonete pärast selles ülemeelikus linnas.",
"14": "<span>14</span> Sest palee jääb maha, linna lärm lakkab, templiküngas ja vahitorn muutuvad igavesti kõledaiks väljadeks, metseeslitele rõõmuks, karjadele karjamaaks,",
"15": "<span>15</span> kuni meie peale valatakse Vaim ülalt. Siis saab kõrb viljapuuaiaks ja viljapuuaeda hakatakse pidama metsaks.",
"16": "<span>16</span> Siis elab õigus kõrbes ja õiglus võtab aset viljapuuaias.",
"17": "<span>17</span> Ja õigluse vili on rahu, õigluse tulemuseks püsiv rahulik elu ning julgeolek.",
"18": "<span>18</span> Ja mu rahvas elab rahu eluasemel, kindlais elamuis ning häirimatuis hingamispaigus,",
"19": "<span>19</span> kui sajab rahet, mets langeb maha ja linn vajub madalusse.",
"20": "<span>20</span> Õnnelikud olete teie, külvajad kõigi vete ääres, kes te võite härja ja eesli jalga lasta vabalt joosta."
},
"33": {
"1": "<span>1</span> Häda sulle, hävitaja, kes ise oled hävitamata, reetur, keda ei ole reedetud! Kui oled hävitusega valmis, hävitatakse sind, kui oled reetmise lõpetanud, reedetakse sind.",
"2": "<span>2</span> Issand, ole meile armuline, me ootame sind! Ole meie käsivars igal hommikul, ole meie abi kitsikuse ajal.",
"3": "<span>3</span> Su kõuehääle eest põgenevad rahvad, kui sa tõused, hajuvad paganad",
"4": "<span>4</span> ja saak kahmatakse meie käest, otsekui ahmaksid röövputukad; rohutirtsude rünnaku sarnaselt tormatakse selle kallale.",
"5": "<span>5</span> Issand on kõrge, sest ta elab kõrgel, tema täidab Siioni õiguse ja õiglusega.",
"6": "<span>6</span> Tema on su aegade tagatis, abi küllus, tarkus ja tunnetus; Issanda kartus - see on Siioni rikkus.",
"7": "<span>7</span> Vaata, Arieli elanikud kisendavad õues, rahu saadikud nutavad kibedasti.",
"8": "<span>8</span> Maanteed on tühjad, teekäijat ei ole, leping on tühistatud, tunnistajad on hüljatud, inimestest ei hoolita.",
"9": "<span>9</span> Maa leinab, närbub, Liibanon häbeneb, närtsib; Saaron on saanud kõnnumaaks, Baasan ja Karmel varistavad lehti.",
"10": "<span>10</span> Nüüd ma tõusen, ütleb Issand, nüüd ma tahan olla kõrge, nüüd ma ülendan ennast.",
"11": "<span>11</span> Kuluheinast olete rasedad, kõrsi toote ilmale, teie hingeõhk on tuli, mis teid sööb.",
"12": "<span>12</span> Jah, rahvad põletatakse lubjaks, otsekui maharaiutud kibuvitsad süüdatakse nad tulega.",
"13": "<span>13</span> Kuulge, kaugelviibijad, mida ma olen teinud, ja juuresolijad, tundke mu väge!",
"14": "<span>14</span> Patused Siionis värisevad, vabin valdab jumalatuid: 'Kes meist saaks elada hävitavas tules? Kes meist saaks elada igavesel leel?'",
"15": "<span>15</span> See, kes elab õiguses ja räägib tõtt, kes põlgab rõhumisest saadavat kasu, kes raputab käsi, et keelduda meeleheast, kes topib kõrvad kinni, et mitte kuulda veretööst, ja kes suleb silmad, et mitte näha kurja,",
"16": "<span>16</span> see elab kõrgustikel, ligipääsmatud kaljud on temale varjupaigaks; temale antakse ta leib, temale on vesi kindlustatud.",
"17": "<span>17</span> Su silmad saavad näha kuningat ta ilus, saavad näha ihaldusväärset maad.",
"18": "<span>18</span> Su süda meenutab hirmsaid asju: kus on nüüd kirjutaja, kus on vaagija, kus on tornide lugeja?",
"19": "<span>19</span> Enam sa ei näe jultunud rahvast, rahvast, kelle segast kõnet sa ei taipa, kelle kogelevast keelest sa ei saa aru.",
"20": "<span>20</span> Vaata Siionit, meie pidupäevade linna! Su silmad näevad Jeruusalemma, rahulikku paika, liigutamatut telki, mille vaiu ei tõmmata iialgi välja ja mille nööridest ei kista ainsatki katki.",
"21": "<span>21</span> Sest seal on Vägev: meiega on Issand nagu laiade jõgede ja vooluste kogumik, sellel ei kulge sõudelaev ja seda ei ületa võimsaimgi alus.",
"22": "<span>22</span> Sest Issand on meie kohtumõistja, Issand on meie käsuandja, Issand on meie kuningas, tema päästab meid.",
"23": "<span>23</span> Su köied lõtvuvad, ei pea paigal mastipuud ega lase purjel paisuda. Siis jagatakse suurt saaki, jalutudki võtavad noosi",
"24": "<span>24</span> ja ükski elanik ei ütle: 'Ma olen nõder!' Rahvale, kes seal elab, antakse süü andeks."
},
"34": {
"1": "<span>1</span> Rahvad, astuge ligi kuulma, ja rahvahõimud, pange tähele! Kuulgu maa ja need, kes seda täidavad, maailm ja kõik, kes seal võrsuvad!",
"2": "<span>2</span> Sest Issandal on raev kõigi rahvaste ja viha kõigi nende väehulkade vastu: ta on pannud need vande alla, ta on andnud need tapetavaiks.",
"3": "<span>3</span> Kes neist maha lüüakse, visatakse ära, nende laipadest tõuseb lehk, nende verest nõretavad mäed.",
"4": "<span>4</span> Kõik taevaväed kaovad, taevad keerduvad kokku otsekui rullraamat: kogu nende vägi variseb, nagu variseb viinapuust leht või viigipuust kuivanud mari.",
"5": "<span>5</span> Sest mu mõõk on joobunud taevas, vaata, see langeb alla Edomi peale, minu poolt neetud rahva peale kohtumõistmiseks.",
"6": "<span>6</span> Issanda mõõk on verine, tilgub rasvast, tallede ja sikkude verest, jäärade neerurasvast, sest Issandal on ohver Bosras ja palju tapmist Edomimaal.",
"7": "<span>7</span> Metshärjadki langevad koos nendega, härjavärsid koos sõnnidega: nende maa joobub verest ja muld muutub rasvast rammusaks.",
"8": "<span>8</span> Sest see on Issanda kättemaksupäev, tasumisaasta riiu eest Siioniga.",
"9": "<span>9</span> Edomi jõed muutuvad tõrvaks, muld väävliks, ja ta maa on otsekui põlev tõrv.",
"10": "<span>10</span> See ei kustu ööl ega päeval, igavesti tõuseb selle suits. See jääb laastatuks põlvest põlve, iialgi ei käi keegi sealtkaudu.",
"11": "<span>11</span> Puguhani ja siil pärivad selle, öökull ja kaaren elutsevad seal; selle üle veetakse tühjuse mõõdunöör ja paljasoleku lood.",
"12": "<span>12</span> Seal ei ole enam ülikuid, et kedagi kuningaks kuulutada, ja kõik ta vürstid saavad otsa.",
"13": "<span>13</span> Tema paleedes kasvavad kibuvitsad, linnustes nõgesed ja ohakad; see saab ðaakalite asukohaks ja jaanalindude pesitsuspaigaks.",
"14": "<span>14</span> Kurjad vaimud kohtuvad seal sortsidega ja sikujalgne paharet hüüab seltsilist. Tõesti, seal viibib tont ja leiab enesele puhkepaiga.",
"15": "<span>15</span> Seal pesitseb süstmadu, muneb, haub pojad välja, ja kogub oma varju alla. Tõesti, sinna kogunevad raisakotkad, igaüks oma paarilisega.",
"16": "<span>16</span> Uurige Issanda raamatust ja lugege: ükski neist ei ole puudu, ükski neist ei ole teist kaotanud, sest tema on oma suu kaudu andnud käsu ja tema Vaim on need kogunud.",
"17": "<span>17</span> Tema on neile liisku heitnud, tema käsi on selle neile mõõdunööriga jaotanud: nad pärivad selle igaveseks, nad elavad seal põlvest põlve."
},
"35": {
"1": "<span>1</span> Kõrb ja liivik rõõmutsevad, nõmmemaa hõiskab ja õitseb nagu liilia.",
"2": "<span>2</span> Ta õitseb kaunisti ja ilutseb rõõmu ning hõiskamisega, temale antakse Liibanoni toredus, Karmeli ja Saaroni ilu. Nad saavad näha Issanda toredust, meie Jumala ilu.",
"3": "<span>3</span> Kinnitage nõrku käsi ja tehke tugevaks komistavad põlved!",
"4": "<span>4</span> Öelge neile, kel rahutu süda: Olge kindlad, ärge kartke! Vaata, teie Jumal! Kättemaks tuleb, teie Jumala karistus; tema ise tuleb ja päästab teid.",
"5": "<span>5</span> Siis avanevad pimedate silmad ja kurtide kõrvad lähevad lahti.",
"6": "<span>6</span> Siis hüppab jalutu otsekui hirv ja keeletu keel hõiskab, sest veed keevad üles kõrbes ja ojad nõmmemaal.",
"7": "<span>7</span> Kuumavirvendusest saab järv ja põuasest pinnast keevad veeallikad üles; seal, kus on ðaakalite eluase, kasvab kaislaid, kõrkjaid ja pilliroogu.",
"8": "<span>8</span> Ja seal on maantee ja tee, mida nimetatakse pühaks teeks; ükski rüve ei või sellel käia, vaid see on tema rahva jaoks: kes seda teed käib, ei eksi, rumaladki mitte.",
"9": "<span>9</span> Seal ei ole lõvi ega lähe sinna murdjad kiskjad, neid seal ei leidu. Aga lunastatud käivad.",
"10": "<span>10</span> Ja Issanda vabaksostetud pöörduvad tagasi ning tulevad Siionisse hõisates. Nende pea kohal on igavene rõõm: rõõm ja ilutsemine valdavad neid, aga kurbus ja ohkamine põgenevad ära."
},
"36": {
"1": "<span>1</span> Kuningas Hiskija neljateistkümnendal aastal tuli Assuri kuningas Sanherib kõigi Juuda kindlustatud linnade kallale ja vallutas need.",
"2": "<span>2</span> Ja Assuri kuningas läkitas Laakisest Jeruusalemma kuningas Hiskija vastu ülemjoogikallaja suure väehulgaga, kes jäi peatuma Ülatiigi veejuhtme juurde, mis on Vanutajavälja maantee ääres.",
"3": "<span>3</span> Siis läksid välja tema juurde Eljakim, Hilkija poeg, kes oli kojaülem, kirjutaja Sebna ja nõunik Joah, Aasafi poeg.",
"4": "<span>4</span> Ja ülemjoogikallaja ütles neile: 'Öelge ometi Hiskijale: Nõnda ütleb suurkuningas, Assuri kuningas: Mis lootus see on, mida sa hellitad?",
"5": "<span>5</span> Sa arvad, et paljad sõnad annavad võitluseks nõu ja jõu? Kelle peale sa loodad, et oled mulle vastu hakanud?",
"6": "<span>6</span> Vaata, sa loodad Egiptuse, tolle murtud pillirookepi peale, mis tungib pihku ja puurib selle läbi, kui keegi selle peale toetub. Niisugune on vaarao, Egiptuse kuningas, kõigile, kes tema peale loodavad.",
"7": "<span>7</span> Või kui sa mulle ütled: Meie loodame Issanda, oma Jumala peale!, kas pole siis mitte tema see, kelle ohvrikünkad ja altarid Hiskija kõrvaldas, öeldes Juudale ja Jeruusalemmale: Selle altari ees peate te kummardama!?",
"8": "<span>8</span> Nüüd aga vea ometi kihla mu isandaga, Assuri kuningaga: mina annan sulle kaks tuhat hobust, kui sa suudad hankida neile ratsanikke!",
"9": "<span>9</span> Kuidas sa siis saaksid tagasi tõrjuda asevalitseja, ühe mu isanda vähimaist sulaseist? Aga sa loodad Egiptuse, tema sõjavankrite ja ratsanike peale.",
"10": "<span>10</span> Kas ma siis nüüd Issandata olen tulnud selle maa vastu, et seda hävitada? Issand ise ütles mulle: Mine sinna maale ja hävita see!'",
"11": "<span>11</span> Siis ütlesid Eljakim, Sebna ja Joah ülemjoogikallajale: 'Räägi ometi oma sulastega aramea keelt, sest me mõistame seda, aga ära räägi meiega juudi keelt müüri peal oleva rahva kuuldes!'",
"12": "<span>12</span> Kuid ülemjoogikallaja vastas: 'Kas mu isand on mind läkitanud kõnelema neid sõnu ainult su isandale ja sinule? Küllap ka müüri peal istuvaile meestele, kes koos teiega peavad sööma oma rooja ja jooma oma kust!'",
"13": "<span>13</span> Ning ülemjoogikallaja astus ette ja hüüdis valju häälega juudi keeles ning ütles: 'Kuulge suurkuninga, Assuri kuninga sõnu!",
"14": "<span>14</span> Nõnda ütleb kuningas: Ärge laske endid Hiskijast petta, sest tema ei suuda teid päästa!",
"15": "<span>15</span> Ärgu pangu Hiskija teid lootma Issanda peale, öeldes: Issand päästab meid kindlasti ja seda linna ei anta Assuri kuninga kätte!",
"16": "<span>16</span> Ärge kuulake Hiskijat, sest Assuri kuningas ütleb nõnda: Tehke minuga alistusleping ja tulge välja mu juurde, siis te võite süüa igamees oma viinapuust ja igamees oma viigipuust ja juua igamees oma kaevust vett,",
"17": "<span>17</span> kuni ma tulen ja viin teid maale, mis on teie maa sarnane, vilja ja veini maa, leiva ja viinamägede maa.",
"18": "<span>18</span> Asjata ässitab teid Hiskija ja ütleb: Issand päästab meid! Kas on muude rahvaste jumalaist mõni päästnud oma maa Assuri kuninga käest?",
"19": "<span>19</span> Kus on Hamati ja Arpadi jumalad? Kus on Sefarvaimi jumalad? Kas need päästsid Samaaria minu käest?",
"20": "<span>20</span> Kes kõigist nende maade jumalaist on päästnud oma maa minu käest, et Issand peaks päästma minu käest Jeruusalemma?'",
"21": "<span>21</span> Aga nad vaikisid ega vastanud temale sõnagi, sest niisugune oli kuninga käsk, kes oli öelnud: 'Ärge vastake temale!'",
"22": "<span>22</span> Siis tulid kojaülem Eljakim, Hilkija poeg, ja kirjutaja Sebna ja nõunik Joah, Aasafi poeg, Hiskija juurde, riided lõhki käristatud, ja kandsid temale ette ülemjoogikallaja sõnad."
},
"37": {
"1": "<span>1</span> Kui kuningas Hiskija seda kuulis, siis ta käristas oma riided lõhki, kattis ennast kotiriidega ja läks Issanda kotta.",
"2": "<span>2</span> Ja ta läkitas kojaülema Eljakimi, kirjutaja Sebna ja preestrite vanemad, kotiriided seljas, prohvet Jesaja, Aamotsi poja juurde,",
"3": "<span>3</span> et need ütleksid temale: 'Nõnda ütleb Hiskija: See päev on ahastuse, sõitluse ja teotuse päev. Jah, lapsed on küll jõudnud emakasuudmeni, aga sünnituseks ei ole jõudu.",
"4": "<span>4</span> Vahest Issand, su Jumal, kuuleb siiski ülemjoogikallaja sõnu? Tema isand, Assuri kuningas, läkitas ta teotama elavat Jumalat, ja nõuab aru nende sõnade pärast, mida Issand, su Jumal, on pidanud kuulma. Tee siis palvet selle jäägi pärast, kes veel on olemas!'",
"5": "<span>5</span> Kui kuningas Hiskija sulased tulid Jesaja juurde,",
"6": "<span>6</span> siis ütles Jesaja neile: 'Öelge oma isandale nii: Nõnda ütleb Issand: Ära karda sõnade pärast, mida sa oled kuulnud, millega Assuri kuninga poisid mind on teotanud!",
"7": "<span>7</span> Vaata, ma panen temasse niisuguse vaimu, et kui ta kuuleb kuulujuttu, siis ta läheb tagasi oma maale ja ma lasen ta langeda mõõga läbi tema oma maal.'",
"8": "<span>8</span> Ja ülemjoogikallaja pöördus tagasi ning leidis Assuri kuninga sõdivat Libna vastu; sest ta oli kuulnud, et too oli Laakisest edasi läinud.",
"9": "<span>9</span> Aga kui Sanherib kuulis kõneldavat Tirhakast, Etioopia kuningast: 'Ta on välja tulnud, et sõdida sinu vastu', siis seda kuuldes läkitas ta käskjalad Hiskija juurde, öeldes:",
"10": "<span>10</span> 'Rääkige nõnda Hiskijaga, Juuda kuningaga, ja öelge: Ära lase ennast petta oma Jumalast, kelle peale sa loodad, arvates, et Jeruusalemma ei anta Assuri kuninga kätte!",
"11": "<span>11</span> Vaata, sa oled ju kuulnud, kuidas Assuri kuningad on talitanud kõigi maadega, neid sootuks hävitades. Ja sind peaks päästetama?",
"12": "<span>12</span> Kas rahvaste jumalad päästsid neid, keda mu isad hävitasid: Goosani, Haarani, Resefi ja Telassaris olevaid edenlasi?",
"13": "<span>13</span> Kus on Hamati kuningas ja Arpadi kuningas, Sefarvaimi linna, Heena ja Ivva kuningas?'",
"14": "<span>14</span> Kui Hiskija oli võtnud käskjalgade käest kirja ja oli seda lugenud, siis ta läks üles Issanda kotta; ja Hiskija laotas selle Issanda ette.",
"15": "<span>15</span> Ja Hiskija palvetas Issanda poole, öeldes:",
"16": "<span>16</span> 'Vägede Issand, Iisraeli Jumal, kes istud keerubite peal! Sina üksi oled kõigi maa kuningriikide Jumal, sina oled teinud taeva ja maa.",
"17": "<span>17</span> Pööra, Issand, oma kõrv ja kuule, ava, Issand, oma silm ja vaata! Kuule kõiki Sanheribi sõnu, millega ta on läkitanud teotama elavat Jumalat!",
"18": "<span>18</span> See on tõsi, Issand, et Assuri kuningad on rüüstanud kõiki rahvaid ja nende maid",
"19": "<span>19</span> ja on heitnud tulle nende jumalad; kuid need ei olnud jumalad, vaid olid inimeste kätetöö, puu ja kivi, ja seepärast nad võisid neid hävitada.",
"20": "<span>20</span> Aga nüüd, Issand, meie Jumal, päästa meid tema käest, et kõik maa kuningriigid tunneksid, et sina, Issand, oled ainus!'",
"21": "<span>21</span> Siis Jesaja, Aamotsi poeg, läkitas Hiskijale ütlema: 'Nõnda ütleb Issand, Iisraeli Jumal: Et sa mind oled palunud Assuri kuninga Sanheribi pärast,",
"22": "<span>22</span> siis on sõna, mis Issand tema kohta kõneleb, niisugune: Neitsi, Siioni tütar, põlastab sind, pilkab sind; Jeruusalemma tütar vangutab su taga pead.",
"23": "<span>23</span> Keda sa oled laimanud ja teotanud ja kelle vastu sa oled kõrgendanud häält? Kõrgele oled tõstnud oma silmad Iisraeli Püha vastu.",
"24": "<span>24</span> Sa laimasid oma sulaste läbi Issandat ja ütlesid: 'Ma tõusin oma vankrite hulgaga mägede harjadele, Liibanoni kaugemaisse kurudesse; ma raiusin maha ta kõrged seedrid, ta valitud küpressid, ma tungisin ta suurimasse kõrgusse, ta tihedaimasse metsa.",
"25": "<span>25</span> Ma kaevasin kaevusid ja jõin vett, ja ma kuivatasin oma jalataldadega kõik Egiptuse jõed.'",
"26": "<span>26</span> Kas sa pole kuulnud, et mina olen seda valmistanud ammusest ajast, kavatsenud muistseist päevist peale? Nüüd olen mina lasknud sündida, et sa võisid purustada kindlustatud linnu varisenud kivihunnikuiks,",
"27": "<span>27</span> et nende elanikud olid jõuetud, täis hirmu ja häbi, olid nagu rohi väljal, haljad taimekesed, nagu hein katustel või idatuule ees kõrbev vili.",
"28": "<span>28</span> Ma tean su istumist ja astumist, su minekut ja tulekut, ka su raevutsemist minu vastu.",
"29": "<span>29</span> Aga et sa raevutsed mu vastu ja su ülbus on ulatunud mu kõrvu, siis ma panen konksu sulle ninna, suulised suhu ja viin sind tagasi sedasama teed, mida mööda sa tulidki.",
"30": "<span>30</span> Ja see olgu sulle, Hiskija, märgiks: sel aastal tuleb süüa isekasvanud vilja ja teisel aastal järelkasvu, aga kolmandal aastal te külvate ja lõikate ning istutate viinamägesid ja sööte nende vilja!",
"31": "<span>31</span> Ja Juuda soost pääsenute jääk juurdub taas alt ja kannab vilja pealt.",
"32": "<span>32</span> Sest Jeruusalemmast tuleb välja jääk ja Siioni mäelt pääsenu. Seda teeb vägede Issanda püha viha.",
"33": "<span>33</span> Seepärast ütleb Issand Assuri kuninga kohta nõnda: Sellesse linna ta ei tule ja ta ei ammu siia nooli; ta ei tule selle ette kilbiga ega kuhja selle vastu piiramisvalli.",
"34": "<span>34</span> Sedasama teed, mida mööda ta tuli, läheb ta tagasi ja sellesse linna ta ei tule, ütleb Issand.",
"35": "<span>35</span> Sest ma kaitsen seda linna, et seda päästa iseenese pärast ja oma sulase Taaveti pärast.'",
"36": "<span>36</span> Ja Issanda ingel läks välja ning lõi Assuri leeris maha sada kaheksakümmend viis tuhat meest; ja kui hommikul vara üles tõusti, vaata, siis olid need kõik surnud.",
"37": "<span>37</span> Siis Assuri kuningas Sanherib asus teele, läks tagasi koju ja jäi Niinevesse.",
"38": "<span>38</span> Aga kord, kui ta kummardas oma jumala Nisroki templis, lõid ta pojad Adrammelek ja Sareser tema mõõgaga maha ning põgenesid ise Araratimaale. Ja tema poeg Eesar-Haddon sai tema asemel kuningaks."
},
"38": {
"1": "<span>1</span> Neil päevil jäi Hiskija haigeks ja oli suremas. Ja prohvet Jesaja, Aamotsi poeg, tuli ta juurde ning ütles temale: 'Nõnda ütleb Issand: Sea oma elumaja asjad korda, sest sa sured ega saa terveks!'",
"2": "<span>2</span> Siis Hiskija pööras oma näo seina poole ja palus Issandat",
"3": "<span>3</span> ning ütles: 'Oh Issand, meenuta ometi, kuidas ma sinu ees olen elanud ustavuses ja siira südamega ja olen teinud, mis sinu silmis hea on!' Ja Hiskija nuttis kibedasti.",
"4": "<span>4</span> Aga Jesajale tuli Issanda sõna, kes ütles:",
"5": "<span>5</span> 'Mine ja ütle Hiskijale: Nõnda ütleb Issand, su isa Taaveti Jumal: Ma olen kuulnud su palvet, ma olen näinud su silmavett. Vaata, ma lisan su elupäevadele viisteist aastat",
"6": "<span>6</span> ja ma päästan sinu ja selle linna Assuri kuninga pihust ning kaitsen seda linna.",
"7": "<span>7</span> Ja see olgu sulle märgiks Issandalt, et Issand teeb, nagu ta on öelnud:",
"8": "<span>8</span> Vaata, ma lasen varjul, mis Aahase päikesekellal on laskunud koos päikesega, kümme pügalat tagasi minna.' Ja päike läkski päikesekellal tagasi need kümme pügalat, mis ta oli laskunud.",
"9": "<span>9</span> Juuda kuninga Hiskija tänulaul pärast haigusest tervenemist:",
"10": "<span>10</span> 'Ma ütlesin iseeneses: Oma elupäevade poolel teel pean ma minema surmavalla väravaisse; minult on röövitud mu ülejäänud aastad.",
"11": "<span>11</span> Ma mõtlesin: Ma ei saa näha Issandat, Issandat elavate maal, ei enam vaadata inimest maailma elanike keskel.",
"12": "<span>12</span> Mu telklaager kistakse üles ja keeratakse minu käest rulli otsekui karjase telk; ma rullin nagu kangur oma elu kokku, mind lõigatakse lõime küljest. Enne kui päev jõuab õhtule, teed sa mulle lõpu.",
"13": "<span>13</span> Ma ootasin hommikuni - otsekui murraks lõvi, nõnda murti kõik mu luud-liikmed. Enne kui päev jõuab õhtule, teed sa mulle lõpu.",
"14": "<span>14</span> Nagu pääsuke või rästas, nõnda ma häälitsesin, kudrutasin otsekui tuvi. Mu silmad väsisid kõrgusesse vaadates: Issand, ma olen rõhutud, astu mulle appi!",
"15": "<span>15</span> Mis oleks mul rääkida ja temale öelda? Tema ju tegi seda! Ma kõnnin tasakesi kõik oma aastad oma hinge kibeduse pärast.",
"16": "<span>16</span> Issand, nõndamoodi jäädakse elama ja selles kõiges on mu vaimu elu: sina teed mind terveks ja hoiad mind elus.",
"17": "<span>17</span> Vaata, mu suur kibedus muutus rahuks: sina kiindusid mu hinge hukatuse augus, sest sa heitsid kõik mu patud oma selja taha.",
"18": "<span>18</span> Sest surmavald ei kiida sind, surm ei ülista sind, hauda vajunud ei looda su ustavuse peale.",
"19": "<span>19</span> Elav, ainult elav kiidab sind, nõnda nagu minagi teen täna: isa kuulutab lastele sinu ustavust.",
"20": "<span>20</span> Issand oli valmis mind päästma, seepärast mängigem mu keelpillidel kõik oma elupäevad Issanda kojas!'",
"21": "<span>21</span> Jesaja oli öelnud: 'Tooge viigimarjakakk ja asetage paisele, et ta saaks terveks!'",
"22": "<span>22</span> Ja Hiskija oli küsinud: 'Mis on märgiks, et ma võin minna Issanda kotta?'"
},
"39": {
"1": "<span>1</span> Sel ajal läkitas Paabeli kuningas Merodak-Baladan, Baladani poeg, saadikud kingitustega Hiskija juurde, kui ta oli kuulnud tema haigusest ning paranemisest.",
"2": "<span>2</span> Ja Hiskija tundis neist rõõmu ja näitas neile oma varaaita, hõbedat ja kulda, kalleid rohte ja parimat õli ja kogu oma sõjariistade kambrit ning kõike, mis leidus ta varanduste hulgas; Hiskija ei jätnud neile midagi näitamata oma kojas ja kogu oma valitsemisalal.",
"3": "<span>3</span> Aga prohvet Jesaja tuli kuningas Hiskija juurde ja küsis temalt: 'Mida need mehed rääkisid ja kust nad su juurde tulid?' Ja Hiskija vastas: 'Nad tulid mu juurde kaugelt maalt, Paabelist.'",
"4": "<span>4</span> Siis ta küsis: 'Mida nad su kojas nägid?' Ja Hiskija vastas: 'Nad nägid kõike, mis mu kojas on; oma varanduste hulgast ei jätnud ma midagi neile näitamata.'",
"5": "<span>5</span> Siis Jesaja ütles Hiskijale: 'Kuule vägede Issanda sõna:",
"6": "<span>6</span> Vaata, päevad tulevad, mil kõik, mis su kojas on ja mis su vanemad tänapäevani on kogunud, viiakse ära Paabelisse! Mitte midagi ei jää järele, ütleb Issand.",
"7": "<span>7</span> Ja sinu poegadest, kes sinust põlvnevad, kes sulle sünnivad, võetakse mõned ja neist saavad õukonnateenrid Paabeli kuninga palees.'",
"8": "<span>8</span> Siis Hiskija ütles Jesajale: 'Issanda sõna, mida sa oled kõnelnud, on hea.' Sest ta mõtles: 'Minu päevil on ju ometi rahu ning julgeolek.'"
},
"40": {
"1": "<span>1</span> Trööstige, trööstige minu rahvast, ütleb teie Jumal.",
"2": "<span>2</span> Rääkige Jeruusalemma meele järgi ja kuulutage temale, et ta vaev on lõppenud, et ta süü on lepitatud, et ta on saanud Issanda käest kahekordselt kõigi oma pattude eest.",
"3": "<span>3</span> Hüüdja hääl: 'Valmistage kõrbes Issanda teed, tehke lagendikul maantee tasaseks meie Jumalale!",
"4": "<span>4</span> Kõik orud ülendatagu ja kõik mäed ning künkad alandatagu: mis mätlik, saagu tasaseks, ja mis konarlik, siledaks maaks!",
"5": "<span>5</span> Siis ilmub Issanda au ja kõik liha näeb seda üheskoos. Jah, Issanda suu on rääkinud.'",
"6": "<span>6</span> Hääl ütleb: 'Kuuluta!' Ja teine kostab: 'Mida ma pean kuulutama?' 'Kõik liha on nagu rohi ja kõik tema hiilgus nagu õieke väljal.",
"7": "<span>7</span> Rohi kuivab ära, õieke närtsib, kui Issanda tuul puhub selle peale. Tõesti, rahvas on nagu rohi.",
"8": "<span>8</span> Rohi kuivab ära, õieke närtsib, aga meie Jumala sõna püsib igavesti.'",
"9": "<span>9</span> Astu kõrgele mäele, Siioni sõnumiviija, tõsta valjusti häält, Jeruusalemma sõnumiviija, tõsta, ära karda! Ütle Juuda linnadele: 'Vaata, teie Jumal!'",
"10": "<span>10</span> Vaata, Issand Jumal tuleb jõuliselt ja tema käsivars valitseb. Vaata, temaga koos on te palk ja tema ees on teie töötasu.",
"11": "<span>11</span> Otsekui karjane hoiab ta oma karja, kogub oma käsivarrega tallekesi ja kannab neid süles, talutab imetajaid lambaid.",
"12": "<span>12</span> Kes on mõõtnud pihuga vee? Või määranud vaksaga taeva? Või kogunud vakaga maa põrmu? Või vaaginud margapuuga mäed ja kaalukaussidega künkad?",
"13": "<span>13</span> Kes on juhatanud Issanda Vaimu või teda õpetanud tema nõuandjana?",
"14": "<span>14</span> Kellega on ta nõu pidanud, et see annaks temale arusaamise ja õpetaks õiguse rada, õpetaks temale tarkust ja teeks teatavaks mõistuse tee?",
"15": "<span>15</span> Vaata, rahvad on otsekui tilk ämbris ja neid peetakse kübemeks kaalukaussidel. Vaata, ta tõstab saared üles kui tolmukübemed.",
"16": "<span>16</span> Ja Liibanonist ei jätku tulepuudeks ega selle loomadest põletusohvriks.",
"17": "<span>17</span> Kõik rahvad on tema ees nagu eimiski, ta peab neid vähemaks kui olematus ja tühjus.",
"18": "<span>18</span> Kellega te siis võrdlete Jumalat ja missuguse kujutise võiksite temast teha?",
"19": "<span>19</span> Jumalakuju? Selle valab valaja. Ja kullassepp kuldab selle üle ning sepistab sellele hõbekette.",
"20": "<span>20</span> Kes on vaene selleks andi andma, valib kõdunematu puu, otsib enesele osava meistri, et see valmistaks kõikumatu kuju.",
"21": "<span>21</span> Kas te ei tea? Kas te ei ole kuulnud? Kas teile ei ole algusest peale kuulutatud? Kas te ei ole taibanud maailma alustest,",
"22": "<span>22</span> et see on tema, kes istub maasõõri kohal, mille elanikud on nagu rohutirtsud; kes laotab taevad laiali kui loori ja venitab neid otsekui telki selles elamiseks;",
"23": "<span>23</span> kes ei pane aukandjaid mikski ja teeb tühiseks maa kohtumõistjad?",
"24": "<span>24</span> Vaevalt on nad istutatud, vaevalt on nad külvatud, vaevalt on nende tüvi maas juurdunud, kui ta juba puhub nende peale ja nad kuivavad ning tuulekeeris puhub nad ära kui kõrred.",
"25": "<span>25</span> Kellega te siis võrdlete mind ja kelle sarnane ma olen? ütleb see, kes on Püha.",
"26": "<span>26</span> Tõstke oma silmad ja vaadake kõrgusse: kes on loonud need seal? Tema, kes nende väe viib välja täiearvuliselt, kes nimetab neid kõiki nimepidi. Tema suure väe ja võimsa jõu tõttu ei puudu neist ainsatki.",
"27": "<span>27</span> Mispärast ütled sina, Jaakob, ja räägid sina, Iisrael: 'Minu tee on varjul Issanda eest ja mu õigus läheb mööda mu Jumalast?'",
"28": "<span>28</span> Kas sa ei tea? Kas sa ei ole kuulnud? Igavene Jumal, Issand, on maailma äärte Looja; tema ei väsi ega tüdi, tema mõistus on uurimatu.",
"29": "<span>29</span> Tema annab rammetule rammu ja jõuetule jõudu.",
"30": "<span>30</span> Poisidki väsivad ja tüdivad, noored mehed komistavad ja kukuvad,",
"31": "<span>31</span> aga kes ootavad Issandat, saavad uut rammu, need tõusevad tiibadega üles nagu kotkad: nad jooksevad ega tüdi, nad käivad ega väsi."
},
"41": {
"1": "<span>1</span> Kuulake mind vaikides, saared, ja rahvad, koguge jõudu! Astuge ligi, rääkige siis, mingem üheskoos kohtu ette!",
"2": "<span>2</span> Kes äratas ida poolt selle, kel kordaminek kannul käib? Kes andis tema kätte rahvad ja alistas kuningad, et ta mõõk need põrmustaks ja ta amb teeks nad hajuvaiks kõrteks?",
"3": "<span>3</span> Tema ajab neid taga, kulgeb ohutult rada, mida ta jalad ei käi.",
"4": "<span>4</span> Kes on seda teinud ja teostanud? See, kes algusest peale on kutsunud rahvapõlvi: Mina, Issand, olen esimene ja olen viimastegi juures seesama.",
"5": "<span>5</span> Saared nägid ja kartsid, maailma ääred värisesid, nad astusid ligi ja tulid.",
"6": "<span>6</span> Üks aitas teist ja ütles oma vennale: 'Ole vahva!'",
"7": "<span>7</span> Valaja julgustab kullasseppa, naastu vasardaja alasil tagujat, öeldes joodetu kohta: 'See on hea!' ja kinnitades naeltega, et see ei kõiguks.",
"8": "<span>8</span> Aga sina, Iisrael, mu sulane, Jaakob, kelle ma olen valinud, mu sõbra Aabrahami sugu,",
"9": "<span>9</span> sina, kelle ma võtsin maailma äärtest ja kutsusin selle kaugemaist paigust, öeldes sulle: 'Sina oled mu sulane, ma valisin sinu ega põlanud sind!' -",
"10": "<span>10</span> ära karda, sest mina olen sinuga; ära vaata ümber, sest mina olen su Jumal: ma teen su tugevaks, ma aitan sind, ma toetan sind oma õiguse parema käega!",
"11": "<span>11</span> Vaata, häbenema ja piinlikkust tundma peavad kõik, kes on sinule vihased; olematuks saavad ja hukkuvad mehed, kes riidlevad sinuga.",
"12": "<span>12</span> Sa otsid, aga enam sa ei leia neid mehi, kes võitlevad sinu vastu; olematuks saavad ja lõpevad mehed, kes sõdivad sinu vastu.",
"13": "<span>13</span> Sest mina olen Issand, su Jumal, kes kinnitab su paremat kätt, kes sulle ütleb: 'Ära karda, mina aitan sind!'",
"14": "<span>14</span> Ära karda, ussike Jaakob, väetike Iisrael, mina aitan sind, ütleb Issand ja su lunastaja, Iisraeli Püha.",
"15": "<span>15</span> Vaata, ma panen sind pahmareeks, uueks ja paljuhambuliseks: sa peksad mägesid nagu reht ja jahvatad neid, teed künkad aganaiks;",
"16": "<span>16</span> sa tuulad neid, tuul kannab neid, torm puistab need laiali. Aga sina ise ilutsed Issanda tõttu, kiitled Iisraeli Püha tõttu.",
"17": "<span>17</span> Kui viletsad ja vaesed asjata otsivad vett ja nende keel kuivab janust, siis mina, Issand, kuulen neid, mina, Iisraeli Jumal, ei jäta neid maha.",
"18": "<span>18</span> Ma panen jõed voolama viljatuil künkail ja allikad orgude põhjas; ma muudan järveks kõrbe ja veelätteiks põuase maa.",
"19": "<span>19</span> Ma istutan kõrbesse seedreid, akaatsiaid, mürte ja õlipuid; ma panen lagendikule küpresse koos plataanide ja piiniatega,",
"20": "<span>20</span> et nad näeksid ja teaksid, tähele paneksid ja ühtlasi mõistaksid, et seda on teinud Issanda käsi ja selle on loonud Iisraeli Püha.",
"21": "<span>21</span> Tooge ette oma riiuasi, ütleb Issand, esitage oma tõendid, ütleb Jaakobi kuningas!",
"22": "<span>22</span> Esitage ja kuulutage meile, mis on tulemas! Jutustage endisist asjust, missugused need olid, et saaksime südamesse võtta ja mõista nende tulemusi! Või laske meid kuulda tulevasi asju,",
"23": "<span>23</span> kuulutage, mis tuleb pärastpoole, et me teaksime, kas te olete jumalad. Tehke ometi midagi, olgu head või kurja, et saaksime üheskoos imetleda ja näha.",
"24": "<span>24</span> Vaata, teie ei olegi midagi ja teie töö on tühjast: kes teid eelistab, teeb jäledust.",
"25": "<span>25</span> Mina äratasin põhja poolt ühe, ja ta tuli, päikesetõusu poolt mu nime appihüüdja, kes tallab valitsejaid nagu savi, otsekui sõtkuks potissepp saue.",
"26": "<span>26</span> Kes on seda kuulutanud algusest peale, et oleksime seda teadnud, et oleksime saanud öelda: 'Temal oli õigus!'? Ükski ei teatanud, ükski ei kuulutanud, ükski ei kuulnud teie sõnu.",
"27": "<span>27</span> Vaata, mina olin esimene, kes kuulutas Siionile: 'Näe, siin nad on!' ja andis Jeruusalemmale hea sõnumi tooja.",
"28": "<span>28</span> Ja kui ma vaatan, siis ei olegi kedagi, ja neist ei ole nõuandjat, et saaksin neilt küsida ja nad annaksid vastuse.",
"29": "<span>29</span> Vaata, nad kõik on tühised, nende teod on eimiski, nende valatud kujud on tühipaljas tuul."
},
"42": {
"1": "<span>1</span> Vaata, see on mu sulane, kellesse ma olen kiindunud, mu valitu, kellest mu hingel on hea meel. Ma olen pannud oma Vaimu tema peale, tema toob rahvaile õiguse.",
"2": "<span>2</span> Tema ei kisenda ega karju, tema häält ei ole kuulda tänavail.",
"3": "<span>3</span> Rudjutud pilliroogu ei murra ta katki ja hõõguvat tahti ei kustuta ta ära, ta levitab ustavalt õigust.",
"4": "<span>4</span> Tema ei nõrke ega murdu, kuni ta maa peal on rajanud õiguse ja saared ootavad tema õpetust.",
"5": "<span>5</span> Nõnda ütleb Jumal, Issand, kes on loonud taeva ja on selle võlvinud, kes on laotanud maa ja sellest võrsuva, kes on andnud hingeõhu selle rahvale ja vaimu neile, kes seal peal käivad:",
"6": "<span>6</span> Mina, Issand, olen õigusega sind kutsunud ja kinnitan su kätt; ma kaitsen sind ja panen sinu rahvale lepinguks, paganaile valguseks,",
"7": "<span>7</span> avama pimedate silmi, vabastama vange vangistusest, pimeduses istujaid vangikojast.",
"8": "<span>8</span> Mina olen Issand, see on mu nimi, ja mina ei anna oma au teisele ega oma kiidetavust nikerdatud kujudele.",
"9": "<span>9</span> Vaata, eelmised sündmused on aset leidnud ja ma kuulutan uusi; enne kui need toimuma hakkavad, teen ma need teile teatavaks.",
"10": "<span>10</span> Laulge Issandale uut laulu tema kiituseks maailma äärest! Ilutsegu meri ja mis seda täidab, saared ja nende elanikud!",
"11": "<span>11</span> Tõstku häält kõrb ja selle linnad, külad, kus Keedar elab! Kaljude elanikud hõisaku, hüüdku valjusti mägede tippudelt!",
"12": "<span>12</span> Andku nad Issandale au ja kuulutagu saartel tema kiidetavust!",
"13": "<span>13</span> Issand läheb välja nagu kangelane, ta õhutab võitlusindu otsekui sõjamees; ta tõstab sõjakisa, hüüab valjusti, astub võidukalt oma vaenlaste vastu.",
"14": "<span>14</span> Ma olen kaua vaikinud, olnud tegevuseta, hoidnud ennast tagasi. Aga nüüd ma oigan otsekui sünnitaja, hingeldan ja ahmin õhku ühtaegu.",
"15": "<span>15</span> Ma laastan mäed ja künkad ning kuivatan kõik nende rohu; ma muudan jõed koolmeiks ja teen järved tahedaks.",
"16": "<span>16</span> Ma juhin pimedaid teel, mida nad ei tunne, ma lasen neid käia tundmatuid radu; ma muudan pimeduse nende ees valguseks ja konara tasaseks. Need on asjad, mis ma teen ega jäta tegemata.",
"17": "<span>17</span> Aga taganema ja häbenema peavad need, kes loodavad nikerdatud kujude peale, kes ütlevad valatud kujudele: 'Teie olete meie jumalad!'",
"18": "<span>18</span> Kurdid, kuulge, ja pimedad, tõstke oma pilk üles, et te näeksite!",
"19": "<span>19</span> Kes on pime, kui mitte mu sulane, ja kurt nagu mu käskjalg, kelle ma läkitan? Kes on nõnda pime nagu mu usaldusmees ja nõnda pime nagu Issanda sulane?",
"20": "<span>20</span> Sa oled näinud palju, aga ei ole tähele pannud; kõrvad on küll lahti, aga sa ei kuule.",
"21": "<span>21</span> Issandale meeldis oma õigluse pärast teha Seadus suureks ja võimsaks.",
"22": "<span>22</span> Ja see on paljaksriisutud ja rüüstatud rahvas: nad kõik on pandud aukudesse ja peidetud vangikodadesse; nad on jäänud saagiks ja päästjat ei ole, rüüsteks, ja ükski ei ütle: 'Anna tagasi!'",
"23": "<span>23</span> Kes teist võtab seda kuulda, paneb tähele ja kuuleb tuleviku tarvis?",
"24": "<span>24</span> Kes andis Jaakobi rüüstata ja Iisraeli riisujate kätte? Kas mitte Issand, kelle vastu me pattu tegime, kelle teedel ei tahetud käia ja kelle Seadust ei tahetud kuulda?",
"25": "<span>25</span> Seepärast ta valas tema peale oma vihalõõma ja sõjajõu: see põletas teda igalt poolt, kuid ta ei saanud targaks; kõrvetas teda, kuid ta ei võtnud seda südamesse."
},
"43": {
"1": "<span>1</span> Aga nõnda ütleb nüüd Issand, kes sind, Jaakob, on loonud, ja kes sind, Iisrael, on kujundanud: Ära karda, sest ma olen sind lunastanud, ma olen sind nimepidi kutsunud, sa oled minu päralt!",
"2": "<span>2</span> Kui sa lähed läbi vee, siis olen mina sinuga, ja kui sa lähed läbi jõgede, siis ei uputa need sind; kui sa käid tules, siis sa ei põle ja leek ei kõrveta sind.",
"3": "<span>3</span> Sest mina olen Issand, su Jumal, Iisraeli Püha, su Päästja; su lunahinnaks ma annan Egiptuse, sinu asemel Etioopia ja Seba.",
"4": "<span>4</span> Et sa mu silmis oled kallis ja auline ja et ma sind armastan, siis annan ma sinu asemel inimesi ja su hinge eest rahvaid.",
"5": "<span>5</span> Ära karda, sest mina olen sinuga, ma toon su soo päikesetõusu poolt ja ma kogun sind päikeseloojaku poolt.",
"6": "<span>6</span> Ma ütlen põhjamaale: Anna! ja lõunamaale: Ära keela! Too mu pojad kaugelt ja mu tütred maailma äärest,",
"7": "<span>7</span> kõik, keda nimetatakse minu nimega ja keda ma oma auks olen loonud, kujundanud ning valmis teinud!",
"8": "<span>8</span> Too välja pime rahvas, kellel siiski on silmad, ja kurdid, kellel siiski on kõrvad!",
"9": "<span>9</span> Kõik paganad on kogunenud ühte ja rahvad on kokku tulnud. Kes neist saaks jutustada niisuguseid asju ja kuulutada meile endisi sündmusi? Toogu nad oma tunnistajad ja õigustagu endid, las need kuulda ning öelda: 'See on tõsi!'",
"10": "<span>10</span> Teie olete minu tunnistajad, ütleb Issand, ja minu sulane, kelle ma olen valinud, et te teaksite, usuksite minusse ja mõistaksite, et mina olen see: enne mind ei ole olnud ühtegi jumalat ega tule ühtegi pärast mind.",
"11": "<span>11</span> Mina, mina olen Issand, ei ole muud päästjat kui mina.",
"12": "<span>12</span> Mina olen teatavaks teinud, päästnud ja kuulutanud, aga mitte mõni võõras teie hulgas; teie olete minu tunnistajad, ütleb Issand, et mina olen Jumal.",
"13": "<span>13</span> Ka edaspidi olen ma seesama ja ükski ei päästa minu käest. Mina teen, ja kes saaks seda takistada?",
"14": "<span>14</span> Nõnda ütleb Issand, teie lunastaja, Iisraeli Püha: teie pärast ma läkitan Paabelisse, ja toon alla kõik põgenikud, ka kaldealased, käratsedes laevadesse.",
"15": "<span>15</span> Mina, Issand, olen teie Püha, mina, Iisraeli Looja, olen teie kuningas.",
"16": "<span>16</span> Nõnda ütleb Issand, kes tegi tee merre ja jalgraja võimsasse vette,",
"17": "<span>17</span> kes tõi välja vankrid ja hobused, väe ja vägevad mehed; need lamavad üheskoos ega tõuse enam, nad on vaibunud, kustunud otsekui taht.",
"18": "<span>18</span> Ärge tuletage meelde endisi asju ja ärge pange tähele, mis muiste on sündinud.",
"19": "<span>19</span> Vaata, mina teen hoopis uut: see juba tärkab, kas te ei märka? Ma teen kõrbessegi tee, tühjale maale jõed.",
"20": "<span>20</span> Mind austavad metsloomad, ðaakalid ja jaanalinnud, sest ma annan kõrbes vett, jõgesid tühjal maal, et joota oma valitud rahvast.",
"21": "<span>21</span> Rahvas, kelle ma enesele olen valmistanud, peab jutustama minu kiidetavusest.",
"22": "<span>22</span> Aga ei ole sina, Jaakob, mind kutsunud, ei ole sina, Iisrael, minu pärast vaeva näinud.",
"23": "<span>23</span> Sina ei ole mulle toonud oma põletusohvrite lambaid ega ole mind austanud oma tapaohvritega; mina ei ole sind pannud orjama roaohvriga ega ole vaevanud viirukiga.",
"24": "<span>24</span> Sina ei ole mulle ostnud raha eest kalmuseid ega ole mind küllastanud oma tapaohvrite rasvaga, vaid sa oled mulle tüli teinud oma pattudega, oled mind vaevanud oma süütegudega.",
"25": "<span>25</span> Mina, mina olen see, kes kustutab su üleastumised iseenese pärast ega pea meeles su patte.",
"26": "<span>26</span> Tuleta mulle meelde, käigem isekeskis kohut, räägi sina, et sa võiksid õigeks saada.",
"27": "<span>27</span> Su esiisa tegi pattu ja su eestkõnelejad astusid üles mu vastu.",
"28": "<span>28</span> Seepärast ma teotasin pühamu vürste, jätsin Jaakobi hävima ja Iisraeli laimualuseks."
},
"44": {
"1": "<span>1</span> Nüüd aga kuule, Jaakob, mu sulane, ja Iisrael, mu valitu!",
"2": "<span>2</span> Nõnda ütleb Issand, sinu Looja, emaihus valmistaja, sinu aitaja: Ära karda, mu sulane Jaakob, ja Jesurun, mu valitu!",
"3": "<span>3</span> Sest ma valan janusele vett ja kuivale voogusid; ma valan sinu soo peale oma Vaimu ja su järglaste peale oma õnnistuse,",
"4": "<span>4</span> et nad võrsuksid kui roogude vahel, otsekui remmelgad veeojade ääres.",
"5": "<span>5</span> Üks ütleb: 'Mina kuulun Issandale', teine nimetab ennast Jaakobi nimega, kolmas kirjutab oma käe peale: 'Issanda oma' ja võtab enesele aunimeks Iisrael.",
"6": "<span>6</span> Nõnda ütleb Issand, Iisraeli kuningas, ja tema lunastaja, vägede Issand: Mina olen esimene ja viimane, ja ei ole muud Jumalat kui mina.",
"7": "<span>7</span> Kes on minu sarnane? See hüüdku, jutustagu sellest ja kandku mulle ette! Sest ajast kui ma seadsin muistse rahva ja tulevased sündmused, jutustagu nad neile sellest, mis on tulemas.",
"8": "<span>8</span> Ärge värisege ja ärge kartke! Kas ma ei ole sulle juba ammu kuulutanud ja teatavaks teinud? Teie olete mu tunnistajad. Kas on muud Jumalat kui mina? Ei, muud kaljut ei ole, mina küll ei tea!",
"9": "<span>9</span> Nikerdatud kujude valmistajad on kõik tühised ja nende lemmikud ei suuda aidata; nende tunnistajad ise ei näe ega tea, et nad peaksid häbenema.",
"10": "<span>10</span> Kes küll peakski valmistama jumala ja valama kuju, millest ei ole kasu?",
"11": "<span>11</span> Vaata, kõik selle austajad jäävad häbisse ja sepistajad ise on ainult inimesed; las nad kõik tulevad kokku, astuvad ette: nad hakkavad üheskoos värisema ja häbenema!",
"12": "<span>12</span> Sepp taob rauast tööriista ja töötleb ääsil, vormib vasaratega ja taob oma käsivarre jõul; temalgi tuleb nälg ja ta jõud kaob; kui ta vett ei joo, siis ta väsib.",
"13": "<span>13</span> Puusepp pingutab mõõdunööri, tähistab kriidiga, voolib kaabitsatega, märgib sirkliga ja valmistab mehesarnase kuju, ilusa inimese taolise, et see asuks kojas.",
"14": "<span>14</span> Ta raiub enesele seedreid; ta valib raudtamme või tamme ja laseb metsapuude hulgas oma tarbeks tugevaks kasvada; ta istutab loorberipuu, vihm kasvatab selle suureks",
"15": "<span>15</span> ja sellest saab inimesele kütet: ta võtab seda enese soojendamiseks, samuti süütab ta selle, et leiba küpsetada; kuid ta valmistab sellest ka jumala ja kummardab seda, ta teeb sellest nikerdatud kuju ja põlvitab selle ette.",
"16": "<span>16</span> Osa sellest ta põletab tules; ta sööb süte pealt liha: küpsetab prae ja sööb kõhu täis, soojendab siis ennast ja ütleb: 'Küll on hea, mul on soe, ma tunnen tulepaistest mõnu!'",
"17": "<span>17</span> Aga selle jäänusest teeb ta jumala, oma nikerdatud kuju, põlvitab selle ette ja kummardab, palvetab selle poole ning ütleb: 'Päästa mind, sest sina oled mu jumal!'",
"18": "<span>18</span> Nad ei tea ega taipa midagi, sest nende silmad on nägemiseks ja südamed mõistmiseks suletud.",
"19": "<span>19</span> Ükski ei võta südamesse, ei ole tal teadmist ega taipu, et ta mõtleks: osa sellest olen põletanud tules, samuti olen selle süte peal küpsetanud leiba, praadinud liha ja söönud, ja nüüd peaksin ma selle jäänusest valmistama jäleduse, põlvitama puutüki ette!",
"20": "<span>20</span> Kes tuhka taga ajab, seda eksitab petetud süda, see ei suuda päästa oma hinge ega mõtle: Kas ei ole viimaks pettus mu paremas käes?",
"21": "<span>21</span> Tuleta seda meelde, Jaakob, ja sina, Iisrael, sest sa oled mu sulane: mina olen su valmistanud, sa oled mu sulane: Iisrael, ma ei unusta sind!",
"22": "<span>22</span> Ma kaotan su üleastumised nagu pilved ja su patud nagu pilvituse. Pöördu minu poole, sest ma lunastan sinu!",
"23": "<span>23</span> Hõisake, taevad, et Issand seda teeb, hüüdke, maa sügavused, rõkatage rõõmust, mäed, metsad ja kõik metsapuud, et Issand lunastab Jaakobi ja ilmutab Iisraelis oma au!",
"24": "<span>24</span> Nõnda ütleb Issand, su lunastaja, kes sind emaihus on valmistanud: Mina olen Issand, kes kõik teeb, kes üksinda võlvis taeva, laotas maa - kes oli koos minuga? -",
"25": "<span>25</span> kes teeb tühjaks valetajate tunnustähed ja muudab narrideks lausujad, kes tõrjub tagasi targad ja pöörab nende teadmised jõleduseks,",
"26": "<span>26</span> aga kes kinnitab oma sulase sõna ja viib täide oma käskjalgade nõu, kes ütleb Jeruusalemmale: 'Sinus hakatakse elama!' ja Juuda linnadele: 'Teid taastatakse, ma ehitan üles teie varemed!',",
"27": "<span>27</span> kes ütleb sügavikule: 'Kuiva! Ma lasen su jõed kuivada!',",
"28": "<span>28</span> kes ütleb Kooresele: 'Mu karjane!' Tema viib täide kõik, mida ma tahan, ja ütleb Jeruusalemmale: 'Sind ehitatakse üles ja rajatakse tempel!'"
},
"45": {
"1": "<span>1</span> Nõnda ütleb Issand oma võitule Kooresele, kelle paremast käest ma olen kinni haaranud, et alistada tema ees rahvaid ja päästa lahti kuningate vöösid, et avada tema ees uksi, et väravad ei jääks suletuks:",
"2": "<span>2</span> Mina käin su ees ja teen kingud tasaseks; ma purustan vaskuksed ja raiun katki raudriivid.",
"3": "<span>3</span> Ma annan sulle pimeduse varjust varandusi ja peidupaikadest aardeid, selleks et sa teaksid, et see olen mina, Issand, Iisraeli Jumal, kes sind on kutsunud nimepidi.",
"4": "<span>4</span> Oma sulase Jaakobi ja oma valitu Iisraeli pärast ma kutsusin sind nimepidi ja andsin sulle aunime, ehkki sa mind ei tundnud.",
"5": "<span>5</span> Mina olen Issand ja kedagi teist ei ole, ei ole ühtegi jumalat peale minu; mina vöötasin sind, ehkki sa mind ei tundnud,",
"6": "<span>6</span> et teataks päikesetõusu ja -loojaku pool, et ei ole ühtegi peale minu; mina olen Issand ja kedagi teist ei ole.",
"7": "<span>7</span> Mina valmistan valguse ja loon pimeduse, mina annan õnne ja toon õnnetuse, mina, Issand, teen seda kõike.",
"8": "<span>8</span> Kastke, taevad, ülalt ja pilved, pange voolama õiglus! Avanegu maa, et idaneks õnnistus ja ühtlasi võrsuks õiglus! Mina, Issand, olen selle loonud.",
"9": "<span>9</span> Häda sellele, kes riidleb oma valmistajaga - kild teiste savikildude seas. Kas ütleb savi oma vormijale: 'Mis sa teed?' ja su töö: 'Tal ei ole käsi!'?",
"10": "<span>10</span> Häda sellele, kes ütleb isale: 'Miks sa sigitad?' või naisele: 'Miks oled sünnitusvaludes?'!",
"11": "<span>11</span> Nõnda ütleb Issand, Iisraeli Püha ja tema Looja: Kas te küsitlete mind mu laste kohta ja annate mulle käsu mu kätetöö jaoks?",
"12": "<span>12</span> Mina tegin maa ja lõin inimesed selle peale; minu käed võlvisid taeva ja ma käsutasin kõiki tema vägesid.",
"13": "<span>13</span> Ma äratasin tema õiguse läbi ja ma teen kõik ta teed tasaseks; tema ehitab mu linna ja vabastab mu vangid hinnata ja meeleheata, ütleb vägede Issand.",
"14": "<span>14</span> Nõnda ütleb Issand: Egiptuse töövaev ja Etioopia kaubitsemine ja seebalased, pikakasvulised mehed, tulevad su juurde ja saavad su omaks; nad käivad su järel; tulevad ahelais ja kummardavad sind, palvetavad su poole: 'Ainult sinu juures on Jumal ja teist ei ole, ei ole ühtegi muud Jumalat!'",
"15": "<span>15</span> Tõesti, sina oled ennast varjav Jumal, Iisraeli Jumal, Päästja!",
"16": "<span>16</span> Häbenevad ja piinlikkust tunnevad kõik üheskoos, häbiga lähevad ebajumalate sepad.",
"17": "<span>17</span> Aga Issand päästab Iisraeli igavese päästega: teil ei ole vaja häbeneda ega tunda piinlikkust, iialgi mitte.",
"18": "<span>18</span> Sest nõnda ütleb Issand, taevaste Looja, tema, kes on Jumal, maa vormija ning valmistaja; tema, selle rajaja, ei ole loonud seda tühjaks, vaid on valmistanud selle, et seal elataks: Mina olen Issand ja kedagi teist ei ole.",
"19": "<span>19</span> Ei ole ma rääkinud salajas, maa pimedas paigas, ega ole ma öelnud Jaakobi soole: Otsige mind ilmaaegu. Mina, Issand, kõnelen õigust, kuulutan, mis on tõsi.",
"20": "<span>20</span> Kogunege ja tulge, liginege üheskoos, rahvaste pääsenud! Ei ole arusaamist neil, kes kannavad puukujusid ja palvetavad jumala poole, kes ei suuda päästa.",
"21": "<span>21</span> Kuulutage ja tooge esile, pidagu nad isekeskis nõu: kes on seda kuulutanud muistsest peale, teatavaks teinud ammusest ajast? Kas mitte mina, Issand? Ei ole ju muud jumalat peale minu, kes oleks õiglane Jumal ja Päästja, mitte ühtegi peale minu.",
"22": "<span>22</span> Pöörduge minu poole ja laske endid päästa, kõik maailma ääred, sest mina olen Jumal ja kedagi teist ei ole!",
"23": "<span>23</span> Ma olen iseeneses vandunud, mu suust on välja tulnud tõde, tagasivõetamatu sõna: Minu ees peab nõtkuma iga põlv, kõik keeled peavad andma mulle vande.",
"24": "<span>24</span> Üksnes Issandas - nõnda öeldakse minu kohta - on õigus ja jõud, tema juurde tulevad häbenedes kõik, kes on olnud tema peale vihased.",
"25": "<span>25</span> Issandas saab õigeks ja auliseks kogu Iisraeli sugu."
},
"46": {
"1": "<span>1</span> Põlvili langeb Beel, küüru tõmbub Nebo, nende kujud pannakse veo- ja kariloomade selga; need, mida te kandsite, tõstetakse koormaks väsinud loomadele.",
"2": "<span>2</span> Nad tõmbuvad küüru, langevad üheskoos põlvili, nad ei suuda päästa koormat, vaid lähevad ise vangi.",
"3": "<span>3</span> Kuulge mind, Jaakobi sugu, ja kogu Iisraeli soo jääk, keda mul on tulnud kanda emaihust peale, sülle võtta emaüsast alates.",
"4": "<span>4</span> Teie vana eani ma olen seesama ja teie hallide juusteni ma kannan teid; mina olen teinud ja mina tõstan üles, mina kannan ja päästan.",
"5": "<span>5</span> Kellega te mind võrdlete ja samastate, või keda te seate mu kõrvale, et oleksime sarnased?",
"6": "<span>6</span> Need, kes puistavad kukrust kulda ja vaevad vaega hõbedat, palkavad kullassepa ja see valmistab jumala, mille ette nad põlvitavad ja mida nad kummardavad.",
"7": "<span>7</span> Nad tõstavad selle õlale, kannavad ja asetavad paigale, ja see seisab ega liigu oma kohalt. Kui siis keegi seda appi hüüab, ei vasta see ega päästa teda ta ahastusest.",
"8": "<span>8</span> Pidage seda meeles ja jääge kindlaks, võtke südamesse, te üleastujad!",
"9": "<span>9</span> Tuletage meelde endisi asju muistsest ajast, sest mina olen Jumal ja kedagi teist ei ole, mina olen Jumal ja ükski ei ole minu sarnane;",
"10": "<span>10</span> kes algusest alates kuulutab lõppu ja aegsasti ette, mida veel ei ole tehtud; kes ütleb: Minu nõu läheb korda ja ma teen kõik, mis ma tahan;",
"11": "<span>11</span> kes kutsub ida poolt röövlinnu, kaugelt maalt mehe, kes teostab mu nõu. Mida ma olen rääkinud, seda ma lasen ka sündida, nagu ma olen kavatsenud, nõnda ma teen.",
"12": "<span>12</span> Kuulge mind, te arad, kes te olete kaugel õigusest!",
"13": "<span>13</span> Ma toon ligidale oma õiguse, see ei ole kaugel, ja mu pääste ei viibi; ma annan Siionile pääste, Iisraelile oma toreduse."
},
"47": {
"1": "<span>1</span> Astu alla ja istu põrmu, neitsi, Paabeli tütar! Istu maha aujärjeta, kaldealaste tütar! Sest enam ei nimetata sind õrnaks ja hellitatuks.",
"2": "<span>2</span> Võta käsikivi ja jahvata jahu; pane loor ära, tõsta seelikuserv üles, paljasta sääred, kahla läbi jõgede!",
"3": "<span>3</span> Su häbe paljastatakse, sinugi häbistust nähakse. Mina tasun kätte ega lase manguda kedagi, ütleb meie lunastaja,",
"4": "<span>4</span> kelle nimi on vägede Issand, Iisraeli Püha.",
"5": "<span>5</span> Istu vaikselt ja mine pimedusse, kaldealaste tütar, sest enam ei nimetata sind kuningriikide käskijannaks!",
"6": "<span>6</span> Mina vihastasin oma rahva peale, teotasin oma pärisosa ja andsin nad su kätte; sina ei osutanud neile halastust, raugalegi panid peale oma üliränga ikke",
"7": "<span>7</span> ja ütlesid: 'Ma olen igavesti käskijanna.' Sa ei võtnud neid asjaolusid südamesse ega mõelnud, kuidas see lõpeb.",
"8": "<span>8</span> Aga kuule nüüd seda, sa himur, kes elad muretult, üteldes südames: 'Mina, ja ei keegi muu! Mina ei ela lesena ega tunne lastetust!'",
"9": "<span>9</span> Ent äkki ühel päeval on need mõlemad sul käes: lastetus ja lesepõlv. Need tabavad sind täiel jõul, hoolimata su paljudest nõidustest, hoolimata su suurest lausumisvõimest.",
"10": "<span>10</span> Sa olid oma kurjuses julge ja ütlesid: 'Ükski ei näe mind!' Su tarkus ja su teadmised eksitasid sind ja sa ütlesid südames: 'Mina, ja ei keegi muu!'",
"11": "<span>11</span> Seepärast tabab sind õnnetus, mida sa ei oska eemale manada; su peale langeb hukatus, mida sa ei suuda tõrjuda; äkitselt tuleb su üle torm, mida sa ei aimagi.",
"12": "<span>12</span> Astu ometi ette oma lausumiste ja oma paljude nõidustega, millega sa ennast oled väsitanud noorpõlvest peale; võib-olla sa suudad abi tuua, võib-olla hirmutada!",
"13": "<span>13</span> Sa oled ennast väsitanud oma paljude nõuandjatega; astugu nad ometi ette ja päästku sind, taevatundjad, tähtede seletajad, kes kuulutavad iga noorkuu ajal, mis sulle juhtub.",
"14": "<span>14</span> Vaata, need on otsekui kõrred, tuli põletab need; nad ei suuda päästa oma hinge leegi võimusest. See ei ole söelõõm soojenduse tarvis ega tulepaistus, mille ees istuda.",
"15": "<span>15</span> Nõnda käib su nõidujate käsi, kelle pärast sa oled vaeva näinud noorpõlvest peale: igaüks vaarub omale poole, ükski ei päästa sind."
},
"48": {
"1": "<span>1</span> Kuulge seda, Jaakobi sugu, keda nimetatakse Iisraeli nimega, kes olete võrsunud Juuda seemnest, kes vannute Issanda nime juures ja kuulutate Iisraeli Jumalat - ometi mitte tões ja õiguses,",
"2": "<span>2</span> ehk küll nad nimetavad endid püha linna järgi ja toetuvad Iisraeli Jumalale, kelle nimi on vägede Issand -,",
"3": "<span>3</span> endisi asju olen ma teatanud ammu, need on lähtunud minu suust ja mina olen neid kuulutanud. Äkitselt tegin ma need teoks ja need sündisid.",
"4": "<span>4</span> Ma teadsin, et sa oled kangekaelne, et su kuklakõõlus on raudne ja otsaesine vaskne.",
"5": "<span>5</span> Seepärast ma teatasin sulle ammu, kuulutasin sulle, enne kui see sündis, et sa ei ütleks: 'Seda tegi mu ebajumal, mu nikerdatud ja valatud kuju käskis nõnda.'",
"6": "<span>6</span> Sa oled kuulnud, nüüd vaata seda kõike! Ja teie, kas te ei tahaks seda tunnustada? Nüüdsest peale ma kuulutan sulle uusi asju ja saladusi, mida sa ei tea.",
"7": "<span>7</span> Need on loodud äsja, ja mitte ammu, ja enne tänast päeva ei ole sa neist kuulnud, et sa ei saaks öelda: 'Vaata, ma teadsin seda!'",
"8": "<span>8</span> Ei ole sa kuulnud ega teadnud, ka ei ole su kõrv varem selleks lahti olnud; sest ma tean, et sa tõepoolest oled truuduseta ja et juba emaihust alates hüütakse sind üleastujaks.",
"9": "<span>9</span> Oma nime pärast olen ma pikameelne ja oma kuulsuse pärast hoian ma ennast tagasi, et sind mitte hävitada.",
"10": "<span>10</span> Vaata, ma olen sind sulatanud, ometi mitte kui hõbedat: ma olen sind proovinud viletsuse ahjus.",
"11": "<span>11</span> Iseenese pärast, iseenese pärast teen ma seda, sest muidu ju teotataks mind. Oma au ma teistele ei anna!",
"12": "<span>12</span> Kuule mind, Jaakob, ja Iisrael, mu kutsutu! See olen mina! Mina olen esimene, mina olen ka viimne.",
"13": "<span>13</span> Minu käsi on rajanud maale aluse ja mu parem käsi on laotanud taeva; kui ma neid hüüan, siis nad astuvad üheskoos ette.",
"14": "<span>14</span> Kogunege kõik ja kuulge! Kes neist on seda kuulutanud? See, keda Issand armastab, näitab oma tahet Paabelis ja oma käsivart kaldealaste seas.",
"15": "<span>15</span> Mina, mina olen rääkinud, mina olen ta kutsunud, olen tema toonud ja tema teekond läheb korda.",
"16": "<span>16</span> Tulge mu juurde, kuulge seda! Mina ei ole algusest peale rääkinud salajas, juba kui see sündis, olin ma seal. Ja nüüd on Issand Jumal läkitanud minu ja oma Vaimu.",
"17": "<span>17</span> Nõnda ütleb Issand, su lunastaja, Iisraeli Püha: Mina olen Issand, su Jumal, kes sulle õpetab, mis on kasulik, kes sind juhatab teele, mida sa pead käima.",
"18": "<span>18</span> Kui sa ometi oleksid tähele pannud mu käske! Siis oleks su rahu olnud kui jõgi ja su õigus oleks olnud otsekui mere lained.",
"19": "<span>19</span> Su sugu oleks olnud nagu liiva ja su ihuvilja selle sõmerate sarnaselt: ei oleks hävitatud ega kaotatud tema nime mu palge eest.",
"20": "<span>20</span> Minge välja Paabelist, põgenege Kaldeast, rõõmuhüüdega andke teada, kuulutage seda, levitage maailma ääreni, öelge: 'Issand on lunastanud oma sulase Jaakobi.",
"21": "<span>21</span> Nad ei saanud tunda janu, kui ta viis neid läbi kõrbete: ta laskis neile kaljust vett voolata, ta lõhestas kalju ja vesi vulises.'",
"22": "<span>22</span> Õelatel ei ole rahu, ütleb Issand."
},
"49": {
"1": "<span>1</span> Kuulge mind, saared, ja pange tähele, kauged rahvad! Issand on mind kutsunud emaihust, alates mu emaüsast on ta nimetanud mu nime.",
"2": "<span>2</span> Ta tegi mu suu vaheda mõõga sarnaseks, peitis mind oma käe varju alla; ta tegi mind teravaks nooleks, talletas mind oma nooletupes.",
"3": "<span>3</span> Ja ta ütles mulle: Sina, Iisrael, oled mu sulane, kelle läbi ma ilmutan oma au.",
"4": "<span>4</span> Aga mina ütlesin: Ma olen asjata vaeva näinud, kulutanud oma jõudu kasuta ja tühja. Ometi on mu õigus Issanda käes ja mu töötasu on mu Jumala juures.",
"5": "<span>5</span> Ja nüüd ütleb Issand, kes mind emaihust alates on valmistanud enesele sulaseks, et tuua Jaakob tagasi tema juurde ja koguda Iisrael tema juurde - sest ma olen Issanda silmis austatud ja mu Jumal on mu tugevus -,",
"6": "<span>6</span> ta ütleb: Sellest on vähe, et sa mu sulasena taastad Jaakobi suguharud ja tood tagasi Iisraeli jäägi: ma panen sind paganaile valguseks, et mu pääste ulatuks ilmamaa ääreni.",
"7": "<span>7</span> Nõnda ütleb Issand, Iisraeli lunastaja, tema Püha, täiesti põlatule, rahvaste poolt jälestatule, valitsejate sulasele: Kuningad näevad seda ja tõusevad püsti, ja vürstid kummardavad Issanda pärast, kes on ustav, Iisraeli Püha pärast, kes sind on valinud.",
"8": "<span>8</span> Nõnda ütleb Issand: Ma olen sind kuulnud hea meele ajal ja aidanud päästepäeval; ma olen sind hoidnud ja pannud rahvale seaduseks, taastama maad, jagama laastatud pärisosi,",
"9": "<span>9</span> ütlema vangistatuile: 'Minge välja!', pimeduses olijaile: 'Tulge valguse kätte!' Nad saavad teede ääres karja hoida ja neil on karjamaa kõigil küngastel.",
"10": "<span>10</span> Ei ole neil nälga ega janu, neid ei pista palavus ega päike, sest nende peale halastaja juhib neid ja talutab nad veeallikate juurde.",
"11": "<span>11</span> Ma teen kõik oma mäed teeks ja mu maanteed on kõrged.",
"12": "<span>12</span> Vaata, nad tulevad kaugelt. Ennäe, ühed põhja ja lääne poolt, teised Siinimimaalt.",
"13": "<span>13</span> Hõisake, taevad, ja ilutse, maa, mäed, rõkatage rõõmust, sest Issand trööstib oma rahvast ja halastab oma viletsate peale!",
"14": "<span>14</span> Aga Siion ütleb: 'Issand on mu maha jätnud, Jumal on mu unustanud.'",
"15": "<span>15</span> Kas naine unustab oma lapsukese ega halasta oma ihuvilja peale? Ja kui nad ka unustaksid, ei unusta mina sind mitte.",
"16": "<span>16</span> Vaata, ma olen sind märkinud oma peopesadesse, su müürid on alati mu silme ees.",
"17": "<span>17</span> Su ehitajad tulevad tõtates; kes sind lammutasid ja laastasid, need lähevad ära su kallalt.",
"18": "<span>18</span> Tõsta oma silmad üles ja vaata ringi: nad kõik kogunevad, tulevad su juurde. Nii tõesti kui ma elan, ütleb Issand, ehid sa ennast nende kõigiga nagu ehtega ja seod selle endale vööle nagu mõrsja.",
"19": "<span>19</span> Jah, su laastatud ja paljaks tehtud paigad ning su hävitatud maa - tõesti jääd sa nüüd elanikele kitsaks, ja kaugele põgenevad su laastajad.",
"20": "<span>20</span> Veel sinu kuuldes saavad öelda su lastetuseaja lapsed: 'Paik on mulle kitsas, tee ruumi, et ma saaksin elada!'",
"21": "<span>21</span> Siis sa mõtled oma südames: Kes on need mulle sünnitanud? Ma olin lasteta ja viljatu, vangi viidud ja ära aetud. Kes on need kasvatanud? Vaata, ma olin üksi järele jäänud. Kus olid siis need?",
"22": "<span>22</span> Nõnda ütleb Issand Jumal: Vaata, ma tõstan oma käe paganate poole ja püstitan oma lipu rahvaste suunas: siis nad toovad su poegi süles ja kannavad su tütreid õlgadel.",
"23": "<span>23</span> Ja sul on lastehoidjaiks kuningad, ammedeks nende emandad; nad kummardavad silmili maha su ette ja lakuvad su jalgadelt põrmu. Siis sa tead, et mina olen Issand, ei jää häbisse need, kes mind ootavad.",
"24": "<span>24</span> Kas sangari käest saab võtta tema saagi või kiskuda vägeva käest tema vange?",
"25": "<span>25</span> Tõesti, nõnda ütleb Issand: Küllap võetakse sangari vangid ja pääseb vägeva saak: mina riidlen sellega, kes riidleb sinuga, ja mina päästan su lapsed.",
"26": "<span>26</span> Ma söödan su rõhujaid nende eneste lihaga ja nad joobuvad omaenese verest otsekui värskest veinist. Siis saab teada kõik liha, et mina, Issand, olen su päästja, Jaakobi Vägev on su lunastaja."
},
"50": {
"1": "<span>1</span> Nõnda ütleb Issand: Kus on teie ema lahutuskiri, millega ma tema olen ära saatnud? Või kellele oma võlausaldajaist ma olen teid müünud? Vaata, te olete müüdud oma süütegude pärast, ja teie üleastumiste pärast on teie ema ära saadetud.",
"2": "<span>2</span> Miks ei olnud kedagi, kui ma tulin, ei vastanud keegi, kui ma hüüdsin? Ons mu käsi liiga lühike lunastamiseks või ei ole mul jõudu päästmiseks? Vaata, oma sõitlusega ma kuivatan mere, teen jõed kõrbeks, vee puudusel hakkavad kalad haisema ja nad surevad janusse.",
"3": "<span>3</span> Ma riietan taevad pimedusega ja annan neile kotiriide katteks.",
"4": "<span>4</span> Issand Jumal on mulle andnud õpetatud keele, et ma oskaksin vastata väsinule, virgutada teda sõnaga. Ta äratab igal hommikul, ta äratab mu kõrva, et ma kuuleksin õpilaste kombel.",
"5": "<span>5</span> Issand Jumal avas mu kõrva ja ma ei ole vastu pannud, ma ei ole taganenud.",
"6": "<span>6</span> Ma andsin oma selja peksjaile ja põsed neile, kes katkusid karvu, ma ei peitnud oma palet teotuse ja sülje eest.",
"7": "<span>7</span> Issand Jumal aitab mind: seepärast ma ei jäänud häbisse, seepärast ma muutsin oma näo otsekui ränikiviks, sest ma teadsin, et ma ei jää häbisse,",
"8": "<span>8</span> et mu õigusemõistja on ligidal. Kes tahab minuga riielda? Astugem üheskoos ette! Kes on mu vastane? Tulgu ta mu juurde!",
"9": "<span>9</span> Vaata, Issand Jumal aitab mind! Kes võib mind süüdi mõista? Vaata, nad kõik kuluvad nagu rüü, koi sööb nad.",
"10": "<span>10</span> Kes teist kardab Issandat, see kuulgu tema sulase häält; kes käib pimeduses ja kel puudub valgusekuma, see lootku Issanda nime peale ja toetugu oma Jumalale.",
"11": "<span>11</span> Aga vaata, teie kõik, kes läidate tule, süütate tuliseid nooli, minge oma tule leekidesse ja tuliste noolte keskele, mis te olete süüdanud. Minu käest tuleb see teile, et peate lamama piinades."
},
"51": {
"1": "<span>1</span> Kuulge mind, õigluse nõudjad, Issanda otsijad! Vaadake kaljut, mille küljest te olete raiutud, ja kaevuauku, kust olete välja kaevatud.",
"2": "<span>2</span> Vaadake Aabrahami, oma isa, ja Saarat, kes teid sünnitas. Kui ta alles üksi oli, kutsusin ma tema ja ma õnnistasin teda ning tegin ta paljuks.",
"3": "<span>3</span> Sest Issand trööstib Siionit, trööstib kõiki selle varemeid; ta teeb selle kõrbe otsekui Eedeniks ja lagendikud Issanda rohuaia sarnaseks. Seal on lusti ja rõõmu, tänulaulu ja pillihäält.",
"4": "<span>4</span> Pane mind tähele, mu rahvas, mu hõimud, kuulake mind! Sest minult lähtub Seadus ja mu õigus rahvaile valguseks.",
"5": "<span>5</span> Äkitselt ligineb mu õiglus, ilmub mu pääste ja mu käsivarred mõistavad rahvaile kohut: mind ootavad saared ja loodavad mu käsivarre peale.",
"6": "<span>6</span> Tõstke oma silmad taeva poole ja vaadake alla maa peale; sest taevad haihtuvad kui suits ja maa kulub nagu kuub, selle elanikud surevad otsekui sääsed. Aga minu pääste jääb igavesti ja minu õiglus ei lõpe.",
"7": "<span>7</span> Kuulge mind, õigusetundjad, rahvas, kelle südames on mu Seadus! Ärge kartke inimeste laimu ja ärge ehmuge nende sõimust!",
"8": "<span>8</span> Sest neid sööb riidekoi nagu riiet, neid sööb villakoi nagu villa. Aga minu õiglus jääb igavesti ja mu pääste põlvest põlve.",
"9": "<span>9</span> Ärka, ärka, ehi ennast jõuga, Issanda käsivars! Ärka nagu muistseil päevil, endiste põlvede ajal! Eks olnud sina see, kes purustas Rahabi, kes torkas läbi merelohe?",
"10": "<span>10</span> Eks olnud sina see, kes kuivatas mere, suure sügavuse veed, kes tegi teeks meresügavikud, lunastatuile läbitavaks?",
"11": "<span>11</span> Ja Issanda lunastatud pöörduvad tagasi ning tulevad Siionisse hõisates. Nende pea kohal on igavene rõõm, rõõm ja ilutsemine valdavad neid, aga kurbus ja ohkamine põgenevad ära.",
"12": "<span>12</span> Mina, mina olen see, kes teid trööstib! Kes oled sina, et sa kardad surelikke inimesi, inimlapsi, kes on nagu rohi,",
"13": "<span>13</span> ja unustad Issanda, kes sind on teinud, kes on laotanud taeva ja rajanud maa, ja värised alati, iga päev, rõhuja viha ees, kui ta valmistub hävitama? Aga kus on nüüd rõhuja viha?",
"14": "<span>14</span> Varsti vabastatakse aheldatu: ta ei sure vangiauku, tema leib ei lõpe.",
"15": "<span>15</span> Sest mina olen Issand, su Jumal, kes liigutab merd ja paneb lained kohisema, kelle nimi on vägede Issand.",
"16": "<span>16</span> Ja ma panin oma sõnad sulle suhu, ma peitsin sind oma käe varju alla, et võlvida taevas ja rajada maa, ja et öelda Siionile: 'Sina oled mu rahvas.'",
"17": "<span>17</span> Ärka, ärka, tõuse üles, Jeruusalemm, kes oled joonud Issanda käest tema viha karika, oled joonud tilgatuks uimastuse peekri!",
"18": "<span>18</span> Ei olnud tal talutajat ühestki oma sünnitatud lapsest, ega haaranud tal käest kinni mitte ükski tema kasvatatud laps.",
"19": "<span>19</span> Need kaks paari said sulle osaks - kes tunneb sulle kaasa? - rüüstamine ja hävitus, nälg ja mõõk - kes olen mina, et sind trööstiksin?",
"20": "<span>20</span> Igal tänavanurgal lamasid su lapsed oimetult, otsekui metskitsed püügivõrgus, löödud Issanda vihast, su Jumala sõitlusest.",
"21": "<span>21</span> Seepärast kuule ometi seda, sa vilets, kes oled joobnud, aga mitte veinist:",
"22": "<span>22</span> nõnda ütleb su Issand, Issand, su Jumal, kes riidleb oma rahva eest: Vaata, ma võtan su käest uimastuse karika, oma viha peekri - seda ei ole sul enam vaja juua.",
"23": "<span>23</span> Ja ma annan selle kätte su piinajaile, kes ütlesid sulle: 'Kummarda, et saaksime sinust üle käia!' Sa andsidki oma selja maaks ja käijatele tänavaks."
},
"52": {
"1": "<span>1</span> Ärka, ärka, ehi ennast oma jõuga, Siion! Pane selga oma ilusad riided, Jeruusalemm, püha linn! Sest sinu sisse ei tule enam ümberlõikamatu ja rüve.",
"2": "<span>2</span> Puhasta ennast tolmust, tõuse üles, istu, Jeruusalemm, su kaela köidikud on vallandunud, vang, Siioni tütar!",
"3": "<span>3</span> Sest nõnda ütleb Issand: Hinnata teid müüdi ja rahata teid lunastatakse.",
"4": "<span>4</span> Sest nõnda ütleb Issand Jumal: Mu rahvas läks esiti alla Egiptusesse, et seal võõrana elada, ja seejärel rõhus Assur teda põhjuseta.",
"5": "<span>5</span> Ja nüüd? Mis oleks mul siin teha, ütleb Issand, kui mu rahvas on hinnata ära viidud? Ta valitsejad räuskavad, ütleb Issand, ja mu nime teotatakse lakkamata iga päev.",
"6": "<span>6</span> Seepärast peab mu rahvas tundma mu nime, peab seepärast just sel päeval mõistma, et mina olen see, kes ütleb: 'Vaata, siin ma olen!'",
"7": "<span>7</span> Kui armsad on mägede peal sõnumitooja sammud. Ta kuulutab rahu, toob häid sõnumeid, kuulutab päästet ja ütleb Siionile: 'Sinu Jumal on kuningas!'",
"8": "<span>8</span> Kuule! Su valvurid tõstavad häält, nad hõiskavad üheskoos, sest nad näevad silmast silma Issanda kojutulekut Siionisse.",
"9": "<span>9</span> Rõõmutsege, hõisake üheskoos, Jeruusalemma varemed, sest Issand trööstib oma rahvast, lunastab Jeruusalemma!",
"10": "<span>10</span> Issand paljastab oma püha käsivarre kõigi rahvaste nähes, ja kõik maailma ääred saavad näha meie Jumala päästet.",
"11": "<span>11</span> Lahkuge, lahkuge, minge sealt ära, ärge puudutage rüvedat; minge ära selle keskelt, puhastage endid, Issanda riistade kandjad!",
"12": "<span>12</span> Aga teil ei ole vaja lahkuda tõtates ega minna põgenedes, sest Issand käib teie ees, Iisraeli Jumal on teile järelväeks.",
"13": "<span>13</span> Vaata, mu sulane talitab targasti, teda ülistatakse ning ülendatakse ja ta saab väga kõrgeks.",
"14": "<span>14</span> Nagu paljud kohkusid tema pärast - nõnda rikutud, ebainimlik oli ta välimus ja ta kuju ei olnud inimlaste taoline -,",
"15": "<span>15</span> nõnda ehmatab ta paljusid rahvaid, kuningad sulevad tema pärast suud. Kuid mida neile ei ole jutustatud, seda saavad nad näha, ja mida nad ei ole kuulnud, seda saavad nad teada."
},
"53": {
"1": "<span>1</span> Kes usub meie kuulutust ja kellele on ilmutatud Issanda käsivars?",
"2": "<span>2</span> Sest ta tõusis meie ees nagu võsuke, otsekui juur põuasest maast. Ei olnud tal kuju ega ilu, et teda vaadata, ega olnud tal välimust, et teda ihaldada.",
"3": "<span>3</span> Ta oli põlatud ja inimeste poolt hüljatud, valude mees ja haigustega tuttav, niisugune, kelle pealt silmad ära pööratakse: ta oli põlatud ja me ei hoolinud temast.",
"4": "<span>4</span> Ent tõeliselt võttis ta enese peale meie haigused ja kandis meie valusid. Meie aga pidasime teda vigaseks, Jumalast nuhelduks ja vaevatuks.",
"5": "<span>5</span> Ent teda haavati meie üleastumiste pärast, löödi meie süütegude tõttu. Karistus oli tema peal, et meil oleks rahu, ja tema vermete läbi on meile tervis tulnud.",
"6": "<span>6</span> Me kõik eksisime nagu lambad, igaüks meist pöördus oma teed, aga Issand laskis meie kõigi süüteod tulla tema peale.",
"7": "<span>7</span> Teda piinati ja ta alistus ega avanud suud nagu tall, keda viiakse tappa, nagu lammas, kes on vait oma niitjate ees, nõnda ei avanud ta oma suud.",
"8": "<span>8</span> Surve ja kohtu läbi võeti ta ära, kes tema sugupõlvest mõtles sellele, et ta lõigati ära elavate maalt, ja teda tabas surm mu rahva üleastumise pärast?",
"9": "<span>9</span> Temale anti haud õelate juurde, kurjategijate juurde, kui ta suri, kuigi ta ei olnud ülekohut teinud ega olnud pettust ta suus.",
"10": "<span>10</span> Aga Issand arvas heaks teda alandada haigustega. Kui ta iseenese on andnud süüohvriks, saab ta näha tulevast sugu, ta elab kaua ja Issanda tahe teostub tema läbi.",
"11": "<span>11</span> Pärast oma hingevaeva saab ta näha valgust ja rahuldust tunda; oma tarkusega teeb mu õiglane sulane paljusid õigeks, sest ta kannab nende patusüüd.",
"12": "<span>12</span> Sellepärast ma annan temale osa paljude hulgas ja ta jagab vägevatega saaki, sest ta tühjendas oma hinge surmani ja ta arvati üleastujate hulka; tema aga kandis paljude pattu ja seisis üleastujate eest."
},
"54": {
"1": "<span>1</span> Hõiska, sigimatu, kes pole sünnitanud, rõkata rõõmust ja ilutse, kes pole olnud lapsevaevas! Sest vallalisel saab olema rohkem lapsi kui abielunaisel, ütleb Issand.",
"2": "<span>2</span> Tee avaraks oma telgipaik ja su elamute vaipu venitatagu! Ära ole kokkuhoidlik! Pikenda oma telginööre ja kinnita vaiu!",
"3": "<span>3</span> Sest sa levid paremale ja vasakule, su järglased vallutavad rahvaid ja asustavad tühje linnu.",
"4": "<span>4</span> Ära karda, sest sul ei ole vaja häbeneda, ja ära tunne piinlikkust, sest sa ei jää häbisse, vaid unusta oma noorpõlve häbi ja ära meenuta enam oma lesepõlve teotust!",
"5": "<span>5</span> Sest sinu Looja on su mees, vägede Issand on tema nimi; sinu lunastaja on Iisraeli Püha, teda nimetatakse kogu maailma Jumalaks.",
"6": "<span>6</span> Sest nagu hüljatud ja sügavasti kurvastatud naist kutsub sind Issand. Ja noorpõlve naine - kas teda saakski põlata? ütleb su Jumal.",
"7": "<span>7</span> Ma jätsin su maha üürikeseks hetkeks, aga ma kogun sind suure halastusega.",
"8": "<span>8</span> Ülevoolavas vihas peitsin ma oma palge silmapilguks su eest, aga ma halastan su peale igavese heldusega, ütleb Issand, su lunastaja.",
"9": "<span>9</span> Sest see on mul nagu Noa päevil, kui ma vandusin, et Noa veed enam ei ujuta maad: nõnda ma vannun, et ma ei ole sinule vihane ega sõitle sind.",
"10": "<span>10</span> Mäed liiguvad ja künkad kõiguvad küll, aga minu heldus ei liigu su juurest ja minu rahuseadus ei kõigu, ütleb Issand, su halastaja.",
"11": "<span>11</span> Sina vilets, vintsutatu, trööstimatu! Vaata, ma ehitan sind türkiisikividega ja rajan su aluse safiiridest.",
"12": "<span>12</span> Ma teen su müürisakmed rubiinidest, su väravad säravatest juveelidest ja kogu su ringmüüri kalliskividest.",
"13": "<span>13</span> Ja kõik su lapsed on Issanda õpilased ning su lastel on suur rahu.",
"14": "<span>14</span> Sind rajatakse õigluses; sa jääd eemale vägivallast, sest sul ei ole midagi karta, ja hirmust, sest see ei ligine sulle.",
"15": "<span>15</span> Kui sulle ka kallale kiputakse, siis mitte minu poolt; kes sulle kallale kipub, see sinu pärast langeb.",
"16": "<span>16</span> Vaata, mina olen loonud sepa, kes puhub ääsituld ja valmistab relva vastavaks otstarbeks: mina ise olen seega loonud hävitaja hävitama.",
"17": "<span>17</span> Aga ei ole edu ühelgi relval, mis valmistatakse sinu vastu, ja sa mõistad hukka iga keele, mis tõuseb sinuga kohut käima. See on Issanda sulaste pärisosa ja nende õigus minult, ütleb Issand."
},
"55": {
"1": "<span>1</span> Hoi! Kõik janused, tulge vee juurde! Ka see, kellel ei ole raha, tulgu, ostku ja söögu! Tulge, ostke ilma rahata, ilma hinnata veini ja piima!",
"2": "<span>2</span> Miks vaete raha selle eest, mis ei ole leib, ja oma vaevatasu selle eest, mis ei toida? Kuulake mind hästi, siis te saate süüa head ja kosutada ennast rammusate roogadega.",
"3": "<span>3</span> Pöörake kõrv ja tulge mu juurde, kuulake mind, siis on teil edu; mina teen teiega igavese lepingu, samasuguse, nagu oli mu osadus Taavetiga!",
"4": "<span>4</span> Vaata, ma panin tema rahvaile tunnistajaks, rahvaste juhiks ja käskijaks.",
"5": "<span>5</span> Näe, ka sina hakkad kutsuma rahvaid, keda sa ei tunne, ja rahvad, kes sind ei tunne, jooksevad sinu juurde Issanda, su Jumala pärast ja Iisraeli Püha pärast, sellepärast et tema sind austab.",
"6": "<span>6</span> Otsige Issandat, kui ta on leitav, hüüdke teda, kui ta on ligidal!",
"7": "<span>7</span> Õel jätku oma tee ja nurjatu mees oma mõtted ning pöördugu Issanda poole, siis halastab tema ta peale; ja meie Jumala poole, sest tema annab palju andeks.",
"8": "<span>8</span> Aga minu mõtted ei ole teie mõtted, ja teie teed ei ole minu teed, ütleb Issand.",
"9": "<span>9</span> Sest otsekui taevad on maast kõrgemal, nõnda on minu teed kõrgemad kui teie teed, ja minu mõtted kõrgemad kui teie mõtted.",
"10": "<span>10</span> Sest otsekui vihm ja lumi tulevad taevast alla ega lähe sinna tagasi, vaid kastavad maad ja teevad selle sigivaks ning kandvaks, et see annaks külvajale seemet ja sööjale leiba,",
"11": "<span>11</span> nõnda on ka minu sõnaga, mis lähtub mu suust: see ei tule tagasi mu juurde tühjalt, vaid teeb, mis on mu meele järgi, ja saadab korda, milleks ma selle läkitasin.",
"12": "<span>12</span> Jah, te lähete rõõmsasti välja ja teid tuuakse rahus. Mäed ja künkad rõkatavad rõõmust teie ees ning kõik väljapuud plaksutavad käsi.",
"13": "<span>13</span> Kibuvitste asemel kasvavad küpressid, nõgeste asemel kasvavad mürdid. See sünnib Issanda auks, igaveseks, hävimatuks märgiks."
},
"56": {
"1": "<span>1</span> Nõnda ütleb Issand: Pange tähele õigust ja olge õiglased, sest mu pääste on ligidal ja mu õiglus ilmumas!",
"2": "<span>2</span> Õnnis on inimene, kes nõnda teeb, inimlaps, kes selles püsib, kes peab hingamispäeva ega riku seda, ja kes hoiab oma kätt igast kurjast teost.",
"3": "<span>3</span> Ärgu rääkigu ega öelgu Issandaga liitunud võõras: 'Issand eraldab mind muidugi oma rahvast!' Ja kohitsetu ärgu öelgu: 'Vaata, ma olen kuivanud puu!'",
"4": "<span>4</span> Sest nõnda ütleb Issand: Kohitsetuile, kes peavad mu hingamispäevi ja valivad, mis on mu meele järgi, ja peavad kinni mu lepingust,",
"5": "<span>5</span> neile ma annan oma kojas ja oma müüride vahel mälestusmärgi ja nime, parema kui pojad ja tütred: mina annan neile igavese nime, mida ei saa hävitada.",
"6": "<span>6</span> Ja võõrad, kes on liitunud Issandaga, teenivad teda ja armastavad Issanda nime, et saada tema sulaseiks, kõik, kes peavad hingamispäeva ega riku seda ja kes peavad kinni mu lepingust -",
"7": "<span>7</span> needki ma viin oma pühale mäele ja ma rõõmustan neid oma palvekojas, ja nende põletus- ja tapaohvrid on mu altari peal meelepärased; sest mu koda nimetatakse palvekojaks kõigile rahvastele.",
"8": "<span>8</span> Issanda, Iisraeli hajutatuid koguva Jumala ütlus: Ma kogun tema juurde veelgi, lisaks neile, kes tema juurde on kogutud.",
"9": "<span>9</span> Kõik loomad väljal, tulge sööma, tulge, kõik metsloomad!",
"10": "<span>10</span> Tema vahimehed on kõik pimedad, nad ei mõista midagi, nad kõik on nagu tummad koerad, kes ei saa haukuda; nad armastavad tukkuda, magavad norinal.",
"11": "<span>11</span> Nad on aplad koerad, kes ei saa iialgi küllalt. Nad on karjased, kellel ei ole arusaamist. Kõik nad pöörduvad oma teed, igaüks eranditult oma kasu poole:",
"12": "<span>12</span> 'Tulge, ma toon veini, rüüpame vägijooki! Olgu homne päev nagu tänane, veel palju suurepärasem!'"
},
"57": {
"1": "<span>1</span> Õige sureb, aga ükski ei võta seda südamesse, ja vagad mehed koristatakse, ilma et keegi märkaks. Kuid õige koristatakse õnnetuse eest,",
"2": "<span>2</span> ta läheb rahusse: oma voodites hingavad need, kes on käinud sirget teed.",
"3": "<span>3</span> Aga teie tulge siia, te nõiamoori lapsed, abielurikkujate ja hoorade sigitis!",
"4": "<span>4</span> Kelle üle te tunnete rõõmu? Kelle vastu te ajate suu ammuli, näitate keelt? Eks te ole üleastumise lapsed, vale sigitis,",
"5": "<span>5</span> teie, kes kirest hõõgute tammede varjus, iga halja puu all, teie, kes tapate lapsi orgudes, kaljulõhede vahel.",
"6": "<span>6</span> Oru siledate kivide seas on su osa, need, need on su liisk. Neile oled sa valanud joogiohvrit, viinud roaohvrit. Kas ma sellega lasen ennast lepitada?",
"7": "<span>7</span> Kõrgele ja väljapaistvale mäele seadsid sa oma voodi, sinna üles sa läksid ka tapaohvreid ohverdama.",
"8": "<span>8</span> Ja ukse ning piitade taha sa panid oma tunnusmärgi, sest minust lahkudes sa riietusid lahti ja läksid üles, tegid oma voodi laiemaks, kauplesid enesele neid, kelle voodeid sa armastasid, vahtisid kürva.",
"9": "<span>9</span> Sa laskusid alla Mooloki juurde õliga ja priiskasid oma võietega; sa läkitasid oma käskjalad kaugele, ja sügavale alla, kuni surmavallani.",
"10": "<span>10</span> Sa väsisid oma paljudest rännakutest, aga sa ei öelnud: 'Lootuseta!' Sa leidsid uut elujõudu, sellepärast sa ei nõrkenud.",
"11": "<span>11</span> Keda sa pelgasid ja kartsid, et sa valetasid? Sa ei meenutanud mind ega võtnud seda südamesse. Eks ole: mina vaikin ammusest ajast ja seepärast sa ei karda mind.",
"12": "<span>12</span> Mina teen teatavaks su õiguse ja su teod, aga need ei aita sind.",
"13": "<span>13</span> Kui sa kisendad, siis päästku sind su ebajumalate jõuk. Aga tuul viib need kõik, tuuleõhk võtab nad ära. Kes aga otsib abi minu juurest, see pärib maa, omandab mu püha mäe.",
"14": "<span>14</span> On öeldud: 'Sillutage, sillutage, tehke tee valmis, koristage takistused mu rahva teelt!'",
"15": "<span>15</span> Sest nõnda ütleb kõrge ja üllas, kes igavesti elab ja kelle nimi on püha: Ma elan kõrges ja pühas paigas ja rõhutute ning vaimult alandlike juures, et turgutada alandlike vaimu ja elustada rõhutute südameid.",
"16": "<span>16</span> Sest mina ei riidle mitte igavesti ega ole jäädavalt vihane, muidu nõrkeksid mu palge ees nende vaim ja hinged, keda ma ise olen teinud.",
"17": "<span>17</span> Tema ahnuse süü pärast ma vihastasin, lõin teda, peitsin enese ja olin vihane, ent tema käis taganejana omaenese südame teed.",
"18": "<span>18</span> Ma olen näinud tema teid, aga ma parandan ja juhatan teda; ja ma tasun temale troostiga ning pakun ta leinajaile huultevilja.",
"19": "<span>19</span> Rahu, rahu kaugel ja lähedal olijale, ütleb Issand, ja ma parandan teda.",
"20": "<span>20</span> Aga õelad on otsekui mässav meri, mis ei saa rahuneda ja mille veed kobrutavad kõntsa ja muda.",
"21": "<span>21</span> Õelatel ei ole rahu, ütleb minu Jumal."
},
"58": {
"1": "<span>1</span> Hüüa täiest kõrist, ära peatu, tõsta häält otsekui pasun! Tee teatavaks mu rahvale nende üleastumine ja Jaakobi soole nende patud!",
"2": "<span>2</span> Päevast päeva nad küll otsivad mind ja tahavad teada mu teid, nagu oleks see rahvas, kes on õiglane ega hülga oma Jumala õigust. Nad nõuavad minult õiglasi otsuseid, igatsevad Jumala ligiolekut:",
"3": "<span>3</span> 'Miks me paastume, kui sa seda ei näe, alandame oma hinge, kui sa seda ei märka?' Vaata, oma paastupäeval te teete, mis teile meeldib, ja pigistate kõiki oma võlgnikke.",
"4": "<span>4</span> Vaata, te paastute riiuks ja tüliks ja et lüüa õela rusikaga. Praegu te küll ei paastu selleks, et teha oma häält kuuldavaks ülal.",
"5": "<span>5</span> Kas niisugune on see paast, mis mulle meeldib, päev, mil inimene alandab oma hinge, et ta painutab oma pead nagu kõrkjas ja teeb enesele aseme kotiriidest ning tuhast? Kas sa seda nimetad paastuks ja Issandale meelepäraseks päevaks?",
"6": "<span>6</span> Eks ole ju mulle meeldiv paast niisugune: päästa valla ülekohtused ahelad, teha lahti ikke rihmad, lasta vabaks rõhutud ja purustada kõik ikked?",
"7": "<span>7</span> Eks see ole murda oma leiba näljasele ja viia oma kotta viletsad kodutud, kui sa näed alastiolijat ja riietad teda ega hoidu oma ligimesest?",
"8": "<span>8</span> Siis ilmub su valgus otsekui koit ja su paranemine edeneb jõudsasti. Sinu õigus käib su ees, Issanda auhiilgus järgneb sulle.",
"9": "<span>9</span> Siis sa hüüad ja Issand vastab, kisendad appi ja tema ütleb: 'Vaata, siin ma olen!' Kui sa oma keskelt eemaldad ikke, sõrmega näitamise ja nurjatu kõne,",
"10": "<span>10</span> kui sa pakud näljasele sedasama, mida sa ka ise himustad, ja toidad alandatud hinge, siis koidab sulle pimeduses valgus ja su pilkane pimedus on otsekui keskpäev.",
"11": "<span>11</span> Ja Issand juhatab sind alati ning toidab su hinge põuasel maal; ta teeb tugevaks su luud-liikmed ja sa oled otsekui kastetud rohuaed, veelätte sarnane, mille vesi ei valmista iial pettumust.",
"12": "<span>12</span> Ja su omad ehitavad üles muistsed varemed, sa taastad endiste põlvede alusmüürid; sind nimetatakse 'lõhutud müüride parandajaks', 'teeradade käidavaks tegijaks'.",
"13": "<span>13</span> Kui sa hingamispäeval seisatad ega tee mu pühal päeval, mis sulle meeldib, kui sa nimetad hingamispäeva rõõmuks ja Issanda püha päeva austusväärseks ning austad seda ega tee, mis sulle meeldib, ei otsi omakasu ega kõnele tühje sõnu,",
"14": "<span>14</span> siis sa tunned rõõmu Issandast: mina viin sind üle maa kõrgendike ja toidan sind su isa Jaakobi pärandiga. Jah, Issanda suu on rääkinud."
},
"59": {
"1": "<span>1</span> Vaata, Issanda käsi ei ole päästmiseks lühike ega ole ta kõrv kuulmiseks kurt,",
"2": "<span>2</span> vaid teie süüteod on teinud vahe teie ja teie Jumala vahele, teie patud varjavad tema palge teie eest, sellepärast ta ei kuule.",
"3": "<span>3</span> Sest teie käed on rüvetatud verega ja teie sõrmed süüga, teie huuled väidavad valet, teie keel kõneleb kõverust.",
"4": "<span>4</span> Ükski ei süüdista õiglaselt ja keegi ei lähe kohtusse tõe nimel: loodetakse tühja peale ja räägitakse valet, sigitatakse pahandust ja sünnitatakse kurjust.",
"5": "<span>5</span> Nad hauvad mürkmao mune ja koovad ämblikuvõrku; kes sööb nende mune, see sureb, ja katkivajutatust poeb välja rästik.",
"6": "<span>6</span> Nende lõngad ei kõlba riideks ja nad ei saa endid katta oma tegudega; nende teod on nurjatud teod ja nende kätes on vägivallatöö.",
"7": "<span>7</span> Nende jalad jooksevad kurja poole ja nad tõttavad valama vaga verd; nende mõtted on nurjatud mõtted, nende teedel on rüüstamine ja hävitus.",
"8": "<span>8</span> Rahu rada nad ei tunne ja õigust ei ole nende jälgedes; nad teevad oma teerajad kõveraiks, ükski, kes käib nende peal, ei tunne rahu.",
"9": "<span>9</span> Sellepärast on õigus meist kaugel ja õiglus ei ulatu meieni; me ootame valgust, aga vaata, on pimedus, me ootame valgusekuma, aga käime pilkases pimedas.",
"10": "<span>10</span> Me kobame seina pimedate sarnaselt, kobame otsekui silmitud; keskpäevaajal me komistame nagu hämarikus, elujõuliste keskel oleme otsekui surnud.",
"11": "<span>11</span> Me kõik mõmiseme nagu karud ja kudrutame tuvide sarnaselt; me ootame õigust, aga seda ei ole, päästet, aga see on meist kaugel.",
"12": "<span>12</span> Sest meie üleastumisi sinu ees on palju ja meie patud tunnistavad meie vastu, sest meie üleastumised on meiega kaasas ja me tunneme oma süütegusid:",
"13": "<span>13</span> vastuhakk ja Issanda salgamine ning loobumine käimisest meie Jumala järel; kõned rõhumisest ja ärataganemisest, valelike sõnade väljamõtlemine ja südamest kuuldavale toomine.",
"14": "<span>14</span> Õiglus on tagasi tõrjutud ja õigus seisab kaugel, sest tõde komistab tänaval ja ausus ei saa sisse tulla.",
"15": "<span>15</span> Nõnda on tõde kadunud ja kes loobub kurjast, laseb ennast paljaks riisuda. Issand nägi seda ja see oli tema silmis paha, et õigust ei olnud.",
"16": "<span>16</span> Tema nägi, et ei olnud ühtegi meest, ja imestas, et ei olnud ühtegi vaheleastujat. Siis aitas teda ta oma käsivars ja teda toetas tema õigus.",
"17": "<span>17</span> Ta pani enesele selga õiguse otsekui soomusrüü, ja päästekiivri pähe; ta riietus kättemaksuriietesse ja kattis ennast püha vihaga otsekui ülekuuega.",
"18": "<span>18</span> Missugused on teod, niisugune on tasu: viha oma vastaste vastu, kättemaks oma vaenlastele, ta maksab saartele kätte.",
"19": "<span>19</span> Siis kardetakse õhtu pool Issanda nime ja päikesetõusu pool tema auhiilgust, sest ta tuleb otsekui paisutatud jõgi, mida Issanda tuul edasi ajab.",
"20": "<span>20</span> Aga Issand ütleb: Siionile, üleastumisest pöördujale Jaakobis, tuleb lunastaja.",
"21": "<span>21</span> Ja niisugune on mu leping nendega, ütleb Issand: Minu Vaim, kes on su peal, ja minu sõnad, mis ma olen pannud sulle suhu, ei lahku sinu suust ega sinu järglaste suust ega sinu järglaste järglaste suust, ütleb Issand, nüüdsest ajast alates ja igavesti."
},
"60": {
"1": "<span>1</span> Tõuse, paista, sest sinu valgus tuleb ja Issanda auhiilgus koidab su kohal.",
"2": "<span>2</span> Sest vaata, pimedus katab maad ja pilkane pimedus rahvaid, aga sinu kohal koidab Issand ja sinu kohal nähakse tema auhiilgust.",
"3": "<span>3</span> Ja rahvad tulevad su valguse juurde ning kuningad paistuse juurde, mis sinust kumab.",
"4": "<span>4</span> Tõsta oma silmad ja vaata ringi: nad kõik kogunevad, tulevad su juurde; su pojad tulevad kaugelt, su tütreid kantakse kätel.",
"5": "<span>5</span> Siis sa näed ja särad rõõmust, su süda põksub ja avardub, kui su poole pöördub mere ohtrus ja su juurde tuleb rahvaste rikkus.",
"6": "<span>6</span> Sind katab kaamelite hulk, Midjani ja Eefa noored kaamelid; kõik tulevad Sebast, kannavad kulda ja viirukit ning kuulutavad Issanda kiiduväärsust.",
"7": "<span>7</span> Su juurde kogunevad kõik Keedari karjad, Nebajoti jäärad teenivad sind: meelepärasena tulevad need mu altari peale ja ma teen oma hiilguse koja veel toredamaks.",
"8": "<span>8</span> Kes on need, kes lendavad otsekui pilv, otsekui tuvid oma puuriavadesse?",
"9": "<span>9</span> Jah, mu juurde kogunevad meresõitjad, eesotsas Tarsise laevadega, et tuua su lapsi kaugelt; nende hõbe ja kuld on neil kaasas - Issanda, su Jumala nimele ja Iisraeli Pühale, sellepärast et tema sind austab.",
"10": "<span>10</span> Ja võõrad ehitavad üles su müürid ja nende kuningad teenivad sind; sest oma vihas ma lõin sind, aga oma armus ma halastan su peale.",
"11": "<span>11</span> Su väravad on alati lahti, neid ei suleta päeval ega ööl, et su juurde saaks tuua rahvaste rikkusi ja juhatada nende kuningaid.",
"12": "<span>12</span> Sest rahvas või kuningriik, kes sind ei teeni, hukkub, seesugused rahvad rüüstatakse sootuks.",
"13": "<span>13</span> Liibanoni toredus tuleb su juurde, küpressid, plataanid ja piiniad üheskoos, et kaunistada mu pühamu paika ja et ma saaksin austada oma jalgade aset.",
"14": "<span>14</span> Ja kummargil tulevad su juurde su rõhujate lapsed, ja kõik, kes sind põlastasid, peavad kummardama su jalataldadeni; ja nad nimetavad sind 'Issanda linnaks', 'Iisraeli Püha Siioniks'.",
"15": "<span>15</span> Selle asemel et sa olid mahajäetud ning vihatud, nii et ükski ei käinud sinu kaudu, teen ma sind igaveseks uhkuseks, rõõmuks põlvest põlve.",
"16": "<span>16</span> Sina saad imeda rahvaste piima, imeda kuningategi rinda, ja sa tunned, et mina, Issand, olen su päästja, et Jaakobi Vägev on su lunastaja.",
"17": "<span>17</span> Vase asemel ma toon kulda ja raua asemel ma toon hõbedat, puidu asemel vaske ja kivide asemel rauda. Ja ma panen su ülemuseks rahu ning su sundijaks õiguse.",
"18": "<span>18</span> Ei kuuldu enam vägivallast su maal, rüüstamisest ja hävitusest su piirides; sa nimetad oma müüre 'Päästeks' ja väravaid 'Kiituseks'.",
"19": "<span>19</span> Päike ei ole sulle enam valguseks päeval ega paista sulle kuupaiste, vaid Issand on sulle igaveseks valguseks ja su Jumal on su hiilgus.",
"20": "<span>20</span> Su päike ei lähe enam looja ja su kuu ei kahane, sest Issand on sulle igaveseks valguseks ja su leinapäevad lõpevad.",
"21": "<span>21</span> Ja igaüks su rahvast on õiglane: nad pärivad igaveseks maa kui minu istutatud võsu, mu kätetöö, millega ma ennast austan.",
"22": "<span>22</span> Kõige pisemast saab tuhatkond ja kõige väetimast vägev rahvas. Mina, Issand, tõttan sellega määratud ajal."
},
"61": {
"1": "<span>1</span> Issanda Jumala Vaim on minu peal, sest Issand on mind võidnud; ta on mind läkitanud viima rõõmusõnumit alandlikele, parandama neid, kel murtud süda, kuulutama vabastust vangidele ja avama pimedate silmi,",
"2": "<span>2</span> kuulutama Issanda meelepärast aastat ja meie Jumala kättemaksu päeva, trööstima kõiki leinajaid,",
"3": "<span>3</span> andma Siioni leinajaile laubaehte tuha asemel, rõõmuõli leinarüü asemel, ülistusrüü kustuva vaimu asemel, et neid nimetataks 'Õigluse tammedeks', 'Issanda istanduseks', millega ta ennast ehib.",
"4": "<span>4</span> Nad ehitavad üles muistsed varemed, taastavad esivanemate rüüstatud paigad ja uuendavad hävitatud linnad, mis põlvede jooksul on olnud laastatud.",
"5": "<span>5</span> Ja võõrad seisavad ning hoiavad teie karja, muulased on teie põllu- ja viinamäeharijad.",
"6": "<span>6</span> Aga teid nimetatakse Issanda preestriteks, teist räägitakse kui meie Jumala sulastest; te toitute rahvaste rikkustest ja võite kiidelda nende varandusega.",
"7": "<span>7</span> Häbi ja teotuse asemel te saate kahekordse osa ja ilutsete selles: te pärite kahekordselt oma maal, teil on igavene rõõm,",
"8": "<span>8</span> sest mina, Issand, armastan õiglust, vihkan röövimist ja nurjatust. Ma annan neile ustavalt töötasu ja teen nendega igavese lepingu.",
"9": "<span>9</span> Nende sugu saab tuntuks paganate juures ja nende järglaskond rahvaste keskel; kõik, kes neid näevad, tunnevad ära, et nad on Issanda õnnistatud sugu.",
"10": "<span>10</span> Mina rõõmutsen väga Issandas, mu hing ilutseb mu Jumalas, sest ta on mind riietanud päästeriietega, katnud õigusekuuega, otsekui oleks peigmees enesele pähe pannud piduliku peakatte või pruut ennast ehetega ehtinud.",
"11": "<span>11</span> Sest nagu maa toob esile oma kasvud ja aed laseb võrsuda oma külvi, nõnda laseb ka Issand Jumal võrsuda õigust ja kiitust kõigi rahvaste ees."
},
"62": {
"1": "<span>1</span> Siioni pärast ma ei vaiki ega jää rahule Jeruusalemma pärast, enne kui tema õigus hakkab paistma ja tema pääste põleb otsekui tõrvik.",
"2": "<span>2</span> Siis saavad rahvad näha su õigust ja kõik kuningad su au. Ja sulle antakse uus nimi, mille määrab Issanda suu.",
"3": "<span>3</span> Siis oled sa toredaks krooniks Issanda käes ja kuninglikuks peaehteks oma Jumala pihus.",
"4": "<span>4</span> Sinust ei kõnelda enam kui 'Hüljatust' ega kõnelda su maast enam kui 'Laastatust', vaid sind hüütakse 'Minu armsam' ja su maad 'Abikaasa', sest Issand armastab sind ja su maa saab mehele.",
"5": "<span>5</span> Sest nagu noor mees naib neitsi, nõnda naivad sind su pojad; ja nagu peigmees tunneb rõõmu pruudist, nõnda tunneb su Jumal rõõmu sinust.",
"6": "<span>6</span> Sinu müüride peale, Jeruusalemm, olen ma seadnud vahid; kogu päeva ja kogu öö ei tohi nad hetkekski vaikida. Issanda meenutajad, ärgu olgu teil puhkust",
"7": "<span>7</span> ja ärge andke temale puhkust, enne kui ta on rajanud Jeruusalemma ja seadnud selle maa peale kiituseks!",
"8": "<span>8</span> Issand on vandunud oma parema käe ja oma tugeva käsivarre juures: tõesti, enam ma ei anna su vilja su vaenlastele roaks ega saa võõramaalased juua su veini, mille pärast sa oled vaeva näinud,",
"9": "<span>9</span> vaid kes koguvad, need söövad ja kiidavad Issandat, ja kes korjavad, need joovad mu pühamu õuedes.",
"10": "<span>10</span> Minge, minge väravaist välja, valmistage rahvale teed, sillutage, sillutage maanteed, puhastage kividest, tõstke rahvaile lipp!",
"11": "<span>11</span> Vaata, Issand on kuulutanud maa ääreni: Öelge Siioni tütrele: Vaata, su pääste tuleb! Näe, temaga koos on ta palk ja tema ees on ta töötasu.",
"12": "<span>12</span> Ja neid hüütakse 'Pühaks rahvaks', 'Issanda lunastatuiks'. Ja sind hüütakse 'Otsituks', 'Linnaks, mis pole maha jäetud'."
},
"63": {
"1": "<span>1</span> Kes see on, kes tuleb Edomist, erepunaste riietega Bosrast, see silmapaistva kuuega, kes sammub oma jõukülluses? 'See olen mina, õiguse kuulutaja, võimas päästma!'",
"2": "<span>2</span> Miks on su kuub punane ja riided nagu surutõrresõtkujal?",
"3": "<span>3</span> 'Mina sõtkusin surutõrt üksinda, rahvaste hulgast ei olnud ükski minuga; mina sõtkusin neid vihas ja tallasin raevus: nende verejoad pritsisid mu riiete peale ja ma määrisin kogu oma kuue.",
"4": "<span>4</span> Sest mul oli südames kättemaksupäev ja oli tulnud mu tasumisaasta.",
"5": "<span>5</span> Ma vaatasin, aga aitajat ei olnud, imestasin, aga ükski ei toetanud; siis aitas mind mu oma käsivars ja mulle oli toeks mu tuline viha.",
"6": "<span>6</span> Oma vihas ma tallasin maha rahvad, purustasin nad raevus ja lasksin nende verejoad voolata maa peale.'",
"7": "<span>7</span> Ma meenutan Issanda heldust, Issanda kiiduväärsust, kõige selle pärast, mida Issand meile on osutanud, ja suurt headust Iisraeli soo vastu, mida ta neile on osutanud oma halastuse ja suure helduse pärast.",
"8": "<span>8</span> Sest ta ütles: Nemad on tõesti minu rahvas, lapsed, kes ei tee pettust. Ja ta tuli neile päästjaks.",
"9": "<span>9</span> Kõigis nende ahistustes tundis ta ahistust ja tema palge ingel päästis nad. Armastuse ja kaastunde pärast ta lunastas nad, tõstis nad üles ja kandis neid kõigil muistseil päevil.",
"10": "<span>10</span> Aga nad tõstsid mässu ja kurvastasid tema Püha Vaimu; seepärast ta muutus nende vaenlaseks, võitles ise nende vastu.",
"11": "<span>11</span> Siis nad meenutasid muistseid päevi, Moosest ja tema rahvast: Kus on see, kes tõi veest välja oma lammaste karjase? Kus on see, kes pani tema sisse oma Püha Vaimu,",
"12": "<span>12</span> kes oma aulist käsivart laskis käia Moosese paremal pool, kes lõhestas nende ees veed, et teha enesele igavest nime,",
"13": "<span>13</span> kes talutas neid sügavustest läbi otsekui hobust kõrbes, et nad ei komistaks?",
"14": "<span>14</span> Otsekui karja, kes läheb alla orgu, viis Issanda Vaim neid puhkepaika. Nõnda juhtisid sa oma rahvast, et teha enesele aulist nime.",
"15": "<span>15</span> Vaata taevast alla ja näe oma pühast ja aulisest eluasemest. Kus on su püha viha ja su võimsad teod, su seesmine liigutus ja su halastus? Ära hoia neid tagasi!",
"16": "<span>16</span> Sest sina oled meie isa! Aabraham ju meist ei tea ja Iisrael meid ei tunne. Sina, Issand, oled meie isa, muistsest ajast on su nimi Meie Lunastaja.",
"17": "<span>17</span> Miks lased meid, Issand, eksida sinu teedelt, lased meie südame kõvaks jääda, nõnda et me sind ei karda? Pöördu oma sulaste, oma pärisosa suguharude pärast!",
"18": "<span>18</span> Ainult üürikeseks ajaks oli su pühitsetud rahvas pärijaks, siis tallasid meie vaenlased su pühamu.",
"19": "<span>19</span> Meie oleme nagu need, keda sa iialgi ei ole valitsenud, keda ei ole nimetatud sinu nimega."
},
"64": {
"1": "<span>1</span> Oh, et sa ometi käristaksid taevad lõhki ja tuleksid alla, et mäed kõiguksid su ees - otsekui tuli põletaks risu või tuli paneks vee keema -, et su nimi saaks tuntuks su vaenlastele, et rahvad väriseksid su ees,",
"2": "<span>2</span> kui sa teed kardetavaid tegusid üle meie ootuse, tuled alla, mäed kõiguvad su ees - sellest ei ole kuuldud muistsest ajast.",
"3": "<span>3</span> Ükski kõrv ei ole kuulnud, ükski silm ei ole näinud muud Jumalat peale sinu, kes tema ootajale seesugust võiks teha.",
"4": "<span>4</span> Oh, et sa tuleksid vastu sellele, kes rõõmsasti teeb õigust, neile, kes mõtlevad sinu teedele! Vaata, sina vihastasid, et me tegime patutegusid; neis me oleme olnud kaua ja kas me pääseme?",
"5": "<span>5</span> Me kõik oleme saanud rüvedaks ja kõik meie õigused on määrdunud riide sarnased; me kõik oleme närtsinud nagu lehed ja meie süü kannab meid ära otsekui tuul.",
"6": "<span>6</span> Ei ole ühtegi, kes hüüaks appi sinu nime, kes ennast õhutaks sinust kinni haarama; sest sina oled peitnud oma palge meie eest ja oled lasknud meid hääbuda meie süütegude tõttu.",
"7": "<span>7</span> Nüüd aga, Issand, oled sina meie isa. Meie oleme savi ja sina vormid meid, me kõik oleme sinu kätetöö.",
"8": "<span>8</span> Issand! Ära vihasta üleliia ja ära meenuta ülekohut lõpmata: näe, vaata ometi - me kõik oleme ju sinu rahvas!",
"9": "<span>9</span> Su pühad linnad on saanud kõrbeks, Siion on saanud kõrbeks, Jeruusalemm kõnnumaaks.",
"10": "<span>10</span> Meie püha ja ilus koda, kus meie vanemad sind ülistasid, on saanud tuleroaks, ja varemeis on kõik, mis oli meile kallis.",
"11": "<span>11</span> Kas sa selle juures, Issand, tahad ennast veel tagasi hoida, vaikida ja meid üliväga alandada?"
},
"65": {
"1": "<span>1</span> Ma olen olnud kättesaadav neile, kes mind ei ole nõudnud; ma olen olnud leitav neile, kes mind ei ole otsinud; ma olen öelnud rahvale, kes mu nime ei ole appi hüüdnud: 'Vaata, siin ma olen! Vaata, siin ma olen!'",
"2": "<span>2</span> Kogu päeva ma sirutan käsi kangekaelse rahva poole, kes iseenese mõtetele järgnedes käib teed, mis ei ole hea,",
"3": "<span>3</span> rahva poole, kes mind ärritab, alati mind trotsib rohuaedades ohverdades ja telliskivide peal suitsutades,",
"4": "<span>4</span> kes istub haudades ja ööbib kaljulõhedes, kes sööb sealiha ja kellel on astjais roisklihaleem,",
"5": "<span>5</span> kes ütleb: 'Jää sinna, kus oled, ära ligine mulle, sest ma olen sulle püha!' Need on suits mu sõõrmeis, tuli, mis põleb kogu päeva.",
"6": "<span>6</span> Vaata, see on mu ees kirja pandud: Mina ei rahune, enne kui olen tasunud, jah, kui olen tasunud neile sülle",
"7": "<span>7</span> teie ja teie vanemate süüteod üheskoos, ütleb Issand, sellepärast et nad on suitsutanud mägedel ja on küngastel mind teotanud. Jah, ma mõõdan neile rüppe nende varasemad teod.",
"8": "<span>8</span> Nõnda ütleb Issand: Otsekui mahlaka viinamarjakobara kohta öeldakse: 'Ära seda riku, sest selles on õnnistus!', nõnda teen mina oma sulaste pärast, et mitte kõiki hävitada.",
"9": "<span>9</span> Mina toon Jaakobist järglase ja Juudast oma mägede pärija; minu valitud pärivad maa ja minu sulased elavad seal.",
"10": "<span>10</span> Saaron saab lammaste ja kitsede karjamaaks ja Aakori org veiste lebamispaigaks mu rahvale, kes mind otsib.",
"11": "<span>11</span> Aga teie, kes hülgate Issanda, unustate mu püha mäe, kes katate õnnejumalale laua ja kallate saatusejumalale tembitud veini -",
"12": "<span>12</span> teid ma määran mõõga jaoks ja teil kõigil tuleb põlvitada tapaks, sest kui ma hüüdsin, siis te ei vastanud, kui ma rääkisin, siis te ei kuulnud, vaid tegite kurja mu silmis ja valisite, mis oli mulle vastumeelt.",
"13": "<span>13</span> Seepärast ütleb Issand Jumal nõnda: Vaata, minu sulased söövad, aga teie nälgite; vaata, minu sulased joovad, aga teil on janu; vaata, minu sulased rõõmutsevad, aga teie häbenete.",
"14": "<span>14</span> Vaata, minu sulased hõiskavad südamerõõmust, aga teie kisendate südamevalust ja ulute meeleheitest.",
"15": "<span>15</span> Ja teie jätate oma nime mu valituile sajatuseks: 'Nõnda surmaku sindki Issand Jumal!' Aga oma sulaseid ta nimetab teise nimega.",
"16": "<span>16</span> Kes maa peal ennast õnnistab, õnnistab ennast tõe Jumala nimel, ja kes maa peal vannub, vannub tõe Jumala juures, sest endised hädad on unustatud ja peidetud mu silme eest.",
"17": "<span>17</span> Sest vaata, ma loon uue taeva ja uue maa. Enam ei mõelda endiste asjade peale ja need ei tule meeldegi,",
"18": "<span>18</span> vaid rõõmutsetakse ja ollakse igavesti rõõmsad mu loodu pärast. Sest vaata, ma loon Jeruusalemma rõõmuks ja ta rahva rõõmustuseks.",
"19": "<span>19</span> Mina rõõmutsen Jeruusalemma pärast ja tunnen rõõmu oma rahvast; seal ei ole enam kuulda nutu- ega hädakisahäält.",
"20": "<span>20</span> Seal ei ole enam imikut, kes elab ainult mõne päeva, ega rauka, kellel ei täitu ta päevade määr, nooreks peetakse seda, kes sureb saja-aastaselt, ja neetuks seda, kes ei saa sadat aastat täis.",
"21": "<span>21</span> Nad ehitavad kodasid ja elavad neis, istutavad viinamägesid ja söövad nende vilja.",
"22": "<span>22</span> Nad ei ehita teistele elamiseks, ei istuta teistele söömiseks, sest mu rahva eluiga on otsekui puu eluiga ja mu valitud kasutavad ise oma kätetööd.",
"23": "<span>23</span> Nad ei näe asjata vaeva ega sünnita lapsi hirmu jaoks, sest nad on Issanda õnnistatud sugu ja koos nendega on õnnistus nende võrseil.",
"24": "<span>24</span> Enne kui nad hüüavad, vastan mina; kui nad alles räägivad, olen mina kuulnud.",
"25": "<span>25</span> Hunt ja tall käivad koos karjas, lõvi sööb õlgi nagu veis ja mao toiduks on põrm: ei tehta paha ega kahju kogu mu pühal mäel, ütleb Issand."
},
"66": {
"1": "<span>1</span> Nõnda ütleb Issand: Taevas on minu aujärg ja maa on minu jalajärg. Kus saaks siis olla koda, mida te tahate mulle ehitada, ja kus saaks siis olla mu hingamispaik?",
"2": "<span>2</span> On ju minu käsi selle kõik teinud ja nõnda on see kõik sündinud, ütleb Issand. Aga mina vaatan ka niisuguse peale, kes on vilets, kellel on purukspekstud vaim ja kes väriseb mu sõna ees.",
"3": "<span>3</span> Ons inimese mahalööja härja tapjaga võrdne? Koera kaela käänaja lamba ohverdajaga? Sea vere tooja roaohvri toojaga? Ons ebajumala austaja viiruki suitsutajaga võrdne? Nõnda nagu need on valinud oma teed ja nende hing armastab nende jäledusi,",
"4": "<span>4</span> nõnda valin minagi nende jaoks piinu ja saadan neile sellepärast hirmuvärinaid; sest kui ma hüüdsin, siis ei vastanud ükski, kui ma rääkisin, siis nad ei kuulnud, vaid tegid kurja mu silmis ja valisid, mis on mulle vastumeelt.",
"5": "<span>5</span> Kuulge Issanda sõna, kes te värisete tema sõna ees: Teie vennad, kes teid vihkavad, kes teid ära tõukavad minu nime pärast, ütlevad: 'Issand olgu auline, et saaksime näha teie rõõmu!' Aga nad peavad jääma häbisse!",
"6": "<span>6</span> Kuule! Lärm linnast! Hääl templist! Issanda hääl, kes tasub kätte oma vaenlastele.",
"7": "<span>7</span> Juba enne lapsevaeva sünnitab Siion, enne kui temale tulevad valud, toob ta poeglapse ilmale.",
"8": "<span>8</span> Kes on kuulnud midagi niisugust? Kes on näinud selliseid asju? Kas maa sünnitatakse üheainsa päevaga või tuleb rahvas ilmale ühekorraga? Kuid niipea kui Siion tunneb valusid, toob ta ka kohe oma lapsed ilmale.",
"9": "<span>9</span> Kas mina avan emakoja, ilma et laseksin sünnitada? Või peaksin mina, sünnitama saatja, sulgema emakoja? ütleb su Jumal.",
"10": "<span>10</span> Rõõmustage koos Jeruusalemmaga ja hõisake tema pärast kõik, kes teda armastate! Olge väga rõõmsad koos temaga kõik, kes te tema pärast leinasite,",
"11": "<span>11</span> et võite imeda ja küllastuda tema troostirindadest, et võite juua ja ennast kosutada tema ohtrast emarinnast!",
"12": "<span>12</span> Sest nõnda ütleb Issand: Vaata, ma juhin tema juurde rahu otsekui jõe, ja rahvaste rikkused otsekui tulvava oja; teie lapsi kantakse kätel ja hellitatakse põlvedel.",
"13": "<span>13</span> Otsekui trööstiks teid ema, nõnda trööstin ma teid - ja teid trööstitakse Jeruusalemmas.",
"14": "<span>14</span> Teie näete seda ja teie süda rõõmustab, teie luud-liikmed kasvavad nagu värske rohi. On tuntav, et Issanda käsi on tema sulastega, aga ta needus tema vaenlastega.",
"15": "<span>15</span> Sest vaata, Issand tuleb tules ja tema sõjavankrid on otsekui tuulekeeris, et kätte tasuda vihalõõsas ja sõitluse tuleleekidega.",
"16": "<span>16</span> Sest Issand mõistab kõige liha üle tule ja mõõgaga kohut ja Issanda poolt mahalööduid on siis palju.",
"17": "<span>17</span> Kes endid pühitsevad ja puhastavad rohuaedade jaoks, järgnedes mõnele endi keskelt, ning sealiha, jäleduste ja hiirte sööjad saavad otsa üheskoos, ütleb Issand.",
"18": "<span>18</span> Mina tunnen nende tegusid ja mõtteid, aga ma tulen koguma kõiki rahvaid ning keeli; ja need tulevad ning näevad minu auhiilgust.",
"19": "<span>19</span> Ja ma teen nende keskel ühe tunnustähe. Ma läkitan nende hulgast pääsenuid rahvaste juurde Tarsisesse, Puudi ja Luudi ammuküttide juurde, Tubalisse ja Jaavanisse, kaugetele saartele, kes ei ole kuulnud minust räägitavat ega ole neil aimu minu auhiilgusest; ja need kuulutavad rahvaste keskel minu auhiilgust.",
"20": "<span>20</span> Ja nad toovad kõik teie vennad kõigi rahvaste seast ohvriannina Issandale; nad toovad nad hobuste, vankrite ja tõldadega, muulade ja kärmete kaamelitega mu pühale mäele Jeruusalemma, ütleb Issand, otsekui Iisraeli lapsed toovad puhtais astjais roaohvri Issanda kotta.",
"21": "<span>21</span> Ja nendegi hulgast ma võtan leviitpreestreid, ütleb Issand.",
"22": "<span>22</span> Sest otsekui uus taevas ja uus maa, mis ma teen, püsivad minu palge ees, ütleb Issand, nõnda püsib ka teie sugu ja teie nimi.",
"23": "<span>23</span> Ja noorkuust noorkuusse ning hingamispäevast hingamispäeva tuleb kogu inimsugu mu ette kummardama, ütleb Issand.",
"24": "<span>24</span> Kui nad välja lähevad, siis nad näevad nende meeste laipu, kes astusid üles mu vastu; sest nende uss ei sure ja nende tuli ei kustu, ja nad on jälkuseks kogu inimsoole.'"
}
}
};
module.exports = book;
|
#!/usr/bin/env python
import sys
import os
import uploader
import json
from exif_aux import verify_mapillary_tag
from . import ipc
def upload(import_path, verbose=False, skip_subfolders=False, number_threads=None, max_attempts=None, video_import_path=None, dry_run=False,api_version=1.0):
'''
Upload local images to Mapillary
Args:
import_path: Directory path to where the images are stored.
verbose: Print extra warnings and errors.
skip_subfolders: Skip images stored in subdirectories.
Returns:
Images are uploaded to Mapillary and flagged locally as uploaded.
'''
# sanity check if video file is passed
if video_import_path and (not os.path.isdir(video_import_path) and not os.path.isfile(video_import_path)):
print("Error, video path " + video_import_path +
" does not exist, exiting...")
sys.exit(1)
# in case of video processing, adjust the import path
if video_import_path:
# set sampling path
video_sampling_path = "mapillary_sampled_video_frames"
video_dirname = video_import_path if os.path.isdir(
video_import_path) else os.path.dirname(video_import_path)
import_path = os.path.join(os.path.abspath(import_path), video_sampling_path) if import_path else os.path.join(
os.path.abspath(video_dirname), video_sampling_path)
# basic check for all
if not import_path or not os.path.isdir(import_path):
print("Error, import directory " + import_path +
" does not exist, exiting...")
sys.exit(1)
# get list of file to process
total_file_list = uploader.get_total_file_list(
import_path, skip_subfolders)
upload_file_list = uploader.get_upload_file_list(
import_path, skip_subfolders)
failed_file_list = uploader.get_failed_upload_file_list(
import_path, skip_subfolders)
success_file_list = uploader.get_success_upload_file_list(
import_path, skip_subfolders)
to_finalize_file_list = uploader.get_finalize_file_list(
import_path, skip_subfolders)
if len(success_file_list) == len(total_file_list):
print("All images have already been uploaded")
else:
if len(failed_file_list):
upload_failed = raw_input(
"Retry uploading previously failed image uploads? [y/n]: ") if not ipc.is_enabled() else 'y'
# if yes, add images to the upload list
if upload_failed in ["y", "Y", "yes", "Yes"]:
upload_file_list.extend(failed_file_list)
# verify the images in the upload list, they need to have the image
# description and certain MAP properties
upload_file_list = [
f for f in upload_file_list if verify_mapillary_tag(f)]
if not len(upload_file_list) and not len(to_finalize_file_list):
print("No images to upload.")
print('Please check if all images contain the required Mapillary metadata. If not, you can use "mapillary_tools process" to add them')
sys.exit(1)
if len(upload_file_list):
# get upload params for the manual upload images, group them per sequence
# and separate direct upload images
params = {}
list_per_sequence_mapping = {}
direct_upload_file_list = []
for image in upload_file_list:
log_root = uploader.log_rootpath(image)
upload_params_path = os.path.join(
log_root, "upload_params_process.json")
if os.path.isfile(upload_params_path):
with open(upload_params_path, "rb") as jf:
params[image] = json.load(
jf, object_hook=uploader.ascii_encode_dict)
sequence = params[image]["key"]
if sequence in list_per_sequence_mapping:
list_per_sequence_mapping[sequence].append(image)
else:
list_per_sequence_mapping[sequence] = [image]
else:
direct_upload_file_list.append(image)
# inform how many images are to be uploaded and how many are being skipped
# from upload
print("Uploading {} images with valid mapillary tags (Skipping {})".format(
len(upload_file_list), len(total_file_list) - len(upload_file_list)))
if len(direct_upload_file_list):
uploader.upload_file_list_direct(
direct_upload_file_list, number_threads, max_attempts)
for idx, sequence_uuid in enumerate(list_per_sequence_mapping):
uploader.upload_file_list_manual(
list_per_sequence_mapping[sequence_uuid],
sequence_uuid,
params, idx, number_threads, max_attempts)
if len(to_finalize_file_list):
params = {}
sequences = []
for image in to_finalize_file_list:
log_root = uploader.log_rootpath(image)
upload_params_path = os.path.join(
log_root, "upload_params_process.json")
if os.path.isfile(upload_params_path):
with open(upload_params_path, "rb") as jf:
image_params = json.load(
jf, object_hook=uploader.ascii_encode_dict)
sequence = image_params["key"]
if sequence not in sequences:
params[image] = image_params
sequences.append(sequence)
uploader.flag_finalization(to_finalize_file_list)
uploader.print_summary(upload_file_list)
|
import React, { useEffect } from 'react'
import { graphql } from 'gatsby'
import * as Elements from '../components/elements'
import { Layout } from '../layout'
import { Head } from '../components/head'
import { PostTitle } from '../components/post-title'
import { PostDate } from '../components/post-date'
import { PostContainer } from '../components/post-container'
import { SponsorButton } from '../components/sponsor-button'
import { Bio } from '../components/bio'
import { PostNavigator } from '../components/post-navigator'
import { Disqus } from '../components/disqus'
import { Utterances } from '../components/utterances'
import * as ScrollManager from '../utils/scroll'
import '../styles/code.scss'
import 'katex/dist/katex.min.css'
export default ({ data, pageContext, location }) => {
useEffect(() => {
ScrollManager.init()
return () => ScrollManager.destroy()
}, [])
const post = data.markdownRemark
const metaData = data.site.siteMetadata
const { title, comment, siteUrl, author, sponsor } = metaData
const { disqusShortName, utterances } = comment
const { title: postTitle, date } = post.frontmatter
return (
<Layout location={location} title={title}>
<Head title={postTitle} description={post.excerpt} />
<PostTitle title={postTitle} />
<PostDate date={date} />
<PostContainer html={post.html} />
{!!sponsor.buyMeACoffeeId && (
<SponsorButton sponsorId={sponsor.buyMeACoffeeId} />
)}
<Elements.Hr />
<Bio />
<PostNavigator pageContext={pageContext} />
{!!disqusShortName && (
<Disqus
post={post}
shortName={disqusShortName}
siteUrl={siteUrl}
slug={pageContext.slug}
/>
)}
{!!utterances && <Utterances repo={utterances} />}
</Layout>
)
}
export const pageQuery = graphql`
query BlogPostBySlug($slug: String!) {
site {
siteMetadata {
title
author
siteUrl
comment {
disqusShortName
utterances
}
sponsor {
buyMeACoffeeId
}
}
}
markdownRemark(fields: { slug: { eq: $slug } }) {
id
excerpt(pruneLength: 280)
html
frontmatter {
title
date(formatString: "MMMM DD, YYYY")
}
}
}
`
|
module.exports = {
extends: require.resolve('eslint-config-alexandernanberg'),
};
|
import React, { Component } from "react";
import { connect } from "react-redux";
import { Input, Label, Form, FormFeedback } from "reactstrap";
import PropTypes from "prop-types";
import classnames from "classnames";
import { createProfile } from "../../actions/profileActions";
class CreateProfile extends Component {
constructor(props) {
super(props);
this.state = {
institute: "",
institutewebsite: "",
errors: {}
};
this.onChange = this.onChange.bind(this);
this.onSubmit = this.onSubmit.bind(this);
}
componentWillReceiveProps(nextProps) {
if (nextProps.errors) {
this.setState({ errors: nextProps.errors });
}
}
onSubmit(e) {
e.preventDefault();
const profileData = {
institute: this.state.institute,
institutewebsite: this.state.institutewebsite
};
this.props.createProfile(profileData, this.props.history);
}
onChange(e) {
this.setState({ [e.target.name]: e.target.value });
}
render() {
const { errors } = this.state;
return (
<div className="create-profile" style={{ minHeight: "100vh" }}>
<div className="container">
<div className="row">
<div className="col-md-8 m-auto">
<h1 className="display-4 text-center">Create You Profile</h1>
<p className="lead text-center">
Let's get some information to make your profile.
</p>
{/* <small className="d-block pb-3">* = required fields</small> */}
<Form onSubmit={this.onSubmit}>
<Label className="label">Institute Name: </Label>
<Input
onChange={this.onChange}
name="institute"
placeholder="Institute Name"
value={this.state.institute}
/>
<Label className="label">Institute Website: </Label>
<Input
onChange={this.onChange}
name="institutewebsite"
placeholder="Institute Website"
className={classnames("fa fa-search form-control-feedback", {
"is-invalid": errors.institutewebsite
})}
value={this.state.institutewebsite}
/>
<FormFeedback>{errors.institutewebsite}</FormFeedback>
<input type="submit" className="btn btn-info btn-block mt-4" />
</Form>
</div>
</div>
</div>
</div>
);
}
}
CreateProfile.propTypes = {
profile: PropTypes.object.isRequired,
errors: PropTypes.object.isRequired
};
const mapToStateProps = state => ({
profile: state.profile,
errors: state.errors
});
export default connect(
mapToStateProps,
{ createProfile }
)(CreateProfile);
|
/**
*
* @author xiaoer
* @email 228112142@qq.com
* @date 2018-08-24 23:03:45
*/
/**数据渲染对象*/
var Render = {
/**
* 渲染状态列
* @param rowdata 行数据
* @param renderData 渲染后的列
* @param index
* @param value 当前对象值
*/
customState: function (rowdata,renderData, index, value) {
if(value == "启用"){
return '<span style="color:green">'+value+'</span>';
}
if(value == "禁用"){
return '<span style="color:red">'+value+'</span>';
}
return value;
},
renderImage: function (rowdata, renderData, index, value) {
if (value != null && value != ''){
return '<img src="'+value+'" class="banner-image">';
}
return value;
},
featuredYn: function (rowdata, renderData, index, value) {
if (value == 'Y'){
return '是';
}
return '';
},
/**
* @param rowdata 行数据
* @param renderData 渲染后的列
* @description 详情按钮渲染
*/
info:function(rowdata,renderData){
var btn=' <button onclick="detailOne(\''+"/activityShow/info"+'\',\''+rowdata.showId+'\')" class="layui-btn layui-btn-mini">详情</button>';
return btn;
},
/**
* @param rowdata 行数据
* @param renderData 渲染后的列
* @description 修改按钮渲染
*/
edit:function(rowdata,renderData){
var btn=' <button onclick="editOne(\''+"/activityShow/edit"+'\',\''+rowdata.showId+'\')" class="layui-btn layui-btn-mini">修改</button>';
return btn;
},
/**
* @param rowdata 行数据
* @param renderData 渲染后的列
* @description 删除按钮渲染
*/
delete:function(rowdata,renderData){
var btn=' <button onclick="deleteOne(\''+"删除"+'\',\''+"/activityShow/delete"+'\',\''+rowdata.showId+'\')" class="layui-btn layui-btn-mini layui-btn-delete">删除</button>';
return btn;
},
/**
* @param rowdata 行数据
* @param renderData 渲染后的列
* @description 启用禁用按钮渲染
*/
state:function(rowdata,renderData){
if(rowdata.state=='0'){
return' <button onclick="updateStateOne(\''+"启用"+'\',\''+"/activityShow/enable"+'\',\''+rowdata.showId+'\')"' +
' class="layui-btn layui-btn-mini layui-btn-green">启用</button>';
}
if(rowdata.state=='1'){
return' <button onclick="updateStateOne(\''+"禁用"+'\',\''+"/activityShow/limit"+'\',\''+rowdata.showId+'\')" ' +
'class="layui-btn layui-btn-mini layui-btn-danger">禁用</button>';
}
return "";
}
};
|
__all__ = ['AlignmentPropertyMatrix', 'Sparse3DMatrix']
|