text
stringlengths 2
1.05M
|
|---|
export { default } from './Association'
|
import { VideoPlayer } from "./video-player.js";
import { registerGamepadEvents, registerKeyboardEvents, registerMouseEvents, sendClickEvent } from "./register-events.js";
let playButton;
let videoPlayer;
showPlayButton();
window.document.oncontextmenu = function () {
return false; // cancel default menu
}
window.addEventListener('resize', function() {
videoPlayer.resizeVideo();
}, true);
function showPlayButton() {
if (!document.getElementById('playButton')) {
let elementPlayButton = document.createElement('img');
elementPlayButton.id = 'playButton';
elementPlayButton.src = './public/images/Play.png';
elementPlayButton.alt = 'Start Streaming';
playButton = document.getElementById('player').appendChild(elementPlayButton);
playButton.addEventListener('click', onClickPlayButton);
}
}
function onClickPlayButton() {
playButton.style.display = 'none';
const playerDiv = document.getElementById('player');
playerDiv.classList = 'h-full rounded-lg player active';
// add video player
const elementVideo = document.createElement('video');
elementVideo.id = 'Video';
elementVideo.style.touchAction = 'none';
playerDiv.appendChild(elementVideo);
// add video thumbnail
const elementVideoThumb = document.createElement('video');
elementVideoThumb.id = 'VideoThumbnail';
elementVideoThumb.style.touchAction = 'none';
playerDiv.appendChild(elementVideoThumb);
setupVideoPlayer([elementVideo, elementVideoThumb]).then(value => videoPlayer = value);
const buttonsContainer = document.createElement('div');
buttonsContainer.id = 'buttonsContainer';
playerDiv.appendChild(buttonsContainer);
const buttons = document.querySelector('#buttonsContainer');
// add green button
const elementBlueButton = document.createElement('button');
elementBlueButton.id = "blueButton";
elementBlueButton.innerHTML = "Light on";
buttons.appendChild(elementBlueButton);
elementBlueButton.addEventListener ("click", function() {
sendClickEvent(videoPlayer, 1);
});
// add green button
const elementGreenButton = document.createElement('button');
elementGreenButton.id = "greenButton";
elementGreenButton.innerHTML = "Light off";
buttons.appendChild(elementGreenButton);
elementGreenButton.addEventListener ("click", function() {
sendClickEvent(videoPlayer, 2);
});
// add orange button
const elementOrangeButton = document.createElement('button');
elementOrangeButton.id = "orangeButton";
elementOrangeButton.innerHTML = "Play audio";
buttons.appendChild(elementOrangeButton);
elementOrangeButton.addEventListener ("click", function() {
sendClickEvent(videoPlayer, 3);
});
// add fullscreen button
const elementFullscreenButton = document.createElement('img');
elementFullscreenButton.id = 'fullscreenButton';
elementFullscreenButton.src = './public/images/FullScreen.png';
playerDiv.appendChild(elementFullscreenButton);
elementFullscreenButton.addEventListener ("click", function() {
if (!document.fullscreenElement) {
if(document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
}
else if(document.documentElement.webkitRequestFullscreen){
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
}
});
document.addEventListener('webkitfullscreenchange', onFullscreenChange);
document.addEventListener('fullscreenchange', onFullscreenChange);
function onFullscreenChange(e) {
if(document.webkitFullscreenElement || document.fullscreenElement) {
elementFullscreenButton.style.display = 'none';
}
else {
elementFullscreenButton.style.display = 'block';
}
}
}
async function setupVideoPlayer(elements, config) {
const videoPlayer = new VideoPlayer(elements, config);
await videoPlayer.setupConnection();
videoPlayer.ondisconnect = onDisconnect;
registerGamepadEvents(videoPlayer);
registerKeyboardEvents(videoPlayer);
registerMouseEvents(videoPlayer, elements[0]);
return videoPlayer;
}
function onDisconnect() {
const playerDiv = document.getElementById('player')
clearChildren(playerDiv);
videoPlayer = null;
showPlayButton();
}
function clearChildren(element) {
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
|
var Npj = Npj || {};
Npj.PesquisaRapidaFuncionario = (function(){
function PesquisaRapidaFuncionario() {
this.pesquisaFuncionarioModal = $('#pesquisaFuncionarioModal');
this.pesquisaFuncionarioBtn = $('.js-pesquisa-funcionario-btn');
this.funcionarioInput = $('#nomeFuncionarioModal');
this.htmlTabela = $('#tabela-pesquisa-rapida-funcionario').html();
this.template = Handlebars.compile(this.htmlTabela);
this.mensagemErro = $('.js-mensagem-erro');
}
PesquisaRapidaFuncionario.prototype.iniciar = function() {
this.pesquisaFuncionarioBtn.on('click', onPesquisaFuncionarioClicado.bind(this));
this.pesquisaFuncionarioModal.on('shown.bs.modal', onModalShow.bind(this));
this.pesquisaFuncionarioModal.on('hide.bs.modal', onModalHide.bind(this));
}
function onModalShow() {
this.funcionarioInput.focus();
}
function onModalHide() {
this.funcionarioInput.val('');
this.mensagemErro.addClass('hidden');
}
function onPesquisaFuncionarioClicado(evento) {
evento.preventDefault();
if(this.funcionarioInput.val()) {
const resposta = $.ajax({
url: this.pesquisaFuncionarioModal.find('form').attr('action'),
method: 'GET',
contentType: 'application/json',
data: {
nome: this.funcionarioInput.val()
}
});
resposta.done(onPesquisaConcluida.bind(this));
resposta.fail(onErroPesquisa.bind(this));
} else {
this.mensagemErro.removeClass('hidden');
}
}
function onErroPesquisa() {
this.mensagemErro.removeClass('hidden');
}
function onPesquisaConcluida(resposta) {
let html = this.template(resposta);
$('#containerTabelaPesquisaRapidaFuncionarios').html(html);
$('.js-funcionario-pesquisa-rapida').on('click', onFuncionarioSelecionadoNaLinhaClicado.bind(this));
}
function onFuncionarioSelecionadoNaLinhaClicado(evento) {
let linhaSelecionada = $(evento.currentTarget);
$('#idFuncionario').val(linhaSelecionada.data('id'));
$('#nomeFuncionario').val(linhaSelecionada.data('nome'));
this.pesquisaFuncionarioModal.modal('hide');
}
return PesquisaRapidaFuncionario;
}());
$(function(){
let pesquisaRapidaFuncionario = new Npj.PesquisaRapidaFuncionario();
pesquisaRapidaFuncionario.iniciar();
});
|
const blueprint = require('../blueprint')
const mqtt = require('../mqtt')
const socket = require('../socket')
const timeseries = require('../timeseries')
const devicesService = require('./devices.service')
const devices = angular.module('simulator.common.services.devices', [
blueprint,
mqtt,
socket,
timeseries
])
.factory('devicesService', devicesService)
module.exports = devices
|
import PropTypes from 'prop-types';
import Button from './Button';
const Header = ({ title, onAdd, showAdd }) => {
return (
<header className="header">
<h1>{title}</h1>
<Button
color={showAdd ? 'red' : 'green'}
text={showAdd ? 'Close' : 'Add'}
onClick={onAdd}
/>
</header>
);
};
Header.defaultProps = {
title: 'Task Tracker'
};
Header.propTypes = {
title: PropTypes.string.isRequired
};
export default Header;
|
import Editor from './Editor';
import Bold from './Plugins/Font/bold';
import Italic from './Plugins/Font/italic';
import Strikethrough from './Plugins/Font/strikethrough';
import OrderedList from './Plugins/List/ordered';
import UnorderedList from './Plugins/List/unordered';
import Quote from './Plugins/Block/quote';
import Code from './Plugins/Block/code-block';
import CodeInline from './Plugins/Block/code-inline';
import Hr from './Plugins/Block/wrap';
import Link from './Plugins/link';
import Logger from './Plugins/Logger';
import Image from './Plugins/image';
import Table from './Plugins/table';
import H2 from './Plugins/Header/h2';
import H3 from './Plugins/Header/h3';
import Emoji from './Plugins/Emoji';
Editor.use(H2);
Editor.use(H3);
Editor.use(Bold);
Editor.use(Italic);
Editor.use(Strikethrough);
Editor.use(UnorderedList);
Editor.use(OrderedList);
Editor.use(Quote);
Editor.use(CodeInline);
Editor.use(Code);
Editor.use(Hr);
Editor.use(Link);
Editor.use(Image);
Editor.use(Table);
Editor.use(Emoji);
Editor.use(Logger);
export default Editor;
|
var data = {cosmos: {}}
|
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import '@/style/index.scss'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
|
(function toggleChildrenTabs () {
const btn = document.querySelectorAll('.children-page__nav-link');
const tab = document.querySelectorAll('.children-page__tab');
const select = document.querySelector('.children-page__mob-nav');
if (btn && tab && (btn.length == tab.length)) {
for (let i = 0; i < btn.length; i++) {
btn[i].addEventListener('click', function(e) {
e.preventDefault();
changeActive(i);
})
}
}
if (select) {
select.addEventListener('change', function(e) {
let item = select.value;
changeActive(item);
})
}
function changeActive(n) {
for (let i = 0; i < btn.length; i++) {
btn[i].classList.remove('children-page__nav-link--active');
tab[i].classList.remove('children-page__tab--active');
}
btn[n].classList.add('children-page__nav-link--active');
tab[n].classList.add('children-page__tab--active');
}
})();
|
google.maps.__gjsload__('common', function(_){'use strict';var Mi,Oi,Pi,Ti,Zi,yj,Bj,Cj,Dj,Kj,Lj,Pj,Oj,Qj,Rj,Sj,Tj,Uj,Yj,qk,sk,tk,zk,Ek,Hk,Lk,Pk,Sk,Xk,$k,dl,bl,cl,zl,Al,Dl,Fl,Ml,Ol,Rl,Pl,Ql,Tl,Ul,Vl,Xl,Yl,Zl,$l,bm,dm,fm,gm,hm,im,mm,lm,rm,vm,um,wm,xm,ym,zm,Em,Km,Dm,Jm,Im,Cm,Lm,Mm,Nm,Om,Rm,Qm,Sm,Tm,Um,Pm,Vm,Xm,cn,en,fn,hn,jn,kn,ln,mn,qn,yn,zn,An,Gn,Ln,Mn,Nn,On,Pn,Qn,Sn,Un,Vn,Wn,ao,bo,co,eo,fo,go,ho,io,ro,to,xo,yo,zo,Ao,Bo,Co,Do,Eo,Fo,Go,Ho,Io,Jo,Ko,Lo,Mo,No,Oo,Po,Qo,Ro,So,To,Uo,Vo,Wo,Yo,cp,dp,ep,fp,gp,hp,ip,jp,lp,mp,pp,Sp,Tp,Up,Vp,Wp,Xp,Yp,Zp,aq,
bq,zs,Bs,Ds,Es,Fs,Gs,Hs,Is,Js,Ks,Ls,Ms,Ns,Os,Ps,Qs,$s,at,bt,ft,gt,ht,it,jt,kt,ot,Lu,Mu,Pu,Ou,Ru,Qu,Vu,Wu,Xu,dv,ev,fv,hv,ov,tv,pv,xv,wv,rv,zv,Av,Bv,Nv,Pv,Rv,ew,gw,iw,pw,kw,nw,jw,mw,hw,qw,lw,ow,rw,sw,vw,tw,Cw,Dw,Bw,Ew,Fw,Gw,Hw,Iw,Jw,Kw,Mw,Nw,Pw,Qw,Rw,Sw,Tw,Uw,Yw,Zw,$w,cx,dx,fx,gx,bx,Ww,ax,hx,ex,ix,jx,lx,mx,nx,sx,rx,tx,px,vx,wx,xx,yx,zx,Ax,Dx,Ex,Fx,Gx,Ix,Jx,Kx,Lx,Nx,Ox,Qx,Tx,Vx,Ux,Wx,Xx,Zx,$x,Yx,cy,dy,Ni,Ri,Si,vj,Ij,cu;Mi=function(a){_.ad.setTimeout(function(){throw a;},0)};
Oi=function(){for(var a=null;a=_.Vg.remove();){try{a.Ld.call(a.j)}catch(c){Mi(c)}var b=_.Ug;b.V(a);b.R<b.U&&(b.R++,a.next=b.j,b.j=a)}Ni=!1};
Pi=function(){var a=_.ad.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!_.Gc("Presto")&&(a=function(){var a=window.document.createElement("IFRAME");a.style.display="none";a.src="";window.document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host,a=(0,_.u)(function(a){if(("*"==
d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!_.Ic()){var b=new a,c={},d=c;b.port1.onmessage=function(){if(_.ra(c.next)){c=c.next;var a=c.cb;c.cb=null;a()}};return function(a){d.next={cb:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof window.document&&"onreadystatechange"in window.document.createElement("SCRIPT")?function(a){var b=window.document.createElement("SCRIPT");
b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};window.document.documentElement.appendChild(b)}:function(a){_.ad.setTimeout(a,0)}};_.Qi=function(a){return"function"==_.ua(a)};
Ti=function(){if(_.ad.Promise&&_.ad.Promise.resolve){var a=_.ad.Promise.resolve(void 0);Ri=function(){a.then(Oi)}}else Ri=function(){var a=Oi;!_.Qi(_.ad.setImmediate)||_.ad.Window&&_.ad.Window.prototype&&!_.Gc("Edge")&&_.ad.Window.prototype.setImmediate==_.ad.setImmediate?(Si||(Si=Pi()),Si(a)):_.ad.setImmediate(a)}};_.Ui=function(a){Ri||Ti();Ni||(Ri(),Ni=!0);_.Vg.add(a,void 0)};
_.Vi=function(a,b){for(var c=a.length,d=[],e=0,f=_.wa(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d};_.Wi=function(a,b,c){for(var d=0,e=0,f=_.y(a);e<f&&(b(a[e])&&(a.splice(e--,1),d++),d!=c);++e);return d};_.Xi=function(){var a=_.S.j[1];return a?new _.Ie(a):_.ji};_.Yi=function(a,b){a!==b&&(a.length=0,b&&(a.length=b.length,_.Uc(a,b)))};Zi=function(a,b){var c=b.Ub();return _.Vi(a.j,function(a){a=a.Ub();return c!=a})};
_.$i=function(a){return a.handled||!_.D(a.bubbles)&&"handled"==a.returnValue};_.aj=function(a,b,c){return _.Wi(a,function(a){return b===a},c)};_.bj=function(a,b){return _.pa[a]=b};_.cj=function(a,b){return a.Ba<=b.Ba&&a.Da>=b.Da&&a.Aa<=b.Aa&&a.Fa>=b.Fa};_.dj=function(a,b){return a.Ba<=b.x&&b.x<a.Da&&a.Aa<=b.y&&b.y<a.Fa};_.ej=function(a,b){return b?a.Ba==b.Ba&&a.Aa==b.Aa&&a.Da==b.Da&&a.Fa==b.Fa:!1};_.fj=function(){var a=_.S.j[21];return a?new _.He(a):_.ki};
_.gj=function(){var a=_.S.j[13];return null!=a?a:""};_.hj=function(a){a=a.j[15];return null!=a?a:!1};_.ij=function(a){a=a.j[15];return null!=a?a:0};_.jj=function(a){a.j[1]=a.j[1]||[];return new _.ce(a.j[1])};_.kj=function(a){return(a=a.j[1])?new _.ce(a):_.Dh};_.lj=function(a){a.j[0]=a.j[0]||[];return new _.ce(a.j[0])};_.mj=function(a){return(a=a.j[0])?new _.ce(a):_.Ch};_.nj=function(a,b){a.j[1]=b};_.oj=function(a){a=a.j[1];return null!=a?a:0};_.pj=function(a,b){a.j[0]=b};
_.qj=function(a){a=a.j[0];return null!=a?a:0};_.rj=function(a,b){b=_.rd(b);var c;c=a.R;var d=b.R;if(c=d.isEmpty()?!0:d.R>=c.R&&d.j<=c.j){c=a.j;var d=b.j,e=c.j,f=c.R;c=_.id(c)?_.id(d)?d.j>=e&&d.R<=f:(d.j>=e||d.R<=f)&&!c.isEmpty():_.id(d)?360==c.R-c.j||d.isEmpty():d.j>=e&&d.R<=f}return c};_.sj=function(a,b){a.Ga.addListener(b,void 0);b.call(void 0,a.get())};_.tj=function(a,b){var c=Zi(a,b);c.push(b);return new _.yc(c)};_.uj=function(a){return"array"==_.ua(a)};
_.wj=function(){if(!vj){var a=[];vj={qa:-1,ra:a};a[1]={type:"d",label:1,S:0};a[2]={type:"d",label:1,S:0}}return vj};_.xj=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b};yj=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};_.zj=function(a){if(a.Ab&&"function"==typeof a.Ab)return a.Ab();if(_.wa(a))return a.split("");if(_.va(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return yj(a)};_.Aj=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};
Bj=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};Cj=function(a,b){if(a)for(var c=a.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null,g=null;0<=e?(f=c[d].substring(0,e),g=c[d].substring(e+1)):f=c[d];b(f,g?(0,window.decodeURIComponent)(g.replace(/\+/g," ")):"")}};
Dj=function(a,b,c){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,c);else if(_.va(a)||_.wa(a))_.Ob(a,b,c);else{var d;if(a.qc&&"function"==typeof a.qc)d=a.qc();else if(a.Ab&&"function"==typeof a.Ab)d=void 0;else if(_.va(a)||_.wa(a)){d=[];for(var e=a.length,f=0;f<e;f++)d.push(f)}else d=_.xj(a);for(var e=_.zj(a),f=e.length,g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)}};
_.Ej=function(a,b){this.wa={};this.j=[];this.T=this.R=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){a instanceof _.Ej?(c=a.qc(),d=a.Ab()):(c=_.xj(a),d=yj(a));for(var e=0;e<c.length;e++)this.set(c[e],d[e])}};
_.Fj=function(a){if(a.R!=a.j.length){for(var b=0,c=0;b<a.j.length;){var d=a.j[b];_.Aj(a.wa,d)&&(a.j[c++]=d);b++}a.j.length=c}if(a.R!=a.j.length){for(var e={},c=b=0;b<a.j.length;)d=a.j[b],_.Aj(e,d)||(a.j[c++]=d,e[d]=1),b++;a.j.length=c}};_.Gj=function(a,b){this.x=_.ra(a)?a:0;this.y=_.ra(b)?b:0};_.Hj=function(a,b){var c=_.uf(a,new _.L(0,179.999999),b),d=_.uf(a,new _.L(0,-179.999999),b);return new _.N(c.x-d.x,c.y-d.y)};
_.Jj=function(){if(!Ij){var a=[];Ij={qa:-1,ra:a};a[1]={type:"m",label:1,S:_.Ch,ma:_.wj()};a[2]={type:"m",label:1,S:_.Dh,ma:_.wj()}}return Ij};Kj=function(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};Lj=function(a){return Array.prototype.concat.apply(Array.prototype,arguments)};_.Mj=function(a,b,c){this.R=this.j=null;this.T=a||null;this.U=!!c};
_.Nj=function(a){a.j||(a.j=new _.Ej,a.R=0,a.T&&Cj(a.T,function(b,c){a.add((0,window.decodeURIComponent)(b.replace(/\+/g," ")),c)}))};Pj=function(a,b){_.Nj(a);b=Oj(a,b);return _.Aj(a.j.wa,b)};Oj=function(a,b){var c=String(b);a.U&&(c=c.toLowerCase());return c};Qj=function(a,b){b&&!a.U&&(_.Nj(a),a.T=null,a.j.forEach(function(a,b){var e=b.toLowerCase();b!=e&&(this.remove(b),this.setValues(e,a))},a));a.U=b};
Rj=function(a,b,c){return _.wa(a)?(a=(0,window.encodeURI)(a).replace(b,Bj),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null};Sj=function(a,b){return a?b?(0,window.decodeURI)(a.replace(/%25/g,"%2525")):(0,window.decodeURIComponent)(a):""};Tj=function(a,b){if(a&&_.F(b)){var c=_.Hj(a,b);return Math.sqrt(c.x*c.x+c.y*c.y)}return 0};Uj=function(a,b){var c=new _.sf;c.Ba=a.Ba*b;c.Aa=a.Aa*b;c.Da=a.Da*b;c.Fa=a.Fa*b;return c};
_.Vj=function(a,b){this.T=this.ka=this.R="";this.$=null;this.U=this.ta="";this.V=!1;var c;if(a instanceof _.Vj){this.V=_.ra(b)?b:a.V;_.Wj(this,a.R);this.ka=a.ka;this.T=a.T;_.Xj(this,a.$);this.setPath(a.getPath());c=a.j;var d=new _.Mj;d.T=c.T;c.j&&(d.j=new _.Ej(c.j),d.R=c.R);Yj(this,d);this.U=a.U}else a&&(c=String(a).match(_.Zj))?(this.V=!!b,_.Wj(this,c[1]||"",!0),this.ka=Sj(c[2]||""),this.T=Sj(c[3]||"",!0),_.Xj(this,c[4]),this.setPath(c[5]||"",!0),Yj(this,c[6]||"",!0),this.U=Sj(c[7]||"")):(this.V=
!!b,this.j=new _.Mj(null,0,this.V))};_.Wj=function(a,b,c){a.R=c?Sj(b,!0):b;a.R&&(a.R=a.R.replace(/:$/,""))};_.Xj=function(a,b){if(b){b=Number(b);if((0,window.isNaN)(b)||0>b)throw Error("Bad port number "+b);a.$=b}else a.$=null};Yj=function(a,b,c){b instanceof _.Mj?(a.j=b,Qj(a.j,a.V)):(c||(b=Rj(b,ak)),a.j=new _.Mj(b,0,a.V));return a};_.bk=function(a,b,c){a.j.set(b,c);return a};
_.ck=function(a,b,c,d,e,f,g){var h="";a&&(h+=a+":");c&&(h+="//",b&&(h+=b+"@"),h+=c,d&&(h+=":"+d));e&&(h+=e);f&&(h+="?"+f);g&&(h+="#"+g);return h};_.dk=function(a,b,c,d,e,f,g){return a&&b&&_.F(c)&&(b=_.uf(a,b,c))?(d&&(c=Tj(a,c))&&window.Infinity!=c&&0!=c&&(a&&a.getPov&&0!=a.getPov().heading()%180?(a=b.y-d.y,a=_.La(a,-c/2,c/2),b.y=d.y+a):(a=b.x-d.x,a=_.La(a,-(c/2),c/2),b.x=d.x+a)),d=b.x-e,f=b.y-f,g&&g.x==d&&g.y==f?g:new _.N(d,f)):null};
_.ek=function(a,b,c){var d=b.getSouthWest();b=b.getNorthEast();var e=d.lng(),f=b.lng();e>f&&(b=new _.L(b.lat(),f+360,!0));d=a.fromLatLngToPoint(d);a=a.fromLatLngToPoint(b);a=new _.sf([d,a]);return Uj(a,Math.pow(2,c))};_.fk=function(a,b,c,d){c=Math.pow(2,c);_.fk.tmp||(_.fk.tmp=new _.N(0,0));var e=_.fk.tmp;e.x=b.x/c;e.y=b.y/c;return a.fromPointToLatLng(e,d)};_.gk=function(a){this.j=a||[]};_.hk=function(a,b){a.j[0]=b};
_.kk=function(a,b){_.va(a);if(!ik){ik={};jk={};for(var c=0;65>c;c++)ik[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c),jk[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(c)}for(var c=b?jk:ik,d=[],e=0;e<a.length;e+=3){var f=a[e],g=e+1<a.length,h=g?a[e+1]:0,l=e+2<a.length,n=l?a[e+2]:0,p=f>>2,f=(f&3)<<4|h>>4,h=(h&15)<<2|n>>6,n=n&63;l||(n=64,g||(h=64));d.push(c[p],c[f],c[h],c[n])}return d.join("")};
_.lk=function(a){for(var b=[],c=0,d=0;d<a.length;d++){for(var e=a.charCodeAt(d);255<e;)b[c++]=e&255,e>>=8;b[c++]=e}return b};_.mk=function(a){a=a.split(/(^[^A-Z]+|[A-Z][^A-Z]+)/);for(var b=[],c=0;c<a.length;++c)a[c]&&b.push(a[c]);return b.join("-").toLowerCase()};_.nk=function(){return(new Date).getTime()};_.ok=function(a){return Array.prototype.slice.call(a,0)};_.pk=function(a){return Math.log(a)/Math.LN2};qk=function(a){a=a.match(_.Zj);return _.ck(a[1],a[2],a[3],a[4])};
_.rk=function(){var a;if(a=!!_.S)a=_.S.j[27],a=null!=a?a:!1;return a};sk=function(a,b,c,d,e){this.tileSize=a;this.zoom=b;this.R=d;this.T=e;this.j={}};tk=function(a,b,c){return a.j[b]=a.T(b,c)};_.uk=function(a){(a=a.srcElement||a.target)&&3==a.nodeType&&(a=a.parentNode);return a};_.vk=function(a,b){a.parentNode&&(a.parentNode.removeChild(a),_.bg(a));b&&(_.Bi.appendChild(a),_.Bi.innerHTML="")};_.wk=function(){return window.devicePixelRatio||window.screen.deviceXDPI&&window.screen.deviceXDPI/96||1};
_.xk=function(a,b,c){var d=a.R.R,e=a.R.j,f=a.j.j,g=a.j.R,h=a.toSpan(),l=h.lat(),h=h.lng();_.id(a.j)&&(g+=360);d-=b*l;e+=b*l;f-=b*h;g+=b*h;c&&(a=Math.min(l,h)/c,a=Math.max(1E-6,a),d=a*Math.floor(d/a),e=a*Math.ceil(e/a),f=a*Math.floor(f/a),g=a*Math.ceil(g/a));if(a=360<=g-f)f=-180,g=180;return new _.od(new _.L(d,f,a),new _.L(e,g,a))};
_.yk=function(a,b,c,d,e){b=_.ek(a,b,c);if(e){var f=b.getCenter();(c=Tj(a,c))&&window.Infinity!=c&&0!=c&&(a&&a.getPov&&0!=a.getPov().heading()%180?(a=f.y-e.y,a=_.La(a,-c/2,c/2)-a,b.Aa+=a,b.Fa+=a):(a=f.x-e.x,a=_.La(a,-c/2,c/2)-a,b.Ba+=a,b.Da+=a))}b.Ba-=d.width;b.Aa-=d.height;b.Da-=d.width;b.Fa-=d.height;return b};
zk=function(a,b,c){b=Uj(b,1/Math.pow(2,c));c=new _.N(b.Da,b.Fa);b=a.fromPointToLatLng(new _.N(b.Ba,b.Aa),!0);var d=a.fromPointToLatLng(c,!0);c=Math.min(b.lat(),d.lat());a=Math.max(b.lat(),d.lat());var e=Math.min(b.lng(),d.lng());b=Math.max(b.lng(),d.lng());c=new _.L(c,e,!0);b=new _.L(a,b,!0);return new _.od(c,b)};_.Ak=function(a,b){return a.Ba>=b.Da||b.Ba>=a.Da||a.Aa>=b.Fa||b.Aa>=a.Fa?!1:!0};_.Bk=function(a){this.j=a||[]};_.Ck=function(a){var b=[];_.Q(a.j,1).push(b);return new _.gk(b)};
_.Dk=function(a){var b=!1,c;return function(){b||(c=a(),b=!0);return c}};Ek=function(a){var b;b=b||0;return function(){return a.apply(this,Array.prototype.slice.call(arguments,0,b))}};_.Fk=function(a,b,c,d){this.latLng=a;this.Pb=b;this.pixel=c;this.Ra=d};_.Gk=function(a,b){for(var c=a.length,d=Array(c),e=_.wa(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d};_.U=function(a){return Math.round(a)+"px"};
Hk=function(a){var b=[],c=!1,d;return function(e){e=e||_.k();c?e(d):(b.push(e),1==_.y(b)&&a(function(a){d=a;for(c=!0;_.y(b);)b.shift()(a)}))}};_.Ik=function(a){return(0,window.parseInt)(a,10)};_.Jk=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}};_.Kk=function(a){a=a.split(".");for(var b=_.ad,c;c=a.shift();)if(null!=b[c])b=b[c];else return null;return b};Lk=function(a,b){this.j=a;this.R=b||0};
_.Mk=function(a,b,c){return a.j>b||a.j==b&&a.R>=(c||0)};
Pk=function(){var a=window.navigator.userAgent;this.V=a;this.j=this.type=0;this.version=new Lk(0);this.U=new Lk(0);for(var a=a.toLowerCase(),b=1;8>b;++b){var c=Nk[b];if(-1!=a.indexOf(c)){this.type=b;var d=(new RegExp(c+"[ /]?([0-9]+).?([0-9]+)?")).exec(a);d&&(this.version=new Lk((0,window.parseInt)(d[1],10),(0,window.parseInt)(d[2]||"0",10)));break}}7==this.type&&(b=/^Mozilla\/.*Gecko\/.*[Minefield|Shiretoko][ /]?([0-9]+).?([0-9]+)?/,d=b.exec(this.V))&&(this.type=5,this.version=new Lk((0,window.parseInt)(d[1],
10),(0,window.parseInt)(d[2]||"0",10)));6==this.type&&(b=/rv:([0-9]{2,}.?[0-9]+)/,b=b.exec(this.V))&&(this.type=1,this.version=new Lk((0,window.parseInt)(b[1],10)));for(b=1;7>b;++b)if(c=Ok[b],-1!=a.indexOf(c)){this.j=b;break}if(5==this.j||6==this.j||2==this.j)if(b=/OS (?:X )?(\d+)[_.]?(\d+)/.exec(this.V))this.U=new Lk((0,window.parseInt)(b[1],10),(0,window.parseInt)(b[2]||"0",10));4==this.j&&(b=/Android (\d+)\.?(\d+)?/.exec(this.V))&&(this.U=new Lk((0,window.parseInt)(b[1],10),(0,window.parseInt)(b[2]||
"0",10)));this.T=5==this.type||7==this.type;this.R=4==this.type||3==this.type;this.ta=0;this.T&&(d=/\brv:\s*(\d+\.\d+)/.exec(a))&&(this.ta=(0,window.parseFloat)(d[1]));this.ka=window.document.compatMode||"";this.$=1==this.j||2==this.j||3==this.j&&-1==a.toLowerCase().indexOf("mobile")};_.Qk=function(){var a=_.V;return 1==a.type&&!_.Mk(a.version,9)};_.Rk=function(){var a=_.V;return 4==a.type&&4==a.j};Sk=function(){var a=_.V;return 4==a.type&&(5==a.j||6==a.j)};
_.Vk=function(){return _.Tk()||(_.V.$?!1:_.Uk())};_.Tk=function(){var a;(a=Sk()||_.Rk()&&_.Mk(_.V.version,534))||(a=_.V,a=3==a.type&&4==a.j);return a||0<window.navigator.msMaxTouchPoints};_.Wk=function(){return!!window.PointerEvent||!!window.navigator.msPointerEnabled};_.Uk=function(){return"ontouchstart"in window.document.documentElement&&"ontouchmove"in window.document.documentElement&&"ontouchend"in window.document.documentElement};Xk=_.na("j");
$k=function(){var a=_.Zk.j;return 1==a.type&&!_.Mk(a.version,10)};_.al=function(){var a=_.Zk;switch(a.j.j){case 1:case 2:case 3:return 3==a.j.type||4==a.j.type||5==a.j.type||1==a.j.type&&_.Mk(a.j.version,8);case 4:return 3==a.j.type&&_.Mk(a.j.U,4,1);case 5:case 6:return!0;default:return!1}};
dl=function(a,b){this.T=a;this.j=bl(b,["transform","WebkitTransform","MozTransform","msTransform"]);this.ua=bl(b,["WebkitUserSelect","MozUserSelect","msUserSelect"]);this.ka=bl(b,["transition","WebkitTransition","MozTransition","OTransition","msTransition"]);var c;a:{for(var d=["-webkit-linear-gradient","-moz-linear-gradient","-o-linear-gradient","-ms-linear-gradient"],e=b.createElement("div"),f=0,g;g=d[f];++f)try{if(e.style.background=g+"(left, #000, #fff)",-1!=e.style.background.indexOf(g)){c=g;
break a}}catch(h){}c=null}this.ta=c;this.$=cl(b,"opacity");this.U=cl(b,"borderRadius");c=window.document.getElementsByTagName("script")[0];d=c.style.color;c.style.color="";try{c.style.color="rgba(0, 0, 0, 0.5)"}catch(h){}e=c.style.color!=d;c.style.color=d;this.V=e};bl=function(a,b){for(var c=0,d;d=b[c];++c)if(cl(a,d))return d;return null};cl=function(a,b){return"string"==typeof a.documentElement.style[b]};
_.el=function(a){if(a.classList)return a.classList;a=a.className;return _.wa(a)&&a.match(/\S+/g)||[]};_.fl=function(a,b){var c;a.classList?c=a.classList.contains(b):(c=_.el(a),c=0<=_.Nb(c,b));return c};_.gl=function(a,b){a.classList?a.classList.add(b):_.fl(a,b)||(a.className+=0<a.className.length?" "+b:b)};
_.W=function(a,b,c,d,e,f){var g;f=f||{};1==_.V.type&&9>window.document.documentMode&&("name"in f||"type"in f)&&(a="<"+a,"name"in f&&(a+=' name="'+f.name+'"',delete f.name),"type"in f&&(a+=' type="'+f.type+'"',delete f.type),a+=">");a=_.hl(b).createElement(a);for(g in f)a.setAttribute(g,f[g]);c&&_.il(a,c);d&&_.yf(a,d);b&&!e&&b.appendChild(a);return a};_.jl=function(a,b,c){a=_.hl(b).createTextNode(a);b&&!c&&b.appendChild(a);return a};_.kl=function(a,b){1==_.V.type?a.innerText=b:a.textContent=b};
_.ll=function(a,b){var c=a.style;_.Ga(b,function(a,b){c[a]=b})};_.hl=function(a){return a?9==a.nodeType?a:a.ownerDocument||window.document:window.document};_.il=function(a,b,c,d){d||_.ml(a);a=a.style;c=c?"right":"left";d=_.U(b.x);a[c]!=d&&(a[c]=d);b=_.U(b.y);a.top!=b&&(a.top=b)};_.nl=function(a){a.style.display=""};_.ol=function(a){a.style.visibility="hidden"};_.pl=function(a){a.style.visibility=""};_.ml=function(a){a=a.style;"absolute"!=a.position&&(a.position="absolute")};
_.ql=function(a,b){if(null==b)throw Error("Undefined cursor style");a.style.cursor=b};_.rl=function(a,b){a.style.zIndex=Math.round(b)};_.xl=function(a){var b=!1;_.Zk.mq()?a.draggable=!1:b=!0;var c=_.wl.ua;c?a.style[c]="none":b=!0;b&&a.setAttribute("unselectable","on");a.onselectstart=function(a){_.cb(a);_.db(a)}};_.yl=function(a,b,c){c=c&&1==b;_.wl.$?a.style.opacity=c?"":b:(b="alpha(opacity="+Math.round(100*b)+")",a.style.filter=c?"":b)};
zl=function(a){if(_.wl.$)return a.style.opacity;var b=null;try{a.filters&&(b=a.filters.alpha)}catch(c){}if(b)return b.Opacity/100};Al=function(a,b){var c=_.W("div",b,_.Ng);_.rl(c,a);return c};_.Bl=function(a){var b=_.hl(a).defaultView;return b&&b.getComputedStyle?b.getComputedStyle(a,"")||{}:a.currentStyle?a.currentStyle:a.style};_.Cl=function(a){var b=_.Ik(a);return(0,window.isNaN)(b)||a!=b&&a!=b+"px"?0:b};Dl=function(){return window.document.location&&window.document.location.href||window.location.href};
Fl=function(){if(_.El()){if(_.D(window.innerWidth)&&_.D(window.innerHeight))return new _.N(window.innerWidth,window.innerHeight);if(window.document.body&&_.D(window.document.body.clientWidth))return new _.N(window.document.body.clientWidth,window.document.body.clientHeight);if(window.document.documentElement&&_.D(window.document.documentElement.clientWidth))return new _.N(window.document.documentElement.clientWidth,window.document.documentElement.clientHeight)}};
_.El=function(){try{return window.self===window.top}catch(a){return!1}};_.Gl=function(a){_.D(window.addEventListener)?(window.addEventListener("resize",a,!1),window.addEventListener("scroll",a,!1)):(window.attachEvent("onresize",a),window.attachEvent("onscroll",a))};
_.Il=function(a,b){b&&b.Mh&&(a=a.replace(/(\W)left(\W)/g,"$1`$2"),a=a.replace(/(\W)right(\W)/g,"$1left$2"),a=a.replace(/(\W)`(\W)/g,"$1right$2"));var c=_.W("style",null);c.setAttribute("type","text/css");c.styleSheet?c.styleSheet.cssText=a:c.appendChild(window.document.createTextNode(a));_.Hl(c);return c};_.Hl=function(a){var b=window.document.getElementsByTagName("head")[0];b.childNodes[0].parentNode.insertBefore(a,b.childNodes[0])};
_.Kl=function(a,b,c){return _.Jl+a+(b&&1<_.wk()?"_hdpi":"")+(c?".gif":".png")};_.Ll=function(){this.V=new _.N(0,0)};_.Nl=function(a,b,c){var d=a.get("offset");return d?Ml(a,b,d.width,d.height,c):null};Ml=function(a,b,c,d,e){return _.dk(a.get("projection"),b,a.get("zoom"),a.get("center"),Math.round(c),Math.round(d),e)};
Ol=function(a,b,c,d,e,f){var g=a.get("projection"),h=a.get("zoom");if(b&&g&&_.F(h)){if(!_.F(b.x)||!_.F(b.y))throw Error("from"+e+"PixelToLatLng: Point.x and Point.y must be of type number");a=a.V;a.x=b.x+Math.round(c);a.y=b.y+Math.round(d);return _.fk(g,a,h,f)}return null};
Rl=function(a,b,c){window._xdc_||(window._xdc_={});var d=window._xdc_;return function(e,f,g){function h(){var a=_.ac(c,e,n.md);window.setTimeout(_.u(_.vk,null,a),25E3)}var l="_"+a(e).toString(36);e+="&callback=_xdc_."+l;b&&(e=b(e));Pl(d,l,e);var n=d[l],l=window.setTimeout(n.md,25E3);n.dh.push(new Ql(f,l,g));1==_.V.type?_.Xa(h):h()}};
Pl=function(a,b,c){if(!a[b]){var d=function(a){var b=d.dh.shift();b&&(b.Qp(a),b.Jg())};d.dh=[];d.md=function(){var a=window._xdc_errorCallback;a&&a(c);if(a=d.dh.shift())a.Wi&&a.Wi(),a.Jg()};a[b]=d}};Ql=function(a,b,c){this.Qp=a;this.j=b;this.Wi=c};_.Sl=function(a,b,c,d,e,f,g){var h=c.charAt(c.length-1);"?"!=h&&"&"!=h&&(c+="?");e&&"&"==e.charAt(e.length-1)&&(e=e.substr(0,e.length-1));c+=e;Rl(b,d,a)(c,f,g)};Tl=_.na("j");Ul=function(a){this.j=a||[]};Vl=function(a){this.j=a||[]};
Xl=function(a){if(!Wl){var b=[];Wl={qa:-1,ra:b};b[1]={type:"s",label:1,S:""};b[2]={type:"s",label:1,S:""};b[3]={type:"s",label:1,S:""};b[4]={type:"s",label:1,S:""};b[100]={type:"s",label:1,S:""};b[101]={type:"s",label:1,S:""}}return _.Wg.j(a.j,Wl)};Yl=function(){function a(b){"object"==typeof b&&_.Ga(b,function(b,d){"Size"!=b&&(_.Ga(d.prototype,function(a){d.prototype[a]=_.sa}),a(d))})}_.I.pk();a(_.ad.google.maps)};Zl=function(a){this.j=a||[]};$l=function(a){this.j=a||[]};
bm=function(a){if(!am){var b=[];am={qa:-1,ra:b};b[1]={type:"s",label:1,S:""};b[2]={type:"s",label:1,S:""};b[3]={type:"s",label:1,S:""};b[5]={type:"e",label:1,S:-1};b[6]={type:"u",label:1,S:0};b[7]={type:"s",label:1,S:""};b[8]={type:"b",label:1,S:!1};b[9]={type:"s",label:1,S:""};b[100]={type:"s",label:1,S:""};b[101]={type:"s",label:1,S:""};b[102]={type:"s",label:1,S:""}}return _.Wg.j(a.j,am)};
dm=function(a,b,c,d,e,f){this.R=Hk(function(c){var h=new Ul;h.setUrl(b.substring(0,1024));d&&(h.j[1]=d,e&&(h.j[2]=e));f&&(h.j[3]=f);a(h,function(a){var b;b=a.j[0];b=null!=b?b:!1;0!=a.getStatus()&&(b=!0);if(!b){for(;_.y(_.eg);){var d=_.eg.pop();d.innerHTML="";d.parentNode&&d.parentNode.removeChild(d)}Yl();a=a.j[1];a=null!=a?a:-1;var d=cm[a]||"UrlAuthenticationCommonError",e=_.mk(d),d="Google Maps API error: "+d+" https://developers.google.com/maps/documentation/javascript/error-messages#"+e;if(0==
a||13==a)d+="\nYour site URL to be authorized: "+Dl();_.$a("Google Maps API error: "+d);window.alert("This page was unable to display a Google Maps element. Please contact the site administrator. If you are the administrator of this site, please check the JavaScript console or check the following page for troubleshooting: http://g.co/mapsJSApiErrors")}c(b)})})};_.em=function(a,b){a.j();return function(){var c=this,d=arguments;a.R(function(a){a&&b.apply(c,d)})}};
fm=function(a,b,c,d,e,f,g){this.j=new Zl;this.j.setUrl(c.substring(0,1024));d?(this.j.j[1]=d,g&&(this.j.j[8]=g)):e&&(this.j.j[2]=e);null!=f&&(this.j.j[7]=f);this.j.j[4]=0;this.j.j[5]=1;this.U=a;this.T=b};
gm=function(a){var b;if(b=0==a.getStatus())a=a.j[2],b=!(null!=a&&a);if(b){a=_.W("p");a.innerHTML='This site has exceeded its daily quota for maps. If you are the creator of this site, please visit the <a href="https://developers.google.com/maps/faq#usagelimits?utm_referrer=v3" target="_blank">documentation</a> to learn more.';for(b=_.Kl("api-3/images/deny_circle");_.y(_.eg);){var c=_.eg.pop();c.innerHTML="";var d=_.W("div",c,_.Ng);_.rl(d,1);_.yl(d,.5);d.style.backgroundColor="#000";d.style.width=
"100%";d.style.height="100%";_.xl(d);c=_.W("div",c,_.Ng);_.rl(c,2);c.style.margin="10% 10%";c.style.padding=_.U(10);c.style.borderRadius=_.U(2);c.style.backgroundColor="#fff";c.style.color="#000";c.style.fontFamily="Roboto,Arial,sans-serif";c.style.fontSize=_.U(12);b&&(d=_.W("div",c),d.style.width="100%",d.style.textAlign="center",d=_.W("img",d),d.src=b,_.xl(d));_.xl(c);c.appendChild(a.cloneNode(!0))}Yl();window.console&&window.console.warn('This site has exceeded its daily quota for maps. If you are the creator of this site, please visit the <a href="https://developers.google.com/maps/faq#usagelimits?utm_referrer=v3" target="_blank">documentation</a> to learn more.')}};
_.jm=function(a,b){if(a==b)return new _.N(0,0);var c=null;if(4==_.V.type&&!_.Mk(_.V.version,529)||5==_.V.type&&!_.Mk(_.V.version,12)){if(c=hm(a),b){var d=hm(b);c.x-=d.x;c.y-=d.y}}else c=im(a,b);!b&&c&&Sk()&&!_.Mk(_.V.U,4,1)&&(c.x-=window.pageXOffset,c.y-=window.pageYOffset);return c};
hm=function(a){for(var b=new _.N(0,0),c=_.wl.j,d=_.hl(a).documentElement,e=a;a!=d;){for(;e&&e!=d&&!e.style[c];)e=e.parentNode;if(!e)return new _.N(0,0);a=im(a,e);b.x+=a.x;b.y+=a.y;if(a=e.style[c])if(a=km.exec(a)){var f=(0,window.parseFloat)(a[1]),g=e.offsetWidth/2,h=e.offsetHeight/2;b.x=(b.x-g)*f+g;b.y=(b.y-h)*f+h;f=_.Ik(a[3]);b.x+=_.Ik(a[2]);b.y+=f}a=e;e=e.parentNode}c=im(d,null);b.x+=c.x;b.y+=c.y;return new _.N(Math.floor(b.x),Math.floor(b.y))};
im=function(a,b){var c=new _.N(0,0);if(a==b)return c;var d=_.hl(a);if(a.getBoundingClientRect){var e=a.getBoundingClientRect();c.x+=e.left;c.y+=e.top;lm(c,_.Bl(a));b&&(e=im(b,null),c.x-=e.x,c.y-=e.y);1==_.V.type&&(c.x-=d.documentElement.clientLeft+d.body.clientLeft,c.y-=d.documentElement.clientTop+d.body.clientTop);return c}return d.getBoxObjectFor&&0==window.pageXOffset&&0==window.pageYOffset?(b?(e=_.Bl(b),c.x-=_.Cl(e.borderLeftWidth),c.y-=_.Cl(e.borderTopWidth)):b=d.documentElement,e=d.getBoxObjectFor(a),
d=d.getBoxObjectFor(b),c.x+=e.screenX-d.screenX,c.y+=e.screenY-d.screenY,lm(c,_.Bl(a)),c):mm(a,b)};
mm=function(a,b){var c=new _.N(0,0),d=_.Bl(a),e=a,f=!0;_.V.R&&(lm(c,d),f=!1);for(;e&&e!=b;){c.x+=e.offsetLeft;c.y+=e.offsetTop;f&&lm(c,d);if("BODY"==e.nodeName){var g=c,h=e,l=d,n=h.parentNode,p=!1;if(_.V.T){var q=_.Bl(n),p="visible"!=l.overflow&&"visible"!=q.overflow,t="static"!=l.position;if(t||p)g.x+=_.Cl(l.marginLeft),g.y+=_.Cl(l.marginTop),lm(g,q);t&&(g.x+=_.Cl(l.left),g.y+=_.Cl(l.top));g.x-=h.offsetLeft;g.y-=h.offsetTop}if((_.V.T||1==_.V.type)&&"BackCompat"!=window.document.compatMode||p)window.pageYOffset?
(g.x-=window.pageXOffset,g.y-=window.pageYOffset):(g.x-=n.scrollLeft,g.y-=n.scrollTop)}if(g=e.offsetParent){var z=_.Bl(g);_.V.T&&1.8<=_.V.ta&&"BODY"!=g.nodeName&&"visible"!=z.overflow&&lm(c,z);c.x-=g.scrollLeft;c.y-=g.scrollTop;if(1!=_.V.type&&"BODY"==e.offsetParent.nodeName&&"static"==z.position&&"absolute"==d.position){if(_.V.T){d=_.Bl(g.parentNode);if("BackCompat"!=_.V.ka||"visible"!=d.overflow)c.x-=window.pageXOffset,c.y-=window.pageYOffset;lm(c,d)}break}}e=g;d=z}1==_.V.type&&window.document.documentElement&&
(c.x+=window.document.documentElement.clientLeft,c.y+=window.document.documentElement.clientTop);b&&null==e&&(e=mm(b,null),c.x-=e.x,c.y-=e.y);return c};lm=function(a,b){a.x+=_.Cl(b.borderLeftWidth);a.y+=_.Cl(b.borderTopWidth)};_.nm=function(a,b){if(_.D(a.clientX)){var c=_.V.R?new _.N(a.pageX-window.pageXOffset,a.pageY-window.pageYOffset):new _.N(a.clientX,a.clientY),d=_.jm(b,null);return new _.N(c.x-d.x,c.y-d.y)}return _.Ng};
_.X=function(a,b,c){!_.Di||a&&a.j||_.M("stats",function(d){var e=c||"";d.Ia(a).ta(b+e)})};_.om=function(a,b){a&&a.j||_.M("stats",function(c){c.Ea(a).ta(b)})};_.pm=function(a,b,c,d){if(_.Di&&!d){var e=a+b;_.M("stats",function(d){d.R(e).add(c);if("-p"==b){var g=a+"-h";d.R(g).add(c)}else"-v"==b&&(g=a+"-vh",d.R(g).add(c))})}};_.qm=function(a,b,c){_.Di&&_.M("stats",function(d){d.R(a+b).remove(c)})};rm=function(a,b,c,d){!_.Di||b&&b.j||_.M("stats",function(e){e.ya(a+"-vpr").R(b,c,d)})};
_.sm=function(a,b){var c=a instanceof _.ud?a.getDiv():a.R;if(!(!c||a&&a.j)){var d;a:{if(_.El()){var e=_.zf(c);d=_.jm(c,null);var e=new _.N(d.x+e.width,d.y+e.height),f=new _.N(0,0),g=Fl();if(g){d=Math.max(0,Math.min(e.x,g.x)-Math.max(d.x,f.x))*Math.max(0,Math.min(e.y,g.y)-Math.max(d.y,f.y));break a}}d=void 0}_.D(d)?(d?_.pm(b,"-v",a,!1):_.qm(b,"-v",a),c=_.zf(c),rm(b,a,d,c.width*c.height)):_.pm(b,"-if",a,!1)}};_.tm=function(a,b){if(!a.loaded){var c=a();b&&(c+=b);_.Il(c);a.loaded=!0}};
vm=function(a,b){b=b||a;this.mapPane=um(a,0);this.overlayLayer=um(a,1);this.overlayShadow=um(a,2);this.markerLayer=um(a,3);this.overlayImage=um(b,4);this.floatShadow=um(b,5);this.overlayMouseTarget=um(b,6);this.floatPane=um(b,7)};um=function(a,b){var c=100+b,d=_.hl(a).createElement("div");_.wl.R(d);_.il(d,_.Ng);_.F(c)&&_.rl(d,c);d.style.width="100%";a.appendChild(d);return d};wm=function(a,b,c){this.scale=a;this.j=b;this.Ra=c};xm=function(a,b,c){this.x=a||0;this.y=b||0;this.j=c||1};
ym=function(a,b){a.x-=(1-a.j)*b.x;a.y-=(1-a.j)*b.y};zm=function(a,b){a.j=b.j;a.x=b.x;a.y=b.y};_.Am=function(a){return!!a.handled};Em=function(a,b){_.Bm();this.R=!1;this.La=null;this.U=!1;this.Ta=1==_.V.type;this.Ga=[];this.ka=[];this.ya=!1;this.T=a;Cm(this);this.qb=a.style.cursor;Dm(this);this.Ia=this.Ea=this.ua=this.ta=this.$=this.V=0;this.va=null;this.j=_.sa;this.Oa=b};
_.Bm=function(){if(!Fm){var a,b;_.V.R?(a="url("+_.Jl+"openhand_8_8.cur) 8 8, default",b="url("+_.Jl+"closedhand_8_8.cur) 8 8, move"):(a="url("+_.Jl+"openhand_8_8.cur), default",b="url("+_.Jl+"closedhand_8_8.cur), move");Gm=a;_.Hm=b;Fm=!0}};Km=function(a,b){_.I.trigger(a,"mousemove",b);if(a.U){a.V=b.clientX;a.$=b.clientY;if(!a.R){if(2>=Math.abs(a.ta-a.V)&&2>=Math.abs(a.ua-a.$))return;a.R=!0;_.I.trigger(a,"movestart",Im(a))}_.I.trigger(a,"move",Jm(a))}};
Dm=function(a){var b;b=0!=a.get("draggable")?a.U?a.get("draggingCursor")||_.Hm:a.get("draggableCursor")||Gm:a.get("draggableCursor")||a.qb;a.La!=b&&(_.ql(a.T,b),a.La=b);a.Oa&&a.Oa({cursor:b,Kf:a.U,ao:!(b==_.Hm||b==Gm)})};
Jm=function(a){var b=a.T,c=a.get("container");c&&(a.V=a.ta+_.Ja(a.V-a.ta,c.offsetLeft-a.Ea,c.offsetLeft-a.Ea+c.offsetWidth-b.offsetWidth),a.$=a.ua+_.Ja(a.$-a.ua,c.offsetTop-a.Ia,c.offsetTop-a.Ia+c.offsetHeight-b.offsetHeight));return new wm(1,new _.N(a.V-a.ta,a.$-a.ua),new _.N(a.V-a.va.x,a.$-a.va.y))};Im=function(a){a.va=_.jm(a.T,null);return new wm(1,new _.N(0,0),new _.N(a.ta-a.va.x,a.ua-a.va.y))};
Cm=function(a){var b=a.T,c=a.Ga;0!=a.get("draggable")?c.push(_.I.Ka(b,"click",a,a.pl)):c.push(_.I.Hb(b,"click",a));c.push(_.I.Ka(b,"mouseup",a,a.ji),_.I.Ka(b,"mousedown",a,a.ql),_.I.Hb(b,"dblclick",a,!0),_.I.Ka(b,"mouseover",a,a.tl),_.I.Ka(b,"mouseout",a,a.rl),_.I.Ka(b,"mousemove",a,a.Dj))};Lm=function(a){_.H(a.ka,_.I.removeListener);a.ka.length=0;_.H(a.Ga,_.I.removeListener);a.Ga.length=0};
Mm=function(){var a={};return function(b){if(b.touches||b.changedTouches)return b;if("touch"!=b.pointerType&&b.pointerType!=b.MSPOINTER_TYPE_TOUCH)_.db(b);else{if("MSPointerUp"==b.type||"pointerup"==b.type||"MSLostPointerCapture"==b.type||"lostpointercapture"==b.type)delete a[b.pointerId];else if("MSPointerDown"==b.type||"pointerdown"==b.type||("MSPointerMove"==b.type||"pointermove"==b.type)&&a[b.pointerId])a[b.pointerId]=new _.N(b.pageX,b.pageY);var c=[],d;for(d in a)c.push({pageX:a[d].x,pageY:a[d].y,
target:b.target});b.touches={item:function(a){return c[a]},length:c.length};b.changedTouches={item:function(){return{pageX:b.pageX,pageY:b.pageY,clientX:b.clientX,clientY:b.clientY}},length:1}}}};
Nm=function(a,b,c){this.Wb=this.Xb=0;this.Ea=new _.N(0,0);this.T=new xm;this.j=new xm;this.Vb=new xm;this.Oa=new xm;this.ua=new xm;this.ka=new xm;this.R=new xm;this.ya=0;this.Ga=[];this.$=!1;this.Ia=a;this.Ga.push(_.I.Ka(a,"touchstart",this,this.Lb));this.Ga.push(_.I.Ka(a,"touchmove",this,this.Fb));this.Ga.push(_.I.Ka(a,"touchend",this,this.va));this.Ga.push(_.I.Ka(a,"touchcancel",this,this.va));this.Ga.push(_.I.Ka(a,window.PointerEvent?"pointerdown":"MSPointerDown",this,this.Lb));this.Ga.push(_.I.Ka(a,
window.PointerEvent?"pointermove":"MSPointerMove",this,this.Fb));this.Ga.push(_.I.Ka(a,window.PointerEvent?"pointerup":"MSPointerUp",this,this.va));this.Ga.push(_.I.Ka(a,window.PointerEvent?"lostpointercapture":"MSLostPointerCapture",this,this.va));this.ta=null;this.La=this.Rb=!1;this.Yb={};this.V=Mm();this.ub=b;this.Ta=0!=c;this.U=_.sa;2==_.wl.T.type&&(a.style.touchAction="none");a.style.msTouchAction="none"};Om=function(a,b,c){for(var d=0,e=b?b.length:0;d<e;++d)a.Yb[b.item(d).identifier]=c};
Rm=function(a,b,c,d){for(var e=[],f=0,g=b.length;f<g;++f){var h=b.item(f);a.Yb[h.identifier]&&e.push(h)}1==e.length?c.set(e[0].pageX,e[0].pageY,1):2==e.length&&c.set((e[0].pageX+e[1].pageX)/2,(e[0].pageY+e[1].pageY)/2,Pm(a,e[0],e[1]));zm(d,c);Qm(a)};Qm=function(a){var b=a.j.j/a.T.j,c=!!a.get("scaleQuiver");a.ua.transform(a.Oa,a.T,a.j,c&&.7<b&&1.3>b)};Sm=function(a){zm(a.Oa,a.ua);zm(a.T,a.j)};
Tm=function(a){zm(a.ka,a.ua);ym(a.ka,a.ta);zm(a.R,a.Vb);a.R.j=0;ym(a.R,a.ta);return new wm(a.ka.j,new _.N(Math.round(a.ka.x),Math.round(a.ka.y)),new _.N(Math.round(a.R.x),Math.round(a.R.y)))};Um=function(a,b,c){c=c.changedTouches;var d=c.item(c.length-1);c=window.document.createEvent("MouseEvents");c.initMouseEvent(b,!0,!0,window,1,d.pageX,d.pageY,d.clientX,d.clientY,!1,!1,!1,!1,0,null);c.j=!0;(d=a.qb)&&d.dispatchEvent&&d.dispatchEvent(c);_.I.trigger(a,b,c)};
Pm=function(a,b,c){return 0!=a.get("scalable")?Math.sqrt(Math.pow(b.pageX-c.pageX,2)+Math.pow(b.pageY-c.pageY,2)):1};Vm=function(a){return 0!=a.get("draggable")};
_.Wm=function(a,b,c,d){this.T=0;var e="mouseup mousedown mousemove movestart move moveend mouseover mouseout click dblclick".split(" "),f=this;if(_.Wk()||!_.Vk())this.j=new Em(a,c),this.j.bindTo("draggingCursor",this),this.j.bindTo("draggableCursor",this),this.j.bindTo("draggable",this),_.Ob(e,function(a){_.I.addListener(f.j,a,function(b){f.T+500<_.Ea()&&_.I.trigger(f,a,b)})});_.Vk()&&(this.R=new Nm(a,b,d),this.R.bindTo("scaleQuiver",this),this.R.bindTo("draggable",this),this.R.bindTo("scalable",
this),_.Ob(e,function(a){_.I.addListener(f.R,a,function(b){f.T=_.Ea();_.I.trigger(f,a,b)})}))};Xm=_.k();_.Ym=function(a){this.j=a||[]};_.Zm=function(a){this.j=a||[]};_.$m=function(a){this.j=a||[]};_.an=function(a){this.j=a||[]};_.bn=function(a){this.Ce=a||[]};cn=function(a){this.j=a||[]};_.dn=function(a){this.j=a||[]};en=function(a){a=a.j[0];return null!=a?a:0};fn=function(a){a=a.j[1];return null!=a?a:0};
hn=function(a){return function(b){if(null!=b.j[5]){var c=b.j[5],c=(c?new cn(c):gn).j[0];a.set("gid",null!=c?c:"")}null!=b.j[7]&&(b=b.j[7],a.set("persistenceKey",null!=b?b:""))}};jn=function(a,b,c,d,e){b=b.call(e);a=a?JSON.stringify(b):b;c.postMessage(a,d)};kn=function(a,b,c,d){var e=d||{};_.I.addDomListener(window,"message",function(d){e.source&&e.source!=d.source||e.lj&&e.lj.contentWindow!=d.source||e.host&&qk(e.host)!=d.origin||!d.data||(d=a?JSON.parse(d.data):d.data,c(new b(d)))})};
ln=function(a,b,c){this.T=b;this.j={};this.R={};kn(c,_.dn,(0,_.u)(this.U,this),{lj:a,host:a.src})};mn=function(a){mn[" "](a);return a};_.nn=function(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}_.Zg&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b};
_.on=function(a){if(1==a.nodeType)return a=_.nn(a),new _.Gj(a.left,a.top);a=a.changedTouches?a.changedTouches[0]:a;return new _.Gj(a.clientX,a.clientY)};_.pn=function(a){this.j=a||[]};qn=function(a){this.j=a||[]};_.rn=function(a){this.j=a||[]};_.tn=function(){sn||(sn={qa:-1,ra:[]});return sn};_.un=function(a){this.j=a||[]};_.xn=function(){if(!vn){var a=[];vn={qa:-1,ra:a};a[1]={type:"y",label:2,S:""};a[2]={type:"y",label:2,S:""};a[3]={type:"m",label:1,S:wn,ma:_.tn()}}return vn};
yn=function(a){this.j=a||[]};zn=function(a){this.j=a||[]};An=function(a){this.j=a||[]};Gn=function(){if(!Bn){var a=[];Bn={qa:-1,ra:a};if(!Cn){var b=[];Cn={qa:-1,ra:b};if(!Dn){var c=[];Dn={qa:-1,ra:c};c[1]={type:"e",label:1,S:4369};c[2]={type:"s",label:1,S:""}}b[1]={type:"m",label:1,S:En,ma:Dn};b[2]={type:"b",label:1,S:!1}}a[15]={type:"m",label:1,S:Fn,ma:Cn}}return Bn};_.Hn=function(a){this.j=a||[]};
Ln=function(){if(!In){var a=[];In={qa:-1,ra:a};a[1]={type:"x",label:2,S:0};a[2]={type:"x",label:2,S:0};a[500]={type:"m",label:1,S:Jn,ma:Gn()};a[15]={type:"m",label:1,S:Kn,ma:_.tn()}}return In};Mn=function(a){this.j=a||[]};Nn=function(a){this.j=a||[]};On=function(a){this.j=a||[]};Pn=function(a){this.j=a||[]};Qn=function(a){this.j=a||[]};Sn=function(){if(!Rn){var a=[];Rn={qa:-1,ra:a};a[3]={type:"d",label:1,S:0};a[4]={type:"d",label:1,S:0}}return Rn};
Un=function(){if(!Tn){var a=[];Tn={qa:-1,ra:a};a[1]={type:"i",label:1,S:0};a[2]={type:"i",label:1,S:0}}return Tn};Vn=function(a){this.j=a||[]};Wn=function(a){this.j=a||[]};
ao=function(){if(!Xn){var a=[];Xn={qa:-1,ra:a};if(!Yn){var b=[];Yn={qa:-1,ra:b};b[4]={type:"e",label:1,S:0};b[1]={type:"i",label:1,S:0};b[2]={type:"i",label:1,S:0};b[3]={type:"i",label:1,S:0}}a[1]={type:"m",label:1,S:Zn,ma:Yn};a[2]={type:"m",label:1,S:$n,ma:Sn()};a[3]={type:"s",label:1,S:""};a[4]={type:"s",label:1,S:""};a[7]={type:"b",label:1,S:!1};a[8]={type:"i",label:1,S:0};a[9]={type:"b",label:1,S:!1};a[10]={type:"s",label:1,S:""};a[11]={type:"e",label:1,S:0};a[12]={type:"e",label:1,S:1}}return Xn};
bo=function(a){this.j=a||[]};co=function(a){this.j=a||[]};eo=function(a){this.j=a||[]};fo=function(a){this.j=a||[]};go=function(a){this.j=a||[]};ho=function(a){this.j=a||[]};io=function(a){this.j=a||[]};_.jo=function(a){this.j=a||[]};
ro=function(){if(!ko){var a=[];ko={qa:-1,ra:a};if(!lo){var b=[];lo={qa:-1,ra:b};b[2]={type:"d",label:1,S:0};b[3]={type:"d",label:1,S:0};b[1]={type:"d",label:1,S:0}}a[1]={type:"m",label:1,S:mo,ma:lo};no||(b=[],no={qa:-1,ra:b},b[1]={type:"f",label:1,S:0},b[2]={type:"f",label:1,S:0},b[3]={type:"f",label:1,S:0});a[2]={type:"m",label:1,S:oo,ma:no};a[3]={type:"m",label:1,S:po,ma:_.qo()};a[4]={type:"f",label:1,S:0}}return ko};
_.qo=function(){if(!so){var a=[];so={qa:-1,ra:a};a[1]={type:"i",label:1,S:0};a[2]={type:"i",label:1,S:0}}return so};to=function(a){this.j=a||[]};xo=function(){if(!uo){var a=[];uo={qa:-1,ra:a};a[1]={type:"s",label:1,S:""};a[9]={type:"e",label:1,S:0};a[2]={type:"s",label:1,S:""};a[3]={type:"m",label:1,S:vo,ma:ro()};a[4]={type:"m",label:1,S:wo,ma:Sn()};a[5]={type:"e",label:1,S:0};a[6]={type:"b",label:1,S:!1};a[7]={type:"b",label:1,S:!1};a[10]={type:"i",label:1,S:2147483647}}return uo};
yo=function(a){this.j=a||[]};zo=function(a){this.j=a||[]};Ao=function(a){this.j=a||[]};Bo=function(a){this.j=a||[]};Co=function(a){this.j=a||[]};Do=function(a){this.j=a||[]};Eo=function(a){this.j=a||[]};Fo=function(a){this.j=a||[]};Go=function(a){this.j=a||[]};Ho=function(a){this.j=a||[]};Io=function(a){this.j=a||[]};Jo=function(a){this.j=a||[]};Ko=function(a){this.j=a||[]};Lo=function(a){this.j=a||[]};Mo=function(a){this.j=a||[]};No=function(a){this.j=a||[]};Oo=function(a){this.j=a||[]};
Po=function(a){this.j=a||[]};Qo=function(a){this.j=a||[]};Ro=function(a){this.j=a||[]};So=function(a){this.j=a||[]};To=function(a){this.j=a||[]};Uo=function(a){this.j=a||[]};Vo=function(a){this.j=a||[]};Wo=function(a){this.j=a||[]};_.Xo=function(a){this.j=a||[]};Yo=function(a){this.j=a||[]};_.$o=function(){if(!Zo){var a=[];Zo={qa:-1,ra:a};a[1]={type:"j",label:2,S:""};a[2]={type:"x",label:2,S:0};a[3]={type:"x",label:2,S:0}}return Zo};
cp=function(){if(!ap){var a=[];ap={qa:-1,ra:a};a[1]={type:"m",label:1,S:bp,ma:_.$o()};a[2]={type:"j",label:1,S:""}}return ap};dp=function(a){this.j=a||[]};ep=function(a){this.j=a||[]};fp=function(a){this.j=a||[]};gp=function(a){this.j=a||[]};hp=function(a){this.j=a||[]};ip=function(a){this.j=a||[]};jp=function(a){this.j=a||[]};
lp=function(){if(!kp){var a=[];kp={qa:-1,ra:a};a[1]={type:"i",label:1,S:-1};a[2]={type:"u",label:2,S:0};a[3]={type:"u",label:3};a[4]={type:"i",label:1,S:0};a[5]={type:"e",label:1,S:0}}return kp};mp=function(a){this.j=a||[]};
pp=function(){if(!np){var a=[];np={qa:-1,ra:a};a[1]={type:"i",label:1,S:-1};a[11]={type:"i",label:1,S:-1};a[2]={type:"i",label:1,S:0};a[8]={type:"i",label:1,S:0};a[5]={type:"i",label:1,S:-1};a[6]={type:"i",label:1,S:-1};a[7]={type:"i",label:1,S:0};a[9]={type:"i",label:1,S:-1};a[10]={type:"b",label:1,S:!1};a[12]={type:"y",label:1,S:""};a[13]={type:"m",label:1,S:op,ma:cp()};a[14]={type:"i",label:1,S:-1};a[3]={type:"i",label:1,S:0};a[4]={type:"i",label:1,S:0}}return np};Sp=function(a){this.j=a||[]};
Tp=function(a){this.j=a||[]};Up=function(a){this.j=a||[]};Vp=function(a){this.j=a||[]};Wp=function(a){this.j=a||[]};Xp=function(a){this.j=a||[]};Yp=function(a){this.j=a||[]};Zp=function(a){this.j=a||[]};_.$p=function(a){this.j=a||[]};aq=function(a){this.j=a||[]};bq=function(a){this.j=a||[]};
zs=function(){if(!cq){var a=[];cq={qa:-1,ra:a};a[2]={type:"m",label:1,S:dq,ma:xo()};a[14]={type:"b",label:1,S:!1};a[10]={type:"s",label:1,S:""};if(!eq){var b=[];eq={qa:-1,ra:b};b[1]={type:"s",label:1,S:""};b[5]={type:"s",label:1,S:""};b[12]={type:"s",label:1,S:""};b[10]={type:"b",label:1,S:!1};b[11]={type:"b",label:1,S:!1};if(!fq){var c=[];fq={qa:-1,ra:c};c[3]={type:"m",label:1,S:gq,ma:Sn()};c[4]={type:"m",label:1,S:hq,ma:Sn()}}b[8]={type:"m",label:1,S:iq,ma:fq};jq||(c=[],jq={qa:-1,ra:c},c[1]={type:"m",
label:2,S:kq,ma:Ln()},c[2]={type:"m",label:2,S:lq,ma:Ln()});b[6]={type:"m",label:1,S:mq,ma:jq};b[13]={type:"m",label:1,S:nq,ma:xo()};oq||(c=[],oq={qa:-1,ra:c},c[1]={type:"s",label:1,S:""},c[2]={type:"s",label:1,S:""},c[3]={type:"s",label:1,S:""},c[4]={type:"f",label:1,S:0},c[5]={type:"f",label:1,S:0});b[2]={type:"m",label:1,S:pq,ma:oq};qq||(c=[],qq={qa:-1,ra:c},c[1]={type:"m",label:1,S:rq,ma:_.xn()},c[3]={type:"s",label:1,S:""},c[2]={type:"f",label:1,S:0},c[4]={type:"i",label:1,S:0});b[3]={type:"m",
label:3,ma:qq};if(!sq){c=[];sq={qa:-1,ra:c};c[1]={type:"e",label:3};if(!tq){var d=[];tq={qa:-1,ra:d};d[1]={type:"e",label:1,S:0};d[2]={type:"v",label:1,S:"0"}}c[2]={type:"m",label:1,S:uq,ma:tq};c[4]={type:"e",label:3};c[7]={type:"s",label:1,S:""};c[18]={type:"b",label:1,S:!1};c[8]={type:"e",label:1,S:0};vq||(d=[],vq={qa:-1,ra:d},d[1]={type:"s",label:1,S:""},d[2]={type:"i",label:1,S:1},d[3]={type:"e",label:1,S:0},d[4]={type:"e",label:1,S:0},d[5]={type:"b",label:1,S:!1});c[9]={type:"m",label:1,S:wq,
ma:vq};c[10]={type:"e",label:3};xq||(d=[],xq={qa:-1,ra:d},d[4]={type:"e",label:3},d[5]={type:"e",label:3});c[11]={type:"m",label:1,S:yq,ma:xq};c[12]={type:"s",label:3};c[13]={type:"i",label:1,S:0};c[14]={type:"i",label:1,S:0};c[15]={type:"i",label:1,S:0};c[19]={type:"b",label:1,S:!1};c[16]={type:"b",label:1,S:!1};c[17]={type:"b",label:1,S:!1}}b[4]={type:"m",label:1,S:zq,ma:sq};b[17]={type:"s",label:1,S:""};b[18]={type:"s",label:1,S:""};Aq||(c=[],Aq={qa:-1,ra:c},c[1]={type:"b",label:1,S:!1},c[2]={type:"s",
label:1,S:""},c[3]={type:"s",label:3});b[19]={type:"m",label:1,S:Bq,ma:Aq};b[20]={type:"e",label:1,S:1}}a[12]={type:"m",label:1,S:Cq,ma:eq};Dq||(b=[],Dq={qa:-1,ra:b},b[1]={type:"s",label:1,S:""});a[15]={type:"m",label:1,S:Eq,ma:Dq};if(!Fq){b=[];Fq={qa:-1,ra:b};Gq||(c=[],Gq={qa:-1,ra:c},c[1]={type:"s",label:1,S:""},c[2]={type:"s",label:1,S:""},c[3]={type:"m",label:1,S:Hq,ma:Sn()},c[12]={type:"s",label:1,S:""},c[4]={type:"s",label:1,S:""},c[5]={type:"e",label:1,S:4},c[6]={type:"e",label:1,S:0},Iq||
(d=[],Iq={qa:-1,ra:d},d[1]={type:"s",label:1,S:""},d[2]={type:"f",label:1,S:0},d[3]={type:"s",label:1,S:""},d[4]={type:"s",label:1,S:""}),c[7]={type:"m",label:1,S:Jq,ma:Iq},c[8]={type:"s",label:1,S:""},c[9]={type:"b",label:1,S:!1},c[13]={type:"s",label:1,S:""},c[11]={type:"b",label:1,S:!1},c[14]={type:"s",label:1,S:""},c[15]={type:"b",label:1,S:!1});b[1]={type:"m",label:3,ma:Gq};b[2]={type:"e",label:1,S:6};b[3]={type:"m",label:1,S:Kq,ma:ro()};Lq||(c=[],Lq={qa:-1,ra:c},Mq||(d=[],Mq={qa:-1,ra:d},d[1]=
{type:"m",label:1,S:Nq,ma:Un()},d[2]={type:"m",label:1,S:Oq,ma:Un()}),c[1]={type:"m",label:3,ma:Mq},c[2]={type:"b",label:1,S:!1});b[20]={type:"m",label:1,S:Pq,ma:Lq};b[4]={type:"i",label:1,S:0};b[5]={type:"e",label:1,S:2};if(!Qq){c=[];Qq={qa:-1,ra:c};if(!Rq){d=[];Rq={qa:-1,ra:d};d[1]={type:"e",label:1,S:1E3};d[2]={type:"e",label:1,S:1};d[3]={type:"j",label:1,S:""};d[5]={type:"e",label:1,S:1};d[6]={type:"b",label:1,S:!1};d[7]={type:"e",label:3};if(!Sq){var e=[];Sq={qa:-1,ra:e};e[1]={type:"e",label:1,
S:0}}d[10]={type:"m",label:3,ma:Sq};d[8]={type:"e",label:1,S:0};d[9]={type:"b",label:1,S:!1}}c[1]={type:"m",label:1,S:Tq,ma:Rq};Uq||(d=[],Uq={qa:-1,ra:d},d[1]={type:"b",label:1,S:!1},d[2]={type:"b",label:1,S:!1},d[20]={type:"e",label:1,S:1},d[3]={type:"b",label:1,S:!0},d[4]={type:"b",label:1,S:!0},d[6]={type:"b",label:1,S:!0},Vq||(e=[],Vq={qa:-1,ra:e},e[2]={type:"b",label:1,S:!1},e[3]={type:"b",label:1,S:!1},e[4]={type:"b",label:1,S:!1},e[5]={type:"b",label:1,S:!1}),d[5]={type:"m",label:1,S:Wq,ma:Vq},
d[7]={type:"b",label:1,S:!1},d[8]={type:"b",label:1,S:!1});c[2]={type:"m",label:1,S:Xq,ma:Uq};c[7]={type:"b",label:1,S:!1};c[3]={type:"b",label:1,S:!0};c[4]={type:"b",label:1,S:!0};Yq||(d=[],Yq={qa:-1,ra:d},d[1]={type:"b",label:1,S:!1},d[2]={type:"i",label:1,S:0},d[3]={type:"i",label:1,S:0},d[7]={type:"i",label:1,S:0},d[4]={type:"b",label:1,S:!1},d[9]={type:"s",label:1,S:""},d[17]={type:"b",label:1,S:!1},d[18]={type:"b",label:1,S:!1},d[20]={type:"i",label:1,S:-1},d[21]={type:"b",label:1,S:!1},d[30]=
{type:"b",label:1,S:!1},d[22]={type:"b",label:1,S:!1},d[23]={type:"b",label:1,S:!1},d[24]={type:"i",label:1,S:0},d[25]={type:"b",label:1,S:!1},d[26]={type:"i",label:1,S:0},d[27]={type:"i",label:1,S:0},d[28]={type:"d",label:1,S:1},d[29]={type:"b",label:1,S:!1},d[31]={type:"b",label:1,S:!1},d[32]={type:"i",label:1,S:0},d[33]={type:"i",label:1,S:0},d[34]={type:"i",label:1,S:-1},d[35]={type:"i",label:1,S:-1},d[36]={type:"i",label:1,S:-1});c[6]={type:"m",label:1,S:Zq,ma:Yq};c[8]={type:"b",label:1,S:!1};
c[9]={type:"e",label:1,S:2};c[10]={type:"b",label:1,S:!1};$q||(d=[],$q={qa:-1,ra:d},d[1]={type:"e",label:1,S:0});c[11]={type:"m",label:1,S:ar,ma:$q};c[12]={type:"b",label:1,S:!0};c[13]={type:"b",label:1,S:!0};c[14]={type:"b",label:1,S:!1};c[15]={type:"i",label:3};c[16]={type:"b",label:1,S:!1};br||(d=[],br={qa:-1,ra:d},d[1]={type:"e",label:3},d[2]={type:"b",label:1,S:!0},d[3]={type:"e",label:3},d[4]={type:"e",label:1,S:0});c[17]={type:"m",label:1,S:cr,ma:br};dr||(d=[],dr={qa:-1,ra:d},d[1]={type:"e",
label:1,S:0},d[2]={type:"e",label:1,S:1},d[3]={type:"j",label:1,S:""});c[19]={type:"m",label:1,S:er,ma:dr};fr||(d=[],fr={qa:-1,ra:d},d[1]={type:"e",label:1,S:6},d[2]={type:"e",label:1,S:1},d[7]={type:"b",label:1,S:!1},d[3]={type:"b",label:1,S:!0},d[4]={type:"b",label:1,S:!1},d[5]={type:"e",label:1,S:0},d[6]={type:"b",label:1,S:!1});c[20]={type:"m",label:1,S:gr,ma:fr};c[25]={type:"b",label:1,S:!1};c[26]={type:"b",label:1,S:!1};c[31]={type:"b",label:1,S:!0};c[33]={type:"b",label:1,S:!0};c[34]={type:"b",
label:1,S:!1}}b[6]={type:"m",label:1,S:hr,ma:Qq};b[7]={type:"e",label:1,S:2};ir||(c=[],ir={qa:-1,ra:c},c[1]={type:"e",label:1,S:0},c[2]={type:"b",label:1,S:!1},c[3]={type:"b",label:1,S:!1},c[4]={type:"i",label:3},c[5]={type:"i",label:3},c[6]={type:"b",label:1,S:!1});b[8]={type:"m",label:1,S:jr,ma:ir};kr||(c=[],kr={qa:-1,ra:c},c[1]={type:"e",label:1,S:0});b[26]={type:"m",label:1,S:lr,ma:kr};mr||(c=[],mr={qa:-1,ra:c},c[1]={type:"i",label:1,S:0},c[2]={type:"m",label:1,S:nr,ma:Sn()},c[3]={type:"s",label:1,
S:""},c[4]={type:"f",label:1,S:0},c[5]={type:"b",label:1,S:!1});b[9]={type:"m",label:3,ma:mr};b[21]={type:"s",label:1,S:""};b[13]={type:"s",label:1,S:""};b[12]={type:"b",label:1,S:!1};b[14]={type:"b",label:1,S:!1};if(!or){c=[];or={qa:-1,ra:c};c[17]={type:"s",label:1,S:""};c[9]={type:"s",label:1,S:""};c[1]={type:"s",label:1,S:""};c[2]={type:"s",label:1,S:""};c[4]={type:"m",label:1,S:pr,ma:pp()};qr||(d=[],qr={qa:-1,ra:d},d[1]={type:"e",label:1,S:0});c[19]={type:"m",label:1,S:rr,ma:qr};c[15]={type:"i",
label:1,S:0};c[12]={type:"e",label:1,S:0};c[18]={type:"e",label:3};c[13]={type:"e",label:1,S:0};if(!sr){d=[];sr={qa:-1,ra:d};d[1]={type:"i",label:1,S:0};d[3]={type:"i",label:1,S:-1};d[4]={type:"i",label:3};d[6]={type:"e",label:1,S:0};if(!tr){e=[];tr={qa:-1,ra:e};if(!ur){var f=[];ur={qa:-1,ra:f};f[1]={type:"m",label:1,S:vr,ma:_.$o()};f[3]={type:"m",label:1,S:wr,ma:cp()};f[4]={type:"s",label:1,S:""};f[2]={type:"m",label:1,S:xr,ma:pp()};f[5]={type:"s",label:1,S:""}}e[1]={type:"m",label:1,S:yr,ma:ur}}d[232]=
{type:"m",label:1,S:zr,ma:tr}}c[8]={type:"m",label:3,ma:sr};c[3]={type:"b",label:1,S:!1};c[5]={type:"s",label:1,S:""};c[6]={type:"s",label:1,S:""};Ar||(d=[],Ar={qa:-1,ra:d},d[1]={type:"e",label:1,S:0},d[29]={type:"e",label:1,S:1},d[30]={type:"e",label:1,S:1},d[32]={type:"u",label:1,S:0},d[2]={type:"s",label:1,S:""},d[33]={type:"s",label:1,S:""},d[23]={type:"e",label:1,S:22},d[31]={type:"e",label:3},Br||(e=[],Br={qa:-1,ra:e},e[1]={type:"s",label:1,S:""},e[2]={type:"b",label:1,S:!1},e[3]={type:"i",
label:1,S:0}),d[3]={type:"m",label:1,S:Cr,ma:Br},d[4]={type:"s",label:1,S:""},d[41]={type:"s",label:1,S:""},d[5]={type:"m",label:1,S:Dr,ma:lp()},d[6]={type:"m",label:3,ma:lp()},d[40]={type:"m",label:3,ma:lp()},d[38]={type:"b",label:1,S:!1},d[37]={type:"u",label:1,S:0},d[7]={type:"b",label:1,S:!1},d[8]={type:"u",label:1,S:0},d[9]={type:"u",label:1,S:0},d[10]={type:"u",label:1,S:0},d[11]={type:"u",label:1,S:0},d[22]={type:"u",label:1,S:0},d[12]={type:"u",label:1,S:0},Er||(e=[],Er={qa:-1,ra:e},e[1]=
{type:"b",label:1,S:!1},e[2]={type:"b",label:1,S:!1},e[3]={type:"b",label:1,S:!1}),d[28]={type:"m",label:1,S:Fr,ma:Er},d[14]={type:"u",label:1,S:0},d[24]={type:"u",label:1,S:0},d[15]={type:"u",label:1,S:0},d[16]={type:"u",label:1,S:0},d[13]={type:"u",label:1,S:0},d[25]={type:"u",label:1,S:0},d[17]={type:"u",label:1,S:0},d[18]={type:"u",label:1,S:0},d[19]={type:"u",label:1,S:0},d[20]={type:"u",label:1,S:0},d[52]={type:"u",label:1,S:0},d[21]={type:"s",label:1,S:""},d[34]={type:"u",label:1,S:0},d[35]=
{type:"u",label:1,S:0},d[50]={type:"u",label:1,S:0},d[51]={type:"u",label:1,S:0},d[36]={type:"u",label:1,S:0},d[44]={type:"u",label:1,S:0},d[45]={type:"u",label:1,S:0},d[46]={type:"u",label:1,S:0},d[47]={type:"u",label:1,S:0},d[48]={type:"u",label:1,S:0},d[49]={type:"u",label:1,S:0},d[26]={type:"s",label:1,S:""},Gr||(e=[],Gr={qa:-1,ra:e},e[1]={type:"b",label:1,S:!1},e[2]={type:"u",label:1,S:0},e[3]={type:"u",label:1,S:0},e[4]={type:"u",label:1,S:0},e[5]={type:"u",label:1,S:0},e[6]={type:"u",label:1,
S:0}),d[27]={type:"m",label:1,S:Hr,ma:Gr},d[39]={type:"e",label:1,S:0},d[42]={type:"s",label:1,S:""},d[43]={type:"b",label:1,S:!1});c[11]={type:"m",label:1,S:Ir,ma:Ar};c[7]={type:"e",label:1,S:0};c[10]={type:"s",label:1,S:""};Jr||(d=[],Jr={qa:-1,ra:d},d[1]={type:"b",label:1,S:!1},d[2]={type:"s",label:1,S:""},d[3]={type:"s",label:1,S:""});c[14]={type:"m",label:1,S:Kr,ma:Jr};Lr||(d=[],Lr={qa:-1,ra:d},d[1]={type:"m",label:1,S:Mr,ma:cp()},d[2]={type:"m",label:1,S:Nr,ma:cp()});c[16]={type:"m",label:3,
ma:Lr}}b[15]={type:"m",label:1,S:Or,ma:or};b[16]={type:"b",label:1,S:!1};b[17]={type:"b",label:1,S:!1};b[18]={type:"b",label:1,S:!1};Pr||(c=[],Pr={qa:-1,ra:c},c[1]={type:"e",label:1,S:1});b[19]={type:"m",label:1,S:Qr,ma:Pr};b[22]={type:"b",label:1,S:!1};b[23]={type:"i",label:1,S:0};Rr||(c=[],Rr={qa:-1,ra:c},c[1]={type:"e",label:1,S:0},c[2]={type:"s",label:1,S:""});b[24]={type:"m",label:1,S:Sr,ma:Rr};b[25]={type:"b",label:1,S:!0};b[27]={type:"b",label:1,S:!1};Tr||(c=[],Tr={qa:-1,ra:c},c[1]={type:"s",
label:1,S:""},c[2]={type:"s",label:1,S:""},c[3]={type:"s",label:1,S:""},c[4]={type:"s",label:1,S:""},c[5]={type:"s",label:1,S:""},c[6]={type:"s",label:1,S:""});b[28]={type:"m",label:1,S:Ur,ma:Tr}}a[8]={type:"m",label:1,S:Vr,ma:Fq};a[21]={type:"e",label:3};Wr||(b=[],Wr={qa:-1,ra:b},Xr||(c=[],Xr={qa:-1,ra:c},c[4]={type:"m",label:3,ma:ao()}),b[2]={type:"m",label:1,S:Yr,ma:Xr},Zr||(c=[],Zr={qa:-1,ra:c},c[1]={type:"s",label:3},c[2]={type:"i",label:1,S:0}),b[3]={type:"m",label:1,S:$r,ma:Zr},as||(c=[],as=
{qa:-1,ra:c},c[1]={type:"s",label:1,S:""},c[2]={type:"m",label:1,S:bs,ma:Sn()},c[3]={type:"e",label:1,S:0}),b[4]={type:"m",label:3,ma:as});a[5]={type:"m",label:1,S:cs,ma:Wr};a[6]={type:"m",label:1,S:ds,ma:ao()};a[11]={type:"e",label:1,S:1};a[19]={type:"u",label:3};es||(b=[],es={qa:-1,ra:b},b[2]={type:"s",label:1,S:""},b[4]={type:"b",label:1,S:!1},b[19]={type:"b",label:1,S:!1},fs||(c=[],fs={qa:-1,ra:c},c[2]={type:"b",label:1,S:!1},c[3]={type:"b",label:1,S:!1},c[5]={type:"b",label:1,S:!1},c[6]={type:"b",
label:1,S:!1}),b[18]={type:"m",label:1,S:gs,ma:fs},b[15]={type:"b",label:1,S:!0},b[11]={type:"s",label:1,S:""},b[14]={type:"b",label:1,S:!1},b[17]={type:"b",label:1,S:!1},hs||(c=[],hs={qa:-1,ra:c},c[1]={type:"b",label:1,S:!1},c[2]={type:"b",label:1,S:!1},c[3]={type:"b",label:1,S:!1},c[4]={type:"b",label:1,S:!1}),b[12]={type:"m",label:1,S:is,ma:hs},b[1]={type:"b",label:1,S:!1},b[9]={type:"b",label:1,S:!1},js||(c=[],js={qa:-1,ra:c},c[1]={type:"b",label:1,S:!1},c[2]={type:"b",label:1,S:!1}),b[21]={type:"m",
label:1,S:ks,ma:js},ls||(c=[],ls={qa:-1,ra:c},c[6]={type:"e",label:1,S:0},c[4]={type:"b",label:1,S:!1},c[5]={type:"b",label:1,S:!1}),b[22]={type:"m",label:1,S:ms,ma:ls});a[13]={type:"m",label:1,S:ns,ma:es};os||(b=[],os={qa:-1,ra:b},b[1]={type:"m",label:1,S:ps,ma:_.xn()},b[2]={type:"s",label:1,S:""},b[3]={type:"m",label:1,S:qs,ma:Ln()});a[16]={type:"m",label:3,ma:os};a[17]={type:"s",label:1,S:""};rs||(b=[],rs={qa:-1,ra:b},b[1]={type:"e",label:1,S:0},b[2]={type:"s",label:1,S:""});a[18]={type:"m",label:3,
ma:rs};ss||(b=[],ss={qa:-1,ra:b},b[1]={type:"e",label:1,S:0});a[20]={type:"m",label:1,S:ts,ma:ss};us||(b=[],us={qa:-1,ra:b},vs||(c=[],vs={qa:-1,ra:c},c[1]={type:"s",label:1,S:""},c[2]={type:"s",label:1,S:""},c[3]={type:"s",label:3},c[4]={type:"b",label:1,S:!1}),b[1]={type:"m",label:3,ma:vs},b[2]={type:"s",label:1,S:""},b[3]={type:"s",label:1,S:""},b[4]={type:"j",label:1,S:""},b[5]={type:"m",label:3,ma:Sn()});a[22]={type:"m",label:1,S:ws,ma:us};a[23]={type:"m",label:1,S:xs,ma:Sn()};a[1]={type:"m",
label:1,S:ys,ma:zs()}}return cq};_.As=function(a){this.j=a||[]};Bs=function(a){this.j=a||[]};_.Cs=function(a){this.j=a||[]};Ds=function(a){this.j=a||[]};Es=function(a){this.j=a||[]};Fs=function(a){this.j=a||[]};Gs=function(a){this.j=a||[]};Hs=function(a){this.j=a||[]};Is=function(a){this.j=a||[]};Js=function(a){this.j=a||[]};Ks=function(a){this.j=a||[]};Ls=function(a){this.j=a||[]};Ms=function(a){this.j=a||[]};Ns=function(a){this.j=a||[]};Os=function(a){this.j=a||[]};Ps=function(a){this.j=a||[]};
Qs=function(a){this.j=a||[]};
$s=function(){if(!Rs){var a=[];Rs={qa:-1,ra:a};a[1]={type:"e",label:1,S:0};if(!Ss){var b=[];Ss={qa:-1,ra:b};b[1]={type:"b",label:1,S:!1};b[2]={type:"i",label:1,S:256}}a[2]={type:"m",label:1,S:Ts,ma:Ss};Us||(b=[],Us={qa:-1,ra:b},b[1]={type:"i",label:1,S:88},b[2]={type:"i",label:1,S:120},b[3]={type:"i",label:1,S:12},b[4]={type:"i",label:1,S:1},b[5]={type:"b",label:1,S:!0},b[6]={type:"e",label:1,S:0});a[3]={type:"m",label:1,S:Vs,ma:Us};Ws||(b=[],Ws={qa:-1,ra:b},b[1]={type:"b",label:1,S:!1},b[2]={type:"i",
label:1,S:0},b[3]={type:"i",label:1,S:256});a[7]={type:"m",label:1,S:Xs,ma:Ws};Ys||(b=[],Ys={qa:-1,ra:b},b[1]={type:"e",label:3});a[8]={type:"m",label:1,S:Zs,ma:Ys};a[4]={type:"b",label:1,S:!1};a[5]={type:"f",label:1,S:1};a[6]={type:"b",label:1,S:!1};a[9]={type:"b",label:1,S:!1}}return Rs};at=function(a){this.j=a||[]};bt=function(a){this.j=a||[]};_.ct=function(a){var b=[];_.Q(a.j,11).push(b);return new _.Bk(b)};_.dt=function(a){this.j=a||[]};
ft=function(){if(!et){var a=[];et={qa:-1,ra:a};a[1]={type:"i",label:2,S:0};a[2]={type:"i",label:2,S:0};a[3]={type:"i",label:2,S:0};a[4]={type:"i",label:1,S:256}}return et};gt=function(a){this.j=a||[]};ht=function(a){this.j=a||[]};it=function(a){this.j=a||[]};jt=function(a){this.j=a||[]};kt=function(a){this.j=a||[]};_.lt=function(a){this.j=a||[]};_.mt=function(a){this.j=a||[]};ot=function(){if(!nt){var a=[];nt={qa:-1,ra:a};a[1]={type:"u",label:2,S:0};a[2]={type:"u",label:2,S:0}}return nt};
_.pt=function(a){this.j=a||[]};
_.Fu=function(a){var b=new _.qt;if(!rt){var c=[];rt={qa:-1,ra:c};if(!st){var d=[];st={qa:-1,ra:d};d[1]={type:"m",label:1,S:tt,ma:ft()};if(!ut){var e=[];ut={qa:-1,ra:e};e[1]={type:"i",label:1,S:0};e[2]={type:"i",label:1,S:0}}d[6]={type:"m",label:1,S:vt,ma:ut};wt||(e=[],wt={qa:-1,ra:e},e[1]={type:"m",label:1,S:xt,ma:ft()},e[2]={type:"i",label:1,S:0},e[3]={type:"x",label:3});d[8]={type:"m",label:1,S:yt,ma:wt};zt||(e=[],zt={qa:-1,ra:e},e[1]={type:"m",label:1,S:At,ma:ot()},e[2]={type:"m",label:1,S:Bt,
ma:ot()},e[3]={type:"i",label:1,S:0});d[3]={type:"m",label:1,S:Ct,ma:zt};Dt||(e=[],Dt={qa:-1,ra:e},e[2]={type:"u",label:1,S:0},e[7]={type:"u",label:1,S:0},e[8]={type:"u",label:1,S:17},e[1]={type:"m",label:1,S:Et,ma:ot()},e[3]={type:"m",label:1,S:Ft,ma:Ln()},e[4]={type:"m",label:3,ma:Ln()},e[5]={type:"m",label:1,S:Gt,ma:Ln()},e[6]={type:"m",label:1,S:Ht,ma:Ln()});d[4]={type:"m",label:1,S:It,ma:Dt};Jt||(e=[],Jt={qa:-1,ra:e},e[1]={type:"s",label:1,S:""},e[2]={type:"s",label:1,S:""},e[3]={type:"s",label:1,
S:""});d[5]={type:"m",label:1,S:Kt,ma:Jt};d[1E3]={type:"d",label:3}}c[1]={type:"m",label:3,ma:st};if(!Lt){d=[];Lt={qa:-1,ra:d};d[1]={type:"e",label:1,S:0};d[2]={type:"s",label:1,S:""};d[3]={type:"i",label:1,S:0};Mt||(e=[],Mt={qa:-1,ra:e},e[1]={type:"s",label:2,S:""},e[2]={type:"s",label:1,S:""});d[4]={type:"m",label:3,ma:Mt};if(!Nt){e=[];Nt={qa:-1,ra:e};if(!Ot){var f=[];Ot={qa:-1,ra:f};f[1]={type:"m",label:2,S:Pt,ma:Ln()};f[2]={type:"e",label:1,S:1};f[3]={type:"u",label:1,S:0};f[4]={type:"s",label:1,
S:""};f[5]={type:"u",label:1,S:4278190080};f[6]={type:"m",label:1,S:Qt,ma:_.xn()};f[7]={type:"b",label:1,S:!1};f[8]={type:"m",label:1,S:Rt,ma:_.tn()};f[9]={type:"i",label:1,S:0};f[10]={type:"i",label:1,S:0};f[11]={type:"e",label:1,S:1}}e[1]={type:"m",label:3,ma:Ot};if(!St){f=[];St={qa:-1,ra:f};if(!Tt){var g=[];Tt={qa:-1,ra:g};g[1]={type:"m",label:3,ma:Ln()};g[500]={type:"m",label:1,S:Ut,ma:Gn()};g[15]={type:"m",label:1,S:Vt,ma:_.tn()}}f[1]={type:"m",label:1,S:Wt,ma:Tt};f[2]={type:"u",label:1,S:0};
f[3]={type:"f",label:1,S:1};f[4]={type:"b",label:1,S:!1}}e[2]={type:"m",label:3,ma:St};e[3]={type:"e",label:3};Xt||(f=[],Xt={qa:-1,ra:f},f[1]={type:"m",label:1,S:Yt,ma:Ln()},f[2]={type:"f",label:1,S:0},f[3]={type:"u",label:1,S:0},f[4]={type:"f",label:1,S:1},f[5]={type:"u",label:1,S:0});e[4]={type:"m",label:3,ma:Xt}}d[6]={type:"m",label:1,S:Zt,ma:Nt};d[5]={type:"i",label:3};d[7]={type:"b",label:1,S:!1};d[8]={type:"m",label:1,S:$t,ma:zs()}}c[2]={type:"m",label:3,ma:Lt};au||(d=[],au={qa:-1,ra:d},d[2]=
{type:"s",label:1,S:""},d[3]={type:"s",label:1,S:""},d[4]={type:"b",label:1,S:!1},d[5]={type:"e",label:1,S:0},bu||(e=[],bu={qa:-1,ra:e},e[1]={type:"e",label:2,S:37},cu||(f=[],cu={qa:-1,ra:f},f[1]={type:"s",label:2,S:""},f[2]={type:"s",label:1,S:""}),e[2]={type:"m",label:3,ma:cu}),d[12]={type:"m",label:3,ma:bu},du||(e=[],du={qa:-1,ra:e},e[1]={type:"i",label:1,S:0},e[2]={type:"i",label:1,S:0}),d[7]={type:"m",label:1,S:eu,ma:du},d[13]={type:"u",label:1,S:0},d[15]={type:"s",label:1,S:""});c[3]={type:"m",
label:1,S:fu,ma:au};c[21]={type:"j",label:1,S:""};gu||(d=[],gu={qa:-1,ra:d},d[2]={type:"e",label:1,S:1},d[3]={type:"b",label:1,S:!1},d[14]={type:"i",label:1,S:0},d[6]={type:"b",label:1,S:!1},d[7]={type:"e",label:1,S:0},d[8]={type:"b",label:1,S:!1},d[9]={type:"b",label:1,S:!1},d[10]={type:"i",label:1,S:-1},d[11]={type:"i",label:1,S:0},d[12]={type:"i",label:1,S:0},d[13]={type:"s",label:1,S:""});c[20]={type:"m",label:1,S:hu,ma:gu};c[4]={type:"e",label:1,S:0};c[10]={type:"e",label:3};c[5]={type:"m",label:1,
S:iu,ma:$s()};ju||(d=[],ju={qa:-1,ra:d},d[1]={type:"e",label:1,S:0},d[28]={type:"e",label:1,S:0},d[2]={type:"i",label:1,S:0},d[44]={type:"e",label:1,S:0},d[4]={type:"b",label:1,S:!1},d[24]={type:"b",label:1,S:!1},d[5]={type:"b",label:1,S:!1},d[43]={type:"b",label:1,S:!1},d[39]={type:"b",label:1,S:!1},d[6]={type:"b",label:1,S:!0},d[7]={type:"b",label:1,S:!1},d[8]={type:"e",label:1,S:0},d[16]={type:"e",label:1,S:0},d[9]={type:"b",label:1,S:!1},d[10]={type:"b",label:1,S:!1},d[11]={type:"e",label:1,S:0},
d[12]={type:"b",label:1,S:!0},d[13]={type:"b",label:1,S:!0},d[14]={type:"b",label:1,S:!1},d[15]={type:"b",label:1,S:!1},d[17]={type:"b",label:1,S:!1},d[18]={type:"b",label:1,S:!0},ku||(e=[],ku={qa:-1,ra:e},e[1]={type:"e",label:1,S:0},e[2]={type:"e",label:1,S:0},e[4]={type:"m",label:1,S:lu,ma:$s()}),d[19]={type:"m",label:1,S:mu,ma:ku},nu||(e=[],nu={qa:-1,ra:e},e[1]={type:"e",label:1,S:0},e[2]={type:"e",label:1,S:0},e[3]={type:"m",label:1,S:ou,ma:$s()}),d[20]={type:"m",label:1,S:pu,ma:nu},d[21]={type:"b",
label:1,S:!1},d[22]={type:"i",label:3},d[25]={type:"b",label:1,S:!1},d[48]={type:"b",label:1,S:!1},qu||(e=[],qu={qa:-1,ra:e},e[1]={type:"b",label:1,S:!1},e[2]={type:"b",label:1,S:!1},e[3]={type:"b",label:1,S:!1},e[4]={type:"b",label:1,S:!1},e[5]={type:"b",label:1,S:!1},e[6]={type:"b",label:1,S:!1},e[7]={type:"b",label:1,S:!1},e[8]={type:"b",label:1,S:!1},e[9]={type:"i",label:1,S:0}),d[26]={type:"m",label:1,S:ru,ma:qu},d[29]={type:"b",label:1,S:!1},su||(e=[],su={qa:-1,ra:e},e[1]={type:"f",label:1,
S:1}),d[30]={type:"m",label:1,S:tu,ma:su},d[42]={type:"i",label:3},d[32]={type:"b",label:1,S:!0},d[36]={type:"b",label:1,S:!1},d[33]={type:"e",label:1,S:0},d[46]={type:"b",label:1,S:!1},d[34]={type:"b",label:1,S:!1},d[35]={type:"e",label:1,S:2},d[40]={type:"b",label:1,S:!1},d[41]={type:"e",label:3},d[47]={type:"b",label:1,S:!1},d[38]={type:"e",label:1,S:1},d[50]={type:"e",label:1,S:0},d[45]={type:"b",label:1,S:!1},d[51]={type:"e",label:1,S:1},d[52]={type:"i",label:1,S:0},d[54]={type:"e",label:1,S:0},
d[1005]={type:"e",label:1,S:1});c[6]={type:"m",label:1,S:uu,ma:ju};vu||(d=[],vu={qa:-1,ra:d},d[1]={type:"e",label:1,S:0},d[2]={type:"d",label:1,S:0},d[3]={type:"d",label:1,S:0},d[4]={type:"i",label:1,S:0},d[5]={type:"s",label:1,S:""},d[6]={type:"s",label:1,S:""},d[7]={type:"s",label:1,S:""});c[9]={type:"m",label:1,S:wu,ma:vu};xu||(d=[],xu={qa:-1,ra:d},d[1]={type:"e",label:1,S:0},d[2]={type:"b",label:1,S:!0});c[11]={type:"m",label:1,S:yu,ma:xu};zu||(d=[],zu={qa:-1,ra:d},d[1]={type:"e",label:1,S:0},
d[2]={type:"b",label:1,S:!1},d[3]={type:"f",label:1,S:1},d[4]={type:"b",label:1,S:!1},d[5]={type:"b",label:1,S:!1});c[12]={type:"m",label:1,S:Au,ma:zu};Bu||(d=[],Bu={qa:-1,ra:d},d[1]={type:"b",label:1,S:!1});c[18]={type:"m",label:1,S:Cu,ma:Bu};Du||(d=[],Du={qa:-1,ra:d},d[1]={type:"b",label:1,S:!1});c[22]={type:"m",label:1,S:Eu,ma:Du};c[7]={type:"s",label:1,S:""};c[8]={type:"v",label:1,S:""};c[13]={type:"i",label:1,S:0};c[14]={type:"b",label:1,S:!1};c[15]={type:"b",label:1,S:!1};c[16]={type:"b",label:1,
S:!1};c[19]={type:"b",label:1,S:!1}}return b.j(a.j,rt)};_.Gu=function(a){a.j[2]=a.j[2]||[];return new bt(a.j[2])};_.Hu=function(a){var b=[];_.Q(a.j,0).push(b);return new ht(b)};_.Iu=function(a){var b=[];_.Q(a.j,1).push(b);return new _.As(b)};_.Ju=function(a){this.j=a||[]};_.Ku=function(a){this.j=a||[]};Lu=function(a){return _.Jk(jn,$k(),_.Ku.prototype.W,a.contentWindow,qk(a.src))};Mu=function(a){this.j=a||[]};
_.Nu=function(){var a=window.document.createElement("iframe");this.V=a;this.U=[];this.j=new Xm;_.I.addDomListener(a,"load",(0,_.u)(this.$,this));this.T=null;var b=_.S,c;c=(c=b.j[25])?new _.Pe(c):_.mi;var d=c.j[1];this.ka=null!=d?d:"";d=new Mu;d.j[0]=_.Ji;d.j[1]=_.af(b);a.name="gm-master";b=c.j[0];a.src=(null!=b?b:"")+"#"+_.kk(_.lk(JSON.stringify(d.W())),!0);a.style.visibility="hidden";a.style.position="absolute";a.style.left=_.U(0);a.style.top=_.U(0);a.style.width=_.U(0);a.style.height=_.U(0);this.R=
new ln(a,hn(this.j),$k());_.rk()&&_.al()&&window.document.body.appendChild(a)};_.qt=_.k();Pu=function(a,b){var c=0,d;for(d in b.ra){var e=(0,window.parseInt)(d,10),f=a[e+b.qa],e=b.ra[e];if(null!=f&&e)if(3==e.label)for(var g=0;g<f.length;++g)c+=Ou(f[g],e);else c+=Ou(f,e)}return c};Ou=function(a,b){var c=4;"m"==b.type&&(c+=Pu(a,b.ma));return c};
Ru=function(a,b,c,d){for(var e in b.ra){var f=(0,window.parseInt)(e,10),g=a[f+b.qa],h=b.ra[f];if(null!=g&&h)if(3==h.label)for(var l=0;l<g.length;++l)d=Qu(g[l],f,h,c,d);else d=Qu(g,f,h,c,d)}return d};
Qu=function(a,b,c,d,e){d[e++]="!";d[e++]=""+b;if("m"==c.type)d[e++]=c.type,d[e++]="",b=e,e=Ru(a,c.ma,d,e),d[b-1]=""+(e-b>>2);else{c=c.type;if("b"==c)a=a?"1":"0";else if("i"==c||"j"==c||"u"==c||"v"==c||"n"==c||"o"==c)a=""+Math.floor(a);else if(a=""+a,"s"==c){var f=a;b=(0,window.encodeURIComponent)(f).replace(/%20/g,"+");var g=b.match(/%[89AB]/ig),f=f.length+(g?g.length:0);if(4*Math.ceil(f/3)-(3-f%3)%3<b.length){c=[];for(f=b=0;f<a.length;f++)g=a.charCodeAt(f),128>g?c[b++]=g:(2048>g?c[b++]=g>>6|192:
(55296==(g&64512)&&f+1<a.length&&56320==(a.charCodeAt(f+1)&64512)?(g=65536+((g&1023)<<10)+(a.charCodeAt(++f)&1023),c[b++]=g>>18|240,c[b++]=g>>12&63|128):c[b++]=g>>12|224,c[b++]=g>>6&63|128),c[b++]=g&63|128);a=_.kk(c,!0);a=a.replace(/\.+$/,"");c="z"}else-1!=a.indexOf("*")&&(a=a.replace(Su,"*2A")),-1!=a.indexOf("!")&&(a=a.replace(Tu,"*21"))}d[e++]=c;d[e++]=a}return e};_.Uu=function(a,b){var c=1<<b;if(0>a.y||a.y>=c)return null;if(0<=a.x&&a.x<c)return a;var d=new _.N(a.x,a.y);d.x=(a.x%c+c)%c;return d};
Vu=function(a,b,c){var d=1<<b;b=Math.ceil(d*c.Fa);if(a.y<Math.floor(d*c.Aa)||a.y>=b)return null;b=Math.floor(d*c.Ba);c=Math.ceil(d*c.Da);if(a.x>=b&&a.x<c)return a;c-=b;d=new _.N(a.x,a.y);d.x=Math.round(((a.x-b)%c+c)%c+b);return d};Wu=function(a){return!!a&&45==a.Jb()&&0!=a.heading()%180};Xu=function(a,b){var c={},d=1<<b,e=(1-1/Math.sqrt(2))/2;c.j=Math.floor(a.height*d*e);c.U=Math.floor(d*e);c.R=a.height*d-2*c.j;c.V=d-2*c.U;c.T=Math.round(c.V*a.height-c.R);return c};
_.Yu=function(){this.ka=this.ka;this.ta=this.ta};_.Zu=function(a,b){this.type=a;this.j=this.target=b;this.Vj=!0};
_.$u=function(a,b){_.Zu.call(this,a?a.type:"");this.j=this.target=null;this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.T=this.state=null;if(a){this.type=a.type;var c=a.changedTouches?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.j=b;var d=a.relatedTarget;if(d&&_.ah)try{mn(d.nodeName)}catch(e){}null===c?(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:
a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0!==c.clientX?c.clientX:c.pageX,this.clientY=void 0!==c.clientY?c.clientY:c.pageY,this.screenX=c.screenX||0,this.screenY=c.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.T=a;a.defaultPrevented&&this.R()}};_.bv=function(a){return!(!a||!a[av])};
dv=function(a,b,c,d,e){this.listener=a;this.j=null;this.src=b;this.type=c;this.Id=!!d;this.Oc=e;this.key=++cv;this.nc=this.ff=!1};ev=function(a){a.nc=!0;a.listener=null;a.j=null;a.src=null;a.Oc=null};fv=function(a){this.src=a;this.Pa={};this.j=0};_.gv=function(a,b){var c=b.type;c in a.Pa&&_.Rb(a.Pa[c],b)&&(ev(b),0==a.Pa[c].length&&(delete a.Pa[c],a.j--))};_.iv=function(a,b,c,d,e){a=a.Pa[b.toString()];b=-1;a&&(b=hv(a,c,d,e));return-1<b?a[b]:null};
hv=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.nc&&f.listener==b&&f.Id==!!c&&f.Oc==d)return e}return-1};_.jv=function(a,b,c,d,e){if(_.uj(b)){for(var f=0;f<b.length;f++)_.jv(a,b[f],c,d,e);return null}c=_.kv(c);return _.bv(a)?a.listen(b,c,d,e):_.lv(a,b,c,!1,d,e)};
_.lv=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=!!e,h=_.mv(a);h||(a[nv]=h=new fv(a));c=h.add(b,c,d,e,f);if(c.j)return c;d=ov();c.j=d;d.src=a;d.listener=c;if(a.addEventListener)a.addEventListener(b.toString(),d,g);else if(a.attachEvent)a.attachEvent(pv(b.toString()),d);else throw Error("addEventListener and attachEvent are unavailable.");qv++;return c};
ov=function(){var a=rv,b=sv?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b};tv=function(a,b,c,d,e){if(_.uj(b))for(var f=0;f<b.length;f++)tv(a,b[f],c,d,e);else c=_.kv(c),_.bv(a)?a.Ph(b,c,d,e):a&&(a=_.mv(a))&&(b=_.iv(a,b,c,!!d,e))&&_.uv(b)};
_.uv=function(a){if(!_.xa(a)&&a&&!a.nc){var b=a.src;if(_.bv(b))_.gv(b.U,a);else{var c=a.type,d=a.j;b.removeEventListener?b.removeEventListener(c,d,a.Id):b.detachEvent&&b.detachEvent(pv(c),d);qv--;(c=_.mv(b))?(_.gv(c,a),0==c.j&&(c.src=null,b[nv]=null)):ev(a)}}};pv=function(a){return a in vv?vv[a]:vv[a]="on"+a};xv=function(a,b,c,d){var e=!0;if(a=_.mv(a))if(b=a.Pa[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.Id==c&&!f.nc&&(f=wv(f,d),e=e&&!1!==f)}return e};
wv=function(a,b){var c=a.listener,d=a.Oc||a.src;a.ff&&_.uv(a);return c.call(d,b)};
rv=function(a,b){if(a.nc)return!0;if(!sv){var c=b||_.Kk("window.event"),d=new _.$u(c,this),e=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){a:{var f=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(l){f=!0}if(f||void 0==c.returnValue)c.returnValue=!0}c=[];for(f=d.j;f;f=f.parentNode)c.push(f);for(var f=a.type,g=c.length-1;0<=g;g--){d.j=c[g];var h=xv(c[g],f,!0,d),e=e&&h}for(g=0;g<c.length;g++)d.j=c[g],h=xv(c[g],f,!1,d),e=e&&h}return e}return wv(a,new _.$u(b,this))};
_.mv=function(a){a=a[nv];return a instanceof fv?a:null};_.kv=function(a){if(_.Qi(a))return a;a[yv]||(a[yv]=function(b){return a.handleEvent(b)});return a[yv]};zv=function(a,b,c){_.Yu.call(this);this.j=null;this.U=!1;this.$=a;this.V=c;this.R=b||window;this.T=(0,_.u)(this.Hn,this)};Av=function(a){a=a.R;return a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||null};
Bv=function(a){a=a.R;return a.cancelAnimationFrame||a.cancelRequestAnimationFrame||a.webkitCancelRequestAnimationFrame||a.mozCancelRequestAnimationFrame||a.oCancelRequestAnimationFrame||a.msCancelRequestAnimationFrame||null};_.Cv=function(){_.Yu.call(this);this.U=new fv(this);this.Ea=this;this.ua=null};_.Dv=function(a,b,c){_.Yu.call(this);this.j=a;this.U=b||0;this.R=c;this.T=(0,_.u)(this.ij,this)};_.Ev=function(a){a.Od()||a.tc(void 0)};_.Fv=function(a,b){this.min=a;this.max=b};
_.Gv=function(a,b){return b<a.min?a.min:b>a.max?a.max:b};_.Hv=function(a){this.R=a;this.T=this.j=0};_.Iv=function(a){return a.j<a.R};_.Jv=function(a,b,c){this.R=a;this.j=b;this.T=!_.hj(c)&&_.rk()};_.Kv=function(a,b){for(var c=(a.T?_.Q(a.j.j,12):b?_.Q(a.j.j,1):_.Q(a.j.j,0)).slice(),d=0;d<c.length;++d)c[d]+="?";return c};_.Lv=function(){return new _.Jv(_.Xi(),_.fj(),_.Se(_.S))};
Nv=function(a,b,c,d,e){this.Na=a;this.zoom=b;this.Ja=d;this.va=c;this.V=!1;this.ka=e&&e.Pg||null;this.ta=e&&e.Sc;this.ua=e&&e.rh;this.ya=e&&e.zIndex;this.U=!1;this.j=null;this.$=_.Mv;this.T=this.R=null};_.Ov=function(a,b,c,d,e){return new Nv(a,b,c,d,e)};
Pv=function(a,b,c,d){this.U=a;this.j=_.W("img",a,_.Ng,b,!0);this.$=d;this.T=!0;this.R=!1;a=this.j;a.src=_.Mv;_.xl(a);a.style.border="0";a.style.padding="0";a.style.margin="0";a.style.maxWidth="none";null!=c&&(a.style.zIndex=c);a.alt="";a.onload=(0,_.u)(this.V,this,!0);a.onerror=(0,_.u)(this.V,this,!1)};_.Qv=function(){this.j={};this.data=new _.wc};Rv=function(a,b,c,d,e,f){this.Na=a.Na;this.zoom=a.zoom;this.j=a;this.U=b;this.T=c;this.ka=d;this.V=e;this.$=f;this.R="";this.lc()};
_.Sv=function(a,b,c,d,e){this.j=function(f,g,h,l,n){return new Rv(_.Ov(f,g,h,l,n),a,b,c,d,e)}};_.Tv=function(a){this.j=new _.pt;a&&_.Yi(this.j.j,a?a.W():null)};_.Uv=function(a,b,c){a=_.Gu(a.j);a.j[1]=b;a.j[2]=c;a.j[4]=_.Jf[43]?78:_.Jf[35]?289:18};_.Vv=function(a,b){a.j.j[3]=b;if(3==b){var c=a.j;c.j[11]=c.j[11]||[];(new Os(c.j[11])).j[4]=!0}else c=a.j,11 in c.j&&delete c.j[11]};_.Wv=function(a,b,c,d){a=_.Hu(a.j);a.j[0]=a.j[0]||[];a=new _.dt(a.j[0]);a.j[1]=b.x;a.j[2]=b.y;a.setZoom(c);d&&(a.j[3]=d)};
_.Xv=function(a,b,c,d){"terrain"==b?(b=_.Iu(a.j),b.j[0]=4,b.j[1]="t",b.j[2]=d,b=_.Iu(a.j),b.j[0]=0,b.j[1]="r"):(b=_.Iu(a.j),b.j[0]=0,b.j[1]="m");b.j[2]=c};_.Yv=function(a,b){var c=_.ct(_.Gu(a.j));_.Yi(c.j,b?b.W():null)};_.Zv=function(a,b){var c=_.ct(_.Gu(a.j));c.j[0]=26;c=_.Ck(c);_.hk(c,"styles");c.j[1]=b};_.$v=function(a,b){a.j.j[12]=b;a.j.j[13]=!0};
_.aw=function(a,b,c,d,e,f,g,h,l,n,p,q,t,z,w){this.Ea=a;this.projection=b;this.maxZoom=c;this.tileSize=new _.O(256,256);this.name=d;this.alt=e;this.ya=g;this.va=h;this.Kh=l;this.R=n;this.mb=p;this.j=null;this.$=f;this.ua=q;this.ka=t;this.ta=z;this.T=w;var x=this;_.I.addDomListener(window,"online",function(){x.notify("options")});w&&w.addListener(this.U,this)};
_.bw=function(a){if(!_.F(a))return _.Uu;var b=(1-1/Math.sqrt(2))/2,c=1-b;if(0==a%180){var d=_.tf(0,b,1,c);return function(a,b){return Vu(a,b,d)}}var e=_.tf(b,0,c,1);return function(a,b){var c=Vu(new _.N(a.y,a.x),b,e);return new _.N(c.y,c.x)}};_.cw=function(a,b,c,d){var e=this;_.wf.call(e);this.j=b;this.R=!!d;var f=[],g=a.length;e["get"+_.rb(b)]=function(){if(!(b in e)){for(var d=f.length=0;d<g;++d)f[d]=e.get(a[d]);e[b]=c.apply(null,f)}return e[b]}};
_.dw=function(a,b){_.Qc.call(this);this.U=a;this.R=b;this.T=!0;this.j=null};ew=function(a,b,c,d,e){this.Na=b;this.zoom=c;this.j=a.getTile(b,c,d);this.R=a;this.T=!1;var f=this;_.I.addListenerOnce(this.j,"load",function(){f.T=!0;e()})};_.fw=function(a,b,c){_.wf.call(this);this.U=Al(this.get("zIndex")||0,a);this.ka=new _.O(0,0);this.V=null;this.R={};this.La=c||null;this.ya=b;this.Ia=!1;this.T=this.j=this.va=this.Ea=null;this.ua=!1;this.Jh(1);this.set("tilesloading",!1)};
gw=function(a){return!!(a.ya&&a.j&&a.j.R)};iw=function(a,b){hw(a);if(a.j=b){a.T=Al(1,a.U);var c=a.T;c&&c.setAttribute("aria-hidden","true");c.style.visibility=c.style.visibility||"inherit";c.style.display="block";a.Ca()}};
pw=function(a){var b=a.getOffset(),c=a.xf(),d=a.get("size"),e=a.j,f=a.T;if(d&&b&&c&&e&&f&&!a.Ia){var b=new _.O(Math.round(b.width),Math.round(b.height)),g=!a.ka.j(b);a.ka=b;var b=a.V,h=a.V=jw(a,c);_.ej(h,b)?g&&kw(a):(e.forEach(function(b){_.dj(h,b.Na)||(delete a.R[b.Na],b.release(),delete e.j[b.Na],_.vk(b.tb(),1==_.V.type))}),c=lw(mw(h)),_.H(c,function(b){var c=e.j[b],d=!1;if(c)g&&nw(a,c);else{var h=tk(e,b,function(){if(!d){var b=h,c=a.Cn();!gw(a)||2!=c&&1!=c?gw(a)&&f.appendChild(b.tb()):(c=zl(b.tb()),
c=void 0!=c?c:1,_.yl(b.tb(),0),f.appendChild(b.tb()),a.ya.T(b.tb(),c,200));d=!0}delete a.R[h.Na];if(b=a.La)a.La=null,b();ow(a)});_.wl.R(h.tb());gw(a)||f.appendChild(h.tb());_.ml(h.tb());nw(a,h)}}),_.nl(f))}};kw=function(a){a.j.forEach(function(b){nw(a,b)})};
nw=function(a,b){var c=b.Na,d=a.j.tileSize,e=new _.N(c.x*d.width-a.ka.width,c.y*d.height-a.ka.height),f=a.getProjection();if(f&&f.getPov){var g=a.j.zoom,f=f.getPov()||_.uh;Wu(f)&&(d=Xu(d,g),e=new _.N(e.x,e.y-Math.floor((c.y-d.U)/d.V)*d.T))}_.il(b.tb(),e,void 0,!0)};
jw=function(a,b){var c=a.j.tileSize,d=a.getProjection();if(d&&d.getPov){var e=b,f=a.j.zoom,d=d.getPov()||_.uh;Wu(d)?(f=Xu(c,f),b=_.tf(e.Ba,e.Aa+Math.floor((e.Aa-f.j)/f.R)*f.T,e.Da,e.Fa+Math.floor((e.Fa-f.j)/f.R)*f.T)):b=e}e=new _.sf;e.Ba=Math.floor(b.Ba/c.width);e.Aa=Math.floor(b.Aa/c.height);e.Da=Math.ceil(b.Da/c.width);e.Fa=Math.ceil(b.Fa/c.height);return e};mw=function(a){for(var b=[],c=a.Ba;c<a.Da;++c)for(var d=a.Aa;d<a.Fa;++d)b.push(new _.N(c,d));return b};
hw=function(a){a.get("tilesloading")&&a.set("tilesloading",!1);a.R={};if(a.j){var b=a.j;a.j.forEach(function(a){a.release();delete b.j[a.Na];_.vk(a.tb(),1==_.V.type)})}a.T&&(_.vk(a.T,1==_.V.type),a.T=null);a.V=null};qw=function(a){a.Ia=!0;a.j&&(a.get("tilesloading")&&a.set("tilesloading",!1),a.R={},a.j.forEach(function(a){a.uc()}))};
lw=function(a){var b=0,c=0,d=0;_.H(a,function(a){++b;c+=a.x;d+=a.y});if(!b)return[];var c=c/b,d=d/b,e=Array(b),f=0;_.H(a,function(a){var b=a.x-c,l=a.y-d;a.ck=b*b+l*l;e[f++]=a});e.sort(function(a,b){return a.ck-b.ck});return e};ow=function(a){a.get("tilesloading")&&_.Ia(a.R)&&(a.set("tilesloading",!1),_.I.trigger(a,"tilesloaded"))};rw=function(a){a.V&&(_.H(mw(a.V),function(b){var c=a.j.j[b];c&&(c.Cc()||(a.R[b]=1))}),a.get("tilesloading")||_.Ia(a.R)||a.set("tilesloading",!0))};
sw=function(a,b,c){return new _.fw(a,b,c)};_.uw=function(a){this.j=a;this.T=this.$=this.V=0;this.R=!1;this.U=tw();this.Ga=null};vw=function(a,b,c,d){var e=_.nm(b,a.j);if(!(!e||0>e.x||0>e.y||e.x>a.j.clientWidth||e.y>a.j.clientHeight)){_.cb(b);_.db(b);!a.R&&d&&1E-6<Math.abs(c%d.ve)&&(a.R=!0);var f=_.nk();a.T=a.R&&300<f-a.$?c:a.T+c;d&&(a.$=f);f-a.V<(a.R?300:200)||_.V.T&&"HTML"==_.uk(b).tagName||0==c||a.R&&Math.abs(a.T)<d.se||(a.T=0,a.V=f,_.I.trigger(a,"mousewheel",e,0>c?-1:1))}};
tw=function(){if(2==_.V.j){if(3==_.V.type)return ww;if(_.V.R)return xw;if(_.V.T)return yw}return{}};_.zw=_.na("j");_.Aw=function(){_.Ll.call(this);this.j=!1;this.R=null};
Cw=function(a,b){var c=a.Yg(),d=a.qg(),e=a.rg();if(d&&_.F(e)&&c){var f;f=a.Xe();var g=a.We();if(b&&a.T&&_.F(a.U)&&f&&g){var c=new _.N(g.x+b.x,g.y+b.y),h=_.fk(a.T,c,a.U,!0),h=_.uf(d,h,e);f=new _.N(g.x+f.width/2,g.y+f.height/2);f=new _.N(h.x-(c.x-f.x),h.y-(c.y-f.y))}else f=_.uf(d,c,e);if(g=f)g=a.xe(),g=!(f&&g&&1E-10>=Math.abs(f.x-g.x)&&1E-10>=Math.abs(f.y-g.y));g&&a.Zj(f)}g=a.Xe();c=a.xe();g&&c&&(f=c.x-g.width/2,g=c.y-g.height/2,c=a.We(),c&&1E-10>=Math.abs(c.x-f)&&1E-10>=Math.abs(c.y-g)||(c||(c=new _.N(0,
0)),c.x=f,c.y=g,a.set("projectionTopLeft",c)));Bw(a);a.U=e;a.T=d};Dw=function(a){var b=a.xe(),c=a.qg(),d=a.rg();if(c&&_.F(d)&&b){if(c=b=_.fk(c,b,d,!0))c=a.Yg(),c=!(b&&c&&1E-10>=Math.abs(b.lat()-c.lat())&&1E-10>=Math.abs(b.lng()-c.lng()));c&&a.set("latLngCenter",b)}};Bw=function(a){var b=a.Yg();b&&(b=18*Math.round(b.lng()/18),b!=a.yh&&(a.yh=b,a.set("projectionCenterQ",a.xe())))};
Ew=function(a){var b=a.Xe(),c=a.We();if(b&&c){var d=c.x+b.width/2,b=c.y+b.height/2,c=a.xe();c&&1E-10>=Math.abs(c.x-d)&&1E-10>=Math.abs(c.y-b)||(c||(c=new _.N(0,0)),c.x=d,c.y=b,a.Zj(c))}var e=a.Xe(),f=a.We();if(e&&f){var d=a.ii()||new _.sf,b=f.x,c=f.y,g=f.x+e.width,e=f.y+e.height;if(d.Ba!=b||d.Aa!=c||d.Da!=g||d.Fa!=e)d.Ba=b,d.Aa=c,d.Da=g,d.Fa=e,a.set("projectionBounds",d)}a.j||(Dw(a),Bw(a))};
Fw=function(a){var b=a.qg(),c=a.rg(),d=a.ii();b&&_.F(c)&&d&&(a.R=zk(b,d,c),window.setTimeout(function(){a.notify("latLngBounds")},0))};Gw=function(a,b,c,d,e,f,g,h){this.x=a;this.y=b;this.j=c;this.r=d;this.T=e;this.R=f;this.V=g;this.$=h;a=1/Math.cos(_.K(this.T));b=1/Math.cos(_.K(this.R));e=_.K(this.r);c=Math.cos(e);d=Math.sin(e);0==e&&(d=0);e=this.j;this.U=[c*e,d*e/a,-d*e*b,c*e*b/a];a=this.x;b=this.y;this.x=this.U[0]*a+this.U[2]*b;this.y=this.U[1]*a+this.U[3]*b};
Hw=function(a,b,c,d,e,f,g){c=Math.pow(2,c)/Math.pow(2,f);f=_.La(d.heading()-a.heading(),-180,180);return new Gw(e.x-b.x,e.y-b.y,c,f,a.Jb(),d.Jb(),g.x,g.y)};Iw=function(){return 4==_.V.type&&!_.Mk(_.V.version,526,1)||5==_.V.type&&!_.Mk(_.V.version,3,7)?!1:!!_.wl.j};Jw=function(){this.T=this.La=this.ya=this.j=this.$=this.ua=this.R=this.ka=this.ta=null;this.va=new zv(this.Ia,window,this)};Kw=function(a){return!!a.R&&!!a.j&&0<=a.U};
Mw=function(a){if(!Kw(a))return Lw;var b=_.uf(a.ya,a.j,a.V),c=_.uf(a.ya,a.$,a.V);return Hw(a.R,b,a.U,a.ka,c,a.V,a.La)};Nw=function(a){this.R=a&&(0,_.u)(a,window);this.j=null};
Pw=function(a){var b=Ow;this.$=a;this.V=b;a=_.Zk;a=this.T=new Nw(!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame)||4!=a.j.j&&4==a.j.type&&!_.Mk(a.j.version,6)||4==a.j.j&&4==a.j.type&&!_.Mk(a.j.U,4,4)||1==a.j.type&&!_.Mk(a.j.version,10)||3==a.j.type&&!_.Mk(a.j.version,10)||5==a.j.type&&!_.Mk(a.j.version,4)?null:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||
window.oRequestAnimationFrame||window.msRequestAnimationFrame||null);a.R&&(a.j={Jp:_.Ea(),dk:_.Ea(),Rc:0,Ge:window.Infinity,nd:0,we:0,Fe:0,Di:0,yj:0,hj:0,jj:0},a.R((0,_.u)(a.T,a)));this.R=this.j=this.U=!1};Qw=function(a){var b;b="user"+(a.j?"_pan":"");b+=a.R?"_zoom":"";return b+=a.U?"_interrupted":""};Rw=function(a,b,c){this.Gc=a;this.duration=c;this.opacity=b};Sw=function(a){this.R=a;this.j={}};Tw=_.k();Uw=function(){this.j=[]};_.Vw=function(){var a=_.wl.ka;return a?new Sw(a):new Uw};
_.Xw=function(a,b,c){_.wf.call(this);this.ub=a;this.Xb=b;this.Vb=c;this.Oa=this.ka=!1;this.U=new Jw;this.bindTo("transform",this.U,null,!0);this.V=[];this.j=new _.N(0,0);this.Wb=_.Vw();this.Ta=this.Ea=this.qb=!1;this.R=this.ua=null;this.Rb=_.sa;this.Ia=new _.Dv(this.Vm,0,this);_.I.bind(this,"tilesloaded",this,this.np);_.I.bind(this,"mousedown",this,this.bl);_.I.bind(this,"movestart",this,this.dl);_.I.bind(this,"move",this,this.el);_.I.bind(this,"moveend",this,this.cl);_.I.bind(this,"panto",this,this.bp);
_.I.bind(this,"panby",this,this.fe);_.I.bind(this,"panbynow",this,this.ap);_.I.bind(this,"panbyfraction",this,this.fl);_.I.bind(this,"pantobounds",this,this.il);Ww(this)};Yw=function(a){return a.R||new Pw((0,_.u)(function(a,c){this.Rb(a,c)},a))};Zw=function(a){var b=a.Vb,c=a.T=sw(a.ub,a.Wb,function(){b.$()});c.bindTo("size",a);c.bindTo("projectionBounds",a,"viewProjectionBounds");a.bindTo("tilesloading",c);a.Yb=[_.I.forward(c,"tilesloaded",a)]};
$w=function(a,b){function c(){_.H(d,(0,_.u)(a.Ki,a))}var d=_.ok(a.V);b?c():window.setTimeout(c,1E3)};cx=function(a){var b=a.j,c=ax(a),d=a.ug(),e=a.xd(),e=new _.N(e.x+c.x,e.y+c.y),f=d.getPov&&d.getPov()||_.uh,g=a.Jc(),h=_.fk(d,e,g,!0);_.H(a.V,function(a){var d=a.getOffset();a.xf();var e=a.getProjection(),q=e.getPov&&e.getPov()||_.uh,t=a.getZoom(),e=_.uf(e,h,t),d=Hw(f,e,g,q,new _.N(d.width+c.x,d.height+c.y),t,c);d.x-=b.x;d.y-=b.y;bx(d,_.Ng,a.getDiv())})};dx=function(a,b,c){a=a.xd();a.x+=b;a.y+=c};
fx=function(a){a.Fb=!0;a.notify("projectionTopLeft");a.Fb=!1;a.$();ex(a)};gx=function(a,b,c){var d=new _.N(a.Da,a.Fa);a=_.fk(b,new _.N(a.Ba,a.Aa),c,!0);b=_.fk(b,d,c,!0);return _.tf(Math.min(a.lng(),b.lng()),Math.min(a.lat(),b.lat()),Math.max(a.lng(),b.lng()),Math.max(a.lat(),b.lat()))};
bx=function(a,b,c){if(!(!Iw()||1!=_.V.type&&5!=_.V.type||1!=a.j||a.r||a.T||a.R)){var d=_.wl.j;d&&(c.style[d]="")}else if(Iw()){d=new Gw(0,0,a.j,a.r,a.T,a.R,a.V,a.$);d.x=a.x+b.x*a.j;d.y=a.y+b.y*a.j;if(a=_.wl.j)b=d.U,b="matrix("+b[0].toFixed(16)+","+b[1].toFixed(16)+","+b[2].toFixed(16)+","+b[3].toFixed(16)+","+Math.round(d.x)+","+Math.round(d.y)+")",c.style[a+"Origin"]=Math.round(d.V)+"px "+Math.round(d.$)+"px",c.style[a]=b;1!=_.V.type&&5!=_.V.type||_.il(c,_.Ng);return}_.il(c,new _.N(a.x+b.x,a.y+b.y))};
Ww=function(a,b){a.ya=b||Lw;var c=a.ya.j,d=a.get("panes");d&&(1==c?(_.pl(d.floatPane),_.pl(d.floatShadow)):(_.ol(d.floatPane),_.ol(d.floatShadow)));bx(a.ya,a.j,a.ub);bx(a.ya,a.j,a.Xb)};ax=function(a){var b=a.get("fixedPoint");a=a.yd();return b||new _.N(a.width/2,a.height/2)};hx=function(a,b){var c=b||_.oi,d=a.yd();if(!d)return null;var e=a.j;return new _.sf([new _.N(c.Ba-e.x,c.Aa-e.y),new _.N((c.Da||d.width)-e.x,(c.Fa||d.height)-e.y)])};
ex=function(a){var b=hx(a);a.Lb&&_.ej(a.Lb,b)||(a.Lb=b,a.notify("pixelBounds"),a.notify("layoutPixelBounds"))};ix=function(a){this.j=Math.min(a,10);this.R=-Math.log(.01/this.j)/.004};
_.kx=function(a){this.ka=this.R=null;this.j=new _.N(0,0);this.T=new _.N(0,0);this.V=this.$=null;this.U=new zv(this.Km,window,this);jx(this);_.I.addListener(a,"mousedown",(0,_.u)(this.uo,this));_.I.addListener(a,"movestart",(0,_.u)(this.wo,this));_.I.addListener(a,"move",(0,_.u)(this.xo,this));_.I.addListener(a,"moveend",(0,_.u)(this.vo,this))};jx=function(a){a.R=null;a.ka=null;a.j.x=0;a.j.y=0;a.T.x=0;a.T.y=0;a.$=null;a.V=null;a.U.stop()};
lx=function(a){a.U.Od()&&(a.U.stop(),_.I.trigger(a,"moveend",a.$));jx(a)};mx=function(a){if(!a.V)return!0;var b=_.Ea()-a.ka,c=a.V.j/.004*(1-Math.exp(-.004*b)),d=Math.round(c*a.T.x),c=Math.round(c*a.T.y);a.$=new wm(a.R.scale,new _.N(a.R.j.x+d,a.R.j.y+c),new _.N(a.R.Ra.x+d,a.R.Ra.y+c));return b>a.V.R};
nx=function(a,b){var c=_.Ea();if(a.R){var d=c-a.ka;if(0<d){var e=(b.j.x-a.R.j.x)/d,f=(b.j.y-a.R.j.y)/d,g=Math.abs(b.scale-a.R.scale)/d,d=Math.exp(-d/32);a.j.x*=d;a.j.y*=d;.001>g&&(a.j.x+=(1-d)*e,a.j.y+=(1-d)*f)}}a.R=b;a.ka=c};
_.ox=function(a,b){this.$=a;this.T=this.U=this.j=null;a&&(this.j=_.hl(this.R).createElement("div"),this.j.style.width="1px",this.j.style.height="1px",_.rl(this.j,1E3));this.R=b;this.T&&(_.I.removeListener(this.T),this.T=null);this.$&&b&&(this.T=_.I.addDomListener(b,"mousemove",(0,_.u)(this.V,this),!0));this.title_changed()};
_.qx=function(a,b,c,d,e,f,g,h,l,n){this.wa=a;this.T=g;this.Sa=e;this.V=f;this.ta=h;this.ua=c;this.j=b;this.$=d;this.U=this.R=0;_.I.Ka(this.j,"contextmenu",this,this.hi);if(_.Wk()||!_.Vk())a=new _.uw(this.j),_.I.bind(a,"mousewheel",this,this.lg),a.bindTo("enabled",this,"scrollwheel");px(this,n,l);_.I.forward(this.T,"forceredraw",this.wa);_.I.forward(this.T,"tilesloaded",this.wa)};
sx=function(a,b){_.I.bind(b,"click",a,a.Yk);_.I.bind(b,"dblclick",a,a.Oo);_.I.bind(b,"mousedown",a,a.Zk);_.H(["mouseover","mousemove","mouseout","mousedown","mouseup"],function(c){_.I.addListener(b,c,(0,_.u)(a.eg,a,c))});var c=new _.kx(b);c.bindTo("disabled",a,"disablePanMomentum");var d=a.V.get("mouseEventTarget");_.H(["movestart","move","moveend"],function(b){_.I.addListener(d,b,function(c){rx(a,b,c)});_.I.addListener(c,b,function(c){rx(a,b,c)})});_.I.forward(b,"mousedown",a.T);_.I.addListener(d,
"mousewheel",(0,_.u)(a.lg,a))};rx=function(a,b,c){c&&(c.latLng=a.Sa.fromContainerPixelToLatLng(c.Ra));_.I.trigger(a.V,b,c);c&&_.Am(c)||_.I.trigger(a.T,b,c)};tx=function(a,b){_.I.addListener(b,"movestart",(0,_.u)(function(){_.I.trigger(this.wa,"dragstart")},a));_.I.addListener(b,"move",(0,_.u)(function(){_.I.trigger(this.wa,"drag")},a));_.I.addListener(b,"moveend",(0,_.u)(function(){_.I.trigger(this.wa,"dragend")},a))};
px=function(a,b,c){var d=new _.Wm(a.j,!0,c,!0);sx(a,d);tx(a,d);d.bindTo("draggable",a);d.bindTo("scalable",a,"draggable");d.bindTo("draggingCursor",a);d.bindTo("draggableCursor",a);_.sj(b,function(a){d.set("scaleQuiver",a)})};_.ux=function(){this.j=!1};
vx=function(a){var b,c=!1,d=!1,e=a.get("mapTypeId");e&&(a.j=!0,"satellite"==e||"hybrid"==e?(d=a.get("zoom"),d=(c=a.get("aerial"))&&18<=d,c&&(e=a.get("desiredTilt"),a.set("desiredTilt",_.F(e)&&22.5>e?0:45)),_.D(d)&&(e=a.get("desiredTilt"),b=d?e:0)):b=0,_.D(b)&&b!=a.get("tilt")&&a.set("tilt",b),a.set("aerialAvailable",c),a.set("aerialAvailableAtZoom",d),a.j=!1)};wx=function(a){this.j=a||[]};xx=function(a){this.j=a||[]};yx=function(a){this.j=a||[]};zx=function(a){this.j=a||[]};
Ax=function(a){this.j=a||[]};Dx=function(a){if(!Bx){var b=[];Bx={qa:-1,ra:b};b[1]={type:"m",label:1,S:Cx,ma:_.Jj()};b[2]={type:"u",label:1,S:0};b[5]={type:"e",label:1,S:0};b[4]={type:"s",label:1,S:""};b[6]={type:"s",label:1,S:""};b[7]={type:"b",label:1,S:!1};b[8]={type:"e",label:1,S:0};b[9]={type:"b",label:1,S:!1};b[10]={type:"b",label:1,S:!1};b[11]={type:"e",label:1,S:0}}return _.Wg.j(a.j,Bx)};Ex=function(a,b){a.j[7]=b};Fx=function(a,b){a.j[8]=b};Gx=function(a){a.j[0]=a.j[0]||[];return new _.de(a.j[0])};
Ix=function(a){return(a=a.j[3])?new wx(a):Hx};Jx=function(a,b){return new zx(_.Q(a.j,1)[b])};Kx=function(a,b){return new Ax(_.Q(a.j,2)[b])};Lx=function(a){a=a.j[0];return null!=a?a:""};Nx=function(a){return(a=a.j[1])?new _.de(a):Mx};Ox=function(a){a=a.j[0];return null!=a?a:0};Qx=function(a){return(a=a.j[1])?new _.de(a):Px};_.Rx=function(a,b,c,d,e,f,g){_.wf.call(this);this.T=this.U=null;this.Ea=a;this.j=c;this.va=b;this.ya=d;this.R=e;this.Ia=!f;this.V=1;this.ka=g};
Tx=function(a,b){var c=Dx(a);_.Sl(window.document,_.Rh,_.Sx+"/maps/api/js/ViewportInfoService.GetViewportInfo",_.gg,c,function(a){b(new yx(a))})};Vx=function(a){var b,c=Ux(a);if("hybrid"==c||"satellite"==c)b=a.Oa;a.va.set("maxZoomRects",b)};Ux=function(a){return(a=a.get("mapType"))&&a.mb};Wx=function(a){return(a=a.get("mapType"))&&a.ya};Xx=function(a,b){a.ya.setAt(0,b)};
Zx=function(a,b){var c=a.get("bounds");Ux(a);var d=Yx(a);if(c&&_.F(d)){var e=new xx;e.j[3]=a.Ea;e.setZoom(a.ua());Fx(e,!!a.get("mapMaker"));e.j[4]=d;d=45==a.get("tilt");e.j[6]=d;Ex(e,d&&a.get("heading")||0);_.Jf[43]?e.j[10]=78:_.Jf[35]&&(e.j[10]=289);(d=a.get("mapType"))&&d.Kh&&a.R&&(e.j[5]=d.Kh);var d=a.T=_.xk(c,1,10),f=Gx(e),g=_.lj(f);_.pj(g,d.getSouthWest().lat());_.nj(g,d.getSouthWest().lng());f=_.jj(f);_.pj(f,d.getNorthEast().lat());_.nj(f,d.getNorthEast().lng());a.ka.ta();Tx(e,b);if(a.Ia){var e=
_.Xe(_.ff()),h=e.split(".")[1]||e,l=a.get("size"),n=_.af(_.S),p;window==window.top&&(e=Fl(),p=(l.width*l.height/(e.x*e.y)).toFixed(2));var q=Wx(a)||"x";_.M("stats",function(a){var b={};b.host=window.document.location&&window.document.location.host||window.location.host;b.v=h;b.r=1;b.mt=q;b.c=c.getCenter().toUrlValue();b.sp=_.nd(c.R).toFixed(5)+"x"+_.jd(c.j).toFixed(5);b.size=l.width+"x"+l.height;b.relsize=p||"iframe";b.token=_.Ji;n&&(b.client=n);a.j.j({ev:"api_viewport"},b)})}}};
$x=function(a){var b=_.mj(a);a=_.kj(a);return _.pd(_.qj(b),_.oj(b),_.qj(a),_.oj(a))};Yx=function(a){a=a.get("mapType");if(!a)return null;switch(a.mb){case "roadmap":return 0;case "terrain":return 4;case "hybrid":return 3;case "satellite":return a.va?5:2}return null};_.ay=function(a){this.R=a;this.j=null};
_.by=function(a){this.j=_.W("span",a.body,new _.N(-999,-999));_.kl(this.j,"BESbewy");_.ll(this.j,{visibility:"hidden",position:"absolute",fontSize:"300px",width:"auto",height:"auto",margin:"0",padding:"0",fontFamily:"Arial,sans-serif"});this.T=this.j.offsetWidth;_.ll(this.j,{fontFamily:"Roboto,Arial,sans-serif"});this.R();this.get("fontLoaded")||this.set("fontLoaded",!1)};cy=_.oa(".gm-style{font-family:Roboto,Arial,sans-serif;font-size:11px;font-weight:400;text-decoration:none}.gm-style img{max-width:none}");
_.ey=function(a,b,c){"absolute"!=_.Bl(a).position&&(a.style.position="relative");if((b=b.backgroundColor)||!a.style.backgroundColor)a.style.backgroundColor=b||"#e5e3df";a.style.overflow="hidden";b=dy(a);var d=dy(b);_.tm(cy);_.gl(b,"gm-style");c.nj&&_.gl(b,"gm-china");_.I.Hb(window,"resize",a);_.I.forward(a,"resize",b);_.I.bind(b,"resize",this,this.ta);_.wl.R(a);this.T=Al(1,d);this.T.style.width="100%";this.ka=null;c.Oi&&(this.ka=Al(2,d),this.ka.style.width="100%",this.ka.style.height="100%",this.V=
Al(3,d),this.V.style.width="100%",this.V.style.height="100%",this.$=Al(4,d),this.$.style.width="100%");this.R=d;this.j=b;this.U=new vm(this.T,this.$);this.ta()};dy=function(a){a=_.W("div",a,_.Ng);a.style.overflow="hidden";a.style.width="100%";a.style.height="100%";a.style.zIndex=0;return a};
_.fy=function(a){var b=a.get("embedReportOnceLog");if(b){var c=function(){for(;b.getLength();){var c=b.pop();_.X(a,c)}};_.I.addListener(b,"insert_at",c);c()}else _.I.addListenerOnce(a,"embedreportoncelog_changed",function(){_.fy(a)})};_.gy=function(a){var b=a.get("embedFeatureLog");if(b){var c=function(){for(;b.getLength();){var c=b.pop();_.om(a,c)}};_.I.addListener(b,"insert_at",c);c()}else _.I.addListenerOnce(a,"embedfeaturelog_changed",function(){_.gy(a)})};Ni=!1;
_.pg.prototype.Ug=_.bj(13,function(a){if(a&&this.j.contains(a)){var b=a.__gmimt.Gc;b?b.uc():this.j.remove(a)}});
_.of.prototype.mf=_.bj(3,function(a,b,c){var d=this.U,e,f,g=b.Pb&&_.$i(b.Pb);if(this.j)e=this.j,f=this.R;else if("mouseout"==a||g)f=e=null;else{for(var h=0;(e=d[h++])&&!(f=e.j(b,!1)););if(!f&&c)for(h=0;(e=d[h++])&&!(f=e.j(b,!0)););}if(e!=this.T||f!=this.V)this.T&&this.T.handleEvent("mouseout",b,this.V),this.T=e,this.V=f,e&&e.handleEvent("mouseover",b,f);if(!e)return!!g;if("mouseover"==a||"mouseout"==a)return!1;e.handleEvent(a,b,f);return!0});_.fd.prototype.Jb=_.bj(2,_.m("R"));
_.yc.prototype.nc=_.bj(1,function(a){a=Zi(this,a);return a.length<this.j.length?new _.yc(a):this});_.N.prototype.Of=_.bj(0,function(){return Math.sqrt(this.x*this.x+this.y*this.y)});_.Zj=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;_.r=_.Ej.prototype;_.r.Ac=_.qa(15);_.r.Ab=function(){_.Fj(this);for(var a=[],b=0;b<this.j.length;b++)a.push(this.wa[this.j[b]]);return a};_.r.qc=function(){_.Fj(this);return this.j.concat()};
_.r.isEmpty=function(){return 0==this.R};_.r.clear=function(){this.wa={};this.T=this.R=this.j.length=0};_.r.remove=function(a){return _.Aj(this.wa,a)?(delete this.wa[a],this.R--,this.T++,this.j.length>2*this.R&&_.Fj(this),!0):!1};_.r.get=function(a,b){return _.Aj(this.wa,a)?this.wa[a]:b};_.r.set=function(a,b){_.Aj(this.wa,a)||(this.R++,this.j.push(a),this.T++);this.wa[a]=b};_.r.forEach=function(a,b){for(var c=this.qc(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};
_.r.Cg=function(a){_.Fj(this);var b=0,c=this.T,d=this,e=new _.Sf;e.next=function(){if(c!=d.T)throw Error("The map has changed since the iterator was created");if(b>=d.j.length)throw _.dg;var e=d.j[b++];return a?e:d.wa[e]};return e};_.r=_.Gj.prototype;_.r.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};_.r.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};_.r.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};
_.r.translate=function(a,b){a instanceof _.Gj?(this.x+=a.x,this.y+=a.y):(this.x+=Number(a),_.xa(b)&&(this.y+=b));return this};_.r.scale=function(a,b){var c=_.xa(b)?b:a;this.x*=a;this.y*=c;return this};var jk=null,ik=null;_.r=_.Mj.prototype;_.r.Ac=_.qa(14);_.r.add=function(a,b){_.Nj(this);this.T=null;a=Oj(this,a);var c=this.j.get(a);c||this.j.set(a,c=[]);c.push(b);this.R=this.R+1;return this};
_.r.remove=function(a){_.Nj(this);a=Oj(this,a);return _.Aj(this.j.wa,a)?(this.T=null,this.R=this.R-this.j.get(a).length,this.j.remove(a)):!1};_.r.clear=function(){this.j=this.T=null;this.R=0};_.r.isEmpty=function(){_.Nj(this);return 0==this.R};_.r.qc=function(){_.Nj(this);for(var a=this.j.Ab(),b=this.j.qc(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};
_.r.Ab=function(a){_.Nj(this);var b=[];if(_.wa(a))Pj(this,a)&&(b=Lj(b,this.j.get(Oj(this,a))));else{a=this.j.Ab();for(var c=0;c<a.length;c++)b=Lj(b,a[c])}return b};_.r.set=function(a,b){_.Nj(this);this.T=null;a=Oj(this,a);Pj(this,a)&&(this.R=this.R-this.j.get(a).length);this.j.set(a,[b]);this.R=this.R+1;return this};_.r.get=function(a,b){var c=a?this.Ab(a):[];return 0<c.length?String(c[0]):b};
_.r.setValues=function(a,b){this.remove(a);0<b.length&&(this.T=null,this.j.set(Oj(this,a),Kj(b)),this.R=this.R+b.length)};_.r.toString=function(){if(this.T)return this.T;if(!this.j)return"";for(var a=[],b=this.j.qc(),c=0;c<b.length;c++)for(var d=b[c],e=(0,window.encodeURIComponent)(String(d)),d=this.Ab(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+(0,window.encodeURIComponent)(String(d[f])));a.push(g)}return this.T=a.join("&")};
_.r.extend=function(a){for(var b=0;b<arguments.length;b++)Dj(arguments[b],function(a,b){this.add(b,a)},this)};var hy=/#/g,ak=/[\#\?@]/g,iy=/[\#\?]/g,jy=/[\#\?:]/g,ky=/[#\/\?@]/g,bu;_.r=_.Vj.prototype;
_.r.toString=function(){var a=[],b=this.R;b&&a.push(Rj(b,ky,!0),":");var c=this.T;if(c||"file"==b)a.push("//"),(b=this.ka)&&a.push(Rj(b,ky,!0),"@"),a.push((0,window.encodeURIComponent)(String(c)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.$,null!=c&&a.push(":",String(c));if(c=this.getPath())this.T&&"/"!=c.charAt(0)&&a.push("/"),a.push(Rj(c,"/"==c.charAt(0)?iy:jy,!0));(c=this.j.toString())&&a.push("?",c);(c=this.U)&&a.push("#",Rj(c,hy));return a.join("")};_.r.getPath=_.m("ta");
_.r.setPath=function(a,b){this.ta=b?Sj(a,!0):a;return this};_.r.setQuery=function(a,b){return Yj(this,a,b)};_.r.getQuery=function(){return this.j.toString()};_.gk.prototype.W=_.m("j");sk.prototype.forEach=function(a){for(var b in this.j)a(this.j[b])};_.Bk.prototype.W=_.m("j");_.Bk.prototype.getType=function(){var a=this.j[0];return null!=a?a:37};_.Fk.prototype.stop=function(){this.Pb&&_.db(this.Pb)};_.ly={roadmap:"m",satellite:"k",hybrid:"h",terrain:"r"};var Nk,Ok;Nk={0:"",1:"msie",3:"chrome",4:"applewebkit",5:"firefox",6:"trident",7:"mozilla",2:"edge"};Ok={0:"",1:"x11",2:"macintosh",3:"windows",4:"android",5:"iphone",6:"ipad"};_.V=null;"undefined"!=typeof window.navigator&&(_.V=new Pk);_.r=Xk.prototype;_.r.lq=_.Dk(function(){var a=new window.Image;return _.ra(a.crossOrigin)});_.r.mq=_.Dk(function(){return _.ra(window.document.createElement("span").draggable)});_.r.$n=_.Dk(function(){try{var a=window.document.createElement("canvas").getContext("2d"),b=a.getImageData(0,0,1,1);b.data[0]=b.data[1]=b.data[2]=100;b.data[3]=64;a.putImageData(b,0,0);b=a.getImageData(0,0,1,1);return 95>b.data[0]||105<b.data[0]}catch(c){return!1}});_.r.On=_.Dk(function(){try{return!!window.document.createEvent("WheelEvent").initWheelEvent}catch(a){return!1}});
_.r.Pn=_.Dk(function(){try{return new window.WheelEvent("wheel"),!0}catch(a){return!1}});_.Zk=_.V?new Xk(_.V):null;dl.prototype.R=function(a){var b=this.T;if(6==b.j||5==b.j||2==b.j&&_.Mk(b.U,10,6)&&4==b.type&&_.Mk(b.version,533,19)||4==b.j&&4==b.type&&_.Mk(b.version,534)||3==b.type&&(_.Mk(b.version,33)&&(1==b.j||2==b.j||3==b.j)||_.Mk(b.version,18)&&4==b.j))a.style[this.j]+=" translateZ(0)"};_.wl=_.V?new dl(_.V,window.document):null;var my;if(_.S){var ny=_.Se(_.S).j[6];my=null!=ny?ny:""}else my="";_.Jl=my;_.Sx=_.S?_.Te():"";_.Mv=_.Kl("transparent");_.lc("common",{});_.v(_.Ll,_.J);_.r=_.Ll.prototype;_.r.fromLatLngToContainerPixel=function(a){var b=this.get("projectionTopLeft");return b?Ml(this,a,b.x,b.y):null};_.r.fromLatLngToDivPixel=function(a){return _.Nl(this,a,null)};_.r.fromDivPixelToLatLng=function(a,b){var c=this.get("offset");return c?Ol(this,a,c.width,c.height,"Div",b):null};_.r.fromContainerPixelToLatLng=function(a,b){var c=this.get("projectionTopLeft");return c?Ol(this,a,c.x,c.y,"Container",b):null};
_.r.getWorldWidth=function(){return Tj(this.get("projection"),this.get("zoom"))};Ql.prototype.Jg=function(){window.clearTimeout(this.j)};Tl.prototype.setPosition=function(a,b){_.il(a,b,this.j)};var Wl;Ul.prototype.W=_.m("j");Ul.prototype.getUrl=function(){var a=this.j[0];return null!=a?a:""};Ul.prototype.setUrl=function(a){this.j[0]=a};Vl.prototype.W=_.m("j");Vl.prototype.getStatus=function(){var a=this.j[2];return null!=a?a:-1};var cm={0:"UnauthorizedURLForClientIdMapError",7:"InvalidClientIdMapError",8:"InvalidClientIdMapError",2:"InvalidKeyOrUnauthorizedURLMapError",11:"ApiNotActivatedMapError",12:"DeletedApiProjectMapError",13:"RefererNotAllowedMapError",14:"InvalidKeyMapError",15:"MissingKeyMapError",4:"NotLoadingAPIFromGoogleMapsError",6:"TOSViolationMapError",1:"ProjectDeniedMapError",9:"ProjectDeniedMapError",10:"RefererDeniedMapError"};var am;Zl.prototype.W=_.m("j");Zl.prototype.getUrl=function(){var a=this.j[0];return null!=a?a:""};Zl.prototype.setUrl=function(a){this.j[0]=a};Zl.prototype.getType=function(){var a=this.j[4];return null!=a?a:-1};$l.prototype.W=_.m("j");$l.prototype.getStatus=function(){var a=this.j[0];return null!=a?a:-1};dm.prototype.j=function(){this.R(_.sa)};fm.prototype.R=function(){var a=this.j,b=_.nk().toString(36);a.j[6]=b.substr(b.length-6);_.em(this.T,(0,_.u)(this.U,null,a,gm))()};var oy,ry,uy,vy;if(_.S){var py=_.Se(_.S).j[3];oy=null!=py?py:!1}else oy=!1;_.qy=new Tl(oy);if(_.S){var sy=_.Se(_.S).j[8];ry=null!=sy?sy:""}else ry="";_.ty=ry;uy=_.S?["/intl/",_.Qe(_.Se(_.S)),"_",_.Re(_.Se(_.S))].join(""):"";if(vy=_.S){var wy=_.S.j[9];vy=null!=wy?wy:""}_.xy=vy||(_.S&&_.hj(_.Se(_.S))?"http://www.google.cn":"https://www.google.com")+uy+"/help/terms_maps.html";
if("undefined"!=typeof window.document){_.yy=new dm(function(a,b){_.Sl(window.document,_.Rh,_.Sx+"/maps/api/js/AuthenticationService.Authenticate",_.gg,Xl(a),function(a){b(new Vl(a))},function(){var a=new Vl;a.j[2]=1;b(a)})},Dl(),0,_.S&&_.af(_.S),_.S&&_.gj(),_.S&&_.cf());var Ay;if(Ay=_.S)Ay=null!=_.S.j[13];var By;if(By=_.S)By=null!=_.S.j[31];var Cy;if(By){var Dy=_.S.j[31];Cy=null!=Dy?Dy:!1}else Cy=null;_.zy=new fm(function(a,b){_.Sl(window.document,_.Rh,_.Sx+"/maps/api/js/QuotaService.RecordEvent",
_.gg,bm(a),function(a){b(new $l(a))},function(){var a=new $l;a.j[0]=1;b(a)})},_.yy,Dl(),_.S&&_.af(_.S),_.S&&_.cf(),Cy,Ay?_.gj():null)};var km=/matrix\(.*, ([0-9.]+), (-?\d+)(?:px)?, (-?\d+)(?:px)?\)/;xm.prototype.transform=function(a,b,c,d){d=d?1:c.j/b.j;this.j=a.j*d;this.x=a.x*d+(c.x-b.x*d);this.y=a.y*d+(c.y-b.y*d)};xm.prototype.set=function(a,b,c){this.j=c;this.x=a;this.y=b};xm.prototype.reset=function(){this.j=1;this.y=this.x=0};xm.prototype.toString=function(){return"("+this.x+","+this.y+","+this.j+")"};var Fm,Gm;_.v(Em,_.J);_.r=Em.prototype;_.r.ql=function(a){this.j();if(!_.$i(a)){_.I.trigger(this,"mousedown",a);var b=0==a.button||1==a.button;0!=this.get("draggable")&&b?(_.V.R||_.bb(a),_.db(a),this.R=!1,b=this.T,this.Ta&&b.setCapture(),this.U=!0,Dm(this),this.ta=a.clientX,this.ua=a.clientY,this.Ea=this.T.offsetLeft,this.Ia=this.T.offsetTop,this.ka.length||this.Ta||(this.ka=[_.I.Ka(window,"mouseup",this,this.ji),_.I.Ka(window,"mousemove",this,this.Dj)])):(_.bb(a),_.db(a))}};
_.r.Dj=function(a){this.ya&&_.$i(a)?_.I.trigger(this,"mousemove",a):(_.V.R&&this.U&&(_.bb(a),_.db(a)),this.j=(0,_.u)(function(){a.cancelBubble||(Km(this,a),this.j=_.sa)},this),1==_.V.type&&9>window.document.documentMode||4==_.V.j&&3!=_.V.type&&5!=_.V.type||!window.requestAnimationFrame?this.j():window.requestAnimationFrame((0,_.u)(function(){this.j()},this)))};_.r.pl=function(a){this.j();this.R?_.db(a):_.$i(a)||_.I.trigger(this,"click",a);this.R=!1};
_.r.ji=function(a){this.j();if(!_.$i(a)||this.R)_.I.trigger(this,"mouseup",a),this.U&&(this.R&&Km(this,a),window.document.releaseCapture&&window.document.releaseCapture(),this.U=!1,Dm(this),_.H(this.ka,_.I.removeListener),this.ka.length=0,this.R&&_.I.trigger(this,"moveend",Jm(this)))};_.r.tl=function(a){this.j();this.ya||(this.ya=!0,_.I.trigger(this,"mouseover",a))};
_.r.rl=function(a){this.j();var b;b=this.T;var c=a.relatedTarget||a.toElement;if(b&&c){try{for(;c!=b&&c.parentNode;)c=c.parentNode}catch(d){}b=b==c}else b=!1;(this.ya=b)||_.I.trigger(this,"mouseout",a)};_.r.draggable_changed=function(){Lm(this);Dm(this);Cm(this)};_.r.draggableCursor_changed=function(){Dm(this)};_.r.draggingCursor_changed=function(){Dm(this)};_.r.release=function(){Lm(this)};_.v(Nm,_.J);
Nm.prototype.Lb=function(a){this.U();this.V&&this.V(a);if(!_.$i(a)){this.Ia.msSetPointerCapture&&this.Ia.msSetPointerCapture(a.pointerId);var b=a.touches;Om(this,a.changedTouches,!0);this.qb=null;1==b.length&&(this.qb=b.item(0).target);Vm(this)&&this.Ta&&(_.bb(a),_.db(a));Um(this,"mousedown",a);if(this.ub){this.Xb=_.Ea();a=b.item(b.length-1);var c=this.Xb-this.Wb;this.La=!this.La&&300>=c&&50>=Math.abs(this.Ea.x-a.pageX)&&50>=Math.abs(this.Ea.y-a.pageY);this.Ea.x=a.pageX;this.Ea.y=a.pageY;this.Rb=
1==b.length}Sm(this);Rm(this,b,this.T,this.j);this.$&&(this.ya=_.Ea(),Vm(this)&&_.I.trigger(this,"move",Tm(this)))}};
Nm.prototype.Fb=function(a){this.V&&this.V(a);if(!_.$i(a)){Vm(this)&&this.Ta&&(_.bb(a),_.db(a));var b=_.Ea();this.U=(0,_.u)(function(){this.U=_.sa;if(!a.cancelBubble)if(Um(this,"mousemove",a),Rm(this,a.touches,this.j,this.Vb),this.$)10<b-this.ya&&(this.ya=b,Vm(this)&&_.I.trigger(this,"move",Tm(this)));else if(15<Math.abs(this.T.x-this.j.x)||15<Math.abs(this.T.y-this.j.y)||15<Math.abs(this.T.j-this.j.j)){this.$=!0;this.ya=b;var c;this.ta=_.jm(this.Ia,window.document.body);zm(this.R,this.T);this.R.j=
0;ym(this.R,this.ta);c=new wm(1,new _.N(0,0),new _.N(Math.round(this.R.x),Math.round(this.R.y)));Vm(this)&&(_.I.trigger(this,"movestart",c),_.I.trigger(this,"move",Tm(this)))}},this);window.requestAnimationFrame?window.requestAnimationFrame((0,_.u)(function(){this.U()},this)):this.U()}};
Nm.prototype.va=function(a){this.U();this.V&&this.V(a);_.$i(a)||(Vm(this)&&this.Ta&&(_.bb(a),_.db(a)),Um(this,"mouseup",a),this.ub&&this.Rb&&!this.$&&(this.Wb=_.Ea(),Um(this,"click",a),this.La&&Um(this,"dblclick",a)),Sm(this),Om(this,a.changedTouches,!1),a.touches&&a.touches.length?Rm(this,a.touches,this.T,this.j):(this.$&&(Qm(this),Vm(this)&&(_.I.trigger(this,"move",Tm(this)),_.I.trigger(this,"moveend",Tm(this))),this.$=!1),this.Oa.reset(),this.ua.reset(),this.T.reset(),this.j.reset()))};
Nm.prototype.release=function(){_.H(this.Ga,_.I.removeListener);this.Ga.length=0};_.v(_.Wm,_.J);_.Wm.prototype.release=function(){this.j&&this.j.release();this.R&&this.R.release()};_.v(Xm,_.J);_.Ym.prototype.W=_.m("j");_.Ey=new _.Zm;_.Fy=new _.Zm;_.Zm.prototype.W=_.m("j");_.$m.prototype.W=_.m("j");_.Gy=new _.Ym;_.r=_.an.prototype;_.r.W=_.m("j");_.r.getType=function(){var a=this.j[1];return null!=a?a:""};_.r.Cf=_.qa(16);_.r.Bf=_.qa(17);_.r.qf=_.qa(18);_.bn.prototype.W=_.m("Ce");_.bn.prototype.yf=_.qa(20);_.bn.prototype.zf=_.qa(22);cn.prototype.W=_.m("j");var gn;_.dn.prototype.W=_.m("j");_.dn.prototype.bg=_.qa(24);_.dn.prototype.jf=_.qa(26);gn=new cn;_.Hy=new _.$m;_.Iy=new _.bn;_.Jy=new _.an;ln.prototype.U=function(a){if(null!=a.j[0]){var b=en(a);this.j[b]&&_.Ob(this.j[b],function(b){b(a)})}else if(null!=a.j[1]){if(b=fn(a),this.R[b])this.R[b](a)}else this.T(a)};mn[" "]=_.sa;_.Ky=new _.pn;_.pn.prototype.W=_.m("j");_.pn.prototype.yf=_.qa(19);_.pn.prototype.zf=_.qa(21);var gu;qn.prototype.W=_.m("j");var sn;_.rn.prototype.W=_.m("j");var vn;_.un.prototype.W=_.m("j");var wn=new _.rn;var Dn;yn.prototype.W=_.m("j");var Cn;zn.prototype.W=_.m("j");var En=new yn;var Bn;An.prototype.W=_.m("j");var Fn=new zn;var In;_.Hn.prototype.W=_.m("j");var Jn=new An;_.Hn.prototype.getMetadata=function(){var a=this.j[499];return a?new An(a):Jn};var Kn=new _.rn;var Tt;Mn.prototype.W=_.m("j");var Ut=new An;Mn.prototype.getMetadata=function(){var a=this.j[499];return a?new An(a):Ut};var Vt=new _.rn;var Nt,Ot,St,Xt;Nn.prototype.W=_.m("j");var Pt=new _.Hn,Qt=new _.un,Rt=new _.rn,Wt=new Mn,Yt=new _.Hn;var Rn,fq,Tn,Mq;On.prototype.W=_.m("j");Pn.prototype.W=_.m("j");var gq=new On,hq=new On;Qn.prototype.W=_.m("j");var Nq=new Qn,Oq=new Qn;var Yn,Xn;Vn.prototype.W=_.m("j");Wn.prototype.W=_.m("j");var Zn=new Vn,$n=new On;var Wr,Xr,Zr,as;bo.prototype.W=_.m("j");var Yr=new co,$r=new eo;co.prototype.W=_.m("j");eo.prototype.W=_.m("j");var bs=new On;var jq;fo.prototype.W=_.m("j");var kq=new _.Hn,lq=new _.Hn;var ko,lo,no,so;go.prototype.W=_.m("j");var mo=new ho;go.prototype.getLocation=function(){var a=this.j[0];return a?new ho(a):mo};var oo=new io,po=new _.jo;ho.prototype.W=_.m("j");_.r=io.prototype;_.r.W=_.m("j");_.r.getHeading=function(){var a=this.j[0];return null!=a?a:0};_.r.setHeading=function(a){this.j[0]=a};_.r.getTilt=function(){var a=this.j[1];return null!=a?a:0};_.r.setTilt=function(a){this.j[1]=a};_.jo.prototype.W=_.m("j");var uo;to.prototype.W=_.m("j");to.prototype.getQuery=function(){var a=this.j[1];return null!=a?a:""};to.prototype.setQuery=function(a){this.j[1]=a};var vo=new go,wo=new On;var vq;yo.prototype.W=_.m("j");var tq,sq,xq;zo.prototype.W=_.m("j");Ao.prototype.W=_.m("j");var uq=new zo,wq=new yo,yq=new Bo;Bo.prototype.W=_.m("j");var eq,qq,oq,Aq;Co.prototype.W=_.m("j");Co.prototype.getQuery=function(){var a=this.j[0];return null!=a?a:""};Co.prototype.setQuery=function(a){this.j[0]=a};var iq=new Pn,mq=new fo,nq=new to,pq=new Do,zq=new Ao,Bq=new Eo,rq=new _.un;Do.prototype.W=_.m("j");Eo.prototype.W=_.m("j");var os,ps=new _.un,qs=new _.Hn;var es,fs,hs,js,ls;Fo.prototype.W=_.m("j");var gs=new Go,is=new Ho,ks=new Io,ms=new Jo;Go.prototype.W=_.m("j");Ho.prototype.W=_.m("j");Io.prototype.W=_.m("j");Jo.prototype.W=_.m("j");var Rr;Ko.prototype.W=_.m("j");var Lq;Lo.prototype.W=_.m("j");var Iq;Mo.prototype.W=_.m("j");var Yq;No.prototype.W=_.m("j");var Gq,mr,$q,dr,Qq,Vq,fr,br,Rq,Sq,Uq,ir,Hq=new On,Jq=new Mo,nr=new On;Oo.prototype.W=_.m("j");Po.prototype.W=_.m("j");Po.prototype.getTime=function(){var a=this.j[2];return null!=a?a:""};Qo.prototype.W=_.m("j");var Tq=new Uo,Xq=new Vo,Zq=new No,ar=new Oo,cr=new To,er=new Po;Qo.prototype.getTime=function(){var a=this.j[18];return a?new Po(a):er};var gr=new So;Ro.prototype.W=_.m("j");So.prototype.W=_.m("j");To.prototype.W=_.m("j");Uo.prototype.W=_.m("j");
Uo.prototype.getTime=function(){var a=this.j[2];return null!=a?a:""};Vo.prototype.W=_.m("j");var Wq=new Ro;Wo.prototype.W=_.m("j");var Zo,ap;_.Xo.prototype.W=_.m("j");Yo.prototype.W=_.m("j");var bp=new _.Xo;var Lr,Mr=new Yo,Nr=new Yo;var Jr;dp.prototype.W=_.m("j");var qr;ep.prototype.W=_.m("j");var Ar,Br,kp,Er,Gr;fp.prototype.W=_.m("j");fp.prototype.getContext=function(){var a=this.j[38];return null!=a?a:0};var Cr=new gp,Dr=new hp,Fr=new ip,Hr=new jp;gp.prototype.W=_.m("j");gp.prototype.getId=function(){var a=this.j[0];return null!=a?a:""};hp.prototype.W=_.m("j");hp.prototype.getType=function(){var a=this.j[1];return null!=a?a:0};ip.prototype.W=_.m("j");jp.prototype.W=_.m("j");var np;mp.prototype.W=_.m("j");mp.prototype.getStyle=function(){var a=this.j[7];return null!=a?a:0};mp.prototype.setStyle=function(a){this.j[7]=a};var op=new Yo;var ur;Sp.prototype.W=_.m("j");var vr=new _.Xo,wr=new Yo,xr=new mp;var tr;Tp.prototype.W=_.m("j");var yr=new Sp;var sr,zr=new Tp;var or;Up.prototype.W=_.m("j");var pr=new mp,rr=new ep,Ir=new fp,Kr=new dp;var Tr;Vp.prototype.W=_.m("j");var kr;Wp.prototype.W=_.m("j");var Fq,Pr;Xp.prototype.W=_.m("j");var Kq=new go,Pq=new Lo,hr=new Qo,jr=new Wo,lr=new Wp,Or=new Up,Qr=new Yp,Sr=new Ko,Ur=new Vp;Yp.prototype.W=_.m("j");var Dq,cq,ss,rs,us,vs;Zp.prototype.W=_.m("j");_.$p.prototype.W=_.m("j");var dq=new to,Cq=new Co,Eq=new Zp,Vr=new Xp,cs=new bo,ds=new Wn,ns=new Fo,ts=new aq,ws=new bq,xs=new On,ys=new _.$p;_.$p.prototype.getContext=function(){var a=this.j[0];return a?new _.$p(a):ys};aq.prototype.W=_.m("j");bq.prototype.W=_.m("j");var Lt,Mt;_.As.prototype.W=_.m("j");_.As.prototype.getType=function(){var a=this.j[0];return null!=a?a:0};_.As.prototype.getId=function(){var a=this.j[1];return null!=a?a:""};var Zt=new Nn,$t=new _.$p;Bs.prototype.W=_.m("j");var Rs,Ss,Us,Ws,Ys,ju,su,ku,nu,qu,vu,xu,zu,Bu,Du;_.Cs.prototype.W=_.m("j");var Ts=new Ds,Vs=new Es,Xs=new Fs,Zs=new Gs;Ds.prototype.W=_.m("j");Es.prototype.W=_.m("j");Fs.prototype.W=_.m("j");Gs.prototype.W=_.m("j");Hs.prototype.W=_.m("j");Hs.prototype.getType=function(){var a=this.j[0];return null!=a?a:0};var mu=new Js,pu=new Ks,ru=new Ls,tu=new Is;Is.prototype.W=_.m("j");Js.prototype.W=_.m("j");Js.prototype.getType=function(){var a=this.j[0];return null!=a?a:0};var lu=new _.Cs;Ks.prototype.W=_.m("j");
Ks.prototype.getType=function(){var a=this.j[0];return null!=a?a:0};var ou=new _.Cs;Ls.prototype.W=_.m("j");Ms.prototype.W=_.m("j");Ms.prototype.getType=function(){var a=this.j[0];return null!=a?a:0};Ns.prototype.W=_.m("j");Os.prototype.W=_.m("j");Os.prototype.getType=function(){var a=this.j[0];return null!=a?a:0};Ps.prototype.W=_.m("j");Qs.prototype.W=_.m("j");var du;at.prototype.W=_.m("j");var au;bt.prototype.W=_.m("j");var eu=new at;var et;_.dt.prototype.W=_.m("j");_.dt.prototype.getZoom=function(){var a=this.j[0];return null!=a?a:0};_.dt.prototype.setZoom=function(a){this.j[0]=a};var wt;gt.prototype.W=_.m("j");var xt=new _.dt;var st,Jt,ut,zt,Dt,nt;ht.prototype.W=_.m("j");var tt=new _.dt;ht.prototype.getTile=function(){var a=this.j[0];return a?new _.dt(a):tt};var vt=new jt,yt=new gt,Ct=new kt;ht.prototype.clearRect=function(){2 in this.j&&delete this.j[2]};var It=new _.lt,Kt=new it;it.prototype.W=_.m("j");it.prototype.getPath=function(){var a=this.j[0];return null!=a?a:""};it.prototype.setPath=function(a){this.j[0]=a};jt.prototype.W=_.m("j");kt.prototype.W=_.m("j");
kt.prototype.getZoom=function(){var a=this.j[2];return null!=a?a:0};kt.prototype.setZoom=function(a){this.j[2]=a};var At=new _.mt,Bt=new _.mt;_.lt.prototype.W=_.m("j");_.lt.prototype.getZoom=function(){var a=this.j[1];return null!=a?a:0};_.lt.prototype.setZoom=function(a){this.j[1]=a};var Et=new _.mt,Ft=new _.Hn;_.lt.prototype.getCenter=function(){var a=this.j[2];return a?new _.Hn(a):Ft};var Gt=new _.Hn,Ht=new _.Hn;_.mt.prototype.W=_.m("j");var rt;_.pt.prototype.W=_.m("j");var fu=new bt,hu=new qn,iu=new _.Cs,uu=new Hs,wu=new Ms,yu=new Ns,Au=new Os,Cu=new Ps,Eu=new Qs;_.pt.prototype.getMetadata=function(a){return _.Q(this.j,9)[a]};_.Ly=new _.Ju;_.Ju.prototype.W=_.m("j");_.My=new _.ce;_.Ku.prototype.W=_.m("j");_.Ku.prototype.bg=_.qa(23);_.Ku.prototype.jf=_.qa(25);Mu.prototype.W=_.m("j");_.ta(_.Nu);_.Nu.prototype.$=function(){var a=this.T=Lu(this.V);_.Ob(this.U,function(b){b(a)});this.U=[]};_.Ny=new _.qt;_.qt.prototype.j=function(a,b){var c=Array(Pu(a,b));Ru(a,b,c,0);return c.join("")};var Su=/(\*)/g,Tu=/(!)/g;var sv=!_.Zg||9<=Number(_.nh),Oy=_.Zg&&!_.ed("9");!_.bh||_.ed("528");_.ah&&_.ed("1.9b")||_.Zg&&_.ed("8")||_.Yg&&_.ed("9.5")||_.bh&&_.ed("528");_.ah&&!_.ed("8")||_.Zg&&_.ed("9");_.Yu.prototype.ka=!1;_.Yu.prototype.ac=function(){this.ka||(this.ka=!0,this.dc())};_.Yu.prototype.dc=function(){if(this.ta)for(;this.ta.length;)this.ta.shift()()};_.Zu.prototype.R=function(){this.Vj=!1};_.v(_.$u,_.Zu);_.$u.prototype.R=function(){_.$u.td.R.call(this);var a=this.T;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Oy)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};var av="closure_listenable_"+(1E6*Math.random()|0),cv=0;fv.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.Pa[f];a||(a=this.Pa[f]=[],this.j++);var g=hv(a,b,d,e);-1<g?(b=a[g],c||(b.ff=!1)):(b=new dv(b,this.src,f,!!d,e),b.ff=c,a.push(b));return b};fv.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.Pa))return!1;var e=this.Pa[a];b=hv(e,b,c,d);return-1<b?(ev(e[b]),_.Qb(e,b),0==e.length&&(delete this.Pa[a],this.j--),!0):!1};var nv="closure_lm_"+(1E6*Math.random()|0),vv={},qv=0,yv="__closure_events_fn_"+(1E9*Math.random()>>>0);_.v(zv,_.Yu);_.r=zv.prototype;_.r.tc=function(){this.stop();this.U=!1;var a=Av(this),b=Bv(this);a&&!b&&this.R.mozRequestAnimationFrame?(this.j=_.jv(this.R,"MozBeforePaint",this.T),this.R.mozRequestAnimationFrame(null),this.U=!0):this.j=a&&b?a.call(this.R,this.T):this.R.setTimeout(Ek(this.T),20)};_.r.stop=function(){if(this.Od()){var a=Av(this),b=Bv(this);a&&!b&&this.R.mozRequestAnimationFrame?_.uv(this.j):a&&b?b.call(this.R,this.j):this.R.clearTimeout(this.j)}this.j=null};
_.r.Od=function(){return null!=this.j};_.r.Hn=function(){this.U&&this.j&&_.uv(this.j);this.j=null;this.$.call(this.V,_.Ea())};_.r.dc=function(){this.stop();zv.td.dc.call(this)};_.v(_.Cv,_.Yu);_.Cv.prototype[av]=!0;_.r=_.Cv.prototype;_.r.addEventListener=function(a,b,c,d){_.jv(this,a,b,c,d)};_.r.removeEventListener=function(a,b,c,d){tv(this,a,b,c,d)};_.r.dc=function(){_.Cv.td.dc.call(this);if(this.U){var a=this.U,b=0,c;for(c in a.Pa){for(var d=a.Pa[c],e=0;e<d.length;e++)++b,ev(d[e]);delete a.Pa[c];a.j--}}this.ua=null};_.r.listen=function(a,b,c,d){return this.U.add(String(a),b,!1,c,d)};_.r.Ph=function(a,b,c,d){return this.U.remove(String(a),b,c,d)};_.v(_.Dv,_.Yu);_.r=_.Dv.prototype;_.r.ze=0;_.r.dc=function(){_.Dv.td.dc.call(this);this.stop();delete this.j;delete this.R};_.r.tc=function(a){this.stop();var b=this.T;a=_.ra(a)?a:this.U;if(!_.Qi(b))if(b&&"function"==typeof b.handleEvent)b=(0,_.u)(b.handleEvent,b);else throw Error("Invalid listener argument");this.ze=2147483647<Number(a)?-1:_.ad.setTimeout(b,a||0)};_.r.stop=function(){this.Od()&&_.ad.clearTimeout(this.ze);this.ze=0};_.r.Od=function(){return 0!=this.ze};
_.r.ij=function(){this.ze=0;this.j&&this.j.call(this.R)};_.Hv.prototype.reset=function(){this.j=0};_.Hv.prototype.next=function(){++this.j;return((Math.sin(Math.PI*(this.j/this.R-.5))+1)/2-this.T)/(1-this.T)};_.Hv.prototype.extend=function(a){this.j=Math.floor(a*this.j/this.R);this.R=a;this.j>this.R/3&&(this.j=Math.round(this.R/3));this.T=(Math.sin(Math.PI*(this.j/this.R-.5))+1)/2};_.r=Nv.prototype;_.r.tb=_.m("Ja");_.r.Cc=function(){return!this.R&&!!this.T};_.r.release=function(){this.V||this.uc();this.j&&(_.vk(this.j),this.j=null);this.T&&this.T.ac();this.ua&&this.ua()};_.r.uc=function(){this.V=!0;this.R&&this.R.ac();this.R=null};_.r.setUrl=function(a){this.V||(this.$=a||_.Mv,this.R&&this.R.ac(),this.R=new Pv(this.Ja,this.va,this.ya,(0,_.u)(this.Bo,this)),this.R.setUrl(this.$))};
_.r.Bo=function(a){this.R&&(this.T&&this.T.ac(),this.T=this.R,this.R=null,a?(this.U=!1,this.j&&(_.vk(this.j),this.j=null)):(this.U=!0,!this.j&&this.ka&&(this.j=_.W("div",this.Ja),a=this.j.style,a.fontFamily="Roboto,Arial,sans-serif",a.fontSize="x-small",a.textAlign="center",a.paddingTop="6em",_.xl(this.j),_.jl(this.ka,this.j))),this.ta&&_.Ui(this.ta))};_.r.lc=function(){this.U&&this.setUrl(this.$)};Pv.prototype.setUrl=function(a){this.j.src=a;var b=_.ad.__gm_captureTile;b&&b(a)};
Pv.prototype.V=function(a){this.T=!1;this.j.onload=this.j.onerror=null;a&&(this.R=!0,this.U.appendChild(this.j));this.$(a)};Pv.prototype.ac=function(){this.T?(this.j.onload=this.j.onerror=null,this.j.src=_.Mv):this.R&&this.U.removeChild(this.j)};_.Qv.prototype.toString=function(){var a;if(this.Dc)a=_.Fu(this.Dc);else{a=this.Ub()+";";var b;if(b=this.R){b=this.R;var c=zs();b=_.Wg.j(b.j,c)}a=a+b+";"+(this.U&&this.U.join())}return a};_.Qv.prototype.Ub=function(){var a=[],b;for(b in this.j)a.push(b+":"+this.j[b]);a=a.sort();a.splice(0,0,this.Ua);return a.join("|")};_.r=Rv.prototype;_.r.tb=function(){return this.j.tb()};_.r.Cc=function(){return this.j.Cc()};_.r.release=function(){this.j.release()};_.r.uc=function(){this.j.uc()};
_.r.lc=function(){for(var a=this.$()||{},a=2==a.scale||4==a.scale?a.scale:1,a=Math.min(1<<this.zoom,a),b=this.T&&this.T.R(this.Na,this.zoom),c=!b&&this.ka,c=c&&4!=a,d=this.zoom,e=a;1<e;e/=2)d--;b=b||this.U;e=this.V(new _.N(this.Na.x,this.Na.y),this.zoom);if(!e)return"";d=_.bk(_.bk(_.bk(new _.Vj(b[(e.x+2*e.y)%b.length]),"x",e.x),"y",e.y),"z",d);1!=a&&_.bk(d,"w",256/a);c&&(a*=2);1!=a&&_.bk(d,"scale",a);a=d.toString();this.R==a?this.j.lc():(this.R=a,this.j.setUrl(a))};_.Tv.prototype.R=function(a){var b=_.Iu(this.j);b.j[0]=2;b.j[1]=a.Ua;_.Q(b.j,4)[0]=1;for(var c in a.j){var d;d=[];_.Q(b.j,3).push(d);d=new Bs(d);d.j[0]=c;d.j[1]=a.j[c]}a.R&&(b.j[7]=b.j[7]||[],c=a.R,_.Yi((new _.$p(b.j[7])).j,c?c.W():null),b=a.R.j[1],b=(b?new to(b):dq).j[4],b=""+(null!=b?b:0),c=_.ct(_.Gu(this.j)),c.j[0]=52,c=_.Ck(c),_.hk(c,"entity_class"),c.j[1]=b);a.T&&_.Yv(this,a.T)};_.v(_.aw,_.sg);_.aw.prototype.V=function(a,b,c,d){return this.Ea.j(a,b,this.tileSize,c.createElement("div"),{Pg:this.$,Sc:d})};_.aw.prototype.Zd=!0;_.aw.prototype.changed=function(a){"options"!=a&&this.U()};
_.aw.prototype.U=function(){var a=new _.Tv;_.Uv(a,this.ka,this.ta);null!=this.mb&&_.Xv(a,this.mb,0,this.ua);var b;this.R&&(b=new _.Bk,b.j[0]=this.R,_.Yv(a,b));b=new _.Bk;b.j[0]=37;_.hk(_.Ck(b),"smartmaps");_.Yv(a,b);this.get("mapMaker")&&(b=new _.Bk,b.j[0]=33,_.Yv(a,b));this.T&&this.T.get().forEach(a.R,a);(b=this.get("apistyle"))&&_.Zv(a,b);this.set("options",{Dc:a.j,Hd:this.get("authUser"),scale:this.get("scale")})};_.Py=Math.sqrt(2);_.v(_.cw,_.wf);_.cw.prototype.Ma=function(){delete this[this.j];this.notify(this.j)};_.cw.prototype.changed=function(a){a!=this.j&&(this.R?this.Ca():this.$())};_.v(_.dw,_.Rc);_.r=_.dw.prototype;_.r.Je=function(){if(!this.j){var a=this;this.j=this.U.addListener((this.R+"").toLowerCase()+"_changed",function(){a.T&&a.Rf()})}};_.r.He=function(){this.j&&(this.j.remove(),this.j=null)};_.r.get=function(){return this.U.get(this.R)};_.r.set=function(a){this.U.set(this.R,a)};_.r.ak=function(a){var b=this.T;this.T=!1;try{this.U.set(this.R,a)}finally{this.T=b}};_.r=ew.prototype;_.r.tb=_.m("j");_.r.Cc=_.m("T");_.r.release=function(){this.R.releaseTile&&this.R.releaseTile(this.j)};_.r.uc=function(){this.R.Ug&&this.R.Ug(this.j)};_.r.lc=_.k();_.v(_.fw,_.wf);_.r=_.fw.prototype;_.r.zIndex_changed=function(){_.rl(this.U,this.get("zIndex")||0)};_.r.getDiv=_.m("U");_.r.Cn=_.P("tileFadeMode");_.r.Jh=_.sc("tileFadeMode");_.r.getZoom=function(){return this.j&&this.j.zoom};_.r.options_changed=function(){this.ua=!0;this.Ca()};_.r.zoom_changed=function(){var a=this.get("zoom");this.Ea!=a&&(this.Ea=a,this.Ng())};_.r.offset_changed=_.fw.prototype.Ca;_.r.projectionBounds_changed=_.fw.prototype.Ca;_.r.size_changed=_.fw.prototype.Ca;_.r.getOffset=_.P("offset");
_.r.getProjection=_.P("projection");_.r.eq=_.sc("projection");_.r.xf=_.P("projectionBounds");_.r.mapType_changed=function(){var a=this.get("mapType");this.va!=a&&(this.va=a,this.Ng(),a instanceof _.sg?this.bindTo("options",a):this.unbind("options"))};
_.r.Ng=function(){var a=this.get("mapType");if(a){var b=a.tileSize;if(!b)return null;var c=this.get("zoom");if(null!=c){var d=_.hl(this.U);iw(this,new sk(b,c,0,a.Zd,a instanceof _.sg?function(b,f){return a.V(b,c,d,f)}:function(b,f){return new ew(a,b,c,d,f)}))}}};_.r.Ma=function(){pw(this);this.ua&&(this.ua=!1,this.j&&this.j.forEach(function(a){a.lc()}));rw(this);ow(this)};_.r.release=function(){hw(this);_.vk(this.U);this.unbindAll()};_.v(_.uw,_.J);var ww={wheel0:{ve:4.000244140625,se:80},mousewheel:{ve:120,se:250}},xw={mousewheel:{ve:12,se:250}},yw={wheel0:{ve:.10000610351625,se:80},MozMousePixelScroll:{ve:15,se:10}};_.uw.prototype.enabled_changed=function(){0!=this.get("enabled")?this.Ga||(this.Ga=[_.I.Ka(this.j,"wheel",this,this.ua),_.I.Ka(this.j,"mousewheel",this,this.ka),_.I.Ka(this.j,"MozMousePixelScroll",this,this.ta)]):this.Ga&&(_.H(this.Ga,_.I.removeListener),this.Ga=null)};
_.uw.prototype.ua=function(a){vw(this,a,-a.deltaY,this.U["wheel"+a.deltaMode])};_.uw.prototype.ka=function(a,b){var c;_.F(a.wheelDeltaY)?c=a.wheelDeltaY:_.F(a.wheelDelta)?c=a.wheelDelta:c=b||a.detail;vw(this,a,c,this.U.mousewheel)};_.uw.prototype.ta=function(a){vw(this,a,-a.detail,this.U.MozMousePixelScroll)};_.v(_.zw,_.J);_.zw.prototype.get=function(a){var b=_.J.prototype.get.call(this,a);return null!=b?b:this.j[a]};_.v(_.Aw,_.Ll);_.r=_.Aw.prototype;_.r.yh=null;_.r.latLngCenter_changed=function(){this.j=!0;Cw(this);this.j=!1};_.r.projection_changed=_.Aw.prototype.zoom_changed=function(){this.yh=null;Cw(this,this.al());Dw(this)};_.r.projectionTopLeft_changed=function(){Ew(this)};_.r.size_changed=function(){Ew(this)};_.r.projectionBounds_changed=function(){Fw(this)};_.r.rg=_.P("zoom");_.r.Xe=_.P("size");_.r.We=_.P("projectionTopLeft");_.r.xe=_.P("center");_.r.Zj=_.sc("center");_.r.Yg=_.P("latLngCenter");
_.r.ii=_.P("projectionBounds");_.r.qg=_.P("projection");_.r.getLatLngBounds=_.m("R");_.r.al=_.P("fixedPoint");var Lw=new Gw(0,0,1,0,0,0,0,0);_.v(Jw,_.J);Jw.prototype.reset=function(){this.j=this.ua=this.$=this.R=this.ta=this.ka=null;this.U=this.Ea=this.V=-1;this.T=null;this.va.stop()};
Jw.prototype.Ia=function(){if(this.T){var a=this.T.next(),b=this.ta,c=this.ka,d=_.La(c.heading()-b.heading(),-180,180);this.R=new _.fd(b.heading()+a*d,(1-a)*b.Jb()+a*c.Jb());b=this.ua;c=this.$;this.j=new _.L((1-a)*b.lat()+a*c.lat(),(1-a)*b.lng()+a*c.lng(),!0);this.U=(1-a)*this.Ea+a*this.V;a=Mw(this);_.Iv(this.T)?this.va.tc():this.reset();this.set("transform",a)}};Nw.prototype.T=function(){if(this.j){var a=this.j,b=_.Ea()-a.dk;if(b){a.Ge=Math.min(b,a.Ge);a.Fe=Math.max(b,a.Fe);var c=1E3/b;a.nd*=.7;a.nd+=.3*c;a.we*=.7;a.we+=.3*c*c;1E3>55*b?a.jj++:1E3>25*b?a.hj++:1E3>15*b?a.yj++:a.Di++}++a.Rc;a.wq+=b;a.dk=_.Ea();this.R((0,_.u)(this.T,this))}};var Ow=.01>Math.random();Sw.prototype.T=function(a,b,c){this.j[_.nb(a)]=new Rw(a,b,c);this.U||(this.U=window.setTimeout((0,_.u)(this.V,this),1))};Sw.prototype.cancel=function(a){a.style[this.R]="none"};Sw.prototype.V=function(){for(var a in this.j){var b=this.j[a],c=b.Gc;c.style[this.R]="opacity "+b.duration+"ms ease-out";_.yl(c,b.opacity)}this.j={};this.U=void 0};Uw.prototype.T=function(a,b,c){var d=zl(a),e=a.T;e||(e=new Tw,a.T=e,this.j.push(a));e.time=0;e.duration=c;e.ek=d;e.Ui=b;this.R||(this.R=window.setInterval((0,_.u)(this.U,this),50))};Uw.prototype.cancel=function(a){a.T&&(_.aj(this.j,a,1),a.T=void 0)};
Uw.prototype.U=function(){for(var a=[],b=0,c=this.j.length;b<c;++b){var d=this.j[b],e=d.T;e.time+=50;var f=e.time/e.duration;1<=f?(_.yl(d,e.Ui),d.T=void 0):(_.yl(d,e.ek+Math.max(0,f)*(e.Ui-e.ek)),a.push(d))}this.j=a;0==this.j.length&&(window.clearInterval(this.R),this.R=void 0)};_.v(_.Xw,_.wf);_.r=_.Xw.prototype;_.r.setFpsMeasurementCallback=_.na("Rb");_.r.Ki=function(a){_.aj(this.V,a)&&a.release();this.T&&this.T.Jh(_.Qk()&&this.get("styles")?0:2)};_.r.size_changed=function(){this.Ca();ex(this)};_.r.mapType_changed=_.Xw.prototype.Ca;_.r.zoom_changed=_.Xw.prototype.Ca;_.r.waitWithTiles_changed=_.Xw.prototype.Ca;
_.r.projectionTopLeft_changed=function(){var a=this.T,b=this.xd(),c=this.Jc();a&&b&&_.F(c)&&c==a.getZoom()&&(a=a.getOffset(),this.j.x=a.width-b.x,this.j.y=a.height-b.y);this.Fb||this.Ca()};_.r.np=function(){this.qb=!0;$w(this,!1)};_.r.bl=function(a){if(this.R){if(!a.touches||1>=a.touches.length)this.R.U=!0;this.Ia.stop()}else this.R=Yw(this)};_.r.dl=function(){this.ka||(this.ka=!0,this.va=_.Ng)};
_.r.el=function(a){if(this.ka){this.R=Yw(this);this.set("fixedPoint",a.Ra);var b=new xm(a.j.x,a.j.y,a.scale);if(_.Vk()){Ww(this,new Gw(b.x,b.y,b.j,0,0,0,b.x,b.y));if(0!=b.x||0!=b.y)this.R.j=!0;if(2<=b.j||.5>=b.j)this.R.R=!0}else{if(1!=b.j){if(a=Math.round(_.pk(b.j)),this.set("zoom",this.Jc()+a),1<=a||-1>=a)this.R.R=!0}else dx(this,this.va.x-a.j.x,this.va.y-a.j.y),this.va=a.j,this.R.j=!0;fx(this)}}};
_.r.cl=function(a){if(this.ka){if(_.Vk()){a=new xm(a.j.x,a.j.y,a.scale);var b=this.yd(),c=this.Jc(),d;d=c+Math.round(_.pk(a.j));var e=this.get("zoomRange");e&&(d=_.Gv(e,d));var c=d-c,e=Math.pow(2,c),f=b.width/2,b=b.height/2;ym(a,new _.N(f,b));a.j=e;ym(a,new _.N(-f,-b));this.R=Yw(this);if(c){if(0!=a.x||0!=a.y)this.R.j=!0;this.R.R=!0;this.set("fixedPoint",new _.N(a.x/(1-a.j),a.y/(1-a.j)));this.set("zoom",d)}else this.R.j=!0,dx(this,-a.x,-a.y);Ww(this);fx(this)}Kw(this.U)||_.Ev(this.Ia);this.set("fixedPoint",
null);this.ka=!1;this.va=null}};_.r.bp=function(a,b){var c=this.yd();this.fe(a+this.j.x-c.width/2,b+this.j.y-c.height/2)};_.r.fe=function(a,b){var c=this.T,d=this.Jc();c&&c.getZoom()!=d&&c.set("zoom",d);this.Ea=!0;dx(this,a,b);fx(this);this.Ea=!1};_.r.ap=function(a,b){this.Oa=!0;this.fe(a,b);this.Oa=!1};_.r.fl=function(a,b){var c=this.yd();this.fe(a*c.width,b*c.height)};
_.r.il=function(a){var b=this.getLayoutPixelBounds();if(b&&a){var c=b.Da-b.Ba,d=b.Fa-b.Aa,e=0,f=a.Ba-1-b.Ba,g=a.Da+1-b.Da;0>f?e=f:0<g&&(e=g);var g=0,h=a.Aa-1-b.Aa;a=a.Fa+1-b.Fa;0>h?g=h:0<a&&(g=a);if(e||g)e>c&&(e=f),g>d&&(g=h),this.fe(e,g)}};
_.r.Ma=function(){var a=this.Jc();if(this.yd()&&_.F(a)&&this.xd()&&!this.get("waitWithTiles")&&(!this.Ta||this.Ea)){this.Ta=!0;var b=this.get("mapType"),c=this.ug(),d=this.T,e=d&&d.getOffset(),f=!!d&&a!=d.getZoom();d&&c==d.getProjection()||(this.j.x=this.j.y=0,ex(this));var g,h=!1,l;if((l=this.T)&&(this.Jc()==this.T.getZoom()||Iw())){var n=this.Jc();2<Math.abs(n-l.getZoom())||1E5<Math.abs(this.j.x)||1E5<Math.abs(this.j.y)?l=!0:(n=gx(this.tg(),this.ug(),n),l=gx(l.xf(),l.getProjection(),l.getZoom()),
l=!_.Ak(n,l))}else l=!0;if(l)$w(this,!0),d||Zw(this),this.U.reset(),g=Lw,this.j.x=this.j.y=0,ex(this);else{if(f||b!=d.get("mapType")){if(h=this.T)qw(h),_.H(this.Yb,_.I.removeListener),h.unbind("size"),h.unbind("projectionBounds"),l=new _.sf,_.Ha(l,this.ah()),h.set("projectionBounds",l),this.V.push(h),3<this.V.length&&this.V.shift().release(),(l=this.get("mapType"))&&l.Zd||window.setTimeout((0,_.u)(this.Ki,this,h),5E3),this.T=null,this.unbind("tilesloading"),this.set("tilesloading",!1);Zw(this)}h=
ax(this);if(d){n=this.ya||Lw;g=d.getProjection();l=d.getZoom();var n=_.fk(g,new _.N(n.x+this.La.Ba+h.x,n.y+this.La.Aa+h.y),l,!0),p=this.xd(),p=_.fk(c,new _.N(p.x+h.x,p.y+h.y),a,!0),q=c.getPov&&c.getPov()||_.uh;g=g.getPov&&g.getPov()||_.uh;var t=this.U;g.heading()==q.heading()&&g.Jb()==q.Jb()&&n.j(p)&&l==a?t.reset():(t.va.stop(),Kw(t)?(t.ta=new _.fd(t.R.heading(),t.R.Jb()),t.ua=new _.L(t.j.lat(),t.j.lng(),!0),t.Ea=t.U):(t.R=new _.fd(g.heading(),g.Jb()),t.ta=g,t.j=new _.L(n.lat(),n.lng(),!0),t.ua=n,
t.U=t.Ea=l),t.ka=q,t.$=p,t.V=a,t.ya=c,t.La=h)}else this.U.reset();g=Mw(this.U);h=0!=this.get("animatedZoom");h=!this.Oa&&(!_.Vk()||!f)&&(f&&h||this.Ea||0!=g.r||g.T!=g.R);cx(this)}this.qb=!1;l=this.getOffset();n=this.T;n.getZoom()!=a&&n.set("zoom",a);n.get("mapType")!=b&&n.set("mapType",b);n.set("offset",new _.O(l.width,l.height));n.eq(c);n.Jh(0==h&&1==f||_.Qk()&&this.get("styles")?0:2);a=h;b=g;c=this.tg();g=this.ah()||new _.sf;a&&1==b.j?(g.Ba=c.Ba-b.x,g.Aa=c.Aa-b.y,g.Da=c.Da-b.x,g.Fa=c.Fa-b.y):(g.Ba=
c.Ba,g.Aa=c.Aa,g.Da=c.Da,g.Fa=c.Fa);this.$j(g);this.La=new _.sf;_.Ha(this.La,c);n.$();h?(a=this.U,b=Mw(a),0==b.x&&0==b.y&&1==b.j&&0==b.r&&b.T==b.R?a.reset():(b=Math.min(60,Math.round(Math.max(5,Math.max(Math.abs(b.r),Math.abs(b.R-b.T))/6,Math.sqrt(b.x*b.x+b.y*b.y)/256*5))),a.T?a.T.extend(b):a.T=new _.Hv(b),a.Ia())):(this.U.reset(),Ww(this));a=!1;d&&l.j(e)||(this.notify("offset"),a=!0);(f||a)&&_.I.trigger(this,"forceredraw");this.Ta=!1}};
_.r.transform_changed=function(){var a=this.get("transform");if(a){Ww(this,a);if(1==a.j){var b=a.x,a=a.y,c=this.tg(),d=this.ah();d.Ba=c.Ba-b;d.Aa=c.Aa-a;d.Da=c.Da-b;d.Fa=c.Fa-a;this.$j(d)}Kw(this.U)||(_.Ev(this.Ia),this.qb&&$w(this,!1))}};_.r.Jc=_.P("zoom");_.r.yd=_.P("size");_.r.ug=_.P("projection");_.r.xd=_.P("projectionTopLeft");_.r.tg=_.P("projectionBounds");_.r.ah=_.P("viewProjectionBounds");_.r.$j=_.sc("viewProjectionBounds");
_.r.getOffset=function(){var a=this.xd();if(!a)return null;var b=this.j.x+a.x,a=this.j.y+a.y;this.ua&&b==this.ua.width&&a==this.ua.height||(this.ua=new _.O(b,a));return this.ua};_.r.getLayoutPixelBounds=function(){return hx(this,this.get("layoutBounds"))};_.r.getPixelBounds=function(){return hx(this)};
_.r.Vm=function(){if(this.R){var a=this.R,b;b=a.T;var c=b.j,d=c?_.Ea()-c.Jp:0;!c||50>d||2>c.Rc?b=null:(b.j=null,b={Ip:d,Pp:c.Rc,Ge:c.Ge,Fe:c.Fe,Co:d/c.Rc,Fp:c.nd,Gp:Math.sqrt(c.we-c.nd*c.nd),Pm:100*c.Di/c.Rc,Io:100*c.yj/c.Rc,Gn:100*c.hj/c.Rc,In:100*c.jj/c.Rc});b&&(b={recordingDuration:b.Ip,renderedFrameCount:b.Pp,maxFps:1E3/b.Ge,minFps:1E3/b.Fe,meanFps:1E3/b.Co,recentFps:b.Fp,recentFpsSigma:b.Gp,badFps:b.Pm,okayFps:b.Io,goodFps:b.Gn,greatFps:b.In},a.V&&_.Lf(_.Nf(Qw(a),{startTime:0}),b),a.$(Qw(a),
b));this.R=null}};_.v(_.kx,_.J);_.r=_.kx.prototype;_.r.uo=function(){lx(this)};_.r.wo=function(a){mx(this);lx(this);nx(this,a);_.I.trigger(this,"movestart",a)};_.r.xo=function(a){nx(this,a);_.I.trigger(this,"move",a)};_.r.vo=function(a){nx(this,a);if(1==this.get("disabled"))_.I.trigger(this,"moveend",a);else if(this.R){var b=this.j.Of();.25<=b?(this.T.x=this.j.x/b,this.T.y=this.j.y/b,this.V=new ix(b),this.U.tc()):(jx(this),_.I.trigger(this,"moveend",a));this.j.x=0;this.j.y=0}else _.I.trigger(this,"moveend",a)};
_.r.Km=function(){var a=mx(this);_.I.trigger(this,"move",this.$);this.U.tc();a&&lx(this)};_.v(_.ox,_.J);_.ox.prototype.ka=function(){if(this.R){var a=this.get("title");a?this.R.setAttribute("title",a):this.R.removeAttribute("title");this.j&&this.U&&(a=_.on(this.R),_.il(this.j,new _.N(this.U.clientX-a.x,this.U.clientY-a.y)),this.R.appendChild(this.j))}};_.ox.prototype.title_changed=_.ox.prototype.ka;_.ox.prototype.V=function(a){this.U={clientX:a.clientX,clientY:a.clientY}};_.v(_.qx,_.J);_.r=_.qx.prototype;_.r.$k=_.sc("zoom");_.r.Xk=_.P("zoom");_.r.zoom_changed=_.qx.prototype.zoomRange_changed=function(){var a=this.Xk(),b;b=a;var c=this.get("zoomRange");c&&(b=_.Gv(c,b));a!=b&&this.$k(b)};_.r.hi=function(a){var b=_.nk();300>=b-this.U?(this.U=0,this.get("disableDoubleClickZoom")||this.lg(_.nm(a,this.j),-1)):(this.U=b,this.eg("rightclick",a));_.cb(a);_.db(a);this.ka=!0};
_.r.Oo=function(a){1<a.button||_.$i(a)||(this.eg("dblclick",a),_.$i(a)||(this.R=0,this.get("disableDoubleClickZoom")||(a=_.nm(a,this.j),this.lg(a,1))))};_.r.Yk=function(a){if(!_.$i(a)&&!this.ka){var b=_.nk();300>=b-this.R?this.R=0:(this.R=b,this.eg("click",a));_.pm("Mm","-i",this,this.$)}};
_.r.eg=function(a,b){var c=_.nm(b,this.ua),d=_.nm(b,this.j),e=this.Sa.fromDivPixelToLatLng(c,!0);e&&(c=new _.L(e.lat(),e.lng()),e=this.wa.get("projection").fromLatLngToPoint(e),d=new _.Fk(c,b,d,e),this.V.R.mf(a,d,_.Vk())||(this.set("draggableCursor",this.wa.get("draggableCursor")),this.ta.get("title")&&this.ta.set("title",null),delete d.Pb,_.I.trigger(this.wa,a,d)))};_.r.Zk=function(a){this.ka=!1;5!=_.V.type||2!=_.V.j||2!=a.button||a.ctrlKey||this.hi(a)};
_.r.lg=function(a,b){var c=Math.pow(2,b),d=new xm(0,0,c);ym(d,new _.N(-a.x,-a.y));c=new wm(c,new _.N(d.x,d.y),a);rx(this,"movestart",null);rx(this,"move",c);rx(this,"moveend",c);_.pm("Mm","-i",this,this.$)};_.v(_.ux,_.J);_.ux.prototype.desiredTilt_changed=function(){var a=this.get("desiredTilt");a!=this.get("tilt")&&this.set("tilt",a)};_.ux.prototype.tilt_changed=function(){this.j||(this.set("desiredTilt",this.get("tilt")),vx(this))};_.ux.prototype.aerial_changed=_.ux.prototype.mapTypeId_changed=_.ux.prototype.zoom_changed=function(){this.j=!0;vx(this);this.j=!1};_.Qy=new _.dt;wx.prototype.W=_.m("j");var Bx;xx.prototype.W=_.m("j");xx.prototype.getZoom=function(){var a=this.j[1];return null!=a?a:0};xx.prototype.setZoom=function(a){this.j[1]=a};var Cx=new _.de;yx.prototype.W=_.m("j");yx.prototype.getStatus=function(){var a=this.j[4];return null!=a?a:-1};yx.prototype.getAttribution=function(){var a=this.j[0];return null!=a?a:""};yx.prototype.setAttribution=function(a){this.j[0]=a};var Hx=new wx;zx.prototype.W=_.m("j");var Mx=new _.de;zx.prototype.clearRect=function(){1 in this.j&&delete this.j[1]};
Ax.prototype.W=_.m("j");var Px=new _.de;Ax.prototype.clearRect=function(){1 in this.j&&delete this.j[1]};_.v(_.Rx,_.wf);_.Rx.prototype.changed=function(a){"mapType"==a&&(Vx(this),this.U=null);this.Ca()};_.Rx.prototype.ua=_.P("zoom");
_.Rx.prototype.Ma=function(){var a=this.get("size");if(a&&a.width&&a.height){var a=this.U,b;b=this.ua();var c=this.get("bounds"),d=Ux(this);_.F(b)&&c&&d?(c=!this.get("mapMaker"),b=d+"|"+b+"|"+c,45==this.get("tilt")&&(b+="|"+(this.get("heading")||0))):b=null;if(b=this.U=b){if((a=b!=a)||(a=(a=this.get("bounds"))?this.T?!_.rj(this.T,a):!0:!1),a){for(var e in this.j)this.j[e].set("featureRects",void 0);++this.V;Zx(this,(0,_.u)(this.La,this,this.V,Ux(this)))}}else Xx(this,"");a=this.get("bounds");this.va.set("latLng",
a&&a.getCenter());for(e in this.j)this.j[e].set("viewport",a)}};_.Rx.prototype.La=function(a,b,c){this.ka.ua();if(a==this.V){Ux(this)==b&&Xx(this,(0,window.decodeURIComponent)(c.getAttribution()));this.R&&this.R.ka(Ix(c));var d={};a=0;for(var e=_.Wc(c.j,1);a<e;++a){b=Jx(c,a);var f=Lx(b);b=$x(Nx(b));d[f]=d[f]||[];d[f].push(b)}_.Cc(this.j,function(a,b){a.set("featureRects",d[b]||[])});e=_.Wc(c.j,2);f=this.Oa=Array(e);for(a=0;a<e;++a){b=Kx(c,a);var g=Ox(b);b=$x(Qx(b));f[a]={rb:b,maxZoom:g}}Vx(this)}};_.v(_.ay,_.J);_.ay.prototype.gid_changed=_.ay.prototype.persistenceKey_changed=function(){var a=this.get("gid"),b=this.get("persistenceKey"),c=this.R.get();this.j&&(c=c.nc(this.j));if(a){var d=new _.Qv;d.Ua="psm";d.j={gid:a,sp:1};b&&(d.j.lpvi=b);d.R=new _.$p;a=d.R;a.j[12]=a.j[12]||[];(new Fo(a.j[12])).j[13]=!0;this.j=d;c=_.tj(c,this.j)}c!=this.R.get()&&this.R.set(c)};_.v(_.by,_.J);_.by.prototype.R=function(){this.j.offsetWidth!=this.T?(this.set("fontLoaded",!0),_.Zf(this.j)):window.setTimeout((0,_.u)(this.R,this),250)};_.v(_.ey,_.J);_.ey.prototype.ta=function(){var a;a=this.j;a=new _.O(a.clientWidth,a.clientHeight);a.j(this.get("size"))||this.set("size",a)};_.Ry=Math.sqrt(2);});
|
const jwt = require('jsonwebtoken');
const dotenv = require('dotenv');
dotenv.config()
const SECRET = process.env.SECRET;
const auth = async (req, res, next) => {
try {
const token = req.headers.authorization.split(" ")[1]
const isCustomAuth = token.length < 500
let decodeData;
//If token is custom token do this
if (token && isCustomAuth) {
decodeData = jwt.verify(token, SECRET)
req.userId = decodeData?.id
} else {
//Else of token is google token then do this
decodeData = jwt.decode(token)
req.userId = decodeData?.sub
}
next()
} catch (error) {
console.log(error)
}
}
module.export = auth
|
import React, { Component } from 'react'
import { fetchOrganization } from '../../core/firebaseRestAPI'
import { authenticate } from '../../lib/session'
import { uuid } from '../../lib/uuid'
import Layout from '../../components/Layout'
import Loading from '../../components/Loading'
import OrganizationEdit from '../../components/OrganizationEdit'
const blankOrganization = () => ({
id: uuid(),
longDescription: "",
name: "",
url: "",
phones: [],
})
class OrganizationAdminPage extends Component {
constructor(props) {
super(props)
this.state = {
organization: null,
}
}
componentWillMount() {
authenticate()
}
componentDidMount() {
const match = this.props.route.pattern.exec(window.location.pathname)
const organizationId = match[1]
if (organizationId === 'new') {
this.setState({ organization: blankOrganization() })
} else {
fetchOrganization(organizationId)
.then(organization => {
this.setState({ organization })
})
}
}
componentDidUpdate() {
const { organization } = this.state
if (organization && organization.name) {
document.title = organization.name
} else {
document.title = 'Create Organization'
}
}
render() {
const { organization } = this.state
return (
<Layout admin>
{ organization ?
<OrganizationEdit organization={organization} /> :
<Loading />
}
</Layout>
)
}
}
export default OrganizationAdminPage
|
import AbstractProcessor from './AbstractProcessor';
export default class IfProcessor extends AbstractProcessor {
constructor() {
super(...arguments);
this.stack = [];
this.throwAway = false;
}
async process({ source, instruction, content }) {
const pop = () => {
source.expectingEOF--;
const value = this.stack.pop();
if (this.stack.length === 0) {
this.throwAway = false;
} else {
this.throwAway = this.stack.some(value => !value.includes || value.throwAway);
}
return value;
};
let includes;
let throwAway = false;
if (instruction === 'elseif' || instruction === 'elseifdef') {
instruction = instruction === 'elseif' ? 'if' : 'ifdef';
const value = pop();
throwAway = value.includes || value.throwAway;
}
if (instruction === 'ifdef') {
includes = this.hasDefined(content);
} else if (instruction === 'ifnotdef') {
includes = !this.hasDefined(content);
} else if (instruction === 'if') {
includes = !!this.getDefined(content);
} else if (instruction === 'ifnot') {
includes = !this.getDefined(content);
} else if (instruction === 'else') {
const previous = pop();
includes = !previous.includes && !previous.throwAway;
instruction = 'if';
}
if (['ifdef', 'ifnotdef', 'if', 'ifnot'].indexOf(instruction) !== -1) {
source.expectingEOF++;
if (throwAway) {
this.throwAway = true;
} else if (!this.throwAway && !includes) {
this.throwAway = !includes;
}
this.stack.push({ includes, throwAway });
} else {
pop();
}
return {
replaceBy: '',
throwAway: this.throwAway,
};
}
}
|
module.exports = {
backgroundColor: "#19272d",
foregroundColor: "#b6ced8",
borderColor: "#2b434e",
cursorColor: "#ffffff",
colors: {
black: "#22353d",
red: "#ba0e2e",
green: "#1ea8fc",
yellow: "#5dcdfd",
blue: "#ffffff",
magenta: "#1ea8fc",
cyan: "#5dcdfd",
white: "#c7d9e1",
lightBlack: "#34525e",
lightRed: "#e61f44",
lightGreen: "#83cffd",
lightYellow: "#c2ecfe",
lightBlue: "#ffffff",
lightMagenta: "#83cffd",
lightCyan: "#c2ecfe",
lightWhite: "#e8eff3"
}
};
|
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
/* global describe, it */
'use strict';
var expect = require('expect.js');
var extractData = require('../../');
describe('exports', function () {
it('should have a single default export function', function () {
expect(extractData).to.be.a('function');
expect(Object.keys(extractData)).to.eql([]);
});
});
describe('Data shape', function () {
var data = extractData({
pluralRules : true,
relativeFields: true,
});
it('should be keyed by locale', function () {
expect(data).to.have.keys('en', 'zh');
});
it('should have object values for each locale key', function () {
expect(data.en).to.be.an('object');
expect(data.zh).to.be.an('object');
});
describe('locale data object', function () {
it('should have a `locale` property equal to the locale', function () {
var locale = Object.keys(data)[0];
var localeData = data[locale];
expect(localeData).to.have.key('locale');
expect(localeData.locale).to.be.a('string');
expect(localeData.locale).to.equal(locale);
});
it('should have `parentLocale` property when it is not a root locale', function () {
expect(data.en).to.not.have.key('parentLocale');
expect(data['en-US']).to.have.key('parentLocale');
expect(data['en-US'].parentLocale).to.equal('en');
});
it('should have a `pluralRuleFunction`', function () {
expect(data.en).to.have.key('pluralRuleFunction');
expect(data.en.pluralRuleFunction).to.be.a('function');
});
it('should have a `fields` object property', function () {
expect(data.en).to.have.key('fields');
expect(data.en.fields).to.be.an('object');
});
describe('`fields` objects', function () {
var field = data.en.fields[Object.keys(data.en.fields)[0]];
it('should have a `displayName` string property', function () {
expect(field).to.have.key('displayName');
expect(field.displayName).to.be.a('string');
});
it('should have a `relative` object property', function () {
expect(field).to.have.key('relative');
expect(field.relative).to.be.an('object');
});
it('should have a `relativeTime` object property', function () {
expect(field).to.have.key('relativeTime');
expect(field.relativeTime).to.be.an('object');
});
describe('`relative` object', function () {
var keys = Object.keys(field.relative);
it('should have numeric keys', function () {
keys.forEach(function (key) {
key = parseInt(key, 10);
expect(key).to.be.a('number');
expect(isNaN(key)).to.be(false);
});
});
it('should have string values', function () {
keys.forEach(function (key) {
expect(field.relative[key]).to.be.a('string');
});
});
});
describe('`relativeTime` object', function () {
it('should have `future` and `past` object properties', function () {
expect(field.relativeTime).to.have.keys('future', 'past');
expect(field.relativeTime.future).to.be.an('object');
expect(field.relativeTime.past).to.be.an('object');
});
describe('`future` object', function () {
var future = field.relativeTime.future;
var keys = Object.keys(future);
it('should have an `other` key', function () {
expect(future).to.have.key('other');
});
it('should have string values', function () {
keys.forEach(function (key) {
expect(future[key]).to.be.a('string');
});
});
});
describe('`past` object', function () {
var past = field.relativeTime.past;
var keys = Object.keys(past);
it('should have an `other` key', function () {
expect(past).to.have.key('other');
});
it('should have string values', function () {
keys.forEach(function (key) {
expect(past[key]).to.be.a('string');
});
});
});
});
});
});
});
describe('extractData()', function () {
it('should always return an object', function () {
expect(extractData).withArgs().to.not.throwException();
expect(extractData()).to.be.an('object');
});
describe('Options', function () {
describe('locales', function () {
it('should default to all available locales', function () {
var data = extractData({pluralRules: true});
expect(Object.keys(data).length).to.be.greaterThan(0);
});
it('should only accept an array of strings', function () {
expect(extractData).withArgs({locales: []}).to.not.throwException();
expect(extractData).withArgs({locales: ['en']}).to.not.throwException();
expect(extractData).withArgs({locales: [true]}).to.throwException();
expect(extractData).withArgs({locales: true}).to.throwException();
expect(extractData).withArgs({locales: 'en'}).to.throwException();
});
it.skip('should throw when no data exists for a locale', function () {
expect(extractData).withArgs({locales: ['foo-bar']}).to.throwException();
});
it('should always contribute an entry for all specified `locales`', function () {
var data = extractData({
locales : ['en-US', 'zh-Hans-SG'],
pluralRules : true,
relativeFields: true,
});
expect(data).to.have.keys('en-US', 'zh-Hans-SG');
});
it('should recursively expand `locales` to their roots', function () {
var data = extractData({
locales : ['en-US', 'zh-Hans-SG'],
pluralRules : true,
relativeFields: true,
});
expect(data).to.have.keys('en', 'zh', 'zh-Hans');
});
it('should accept `locales` of any case and normalize them', function () {
expect(extractData({
locales : ['en-us', 'ZH-HANT-HK'],
pluralRules : true,
})).to.have.keys('en-US', 'zh-Hant-HK');
});
});
describe('pluralRules', function () {
it('should contribute a `pluralRuleFunction` function property', function () {
var data = extractData({
locales : ['en'],
pluralRules: true,
});
expect(data.en).to.have.key('pluralRuleFunction');
expect(data.en.pluralRuleFunction).to.be.a('function');
});
});
describe('relativeFields', function () {
it('should contribute a `fields` object property', function () {
var data = extractData({
locales : ['en'],
relativeFields: true,
});
expect(data.en).to.have.key('fields');
expect(data.en.fields).to.be.an('object');
});
});
describe('numberFields', function () {
it('should contribute a `numbers` object property', function () {
var data = extractData({
locales : ['en'],
numberFields: true,
});
expect(data.en).to.have.key('numbers');
var numbers = data.en.numbers;
expect(numbers).to.be.an('object');
expect(numbers).to.have.key('decimal');
// [
// [1000, {one: ["0K", 1], other: ["0K", 1]}],
// [10000, %{one: ["00K", 2], other: ["00K", 2]}]
// ]
expect(numbers.decimal).to.have.key('long');
expect(numbers.decimal).to.have.key('short');
expect(numbers.decimal.long.length).to.be.greaterThan(1);
expect(numbers.decimal.short.length).to.be.greaterThan(1);
expect(numbers.decimal.short[0].length).to.be.equal(2);
expect(numbers.decimal.short[0][0]).to.be.equal(1000);
expect(numbers.decimal.short[0][1]).to.have.key('one');
expect(numbers.decimal.short[0][1]).to.have.key('other');
});
});
});
describe('Locale hierarchy', function () {
it('should determine the correct parent locale', function () {
var data = extractData({
locales: [
'en',
'pt-MZ',
'zh-Hant-HK',
]
});
expect(data['en']).to.not.have.key('parentLocale');
expect(data['pt-MZ']).to.have.key('parentLocale');
expect(data['pt-MZ'].parentLocale).to.equal('pt-PT');
expect(data['zh-Hant-HK']).to.have.key('parentLocale');
expect(data['zh-Hant-HK'].parentLocale).to.equal('zh-Hant');
expect(data['zh-Hant']).to.not.have.key('parentLocale');
});
it('should de-duplicate data with suitable ancestors', function () {
var locales = [
'es-AR',
'es-MX',
'es-VE',
];
var data = extractData({
locales : locales,
pluralRules : true,
relativeFields: true,
numberFields: true,
});
expect(data['es-AR']).to.have.keys('parentLocale');
expect(data['es-AR']).to.not.have.keys('pluralRuleFunction', 'fields');
expect(data['es-MX']).to.have.keys('parentLocale', 'fields');
expect(data['es-MX']).to.not.have.keys('pluralRuleFunction');
expect(data['es-VE']).to.have.keys('parentLocale');
expect(data['es-VE']).to.not.have.keys('pluralRuleFunction', 'fields');
locales.forEach(function (locale) {
var pluralRuleFunction;
var fields;
// Traverse locale hierarchy for `locale` looking for the first
// occurrence of `pluralRuleFunction` and `fields`;
while (locale) {
if (!pluralRuleFunction) {
pluralRuleFunction = data[locale].pluralRuleFunction;
}
if (!fields) {
fields = data[locale].fields;
}
locale = data[locale].parentLocale;
}
expect(pluralRuleFunction).to.be.a('function');
expect(fields).to.be.a('object');
});
});
});
});
|
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage/firepad-classroom'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
|
import React from 'react'
import useContextMenu from './useContextMenu'
const GraphMenu = ({ outerRef }) => {
const { xPos, yPos, menu } = useContextMenu(outerRef)
console.log(`xpos is ${xPos} and yPos is ${yPos} and menu is ${menu}`)
if (menu) {
return (
<ul className="menu" style={{ top: yPos, left: xPos }}>
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</ul>
)
}
return <></>
}
export default GraphMenu
|
/**
* Copyright (c) 2014 Intel Corporation
*
* 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.
*/
'use strict';
iotApp.directive('treeList', function () {
return {
restrict: 'E',
template: '<div style="display: none"><ul><tree-list-item ng-repeat="item in tree" item="item"></tree-list-item></ul></div>',
replace: true,
transclude: true,
scope: {
tree: '=',
eagerInit: "=",
selectGroup: '&'
},
link: function (scope, element) {
scope.$on('repeat-done', function(){
angular.element('#hierarchy').menu({
content: element.html(),
positionOpts: { posX: 'left', posY: 'top' },
//maxHeight:100,
crumbDefaultText: '',
linkHover: 'fg-menu-li-hover',
eagerInit: scope.eagerInit || false,
chooseItemCallback: scope.selectGroup
});
});
}
};
});
iotApp.directive('treeListItem', function ($compile, $timeout) {
return {
restrict: 'E',
template: '<li><a href="#" data-id="{{item.id}}">{{item.name}}</a></li>',
replace: true,
transclude: true,
scope: {
item: "="
},
link: function (scope, element) {
scope.$watch('item.children', function(it) {
if(it !== undefined && it.length !== undefined && it.length > 0){
element.append($compile('<ul><tree-list-item ng-repeat="child in item.children" item="child"></tree-list-item></ul>')(scope));
}
});
if (scope.$parent.$last){ // ISSUE IS HERE
$timeout(function(){
scope.$emit('repeat-done');
});
}
}
};
});
|
'use strict';
//>module.exports
module.exports = {
allMarkdownRemark: {
group: [
{
fieldValue: 'test_0',
totalCount: 1
},
{
fieldValue: 'test_1',
totalCount: 2
}
],
edges: [
{
node: {
fields: {
slug: '/test_0',
categorySlug: '/test'
},
frontmatter: {
date: '2016-09-01',
description: 'test_0',
category: 'test',
title: 'test_0'
}
}
},
{
node: {
fields: {
slug: '/test_1',
categorySlug: '/test'
},
frontmatter: {
date: '2016-09-01',
description: 'test_1',
category: 'test',
title: 'test_1'
}
}
}
]
}
};
|
#!/usr/bin/env node
//noinspection JSUnresolvedFunction,JSUnresolvedVariable
/**
* Generate xtemplate function by xtemplate file using kissy xtemplate.
* @author yiminghe@gmail.com
*/
var program = require('./lib/commander');
program
.option('-p, --package-path <packagePath>', 'Set kissy package path')
.option('-e, --encoding [encoding]', 'Set xtemplate file encoding', 'utf-8')
.option('-w, --watch', 'Watch xtemplate file change')
.parse(process.argv);
var S = require('../build/kissy-nodejs'),
chokidar = require('chokidar'),
/*jshint camelcase: false*/
jsBeautify = require('js-beautify').js_beautify,
fs = require('fs'),
path = require('path'),
packagePath = program.packagePath,
encoding = program.encoding,
cwd = process.cwd();
packagePath = path.resolve(cwd, packagePath);
var tplTemplate = '' +
'/*\n' +
' Generated by kissy-tpl2mod.' +
'*/\n' +
'KISSY.add(\'{code}\');';
function normalizeSlash(str) {
return str.replace(/\\/g, '/');
}
function myJsBeautify(str) {
var opts = {
'indent_size': '4',
'indent_char': ' ',
'preserve_newlines': true,
'brace_style': 'collapse',
'keep_array_indentation': false,
'space_after_anon_function': true
};
return jsBeautify(str, opts);
}
S.use('xtemplate/compiler', function (S, XTemplateCompiler) {
function compile(tpl, modulePath) {
var tplContent = fs.readFileSync(tpl, encoding);
var moduleCode = myJsBeautify(
'/** Compiled By kissy-xtemplate */\n' +
'KISSY.add(function(S,require,exports,module){\n' +
'/*jshint quotmark:false, loopfunc:true, indent:false, asi:true, unused:false, boss:true*/\n' +
'return ' + XTemplateCompiler.compileToStr(tplContent)) + ';\n' +
'});';
fs.writeFileSync(modulePath, moduleCode, encoding);
console.info('generate xtpl module: ' + modulePath + ' at ' + (new Date().toLocaleString()));
}
function process(filePath) {
var modulePath;
if (S.endsWith(filePath, '.xtpl.html')||S.endsWith(filePath, '-xtpl.html')) {
modulePath = filePath.replace(/[.-]xtpl\.html$/, '-xtpl.js');
compile(filePath, modulePath);
} else if (S.endsWith(filePath, '.tpl.html')) {
modulePath = filePath.replace(/\.tpl\.html$/, '-tpl.js');
var tplContent = fs.readFileSync(filePath, encoding);
tplContent = tplContent.replace(/\\/g, '\\')
.replace(/\r?\n/g, '\\n')
.replace(/'/g, '\\\'');
var moduleCode = myJsBeautify(S.substitute(tplTemplate, {
code: tplContent
}));
fs.writeFileSync(modulePath, moduleCode, encoding);
console.info('generate tpl module: ' + modulePath +
' at ' + (new Date().toLocaleString()));
}
}
if (program.watch) {
var watcher = chokidar.watch(packagePath, {ignored: /^\./, persistent: true});
watcher.on('add', process).on('change', process);
} else {
var walk = require('walk');
//noinspection JSUnresolvedFunction
var walker = walk.walk(packagePath);
walker.on('file', function (root, fileStats, next) {
var filePath = normalizeSlash(root + '/' + fileStats.name);
process(filePath);
next();
});
}
});
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GarbageCollectorMetrics = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const formatter_1 = require("../../formatter");
const Table_1 = (0, tslib_1.__importDefault)(require("@mui/material/Table"));
const TableBody_1 = (0, tslib_1.__importDefault)(require("@mui/material/TableBody"));
const TableCell_1 = (0, tslib_1.__importDefault)(require("@mui/material/TableCell"));
const TableHead_1 = (0, tslib_1.__importDefault)(require("@mui/material/TableHead"));
const TableRow_1 = (0, tslib_1.__importDefault)(require("@mui/material/TableRow"));
const mui_linear_progress_1 = (0, tslib_1.__importDefault)(require("./mui-linear-progress"));
const Grid_1 = (0, tslib_1.__importDefault)(require("@mui/material/Grid"));
class GarbageCollectorMetrics extends react_1.default.Component {
render() {
const { garbageCollectorMetrics, wholeNumberFormat } = this.props;
return (react_1.default.createElement("div", null,
react_1.default.createElement("h3", null, "Garbage Collection"),
react_1.default.createElement(Grid_1.default, { container: true },
react_1.default.createElement(Grid_1.default, { md: 4, xs: 4, lg: 4 },
react_1.default.createElement("span", null,
"GC Live Data Size/GC Max Data Size (",
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['jvm.gc.live.data.size'] / 1048576, type: 'number', format: wholeNumberFormat }),
"M /",
' ',
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['jvm.gc.max.data.size'] / 1048576, type: 'number', format: wholeNumberFormat }),
"M)"),
react_1.default.createElement(mui_linear_progress_1.default, { color: "success", value: 100 * garbageCollectorMetrics['jvm.gc.live.data.size'] / garbageCollectorMetrics['jvm.gc.max.data.size'] })),
react_1.default.createElement(Grid_1.default, { md: 4, xs: 4, lg: 4 },
react_1.default.createElement("span", null,
"GC Memory Promoted/GC Memory Allocated (",
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['jvm.gc.memory.promoted'] / 1048576, type: 'number', format: wholeNumberFormat }),
"M /",
' ',
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['jvm.gc.memory.allocated'] / 1048576, type: 'number', format: wholeNumberFormat }),
"M)"),
react_1.default.createElement(mui_linear_progress_1.default, { color: "success", value: 100 * garbageCollectorMetrics['jvm.gc.memory.promoted'] / garbageCollectorMetrics['jvm.gc.memory.allocated'] })),
react_1.default.createElement(Grid_1.default, { md: 4, xs: 4, lg: 4 },
react_1.default.createElement(Grid_1.default, { container: true },
react_1.default.createElement(Grid_1.default, { md: 9, xs: 9, lg: 9 }, "Classes loaded"),
react_1.default.createElement(Grid_1.default, { md: 3, xs: 3, lg: 3 }, garbageCollectorMetrics.classesLoaded)),
react_1.default.createElement(Grid_1.default, { container: true },
react_1.default.createElement(Grid_1.default, { md: 9, xs: 9, lg: 9 }, "Classes unloaded"),
react_1.default.createElement(Grid_1.default, { md: 3, xs: 3, lg: 3 }, garbageCollectorMetrics.classesUnloaded)))),
react_1.default.createElement(Table_1.default, null,
react_1.default.createElement(TableHead_1.default, null,
react_1.default.createElement(TableRow_1.default, null,
react_1.default.createElement(TableCell_1.default, null),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "Count"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "Mean"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "Min"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "p50"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "p75"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "p95"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "p99"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" }, "Max"))),
react_1.default.createElement(TableBody_1.default, null,
react_1.default.createElement(TableRow_1.default, null,
react_1.default.createElement(TableCell_1.default, null, "jvm.gc.pause"),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics.count, type: 'number', format: '0,0.[000]' })),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics.mean, type: 'number', format: '0,0.[000]' })),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['0.0'], type: 'number', format: '0,0.[000]' })),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['0.5'], type: 'number', format: '0,0.[000]' })),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['0.75'], type: 'number', format: '0,0.[000]' })),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['0.95'], type: 'number', format: '0,0.[000]' })),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics['0.99'], type: 'number', format: '0,0.[000]' })),
react_1.default.createElement(TableCell_1.default, { className: "text-end" },
react_1.default.createElement(formatter_1.TextFormat, { value: garbageCollectorMetrics.max, type: 'number', format: '0,0.[000]' })))))));
}
}
exports.GarbageCollectorMetrics = GarbageCollectorMetrics;
//# sourceMappingURL=garbageCollectorMetrics.js.map
|
// Copyright © 2020 The Things Network Foundation, The Things Industries B.V.
//
// 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.
import { connect } from 'react-redux'
import { replace } from 'connected-react-router'
import api from '@console/api'
import { getCollaborator } from '@console/store/actions/collaborators'
import {
selectSelectedApplicationId,
selectApplicationRights,
selectApplicationPseudoRights,
selectApplicationRightsFetching,
selectApplicationRightsError,
} from '@console/store/selectors/applications'
import {
selectUserCollaborator,
selectOrganizationCollaborator,
selectCollaboratorFetching,
selectCollaboratorError,
} from '@console/store/selectors/collaborators'
const mapStateToProps = (state, props) => {
const appId = selectSelectedApplicationId(state)
const { collaboratorId, collaboratorType } = props.match.params
const collaborator =
collaboratorType === 'user'
? selectUserCollaborator(state)
: selectOrganizationCollaborator(state)
const fetching = selectApplicationRightsFetching(state) || selectCollaboratorFetching(state)
const error = selectApplicationRightsError(state) || selectCollaboratorError(state)
return {
collaboratorId,
collaboratorType,
collaborator,
appId,
rights: selectApplicationRights(state),
pseudoRights: selectApplicationPseudoRights(state),
fetching,
error,
}
}
const mapDispatchToProps = (dispatch, ownProps) => ({
getCollaborator: (appId, collaboratorId, isUser) => {
dispatch(getCollaborator('application', appId, collaboratorId, isUser))
},
redirectToList: appId => {
dispatch(replace(`/applications/${appId}/collaborators`))
},
updateCollaborator: (appId, patch) => api.application.collaborators.update(appId, patch),
removeCollaborator: (appId, patch) => api.application.collaborators.update(appId, patch),
})
const mergeProps = (stateProps, dispatchProps, ownProps) => ({
...stateProps,
...dispatchProps,
...ownProps,
getCollaborator: () =>
dispatchProps.getCollaborator(
stateProps.appId,
stateProps.collaboratorId,
stateProps.collaboratorType === 'user',
),
redirectToList: () => dispatchProps.redirectToList(stateProps.appId),
updateCollaborator: patch => api.application.collaborators.update(stateProps.appId, patch),
removeCollaborator: patch => api.application.collaborators.update(stateProps.appId, patch),
})
export default ApplicationCollaboratorEdit =>
connect(
mapStateToProps,
mapDispatchToProps,
mergeProps,
)(ApplicationCollaboratorEdit)
|
/*
YUI 3.17.1 (build 0eb5a52)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('scrollview-base', function (Y, NAME) {
/**
* The scrollview-base module provides a basic ScrollView Widget, without scrollbar indicators
*
* @module scrollview
* @submodule scrollview-base
*/
// Local vars
var getClassName = Y.ClassNameManager.getClassName,
DOCUMENT = Y.config.doc,
IE = Y.UA.ie,
NATIVE_TRANSITIONS = Y.Transition.useNative,
vendorPrefix = Y.Transition._VENDOR_PREFIX, // Todo: This is a private property, and alternative approaches should be investigated
SCROLLVIEW = 'scrollview',
CLASS_NAMES = {
vertical: getClassName(SCROLLVIEW, 'vert'),
horizontal: getClassName(SCROLLVIEW, 'horiz')
},
EV_SCROLL_END = 'scrollEnd',
FLICK = 'flick',
DRAG = 'drag',
MOUSEWHEEL = 'mousewheel',
UI = 'ui',
TOP = 'top',
LEFT = 'left',
PX = 'px',
AXIS = 'axis',
SCROLL_Y = 'scrollY',
SCROLL_X = 'scrollX',
BOUNCE = 'bounce',
DISABLED = 'disabled',
DECELERATION = 'deceleration',
DIM_X = 'x',
DIM_Y = 'y',
BOUNDING_BOX = 'boundingBox',
CONTENT_BOX = 'contentBox',
GESTURE_MOVE = 'gesturemove',
START = 'start',
END = 'end',
EMPTY = '',
ZERO = '0s',
SNAP_DURATION = 'snapDuration',
SNAP_EASING = 'snapEasing',
EASING = 'easing',
FRAME_DURATION = 'frameDuration',
BOUNCE_RANGE = 'bounceRange',
_constrain = function (val, min, max) {
return Math.min(Math.max(val, min), max);
};
/**
* ScrollView provides a scrollable widget, supporting flick gestures,
* across both touch and mouse based devices.
*
* @class ScrollView
* @param config {Object} Object literal with initial attribute values
* @extends Widget
* @constructor
*/
function ScrollView() {
ScrollView.superclass.constructor.apply(this, arguments);
}
Y.ScrollView = Y.extend(ScrollView, Y.Widget, {
// *** Y.ScrollView prototype
/**
* Flag driving whether or not we should try and force H/W acceleration when transforming. Currently enabled by default for Webkit.
* Used by the _transform method.
*
* @property _forceHWTransforms
* @type boolean
* @protected
*/
_forceHWTransforms: Y.UA.webkit ? true : false,
/**
* <p>Used to control whether or not ScrollView's internal
* gesturemovestart, gesturemove and gesturemoveend
* event listeners should preventDefault. The value is an
* object, with "start", "move" and "end" properties used to
* specify which events should preventDefault and which shouldn't:</p>
*
* <pre>
* {
* start: false,
* move: true,
* end: false
* }
* </pre>
*
* <p>The default values are set up in order to prevent panning,
* on touch devices, while allowing click listeners on elements inside
* the ScrollView to be notified as expected.</p>
*
* @property _prevent
* @type Object
* @protected
*/
_prevent: {
start: false,
move: true,
end: false
},
/**
* Contains the distance (postive or negative) in pixels by which
* the scrollview was last scrolled. This is useful when setting up
* click listeners on the scrollview content, which on mouse based
* devices are always fired, even after a drag/flick.
*
* <p>Touch based devices don't currently fire a click event,
* if the finger has been moved (beyond a threshold) so this
* check isn't required, if working in a purely touch based environment</p>
*
* @property lastScrolledAmt
* @type Number
* @public
* @default 0
*/
lastScrolledAmt: 0,
/**
* Internal state, defines the minimum amount that the scrollview can be scrolled along the X axis
*
* @property _minScrollX
* @type number
* @protected
*/
_minScrollX: null,
/**
* Internal state, defines the maximum amount that the scrollview can be scrolled along the X axis
*
* @property _maxScrollX
* @type number
* @protected
*/
_maxScrollX: null,
/**
* Internal state, defines the minimum amount that the scrollview can be scrolled along the Y axis
*
* @property _minScrollY
* @type number
* @protected
*/
_minScrollY: null,
/**
* Internal state, defines the maximum amount that the scrollview can be scrolled along the Y axis
*
* @property _maxScrollY
* @type number
* @protected
*/
_maxScrollY: null,
/**
* Designated initializer
*
* @method initializer
* @param {Object} Configuration object for the plugin
*/
initializer: function () {
var sv = this;
// Cache these values, since they aren't going to change.
sv._bb = sv.get(BOUNDING_BOX);
sv._cb = sv.get(CONTENT_BOX);
// Cache some attributes
sv._cAxis = sv.get(AXIS);
sv._cBounce = sv.get(BOUNCE);
sv._cBounceRange = sv.get(BOUNCE_RANGE);
sv._cDeceleration = sv.get(DECELERATION);
sv._cFrameDuration = sv.get(FRAME_DURATION);
},
/**
* bindUI implementation
*
* Hooks up events for the widget
* @method bindUI
*/
bindUI: function () {
var sv = this;
// Bind interaction listers
sv._bindFlick(sv.get(FLICK));
sv._bindDrag(sv.get(DRAG));
sv._bindMousewheel(true);
// Bind change events
sv._bindAttrs();
// IE SELECT HACK. See if we can do this non-natively and in the gesture for a future release.
if (IE) {
sv._fixIESelect(sv._bb, sv._cb);
}
// Set any deprecated static properties
if (ScrollView.SNAP_DURATION) {
sv.set(SNAP_DURATION, ScrollView.SNAP_DURATION);
}
if (ScrollView.SNAP_EASING) {
sv.set(SNAP_EASING, ScrollView.SNAP_EASING);
}
if (ScrollView.EASING) {
sv.set(EASING, ScrollView.EASING);
}
if (ScrollView.FRAME_STEP) {
sv.set(FRAME_DURATION, ScrollView.FRAME_STEP);
}
if (ScrollView.BOUNCE_RANGE) {
sv.set(BOUNCE_RANGE, ScrollView.BOUNCE_RANGE);
}
// Recalculate dimension properties
// TODO: This should be throttled.
// Y.one(WINDOW).after('resize', sv._afterDimChange, sv);
},
/**
* Bind event listeners
*
* @method _bindAttrs
* @private
*/
_bindAttrs: function () {
var sv = this,
scrollChangeHandler = sv._afterScrollChange,
dimChangeHandler = sv._afterDimChange;
// Bind any change event listeners
sv.after({
'scrollEnd': sv._afterScrollEnd,
'disabledChange': sv._afterDisabledChange,
'flickChange': sv._afterFlickChange,
'dragChange': sv._afterDragChange,
'axisChange': sv._afterAxisChange,
'scrollYChange': scrollChangeHandler,
'scrollXChange': scrollChangeHandler,
'heightChange': dimChangeHandler,
'widthChange': dimChangeHandler
});
},
/**
* Bind (or unbind) gesture move listeners required for drag support
*
* @method _bindDrag
* @param drag {boolean} If true, the method binds listener to enable
* drag (gesturemovestart). If false, the method unbinds gesturemove
* listeners for drag support.
* @private
*/
_bindDrag: function (drag) {
var sv = this,
bb = sv._bb;
// Unbind any previous 'drag' listeners
bb.detach(DRAG + '|*');
if (drag) {
bb.on(DRAG + '|' + GESTURE_MOVE + START, Y.bind(sv._onGestureMoveStart, sv));
}
},
/**
* Bind (or unbind) flick listeners.
*
* @method _bindFlick
* @param flick {Object|boolean} If truthy, the method binds listeners for
* flick support. If false, the method unbinds flick listeners.
* @private
*/
_bindFlick: function (flick) {
var sv = this,
bb = sv._bb;
// Unbind any previous 'flick' listeners
bb.detach(FLICK + '|*');
if (flick) {
bb.on(FLICK + '|' + FLICK, Y.bind(sv._flick, sv), flick);
// Rebind Drag, becuase _onGestureMoveEnd always has to fire -after- _flick
sv._bindDrag(sv.get(DRAG));
}
},
/**
* Bind (or unbind) mousewheel listeners.
*
* @method _bindMousewheel
* @param mousewheel {Object|boolean} If truthy, the method binds listeners for
* mousewheel support. If false, the method unbinds mousewheel listeners.
* @private
*/
_bindMousewheel: function (mousewheel) {
var sv = this,
bb = sv._bb;
// Unbind any previous 'mousewheel' listeners
// TODO: This doesn't actually appear to work properly. Fix. #2532743
bb.detach(MOUSEWHEEL + '|*');
// Only enable for vertical scrollviews
if (mousewheel) {
// Bound to document, because that's where mousewheel events fire off of.
Y.one(DOCUMENT).on(MOUSEWHEEL, Y.bind(sv._mousewheel, sv));
}
},
/**
* syncUI implementation.
*
* Update the scroll position, based on the current value of scrollX/scrollY.
*
* @method syncUI
*/
syncUI: function () {
var sv = this,
scrollDims = sv._getScrollDims(),
width = scrollDims.offsetWidth,
height = scrollDims.offsetHeight,
scrollWidth = scrollDims.scrollWidth,
scrollHeight = scrollDims.scrollHeight;
// If the axis is undefined, auto-calculate it
if (sv._cAxis === undefined) {
// This should only ever be run once (for now).
// In the future SV might post-load axis changes
sv._cAxis = {
x: (scrollWidth > width),
y: (scrollHeight > height)
};
sv._set(AXIS, sv._cAxis);
}
// get text direction on or inherited by scrollview node
sv.rtl = (sv._cb.getComputedStyle('direction') === 'rtl');
// Cache the disabled value
sv._cDisabled = sv.get(DISABLED);
// Run this to set initial values
sv._uiDimensionsChange();
// If we're out-of-bounds, snap back.
if (sv._isOutOfBounds()) {
sv._snapBack();
}
},
/**
* Utility method to obtain widget dimensions
*
* @method _getScrollDims
* @return {Object} The offsetWidth, offsetHeight, scrollWidth and
* scrollHeight as an array: [offsetWidth, offsetHeight, scrollWidth,
* scrollHeight]
* @private
*/
_getScrollDims: function () {
var sv = this,
cb = sv._cb,
bb = sv._bb,
TRANS = ScrollView._TRANSITION,
// Ideally using CSSMatrix - don't think we have it normalized yet though.
// origX = (new WebKitCSSMatrix(cb.getComputedStyle("transform"))).e,
// origY = (new WebKitCSSMatrix(cb.getComputedStyle("transform"))).f,
origX = sv.get(SCROLL_X),
origY = sv.get(SCROLL_Y),
origHWTransform,
dims;
// TODO: Is this OK? Just in case it's called 'during' a transition.
if (NATIVE_TRANSITIONS) {
cb.setStyle(TRANS.DURATION, ZERO);
cb.setStyle(TRANS.PROPERTY, EMPTY);
}
origHWTransform = sv._forceHWTransforms;
sv._forceHWTransforms = false; // the z translation was causing issues with picking up accurate scrollWidths in Chrome/Mac.
sv._moveTo(cb, 0, 0);
dims = {
'offsetWidth': bb.get('offsetWidth'),
'offsetHeight': bb.get('offsetHeight'),
'scrollWidth': bb.get('scrollWidth'),
'scrollHeight': bb.get('scrollHeight')
};
sv._moveTo(cb, -(origX), -(origY));
sv._forceHWTransforms = origHWTransform;
return dims;
},
/**
* This method gets invoked whenever the height or width attributes change,
* allowing us to determine which scrolling axes need to be enabled.
*
* @method _uiDimensionsChange
* @protected
*/
_uiDimensionsChange: function () {
var sv = this,
bb = sv._bb,
scrollDims = sv._getScrollDims(),
width = scrollDims.offsetWidth,
height = scrollDims.offsetHeight,
scrollWidth = scrollDims.scrollWidth,
scrollHeight = scrollDims.scrollHeight,
rtl = sv.rtl,
svAxis = sv._cAxis,
minScrollX = (rtl ? Math.min(0, -(scrollWidth - width)) : 0),
maxScrollX = (rtl ? 0 : Math.max(0, scrollWidth - width)),
minScrollY = 0,
maxScrollY = Math.max(0, scrollHeight - height);
if (svAxis && svAxis.x) {
bb.addClass(CLASS_NAMES.horizontal);
}
if (svAxis && svAxis.y) {
bb.addClass(CLASS_NAMES.vertical);
}
sv._setBounds({
minScrollX: minScrollX,
maxScrollX: maxScrollX,
minScrollY: minScrollY,
maxScrollY: maxScrollY
});
},
/**
* Set the bounding dimensions of the ScrollView
*
* @method _setBounds
* @protected
* @param bounds {Object} [duration] ms of the scroll animation. (default is 0)
* @param {Number} [bounds.minScrollX] The minimum scroll X value
* @param {Number} [bounds.maxScrollX] The maximum scroll X value
* @param {Number} [bounds.minScrollY] The minimum scroll Y value
* @param {Number} [bounds.maxScrollY] The maximum scroll Y value
*/
_setBounds: function (bounds) {
var sv = this;
// TODO: Do a check to log if the bounds are invalid
sv._minScrollX = bounds.minScrollX;
sv._maxScrollX = bounds.maxScrollX;
sv._minScrollY = bounds.minScrollY;
sv._maxScrollY = bounds.maxScrollY;
},
/**
* Get the bounding dimensions of the ScrollView
*
* @method _getBounds
* @protected
*/
_getBounds: function () {
var sv = this;
return {
minScrollX: sv._minScrollX,
maxScrollX: sv._maxScrollX,
minScrollY: sv._minScrollY,
maxScrollY: sv._maxScrollY
};
},
/**
* Scroll the element to a given xy coordinate
*
* @method scrollTo
* @param x {Number} The x-position to scroll to. (null for no movement)
* @param y {Number} The y-position to scroll to. (null for no movement)
* @param {Number} [duration] ms of the scroll animation. (default is 0)
* @param {String} [easing] An easing equation if duration is set. (default is `easing` attribute)
* @param {String} [node] The node to transform. Setting this can be useful in
* dual-axis paginated instances. (default is the instance's contentBox)
*/
scrollTo: function (x, y, duration, easing, node) {
// Check to see if widget is disabled
if (this._cDisabled) {
return;
}
var sv = this,
cb = sv._cb,
TRANS = ScrollView._TRANSITION,
callback = Y.bind(sv._onTransEnd, sv), // @Todo : cache this
newX = 0,
newY = 0,
transition = {},
transform;
// default the optional arguments
duration = duration || 0;
easing = easing || sv.get(EASING); // @TODO: Cache this
node = node || cb;
if (x !== null) {
sv.set(SCROLL_X, x, {src:UI});
newX = -(x);
}
if (y !== null) {
sv.set(SCROLL_Y, y, {src:UI});
newY = -(y);
}
transform = sv._transform(newX, newY);
if (NATIVE_TRANSITIONS) {
// ANDROID WORKAROUND - try and stop existing transition, before kicking off new one.
node.setStyle(TRANS.DURATION, ZERO).setStyle(TRANS.PROPERTY, EMPTY);
}
// Move
if (duration === 0) {
if (NATIVE_TRANSITIONS) {
node.setStyle('transform', transform);
}
else {
// TODO: If both set, batch them in the same update
// Update: Nope, setStyles() just loops through each property and applies it.
if (x !== null) {
node.setStyle(LEFT, newX + PX);
}
if (y !== null) {
node.setStyle(TOP, newY + PX);
}
}
}
// Animate
else {
transition.easing = easing;
transition.duration = duration / 1000;
if (NATIVE_TRANSITIONS) {
transition.transform = transform;
}
else {
transition.left = newX + PX;
transition.top = newY + PX;
}
node.transition(transition, callback);
}
},
/**
* Utility method, to create the translate transform string with the
* x, y translation amounts provided.
*
* @method _transform
* @param {Number} x Number of pixels to translate along the x axis
* @param {Number} y Number of pixels to translate along the y axis
* @private
*/
_transform: function (x, y) {
// TODO: Would we be better off using a Matrix for this?
var prop = 'translate(' + x + 'px, ' + y + 'px)';
if (this._forceHWTransforms) {
prop += ' translateZ(0)';
}
return prop;
},
/**
* Utility method, to move the given element to the given xy position
*
* @method _moveTo
* @param node {Node} The node to move
* @param x {Number} The x-position to move to
* @param y {Number} The y-position to move to
* @private
*/
_moveTo : function(node, x, y) {
if (NATIVE_TRANSITIONS) {
node.setStyle('transform', this._transform(x, y));
} else {
node.setStyle(LEFT, x + PX);
node.setStyle(TOP, y + PX);
}
},
/**
* Content box transition callback
*
* @method _onTransEnd
* @param {EventFacade} e The event facade
* @private
*/
_onTransEnd: function () {
var sv = this;
// If for some reason we're OOB, snapback
if (sv._isOutOfBounds()) {
sv._snapBack();
}
else {
/**
* Notification event fired at the end of a scroll transition
*
* @event scrollEnd
* @param e {EventFacade} The default event facade.
*/
sv.fire(EV_SCROLL_END);
}
},
/**
* gesturemovestart event handler
*
* @method _onGestureMoveStart
* @param e {EventFacade} The gesturemovestart event facade
* @private
*/
_onGestureMoveStart: function (e) {
if (this._cDisabled) {
return false;
}
var sv = this,
bb = sv._bb,
currentX = sv.get(SCROLL_X),
currentY = sv.get(SCROLL_Y),
clientX = e.clientX,
clientY = e.clientY;
if (sv._prevent.start) {
e.preventDefault();
}
// if a flick animation is in progress, cancel it
if (sv._flickAnim) {
sv._cancelFlick();
sv._onTransEnd();
}
// Reset lastScrolledAmt
sv.lastScrolledAmt = 0;
// Stores data for this gesture cycle. Cleaned up later
sv._gesture = {
// Will hold the axis value
axis: null,
// The current attribute values
startX: currentX,
startY: currentY,
// The X/Y coordinates where the event began
startClientX: clientX,
startClientY: clientY,
// The X/Y coordinates where the event will end
endClientX: null,
endClientY: null,
// The current delta of the event
deltaX: null,
deltaY: null,
// Will be populated for flicks
flick: null,
// Create some listeners for the rest of the gesture cycle
onGestureMove: bb.on(DRAG + '|' + GESTURE_MOVE, Y.bind(sv._onGestureMove, sv)),
// @TODO: Don't bind gestureMoveEnd if it's a Flick?
onGestureMoveEnd: bb.on(DRAG + '|' + GESTURE_MOVE + END, Y.bind(sv._onGestureMoveEnd, sv))
};
},
/**
* gesturemove event handler
*
* @method _onGestureMove
* @param e {EventFacade} The gesturemove event facade
* @private
*/
_onGestureMove: function (e) {
var sv = this,
gesture = sv._gesture,
svAxis = sv._cAxis,
svAxisX = svAxis.x,
svAxisY = svAxis.y,
startX = gesture.startX,
startY = gesture.startY,
startClientX = gesture.startClientX,
startClientY = gesture.startClientY,
clientX = e.clientX,
clientY = e.clientY;
if (sv._prevent.move) {
e.preventDefault();
}
gesture.deltaX = startClientX - clientX;
gesture.deltaY = startClientY - clientY;
// Determine if this is a vertical or horizontal movement
// @TODO: This is crude, but it works. Investigate more intelligent ways to detect intent
if (gesture.axis === null) {
gesture.axis = (Math.abs(gesture.deltaX) > Math.abs(gesture.deltaY)) ? DIM_X : DIM_Y;
}
// Move X or Y. @TODO: Move both if dualaxis.
if (gesture.axis === DIM_X && svAxisX) {
sv.set(SCROLL_X, startX + gesture.deltaX);
}
else if (gesture.axis === DIM_Y && svAxisY) {
sv.set(SCROLL_Y, startY + gesture.deltaY);
}
},
/**
* gesturemoveend event handler
*
* @method _onGestureMoveEnd
* @param e {EventFacade} The gesturemoveend event facade
* @private
*/
_onGestureMoveEnd: function (e) {
var sv = this,
gesture = sv._gesture,
flick = gesture.flick,
clientX = e.clientX,
clientY = e.clientY,
isOOB;
if (sv._prevent.end) {
e.preventDefault();
}
// Store the end X/Y coordinates
gesture.endClientX = clientX;
gesture.endClientY = clientY;
// Cleanup the event handlers
gesture.onGestureMove.detach();
gesture.onGestureMoveEnd.detach();
// If this wasn't a flick, wrap up the gesture cycle
if (!flick) {
// @TODO: Be more intelligent about this. Look at the Flick attribute to see
// if it is safe to assume _flick did or didn't fire.
// Then, the order _flick and _onGestureMoveEnd fire doesn't matter?
// If there was movement (_onGestureMove fired)
if (gesture.deltaX !== null && gesture.deltaY !== null) {
isOOB = sv._isOutOfBounds();
// If we're out-out-bounds, then snapback
if (isOOB) {
sv._snapBack();
}
// Inbounds
else {
// Fire scrollEnd unless this is a paginated instance and the gesture axis is the same as paginator's
// Not totally confident this is ideal to access a plugin's properties from a host, @TODO revisit
if (!sv.pages || (sv.pages && !sv.pages.get(AXIS)[gesture.axis])) {
sv._onTransEnd();
}
}
}
}
},
/**
* Execute a flick at the end of a scroll action
*
* @method _flick
* @param e {EventFacade} The Flick event facade
* @private
*/
_flick: function (e) {
if (this._cDisabled) {
return false;
}
var sv = this,
svAxis = sv._cAxis,
flick = e.flick,
flickAxis = flick.axis,
flickVelocity = flick.velocity,
axisAttr = flickAxis === DIM_X ? SCROLL_X : SCROLL_Y,
startPosition = sv.get(axisAttr);
// Sometimes flick is enabled, but drag is disabled
if (sv._gesture) {
sv._gesture.flick = flick;
}
// Prevent unneccesary firing of _flickFrame if we can't scroll on the flick axis
if (svAxis[flickAxis]) {
sv._flickFrame(flickVelocity, flickAxis, startPosition);
}
},
/**
* Execute a single frame in the flick animation
*
* @method _flickFrame
* @param velocity {Number} The velocity of this animated frame
* @param flickAxis {String} The axis on which to animate
* @param startPosition {Number} The starting X/Y point to flick from
* @protected
*/
_flickFrame: function (velocity, flickAxis, startPosition) {
var sv = this,
axisAttr = flickAxis === DIM_X ? SCROLL_X : SCROLL_Y,
bounds = sv._getBounds(),
// Localize cached values
bounce = sv._cBounce,
bounceRange = sv._cBounceRange,
deceleration = sv._cDeceleration,
frameDuration = sv._cFrameDuration,
// Calculate
newVelocity = velocity * deceleration,
newPosition = startPosition - (frameDuration * newVelocity),
// Some convinience conditions
min = flickAxis === DIM_X ? bounds.minScrollX : bounds.minScrollY,
max = flickAxis === DIM_X ? bounds.maxScrollX : bounds.maxScrollY,
belowMin = (newPosition < min),
belowMax = (newPosition < max),
aboveMin = (newPosition > min),
aboveMax = (newPosition > max),
belowMinRange = (newPosition < (min - bounceRange)),
withinMinRange = (belowMin && (newPosition > (min - bounceRange))),
withinMaxRange = (aboveMax && (newPosition < (max + bounceRange))),
aboveMaxRange = (newPosition > (max + bounceRange)),
tooSlow;
// If we're within the range but outside min/max, dampen the velocity
if (withinMinRange || withinMaxRange) {
newVelocity *= bounce;
}
// Is the velocity too slow to bother?
tooSlow = (Math.abs(newVelocity).toFixed(4) < 0.015);
// If the velocity is too slow or we're outside the range
if (tooSlow || belowMinRange || aboveMaxRange) {
// Cancel and delete sv._flickAnim
if (sv._flickAnim) {
sv._cancelFlick();
}
// If we're inside the scroll area, just end
if (aboveMin && belowMax) {
sv._onTransEnd();
}
// We're outside the scroll area, so we need to snap back
else {
sv._snapBack();
}
}
// Otherwise, animate to the next frame
else {
// @TODO: maybe use requestAnimationFrame instead
sv._flickAnim = Y.later(frameDuration, sv, '_flickFrame', [newVelocity, flickAxis, newPosition]);
sv.set(axisAttr, newPosition);
}
},
_cancelFlick: function () {
var sv = this;
if (sv._flickAnim) {
// Cancel the flick (if it exists)
sv._flickAnim.cancel();
// Also delete it, otherwise _onGestureMoveStart will think we're still flicking
delete sv._flickAnim;
}
},
/**
* Handle mousewheel events on the widget
*
* @method _mousewheel
* @param e {EventFacade} The mousewheel event facade
* @private
*/
_mousewheel: function (e) {
var sv = this,
scrollY = sv.get(SCROLL_Y),
bounds = sv._getBounds(),
bb = sv._bb,
scrollOffset = 10, // 10px
isForward = (e.wheelDelta > 0),
scrollToY = scrollY - ((isForward ? 1 : -1) * scrollOffset);
scrollToY = _constrain(scrollToY, bounds.minScrollY, bounds.maxScrollY);
// Because Mousewheel events fire off 'document', every ScrollView widget will react
// to any mousewheel anywhere on the page. This check will ensure that the mouse is currently
// over this specific ScrollView. Also, only allow mousewheel scrolling on Y-axis,
// becuase otherwise the 'prevent' will block page scrolling.
if (bb.contains(e.target) && sv._cAxis[DIM_Y]) {
// Reset lastScrolledAmt
sv.lastScrolledAmt = 0;
// Jump to the new offset
sv.set(SCROLL_Y, scrollToY);
// if we have scrollbars plugin, update & set the flash timer on the scrollbar
// @TODO: This probably shouldn't be in this module
if (sv.scrollbars) {
// @TODO: The scrollbars should handle this themselves
sv.scrollbars._update();
sv.scrollbars.flash();
// or just this
// sv.scrollbars._hostDimensionsChange();
}
// Fire the 'scrollEnd' event
sv._onTransEnd();
// prevent browser default behavior on mouse scroll
e.preventDefault();
}
},
/**
* Checks to see the current scrollX/scrollY position beyond the min/max boundary
*
* @method _isOutOfBounds
* @param x {Number} [optional] The X position to check
* @param y {Number} [optional] The Y position to check
* @return {Boolean} Whether the current X/Y position is out of bounds (true) or not (false)
* @private
*/
_isOutOfBounds: function (x, y) {
var sv = this,
svAxis = sv._cAxis,
svAxisX = svAxis.x,
svAxisY = svAxis.y,
currentX = x || sv.get(SCROLL_X),
currentY = y || sv.get(SCROLL_Y),
bounds = sv._getBounds(),
minX = bounds.minScrollX,
minY = bounds.minScrollY,
maxX = bounds.maxScrollX,
maxY = bounds.maxScrollY;
return (svAxisX && (currentX < minX || currentX > maxX)) || (svAxisY && (currentY < minY || currentY > maxY));
},
/**
* Bounces back
* @TODO: Should be more generalized and support both X and Y detection
*
* @method _snapBack
* @private
*/
_snapBack: function () {
var sv = this,
currentX = sv.get(SCROLL_X),
currentY = sv.get(SCROLL_Y),
bounds = sv._getBounds(),
minX = bounds.minScrollX,
minY = bounds.minScrollY,
maxX = bounds.maxScrollX,
maxY = bounds.maxScrollY,
newY = _constrain(currentY, minY, maxY),
newX = _constrain(currentX, minX, maxX),
duration = sv.get(SNAP_DURATION),
easing = sv.get(SNAP_EASING);
if (newX !== currentX) {
sv.set(SCROLL_X, newX, {duration:duration, easing:easing});
}
else if (newY !== currentY) {
sv.set(SCROLL_Y, newY, {duration:duration, easing:easing});
}
else {
sv._onTransEnd();
}
},
/**
* After listener for changes to the scrollX or scrollY attribute
*
* @method _afterScrollChange
* @param e {EventFacade} The event facade
* @protected
*/
_afterScrollChange: function (e) {
if (e.src === ScrollView.UI_SRC) {
return false;
}
var sv = this,
duration = e.duration,
easing = e.easing,
val = e.newVal,
scrollToArgs = [];
// Set the scrolled value
sv.lastScrolledAmt = sv.lastScrolledAmt + (e.newVal - e.prevVal);
// Generate the array of args to pass to scrollTo()
if (e.attrName === SCROLL_X) {
scrollToArgs.push(val);
scrollToArgs.push(sv.get(SCROLL_Y));
}
else {
scrollToArgs.push(sv.get(SCROLL_X));
scrollToArgs.push(val);
}
scrollToArgs.push(duration);
scrollToArgs.push(easing);
sv.scrollTo.apply(sv, scrollToArgs);
},
/**
* After listener for changes to the flick attribute
*
* @method _afterFlickChange
* @param e {EventFacade} The event facade
* @protected
*/
_afterFlickChange: function (e) {
this._bindFlick(e.newVal);
},
/**
* After listener for changes to the disabled attribute
*
* @method _afterDisabledChange
* @param e {EventFacade} The event facade
* @protected
*/
_afterDisabledChange: function (e) {
// Cache for performance - we check during move
this._cDisabled = e.newVal;
},
/**
* After listener for the axis attribute
*
* @method _afterAxisChange
* @param e {EventFacade} The event facade
* @protected
*/
_afterAxisChange: function (e) {
this._cAxis = e.newVal;
},
/**
* After listener for changes to the drag attribute
*
* @method _afterDragChange
* @param e {EventFacade} The event facade
* @protected
*/
_afterDragChange: function (e) {
this._bindDrag(e.newVal);
},
/**
* After listener for the height or width attribute
*
* @method _afterDimChange
* @param e {EventFacade} The event facade
* @protected
*/
_afterDimChange: function () {
this._uiDimensionsChange();
},
/**
* After listener for scrollEnd, for cleanup
*
* @method _afterScrollEnd
* @param e {EventFacade} The event facade
* @protected
*/
_afterScrollEnd: function () {
var sv = this;
if (sv._flickAnim) {
sv._cancelFlick();
}
// Ideally this should be removed, but doing so causing some JS errors with fast swiping
// because _gesture is being deleted after the previous one has been overwritten
// delete sv._gesture; // TODO: Move to sv.prevGesture?
},
/**
* Setter for 'axis' attribute
*
* @method _axisSetter
* @param val {Mixed} A string ('x', 'y', 'xy') to specify which axis/axes to allow scrolling on
* @param name {String} The attribute name
* @return {Object} An object to specify scrollability on the x & y axes
*
* @protected
*/
_axisSetter: function (val) {
// Turn a string into an axis object
if (Y.Lang.isString(val)) {
return {
x: val.match(/x/i) ? true : false,
y: val.match(/y/i) ? true : false
};
}
},
/**
* The scrollX, scrollY setter implementation
*
* @method _setScroll
* @private
* @param {Number} val
* @param {String} dim
*
* @return {Number} The value
*/
_setScroll : function(val) {
// Just ensure the widget is not disabled
if (this._cDisabled) {
val = Y.Attribute.INVALID_VALUE;
}
return val;
},
/**
* Setter for the scrollX attribute
*
* @method _setScrollX
* @param val {Number} The new scrollX value
* @return {Number} The normalized value
* @protected
*/
_setScrollX: function(val) {
return this._setScroll(val, DIM_X);
},
/**
* Setter for the scrollY ATTR
*
* @method _setScrollY
* @param val {Number} The new scrollY value
* @return {Number} The normalized value
* @protected
*/
_setScrollY: function(val) {
return this._setScroll(val, DIM_Y);
}
// End prototype properties
}, {
// Static properties
/**
* The identity of the widget.
*
* @property NAME
* @type String
* @default 'scrollview'
* @readOnly
* @protected
* @static
*/
NAME: 'scrollview',
/**
* Static property used to define the default attribute configuration of
* the Widget.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* Specifies ability to scroll on x, y, or x and y axis/axes.
*
* @attribute axis
* @type String
*/
axis: {
setter: '_axisSetter',
writeOnce: 'initOnly'
},
/**
* The current scroll position in the x-axis
*
* @attribute scrollX
* @type Number
* @default 0
*/
scrollX: {
value: 0,
setter: '_setScrollX'
},
/**
* The current scroll position in the y-axis
*
* @attribute scrollY
* @type Number
* @default 0
*/
scrollY: {
value: 0,
setter: '_setScrollY'
},
/**
* Drag coefficent for inertial scrolling. The closer to 1 this
* value is, the less friction during scrolling.
*
* @attribute deceleration
* @default 0.93
*/
deceleration: {
value: 0.93
},
/**
* Drag coefficient for intertial scrolling at the upper
* and lower boundaries of the scrollview. Set to 0 to
* disable "rubber-banding".
*
* @attribute bounce
* @type Number
* @default 0.1
*/
bounce: {
value: 0.1
},
/**
* The minimum distance and/or velocity which define a flick. Can be set to false,
* to disable flick support (note: drag support is enabled/disabled separately)
*
* @attribute flick
* @type Object
* @default Object with properties minDistance = 10, minVelocity = 0.3.
*/
flick: {
value: {
minDistance: 10,
minVelocity: 0.3
}
},
/**
* Enable/Disable dragging the ScrollView content (note: flick support is enabled/disabled separately)
* @attribute drag
* @type boolean
* @default true
*/
drag: {
value: true
},
/**
* The default duration to use when animating the bounce snap back.
*
* @attribute snapDuration
* @type Number
* @default 400
*/
snapDuration: {
value: 400
},
/**
* The default easing to use when animating the bounce snap back.
*
* @attribute snapEasing
* @type String
* @default 'ease-out'
*/
snapEasing: {
value: 'ease-out'
},
/**
* The default easing used when animating the flick
*
* @attribute easing
* @type String
* @default 'cubic-bezier(0, 0.1, 0, 1.0)'
*/
easing: {
value: 'cubic-bezier(0, 0.1, 0, 1.0)'
},
/**
* The interval (ms) used when animating the flick for JS-timer animations
*
* @attribute frameDuration
* @type Number
* @default 15
*/
frameDuration: {
value: 15
},
/**
* The default bounce distance in pixels
*
* @attribute bounceRange
* @type Number
* @default 150
*/
bounceRange: {
value: 150
}
},
/**
* List of class names used in the scrollview's DOM
*
* @property CLASS_NAMES
* @type Object
* @static
*/
CLASS_NAMES: CLASS_NAMES,
/**
* Flag used to source property changes initiated from the DOM
*
* @property UI_SRC
* @type String
* @static
* @default 'ui'
*/
UI_SRC: UI,
/**
* Object map of style property names used to set transition properties.
* Defaults to the vendor prefix established by the Transition module.
* The configured property names are `_TRANSITION.DURATION` (e.g. "WebkitTransitionDuration") and
* `_TRANSITION.PROPERTY (e.g. "WebkitTransitionProperty").
*
* @property _TRANSITION
* @private
*/
_TRANSITION: {
DURATION: (vendorPrefix ? vendorPrefix + 'TransitionDuration' : 'transitionDuration'),
PROPERTY: (vendorPrefix ? vendorPrefix + 'TransitionProperty' : 'transitionProperty')
},
/**
* The default bounce distance in pixels
*
* @property BOUNCE_RANGE
* @type Number
* @static
* @default false
* @deprecated (in 3.7.0)
*/
BOUNCE_RANGE: false,
/**
* The interval (ms) used when animating the flick
*
* @property FRAME_STEP
* @type Number
* @static
* @default false
* @deprecated (in 3.7.0)
*/
FRAME_STEP: false,
/**
* The default easing used when animating the flick
*
* @property EASING
* @type String
* @static
* @default false
* @deprecated (in 3.7.0)
*/
EASING: false,
/**
* The default easing to use when animating the bounce snap back.
*
* @property SNAP_EASING
* @type String
* @static
* @default false
* @deprecated (in 3.7.0)
*/
SNAP_EASING: false,
/**
* The default duration to use when animating the bounce snap back.
*
* @property SNAP_DURATION
* @type Number
* @static
* @default false
* @deprecated (in 3.7.0)
*/
SNAP_DURATION: false
// End static properties
});
}, '3.17.1', {"requires": ["widget", "event-gestures", "event-mousewheel", "transition"], "skinnable": true});
|
define([
], function (
) {
'use strict';
// this looks odd, but we'll be added other properties in future - validators etc
return [ 'data', 'computed' ];
});
|
!function(e){const i=e.ar=e.ar||{};i.dictionary=Object.assign(i.dictionary||{},{"%0 of %1":"","Align center":"محاذاة في المنتصف","Align left":"محاذاة لليسار","Align right":"محاذاة لليمين",Aquamarine:"",Big:"كبير",Black:"","Block quote":"اقتباس",Blue:"",Bold:"عريض","Break text":"","Bulleted List":"قائمة نقطية",Cancel:"إلغاء","Cannot upload file:":"لا يمكن رفع الملف:","Centered image":"صورة بالوسط","Change image text alternative":"غير النص البديل للصورة","Choose heading":"اختر عنوان",Code:"شفرة برمجية",Column:"عمود",Default:"افتراضي","Delete column":"حذف العمود","Delete row":"حذف الصف","Dim grey":"","Document colors":"",Downloadable:"","Dropdown toolbar":"","Edit block":"","Edit link":"تحرير الرابط","Editor toolbar":"","Enter image caption":"ادخل عنوان الصورة","Font Background Color":"","Font Color":"","Font Family":"نوع الخط","Font Size":"حجم الخط","Full size image":"صورة بحجم كامل",Green:"",Grey:"","Header column":"عمود عنوان","Header row":"صف عنوان",Heading:"عنوان","Heading 1":"عنوان 1","Heading 2":"عنوان 2","Heading 3":"عنوان 3","Heading 4":"","Heading 5":"","Heading 6":"",Huge:"ضخم","Image resize list":"","Image toolbar":"","image widget":"عنصر الصورة","In line":"",Insert:"","Insert column left":"أدخل العمود إلى اليسار","Insert column right":"أدخل العمود إلى اليمين","Insert image":"ادراج صورة","Insert image via URL":"","Insert media":"أدخل الوسائط","Insert row above":"ادراج صف قبل","Insert row below":"ادراج صف بعد","Insert table":"إدراج جدول",Italic:"مائل",Justify:"ضبط","Left aligned image":"صورة بمحاذاة لليسار","Light blue":"","Light green":"","Light grey":"",Link:"رابط","Link URL":"رابط عنوان","Media URL":"","media widget":"","Merge cell down":"دمج الخلايا للأسفل","Merge cell left":"دمج الخلايا لليسار","Merge cell right":"دمج الخلايا لليمين","Merge cell up":"دمج الخلايا للأعلى","Merge cells":"دمج الخلايا",Next:"","Numbered List":"قائمة رقمية","Open in a new tab":"","Open link in new tab":"فتح الرابط في تبويب جديد",Orange:"",Original:"",Paragraph:"فقرة","Paste the media URL in the input.":"",Previous:"",Purple:"",Red:"",Redo:"إعادة","Remove color":"","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Rich Text Editor":"معالج نصوص","Rich Text Editor, %0":"معالج نصوص، 0%","Right aligned image":"صورة بمحاذاة لليمين",Row:"صف",Save:"حفظ","Select column":"حدد العمود","Select row":"حدد صفًا","Show more items":"","Side image":"صورة جانبية",Small:"صغير","Split cell horizontally":"فصل الخلايا بشكل افقي","Split cell vertically":"فصل الخلايا بشكل عمودي",Strikethrough:"يتوسطه خط",Subscript:"",Superscript:"","Table toolbar":"شريط أدوات الجدول","Text alignment":"محاذاة النص","Text alignment toolbar":"","Text alternative":"النص البديل","The URL must not be empty.":"","This link has no URL":"لا يحتوي هذا الرابط على عنوان","This media URL is not supported.":"",Tiny:"ضئيل","Tip: Paste the URL into the content to embed faster.":"","To-do List":"","Toggle caption off":"","Toggle caption on":"",Turquoise:"",Underline:"تحته خط",Undo:"تراجع",Unlink:"إلغاء الرابط",Update:"","Update image URL":"","Upload failed":"فشل الرفع","Upload in progress":"جاري الرفع",White:"","Wrap text":"",Yellow:""}),i.getPluralForm=function(e){return 0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11&&e%100<=99?4:5}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_movie_filter_twotone = void 0;
var ic_movie_filter_twotone = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M0 0h24v24H0V0z",
"fill": "none"
},
"children": []
}, {
"name": "path",
"attribs": {
"d": "M16.63 11.37L18 12l-1.37.63L16 14l-.63-1.37L14 12l1.37-.63L16 10H5.77L4.01 6.47V18h16v-8H16l.63 1.37zm-5.69 3.57L10 17l-.94-2.06L7 14l2.06-.94L10 11l.94 2.06L13 14l-2.06.94z",
"opacity": ".3"
},
"children": []
}, {
"name": "path",
"attribs": {
"d": "M10 11l-.94 2.06L7 14l2.06.94L10 17l.94-2.06L13 14l-2.06-.94zm8.01-7l2 4h-3l-2-4h-2l2 4h-3l-2-4h-2l2 4h-3l-2-4h-1c-1.1 0-1.99.9-1.99 2l-.01 12c0 1.1.9 2 2 2h16c1.1 0 1.99-.9 1.99-2V4h-3.99zm2 14h-16V6.47L5.77 10H16l-.63 1.37L14 12l1.37.63L16 14l.63-1.37L18 12l-1.37-.63L16 10h4.01v8z"
},
"children": []
}]
};
exports.ic_movie_filter_twotone = ic_movie_filter_twotone;
|
import { DefaultFairy } from './DefaultFairy';
import { StrongerStage1Fairy } from './StrongerStage1Fairy';
import { StrongStage1Fairy } from './StrongStage1Fairy';
import { Tumbleweed } from './Tumbleweed';
import { Wriggle1 } from './Wriggle1';
import { Wriggle2 } from './Wriggle2';
/* eslint no-unused-vars: 0 */
const stage1def = () => {
const map = {
epochs: [[]],
};
map.epochs[0].push({
type: 'UI',
action: 'stageStartQuote',
text: [
'Stage 1',
'Where the Fireflies Fly',
'Are the fireflies brighter than usual, or is it just your imagination? Tonight will be a long night'
],
wait: 7
})
for (let i = 0; i < 12; i++) {
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: DefaultFairy([[-1, -0.9], [-0.1, 0.1], [1, 0.9]], [0, 0, 0]),
wait: .50
})
}
map.epochs[0].push({
type: 'empty',
wait: 3
})
for (let i = 0; i < 12; i++) {
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: DefaultFairy([[-0.1, 0.1], [1, 0.9], [1, 0.9]], [0, 0, 0]),
wait: .50
})
}
map.epochs[0].push({
type: 'empty',
wait: 3
})
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: StrongStage1Fairy([-1, 0.5, 1], [1.5, 0, 0]),
wait: 5
})
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: StrongerStage1Fairy([1, 0.5, 1], [-1.5, 0.5, 0]),
wait: 5
})
for (let i = 0; i < 12; i++) {
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: DefaultFairy([[-1, -0.9], [1, 0.9], [1, 0.9]], [0, 0, 0]),
wait: .50
})
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: DefaultFairy([[1, 0.9], [1, 0.9], [1, 0.9]], [0, 0, 0]),
wait: .250
})
}
for (let i = 0; i < 12; i++) {
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: Tumbleweed([[-1.3, -1.1], [-0.3, -0.1], [1, 0.9]], [[1.3, 1.1], [-0.3, -0.1], [1, 0.9]]),
wait: .1
})
map.epochs[0].push({
type: "enemies",
action: 'spawn',
enemy: Tumbleweed([[1.3, 1.1], [0.1, 0.3], [1, 0.9]], [[-1.3, -1.1], [0.1, 0.3], [1, 0.9]]),
wait: .1
})
}
map.epochs[0].push({
type: "enemies",
action: 'nextEpoch',
wait: 0
})
map.epochs.push([]);
map.epochs[1].push({
type: "enemies",
action: 'spawn',
enemy: Wriggle1(),
wait: 2
})
map.epochs[1].push({
type: "enemies",
action: 'nextEpoch',
wait: 0
})
map.epochs.push([]);
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: StrongStage1Fairy([-1, 0.5, 1], [1, 0, 0]),
wait: 0
})
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: StrongStage1Fairy([1, -0.5, 1], [-1, 0, 0]),
wait: 3
})
for (let i = 0; i < 20; i++) {
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: DefaultFairy([[-1, 1], [-1, 1], [1, 0.9]], [0, 0, 0]),
wait: .1
})
}
map.epochs[2].push({
type: 'empty',
wait: 3
})
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: StrongerStage1Fairy([1, 0, 1], [-1, 0, 0]),
wait: 0
})
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: StrongerStage1Fairy([-1, 0, 1], [-1, 0, 0]),
wait: 0
})
map.epochs[2].push({
type: 'empty',
wait: 2
})
for (let i = 0; i < 15; i++) {
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: Tumbleweed([[-1.3, -1.1], [-0.3, -0.1], [1, 0.9]], [[1.3, 1.1], [-0.3, -0.1], [1, 0.9]]),
wait: .1
})
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: Tumbleweed([[1.3, 1.1], [0.1, 0.3], [1, 0.9]], [[-1.3, -1.1], [0.1, 0.3], [1, 0.9]]),
wait: .1
})
}
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: StrongStage1Fairy([1, 0.5, 1], [-1, 0.5, 0]),
wait: 0
})
map.epochs[2].push({
type: "enemies",
action: 'spawn',
enemy: StrongerStage1Fairy([-1, -0.5, 1], [1, -0.5, 0]),
wait: 6
})
map.epochs[2].push({
type: "enemies",
action: 'nextEpoch',
wait: 0
})
map.epochs.push([]);
map.epochs[3].push({
type: "enemies",
action: 'spawn',
enemy: Wriggle2(),
wait: 3
})
map.epochs[3].push({
type: 'UI',
action: 'init',
actors: ["player", "wriggle"],
text: "Oh hey there!"
})
map.epochs[3].push({
type: 'UI',
action: 'talk',
actor: "wriggle",
emotion: "excited",
text: "Hello ^-^, and what might you be doing out on a night like this?"
})
map.epochs[3].push({
type: 'UI',
action: 'talk',
actor: "player",
emotion: "neutral",
text: "Well you see I'm just enjoying this cool new extra dimension"
})
map.epochs[3].push({
type: 'UI',
action: 'talk',
actor: "wriggle",
emotion: "tired",
text: "Yea, up is a pretty neat direction, how do you think the developer managed all this in a browser?"
})
map.epochs[3].push({
type: 'UI',
action: 'talk',
actor: "player",
emotion: "excited",
text: "Probably some pretty wild compute shaders"
})
map.epochs[3].push({
type: 'UI',
action: 'talk',
actor: "player",
emotion: "neutral",
text: "Anyways, let's show off what this engine can really do"
})
map.epochs[3].push({
type: 'UI',
action: 'talk',
actor: "wriggle",
emotion: "excited",
text: "Heck ya!"
})
map.epochs[3].push({
type: 'UI',
action: 'nextEpoch',
})
map.epochs.push([]);
map.epochs[4].push({
type: "UI",
action: 'globalCallback',
callback: 'bossStart'
})
return map;
};
export default stage1def;
|
import{r as t,h as e,F as a,g as i,c as n}from"./p-6b8b45ed.js";import{b as o,g as r,C as l}from"./p-f1686cee.js";import"./p-a4e6e35b.js";const s=class{constructor(e){t(this,e)}renderHeader(){return o(this.el,"header")?e("slot",{name:"header"}):null}renderContent(){return this.contentBehind?[e("div",{class:{content:!0,"content--behind":!!this.contentBehind}},e("slot",null)),e("slot",{name:"center-row"})]:[e("div",{class:"content"},e("slot",null),e("slot",{name:"center-row"}))]}renderFooter(){return o(this.el,"footer")?e("div",{class:"footer"},e("slot",{name:"footer"})):null}renderMain(){const t=o(this.el,"primary-panel");return e("div",{class:{main:!0,"main--reversed":"end"===(null==t?void 0:t.position)}},e("slot",{name:"primary-panel"}),this.renderContent(),e("slot",{name:"contextual-panel"}))}render(){return e(a,null,this.renderHeader(),this.renderMain(),this.renderFooter())}get el(){return i(this)}};s.style="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{width:100%;height:100%;position:absolute;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden;top:0;right:0;bottom:0;left:0;--calcite-shell-tip-spacing:26vw}.main{height:100%;width:100%;-ms-flex:1 1 auto;flex:1 1 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;position:relative;border-width:0;border-top-width:1px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);-ms-flex-pack:justify;justify-content:space-between;overflow:hidden}.main--reversed{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.content{display:-ms-flexbox;display:flex;height:100%;overflow:auto;width:100%;border-width:0;border-left-width:1px;border-right-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);-ms-flex-flow:column nowrap;flex-flow:column nowrap}.content ::slotted(calcite-shell-center-row),.content ::slotted(calcite-panel),.content ::slotted(calcite-flow){-ms-flex-item-align:stretch;align-self:stretch;-ms-flex:1 1 auto;flex:1 1 auto;max-height:unset}.content--behind{border-width:0;position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;display:initial}::slotted(calcite-shell-center-row){width:unset}::slotted(.header .heading){font-weight:var(--calcite-font-weight-normal);font-size:var(--calcite-font-size--2);line-height:1.375}::slotted(calcite-shell-panel),::slotted(calcite-shell-center-row){position:relative;z-index:1}slot[name=center-row]::slotted(calcite-shell-center-row:not([detached])){border-left-width:1px;border-right-width:1px;border-color:var(--calcite-ui-border-3)}::slotted(calcite-tip-manager){border-radius:0.25rem;-webkit-box-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);box-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);position:absolute;-webkit-animation:in-up var(--calcite-animation-timing) ease-in-out;animation:in-up var(--calcite-animation-timing) ease-in-out;-webkit-box-sizing:border-box;box-sizing:border-box;bottom:0.5rem;left:var(--calcite-shell-tip-spacing);right:var(--calcite-shell-tip-spacing);z-index:2}";const c=class{constructor(e){t(this,e),this.detached=!1,this.heightScale="s",this.position="end"}render(){const{el:t}=this,i="rtl"===r(t),n=e("div",{class:{content:!0,[l.rtl]:i}},e("slot",null)),s=o(t,"action-bar"),c=[s?e("div",{class:{"action-bar-container":!0,[l.rtl]:i}},e("slot",{name:"action-bar"})):null,n];return"end"===(null==s?void 0:s.position)&&c.reverse(),e(a,null,c)}get el(){return i(this)}};c.style="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;overflow:hidden;background-color:transparent}.content{display:-ms-flexbox;display:flex;height:100%;margin:0;overflow:hidden;width:100%;-ms-flex:1 0 0px;flex:1 0 0}.action-bar-container{display:-ms-flexbox;display:flex}:host([detached]){border-width:0;border-radius:0.25rem;-webkit-box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);margin-top:0.5rem;margin-bottom:1.5rem;margin-left:0.5rem;margin-right:0.5rem;-webkit-animation:in-up var(--calcite-animation-timing) ease-in-out;animation:in-up var(--calcite-animation-timing) ease-in-out}:host([position=end]){-ms-flex-item-align:end;align-self:flex-end}:host([position=start]){-ms-flex-item-align:start;align-self:flex-start}:host([height-scale=s]){height:33.333333%}:host([height-scale=m]){height:70%}:host([height-scale=l]){height:100%}:host([height-scale=l][detached]){height:calc(100% - 2rem)}::slotted(calcite-panel){width:100%;height:100%}::slotted(calcite-action-bar){border-right-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}::slotted(calcite-action-bar[position=end]){border-left-width:0;border-right-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.calcite--rtl ::slotted(calcite-action-bar){border-right-width:0;border-left-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.calcite--rtl ::slotted(calcite-action-bar[position=end]){border-left-width:0;border-right-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}";const m=class{constructor(e){t(this,e),this.calciteShellPanelToggle=n(this,"calciteShellPanelToggle",7),this.collapsed=!1,this.detached=!1,this.detachedHeightScale="l",this.widthScale="m"}watchHandler(){this.calciteShellPanelToggle.emit()}renderHeader(){const{el:t}=this;return o(t,"header")?e("div",{class:"content__header"},e("slot",{name:"header"})):null}render(){const{collapsed:t,detached:i,position:n}=this,o=e("div",{class:{content:!0,"content--detached":i},hidden:t},this.renderHeader(),e("div",{class:"content__body"},e("slot",null))),r=[e("slot",{name:"action-bar"}),o];return"end"===n&&r.reverse(),e(a,null,r)}get el(){return i(this)}static get watchers(){return{collapsed:["watchHandler"]}}};m.style="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:300ms}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;background-color:transparent;pointer-events:none;--calcite-shell-panel-detached-max-height:unset}::slotted(calcite-panel),::slotted(calcite-flow){-ms-flex:1 1 auto;flex:1 1 auto;height:100%;width:100%;max-height:unset;max-width:unset}::slotted(.calcite-match-height){display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;overflow:hidden}.content{-ms-flex-align:stretch;align-items:stretch;-ms-flex-item-align:stretch;align-self:stretch;background-color:var(--calcite-ui-background);display:-ms-flexbox;display:flex;padding:0;pointer-events:auto;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:var(--calcite-shell-panel-width);max-width:var(--calcite-shell-panel-max-width);min-width:var(--calcite-shell-panel-min-width);-webkit-transition:max-height 150ms ease-in-out, max-width 150ms ease-in-out;transition:max-height 150ms ease-in-out, max-width 150ms ease-in-out}.content__header{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:stretch;align-items:stretch}.content__body{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;overflow:hidden}:host([width-scale=s]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 12vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 300px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 150px)}:host([width-scale=m]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 20vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 420px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 240px)}:host([width-scale=l]) .content{--calcite-shell-panel-width:calc(var(--calcite-panel-width-multiplier) * 45vw);--calcite-shell-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 680px);--calcite-shell-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 340px)}:host([detached-height-scale=s]) .content--detached{--calcite-shell-panel-detached-max-height:40vh}:host([detached-height-scale=m]) .content--detached{--calcite-shell-panel-detached-max-height:60vh}:host([detached-height-scale=l]) .content--detached{--calcite-shell-panel-detached-max-height:80vh}.content--detached{border-radius:0.25rem;-webkit-box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);box-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);height:auto;overflow:hidden;margin-top:0.5rem;margin-bottom:auto;margin-left:0.5rem;margin-right:0.5rem;max-height:var(--calcite-shell-panel-detached-max-height)}.content--detached ::slotted(calcite-panel),.content--detached ::slotted(calcite-flow){max-height:unset}.content[hidden]{display:none}:host([position=start]) slot[name=action-bar]::slotted(calcite-action-bar){border-right-width:1px;border-right-color:var(--calcite-ui-border-3);border-right-style:solid}:host([position=end]) slot[name=action-bar]::slotted(calcite-action-bar){border-left-width:1px;border-left-color:var(--calcite-ui-border-3);border-left-style:solid}";export{s as calcite_shell,c as calcite_shell_center_row,m as calcite_shell_panel}
|
/* eslint-disable prefer-arrow-callback,no-var,space-before-function-paren */
test('load localhost', async () => {
jest.setTimeout(30000)
await browser.url('/src/browserstack/page.html')
await browser.getUrl()
if (needPolyfill) {
await browser.execute(function(url) {
if (!window.__addScript__) {
console.error('no __addScript__', document.title)
return
}
window.__addScript__(url)
}, `/node_modules/@babel/polyfill/dist/polyfill.js`)
await new Promise(rs => setTimeout(rs, 1000))
}
await browser.execute(function(url) {
if (!window.__addScript__) {
console.error('no __addScript__', document.title)
return
}
window.__addScript__(url)
}, `/npm/effector/${libraryFile}.js`)
await new Promise(rs => setTimeout(rs, 500))
await browser.execute(function() {
if (!window.__runCode__) {
console.error('no __runCode__', document.title)
return
}
window.__runCode__(function() {
if (!window.effector) return
var createStore = window.effector.createStore
/*prettier-ignore*/
var store = createStore({
message: 'hello',
isError: false
})
store.watch(function(state) {
window.__setText__(state.message, state.isError)
})
/*prettier-ignore*/
store.setState({
message: 'effector works as expected',
isError: false
})
})
})
await new Promise(rs => setTimeout(rs, 500))
const results = await browser.execute(function() {
var logs = window.__errorLogs__
window.__errorLogs__ = []
return logs
})
expect(results).toEqual([])
})
|
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var task_icons_component_1 = require("./task-icons.component");
var task_tooltip_directive_1 = require("./task-tooltip.directive");
var shared_1 = require("../shared/shared");
var TasksComponent = (function () {
function TasksComponent(tasksService, settingsService) {
this.tasksService = tasksService;
this.settingsService = settingsService;
this.tasks = [];
this.tasks = this.tasksService.taskStore;
this.today = new Date();
this.queueHeaderMapping = settingsService.pluralsMap.tasks;
this.timerMinutes = settingsService.timerMinutes;
}
TasksComponent.prototype.ngOnInit = function () {
this.updateQueuedTomatoes();
};
TasksComponent.prototype.toggleTask = function (task) {
task.queued = !task.queued;
this.updateQueuedTomatoes();
};
TasksComponent.prototype.updateQueuedTomatoes = function () {
this.queuedTomatoes = this.tasks
.filter(function (task) { return task.queued; })
.reduce(function (tomatoes, queuedTask) {
return tomatoes + queuedTask.tomatoRequired;
}, 0);
};
return TasksComponent;
}());
TasksComponent = __decorate([
core_1.Component({
selector: 'tomato-tasks',
entryComponents: [task_icons_component_1.default, task_tooltip_directive_1.default, shared_1.SHARED_PIPES],
styleUrls: ['/app/tasks/tasks.component.css'],
templateUrl: '/app/tasks/tasks.component.html'
}),
__metadata("design:paramtypes", [shared_1.TaskService,
shared_1.SettingsService])
], TasksComponent);
exports.default = TasksComponent;
|
/**
* The Jira Cloud platform REST API
* Jira Cloud platform REST API documentation
*
* The version of the OpenAPI document: 1001.0.0-SNAPSHOT
* Contact: ecosystem@atlassian.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.Jira);
}
}(this, function(expect, Jira) {
'use strict';
var instance;
beforeEach(function() {
instance = new Jira.FieldConfigurationSchemeProjectAssociation();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('FieldConfigurationSchemeProjectAssociation', function() {
it('should create an instance of FieldConfigurationSchemeProjectAssociation', function() {
// uncomment below and update the code to test FieldConfigurationSchemeProjectAssociation
//var instane = new Jira.FieldConfigurationSchemeProjectAssociation();
//expect(instance).to.be.a(Jira.FieldConfigurationSchemeProjectAssociation);
});
it('should have the property fieldConfigurationSchemeId (base name: "fieldConfigurationSchemeId")', function() {
// uncomment below and update the code to test the property fieldConfigurationSchemeId
//var instane = new Jira.FieldConfigurationSchemeProjectAssociation();
//expect(instance).to.be();
});
it('should have the property projectId (base name: "projectId")', function() {
// uncomment below and update the code to test the property projectId
//var instane = new Jira.FieldConfigurationSchemeProjectAssociation();
//expect(instance).to.be();
});
});
}));
|
"use strict";
import GameManager from "./GameManager.js"
/*
Необходим для связи всех кораблей при создании и расстановке.
Создает матрицу на основе всех кораблей.
*/
export default class ShipList
{
constructor()
{
if (ShipList.__instance) {
return ShipList.__instance;
}
this.listShip = [];
ShipList.__instance = this;
}
getShip(i)
{
return this.listShip[i];
}
getTurnShip (i)
{
return (this.getShip(i)).getTurn();
}
setShip(ship, i)
{
this.listShip[i] = ship;
}
setShipLiveField (i, field)
{
(this.getShip(i)).setLiveField(field);
}
setTurnShip (i, turn)
{
(this.getShip(i)).setTurn(turn);
}
canDoMatrix ()
{
for (let i = 0; i < this.listShip.length; i++) {
let ship = this.getShip(i);
if (!(ship.getLive().length)) {
return false;
}
}
return true;
}
CreateMatrix(rand)
{
if (rand) {
let gameManager = new GameManager();
if(!gameManager.getGame()) {
return [1, 0, 0, 0, 6, 6, 0, 0, 7, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
0, 0, 0, 5, 5, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 10, 0, 0, 0, 0, 0, 2, 0, 0,
0, 10, 0, 0, 8, 0, 0, 0, 0, 0,
0, 10, 0, 0, 8, 0, 0, 0, 0, 0,
0, 10, 0, 0, 8, 0, 0, 9, 9, 9,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
}
else {
return this.createRandomMatrix();
}
}
let matrixShips = [];
for (let i = 0; i < 100; i++) {
matrixShips[i] = 0;
}
for (let i = 0; i < this.listShip.length; i++) {
let ship = this.getShip(i);
let liveShip = ship.getLive();
for (let j = 0; j < liveShip.length; j++) {
matrixShips[(+liveShip[j][0]) * 10 + (+liveShip[j][2])] = i+1; // поле в матрице = id корабля
}
}
return matrixShips;
}
createShipArray (rand = 0)
{
let shipArray = [];
if (rand) {
let gameManager = new GameManager();
let ships = gameManager.getRandomResponse();
for (let i = 0; i < ships.length; i++) {
let ship = {};
ship.length = ships[i].length;
ship.isVertical = ships[i].isVertical;
ship.rowPos = ships[i].rowPos;
ship.colPos = ships[i].colPos;
shipArray[i] = ship;
}
}
else {
for (let i = 0; i < 10; i++) {
let ship = {};
ship.length = this.getShip(i).getSize();
ship.isVertical = (this.getTurnShip(i)) ? true : false;
ship.rowPos = +((this.getShip(i).getLive())[0][0]);
ship.colPos = +((this.getShip(i).getLive())[0][2]);
shipArray[i] = ship;
}
}
return shipArray;
}
clearList()
{
this.listShip = [];
}
createRandomMatrix()
{
let gameManager = new GameManager();
let ships = gameManager.getRandomResponse();
let matrixShips = [];
for (let i = 0; i < 100; i++) {
matrixShips[i] = 0;
}
for (let i = 0; i < ships.length; i++) {
let ship = ships[i];
for (let j = 0; j < ship.cells.length; j++) {
matrixShips[(+ship.cells[j].rowPos) * 10 + (+ship.cells[j].colPos)] = i+1; // поле в матрице = id корабля
}
}
return matrixShips;
}
}
|
import React, { useCallback, useState } from 'react';
import { useEffect } from 'react';
import { FiXCircle } from 'react-icons/fi';
import { useAxios } from '../../services/api';
import { Search, TagContainer, TagButton } from './style';
const TagSelector = ({ selectedTags, setSelectedTags }) => {
const { data: tags, mutate } = useAxios('/tags?limit=200');
const [unchosenTags, setUnchosenTags] = useState();
useEffect(() => {
if (selectedTags && tags) {
const res = tags.filter((tag) => {
selectedTags.some((selected) => {
return selected.id === tag.id;
});
return !selectedTags.some((selected) => {
return selected.id === tag.id;
});
});
setUnchosenTags(res);
} else {
setUnchosenTags(tags);
}
}, [selectedTags, tags]);
const handleSelectCategory = useCallback(
(id) => {
id = Number(id);
if (!id || selectedTags.some((tag) => tag.id === id)) {
return;
}
const selectedTag = tags.find((t) => {
return t.id === id;
});
setSelectedTags([...selectedTags, selectedTag]);
const updatedTags = tags.filter((tag) => tag.id !== id);
mutate(updatedTags, false);
},
[mutate, selectedTags, setSelectedTags, tags],
);
const handleDeleteCategory = useCallback(
(id) => {
id = Number(id);
const updatedTags = unchosenTags;
const newTags = selectedTags.filter((t) => {
if (t.id === id) {
updatedTags.push(t);
return false;
}
return true;
});
setSelectedTags(newTags);
mutate(updatedTags, false);
},
[mutate, selectedTags, setSelectedTags, unchosenTags],
);
return (
<>
<Search>
<select
onChange={(e) => handleSelectCategory(e.target.value)}
name="tags"
id="tags"
className="select-form"
>
<option value="">Selecione as categorias</option>
{unchosenTags
? unchosenTags.map((item) => (
<option key={item.id} value={item.id}>
{item.description}
</option>
))
: 'Carregando'}
</select>
</Search>
<TagContainer>
{selectedTags.map((item) => (
<TagButton
onClick={() => {
handleDeleteCategory(item.id);
}}
key={item.id}
>
<span>{item.description}</span>
<FiXCircle size={18} color="#fff" />
</TagButton>
))}
</TagContainer>
</>
);
};
export default TagSelector;
|
import React from 'react'
const Team = () => {
return (
<div>
Team Page
</div>
)
}
export default Team
|
i18n.setKeys({
"General.Elasticsearch": "Elasticsearch",
"General.LoadingAggs": "Gruplar Yükleniyor...",
"General.Searching": "Aranıyor...",
"General.Search": "Ara",
"General.Help": "Yardım",
"General.HelpGlyph": "?",
"General.CloseGlyph": "X",
"General.RefreshResults": "Yenile",
"General.ManualRefresh": "Manuel Yenileme",
"General.RefreshQuickly": "Hızlı yenile",
"General.Refresh5seconds": "5 saniyede bir yenile",
"General.Refresh1minute": "Her dakika yenile",
"AliasForm.AliasName": "Alternatif İsim",
"AliasForm.NewAliasForIndex": "{0} için yeni alternatif isim",
"AliasForm.DeleteAliasMessage": "{1} silmek için ''{0}'' . Geriye dönüş yoktur.",
"AnyRequest.DisplayOptions" : "Seçenekleri Göster",
"AnyRequest.AsGraph" : "Sonuçları Çizdir",
"AnyRequest.AsJson" : "JSON formatında göster",
"AnyRequest.AsTable" : "Arama sonuçlarını tablo halinde göster",
"AnyRequest.History" : "Geçmiş",
"AnyRequest.RepeatRequest" : "İsteği Tekrarla",
"AnyRequest.RepeatRequestSelect" : "İsteği sürekli tekrarla ",
"AnyRequest.Transformer" : "Sonuç Dönüştürücü",
"AnyRequest.Pretty": "Düzenli",
"AnyRequest.Query" : "Sorgu",
"AnyRequest.Request": "Gönder",
"AnyRequest.Requesting": "İsteniyor...",
"AnyRequest.ValidateJSON": "JSON Doğrula",
"Browser.Title": "Browser",
"Browser.ResultSourcePanelTitle": "Sonuç Kaynağı",
"Command.DELETE": "SİL",
"Command.SHUTDOWN": "KAPA",
"Command.DeleteAliasMessage": "Alternatif ismi sil?",
"ClusterOverView.IndexName": "Indeks İsmi",
"ClusterOverview.NumShards": "Sektör Sayısı",
"ClusterOverview.NumReplicas": "Yedek Sayısı",
"ClusterOverview.NewIndex": "Yeni Indeks",
"IndexActionsMenu.Title": "İşlemler",
"IndexActionsMenu.NewAlias": "Yeni Alternatif İsim...",
"IndexActionsMenu.Refresh": "Yenile",
"IndexActionsMenu.Flush": "Boşalt",
"IndexActionsMenu.Optimize": "Optimize et...",
"IndexActionsMenu.ForceMerge": "ForceMerge et...",
"IndexActionsMenu.Snapshot": "Gateway Snapshot (Kopya Al)",
"IndexActionsMenu.Analyser": "Analizi test et",
"IndexActionsMenu.Open": "Aç",
"IndexActionsMenu.Close": "Kapa",
"IndexActionsMenu.Delete": "Sil...",
"IndexInfoMenu.Title": "Bilgi",
"IndexInfoMenu.Status": "Indeks Durumu",
"IndexInfoMenu.Metadata": "Indeks Metaveri",
"IndexCommand.TextToAnalyze": "Analiz edilecek metin",
"IndexCommand.ShutdownMessage": "{1} kapatmak için ''{0}'' yazın . Nod bu arayüzden tekrar BAŞLATILAMAZ",
"IndexOverview.PageTitle": "Indeksler Genel Bakış",
"IndexSelector.NameWithDocs": "{0} ({1} döküman)",
"IndexSelector.SearchIndexForDocs": "{0} indeksinde ara:",
"FilterBrowser.OutputType": "Sonuç Formatı: {0}",
"FilterBrowser.OutputSize": "Sonuç Sayısı: {0}",
"Header.ClusterHealth": "Küme Durumu: {0} ({1} de {2})",
"Header.ClusterNotConnected": "Küme Durumu: Bağlı Değil",
"Header.Connect": "Bağlan",
"Nav.AnyRequest": "Özel Sorgu",
"Nav.Browser": "Görüntüle",
"Nav.ClusterHealth": "Küme Durumu",
"Nav.ClusterState": "Küme Statüsü",
"Nav.ClusterNodes": "Nod Bilgileri",
"Nav.Info": "Bilgi",
"Nav.NodeStats": "Nod İstatistikleri",
"Nav.Overview": "Genel Bakış",
"Nav.Indices": "Indeksler",
"Nav.Plugins": "Eklentiler",
"Nav.Status": "Indeks İstatistikleri",
"Nav.Templates": "Şablonlar",
"Nav.StructuredQuery": "Yapılandırılmış Sorgu",
"NodeActionsMenu.Title": "İşlemler",
"NodeActionsMenu.Shutdown": "Kapat...",
"NodeInfoMenu.Title": "Bilgi",
"NodeInfoMenu.ClusterNodeInfo": "Küme Nod Bilgileri",
"NodeInfoMenu.NodeStats": "Nod İstatistikleri",
"NodeType.Client": "Client Nod",
"NodeType.Coord": "Coordinator",
"NodeType.Master": "Master Nod",
"NodeType.Tribe": "Tribe Nod",
"NodeType.Worker": "Worker Nod",
"NodeType.Unassigned": "Sahipsiz",
"OptimizeForm.OptimizeIndex": "{0} Optimize Et",
"OptimizeForm.MaxSegments": "Maksimum Segment Sayısı",
"OptimizeForm.ExpungeDeletes": "Silme İşlemi Artıklarını Temizle",
"OptimizeForm.FlushAfter": "Optimize Ettikten Sonra Boşalt",
"OptimizeForm.WaitForMerge": "Birleştirme İçin Bekle",
"ForceMergeForm.ForceMergeIndex": "{0} ForceMerge Et",
"ForceMergeForm.MaxSegments": "Maksimum Segment Sayısı",
"ForceMergeForm.ExpungeDeletes": "Silme İşlemi Artıklarını Temizle",
"ForceMergeForm.FlushAfter": "ForceMerge Ettikten Sonra Boşalt",
"ForceMergeForm.WaitForMerge": "Birleştirme İçin Bekle",
"Overview.PageTitle" : "Kümeler Genelbakış",
"Output.JSON": "JSON",
"Output.Table": "Tablo",
"Output.CSV": "CSV",
"Output.ShowSource": "Sorgu kaynağını göster",
"Preference.SortCluster": "Kümeyi Sırala",
"Sort.ByName": "İsme göre",
"Sort.ByAddress": "Adrese göre",
"Sort.ByType": "Tipe göre",
"Preference.SortIndices": "Indeksleri sırala",
"SortIndices.Descending": "Azalan",
"SortIndices.Ascending": "Artan",
"Preference.ViewAliases": "Alternatif isimleri görüntüle",
"ViewAliases.Grouped": "Gruplanmış",
"ViewAliases.List": "Liste",
"ViewAliases.None": "Karışık",
"Overview.IndexFilter": "Indeks Filtresi",
"TableResults.Summary": "{0} parçanın {1} tanesi arandı. {2} sonuç. {3} saniye",
"QueryFilter.AllIndices": "Tüm Indeksler",
"QueryFilter.AnyValue": "herhangi",
"QueryFilter-Header-Indices": "Indeksler",
"QueryFilter-Header-Types": "Tipler",
"QueryFilter-Header-Fields": "Alanlar",
"QueryFilter.DateRangeHint.from": "{0}'dan",
"QueryFilter.DateRangeHint.to": " {0}'a",
"Query.FailAndUndo": "Sorgu Başarısız. Son değişiklikler geri alınıyor.",
"StructuredQuery.ShowRawJson": "Formatsız JSON göster"
});
i18n.setKeys({
"AnyRequest.TransformerHelp" : "\
<p>Sonuç Dönüştürücü sorgudan dönen JSON sonuçlarını işleyip daha kullanışlı bir formata dönüştürmek için kullanılabilir.</p>\
<p>Dönüştürücü içierisinde javascript fonksiyonu tanımlanmalıdır. Bu fonksiyondan dönen yeni sonuç çıktı kısmına yazdırılır.</p>\
<p>Örnek:<br>\
<code>return root.hits.hits[0];</code> sonucu dolaşarak ilk eşleşmeyi göster<br>\
<code>return Object.keys(root.nodes).reduce(function(tot, node) { return tot + root.nodes[node].os.mem.used_in_bytes; }, 0);</code> tüm kümede kullanılan toplam belleği gösterir<br></p>\
<p>Aşağıdaki fonksiyonlar dizi ve objelerin işlenmesinde yardımcı olması için kullanılabilir<br>\
<ul>\
<li><i>Object.keys</i>(object) := array</li>\
<li>array.<i>forEach</i>(function(prop, index))</li>\
<li>array.<i>map</i>(function(prop, index)) := array</li>\
<li>array.<i>reduce</i>(function(accumulator, prop, index), initial_value) := final_value</li>\
</ul>\
<p>Sorgu tekrarlama çalışırken, prev isimli ekstra bir parametre dönüştürücü fonksiyonuna verilir. Bu sayede karşılaştırmalar ve toplu grafik gösterimleri yapılabilir.</p>\
<p>Örnek:<br>\
<code>var la = [ root.nodes[Object.keys(root.nodes)[0]].os.load_average[0] ]; return prev ? la.concat(prev) : la;</code> önceki dakika boyunca kümede bulunan ilk nod üzerindeki averaj yükü verir.\
Bu sonuç nod için yük grafiği yaratılmasında kullanılabilir.\
"
});
i18n.setKeys({
"AnyRequest.DisplayOptionsHelp" : "\
<p>Sade Json: Sorgunun tüm sonuçlarını ve (yapıldıysa) dönüştürüldükten sonraki halini sade JSON formatında gösterir </p>\
<p>Sonuçları Çizdir: Sonuçları grafiksel olarak görüntülemek için sonuç dörücüyü kullanarak değerleri dizi haline getirin.</p>\
<p>Arama Sonuçları Tablosu: Eğer sorgunuz bir arama ise, sonuçları bir tabloda görüntüleyebilirsiniz.</p>\
"
});
i18n.setKeys({
"QueryFilter.DateRangeHelp" : "\
<p>Tarih alanları ana dile yakın kelimeler kullanarak iki tarih aralığında sorgu yapılabilmesini sağlar.</p>\
<p>Aşağıdaki tanımlar kullanılabilir:</p>\
<ul>\
<li><b>Anahtar Kelimeler</b><br>\
<code>now<br> today<br> tomorrow<br> yesterday<br> last / this / next + week / month / year</code><br>\
kelimeleri eşleşen tarihleri verir. Örneğin <code>last year</code> geçen yıl tarihli bütün verileri döndürür.</li>\
<li><b>Aralıklar</b><br>\
<code>1000 secs<br> 5mins<br> 1day<br> 2days<br> 80d<br> 9 months<br> 2yrs</code> (boşluklar isteğe bağlıdır, ayni kelime için farklı yazım şekilleri kullanılabilir)<br>\
Şu anki tarihi (<code>now</code>) baz alarak geçmiş veya ileriki bir tarih aralığındaki kayıtları verir.</li>\
<li><b>Tarih ve Kısmi Tarihler</b><br>\
<code>2011<br> 2011-01<br> 2011-01-18<br> 2011-01-18 12<br> 2011-01-18 12:32<br> 2011-01-18 12:32:45</code><br>\
bu formatlar spesifik bir tarihi tanımlarlar. <code>2011</code> tüm 2011 yılını ararken, <code>2011-01-18 12:32:45</code> şeklinde bir sorgu sadece o saniyedeki sonuçları verir.</li>\
<li><b>Zaman ve Kısmi Zamanlar</b><br>\
<code>12<br> 12:32<br> 12:32:45</code><br>\
bu formatlar gün içerisinde spesifik bir zamanı tanımlarlar. Örneğin <code>12:32</code> sadece bu saat ve dakikadaki kayıtları verir.</li>\
<li><b>Tarih Aralıkları</b><br>\
<code>2010 -> 2011<br> last week -> next week<br> 2011-05 -><br> < now</code><br>\
Tarih aralıkları yukarda belirtilen herhangi bir formatı < or -> ile ayırarak yapılabilir. Eğer aralığın bir tarafı eksikse, sorgu ucu açıkmış gibi davranır.</li>\
<li><b>Ofsetli Tarih Aralığı</b><br>\
<code>2010 -> 1yr<br> 3mins < now</code>\
Verilen yöndeki tarih aralığına bakar.</li>\
<li><b>Çakılı Aralıklar</b><br>\
<code>2010-05-13 05:13 <> 10m<br> now <> 1yr<br> lastweek <> 1month</code><br>\
Yukarıdakiyle ayni fakat belirtilen tarihten her iki yöne de bakılır.</li>\
</ul>\
"
});
|
const fs = require('fs')
const path = require('path')
const fb = require('@functional-bitcoin/agent')
const forge = require('node-forge')
const axios = require('axios')
const { NodeVM } = require('vm2')
fb.config.adapter.key = 'test'
const agent = new fb.Agent({
transforms: {
'19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut': '5f94a325c835ac0fcc89370061c6a63b305b2c6cf3d2fe002d264e98dbd44ac2'
},
sandbox: {
axios,
forge,
bitdb: { key: fb.config.adapter.key }
}
})
createTestScript = (name, args = [], opts = {}) => {
// Load function
const file = `${ name }.js`,
filePath = path.join(process.cwd(), 'src', file),
fn = fs.readFileSync(filePath, 'utf8');
// Build arguments
args = args.map(arg => Buffer.from(arg))
// Init script
script = new fb.Script({ txid: 'TEST', ctx: opts.ctx, agent })
script.stack = [
{ cmd: name, fn: agent._vm.run(fn, file), args }
]
return script
}
|
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');
const { Output } = require('../util/Output.js');
const Emailer = require('../util/Emailer.js');
/**
* Create a user.
*/
function post(req, res) {
var o = new Output(res);
// Input
var { email, password, name, type } = req.body;
if ([email, password, name, type].some(a => a === undefined))
return o.err('MISSING_POST').out();
// Validate input.
if (!email || email.lenth > 100 || (email.match(/@/g) || []).length != 1)
return o.err('INVALID_INPUT', 'Invalid email.').out();
if (password.length < 6 || password.length > 50)
return o.err('INVALID_INPUT', 'Invalid password.').out();
if (name.length < 2 || name.length > 50)
return o.err('INVALID_INPUT', 'Invalid name.').out();
if (![1, 2].includes(type)) // Can only create students/intructors.
return o.err('INVALID_INPUT', 'Invalid type.').out();
email = email.toLowerCase();
// Email in use?
var User = mongoose.model('User');
User.findOne({ 'email': email }, function (err, result) {
if (err) return o.err('DATABASE').out();
else if (result) return o.err('EMAIL_TAKEN').out();
else {
// Hash password.
const SALT_ROUNDS = 10;
const PASSWORD = 'TreelBcryptPassword';
bcrypt.genSalt(SALT_ROUNDS, function(err, salt) {
bcrypt.hash(password, salt, function(err, passwordHash) {
// Create user, login, and output.
newUser = new User({ email, passwordHash, name, type });
newUser.save(function (err, newUser) {
if (err) return o.err('DATABASE').out();
o.set('user', newUser).out();
return createVerification(o, newUser);
});
});
});
}
});
}
// Create a Verification and send email.
function createVerification(o, user) {
// Generate unique code.
let time = new Date().valueOf().toString(36).substring(2),
rand = Math.random().toString(36).substring(5),
code = time + rand;
let Verification = mongoose.model('Verification'),
v = new Verification({ user, code });
v.isVerified = false;
v.save((err, savedV) => {
Emailer.sendVerification(user.email, savedV.code);
});
}
module.exports = { post };
|
var stringifier = Object.prototype.toString
module.exports = isError
function isError(value) {
return stringifier.call(value) === "[object Error]"
}
|
var THREEx = THREEx || {}
//////////////////////////////////////////////////////////////////////////////////
// Constructor //
//////////////////////////////////////////////////////////////////////////////////
/**
* create a dynamic texture with a underlying canvas
*
* @param {Number} width width of the canvas
* @param {Number} height height of the canvas
*/
THREEx.DynamicTexture = function(width, height){
var canvas = document.createElement( 'canvas' )
canvas.width = width
canvas.height = height
this.canvas = canvas
var context = canvas.getContext( '2d' )
this.context = context
var texture = new THREE.Texture(canvas)
this.texture = texture;
//this.texture.minFilter = THREE.Linear;
//this.texture.magFilter = THREE.Linear;
this.texture.anisotropy = 2;
}
//////////////////////////////////////////////////////////////////////////////////
// methods //
//////////////////////////////////////////////////////////////////////////////////
/**
* clear the canvas
*
* @param {String*} fillStyle the fillStyle to clear with, if not provided, fallback on .clearRect
* @return {THREEx.DynamicTexture} the object itself, for chained texture
*/
THREEx.DynamicTexture.prototype.clear = function(fillStyle){
// depends on fillStyle
if( fillStyle !== undefined ){
this.context.fillStyle = fillStyle
this.context.fillRect(0,0,this.canvas.width, this.canvas.height)
}else{
this.context.clearRect(0,0,this.canvas.width, this.canvas.height)
}
// make the texture as .needsUpdate
this.texture.needsUpdate = true;
// for chained API
return this;
}
/**
* draw text
*
* @param {String} text the text to display
* @param {Number|undefined} x if provided, it is the x where to draw, if not, the text is centered
* @param {Number} y the y where to draw the text
* @param {String*} fillStyle the fillStyle to clear with, if not provided, fallback on .clearRect
* @param {String*} contextFont the font to use
* @return {THREEx.DynamicTexture} the object itself, for chained texture
*/
THREEx.DynamicTexture.prototype.drawText = function(text, x, y, fillStyle, contextFont){
// set font if needed
if( contextFont !== undefined ) this.context.font = contextFont;
// if x isnt provided
if( x === undefined || x === null ){
var textSize = this.context.measureText(text);
x = (this.canvas.width - textSize.width) / 2;
}
// actually draw the text
this.context.fillStyle = fillStyle;
this.context.fillText(text, x, y);
// make the texture as .needsUpdate
this.texture.needsUpdate = true;
// for chained API
return this;
};
THREEx.DynamicTexture.prototype.drawTextCooked = function(text, options){
var context = this.context
var canvas = this.canvas
options = options || {}
var params = {
margin : options.margin !== undefined ? options.margin : 0.1,
lineHeight : options.lineHeight !== undefined ? options.lineHeight : 0.1,
align : options.align !== undefined ? options.align : 'left',
fillStyle : options.fillStyle !== undefined ? options.fillStyle : 'black',
}
context.save()
context.fillStyle = params.fillStyle;
var y = (params.lineHeight + params.margin)*canvas.height
while(text.length > 0 ){
// compute the text for specifically this line
var maxText = computeMaxTextLength(text)
// update the remaining text
text = text.substr(maxText.length)
// compute x based on params.align
var textSize = context.measureText(maxText);
if( params.align === 'left' ){
var x = params.margin*canvas.width
}else if( params.align === 'right' ){
var x = (1-params.margin)*canvas.width - textSize.width
}else if( params.align === 'center' ){
var x = (canvas.width - textSize.width) / 2;
}else console.assert( false )
// actually draw the text at the proper position
this.context.fillText(maxText, x, y);
// goto the next line
y += params.lineHeight*canvas.height
}
context.restore()
// make the texture as .needsUpdate
this.texture.needsUpdate = true;
// for chained API
return this;
function computeMaxTextLength(text){
var maxText = ''
var maxWidth = (1-params.margin*2)*canvas.width
while( maxText.length !== text.length ){
var textSize = context.measureText(maxText);
if( textSize.width > maxWidth ) break;
maxText += text.substr(maxText.length, 1)
}
return maxText
}
}
/**
* execute the drawImage on the internal context
* the arguments are the same the official context2d.drawImage
*/
THREEx.DynamicTexture.prototype.drawImage = function(/* same params as context2d.drawImage */){
// call the drawImage
this.context.drawImage.apply(this.context, arguments)
// make the texture as .needsUpdate
this.texture.needsUpdate = true;
// for chained API
return this;
}
|
import { HtmlTemplate } from "./HtmlTemplate.js";
import { parseTimeAsTotalMinutes } from "./datetime.js";
export class ScheduleItem {
constructor(data, localStarStorage) {
this.id = data.id;
this.tracks = data.tracks;
this.localStarStorage = localStarStorage;
scheduleItemTemplate = new HtmlTemplate("schedule-item");
this.element = this.scheduleItemTemplate.createElement(data);
this.starredClass = "starred";
if (localStarStorage.isStarred(this.id)) {
this.element.classList.add(this.starredClass);
}
this.initializeElementClass();
this.initializeElementPosition(data.start, data.end);
this.addStarClickEventHandler();
}
initializeElementClass() {
if (this.isInTrack(1) && this.isInTrack(2)) {
this.element.classList.add("both-tracks");
} else if (this.isInTrack(1)) {
this.element.classList.add("track-1");
} else if (this.isInTrack(2)) {
this.element.classList.add("track-2");
}
}
initializeElementPosition(start, end) {
const startTimeInMinutes = parseTimeAsTotalMinutes(start);
const endTimeInMinutes = parseTimeAsTotalMinutes(end);
const pixelsPerMinute = 2;
const conferenceStartTimeInMinutes = 8 * 60 + 30;
this.element.style.top = pixelsPerMinute * (startTimeInMinutes - conferenceStartTimeInMinutes) + "px";
this.element.style.height = pixelsPerMinute * (endTimeInMinutes - startTimeInMinutes) + "px";
}
addStarClickEventHandler() {
const starElement = this.element.querySelector(".star");
starElement.addEventListener("click", this.toggleStar.bind(this), false);
}
isInTrack(track) {
return this.tracks.indexOf(track) >= 0;
}
toggleStar() {
if (this.isStarred()) {
this.unsetStar();
} else {
this.setStar();
}
}
isStarred() {
return this.element.classList.contains(this.starredClass);
}
unsetStar() {
this.element.classList.remove(this.starredClass);
this.postStarChange(false);
this.localStarStorage.removeStar(this.id);
}
setStar() {
this.element.classList.add(this.starredClass);
this.postStarChange(true);
this.localStarStorage.addStar(this.id);
}
async postStarChange(isStarred) {
const headers = new Headers({
"Content-Type": "application/x-www-form-urlencoded"
})
const options = {
method: 'POST',
headers: headers,
body: "starred=" + isStarred
}
const response = await fetch("/schedule/star/" + this.id, options);
if (isStarred) {
if (response.ok) {
const data = await response.json();
this.updateStarCount(data.starCount);
if (data.starCount > 50)
alert("This session is very popular! Be sure to arrive early to get a seat.");
}
}
}
updateStarCount(starCount) {
const starCountElement = this.element.querySelector(".star-count");
starCountElement.textContent = starCount.toString();
}
show() {
this.element.style.display = "block";
}
hide() {
this.element.style.display = "none";
}
}
|
var searchData=
[
['d',['d',['../classplanning_1_1Spline.html#a5472a964ebb6926770a9c8d0fbb0f3b4',1,'planning::Spline']]],
['default_5fclang_5fformat_5fignore',['DEFAULT_CLANG_FORMAT_IGNORE',['../namespacerun-clang-format.html#ab748f2f9864ae4e0e025c7699e02ede4',1,'run-clang-format']]],
['default_5fextensions',['DEFAULT_EXTENSIONS',['../namespacerun-clang-format.html#ad72ad57feffc8a7b6d4b6c1ef7115834',1,'run-clang-format']]],
['devnull',['DEVNULL',['../namespacerun-clang-format.html#a97e5d03a54579dfe424174c7d8d30839',1,'run-clang-format']]],
['diff',['DIFF',['../classrun-clang-format_1_1ExitStatus.html#a0dde1d7ffb4451ddc403acd8c8b2470f',1,'run-clang-format::ExitStatus']]]
];
|
/**
* Copyright IBM Corp. 2016, 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.
*/
var _20 = {
"elem": "svg",
"attrs": {
"xmlns": "http://www.w3.org/2000/svg",
"viewBox": "0 0 32 32",
"fill": "currentColor",
"width": 20,
"height": 20
},
"content": [{
"elem": "circle",
"attrs": {
"cx": "23",
"cy": "25",
"r": "1"
}
}, {
"elem": "path",
"attrs": {
"d": "M26 22v6H6V22H26m0-2H6a2 2 0 00-2 2v6a2 2 0 002 2H26a2 2 0 002-2V22a2 2 0 00-2-2zM20.59 4.59L17 8.17 17 0 15 0 15 8.17 11.41 4.59 10 6 16 12 22 6 20.59 4.59z"
}
}, {
"elem": "path",
"attrs": {
"d": "M20.59 10.59L16 15.16 11.41 10.59 10 12 16 18 22 12 20.59 10.59zM8 24H20V26H8z"
}
}],
"name": "launch-study--3",
"size": 20
};
export default _20;
|
/*!
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
/**
* Controller to save mail smtp settings
*/
(function () {
angular.module('piwikApp').controller('BrandingController', BrandingController);
BrandingController.$inject = ['$scope', 'piwikApi'];
function BrandingController($scope, piwikApi) {
var self = this;
this.isLoading = false;
function refreshCustomLogo() {
var selectors = ['#currentLogo', '#currentFavicon'];
var index;
for (index = 0; index < selectors.length; index++) {
var imageDiv = $(selectors[index]);
if (imageDiv && imageDiv.data("src") && imageDiv.data("srcExists")) {
var logoUrl = imageDiv.data("src");
imageDiv.attr("src", logoUrl + "?" + (new Date()).getTime());
imageDiv.show();
} else {
imageDiv.hide();
}
}
}
this.updateLogo = function () {
var isSubmittingLogo = (this.customLogo != undefined && this.customLogo != '');
var isSubmittingFavicon = (this.customFavicon != undefined && this.customFavicon != '');
if (!isSubmittingLogo && !isSubmittingFavicon) {
return;
}
var $uploadError = $('.uploaderror');
$uploadError.fadeOut();
var frameName = "upload" + (new Date()).getTime();
var uploadFrame = $("<iframe name=\"" + frameName + "\" />");
uploadFrame.css("display", "none");
uploadFrame.load(function (data) {
setTimeout(function () {
var frameContent = $(uploadFrame.contents()).find('body').html();
frameContent = $.trim(frameContent);
if ('0' === frameContent) {
$uploadError.show();
} else {
// Upload succeed, so we update the images availability
// according to what have been uploaded
if (isSubmittingLogo) {
$('#currentLogo').data("srcExists", true);
}
if (isSubmittingFavicon) {
$('#currentFavicon').data("srcExists", true);
}
refreshCustomLogo();
}
if ('1' === frameContent || '0' === frameContent) {
uploadFrame.remove();
}
}, 1000);
});
$("body:first").append(uploadFrame);
var submittingForm = $('#logoUploadForm');
submittingForm.attr("target", frameName);
submittingForm.submit();
this.customLogo = '';
this.customFavicon = '';
};
refreshCustomLogo();
this.toggleCustomLogo = function () {
refreshCustomLogo();
};
this.save = function () {
this.isLoading = true;
piwikApi.post({module: 'API', method: 'CoreAdminHome.setBrandingSettings'}, {
useCustomLogo: this.enabled ? '1' : '0'
}).then(function (success) {
self.isLoading = false;
var UI = require('piwik/UI');
var notification = new UI.Notification();
notification.show(_pk_translate('CoreAdminHome_SettingsSaveSuccess'), {
id: 'generalSettings', context: 'success'
});
notification.scrollToNotification();
}, function () {
self.isLoading = false;
});
};
}
})();
|
module.exports = ['090-####-####', '080-####-####', '070-####-####'];
|
import { URLSearchParams } from 'url';
import axios from 'axios';
import config from 'config';
import debugLib from 'debug';
import jwt from 'jsonwebtoken';
import { get } from 'lodash';
import errors from '../../lib/errors';
import stripe from '../../lib/stripe';
import { addParamsToUrl } from '../../lib/utils';
import models from '../../models';
import creditcard from './creditcard';
const debug = debugLib('stripe');
const AUTHORIZE_URI = 'https://connect.stripe.com/oauth/authorize';
const TOKEN_URI = 'https://connect.stripe.com/oauth/token';
/* eslint-disable camelcase */
const getToken = code => () =>
axios
.post(TOKEN_URI, {
grant_type: 'authorization_code',
client_id: config.stripe.clientId,
client_secret: config.stripe.secret,
code,
})
.then(res => res.data);
/* eslint-enable camelcase */
const getAccountInformation = data => {
return new Promise((resolve, reject) => {
return stripe.accounts.retrieve(data.stripe_user_id, (err, account) => {
if (err) {
return reject(err);
}
data.account = account;
return resolve(data);
});
});
};
export default {
// payment method types
// like cc, btc, etc.
types: {
default: creditcard,
creditcard,
},
oauth: {
// Returns the redirectUrl to connect the Stripe Account to the Host Collective Id
redirectUrl: (remoteUser, CollectiveId, query) => {
// Since we pass the redirectUrl in clear to the frontend, we cannot pass the CollectiveId in the state query variable
// It would be trivial to change that value and attach a Stripe Account to someone else's collective
// That's why we encode the state in a JWT
const state = jwt.sign(
{
CollectiveId,
CreatedByUserId: remoteUser.id,
redirect: query.redirect,
},
config.keys.opencollective.jwtSecret,
{
expiresIn: '45m', // People may need some time to set up their Stripe Account if they don't have one already
},
);
/* eslint-disable camelcase */
const params = new URLSearchParams({
response_type: 'code',
scope: 'read_write',
client_id: config.stripe.clientId,
redirect_uri: config.stripe.redirectUri,
state,
});
/* eslint-enable camelcase */
return Promise.resolve(`${AUTHORIZE_URI}?${params.toString()}`);
},
// callback called by Stripe after the user approves the connection
callback: (req, res, next) => {
let state, collective;
debug('req.query', JSON.stringify(req.query, null, ' '));
try {
state = jwt.verify(req.query.state, config.keys.opencollective.jwtSecret);
} catch (e) {
return next(new errors.BadRequest(`Invalid JWT: ${e.message}`));
}
debug('state', state);
const { CollectiveId, CreatedByUserId, redirect } = state;
if (!CollectiveId) {
return next(new errors.BadRequest('No state in the callback'));
}
let redirectUrl = redirect;
const createStripeAccount = data =>
models.ConnectedAccount.create({
service: 'stripe',
CollectiveId,
CreatedByUserId,
username: data.stripe_user_id,
token: data.access_token,
refreshToken: data.refresh_token,
data: {
publishableKey: data.stripe_publishable_key,
tokenType: data.token_type,
scope: data.scope,
account: data.account,
},
});
/**
* Update the Host Collective
* with the default currency of the bank account connected to the stripe account and legal address
* @param {*} connectedAccount
*/
const updateHost = async connectedAccount => {
if (!connectedAccount) {
console.error('>>> updateHost: error: no connectedAccount');
}
const { account } = connectedAccount.data;
if (!collective.address && account.legal_entity) {
const { address } = account.legal_entity;
const addressLines = [address.line1];
if (address.line2) {
addressLines.push(address.line2);
}
if (address.country === 'US') {
addressLines.push(`${address.city} ${address.state} ${address.postal_code}`);
} else if (address.country === 'UK') {
addressLines.push(`${address.city} ${address.postal_code}`);
} else {
addressLines.push(`${address.postal_code} ${address.city}`);
}
addressLines.push(address.country);
collective.address = addressLines.join('\n');
}
// Adds the opencollective payment method to enable the host to allocate funds to collectives
// Note that it's not expected anymore to connect Stripe if you're not an host
await collective.becomeHost();
await collective.setCurrency(account.default_currency.toUpperCase());
collective.timezone = collective.timezone || account.timezone;
return collective.save();
};
return models.Collective.findByPk(CollectiveId)
.then(c => {
collective = c;
redirectUrl = redirectUrl || `${config.host.website}/${collective.slug}`;
})
.then(getToken(req.query.code))
.then(getAccountInformation)
.then(createStripeAccount)
.then(updateHost)
.then(() => {
redirectUrl = addParamsToUrl(redirectUrl, {
message: 'StripeAccountConnected',
CollectiveId: collective.id,
});
debug('redirectUrl', redirectUrl);
return res.redirect(redirectUrl);
})
.catch(e => {
if (get(e, 'data.error_description')) {
return next(new errors.BadRequest(e.data.error_description));
} else {
return next(e);
}
});
},
},
processOrder: order => {
switch (order.paymentMethod.type) {
case 'bitcoin':
throw new errors.BadRequest('Stripe-Bitcoin not supported anymore :(');
case 'creditcard': /* Fallthrough */
default:
return creditcard.processOrder(order);
}
},
webhook: requestBody => {
// Stripe sends test events to production as well
// don't do anything if the event is not livemode
// NOTE: not using config.env because of ugly tests
if (process.env.OC_ENV === 'production' && !requestBody.livemode) {
return Promise.resolve();
}
/**
* We check the event on stripe directly to be sure we don't get a fake event from
* someone else
*/
return stripe.events.retrieve(requestBody.id, { stripeAccount: requestBody.user_id }).then(event => {
if (!event || (event && !event.type)) {
throw new errors.BadRequest('Event not found');
}
if (event.type === 'invoice.payment_succeeded') {
return creditcard.webhook(requestBody, event);
} else if (event.type === 'source.chargeable') {
/* This will cause stripe to send us email alerts, saying
* that our stuff is broken. But that should never happen
* since they discontinued the support. */
throw new errors.BadRequest('Stripe-Bitcoin not supported anymore :(');
} else {
throw new errors.BadRequest('Wrong event type received');
}
});
},
};
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkId = exports.checkInteger = exports.checkString = exports.match = exports.asyncCheckInRange = exports.checkInRange = exports.checkEmail = exports.checkNumber = exports.asyncCompare = exports.compare = exports.checkBoolean = exports.checkArray = exports.checkRequiredValue = exports.asyncSetDefaultValue = exports.setDefaultValue = exports.asyncFilter = exports.filter = exports.asyncValidate = exports.validate = void 0;
const _ = require("lodash");
const filter_validator_1 = require("./validators/filter-validator");
const async_filter_validator_1 = require("./validators/async-filter-validator");
const default_value_validator_1 = require("./validators/default-value-validator");
const async_default_value_validator_1 = require("./validators/async-default-value-validator");
const required_validator_1 = require("./validators/required-validator");
const array_validator_1 = require("./validators/array-validator");
const boolean_validator_1 = require("./validators/boolean-validator");
const compare_validator_1 = require("./validators/compare-validator");
const async_compare_validator_1 = require("./validators/async-compare-validator");
const number_validator_1 = require("./validators/number-validator");
const email_validator_1 = require("./validators/email-validator");
const range_validator_1 = require("./validators/range-validator");
const async_range_validator_1 = require("./validators/async-range-validator");
const regular_expression_validator_1 = require("./validators/regular-expression-validator");
const string_validator_1 = require("./validators/string-validator");
var validator_1 = require("./validator");
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validator_1.validate; } });
var async_validator_1 = require("./async-validator");
Object.defineProperty(exports, "asyncValidate", { enumerable: true, get: function () { return async_validator_1.validate; } });
exports.filter = filter_validator_1.FilterValidator.validate;
exports.asyncFilter = async_filter_validator_1.AsyncFilterValidator.validate;
exports.setDefaultValue = default_value_validator_1.DefaultValueValidator.validate;
exports.asyncSetDefaultValue = async_default_value_validator_1.AsyncDefaultValueValidator.validate;
exports.checkRequiredValue = required_validator_1.RequiredValidator.validateValue;
exports.checkArray = array_validator_1.ArrayValidator.validateValue;
exports.checkBoolean = boolean_validator_1.BooleanValidator.validateValue;
exports.compare = compare_validator_1.CompareValidator.validateValue;
exports.asyncCompare = async_compare_validator_1.AsyncCompareValidator.validateValue;
exports.checkNumber = number_validator_1.NumberValidator.validateValue;
exports.checkEmail = email_validator_1.EmailValidator.validateValue;
exports.checkInRange = range_validator_1.RangeValidator.validateValue;
exports.asyncCheckInRange = async_range_validator_1.AsyncRangeValidator.validateValue;
exports.match = regular_expression_validator_1.RegularExpressionValidator.validateValue;
exports.checkString = string_validator_1.StringValidator.validateValue;
const checkInteger = function (value, variableName, options) {
options = options || {};
if (_.isPlainObject(variableName)) {
options = variableName;
variableName = undefined;
}
options = _.extend(options, {
integerOnly: true
});
return number_validator_1.NumberValidator.validateValue(value, variableName, options);
};
exports.checkInteger = checkInteger;
const checkId = function (value, variableName, options) {
options = options || {};
if (_.isPlainObject(variableName)) {
options = variableName;
variableName = undefined;
}
options = _.extend(options, {
integerOnly: true,
min: 1,
tooSmall: '{attribute} must be correct id.'
});
return number_validator_1.NumberValidator.validateValue(value, variableName, options);
};
exports.checkId = checkId;
|
var React = require('react');
function AboveGame() {
return (
<div className="above-game">
<p className="game-intro">Join the numbers and get to the <strong>2048 tile!</strong></p>
<a className="restart-button">New Game</a>
</div>
);
}
module.exports = AboveGame;
|
import React from 'react';
import ReactDOM from 'react-dom';
import App from './Components/App';
import * as serviceWorker from './serviceWorker';
import Axios from "axios";
import '../css/404.css';
import '../css/app.css';
window.laravel.csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
window.laravel.user = JSON.parse(window.laravel.user);
window.axios = Axios;
window.axios.defaults.baseURL = window.laravel.env.baseUrl+'/api/v1';
window.axios.defaults.headers.common = {
'X-CSRF-TOKEN': window.laravel.csrfToken,
'X-Requested-With': 'XMLHttpRequest',
'Authorization' : 'Bearer '+ window.laravel.user.api_token,
'Accept' : 'application/json'
};
ReactDOM.render(<App />, document.getElementById('app'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
|
/**
* ReactDOMFiber v16.0.0-alpha.2
*/
;(function(f) {
// CommonJS
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = f(require('react'));
// RequireJS
} else if (typeof define === "function" && define.amd) {
define(['react'], f);
// <script>
} else {
var g;
if (typeof window !== "undefined") {
g = window;
} else if (typeof global !== "undefined") {
g = global;
} else if (typeof self !== "undefined") {
g = self;
} else {
// works providing we're not in "use strict";
// needed for Java 8 Nashorn
// see https://github.com/facebook/react/issues/3037
g = this;
}
g.ReactDOMFiber = f(g.React);
}
})(function(React) {
return (function(f){return f()})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,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;
},{}],2:[function(_dereq_,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 EventPropagators = _dereq_(14);
var ExecutionEnvironment = _dereq_(120);
var FallbackCompositionState = _dereq_(15);
var SyntheticCompositionEvent = _dereq_(79);
var SyntheticInputEvent = _dereq_(83);
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;
},{"120":120,"14":14,"15":15,"79":79,"83":83}],3:[function(_dereq_,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;
},{}],4:[function(_dereq_,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 CSSProperty = _dereq_(3);
var ExecutionEnvironment = _dereq_(120);
var camelizeStyleName = _dereq_(122);
var dangerousStyleValue = _dereq_(94);
var getComponentName = _dereq_(98);
var hyphenateStyleName = _dereq_(130);
var memoizeStringOnly = _dereq_(134);
var warning = _dereq_(138);
if ("development" !== 'production') {
var _require = _dereq_(38),
getCurrentFiberOwnerName = _require.getCurrentFiberOwnerName;
}
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 ("development" !== '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;
"development" !== '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;
"development" !== '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;
"development" !== '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;
"development" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
};
var checkRenderMessage = function (owner) {
var ownerName;
if (owner != null) {
// Stack passes the owner manually all the way to CSSPropertyOperations.
ownerName = getComponentName(owner);
} else {
// Fiber doesn't pass it but uses ReactDebugCurrentFiber to track it.
// It is only enabled in development and tracks host components too.
ownerName = getCurrentFiberOwnerName();
// TODO: also report the stack.
}
if (ownerName) {
return '\n\nCheck the render method of `' + ownerName + '`.';
}
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 ("development" !== '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) {
var style = node.style;
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
if ("development" !== '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;
},{"120":120,"122":122,"130":130,"134":134,"138":138,"3":3,"38":38,"94":94,"98":98}],5:[function(_dereq_,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 EventPluginHub = _dereq_(11);
var EventPropagators = _dereq_(14);
var ExecutionEnvironment = _dereq_(120);
var ReactControlledComponent = _dereq_(20);
var ReactDOMComponentTree = _dereq_(24);
var ReactGenericBatching = _dereq_(61);
var SyntheticEvent = _dereq_(81);
var inputValueTracking = _dereq_(108);
var getEventTarget = _dereq_(103);
var isEventSupported = _dereq_(109);
var isTextInputElement = _dereq_(110);
var eventTypes = {
change: {
phasedRegistrationNames: {
bubbled: 'onChange',
captured: 'onChangeCapture'
},
dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
}
};
function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, target);
event.type = 'change';
// Flag this event loop as needing state restore.
ReactControlledComponent.enqueueStateRestore(target);
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
/**
* For IE shims
*/
var activeElement = null;
var activeElementInst = 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 = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
// 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.
ReactGenericBatching.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 getInstIfValueChanged(targetInst) {
if (inputValueTracking.updateValueIfChanged(targetInst)) {
return targetInst;
}
}
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.
isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
}
/**
* (For IE <=9) 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;
activeElement.attachEvent('onpropertychange', handlePropertyChange);
}
/**
* (For IE <=9) Removes the event listeners from the currently-tracked element,
* if any exists.
*/
function stopWatchingForValueChange() {
if (!activeElement) {
return;
}
activeElement.detachEvent('onpropertychange', handlePropertyChange);
activeElement = null;
activeElementInst = null;
}
/**
* (For IE <=9) 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;
}
if (getInstIfValueChanged(activeElementInst)) {
manualDispatchChangeEvent(nativeEvent);
}
}
function handleEventsForInputEventPolyfill(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, 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 getTargetInstForInputEventPolyfill(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.
return getInstIfValueChanged(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.
var nodeName = elem.nodeName;
return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}
function getTargetInstForClickEvent(topLevelType, targetInst) {
if (topLevelType === 'topClick') {
return getInstIfValueChanged(targetInst);
}
}
function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
if (topLevelType === 'topInput' || topLevelType === 'topChange') {
return getInstIfValueChanged(targetInst);
}
}
/**
* 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,
_isInputEventSupported: isInputEventSupported,
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 = getTargetInstForInputOrChangeEvent;
} else {
getTargetInstFunc = getTargetInstForInputEventPolyfill;
handleEventFunc = handleEventsForInputEventPolyfill;
}
} else if (shouldUseClickEvent(targetNode)) {
getTargetInstFunc = getTargetInstForClickEvent;
}
if (getTargetInstFunc) {
var inst = getTargetInstFunc(topLevelType, targetInst);
if (inst) {
var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(topLevelType, targetNode, targetInst);
}
}
};
module.exports = ChangeEventPlugin;
},{"103":103,"108":108,"109":109,"11":11,"110":110,"120":120,"14":14,"20":20,"24":24,"61":61,"81":81}],6:[function(_dereq_,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 DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
module.exports = DOMEventPluginOrder;
},{}],7:[function(_dereq_,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;
},{}],8:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var invariant = _dereq_(131);
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) ? "development" !== '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) ? "development" !== '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 ("development" !== 'production') {
DOMProperty.getPossibleStandardName[lowerCased] = propName;
}
if (DOMAttributeNames.hasOwnProperty(propName)) {
var attributeName = DOMAttributeNames[propName];
propertyInfo.attributeName = attributeName;
if ("development" !== '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: "development" !== '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;
},{"112":112,"131":131}],9:[function(_dereq_,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 DOMProperty = _dereq_(8);
var ReactDOMComponentTree = _dereq_(24);
var ReactInstrumentation = _dereq_(65);
var quoteAttributeValueForBrowser = _dereq_(111);
var warning = _dereq_(138);
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;
"development" !== '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)) {
DOMPropertyOperations.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 ("development" !== '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 ("development" !== '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 ("development" !== '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 ("development" !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'remove attribute',
payload: name
});
}
}
};
module.exports = DOMPropertyOperations;
},{"111":111,"138":138,"24":24,"65":65,"8":8}],10:[function(_dereq_,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 EventPropagators = _dereq_(14);
var ReactDOMComponentTree = _dereq_(24);
var SyntheticMouseEvent = _dereq_(85);
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;
},{"14":14,"24":24,"85":85}],11:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var EventPluginRegistry = _dereq_(12);
var EventPluginUtils = _dereq_(13);
var ReactErrorUtils = _dereq_(41);
var accumulateInto = _dereq_(91);
var forEachAccumulated = _dereq_(97);
var invariant = _dereq_(131);
/**
* 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);
};
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
},
/**
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @return {?function} The stored callback.
*/
getListener: function (inst, registrationName) {
var listener;
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
// live here; needs to be moved to a better place soon
if (typeof inst.tag === 'number') {
var props = EventPluginUtils.getFiberCurrentPropsFromNode(inst.stateNode);
if (!props) {
// Work in progress.
return null;
}
listener = props[registrationName];
if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
return null;
}
} else {
if (typeof inst._currentElement === 'string') {
// Text node, let it bubble through.
return null;
}
var _props = inst._currentElement.props;
listener = _props[registrationName];
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, _props)) {
return null;
}
}
!(!listener || typeof listener === 'function') ? "development" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
return listener;
},
/**
* 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 ? "development" !== '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();
}
};
module.exports = EventPluginHub;
},{"112":112,"12":12,"13":13,"131":131,"41":41,"91":91,"97":97}],12:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var invariant = _dereq_(131);
/**
* 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) ? "development" !== '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 ? "development" !== '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) ? "development" !== '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) ? "development" !== '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.
*
* @param {string} registrationName Registration name to add.
* @param {object} PluginModule Plugin publishing the event.
* @private
*/
function publishRegistrationName(registrationName, pluginModule, eventName) {
!!EventPluginRegistry.registrationNameModules[registrationName] ? "development" !== '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 ("development" !== '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: "development" !== '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 ? "development" !== '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] ? "development" !== '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 ("development" !== 'production') {
var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
for (var lowerCasedName in possibleRegistrationNames) {
if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
delete possibleRegistrationNames[lowerCasedName];
}
}
}
}
};
module.exports = EventPluginRegistry;
},{"112":112,"131":131}],13:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var ReactErrorUtils = _dereq_(41);
var invariant = _dereq_(131);
var warning = _dereq_(138);
/**
* Injected dependencies:
*/
/**
* - `ComponentTree`: [required] Module that can convert between React instances
* and actual node references.
*/
var ComponentTree;
var injection = {
injectComponentTree: function (Injected) {
ComponentTree = Injected;
if ("development" !== 'production') {
"development" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : 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 ("development" !== '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;
"development" !== '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 ("development" !== '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 ("development" !== '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 ("development" !== 'production') {
validateEventDispatches(event);
}
var dispatchListener = event._dispatchListeners;
var dispatchInstance = event._dispatchInstances;
!!Array.isArray(dispatchListener) ? "development" !== '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,
getFiberCurrentPropsFromNode: function (node) {
return ComponentTree.getFiberCurrentPropsFromNode(node);
},
getInstanceFromNode: function (node) {
return ComponentTree.getInstanceFromNode(node);
},
getNodeFromInstance: function (node) {
return ComponentTree.getNodeFromInstance(node);
},
injection: injection
};
module.exports = EventPluginUtils;
},{"112":112,"131":131,"138":138,"41":41}],14:[function(_dereq_,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 EventPluginHub = _dereq_(11);
var ReactTreeTraversal = _dereq_(71);
var accumulateInto = _dereq_(91);
var forEachAccumulated = _dereq_(97);
var warning = _dereq_(138);
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 ("development" !== 'production') {
"development" !== '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) {
ReactTreeTraversal.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 ? ReactTreeTraversal.getParentInstance(targetInst) : null;
ReactTreeTraversal.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) {
ReactTreeTraversal.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 even a
* single one.
*
* @constructor EventPropagators
*/
var EventPropagators = {
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
accumulateDirectDispatches: accumulateDirectDispatches,
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
};
module.exports = EventPropagators;
},{"11":11,"138":138,"71":71,"91":91,"97":97}],15:[function(_dereq_,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 _assign = _dereq_(139);
var PooledClass = _dereq_(17);
var getTextContentAccessor = _dereq_(106);
/**
* 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;
},{"106":106,"139":139,"17":17}],16:[function(_dereq_,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 DOMProperty = _dereq_(8);
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,
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,
// support for projecting regular DOM Elements via V1 named slots ( shadow dom )
slot: 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: {}
};
module.exports = HTMLDOMPropertyConfig;
},{"8":8}],17:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var invariant = _dereq_(131);
/**
* 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) ? "development" !== '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;
},{"112":112,"131":131}],18:[function(_dereq_,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 _assign = _dereq_(139);
var EventPluginRegistry = _dereq_(12);
var ReactEventEmitterMixin = _dereq_(42);
var ViewportMetrics = _dereq_(90);
var getVendorPrefixedEventName = _dereq_(107);
var isEventSupported = _dereq_(109);
/**
* 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',
topCancel: 'cancel',
topCanPlay: 'canplay',
topCanPlayThrough: 'canplaythrough',
topChange: 'change',
topClick: 'click',
topClose: 'close',
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',
topToggle: 'toggle',
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]];
}
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 (dependency === 'topCancel') {
if (isEventSupported('cancel', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topCancel', 'cancel', mountAt);
}
isListening.topCancel = true;
} else if (dependency === 'topClose') {
if (isEventSupported('close', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topClose', 'close', mountAt);
}
isListening.topClose = true;
} else if (topEventMapping.hasOwnProperty(dependency)) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
}
isListening[dependency] = true;
}
}
},
isListeningToAllDependencies: function (registrationName, mountAt) {
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])) {
return false;
}
}
return 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;
},{"107":107,"109":109,"12":12,"139":139,"42":42,"90":90}],19:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var REACT_ELEMENT_TYPE = _dereq_(40);
var _require = _dereq_(22),
REACT_COROUTINE_TYPE = _require.REACT_COROUTINE_TYPE,
REACT_YIELD_TYPE = _require.REACT_YIELD_TYPE;
var _require2 = _dereq_(67),
REACT_PORTAL_TYPE = _require2.REACT_PORTAL_TYPE;
var ReactFiber = _dereq_(45);
var ReactTypeOfSideEffect = _dereq_(72);
var ReactTypeOfWork = _dereq_(73);
var emptyObject = _dereq_(125);
var getIteratorFn = _dereq_(104);
var invariant = _dereq_(131);
var ReactFeatureFlags = _dereq_(44);
var ReactCurrentOwner = _dereq_(117);
if ("development" !== 'production') {
var _require3 = _dereq_(38),
getCurrentFiberStackAddendum = _require3.getCurrentFiberStackAddendum;
var _require4 = _dereq_(59),
getComponentName = _require4.getComponentName;
var warning = _dereq_(138);
var didWarnAboutMaps = false;
}
var cloneFiber = ReactFiber.cloneFiber,
createFiberFromElement = ReactFiber.createFiberFromElement,
createFiberFromFragment = ReactFiber.createFiberFromFragment,
createFiberFromText = ReactFiber.createFiberFromText,
createFiberFromCoroutine = ReactFiber.createFiberFromCoroutine,
createFiberFromYield = ReactFiber.createFiberFromYield,
createFiberFromPortal = ReactFiber.createFiberFromPortal;
var isArray = Array.isArray;
var FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
ClassComponent = ReactTypeOfWork.ClassComponent,
HostText = ReactTypeOfWork.HostText,
HostPortal = ReactTypeOfWork.HostPortal,
CoroutineComponent = ReactTypeOfWork.CoroutineComponent,
YieldComponent = ReactTypeOfWork.YieldComponent,
Fragment = ReactTypeOfWork.Fragment;
var NoEffect = ReactTypeOfSideEffect.NoEffect,
Placement = ReactTypeOfSideEffect.Placement,
Deletion = ReactTypeOfSideEffect.Deletion;
function coerceRef(current, element) {
var mixedRef = element.ref;
if (mixedRef !== null && typeof mixedRef !== 'function') {
if (element._owner) {
var owner = element._owner;
var inst = void 0;
if (owner) {
if (typeof owner.tag === 'number') {
var ownerFiber = owner;
!(ownerFiber.tag === ClassComponent) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
inst = ownerFiber.stateNode;
} else {
// Stack
inst = owner.getPublicInstance();
}
}
!inst ? "development" !== 'production' ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : _prodInvariant('155', mixedRef) : void 0;
var stringRef = String(mixedRef);
// Check if previous string ref matches new string ref
if (current !== null && current.ref !== null && current.ref._stringRef === stringRef) {
return current.ref;
}
var ref = function (value) {
var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
if (value === null) {
delete refs[stringRef];
} else {
refs[stringRef] = value;
}
};
ref._stringRef = stringRef;
return ref;
}
}
return mixedRef;
}
function throwOnInvalidObjectType(returnFiber, newChild) {
if (returnFiber.type !== 'textarea') {
var childrenString = String(newChild);
var addendum = '';
if ("development" !== '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.';
var owner = ReactCurrentOwner.owner || returnFiber._debugOwner;
if (owner && typeof owner.tag === 'number') {
var name = getComponentName(owner);
if (name) {
addendum += '\n\nCheck the render method of `' + name + '`.';
}
}
}
!false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : childrenString, addendum) : void 0;
}
}
// This wrapper function exists because I expect to clone the code in each path
// to be able to optimize each path individually by branching early. This needs
// a compiler or we can do it manually. Helpers that don't need this branching
// live outside of this function.
function ChildReconciler(shouldClone, shouldTrackSideEffects) {
function deleteChild(returnFiber, childToDelete) {
if (!shouldTrackSideEffects) {
// Noop.
return;
}
if (!shouldClone) {
// When we're reconciling in place we have a work in progress copy. We
// actually want the current copy. If there is no current copy, then we
// don't need to track deletion side-effects.
if (childToDelete.alternate === null) {
return;
}
childToDelete = childToDelete.alternate;
}
// Deletions are added in reversed order so we add it to the front.
var last = returnFiber.progressedLastDeletion;
if (last !== null) {
last.nextEffect = childToDelete;
returnFiber.progressedLastDeletion = childToDelete;
} else {
returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete;
}
childToDelete.nextEffect = null;
childToDelete.effectTag = Deletion;
}
function deleteRemainingChildren(returnFiber, currentFirstChild) {
if (!shouldTrackSideEffects) {
// Noop.
return null;
}
// TODO: For the shouldClone case, this could be micro-optimized a bit by
// assuming that after the first child we've already added everything.
var childToDelete = currentFirstChild;
while (childToDelete !== null) {
deleteChild(returnFiber, childToDelete);
childToDelete = childToDelete.sibling;
}
return null;
}
function mapRemainingChildren(returnFiber, currentFirstChild) {
// Add the remaining children to a temporary map so that we can find them by
// keys quickly. Implicit (null) keys get added to this set with their index
var existingChildren = new Map();
var existingChild = currentFirstChild;
while (existingChild !== null) {
if (existingChild.key !== null) {
existingChildren.set(existingChild.key, existingChild);
} else {
existingChildren.set(existingChild.index, existingChild);
}
existingChild = existingChild.sibling;
}
return existingChildren;
}
function useFiber(fiber, priority) {
// We currently set sibling to null and index to 0 here because it is easy
// to forget to do before returning it. E.g. for the single child case.
if (shouldClone) {
var clone = cloneFiber(fiber, priority);
clone.index = 0;
clone.sibling = null;
return clone;
} else {
// We override the pending priority even if it is higher, because if
// we're reconciling at a lower priority that means that this was
// down-prioritized.
fiber.pendingWorkPriority = priority;
fiber.effectTag = NoEffect;
fiber.index = 0;
fiber.sibling = null;
return fiber;
}
}
function placeChild(newFiber, lastPlacedIndex, newIndex) {
newFiber.index = newIndex;
if (!shouldTrackSideEffects) {
// Noop.
return lastPlacedIndex;
}
var current = newFiber.alternate;
if (current !== null) {
var oldIndex = current.index;
if (oldIndex < lastPlacedIndex) {
// This is a move.
newFiber.effectTag = Placement;
return lastPlacedIndex;
} else {
// This item can stay in place.
return oldIndex;
}
} else {
// This is an insertion.
newFiber.effectTag = Placement;
return lastPlacedIndex;
}
}
function placeSingleChild(newFiber) {
// This is simpler for the single child case. We only need to do a
// placement for inserting new children.
if (shouldTrackSideEffects && newFiber.alternate === null) {
newFiber.effectTag = Placement;
}
return newFiber;
}
function updateTextNode(returnFiber, current, textContent, priority) {
if (current === null || current.tag !== HostText) {
// Insert
var created = createFiberFromText(textContent, priority);
created['return'] = returnFiber;
return created;
} else {
// Update
var existing = useFiber(current, priority);
existing.pendingProps = textContent;
existing['return'] = returnFiber;
return existing;
}
}
function updateElement(returnFiber, current, element, priority) {
if (current === null || current.type !== element.type) {
// Insert
var created = createFiberFromElement(element, priority);
created.ref = coerceRef(current, element);
created['return'] = returnFiber;
return created;
} else {
// Move based on index
var existing = useFiber(current, priority);
existing.ref = coerceRef(current, element);
existing.pendingProps = element.props;
existing['return'] = returnFiber;
if ("development" !== 'production') {
existing._debugSource = element._source;
existing._debugOwner = element._owner;
}
return existing;
}
}
function updateCoroutine(returnFiber, current, coroutine, priority) {
// TODO: Should this also compare handler to determine whether to reuse?
if (current === null || current.tag !== CoroutineComponent) {
// Insert
var created = createFiberFromCoroutine(coroutine, priority);
created['return'] = returnFiber;
return created;
} else {
// Move based on index
var existing = useFiber(current, priority);
existing.pendingProps = coroutine;
existing['return'] = returnFiber;
return existing;
}
}
function updateYield(returnFiber, current, yieldNode, priority) {
if (current === null || current.tag !== YieldComponent) {
// Insert
var created = createFiberFromYield(yieldNode, priority);
created.type = yieldNode.value;
created['return'] = returnFiber;
return created;
} else {
// Move based on index
var existing = useFiber(current, priority);
existing.type = yieldNode.value;
existing['return'] = returnFiber;
return existing;
}
}
function updatePortal(returnFiber, current, portal, priority) {
if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {
// Insert
var created = createFiberFromPortal(portal, priority);
created['return'] = returnFiber;
return created;
} else {
// Update
var existing = useFiber(current, priority);
existing.pendingProps = portal.children || [];
existing['return'] = returnFiber;
return existing;
}
}
function updateFragment(returnFiber, current, fragment, priority) {
if (current === null || current.tag !== Fragment) {
// Insert
var created = createFiberFromFragment(fragment, priority);
created['return'] = returnFiber;
return created;
} else {
// Update
var existing = useFiber(current, priority);
existing.pendingProps = fragment;
existing['return'] = returnFiber;
return existing;
}
}
function createChild(returnFiber, newChild, priority) {
if (typeof newChild === 'string' || typeof newChild === 'number') {
// Text nodes doesn't have keys. If the previous node is implicitly keyed
// we can continue to replace it without aborting even if it is not a text
// node.
var created = createFiberFromText('' + newChild, priority);
created['return'] = returnFiber;
return created;
}
if (typeof newChild === 'object' && newChild !== null) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE:
{
var _created = createFiberFromElement(newChild, priority);
_created.ref = coerceRef(null, newChild);
_created['return'] = returnFiber;
return _created;
}
case REACT_COROUTINE_TYPE:
{
var _created2 = createFiberFromCoroutine(newChild, priority);
_created2['return'] = returnFiber;
return _created2;
}
case REACT_YIELD_TYPE:
{
var _created3 = createFiberFromYield(newChild, priority);
_created3.type = newChild.value;
_created3['return'] = returnFiber;
return _created3;
}
case REACT_PORTAL_TYPE:
{
var _created4 = createFiberFromPortal(newChild, priority);
_created4['return'] = returnFiber;
return _created4;
}
}
if (isArray(newChild) || getIteratorFn(newChild)) {
var _created5 = createFiberFromFragment(newChild, priority);
_created5['return'] = returnFiber;
return _created5;
}
throwOnInvalidObjectType(returnFiber, newChild);
}
return null;
}
function updateSlot(returnFiber, oldFiber, newChild, priority) {
// Update the fiber if the keys match, otherwise return null.
var key = oldFiber !== null ? oldFiber.key : null;
if (typeof newChild === 'string' || typeof newChild === 'number') {
// Text nodes doesn't have keys. If the previous node is implicitly keyed
// we can continue to replace it without aborting even if it is not a text
// node.
if (key !== null) {
return null;
}
return updateTextNode(returnFiber, oldFiber, '' + newChild, priority);
}
if (typeof newChild === 'object' && newChild !== null) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE:
{
if (newChild.key === key) {
return updateElement(returnFiber, oldFiber, newChild, priority);
} else {
return null;
}
}
case REACT_COROUTINE_TYPE:
{
if (newChild.key === key) {
return updateCoroutine(returnFiber, oldFiber, newChild, priority);
} else {
return null;
}
}
case REACT_YIELD_TYPE:
{
// Yields doesn't have keys. If the previous node is implicitly keyed
// we can continue to replace it without aborting even if it is not a
// yield.
if (key === null) {
return updateYield(returnFiber, oldFiber, newChild, priority);
} else {
return null;
}
}
case REACT_PORTAL_TYPE:
{
if (newChild.key === key) {
return updatePortal(returnFiber, oldFiber, newChild, priority);
} else {
return null;
}
}
}
if (isArray(newChild) || getIteratorFn(newChild)) {
// Fragments doesn't have keys so if the previous key is implicit we can
// update it.
if (key !== null) {
return null;
}
return updateFragment(returnFiber, oldFiber, newChild, priority);
}
throwOnInvalidObjectType(returnFiber, newChild);
}
return null;
}
function updateFromMap(existingChildren, returnFiber, newIdx, newChild, priority) {
if (typeof newChild === 'string' || typeof newChild === 'number') {
// Text nodes doesn't have keys, so we neither have to check the old nor
// new node for the key. If both are text nodes, they match.
var matchedFiber = existingChildren.get(newIdx) || null;
return updateTextNode(returnFiber, matchedFiber, '' + newChild, priority);
}
if (typeof newChild === 'object' && newChild !== null) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE:
{
var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
return updateElement(returnFiber, _matchedFiber, newChild, priority);
}
case REACT_COROUTINE_TYPE:
{
var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
return updateCoroutine(returnFiber, _matchedFiber2, newChild, priority);
}
case REACT_YIELD_TYPE:
{
// Yields doesn't have keys, so we neither have to check the old nor
// new node for the key. If both are yields, they match.
var _matchedFiber3 = existingChildren.get(newIdx) || null;
return updateYield(returnFiber, _matchedFiber3, newChild, priority);
}
case REACT_PORTAL_TYPE:
{
var _matchedFiber4 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
return updatePortal(returnFiber, _matchedFiber4, newChild, priority);
}
}
if (isArray(newChild) || getIteratorFn(newChild)) {
var _matchedFiber5 = existingChildren.get(newIdx) || null;
return updateFragment(returnFiber, _matchedFiber5, newChild, priority);
}
throwOnInvalidObjectType(returnFiber, newChild);
}
return null;
}
function warnOnDuplicateKey(child, knownKeys) {
if ("development" !== 'production') {
if (typeof child !== 'object' || child === null) {
return knownKeys;
}
switch (child.$$typeof) {
case REACT_ELEMENT_TYPE:
case REACT_COROUTINE_TYPE:
case REACT_PORTAL_TYPE:
var key = child.key;
if (typeof key !== 'string') {
break;
}
if (knownKeys === null) {
knownKeys = new Set();
knownKeys.add(key);
break;
}
if (!knownKeys.has(key)) {
knownKeys.add(key);
break;
}
"development" !== 'production' ? warning(false, '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', key, getCurrentFiberStackAddendum()) : void 0;
break;
default:
break;
}
}
return knownKeys;
}
function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, priority) {
// This algorithm can't optimize by searching from boths ends since we
// don't have backpointers on fibers. I'm trying to see how far we can get
// with that model. If it ends up not being worth the tradeoffs, we can
// add it later.
// Even with a two ended optimization, we'd want to optimize for the case
// where there are few changes and brute force the comparison instead of
// going for the Map. It'd like to explore hitting that path first in
// forward-only mode and only go for the Map once we notice that we need
// lots of look ahead. This doesn't handle reversal as well as two ended
// search but that's unusual. Besides, for the two ended optimization to
// work on Iterables, we'd need to copy the whole set.
// In this first iteration, we'll just live with hitting the bad case
// (adding everything to a Map) in for every insert/move.
// If you change this code, also update reconcileChildrenIterator() which
// uses the same algorithm.
if ("development" !== 'production') {
// First, validate keys.
var knownKeys = null;
for (var i = 0; i < newChildren.length; i++) {
var child = newChildren[i];
knownKeys = warnOnDuplicateKey(child, knownKeys);
}
}
var resultingFirstChild = null;
var previousNewFiber = null;
var oldFiber = currentFirstChild;
var lastPlacedIndex = 0;
var newIdx = 0;
var nextOldFiber = null;
for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
if (oldFiber.index > newIdx) {
nextOldFiber = oldFiber;
oldFiber = null;
} else {
nextOldFiber = oldFiber.sibling;
}
var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], priority);
if (newFiber === null) {
// TODO: This breaks on empty slots like null children. That's
// unfortunate because it triggers the slow path all the time. We need
// a better way to communicate whether this was a miss or null,
// boolean, undefined, etc.
if (oldFiber === null) {
oldFiber = nextOldFiber;
}
break;
}
if (shouldTrackSideEffects) {
if (oldFiber && newFiber.alternate === null) {
// We matched the slot, but we didn't reuse the existing fiber, so we
// need to delete the existing child.
deleteChild(returnFiber, oldFiber);
}
}
lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
// TODO: Move out of the loop. This only happens for the first run.
resultingFirstChild = newFiber;
} else {
// TODO: Defer siblings if we're not at the right index for this slot.
// I.e. if we had null values before, then we want to defer this
// for each null value. However, we also don't want to call updateSlot
// with the previous one.
previousNewFiber.sibling = newFiber;
}
previousNewFiber = newFiber;
oldFiber = nextOldFiber;
}
if (newIdx === newChildren.length) {
// We've reached the end of the new children. We can delete the rest.
deleteRemainingChildren(returnFiber, oldFiber);
return resultingFirstChild;
}
if (oldFiber === null) {
// If we don't have any more existing children we can choose a fast path
// since the rest will all be insertions.
for (; newIdx < newChildren.length; newIdx++) {
var _newFiber = createChild(returnFiber, newChildren[newIdx], priority);
if (!_newFiber) {
continue;
}
lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
// TODO: Move out of the loop. This only happens for the first run.
resultingFirstChild = _newFiber;
} else {
previousNewFiber.sibling = _newFiber;
}
previousNewFiber = _newFiber;
}
return resultingFirstChild;
}
// Add all children to a key map for quick lookups.
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
// Keep scanning and use the map to restore deleted items as moves.
for (; newIdx < newChildren.length; newIdx++) {
var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], priority);
if (_newFiber2) {
if (shouldTrackSideEffects) {
if (_newFiber2.alternate !== null) {
// The new fiber is a work in progress, but if there exists a
// current, that means that we reused the fiber. We need to delete
// it from the child list so that we don't add it to the deletion
// list.
existingChildren['delete'](_newFiber2.key === null ? newIdx : _newFiber2.key);
}
}
lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
resultingFirstChild = _newFiber2;
} else {
previousNewFiber.sibling = _newFiber2;
}
previousNewFiber = _newFiber2;
}
}
if (shouldTrackSideEffects) {
// Any existing children that weren't consumed above were deleted. We need
// to add them to the deletion list.
existingChildren.forEach(function (child) {
return deleteChild(returnFiber, child);
});
}
return resultingFirstChild;
}
function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, priority) {
// This is the same implementation as reconcileChildrenArray(),
// but using the iterator instead.
var iteratorFn = getIteratorFn(newChildrenIterable);
!(typeof iteratorFn === 'function') ? "development" !== 'production' ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('156') : void 0;
if ("development" !== 'production') {
// Warn about using Maps as children
if (typeof newChildrenIterable.entries === 'function') {
var possibleMap = newChildrenIterable;
if (possibleMap.entries === iteratorFn) {
var mapsAsChildrenAddendum = '';
var owner = ReactCurrentOwner.owner || returnFiber._debugOwner;
if (owner && typeof owner.tag === 'number') {
var mapsAsChildrenOwnerName = getComponentName(owner);
if (mapsAsChildrenOwnerName) {
mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.';
}
}
"development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
didWarnAboutMaps = true;
}
}
// First, validate keys.
// We'll get a different iterator later for the main pass.
var _newChildren = iteratorFn.call(newChildrenIterable);
if (_newChildren) {
var knownKeys = null;
var _step = _newChildren.next();
for (; !_step.done; _step = _newChildren.next()) {
var child = _step.value;
knownKeys = warnOnDuplicateKey(child, knownKeys);
}
}
}
var newChildren = iteratorFn.call(newChildrenIterable);
!(newChildren != null) ? "development" !== 'production' ? invariant(false, 'An iterable object provided no iterator.') : _prodInvariant('157') : void 0;
var resultingFirstChild = null;
var previousNewFiber = null;
var oldFiber = currentFirstChild;
var lastPlacedIndex = 0;
var newIdx = 0;
var nextOldFiber = null;
var step = newChildren.next();
for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
if (oldFiber.index > newIdx) {
nextOldFiber = oldFiber;
oldFiber = null;
} else {
nextOldFiber = oldFiber.sibling;
}
var newFiber = updateSlot(returnFiber, oldFiber, step.value, priority);
if (newFiber === null) {
// TODO: This breaks on empty slots like null children. That's
// unfortunate because it triggers the slow path all the time. We need
// a better way to communicate whether this was a miss or null,
// boolean, undefined, etc.
if (!oldFiber) {
oldFiber = nextOldFiber;
}
break;
}
if (shouldTrackSideEffects) {
if (oldFiber && newFiber.alternate === null) {
// We matched the slot, but we didn't reuse the existing fiber, so we
// need to delete the existing child.
deleteChild(returnFiber, oldFiber);
}
}
lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
// TODO: Move out of the loop. This only happens for the first run.
resultingFirstChild = newFiber;
} else {
// TODO: Defer siblings if we're not at the right index for this slot.
// I.e. if we had null values before, then we want to defer this
// for each null value. However, we also don't want to call updateSlot
// with the previous one.
previousNewFiber.sibling = newFiber;
}
previousNewFiber = newFiber;
oldFiber = nextOldFiber;
}
if (step.done) {
// We've reached the end of the new children. We can delete the rest.
deleteRemainingChildren(returnFiber, oldFiber);
return resultingFirstChild;
}
if (oldFiber === null) {
// If we don't have any more existing children we can choose a fast path
// since the rest will all be insertions.
for (; !step.done; newIdx++, step = newChildren.next()) {
var _newFiber3 = createChild(returnFiber, step.value, priority);
if (_newFiber3 === null) {
continue;
}
lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
// TODO: Move out of the loop. This only happens for the first run.
resultingFirstChild = _newFiber3;
} else {
previousNewFiber.sibling = _newFiber3;
}
previousNewFiber = _newFiber3;
}
return resultingFirstChild;
}
// Add all children to a key map for quick lookups.
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
// Keep scanning and use the map to restore deleted items as moves.
for (; !step.done; newIdx++, step = newChildren.next()) {
var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, priority);
if (_newFiber4 !== null) {
if (shouldTrackSideEffects) {
if (_newFiber4.alternate !== null) {
// The new fiber is a work in progress, but if there exists a
// current, that means that we reused the fiber. We need to delete
// it from the child list so that we don't add it to the deletion
// list.
existingChildren['delete'](_newFiber4.key === null ? newIdx : _newFiber4.key);
}
}
lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
resultingFirstChild = _newFiber4;
} else {
previousNewFiber.sibling = _newFiber4;
}
previousNewFiber = _newFiber4;
}
}
if (shouldTrackSideEffects) {
// Any existing children that weren't consumed above were deleted. We need
// to add them to the deletion list.
existingChildren.forEach(function (child) {
return deleteChild(returnFiber, child);
});
}
return resultingFirstChild;
}
function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, priority) {
// There's no need to check for keys on text nodes since we don't have a
// way to define them.
if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
// We already have an existing node so let's just update it and delete
// the rest.
deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
var existing = useFiber(currentFirstChild, priority);
existing.pendingProps = textContent;
existing['return'] = returnFiber;
return existing;
}
// The existing first child is not a text node so we need to create one
// and delete the existing ones.
deleteRemainingChildren(returnFiber, currentFirstChild);
var created = createFiberFromText(textContent, priority);
created['return'] = returnFiber;
return created;
}
function reconcileSingleElement(returnFiber, currentFirstChild, element, priority) {
var key = element.key;
var child = currentFirstChild;
while (child !== null) {
// TODO: If key === null and child.key === null, then this only applies to
// the first item in the list.
if (child.key === key) {
if (child.type === element.type) {
deleteRemainingChildren(returnFiber, child.sibling);
var existing = useFiber(child, priority);
existing.ref = coerceRef(child, element);
existing.pendingProps = element.props;
existing['return'] = returnFiber;
if ("development" !== 'production') {
existing._debugSource = element._source;
existing._debugOwner = element._owner;
}
return existing;
} else {
deleteRemainingChildren(returnFiber, child);
break;
}
} else {
deleteChild(returnFiber, child);
}
child = child.sibling;
}
var created = createFiberFromElement(element, priority);
created.ref = coerceRef(currentFirstChild, element);
created['return'] = returnFiber;
return created;
}
function reconcileSingleCoroutine(returnFiber, currentFirstChild, coroutine, priority) {
var key = coroutine.key;
var child = currentFirstChild;
while (child !== null) {
// TODO: If key === null and child.key === null, then this only applies to
// the first item in the list.
if (child.key === key) {
if (child.tag === CoroutineComponent) {
deleteRemainingChildren(returnFiber, child.sibling);
var existing = useFiber(child, priority);
existing.pendingProps = coroutine;
existing['return'] = returnFiber;
return existing;
} else {
deleteRemainingChildren(returnFiber, child);
break;
}
} else {
deleteChild(returnFiber, child);
}
child = child.sibling;
}
var created = createFiberFromCoroutine(coroutine, priority);
created['return'] = returnFiber;
return created;
}
function reconcileSingleYield(returnFiber, currentFirstChild, yieldNode, priority) {
// There's no need to check for keys on yields since they're stateless.
var child = currentFirstChild;
if (child !== null) {
if (child.tag === YieldComponent) {
deleteRemainingChildren(returnFiber, child.sibling);
var existing = useFiber(child, priority);
existing.type = yieldNode.value;
existing['return'] = returnFiber;
return existing;
} else {
deleteRemainingChildren(returnFiber, child);
}
}
var created = createFiberFromYield(yieldNode, priority);
created.type = yieldNode.value;
created['return'] = returnFiber;
return created;
}
function reconcileSinglePortal(returnFiber, currentFirstChild, portal, priority) {
var key = portal.key;
var child = currentFirstChild;
while (child !== null) {
// TODO: If key === null and child.key === null, then this only applies to
// the first item in the list.
if (child.key === key) {
if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
deleteRemainingChildren(returnFiber, child.sibling);
var existing = useFiber(child, priority);
existing.pendingProps = portal.children || [];
existing['return'] = returnFiber;
return existing;
} else {
deleteRemainingChildren(returnFiber, child);
break;
}
} else {
deleteChild(returnFiber, child);
}
child = child.sibling;
}
var created = createFiberFromPortal(portal, priority);
created['return'] = returnFiber;
return created;
}
// This API will tag the children with the side-effect of the reconciliation
// itself. They will be added to the side-effect list as we pass through the
// children and the parent.
function reconcileChildFibers(returnFiber, currentFirstChild, newChild, priority) {
// This function is not recursive.
// If the top level item is an array, we treat it as a set of children,
// not as a fragment. Nested arrays on the other hand will be treated as
// fragment nodes. Recursion happens at the normal flow.
var disableNewFiberFeatures = ReactFeatureFlags.disableNewFiberFeatures;
// Handle object types
var isObject = typeof newChild === 'object' && newChild !== null;
if (isObject) {
// Support only the subset of return types that Stack supports. Treat
// everything else as empty, but log a warning.
if (disableNewFiberFeatures) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE:
return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, priority));
case REACT_PORTAL_TYPE:
return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, priority));
}
} else {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE:
return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, priority));
case REACT_COROUTINE_TYPE:
return placeSingleChild(reconcileSingleCoroutine(returnFiber, currentFirstChild, newChild, priority));
case REACT_YIELD_TYPE:
return placeSingleChild(reconcileSingleYield(returnFiber, currentFirstChild, newChild, priority));
case REACT_PORTAL_TYPE:
return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, priority));
}
}
}
if (disableNewFiberFeatures) {
// The new child is not an element. If it's not null or false,
// and the return fiber is a composite component, throw an error.
switch (returnFiber.tag) {
case ClassComponent:
{
if ("development" !== 'production') {
var instance = returnFiber.stateNode;
if (instance.render._isMockFunction && typeof newChild === 'undefined') {
// We allow auto-mocks to proceed as if they're
// returning null.
break;
}
}
var Component = returnFiber.type;
!(newChild === null || newChild === false) ? "development" !== '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.', Component.displayName || Component.name || 'Component') : _prodInvariant('109', Component.displayName || Component.name || 'Component') : void 0;
break;
}
case FunctionalComponent:
{
// Composites accept elements, portals, null, or false
var _Component = returnFiber.type;
!(newChild === null || newChild === false) ? "development" !== '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;
break;
}
}
}
if (typeof newChild === 'string' || typeof newChild === 'number') {
return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, priority));
}
if (isArray(newChild)) {
return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, priority);
}
if (getIteratorFn(newChild)) {
return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, priority);
}
if (isObject) {
throwOnInvalidObjectType(returnFiber, newChild);
}
if (!disableNewFiberFeatures && typeof newChild === 'undefined') {
// If the new child is undefined, and the return fiber is a composite
// component, throw an error. If Fiber return types are disabled,
// we already threw above.
switch (returnFiber.tag) {
case ClassComponent:
{
if ("development" !== 'production') {
var _instance = returnFiber.stateNode;
if (_instance.render._isMockFunction) {
// We allow auto-mocks to proceed as if they're returning null.
break;
}
}
}
// Intentionally fall through to the next case, which handles both
// functions and classes
// eslint-disable-next-lined no-fallthrough
case FunctionalComponent:
{
var _Component2 = returnFiber.type;
!false ? "development" !== 'production' ? invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', _Component2.displayName || _Component2.name || 'Component') : _prodInvariant('158', _Component2.displayName || _Component2.name || 'Component') : void 0;
}
}
}
// Remaining cases are all treated as empty.
return deleteRemainingChildren(returnFiber, currentFirstChild);
}
return reconcileChildFibers;
}
exports.reconcileChildFibers = ChildReconciler(true, true);
exports.reconcileChildFibersInPlace = ChildReconciler(false, true);
exports.mountChildFibersInPlace = ChildReconciler(false, false);
exports.cloneChildFibers = function (current, workInProgress) {
if (!workInProgress.child) {
return;
}
if (current !== null && workInProgress.child === current.child) {
// We use workInProgress.child since that lets Flow know that it can't be
// null since we validated that already. However, as the line above suggests
// they're actually the same thing.
var currentChild = workInProgress.child;
// TODO: This used to reset the pending priority. Not sure if that is needed.
// workInProgress.pendingWorkPriority = current.pendingWorkPriority;
// TODO: The below priority used to be set to NoWork which would've
// dropped work. This is currently unobservable but will become
// observable when the first sibling has lower priority work remaining
// than the next sibling. At that point we should add tests that catches
// this.
var newChild = cloneFiber(currentChild, currentChild.pendingWorkPriority);
workInProgress.child = newChild;
newChild['return'] = workInProgress;
while (currentChild.sibling !== null) {
currentChild = currentChild.sibling;
newChild = newChild.sibling = cloneFiber(currentChild, currentChild.pendingWorkPriority);
newChild['return'] = workInProgress;
}
newChild.sibling = null;
}
// If there is no alternate, then we don't need to clone the children.
// If the children of the alternate fiber is a different set, then we don't
// need to clone. We need to reset the return fiber though since we'll
// traverse down into them.
var child = workInProgress.child;
while (child !== null) {
child['return'] = workInProgress;
child = child.sibling;
}
};
},{"104":104,"112":112,"117":117,"125":125,"131":131,"138":138,"22":22,"38":38,"40":40,"44":44,"45":45,"59":59,"67":67,"72":72,"73":73}],20:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var EventPluginUtils = _dereq_(13);
var invariant = _dereq_(131);
// Use to restore controlled state after a change event has fired.
var fiberHostComponent = null;
var ReactControlledComponentInjection = {
injectFiberControlledHostComponent: function (hostComponentImpl) {
// The fiber implementation doesn't use dynamic dispatch so we need to
// inject the implementation.
fiberHostComponent = hostComponentImpl;
}
};
var restoreTarget = null;
var restoreQueue = null;
function restoreStateOfTarget(target) {
// We perform this translation at the end of the event loop so that we
// always receive the correct fiber here
var internalInstance = EventPluginUtils.getInstanceFromNode(target);
if (!internalInstance) {
// Unmounted
return;
}
if (typeof internalInstance.tag === 'number') {
!(fiberHostComponent && typeof fiberHostComponent.restoreControlledState === 'function') ? "development" !== 'production' ? invariant(false, 'Fiber needs to be injected to handle a fiber target for controlled events.') : _prodInvariant('189') : void 0;
var props = EventPluginUtils.getFiberCurrentPropsFromNode(internalInstance.stateNode);
fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props);
return;
}
!(typeof internalInstance.restoreControlledState === 'function') ? "development" !== 'production' ? invariant(false, 'The internal instance must be a React host component.') : _prodInvariant('190') : void 0;
// If it is not a Fiber, we can just use dynamic dispatch.
internalInstance.restoreControlledState();
}
var ReactControlledComponent = {
injection: ReactControlledComponentInjection,
enqueueStateRestore: function (target) {
if (restoreTarget) {
if (restoreQueue) {
restoreQueue.push(target);
} else {
restoreQueue = [target];
}
} else {
restoreTarget = target;
}
},
restoreStateIfNeeded: function () {
if (!restoreTarget) {
return;
}
var target = restoreTarget;
var queuedTargets = restoreQueue;
restoreTarget = null;
restoreQueue = null;
restoreStateOfTarget(target);
if (queuedTargets) {
for (var i = 0; i < queuedTargets.length; i++) {
restoreStateOfTarget(queuedTargets[i]);
}
}
}
};
module.exports = ReactControlledComponent;
},{"112":112,"13":13,"131":131}],21:[function(_dereq_,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 React = _dereq_(118);
var ReactPropTypesSecret = _dereq_(70);
var warning = _dereq_(138);
var hasReadOnlyValue = {
'button': true,
'checkbox': true,
'image': true,
'hidden': true,
'radio': true,
'reset': true,
'submit': true
};
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: React.PropTypes.func
};
var loggedTypeFailures = {};
function getDeclarationErrorAddendum(ownerName) {
if (ownerName) {
return '\n\nCheck the render method of `' + ownerName + '`.';
}
return '';
}
/**
* Provide a linked `value` attribute for controlled forms. You should not use
* this outside of the ReactDOM controlled form components.
*/
var ReactControlledValuePropTypes = {
checkPropTypes: function (tagName, props, ownerName) {
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(ownerName);
"development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
}
}
}
};
module.exports = ReactControlledValuePropTypes;
},{"118":118,"138":138,"70":70}],22:[function(_dereq_,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 special React types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_COROUTINE_TYPE;
var REACT_YIELD_TYPE;
if (typeof Symbol === 'function' && Symbol['for']) {
REACT_COROUTINE_TYPE = Symbol['for']('react.coroutine');
REACT_YIELD_TYPE = Symbol['for']('react.yield');
} else {
REACT_COROUTINE_TYPE = 0xeac8;
REACT_YIELD_TYPE = 0xeac9;
}
exports.createCoroutine = function (children, handler, props) {
var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var coroutine = {
// This tag allow us to uniquely identify this as a React Coroutine
$$typeof: REACT_COROUTINE_TYPE,
key: key == null ? null : '' + key,
children: children,
handler: handler,
props: props
};
if ("development" !== 'production') {
// TODO: Add _store property for marking this as validated.
if (Object.freeze) {
Object.freeze(coroutine.props);
Object.freeze(coroutine);
}
}
return coroutine;
};
exports.createYield = function (value) {
var yieldNode = {
// This tag allow us to uniquely identify this as a React Yield
$$typeof: REACT_YIELD_TYPE,
value: value
};
if ("development" !== 'production') {
// TODO: Add _store property for marking this as validated.
if (Object.freeze) {
Object.freeze(yieldNode);
}
}
return yieldNode;
};
/**
* Verifies the object is a coroutine object.
*/
exports.isCoroutine = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_COROUTINE_TYPE;
};
/**
* Verifies the object is a yield object.
*/
exports.isYield = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_YIELD_TYPE;
};
exports.REACT_YIELD_TYPE = REACT_YIELD_TYPE;
exports.REACT_COROUTINE_TYPE = REACT_COROUTINE_TYPE;
},{}],23:[function(_dereq_,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;
},{}],24:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var DOMProperty = _dereq_(8);
var ReactDOMComponentFlags = _dereq_(23);
var _require = _dereq_(73),
HostComponent = _require.HostComponent,
HostText = _require.HostText;
var invariant = _dereq_(131);
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var Flags = ReactDOMComponentFlags;
var randomKey = Math.random().toString(36).slice(2);
var internalInstanceKey = '__reactInternalInstance$' + randomKey;
var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
/**
* 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 precacheFiberNode(hostInst, 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.
!false ? "development" !== '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 = node[internalInstanceKey];
if (inst.tag === HostComponent || inst.tag === HostText) {
// In Fiber, this will always be the deepest root.
return 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 = node[internalInstanceKey];
if (inst) {
if (inst.tag === HostComponent || inst.tag === HostText) {
return inst;
} else if (inst._hostNode === node) {
return inst;
} else {
return null;
}
}
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) {
if (inst.tag === HostComponent || inst.tag === HostText) {
// In Fiber this, is just the state node right now. We assume it will be
// a host component or host text.
return inst.stateNode;
}
// Without this first invariant, passing a non-DOM-component triggers the next
// invariant for a missing parent, which is super confusing.
!(inst._hostNode !== undefined) ? "development" !== '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 ? "development" !== '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;
}
function getFiberCurrentPropsFromNode(node) {
return node[internalEventHandlersKey] || null;
}
function updateFiberProps(node, props) {
node[internalEventHandlersKey] = props;
}
var ReactDOMComponentTree = {
getClosestInstanceFromNode: getClosestInstanceFromNode,
getInstanceFromNode: getInstanceFromNode,
getNodeFromInstance: getNodeFromInstance,
precacheChildNodes: precacheChildNodes,
precacheNode: precacheNode,
uncacheNode: uncacheNode,
precacheFiberNode: precacheFiberNode,
getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode,
updateFiberProps: updateFiberProps
};
module.exports = ReactDOMComponentTree;
},{"112":112,"131":131,"23":23,"73":73,"8":8}],25:[function(_dereq_,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;
},{}],26:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var ReactBrowserEventEmitter = _dereq_(18);
var ReactControlledComponent = _dereq_(20);
var ReactDOMComponentTree = _dereq_(24);
var ReactFeatureFlags = _dereq_(44);
var ReactDOMFeatureFlags = _dereq_(25);
var ReactDOMFiberComponent = _dereq_(27);
var ReactDOMFrameScheduling = _dereq_(32);
var ReactDOMInjection = _dereq_(33);
var ReactGenericBatching = _dereq_(61);
var ReactFiberReconciler = _dereq_(55);
var ReactInputSelection = _dereq_(63);
var ReactInstanceMap = _dereq_(64);
var ReactPortal = _dereq_(67);
var _require = _dereq_(118),
isValidElement = _require.isValidElement;
var _require2 = _dereq_(51),
injectInternals = _require2.injectInternals;
var findDOMNode = _dereq_(96);
var invariant = _dereq_(131);
var warning = _dereq_(138);
var createElement = ReactDOMFiberComponent.createElement,
getChildNamespace = ReactDOMFiberComponent.getChildNamespace,
setInitialProperties = ReactDOMFiberComponent.setInitialProperties,
diffProperties = ReactDOMFiberComponent.diffProperties,
updateProperties = ReactDOMFiberComponent.updateProperties;
var precacheFiberNode = ReactDOMComponentTree.precacheFiberNode,
updateFiberProps = ReactDOMComponentTree.updateFiberProps;
if ("development" !== 'production') {
var validateDOMNesting = _dereq_(115);
var updatedAncestorInfo = validateDOMNesting.updatedAncestorInfo;
}
var DOCUMENT_NODE = 9;
ReactDOMInjection.inject();
ReactControlledComponent.injection.injectFiberControlledHostComponent(ReactDOMFiberComponent);
findDOMNode._injectFiber(function (fiber) {
return DOMRenderer.findHostInstance(fiber);
});
var eventsEnabled = null;
var selectionInformation = null;
var ELEMENT_NODE_TYPE = 1;
var DOC_NODE_TYPE = 9;
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
/**
* 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));
}
function validateContainer(container) {
if (!isValidContainer(container)) {
throw new Error('Target container is not a DOM element.');
}
}
function getReactRootElementInContainer(container) {
if (!container) {
return null;
}
if (container.nodeType === DOC_NODE_TYPE) {
return container.documentElement;
} else {
return container.firstChild;
}
}
function shouldAutoFocusHostComponent(type, props) {
switch (type) {
case 'button':
case 'input':
case 'select':
case 'textarea':
return !!props.autoFocus;
}
return false;
}
var DOMRenderer = ReactFiberReconciler({
getRootHostContext: function (rootContainerInstance) {
var ownNamespace = rootContainerInstance.namespaceURI || null;
var type = rootContainerInstance.tagName;
var namespace = getChildNamespace(ownNamespace, type);
if ("development" !== 'production') {
var isMountingIntoDocument = rootContainerInstance.ownerDocument.documentElement === rootContainerInstance;
var validatedTag = isMountingIntoDocument ? '#document' : type.toLowerCase();
var _ancestorInfo = updatedAncestorInfo(null, validatedTag, null);
return { namespace: namespace, ancestorInfo: _ancestorInfo };
}
return namespace;
},
getChildHostContext: function (parentHostContext, type) {
if ("development" !== 'production') {
var parentHostContextDev = parentHostContext;
var _namespace = getChildNamespace(parentHostContextDev.namespace, type);
var _ancestorInfo2 = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type, null);
return { namespace: _namespace, ancestorInfo: _ancestorInfo2 };
}
var parentNamespace = parentHostContext;
return getChildNamespace(parentNamespace, type);
},
getPublicInstance: function (instance) {
return instance;
},
prepareForCommit: function () {
eventsEnabled = ReactBrowserEventEmitter.isEnabled();
selectionInformation = ReactInputSelection.getSelectionInformation();
ReactBrowserEventEmitter.setEnabled(false);
},
resetAfterCommit: function () {
ReactInputSelection.restoreSelection(selectionInformation);
selectionInformation = null;
ReactBrowserEventEmitter.setEnabled(eventsEnabled);
eventsEnabled = null;
},
createInstance: function (type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
var parentNamespace = void 0;
if ("development" !== 'production') {
// TODO: take namespace into account when validating.
var hostContextDev = hostContext;
validateDOMNesting(type, null, null, hostContextDev.ancestorInfo);
if (typeof props.children === 'string' || typeof props.children === 'number') {
var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type, null);
validateDOMNesting(null, String(props.children), null, ownAncestorInfo);
}
parentNamespace = hostContextDev.namespace;
} else {
parentNamespace = hostContext;
}
var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
precacheFiberNode(internalInstanceHandle, domElement);
updateFiberProps(domElement, props);
return domElement;
},
appendInitialChild: function (parentInstance, child) {
parentInstance.appendChild(child);
},
finalizeInitialChildren: function (domElement, type, props, rootContainerInstance) {
setInitialProperties(domElement, type, props, rootContainerInstance);
return shouldAutoFocusHostComponent(type, props);
},
prepareUpdate: function (domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
if ("development" !== 'production') {
var hostContextDev = hostContext;
if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type, null);
validateDOMNesting(null, String(newProps.children), null, ownAncestorInfo);
}
}
return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
},
commitMount: function (domElement, type, newProps, internalInstanceHandle) {
domElement.focus();
},
commitUpdate: function (domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
// Update the props handle so that we know which props are the ones with
// with current event handlers.
updateFiberProps(domElement, newProps);
// Apply the diff to the DOM node.
updateProperties(domElement, updatePayload, type, oldProps, newProps);
},
shouldSetTextContent: function (props) {
return typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && typeof props.dangerouslySetInnerHTML.__html === 'string';
},
resetTextContent: function (domElement) {
domElement.textContent = '';
},
createTextInstance: function (text, rootContainerInstance, hostContext, internalInstanceHandle) {
if ("development" !== 'production') {
var hostContextDev = hostContext;
validateDOMNesting(null, text, null, hostContextDev.ancestorInfo);
}
var textNode = document.createTextNode(text);
precacheFiberNode(internalInstanceHandle, textNode);
return textNode;
},
commitTextUpdate: function (textInstance, oldText, newText) {
textInstance.nodeValue = newText;
},
appendChild: function (parentInstance, child) {
parentInstance.appendChild(child);
},
insertBefore: function (parentInstance, child, beforeChild) {
parentInstance.insertBefore(child, beforeChild);
},
removeChild: function (parentInstance, child) {
parentInstance.removeChild(child);
},
scheduleAnimationCallback: ReactDOMFrameScheduling.rAF,
scheduleDeferredCallback: ReactDOMFrameScheduling.rIC,
useSyncScheduling: true
});
ReactGenericBatching.injection.injectFiberBatchedUpdates(DOMRenderer.batchedUpdates);
var warned = false;
function warnAboutUnstableUse() {
// Ignore this warning is the feature flag is turned on. E.g. for tests.
"development" !== 'production' ? warning(warned || ReactDOMFeatureFlags.useFiber, 'You are using React DOM Fiber which is an experimental renderer. ' + 'It is likely to have bugs, breaking changes and is unsupported.') : void 0;
warned = true;
}
function renderSubtreeIntoContainer(parentComponent, children, containerNode, callback) {
validateContainer(containerNode);
var container = containerNode.nodeType === DOCUMENT_NODE ? containerNode.documentElement : containerNode;
var root = container._reactRootContainer;
if (!root) {
// First clear any existing content.
while (container.lastChild) {
container.removeChild(container.lastChild);
}
var newRoot = DOMRenderer.createContainer(container);
root = container._reactRootContainer = newRoot;
// Initial mount should not be batched.
DOMRenderer.unbatchedUpdates(function () {
DOMRenderer.updateContainer(children, newRoot, parentComponent, callback);
});
} else {
DOMRenderer.updateContainer(children, root, parentComponent, callback);
}
return DOMRenderer.getPublicRootInstance(root);
}
var ReactDOM = {
render: function (element, container, callback) {
validateContainer(container);
if (ReactFeatureFlags.disableNewFiberFeatures) {
// Top-level check occurs here instead of inside child reconciler because
// because requirements vary between renderers. E.g. React Art
// allows arrays.
if (!isValidElement(element)) {
if (typeof element === 'string') {
!false ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element. Instead of passing a string like \'div\', pass React.createElement(\'div\') or <div />.') : _prodInvariant('146') : void 0;
} else if (typeof element === 'function') {
!false ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element. Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.') : _prodInvariant('147') : void 0;
} else if (element != null && typeof element.props !== 'undefined') {
// Check if it quacks like an element
!false ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element. This may be caused by unintentionally loading two independent copies of React.') : _prodInvariant('148') : void 0;
} else {
!false ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.') : _prodInvariant('149') : void 0;
}
}
}
if ("development" !== 'production') {
var isRootRenderedBySomeReact = Boolean(container._reactRootContainer);
var rootEl = getReactRootElementInContainer(container);
var hasNonRootReactChild = Boolean(rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl));
"development" !== 'production' ? warning(!hasNonRootReactChild || isRootRenderedBySomeReact, '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;
"development" !== 'production' ? warning(!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;
}
return renderSubtreeIntoContainer(null, element, container, callback);
},
unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) {
!(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? "development" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
return renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
},
unmountComponentAtNode: function (container) {
!isValidContainer(container) ? "development" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
warnAboutUnstableUse();
if (container._reactRootContainer) {
if ("development" !== 'production') {
var rootEl = getReactRootElementInContainer(container);
var renderedByDifferentReact = rootEl && !ReactDOMComponentTree.getInstanceFromNode(rootEl);
"development" !== 'production' ? warning(!renderedByDifferentReact, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
}
// Unmount should not be batched.
return DOMRenderer.unbatchedUpdates(function () {
return renderSubtreeIntoContainer(null, null, container, function () {
container._reactRootContainer = null;
});
});
}
},
findDOMNode: findDOMNode,
unstable_createPortal: function (children, container) {
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
// TODO: pass ReactDOM portal implementation as third argument
return ReactPortal.createPortal(children, container, null, key);
},
unstable_batchedUpdates: ReactGenericBatching.batchedUpdates,
unstable_deferredUpdates: DOMRenderer.deferredUpdates
};
if (typeof injectInternals === 'function') {
injectInternals({
findFiberByHostInstance: ReactDOMComponentTree.getClosestInstanceFromNode,
findHostInstanceByFiber: DOMRenderer.findHostInstance
});
}
module.exports = ReactDOM;
},{"112":112,"115":115,"118":118,"131":131,"138":138,"18":18,"20":20,"24":24,"25":25,"27":27,"32":32,"33":33,"44":44,"51":51,"55":55,"61":61,"63":63,"64":64,"67":67,"96":96}],27:[function(_dereq_,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.
*
*
*/
/* global hasOwnProperty:true */
'use strict';
var _extends = _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 _prodInvariant = _dereq_(112),
_assign = _dereq_(139);
var CSSPropertyOperations = _dereq_(4);
var DOMNamespaces = _dereq_(7);
var DOMProperty = _dereq_(8);
var DOMPropertyOperations = _dereq_(9);
var EventPluginRegistry = _dereq_(12);
var ReactBrowserEventEmitter = _dereq_(18);
var ReactDOMFiberInput = _dereq_(28);
var ReactDOMFiberOption = _dereq_(29);
var ReactDOMFiberSelect = _dereq_(30);
var ReactDOMFiberTextarea = _dereq_(31);
var _require = _dereq_(38),
getCurrentFiberOwnerName = _require.getCurrentFiberOwnerName;
var emptyFunction = _dereq_(124);
var invariant = _dereq_(131);
var isEventSupported = _dereq_(109);
var setInnerHTML = _dereq_(113);
var setTextContent = _dereq_(114);
var inputValueTracking = _dereq_(108);
var warning = _dereq_(138);
if ("development" !== 'production') {
var ReactDOMInvalidARIAHook = _dereq_(34);
var ReactDOMNullInputValuePropHook = _dereq_(35);
var ReactDOMUnknownPropertyHook = _dereq_(37);
var validateARIAProperties = ReactDOMInvalidARIAHook.validateProperties;
var validateInputPropertes = ReactDOMNullInputValuePropHook.validateProperties;
var validateUnknownPropertes = ReactDOMUnknownPropertyHook.validateProperties;
}
var didWarnShadyDOM = false;
var listenTo = ReactBrowserEventEmitter.listenTo;
var registrationNameModules = EventPluginRegistry.registrationNameModules;
var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
var CHILDREN = 'children';
var STYLE = 'style';
var HTML = '__html';
var HTML_NAMESPACE = DOMNamespaces.html,
SVG_NAMESPACE = DOMNamespaces.svg,
MATH_NAMESPACE = DOMNamespaces.mathml;
// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
var DOC_FRAGMENT_TYPE = 11;
function getDeclarationErrorAddendum() {
var ownerName = getCurrentFiberOwnerName();
if (ownerName) {
// TODO: also report the stack.
return '\n\nThis DOM node was rendered by `' + ownerName + '`.';
}
return '';
}
function assertValidProps(tag, props) {
if (!props) {
return;
}
// Note the use of `==` which checks for null or undefined.
if (voidElementTags[tag]) {
!(props.children == null && props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, getDeclarationErrorAddendum()) : _prodInvariant('137', tag, getDeclarationErrorAddendum()) : void 0;
}
if (props.dangerouslySetInnerHTML != null) {
!(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? "development" !== '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 ("development" !== 'production') {
"development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
"development" !== '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;
"development" !== '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') ? "development" !== '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()) : _prodInvariant('62', getDeclarationErrorAddendum()) : void 0;
}
if ("development" !== 'production') {
var validatePropertiesInDevelopment = function (type, props) {
validateARIAProperties(type, props);
validateInputPropertes(type, props);
validateUnknownPropertes(type, props);
};
}
function ensureListeningTo(rootContainerElement, registrationName) {
if ("development" !== 'production') {
// IE8 has no API for event capturing and the `onScroll` event doesn't
// bubble.
"development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
}
var isDocumentFragment = rootContainerElement.nodeType === DOC_FRAGMENT_TYPE;
var doc = isDocumentFragment ? rootContainerElement : rootContainerElement.ownerDocument;
listenTo(registrationName, doc);
}
// 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 trapClickOnNonInteractiveElement(node) {
// 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
// Just set it using the onclick property so that we don't have to manage any
// bookkeeping for it. Not sure if we need to clear it when the listener is
// removed.
// TODO: Only do this for the relevant Safaris maybe?
node.onclick = emptyFunction;
}
function trapBubbledEventsLocal(node, tag) {
// 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.
// TODO: Make sure that we check isMounted before firing any of these events.
// TODO: Inline these below since we're calling this from an equivalent
// switch statement.
switch (tag) {
case 'iframe':
case 'object':
ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node);
break;
case 'video':
case 'audio':
// Create listener for each media event
for (var event in mediaEvents) {
if (mediaEvents.hasOwnProperty(event)) {
ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node);
}
}
break;
case 'source':
ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node);
break;
case 'img':
ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node);
ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node);
break;
case 'form':
ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node);
ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node);
break;
case 'input':
case 'select':
case 'textarea':
ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node);
break;
case 'details':
ReactBrowserEventEmitter.trapBubbledEvent('topToggle', 'toggle', node);
break;
}
}
// 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
};
// 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 = _extends({
'menuitem': true
}, omittedCloseTags);
function isCustomComponent(tagName, props) {
return tagName.indexOf('-') >= 0 || props.is != null;
}
function setInitialDOMProperties(domElement, rootContainerElement, nextProps, isCustomComponentTag) {
for (var propKey in nextProps) {
var nextProp = nextProps[propKey];
if (!nextProps.hasOwnProperty(propKey)) {
continue;
}
if (propKey === STYLE) {
if ("development" !== 'production') {
if (nextProp) {
// Freeze the next style object so that we can assume it won't be
// mutated. We have already warned for this in the past.
Object.freeze(nextProp);
}
}
// Relies on `updateStylesByID` not mutating `styleUpdates`.
// TODO: call ReactInstrumentation.debugTool.onHostOperation in DEV.
CSSPropertyOperations.setValueForStyles(domElement, nextProp);
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
var nextHtml = nextProp ? nextProp[HTML] : undefined;
if (nextHtml != null) {
setInnerHTML(domElement, nextHtml);
}
} else if (propKey === CHILDREN) {
if (typeof nextProp === 'string') {
setTextContent(domElement, nextProp);
} else if (typeof nextProp === 'number') {
setTextContent(domElement, '' + nextProp);
}
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING) {
// Noop
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp) {
ensureListeningTo(rootContainerElement, propKey);
}
} else if (isCustomComponentTag) {
DOMPropertyOperations.setValueForAttribute(domElement, propKey, nextProp);
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
// 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(domElement, propKey, nextProp);
}
}
}
}
function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
// TODO: Handle wasCustomComponentTag
for (var i = 0; i < updatePayload.length; i += 2) {
var propKey = updatePayload[i];
var propValue = updatePayload[i + 1];
if (propKey === STYLE) {
// TODO: call ReactInstrumentation.debugTool.onHostOperation in DEV.
CSSPropertyOperations.setValueForStyles(domElement, propValue);
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
setInnerHTML(domElement, propValue);
} else if (propKey === CHILDREN) {
setTextContent(domElement, propValue);
} else if (isCustomComponentTag) {
if (propValue != null) {
DOMPropertyOperations.setValueForAttribute(domElement, propKey, propValue);
} else {
DOMPropertyOperations.deleteValueForAttribute(domElement, propKey);
}
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
// 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 (propValue != null) {
DOMPropertyOperations.setValueForProperty(domElement, propKey, propValue);
} else {
DOMPropertyOperations.deleteValueForProperty(domElement, propKey);
}
}
}
}
// Assumes there is no parent namespace.
function getIntrinsicNamespace(type) {
switch (type) {
case 'svg':
return SVG_NAMESPACE;
case 'math':
return MATH_NAMESPACE;
default:
return HTML_NAMESPACE;
}
}
var ReactDOMFiberComponent = {
getChildNamespace: function (parentNamespace, type) {
if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
// No (or default) parent namespace: potential entry point.
return getIntrinsicNamespace(type);
}
if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
// We're leaving SVG.
return HTML_NAMESPACE;
}
// By default, pass namespace below.
return parentNamespace;
},
createElement: function (type, props, rootContainerElement, parentNamespace) {
// We create tags in the namespace of their parent container, except HTML
// tags get no namespace.
var ownerDocument = rootContainerElement.ownerDocument;
var domElement;
var namespaceURI = parentNamespace;
if (namespaceURI === HTML_NAMESPACE) {
namespaceURI = getIntrinsicNamespace(type);
}
if (namespaceURI === HTML_NAMESPACE) {
if ("development" !== 'production') {
"development" !== 'production' ? warning(type === type.toLowerCase() || isCustomComponent(type, props), '<%s /> is using uppercase HTML. Always use lowercase HTML tags ' + 'in React.', type) : void 0;
}
if (type === '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');
div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
// This is guaranteed to yield a script element.
var firstChild = div.firstChild;
domElement = div.removeChild(firstChild);
} else if (props.is) {
domElement = ownerDocument.createElement(type, props.is);
} else {
// Separate else branch instead of using `props.is || undefined` above because 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
domElement = ownerDocument.createElement(type);
}
} else {
domElement = ownerDocument.createElementNS(namespaceURI, type);
}
return domElement;
},
setInitialProperties: function (domElement, tag, rawProps, rootContainerElement) {
var isCustomComponentTag = isCustomComponent(tag, rawProps);
if ("development" !== 'production') {
validatePropertiesInDevelopment(tag, rawProps);
if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
"development" !== 'production' ? warning(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerName() || 'A component') : void 0;
didWarnShadyDOM = true;
}
}
var props;
switch (tag) {
case 'audio':
case 'form':
case 'iframe':
case 'img':
case 'link':
case 'object':
case 'source':
case 'video':
case 'details':
trapBubbledEventsLocal(domElement, tag);
props = rawProps;
break;
case 'input':
ReactDOMFiberInput.mountWrapper(domElement, rawProps);
props = ReactDOMFiberInput.getHostProps(domElement, rawProps);
trapBubbledEventsLocal(domElement, tag);
// For controlled components we always need to ensure we're listening
// to onChange. Even if there is no listener.
ensureListeningTo(rootContainerElement, 'onChange');
break;
case 'option':
ReactDOMFiberOption.mountWrapper(domElement, rawProps);
props = ReactDOMFiberOption.getHostProps(domElement, rawProps);
break;
case 'select':
ReactDOMFiberSelect.mountWrapper(domElement, rawProps);
props = ReactDOMFiberSelect.getHostProps(domElement, rawProps);
trapBubbledEventsLocal(domElement, tag);
// For controlled components we always need to ensure we're listening
// to onChange. Even if there is no listener.
ensureListeningTo(rootContainerElement, 'onChange');
break;
case 'textarea':
ReactDOMFiberTextarea.mountWrapper(domElement, rawProps);
props = ReactDOMFiberTextarea.getHostProps(domElement, rawProps);
trapBubbledEventsLocal(domElement, tag);
// For controlled components we always need to ensure we're listening
// to onChange. Even if there is no listener.
ensureListeningTo(rootContainerElement, 'onChange');
break;
default:
props = rawProps;
}
assertValidProps(tag, props);
setInitialDOMProperties(domElement, rootContainerElement, props, isCustomComponentTag);
switch (tag) {
case 'input':
// TODO: Make sure we check if this is still unmounted or do any clean
// up necessary since we never stop tracking anymore.
inputValueTracking.trackNode(domElement);
ReactDOMFiberInput.postMountWrapper(domElement, rawProps);
break;
case 'textarea':
// TODO: Make sure we check if this is still unmounted or do any clean
// up necessary since we never stop tracking anymore.
inputValueTracking.trackNode(domElement);
ReactDOMFiberTextarea.postMountWrapper(domElement, rawProps);
break;
case 'option':
ReactDOMFiberOption.postMountWrapper(domElement, rawProps);
break;
default:
if (typeof props.onClick === 'function') {
// TODO: This cast may not be sound for SVG, MathML or custom elements.
trapClickOnNonInteractiveElement(domElement);
}
break;
}
},
// Calculate the diff between the two objects.
diffProperties: function (domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
if ("development" !== 'production') {
validatePropertiesInDevelopment(tag, nextRawProps);
}
var updatePayload = null;
var lastProps;
var nextProps;
switch (tag) {
case 'input':
lastProps = ReactDOMFiberInput.getHostProps(domElement, lastRawProps);
nextProps = ReactDOMFiberInput.getHostProps(domElement, nextRawProps);
updatePayload = [];
break;
case 'option':
lastProps = ReactDOMFiberOption.getHostProps(domElement, lastRawProps);
nextProps = ReactDOMFiberOption.getHostProps(domElement, nextRawProps);
updatePayload = [];
break;
case 'select':
lastProps = ReactDOMFiberSelect.getHostProps(domElement, lastRawProps);
nextProps = ReactDOMFiberSelect.getHostProps(domElement, nextRawProps);
updatePayload = [];
break;
case 'textarea':
lastProps = ReactDOMFiberTextarea.getHostProps(domElement, lastRawProps);
nextProps = ReactDOMFiberTextarea.getHostProps(domElement, nextRawProps);
updatePayload = [];
break;
default:
lastProps = lastRawProps;
nextProps = nextRawProps;
if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
// TODO: This cast may not be sound for SVG, MathML or custom elements.
trapClickOnNonInteractiveElement(domElement);
}
break;
}
assertValidProps(tag, nextProps);
var propKey;
var styleName;
var styleUpdates = null;
for (propKey in lastProps) {
if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
continue;
}
if (propKey === STYLE) {
var lastStyle = lastProps[propKey];
for (styleName in lastStyle) {
if (lastStyle.hasOwnProperty(styleName)) {
if (!styleUpdates) {
styleUpdates = {};
}
styleUpdates[styleName] = '';
}
}
} else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {
// Noop. This is handled by the clear text mechanism.
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING) {
// Noop
} else if (registrationNameModules.hasOwnProperty(propKey)) {
// This is a special case. If any listener updates we need to ensure
// that the "current" fiber pointer gets updated so we need a commit
// to update this element.
if (!updatePayload) {
updatePayload = [];
}
} else {
// For all other deleted properties we add it to the queue. We use
// the whitelist in the commit phase instead.
(updatePayload = updatePayload || []).push(propKey, null);
}
}
for (propKey in nextProps) {
var nextProp = nextProps[propKey];
var lastProp = lastProps != null ? lastProps[propKey] : undefined;
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
continue;
}
if (propKey === STYLE) {
if ("development" !== 'production') {
if (nextProp) {
// Freeze the next style object so that we can assume it won't be
// mutated. We have already warned for this in the past.
Object.freeze(nextProp);
}
}
if (lastProp) {
// Unset styles on `lastProp` but not on `nextProp`.
for (styleName in lastProp) {
if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
if (!styleUpdates) {
styleUpdates = {};
}
styleUpdates[styleName] = '';
}
}
// Update styles that changed since `lastProp`.
for (styleName in nextProp) {
if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
if (!styleUpdates) {
styleUpdates = {};
}
styleUpdates[styleName] = nextProp[styleName];
}
}
} else {
// Relies on `updateStylesByID` not mutating `styleUpdates`.
if (!styleUpdates) {
if (!updatePayload) {
updatePayload = [];
}
updatePayload.push(propKey, styleUpdates);
}
styleUpdates = nextProp;
}
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
var nextHtml = nextProp ? nextProp[HTML] : undefined;
var lastHtml = lastProp ? lastProp[HTML] : undefined;
if (nextHtml != null) {
if (lastHtml !== nextHtml) {
(updatePayload = updatePayload || []).push(propKey, '' + nextHtml);
}
} else {
// TODO: It might be too late to clear this if we have children
// inserted already.
}
} else if (propKey === CHILDREN) {
if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
(updatePayload = updatePayload || []).push(propKey, '' + nextProp);
}
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING) {
// Noop
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp) {
// We eagerly listen to this even though we haven't committed yet.
ensureListeningTo(rootContainerElement, propKey);
}
if (!updatePayload && lastProp !== nextProp) {
// This is a special case. If any listener updates we need to ensure
// that the "current" props pointer gets updated so we need a commit
// to update this element.
updatePayload = [];
}
} else {
// For any other property we always add it to the queue and then we
// filter it out using the whitelist during the commit.
(updatePayload = updatePayload || []).push(propKey, nextProp);
}
}
if (styleUpdates) {
(updatePayload = updatePayload || []).push(STYLE, styleUpdates);
}
return updatePayload;
},
// Apply the diff.
updateProperties: function (domElement, updatePayload, tag, lastRawProps, nextRawProps) {
var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
// Apply the diff.
updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
// TODO: Ensure that an update gets scheduled if any of the special props
// changed.
switch (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.
ReactDOMFiberInput.updateWrapper(domElement, nextRawProps);
break;
case 'textarea':
ReactDOMFiberTextarea.updateWrapper(domElement, nextRawProps);
break;
case 'select':
// <select> value update needs to occur after <option> children
// reconciliation
ReactDOMFiberSelect.postUpdateWrapper(domElement, nextRawProps);
break;
}
},
restoreControlledState: function (domElement, tag, props) {
switch (tag) {
case 'input':
ReactDOMFiberInput.restoreControlledState(domElement, props);
return;
case 'textarea':
ReactDOMFiberTextarea.restoreControlledState(domElement, props);
return;
case 'select':
ReactDOMFiberSelect.restoreControlledState(domElement, props);
return;
}
}
};
module.exports = ReactDOMFiberComponent;
},{"108":108,"109":109,"112":112,"113":113,"114":114,"12":12,"124":124,"131":131,"138":138,"139":139,"18":18,"28":28,"29":29,"30":30,"31":31,"34":34,"35":35,"37":37,"38":38,"4":4,"7":7,"8":8,"9":9}],28:[function(_dereq_,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 _prodInvariant = _dereq_(112),
_assign = _dereq_(139);
var DOMPropertyOperations = _dereq_(9);
var ReactControlledValuePropTypes = _dereq_(21);
var ReactDOMComponentTree = _dereq_(24);
var _require = _dereq_(38),
getCurrentFiberOwnerName = _require.getCurrentFiberOwnerName;
var invariant = _dereq_(131);
var warning = _dereq_(138);
var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;
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 (element, props) {
var node = element;
var value = props.value;
var checked = props.checked;
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 : node._wrapperState.initialValue,
checked: checked != null ? checked : node._wrapperState.initialChecked
});
return hostProps;
},
mountWrapper: function (element, props) {
if ("development" !== 'production') {
ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberOwnerName());
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
"development" !== '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', getCurrentFiberOwnerName() || 'A component', props.type) : void 0;
didWarnCheckedDefaultChecked = true;
}
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
"development" !== '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', getCurrentFiberOwnerName() || 'A component', props.type) : void 0;
didWarnValueDefaultValue = true;
}
}
var defaultValue = props.defaultValue;
var node = element;
node._wrapperState = {
initialChecked: props.checked != null ? props.checked : props.defaultChecked,
initialValue: props.value != null ? props.value : defaultValue
};
if ("development" !== 'production') {
node._wrapperState.controlled = isControlled(props);
}
},
updateWrapper: function (element, props) {
var node = element;
if ("development" !== 'production') {
var controlled = isControlled(props);
if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
"development" !== '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', getCurrentFiberOwnerName() || 'A component', props.type) : void 0;
didWarnUncontrolledToControlled = true;
}
if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
"development" !== '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', getCurrentFiberOwnerName() || 'A component', props.type) : void 0;
didWarnControlledToUncontrolled = true;
}
}
var checked = props.checked;
if (checked != null) {
DOMPropertyOperations.setValueForProperty(node, 'checked', checked || false);
}
var value = props.value;
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;
}
} 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 (element, props) {
var node = element;
// 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;
}
},
restoreControlledState: function (element, props) {
var node = element;
ReactDOMInput.updateWrapper(node, props);
updateNamedCousins(node, props);
}
};
function updateNamedCousins(rootNode, props) {
var name = props.name;
if (props.type === 'radio' && name != null) {
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. It might not even be in the
// document. Let's just use the local `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 ? "development" !== '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.
ReactDOMInput.updateWrapper(otherNode, otherInstance.memoizedProps);
}
}
}
module.exports = ReactDOMInput;
},{"112":112,"131":131,"138":138,"139":139,"21":21,"24":24,"38":38,"9":9}],29:[function(_dereq_,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 _assign = _dereq_(139);
var React = _dereq_(118);
var warning = _dereq_(138);
function flattenChildren(children) {
var content = '';
// Flatten children and warn if they aren't strings or numbers;
// invalid types are ignored.
// We can silently skip them because invalid DOM nesting warning
// catches these cases in Fiber.
React.Children.forEach(children, function (child) {
if (child == null) {
return;
}
if (typeof child === 'string' || typeof child === 'number') {
content += child;
}
});
return content;
}
/**
* Implements an <option> host component that warns when `selected` is set.
*/
var ReactDOMOption = {
mountWrapper: function (element, props) {
// TODO (yungsters): Remove support for `selected` in <option>.
if ("development" !== 'production') {
"development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
}
},
postMountWrapper: function (element, props) {
// value="" should make a value attribute (#6219)
if (props.value != null) {
element.setAttribute('value', props.value);
}
},
getHostProps: function (element, props) {
var hostProps = _assign({ children: undefined }, props);
var content = flattenChildren(props.children);
if (content) {
hostProps.children = content;
}
return hostProps;
}
};
module.exports = ReactDOMOption;
},{"118":118,"138":138,"139":139}],30:[function(_dereq_,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 _assign = _dereq_(139);
var ReactControlledValuePropTypes = _dereq_(21);
var _require = _dereq_(38),
getCurrentFiberOwnerName = _require.getCurrentFiberOwnerName;
var warning = _dereq_(138);
var didWarnValueDefaultValue = false;
function getDeclarationErrorAddendum() {
var ownerName = getCurrentFiberOwnerName();
if (ownerName) {
return '\n\nCheck the render method of `' + ownerName + '`.';
}
return '';
}
var valuePropNames = ['value', 'defaultValue'];
/**
* Validation function for `value` and `defaultValue`.
*/
function checkSelectPropTypes(props) {
ReactControlledValuePropTypes.checkPropTypes('select', props, getCurrentFiberOwnerName());
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) {
"development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum()) : void 0;
} else if (!props.multiple && isArray) {
"development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum()) : void 0;
}
}
}
function updateOptions(node, multiple, propValue) {
var options = node.options;
if (multiple) {
var selectedValues = propValue;
var selectedValue = {};
for (var i = 0; i < selectedValues.length; i++) {
selectedValue['' + selectedValues[i]] = true;
}
for (var _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.
var _selectedValue = '' + propValue;
for (var _i2 = 0; _i2 < options.length; _i2++) {
if (options[_i2].value === _selectedValue) {
options[_i2].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 (element, props) {
return _assign({}, props, {
value: undefined
});
},
mountWrapper: function (element, props) {
var node = element;
if ("development" !== 'production') {
checkSelectPropTypes(props);
}
var value = props.value;
node._wrapperState = {
initialValue: value != null ? value : props.defaultValue,
wasMultiple: Boolean(props.multiple)
};
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
"development" !== '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;
}
node.multiple = Boolean(props.multiple);
if (value != null) {
updateOptions(node, Boolean(props.multiple), value);
} else if (props.defaultValue != null) {
updateOptions(node, Boolean(props.multiple), props.defaultValue);
}
},
postUpdateWrapper: function (element, props) {
var node = element;
// After the initial mount, we control selected-ness manually so don't pass
// this value down
node._wrapperState.initialValue = undefined;
var wasMultiple = node._wrapperState.wasMultiple;
node._wrapperState.wasMultiple = Boolean(props.multiple);
var value = props.value;
if (value != null) {
updateOptions(node, Boolean(props.multiple), value);
} else if (wasMultiple !== Boolean(props.multiple)) {
// For simplicity, reapply `defaultValue` if `multiple` is toggled.
if (props.defaultValue != null) {
updateOptions(node, Boolean(props.multiple), props.defaultValue);
} else {
// Revert the select back to its default unselected state.
updateOptions(node, Boolean(props.multiple), props.multiple ? [] : '');
}
}
},
restoreControlledState: function (element, props) {
var node = element;
var value = props.value;
if (value != null) {
updateOptions(node, Boolean(props.multiple), value);
}
}
};
module.exports = ReactDOMSelect;
},{"138":138,"139":139,"21":21,"38":38}],31:[function(_dereq_,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 _prodInvariant = _dereq_(112),
_assign = _dereq_(139);
var ReactControlledValuePropTypes = _dereq_(21);
var _require = _dereq_(38),
getCurrentFiberOwnerName = _require.getCurrentFiberOwnerName;
var invariant = _dereq_(131);
var warning = _dereq_(138);
var didWarnValDefaultVal = false;
/**
* 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 (element, props) {
var node = element;
!(props.dangerouslySetInnerHTML == null) ? "development" !== '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: '' + node._wrapperState.initialValue
});
return hostProps;
},
mountWrapper: function (element, props) {
var node = element;
if ("development" !== 'production') {
ReactControlledValuePropTypes.checkPropTypes('textarea', props, getCurrentFiberOwnerName());
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
"development" !== '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 = props.value;
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 ("development" !== 'production') {
"development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
}
!(defaultValue == null) ? "development" !== '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) ? "development" !== '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;
}
node._wrapperState = {
initialValue: '' + initialValue
};
},
updateWrapper: function (element, props) {
var node = element;
var value = props.value;
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 (element, props) {
var node = element;
// This is in postMount because we need access to the DOM node, which is not
// available until after the component has mounted.
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 === node._wrapperState.initialValue) {
node.value = textContent;
}
},
restoreControlledState: function (element, props) {
// DOM component is still mounted; update
ReactDOMTextarea.updateWrapper(element, props);
}
};
module.exports = ReactDOMTextarea;
},{"112":112,"131":131,"138":138,"139":139,"21":21,"38":38}],32:[function(_dereq_,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';
// This a built-in polyfill for requestIdleCallback. It works by scheduling
// a requestAnimationFrame, store the time for the start of the frame, then
// schedule a postMessage which gets scheduled after paint. Within the
// postMessage handler do as much work as possible until time + frame rate.
// By separating the idle call into a separate event tick we ensure that
// layout, paint and other browser work is counted against the available time.
// The frame rate is dynamically adjusted.
var _prodInvariant = _dereq_(112);
var invariant = _dereq_(131);
// TODO: There's no way to cancel these, because Fiber doesn't atm.
var rAF = void 0;
var rIC = void 0;
if (typeof requestAnimationFrame !== 'function') {
!false ? "development" !== 'production' ? invariant(false, 'React depends on requestAnimationFrame. Make sure that you load a polyfill in older browsers.') : _prodInvariant('150') : void 0;
} else if (typeof requestIdleCallback !== 'function') {
// Wrap requestAnimationFrame and polyfill requestIdleCallback.
var scheduledRAFCallback = null;
var scheduledRICCallback = null;
var isIdleScheduled = false;
var isAnimationFrameScheduled = false;
var frameDeadline = 0;
// We start out assuming that we run at 30fps but then the heuristic tracking
// will adjust this value to a faster fps if we get more frequent animation
// frames.
var previousFrameTime = 33;
var activeFrameTime = 33;
var frameDeadlineObject = {
timeRemaining: typeof performance === 'object' && typeof performance.now === 'function' ? function () {
// We assume that if we have a performance timer that the rAF callback
// gets a performance timer value. Not sure if this is always true.
return frameDeadline - performance.now();
} : function () {
// As a fallback we use Date.now.
return frameDeadline - Date.now();
}
};
// We use the postMessage trick to defer idle work until after the repaint.
var messageKey = '__reactIdleCallback$' + Math.random().toString(36).slice(2);
var idleTick = function (event) {
if (event.source !== window || event.data !== messageKey) {
return;
}
isIdleScheduled = false;
var callback = scheduledRICCallback;
scheduledRICCallback = null;
if (callback) {
callback(frameDeadlineObject);
}
};
// Assumes that we have addEventListener in this environment. Might need
// something better for old IE.
window.addEventListener('message', idleTick, false);
var animationTick = function (rafTime) {
isAnimationFrameScheduled = false;
var nextFrameTime = rafTime - frameDeadline + activeFrameTime;
if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) {
if (nextFrameTime < 8) {
// Defensive coding. We don't support higher frame rates than 120hz.
// If we get lower than that, it is probably a bug.
nextFrameTime = 8;
}
// If one frame goes long, then the next one can be short to catch up.
// If two frames are short in a row, then that's an indication that we
// actually have a higher frame rate than what we're currently optimizing.
// We adjust our heuristic dynamically accordingly. For example, if we're
// running on 120hz display or 90hz VR display.
// Take the max of the two in case one of them was an anomaly due to
// missed frame deadlines.
activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime;
} else {
previousFrameTime = nextFrameTime;
}
frameDeadline = rafTime + activeFrameTime;
if (!isIdleScheduled) {
isIdleScheduled = true;
window.postMessage(messageKey, '*');
}
var callback = scheduledRAFCallback;
scheduledRAFCallback = null;
if (callback) {
callback(rafTime);
}
};
rAF = function (callback) {
// This assumes that we only schedule one callback at a time because that's
// how Fiber uses it.
scheduledRAFCallback = callback;
if (!isAnimationFrameScheduled) {
// If rIC didn't already schedule one, we need to schedule a frame.
isAnimationFrameScheduled = true;
requestAnimationFrame(animationTick);
}
return 0;
};
rIC = function (callback) {
// This assumes that we only schedule one callback at a time because that's
// how Fiber uses it.
scheduledRICCallback = callback;
if (!isAnimationFrameScheduled) {
// If rAF didn't already schedule one, we need to schedule a frame.
// TODO: If this rAF doesn't materialize because the browser throttles, we
// might want to still have setTimeout trigger rIC as a backup to ensure
// that we keep performing work.
isAnimationFrameScheduled = true;
requestAnimationFrame(animationTick);
}
return 0;
};
} else {
rAF = requestAnimationFrame;
rIC = requestIdleCallback;
}
exports.rAF = rAF;
exports.rIC = rIC;
},{"112":112,"131":131}],33:[function(_dereq_,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 = _dereq_(1);
var BeforeInputEventPlugin = _dereq_(2);
var DOMProperty = _dereq_(8);
var ChangeEventPlugin = _dereq_(5);
var DOMEventPluginOrder = _dereq_(6);
var EnterLeaveEventPlugin = _dereq_(10);
var EventPluginHub = _dereq_(11);
var EventPluginUtils = _dereq_(13);
var HTMLDOMPropertyConfig = _dereq_(16);
var ReactBrowserEventEmitter = _dereq_(18);
var ReactDOMComponentTree = _dereq_(24);
var ReactEventListener = _dereq_(43);
var SVGDOMPropertyConfig = _dereq_(74);
var SelectEventPlugin = _dereq_(75);
var SimpleEventPlugin = _dereq_(76);
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;
ReactBrowserEventEmitter.injection.injectReactEventListener(ReactEventListener);
/**
* Inject modules for resolving DOM hierarchy and plugin ordering.
*/
EventPluginHub.injection.injectEventPluginOrder(DOMEventPluginOrder);
EventPluginUtils.injection.injectComponentTree(ReactDOMComponentTree);
/**
* Some important event plugins included by default (without having to require
* them).
*/
EventPluginHub.injection.injectEventPluginsByName({
SimpleEventPlugin: SimpleEventPlugin,
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
ChangeEventPlugin: ChangeEventPlugin,
SelectEventPlugin: SelectEventPlugin,
BeforeInputEventPlugin: BeforeInputEventPlugin
});
DOMProperty.injection.injectDOMPropertyConfig(ARIADOMPropertyConfig);
DOMProperty.injection.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
DOMProperty.injection.injectDOMPropertyConfig(SVGDOMPropertyConfig);
}
module.exports = {
inject: inject
};
},{"1":1,"10":10,"11":11,"13":13,"16":16,"18":18,"2":2,"24":24,"43":43,"5":5,"6":6,"74":74,"75":75,"76":76,"8":8}],34:[function(_dereq_,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 DOMProperty = _dereq_(8);
var ReactComponentTreeHook = _dereq_(116);
var ReactDebugCurrentFiber = _dereq_(38);
var warning = _dereq_(138);
var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
function getStackAddendum(debugID) {
if (debugID != null) {
// This can only happen on Stack
return ReactComponentTreeHook.getStackAddendumByID(debugID);
} else {
// This can only happen on Fiber
return ReactDebugCurrentFiber.getCurrentFiberStackAddendum();
}
}
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) {
"development" !== 'production' ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, getStackAddendum(debugID)) : void 0;
warnedProperties[name] = true;
return true;
}
}
return true;
}
function warnInvalidARIAProps(type, props, debugID) {
var invalidProps = [];
for (var key in props) {
var isValid = validateProperty(type, key, debugID);
if (!isValid) {
invalidProps.push(key);
}
}
var unknownPropString = invalidProps.map(function (prop) {
return '`' + prop + '`';
}).join(', ');
if (invalidProps.length === 1) {
"development" !== 'production' ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum(debugID)) : void 0;
} else if (invalidProps.length > 1) {
"development" !== 'production' ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum(debugID)) : void 0;
}
}
function validateProperties(type, props, debugID /* Stack only */) {
if (type.indexOf('-') >= 0 || props.is) {
return;
}
warnInvalidARIAProps(type, props, debugID);
}
var ReactDOMInvalidARIAHook = {
// Fiber
validateProperties: validateProperties,
// Stack
onBeforeMountComponent: function (debugID, element) {
if ("development" !== 'production' && element != null && typeof element.type === 'string') {
validateProperties(element.type, element.props, debugID);
}
},
onBeforeUpdateComponent: function (debugID, element) {
if ("development" !== 'production' && element != null && typeof element.type === 'string') {
validateProperties(element.type, element.props, debugID);
}
}
};
module.exports = ReactDOMInvalidARIAHook;
},{"116":116,"138":138,"38":38,"8":8}],35:[function(_dereq_,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 ReactComponentTreeHook = _dereq_(116);
var ReactDebugCurrentFiber = _dereq_(38);
var warning = _dereq_(138);
var didWarnValueNull = false;
function getStackAddendum(debugID) {
if (debugID != null) {
// This can only happen on Stack
return ReactComponentTreeHook.getStackAddendumByID(debugID);
} else {
// This can only happen on Fiber
return ReactDebugCurrentFiber.getCurrentFiberStackAddendum();
}
}
function validateProperties(type, props, debugID /* Stack only */) {
if (type !== 'input' && type !== 'textarea' && type !== 'select') {
return;
}
if (props != null && props.value === null && !didWarnValueNull) {
"development" !== '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', type, getStackAddendum(debugID)) : void 0;
didWarnValueNull = true;
}
}
var ReactDOMNullInputValuePropHook = {
// Fiber
validateProperties: validateProperties,
// Stack
onBeforeMountComponent: function (debugID, element) {
if ("development" !== 'production' && element != null && typeof element.type === 'string') {
validateProperties(element.type, element.props, debugID);
}
},
onBeforeUpdateComponent: function (debugID, element) {
if ("development" !== 'production' && element != null && typeof element.type === 'string') {
validateProperties(element.type, element.props, debugID);
}
}
};
module.exports = ReactDOMNullInputValuePropHook;
},{"116":116,"138":138,"38":38}],36:[function(_dereq_,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 ExecutionEnvironment = _dereq_(120);
var getNodeForCharacterOffset = _dereq_(105);
var getTextContentAccessor = _dereq_(106);
/**
* 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;
},{"105":105,"106":106,"120":120}],37:[function(_dereq_,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 DOMProperty = _dereq_(8);
var EventPluginRegistry = _dereq_(12);
var ReactComponentTreeHook = _dereq_(116);
var ReactDebugCurrentFiber = _dereq_(38);
var warning = _dereq_(138);
function getStackAddendum(debugID) {
if (debugID != null) {
// This can only happen on Stack
return ReactComponentTreeHook.getStackAddendumByID(debugID);
} else {
// This can only happen on Fiber
return ReactDebugCurrentFiber.getCurrentFiberStackAddendum();
}
}
if ("development" !== 'production') {
var reactProps = {
children: true,
dangerouslySetInnerHTML: true,
key: true,
ref: true,
autoFocus: true,
defaultValue: true,
defaultChecked: 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) {
"development" !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, getStackAddendum(debugID)) : void 0;
return true;
} else if (registrationName != null) {
"development" !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, getStackAddendum(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 (type, props, debugID) {
var unknownProps = [];
for (var key in props) {
var isValid = validateProperty(type, key, debugID);
if (!isValid) {
unknownProps.push(key);
}
}
var unknownPropString = unknownProps.map(function (prop) {
return '`' + prop + '`';
}).join(', ');
if (unknownProps.length === 1) {
"development" !== '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, type, getStackAddendum(debugID)) : void 0;
} else if (unknownProps.length > 1) {
"development" !== '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, type, getStackAddendum(debugID)) : void 0;
}
};
function validateProperties(type, props, debugID /* Stack only */) {
if (type.indexOf('-') >= 0 || props.is) {
return;
}
warnUnknownProperties(type, props, debugID);
}
var ReactDOMUnknownPropertyHook = {
// Fiber
validateProperties: validateProperties,
// Stack
onBeforeMountComponent: function (debugID, element) {
if ("development" !== 'production' && element != null && typeof element.type === 'string') {
validateProperties(element.type, element.props, debugID);
}
},
onBeforeUpdateComponent: function (debugID, element) {
if ("development" !== 'production' && element != null && typeof element.type === 'string') {
validateProperties(element.type, element.props, debugID);
}
}
};
module.exports = ReactDOMUnknownPropertyHook;
},{"116":116,"12":12,"138":138,"38":38,"8":8}],38:[function(_dereq_,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';
if ("development" !== 'production') {
var getComponentName = _dereq_(98);
var _require = _dereq_(116),
getStackAddendumByWorkInProgressFiber = _require.getStackAddendumByWorkInProgressFiber;
}
function getCurrentFiberOwnerName() {
if ("development" !== 'production') {
var fiber = ReactDebugCurrentFiber.current;
if (fiber === null) {
return null;
}
if (fiber._debugOwner != null) {
return getComponentName(fiber._debugOwner);
}
}
return null;
}
function getCurrentFiberStackAddendum() {
if ("development" !== 'production') {
var fiber = ReactDebugCurrentFiber.current;
if (fiber === null) {
return null;
}
// Safe because if current fiber exists, we are reconciling,
// and it is guaranteed to be the work-in-progress version.
return getStackAddendumByWorkInProgressFiber(fiber);
}
return null;
}
var ReactDebugCurrentFiber = {
current: null,
getCurrentFiberOwnerName: getCurrentFiberOwnerName,
getCurrentFiberStackAddendum: getCurrentFiberStackAddendum
};
module.exports = ReactDebugCurrentFiber;
},{"116":116,"98":98}],39:[function(_dereq_,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 ReactInvalidSetStateWarningHook = _dereq_(66);
var ReactHostOperationHistoryHook = _dereq_(62);
var ReactComponentTreeHook = _dereq_(116);
var ExecutionEnvironment = _dereq_(120);
var performanceNow = _dereq_(136);
var warning = _dereq_(138);
// Trust the developer to only use this with a __DEV__ check
var ReactDebugTool = null;
if ("development" !== 'production') {
var hooks = [];
var didHookThrowForEvent = {};
var callHook = function (event, fn, context, arg1, arg2, arg3, arg4, arg5) {
try {
fn.call(context, arg1, arg2, arg3, arg4, arg5);
} catch (e) {
"development" !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
didHookThrowForEvent[event] = true;
}
};
var emitEvent = function (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;
var clearHistory = function () {
ReactComponentTreeHook.purgeUnmountedComponents();
ReactHostOperationHistoryHook.clearHistory();
};
var getTreeSnapshot = function (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;
}, {});
};
var resetMeasurements = function () {
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 = [];
};
var checkDebugID = function (debugID) {
var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (allowRoot && debugID === 0) {
return;
}
if (!debugID) {
"development" !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
}
};
var beginLifeCycleTimer = function (debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
if (currentTimerType && !lifeCycleTimerHasWarned) {
"development" !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code.' + '\n\nDid 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;
};
var endLifeCycleTimer = function (debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
"development" !== '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;
};
var pauseCurrentLifeCycleTimer = function () {
var currentTimer = {
startTime: currentTimerStartTime,
nestedFlushStartTime: performanceNow(),
debugID: currentTimerDebugID,
timerType: currentTimerType
};
lifeCycleTimerStack.push(currentTimer);
currentTimerStartTime = 0;
currentTimerNestedFlushDuration = 0;
currentTimerDebugID = null;
currentTimerType = null;
};
var resumeCurrentLifeCycleTimer = function () {
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';
var shouldMark = function (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;
};
var markBegin = function (debugID, markType) {
if (!shouldMark(debugID)) {
return;
}
var markName = debugID + '::' + markType;
lastMarkTimeStamp = performanceNow();
performance.mark(markName);
};
var markEnd = function (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);
};
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');
}
};
ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
ReactDebugTool.addHook(ReactComponentTreeHook);
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
if (/[?&]react_perf\b/.test(url)) {
ReactDebugTool.beginProfiling();
}
}
module.exports = ReactDebugTool;
},{"116":116,"120":120,"136":136,"138":138,"62":62,"66":66}],40:[function(_dereq_,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;
},{}],41:[function(_dereq_,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 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 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 ("development" !== '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 = function () {
func(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;
},{}],42:[function(_dereq_,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 EventPluginHub = _dereq_(11);
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;
},{"11":11}],43:[function(_dereq_,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 _assign = _dereq_(139);
var EventListener = _dereq_(119);
var ExecutionEnvironment = _dereq_(120);
var PooledClass = _dereq_(17);
var ReactDOMComponentTree = _dereq_(24);
var ReactGenericBatching = _dereq_(61);
var ReactTypeOfWork = _dereq_(73);
var getEventTarget = _dereq_(103);
var getUnboundedScrollPosition = _dereq_(128);
var HostRoot = ReactTypeOfWork.HostRoot;
/**
* 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 findRootContainerNode(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.
if (typeof inst.tag === 'number') {
while (inst['return']) {
inst = inst['return'];
}
if (inst.tag !== HostRoot) {
// This can happen if we're in a detached tree.
return null;
}
return inst.stateNode.containerInfo;
} else {
while (inst._hostParent) {
inst = inst._hostParent;
}
var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
return rootNode.parentNode;
}
}
// Used to store ancestor hierarchy in top level callback
function TopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) {
this.topLevelType = topLevelType;
this.nativeEvent = nativeEvent;
this.targetInst = targetInst;
this.ancestors = [];
}
_assign(TopLevelCallbackBookKeeping.prototype, {
destructor: function () {
this.topLevelType = null;
this.nativeEvent = null;
this.targetInst = null;
this.ancestors.length = 0;
}
});
PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.threeArgumentPooler);
function handleTopLevelImpl(bookKeeping) {
var targetInst = bookKeeping.targetInst;
// 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 {
if (!ancestor) {
bookKeeping.ancestors.push(ancestor);
break;
}
var root = findRootContainerNode(ancestor);
if (!root) {
break;
}
bookKeeping.ancestors.push(ancestor);
ancestor = ReactDOMComponentTree.getClosestInstanceFromNode(root);
} 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 nativeEventTarget = getEventTarget(nativeEvent);
var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent, targetInst);
try {
// Event queue being processed in the same cycle allows
// `preventDefault`.
ReactGenericBatching.batchedUpdates(handleTopLevelImpl, bookKeeping);
} finally {
TopLevelCallbackBookKeeping.release(bookKeeping);
}
}
};
module.exports = ReactEventListener;
},{"103":103,"119":119,"120":120,"128":128,"139":139,"17":17,"24":24,"61":61,"73":73}],44:[function(_dereq_,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,
prepareNewChildrenBeforeUnmountInStack: true,
disableNewFiberFeatures: false
};
module.exports = ReactFeatureFlags;
},{}],45:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var ReactTypeOfWork = _dereq_(73);
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
ClassComponent = ReactTypeOfWork.ClassComponent,
HostRoot = ReactTypeOfWork.HostRoot,
HostComponent = ReactTypeOfWork.HostComponent,
HostText = ReactTypeOfWork.HostText,
HostPortal = ReactTypeOfWork.HostPortal,
CoroutineComponent = ReactTypeOfWork.CoroutineComponent,
YieldComponent = ReactTypeOfWork.YieldComponent,
Fragment = ReactTypeOfWork.Fragment;
var _require = _dereq_(68),
NoWork = _require.NoWork;
var _require2 = _dereq_(72),
NoEffect = _require2.NoEffect;
var _require3 = _dereq_(60),
cloneUpdateQueue = _require3.cloneUpdateQueue;
var invariant = _dereq_(131);
if ("development" !== 'production') {
var getComponentName = _dereq_(98);
}
// A Fiber is work on a Component that needs to be done or was done. There can
// be more than one per component.
if ("development" !== 'production') {
var debugCounter = 1;
}
// This is a constructor of a POJO instead of a constructor function for a few
// reasons:
// 1) Nobody should add any instance methods on this. Instance methods can be
// more difficult to predict when they get optimized and they are almost
// never inlined properly in static compilers.
// 2) Nobody should rely on `instanceof Fiber` for type testing. We should
// always know when it is a fiber.
// 3) We can easily go from a createFiber call to calling a constructor if that
// is faster. The opposite is not true.
// 4) We might want to experiment with using numeric keys since they are easier
// to optimize in a non-JIT environment.
// 5) It should be easy to port this to a C struct and keep a C implementation
// compatible.
var createFiber = function (tag, key) {
var fiber = {
// Instance
tag: tag,
key: key,
type: null,
stateNode: null,
// Fiber
'return': null,
child: null,
sibling: null,
index: 0,
ref: null,
pendingProps: null,
memoizedProps: null,
updateQueue: null,
memoizedState: null,
effectTag: NoEffect,
nextEffect: null,
firstEffect: null,
lastEffect: null,
pendingWorkPriority: NoWork,
progressedPriority: NoWork,
progressedChild: null,
progressedFirstDeletion: null,
progressedLastDeletion: null,
alternate: null
};
if ("development" !== 'production') {
fiber._debugID = debugCounter++;
fiber._debugSource = null;
fiber._debugOwner = null;
}
return fiber;
};
function shouldConstruct(Component) {
return !!(Component.prototype && Component.prototype.isReactComponent);
}
// This is used to create an alternate fiber to do work on.
// TODO: Rename to createWorkInProgressFiber or something like that.
exports.cloneFiber = function (fiber, priorityLevel) {
// We clone to get a work in progress. That means that this fiber is the
// current. To make it safe to reuse that fiber later on as work in progress
// we need to reset its work in progress flag now. We don't have an
// opportunity to do this earlier since we don't traverse the tree when
// the work in progress tree becomes the current tree.
// fiber.progressedPriority = NoWork;
// fiber.progressedChild = null;
// We use a double buffering pooling technique because we know that we'll only
// ever need at most two versions of a tree. We pool the "other" unused node
// that we're free to reuse. This is lazily created to avoid allocating extra
// objects for things that are never updated. It also allow us to reclaim the
// extra memory if needed.
var alt = fiber.alternate;
if (alt !== null) {
// If we clone, then we do so from the "current" state. The current state
// can't have any side-effects that are still valid so we reset just to be
// sure.
alt.effectTag = NoEffect;
alt.nextEffect = null;
alt.firstEffect = null;
alt.lastEffect = null;
} else {
// This should not have an alternate already
alt = createFiber(fiber.tag, fiber.key);
alt.type = fiber.type;
alt.progressedChild = fiber.progressedChild;
alt.progressedPriority = fiber.progressedPriority;
alt.alternate = fiber;
fiber.alternate = alt;
}
alt.stateNode = fiber.stateNode;
alt.child = fiber.child;
alt.sibling = fiber.sibling; // This should always be overridden. TODO: null
alt.index = fiber.index; // This should always be overridden.
alt.ref = fiber.ref;
// pendingProps is here for symmetry but is unnecessary in practice for now.
// TODO: Pass in the new pendingProps as an argument maybe?
alt.pendingProps = fiber.pendingProps;
cloneUpdateQueue(fiber, alt);
alt.pendingWorkPriority = priorityLevel;
alt.memoizedProps = fiber.memoizedProps;
alt.memoizedState = fiber.memoizedState;
if ("development" !== 'production') {
alt._debugID = fiber._debugID;
alt._debugSource = fiber._debugSource;
alt._debugOwner = fiber._debugOwner;
}
return alt;
};
exports.createHostRootFiber = function () {
var fiber = createFiber(HostRoot, null);
return fiber;
};
exports.createFiberFromElement = function (element, priorityLevel) {
var owner = null;
if ("development" !== 'production') {
owner = element._owner;
}
var fiber = createFiberFromElementType(element.type, element.key, owner);
fiber.pendingProps = element.props;
fiber.pendingWorkPriority = priorityLevel;
if ("development" !== 'production') {
fiber._debugSource = element._source;
fiber._debugOwner = element._owner;
}
return fiber;
};
exports.createFiberFromFragment = function (elements, priorityLevel) {
// TODO: Consider supporting keyed fragments. Technically, we accidentally
// support that in the existing React.
var fiber = createFiber(Fragment, null);
fiber.pendingProps = elements;
fiber.pendingWorkPriority = priorityLevel;
return fiber;
};
exports.createFiberFromText = function (content, priorityLevel) {
var fiber = createFiber(HostText, null);
fiber.pendingProps = content;
fiber.pendingWorkPriority = priorityLevel;
return fiber;
};
function createFiberFromElementType(type, key, debugOwner) {
var fiber = void 0;
if (typeof type === 'function') {
fiber = shouldConstruct(type) ? createFiber(ClassComponent, key) : createFiber(IndeterminateComponent, key);
fiber.type = type;
} else if (typeof type === 'string') {
fiber = createFiber(HostComponent, key);
fiber.type = type;
} else if (typeof type === 'object' && type !== null && typeof type.tag === 'number') {
// Currently assumed to be a continuation and therefore is a fiber already.
// TODO: The yield system is currently broken for updates in some cases.
// The reified yield stores a fiber, but we don't know which fiber that is;
// the current or a workInProgress? When the continuation gets rendered here
// we don't know if we can reuse that fiber or if we need to clone it.
// There is probably a clever way to restructure this.
fiber = type;
} else {
var info = '';
if ("development" !== '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.';
}
var ownerName = debugOwner ? getComponentName(debugOwner) : null;
if (ownerName) {
info += '\n\nCheck the render method of `' + ownerName + '`.';
}
}
!false ? "development" !== '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;
}
return fiber;
}
exports.createFiberFromElementType = createFiberFromElementType;
exports.createFiberFromCoroutine = function (coroutine, priorityLevel) {
var fiber = createFiber(CoroutineComponent, coroutine.key);
fiber.type = coroutine.handler;
fiber.pendingProps = coroutine;
fiber.pendingWorkPriority = priorityLevel;
return fiber;
};
exports.createFiberFromYield = function (yieldNode, priorityLevel) {
var fiber = createFiber(YieldComponent, null);
return fiber;
};
exports.createFiberFromPortal = function (portal, priorityLevel) {
var fiber = createFiber(HostPortal, portal.key);
fiber.pendingProps = portal.children || [];
fiber.pendingWorkPriority = priorityLevel;
fiber.stateNode = {
containerInfo: portal.containerInfo,
implementation: portal.implementation
};
return fiber;
};
},{"112":112,"131":131,"60":60,"68":68,"72":72,"73":73,"98":98}],46:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var _require = _dereq_(19),
mountChildFibersInPlace = _require.mountChildFibersInPlace,
reconcileChildFibers = _require.reconcileChildFibers,
reconcileChildFibersInPlace = _require.reconcileChildFibersInPlace,
cloneChildFibers = _require.cloneChildFibers;
var _require2 = _dereq_(60),
beginUpdateQueue = _require2.beginUpdateQueue;
var ReactTypeOfWork = _dereq_(73);
var _require3 = _dereq_(50),
getMaskedContext = _require3.getMaskedContext,
getUnmaskedContext = _require3.getUnmaskedContext,
hasContextChanged = _require3.hasContextChanged,
pushContextProvider = _require3.pushContextProvider,
pushTopLevelContextObject = _require3.pushTopLevelContextObject,
invalidateContextProvider = _require3.invalidateContextProvider;
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
ClassComponent = ReactTypeOfWork.ClassComponent,
HostRoot = ReactTypeOfWork.HostRoot,
HostComponent = ReactTypeOfWork.HostComponent,
HostText = ReactTypeOfWork.HostText,
HostPortal = ReactTypeOfWork.HostPortal,
CoroutineComponent = ReactTypeOfWork.CoroutineComponent,
CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase,
YieldComponent = ReactTypeOfWork.YieldComponent,
Fragment = ReactTypeOfWork.Fragment;
var _require4 = _dereq_(68),
NoWork = _require4.NoWork,
OffscreenPriority = _require4.OffscreenPriority;
var _require5 = _dereq_(72),
Placement = _require5.Placement,
ContentReset = _require5.ContentReset,
Err = _require5.Err,
Ref = _require5.Ref;
var ReactCurrentOwner = _dereq_(117);
var ReactFiberClassComponent = _dereq_(47);
var invariant = _dereq_(131);
if ("development" !== 'production') {
var ReactDebugCurrentFiber = _dereq_(38);
var warning = _dereq_(138);
var warnedAboutStatelessRefs = {};
}
module.exports = function (config, hostContext, scheduleUpdate, getPriorityContext) {
var shouldSetTextContent = config.shouldSetTextContent;
var pushHostContext = hostContext.pushHostContext,
pushHostContainer = hostContext.pushHostContainer;
var _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState),
adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance,
constructClassInstance = _ReactFiberClassCompo.constructClassInstance,
mountClassInstance = _ReactFiberClassCompo.mountClassInstance,
resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance,
updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
function markChildAsProgressed(current, workInProgress, priorityLevel) {
// We now have clones. Let's store them as the currently progressed work.
workInProgress.progressedChild = workInProgress.child;
workInProgress.progressedPriority = priorityLevel;
if (current !== null) {
// We also store it on the current. When the alternate swaps in we can
// continue from this point.
current.progressedChild = workInProgress.progressedChild;
current.progressedPriority = workInProgress.progressedPriority;
}
}
function clearDeletions(workInProgress) {
workInProgress.progressedFirstDeletion = workInProgress.progressedLastDeletion = null;
}
function transferDeletions(workInProgress) {
// Any deletions get added first into the effect list.
workInProgress.firstEffect = workInProgress.progressedFirstDeletion;
workInProgress.lastEffect = workInProgress.progressedLastDeletion;
}
function reconcileChildren(current, workInProgress, nextChildren) {
var priorityLevel = workInProgress.pendingWorkPriority;
reconcileChildrenAtPriority(current, workInProgress, nextChildren, priorityLevel);
}
function reconcileChildrenAtPriority(current, workInProgress, nextChildren, priorityLevel) {
// At this point any memoization is no longer valid since we'll have changed
// the children.
workInProgress.memoizedProps = null;
if (current === null) {
// If this is a fresh new component that hasn't been rendered yet, we
// won't update its child set by applying minimal side-effects. Instead,
// we will add them all to the child before it gets rendered. That means
// we can optimize this reconciliation pass by not tracking side-effects.
workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel);
} else if (current.child === workInProgress.child) {
// If the current child is the same as the work in progress, it means that
// we haven't yet started any work on these children. Therefore, we use
// the clone algorithm to create a copy of all the current children.
// If we had any progressed work already, that is invalid at this point so
// let's throw it out.
clearDeletions(workInProgress);
workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel);
transferDeletions(workInProgress);
} else {
// If, on the other hand, it is already using a clone, that means we've
// already begun some work on this tree and we can continue where we left
// off by reconciling against the existing children.
workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel);
transferDeletions(workInProgress);
}
markChildAsProgressed(current, workInProgress, priorityLevel);
}
function updateFragment(current, workInProgress) {
var nextChildren = workInProgress.pendingProps;
if (hasContextChanged()) {
// Normally we can bail out on props equality but if context has changed
// we don't do the bailout and we have to reuse existing props instead.
if (nextChildren === null) {
nextChildren = workInProgress.memoizedProps;
}
} else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) {
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
reconcileChildren(current, workInProgress, nextChildren);
memoizeProps(workInProgress, nextChildren);
return workInProgress.child;
}
function markRef(current, workInProgress) {
var ref = workInProgress.ref;
if (ref !== null && (!current || current.ref !== ref)) {
// Schedule a Ref effect
workInProgress.effectTag |= Ref;
}
}
function updateFunctionalComponent(current, workInProgress) {
var fn = workInProgress.type;
var nextProps = workInProgress.pendingProps;
var memoizedProps = workInProgress.memoizedProps;
if (hasContextChanged()) {
// Normally we can bail out on props equality but if context has changed
// we don't do the bailout and we have to reuse existing props instead.
if (nextProps === null) {
nextProps = memoizedProps;
}
} else {
if (nextProps === null || memoizedProps === nextProps) {
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
// TODO: Disable this before release, since it is not part of the public API
// I use this for testing to compare the relative overhead of classes.
if (typeof fn.shouldComponentUpdate === 'function' && !fn.shouldComponentUpdate(memoizedProps, nextProps)) {
// Memoize props even if shouldComponentUpdate returns false
memoizeProps(workInProgress, nextProps);
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
}
var unmaskedContext = getUnmaskedContext(workInProgress);
var context = getMaskedContext(workInProgress, unmaskedContext);
var nextChildren;
if ("development" !== 'production') {
ReactCurrentOwner.current = workInProgress;
nextChildren = fn(nextProps, context);
} else {
nextChildren = fn(nextProps, context);
}
reconcileChildren(current, workInProgress, nextChildren);
memoizeProps(workInProgress, nextProps);
return workInProgress.child;
}
function updateClassComponent(current, workInProgress, priorityLevel) {
// Push context providers early to prevent context stack mismatches.
// During mounting we don't know the child context yet as the instance doesn't exist.
// We will invalidate the child context in finishClassComponent() right after rendering.
var hasContext = pushContextProvider(workInProgress);
var shouldUpdate = void 0;
if (current === null) {
if (!workInProgress.stateNode) {
// In the initial pass we might need to construct the instance.
constructClassInstance(workInProgress);
mountClassInstance(workInProgress, priorityLevel);
shouldUpdate = true;
} else {
// In a resume, we'll already have an instance we can reuse.
shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel);
}
} else {
shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel);
}
return finishClassComponent(current, workInProgress, shouldUpdate, hasContext);
}
function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) {
// Refs should update even if shouldComponentUpdate returns false
markRef(current, workInProgress);
if (!shouldUpdate) {
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
var instance = workInProgress.stateNode;
// Rerender
ReactCurrentOwner.current = workInProgress;
var nextChildren = instance.render();
reconcileChildren(current, workInProgress, nextChildren);
// Memoize props and state using the values we just used to render.
// TODO: Restructure so we never read values from the instance.
memoizeState(workInProgress, instance.state);
memoizeProps(workInProgress, instance.props);
// The context might have changed so we need to recalculate it.
if (hasContext) {
invalidateContextProvider(workInProgress);
}
return workInProgress.child;
}
function updateHostRoot(current, workInProgress, priorityLevel) {
var root = workInProgress.stateNode;
if (root.pendingContext) {
pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
} else if (root.context) {
// Should always be set
pushTopLevelContextObject(workInProgress, root.context, false);
}
pushHostContainer(workInProgress, root.containerInfo);
var updateQueue = workInProgress.updateQueue;
if (updateQueue !== null) {
var prevState = workInProgress.memoizedState;
var state = beginUpdateQueue(workInProgress, updateQueue, null, prevState, null, priorityLevel);
if (prevState === state) {
// If the state is the same as before, that's a bailout because we had
// no work matching this priority.
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
var element = state.element;
reconcileChildren(current, workInProgress, element);
memoizeState(workInProgress, state);
return workInProgress.child;
}
// If there is no update queue, that's a bailout because the root has no props.
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
function updateHostComponent(current, workInProgress) {
pushHostContext(workInProgress);
var nextProps = workInProgress.pendingProps;
var prevProps = current !== null ? current.memoizedProps : null;
var memoizedProps = workInProgress.memoizedProps;
if (hasContextChanged()) {
// Normally we can bail out on props equality but if context has changed
// we don't do the bailout and we have to reuse existing props instead.
if (nextProps === null) {
nextProps = memoizedProps;
!(nextProps !== null) ? "development" !== 'production' ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('159') : void 0;
}
} else if (nextProps === null || memoizedProps === nextProps) {
if (memoizedProps.hidden && workInProgress.pendingWorkPriority !== OffscreenPriority) {
// This subtree still has work, but it should be deprioritized so we need
// to bail out and not do any work yet.
// TODO: It would be better if this tree got its correct priority set
// during scheduleUpdate instead because otherwise we'll start a higher
// priority reconciliation first before we can get down here. However,
// that is a bit tricky since workInProgress and current can have
// different "hidden" settings.
var child = workInProgress.progressedChild;
while (child !== null) {
// To ensure that this subtree gets its priority reset, the children
// need to be reset.
child.pendingWorkPriority = OffscreenPriority;
child = child.sibling;
}
return null;
}
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
var nextChildren = nextProps.children;
var isDirectTextChild = shouldSetTextContent(nextProps);
if (isDirectTextChild) {
// We special case a direct text child of a host node. This is a common
// case. We won't handle it as a reified child. We will instead handle
// this in the host environment that also have access to this prop. That
// avoids allocating another HostText fiber and traversing it.
nextChildren = null;
} else if (prevProps && shouldSetTextContent(prevProps)) {
// If we're switching from a direct text child to a normal child, or to
// empty, we need to schedule the text content to be reset.
workInProgress.effectTag |= ContentReset;
}
markRef(current, workInProgress);
if (nextProps.hidden && workInProgress.pendingWorkPriority !== OffscreenPriority) {
// If this host component is hidden, we can bail out on the children.
// We'll rerender the children later at the lower priority.
// It is unfortunate that we have to do the reconciliation of these
// children already since that will add them to the tree even though
// they are not actually done yet. If this is a large set it is also
// confusing that this takes time to do right now instead of later.
if (workInProgress.progressedPriority === OffscreenPriority) {
// If we already made some progress on the offscreen priority before,
// then we should continue from where we left off.
workInProgress.child = workInProgress.progressedChild;
}
// Reconcile the children and stash them for later work.
reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority);
memoizeProps(workInProgress, nextProps);
workInProgress.child = current !== null ? current.child : null;
if (current === null) {
// If this doesn't have a current we won't track it for placement
// effects. However, when we come back around to this we have already
// inserted the parent which means that we'll infact need to make this a
// placement.
// TODO: There has to be a better solution to this problem.
var _child = workInProgress.progressedChild;
while (_child !== null) {
_child.effectTag = Placement;
_child = _child.sibling;
}
}
// Abort and don't process children yet.
return null;
} else {
reconcileChildren(current, workInProgress, nextChildren);
memoizeProps(workInProgress, nextProps);
return workInProgress.child;
}
}
function updateHostText(current, workInProgress) {
var nextProps = workInProgress.pendingProps;
if (nextProps === null) {
nextProps = workInProgress.memoizedProps;
}
memoizeProps(workInProgress, nextProps);
// Nothing to do here. This is terminal. We'll do the completion step
// immediately after.
return null;
}
function mountIndeterminateComponent(current, workInProgress, priorityLevel) {
!(current === null) ? "development" !== 'production' ? invariant(false, 'An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('160') : void 0;
var fn = workInProgress.type;
var props = workInProgress.pendingProps;
var unmaskedContext = getUnmaskedContext(workInProgress);
var context = getMaskedContext(workInProgress, unmaskedContext);
var value;
if ("development" !== 'production') {
ReactCurrentOwner.current = workInProgress;
value = fn(props, context);
} else {
value = fn(props, context);
}
if (typeof value === 'object' && value !== null && typeof value.render === 'function') {
// Proceed under the assumption that this is a class instance
workInProgress.tag = ClassComponent;
// Push context providers early to prevent context stack mismatches.
// During mounting we don't know the child context yet as the instance doesn't exist.
// We will invalidate the child context in finishClassComponent() right after rendering.
var hasContext = pushContextProvider(workInProgress);
adoptClassInstance(workInProgress, value);
mountClassInstance(workInProgress, priorityLevel);
return finishClassComponent(current, workInProgress, true, hasContext);
} else {
// Proceed under the assumption that this is a functional component
workInProgress.tag = FunctionalComponent;
if ("development" !== 'production') {
if (workInProgress.ref !== null) {
var info = '';
var ownerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName();
if (ownerName) {
info += '\n\nCheck the render method of `' + ownerName + '`.';
}
var warningKey = ownerName || workInProgress._debugID || '';
var debugSource = workInProgress._debugSource;
if (debugSource) {
warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
}
if (!warnedAboutStatelessRefs[warningKey]) {
warnedAboutStatelessRefs[warningKey] = true;
"development" !== 'production' ? warning(false, 'Stateless function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s%s', info, ReactDebugCurrentFiber.getCurrentFiberStackAddendum()) : void 0;
}
}
}
reconcileChildren(current, workInProgress, value);
memoizeProps(workInProgress, props);
return workInProgress.child;
}
}
function updateCoroutineComponent(current, workInProgress) {
var nextCoroutine = workInProgress.pendingProps;
if (hasContextChanged()) {
// Normally we can bail out on props equality but if context has changed
// we don't do the bailout and we have to reuse existing props instead.
if (nextCoroutine === null) {
nextCoroutine = current && current.memoizedProps;
!(nextCoroutine !== null) ? "development" !== 'production' ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('159') : void 0;
}
} else if (nextCoroutine === null || workInProgress.memoizedProps === nextCoroutine) {
nextCoroutine = workInProgress.memoizedProps;
// TODO: When bailing out, we might need to return the stateNode instead
// of the child. To check it for work.
// return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
var nextChildren = nextCoroutine.children;
var priorityLevel = workInProgress.pendingWorkPriority;
// The following is a fork of reconcileChildrenAtPriority but using
// stateNode to store the child.
// At this point any memoization is no longer valid since we'll have changed
// the children.
workInProgress.memoizedProps = null;
if (current === null) {
workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel);
} else if (current.child === workInProgress.child) {
clearDeletions(workInProgress);
workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel);
transferDeletions(workInProgress);
} else {
workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel);
transferDeletions(workInProgress);
}
memoizeProps(workInProgress, nextCoroutine);
// This doesn't take arbitrary time so we could synchronously just begin
// eagerly do the work of workInProgress.child as an optimization.
return workInProgress.stateNode;
}
function updatePortalComponent(current, workInProgress) {
pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
var priorityLevel = workInProgress.pendingWorkPriority;
var nextChildren = workInProgress.pendingProps;
if (hasContextChanged()) {
// Normally we can bail out on props equality but if context has changed
// we don't do the bailout and we have to reuse existing props instead.
if (nextChildren === null) {
nextChildren = current && current.memoizedProps;
!(nextChildren != null) ? "development" !== 'production' ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('159') : void 0;
}
} else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) {
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
if (current === null) {
// Portals are special because we don't append the children during mount
// but at commit. Therefore we need to track insertions which the normal
// flow doesn't do during mount. This doesn't happen at the root because
// the root always starts with a "current" with a null child.
// TODO: Consider unifying this with how the root works.
workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel);
memoizeProps(workInProgress, nextChildren);
markChildAsProgressed(current, workInProgress, priorityLevel);
} else {
reconcileChildren(current, workInProgress, nextChildren);
memoizeProps(workInProgress, nextChildren);
}
return workInProgress.child;
}
/*
function reuseChildrenEffects(returnFiber : Fiber, firstChild : Fiber) {
let child = firstChild;
do {
// Ensure that the first and last effect of the parent corresponds
// to the children's first and last effect.
if (!returnFiber.firstEffect) {
returnFiber.firstEffect = child.firstEffect;
}
if (child.lastEffect) {
if (returnFiber.lastEffect) {
returnFiber.lastEffect.nextEffect = child.firstEffect;
}
returnFiber.lastEffect = child.lastEffect;
}
} while (child = child.sibling);
}
*/
function bailoutOnAlreadyFinishedWork(current, workInProgress) {
var priorityLevel = workInProgress.pendingWorkPriority;
// TODO: We should ideally be able to bail out early if the children have no
// more work to do. However, since we don't have a separation of this
// Fiber's priority and its children yet - we don't know without doing lots
// of the same work we do anyway. Once we have that separation we can just
// bail out here if the children has no more work at this priority level.
// if (workInProgress.priorityOfChildren <= priorityLevel) {
// // If there are side-effects in these children that have not yet been
// // committed we need to ensure that they get properly transferred up.
// if (current && current.child !== workInProgress.child) {
// reuseChildrenEffects(workInProgress, child);
// }
// return null;
// }
if (current && workInProgress.child === current.child) {
// If we had any progressed work already, that is invalid at this point so
// let's throw it out.
clearDeletions(workInProgress);
}
cloneChildFibers(current, workInProgress);
markChildAsProgressed(current, workInProgress, priorityLevel);
return workInProgress.child;
}
function bailoutOnLowPriority(current, workInProgress) {
// TODO: Handle HostComponent tags here as well and call pushHostContext()?
// See PR 8590 discussion for context
switch (workInProgress.tag) {
case ClassComponent:
pushContextProvider(workInProgress);
break;
case HostPortal:
pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
break;
}
// TODO: What if this is currently in progress?
// How can that happen? How is this not being cloned?
return null;
}
function memoizeProps(workInProgress, nextProps) {
workInProgress.memoizedProps = nextProps;
// Reset the pending props
workInProgress.pendingProps = null;
}
function memoizeState(workInProgress, nextState) {
workInProgress.memoizedState = nextState;
// Don't reset the updateQueue, in case there are pending updates. Resetting
// is handled by beginUpdateQueue.
}
function beginWork(current, workInProgress, priorityLevel) {
if (workInProgress.pendingWorkPriority === NoWork || workInProgress.pendingWorkPriority > priorityLevel) {
return bailoutOnLowPriority(current, workInProgress);
}
if ("development" !== 'production') {
ReactDebugCurrentFiber.current = workInProgress;
}
// If we don't bail out, we're going be recomputing our children so we need
// to drop our effect list.
workInProgress.firstEffect = null;
workInProgress.lastEffect = null;
if (workInProgress.progressedPriority === priorityLevel) {
// If we have progressed work on this priority level already, we can
// proceed this that as the child.
workInProgress.child = workInProgress.progressedChild;
}
switch (workInProgress.tag) {
case IndeterminateComponent:
return mountIndeterminateComponent(current, workInProgress, priorityLevel);
case FunctionalComponent:
return updateFunctionalComponent(current, workInProgress);
case ClassComponent:
return updateClassComponent(current, workInProgress, priorityLevel);
case HostRoot:
return updateHostRoot(current, workInProgress, priorityLevel);
case HostComponent:
return updateHostComponent(current, workInProgress);
case HostText:
return updateHostText(current, workInProgress);
case CoroutineHandlerPhase:
// This is a restart. Reset the tag to the initial phase.
workInProgress.tag = CoroutineComponent;
// Intentionally fall through since this is now the same.
case CoroutineComponent:
return updateCoroutineComponent(current, workInProgress);
case YieldComponent:
// A yield component is just a placeholder, we can just run through the
// next one immediately.
return null;
case HostPortal:
return updatePortalComponent(current, workInProgress);
case Fragment:
return updateFragment(current, workInProgress);
default:
!false ? "development" !== 'production' ? invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('161') : void 0;
}
}
function beginFailedWork(current, workInProgress, priorityLevel) {
!(workInProgress.tag === ClassComponent || workInProgress.tag === HostRoot) ? "development" !== 'production' ? invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('162') : void 0;
// Add an error effect so we can handle the error during the commit phase
workInProgress.effectTag |= Err;
if (workInProgress.pendingWorkPriority === NoWork || workInProgress.pendingWorkPriority > priorityLevel) {
return bailoutOnLowPriority(current, workInProgress);
}
// If we don't bail out, we're going be recomputing our children so we need
// to drop our effect list.
workInProgress.firstEffect = null;
workInProgress.lastEffect = null;
// Unmount the current children as if the component rendered null
var nextChildren = null;
reconcileChildren(current, workInProgress, nextChildren);
if (workInProgress.tag === ClassComponent) {
var instance = workInProgress.stateNode;
workInProgress.memoizedProps = instance.props;
workInProgress.memoizedState = instance.state;
workInProgress.pendingProps = null;
}
return workInProgress.child;
}
return {
beginWork: beginWork,
beginFailedWork: beginFailedWork
};
};
},{"112":112,"117":117,"131":131,"138":138,"19":19,"38":38,"47":47,"50":50,"60":60,"68":68,"72":72,"73":73}],47:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var _require = _dereq_(72),
Update = _require.Update;
var _require2 = _dereq_(50),
cacheContext = _require2.cacheContext,
getMaskedContext = _require2.getMaskedContext,
getUnmaskedContext = _require2.getUnmaskedContext,
isContextConsumer = _require2.isContextConsumer;
var _require3 = _dereq_(60),
addUpdate = _require3.addUpdate,
addReplaceUpdate = _require3.addReplaceUpdate,
addForceUpdate = _require3.addForceUpdate,
beginUpdateQueue = _require3.beginUpdateQueue;
var _require4 = _dereq_(50),
hasContextChanged = _require4.hasContextChanged;
var _require5 = _dereq_(59),
getComponentName = _require5.getComponentName,
isMounted = _require5.isMounted;
var ReactInstanceMap = _dereq_(64);
var emptyObject = _dereq_(125);
var shallowEqual = _dereq_(137);
var invariant = _dereq_(131);
var isArray = Array.isArray;
if ("development" !== 'production') {
var warning = _dereq_(138);
var warnOnInvalidCallback = function (callback, callerName) {
"development" !== 'production' ? warning(callback === null || typeof callback === 'function', '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, String(callback)) : void 0;
};
}
module.exports = function (scheduleUpdate, getPriorityContext, memoizeProps, memoizeState) {
// Class component state updater
var updater = {
isMounted: isMounted,
enqueueSetState: function (instance, partialState, callback) {
var fiber = ReactInstanceMap.get(instance);
var priorityLevel = getPriorityContext();
callback = callback === undefined ? null : callback;
if ("development" !== 'production') {
warnOnInvalidCallback(callback, 'setState');
}
addUpdate(fiber, partialState, callback, priorityLevel);
scheduleUpdate(fiber, priorityLevel);
},
enqueueReplaceState: function (instance, state, callback) {
var fiber = ReactInstanceMap.get(instance);
var priorityLevel = getPriorityContext();
callback = callback === undefined ? null : callback;
if ("development" !== 'production') {
warnOnInvalidCallback(callback, 'replaceState');
}
addReplaceUpdate(fiber, state, callback, priorityLevel);
scheduleUpdate(fiber, priorityLevel);
},
enqueueForceUpdate: function (instance, callback) {
var fiber = ReactInstanceMap.get(instance);
var priorityLevel = getPriorityContext();
callback = callback === undefined ? null : callback;
if ("development" !== 'production') {
warnOnInvalidCallback(callback, 'forceUpdate');
}
addForceUpdate(fiber, callback, priorityLevel);
scheduleUpdate(fiber, priorityLevel);
}
};
function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) {
if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) {
// If the workInProgress already has an Update effect, return true
return true;
}
var instance = workInProgress.stateNode;
if (typeof instance.shouldComponentUpdate === 'function') {
var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext);
if ("development" !== 'production') {
"development" !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress)) : void 0;
}
return shouldUpdate;
}
var type = workInProgress.type;
if (type.prototype && type.prototype.isPureReactComponent) {
return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
}
return true;
}
function checkClassInstance(workInProgress) {
var instance = workInProgress.stateNode;
if ("development" !== 'production') {
var name = getComponentName(workInProgress);
var renderPresent = instance.render;
"development" !== 'production' ? warning(renderPresent, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name) : void 0;
var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
"development" !== 'production' ? warning(noGetInitialStateOnES6, '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?', name) : void 0;
var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
"development" !== 'production' ? warning(noGetDefaultPropsOnES6, '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.', name) : void 0;
var noInstancePropTypes = !instance.propTypes;
"development" !== 'production' ? warning(noInstancePropTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
var noInstanceContextTypes = !instance.contextTypes;
"development" !== 'production' ? warning(noInstanceContextTypes, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;
var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
"development" !== 'production' ? warning(noComponentShouldUpdate, '%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.', name) : void 0;
var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
"development" !== 'production' ? warning(noComponentDidUnmount, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
"development" !== 'production' ? warning(noComponentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
var hasMutatedProps = instance.props !== workInProgress.pendingProps;
"development" !== 'production' ? warning(instance.props === undefined || !hasMutatedProps, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', name, name) : void 0;
}
var state = instance.state;
if (state && (typeof state !== 'object' || isArray(state))) {
!false ? "development" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', getComponentName(workInProgress)) : _prodInvariant('106', getComponentName(workInProgress)) : void 0;
}
if (typeof instance.getChildContext === 'function') {
!(typeof workInProgress.type.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', getComponentName(workInProgress)) : _prodInvariant('107', getComponentName(workInProgress)) : void 0;
}
}
function markUpdate(workInProgress) {
workInProgress.effectTag |= Update;
}
function markUpdateIfAlreadyInProgress(current, workInProgress) {
// If an update was already in progress, we should schedule an Update
// effect even though we're bailing out, so that cWU/cDU are called.
if (current !== null) {
if (workInProgress.memoizedProps !== current.memoizedProps || workInProgress.memoizedState !== current.memoizedState) {
markUpdate(workInProgress);
}
}
}
function resetInputPointers(workInProgress, instance) {
instance.props = workInProgress.memoizedProps;
instance.state = workInProgress.memoizedState;
}
function adoptClassInstance(workInProgress, instance) {
instance.updater = updater;
workInProgress.stateNode = instance;
// The instance needs access to the fiber so that it can schedule updates
ReactInstanceMap.set(instance, workInProgress);
}
function constructClassInstance(workInProgress) {
var ctor = workInProgress.type;
var props = workInProgress.pendingProps;
var unmaskedContext = getUnmaskedContext(workInProgress);
var needsContext = isContextConsumer(workInProgress);
var context = needsContext ? getMaskedContext(workInProgress, unmaskedContext) : emptyObject;
var instance = new ctor(props, context);
adoptClassInstance(workInProgress, instance);
checkClassInstance(workInProgress);
// Cache unmasked context so we can avoid recreating masked context unless necessary.
// ReactFiberContext usually updates this cache but can't for newly-created instances.
if (needsContext) {
cacheContext(workInProgress, unmaskedContext, context);
}
return instance;
}
// Invokes the mount life-cycles on a previously never rendered instance.
function mountClassInstance(workInProgress, priorityLevel) {
markUpdate(workInProgress);
var instance = workInProgress.stateNode;
var state = instance.state || null;
var props = workInProgress.pendingProps;
!props ? "development" !== 'production' ? invariant(false, 'There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('163') : void 0;
var unmaskedContext = getUnmaskedContext(workInProgress);
instance.props = props;
instance.state = state;
instance.context = getMaskedContext(workInProgress, unmaskedContext);
if (typeof instance.componentWillMount === 'function') {
instance.componentWillMount();
// If we had additional state updates during this life-cycle, let's
// process them now.
var updateQueue = workInProgress.updateQueue;
if (updateQueue !== null) {
instance.state = beginUpdateQueue(workInProgress, updateQueue, instance, state, props, priorityLevel);
}
}
}
// Called on a preexisting class instance. Returns false if a resumed render
// could be reused.
function resumeMountClassInstance(workInProgress, priorityLevel) {
markUpdate(workInProgress);
var instance = workInProgress.stateNode;
resetInputPointers(workInProgress, instance);
var newState = workInProgress.memoizedState;
var newProps = workInProgress.pendingProps;
if (!newProps) {
// If there isn't any new props, then we'll reuse the memoized props.
// This could be from already completed work.
newProps = workInProgress.memoizedProps;
!(newProps != null) ? "development" !== 'production' ? invariant(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('164') : void 0;
}
var newUnmaskedContext = getUnmaskedContext(workInProgress);
var newContext = getMaskedContext(workInProgress, newUnmaskedContext);
// TODO: Should we deal with a setState that happened after the last
// componentWillMount and before this componentWillMount? Probably
// unsupported anyway.
if (!checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) {
// Update the existing instance's state, props, and context pointers even
// though we're bailing out.
instance.props = newProps;
instance.state = newState;
instance.context = newContext;
return false;
}
// If we didn't bail out we need to construct a new instance. We don't
// want to reuse one that failed to fully mount.
var newInstance = constructClassInstance(workInProgress);
newInstance.props = newProps;
newInstance.state = newState = newInstance.state || null;
newInstance.context = newContext;
if (typeof newInstance.componentWillMount === 'function') {
newInstance.componentWillMount();
}
// If we had additional state updates, process them now.
// They may be from componentWillMount() or from error boundary's setState()
// during initial mounting.
var newUpdateQueue = workInProgress.updateQueue;
if (newUpdateQueue !== null) {
newInstance.state = beginUpdateQueue(workInProgress, newUpdateQueue, newInstance, newState, newProps, priorityLevel);
}
return true;
}
// Invokes the update life-cycles and returns false if it shouldn't rerender.
function updateClassInstance(current, workInProgress, priorityLevel) {
var instance = workInProgress.stateNode;
resetInputPointers(workInProgress, instance);
var oldProps = workInProgress.memoizedProps;
var newProps = workInProgress.pendingProps;
if (!newProps) {
// If there aren't any new props, then we'll reuse the memoized props.
// This could be from already completed work.
newProps = oldProps;
!(newProps != null) ? "development" !== 'production' ? invariant(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('164') : void 0;
}
var oldContext = instance.context;
var newUnmaskedContext = getUnmaskedContext(workInProgress);
var newContext = getMaskedContext(workInProgress, newUnmaskedContext);
// Note: During these life-cycles, instance.props/instance.state are what
// ever the previously attempted to render - not the "current". However,
// during componentDidUpdate we pass the "current" props.
if (oldProps !== newProps || oldContext !== newContext) {
if (typeof instance.componentWillReceiveProps === 'function') {
instance.componentWillReceiveProps(newProps, newContext);
}
}
// Compute the next state using the memoized state and the update queue.
var updateQueue = workInProgress.updateQueue;
var oldState = workInProgress.memoizedState;
// TODO: Previous state can be null.
var newState = void 0;
if (updateQueue !== null) {
newState = beginUpdateQueue(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel);
} else {
newState = oldState;
}
if (oldProps === newProps && oldState === newState && !hasContextChanged() && !(updateQueue !== null && updateQueue.hasForceUpdate)) {
markUpdateIfAlreadyInProgress(current, workInProgress);
return false;
}
var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext);
if (shouldUpdate) {
markUpdate(workInProgress);
if (typeof instance.componentWillUpdate === 'function') {
instance.componentWillUpdate(newProps, newState, newContext);
}
} else {
markUpdateIfAlreadyInProgress(current, workInProgress);
// If shouldComponentUpdate returned false, we should still update the
// memoized props/state to indicate that this work can be reused.
memoizeProps(workInProgress, newProps);
memoizeState(workInProgress, newState);
}
// Update the existing instance's state, props, and context pointers even
// if shouldComponentUpdate returns false.
instance.props = newProps;
instance.state = newState;
instance.context = newContext;
return shouldUpdate;
}
return {
adoptClassInstance: adoptClassInstance,
constructClassInstance: constructClassInstance,
mountClassInstance: mountClassInstance,
resumeMountClassInstance: resumeMountClassInstance,
updateClassInstance: updateClassInstance
};
};
},{"112":112,"125":125,"131":131,"137":137,"138":138,"50":50,"59":59,"60":60,"64":64,"72":72}],48:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var ReactTypeOfWork = _dereq_(73);
var ClassComponent = ReactTypeOfWork.ClassComponent,
HostRoot = ReactTypeOfWork.HostRoot,
HostComponent = ReactTypeOfWork.HostComponent,
HostText = ReactTypeOfWork.HostText,
HostPortal = ReactTypeOfWork.HostPortal,
CoroutineComponent = ReactTypeOfWork.CoroutineComponent;
var _require = _dereq_(60),
commitCallbacks = _require.commitCallbacks;
var _require2 = _dereq_(51),
onCommitUnmount = _require2.onCommitUnmount;
var _require3 = _dereq_(72),
Placement = _require3.Placement,
Update = _require3.Update,
Callback = _require3.Callback,
ContentReset = _require3.ContentReset;
var invariant = _dereq_(131);
module.exports = function (config, captureError) {
var commitMount = config.commitMount,
commitUpdate = config.commitUpdate,
resetTextContent = config.resetTextContent,
commitTextUpdate = config.commitTextUpdate,
appendChild = config.appendChild,
insertBefore = config.insertBefore,
removeChild = config.removeChild,
getPublicInstance = config.getPublicInstance;
// Capture errors so they don't interrupt unmounting.
function safelyCallComponentWillUnmount(current, instance) {
try {
instance.componentWillUnmount();
} catch (error) {
captureError(current, error);
}
}
// Capture errors so they don't interrupt unmounting.
function safelyDetachRef(current) {
try {
var ref = current.ref;
if (ref !== null) {
ref(null);
}
} catch (error) {
captureError(current, error);
}
}
// Only called during update. It's ok to throw.
function detachRefIfNeeded(current, finishedWork) {
if (current) {
var currentRef = current.ref;
if (currentRef !== null && currentRef !== finishedWork.ref) {
currentRef(null);
}
}
}
function getHostParent(fiber) {
var parent = fiber['return'];
while (parent !== null) {
switch (parent.tag) {
case HostComponent:
return parent.stateNode;
case HostRoot:
return parent.stateNode.containerInfo;
case HostPortal:
return parent.stateNode.containerInfo;
}
parent = parent['return'];
}
!false ? "development" !== 'production' ? invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('165') : void 0;
}
function getHostParentFiber(fiber) {
var parent = fiber['return'];
while (parent !== null) {
if (isHostParent(parent)) {
return parent;
}
parent = parent['return'];
}
!false ? "development" !== 'production' ? invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('165') : void 0;
}
function isHostParent(fiber) {
return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
}
function getHostSibling(fiber) {
// We're going to search forward into the tree until we find a sibling host
// node. Unfortunately, if multiple insertions are done in a row we have to
// search past them. This leads to exponential search for the next sibling.
var node = fiber;
siblings: while (true) {
// If we didn't find anything, let's try the next sibling.
while (node.sibling === null) {
if (node['return'] === null || isHostParent(node['return'])) {
// If we pop out of the root or hit the parent the fiber we are the
// last sibling.
return null;
}
node = node['return'];
}
node.sibling['return'] = node['return'];
node = node.sibling;
while (node.tag !== HostComponent && node.tag !== HostText) {
// If it is not host node and, we might have a host node inside it.
// Try to search down until we find one.
if (node.effectTag & Placement) {
// If we don't have a child, try the siblings instead.
continue siblings;
}
// If we don't have a child, try the siblings instead.
// We also skip portals because they are not part of this host tree.
if (node.child === null || node.tag === HostPortal) {
continue siblings;
} else {
node.child['return'] = node;
node = node.child;
}
}
// Check if this host node is stable or about to be placed.
if (!(node.effectTag & Placement)) {
// Found it!
return node.stateNode;
}
}
}
function commitPlacement(finishedWork) {
// Recursively insert all host nodes into the parent.
var parentFiber = getHostParentFiber(finishedWork);
var parent = void 0;
switch (parentFiber.tag) {
case HostComponent:
parent = parentFiber.stateNode;
break;
case HostRoot:
parent = parentFiber.stateNode.containerInfo;
break;
case HostPortal:
parent = parentFiber.stateNode.containerInfo;
break;
default:
!false ? "development" !== 'production' ? invariant(false, 'Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('166') : void 0;
}
if (parentFiber.effectTag & ContentReset) {
// Reset the text content of the parent before doing any insertions
resetTextContent(parent);
// Clear ContentReset from the effect tag
parentFiber.effectTag &= ~ContentReset;
}
var before = getHostSibling(finishedWork);
// We only have the top Fiber that was inserted but we need recurse down its
// children to find all the terminal nodes.
var node = finishedWork;
while (true) {
if (node.tag === HostComponent || node.tag === HostText) {
if (before) {
insertBefore(parent, node.stateNode, before);
} else {
appendChild(parent, node.stateNode);
}
} else if (node.tag === HostPortal) {
// If the insertion itself is a portal, then we don't want to traverse
// down its children. Instead, we'll get insertions from each child in
// the portal directly.
} else if (node.child !== null) {
node.child['return'] = node;
node = node.child;
continue;
}
if (node === finishedWork) {
return;
}
while (node.sibling === null) {
if (node['return'] === null || node['return'] === finishedWork) {
return;
}
node = node['return'];
}
node.sibling['return'] = node['return'];
node = node.sibling;
}
}
function commitNestedUnmounts(root) {
// While we're inside a removed host node we don't want to call
// removeChild on the inner nodes because they're removed by the top
// call anyway. We also want to call componentWillUnmount on all
// composites before this host node is removed from the tree. Therefore
var node = root;
while (true) {
commitUnmount(node);
// Visit children because they may contain more composite or host nodes.
// Skip portals because commitUnmount() currently visits them recursively.
if (node.child !== null && node.tag !== HostPortal) {
node.child['return'] = node;
node = node.child;
continue;
}
if (node === root) {
return;
}
while (node.sibling === null) {
if (node['return'] === null || node['return'] === root) {
return;
}
node = node['return'];
}
node.sibling['return'] = node['return'];
node = node.sibling;
}
}
function unmountHostComponents(parent, current) {
// We only have the top Fiber that was inserted but we need recurse down its
var node = current;
while (true) {
if (node.tag === HostComponent || node.tag === HostText) {
commitNestedUnmounts(node);
// After all the children have unmounted, it is now safe to remove the
// node from the tree.
removeChild(parent, node.stateNode);
// Don't visit children because we already visited them.
} else if (node.tag === HostPortal) {
// When we go into a portal, it becomes the parent to remove from.
// We will reassign it back when we pop the portal on the way up.
parent = node.stateNode.containerInfo;
// Visit children because portals might contain host components.
if (node.child !== null) {
node.child['return'] = node;
node = node.child;
continue;
}
} else {
commitUnmount(node);
// Visit children because we may find more host components below.
if (node.child !== null) {
node.child['return'] = node;
node = node.child;
continue;
}
}
if (node === current) {
return;
}
while (node.sibling === null) {
if (node['return'] === null || node['return'] === current) {
return;
}
node = node['return'];
if (node.tag === HostPortal) {
// When we go out of the portal, we need to restore the parent.
// Since we don't keep a stack of them, we will search for it.
parent = getHostParent(node);
}
}
node.sibling['return'] = node['return'];
node = node.sibling;
}
}
function commitDeletion(current) {
// Recursively delete all host nodes from the parent.
var parent = getHostParent(current);
// Detach refs and call componentWillUnmount() on the whole subtree.
unmountHostComponents(parent, current);
// Cut off the return pointers to disconnect it from the tree. Ideally, we
// should clear the child pointer of the parent alternate to let this
// get GC:ed but we don't know which for sure which parent is the current
// one so we'll settle for GC:ing the subtree of this child. This child
// itself will be GC:ed when the parent updates the next time.
current['return'] = null;
current.child = null;
if (current.alternate) {
current.alternate.child = null;
current.alternate['return'] = null;
}
}
// User-originating errors (lifecycles and refs) should not interrupt
// deletion, so don't let them throw. Host-originating errors should
// interrupt deletion, so it's okay
function commitUnmount(current) {
if (typeof onCommitUnmount === 'function') {
onCommitUnmount(current);
}
switch (current.tag) {
case ClassComponent:
{
safelyDetachRef(current);
var instance = current.stateNode;
if (typeof instance.componentWillUnmount === 'function') {
safelyCallComponentWillUnmount(current, instance);
}
return;
}
case HostComponent:
{
safelyDetachRef(current);
return;
}
case CoroutineComponent:
{
commitNestedUnmounts(current.stateNode);
return;
}
case HostPortal:
{
// TODO: this is recursive.
// We are also not using this parent because
// the portal will get pushed immediately.
var parent = getHostParent(current);
unmountHostComponents(parent, current);
return;
}
}
}
function commitWork(current, finishedWork) {
switch (finishedWork.tag) {
case ClassComponent:
{
detachRefIfNeeded(current, finishedWork);
return;
}
case HostComponent:
{
var instance = finishedWork.stateNode;
if (instance != null && current !== null) {
// Commit the work prepared earlier.
var newProps = finishedWork.memoizedProps;
var oldProps = current.memoizedProps;
var type = finishedWork.type;
// TODO: Type the updateQueue to be specific to host components.
var updatePayload = finishedWork.updateQueue;
finishedWork.updateQueue = null;
if (updatePayload !== null) {
commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
}
}
detachRefIfNeeded(current, finishedWork);
return;
}
case HostText:
{
!(finishedWork.stateNode !== null && current !== null) ? "development" !== 'production' ? invariant(false, 'This should only be done during updates. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('167') : void 0;
var textInstance = finishedWork.stateNode;
var newText = finishedWork.memoizedProps;
var oldText = current.memoizedProps;
commitTextUpdate(textInstance, oldText, newText);
return;
}
case HostRoot:
{
return;
}
case HostPortal:
{
return;
}
default:
{
!false ? "development" !== 'production' ? invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('168') : void 0;
}
}
}
function commitLifeCycles(current, finishedWork) {
switch (finishedWork.tag) {
case ClassComponent:
{
var instance = finishedWork.stateNode;
if (finishedWork.effectTag & Update) {
if (current === null) {
if (typeof instance.componentDidMount === 'function') {
instance.componentDidMount();
}
} else {
if (typeof instance.componentDidUpdate === 'function') {
var prevProps = current.memoizedProps;
var prevState = current.memoizedState;
instance.componentDidUpdate(prevProps, prevState);
}
}
}
if (finishedWork.effectTag & Callback && finishedWork.updateQueue !== null) {
commitCallbacks(finishedWork, finishedWork.updateQueue, instance);
}
return;
}
case HostRoot:
{
var updateQueue = finishedWork.updateQueue;
if (updateQueue !== null) {
var _instance = finishedWork.child && finishedWork.child.stateNode;
commitCallbacks(finishedWork, updateQueue, _instance);
}
return;
}
case HostComponent:
{
var _instance2 = finishedWork.stateNode;
// Renderers may schedule work to be done after host components are mounted
// (eg DOM renderer may schedule auto-focus for inputs and form controls).
// These effects should only be committed when components are first mounted,
// aka when there is no current/alternate.
if (current === null && finishedWork.effectTag & Update) {
var type = finishedWork.type;
var props = finishedWork.memoizedProps;
commitMount(_instance2, type, props, finishedWork);
}
return;
}
case HostText:
{
// We have no life-cycles associated with text.
return;
}
case HostPortal:
{
// We have no life-cycles associated with portals.
return;
}
default:
{
!false ? "development" !== 'production' ? invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('168') : void 0;
}
}
}
function commitRef(finishedWork) {
if (finishedWork.tag !== ClassComponent && finishedWork.tag !== HostComponent) {
return;
}
var ref = finishedWork.ref;
if (ref !== null) {
var instance = getPublicInstance(finishedWork.stateNode);
ref(instance);
}
}
return {
commitPlacement: commitPlacement,
commitDeletion: commitDeletion,
commitWork: commitWork,
commitLifeCycles: commitLifeCycles,
commitRef: commitRef
};
};
},{"112":112,"131":131,"51":51,"60":60,"72":72,"73":73}],49:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var _require = _dereq_(19),
reconcileChildFibers = _require.reconcileChildFibers;
var _require2 = _dereq_(50),
popContextProvider = _require2.popContextProvider;
var ReactTypeOfWork = _dereq_(73);
var ReactTypeOfSideEffect = _dereq_(72);
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
ClassComponent = ReactTypeOfWork.ClassComponent,
HostRoot = ReactTypeOfWork.HostRoot,
HostComponent = ReactTypeOfWork.HostComponent,
HostText = ReactTypeOfWork.HostText,
HostPortal = ReactTypeOfWork.HostPortal,
CoroutineComponent = ReactTypeOfWork.CoroutineComponent,
CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase,
YieldComponent = ReactTypeOfWork.YieldComponent,
Fragment = ReactTypeOfWork.Fragment;
var Ref = ReactTypeOfSideEffect.Ref,
Update = ReactTypeOfSideEffect.Update;
if ("development" !== 'production') {
var ReactDebugCurrentFiber = _dereq_(38);
}
var invariant = _dereq_(131);
module.exports = function (config, hostContext) {
var createInstance = config.createInstance,
createTextInstance = config.createTextInstance,
appendInitialChild = config.appendInitialChild,
finalizeInitialChildren = config.finalizeInitialChildren,
prepareUpdate = config.prepareUpdate;
var getRootHostContainer = hostContext.getRootHostContainer,
popHostContext = hostContext.popHostContext,
getHostContext = hostContext.getHostContext,
popHostContainer = hostContext.popHostContainer;
function markChildAsProgressed(current, workInProgress, priorityLevel) {
// We now have clones. Let's store them as the currently progressed work.
workInProgress.progressedChild = workInProgress.child;
workInProgress.progressedPriority = priorityLevel;
if (current !== null) {
// We also store it on the current. When the alternate swaps in we can
// continue from this point.
current.progressedChild = workInProgress.progressedChild;
current.progressedPriority = workInProgress.progressedPriority;
}
}
function markUpdate(workInProgress) {
// Tag the fiber with an update effect. This turns a Placement into
// an UpdateAndPlacement.
workInProgress.effectTag |= Update;
}
function appendAllYields(yields, workInProgress) {
var node = workInProgress.stateNode;
if (node) {
node['return'] = workInProgress;
}
while (node !== null) {
if (node.tag === HostComponent || node.tag === HostText || node.tag === HostPortal) {
!false ? "development" !== 'production' ? invariant(false, 'A coroutine cannot have host component children.') : _prodInvariant('169') : void 0;
} else if (node.tag === YieldComponent) {
yields.push(node.type);
} else if (node.child !== null) {
node.child['return'] = node;
node = node.child;
continue;
}
while (node.sibling === null) {
if (node['return'] === null || node['return'] === workInProgress) {
return;
}
node = node['return'];
}
node.sibling['return'] = node['return'];
node = node.sibling;
}
}
function moveCoroutineToHandlerPhase(current, workInProgress) {
var coroutine = workInProgress.memoizedProps;
!coroutine ? "development" !== 'production' ? invariant(false, 'Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('170') : void 0;
// First step of the coroutine has completed. Now we need to do the second.
// TODO: It would be nice to have a multi stage coroutine represented by a
// single component, or at least tail call optimize nested ones. Currently
// that requires additional fields that we don't want to add to the fiber.
// So this requires nested handlers.
// Note: This doesn't mutate the alternate node. I don't think it needs to
// since this stage is reset for every pass.
workInProgress.tag = CoroutineHandlerPhase;
// Build up the yields.
// TODO: Compare this to a generator or opaque helpers like Children.
var yields = [];
appendAllYields(yields, workInProgress);
var fn = coroutine.handler;
var props = coroutine.props;
var nextChildren = fn(props, yields);
var currentFirstChild = current !== null ? current.child : null;
// Inherit the priority of the returnFiber.
var priority = workInProgress.pendingWorkPriority;
workInProgress.child = reconcileChildFibers(workInProgress, currentFirstChild, nextChildren, priority);
markChildAsProgressed(current, workInProgress, priority);
return workInProgress.child;
}
function appendAllChildren(parent, workInProgress) {
// We only have the top Fiber that was created but we need recurse down its
// children to find all the terminal nodes.
var node = workInProgress.child;
while (node !== null) {
if (node.tag === HostComponent || node.tag === HostText) {
appendInitialChild(parent, node.stateNode);
} else if (node.tag === HostPortal) {
// If we have a portal child, then we don't want to traverse
// down its children. Instead, we'll get insertions from each child in
// the portal directly.
} else if (node.child !== null) {
node = node.child;
continue;
}
if (node === workInProgress) {
return;
}
while (node.sibling === null) {
if (node['return'] === null || node['return'] === workInProgress) {
return;
}
node = node['return'];
}
node = node.sibling;
}
}
function completeWork(current, workInProgress) {
if ("development" !== 'production') {
ReactDebugCurrentFiber.current = workInProgress;
}
switch (workInProgress.tag) {
case FunctionalComponent:
return null;
case ClassComponent:
{
// We are leaving this subtree, so pop context if any.
popContextProvider(workInProgress);
return null;
}
case HostRoot:
{
// TODO: Pop the host container after #8607 lands.
var fiberRoot = workInProgress.stateNode;
if (fiberRoot.pendingContext) {
fiberRoot.context = fiberRoot.pendingContext;
fiberRoot.pendingContext = null;
}
return null;
}
case HostComponent:
{
popHostContext(workInProgress);
var rootContainerInstance = getRootHostContainer();
var type = workInProgress.type;
var newProps = workInProgress.memoizedProps;
if (current !== null && workInProgress.stateNode != null) {
// If we have an alternate, that means this is an update and we need to
// schedule a side-effect to do the updates.
var oldProps = current.memoizedProps;
// If we get updated because one of our children updated, we don't
// have newProps so we'll have to reuse them.
// TODO: Split the update API as separate for the props vs. children.
// Even better would be if children weren't special cased at all tho.
var instance = workInProgress.stateNode;
var currentHostContext = getHostContext();
var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
// TODO: Type this specific to this type of component.
workInProgress.updateQueue = updatePayload;
// If the update payload indicates that there is a change or if there
// is a new ref we mark this as an update.
if (updatePayload || current.ref !== workInProgress.ref) {
markUpdate(workInProgress);
}
} else {
if (!newProps) {
!(workInProgress.stateNode !== null) ? "development" !== 'production' ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('171') : void 0;
// This can happen when we abort work.
return null;
}
var _currentHostContext = getHostContext();
// TODO: Move createInstance to beginWork and keep it on a context
// "stack" as the parent. Then append children as we go in beginWork
// or completeWork depending on we want to add then top->down or
// bottom->up. Top->down is faster in IE11.
var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress);
appendAllChildren(_instance, workInProgress);
// Certain renderers require commit-time effects for initial mount.
// (eg DOM renderer supports auto-focus for certain elements).
// Make sure such renderers get scheduled for later work.
if (finalizeInitialChildren(_instance, type, newProps, rootContainerInstance)) {
markUpdate(workInProgress);
}
workInProgress.stateNode = _instance;
if (workInProgress.ref !== null) {
// If there is a ref on a host node we need to schedule a callback
workInProgress.effectTag |= Ref;
}
}
return null;
}
case HostText:
{
var newText = workInProgress.memoizedProps;
if (current && workInProgress.stateNode != null) {
var oldText = current.memoizedProps;
// If we have an alternate, that means this is an update and we need
// to schedule a side-effect to do the updates.
if (oldText !== newText) {
markUpdate(workInProgress);
}
} else {
if (typeof newText !== 'string') {
!(workInProgress.stateNode !== null) ? "development" !== 'production' ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('171') : void 0;
// This can happen when we abort work.
return null;
}
var _rootContainerInstance = getRootHostContainer();
var _currentHostContext2 = getHostContext();
var textInstance = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress);
workInProgress.stateNode = textInstance;
}
return null;
}
case CoroutineComponent:
return moveCoroutineToHandlerPhase(current, workInProgress);
case CoroutineHandlerPhase:
// Reset the tag to now be a first phase coroutine.
workInProgress.tag = CoroutineComponent;
return null;
case YieldComponent:
// Does nothing.
return null;
case Fragment:
return null;
case HostPortal:
// TODO: Only mark this as an update if we have any pending callbacks.
markUpdate(workInProgress);
popHostContainer(workInProgress);
return null;
// Error cases
case IndeterminateComponent:
!false ? "development" !== 'production' ? invariant(false, 'An indeterminate component should have become determinate before completing. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('172') : void 0;
// eslint-disable-next-line no-fallthrough
default:
!false ? "development" !== 'production' ? invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('161') : void 0;
}
}
return {
completeWork: completeWork
};
};
},{"112":112,"131":131,"19":19,"38":38,"50":50,"72":72,"73":73}],50:[function(_dereq_,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 _extends = _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 _prodInvariant = _dereq_(112),
_assign = _dereq_(139);
var emptyObject = _dereq_(125);
var invariant = _dereq_(131);
var warning = _dereq_(138);
var _require = _dereq_(59),
getComponentName = _require.getComponentName,
isFiberMounted = _require.isFiberMounted;
var _require2 = _dereq_(73),
ClassComponent = _require2.ClassComponent,
HostRoot = _require2.HostRoot;
var _require3 = _dereq_(58),
createCursor = _require3.createCursor,
pop = _require3.pop,
push = _require3.push;
if ("development" !== 'production') {
var checkReactTypeSpec = _dereq_(92);
var warnedAboutMissingGetChildContext = {};
}
// A cursor to the current merged context object on the stack.
var contextStackCursor = createCursor(emptyObject);
// A cursor to a boolean indicating whether the context has changed.
var didPerformWorkStackCursor = createCursor(false);
// Keep track of the previous context object that was on the stack.
// We use this to get access to the parent context after we have already
// pushed the next context provider, and now need to merge their contexts.
var previousContext = emptyObject;
function getUnmaskedContext(workInProgress) {
var hasOwnContext = isContextProvider(workInProgress);
if (hasOwnContext) {
// If the fiber is a context provider itself, when we read its context
// we have already pushed its own child context on the stack. A context
// provider should not "see" its own child context. Therefore we read the
// previous (parent) context instead for a context provider.
return previousContext;
}
return contextStackCursor.current;
}
exports.getUnmaskedContext = getUnmaskedContext;
function cacheContext(workInProgress, unmaskedContext, maskedContext) {
var instance = workInProgress.stateNode;
instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
}
exports.cacheContext = cacheContext;
exports.getMaskedContext = function (workInProgress, unmaskedContext) {
var type = workInProgress.type;
var contextTypes = type.contextTypes;
if (!contextTypes) {
return emptyObject;
}
// Avoid recreating masked context unless unmasked context has changed.
// Failing to do this will result in unnecessary calls to componentWillReceiveProps.
// This may trigger infinite loops if componentWillReceiveProps calls setState.
var instance = workInProgress.stateNode;
if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
return instance.__reactInternalMemoizedMaskedChildContext;
}
var context = {};
for (var key in contextTypes) {
context[key] = unmaskedContext[key];
}
if ("development" !== 'production') {
var name = getComponentName(workInProgress);
checkReactTypeSpec(contextTypes, context, 'context', name, null, workInProgress);
}
// Cache unmasked context so we can avoid recreating masked context unless necessary.
// Context is created before the class component is instantiated so check for instance.
if (instance) {
cacheContext(workInProgress, unmaskedContext, context);
}
return context;
};
exports.hasContextChanged = function () {
return didPerformWorkStackCursor.current;
};
function isContextConsumer(fiber) {
return fiber.tag === ClassComponent && fiber.type.contextTypes != null;
}
exports.isContextConsumer = isContextConsumer;
function isContextProvider(fiber) {
return fiber.tag === ClassComponent && fiber.type.childContextTypes != null;
}
exports.isContextProvider = isContextProvider;
function popContextProvider(fiber) {
if (!isContextProvider(fiber)) {
return;
}
pop(didPerformWorkStackCursor, fiber);
pop(contextStackCursor, fiber);
}
exports.popContextProvider = popContextProvider;
exports.pushTopLevelContextObject = function (fiber, context, didChange) {
!(contextStackCursor.cursor == null) ? "development" !== 'production' ? invariant(false, 'Unexpected context found on stack') : _prodInvariant('173') : void 0;
push(contextStackCursor, context, fiber);
push(didPerformWorkStackCursor, didChange, fiber);
};
function processChildContext(fiber, parentContext, isReconciling) {
var instance = fiber.stateNode;
var childContextTypes = fiber.type.childContextTypes;
// TODO (bvaughn) Replace this behavior with an invariant() in the future.
// It has only been added in Fiber to match the (unintentional) behavior in Stack.
if (typeof instance.getChildContext !== 'function') {
if ("development" !== 'production') {
var componentName = getComponentName(fiber);
if (!warnedAboutMissingGetChildContext[componentName]) {
warnedAboutMissingGetChildContext[componentName] = true;
"development" !== 'production' ? warning(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName) : void 0;
}
}
return parentContext;
}
var childContext = instance.getChildContext();
for (var contextKey in childContext) {
!(contextKey in childContextTypes) ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(fiber), contextKey) : _prodInvariant('108', getComponentName(fiber), contextKey) : void 0;
}
if ("development" !== 'production') {
var name = getComponentName(fiber);
// We can only provide accurate element stacks if we pass work-in-progress tree
// during the begin or complete phase. However currently this function is also
// called from unstable_renderSubtree legacy implementation. In this case it unsafe to
// assume anything about the given fiber. We won't pass it down if we aren't sure.
// TODO: remove this hack when we delete unstable_renderSubtree in Fiber.
var workInProgress = isReconciling ? fiber : null;
checkReactTypeSpec(childContextTypes, childContext, 'childContext', name, null, workInProgress);
}
return _extends({}, parentContext, childContext);
}
exports.processChildContext = processChildContext;
exports.pushContextProvider = function (workInProgress) {
if (!isContextProvider(workInProgress)) {
return false;
}
var instance = workInProgress.stateNode;
// We push the context as early as possible to ensure stack integrity.
// If the instance does not exist yet, we will push null at first,
// and replace it on the stack later when invalidating the context.
var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
// Remember the parent context so we can merge with it later.
previousContext = contextStackCursor.current;
push(contextStackCursor, memoizedMergedChildContext, workInProgress);
push(didPerformWorkStackCursor, false, workInProgress);
return true;
};
exports.invalidateContextProvider = function (workInProgress) {
var instance = workInProgress.stateNode;
!instance ? "development" !== 'production' ? invariant(false, 'Expected to have an instance by this point.') : _prodInvariant('174') : void 0;
// Merge parent and own context.
var mergedContext = processChildContext(workInProgress, previousContext, true);
instance.__reactInternalMemoizedMergedChildContext = mergedContext;
// Replace the old (or empty) context with the new one.
// It is important to unwind the context in the reverse order.
pop(didPerformWorkStackCursor, workInProgress);
pop(contextStackCursor, workInProgress);
// Now push the new context and mark that it has changed.
push(contextStackCursor, mergedContext, workInProgress);
push(didPerformWorkStackCursor, true, workInProgress);
};
exports.resetContext = function () {
previousContext = emptyObject;
contextStackCursor.current = emptyObject;
didPerformWorkStackCursor.current = false;
};
exports.findCurrentUnmaskedContext = function (fiber) {
// Currently this is only used with renderSubtreeIntoContainer; not sure if it
// makes sense elsewhere
!(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? "development" !== 'production' ? invariant(false, 'Expected subtree parent to be a mounted class component') : _prodInvariant('175') : void 0;
var node = fiber;
while (node.tag !== HostRoot) {
if (isContextProvider(node)) {
return node.stateNode.__reactInternalMemoizedMergedChildContext;
}
var parent = node['return'];
!parent ? "development" !== 'production' ? invariant(false, 'Found unexpected detached subtree parent') : _prodInvariant('176') : void 0;
node = parent;
}
return node.stateNode.context;
};
},{"112":112,"125":125,"131":131,"138":138,"139":139,"58":58,"59":59,"73":73,"92":92}],51:[function(_dereq_,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 warning = _dereq_(138);
var rendererID = null;
var injectInternals = null;
var onCommitRoot = null;
var onCommitUnmount = null;
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && __REACT_DEVTOOLS_GLOBAL_HOOK__.supportsFiber) {
var inject = __REACT_DEVTOOLS_GLOBAL_HOOK__.inject,
onCommitFiberRoot = __REACT_DEVTOOLS_GLOBAL_HOOK__.onCommitFiberRoot,
onCommitFiberUnmount = __REACT_DEVTOOLS_GLOBAL_HOOK__.onCommitFiberUnmount;
injectInternals = function (internals) {
"development" !== 'production' ? warning(rendererID == null, 'Cannot inject into DevTools twice.') : void 0;
rendererID = inject(internals);
};
onCommitRoot = function (root) {
if (rendererID == null) {
return;
}
try {
onCommitFiberRoot(rendererID, root);
} catch (err) {
// Catch all errors because it is unsafe to throw in the commit phase.
if ("development" !== 'production') {
"development" !== 'production' ? warning(false, 'React DevTools encountered an error: %s', err) : void 0;
}
}
};
onCommitUnmount = function (fiber) {
if (rendererID == null) {
return;
}
try {
onCommitFiberUnmount(rendererID, fiber);
} catch (err) {
// Catch all errors because it is unsafe to throw in the commit phase.
if ("development" !== 'production') {
"development" !== 'production' ? warning(false, 'React DevTools encountered an error: %s', err) : void 0;
}
}
};
}
exports.injectInternals = injectInternals;
exports.onCommitRoot = onCommitRoot;
exports.onCommitUnmount = onCommitUnmount;
},{"138":138}],52:[function(_dereq_,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';
function logCapturedError(capturedError) {
if ("development" !== 'production') {
var componentName = capturedError.componentName,
componentStack = capturedError.componentStack,
error = capturedError.error,
errorBoundaryName = capturedError.errorBoundaryName,
errorBoundaryFound = capturedError.errorBoundaryFound,
willRetry = capturedError.willRetry;
var message = error.message,
name = error.name,
stack = error.stack;
var errorSummary = message ? name + ': ' + message : name;
var componentNameMessage = componentName ? 'React caught an error thrown by ' + componentName + '.' : 'React caught an error thrown by one of your components.';
// Error stack varies by browser, eg:
// Chrome prepends the Error name and type.
// Firefox, Safari, and IE don't indent the stack lines.
// Format it in a consistent way for error logging.
var formattedCallStack = stack.slice(0, errorSummary.length) === errorSummary ? stack.slice(errorSummary.length) : stack;
formattedCallStack = formattedCallStack.trim().split('\n').map(function (line) {
return '\n ' + line.trim();
}).join();
var errorBoundaryMessage = void 0;
// errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.
if (errorBoundaryFound && errorBoundaryName) {
if (willRetry) {
errorBoundaryMessage = 'React will try to recreate this component tree from scratch ' + ('using the error boundary you provided, ' + errorBoundaryName + '.');
} else {
errorBoundaryMessage = 'This error was initially handled by the error boundary ' + errorBoundaryName + '. ' + 'Recreating the tree from scratch failed so React will unmount the tree.';
}
} else {
// TODO Link to unstable_handleError() documentation once it exists.
errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.';
}
console.error(componentNameMessage + ' You should fix this error in your code. ' + errorBoundaryMessage + '\n\n' + (errorSummary + '\n\n') + ('The error is located at: ' + componentStack + '\n\n') + ('The error was thrown at: ' + formattedCallStack));
}
if (!("development" !== 'production')) {
var _error = capturedError.error;
console.error('React caught an error thrown by one of your components.\n\n' + _error.stack);
}
}
exports.logCapturedError = logCapturedError;
},{}],53:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var emptyObject = _dereq_(125);
var _require = _dereq_(58),
createCursor = _require.createCursor,
pop = _require.pop,
push = _require.push;
var invariant = _dereq_(131);
module.exports = function (config) {
var getChildHostContext = config.getChildHostContext,
getRootHostContext = config.getRootHostContext;
var contextStackCursor = createCursor(null);
var contextFiberStackCursor = createCursor(null);
var rootInstanceStackCursor = createCursor(null);
function getRootHostContainer() {
var rootInstance = rootInstanceStackCursor.current;
!(rootInstance !== null) ? "development" !== 'production' ? invariant(false, 'Expected root container to exist. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('177') : void 0;
return rootInstance;
}
function pushHostContainer(fiber, nextRootInstance) {
// Push current root instance onto the stack;
// This allows us to reset root when portals are popped.
push(rootInstanceStackCursor, nextRootInstance, fiber);
var nextRootContext = getRootHostContext(nextRootInstance);
// Track the context and the Fiber that provided it.
// This enables us to pop only Fibers that provide unique contexts.
push(contextFiberStackCursor, fiber, fiber);
push(contextStackCursor, nextRootContext, fiber);
}
function popHostContainer(fiber) {
pop(contextStackCursor, fiber);
pop(contextFiberStackCursor, fiber);
pop(rootInstanceStackCursor, fiber);
}
function getHostContext() {
var context = contextStackCursor.current;
!(context != null) ? "development" !== 'production' ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('178') : void 0;
return context;
}
function pushHostContext(fiber) {
var rootInstance = rootInstanceStackCursor.current;
!(rootInstance != null) ? "development" !== 'production' ? invariant(false, 'Expected root host context to exist. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('179') : void 0;
var context = contextStackCursor.current !== null ? contextStackCursor.current : emptyObject;
var nextContext = getChildHostContext(context, fiber.type, rootInstance);
// Don't push this Fiber's context unless it's unique.
if (context === nextContext) {
return;
}
// Track the context and the Fiber that provided it.
// This enables us to pop only Fibers that provide unique contexts.
push(contextFiberStackCursor, fiber, fiber);
push(contextStackCursor, nextContext, fiber);
}
function popHostContext(fiber) {
// Do not pop unless this Fiber provided the current context.
// pushHostContext() only pushes Fibers that provide unique contexts.
if (contextFiberStackCursor.current !== fiber) {
return;
}
pop(contextStackCursor, fiber);
pop(contextFiberStackCursor, fiber);
}
function resetHostContainer() {
contextStackCursor.current = null;
rootInstanceStackCursor.current = null;
}
return {
getHostContext: getHostContext,
getRootHostContainer: getRootHostContainer,
popHostContainer: popHostContainer,
popHostContext: popHostContext,
pushHostContainer: pushHostContainer,
pushHostContext: pushHostContext,
resetHostContainer: resetHostContainer
};
};
},{"112":112,"125":125,"131":131,"58":58}],54:[function(_dereq_,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';
// This lets us hook into Fiber to debug what it's doing.
// See https://github.com/facebook/react/pull/8033.
// This is not part of the public API, not even for React DevTools.
// You may only inject a debugTool if you work on React Fiber itself.
var ReactFiberInstrumentation = {
debugTool: null
};
module.exports = ReactFiberInstrumentation;
},{}],55:[function(_dereq_,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 _require = _dereq_(60),
addTopLevelUpdate = _require.addTopLevelUpdate;
var _require2 = _dereq_(50),
findCurrentUnmaskedContext = _require2.findCurrentUnmaskedContext,
isContextProvider = _require2.isContextProvider,
processChildContext = _require2.processChildContext;
var _require3 = _dereq_(56),
createFiberRoot = _require3.createFiberRoot;
var ReactFiberScheduler = _dereq_(57);
if ("development" !== 'production') {
var warning = _dereq_(138);
var ReactFiberInstrumentation = _dereq_(54);
}
var _require4 = _dereq_(59),
findCurrentHostFiber = _require4.findCurrentHostFiber;
var getContextForSubtree = _dereq_(99);
getContextForSubtree._injectFiber(function (fiber) {
var parentContext = findCurrentUnmaskedContext(fiber);
return isContextProvider(fiber) ? processChildContext(fiber, parentContext, false) : parentContext;
});
module.exports = function (config) {
var _ReactFiberScheduler = ReactFiberScheduler(config),
scheduleUpdate = _ReactFiberScheduler.scheduleUpdate,
getPriorityContext = _ReactFiberScheduler.getPriorityContext,
performWithPriority = _ReactFiberScheduler.performWithPriority,
batchedUpdates = _ReactFiberScheduler.batchedUpdates,
unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates,
syncUpdates = _ReactFiberScheduler.syncUpdates,
deferredUpdates = _ReactFiberScheduler.deferredUpdates;
function scheduleTopLevelUpdate(current, element, callback) {
var priorityLevel = getPriorityContext();
var nextState = { element: element };
callback = callback === undefined ? null : callback;
if ("development" !== 'production') {
"development" !== 'production' ? warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', String(callback)) : void 0;
}
addTopLevelUpdate(current, nextState, callback, priorityLevel);
scheduleUpdate(current, priorityLevel);
}
return {
createContainer: function (containerInfo) {
return createFiberRoot(containerInfo);
},
updateContainer: function (element, container, parentComponent, callback) {
// TODO: If this is a nested container, this won't be the root.
var current = container.current;
if ("development" !== 'production') {
if (ReactFiberInstrumentation.debugTool) {
if (current.alternate === null) {
ReactFiberInstrumentation.debugTool.onMountContainer(container);
} else if (element === null) {
ReactFiberInstrumentation.debugTool.onUnmountContainer(container);
} else {
ReactFiberInstrumentation.debugTool.onUpdateContainer(container);
}
}
}
var context = getContextForSubtree(parentComponent);
if (container.context === null) {
container.context = context;
} else {
container.pendingContext = context;
}
scheduleTopLevelUpdate(current, element, callback);
},
performWithPriority: performWithPriority,
batchedUpdates: batchedUpdates,
unbatchedUpdates: unbatchedUpdates,
syncUpdates: syncUpdates,
deferredUpdates: deferredUpdates,
getPublicRootInstance: function (container) {
var containerFiber = container.current;
if (!containerFiber.child) {
return null;
}
return containerFiber.child.stateNode;
},
findHostInstance: function (fiber) {
var hostFiber = findCurrentHostFiber(fiber);
if (hostFiber === null) {
return null;
}
return hostFiber.stateNode;
}
};
};
},{"138":138,"50":50,"54":54,"56":56,"57":57,"59":59,"60":60,"99":99}],56:[function(_dereq_,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 _require = _dereq_(45),
createHostRootFiber = _require.createHostRootFiber;
exports.createFiberRoot = function (containerInfo) {
// Cyclic construction. This cheats the type system right now because
// stateNode is any.
var uninitializedFiber = createHostRootFiber();
var root = {
current: uninitializedFiber,
containerInfo: containerInfo,
isScheduled: false,
nextScheduledRoot: null,
context: null,
pendingContext: null
};
uninitializedFiber.stateNode = root;
return root;
};
},{"45":45}],57:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var _require = _dereq_(50),
popContextProvider = _require.popContextProvider;
var _require2 = _dereq_(58),
reset = _require2.reset;
var _require3 = _dereq_(116),
getStackAddendumByWorkInProgressFiber = _require3.getStackAddendumByWorkInProgressFiber;
var _require4 = _dereq_(52),
logCapturedError = _require4.logCapturedError;
var ReactFiberBeginWork = _dereq_(46);
var ReactFiberCompleteWork = _dereq_(49);
var ReactFiberCommitWork = _dereq_(48);
var ReactFiberHostContext = _dereq_(53);
var ReactCurrentOwner = _dereq_(117);
var ReactFeatureFlags = _dereq_(44);
var getComponentName = _dereq_(98);
var _require5 = _dereq_(45),
cloneFiber = _require5.cloneFiber;
var _require6 = _dereq_(51),
onCommitRoot = _require6.onCommitRoot;
var _require7 = _dereq_(68),
NoWork = _require7.NoWork,
SynchronousPriority = _require7.SynchronousPriority,
TaskPriority = _require7.TaskPriority,
AnimationPriority = _require7.AnimationPriority,
HighPriority = _require7.HighPriority,
LowPriority = _require7.LowPriority,
OffscreenPriority = _require7.OffscreenPriority;
var _require8 = _dereq_(72),
NoEffect = _require8.NoEffect,
Placement = _require8.Placement,
Update = _require8.Update,
PlacementAndUpdate = _require8.PlacementAndUpdate,
Deletion = _require8.Deletion,
ContentReset = _require8.ContentReset,
Callback = _require8.Callback,
Err = _require8.Err,
Ref = _require8.Ref;
var _require9 = _dereq_(73),
HostRoot = _require9.HostRoot,
HostComponent = _require9.HostComponent,
HostPortal = _require9.HostPortal,
ClassComponent = _require9.ClassComponent;
var _require10 = _dereq_(60),
getPendingPriority = _require10.getPendingPriority;
var _require11 = _dereq_(50),
resetContext = _require11.resetContext;
var invariant = _dereq_(131);
if ("development" !== 'production') {
var ReactFiberInstrumentation = _dereq_(54);
var ReactDebugCurrentFiber = _dereq_(38);
}
var timeHeuristicForUnitOfWork = 1;
module.exports = function (config) {
var hostContext = ReactFiberHostContext(config);
var popHostContainer = hostContext.popHostContainer,
popHostContext = hostContext.popHostContext,
resetHostContainer = hostContext.resetHostContainer;
var _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, scheduleUpdate, getPriorityContext),
beginWork = _ReactFiberBeginWork.beginWork,
beginFailedWork = _ReactFiberBeginWork.beginFailedWork;
var _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext),
completeWork = _ReactFiberCompleteWo.completeWork;
var _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError),
commitPlacement = _ReactFiberCommitWork.commitPlacement,
commitDeletion = _ReactFiberCommitWork.commitDeletion,
commitWork = _ReactFiberCommitWork.commitWork,
commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles,
commitRef = _ReactFiberCommitWork.commitRef;
var hostScheduleAnimationCallback = config.scheduleAnimationCallback,
hostScheduleDeferredCallback = config.scheduleDeferredCallback,
useSyncScheduling = config.useSyncScheduling,
prepareForCommit = config.prepareForCommit,
resetAfterCommit = config.resetAfterCommit;
// The priority level to use when scheduling an update.
// TODO: Should we change this to an array? Might be less confusing.
var priorityContext = useSyncScheduling ? SynchronousPriority : LowPriority;
// Keep track of this so we can reset the priority context if an error
// is thrown during reconciliation.
var priorityContextBeforeReconciliation = NoWork;
// Keeps track of whether we're currently in a work loop.
var isPerformingWork = false;
// Keeps track of whether we should should batch sync updates.
var isBatchingUpdates = false;
// The next work in progress fiber that we're currently working on.
var nextUnitOfWork = null;
var nextPriorityLevel = NoWork;
// The next fiber with an effect that we're currently committing.
var nextEffect = null;
var pendingCommit = null;
// Linked list of roots with scheduled work on them.
var nextScheduledRoot = null;
var lastScheduledRoot = null;
// Keep track of which host environment callbacks are scheduled.
var isAnimationCallbackScheduled = false;
var isDeferredCallbackScheduled = false;
// Keep track of which fibers have captured an error that need to be handled.
// Work is removed from this collection after unstable_handleError is called.
var capturedErrors = null;
// Keep track of which fibers have failed during the current batch of work.
// This is a different set than capturedErrors, because it is not reset until
// the end of the batch. This is needed to propagate errors correctly if a
// subtree fails more than once.
var failedBoundaries = null;
// Error boundaries that captured an error during the current commit.
var commitPhaseBoundaries = null;
var firstUncaughtError = null;
var fatalError = null;
var isCommitting = false;
var isUnmounting = false;
function scheduleAnimationCallback(callback) {
if (!isAnimationCallbackScheduled) {
isAnimationCallbackScheduled = true;
hostScheduleAnimationCallback(callback);
}
}
function scheduleDeferredCallback(callback) {
if (!isDeferredCallbackScheduled) {
isDeferredCallbackScheduled = true;
hostScheduleDeferredCallback(callback);
}
}
function resetContextStack() {
// Reset the stack
reset();
// Reset the cursors
resetContext();
resetHostContainer();
}
// findNextUnitOfWork mutates the current priority context. It is reset after
// after the workLoop exits, so never call findNextUnitOfWork from outside
// the work loop.
function findNextUnitOfWork() {
// Clear out roots with no more work on them, or if they have uncaught errors
while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork) {
// Unschedule this root.
nextScheduledRoot.isScheduled = false;
// Read the next pointer now.
// We need to clear it in case this root gets scheduled again later.
var next = nextScheduledRoot.nextScheduledRoot;
nextScheduledRoot.nextScheduledRoot = null;
// Exit if we cleared all the roots and there's no work to do.
if (nextScheduledRoot === lastScheduledRoot) {
nextScheduledRoot = null;
lastScheduledRoot = null;
nextPriorityLevel = NoWork;
return null;
}
// Continue with the next root.
// If there's no work on it, it will get unscheduled too.
nextScheduledRoot = next;
}
var root = nextScheduledRoot;
var highestPriorityRoot = null;
var highestPriorityLevel = NoWork;
while (root !== null) {
if (root.current.pendingWorkPriority !== NoWork && (highestPriorityLevel === NoWork || highestPriorityLevel > root.current.pendingWorkPriority)) {
highestPriorityLevel = root.current.pendingWorkPriority;
highestPriorityRoot = root;
}
// We didn't find anything to do in this root, so let's try the next one.
root = root.nextScheduledRoot;
}
if (highestPriorityRoot !== null) {
nextPriorityLevel = highestPriorityLevel;
priorityContext = nextPriorityLevel;
// Before we start any new work, let's make sure that we have a fresh
// stack to work from.
// TODO: This call is buried a bit too deep. It would be nice to have
// a single point which happens right before any new work and
// unfortunately this is it.
resetContextStack();
return cloneFiber(highestPriorityRoot.current, highestPriorityLevel);
}
nextPriorityLevel = NoWork;
return null;
}
function commitAllHostEffects() {
while (nextEffect !== null) {
if ("development" !== 'production') {
ReactDebugCurrentFiber.current = nextEffect;
}
if (nextEffect.effectTag & ContentReset) {
config.resetTextContent(nextEffect.stateNode);
}
// The following switch statement is only concerned about placement,
// updates, and deletions. To avoid needing to add a case for every
// possible bitmap value, we remove the secondary effects from the
// effect tag and switch on that value.
var primaryEffectTag = nextEffect.effectTag & ~(Callback | Err | ContentReset | Ref);
switch (primaryEffectTag) {
case Placement:
{
commitPlacement(nextEffect);
// Clear the "placement" from effect tag so that we know that this is inserted, before
// any life-cycles like componentDidMount gets called.
// TODO: findDOMNode doesn't rely on this any more but isMounted
// does and isMounted is deprecated anyway so we should be able
// to kill this.
nextEffect.effectTag &= ~Placement;
break;
}
case PlacementAndUpdate:
{
// Placement
commitPlacement(nextEffect);
// Clear the "placement" from effect tag so that we know that this is inserted, before
// any life-cycles like componentDidMount gets called.
nextEffect.effectTag &= ~Placement;
// Update
var current = nextEffect.alternate;
commitWork(current, nextEffect);
break;
}
case Update:
{
var _current = nextEffect.alternate;
commitWork(_current, nextEffect);
break;
}
case Deletion:
{
isUnmounting = true;
commitDeletion(nextEffect);
isUnmounting = false;
break;
}
}
nextEffect = nextEffect.nextEffect;
}
if ("development" !== 'production') {
ReactDebugCurrentFiber.current = null;
}
}
function commitAllLifeCycles() {
while (nextEffect !== null) {
var current = nextEffect.alternate;
// Use Task priority for lifecycle updates
if (nextEffect.effectTag & (Update | Callback)) {
commitLifeCycles(current, nextEffect);
}
if (nextEffect.effectTag & Ref) {
commitRef(nextEffect);
}
if (nextEffect.effectTag & Err) {
commitErrorHandling(nextEffect);
}
var next = nextEffect.nextEffect;
// Ensure that we clean these up so that we don't accidentally keep them.
// I'm not actually sure this matters because we can't reset firstEffect
// and lastEffect since they're on every node, not just the effectful
// ones. So we have to clean everything as we reuse nodes anyway.
nextEffect.nextEffect = null;
// Ensure that we reset the effectTag here so that we can rely on effect
// tags to reason about the current life-cycle.
nextEffect = next;
}
}
function commitAllWork(finishedWork) {
// We keep track of this so that captureError can collect any boundaries
// that capture an error during the commit phase. The reason these aren't
// local to this function is because errors that occur during cWU are
// captured elsewhere, to prevent the unmount from being interrupted.
isCommitting = true;
pendingCommit = null;
var root = finishedWork.stateNode;
!(root.current !== finishedWork) ? "development" !== 'production' ? invariant(false, 'Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('180') : void 0;
// Updates that occur during the commit phase should have Task priority
var previousPriorityContext = priorityContext;
priorityContext = TaskPriority;
var firstEffect = void 0;
if (finishedWork.effectTag !== NoEffect) {
// A fiber's effect list consists only of its children, not itself. So if
// the root has an effect, we need to add it to the end of the list. The
// resulting list is the set that would belong to the root's parent, if
// it had one; that is, all the effects in the tree including the root.
if (finishedWork.lastEffect !== null) {
finishedWork.lastEffect.nextEffect = finishedWork;
firstEffect = finishedWork.firstEffect;
} else {
firstEffect = finishedWork;
}
} else {
// There is no effect on the root.
firstEffect = finishedWork.firstEffect;
}
var commitInfo = prepareForCommit();
// Commit all the side-effects within a tree. We'll do this in two passes.
// The first pass performs all the host insertions, updates, deletions and
// ref unmounts.
nextEffect = firstEffect;
while (nextEffect !== null) {
try {
commitAllHostEffects(finishedWork);
} catch (error) {
!(nextEffect !== null) ? "development" !== 'production' ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('181') : void 0;
captureError(nextEffect, error);
// Clean-up
if (nextEffect !== null) {
nextEffect = nextEffect.nextEffect;
}
}
}
resetAfterCommit(commitInfo);
// The work-in-progress tree is now the current tree. This must come after
// the first pass of the commit phase, so that the previous tree is still
// current during componentWillUnmount, but before the second pass, so that
// the finished work is current during componentDidMount/Update.
root.current = finishedWork;
// In the second pass we'll perform all life-cycles and ref callbacks.
// Life-cycles happen as a separate pass so that all placements, updates,
// and deletions in the entire tree have already been invoked.
// This pass also triggers any renderer-specific initial effects.
nextEffect = firstEffect;
while (nextEffect !== null) {
try {
commitAllLifeCycles(finishedWork, nextEffect);
} catch (error) {
!(nextEffect !== null) ? "development" !== 'production' ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('181') : void 0;
captureError(nextEffect, error);
if (nextEffect !== null) {
nextEffect = nextEffect.nextEffect;
}
}
}
isCommitting = false;
if (typeof onCommitRoot === 'function') {
onCommitRoot(finishedWork.stateNode);
}
if ("development" !== 'production' && ReactFiberInstrumentation.debugTool) {
ReactFiberInstrumentation.debugTool.onCommitWork(finishedWork);
}
// If we caught any errors during this commit, schedule their boundaries
// to update.
if (commitPhaseBoundaries) {
commitPhaseBoundaries.forEach(scheduleErrorRecovery);
commitPhaseBoundaries = null;
}
priorityContext = previousPriorityContext;
}
function resetWorkPriority(workInProgress) {
var newPriority = NoWork;
// Check for pending update priority. This is usually null so it shouldn't
// be a perf issue.
var queue = workInProgress.updateQueue;
if (queue !== null) {
newPriority = getPendingPriority(queue);
}
// TODO: Coroutines need to visit stateNode
// progressedChild is going to be the child set with the highest priority.
// Either it is the same as child, or it just bailed out because it choose
// not to do the work.
var child = workInProgress.progressedChild;
while (child !== null) {
// Ensure that remaining work priority bubbles up.
if (child.pendingWorkPriority !== NoWork && (newPriority === NoWork || newPriority > child.pendingWorkPriority)) {
newPriority = child.pendingWorkPriority;
}
child = child.sibling;
}
workInProgress.pendingWorkPriority = newPriority;
}
function completeUnitOfWork(workInProgress) {
while (true) {
// The current, flushed, state of this fiber is the alternate.
// Ideally nothing should rely on this, but relying on it here
// means that we don't need an additional field on the work in
// progress.
var current = workInProgress.alternate;
var next = completeWork(current, workInProgress);
var returnFiber = workInProgress['return'];
var siblingFiber = workInProgress.sibling;
resetWorkPriority(workInProgress);
if (next !== null) {
if ("development" !== 'production' && ReactFiberInstrumentation.debugTool) {
ReactFiberInstrumentation.debugTool.onCompleteWork(workInProgress);
}
// If completing this work spawned new work, do that next. We'll come
// back here again.
return next;
}
if (returnFiber !== null) {
// Append all the effects of the subtree and this fiber onto the effect
// list of the parent. The completion order of the children affects the
// side-effect order.
if (returnFiber.firstEffect === null) {
returnFiber.firstEffect = workInProgress.firstEffect;
}
if (workInProgress.lastEffect !== null) {
if (returnFiber.lastEffect !== null) {
returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
}
returnFiber.lastEffect = workInProgress.lastEffect;
}
// If this fiber had side-effects, we append it AFTER the children's
// side-effects. We can perform certain side-effects earlier if
// needed, by doing multiple passes over the effect list. We don't want
// to schedule our own side-effect on our own list because if end up
// reusing children we'll schedule this effect onto itself since we're
// at the end.
if (workInProgress.effectTag !== NoEffect) {
if (returnFiber.lastEffect !== null) {
returnFiber.lastEffect.nextEffect = workInProgress;
} else {
returnFiber.firstEffect = workInProgress;
}
returnFiber.lastEffect = workInProgress;
}
}
if ("development" !== 'production' && ReactFiberInstrumentation.debugTool) {
ReactFiberInstrumentation.debugTool.onCompleteWork(workInProgress);
}
if (siblingFiber !== null) {
// If there is more work to do in this returnFiber, do that next.
return siblingFiber;
} else if (returnFiber !== null) {
// If there's no more work in this returnFiber. Complete the returnFiber.
workInProgress = returnFiber;
continue;
} else {
// We've reached the root. Unless we're current performing deferred
// work, we should commit the completed work immediately. If we are
// performing deferred work, returning null indicates to the caller
// that we just completed the root so they can handle that case correctly.
if (nextPriorityLevel < HighPriority) {
// Otherwise, we should commit immediately.
commitAllWork(workInProgress);
} else {
pendingCommit = workInProgress;
}
return null;
}
}
}
function performUnitOfWork(workInProgress) {
// The current, flushed, state of this fiber is the alternate.
// Ideally nothing should rely on this, but relying on it here
// means that we don't need an additional field on the work in
// progress.
var current = workInProgress.alternate;
// See if beginning this work spawns more work.
var next = beginWork(current, workInProgress, nextPriorityLevel);
if ("development" !== 'production' && ReactFiberInstrumentation.debugTool) {
ReactFiberInstrumentation.debugTool.onBeginWork(workInProgress);
}
if (next === null) {
// If this doesn't spawn new work, complete the current work.
next = completeUnitOfWork(workInProgress);
}
ReactCurrentOwner.current = null;
if ("development" !== 'production') {
ReactDebugCurrentFiber.current = null;
}
return next;
}
function performFailedUnitOfWork(workInProgress) {
// The current, flushed, state of this fiber is the alternate.
// Ideally nothing should rely on this, but relying on it here
// means that we don't need an additional field on the work in
// progress.
var current = workInProgress.alternate;
// See if beginning this work spawns more work.
var next = beginFailedWork(current, workInProgress, nextPriorityLevel);
if ("development" !== 'production' && ReactFiberInstrumentation.debugTool) {
ReactFiberInstrumentation.debugTool.onBeginWork(workInProgress);
}
if (next === null) {
// If this doesn't spawn new work, complete the current work.
next = completeUnitOfWork(workInProgress);
}
ReactCurrentOwner.current = null;
if ("development" !== 'production') {
ReactDebugCurrentFiber.current = null;
}
return next;
}
function performDeferredWork(deadline) {
// We pass the lowest deferred priority here because it acts as a minimum.
// Higher priorities will also be performed.
isDeferredCallbackScheduled = false;
performWork(OffscreenPriority, deadline);
}
function performAnimationWork() {
isAnimationCallbackScheduled = false;
performWork(AnimationPriority, null);
}
function clearErrors() {
if (nextUnitOfWork === null) {
nextUnitOfWork = findNextUnitOfWork();
}
// Keep performing work until there are no more errors
while (capturedErrors !== null && capturedErrors.size && nextUnitOfWork !== null && nextPriorityLevel !== NoWork && nextPriorityLevel <= TaskPriority) {
if (hasCapturedError(nextUnitOfWork)) {
// Use a forked version of performUnitOfWork
nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork);
} else {
nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
}
if (nextUnitOfWork === null) {
// If performUnitOfWork returns null, that means we just committed
// a root. Normally we'd need to clear any errors that were scheduled
// during the commit phase. But we're already clearing errors, so
// we can continue.
nextUnitOfWork = findNextUnitOfWork();
}
}
}
function workLoop(priorityLevel, deadline, deadlineHasExpired) {
// Clear any errors.
clearErrors();
if (nextUnitOfWork === null) {
nextUnitOfWork = findNextUnitOfWork();
}
var hostRootTimeMarker = void 0;
if (ReactFeatureFlags.logTopLevelRenders && nextUnitOfWork !== null && nextUnitOfWork.tag === HostRoot && nextUnitOfWork.child !== null) {
var _componentName = getComponentName(nextUnitOfWork.child) || '';
hostRootTimeMarker = 'React update: ' + _componentName;
console.time(hostRootTimeMarker);
}
// If there's a deadline, and we're not performing Task work, perform work
// using this loop that checks the deadline on every iteration.
if (deadline !== null && priorityLevel > TaskPriority) {
// The deferred work loop will run until there's no time left in
// the current frame.
while (nextUnitOfWork !== null && !deadlineHasExpired) {
if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
// In a deferred work batch, iff nextUnitOfWork returns null, we just
// completed a root and a pendingCommit exists. Logically, we could
// omit either of the checks in the following condition, but we need
// both to satisfy Flow.
if (nextUnitOfWork === null && pendingCommit !== null) {
// If we have time, we should commit the work now.
if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
commitAllWork(pendingCommit);
nextUnitOfWork = findNextUnitOfWork();
// Clear any errors that were scheduled during the commit phase.
clearErrors();
} else {
deadlineHasExpired = true;
}
// Otherwise the root will committed in the next frame.
}
} else {
deadlineHasExpired = true;
}
}
} else {
// If there's no deadline, or if we're performing Task work, use this loop
// that doesn't check how much time is remaining. It will keep running
// until we run out of work at this priority level.
while (nextUnitOfWork !== null && nextPriorityLevel !== NoWork && nextPriorityLevel <= priorityLevel) {
nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
if (nextUnitOfWork === null) {
nextUnitOfWork = findNextUnitOfWork();
// performUnitOfWork returned null, which means we just committed a
// root. Clear any errors that were scheduled during the commit phase.
clearErrors();
}
}
}
if (hostRootTimeMarker) {
console.timeEnd(hostRootTimeMarker);
}
return deadlineHasExpired;
}
function performWork(priorityLevel, deadline) {
!!isPerformingWork ? "development" !== 'production' ? invariant(false, 'performWork was called recursively. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('182') : void 0;
isPerformingWork = true;
var isPerformingDeferredWork = Boolean(deadline);
var deadlineHasExpired = false;
// This outer loop exists so that we can restart the work loop after
// catching an error. It also lets us flush Task work at the end of a
// deferred batch.
while (priorityLevel !== NoWork && !fatalError) {
!(deadline !== null || priorityLevel < HighPriority) ? "development" !== 'production' ? invariant(false, 'Cannot perform deferred work without a deadline. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('183') : void 0;
// Before starting any work, check to see if there are any pending
// commits from the previous frame.
if (pendingCommit !== null && !deadlineHasExpired) {
commitAllWork(pendingCommit);
}
// Nothing in performWork should be allowed to throw. All unsafe
// operations must happen within workLoop, which is extracted to a
// separate function so that it can be optimized by the JS engine.
try {
priorityContextBeforeReconciliation = priorityContext;
priorityContext = nextPriorityLevel;
deadlineHasExpired = workLoop(priorityLevel, deadline, deadlineHasExpired);
} catch (error) {
// We caught an error during either the begin or complete phases.
var failedWork = nextUnitOfWork;
if (failedWork !== null) {
// Reset the priority context to its value before reconciliation.
priorityContext = priorityContextBeforeReconciliation;
// "Capture" the error by finding the nearest boundary. If there is no
// error boundary, the nearest host container acts as one. If
// captureError returns null, the error was intentionally ignored.
var maybeBoundary = captureError(failedWork, error);
if (maybeBoundary !== null) {
var boundary = maybeBoundary;
// Complete the boundary as if it rendered null. This will unmount
// the failed tree.
beginFailedWork(boundary.alternate, boundary, priorityLevel);
// The next unit of work is now the boundary that captured the error.
// Conceptually, we're unwinding the stack. We need to unwind the
// context stack, too, from the failed work to the boundary that
// captured the error.
// TODO: If we set the memoized props in beginWork instead of
// completeWork, rather than unwind the stack, we can just restart
// from the root. Can't do that until then because without memoized
// props, the nodes higher up in the tree will rerender unnecessarily.
unwindContexts(failedWork, boundary);
nextUnitOfWork = completeUnitOfWork(boundary);
}
// Continue performing work
continue;
} else if (fatalError === null) {
// There is no current unit of work. This is a worst-case scenario
// and should only be possible if there's a bug in the renderer, e.g.
// inside resetAfterCommit.
fatalError = error;
}
} finally {
priorityContext = priorityContextBeforeReconciliation;
}
// Stop performing work
priorityLevel = NoWork;
// If have we more work, and we're in a deferred batch, check to see
// if the deadline has expired.
if (nextPriorityLevel !== NoWork && isPerformingDeferredWork && !deadlineHasExpired) {
// We have more time to do work.
priorityLevel = nextPriorityLevel;
continue;
}
// There might be work left. Depending on the priority, we should
// either perform it now or schedule a callback to perform it later.
switch (nextPriorityLevel) {
case SynchronousPriority:
case TaskPriority:
// Perform work immediately by switching the priority level
// and continuing the loop.
priorityLevel = nextPriorityLevel;
break;
case AnimationPriority:
scheduleAnimationCallback(performAnimationWork);
// Even though the next unit of work has animation priority, there
// may still be deferred work left over as well. I think this is
// only important for unit tests. In a real app, a deferred callback
// would be scheduled during the next animation frame.
scheduleDeferredCallback(performDeferredWork);
break;
case HighPriority:
case LowPriority:
case OffscreenPriority:
scheduleDeferredCallback(performDeferredWork);
break;
}
}
var errorToThrow = fatalError || firstUncaughtError;
// We're done performing work. Time to clean up.
isPerformingWork = false;
fatalError = null;
firstUncaughtError = null;
capturedErrors = null;
failedBoundaries = null;
// It's safe to throw any unhandled errors.
if (errorToThrow !== null) {
throw errorToThrow;
}
}
// Returns the boundary that captured the error, or null if the error is ignored
function captureError(failedWork, error) {
// It is no longer valid because we exited the user code.
ReactCurrentOwner.current = null;
if ("development" !== 'production') {
ReactDebugCurrentFiber.current = null;
}
// It is no longer valid because this unit of work failed.
nextUnitOfWork = null;
// Search for the nearest error boundary.
var boundary = null;
// Passed to logCapturedError()
var errorBoundaryFound = false;
var willRetry = false;
var errorBoundaryName = null;
// Host containers are a special case. If the failed work itself is a host
// container, then it acts as its own boundary. In all other cases, we
// ignore the work itself and only search through the parents.
if (failedWork.tag === HostRoot) {
boundary = failedWork;
if (isFailedBoundary(failedWork)) {
// If this root already failed, there must have been an error when
// attempting to unmount it. This is a worst-case scenario and
// should only be possible if there's a bug in the renderer.
fatalError = error;
}
} else {
var node = failedWork['return'];
while (node !== null && boundary === null) {
if (node.tag === ClassComponent) {
var instance = node.stateNode;
if (typeof instance.unstable_handleError === 'function') {
errorBoundaryFound = true;
errorBoundaryName = getComponentName(node);
// Found an error boundary!
boundary = node;
willRetry = true;
}
} else if (node.tag === HostRoot) {
// Treat the root like a no-op error boundary.
boundary = node;
}
if (isFailedBoundary(node)) {
// This boundary is already in a failed state.
// If we're currently unmounting, that means this error was
// thrown while unmounting a failed subtree. We should ignore
// the error.
if (isUnmounting) {
return null;
}
// If we're in the commit phase, we should check to see if
// this boundary already captured an error during this commit.
// This case exists because multiple errors can be thrown during
// a single commit without interruption.
if (commitPhaseBoundaries !== null && (commitPhaseBoundaries.has(node) || node.alternate !== null && commitPhaseBoundaries.has(node.alternate))) {
// If so, we should ignore this error.
return null;
}
// The error should propagate to the next boundary -— we keep looking.
boundary = null;
willRetry = false;
}
node = node['return'];
}
}
if (boundary !== null) {
// Add to the collection of failed boundaries. This lets us know that
// subsequent errors in this subtree should propagate to the next boundary.
if (failedBoundaries === null) {
failedBoundaries = new Set();
}
failedBoundaries.add(boundary);
// This method is unsafe outside of the begin and complete phases.
// We might be in the commit phase when an error is captured.
// The risk is that the return path from this Fiber may not be accurate.
// That risk is acceptable given the benefit of providing users more context.
var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork);
var _componentName2 = getComponentName(failedWork);
// Add to the collection of captured errors. This is stored as a global
// map of errors and their component stack location keyed by the boundaries
// that capture them. We mostly use this Map as a Set; it's a Map only to
// avoid adding a field to Fiber to store the error.
if (capturedErrors === null) {
capturedErrors = new Map();
}
capturedErrors.set(boundary, {
componentName: _componentName2,
componentStack: _componentStack,
error: error,
errorBoundaryFound: errorBoundaryFound,
errorBoundaryName: errorBoundaryName,
willRetry: willRetry
});
// If we're in the commit phase, defer scheduling an update on the
// boundary until after the commit is complete
if (isCommitting) {
if (commitPhaseBoundaries === null) {
commitPhaseBoundaries = new Set();
}
commitPhaseBoundaries.add(boundary);
} else {
// Otherwise, schedule an update now.
scheduleErrorRecovery(boundary);
}
return boundary;
} else if (firstUncaughtError === null) {
// If no boundary is found, we'll need to throw the error
firstUncaughtError = error;
}
return null;
}
function hasCapturedError(fiber) {
// TODO: capturedErrors should store the boundary instance, to avoid needing
// to check the alternate.
return Boolean(capturedErrors !== null && (capturedErrors.has(fiber) || fiber.alternate !== null && capturedErrors.has(fiber.alternate)));
}
function isFailedBoundary(fiber) {
// TODO: failedBoundaries should store the boundary instance, to avoid
// needing to check the alternate.
return Boolean(failedBoundaries !== null && (failedBoundaries.has(fiber) || fiber.alternate !== null && failedBoundaries.has(fiber.alternate)));
}
function commitErrorHandling(effectfulFiber) {
var capturedError = void 0;
if (capturedErrors !== null) {
capturedError = capturedErrors.get(effectfulFiber);
capturedErrors['delete'](effectfulFiber);
if (capturedError == null) {
if (effectfulFiber.alternate !== null) {
effectfulFiber = effectfulFiber.alternate;
capturedError = capturedErrors.get(effectfulFiber);
capturedErrors['delete'](effectfulFiber);
}
}
}
!(capturedError != null) ? "development" !== 'production' ? invariant(false, 'No error for given unit of work. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('184') : void 0;
var error = capturedError.error;
try {
logCapturedError(capturedError);
} catch (e) {
// Prevent cycle if logCapturedError() throws.
// A cycle may still occur if logCapturedError renders a component that throws.
console.error(e);
}
switch (effectfulFiber.tag) {
case ClassComponent:
var instance = effectfulFiber.stateNode;
// Allow the boundary to handle the error, usually by scheduling
// an update to itself
instance.unstable_handleError(error);
return;
case HostRoot:
if (firstUncaughtError === null) {
// If this is the host container, we treat it as a no-op error
// boundary. We'll throw the first uncaught error once it's safe to
// do so, at the end of the batch.
firstUncaughtError = error;
}
return;
default:
!false ? "development" !== 'production' ? invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.') : _prodInvariant('162') : void 0;
}
}
function unwindContexts(from, to) {
var node = from;
while (node !== null && node !== to && node.alternate !== to) {
switch (node.tag) {
case ClassComponent:
popContextProvider(node);
break;
case HostComponent:
popHostContext(node);
break;
case HostRoot:
popHostContainer(node);
break;
case HostPortal:
popHostContainer(node);
break;
}
node = node['return'];
}
}
function scheduleRoot(root, priorityLevel) {
if (priorityLevel === NoWork) {
return;
}
if (!root.isScheduled) {
root.isScheduled = true;
if (lastScheduledRoot) {
// Schedule ourselves to the end.
lastScheduledRoot.nextScheduledRoot = root;
lastScheduledRoot = root;
} else {
// We're the only work scheduled.
nextScheduledRoot = root;
lastScheduledRoot = root;
}
}
}
function scheduleUpdate(fiber, priorityLevel) {
if (priorityLevel <= nextPriorityLevel) {
// We must reset the current unit of work pointer so that we restart the
// search from the root during the next tick, in case there is now higher
// priority work somewhere earlier than before.
nextUnitOfWork = null;
}
var node = fiber;
var shouldContinue = true;
while (node !== null && shouldContinue) {
// Walk the parent path to the root and update each node's priority. Once
// we reach a node whose priority matches (and whose alternate's priority
// matches) we can exit safely knowing that the rest of the path is correct.
shouldContinue = false;
if (node.pendingWorkPriority === NoWork || node.pendingWorkPriority > priorityLevel) {
// Priority did not match. Update and keep going.
shouldContinue = true;
node.pendingWorkPriority = priorityLevel;
}
if (node.alternate !== null) {
if (node.alternate.pendingWorkPriority === NoWork || node.alternate.pendingWorkPriority > priorityLevel) {
// Priority did not match. Update and keep going.
shouldContinue = true;
node.alternate.pendingWorkPriority = priorityLevel;
}
}
if (node['return'] === null) {
if (node.tag === HostRoot) {
var root = node.stateNode;
scheduleRoot(root, priorityLevel);
// Depending on the priority level, either perform work now or
// schedule a callback to perform work later.
switch (priorityLevel) {
case SynchronousPriority:
performWork(SynchronousPriority, null);
return;
case TaskPriority:
// TODO: If we're not already performing work, schedule a
// deferred callback.
return;
case AnimationPriority:
scheduleAnimationCallback(performAnimationWork);
return;
case HighPriority:
case LowPriority:
case OffscreenPriority:
scheduleDeferredCallback(performDeferredWork);
return;
}
} else {
// TODO: Warn about setting state on an unmounted component.
return;
}
}
node = node['return'];
}
}
function getPriorityContext() {
// If we're in a batch, or if we're already performing work, downgrade sync
// priority to task priority
if (priorityContext === SynchronousPriority && (isPerformingWork || isBatchingUpdates)) {
return TaskPriority;
}
return priorityContext;
}
function scheduleErrorRecovery(fiber) {
scheduleUpdate(fiber, TaskPriority);
}
function performWithPriority(priorityLevel, fn) {
var previousPriorityContext = priorityContext;
priorityContext = priorityLevel;
try {
fn();
} finally {
priorityContext = previousPriorityContext;
}
}
function batchedUpdates(fn, a) {
var previousIsBatchingUpdates = isBatchingUpdates;
isBatchingUpdates = true;
try {
return fn(a);
} finally {
isBatchingUpdates = previousIsBatchingUpdates;
// If we're not already inside a batch, we need to flush any task work
// that was created by the user-provided function.
if (!isPerformingWork && !isBatchingUpdates) {
performWork(TaskPriority, null);
}
}
}
function unbatchedUpdates(fn) {
var previousIsBatchingUpdates = isBatchingUpdates;
isBatchingUpdates = false;
try {
return fn();
} finally {
isBatchingUpdates = previousIsBatchingUpdates;
}
}
function syncUpdates(fn) {
var previousPriorityContext = priorityContext;
priorityContext = SynchronousPriority;
try {
return fn();
} finally {
priorityContext = previousPriorityContext;
}
}
function deferredUpdates(fn) {
var previousPriorityContext = priorityContext;
priorityContext = LowPriority;
try {
return fn();
} finally {
priorityContext = previousPriorityContext;
}
}
return {
scheduleUpdate: scheduleUpdate,
getPriorityContext: getPriorityContext,
performWithPriority: performWithPriority,
batchedUpdates: batchedUpdates,
unbatchedUpdates: unbatchedUpdates,
syncUpdates: syncUpdates,
deferredUpdates: deferredUpdates
};
};
},{"112":112,"116":116,"117":117,"131":131,"38":38,"44":44,"45":45,"46":46,"48":48,"49":49,"50":50,"51":51,"52":52,"53":53,"54":54,"58":58,"60":60,"68":68,"72":72,"73":73,"98":98}],58:[function(_dereq_,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 warning = _dereq_(138);
var valueStack = [];
if ("development" !== 'production') {
var fiberStack = [];
}
var index = -1;
exports.createCursor = function (defaultValue) {
return {
current: defaultValue
};
};
exports.isEmpty = function () {
return index === -1;
};
exports.pop = function (cursor, fiber) {
if (index < 0) {
if ("development" !== 'production') {
"development" !== 'production' ? warning(false, 'Unexpected pop.') : void 0;
}
return;
}
if ("development" !== 'production') {
if (fiber !== fiberStack[index]) {
"development" !== 'production' ? warning(false, 'Unexpected Fiber popped.') : void 0;
}
}
cursor.current = valueStack[index];
valueStack[index] = null;
if ("development" !== 'production') {
fiberStack[index] = null;
}
index--;
};
exports.push = function (cursor, value, fiber) {
index++;
valueStack[index] = cursor.current;
if ("development" !== 'production') {
fiberStack[index] = fiber;
}
cursor.current = value;
};
exports.reset = function () {
while (index > -1) {
valueStack[index] = null;
if ("development" !== 'production') {
fiberStack[index] = null;
}
index--;
}
};
},{"138":138}],59:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var ReactInstanceMap = _dereq_(64);
var invariant = _dereq_(131);
var _require = _dereq_(73),
HostRoot = _require.HostRoot,
HostComponent = _require.HostComponent,
HostText = _require.HostText;
var _require2 = _dereq_(72),
NoEffect = _require2.NoEffect,
Placement = _require2.Placement;
var MOUNTING = 1;
var MOUNTED = 2;
var UNMOUNTED = 3;
function isFiberMountedImpl(fiber) {
var node = fiber;
if (!fiber.alternate) {
// If there is no alternate, this might be a new tree that isn't inserted
// yet. If it is, then it will have a pending insertion effect on it.
if ((node.effectTag & Placement) !== NoEffect) {
return MOUNTING;
}
while (node['return']) {
node = node['return'];
if ((node.effectTag & Placement) !== NoEffect) {
return MOUNTING;
}
}
} else {
while (node['return']) {
node = node['return'];
}
}
if (node.tag === HostRoot) {
// TODO: Check if this was a nested HostRoot when used with
// renderContainerIntoSubtree.
return MOUNTED;
}
// If we didn't hit the root, that means that we're in an disconnected tree
// that has been unmounted.
return UNMOUNTED;
}
exports.isFiberMounted = function (fiber) {
return isFiberMountedImpl(fiber) === MOUNTED;
};
exports.isMounted = function (component) {
var fiber = ReactInstanceMap.get(component);
if (!fiber) {
return false;
}
return isFiberMountedImpl(fiber) === MOUNTED;
};
function assertIsMounted(fiber) {
!(isFiberMountedImpl(fiber) === MOUNTED) ? "development" !== 'production' ? invariant(false, 'Unable to find node on an unmounted component.') : _prodInvariant('153') : void 0;
}
function findCurrentFiberUsingSlowPath(fiber) {
var alternate = fiber.alternate;
if (!alternate) {
// If there is no alternate, then we only need to check if it is mounted.
var state = isFiberMountedImpl(fiber);
!(state !== UNMOUNTED) ? "development" !== 'production' ? invariant(false, 'Unable to find node on an unmounted component.') : _prodInvariant('153') : void 0;
if (state === MOUNTING) {
return null;
}
return fiber;
}
// If we have two possible branches, we'll walk backwards up to the root
// to see what path the root points to. On the way we may hit one of the
// special cases and we'll deal with them.
var a = fiber;
var b = alternate;
while (true) {
var parentA = a['return'];
var parentB = parentA ? parentA.alternate : null;
if (!parentA || !parentB) {
// We're at the root.
break;
}
// If both copies of the parent fiber point to the same child, we can
// assume that the child is current. This happens when we bailout on low
// priority: the bailed out fiber's child reuses the current child.
if (parentA.child === parentB.child) {
var child = parentA.child;
while (child) {
if (child === a) {
// We've determined that A is the current branch.
assertIsMounted(parentA);
return fiber;
}
if (child === b) {
// We've determined that B is the current branch.
assertIsMounted(parentA);
return alternate;
}
child = child.sibling;
}
// We should never have an alternate for any mounting node. So the only
// way this could possibly happen is if this was unmounted, if at all.
!false ? "development" !== 'production' ? invariant(false, 'Unable to find node on an unmounted component.') : _prodInvariant('153') : void 0;
}
if (a['return'] !== b['return']) {
// The return pointer of A and the return pointer of B point to different
// fibers. We assume that return pointers never criss-cross, so A must
// belong to the child set of A.return, and B must belong to the child
// set of B.return.
a = parentA;
b = parentB;
} else {
// The return pointers pointer to the same fiber. We'll have to use the
// default, slow path: scan the child sets of each parent alternate to see
// which child belongs to which set.
//
// Search parent A's child set
var didFindChild = false;
var _child = parentA.child;
while (_child) {
if (_child === a) {
didFindChild = true;
a = parentA;
b = parentB;
break;
}
if (_child === b) {
didFindChild = true;
b = parentA;
a = parentB;
break;
}
_child = _child.sibling;
}
if (!didFindChild) {
// Search parent B's child set
_child = parentB.child;
while (_child) {
if (_child === a) {
didFindChild = true;
a = parentB;
b = parentA;
break;
}
if (_child === b) {
didFindChild = true;
b = parentB;
a = parentA;
break;
}
_child = _child.sibling;
}
!didFindChild ? "development" !== 'production' ? invariant(false, 'Child was not found in either parent set. This indicates a bug related to the return pointer.') : _prodInvariant('185') : void 0;
}
}
!(a.alternate === b) ? "development" !== 'production' ? invariant(false, 'Return fibers should always be each others\' alternates.') : _prodInvariant('186') : void 0;
}
// If the root is not a host container, we're in a disconnected tree. I.e.
// unmounted.
!(a.tag === HostRoot) ? "development" !== 'production' ? invariant(false, 'Unable to find node on an unmounted component.') : _prodInvariant('153') : void 0;
if (a.stateNode.current === a) {
// We've determined that A is the current branch.
return fiber;
}
// Otherwise B has to be current branch.
return alternate;
}
exports.findCurrentFiberUsingSlowPath = findCurrentFiberUsingSlowPath;
exports.findCurrentHostFiber = function (parent) {
var currentParent = findCurrentFiberUsingSlowPath(parent);
if (!currentParent) {
return null;
}
// Next we'll drill down this component to find the first HostComponent/Text.
var node = currentParent;
while (true) {
if (node.tag === HostComponent || node.tag === HostText) {
return node;
} else if (node.child) {
// TODO: If we hit a Portal, we're supposed to skip it.
node.child['return'] = node;
node = node.child;
continue;
}
if (node === currentParent) {
return null;
}
while (!node.sibling) {
if (!node['return'] || node['return'] === currentParent) {
return null;
}
node = node['return'];
}
node.sibling['return'] = node['return'];
node = node.sibling;
}
// Flow needs the return null here, but ESLint complains about it.
// eslint-disable-next-line no-unreachable
return null;
};
exports.getComponentName = function (fiber) {
var type = fiber.type;
var instance = fiber.stateNode;
var constructor = instance && instance.constructor;
return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || 'A Component';
};
},{"112":112,"131":131,"64":64,"72":72,"73":73}],60:[function(_dereq_,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 _prodInvariant = _dereq_(112),
_assign = _dereq_(139);
var _require = _dereq_(72),
CallbackEffect = _require.Callback;
var _require2 = _dereq_(68),
NoWork = _require2.NoWork,
SynchronousPriority = _require2.SynchronousPriority,
TaskPriority = _require2.TaskPriority;
var invariant = _dereq_(131);
if ("development" !== 'production') {
var warning = _dereq_(138);
}
// Callbacks are not validated until invocation
// Singly linked-list of updates. When an update is scheduled, it is added to
// the queue of the current fiber and the work-in-progress fiber. The two queues
// are separate but they share a persistent structure.
//
// During reconciliation, updates are removed from the work-in-progress fiber,
// but they remain on the current fiber. That ensures that if a work-in-progress
// is aborted, the aborted updates are recovered by cloning from current.
//
// The work-in-progress queue is always a subset of the current queue.
//
// When the tree is committed, the work-in-progress becomes the current.
function comparePriority(a, b) {
// When comparing update priorities, treat sync and Task work as equal.
// TODO: Could we avoid the need for this by always coercing sync priority
// to Task when scheduling an update?
if ((a === TaskPriority || a === SynchronousPriority) && (b === TaskPriority || b === SynchronousPriority)) {
return 0;
}
if (a === NoWork && b !== NoWork) {
return -255;
}
if (a !== NoWork && b === NoWork) {
return 255;
}
return a - b;
}
// Ensures that a fiber has an update queue, creating a new one if needed.
// Returns the new or existing queue.
function ensureUpdateQueue(fiber) {
if (fiber.updateQueue) {
// We already have an update queue.
return fiber.updateQueue;
}
var queue = void 0;
if ("development" !== 'production') {
queue = {
first: null,
last: null,
hasForceUpdate: false,
callbackList: null,
isProcessing: false
};
} else {
queue = {
first: null,
last: null,
hasForceUpdate: false,
callbackList: null
};
}
fiber.updateQueue = queue;
return queue;
}
// Clones an update queue from a source fiber onto its alternate.
function cloneUpdateQueue(current, workInProgress) {
var currentQueue = current.updateQueue;
if (!currentQueue) {
// The source fiber does not have an update queue.
workInProgress.updateQueue = null;
return null;
}
// If the alternate already has a queue, reuse the previous object.
var altQueue = workInProgress.updateQueue || {};
altQueue.first = currentQueue.first;
altQueue.last = currentQueue.last;
// These fields are invalid by the time we clone from current. Reset them.
altQueue.hasForceUpdate = false;
altQueue.callbackList = null;
altQueue.isProcessing = false;
workInProgress.updateQueue = altQueue;
return altQueue;
}
exports.cloneUpdateQueue = cloneUpdateQueue;
function cloneUpdate(update) {
return {
priorityLevel: update.priorityLevel,
partialState: update.partialState,
callback: update.callback,
isReplace: update.isReplace,
isForced: update.isForced,
isTopLevelUnmount: update.isTopLevelUnmount,
next: null
};
}
function insertUpdateIntoQueue(queue, update, insertAfter, insertBefore) {
if (insertAfter) {
insertAfter.next = update;
} else {
// This is the first item in the queue.
update.next = queue.first;
queue.first = update;
}
if (insertBefore) {
update.next = insertBefore;
} else {
// This is the last item in the queue.
queue.last = update;
}
}
// Returns the update after which the incoming update should be inserted into
// the queue, or null if it should be inserted at beginning.
function findInsertionPosition(queue, update) {
var priorityLevel = update.priorityLevel;
var insertAfter = null;
var insertBefore = null;
if (queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) {
// Fast path for the common case where the update should be inserted at
// the end of the queue.
insertAfter = queue.last;
} else {
insertBefore = queue.first;
while (insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0) {
insertAfter = insertBefore;
insertBefore = insertBefore.next;
}
}
return insertAfter;
}
// The work-in-progress queue is a subset of the current queue (if it exists).
// We need to insert the incoming update into both lists. However, it's possible
// that the correct position in one list will be different from the position in
// the other. Consider the following case:
//
// Current: 3-5-6
// Work-in-progress: 6
//
// Then we receive an update with priority 4 and insert it into each list:
//
// Current: 3-4-5-6
// Work-in-progress: 4-6
//
// In the current queue, the new update's `next` pointer points to the update
// with priority 5. But in the work-in-progress queue, the pointer points to the
// update with priority 6. Because these two queues share the same persistent
// data structure, this won't do. (This can only happen when the incoming update
// has higher priority than all the updates in the work-in-progress queue.)
//
// To solve this, in the case where the incoming update needs to be inserted
// into two different positions, we'll make a clone of the update and insert
// each copy into a separate queue. This forks the list while maintaining a
// persistent structure, because the update that is added to the work-in-progress
// is always added to the front of the list.
//
// However, if incoming update is inserted into the same position of both lists,
// we shouldn't make a copy.
//
// If the update is cloned, it returns the cloned update.
function insertUpdate(fiber, update) {
var queue1 = ensureUpdateQueue(fiber);
var queue2 = fiber.alternate ? ensureUpdateQueue(fiber.alternate) : null;
// Warn if an update is scheduled from inside an updater function.
if ("development" !== 'production') {
if (queue1.isProcessing || queue2 && queue2.isProcessing) {
"development" !== 'production' ? warning(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.') : void 0;
}
}
// Find the insertion position in the first queue.
var insertAfter1 = findInsertionPosition(queue1, update);
var insertBefore1 = insertAfter1 ? insertAfter1.next : queue1.first;
if (!queue2) {
// If there's no alternate queue, there's nothing else to do but insert.
insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1);
return null;
}
// If there is an alternate queue, find the insertion position.
var insertAfter2 = findInsertionPosition(queue2, update);
var insertBefore2 = insertAfter2 ? insertAfter2.next : queue2.first;
// Now we can insert into the first queue. This must come after finding both
// insertion positions because it mutates the list.
insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1);
if (insertBefore1 !== insertBefore2) {
// The insertion positions are different, so we need to clone the update and
// insert the clone into the alternate queue.
var update2 = cloneUpdate(update);
insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2);
return update2;
} else {
// The insertion positions are the same, so when we inserted into the first
// queue, it also inserted into the alternate. All we need to do is update
// the alternate queue's `first` and `last` pointers, in case they
// have changed.
if (!insertAfter2) {
queue2.first = update;
}
if (!insertBefore2) {
queue2.last = null;
}
}
return null;
}
function addUpdate(fiber, partialState, callback, priorityLevel) {
var update = {
priorityLevel: priorityLevel,
partialState: partialState,
callback: callback,
isReplace: false,
isForced: false,
isTopLevelUnmount: false,
next: null
};
insertUpdate(fiber, update);
}
exports.addUpdate = addUpdate;
function addReplaceUpdate(fiber, state, callback, priorityLevel) {
var update = {
priorityLevel: priorityLevel,
partialState: state,
callback: callback,
isReplace: true,
isForced: false,
isTopLevelUnmount: false,
next: null
};
insertUpdate(fiber, update);
}
exports.addReplaceUpdate = addReplaceUpdate;
function addForceUpdate(fiber, callback, priorityLevel) {
var update = {
priorityLevel: priorityLevel,
partialState: null,
callback: callback,
isReplace: false,
isForced: true,
isTopLevelUnmount: false,
next: null
};
insertUpdate(fiber, update);
}
exports.addForceUpdate = addForceUpdate;
function getPendingPriority(queue) {
return queue.first ? queue.first.priorityLevel : NoWork;
}
exports.getPendingPriority = getPendingPriority;
function addTopLevelUpdate(fiber, partialState, callback, priorityLevel) {
var isTopLevelUnmount = Boolean(partialState && partialState.element === null);
var update = {
priorityLevel: priorityLevel,
partialState: partialState,
callback: callback,
isReplace: false,
isForced: false,
isTopLevelUnmount: isTopLevelUnmount,
next: null
};
var update2 = insertUpdate(fiber, update);
if (isTopLevelUnmount) {
// Drop all updates that are lower-priority, so that the tree is not
// remounted. We need to do this for both queues.
var queue1 = fiber.updateQueue;
var queue2 = fiber.alternate && fiber.alternate.updateQueue;
if (queue1 && update.next) {
update.next = null;
queue1.last = update;
}
if (queue2 && update2 && update2.next) {
update2.next = null;
queue2.last = update;
}
}
}
exports.addTopLevelUpdate = addTopLevelUpdate;
function getStateFromUpdate(update, instance, prevState, props) {
var partialState = update.partialState;
if (typeof partialState === 'function') {
var updateFn = partialState;
return updateFn.call(instance, prevState, props);
} else {
return partialState;
}
}
function beginUpdateQueue(workInProgress, queue, instance, prevState, props, priorityLevel) {
if ("development" !== 'production') {
// Set this flag so we can warn if setState is called inside the update
// function of another setState.
queue.isProcessing = true;
}
queue.hasForceUpdate = false;
// Applies updates with matching priority to the previous state to create
// a new state object.
var state = prevState;
var dontMutatePrevState = true;
var callbackList = null;
var update = queue.first;
while (update && comparePriority(update.priorityLevel, priorityLevel) <= 0) {
// Remove each update from the queue right before it is processed. That way
// if setState is called from inside an updater function, the new update
// will be inserted in the correct position.
queue.first = update.next;
if (!queue.first) {
queue.last = null;
}
var _partialState = void 0;
if (update.isReplace) {
state = getStateFromUpdate(update, instance, state, props);
dontMutatePrevState = true;
} else {
_partialState = getStateFromUpdate(update, instance, state, props);
if (_partialState) {
if (dontMutatePrevState) {
state = _assign({}, state, _partialState);
} else {
state = _assign(state, _partialState);
}
dontMutatePrevState = false;
}
}
if (update.isForced) {
queue.hasForceUpdate = true;
}
// Second condition ignores top-level unmount callbacks if they are not the
// last update in the queue, since a subsequent update will cause a remount.
if (update.callback !== null && !(update.isTopLevelUnmount && update.next !== null)) {
callbackList = callbackList || [];
callbackList.push(update.callback);
workInProgress.effectTag |= CallbackEffect;
}
update = update.next;
}
queue.callbackList = callbackList;
if (!queue.first && !callbackList && !queue.hasForceUpdate) {
// The queue is empty and there are no callbacks. We can reset it.
workInProgress.updateQueue = null;
}
if ("development" !== 'production') {
queue.isProcessing = false;
}
return state;
}
exports.beginUpdateQueue = beginUpdateQueue;
function commitCallbacks(finishedWork, queue, context) {
var callbackList = queue.callbackList;
if (!callbackList) {
return;
}
for (var i = 0; i < callbackList.length; i++) {
var _callback = callbackList[i];
!(typeof _callback === 'function') ? "development" !== 'production' ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', String(_callback)) : _prodInvariant('187', String(_callback)) : void 0;
_callback.call(context);
}
}
exports.commitCallbacks = commitCallbacks;
},{"112":112,"131":131,"138":138,"139":139,"68":68,"72":72}],61:[function(_dereq_,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 ReactControlledComponent = _dereq_(20);
// Used as a way to call batchedUpdates when we don't know if we're in a Fiber
// or Stack context. Such as when we're dispatching events or if third party
// libraries need to call batchedUpdates. Eventually, this API will go away when
// everything is batched by default. We'll then have a similar API to opt-out of
// scheduled work and instead do synchronous work.
// Defaults
var stackBatchedUpdates = function (fn, a, b, c, d, e) {
return fn(a, b, c, d, e);
};
var fiberBatchedUpdates = function (fn, bookkeeping) {
return fn(bookkeeping);
};
function performFiberBatchedUpdates(fn, bookkeeping) {
// If we have Fiber loaded, we need to wrap this in a batching call so that
// Fiber can apply its default priority for this call.
return fiberBatchedUpdates(fn, bookkeeping);
}
function batchedUpdates(fn, bookkeeping) {
// We first perform work with the stack batching strategy, by passing our
// indirection to it.
return stackBatchedUpdates(performFiberBatchedUpdates, fn, bookkeeping);
}
var isNestingBatched = false;
function batchedUpdatesWithControlledComponents(fn, bookkeeping) {
if (isNestingBatched) {
// If we are currently inside another batch, we need to wait until it
// fully completes before restoring state. Therefore, we add the target to
// a queue of work.
return batchedUpdates(fn, bookkeeping);
}
isNestingBatched = true;
try {
return batchedUpdates(fn, bookkeeping);
} finally {
// Here we wait until all updates have propagated, which is important
// when using controlled components within layers:
// https://github.com/facebook/react/issues/1698
// Then we restore state of any controlled component.
isNestingBatched = false;
ReactControlledComponent.restoreStateIfNeeded();
}
}
var ReactGenericBatchingInjection = {
injectStackBatchedUpdates: function (_batchedUpdates) {
stackBatchedUpdates = _batchedUpdates;
},
injectFiberBatchedUpdates: function (_batchedUpdates) {
fiberBatchedUpdates = _batchedUpdates;
}
};
var ReactGenericBatching = {
batchedUpdates: batchedUpdatesWithControlledComponents,
injection: ReactGenericBatchingInjection
};
module.exports = ReactGenericBatching;
},{"20":20}],62:[function(_dereq_,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';
// Trust the developer to only use this with a __DEV__ check
var ReactHostOperationHistoryHook = null;
if ("development" !== 'production') {
var history = [];
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;
},{}],63:[function(_dereq_,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 ReactDOMSelection = _dereq_(36);
var containsNode = _dereq_(123);
var focusNode = _dereq_(126);
var getActiveElement = _dereq_(127);
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);
}
// Focusing a node can change the scroll position, which is undesirable
var ancestors = [];
var ancestor = priorFocusedElem;
while (ancestor = ancestor.parentNode) {
if (ancestor.nodeType === 1) {
ancestors.push({
element: ancestor,
left: ancestor.scrollLeft,
top: ancestor.scrollTop
});
}
}
focusNode(priorFocusedElem);
for (var i = 0; i < ancestors.length; i++) {
var info = ancestors[i];
info.element.scrollLeft = info.left;
info.element.scrollTop = info.top;
}
}
},
/**
* @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;
},{"123":123,"126":126,"127":127,"36":36}],64:[function(_dereq_,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;
},{}],65:[function(_dereq_,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';
// Trust the developer to only use ReactInstrumentation with a __DEV__ check
var debugTool = null;
if ("development" !== 'production') {
var ReactDebugTool = _dereq_(39);
debugTool = ReactDebugTool;
}
module.exports = { debugTool: debugTool };
},{"39":39}],66:[function(_dereq_,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 warning = _dereq_(138);
var ReactInvalidSetStateWarningHook = {};
if ("development" !== 'production') {
var processingChildContext = false;
var warnInvalidSetState = function () {
"development" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
};
ReactInvalidSetStateWarningHook = {
onBeginProcessingChildContext: function () {
processingChildContext = true;
},
onEndProcessingChildContext: function () {
processingChildContext = false;
},
onSetState: function () {
warnInvalidSetState();
}
};
}
module.exports = ReactInvalidSetStateWarningHook;
},{"138":138}],67:[function(_dereq_,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 special React types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_PORTAL_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.portal') || 0xeaca;
exports.createPortal = function (children, containerInfo,
// TODO: figure out the API for cross-renderer implementation.
implementation) {
var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
return {
// This tag allow us to uniquely identify this as a React Portal
$$typeof: REACT_PORTAL_TYPE,
key: key == null ? null : '' + key,
children: children,
containerInfo: containerInfo,
implementation: implementation
};
};
/**
* Verifies the object is a portal object.
*/
exports.isPortal = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_PORTAL_TYPE;
};
exports.REACT_PORTAL_TYPE = REACT_PORTAL_TYPE;
},{}],68:[function(_dereq_,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 = {
NoWork: 0, // No work is pending.
SynchronousPriority: 1, // For controlled text inputs. Synchronous side-effects.
TaskPriority: 2, // Completes at the end of the current tick.
AnimationPriority: 3, // Needs to complete before the next frame.
HighPriority: 4, // Interaction that needs to complete pretty soon to feel responsive.
LowPriority: 5, // Data fetching, or result from updating stores.
OffscreenPriority: 6 };
},{}],69:[function(_dereq_,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 ReactPropTypeLocationNames = {};
if ("development" !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
},{}],70:[function(_dereq_,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;
},{}],71:[function(_dereq_,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 _require = _dereq_(73),
HostComponent = _require.HostComponent;
function getParent(inst) {
if (inst._hostParent !== undefined) {
return inst._hostParent;
}
if (typeof inst.tag === 'number') {
do {
inst = inst['return'];
// TODO: If this is a HostRoot we might want to bail out.
// That is depending on if we want nested subtrees (layers) to bubble
// events to their parent. We could also go through parentNode on the
// host node but that wouldn't work for React Native and doesn't let us
// do the portal feature.
} while (inst && inst.tag !== HostComponent);
if (inst) {
return inst;
}
}
return null;
}
/**
* Return the lowest common ancestor of A and B, or null if they are in
* different trees.
*/
function getLowestCommonAncestor(instA, instB) {
var depthA = 0;
for (var tempA = instA; tempA; tempA = getParent(tempA)) {
depthA++;
}
var depthB = 0;
for (var tempB = instB; tempB; tempB = getParent(tempB)) {
depthB++;
}
// If A is deeper, crawl up.
while (depthA - depthB > 0) {
instA = getParent(instA);
depthA--;
}
// If B is deeper, crawl up.
while (depthB - depthA > 0) {
instB = getParent(instB);
depthB--;
}
// Walk in lockstep until we find a match.
var depth = depthA;
while (depth--) {
if (instA === instB || instA === instB.alternate) {
return instA;
}
instA = getParent(instA);
instB = getParent(instB);
}
return null;
}
/**
* Return if A is an ancestor of B.
*/
function isAncestor(instA, instB) {
while (instB) {
if (instA === instB || instA === instB.alternate) {
return true;
}
instB = getParent(instB);
}
return false;
}
/**
* Return the parent instance of the passed-in instance.
*/
function getParentInstance(inst) {
return getParent(inst);
}
/**
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
*/
function traverseTwoPhase(inst, fn, arg) {
var path = [];
while (inst) {
path.push(inst);
inst = getParent(inst);
}
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 = getParent(from);
}
var pathTo = [];
while (to && to !== common) {
pathTo.push(to);
to = getParent(to);
}
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
};
},{"73":73}],72:[function(_dereq_,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 = {
NoEffect: 0, // 0b0000000
Placement: 1, // 0b0000001
Update: 2, // 0b0000010
PlacementAndUpdate: 3, // 0b0000011
Deletion: 4, // 0b0000100
ContentReset: 8, // 0b0001000
Callback: 16, // 0b0010000
Err: 32, // 0b0100000
Ref: 64 };
},{}],73:[function(_dereq_,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 = {
IndeterminateComponent: 0, // Before we know whether it is functional or class
FunctionalComponent: 1,
ClassComponent: 2,
HostRoot: 3, // Root of a host tree. Could be nested inside another node.
HostPortal: 4, // A subtree. Could be an entry point to a different renderer.
HostComponent: 5,
HostText: 6,
CoroutineComponent: 7,
CoroutineHandlerPhase: 8,
YieldComponent: 9,
Fragment: 10
};
},{}],74:[function(_dereq_,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;
},{}],75:[function(_dereq_,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 EventPropagators = _dereq_(14);
var ExecutionEnvironment = _dereq_(120);
var ReactBrowserEventEmitter = _dereq_(18);
var ReactDOMComponentTree = _dereq_(24);
var ReactInputSelection = _dereq_(63);
var SyntheticEvent = _dereq_(81);
var getActiveElement = _dereq_(127);
var isTextInputElement = _dereq_(110);
var shallowEqual = _dereq_(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 all listeners exists for this plugin. If none exist, we do
// not extract events. See #3639.
var isListeningToAllDependencies = ReactBrowserEventEmitter.isListeningToAllDependencies;
/**
* 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) {
var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument;
if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
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;
}
};
module.exports = SelectEventPlugin;
},{"110":110,"120":120,"127":127,"137":137,"14":14,"18":18,"24":24,"63":63,"81":81}],76:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var EventPropagators = _dereq_(14);
var SyntheticAnimationEvent = _dereq_(77);
var SyntheticClipboardEvent = _dereq_(78);
var SyntheticEvent = _dereq_(81);
var SyntheticFocusEvent = _dereq_(82);
var SyntheticKeyboardEvent = _dereq_(84);
var SyntheticMouseEvent = _dereq_(85);
var SyntheticDragEvent = _dereq_(80);
var SyntheticTouchEvent = _dereq_(86);
var SyntheticTransitionEvent = _dereq_(87);
var SyntheticUIEvent = _dereq_(88);
var SyntheticWheelEvent = _dereq_(89);
var getEventCharCode = _dereq_(100);
var invariant = _dereq_(131);
/**
* Turns
* ['abort', ...]
* into
* eventTypes = {
* 'abort': {
* phasedRegistrationNames: {
* bubbled: 'onAbort',
* captured: 'onAbortCapture',
* },
* dependencies: ['topAbort'],
* },
* ...
* };
* topLevelEventsToDispatchConfig = {
* 'topAbort': { sameConfig }
* };
*/
var eventTypes = {};
var topLevelEventsToDispatchConfig = {};
['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', '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', 'toggle', '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 SimpleEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
if (!dispatchConfig) {
return null;
}
var EventConstructor;
switch (topLevelType) {
case 'topAbort':
case 'topCancel':
case 'topCanPlay':
case 'topCanPlayThrough':
case 'topClose':
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 'topToggle':
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 ? "development" !== '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;
}
};
module.exports = SimpleEventPlugin;
},{"100":100,"112":112,"131":131,"14":14,"77":77,"78":78,"80":80,"81":81,"82":82,"84":84,"85":85,"86":86,"87":87,"88":88,"89":89}],77:[function(_dereq_,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 SyntheticEvent = _dereq_(81);
/**
* @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;
},{"81":81}],78:[function(_dereq_,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 SyntheticEvent = _dereq_(81);
/**
* @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;
},{"81":81}],79:[function(_dereq_,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 SyntheticEvent = _dereq_(81);
/**
* @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;
},{"81":81}],80:[function(_dereq_,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 SyntheticMouseEvent = _dereq_(85);
/**
* @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;
},{"85":85}],81:[function(_dereq_,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 _assign = _dereq_(139);
var PooledClass = _dereq_(17);
var emptyFunction = _dereq_(124);
var warning = _dereq_(138);
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 ("development" !== '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 ("development" !== '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 ("development" !== '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 ("development" !== '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 ("development" !== '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) {
"development" !== '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;
"development" !== '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;
}
}
},{"124":124,"138":138,"139":139,"17":17}],82:[function(_dereq_,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 SyntheticUIEvent = _dereq_(88);
/**
* @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;
},{"88":88}],83:[function(_dereq_,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 SyntheticEvent = _dereq_(81);
/**
* @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;
},{"81":81}],84:[function(_dereq_,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 SyntheticUIEvent = _dereq_(88);
var getEventCharCode = _dereq_(100);
var getEventKey = _dereq_(101);
var getEventModifierState = _dereq_(102);
/**
* @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;
},{"100":100,"101":101,"102":102,"88":88}],85:[function(_dereq_,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 SyntheticUIEvent = _dereq_(88);
var ViewportMetrics = _dereq_(90);
var getEventModifierState = _dereq_(102);
/**
* @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;
},{"102":102,"88":88,"90":90}],86:[function(_dereq_,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 SyntheticUIEvent = _dereq_(88);
var getEventModifierState = _dereq_(102);
/**
* @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;
},{"102":102,"88":88}],87:[function(_dereq_,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 SyntheticEvent = _dereq_(81);
/**
* @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;
},{"81":81}],88:[function(_dereq_,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 SyntheticEvent = _dereq_(81);
var getEventTarget = _dereq_(103);
/**
* @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;
},{"103":103,"81":81}],89:[function(_dereq_,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 SyntheticMouseEvent = _dereq_(85);
/**
* @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;
},{"85":85}],90:[function(_dereq_,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;
},{}],91:[function(_dereq_,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 _prodInvariant = _dereq_(112);
var invariant = _dereq_(131);
/**
* 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) ? "development" !== '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;
},{"112":112,"131":131}],92:[function(_dereq_,module,exports){
(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 = _dereq_(112);
var ReactPropTypeLocationNames = _dereq_(69);
var ReactPropTypesSecret = _dereq_(70);
var invariant = _dereq_(131);
var warning = _dereq_(138);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && "development" === '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 = _dereq_(116);
}
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} workInProgressOrDebugID The React component instance that is being type-checked
* @private
*/
function checkReactTypeSpec(typeSpecs, values, location, componentName, element,
// It is only safe to pass fiber if it is the work-in-progress version, and
workInProgressOrDebugID) {
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') ? "development" !== '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;
}
"development" !== '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 ("development" !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = _dereq_(116);
}
if (workInProgressOrDebugID != null) {
if (typeof workInProgressOrDebugID === 'number') {
// DebugID from Stack.
var debugID = workInProgressOrDebugID;
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
} else if (typeof workInProgressOrDebugID.tag === 'number') {
// This is a Fiber.
// The stack will only be correct if this is a work in progress
// version and we're calling it during reconciliation.
var workInProgress = workInProgressOrDebugID;
componentStackInfo = ReactComponentTreeHook.getStackAddendumByWorkInProgressFiber(workInProgress);
}
} else if (element !== null) {
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
}
}
"development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
}
}
}
}
module.exports = checkReactTypeSpec;
}).call(this,undefined)
},{"112":112,"116":116,"131":131,"138":138,"69":69,"70":70}],93:[function(_dereq_,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(_dereq_,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 CSSProperty = _dereq_(3);
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
/**
* 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 '';
}
if (typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
}
return ('' + value).trim();
}
module.exports = dangerousStyleValue;
},{"3":3}],95:[function(_dereq_,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(_dereq_,module,exports){
'use strict';
var _prodInvariant = _dereq_(112);
/**
* 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.
*
*
*/
var ReactCurrentOwner = _dereq_(117);
var ReactInstanceMap = _dereq_(64);
var getComponentName = _dereq_(98);
var invariant = _dereq_(131);
var warning = _dereq_(138);
var findFiber = function (arg) {
!false ? "development" !== 'production' ? invariant(false, 'Missing injection for fiber findDOMNode') : _prodInvariant('151') : void 0;
};
var findStack = function (arg) {
!false ? "development" !== 'production' ? invariant(false, 'Missing injection for stack findDOMNode') : _prodInvariant('152') : void 0;
};
var findDOMNode = function (componentOrElement) {
if ("development" !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null && '_warnedAboutRefsInRender' in owner) {
"development" !== '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.', getComponentName(owner) || '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) {
if (typeof inst.tag === 'number') {
return findFiber(inst);
} else {
return findStack(inst);
}
}
if (typeof componentOrElement.render === 'function') {
!false ? "development" !== 'production' ? invariant(false, 'Unable to find node on an unmounted component.') : _prodInvariant('153') : void 0;
} else {
!false ? "development" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode. Keys: %s', Object.keys(componentOrElement)) : _prodInvariant('154', Object.keys(componentOrElement)) : void 0;
}
};
findDOMNode._injectFiber = function (fn) {
findFiber = fn;
};
findDOMNode._injectStack = function (fn) {
findStack = fn;
};
module.exports = findDOMNode;
},{"112":112,"117":117,"131":131,"138":138,"64":64,"98":98}],97:[function(_dereq_,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).
* @param {function} cb Callback invoked with each element or a collection.
* @param {?} [scope] Scope used as `this` in a callback.
*/
function forEachAccumulated(arr, cb, scope) {
if (Array.isArray(arr)) {
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
}
}
module.exports = forEachAccumulated;
},{}],98:[function(_dereq_,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';
function getComponentName(instanceOrFiber) {
if (typeof instanceOrFiber.getName === 'function') {
// Stack reconciler
var instance = instanceOrFiber;
return instance.getName();
}
if (typeof instanceOrFiber.tag === 'number') {
// Fiber reconciler
var fiber = instanceOrFiber;
var type = fiber.type;
if (typeof type === 'string') {
return type;
}
if (typeof type === 'function') {
return type.displayName || type.name;
}
}
return null;
}
module.exports = getComponentName;
},{}],99:[function(_dereq_,module,exports){
'use strict';
var _prodInvariant = _dereq_(112);
/**
* 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.
*
*
*/
var ReactInstanceMap = _dereq_(64);
var emptyObject = _dereq_(125);
var invariant = _dereq_(131);
var getContextFiber = function (arg) {
!false ? "development" !== 'production' ? invariant(false, 'Missing injection for fiber getContextForSubtree') : _prodInvariant('188') : void 0;
};
function getContextForSubtree(parentComponent) {
if (!parentComponent) {
return emptyObject;
}
var instance = ReactInstanceMap.get(parentComponent);
if (typeof instance.tag === 'number') {
return getContextFiber(instance);
} else {
return instance._processChildContext(instance._context);
}
}
getContextForSubtree._injectFiber = function (fn) {
getContextFiber = fn;
};
module.exports = getContextForSubtree;
},{"112":112,"125":125,"131":131,"64":64}],100:[function(_dereq_,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;
},{}],101:[function(_dereq_,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 getEventCharCode = _dereq_(100);
/**
* 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;
},{"100":100}],102:[function(_dereq_,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;
},{}],103:[function(_dereq_,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;
},{}],104:[function(_dereq_,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;
},{}],105:[function(_dereq_,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;
},{}],106:[function(_dereq_,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 ExecutionEnvironment = _dereq_(120);
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;
},{"120":120}],107:[function(_dereq_,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 ExecutionEnvironment = _dereq_(120);
/**
* 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;
},{"120":120}],108:[function(_dereq_,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 ReactDOMComponentTree = _dereq_(24);
function isCheckable(elem) {
var type = elem.type;
var nodeName = elem.nodeName;
return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
}
function getTracker(inst) {
if (typeof inst.tag === 'number') {
inst = inst.stateNode;
}
return inst._wrapperState.valueTracker;
}
function attachTracker(inst, tracker) {
inst._wrapperState.valueTracker = tracker;
}
function detachTracker(inst) {
delete inst._wrapperState.valueTracker;
}
function getValueFromNode(node) {
var value;
if (node) {
value = isCheckable(node) ? '' + node.checked : node.value;
}
return value;
}
function trackValueOnNode(node, inst) {
var valueField = isCheckable(node) ? 'checked' : 'value';
var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
var currentValue = '' + node[valueField];
// if someone has already defined a value or Safari, then bail
// and don't track value will cause over reporting of changes,
// but it's better then a hard failure
// (needed for certain tests that spyOn input values and Safari)
if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
return;
}
Object.defineProperty(node, valueField, {
enumerable: descriptor.enumerable,
configurable: true,
get: function () {
return descriptor.get.call(this);
},
set: function (value) {
currentValue = '' + value;
descriptor.set.call(this, value);
}
});
var tracker = {
getValue: function () {
return currentValue;
},
setValue: function (value) {
currentValue = '' + value;
},
stopTracking: function () {
detachTracker(inst);
delete node[valueField];
}
};
return tracker;
}
var inputValueTracking = {
// exposed for testing
_getTrackerFromNode: function (node) {
return getTracker(ReactDOMComponentTree.getInstanceFromNode(node));
},
trackNode: function (node) {
if (node._wrapperState.valueTracker) {
return;
}
node._wrapperState.valueTracker = trackValueOnNode(node, node);
},
track: function (inst) {
if (getTracker(inst)) {
return;
}
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
attachTracker(inst, trackValueOnNode(node, inst));
},
updateValueIfChanged: function (inst) {
if (!inst) {
return false;
}
var tracker = getTracker(inst);
if (!tracker) {
if (typeof inst.tag === 'number') {
inputValueTracking.trackNode(inst.stateNode);
} else {
inputValueTracking.track(inst);
}
return true;
}
var lastValue = tracker.getValue();
var nextValue = getValueFromNode(ReactDOMComponentTree.getNodeFromInstance(inst));
if (nextValue !== lastValue) {
tracker.setValue(nextValue);
return true;
}
return false;
},
stopTracking: function (inst) {
var tracker = getTracker(inst);
if (tracker) {
tracker.stopTracking();
}
}
};
module.exports = inputValueTracking;
},{"24":24}],109:[function(_dereq_,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 ExecutionEnvironment = _dereq_(120);
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;
},{"120":120}],110:[function(_dereq_,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;
},{}],111:[function(_dereq_,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 escapeTextContentForBrowser = _dereq_(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;
},{"95":95}],112:[function(_dereq_,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;
},{}],113:[function(_dereq_,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 ExecutionEnvironment = _dereq_(120);
var DOMNamespaces = _dereq_(7);
var WHITESPACE_TEST = /^[ \r\n\t\f]/;
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
var createMicrosoftUnsafeLocalFunction = _dereq_(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;
},{"120":120,"7":7,"93":93}],114:[function(_dereq_,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 ExecutionEnvironment = _dereq_(120);
var escapeTextContentForBrowser = _dereq_(95);
var setInnerHTML = _dereq_(113);
/**
* 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;
},{"113":113,"120":120,"95":95}],115:[function(_dereq_,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 _assign = _dereq_(139);
var emptyFunction = _dereq_(124);
var getComponentName = _dereq_(98);
var warning = _dereq_(138);
var validateDOMNesting = emptyFunction;
if ("development" !== 'production') {
var _require = _dereq_(38),
getCurrentFiberStackAddendum = _require.getCurrentFiberStackAddendum;
// 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 getOwnerInfo = function (childInstance, childTag, ancestorInstance, ancestorTag, isParent) {
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 getComponentName(inst) || UNKNOWN;
});
var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
return getComponentName(inst) || 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 ? getComponentName(childOwners[deepestCommon]) || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
// If we're warning about an invalid (non-parent) ancestry, add '...'
isParent ? [] : ['...'], childOwnerNames, childTag).join(' > ');
return ownerInfo;
};
var didWarn = {};
validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
if (childText != null) {
"development" !== '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 invalidParentOrAncestor = invalidParent || invalidAncestor;
if (!invalidParentOrAncestor) {
return;
}
var ancestorInstance = invalidParentOrAncestor.instance;
var ancestorTag = invalidParentOrAncestor.tag;
var addendum;
if (childInstance != null) {
addendum = ' See ' + getOwnerInfo(childInstance, childTag, ancestorInstance, ancestorTag, Boolean(invalidParent)) + '.';
} else {
addendum = getCurrentFiberStackAddendum();
}
var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
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.';
}
"development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum) : void 0;
} else {
"development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum) : 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;
},{"124":124,"138":138,"139":139,"38":38,"98":98}],116:[function(_dereq_,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 React */
'use strict';
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
module.exports = ReactInternals.ReactComponentTreeHook;
},{}],117:[function(_dereq_,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 React */
'use strict';
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
module.exports = ReactInternals.ReactCurrentOwner;
},{}],118:[function(_dereq_,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 React */
'use strict';
module.exports = React;
},{}],119:[function(_dereq_,module,exports){
'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 = _dereq_(124);
/**
* 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 ("development" !== '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;
},{"124":124}],120:[function(_dereq_,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;
},{}],121:[function(_dereq_,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;
},{}],122:[function(_dereq_,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';
var camelize = _dereq_(121);
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;
},{"121":121}],123:[function(_dereq_,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.
*
*
*/
var isTextNode = _dereq_(133);
/*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;
},{"133":133}],124:[function(_dereq_,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;
},{}],125:[function(_dereq_,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 emptyObject = {};
if ("development" !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
},{}],126:[function(_dereq_,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;
},{}],127:[function(_dereq_,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.
*/
function getActiveElement() /*?DOMElement*/{
if (typeof document === 'undefined') {
return null;
}
try {
return document.activeElement || document.body;
} catch (e) {
return document.body;
}
}
module.exports = getActiveElement;
},{}],128:[function(_dereq_,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) {
return {
x: window.pageXOffset || document.documentElement.scrollLeft,
y: window.pageYOffset || document.documentElement.scrollTop
};
}
return {
x: scrollable.scrollLeft,
y: scrollable.scrollTop
};
}
module.exports = getUnboundedScrollPosition;
},{}],129:[function(_dereq_,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;
},{}],130:[function(_dereq_,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';
var hyphenate = _dereq_(129);
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;
},{"129":129}],131:[function(_dereq_,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';
/**
* 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 ("development" !== '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;
},{}],132:[function(_dereq_,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) {
return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
}
module.exports = isNode;
},{}],133:[function(_dereq_,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 isNode = _dereq_(132);
/**
* @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;
},{"132":132}],134:[function(_dereq_,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;
},{}],135:[function(_dereq_,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';
var ExecutionEnvironment = _dereq_(120);
var performance;
if (ExecutionEnvironment.canUseDOM) {
performance = window.performance || window.msPerformance || window.webkitPerformance;
}
module.exports = performance || {};
},{"120":120}],136:[function(_dereq_,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 performance = _dereq_(135);
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;
},{"135":135}],137:[function(_dereq_,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(_dereq_,module,exports){
/**
* 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 = _dereq_(124);
/**
* 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 ("development" !== '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;
},{"124":124}],139:[function(_dereq_,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;
};
},{}]},{},[26])(26)
});
});
|
const assert = require('assert').strict;
const {BigQuery} = require('@google-cloud/bigquery');
const BQ_PROJECTID = process.env.BQ_PROJECTID;
const BQ_DATASET_QUADKEY = process.env.BQ_DATASET_QUADKEY;
describe('TOCHILDREN integration tests', () => {
const queryOptions = { 'timeoutMs' : 30000 };
let client;
before(async () => {
if (!BQ_PROJECTID) {
throw "Missing BQ_PROJECTID env variable";
}
if (!BQ_DATASET_QUADKEY) {
throw "Missing BQ_DATASET_QUADKEY env variable";
}
client = new BigQuery({projectId: `${BQ_PROJECTID}`});
});
it ('TOCHILDREN should work at any level of zoom', async () => {
let query = `WITH zoomContext AS
(
WITH zoomValues AS
(
SELECT zoom FROM UNNEST (GENERATE_ARRAY(0,28)) AS zoom
)
SELECT *
FROM
zoomValues,
UNNEST(GENERATE_ARRAY(0,CAST(pow(2, zoom) - 1 AS INT64),COALESCE(NULLIF(CAST(pow(2, zoom)*0.02 AS INT64),0),1))) tileX,
UNNEST(GENERATE_ARRAY(0,CAST(pow(2, zoom) - 1 AS INT64),COALESCE(NULLIF(CAST(pow(2, zoom)*0.02 AS INT64),0),1))) tileY
),
expectedQuadintContext AS
(
SELECT *,
\`${BQ_PROJECTID}\`.\`${BQ_DATASET_QUADKEY}\`.QUADINT_FROMZXY(zoom, tileX, tileY) AS expectedQuadint,
FROM zoomContext
),
childrenContext AS
(
SELECT *,
\`${BQ_PROJECTID}\`.\`${BQ_DATASET_QUADKEY}\`.TOCHILDREN(expectedQuadint, zoom + 1) AS children
FROM expectedQuadintContext
)
SELECT *
FROM
(
SELECT expectedQuadint,
\`${BQ_PROJECTID}\`.\`${BQ_DATASET_QUADKEY}\`.TOPARENT(child, zoom) AS currentQuadint
FROM childrenContext, UNNEST(children) AS child
)
WHERE currentQuadint != expectedQuadint`;
await assert.doesNotReject( async () => {
[rows] = await client.query(query, queryOptions);
});
assert.equal(rows.length, 0);
});
it ('TOCHILDREN should reject quadints at zoom 29', async () => {
let query = `SELECT \`${BQ_PROJECTID}\`.\`${BQ_DATASET_QUADKEY}\`.TOCHILDREN(4611686027017322525,30)`;
await assert.rejects( async () => {
[rows] = await client.query(query, queryOptions);
});
});
it ('TOCHILDREN should fail with NULL arguments', async () => {
let rows;
let query = `SELECT \`${BQ_PROJECTID}\`.\`${BQ_DATASET_QUADKEY}\`.TOCHILDREN(NULL, 1);`;
await assert.rejects( async () => {
[rows] = await client.query(query, queryOptions);
});
query = `SELECT \`${BQ_PROJECTID}\`.\`${BQ_DATASET_QUADKEY}\`.TOCHILDREN(322, NULL);`;
await assert.rejects( async () => {
[rows] = await client.query(query, queryOptions);
});
});
}); /* QUADKEY integration tests */
|
module.exports={A:{A:{"2":"K D G E A B iB"},B:{"2":"2 C d J M H I"},C:{"2":"0 1 2 3 4 6 7 8 9 fB DB F N K D G E A B C d J M H I O P Q R S T U V W X Y Z a b c e f g h i j k l m n o L q r s t u v w x y z HB GB BB CB FB ZB YB"},D:{"2":"0 1 2 6 7 F N K D G E A B C d J M H I O P Q R S T U V W X Y Z a b c e f g h i j k l m n o L q r s t u v w x y z HB","1028":"3 4 8 9 GB BB CB FB SB NB LB kB MB JB OB PB QB"},E:{"2":"5 F N K D G E A B C RB IB TB UB VB WB XB p aB"},F:{"2":"5 6 E B C J M H I O P Q R S T U V W X Y Z a b c e f g h i j k l m n o L q bB cB dB eB p AB gB","1028":"0 1 r s t u v w x y z"},G:{"2":"G IB hB EB jB KB lB mB nB oB pB qB rB sB tB uB"},H:{"2":"vB"},I:{"1":"4","2":"wB 0B 1B","132":"DB F xB yB zB EB"},J:{"2":"D A"},K:{"2":"5 A B C p AB","516":"L"},L:{"1":"JB"},M:{"1":"3"},N:{"2":"A B"},O:{"2":"2B"},P:{"1":"6B 7B","132":"F","516":"3B 4B 5B"},Q:{"2":"8B"},R:{"516":"9B"},S:{"260":"AC"}},B:7,C:"Network Information API"};
|
/*!
* =====================================================
* Mui v0.9.0 (https://github.com/dcloudio/mui)
* =====================================================
*/
/*!
handlebars v2.0.0
Copyright (C) 2011-2014 by Yehuda Katz
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.
@license
*/
/* exported Handlebars */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.Handlebars = root.Handlebars || factory();
}
}(this, function () {
// handlebars/safe-string.js
var __module4__ = (function() {
"use strict";
var __exports__;
// Build out our basic SafeString type
function SafeString(string) {
this.string = string;
}
SafeString.prototype.toString = function() {
return "" + this.string;
};
__exports__ = SafeString;
return __exports__;
})();
// handlebars/utils.js
var __module3__ = (function(__dependency1__) {
"use strict";
var __exports__ = {};
/*jshint -W004 */
var SafeString = __dependency1__;
var escape = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"`": "`"
};
var badChars = /[&<>"'`]/g;
var possible = /[&<>"'`]/;
function escapeChar(chr) {
return escape[chr];
}
function extend(obj /* , ...source */) {
for (var i = 1; i < arguments.length; i++) {
for (var key in arguments[i]) {
if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
obj[key] = arguments[i][key];
}
}
}
return obj;
}
__exports__.extend = extend;var toString = Object.prototype.toString;
__exports__.toString = toString;
// Sourced from lodash
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
var isFunction = function(value) {
return typeof value === 'function';
};
// fallback for older versions of Chrome and Safari
/* istanbul ignore next */
if (isFunction(/x/)) {
isFunction = function(value) {
return typeof value === 'function' && toString.call(value) === '[object Function]';
};
}
var isFunction;
__exports__.isFunction = isFunction;
/* istanbul ignore next */
var isArray = Array.isArray || function(value) {
return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
};
__exports__.isArray = isArray;
function escapeExpression(string) {
// don't escape SafeStrings, since they're already safe
if (string instanceof SafeString) {
return string.toString();
} else if (string == null) {
return "";
} else if (!string) {
return string + '';
}
// Force a string conversion as this will be done by the append regardless and
// the regex test will do this transparently behind the scenes, causing issues if
// an object's to string has escaped characters in it.
string = "" + string;
if(!possible.test(string)) { return string; }
return string.replace(badChars, escapeChar);
}
__exports__.escapeExpression = escapeExpression;function isEmpty(value) {
if (!value && value !== 0) {
return true;
} else if (isArray(value) && value.length === 0) {
return true;
} else {
return false;
}
}
__exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) {
return (contextPath ? contextPath + '.' : '') + id;
}
__exports__.appendContextPath = appendContextPath;
return __exports__;
})(__module4__);
// handlebars/exception.js
var __module5__ = (function() {
"use strict";
var __exports__;
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
function Exception(message, node) {
var line;
if (node && node.firstLine) {
line = node.firstLine;
message += ' - ' + line + ':' + node.firstColumn;
}
var tmp = Error.prototype.constructor.call(this, message);
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
for (var idx = 0; idx < errorProps.length; idx++) {
this[errorProps[idx]] = tmp[errorProps[idx]];
}
if (line) {
this.lineNumber = line;
this.column = node.firstColumn;
}
}
Exception.prototype = new Error();
__exports__ = Exception;
return __exports__;
})();
// handlebars/base.js
var __module2__ = (function(__dependency1__, __dependency2__) {
"use strict";
var __exports__ = {};
var Utils = __dependency1__;
var Exception = __dependency2__;
var VERSION = "2.0.0";
__exports__.VERSION = VERSION;var COMPILER_REVISION = 6;
__exports__.COMPILER_REVISION = COMPILER_REVISION;
var REVISION_CHANGES = {
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
2: '== 1.0.0-rc.3',
3: '== 1.0.0-rc.4',
4: '== 1.x.x',
5: '== 2.0.0-alpha.x',
6: '>= 2.0.0-beta.1'
};
__exports__.REVISION_CHANGES = REVISION_CHANGES;
var isArray = Utils.isArray,
isFunction = Utils.isFunction,
toString = Utils.toString,
objectType = '[object Object]';
function HandlebarsEnvironment(helpers, partials) {
this.helpers = helpers || {};
this.partials = partials || {};
registerDefaultHelpers(this);
}
__exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
constructor: HandlebarsEnvironment,
logger: logger,
log: log,
registerHelper: function(name, fn) {
if (toString.call(name) === objectType) {
if (fn) { throw new Exception('Arg not supported with multiple helpers'); }
Utils.extend(this.helpers, name);
} else {
this.helpers[name] = fn;
}
},
unregisterHelper: function(name) {
delete this.helpers[name];
},
registerPartial: function(name, partial) {
if (toString.call(name) === objectType) {
Utils.extend(this.partials, name);
} else {
this.partials[name] = partial;
}
},
unregisterPartial: function(name) {
delete this.partials[name];
}
};
function registerDefaultHelpers(instance) {
instance.registerHelper('helperMissing', function(/* [args, ]options */) {
if(arguments.length === 1) {
// A missing field in a {{foo}} constuct.
return undefined;
} else {
// Someone is actually trying to call something, blow up.
throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'");
}
});
instance.registerHelper('blockHelperMissing', function(context, options) {
var inverse = options.inverse,
fn = options.fn;
if(context === true) {
return fn(this);
} else if(context === false || context == null) {
return inverse(this);
} else if (isArray(context)) {
if(context.length > 0) {
if (options.ids) {
options.ids = [options.name];
}
return instance.helpers.each(context, options);
} else {
return inverse(this);
}
} else {
if (options.data && options.ids) {
var data = createFrame(options.data);
data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
options = {data: data};
}
return fn(context, options);
}
});
instance.registerHelper('each', function(context, options) {
if (!options) {
throw new Exception('Must pass iterator to #each');
}
var fn = options.fn, inverse = options.inverse;
var i = 0, ret = "", data;
var contextPath;
if (options.data && options.ids) {
contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
}
if (isFunction(context)) { context = context.call(this); }
if (options.data) {
data = createFrame(options.data);
}
if(context && typeof context === 'object') {
if (isArray(context)) {
for(var j = context.length; i<j; i++) {
if (data) {
data.index = i;
data.first = (i === 0);
data.last = (i === (context.length-1));
if (contextPath) {
data.contextPath = contextPath + i;
}
}
ret = ret + fn(context[i], { data: data });
}
} else {
for(var key in context) {
if(context.hasOwnProperty(key)) {
if(data) {
data.key = key;
data.index = i;
data.first = (i === 0);
if (contextPath) {
data.contextPath = contextPath + key;
}
}
ret = ret + fn(context[key], {data: data});
i++;
}
}
}
}
if(i === 0){
ret = inverse(this);
}
return ret;
});
instance.registerHelper('if', function(conditional, options) {
if (isFunction(conditional)) { conditional = conditional.call(this); }
// Default behavior is to render the positive path if the value is truthy and not empty.
// The `includeZero` option may be set to treat the condtional as purely not empty based on the
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});
instance.registerHelper('unless', function(conditional, options) {
return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
});
instance.registerHelper('with', function(context, options) {
if (isFunction(context)) { context = context.call(this); }
var fn = options.fn;
if (!Utils.isEmpty(context)) {
if (options.data && options.ids) {
var data = createFrame(options.data);
data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
options = {data:data};
}
return fn(context, options);
} else {
return options.inverse(this);
}
});
instance.registerHelper('log', function(message, options) {
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
instance.log(level, message);
});
instance.registerHelper('lookup', function(obj, field) {
return obj && obj[field];
});
}
var logger = {
methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
// State enum
DEBUG: 0,
INFO: 1,
WARN: 2,
ERROR: 3,
level: 3,
// can be overridden in the host environment
log: function(level, message) {
if (logger.level <= level) {
var method = logger.methodMap[level];
if (typeof console !== 'undefined' && console[method]) {
console[method].call(console, message);
}
}
}
};
__exports__.logger = logger;
var log = logger.log;
__exports__.log = log;
var createFrame = function(object) {
var frame = Utils.extend({}, object);
frame._parent = object;
return frame;
};
__exports__.createFrame = createFrame;
return __exports__;
})(__module3__, __module5__);
// handlebars/runtime.js
var __module6__ = (function(__dependency1__, __dependency2__, __dependency3__) {
"use strict";
var __exports__ = {};
var Utils = __dependency1__;
var Exception = __dependency2__;
var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
var createFrame = __dependency3__.createFrame;
function checkRevision(compilerInfo) {
var compilerRevision = compilerInfo && compilerInfo[0] || 1,
currentRevision = COMPILER_REVISION;
if (compilerRevision !== currentRevision) {
if (compilerRevision < currentRevision) {
var runtimeVersions = REVISION_CHANGES[currentRevision],
compilerVersions = REVISION_CHANGES[compilerRevision];
throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
} else {
// Use the embedded version info since the runtime doesn't know about this revision yet
throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
"Please update your runtime to a newer version ("+compilerInfo[1]+").");
}
}
}
__exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
function template(templateSpec, env) {
/* istanbul ignore next */
if (!env) {
throw new Exception("No environment passed to template");
}
if (!templateSpec || !templateSpec.main) {
throw new Exception('Unknown template object: ' + typeof templateSpec);
}
// Note: Using env.VM references rather than local var references throughout this section to allow
// for external users to override these as psuedo-supported APIs.
env.VM.checkRevision(templateSpec.compiler);
var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {
if (hash) {
context = Utils.extend({}, context, hash);
}
var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);
if (result == null && env.compile) {
var options = { helpers: helpers, partials: partials, data: data, depths: depths };
partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);
result = partials[name](context, options);
}
if (result != null) {
if (indent) {
var lines = result.split('\n');
for (var i = 0, l = lines.length; i < l; i++) {
if (!lines[i] && i + 1 === l) {
break;
}
lines[i] = indent + lines[i];
}
result = lines.join('\n');
}
return result;
} else {
throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
}
};
// Just add water
var container = {
lookup: function(depths, name) {
var len = depths.length;
for (var i = 0; i < len; i++) {
if (depths[i] && depths[i][name] != null) {
return depths[i][name];
}
}
},
lambda: function(current, context) {
return typeof current === 'function' ? current.call(context) : current;
},
escapeExpression: Utils.escapeExpression,
invokePartial: invokePartialWrapper,
fn: function(i) {
return templateSpec[i];
},
programs: [],
program: function(i, data, depths) {
var programWrapper = this.programs[i],
fn = this.fn(i);
if (data || depths) {
programWrapper = program(this, i, fn, data, depths);
} else if (!programWrapper) {
programWrapper = this.programs[i] = program(this, i, fn);
}
return programWrapper;
},
data: function(data, depth) {
while (data && depth--) {
data = data._parent;
}
return data;
},
merge: function(param, common) {
var ret = param || common;
if (param && common && (param !== common)) {
ret = Utils.extend({}, common, param);
}
return ret;
},
noop: env.VM.noop,
compilerInfo: templateSpec.compiler
};
var ret = function(context, options) {
options = options || {};
var data = options.data;
ret._setup(options);
if (!options.partial && templateSpec.useData) {
data = initData(context, data);
}
var depths;
if (templateSpec.useDepths) {
depths = options.depths ? [context].concat(options.depths) : [context];
}
return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);
};
ret.isTop = true;
ret._setup = function(options) {
if (!options.partial) {
container.helpers = container.merge(options.helpers, env.helpers);
if (templateSpec.usePartial) {
container.partials = container.merge(options.partials, env.partials);
}
} else {
container.helpers = options.helpers;
container.partials = options.partials;
}
};
ret._child = function(i, data, depths) {
if (templateSpec.useDepths && !depths) {
throw new Exception('must pass parent depths');
}
return program(container, i, templateSpec[i], data, depths);
};
return ret;
}
__exports__.template = template;function program(container, i, fn, data, depths) {
var prog = function(context, options) {
options = options || {};
return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths));
};
prog.program = i;
prog.depth = depths ? depths.length : 0;
return prog;
}
__exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data, depths) {
var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths };
if(partial === undefined) {
throw new Exception("The partial " + name + " could not be found");
} else if(partial instanceof Function) {
return partial(context, options);
}
}
__exports__.invokePartial = invokePartial;function noop() { return ""; }
__exports__.noop = noop;function initData(context, data) {
if (!data || !('root' in data)) {
data = data ? createFrame(data) : {};
data.root = context;
}
return data;
}
return __exports__;
})(__module3__, __module5__, __module2__);
// handlebars.runtime.js
var __module1__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
"use strict";
var __exports__;
/*globals Handlebars: true */
var base = __dependency1__;
// Each of these augment the Handlebars object. No need to setup here.
// (This is done to easily share code between commonjs and browse envs)
var SafeString = __dependency2__;
var Exception = __dependency3__;
var Utils = __dependency4__;
var runtime = __dependency5__;
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
var create = function() {
var hb = new base.HandlebarsEnvironment();
Utils.extend(hb, base);
hb.SafeString = SafeString;
hb.Exception = Exception;
hb.Utils = Utils;
hb.escapeExpression = Utils.escapeExpression;
hb.VM = runtime;
hb.template = function(spec) {
return runtime.template(spec, hb);
};
return hb;
};
var Handlebars = create();
Handlebars.create = create;
Handlebars['default'] = Handlebars;
__exports__ = Handlebars;
return __exports__;
})(__module2__, __module4__, __module5__, __module3__, __module6__);
// handlebars/compiler/ast.js
var __module7__ = (function(__dependency1__) {
"use strict";
var __exports__;
var Exception = __dependency1__;
function LocationInfo(locInfo) {
locInfo = locInfo || {};
this.firstLine = locInfo.first_line;
this.firstColumn = locInfo.first_column;
this.lastColumn = locInfo.last_column;
this.lastLine = locInfo.last_line;
}
var AST = {
ProgramNode: function(statements, strip, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "program";
this.statements = statements;
this.strip = strip;
},
MustacheNode: function(rawParams, hash, open, strip, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "mustache";
this.strip = strip;
// Open may be a string parsed from the parser or a passed boolean flag
if (open != null && open.charAt) {
// Must use charAt to support IE pre-10
var escapeFlag = open.charAt(3) || open.charAt(2);
this.escaped = escapeFlag !== '{' && escapeFlag !== '&';
} else {
this.escaped = !!open;
}
if (rawParams instanceof AST.SexprNode) {
this.sexpr = rawParams;
} else {
// Support old AST API
this.sexpr = new AST.SexprNode(rawParams, hash);
}
// Support old AST API that stored this info in MustacheNode
this.id = this.sexpr.id;
this.params = this.sexpr.params;
this.hash = this.sexpr.hash;
this.eligibleHelper = this.sexpr.eligibleHelper;
this.isHelper = this.sexpr.isHelper;
},
SexprNode: function(rawParams, hash, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "sexpr";
this.hash = hash;
var id = this.id = rawParams[0];
var params = this.params = rawParams.slice(1);
// a mustache is definitely a helper if:
// * it is an eligible helper, and
// * it has at least one parameter or hash segment
this.isHelper = !!(params.length || hash);
// a mustache is an eligible helper if:
// * its id is simple (a single part, not `this` or `..`)
this.eligibleHelper = this.isHelper || id.isSimple;
// if a mustache is an eligible helper but not a definite
// helper, it is ambiguous, and will be resolved in a later
// pass or at runtime.
},
PartialNode: function(partialName, context, hash, strip, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "partial";
this.partialName = partialName;
this.context = context;
this.hash = hash;
this.strip = strip;
this.strip.inlineStandalone = true;
},
BlockNode: function(mustache, program, inverse, strip, locInfo) {
LocationInfo.call(this, locInfo);
this.type = 'block';
this.mustache = mustache;
this.program = program;
this.inverse = inverse;
this.strip = strip;
if (inverse && !program) {
this.isInverse = true;
}
},
RawBlockNode: function(mustache, content, close, locInfo) {
LocationInfo.call(this, locInfo);
if (mustache.sexpr.id.original !== close) {
throw new Exception(mustache.sexpr.id.original + " doesn't match " + close, this);
}
content = new AST.ContentNode(content, locInfo);
this.type = 'block';
this.mustache = mustache;
this.program = new AST.ProgramNode([content], {}, locInfo);
},
ContentNode: function(string, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "content";
this.original = this.string = string;
},
HashNode: function(pairs, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "hash";
this.pairs = pairs;
},
IdNode: function(parts, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "ID";
var original = "",
dig = [],
depth = 0,
depthString = '';
for(var i=0,l=parts.length; i<l; i++) {
var part = parts[i].part;
original += (parts[i].separator || '') + part;
if (part === ".." || part === "." || part === "this") {
if (dig.length > 0) {
throw new Exception("Invalid path: " + original, this);
} else if (part === "..") {
depth++;
depthString += '../';
} else {
this.isScoped = true;
}
} else {
dig.push(part);
}
}
this.original = original;
this.parts = dig;
this.string = dig.join('.');
this.depth = depth;
this.idName = depthString + this.string;
// an ID is simple if it only has one part, and that part is not
// `..` or `this`.
this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
this.stringModeValue = this.string;
},
PartialNameNode: function(name, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "PARTIAL_NAME";
this.name = name.original;
},
DataNode: function(id, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "DATA";
this.id = id;
this.stringModeValue = id.stringModeValue;
this.idName = '@' + id.stringModeValue;
},
StringNode: function(string, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "STRING";
this.original =
this.string =
this.stringModeValue = string;
},
NumberNode: function(number, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "NUMBER";
this.original =
this.number = number;
this.stringModeValue = Number(number);
},
BooleanNode: function(bool, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "BOOLEAN";
this.bool = bool;
this.stringModeValue = bool === "true";
},
CommentNode: function(comment, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "comment";
this.comment = comment;
this.strip = {
inlineStandalone: true
};
}
};
// Must be exported as an object rather than the root of the module as the jison lexer
// most modify the object to operate properly.
__exports__ = AST;
return __exports__;
})(__module5__);
// handlebars/compiler/parser.js
var __module9__ = (function() {
"use strict";
var __exports__;
/* jshint ignore:start */
/* istanbul ignore next */
/* Jison generated parser */
var handlebars = (function(){
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"root":3,"program":4,"EOF":5,"program_repetition0":6,"statement":7,"mustache":8,"block":9,"rawBlock":10,"partial":11,"CONTENT":12,"COMMENT":13,"openRawBlock":14,"END_RAW_BLOCK":15,"OPEN_RAW_BLOCK":16,"sexpr":17,"CLOSE_RAW_BLOCK":18,"openBlock":19,"block_option0":20,"closeBlock":21,"openInverse":22,"block_option1":23,"OPEN_BLOCK":24,"CLOSE":25,"OPEN_INVERSE":26,"inverseAndProgram":27,"INVERSE":28,"OPEN_ENDBLOCK":29,"path":30,"OPEN":31,"OPEN_UNESCAPED":32,"CLOSE_UNESCAPED":33,"OPEN_PARTIAL":34,"partialName":35,"param":36,"partial_option0":37,"partial_option1":38,"sexpr_repetition0":39,"sexpr_option0":40,"dataName":41,"STRING":42,"NUMBER":43,"BOOLEAN":44,"OPEN_SEXPR":45,"CLOSE_SEXPR":46,"hash":47,"hash_repetition_plus0":48,"hashSegment":49,"ID":50,"EQUALS":51,"DATA":52,"pathSegments":53,"SEP":54,"$accept":0,"$end":1},
terminals_: {2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},
productions_: [0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: yy.prepareProgram($$[$0-1].statements, true); return $$[$0-1];
break;
case 2:this.$ = new yy.ProgramNode(yy.prepareProgram($$[$0]), {}, this._$);
break;
case 3:this.$ = $$[$0];
break;
case 4:this.$ = $$[$0];
break;
case 5:this.$ = $$[$0];
break;
case 6:this.$ = $$[$0];
break;
case 7:this.$ = new yy.ContentNode($$[$0], this._$);
break;
case 8:this.$ = new yy.CommentNode($$[$0], this._$);
break;
case 9:this.$ = new yy.RawBlockNode($$[$0-2], $$[$0-1], $$[$0], this._$);
break;
case 10:this.$ = new yy.MustacheNode($$[$0-1], null, '', '', this._$);
break;
case 11:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], false, this._$);
break;
case 12:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], true, this._$);
break;
case 13:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
break;
case 14:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
break;
case 15:this.$ = { strip: yy.stripFlags($$[$0-1], $$[$0-1]), program: $$[$0] };
break;
case 16:this.$ = {path: $$[$0-1], strip: yy.stripFlags($$[$0-2], $$[$0])};
break;
case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
break;
case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
break;
case 19:this.$ = new yy.PartialNode($$[$0-3], $$[$0-2], $$[$0-1], yy.stripFlags($$[$0-4], $$[$0]), this._$);
break;
case 20:this.$ = new yy.PartialNode($$[$0-2], undefined, $$[$0-1], yy.stripFlags($$[$0-3], $$[$0]), this._$);
break;
case 21:this.$ = new yy.SexprNode([$$[$0-2]].concat($$[$0-1]), $$[$0], this._$);
break;
case 22:this.$ = new yy.SexprNode([$$[$0]], null, this._$);
break;
case 23:this.$ = $$[$0];
break;
case 24:this.$ = new yy.StringNode($$[$0], this._$);
break;
case 25:this.$ = new yy.NumberNode($$[$0], this._$);
break;
case 26:this.$ = new yy.BooleanNode($$[$0], this._$);
break;
case 27:this.$ = $$[$0];
break;
case 28:$$[$0-1].isHelper = true; this.$ = $$[$0-1];
break;
case 29:this.$ = new yy.HashNode($$[$0], this._$);
break;
case 30:this.$ = [$$[$0-2], $$[$0]];
break;
case 31:this.$ = new yy.PartialNameNode($$[$0], this._$);
break;
case 32:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0], this._$), this._$);
break;
case 33:this.$ = new yy.PartialNameNode(new yy.NumberNode($$[$0], this._$));
break;
case 34:this.$ = new yy.DataNode($$[$0], this._$);
break;
case 35:this.$ = new yy.IdNode($$[$0], this._$);
break;
case 36: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2];
break;
case 37:this.$ = [{part: $$[$0]}];
break;
case 38:this.$ = [];
break;
case 39:$$[$0-1].push($$[$0]);
break;
case 48:this.$ = [];
break;
case 49:$$[$0-1].push($$[$0]);
break;
case 52:this.$ = [$$[$0]];
break;
case 53:$$[$0-1].push($$[$0]);
break;
}
},
table: [{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],
defaultActions: {4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},
parseError: function parseError(str, hash) {
throw new Error(str);
},
parse: function parse(input) {
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
this.yy.parser = this;
if (typeof this.lexer.yylloc == "undefined")
this.lexer.yylloc = {};
var yyloc = this.lexer.yylloc;
lstack.push(yyloc);
var ranges = this.lexer.options && this.lexer.options.ranges;
if (typeof this.yy.parseError === "function")
this.parseError = this.yy.parseError;
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
function lex() {
var token;
token = self.lexer.lex() || 1;
if (typeof token !== "number") {
token = self.symbols_[token] || token;
}
return token;
}
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
while (true) {
state = stack[stack.length - 1];
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol === null || typeof symbol == "undefined") {
symbol = lex();
}
action = table[state] && table[state][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
if (!recovering) {
expected = [];
for (p in table[state])
if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
if (this.lexer.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
}
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
if (recovering > 0)
recovering--;
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
if (ranges) {
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
}
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
if (typeof r !== "undefined") {
return r;
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
}
}
return true;
}
};
/* Jison generated lexer */
var lexer = (function(){
var lexer = ({EOF:1,
parseError:function parseError(str, hash) {
if (this.yy.parser) {
this.yy.parser.parseError(str, hash);
} else {
throw new Error(str);
}
},
setInput:function (input) {
this._input = input;
this._more = this._less = this.done = false;
this.yylineno = this.yyleng = 0;
this.yytext = this.matched = this.match = '';
this.conditionStack = ['INITIAL'];
this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
if (this.options.ranges) this.yylloc.range = [0,0];
this.offset = 0;
return this;
},
input:function () {
var ch = this._input[0];
this.yytext += ch;
this.yyleng++;
this.offset++;
this.match += ch;
this.matched += ch;
var lines = ch.match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno++;
this.yylloc.last_line++;
} else {
this.yylloc.last_column++;
}
if (this.options.ranges) this.yylloc.range[1]++;
this._input = this._input.slice(1);
return ch;
},
unput:function (ch) {
var len = ch.length;
var lines = ch.split(/(?:\r\n?|\n)/g);
this._input = ch + this._input;
this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
//this.yyleng -= len;
this.offset -= len;
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length-1);
this.matched = this.matched.substr(0, this.matched.length-1);
if (lines.length-1) this.yylineno -= lines.length-1;
var r = this.yylloc.range;
this.yylloc = {first_line: this.yylloc.first_line,
last_line: this.yylineno+1,
first_column: this.yylloc.first_column,
last_column: lines ?
(lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
this.yylloc.first_column - len
};
if (this.options.ranges) {
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
}
return this;
},
more:function () {
this._more = true;
return this;
},
less:function (n) {
this.unput(this.match.slice(n));
},
pastInput:function () {
var past = this.matched.substr(0, this.matched.length - this.match.length);
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
},
upcomingInput:function () {
var next = this.match;
if (next.length < 20) {
next += this._input.substr(0, 20-next.length);
}
return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
},
showPosition:function () {
var pre = this.pastInput();
var c = new Array(pre.length + 1).join("-");
return pre + this.upcomingInput() + "\n" + c+"^";
},
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) this.done = true;
var token,
match,
tempMatch,
index,
col,
lines;
if (!this._more) {
this.yytext = '';
this.match = '';
}
var rules = this._currentRules();
for (var i=0;i < rules.length; i++) {
tempMatch = this._input.match(this.rules[rules[i]]);
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
match = tempMatch;
index = i;
if (!this.options.flex) break;
}
}
if (match) {
lines = match[0].match(/(?:\r\n?|\n).*/g);
if (lines) this.yylineno += lines.length;
this.yylloc = {first_line: this.yylloc.last_line,
last_line: this.yylineno+1,
first_column: this.yylloc.last_column,
last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
this.yytext += match[0];
this.match += match[0];
this.matches = match;
this.yyleng = this.yytext.length;
if (this.options.ranges) {
this.yylloc.range = [this.offset, this.offset += this.yyleng];
}
this._more = false;
this._input = this._input.slice(match[0].length);
this.matched += match[0];
token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
if (this.done && this._input) this.done = false;
if (token) return token;
else return;
}
if (this._input === "") {
return this.EOF;
} else {
return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
{text: "", token: null, line: this.yylineno});
}
},
lex:function lex() {
var r = this.next();
if (typeof r !== 'undefined') {
return r;
} else {
return this.lex();
}
},
begin:function begin(condition) {
this.conditionStack.push(condition);
},
popState:function popState() {
return this.conditionStack.pop();
},
_currentRules:function _currentRules() {
return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
},
topState:function () {
return this.conditionStack[this.conditionStack.length-2];
},
pushState:function begin(condition) {
this.begin(condition);
}});
lexer.options = {};
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
function strip(start, end) {
return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
}
var YYSTATE=YY_START
switch($avoiding_name_collisions) {
case 0:
if(yy_.yytext.slice(-2) === "\\\\") {
strip(0,1);
this.begin("mu");
} else if(yy_.yytext.slice(-1) === "\\") {
strip(0,1);
this.begin("emu");
} else {
this.begin("mu");
}
if(yy_.yytext) return 12;
break;
case 1:return 12;
break;
case 2:
this.popState();
return 12;
break;
case 3:
yy_.yytext = yy_.yytext.substr(5, yy_.yyleng-9);
this.popState();
return 15;
break;
case 4: return 12;
break;
case 5:strip(0,4); this.popState(); return 13;
break;
case 6:return 45;
break;
case 7:return 46;
break;
case 8: return 16;
break;
case 9:
this.popState();
this.begin('raw');
return 18;
break;
case 10:return 34;
break;
case 11:return 24;
break;
case 12:return 29;
break;
case 13:this.popState(); return 28;
break;
case 14:this.popState(); return 28;
break;
case 15:return 26;
break;
case 16:return 26;
break;
case 17:return 32;
break;
case 18:return 31;
break;
case 19:this.popState(); this.begin('com');
break;
case 20:strip(3,5); this.popState(); return 13;
break;
case 21:return 31;
break;
case 22:return 51;
break;
case 23:return 50;
break;
case 24:return 50;
break;
case 25:return 54;
break;
case 26:// ignore whitespace
break;
case 27:this.popState(); return 33;
break;
case 28:this.popState(); return 25;
break;
case 29:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 42;
break;
case 30:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 42;
break;
case 31:return 52;
break;
case 32:return 44;
break;
case 33:return 44;
break;
case 34:return 43;
break;
case 35:return 50;
break;
case 36:yy_.yytext = strip(1,2); return 50;
break;
case 37:return 'INVALID';
break;
case 38:return 5;
break;
}
};
lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}};
return lexer;})()
parser.lexer = lexer;
function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
return new Parser;
})();__exports__ = handlebars;
/* jshint ignore:end */
return __exports__;
})();
// handlebars/compiler/helpers.js
var __module10__ = (function(__dependency1__) {
"use strict";
var __exports__ = {};
var Exception = __dependency1__;
function stripFlags(open, close) {
return {
left: open.charAt(2) === '~',
right: close.charAt(close.length-3) === '~'
};
}
__exports__.stripFlags = stripFlags;
function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) {
/*jshint -W040 */
if (mustache.sexpr.id.original !== close.path.original) {
throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache);
}
var inverse = inverseAndProgram && inverseAndProgram.program;
var strip = {
left: mustache.strip.left,
right: close.strip.right,
// Determine the standalone candiacy. Basically flag our content as being possibly standalone
// so our parent can determine if we actually are standalone
openStandalone: isNextWhitespace(program.statements),
closeStandalone: isPrevWhitespace((inverse || program).statements)
};
if (mustache.strip.right) {
omitRight(program.statements, null, true);
}
if (inverse) {
var inverseStrip = inverseAndProgram.strip;
if (inverseStrip.left) {
omitLeft(program.statements, null, true);
}
if (inverseStrip.right) {
omitRight(inverse.statements, null, true);
}
if (close.strip.left) {
omitLeft(inverse.statements, null, true);
}
// Find standalone else statments
if (isPrevWhitespace(program.statements)
&& isNextWhitespace(inverse.statements)) {
omitLeft(program.statements);
omitRight(inverse.statements);
}
} else {
if (close.strip.left) {
omitLeft(program.statements, null, true);
}
}
if (inverted) {
return new this.BlockNode(mustache, inverse, program, strip, locInfo);
} else {
return new this.BlockNode(mustache, program, inverse, strip, locInfo);
}
}
__exports__.prepareBlock = prepareBlock;
function prepareProgram(statements, isRoot) {
for (var i = 0, l = statements.length; i < l; i++) {
var current = statements[i],
strip = current.strip;
if (!strip) {
continue;
}
var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'),
_isNextWhitespace = isNextWhitespace(statements, i, isRoot),
openStandalone = strip.openStandalone && _isPrevWhitespace,
closeStandalone = strip.closeStandalone && _isNextWhitespace,
inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
if (strip.right) {
omitRight(statements, i, true);
}
if (strip.left) {
omitLeft(statements, i, true);
}
if (inlineStandalone) {
omitRight(statements, i);
if (omitLeft(statements, i)) {
// If we are on a standalone node, save the indent info for partials
if (current.type === 'partial') {
current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : '';
}
}
}
if (openStandalone) {
omitRight((current.program || current.inverse).statements);
// Strip out the previous content node if it's whitespace only
omitLeft(statements, i);
}
if (closeStandalone) {
// Always strip the next node
omitRight(statements, i);
omitLeft((current.inverse || current.program).statements);
}
}
return statements;
}
__exports__.prepareProgram = prepareProgram;function isPrevWhitespace(statements, i, isRoot) {
if (i === undefined) {
i = statements.length;
}
// Nodes that end with newlines are considered whitespace (but are special
// cased for strip operations)
var prev = statements[i-1],
sibling = statements[i-2];
if (!prev) {
return isRoot;
}
if (prev.type === 'content') {
return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original);
}
}
function isNextWhitespace(statements, i, isRoot) {
if (i === undefined) {
i = -1;
}
var next = statements[i+1],
sibling = statements[i+2];
if (!next) {
return isRoot;
}
if (next.type === 'content') {
return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original);
}
}
// Marks the node to the right of the position as omitted.
// I.e. {{foo}}' ' will mark the ' ' node as omitted.
//
// If i is undefined, then the first child will be marked as such.
//
// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
// content is met.
function omitRight(statements, i, multiple) {
var current = statements[i == null ? 0 : i + 1];
if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) {
return;
}
var original = current.string;
current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), '');
current.rightStripped = current.string !== original;
}
// Marks the node to the left of the position as omitted.
// I.e. ' '{{foo}} will mark the ' ' node as omitted.
//
// If i is undefined then the last child will be marked as such.
//
// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
// content is met.
function omitLeft(statements, i, multiple) {
var current = statements[i == null ? statements.length - 1 : i - 1];
if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) {
return;
}
// We omit the last node if it's whitespace only and not preceeded by a non-content node.
var original = current.string;
current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), '');
current.leftStripped = current.string !== original;
return current.leftStripped;
}
return __exports__;
})(__module5__);
// handlebars/compiler/base.js
var __module8__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__) {
"use strict";
var __exports__ = {};
var parser = __dependency1__;
var AST = __dependency2__;
var Helpers = __dependency3__;
var extend = __dependency4__.extend;
__exports__.parser = parser;
var yy = {};
extend(yy, Helpers, AST);
function parse(input) {
// Just return if an already-compile AST was passed in.
if (input.constructor === AST.ProgramNode) { return input; }
parser.yy = yy;
return parser.parse(input);
}
__exports__.parse = parse;
return __exports__;
})(__module9__, __module7__, __module10__, __module3__);
// handlebars/compiler/compiler.js
var __module11__ = (function(__dependency1__, __dependency2__) {
"use strict";
var __exports__ = {};
var Exception = __dependency1__;
var isArray = __dependency2__.isArray;
var slice = [].slice;
function Compiler() {}
__exports__.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a
// function in a context. This is necessary for mustache compatibility, which
// requires that context functions in blocks are evaluated by blockHelperMissing,
// and then proceed as if the resulting value was provided to blockHelperMissing.
Compiler.prototype = {
compiler: Compiler,
equals: function(other) {
var len = this.opcodes.length;
if (other.opcodes.length !== len) {
return false;
}
for (var i = 0; i < len; i++) {
var opcode = this.opcodes[i],
otherOpcode = other.opcodes[i];
if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
return false;
}
}
// We know that length is the same between the two arrays because they are directly tied
// to the opcode behavior above.
len = this.children.length;
for (i = 0; i < len; i++) {
if (!this.children[i].equals(other.children[i])) {
return false;
}
}
return true;
},
guid: 0,
compile: function(program, options) {
this.opcodes = [];
this.children = [];
this.depths = {list: []};
this.options = options;
this.stringParams = options.stringParams;
this.trackIds = options.trackIds;
// These changes will propagate to the other compiler components
var knownHelpers = this.options.knownHelpers;
this.options.knownHelpers = {
'helperMissing': true,
'blockHelperMissing': true,
'each': true,
'if': true,
'unless': true,
'with': true,
'log': true,
'lookup': true
};
if (knownHelpers) {
for (var name in knownHelpers) {
this.options.knownHelpers[name] = knownHelpers[name];
}
}
return this.accept(program);
},
accept: function(node) {
return this[node.type](node);
},
program: function(program) {
var statements = program.statements;
for(var i=0, l=statements.length; i<l; i++) {
this.accept(statements[i]);
}
this.isSimple = l === 1;
this.depths.list = this.depths.list.sort(function(a, b) {
return a - b;
});
return this;
},
compileProgram: function(program) {
var result = new this.compiler().compile(program, this.options);
var guid = this.guid++, depth;
this.usePartial = this.usePartial || result.usePartial;
this.children[guid] = result;
for(var i=0, l=result.depths.list.length; i<l; i++) {
depth = result.depths.list[i];
if(depth < 2) { continue; }
else { this.addDepth(depth - 1); }
}
return guid;
},
block: function(block) {
var mustache = block.mustache,
program = block.program,
inverse = block.inverse;
if (program) {
program = this.compileProgram(program);
}
if (inverse) {
inverse = this.compileProgram(inverse);
}
var sexpr = mustache.sexpr;
var type = this.classifySexpr(sexpr);
if (type === "helper") {
this.helperSexpr(sexpr, program, inverse);
} else if (type === "simple") {
this.simpleSexpr(sexpr);
// now that the simple mustache is resolved, we need to
// evaluate it by executing `blockHelperMissing`
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.opcode('emptyHash');
this.opcode('blockValue', sexpr.id.original);
} else {
this.ambiguousSexpr(sexpr, program, inverse);
// now that the simple mustache is resolved, we need to
// evaluate it by executing `blockHelperMissing`
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.opcode('emptyHash');
this.opcode('ambiguousBlockValue');
}
this.opcode('append');
},
hash: function(hash) {
var pairs = hash.pairs, i, l;
this.opcode('pushHash');
for(i=0, l=pairs.length; i<l; i++) {
this.pushParam(pairs[i][1]);
}
while(i--) {
this.opcode('assignToHash', pairs[i][0]);
}
this.opcode('popHash');
},
partial: function(partial) {
var partialName = partial.partialName;
this.usePartial = true;
if (partial.hash) {
this.accept(partial.hash);
} else {
this.opcode('push', 'undefined');
}
if (partial.context) {
this.accept(partial.context);
} else {
this.opcode('getContext', 0);
this.opcode('pushContext');
}
this.opcode('invokePartial', partialName.name, partial.indent || '');
this.opcode('append');
},
content: function(content) {
if (content.string) {
this.opcode('appendContent', content.string);
}
},
mustache: function(mustache) {
this.sexpr(mustache.sexpr);
if(mustache.escaped && !this.options.noEscape) {
this.opcode('appendEscaped');
} else {
this.opcode('append');
}
},
ambiguousSexpr: function(sexpr, program, inverse) {
var id = sexpr.id,
name = id.parts[0],
isBlock = program != null || inverse != null;
this.opcode('getContext', id.depth);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.ID(id);
this.opcode('invokeAmbiguous', name, isBlock);
},
simpleSexpr: function(sexpr) {
var id = sexpr.id;
if (id.type === 'DATA') {
this.DATA(id);
} else if (id.parts.length) {
this.ID(id);
} else {
// Simplified ID for `this`
this.addDepth(id.depth);
this.opcode('getContext', id.depth);
this.opcode('pushContext');
}
this.opcode('resolvePossibleLambda');
},
helperSexpr: function(sexpr, program, inverse) {
var params = this.setupFullMustacheParams(sexpr, program, inverse),
id = sexpr.id,
name = id.parts[0];
if (this.options.knownHelpers[name]) {
this.opcode('invokeKnownHelper', params.length, name);
} else if (this.options.knownHelpersOnly) {
throw new Exception("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
} else {
id.falsy = true;
this.ID(id);
this.opcode('invokeHelper', params.length, id.original, id.isSimple);
}
},
sexpr: function(sexpr) {
var type = this.classifySexpr(sexpr);
if (type === "simple") {
this.simpleSexpr(sexpr);
} else if (type === "helper") {
this.helperSexpr(sexpr);
} else {
this.ambiguousSexpr(sexpr);
}
},
ID: function(id) {
this.addDepth(id.depth);
this.opcode('getContext', id.depth);
var name = id.parts[0];
if (!name) {
// Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
this.opcode('pushContext');
} else {
this.opcode('lookupOnContext', id.parts, id.falsy, id.isScoped);
}
},
DATA: function(data) {
this.options.data = true;
this.opcode('lookupData', data.id.depth, data.id.parts);
},
STRING: function(string) {
this.opcode('pushString', string.string);
},
NUMBER: function(number) {
this.opcode('pushLiteral', number.number);
},
BOOLEAN: function(bool) {
this.opcode('pushLiteral', bool.bool);
},
comment: function() {},
// HELPERS
opcode: function(name) {
this.opcodes.push({ opcode: name, args: slice.call(arguments, 1) });
},
addDepth: function(depth) {
if(depth === 0) { return; }
if(!this.depths[depth]) {
this.depths[depth] = true;
this.depths.list.push(depth);
}
},
classifySexpr: function(sexpr) {
var isHelper = sexpr.isHelper;
var isEligible = sexpr.eligibleHelper;
var options = this.options;
// if ambiguous, we can possibly resolve the ambiguity now
// An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
if (isEligible && !isHelper) {
var name = sexpr.id.parts[0];
if (options.knownHelpers[name]) {
isHelper = true;
} else if (options.knownHelpersOnly) {
isEligible = false;
}
}
if (isHelper) { return "helper"; }
else if (isEligible) { return "ambiguous"; }
else { return "simple"; }
},
pushParams: function(params) {
for(var i=0, l=params.length; i<l; i++) {
this.pushParam(params[i]);
}
},
pushParam: function(val) {
if (this.stringParams) {
if(val.depth) {
this.addDepth(val.depth);
}
this.opcode('getContext', val.depth || 0);
this.opcode('pushStringParam', val.stringModeValue, val.type);
if (val.type === 'sexpr') {
// Subexpressions get evaluated and passed in
// in string params mode.
this.sexpr(val);
}
} else {
if (this.trackIds) {
this.opcode('pushId', val.type, val.idName || val.stringModeValue);
}
this.accept(val);
}
},
setupFullMustacheParams: function(sexpr, program, inverse) {
var params = sexpr.params;
this.pushParams(params);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
if (sexpr.hash) {
this.hash(sexpr.hash);
} else {
this.opcode('emptyHash');
}
return params;
}
};
function precompile(input, options, env) {
if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
}
options = options || {};
if (!('data' in options)) {
options.data = true;
}
if (options.compat) {
options.useDepths = true;
}
var ast = env.parse(input);
var environment = new env.Compiler().compile(ast, options);
return new env.JavaScriptCompiler().compile(environment, options);
}
__exports__.precompile = precompile;function compile(input, options, env) {
if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
}
options = options || {};
if (!('data' in options)) {
options.data = true;
}
if (options.compat) {
options.useDepths = true;
}
var compiled;
function compileInput() {
var ast = env.parse(input);
var environment = new env.Compiler().compile(ast, options);
var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
return env.template(templateSpec);
}
// Template is only compiled on first use and cached after that point.
var ret = function(context, options) {
if (!compiled) {
compiled = compileInput();
}
return compiled.call(this, context, options);
};
ret._setup = function(options) {
if (!compiled) {
compiled = compileInput();
}
return compiled._setup(options);
};
ret._child = function(i, data, depths) {
if (!compiled) {
compiled = compileInput();
}
return compiled._child(i, data, depths);
};
return ret;
}
__exports__.compile = compile;function argEquals(a, b) {
if (a === b) {
return true;
}
if (isArray(a) && isArray(b) && a.length === b.length) {
for (var i = 0; i < a.length; i++) {
if (!argEquals(a[i], b[i])) {
return false;
}
}
return true;
}
}
return __exports__;
})(__module5__, __module3__);
// handlebars/compiler/javascript-compiler.js
var __module12__ = (function(__dependency1__, __dependency2__) {
"use strict";
var __exports__;
var COMPILER_REVISION = __dependency1__.COMPILER_REVISION;
var REVISION_CHANGES = __dependency1__.REVISION_CHANGES;
var Exception = __dependency2__;
function Literal(value) {
this.value = value;
}
function JavaScriptCompiler() {}
JavaScriptCompiler.prototype = {
// PUBLIC API: You can override these methods in a subclass to provide
// alternative compiled forms for name lookup and buffering semantics
nameLookup: function(parent, name /* , type*/) {
if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
return parent + "." + name;
} else {
return parent + "['" + name + "']";
}
},
depthedLookup: function(name) {
this.aliases.lookup = 'this.lookup';
return 'lookup(depths, "' + name + '")';
},
compilerInfo: function() {
var revision = COMPILER_REVISION,
versions = REVISION_CHANGES[revision];
return [revision, versions];
},
appendToBuffer: function(string) {
if (this.environment.isSimple) {
return "return " + string + ";";
} else {
return {
appendToBuffer: true,
content: string,
toString: function() { return "buffer += " + string + ";"; }
};
}
},
initializeBuffer: function() {
return this.quotedString("");
},
namespace: "Handlebars",
// END PUBLIC API
compile: function(environment, options, context, asObject) {
this.environment = environment;
this.options = options;
this.stringParams = this.options.stringParams;
this.trackIds = this.options.trackIds;
this.precompile = !asObject;
this.name = this.environment.name;
this.isChild = !!context;
this.context = context || {
programs: [],
environments: []
};
this.preamble();
this.stackSlot = 0;
this.stackVars = [];
this.aliases = {};
this.registers = { list: [] };
this.hashes = [];
this.compileStack = [];
this.inlineStack = [];
this.compileChildren(environment, options);
this.useDepths = this.useDepths || environment.depths.list.length || this.options.compat;
var opcodes = environment.opcodes,
opcode,
i,
l;
for (i = 0, l = opcodes.length; i < l; i++) {
opcode = opcodes[i];
this[opcode.opcode].apply(this, opcode.args);
}
// Flush any trailing content that might be pending.
this.pushSource('');
/* istanbul ignore next */
if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
throw new Exception('Compile completed with content left on stack');
}
var fn = this.createFunctionContext(asObject);
if (!this.isChild) {
var ret = {
compiler: this.compilerInfo(),
main: fn
};
var programs = this.context.programs;
for (i = 0, l = programs.length; i < l; i++) {
if (programs[i]) {
ret[i] = programs[i];
}
}
if (this.environment.usePartial) {
ret.usePartial = true;
}
if (this.options.data) {
ret.useData = true;
}
if (this.useDepths) {
ret.useDepths = true;
}
if (this.options.compat) {
ret.compat = true;
}
if (!asObject) {
ret.compiler = JSON.stringify(ret.compiler);
ret = this.objectLiteral(ret);
}
return ret;
} else {
return fn;
}
},
preamble: function() {
// track the last context pushed into place to allow skipping the
// getContext opcode when it would be a noop
this.lastContext = 0;
this.source = [];
},
createFunctionContext: function(asObject) {
var varDeclarations = '';
var locals = this.stackVars.concat(this.registers.list);
if(locals.length > 0) {
varDeclarations += ", " + locals.join(", ");
}
// Generate minimizer alias mappings
for (var alias in this.aliases) {
if (this.aliases.hasOwnProperty(alias)) {
varDeclarations += ', ' + alias + '=' + this.aliases[alias];
}
}
var params = ["depth0", "helpers", "partials", "data"];
if (this.useDepths) {
params.push('depths');
}
// Perform a second pass over the output to merge content when possible
var source = this.mergeSource(varDeclarations);
if (asObject) {
params.push(source);
return Function.apply(this, params);
} else {
return 'function(' + params.join(',') + ') {\n ' + source + '}';
}
},
mergeSource: function(varDeclarations) {
var source = '',
buffer,
appendOnly = !this.forceBuffer,
appendFirst;
for (var i = 0, len = this.source.length; i < len; i++) {
var line = this.source[i];
if (line.appendToBuffer) {
if (buffer) {
buffer = buffer + '\n + ' + line.content;
} else {
buffer = line.content;
}
} else {
if (buffer) {
if (!source) {
appendFirst = true;
source = buffer + ';\n ';
} else {
source += 'buffer += ' + buffer + ';\n ';
}
buffer = undefined;
}
source += line + '\n ';
if (!this.environment.isSimple) {
appendOnly = false;
}
}
}
if (appendOnly) {
if (buffer || !source) {
source += 'return ' + (buffer || '""') + ';\n';
}
} else {
varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer());
if (buffer) {
source += 'return buffer + ' + buffer + ';\n';
} else {
source += 'return buffer;\n';
}
}
if (varDeclarations) {
source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n ') + source;
}
return source;
},
// [blockValue]
//
// On stack, before: hash, inverse, program, value
// On stack, after: return value of blockHelperMissing
//
// The purpose of this opcode is to take a block of the form
// `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
// replace it on the stack with the result of properly
// invoking blockHelperMissing.
blockValue: function(name) {
this.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
var params = [this.contextName(0)];
this.setupParams(name, 0, params);
var blockName = this.popStack();
params.splice(1, 0, blockName);
this.push('blockHelperMissing.call(' + params.join(', ') + ')');
},
// [ambiguousBlockValue]
//
// On stack, before: hash, inverse, program, value
// Compiler value, before: lastHelper=value of last found helper, if any
// On stack, after, if no lastHelper: same as [blockValue]
// On stack, after, if lastHelper: value
ambiguousBlockValue: function() {
this.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
// We're being a bit cheeky and reusing the options value from the prior exec
var params = [this.contextName(0)];
this.setupParams('', 0, params, true);
this.flushInline();
var current = this.topStack();
params.splice(1, 0, current);
this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
},
// [appendContent]
//
// On stack, before: ...
// On stack, after: ...
//
// Appends the string value of `content` to the current buffer
appendContent: function(content) {
if (this.pendingContent) {
content = this.pendingContent + content;
}
this.pendingContent = content;
},
// [append]
//
// On stack, before: value, ...
// On stack, after: ...
//
// Coerces `value` to a String and appends it to the current buffer.
//
// If `value` is truthy, or 0, it is coerced into a string and appended
// Otherwise, the empty string is appended
append: function() {
// Force anything that is inlined onto the stack so we don't have duplication
// when we examine local
this.flushInline();
var local = this.popStack();
this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }');
if (this.environment.isSimple) {
this.pushSource("else { " + this.appendToBuffer("''") + " }");
}
},
// [appendEscaped]
//
// On stack, before: value, ...
// On stack, after: ...
//
// Escape `value` and append it to the buffer
appendEscaped: function() {
this.aliases.escapeExpression = 'this.escapeExpression';
this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")"));
},
// [getContext]
//
// On stack, before: ...
// On stack, after: ...
// Compiler value, after: lastContext=depth
//
// Set the value of the `lastContext` compiler value to the depth
getContext: function(depth) {
this.lastContext = depth;
},
// [pushContext]
//
// On stack, before: ...
// On stack, after: currentContext, ...
//
// Pushes the value of the current context onto the stack.
pushContext: function() {
this.pushStackLiteral(this.contextName(this.lastContext));
},
// [lookupOnContext]
//
// On stack, before: ...
// On stack, after: currentContext[name], ...
//
// Looks up the value of `name` on the current context and pushes
// it onto the stack.
lookupOnContext: function(parts, falsy, scoped) {
/*jshint -W083 */
var i = 0,
len = parts.length;
if (!scoped && this.options.compat && !this.lastContext) {
// The depthed query is expected to handle the undefined logic for the root level that
// is implemented below, so we evaluate that directly in compat mode
this.push(this.depthedLookup(parts[i++]));
} else {
this.pushContext();
}
for (; i < len; i++) {
this.replaceStack(function(current) {
var lookup = this.nameLookup(current, parts[i], 'context');
// We want to ensure that zero and false are handled properly if the context (falsy flag)
// needs to have the special handling for these values.
if (!falsy) {
return ' != null ? ' + lookup + ' : ' + current;
} else {
// Otherwise we can use generic falsy handling
return ' && ' + lookup;
}
});
}
},
// [lookupData]
//
// On stack, before: ...
// On stack, after: data, ...
//
// Push the data lookup operator
lookupData: function(depth, parts) {
/*jshint -W083 */
if (!depth) {
this.pushStackLiteral('data');
} else {
this.pushStackLiteral('this.data(data, ' + depth + ')');
}
var len = parts.length;
for (var i = 0; i < len; i++) {
this.replaceStack(function(current) {
return ' && ' + this.nameLookup(current, parts[i], 'data');
});
}
},
// [resolvePossibleLambda]
//
// On stack, before: value, ...
// On stack, after: resolved value, ...
//
// If the `value` is a lambda, replace it on the stack by
// the return value of the lambda
resolvePossibleLambda: function() {
this.aliases.lambda = 'this.lambda';
this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')');
},
// [pushStringParam]
//
// On stack, before: ...
// On stack, after: string, currentContext, ...
//
// This opcode is designed for use in string mode, which
// provides the string value of a parameter along with its
// depth rather than resolving it immediately.
pushStringParam: function(string, type) {
this.pushContext();
this.pushString(type);
// If it's a subexpression, the string result
// will be pushed after this opcode.
if (type !== 'sexpr') {
if (typeof string === 'string') {
this.pushString(string);
} else {
this.pushStackLiteral(string);
}
}
},
emptyHash: function() {
this.pushStackLiteral('{}');
if (this.trackIds) {
this.push('{}'); // hashIds
}
if (this.stringParams) {
this.push('{}'); // hashContexts
this.push('{}'); // hashTypes
}
},
pushHash: function() {
if (this.hash) {
this.hashes.push(this.hash);
}
this.hash = {values: [], types: [], contexts: [], ids: []};
},
popHash: function() {
var hash = this.hash;
this.hash = this.hashes.pop();
if (this.trackIds) {
this.push('{' + hash.ids.join(',') + '}');
}
if (this.stringParams) {
this.push('{' + hash.contexts.join(',') + '}');
this.push('{' + hash.types.join(',') + '}');
}
this.push('{\n ' + hash.values.join(',\n ') + '\n }');
},
// [pushString]
//
// On stack, before: ...
// On stack, after: quotedString(string), ...
//
// Push a quoted version of `string` onto the stack
pushString: function(string) {
this.pushStackLiteral(this.quotedString(string));
},
// [push]
//
// On stack, before: ...
// On stack, after: expr, ...
//
// Push an expression onto the stack
push: function(expr) {
this.inlineStack.push(expr);
return expr;
},
// [pushLiteral]
//
// On stack, before: ...
// On stack, after: value, ...
//
// Pushes a value onto the stack. This operation prevents
// the compiler from creating a temporary variable to hold
// it.
pushLiteral: function(value) {
this.pushStackLiteral(value);
},
// [pushProgram]
//
// On stack, before: ...
// On stack, after: program(guid), ...
//
// Push a program expression onto the stack. This takes
// a compile-time guid and converts it into a runtime-accessible
// expression.
pushProgram: function(guid) {
if (guid != null) {
this.pushStackLiteral(this.programExpression(guid));
} else {
this.pushStackLiteral(null);
}
},
// [invokeHelper]
//
// On stack, before: hash, inverse, program, params..., ...
// On stack, after: result of helper invocation
//
// Pops off the helper's parameters, invokes the helper,
// and pushes the helper's return value onto the stack.
//
// If the helper is not found, `helperMissing` is called.
invokeHelper: function(paramSize, name, isSimple) {
this.aliases.helperMissing = 'helpers.helperMissing';
var nonHelper = this.popStack();
var helper = this.setupHelper(paramSize, name);
var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing';
this.push('((' + lookup + ').call(' + helper.callParams + '))');
},
// [invokeKnownHelper]
//
// On stack, before: hash, inverse, program, params..., ...
// On stack, after: result of helper invocation
//
// This operation is used when the helper is known to exist,
// so a `helperMissing` fallback is not required.
invokeKnownHelper: function(paramSize, name) {
var helper = this.setupHelper(paramSize, name);
this.push(helper.name + ".call(" + helper.callParams + ")");
},
// [invokeAmbiguous]
//
// On stack, before: hash, inverse, program, params..., ...
// On stack, after: result of disambiguation
//
// This operation is used when an expression like `{{foo}}`
// is provided, but we don't know at compile-time whether it
// is a helper or a path.
//
// This operation emits more code than the other options,
// and can be avoided by passing the `knownHelpers` and
// `knownHelpersOnly` flags at compile-time.
invokeAmbiguous: function(name, helperCall) {
this.aliases.functionType = '"function"';
this.aliases.helperMissing = 'helpers.helperMissing';
this.useRegister('helper');
var nonHelper = this.popStack();
this.emptyHash();
var helper = this.setupHelper(0, name, helperCall);
var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
this.push(
'((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing'
+ (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),'
+ '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))');
},
// [invokePartial]
//
// On stack, before: context, ...
// On stack after: result of partial invocation
//
// This operation pops off a context, invokes a partial with that context,
// and pushes the result of the invocation back.
invokePartial: function(name, indent) {
var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"];
if (this.options.data) {
params.push("data");
} else if (this.options.compat) {
params.push('undefined');
}
if (this.options.compat) {
params.push('depths');
}
this.push("this.invokePartial(" + params.join(", ") + ")");
},
// [assignToHash]
//
// On stack, before: value, ..., hash, ...
// On stack, after: ..., hash, ...
//
// Pops a value off the stack and assigns it to the current hash
assignToHash: function(key) {
var value = this.popStack(),
context,
type,
id;
if (this.trackIds) {
id = this.popStack();
}
if (this.stringParams) {
type = this.popStack();
context = this.popStack();
}
var hash = this.hash;
if (context) {
hash.contexts.push("'" + key + "': " + context);
}
if (type) {
hash.types.push("'" + key + "': " + type);
}
if (id) {
hash.ids.push("'" + key + "': " + id);
}
hash.values.push("'" + key + "': (" + value + ")");
},
pushId: function(type, name) {
if (type === 'ID' || type === 'DATA') {
this.pushString(name);
} else if (type === 'sexpr') {
this.pushStackLiteral('true');
} else {
this.pushStackLiteral('null');
}
},
// HELPERS
compiler: JavaScriptCompiler,
compileChildren: function(environment, options) {
var children = environment.children, child, compiler;
for(var i=0, l=children.length; i<l; i++) {
child = children[i];
compiler = new this.compiler();
var index = this.matchExistingProgram(child);
if (index == null) {
this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
index = this.context.programs.length;
child.index = index;
child.name = 'program' + index;
this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
this.context.environments[index] = child;
this.useDepths = this.useDepths || compiler.useDepths;
} else {
child.index = index;
child.name = 'program' + index;
}
}
},
matchExistingProgram: function(child) {
for (var i = 0, len = this.context.environments.length; i < len; i++) {
var environment = this.context.environments[i];
if (environment && environment.equals(child)) {
return i;
}
}
},
programExpression: function(guid) {
var child = this.environment.children[guid],
depths = child.depths.list,
useDepths = this.useDepths,
depth;
var programParams = [child.index, 'data'];
if (useDepths) {
programParams.push('depths');
}
return 'this.program(' + programParams.join(', ') + ')';
},
useRegister: function(name) {
if(!this.registers[name]) {
this.registers[name] = true;
this.registers.list.push(name);
}
},
pushStackLiteral: function(item) {
return this.push(new Literal(item));
},
pushSource: function(source) {
if (this.pendingContent) {
this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent)));
this.pendingContent = undefined;
}
if (source) {
this.source.push(source);
}
},
pushStack: function(item) {
this.flushInline();
var stack = this.incrStack();
this.pushSource(stack + " = " + item + ";");
this.compileStack.push(stack);
return stack;
},
replaceStack: function(callback) {
var prefix = '',
inline = this.isInline(),
stack,
createdStack,
usedLiteral;
/* istanbul ignore next */
if (!this.isInline()) {
throw new Exception('replaceStack on non-inline');
}
// We want to merge the inline statement into the replacement statement via ','
var top = this.popStack(true);
if (top instanceof Literal) {
// Literals do not need to be inlined
prefix = stack = top.value;
usedLiteral = true;
} else {
// Get or create the current stack name for use by the inline
createdStack = !this.stackSlot;
var name = !createdStack ? this.topStackName() : this.incrStack();
prefix = '(' + this.push(name) + ' = ' + top + ')';
stack = this.topStack();
}
var item = callback.call(this, stack);
if (!usedLiteral) {
this.popStack();
}
if (createdStack) {
this.stackSlot--;
}
this.push('(' + prefix + item + ')');
},
incrStack: function() {
this.stackSlot++;
if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
return this.topStackName();
},
topStackName: function() {
return "stack" + this.stackSlot;
},
flushInline: function() {
var inlineStack = this.inlineStack;
if (inlineStack.length) {
this.inlineStack = [];
for (var i = 0, len = inlineStack.length; i < len; i++) {
var entry = inlineStack[i];
if (entry instanceof Literal) {
this.compileStack.push(entry);
} else {
this.pushStack(entry);
}
}
}
},
isInline: function() {
return this.inlineStack.length;
},
popStack: function(wrapped) {
var inline = this.isInline(),
item = (inline ? this.inlineStack : this.compileStack).pop();
if (!wrapped && (item instanceof Literal)) {
return item.value;
} else {
if (!inline) {
/* istanbul ignore next */
if (!this.stackSlot) {
throw new Exception('Invalid stack pop');
}
this.stackSlot--;
}
return item;
}
},
topStack: function() {
var stack = (this.isInline() ? this.inlineStack : this.compileStack),
item = stack[stack.length - 1];
if (item instanceof Literal) {
return item.value;
} else {
return item;
}
},
contextName: function(context) {
if (this.useDepths && context) {
return 'depths[' + context + ']';
} else {
return 'depth' + context;
}
},
quotedString: function(str) {
return '"' + str
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
.replace(/\u2029/g, '\\u2029') + '"';
},
objectLiteral: function(obj) {
var pairs = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
pairs.push(this.quotedString(key) + ':' + obj[key]);
}
}
return '{' + pairs.join(',') + '}';
},
setupHelper: function(paramSize, name, blockHelper) {
var params = [],
paramsInit = this.setupParams(name, paramSize, params, blockHelper);
var foundHelper = this.nameLookup('helpers', name, 'helper');
return {
params: params,
paramsInit: paramsInit,
name: foundHelper,
callParams: [this.contextName(0)].concat(params).join(", ")
};
},
setupOptions: function(helper, paramSize, params) {
var options = {}, contexts = [], types = [], ids = [], param, inverse, program;
options.name = this.quotedString(helper);
options.hash = this.popStack();
if (this.trackIds) {
options.hashIds = this.popStack();
}
if (this.stringParams) {
options.hashTypes = this.popStack();
options.hashContexts = this.popStack();
}
inverse = this.popStack();
program = this.popStack();
// Avoid setting fn and inverse if neither are set. This allows
// helpers to do a check for `if (options.fn)`
if (program || inverse) {
if (!program) {
program = 'this.noop';
}
if (!inverse) {
inverse = 'this.noop';
}
options.fn = program;
options.inverse = inverse;
}
// The parameters go on to the stack in order (making sure that they are evaluated in order)
// so we need to pop them off the stack in reverse order
var i = paramSize;
while (i--) {
param = this.popStack();
params[i] = param;
if (this.trackIds) {
ids[i] = this.popStack();
}
if (this.stringParams) {
types[i] = this.popStack();
contexts[i] = this.popStack();
}
}
if (this.trackIds) {
options.ids = "[" + ids.join(",") + "]";
}
if (this.stringParams) {
options.types = "[" + types.join(",") + "]";
options.contexts = "[" + contexts.join(",") + "]";
}
if (this.options.data) {
options.data = "data";
}
return options;
},
// the params and contexts arguments are passed in arrays
// to fill in
setupParams: function(helperName, paramSize, params, useRegister) {
var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params));
if (useRegister) {
this.useRegister('options');
params.push('options');
return 'options=' + options;
} else {
params.push(options);
return '';
}
}
};
var reservedWords = (
"break else new var" +
" case finally return void" +
" catch for switch while" +
" continue function this with" +
" default if throw" +
" delete in try" +
" do instanceof typeof" +
" abstract enum int short" +
" boolean export interface static" +
" byte extends long super" +
" char final native synchronized" +
" class float package throws" +
" const goto private transient" +
" debugger implements protected volatile" +
" double import public let yield"
).split(" ");
var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
for(var i=0, l=reservedWords.length; i<l; i++) {
compilerWords[reservedWords[i]] = true;
}
JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
};
__exports__ = JavaScriptCompiler;
return __exports__;
})(__module2__, __module5__);
// handlebars.js
var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
"use strict";
var __exports__;
/*globals Handlebars: true */
var Handlebars = __dependency1__;
// Compiler imports
var AST = __dependency2__;
var Parser = __dependency3__.parser;
var parse = __dependency3__.parse;
var Compiler = __dependency4__.Compiler;
var compile = __dependency4__.compile;
var precompile = __dependency4__.precompile;
var JavaScriptCompiler = __dependency5__;
var _create = Handlebars.create;
var create = function() {
var hb = _create();
hb.compile = function(input, options) {
return compile(input, options, hb);
};
hb.precompile = function (input, options) {
return precompile(input, options, hb);
};
hb.AST = AST;
hb.Compiler = Compiler;
hb.JavaScriptCompiler = JavaScriptCompiler;
hb.Parser = Parser;
hb.parse = parse;
return hb;
};
Handlebars = create();
Handlebars.create = create;
Handlebars['default'] = Handlebars;
__exports__ = Handlebars;
return __exports__;
})(__module1__, __module7__, __module8__, __module11__, __module12__);
return __module0__;
}));
(function(hbs) {
if (hbs) {
hbs.registerHelper('ifCond', function(v1, operator, v2, options) {
switch (operator) {
case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this);
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
case '<':
return (v1 < v2) ? options.fn(this) : options.inverse(this);
case '<=':
return (v1 <= v2) ? options.fn(this) : options.inverse(this);
case '>':
return (v1 > v2) ? options.fn(this) : options.inverse(this);
case '>=':
return (v1 >= v2) ? options.fn(this) : options.inverse(this);
case '&&':
return (v1 && v2) ? options.fn(this) : options.inverse(this);
case '||':
return (v1 || v2) ? options.fn(this) : options.inverse(this);
default:
return options.inverse(this);
}
});
hbs.registerHelper("last", function(array, options) {
return options.fn(array[array.length - 1]);
});
}
})(Handlebars);
Handlebars.registerPartial("badge", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, buffer = "<span class=\"mui-badge";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.style : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "\">";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.text : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "</span>\r";
},"2":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " mui-badge-";
stack1 = ((helper = (helper = helpers.style || (depth0 != null ? depth0.style : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"style","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
return buffer;
},"4":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing;
stack1 = ((helper = (helper = helpers.text || (depth0 != null ? depth0.text : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"text","hash":{},"data":data}) : helper));
if (stack1 != null) { return stack1; }
else { return ''; }
},"6":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda;
stack1 = lambda(depth0, depth0);
if (stack1 != null) { return stack1; }
else { return ''; }
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing;
stack1 = ((helper = (helper = helpers.badge || (depth0 != null ? depth0.badge : depth0)) != null ? helper : helperMissing),(options={"name":"badge","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.badge) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { return stack1; }
else { return ''; }
},"useData":true}));
Handlebars.registerPartial("btn", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, buffer = "<button class=\"mui-btn";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.style : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "\">";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.text : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "</button>\n";
},"2":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " mui-btn-";
stack1 = ((helper = (helper = helpers.style || (depth0 != null ? depth0.style : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"style","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
return buffer;
},"4":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing;
stack1 = ((helper = (helper = helpers.text || (depth0 != null ? depth0.text : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"text","hash":{},"data":data}) : helper));
if (stack1 != null) { return stack1; }
else { return ''; }
},"6":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda;
stack1 = lambda(depth0, depth0);
if (stack1 != null) { return stack1; }
else { return ''; }
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing;
stack1 = ((helper = (helper = helpers.btn || (depth0 != null ? depth0.btn : depth0)) != null ? helper : helperMissing),(options={"name":"btn","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.btn) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { return stack1; }
else { return ''; }
},"useData":true}));
Handlebars.registerPartial("checkbox", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "<input name=\""
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ "\" type=\"checkbox\" value=\""
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
+ "\"> ";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = "";
stack1 = ((helper = (helper = helpers.checkbox || (depth0 != null ? depth0.checkbox : depth0)) != null ? helper : helperMissing),(options={"name":"checkbox","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.checkbox) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
return buffer + "\n";
},"useData":true}));
Handlebars.registerPartial("grid", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, buffer = "<ul class=\"mui-table-view mui-grid-view\">\n";
stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.grid : depth0), {"name":"each","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "</ul>\n";
},"2":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <li class=\"mui-table-view-cell mui-media mui-col-xs-6\">\n <a href=\"";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.href : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.program(5, data),"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "\">\n <img class=\"mui-media-object\" src=\""
+ escapeExpression(((helper = (helper = helpers.src || (depth0 != null ? depth0.src : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"src","hash":{},"data":data}) : helper)))
+ "\">\n <div class=\"mui-media-body\">";
stack1 = ((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"title","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
return buffer + "</div>\n </a>\n </li>\n";
},"3":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return escapeExpression(((helper = (helper = helpers.href || (depth0 != null ? depth0.href : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"href","hash":{},"data":data}) : helper)));
},"5":function(depth0,helpers,partials,data) {
return "#";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, blockHelperMissing=helpers.blockHelperMissing, buffer = "";
stack1 = blockHelperMissing.call(depth0, lambda(depth0, depth0), {"name":"this","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer;
},"useData":true}));
Handlebars.registerPartial("media", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, buffer = " ";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.src : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += " ";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.desc : depth0), {"name":"if","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + " ";
},"2":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "\n<img class=\"mui-media-object ";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.position : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.program(5, data),"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "\" src=\""
+ escapeExpression(((helper = (helper = helpers.src || (depth0 != null ? depth0.src : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"src","hash":{},"data":data}) : helper)))
+ "\">";
},"3":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "mui-pull-"
+ escapeExpression(((helper = (helper = helpers.position || (depth0 != null ? depth0.position : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"position","hash":{},"data":data}) : helper)));
},"5":function(depth0,helpers,partials,data) {
return "mui-pull-left";
},"7":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = "\n<div class=\"mui-media-body\">\n ";
stack1 = ((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"title","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
buffer += "\n <p class='";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.ellipsis : depth0), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.program(10, data),"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "'>";
stack1 = ((helper = (helper = helpers.desc || (depth0 != null ? depth0.desc : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"desc","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
return buffer + "</p>\n</div>\n";
},"8":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "mui-ellipsis-"
+ escapeExpression(((helper = (helper = helpers.ellipsis || (depth0 != null ? depth0.ellipsis : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"ellipsis","hash":{},"data":data}) : helper)));
},"10":function(depth0,helpers,partials,data) {
return "mui-ellipsis";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, blockHelperMissing=helpers.blockHelperMissing, buffer = "";
stack1 = blockHelperMissing.call(depth0, lambda(depth0, depth0), {"name":"this","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "\n";
},"useData":true}));
Handlebars.registerPartial("radio", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "<input name=\""
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ "\" type=\"radio\" value=\""
+ escapeExpression(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"value","hash":{},"data":data}) : helper)))
+ "\"> ";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = "";
stack1 = ((helper = (helper = helpers.radio || (depth0 != null ? depth0.radio : depth0)) != null ? helper : helperMissing),(options={"name":"radio","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.radio) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
return buffer + "\n";
},"useData":true}));
Handlebars.registerPartial("slider", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.id : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += " class=\"mui-slider\">\n <div class=\"mui-slider-group";
stack1 = ((helper = (helper = helpers.loop || (depth0 != null ? depth0.loop : depth0)) != null ? helper : helperMissing),(options={"name":"loop","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.loop) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
buffer += "\">\n ";
stack1 = ((helper = (helper = helpers.loop || (depth0 != null ? depth0.loop : depth0)) != null ? helper : helperMissing),(options={"name":"loop","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.loop) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
buffer += " ";
stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.slider : depth0), {"name":"each","hash":{},"fn":this.program(9, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += " ";
stack1 = ((helper = (helper = helpers.loop || (depth0 != null ? depth0.loop : depth0)) != null ? helper : helperMissing),(options={"name":"loop","hash":{},"fn":this.program(11, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.loop) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
buffer += "\n </div>\n";
stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.slider : depth0)) != null ? stack1['0'] : stack1)) != null ? stack1.src : stack1), {"name":"if","hash":{},"fn":this.program(13, data),"inverse":this.program(17, data),"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + " </div>\n";
},"2":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " id=\""
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "\" ";
},"4":function(depth0,helpers,partials,data) {
return " mui-slider-loop";
},"6":function(depth0,helpers,partials,data) {
var stack1, helperMissing=helpers.helperMissing, buffer = " ";
stack1 = ((helpers.last || (depth0 && depth0.last) || helperMissing).call(depth0, (depth0 != null ? depth0.slider : depth0), {"name":"last","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data}));
if (stack1 != null) { buffer += stack1; }
return buffer + " ";
},"7":function(depth0,helpers,partials,data) {
var stack1, buffer = "\n <div class=\"mui-slider-item mui-slider-item-duplicate\">\n";
stack1 = this.invokePartial(partials.slideritem, ' ', 'slideritem', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
return buffer + " </div>\n ";
},"9":function(depth0,helpers,partials,data) {
var stack1, buffer = "\n <div class=\"mui-slider-item\">\n";
stack1 = this.invokePartial(partials.slideritem, ' ', 'slideritem', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
return buffer + " </div>\n ";
},"11":function(depth0,helpers,partials,data) {
var stack1, buffer = " ";
stack1 = helpers['with'].call(depth0, ((stack1 = (depth0 != null ? depth0.slider : depth0)) != null ? stack1['0'] : stack1), {"name":"with","hash":{},"fn":this.program(7, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + " ";
},"13":function(depth0,helpers,partials,data) {
var stack1, buffer = " <div class=\"mui-slider-indicator mui-text-right\">\n";
stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.slider : depth0), {"name":"each","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + " </div>\n";
},"14":function(depth0,helpers,partials,data) {
var stack1, buffer = " <div class=\"mui-indicator";
stack1 = helpers['if'].call(depth0, (data && data.first), {"name":"if","hash":{},"fn":this.program(15, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "\"></div>\n";
},"15":function(depth0,helpers,partials,data) {
return " mui-active";
},"17":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression;
return " <div class=\"mui-slider-indicator\" style=\"position: static;background-color: #fff;\">\n <span class=\"mui-action mui-action-previous mui-icon mui-icon-back\"></span>\n <div class=\"mui-number\">\n <span>1</span> / "
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.slider : depth0)) != null ? stack1.length : stack1), depth0))
+ "\n </div>\n <span class=\"mui-action mui-action-next mui-icon mui-icon-forward\"></span>\n </div>\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, blockHelperMissing=helpers.blockHelperMissing, buffer = "";
stack1 = blockHelperMissing.call(depth0, lambda(depth0, depth0), {"name":"this","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer;
},"usePartial":true,"useData":true}));
Handlebars.registerPartial("slideritem", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "<a href=\"";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.href : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "\">\n <img src=\""
+ escapeExpression(((helper = (helper = helpers.src || (depth0 != null ? depth0.src : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"src","hash":{},"data":data}) : helper)))
+ "\">";
stack1 = ((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helperMissing),(options={"name":"title","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.title) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
return buffer + "</a>\n";
},"2":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return escapeExpression(((helper = (helper = helpers.href || (depth0 != null ? depth0.href : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"href","hash":{},"data":data}) : helper)));
},"4":function(depth0,helpers,partials,data) {
return "#";
},"6":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, buffer = "\n <p class=\"mui-slider-title\">";
stack1 = lambda(depth0, depth0);
if (stack1 != null) { buffer += stack1; }
return buffer + "</p>\n";
},"8":function(depth0,helpers,partials,data) {
var stack1, buffer = "<ul class=\"mui-table-view mui-grid-view\">\n";
stack1 = helpers.each.call(depth0, depth0, {"name":"each","hash":{},"fn":this.program(9, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "</ul>\n";
},"9":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <li class=\"mui-table-view-cell mui-media mui-col-xs-6\">\n <a href=\"";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.href : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "\">\n <img class=\"mui-media-object\" src=\""
+ escapeExpression(((helper = (helper = helpers.src || (depth0 != null ? depth0.src : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"src","hash":{},"data":data}) : helper)))
+ "\">\n <div class=\"mui-media-body\">";
stack1 = ((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"title","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
return buffer + "</div>\n </a>\n </li>\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, buffer = "";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.src : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(8, data),"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer;
},"useData":true}));
Handlebars.registerPartial("switch", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = "<div class=\"mui-switch";
stack1 = ((helper = (helper = helpers.style || (depth0 != null ? depth0.style : depth0)) != null ? helper : helperMissing),(options={"name":"style","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.style) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
stack1 = ((helper = (helper = helpers.size || (depth0 != null ? depth0.size : depth0)) != null ? helper : helperMissing),(options={"name":"size","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.size) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
stack1 = ((helper = (helper = helpers.active || (depth0 != null ? depth0.active : depth0)) != null ? helper : helperMissing),(options={"name":"active","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.active) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
return buffer + "\">\n <div class=\"mui-switch-handle\"></div>\n</div>\n";
},"2":function(depth0,helpers,partials,data) {
var lambda=this.lambda, escapeExpression=this.escapeExpression;
return " mui-switch-"
+ escapeExpression(lambda(depth0, depth0));
},"4":function(depth0,helpers,partials,data) {
return " mui-active";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing;
stack1 = ((helper = (helper = helpers['switch'] || (depth0 != null ? depth0['switch'] : depth0)) != null ? helper : helperMissing),(options={"name":"switch","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers['switch']) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { return stack1; }
else { return ''; }
},"useData":true}));
Handlebars.registerPartial("tableview", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = "<ul";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.id : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += " class=\"mui-table-view";
stack1 = ((helper = (helper = helpers.chevron || (depth0 != null ? depth0.chevron : depth0)) != null ? helper : helperMissing),(options={"name":"chevron","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.chevron) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
stack1 = ((helper = (helper = helpers.striped || (depth0 != null ? depth0.striped : depth0)) != null ? helper : helperMissing),(options={"name":"striped","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.striped) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
stack1 = ((helper = (helper = helpers.inverted || (depth0 != null ? depth0.inverted : depth0)) != null ? helper : helperMissing),(options={"name":"inverted","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.inverted) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
buffer += "\">\n ";
stack1 = ((helper = (helper = helpers.tableview || (depth0 != null ? depth0.tableview : depth0)) != null ? helper : helperMissing),(options={"name":"tableview","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.tableview) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
return buffer + "\n</ul>\n";
},"2":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " id=\""
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "\"";
},"4":function(depth0,helpers,partials,data) {
return " mui-table-view-chevron";
},"6":function(depth0,helpers,partials,data) {
return " mui-table-view-striped";
},"8":function(depth0,helpers,partials,data) {
return " mui-table-view-inverted";
},"10":function(depth0,helpers,partials,data) {
var stack1, buffer = " ";
stack1 = this.invokePartial(partials.tableviewcell, '', 'tableviewcell', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
return buffer + " ";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, blockHelperMissing=helpers.blockHelperMissing, buffer = "";
stack1 = blockHelperMissing.call(depth0, lambda(depth0, depth0), {"name":"this","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer;
},"usePartial":true,"useData":true}));
Handlebars.registerPartial("tableviewcell", Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = "<li class=\"mui-table-view-";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.divider : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data});
if (stack1 != null) { buffer += stack1; }
stack1 = ((helper = (helper = helpers.radio || (depth0 != null ? depth0.radio : depth0)) != null ? helper : helperMissing),(options={"name":"radio","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.radio) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
stack1 = ((helper = (helper = helpers.checkbox || (depth0 != null ? depth0.checkbox : depth0)) != null ? helper : helperMissing),(options={"name":"checkbox","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.checkbox) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
stack1 = ((helper = (helper = helpers.position || (depth0 != null ? depth0.position : depth0)) != null ? helper : helperMissing),(options={"name":"position","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper));
if (!helpers.position) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if (stack1 != null) { buffer += stack1; }
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.tableview : depth0), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "\">\n ";
stack1 = ((helpers.ifCond || (depth0 && depth0.ifCond) || helperMissing).call(depth0, (depth0 != null ? depth0.title : depth0), "||", (depth0 != null ? depth0.src : depth0), {"name":"ifCond","hash":{},"fn":this.program(14, data),"inverse":this.program(26, data),"data":data}));
if (stack1 != null) { buffer += stack1; }
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.tableview : depth0), {"name":"if","hash":{},"fn":this.program(28, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "\n</li>\n";
},"2":function(depth0,helpers,partials,data) {
return "divider";
},"4":function(depth0,helpers,partials,data) {
return "cell";
},"6":function(depth0,helpers,partials,data) {
return " mui-radio";
},"8":function(depth0,helpers,partials,data) {
return " mui-checkbox";
},"10":function(depth0,helpers,partials,data) {
var lambda=this.lambda, escapeExpression=this.escapeExpression;
return " mui-"
+ escapeExpression(lambda(depth0, depth0));
},"12":function(depth0,helpers,partials,data) {
return " mui-collapse";
},"14":function(depth0,helpers,partials,data) {
var stack1, helperMissing=helpers.helperMissing, buffer = " ";
stack1 = ((helpers.ifCond || (depth0 && depth0.ifCond) || helperMissing).call(depth0, (depth0 != null ? depth0.navigate : depth0), "||", (depth0 != null ? depth0.href : depth0), {"name":"ifCond","hash":{},"fn":this.program(15, data),"inverse":this.noop,"data":data}));
if (stack1 != null) { buffer += stack1; }
stack1 = ((helpers.ifCond || (depth0 && depth0.ifCond) || helperMissing).call(depth0, (depth0 != null ? depth0.src : depth0), "||", (depth0 != null ? depth0.desc : depth0), {"name":"ifCond","hash":{},"fn":this.program(20, data),"inverse":this.program(22, data),"data":data}));
if (stack1 != null) { buffer += stack1; }
buffer += "\n";
stack1 = this.invokePartial(partials.badge, ' ', 'badge', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
buffer += "\n";
stack1 = this.invokePartial(partials.btn, ' ', 'btn', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
buffer += "\n";
stack1 = this.invokePartial(partials['switch'], ' ', 'switch', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
buffer += "\n";
stack1 = this.invokePartial(partials.radio, ' ', 'radio', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
buffer += "\n";
stack1 = this.invokePartial(partials.checkbox, ' ', 'checkbox', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
buffer += "\n";
stack1 = this.invokePartial(partials.media, ' ', 'media', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
buffer += "\n";
stack1 = ((helpers.ifCond || (depth0 && depth0.ifCond) || helperMissing).call(depth0, (depth0 != null ? depth0.navigate : depth0), "||", (depth0 != null ? depth0.href : depth0), {"name":"ifCond","hash":{},"fn":this.program(24, data),"inverse":this.noop,"data":data}));
if (stack1 != null) { buffer += stack1; }
return buffer;
},"15":function(depth0,helpers,partials,data) {
var stack1, buffer = "\n <a class=\"";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.navigate : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
buffer += "\" ";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.href : depth0), {"name":"if","hash":{},"fn":this.program(18, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + ">\n";
},"16":function(depth0,helpers,partials,data) {
return "mui-navigate-right";
},"18":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " href=\""
+ escapeExpression(((helper = (helper = helpers.href || (depth0 != null ? depth0.href : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"href","hash":{},"data":data}) : helper)))
+ "\" ";
},"20":function(depth0,helpers,partials,data) {
return "";
},"22":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " ";
stack1 = ((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"title","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
return buffer + "\n";
},"24":function(depth0,helpers,partials,data) {
return "\n </a>\n";
},"26":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, buffer = " ";
stack1 = lambda(depth0, depth0);
if (stack1 != null) { buffer += stack1; }
return buffer + "\n";
},"28":function(depth0,helpers,partials,data) {
var stack1, buffer = " ";
stack1 = this.invokePartial(partials.tableview, '', 'tableview', depth0, undefined, helpers, partials, data);
if (stack1 != null) { buffer += stack1; }
return buffer + " ";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, blockHelperMissing=helpers.blockHelperMissing;
stack1 = blockHelperMissing.call(depth0, lambda(depth0, depth0), {"name":"this","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
if (stack1 != null) { return stack1; }
else { return ''; }
},"usePartial":true,"useData":true}));
(function($, document) {
var isArray = Array.isArray ||
function(object) {
return object instanceof Array
};
var div = document.createElement('div');
$.each(['tableview', 'slider', 'grid'], function(index, plugin) {
(function(name) {
var oldPlugin = null;
var oldPluginApi = null;
if ($.fn[name]) {
oldPlugin = $.fn[name];
}
$.fn[name] = function(options) {
var opts = {
output: true
};
if (isArray(options)) {
opts[name] = options;
} else {
opts = $.extend(opts, options);
}
if (!opts.hasOwnProperty(name)) { //no data
return oldPlugin && oldPlugin.call(this, opts);
}
var template = Handlebars.compile(opts.tpl ? opts.tpl : '{{>' + name + '}}');
var html = '';
this.each(function() {
var id = this.id;
html = template($.extend({
id: id
}, opts));
if (opts.output === false) {
return false;
} else {
div.innerHTML = html;
var element = null;
while (!!(element = div.firstElementChild)) {
this.parentNode.insertBefore(element, this);
if (oldPlugin) {
if (name === 'slider' && element.querySelector('.mui-slider-group')) {
$.ready(function() {
oldPluginApi = oldPlugin.call($(element), opts);
});
}
}
}
this.parentNode.removeChild(this);
}
});
if (opts.output === false) {
return html;
} else if (oldPluginApi) {
return oldPluginApi;
}
};
})(plugin);
});
})(mui, document);
|
[{"Owner":"max123","Date":"2016-11-17T10:40:06Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHi_co_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI_t_ve searched the forum_co_ but most questions and answers that I found relate to the reverse_dd_ convert World to Screed coordinates. _lt_br /_gt_\n\tThe reason I need this is to launch a projectile in the direction of mouse coordinates when a user clicks on a screen. I tried the ray picking approach_co_ but 1) it_t_s too cumbersome and it didn_t_t work_co_ and 2) there_t_s nothing to pick with a ray! _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\tI wonder if anyone here had the same issue and managed to find a solution.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tCheers!\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"RaananW","Date":"2016-11-17T11:10:37Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tWell_co_ you are clicking in a 2D space_co_ what would you expect to get? let_t_s say your camera is parallel to the floor_co_ pointer straight at the z axis. Let_t_s say we have y (which is 0) and x (which is also 0). What would you expect Z to be?\n_lt_/p_gt_\n\n_lt_p_gt_\n\tPicking is your friend (which is rather straight-forward). You will need to add a picking mesh (a plane_co_ for example) that will transform your single click to 3d coordinates according to your definition. This would be the simplest way.\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"max123","Date":"2016-11-17T11:14:36Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\t_lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/10310-raananw/?do_eq_hovercard_qt_ data-mentionid_eq__qt_10310_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/10310-raananw/_qt_ rel_eq__qt__qt__gt_@RaananW_lt_/a_gt__co_ how would you deal with camera_t_s position/rotation in this case? Can you provide an example? Even pseudo-code will do _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_ \n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"RaananW","Date":"2016-11-17T11:59:34Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tWhy pseudo_co_ when you can get the real thing_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_http_dd_//www.babylonjs-playground.com/#ALAAX_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs-playground.com/#ALAAX_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\twall is your collision wall_co_ I set it_t_s material_t_s alpha to be 0.3 (so you will see where it is). the pick result is the position in the world that you clicked on. notice that the wall_t_s parent is the camera_co_ and that it is 20 units away from it_co_ so this would be your z axis (local coordinates).\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"max123","Date":"2016-11-17T12:45:40Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tYou_t_re da man_co_ _lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/10310-raananw/?do_eq_hovercard_qt_ data-mentionid_eq__qt_10310_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/10310-raananw/_qt_ rel_eq__qt__qt__gt_@RaananW_lt_/a_gt_! Will give it a try. \n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"max123","Date":"2016-11-17T15:28:15Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t_lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/10310-raananw/?do_eq_hovercard_qt_ data-mentionid_eq__qt_10310_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/10310-raananw/_qt_ rel_eq__qt__qt__gt_@RaananW_lt_/a_gt__co_ thanks again_co_ dude! This worked like a dream _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]
|
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
const rocket_exports_1 = require('./rocket.exports');
let RocketComponent = class RocketComponent extends rocket_exports_1.Sam {
constructor(loader, elementRef) {
super(rocket_exports_1.RocketActions, rocket_exports_1.RocketModel, rocket_exports_1.RocketState, rocket_exports_1.RocketViews);
this.loader = loader;
this.elementRef = elementRef;
this.actions.init();
}
ngOnInit() {
this.views.updated.subscribe((representation) => {
// Not sure how efficient this is at replacing the DOM. Gut tells me it's exspensive.
// Could create a single view/template with ngIfs and a ViewModel that it would bind to.
// ViewModel properties would updated based on state
if (this.component == undefined || this.component.componentType.name !== representation.name) {
this.loader.loadIntoLocation(representation, this.elementRef, 'rocket').then((component) => {
if (this.component) {
this.component.dispose();
}
component.instance.rocket = this;
this.component = component;
});
}
});
this.views.updated.subscribe((reprsentation) => {
if (this.state.launched(this.model)) {
jQuery('rocket').find('#rocket_launch').css("margin-bottom", "1000px");
jQuery('rocket').find('.cloud_fill').css("animation", "smoke_size .35s infinite");
jQuery('rocket').find('.rocket_shadow').css("animation", "shadow_flare .35s infinite");
}
});
this.views.updated.next(this.views.representation);
}
};
RocketComponent = __decorate([
rocket_exports_1.Component({
selector: 'rocket',
templateUrl: './app/rocket/rocket.template.html',
styleUrls: ['./app/rocket/rocket.style.css']
}),
__metadata('design:paramtypes', [rocket_exports_1.DynamicComponentLoader, rocket_exports_1.ElementRef])
], RocketComponent);
exports.RocketComponent = RocketComponent;
//# sourceMappingURL=rocket.component.js.map
|
// alert("This Web page is Work In Progress and you may see errors");
|
import React from 'react';
import { StyleSheet, Platform, Image, Text, View, ScrollView, FlatList } from 'react-native';
import DataStore from './api/DataStore';
import firebase from 'react-native-firebase';
export default class App extends React.Component {
constructor() {
super();
this.state = {};
this.token = "";
}
async componentDidMount() {
await getToken();
await this.getAllContacts();
}
async getToken() {
const token = await DataStore.getTokenAsync({
username: "eg",
password: "worthyisthelamb"
});
this.token = token;
}
async getAllContacts() {
const contacts = await DataStore.getAllContactsAsync(this.token);
this.contacts = contacts;
this.forceUpdate();
}
async getContact(contactName, contactId) {
const contacts = await DataStore.getContactByIdAsync(this.token, contactName, contactId);
this.contacts = contacts;
this.forceUpdate();
}
renderAllContacts(item) {
return (
<View style={styles.itemContainer}>
<Text style={styles.title}>{item.name}</Text>
<Text style={styles.subtitle}>Location: {item.locations && item.locations.length ? item.locations.join(", ") : "unknown"}</Text>
<Text style={styles.subtitle}>Status: {item.status}</Text>
</View>
);
}
renderContactComment(comment) {
return (
<View style={styles.itemContainer}>
<Text style={styles.title}>Author: {comment.author}</Text>
<Text style={styles.subtitle}>Comment: {comment.content} </Text>
</View>
);
}
renderContact(contact) {
return (
<View style={styles.itemContainer}>
<Text style={styles.title}>Name: {contact.name}</Text>
<ScrollView>
<FlatList
data={contact.comments}
renderItem={({item}) => this.renderContactComment(item)}
/>
</ScrollView>
</View>
);
}
render() {
return (
<ScrollView>
<Text/>
<Text style={styles.welcome}>Find A Disciple</Text>
<FlatList
data={this.contacts}
renderItem={({item}) => this.renderContact(this.getContact("Nina Kalb", 67))}
// renderItem={({item}) => this.renderAllContacts(item)}
/>
</ScrollView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
logo: {
height: 120,
marginBottom: 16,
marginTop: 64,
padding: 10,
width: 135,
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
modules: {
margin: 20,
},
modulesHeader: {
fontSize: 16,
marginBottom: 8,
},
module: {
fontSize: 14,
marginTop: 4,
textAlign: 'center',
},
itemContainer: {
margin: 20,
backgroundColor: '#0d97a6',
padding: 5,
borderRadius: 10
},
title: {
color: "#ffffff",
fontSize: 24
},
subtitle: {
color: "#ffffff",
fontSize: 18
}
});
|
// Swedish
'use strict';
var sv = function() {}
sv.code = 'sv';
sv.data = {
GEN_Help_0 : 'Already have a wallet somewhere?',
GEN_Help_MetaMask : 'So easy! Keys stay in MetaMask, not on a phishing site! Try it today.',
GEN_Warning_1 : '**Do not lose it!** It cannot be recovered if you lose it.',
GEN_Warning_2 : '**Do not share it!** Your funds will be stolen if you use this file on a malicious/phishing site.',
GEN_Warning_3 : '**Make a backup!** Secure it like the millions of dollars it may one day be worth.',
GAS_Price_1 : 'Not So Fast',
GAS_Price_2 : 'Fast',
GAS_Price_3 : 'Fast AF',
CONTRACT_Helper_1 : 'Please change the address to your own Multisig Contract Address.',
CONTRACT_Warning_1 : 'You are about to **deploy a contract**.',
CONTRACT_Warning_2 : 'It will be deployed on the following network:',
CONTRACT_Warning_3 : 'You are about to **execute a function on contract**.',
SEND_Helper_Contract : 'In most cases you should leave this as 0.',
SEND_ViewOnly : 'You cannot send with only your address. You must use one of the other options to unlock your wallet in order to send.',
SEND_LoadTokens : 'Load Tokens',
SEND_CustomAddrMsg : 'A message regarding',
SWAP_Warning_1 : 'Warning! You do not have enough funds to complete this swap.',
SWAP_Warning_2 : 'Please add more funds to your wallet or access a different wallet.',
X_Advanced : 'Advanced Users Only.',
X_HelpfulLinks : 'Helpful Links & FAQs',
X_HelpfulLinks_1 : 'How to Access your Wallet',
X_HelpfulLinks_2 : 'I lost my private key',
X_HelpfulLinks_3 : 'My private key opens a different address',
X_HelpfulLinks_4 : 'Migrating to/from MyEtherWallet',
X_Network : 'Network', // aka "node" or "chain" - used in the dropdown in header
X_Network_Custom : 'Add Custom Network / Node',
DOMAIN_Buy : 'Buy the domain',
DOMAIN_BuyItNow : 'Price to buy the domain immediately:',
DOMAIN_bid : 'Bid for the domain',
DOMAIN_bid_0 : 'You are currently winning this auction with the highest bid. You can bid higher if you want, but it will delay the close of the auction for 24 hours.',
DOMAIN_bid_1 : 'Bid at least',
DOMAIN_bid_2 : 'on the domain.',
DOMAIN_bid_3 : 'You will win the domain if no higher bids are placed within the next 24 hours.',
DOMAIN_bid_4 : 'Note that the domain has a locked value of',
DOMAIN_bid_5 : 'As part of the sale you will receive the deed with this value but cannot claim it unless you release the name.',
DOMAIN_Finish_1 : 'Not related to that auction',
DOMAIN_Finish_2 : 'This address is neither the winner nor the seller of the auction.',
DOMAIN_Finish_3 : 'Finish the auction',
DOMAIN_Finish_4 : 'Finish the auction to allocate the domain to the winner and the funds to the seller.',
DOMAIN_Finish_5 : 'Click your TX hash to see if you successfully transferred the domain to DomainSale.',
DOMAIN_offer_4 : 'Offer For Sale:',
DOMAIN_offer_5 : 'Set either of both of the prices below to offer your domain for sale. Remember that any funds you have locked in the domain\'s deed will go to the buyer and 10% of the funds when sold goes to referrers.',
DOMAIN_offer_7 : 'Alter Your Offer for:',
DOMAIN_offer_8 : 'Change either of both of the prices below to alter your domain sale offer. Remember that any funds you have locked in the domain\'s deed will go to the buyer and 10% of the funds when sold goes to referrers.',
DOMAIN_offer_9 : 'Buy price',
DOMAIN_offer_10 : 'This is the price at which someone can buy the domain immediately. 0 means that the domain cannot be purchased immediately.',
DOMAIN_offer_11 : 'This is the price at which someone can start an auction for the domain. 0 means that the domain will not be available for auction.',
DOMAIN_offer_12 : 'Offer your domain',
DOMAIN_offer_13 : 'Alter your sale',
DOMAIN_offer_14 : 'Cancel your sale',
DOMAIN_offer_15 : 'You can cancel your domain sale, which will return the domain to you with no charge. This is only available before any bids have been received for the domain.',
ENS_WrongAddress_1 : 'The wallet you unlocked does not own the name ',
ENS_WrongAddress_2 : 'Please unlock the wallet with address ',
ENS_Finalize : 'Finalize',
ENS_Finalize_content : 'Finalizing this name assigns the ENS name to the winning bidder. The winner will be refunded the difference between their bid and the next-highest bid. If you are the only bidder, you will refunded all but 0.01 ETH. Any non-winners will also be refunded.',
ENS_Finalize_content_1 : 'You are about to finalize the auction & claim the name:',
ENS_Helper_1 : 'What is the process like?',
ENS_Helper_2 : '1) Preparation',
ENS_Helper_3 : 'Decide which account you wish to own the name & ensure you have multiple backups of that account.',
ENS_Helper_4 : 'Decide the maximum amount of ETH you are willing to pay for the name (your <u>Bid Amount</u>). Ensure that account has enough to cover your bid + 0.01 ETH for gas.',
ENS_Helper_5 : '2) Start an Auction / Place a Bid',
ENS_Helper_6 : 'Bidding period lasts 3 days (72 hours).',
ENS_Helper_7 : 'You will enter the <u>name</u>, <u>Actual Bid Amount</u>, <u>Bid Mask</u>, which is protected by a <u>Secret Phrase</u>.',
ENS_Helper_8 : 'This places your bid, but this information is kept secret until you reveal it.',
ENS_Helper_9 : '3) Reveal your Bid',
ENS_Helper_10 : '**If you do not reveal your bid, you will not be refunded.**',
ENS_Helper_11 : 'Reveal Period lasts 2 days (48 hours).',
ENS_Helper_12 : 'You will unlock your account, enter the <u>Bid Amount</u>, and the <u>Secret Phrase</u>.',
ENS_Helper_13 : 'In the event that two parties bid exactly the same amount, the first bid revealed will win.',
ENS_Helper_14 : '4) Finalize the Auction',
ENS_Helper_15 : 'Once the auction has ended (after 5 days / 120 hours), the winner needs to finalize the auction in order to claim their new name.',
ENS_Helper_16 : 'The winner will be refunded the difference between their bid and the next-highest bid. If you are the only bidder, you will refunded all but 0.01 ETH.',
ENS_Helper_17 : 'More Information',
ENS_Helper_18 : 'The auction for this registrar is a blind auction, and is described in',
ENS_Helper_19 : 'Basically, no one can see *anything* during the auction.',
ENS_Helper_20 : 'ENS: Read the Docs',
ENS_Helper_21 : 'Announcing the Ethereum Name Service Relaunch Date!',
ENS_Helper_22 : 'Knowledge Base: ENS',
ENS_Helper_23 : 'Debugging a [BAD INSTRUCTION] Reveal',
ENS_Helper_24 : 'Please try the above before relying on support for reveal issues as we are severely backlogged on support tickets. We\'re so sorry. :(',
EOS_01 : '**Generate EOS Key-pair**',
EOS_02 : '**Register / Map your EOS Key**',
EOS_03 : 'Select `register`',
EOS_04 : 'Enter your **EOS Public Key** <--- CAREFUL! EOS PUBLIC KEY!',
EOS_05 : 'Fund EOS Contract on Send Page',
EOS_06 : 'Go to Send Ether & Tokens Page',
EOS_07 : 'Unlock same wallet you are unlocking here.',
EOS_08 : 'Send Amount you want to Contribute to `0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf`',
EOS_09 : 'Claim EOS Tokens',
EOS_10 : 'Select `claimAll`.',
/* Onboarding */
ONBOARD_welcome_title : 'Welcome to MyEtherWallet.com',
ONBOARD_welcome_content__1 : 'Please take some time to understand this for your own safety. 🙏',
ONBOARD_welcome_content__2 : 'Your funds will be stolen if you do not heed these warnings.',
ONBOARD_welcome_content__3 : 'We know this click-through stuff is annoying. We are sorry.',
ONBOARD_welcome_content__4 : 'What is MEW? ',
ONBOARD_welcome_content__5 : 'MyEtherWallet is a free, open-source, client-side interface.',
ONBOARD_welcome_content__6 : 'We allow you to interact directly with the blockchain while remaining in full control of your keys & your funds.',
ONBOARD_welcome_content__7 : '**You** and **only you** are responsible for your security.',
ONBOARD_welcome_content__8 : 'We cannot recover your funds or freeze your account if you visit a phishing site or lose your private key.',
ONBOARD_bank_title : 'MyEtherWallet is not a Bank',
ONBOARD_bank_content__1 : 'When you open an account with a bank or exchange, they create an account for you in their system.',
ONBOARD_bank_content__2 : 'The bank keeps track of your personal information, account passwords, balances, transactions and ultimately your money.',
ONBOARD_bank_content__3 : 'The bank charge fees to manage your account and provide services, like refunding transactions when your card gets stolen.',
ONBOARD_bank_content__4 : 'The bank allows you to write a check or charge your debit card to send money, go online to check your balance, reset your password, and get a new debit card if you lose it.',
ONBOARD_bank_content__5 : 'You have an account *with the bank or exchange* and they decide how much money you can send, where you can send it, and how long to hold on a suspicious deposit. All for a fee.',
ONBOARD_welcome_title__alt : 'Introduction',
ONBOARD_interface_title : 'MyEtherWallet is an Interface',
ONBOARD_interface_content__1 : 'When you create an account on MyEtherWallet you are generating a cryptographic set of numbers: your private key and your public key (address).',
ONBOARD_interface_content__2 : 'The handling of your keys happens entirely on your computer, inside your browser.',
ONBOARD_interface_content__3 : 'We never transmit, receive or store your private key, password, or other account information.',
ONBOARD_interface_content__4 : 'We do not charge a transaction fee.',
ONBOARD_interface_content__5 : 'You are simply using our **interface** to interact **directly with the blockchain**.',
ONBOARD_interface_content__6 : 'If you send your *public key (address)* to someone, they can send you ETH or tokens. 👍',
ONBOARD_interface_content__7 : 'If you send your *private key* to someone, they now have full control of your account. 👎',
ONBOARD_bank_title__alt : 'MEW isn\'t a Bank',
ONBOARD_blockchain_title__alt : 'WTF is a Blockchain?',
ONBOARD_blockchain_skip : 'I already know what a blockchain is...',
ONBOARD_blockchain_title : 'Wait, WTF is a Blockchain?',
ONBOARD_blockchain_content__1 : 'The blockchain is like a huge, global, decentralized spreadsheet.',
ONBOARD_blockchain_content__2 : 'It keeps track of who sent how many coins to whom, and what the balance of every account is.',
ONBOARD_blockchain_content__3 : 'It is stored and maintained by thousands of people (miners) across the globe who have special computers.',
ONBOARD_blockchain_content__4 : 'The blocks in the blockchain are made up of all the individual transactions sent from MyEtherWallet, MetaMask, Exodus, Mist, Geth, Parity, and everywhere else.',
ONBOARD_blockchain_content__5 : 'When you see your balance on MyEtherWallet.com or view your transactions on [etherscan.io](https://etherscan.io), you are seeing data on the blockchain, not in our personal systems.',
ONBOARD_blockchain_content__6 : 'Again: **we are not a bank**.',
ONBOARD_interface_title__alt : 'MEW is an Interface',
ONBOARD_why_title__alt : 'But...why does this matter?',
ONBOARD_why_title : 'Why are you making me read all this?',
ONBOARD_why_content__1 : 'Because we need you to understand that we **cannot**...',
ONBOARD_why_content__2 : 'Access your account or send your funds for you X.',
ONBOARD_why_content__3 : 'Recover or change your private key.',
ONBOARD_why_content__4 : 'Recover or reset your password.',
ONBOARD_why_content__5 : 'Reverse, cancel, or refund transactions.',
ONBOARD_why_content__6 : 'Freeze accounts.',
ONBOARD_why_content__7 : '**You** and **only you** are responsible for your security.',
ONBOARD_why_content__8 : 'Be diligent to keep your private key and password safe. Your private key is sometimes called your mnemonic phrase, keystore file, UTC file, JSON file, wallet file.',
ONBOARD_why_content__9 : 'If you lose your private key or password, no one can recover it.',
ONBOARD_why_content__10 : 'If you enter your private key on a phishing website, you will have **all your funds taken**.',
ONBOARD_blockchain_title__alt : 'WTF is a Blockchain?',
ONBOARD_point_title__alt : 'What\'s the Point of MEW then?',
ONBOARD_whymew_title : 'If MyEtherWallet can\'t do those things, what\'s the point?',
ONBOARD_whymew_content__1 : 'Because that is the point of decentralization and the blockchain.',
ONBOARD_whymew_content__2 : 'You don\'t have to rely on your bank, government, or anyone else when you want to move your funds.',
ONBOARD_whymew_content__3 : 'You don\'t have to rely on the security of an exchange or bank to keep your funds safe.',
ONBOARD_whymew_content__4 : 'If you don\'t find these things valuable, ask yourself why you think the blockchain and cryptocurrencies are valuable. 😉',
ONBOARD_whymew_content__5 : 'If you don\'t like the sound of this, consider using [Coinbase](https://www.coinbase.com/) or [Blockchain.info](https://blockchain.info/wallet/#/signup). They have more familiar accounts with usernames & passwords.',
ONBOARD_whymew_content__6 : 'If you are scared but want to use MEW, [get a hardware wallet](https://myetherwallet.github.io/knowledge-base/hardware-wallets/hardware-wallet-recommendations.html)! These keep your keys secure.',
ONBOARD_why_title__alt : 'But...why?',
ONBOARD_secure_title : 'How To Protect Yourself & Your Funds',
ONBOARD_secure_1_title : 'How To Protect Yourself from Phishers',
ONBOARD_secure_1_content__1 : 'Phishers send you a message with a link to a website that looks just like MyEtherWallet, EtherDelta, Paypal, or your bank, but is not the real website. They steal your information and then steal your money.',
ONBOARD_secure_1_content__2 : 'Install [EAL](https://chrome.google.com/webstore/detail/etheraddresslookup/pdknmigbbbhmllnmgdfalmedcmcefdfn) or [MetaMask](https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn) or [Cryptonite by Metacert](https://chrome.google.com/webstore/detail/cryptonite-by-metacert/keghdcpemohlojlglbiegihkljkgnige) or the [MyEtherWallet Chrome Extension](https://chrome.google.com/webstore/detail/myetherwallet-cx/nlbmnnijcnlegkjjpcfjclmcfggfefdm) to block malicious websites.',
ONBOARD_secure_1_content__3 : 'Always check the URL: `https://www.myetherwallet.com`.',
ONBOARD_secure_1_content__4 : 'Always make sure the URL bar has `MYETHERWALLET LLC` in green.',
ONBOARD_secure_1_content__5 : 'Do not trust messages or links sent to you randomly via email, Slack, Reddit, Twitter, etc.',
ONBOARD_secure_1_content__6 : 'Always navigate directly to a site before you enter information. Do not enter information after clicking a link from a message or email.',
ONBOARD_secure_1_content__7 : '[Install an AdBlocker](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en) and do not click ads on your search engine (e.g. Google).',
ONBOARD_point_title__alt_2 : 'What\'s the point?',
ONBOARD_secure_2_title : 'How To Protect Yourself from Scams',
ONBOARD_secure_2_content__1 : 'People will try to get you to give them money in return for nothing.',
ONBOARD_secure_2_content__2 : 'If it is too good to be true, it probably is.',
ONBOARD_secure_2_content__3 : 'Research before sending money to someone or some project. Look for information on a variety of websites and forums. Be wary.',
ONBOARD_secure_2_content__4 : 'Ask questions when you don\'t understand something or it doesn\'t seem right.',
ONBOARD_secure_2_content__5 : 'Don\'t let fear, FUD, or FOMO win over common sense. If something is very urgent, ask yourself "why?". It may be to create FOMO or prevent you from doing research.',
ONBOARD_secure_3_title__alt : 'Phuck Phishers',
ONBOARD_secure_3_title : 'How To Protect Yourself from Loss',
ONBOARD_secure_3_content__1 : 'If you lose your private key or password, it is gone forever. Don\'t lose it.',
ONBOARD_secure_3_content__2 : 'Make a backup of your private key and password. Do NOT just store it on your computer. Print it out on a piece of paper or save it to a USB drive.',
ONBOARD_secure_3_content__3 : 'Store this paper or USB drive in a different physical location. A backup is not useful if it is destroyed by a fire or flood along with your laptop.',
ONBOARD_secure_3_content__4 : 'Do not store your private key in Dropbox, Google Drive, or other cloud storage. If that account is compromised, your funds will be stolen.',
ONBOARD_secure_3_content__5 : 'If you have more than 1-week\'s worth of pay worth of cryptocurrency, get a hardware wallet. No excuses. It\'s worth it. I promise.',
ONBOARD_secure_3_content__6 : '[Even more Security Tips!](https://myetherwallet.github.io/knowledge-base/getting-started/protecting-yourself-and-your-funds.html)',
ONBOARD_secure_2_title__alt_2 : 'Screw Scams',
ONBOARD_final_title__alt : 'One more click & you\'re done! 🤘',
ONBOARD_final_title : 'Alright, I\'m done lecturing you!',
ONBOARD_final_subtitle : 'Sorry for being like this. Onwards!',
ONBOARD_final_content__1 : 'Create a wallet',
ONBOARD_final_content__2 : 'Get a hardware wallet',
ONBOARD_final_content__3 : 'How to Set up MEW + MetaMask',
ONBOARD_final_content__4 : 'How to Run MEW Offline / Locally',
ONBOARD_final_content__5 : 'How to Send via Ledger hardware wallet',
ONBOARD_final_content__6 : 'How to Send via TREZOR hardware wallet',
ONBOARD_final_content__7 : 'How to Send via MetaMask',
ONBOARD_final_content__8 : 'Learn More or Contact Us',
ONBOARD_final_content__9 : 'OMG, please just let me send FFS.',
ONBOARD_resume : 'It looks like you didn\'t finish reading through these slides last time. ProTip: Finish reading through the slides 😉',
HELP_2a_Title : 'Hur säkerhetskopierar jag min plånbok? ',
/* New Generics */
x_CancelReplaceTx : 'Avbryt eller ersätt transaktion',
x_CancelTx : 'Avbryt transaktion',
x_PasswordDesc : 'This password * encrypts * your private key. This does not act as a seed to generate your keys. **You will need this password + your private key to unlock your wallet.**',
x_ReadMore : 'Läs mer',
x_ReplaceTx : 'Ersätt transaktion',
x_TransHash : 'Transaktionens Hash',
x_TXFee : 'TX Avgift',
x_TxHash : 'TX Hash',
/* Check TX Status */
NAV_CheckTxStatus : 'Kontrollera TX Status',
NAV_TxStatus : 'TX Status',
tx_Details : 'Transaktionsdetaljer',
tx_Summary : 'During times of high volume (like during ICOs) transactions can be pending for hours, if not days. This tool aims to give you the ability to find and "cancel" / replace these TXs. ** This is not typically something you can do. It should not be relied upon & will only work when the TX Pools are full. [Please, read about this tool here.](https://myetherwallet.github.io/knowledge-base/transactions/check-status-of-ethereum-transaction.html)**',
tx_notFound : 'Transaktionen hittades inte',
tx_notFound_1 : 'This TX cannot be found in the TX Pool of the node you are connected to.',
tx_notFound_2 : 'If you just sent the transaction, please wait 15 seconds and press the "Check TX Status" button again. ',
tx_notFound_3 : 'It could still be in the TX Pool of a different node, waiting to be mined.',
tx_notFound_4 : 'Please use the dropdown in the top-right & select a different ETH node (e.g. `ETH (Etherscan.io)` or `ETH (Infura.io)` or `ETH (MyEtherWallet)`) and check again.',
tx_foundInPending : 'Pågående transaktioner hittades',
tx_foundInPending_1 : 'Your transaction was located in the TX Pool of the node you are connected to. ',
tx_foundInPending_2 : 'It is currently pending (waiting to be mined). ',
tx_foundInPending_3 : 'There is a chance you can "cancel" or replace this transaction. Unlock your wallet below.',
tx_FoundOnChain : 'Transaktionen hittades',
tx_FoundOnChain_1 : 'Your transaction was successfully mined and is on the blockchain.',
tx_FoundOnChain_2 : '**If you see a red `( ! )`, a `BAD INSTRUCTION` or `OUT OF GAS` error message**, it means that the transaction was not successfully *sent*. You cannot cancel or replace this transaction. Instead, send a new transaction. If you received an "Out of Gas" error, you should double the gas limit you specified originally.',
tx_FoundOnChain_3 : '**If you do not see any errors, your transaction was successfully sent.** Your ETH or Tokens are where you sent them. If you cannot see this ETH or Tokens credited in your other wallet / exchange account, and it has been 24+ hours since you sent, please [contact that service](https://myetherwallet.github.io/knowledge-base/diving-deeper/ethereum-list-of-support-and-communities.html). Send them the *link* to your transaction and ask them, nicely, to look into your situation.',
/* Gen Wallet Updates */
GEN_Help_1 : 'Använd din',
GEN_Help_2 : 'för att komma åt ditt konto.',
GEN_Help_3 : 'Din enhet * är * din plånbok.',
GEN_Help_4 : 'Guider & FAQ',
GEN_Help_5 : 'Hur man skapar en plånbok',
GEN_Help_6 : 'Kom igång',
GEN_Help_7 : 'Spara den säkert · Gör en säkerhetskopia · Dela inte med någon · Tappa inte bort den · Din plånbok kan inte återställas om du tappar bort den.',
GEN_Help_8 : 'Startar inte nedladdningen? ',
GEN_Help_9 : 'Testa med Google Chrome ',
GEN_Help_10 : 'Högerklicka & spara som. Filnamn: ',
GEN_Help_11 : 'Öpnna inte den här filen på din dator ',
GEN_Help_12 : 'Använd filen för att låsa upp din plånbok via t.ex MyEtherWallet, Mist, Geth, Parity eller andra klienter.',
GEN_Help_13 : 'Hur säkerhetskopierar jag mina privata nycklar? ',
GEN_Help_14 : 'Vad innebär de olika formaten? ',
GEN_Help_15 : 'Förhindrar förlust & och stöld av din investering.',
GEN_Help_16 : 'Vad innebär de olika formaten?',
GEN_Help_17 : 'Varför är det en bra idé?',
GEN_Help_18 : 'För att få en extra backup.',
GEN_Help_19 : 'Ifall du glömmer bort ditt lösenord.',
GEN_Help_20 : 'Cold Storage',
GET_ConfButton : 'Jag förstår. Fortsätt',
GEN_Label_5 : 'Spara din `Privata nyckel`. ',
GEN_Unlock : 'Lås upp din plånbok för att se din address',
GAS_PRICE_Desc : 'Gas priset är summan du betalar per enhet gas. `TX avgift = gas priset * gas limit` & betalas av miners för att inkludera din transaktion i sitt block. Ju högre gas pris, desto snabbare. Ett normalt värde är `41 GWEI`.',
GAS_LIMIT_Desc : 'Gas limit is the amount of gas to send with your TX. `TX fee` = gas price * gas limit & is paid to miners for including your TX in a block. Increasing this number will not get your TX mined faster. Sending ETH = `21000`. Sending Tokens = ~`200000`.',
NONCE_Desc : 'The nonce is the number of transactions sent from a given address. It ensures transactions are sent in order & not more than once.',
TXFEE_Desc : 'The TX Fee is paid to miners for including your TX in a block. Is is the `gas limit` * `gas price`. [You can convert GWEI -> ETH here](https://www.myetherwallet.com/helpers.html)',
/* Navigation*/
NAV_AddWallet : 'Lägg till Plånbok ',
NAV_BulkGenerate : 'Mass Generera ',
NAV_Contact : 'Kontakt ',
NAV_Contracts : 'Contracts ',
NAV_DeployContract : 'Deploy Contract ',
NAV_ENS : 'ENS',
NAV_GenerateWallet_alt : 'New Wallet ',
NAV_GenerateWallet : 'Generera Plånbok ',
NAV_Help : 'Hjälp ',
NAV_InteractContract : 'Interact with Contract ',
NAV_Multisig : 'Multisig ',
NAV_MyWallets : 'Mina Plånböcker ',
NAV_Offline : 'Skicka Offline ',
NAV_SendEther : 'Skicka Ether och Tokens ',
NAV_SendTokens : 'Skicka Token ', /*Översätt token?*/
NAV_SignMsg : 'Sign Message ',
NAV_Swap : 'Swap ',
NAV_ViewWallet : 'Visa Plånboks Info ',
NAV_YourWallets : 'Dina Plånböcker ',
/* General */
x_Access : 'Access ',
x_AddessDesc : 'Your Address can also be known as you `Account #` or your `Public Key`. It is what you share with people so they can send you Ether or Tokens. Find the colorful address icon. Make sure it matches your paper wallet & whenever you enter your address somewhere. Det här är vad som ibland kallas "Publik Nyckel", "Adress" eller "Konto nr". Det är vad du ger människor så att de kan skicka dig ether. Den här ikonen är ett enkelt sätt att känna igen din adress. ',
x_Address : 'Din Adress ',
x_Cancel : 'Avbryt ',
x_CSV : 'CSV fil (okrypterad) ',
x_Download : 'Ladda Ner ',
x_Json : 'JSON Fil (okrypterad) ',
x_JsonDesc : 'Det här är din okrypterade privata nyckel i JSON format. Det här betyder att du inte behöver ditt lösenord men vem som helst som hittar din JSON kan få tillgång till din plånbok och Ether utan ditt lösenord. ',
x_Keystore : 'Keystore Fil (UTC / JSON · Rekomenderad · Krypterad) ',
x_Keystore2 : 'Keystore Fil (UTC / JSON) ',
x_KeystoreDesc : 'Den här Keystore filen matchar formatet som används av Mist så du kan enkelt importera det i framtiden. Det är det rekommenderade format att hämta för backup. ',
x_MetaMask : 'MetaMask / Mist ',
x_Mnemonic : 'Mnemonic Phrase ',
x_Password : 'Lösenord ',
x_Print : 'Skriv Ut Pappers Plånbok ',
x_PrintDesc : 'Tips: Klicka på skriv ut och spara som PDF, även om du inte har en skrivare! ',
x_PrintShort : 'Skriv Ut ',
x_PrivKey : 'Privat Nyckel (okrypterad) ',
x_PrivKey2 : 'Privat Nyckel ',
x_PrivKey2 : 'Private Key ',
x_PrivKeyDesc : 'Det här är en okrypterad variant av din privata nyckel, vilket betyder att ett lösenord inte är nödvändigt. Om någon skulle hitta din okrypterade privata nyckel, så kan dom få tillgång till din plånbok utan lösenord. Av den anledningen så rekomenderas en krypterad variant av plånboken istället. ',
x_Save : 'Spara ',
x_TXT : 'TXT fil (okrypterad) ',
x_Wallet : 'Plånbok ',
x_ParityPhrase : 'Parity Phrase ',
/* Header */
CX_Tagline : 'Open Source JavaScript Client-Side Ether Wallet Chrome Extension ',
CX_Warning_1 : 'Make sure you have **external backups** of any wallets you store here. Many things could happen that would cause you to lose the data in this Chrome Extension, including uninstalling and reinstalling the extension. This extension is a way to easily access your wallets, **not** a way to back them up. ',
MEW_Tagline : 'Open Source JavaScript Client-Side Ether Wallet ',
MEW_Warning_1 : 'Always check the URL before accessing your wallet or creating a new wallet. Beware of phishing sites! ',
/* Footer */
FOOTER_1 : 'Free, open-source, client-side interface for generating Ethereum wallets & more. Interact with the Ethereum blockchain easily & securely. Double-check the URL ( myetherwallet.com ) before unlocking your wallet.',
FOOTER_1b : 'Created by ',
FOOTER_2 : 'Donations greatly appreciated ',
FOOTER_3 : 'Client-side wallet generation by ',
FOOTER_4 : 'Disclaimer ',
/* Sidebar */
sidebar_AccountAddr : 'Konto Adress ',
sidebar_AccountBal : 'Konto Saldo ',
sidebar_AccountInfo : 'Kontoinformation ',
sidebar_donate : 'Donera ',
sidebar_donation : 'MyEtherWallet är en gratis service, med öppen källkod inriktade på din integritet och säkerhet. Ju fler donationer vi får, desto mer tid lägger vi på att skapa nya funktioner, lyssna på feedback, och ge dig vad du vill. Vi är bara två personer som försöker förändra världen. Hjälp oss? ',
sidebar_Equiv : 'Motsvarande Värden ',
sidebar_thanks : 'TACK!!! ',
sidebar_TokenBal : 'Token Saldon ',
sidebar_TransHistory : 'Transaktionshistorik ',
sidebar_DisplayOnTrezor : 'Display address on TREZOR',
sidebar_DisplayOnLedger : 'Display address on Ledger',
/* Decrypt Panel */
decrypt_Access : 'How would you like to access your wallet? ',
decrypt_Title : 'Select the format of your private key ',
decrypt_Select : 'Select a Wallet ',
/* Mnemonic */
MNEM_1 : 'Please select the address you would like to interact with. ',
MNEM_2 : 'Your single HD mnemonic phrase can access a number of wallets / addresses. Please select the address you would like to interact with at this time. ',
MNEM_more : 'More Addresses ',
MNEM_prev : 'Previous Addresses ',
/* Hardware wallets */
x_Ledger : 'Ledger Wallet ',
ADD_Ledger_1 : 'Connect your Ledger Wallet ',
ADD_Ledger_2 : 'Open the Ethereum application (or a contract application) ',
ADD_Ledger_2_Exp : 'Open the Expanse application (or a contract application) ',
ADD_Ledger_2_Ubq : 'Open the Ubiq application (or a contract application) ',
ADD_Ledger_3 : 'Verify that Browser Support is enabled in Settings ',
ADD_Ledger_4 : 'If no Browser Support is found in settings, verify that you have [Firmware >1.2](https://www.ledgerwallet.com/apps/manager) ',
ADD_Ledger_0a : 'Please use MyEtherWallet on a secure (SSL / HTTPS) connection to connect. ',
ADD_Ledger_0b : 'Re-open MyEtherWallet using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ',
ADD_Ledger_scan : 'Connect to Ledger Wallet ',
ADD_MetaMask : 'Connect to MetaMask ',
x_Trezor : 'TREZOR ',
ADD_Trezor_scan : 'Connect to TREZOR ',
x_DigitalBitbox : 'Digital Bitbox ',
ADD_DigitalBitbox_0a : 'Re-open MyEtherWallet on a secure (SSL) connection ',
ADD_DigitalBitbox_0b : 'Re-open MyEtherWallet using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ',
ADD_DigitalBitbox_scan : 'Connect your Digital Bitbox ',
x_Secalot : 'Secalot ',
ADD_Secalot_0a : 'Re-open MyEtherWallet on a secure (SSL) connection ',
ADD_Secalot_0b : 'Re-open MyEtherWallet using [Chrome](https://www.google.com/chrome/browser/desktop/) or [Opera](https://www.opera.com/) ',
ADD_Secalot_scan : 'Connect your Secalot ',
/* Add Wallet */
ADD_Label_1 : 'What would you like to do? ',
ADD_Radio_1 : 'Generate New Wallet ',
ADD_Radio_2 : 'Select Your Wallet File (Keystore / JSON) ',
ADD_Radio_2_alt : 'Select Your Wallet File ',
ADD_Radio_2_short : 'SELECT WALLET FILE... ',
ADD_Radio_3 : 'Paste Your Private Key ',
ADD_Radio_4 : 'Add an Account to Watch ',
ADD_Radio_5 : 'Paste Your Mnemonic ',
ADD_Radio_5_Path : 'Select HD derivation path ',
ADD_Radio_5_woTrezor : '(Jaxx, Metamask, Exodus, imToken)',
ADD_Radio_5_withTrezor : '(Jaxx, Metamask, Exodus, imToken, TREZOR)',
ADD_Radio_5_PathAlternative : '(Ledger)',
ADD_Radio_5_PathTrezor : '(TREZOR)',
ADD_Radio_5_PathCustom : 'Custom',
ADD_Label_2 : 'Create a Nickname ',
ADD_Label_3 : 'Your wallet is encrypted. Good! Please enter the password. ',
ADD_Label_4 : 'Add an Account to Watch ',
ADD_Warning_1 : 'You can add any account to "watch" on the wallets tab without uploading a private key. This does ** not ** mean you have access to this wallet, nor can you transfer Ether from it. ',
ADD_Label_5 : 'Enter the Address ',
ADD_Label_6 : 'Unlock your Wallet ',
ADD_Label_6_short : 'Unlock ',
ADD_Label_7 : 'Add Account ',
ADD_Label_8 : 'Password (optional): ',
/* Generate Wallets */
GEN_desc : 'If you want to generate multiple wallets, you can do so here ',
GEN_Label_1 : 'Enter a strong password (at least 9 characters) ',
GEN_Placeholder_1 : 'Do NOT forget to save this! ',
GEN_SuccessMsg : 'Success! Your wallet has been generated. ',
GEN_Label_2 : 'Save your Wallet File. ',
GEN_Label_3 : 'Save Your Address. ',
GEN_Label_4 : 'Print paper wallet or a QR code.',
/* Bulk Generate Wallets */
BULK_Label_1 : 'Antal Plånböcker att Generera ',
BULK_Label_2 : 'Generera Plånböcker ',
BULK_SuccessMsg : 'Dina plånböcker har genererats. ',
/* Sending Ether and Tokens */
SEND_addr : 'To Address ',
SEND_amount : 'Amount to Send ',
SEND_amount_short : 'Amount ',
SEND_custom : 'Add Custom Token ',
SEND_gas : 'Gas ',
SEND_TransferTotal : 'Send Entire Balance ',
SEND_generate : 'Generate Transaction ',
SEND_raw : 'Raw Transaction ',
SEND_signed : 'Signed Transaction ',
SEND_trans : 'Send Transaction ',
SENDModal_Title : 'Warning! ',
/* full sentence reads "You are about to send "10 ETH" to address "0x1234". Are you sure you want to do this? " */
SENDModal_Content_1 : 'You are about to send ',
SENDModal_Content_2 : 'to address ',
SENDModal_Content_3 : 'Are you sure you want to do this? ',
SENDModal_Content_4 : 'NOTE: If you encounter an error, you most likely need to add ether to your account to cover the gas cost of sending tokens. Gas is paid in ether. ',
SENDModal_No : 'No, get me out of here! ',
SENDModal_Yes : 'Yes, I am sure! Make transaction. ',
/* Tokens */
TOKEN_Addr : 'Token Contract Address ',
TOKEN_Symbol : 'Token Symbol ',
TOKEN_Dec : 'Decimals ',
TOKEN_show : 'Show All Tokens ',
TOKEN_hide : 'Hide Tokens ',
/* Send Transaction */
TRANS_desc : 'If you want to send Tokens, please use the "Send Token" page instead. ',
TRANS_warning : 'If you are using the "Only ETH" or "Only ETC" Functions you are sending via a contract. Some services have issues accepting these transactions. Read more. ',
TRANS_advanced : '+Advanced: Add Data ',
TRANS_data : 'Data ',
TRANS_gas : 'Gas Limit ',
TRANS_sendInfo : 'A standard transaction using 21000 gas will cost 0.000441 ETH. We use a slightly-above-minimum gas price of 0.000000021 ETH to ensure it gets mined quickly. We do not take a transaction fee. ',
/* Offline Transaction */
OFFLINE_Title : 'Generate & Send Offline Transaction ',
OFFLINE_Desc : 'Generating offline transactions can be done in three steps. You will complete steps 1 and 3 on an online computer, and step 2 on an offline/airgapped computer. This ensures your private keys do not touch an internet-connected device. ',
OFFLLINE_Step1_Title : 'Step 1: Generate Information (Online Computer) ',
OFFLINE_Step1_Button : 'Generate Information ',
OFFLINE_Step1_Label_1 : 'From Address ',
OFFLINE_Step1_Label_2 : 'Note: This is the FROM address, not the TO address. Nonce is generated from the originating account. If using an airgapped computer, it would be the address of the cold-storage account. ',
OFFLINE_Step2_Title : 'Step 2: Generate Transaction (Offline Computer) ',
OFFLINE_Step2_Label_1 : 'To Address ',
OFFLINE_Step2_Label_2 : 'Value / Amount to Send ',
OFFLINE_Step2_Label_3 : 'Gas Price ',
OFFLINE_Step2_Label_3b : 'This was displayed in Step 1 on your online computer. ',
OFFLINE_Step2_Label_4 : 'Gas Limit ',
OFFLINE_Step2_Label_4b : '21000 is the default gas limit. When you send contracts or add\'l data, this may need to be different. Any unused gas will be returned to you. ',
OFFLINE_Step2_Label_5 : 'Nonce ',
OFFLINE_Step2_Label_5b : 'This was displayed in Step 1 on your online computer. ',
OFFLINE_Step2_Label_6 : 'Data ',
OFFLINE_Step2_Label_6b : 'This is optional. Data is often used when you send transactions to contracts. ',
OFFLINE_Step2_Label_7 : 'Enter / Select your Private Key / JSON. ',
OFFLINE_Step3_Title : 'Step 3: Send / Publish Transaction (Online Computer) ',
OFFLINE_Step3_Label_1 : 'Paste the signed transaction from Step 2 here and press the "SEND TRANSACTION" button. ',
/* My Wallet */
MYWAL_Nick : 'Plånboks Namn ',
MYWAL_Address : 'Plånboks Adress ',
MYWAL_Bal : 'Saldo ',
MYWAL_Edit : 'Ändra ',
MYWAL_View : 'Visa ',
MYWAL_Remove : 'Ta Bort ',
MYWAL_RemoveWal : 'Ta Bort Plånbok: ',
MYWAL_WatchOnly : 'Dina Bevakade Konton ', /*Any better translation?*/
MYWAL_Viewing : 'Visar Plånbok ',
MYWAL_Hide : 'Dölj Plånboks Info ',
MYWAL_Edit_2 : 'Ändra Plånbok ',
MYWAL_Name : 'Plånboks Namn ',
MYWAL_Content_1 : 'Varning! Du är på väg att ta bort din plånbok ',
MYWAL_Content_2 : 'Kontrollera att du har **sparat den privata nyckeln / Keystore filen och lösenordet** som tillhör den här plånboken innan du tar bort den. ',
MYWAL_Content_3 : 'Om du vill använda plånboken med MyEtherWallet CX i framtiden, måste du manuellt lägga till den med hjälp av den privata nyckeln / JSON filen och lösenordet. ',
/* View Wallet Details */
VIEWWALLET_Subtitle : 'This allows you to download different versions of private keys and re-print your paper wallet. You may want to do this in order to [import your account into Geth/Mist](http://ethereum.stackexchange.com/questions/465/how-to-import-a-plain-private-key-into-geth/). If you want to check your balance, we recommend using a blockchain explorer like [etherscan.io](https://etherscan.io/). ',
VIEWWALLET_Subtitle_Short : 'This allows you to download different versions of private keys and re-print your paper wallet. ',
VIEWWALLET_SuccessMsg : 'Success! Here are your wallet details. ',
VIEWWALLET_ShowPrivKey : '(show)',
VIEWWALLET_HidePrivKey : '(hide)',
/* Contracts */
CONTRACT_Title : 'Contract Address ',
CONTRACT_Title_2 : 'Select Existing Contract ',
CONTRACT_Json : 'ABI / JSON Interface ',
CONTRACT_Interact_Title : 'Read / Write Contract ',
CONTRACT_Interact_CTA : 'Select a function ',
CONTRACT_ByteCode : 'Byte Code ',
CONTRACT_Read : 'READ ',
CONTRACT_Write : 'WRITE ',
DEP_generate : 'Generate Bytecode ',
DEP_generated : 'Generated Bytecode ',
DEP_signtx : 'Sign Transaction ',
DEP_interface : 'Generated Interface ',
/* Node Switcher */
NODE_Title : 'Set Up Your Custom Node',
NODE_Subtitle : 'To connect to a local node...',
NODE_Warning : 'Your node must be HTTPS in order to connect to it via MyEtherWallet.com. You can [download the MyEtherWallet repo & run it locally](https://github.com/kvhnuke/etherwallet/releases/latest) to connect to any node. Or, get free SSL certificate via [LetsEncrypt](https://letsencrypt.org/)',
NODE_Name : 'Node Name',
NODE_Port : 'Node Port',
NODE_CTA : 'Save & Use Custom Node',
/* Swap / Exchange */
SWAP_rates : "Current Rates ",
SWAP_init_1 : "I want to swap my ",
SWAP_init_2 : " for ", // "I want to swap my X ETH for X BTC"
SWAP_init_CTA : "Let's do this! ", // or "Continue"
SWAP_information : "Your Information ",
SWAP_send_amt : "Amount to send ",
SWAP_rec_amt : "Amount to receive ",
SWAP_your_rate : "Your rate ",
SWAP_rec_add : "Your Receiving Address ",
SWAP_start_CTA : "Start Swap ",
SWAP_ref_num : "Your reference number ",
SWAP_time : "Time remaining to send ",
SWAP_elapsed : "Time elapsed since sent ",
SWAP_progress_1 : "Order Initiated ",
SWAP_progress_2 : "Waiting for your ", // Waiting for your BTC...
SWAP_progress_3 : "Received! ", // ETH Received!
SWAP_progress_4 : "Sending your {{orderResult.output.currency}} ",
SWAP_progress_5 : "Order Complete ",
SWAP_order_CTA : "Please send ", // Please send 1 ETH...
SWAP_unlock : "Unlock your wallet to send ETH or Tokens directly from this page. ",
/* Sign Message */
MSG_message : 'Message ',
MSG_date : 'Date ',
MSG_signature : 'Signature ',
MSG_verify : 'Verify Message ',
MSG_info1 : 'Include the current date so the signature cannot be reused on a different date. ',
MSG_info2 : 'Include your nickname and where you use the nickname so someone else cannot use it. ',
MSG_info3 : 'Include a specific reason for the message so it cannot be reused for a different purpose. ',
/* Chrome Extension */
CX_error_1 : 'You don\'t have any wallets saved. Click ["Add Wallet"](/cx-wallet.html#add-wallet) to add one! ',
CX_quicksend : 'QuickSend ', // if no appropriate translation, just use "Send"
/* Error Messages */
ERROR_0 : 'Please enter a valid amount.', // 0
ERROR_1 : 'Your password must be at least 9 characters. Please ensure it is a strong password. ', // 1
ERROR_2 : 'Sorry! We don\'t recognize this type of wallet file. ', // 2
ERROR_3 : 'This is not a valid wallet file. ', // 3
ERROR_4 : 'This unit doesn\'t exists, please use the one of the following units ', // 4
ERROR_5 : 'Please enter a valid address. ', // 5
ERROR_6 : 'Please enter a valid password. ', // 6
ERROR_7 : 'Please enter valid decimals (Must be integer, 0-18). ', // 7
ERROR_8 : 'Please enter a valid gas limit (Must be integer. Try 21000-4000000). ', // 8
ERROR_9 : 'Please enter a valid data value (Must be hex). ', // 9
ERROR_10 : 'Please enter a valid gas price. (Must be integer. Try 20 GWEI (20000000000 WEI)',
ERROR_11 : 'Please enter a valid nonce (Must be integer).', // 11
ERROR_12 : 'Invalid signed transaction. ', // 12
ERROR_13 : 'A wallet with this nickname already exists. ', // 13
ERROR_14 : 'Wallet not found. ', // 14
ERROR_15 : 'Whoops. It doesn\'t look like a proposal with this ID exists yet or there is an error reading this proposal. ', // 15 - NOT USED
ERROR_16 : 'A wallet with this address already exists in storage. Please check your wallets page. ', // 16
ERROR_17 : 'Account you are sending from does not have enough funds. If sending tokens, you must have 0.01 ETH in your account to cover the cost of gas. ', // 17
ERROR_18 : 'All gas would be used on this transaction. This means you have already voted on this proposal or the debate period has ended.', // 18
ERROR_19 : 'Please enter a valid symbol', // 19
ERROR_20 : 'Not a valid ERC-20 token', // 20
ERROR_21 : 'Could not estimate gas. There are not enough funds in the account, or the receiving contract address would throw an error. Feel free to manually set the gas and proceed. The error message upon sending may be more informative.', // 21
ERROR_22 : 'Please enter a valid node name', // 22
ERROR_23 : 'Please enter a valid URL. If you are on https, your URL must be https', // 23
ERROR_24 : 'Please enter a valid port. ', // 24
ERROR_25 : 'Please enter a valid chain ID. ', // 25
ERROR_26 : 'Please enter a valid ABI. ', // 26
ERROR_27 : 'Minimum amount: 0.01. Max amount: ', // 27
ERROR_28 : 'You need this `Keystore File + Password` or the `Private Key` (next page) to access this wallet in the future. ', // 28
ERROR_29 : 'Please enter a valid user and password. ', // 29
ERROR_30 : 'Please enter a valid name (7+ characters, limited punctuation) ', // 30
ERROR_31 : 'Please enter a valid secret phrase. ', // 31
ERROR_32 : 'Could not connect to the node. Refresh your page, try a different node (upper right corner), check your firewall settings. If custom node, check your configs.', // 32
ERROR_33 : 'The wallet you have unlocked does not match the owner\'s address. ', // 33
ERROR_34 : 'The name you are attempting to reveal does not match the name you have entered. ', // 34
ERROR_35 : 'Input address is not checksummed. <a href="https://myetherwallet.github.io/knowledge-base/addresses/not-checksummed-shows-when-i-enter-an-address.html" target="_blank" rel="noopener noreferrer"> More info</a>', // 35
ERROR_36 : 'Enter valid TX hash', // 36
ERROR_37 : 'Enter valid hex string (0-9, a-f)', // 37
SUCCESS_1 : 'Valid address ',
SUCCESS_2 : 'Wallet successfully decrypted ',
SUCCESS_3 : 'Your TX has been broadcast to the network. This does not mean it has been mined & sent. During times of extreme volume, it may take 3+ hours to send. 1) Check your TX below. 2) If it is pending for hours or disappears, use the Check TX Status Page to replace. 3) Use [ETH Gas Station](https://ethgasstation.info/) to see what gas price is optimal. 4) Save your TX Hash in case you need it later: ', //'Your TX has been broadcast to the network. This does not mean it has been mined & sent. During times of extreme volume, it may take 3+ hours to send. 1) Check your TX below. 2) If it is pending for hours or disappears, use the Check TX Status Page to replace. 3) Use [ETH Gas Station](https://ethgasstation.info/) to see what gas price is optimal. 4) Save your TX Hash in case you need it later: ', //
SUCCESS_4 : 'Your wallet was successfully added ',
SUCCESS_5 : 'File Selected ',
SUCCESS_6 : 'You are successfully connected ',
SUCCESS_7 : 'Message Signature Verified',
WARN_Send_Link : 'You arrived via a link that has the address, value, gas, data fields, or transaction type (send mode) filled in for you. You can change any information before sending. Unlock your wallet to get started. ',
/* Geth Error Messages */
GETH_InvalidSender : 'Invalid sender ',
GETH_Nonce : 'Nonce too low ',
GETH_Cheap : 'Gas price too low for acceptance ',
GETH_Balance : 'Insufficient balance ',
GETH_NonExistentAccount : 'Account does not exist or account balance too low ',
GETH_InsufficientFunds : 'Insufficient funds for gas * price + value ',
GETH_IntrinsicGas : 'Intrinsic gas too low ',
GETH_GasLimit : 'Exceeds block gas limit ',
GETH_NegativeValue : 'Negative value ',
/* Parity Error Messages */
PARITY_AlreadyImported : "Transaction with the same hash was already imported.",
PARITY_Old : "Transaction nonce is too low. Try incrementing the nonce.",
PARITY_TooCheapToReplace : "Transaction fee is too low. There is another transaction with same nonce in the queue. Try increasing the fee or incrementing the nonce.",
PARITY_LimitReached : "There are too many transactions in the queue. Your transaction was dropped due to limit. Try increasing the fee.",
PARITY_InsufficientGasPrice : "Transaction fee is too low. It does not satisfy your node's minimal fee (minimal: {}, got: {}). Try increasing the fee.",
PARITY_InsufficientBalance : "Insufficient funds. Account you try to send transaction from does not have enough funds. Required {} wei and got: {} wei.",
PARITY_GasLimitExceeded : "Transaction cost exceeds current gas limit. Limit: {}, got: {}. Try decreasing supplied gas.",
PARITY_InvalidGasLimit : "Supplied gas is beyond limit.",
/* Tranlsation Info */
translate_version : '0.5 ',
Translator_Desc : ' ',
TranslatorName_1 : ' ',
TranslatorAddr_1 : ' ',
/* Translator 1 : Insert Comments Here */
TranslatorName_2 : ' ',
TranslatorAddr_2 : ' ',
/* Translator 2 : Insert Comments Here */
TranslatorName_3 : ' ',
TranslatorAddr_3 : ' ',
/* Translator 3 : Insert Comments Here */
TranslatorName_4 : ' ',
TranslatorAddr_4 : ' ',
/* Translator 4 : Insert Comments Here */
TranslatorName_5 : ' ',
TranslatorAddr_5 : ' ',
/* Translator 5 : Insert Comments Here */
/* Help - Nothing after this point has to be translated. If you feel like being extra helpful, go for it. */
HELP_Warning : 'If you created a wallet -or- downloaded the repo before **Dec. 31st, 2015**, please check your wallets & download a new version of the repo. Click for details. ',
HELP_Desc : 'Do you see something missing? Have another question? [Get in touch with us](mailto:support@myetherwallet.com), and we will not only answer your question, we will update this page to be more useful to people in the future! ',
HELP_Remind_Title : 'Some reminders ',
HELP_Remind_Desc_1 : '**Ethereum, MyEtherWallet.com & MyEtherWallet CX, and some of the underlying Javascript libraries we use are under active development.** While we have thoroughly tested & tens of thousands of wallets have been successfully created by people all over the globe, there is always the remote possibility that something unexpected happens that causes your ETH to be lost. Please do not invest more than you are willing to lose, and please be careful. If something were to happen, we are sorry, but **we are not responsible for the lost Ether**. ',
HELP_Remind_Desc_2 : 'MyEtherWallet.com & MyEtherWallet CX are not "web wallets". You do not create an account or give us your Ether to hold onto. All data never leaves your computer/your browser. We make it easy for you to create, save, and access your information and interact with the blockchain. ',
HELP_Remind_Desc_3 : 'If you do not save your private key & password, there is no way to recover access to your wallet or the funds it holds. Back them up in multiple physical locations – not just on your computer! ',
HELP_0_Title : '0) I\'m new. What do I do? ',
HELP_0_Desc_1 : 'MyEtherWallet gives you the ability to generate new wallets so you can store your Ether yourself, not on an exchange. This process happens entirely on your computer, not our servers. Therefore, when you generate a new wallet, **you are responsible for safely backing it up**. ',
HELP_0_Desc_2 : 'Create a new wallet. ',
HELP_0_Desc_3 : 'Back the wallet up. ',
HELP_0_Desc_4 : 'Verify you have access to this new wallet and have correctly saved all necessary information. ',
HELP_0_Desc_5 : 'Transfer Ether to this new wallet. ',
HELP_1_Title : '1) How do I create a new wallet? ',
HELP_1_Desc_1 : 'Go to the "Generate Wallet" page. ',
HELP_1_Desc_2 : 'Go to the "Add Wallet" page & select "Generate New Wallet" ',
HELP_1_Desc_3 : 'Enter a strong password. If you think you may forget it, save it somewhere safe. You will need this password to send transactions. ',
HELP_1_Desc_4 : 'Click "GENERATE". ',
HELP_1_Desc_5 : 'Your wallet has now been generated. ',
HELP_2a_Desc_1 : 'You should always back up your wallet externally and in multiple physical locations - like on a USB drive and/or a piece of paper. ',
HELP_2a_Desc_2 : 'Save the address. You can keep it to yourself or share it with others. That way, others can transfer ether to you. ',
HELP_2a_Desc_3 : 'Save versions of the private key. Do not share it with anyone else. Your private key is necessary when you want to access your Ether to send it! There are 3 types of private keys ',
HELP_2a_Desc_4 : 'Place your address, versions of the private key, and the PDF version of your paper wallet in a folder. Save this on your computer and a USB drive. ',
HELP_2a_Desc_5 : 'Print the wallet if you have a printer. Otherwise, write down your private key and address on a piece of paper. Store this as a secure location, separate from your computer and the USB drive. ',
HELP_2a_Desc_6 : 'Keep in mind, you must prevent loss of the keys and password due to loss or failure of you hard drive failure, or USB drive, or piece of paper. You also must keep in mind physical loss / damage of an entire area (think fire or flood). ',
HELP_2b_Title : '2b) How do I safely / offline / cold storage with MyEtherWallet? ',
HELP_2b_Desc_1 : 'Go to [https://github.com/kvhnuke/etherwallet/releases/latest](https://github.com/kvhnuke/etherwallet/releases/latest). ',
HELP_2b_Desc_2 : 'Click on `etherwallet-vX.X.X.X.zip`. ',
HELP_2b_Desc_3 : 'Move zip to an airgapped computer. ',
HELP_2b_Desc_4 : 'Unzip it and double-click `index.html`. ',
HELP_2b_Desc_5 : 'Generate a wallet with a strong password. ',
HELP_2b_Desc_6 : 'Save the address. Save versions of the private key. Save the password if you might not remember it forever. ',
HELP_2b_Desc_7 : 'Store these papers / USBs in multiple physically separate locations. ',
HELP_2b_Desc_8 : 'Go to the "View Wallet Info" page and type in your private key / password to ensure they are correct and access your wallet. Check that the address you wrote down is the same. ',
HELP_3_Title : '3) How do I verify I have access to my new wallet? ',
HELP_3_Desc_1 : '**Before you send any Ether to your new wallet**, you should ensure you have access to it. ',
HELP_3_Desc_2 : 'Navigate to the "View Wallet Info" page. ',
HELP_3_Desc_3 : 'Navigate to the MyEtherWallet.com "View Wallet Info" page. ',
HELP_3_Desc_4 : 'Select your wallet file -or- your private key and unlock your wallet. ',
HELP_3_Desc_5 : 'If the wallet is encrypted, a text box will automatically appear. Enter the password. ',
HELP_3_Desc_6 : 'Click the "Unlock Wallet" button. ',
HELP_3_Desc_7 : 'Your wallet information should show up. Find your account address, next to a colorful, circular icon. This icon visually represents your address. Be certain that the address is the address you have saved to your text document and is on your paper wallet. ',
HELP_3_Desc_8 : 'If you are planning on holding a large amount of ether, we recommend that send a small amount of ether from new wallet before depositing a large amount. Send 0.001 ether to your new wallet, access that wallet, send that 0.001 ether to another address, and ensure everything works smoothly. ',
HELP_4_Title : '4) How do I send Ether from one wallet to another? ',
HELP_4_Desc_1 : 'If you plan to move a large amount of ether, you should test sending a small amount to your wallet first to ensure everything goes as planned. ',
HELP_4_Desc_2 : 'Navigate to the "Send Ether & Tokens" page. ',
HELP_4_Desc_3 : 'Select your wallet file -or- your private key and unlock your wallet. ',
HELP_4_Desc_4 : 'If the wallet is encrypted, a text box will automatically appear. Enter the password. ',
HELP_4_Desc_5 : 'Click the "Unlock Wallet" button. ',
HELP_4_Desc_6 : 'Enter the address you would like to send to in the "To Address:" field. ',
HELP_4_Desc_7 : 'Enter the amount you would like to send. You can also click the "Send Entire Balance" link if you would like the transfer the entire balance. ',
HELP_4_Desc_9 : 'Click "Generate Transaction". ',
HELP_4_Desc_10 : 'A couple more fields will appear. This is your browser generating the transaction. ',
HELP_4_Desc_11 : 'Click the blue "Send Transaction" button below that. ',
HELP_4_Desc_12 : 'A pop-up will appear. Verify that the amount and the address you are sending to are correct. Then click "Yes, I am sure! Make transaction." button. ',
HELP_4_Desc_13 : 'The transaction will be submitted. The TX Hash will display. You can click that TX Hash to see it on the blockchain. ',
HELP_4CX_Title : '4) How do I send Ether using MyEtherWallet CX? ',
HELP_4CX_Desc_1 : 'First, you need to add a wallet. Once you have done that, you have 2 options: the "QuickSend" functionality from the Chrome Extension icon or the "Send Ether & Tokens" page. ',
HELP_4CX_Desc_2 : 'QuickSend ',
HELP_4CX_Desc_3 : 'Click the Chrome Extension Icon. ',
HELP_4CX_Desc_4 : 'Click the "QuickSend" button. ',
HELP_4CX_Desc_5 : 'Select the wallet you wish to send from. ',
HELP_4CX_Desc_6 : 'Enter the address you would like to send to in the "To Address:" field. ',
HELP_4CX_Desc_7 : 'Enter the amount you would like to send. You can also click the "Send Entire Balance" link if you would like the transfer the entire balance. ',
HELP_4CX_Desc_8 : 'Click "Send Transaction". ',
HELP_4CX_Desc_9 : 'Verify the address and the amount you are sending is correct. ',
HELP_4CX_Desc_10 : 'Enter the password for that wallet. ',
HELP_4CX_Desc_11 : 'Click "Send Transaction." ',
HELP_4CX_Desc_12 : 'Using "Send Ether & Tokens" Page ',
HELP_5_Title : '5) How do I run MyEtherWallet.com offline/locally? ',
HELP_5_Desc_1 : 'You can run MyEtherWallet.com on your computer instead of from the GitHub servers. You can generate a wallet completely offline and send transactions from the "Offline Transaction" page. ',
HELP_5_Desc_7 : 'MyEtherWallet.com is now running entirely on your computer. ',
HELP_5_Desc_8 : 'In case you are not familiar, you need to keep the entire folder in order to run the website, not just `index.html`. Don\'t touch or move anything around in the folder. If you are storing a backup of the MyEtherWallet repo for the future, we recommend just storing the ZIP so you can be sure the folder contents stay intact. ',
HELP_5_Desc_9 : 'As we are constantly updating MyEtherWallet.com, we recommend you periodically update your saved version of the repo. ',
HELP_5CX_Title : '5) How can I install this extension from the repo instead of the Chrome Store? ',
HELP_5CX_Desc_2 : 'Click on `chrome-extension-vX.X.X.X.zip` and unzip it. ',
HELP_5CX_Desc_3 : 'Go to Google Chrome and find you settings (in the menu in the upper right). ',
HELP_5CX_Desc_4 : 'Click "Extensions" on the left. ',
HELP_5CX_Desc_5 : 'Check the "Developer Mode" button at the top of that page. ',
HELP_5CX_Desc_6 : 'Click the "Load unpacked extension..." button. ',
HELP_5CX_Desc_7 : 'Navigate to the now-unzipped folder that you downloaded earlier. Click "select". ',
HELP_5CX_Desc_8 : 'The extension should now show up in your extensions and in your Chrome Extension bar. ',
HELP_7_Title : '7) How do I send tokens & add custom tokens? ',
HELP_7_Desc_0 : '[Ethplorer.io](https://ethplorer.io/) is a great way to explore tokens and find the decimals of a token. ',
HELP_7_Desc_1 : 'Navigate to the "Send Ether & Tokens" page. ',
HELP_7_Desc_2 : 'Unlock your wallet. ',
HELP_7_Desc_3 : 'Enter the address you would like to send to in the "To Address:" field. ',
HELP_7_Desc_4 : 'Enter the amount you would like to send. ',
HELP_7_Desc_5 : 'Select which token you would like to send. ',
HELP_7_Desc_6 : 'If you do not see the token listed ',
HELP_7_Desc_7 : 'Click "Custom". ',
HELP_7_Desc_8 : 'Enter the address, name, and decimals of the token. These are provided by the developers of the token and are also needed when you "Add a Watch Token" to Mist. ',
HELP_7_Desc_9 : 'Click "Save". ',
HELP_7_Desc_10 : 'You can now send that token as well as see it\'s balance in the sidebar. ',
HELP_7_Desc_11 : 'Click "Generate Transaction". ',
HELP_7_Desc_12 : 'A couple more fields will appear. This is your browser generating the transaction. ',
HELP_7_Desc_13 : 'Click the blue "Send Transaction" button below that. ',
HELP_7_Desc_14 : 'A pop-up will appear. Verify that the amount and the address you are sending to are correct. Then click "Yes, I am sure! Make transaction." button. ',
HELP_7_Desc_15 : 'The transaction will be submitted. The TX Hash will display. You can click that TX Hash to see it on the blockchain. ',
HELP_8_Title : '8) What happens if your site goes down? ',
HELP_8_Desc_1 : 'MyEtherWallet is not a web wallet. You don\'t have a login and nothing ever gets saved to our servers. It is simply an interface that allows you interact with the blockchain. ',
HELP_8_Desc_2 : 'If MyEtherWallet.com goes down, you would have to find another way (like geth or Ethereum Wallet / Mist) to do what we are doing. But you wouldn\'t have to "get" your Ether out of MyEtherWallet because it\'s not in MyEtherWallet. It\'s in whatever wallet your generated via our site. ',
HELP_8_Desc_3 : 'You can import your unencrypted private key and your Geth/Mist Format (encrypted) files directly into geth / Ethereum Wallet / Mist very easily now. See question #12 below. ',
HELP_8_Desc_4 : 'In addition, the likelihood of us taking MyEtherWallet down is slim to none. It costs us almost nothing to maintain as we aren\'t storing any information. If we do take the domain down, it still is, and always will be, publicly available at [https://github.com/kvhnuke/etherwallet](https://github.com/kvhnuke/etherwallet/tree/gh-pages). You can download the ZIP there and run it locally. ',
HELP_8CX_Title : '8) What happens if MyEtherWallet CX disappears? ',
HELP_8CX_Desc_1 : 'First, all data is saved on your computer, not our servers. I know it can be confusing, but when you look at the Chrome Extension, you are NOT looking at stuff saved on our servers somewhere - it\'s all saved on your own computer. ',
HELP_8CX_Desc_2 : 'That said, it is **very important** that you back up all your information for any new wallets generated with MyEtherWallet CX. That way if anything happens to MyEtherWallet CX or your computer, you still have all the information necessary to access your Ether. See the #2a for how to back up your wallets. ',
HELP_8CX_Desc_3 : 'If for some reason MyEtherWallet CX disappears from the Chrome Store, you can find the source on Github and load it manually. See #5 above. ',
HELP_9_Title : '9) Is the "Send Ether & Tokens" page offline? ',
HELP_9_Desc_1 : 'No. It needs the internet in order to get the current gas price, nonce of your account, and broadcast the transaction (aka "send"). However, it only sends the signed transaction. Your private key safely stays with you. We also now provide an "Offline Transaction" page so that you can ensure your private keys are on an offline/airgapped computer at all times. ',
HELP_10_Title : '10) How do I make an offline transaction? ',
HELP_10_Desc_1 : 'Navigate to the "Offline Transaction" page via your online computer. ',
HELP_10_Desc_2 : 'Enter the "From Address". Please note, this is the address you are sending FROM, not TO. This generates the nonce and gas price. ',
HELP_10_Desc_3 : 'Move to your offline computer. Enter the "TO ADDRESS" and the "AMOUNT" you wish to send. ',
HELP_10_Desc_4 : 'Enter the "GAS PRICE" as it was displayed to you on your online computer in step #1. ',
HELP_10_Desc_5 : 'Enter the "NONCE" as it was displayed to you on your online computer in step #1. ',
HELP_10_Desc_6 : 'The "GAS LIMIT" has a default value of 21000. This will cover a standard transaction. If you are sending to a contract or are including additional data with your transaction, you will need to increase the gas limit. Any excess gas will be returned to you. ',
HELP_10_Desc_7 : 'If you wish, enter some data. If you enter data, you will need to include more than the 21000 default gas limit. All data is in HEX format. ',
HELP_10_Desc_8 : 'Select your wallet file -or- your private key and unlock your wallet. ',
HELP_10_Desc_9 : 'Press the "GENERATE SIGNED TRANSACTION" button. ',
HELP_10_Desc_10 : 'The data field below this button will populate with your signed transaction. Copy this and move it back to your online computer. ',
HELP_10_Desc_11 : 'On your online computer, paste the signed transaction into the text field in step #3 and click send. This will broadcast your transaction. ',
HELP_12_Title : '12) How do I import a wallet created with MyEtherWallet into geth / Ethereum Wallet / Mist? ',
HELP_12_Desc_1 : 'Using an Geth/Mist JSON file from MyEtherWallet v2+.... ',
HELP_12_Desc_2 : 'Go to the "View Wallet Info" page. ',
HELP_12_Desc_3 : 'Unlock your wallet using your **encrypted** private key or JSON file. ',
HELP_12_Desc_4 : 'Go to the "My Wallets" page. ',
HELP_12_Desc_5 : 'Select the wallet you want to import into Mist, click the "View" icon, enter your password, and access your wallet. ',
HELP_12_Desc_6 : 'Find the "Download JSON file - Geth/Mist Format (encrypted)" section. Press the "Download" button below that. You now have your keystore file. ',
HELP_12_Desc_7 : 'Open the Ethereum Wallet application. ',
HELP_12_Desc_8 : 'In the menu bar, go "Accounts" -> "Backup" -> "Accounts" ',
HELP_12_Desc_9 : 'This will open your keystore folder. Copy the file you just downloaded (`UTC--2016-04-14......../`) into that keystore folder. ',
HELP_12_Desc_10 : 'Your account should show up immediately under "Accounts." ',
HELP_12_Desc_11 : 'Using your unencrypted private key... ',
HELP_12_Desc_12 : 'If you do not already have your unencrypted private key, navigate to the "View Wallet Details" page. ',
HELP_12_Desc_13 : 'Select your wallet file -or- enter/paste your private key to unlock your wallet. ',
HELP_12_Desc_14 : 'Copy Your Private Key (unencrypted). ',
HELP_12_Desc_15 : 'If you are on a Mac ',
HELP_12_Desc_15b : 'If you are on a PC ',
HELP_12_Desc_16 : 'Open Text Edit and paste this private key. ',
HELP_12_Desc_17 : 'Go to the menu bar and click "Format" -> "Make Plain Text". ',
HELP_12_Desc_18 : 'Save this file to your `desktop/` as `nothing_special_delete_me.txt`. Make sure it says "UTF-8" and "If no extension is provided use .txt" in the save dialog. ',
HELP_12_Desc_19 : 'Open terminal and run the following command: `geth account import ~/Desktop/nothing_special_delete_me.txt` ',
HELP_12_Desc_20 : 'This will prompt you to make a new password. This is the password you will use in geth / Ethereum Wallet / Mist whenever you send a transaction, so don\'t forget it. ',
HELP_12_Desc_21 : 'After successful import, delete `nothing_special_delete_me.txt` ',
HELP_12_Desc_22 : 'The next time you open the Ethereum Wallet application, your account will be listed under "Accounts". ',
HELP_12_Desc_23 : 'Open Notepad & paste the private key ',
HELP_12_Desc_24 : 'Save the file as `nothing_special_delete_me.txt` at `C:` ',
HELP_12_Desc_25 : 'Run the command, `geth account import C:\\nothing_special_delete_me.txt` ',
HELP_12_Desc_26 : 'This will prompt you to make a new password. This is the password you will use in geth / Ethereum Wallet / Mist whenever you send a transaction, so don\'t forget it. ',
HELP_12_Desc_27 : 'After successful import, delete `nothing_special_delete_me.txt` ',
HELP_12_Desc_28 : 'The next time you open the Ethereum Wallet application, your account will be listed under "Accounts". ',
HELP_13_Title : '13) What does "Insufficient funds. Account you try to send transaction from does not have enough funds. Required XXXXXXXXXXXXXXXXXXX and got: XXXXXXXXXXXXXXXX." Mean? ',
HELP_13_Desc_1 : 'This means you do not have enough Ether in your account to cover the cost of gas. Each transaction (including token and contract transactions) require gas and that gas is paid in Ether. The number displayed is the amount required to cover the cost of the transaction in Wei. Take that number, divide by `2100000000000000000`, and subtract the amount of Ether you were trying to send (if you were attempting to send Ether). This will give you the amount of Ether you need to send to that account to make the transaction. ',
HELP_14_Title : '14) Some sites randomize (seed) the private key generation via mouse movements. MyEtherWallet.com doesn\'t do this. Is the random number generation for MyEtherWallet safe? ',
HELP_14_Desc_1 : 'While the mouse moving thing is clever and we understand why people like it, the reality is window.crypto ensures more entropy than your mouse movements. The mouse movements aren\'t unsafe, it\'s just that we (and tons of other crypto experiments) believe in window.crypto. In addition, MyEtherWallet.com can be used on touch devices. Here\'s a [conversation between an angry redditor and Vitalik Buterin regarding mouse movements v. window.crypto](https://www.reddit.com/r/ethereum/comments/2bilqg/note_there_is_a_paranoid_highsecurity_way_to/cj5sgrm) and here is the [the window.crypto w3 spec](https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-GlobalCrypto). ',
HELP_15_Title : '15) Why hasn\'t the account I just created show up in the blockchain explorer? (ie: etherchain, etherscan) ',
HELP_15_Desc_1 : 'Accounts will only show up in a blockchain explorer once the account has activity on it—for example, once you have transferred some Ether to it. ',
HELP_16_Title : '16) How do I check the balance of my account? ',
HELP_16_Desc_1 : 'You can use a blockchain explorer like [etherscan.io](https://etherscan.io/). Paste your address into the search bar and it will pull up your address and transaction history. For example, here\'s what our [donation account](https://etherscan.io/address/0xDECAF9CD2367cdbb726E904cD6397eDFcAe6068D) looks like on etherscan.io ',
HELP_17_Title : '17) Why isn\'t my balance showing up when I unlock my wallet? ',
HELP_17_Desc_1 : ' This is most likely due to the fact that you are behind a firewall. The API that we use to get the balance and convert said balance is often blocked by firewalls for whatever reason. You will still be able to send transactions, you just need to use a different method to see said balance, like etherscan.io ',
HELP_18_Title : '18) Where is my geth wallet file? ',
HELP_19_Title : '19) Where is my Mist wallet file? ',
HELP_19_Desc_1 : 'Mist files are typically found in the file locations above, but it\'s much easier to open Mist, select "Accounts" in the top bar, select "Backup", and select "Accounts". This will open the folder where your files are stored. ',
HELP_20_Title : '20) Where is my pre-sale wallet file? ',
HELP_20_Desc_1 : 'Wherever you saved it. ;) It also was emailed to you, so check there. Look for the file called `"ethereum_wallet_backup.json"` and select that file. This wallet file will be encrypted with a password that you created during the purchase of the pre-sale. ',
HELP_21_Title : '21) Couldn\'t everybody put in random private keys, look for a balance, and send to their own address? ',
HELP_21_Desc_1 : 'Short version: yes, but finding an account with a balance would take longer than the universe...so...no. ',
HELP_21_Desc_2 : 'Long ELI5 Version: So Ethereum is based on [Public Key Cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography), specifically [Elliptic curve cryptography](https://eprint.iacr.org/2013/734.pdf) which is very widely used, not just in Ethereum. Most servers are protected via ECC. Bitcoin uses the same, as well as SSH and TLS and a lot of other stuff. The Ethereum keys specifically are 256-bit keys, which are stronger than 128-bit and 192-bit, which are also widely used and still considered secure by experts. ',
HELP_21_Desc_3 : 'In this you have a private key and a public key. The private key can derive the public key, but the public key cannot be turned back into the private key. The fact that the internet and the world’s secrets are using this cryptography means that if there is a way to go from public key to private key, your lost ether is the least of everyone’s problems. ',
HELP_21_Desc_4 : 'Now, that said, YES if someone else has your private key then they can indeed send ether from your account. Just like if someone has your password to your email, they can read and send your email, or the password to your bank account, they could make transfers. You could download the Keystore version of your private key which is the private key that is encrypted with a password. This is like having a password that is also protected by another password. ',
HELP_21_Desc_5 : 'And YES, in theory you could just type in a string of 64 hexadecimal characters until you got one that matched. In fact, smart people could write a program to very quickly check random private keys. This is known as "brute-forcing" or "mining" private keys. People have thought about this long and hard. With a few very high end servers, they may be able to check 1M+ keys / second. However, even checking that many per second would not yield access to make the cost of running those servers even close to worthwhile - it is more likely you, and your great-grandchildren, will die before getting a match. ',
HELP_21_Desc_6 : 'If you know anything about Bitcoin, [this will put it in perspective:](http://bitcoin.stackexchange.com/questions/32331/two-people-with-same-public-address-how-will-people-network-know-how-to-deliver) *To illustrate how unlikely this is: suppose every satoshi of every bitcoin ever to be generated was sent to its own unique private keys. The probability that among those keys there could be two that would correspond to the same address is roughly one in 100 quintillion. ',
HELP_21_Desc_7 : '[If you want something a bit more technical:](http://security.stackexchange.com/questions/25375/why-not-use-larger-cipher-keys/25392#25392) *These numbers have nothing to do with the technology of the devices; they are the maximums that thermodynamics will allow. And they strongly imply that brute-force attacks against 256-bit keys will be infeasible until computers are built from something other than matter and occupy something other than space. ',
HELP_21_Desc_8 : 'Of course, this all assumes that keys are generated in a truly random way & with sufficient entropy. The keys generated here meet that criteria, as do Jaxx and Mist/geth. The Ethereum wallets are all pretty good. Keys generated by brainwallets do not, as a person\'s brain is not capable of creating a truly random seed. There have been a number of other issues regarding lack of entropy or seeds not being generated in a truly random way in Bitcoin-land, but that\'s a separate issue that can wait for another day. ',
HELP_SecCX_Title : 'Security - MyEtherWallet CX ',
HELP_SecCX_Desc_1 : 'Where is this extension saving my information? ',
HELP_SecCX_Desc_2 : 'The information you store in this Chrome Extension is saved via [chrome.storage](http://chrome.storage/). - this is the same place your passwords are saved when you save your password in Chrome. ',
HELP_SecCX_Desc_3 : 'What information is saved? ',
HELP_SecCX_Desc_4 : 'The address, nickname, private key is stored in chrome.storage. The private key is encrypted using the password you set when you added the wallet. The nickname and wallet address is not encrypted. ',
HELP_SecCX_Desc_5 : 'Why aren\'t the nickname and wallet address encrypted? ',
HELP_SecCX_Desc_6 : 'If we were to encrypt these items, you would need to enter a password each time you wanted to view your account balance or view the nicknames. If this concerns you, we recommend you use MyEtherWallet.com instead of this Chrome Extension. ',
HELP_Sec_Title : 'Security ',
HELP_Sec_Desc_1 : 'If one of your first questions is "Why should I trust these people?", that is a good thing. Hopefully the following will help ease your fears. ',
HELP_Sec_Desc_2 : 'We\'ve been up and running since August 2015. If you search for ["myetherwallet" on reddit](https://www.reddit.com/search?q=myetherwallet), you can see numerous people who use us with great success. ',
HELP_Sec_Desc_3 : 'We aren\'t going to take your money or steal your private key(s). There is no malicious code on this site. In fact the "GENERATE WALLET" pages are completely client-side. That means that all the code is executed on ** your computer** and it is never saved and transmitted anywhere. ',
HELP_Sec_Desc_4 : 'Check the URL -- This site is being served through GitHub and you can see the source code here: [https://github.com/kvhnuke/etherwallet/tree/gh-pages](https://github.com/kvhnuke/etherwallet/tree/gh-pages) to [https://www.myetherwallet.com](https://www.myetherwallet.com). ',
HELP_Sec_Desc_5 : 'For generating wallets, you can download the [source code and run it locally](https://github.com/kvhnuke/etherwallet/releases/latest). See #5 above. ',
HELP_Sec_Desc_6 : 'Generate a test wallet and check and see what network activity is happening. The easiest way for you to do this is to right click on the page and click "inspect element". Go to the "Network" tab. Generate a test wallet. You will see there is no network activity. You may see something happening that looks like data:image/gif and data:image/png. Those are the QR codes being generated...on your computer...by your computer. No bytes were transferred. ',
HELP_Sec_Desc_8 : 'If you do not feel comfortable using this tool, then by all means, do not use it. We created this tool as a helpful way for people to generate wallets and make transactions without needing to dive into command line or run a full node. Again, feel free to reach out if you have concerns and we will respond as quickly as possible. Thanks! ',
HELP_FAQ_Title : 'More Helpful Answers to Frequent Questions ',
HELP_Contact_Title : 'Ways to Get in Touch '
};
module.exports = sv;
|
const btnMobile = document.getElementById('btn-mobile');
function toggleMenu () {
const nav btnMobile = document.getElementById('nav');
nav.classList.toggle('active');
}
btnMobile.addEventListener('click' , toggleMenu);
|
import {Router} from 'aurelia-router';
import bootstrap from 'bootstrap';
export class App {
static inject() { return [Router]; }
constructor(router) {
this.router = router;
this.router.configure(config => {
config.title = 'MCharts';
config.map([
{ route: ['','calculated'], moduleId: 'calculated', nav: true },
{ route: 'graded', moduleId: 'graded', nav: true },
{ route: 'edit', moduleId: 'edit', nav: true }
]);
});
}
}
|
'use strict'
const Bunyan = require( 'bunyan' )
/**
* Instantiates a logger
* @class
*/
module.exports = class Logger extends Bunyan {
/**
* @constructs
* @param opts <Object> passed straight through to bunyan.Logger
*/
constructor( opts ) {
super( Object.assign({
name: 'koa'
}, opts || {} ))
}
/**
* Attaches the log instance to the koa instance
* @param opts <Object>
* @param as <String> append to context as this string
* @returns koa middleware function
*/
attach( opts ) {
opts = Object.assign({
as: 'logger'
}, opts || {} )
const logger = this
return async function( ctx, next ) {
if ( ctx[ opts.as ] ) {
console.warn( 'ctx.logger already exists' )
await next()
return
}
ctx[ opts.as ] = logger
await next()
}
}
/**
* Basic request log middleware
* @param opts <Object>
* @returns koa middleware function
*/
attachRequest( opts ) {
const logger = this
return async function( ctx, next ) {
let start = Date.now()
logger.info({
event: 'request',
method: ctx.method,
url: ctx.url
})
await next()
logger.info({
event: 'response',
method: ctx.method,
url: ctx.originalUrl,
status: ctx.status,
delta: Date.now() - start
})
}
}
}
|
import React, { useState, useEffect } from "react"
import { Flex, Text, Box } from "rebass"
import styled from "@emotion/styled"
import { useForm } from "react-hook-form"
import paymentProvidersMapper from "../../../utils/payment-providers-mapper"
import MultiSelect from "../../../components/multi-select"
import useMedusa from "../../../hooks/use-medusa"
import Input from "../../../components/input"
import Select from "../../../components/select"
import Card from "../../../components/card"
import Button from "../../../components/button"
import Spinner from "../../../components/spinner"
import TagDropdown from "../../../components/tag-dropdown"
import { countries as countryData } from "../../../utils/countries"
import Shipping from "./shipping"
import fulfillmentProvidersMapper from "../../../utils/fulfillment-providers.mapper"
const Regions = ({ id }) => {
const [currencies, setCurrencies] = useState([])
const [countries, setCountries] = useState([])
const [paymentOptions, setPaymentOptions] = useState([])
const [paymentProviders, setPaymentProviders] = useState([])
const [fulfillmentOptions, setFulfillmentOptions] = useState([])
const [fulfillmentProviders, setFulfillmentProviders] = useState([])
const { store, isLoading: storeIsLoading } = useMedusa("store")
const {
region,
isLoading,
fulfillmentOptions: fulfillmentEndpoint,
update,
toaster,
} = useMedusa("regions", { id })
const { register, reset, setValue, handleSubmit } = useForm()
useEffect(() => {
if (storeIsLoading) return
if (store.currencies && region) {
setCurrencies(getCurrencies(store.currencies))
}
}, [store, region, storeIsLoading])
useEffect(() => {
if (storeIsLoading) return
setPaymentOptions(
store.payment_providers.map(c => paymentProvidersMapper(c.id))
)
setFulfillmentOptions(
store.fulfillment_providers.map(c => fulfillmentProvidersMapper(c.id))
)
}, [store, storeIsLoading])
useEffect(() => {
if (isLoading) return
reset({ ...region, tax_rate: region.tax_rate / 100 })
register({ name: "countries" })
register({ name: "payment_providers" })
register({ name: "fulfillment_providers" })
setValue(
"countries",
region.countries.map(c => c.iso_2)
)
setCountries(
region.countries.map(c => ({ value: c.iso_2, label: c.display_name }))
)
setValue(
"payment_providers",
region.payment_providers.map(v => v.id)
)
setPaymentProviders(region.payment_providers.map(v => ({ value: v.id })))
setValue(
"fulfillment_providers",
region.fulfillment_providers.map(v => v.id)
)
setFulfillmentProviders(
region.fulfillment_providers.map(v => ({ value: v.id }))
)
}, [region, isLoading])
const getCurrencies = storeCurrencies => {
let currs = storeCurrencies
.filter(item => item.code !== region.currency_code)
.map(el => el.code)
currs.unshift(region.currency_code)
return (
currs.map(c => ({
value: c,
label: c.toUpperCase(),
})) || []
)
}
const handlePaymentChange = values => {
const providers = values.map(v => ({ value: v.value }))
setPaymentProviders(providers)
setValue(
"payment_providers",
values.map(v => v.value)
)
}
const handleFulfillmentChange = values => {
const providers = values.map(v => ({ value: v.value }))
setFulfillmentProviders(providers)
setValue(
"fulfillment_providers",
values.map(v => v.value)
)
}
const handleChange = values => {
setCountries(values)
setValue(
"countries",
values.map(c => c.value)
)
}
const onSave = async data => {
try {
await update({ ...data, tax_rate: data.tax_rate * 100 })
toaster("Successfully updated region", "success")
} catch (error) {
toaster("Failed to update region", "error")
}
}
const countryOptions = countryData.map(c => ({
label: c.name,
value: c.alpha2.toLowerCase(),
}))
if (isLoading || !currencies.length) {
return (
<Flex flexDirection="column" alignItems="center" height="100vh" mt="auto">
<Box height="75px" width="75px" mt="50%">
<Spinner dark />
</Box>
</Flex>
)
}
return (
<Flex flexDirection="column" py={5} mb={5}>
<Card as="form" mb={3} onSubmit={handleSubmit(onSave)}>
<Card.Header>Region Details</Card.Header>
<Card.Body flexDirection="column">
{isLoading || storeIsLoading ? (
<Flex
flexDirection="column"
alignItems="center"
height="100vh"
mt="auto"
>
<Box height="75px" width="75px" mt="50%">
<Spinner dark />
</Box>
</Flex>
) : (
<Box width={1 / 2} ml={3}>
<Input
start={true}
inline
mb={3}
name="name"
label="Name"
ref={register}
/>
<Select
start={true}
inline
mb={3}
label="Currency"
name="currency_code"
options={currencies}
ref={register}
/>
<Input
start={true}
inline
mb={3}
type="number"
placeholder="0.25"
step="0.01"
min={0}
max={1}
name="tax_rate"
label="Tax Rate"
ref={register}
/>
<Input
start={true}
inline
mb={3}
placeholder="1000"
name="tax_code"
label="Tax Code"
ref={register}
/>
<MultiSelect
inline
start={true}
mb={3}
label="Countries"
selectOptions={{ hasSelectAll: false }}
options={countryOptions}
value={countries}
onChange={handleChange}
/>
{!!paymentOptions.length && (
<TagDropdown
inline
start={true}
mb={3}
label={"Payment Providers"}
toggleText="Select"
values={paymentProviders}
onChange={handlePaymentChange}
options={paymentOptions}
optionRender={o => <span>{o.label}</span>}
valueRender={o => <span>{o.value}</span>}
/>
)}
{!!fulfillmentOptions.length && (
<TagDropdown
inline
start={true}
mb={3}
label={"Fulfillment Providers"}
toggleText="Select"
values={fulfillmentProviders}
onChange={handleFulfillmentChange}
options={fulfillmentOptions}
optionRender={o => <span>{o.label}</span>}
valueRender={o => <span>{o.value}</span>}
/>
)}
</Box>
)}
</Card.Body>
<Card.Footer px={3} justifyContent="flex-end">
<Button type="submit" variant="primary" variant="cta">
Save
</Button>
</Card.Footer>
</Card>
{!isLoading && (
<Shipping region={region} fulfillmentMethods={fulfillmentEndpoint} />
)}
</Flex>
)
}
export default Regions
|
import React from 'react';
import {render} from 'react-dom';
import DeckGL from '@deck.gl/react';
import {MapView} from '@deck.gl/core';
import {TileLayer} from '@deck.gl/geo-layers';
import {BitmapLayer, PathLayer} from '@deck.gl/layers';
const INITIAL_VIEW_STATE = {
latitude: 47.65,
longitude: 7,
zoom: 4.5,
maxZoom: 20,
maxPitch: 89,
bearing: 0
};
/* global window */
const devicePixelRatio = (typeof window !== 'undefined' && window.devicePixelRatio) || 1;
function getTooltip({tile}) {
return tile && `tile: x: ${tile.x}, y: ${tile.y}, z: ${tile.z}`;
}
export default function App({showBorder = false, onTilesLoad = null}) {
const tileLayer = new TileLayer({
// https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Tile_servers
data: [
'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png',
'https://b.tile.openstreetmap.org/{z}/{x}/{y}.png',
'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png'
],
pickable: true,
onViewportLoad: onTilesLoad,
autoHighlight: showBorder,
highlightColor: [60, 60, 60, 40],
// https://wiki.openstreetmap.org/wiki/Zoom_levels
minZoom: 0,
maxZoom: 19,
tileSize: 512 / devicePixelRatio,
renderSubLayers: props => {
const {
bbox: {west, south, east, north}
} = props.tile;
return [
new BitmapLayer(props, {
data: null,
image: props.data,
bounds: [west, south, east, north]
}),
showBorder &&
new PathLayer({
id: `${props.id}-border`,
data: [[[west, north], [west, south], [east, south], [east, north], [west, north]]],
getPath: d => d,
getColor: [255, 0, 0],
widthMinPixels: 4
})
];
}
});
return (
<DeckGL
layers={[tileLayer]}
views={new MapView({repeat: true})}
initialViewState={INITIAL_VIEW_STATE}
controller={true}
getTooltip={getTooltip}
/>
);
}
export function renderToDOM(container) {
render(<App />, container);
}
|
/**
* o------------------------------------------------------------------------------o
* | This file is part of the RGraph package - you can learn more at: |
* | |
* | http://www.rgraph.net |
* | |
* | This package is licensed under the RGraph license. For all kinds of business |
* | purposes there is a small one-time licensing fee to pay and for non |
* | commercial purposes it is free to use. You can read the full license here: |
* | |
* | http://www.rgraph.net/LICENSE.txt |
* o------------------------------------------------------------------------------o
*/
if (typeof(RGraph) == 'undefined') RGraph = {isRGraph:true,type:'common'};
/**
* This installs some event handlers
*
* Checking the RGraph.Annotate flag means the annotate code only runs once
*/
RGraph.Annotating_canvas_onmousedown = function (e)
{
if (e.button == 0) {
e.target.__object__.Set('chart.mousedown', true);
// Get the object from the canvas. Annotating must be enabled on the
// last object defined
var obj = e.target.__object__;
// This staarts the annotating "path" and set the color
obj.context.beginPath();
obj.context.strokeStyle = obj.Get('chart.annotate.color');
obj.context.lineWidth = 1;
var mouseXY = RGraph.getMouseXY(e);
var mouseX = mouseXY[0];
var mouseY = mouseXY[1];
// Clear the annotation recording
RGraph.Registry.Set('annotate.actions', [obj.Get('chart.annotate.color')]);
// This sets the initial X/Y position
obj.context.moveTo(mouseX, mouseY);
RGraph.Registry.Set('started.annotating', false);
RGraph.Registry.Set('chart.annotating', obj);
// Fire the onannotatebegin event.
RGraph.FireCustomEvent(obj, 'onannotatebegin');
}
return false;
}
/**
* This cancels annotating for ALL canvases
*/
RGraph.Annotating_window_onmouseup = function (e)
{
var obj = RGraph.Registry.Get('chart.annotating');
if (e.button != 0 || !obj) {
return;
}
// This cancels annotating on ALL canvas tags on the page
var tags = document.getElementsByTagName('canvas');
for (var i=0; i<tags.length; ++i) {
if (tags[i].__object__) {
tags[i].__object__.Set('chart.mousedown', false);
}
}
// Store the annotations in browser storage if it's available
if (RGraph.Registry.Get('annotate.actions') && RGraph.Registry.Get('annotate.actions').length > 0 && window.localStorage) {
var id = '__rgraph_annotations_' + e.target.id + '__';
var annotations = window.localStorage[id] ? window.localStorage[id] + '|' : '';
annotations += RGraph.Registry.Get('annotate.actions');
// Store the annotations information in HTML5 browser storage here
window.localStorage[id] = annotations;
}
// Clear the recorded annotations
RGraph.Registry.Set('annotate.actions', []);
// Fire the annotate event
RGraph.FireCustomEvent(obj, 'onannotateend');
}
/**
* The canvas onmousemove function
*/
RGraph.Annotating_canvas_onmousemove = function (e)
{
var e = RGraph.FixEventObject(e);
var obj = e.target.__object__;
var mouseXY = RGraph.getMouseXY(e);
var mouseX = mouseXY[0];
var mouseY = mouseXY[1];
if (obj.Get('chart.mousedown')) {
obj.context.lineTo(mouseX, mouseY);
RGraph.Registry.Set('annotate.actions', RGraph.Registry.Get('annotate.actions') + '|' + mouseX + ',' + mouseY);
RGraph.FireCustomEvent(obj, 'onannotate');
obj.context.stroke();
}
}
/**
* Shows the mini palette used for annotations
*
* @param object e The event object
*/
RGraph.Showpalette = function (e)
{
var isSafari = navigator.userAgent.indexOf('Safari') ? true : false;
e = RGraph.FixEventObject(e);
var canvas = e.target.parentNode.__canvas__;
var context = canvas.getContext('2d');
var obj = canvas.__object__;
var div = document.createElement('DIV');
var coords = RGraph.getMouseXY(e);
div.__object__ = obj; // The graph object
div.className = 'RGraph_palette';
div.style.position = 'absolute';
div.style.backgroundColor = 'white';
div.style.border = '1px solid black';
div.style.left = 0;
div.style.top = 0;
div.style.padding = '3px';
div.style.paddingBottom = 0;
div.style.paddingRight = 0;
div.style.opacity = 0;
div.style.boxShadow = 'rgba(96,96,96,0.5) 3px 3px 3px';
div.style.WebkitBoxShadow = 'rgba(96,96,96,0.5) 3px 3px 3px';
div.style.MozBoxShadow = 'rgba(96,96,96,0.5) 3px 3px 3px';
div.style.filter = 'progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=135)';
var common_css = 'padding: 1px; display: inline; display: inline-block; width: 15px; height: 15px; margin-right: 3px; cursor: pointer;' + (isSafari ? 'margin-bottom: 3px' : '');
var common_mouseover = ' onmouseover="this.style.border = \'1px black solid\'; this.style.padding = 0"';
var common_mouseout = ' onmouseout="this.style.border = 0; this.style.padding = \'1px\'" ';
var str = '';
var colors = ['red', 'blue', 'green', 'black', 'yellow', 'magenta', 'pink', 'cyan', 'purple', '#ddf', 'gray', '#36905c'];
for (i=0; i<colors.length; ++i) {
str = str + '<span ' + common_mouseover + common_mouseout + ' style="background-color: ' + colors[i] + '; ' + common_css + '" onclick="this.parentNode.__object__.Set(\'chart.annotate.color\', this.style.backgroundColor); this.parentNode.style.display = \'none\'; RGraph.FireCustomEvent(this.parentNode.__object__, \'onannotatecolor\')"> </span>';
// This makes the colours go across two levels
if (i == 5) {
str += '<br />';
}
}
div.innerHTML = str;
document.body.appendChild(div);
/**
* Now the div has been added to the document, move it up and left and set the width and height
*/
div.style.width = (div.offsetWidth) + 'px';
div.style.height = (div.offsetHeight - (RGraph.isIE9up() ? 5 : 5)) + 'px';
div.style.left = Math.max(0, e.pageX - div.offsetWidth - 2) + 'px';
div.style.top = (e.pageY - div.offsetHeight - 2) + 'px';
/**
* Store the palette div in the registry
*/
RGraph.Registry.Set('palette', div);
setTimeout("RGraph.Registry.Get('palette').style.opacity = 0.2", 50);
setTimeout("RGraph.Registry.Get('palette').style.opacity = 0.4", 100);
setTimeout("RGraph.Registry.Get('palette').style.opacity = 0.6", 150);
setTimeout("RGraph.Registry.Get('palette').style.opacity = 0.8", 200);
setTimeout("RGraph.Registry.Get('palette').style.opacity = 1", 250);
RGraph.HideContext();
window.onclick = function ()
{
RGraph.HidePalette();
}
// Should this be here? Yes. This function is being used as an event handler.
e.stopPropagation();
return false;
}
/**
* Clears any annotation data from global storage
*
* @param object canvas The canvas tag object
*/
RGraph.ClearAnnotations = function (canvas)
{
/**
* For BC the argument can also be the ID of the canvas
*/
if (typeof(canvas) == 'string') {
var id = canvas;
canvas = document.getElementById(id);
} else {
var id = canvas.id
}
var obj = canvas.__object__;
if (window.localStorage && window.localStorage['__rgraph_annotations_' + id + '__'] && window.localStorage['__rgraph_annotations_' + id + '__'].length) {
window.localStorage['__rgraph_annotations_' + id + '__'] = [];
RGraph.FireCustomEvent(obj, 'onannotateclear');
}
}
/**
* Replays stored annotations
*
* @param object obj The graph object
*/
RGraph.ReplayAnnotations = function (obj)
{
// Check for support
if (!window.localStorage) {
return;
}
var context = obj.context;
var annotations = window.localStorage['__rgraph_annotations_' + obj.id + '__'];
var i, len, move, coords;
context.beginPath();
context.lineWidth = 2;
if (annotations && annotations.length) {
annotations = annotations.split('|');
} else {
return;
}
for (i=0, len=annotations.length; i<len; ++i) {
if (!annotations[i].match(/^[0-9]+,[0-9]+$/)) {
context.stroke();
context.beginPath();
context.strokeStyle = annotations[i];
move = true;
continue;
}
coords = annotations[i].split(',');
if (move) {
context.moveTo(coords[0], coords[1]);
move = false;
} else {
context.lineTo(coords[0], coords[1]);
}
}
context.stroke();
}
window.addEventListener('load', function (e)
{
// This delay is necessary to allow the window.onload event listener to run
setTimeout(function ()
{
var tags = document.getElementsByTagName('canvas');
for (var i=0; i<tags.length; ++i) {
if (tags[i].__object__ && tags[i].__object__.isRGraph && tags[i].__object__.Get('chart.annotatable')) {
RGraph.ReplayAnnotations(tags[i].__object__);
}
}
}, 100); // This delay is sufficient to wait before replaying the annotations
}, false);
|
/*
Club Finder
- This uses Cheerio.js and NightmareJS to search against the Drexel CampusLabs website
for club information and photo.
*/
const cheerio = require("cheerio");
const puppeteer = require("puppeteer");
exports.run = (discord, client, db, message, args, discord_email, code_email_temp, code_discord_temp) => {
if (message.channel.id === process.env.CLUB_CHANNEL_ID) {
const query = args[0] + "%20" + args[1] + "%20";
message.channel.send("Fetching...").then(msg => {
msg.delete(5000);
});
async () => {
const browser = await puppeteer.launch({
args: ["--no-sandbox"]
});
const page = await browser.newPage();
await page.goto(
process.env.CAMPUSLABS_URL + "/engage/organizations?query=" + query
);
/*
const nightmare = Nightmare({ show: false, waitTimeout: 10000 });
nightmare
.goto(config.CAMPUSLABS_URL + "/engage/organizations?query=" + query)
.wait("#org-search-results")
.evaluate(() => document.querySelector("#org-search-results").innerHTML)
.end()
.then(response => {
console.log(getData(response));
})
.catch(err => {
console.log(err);
});
*/
const html = await page.$eval("#org-search-results", e => e.innerHTML);
let data = [];
const $ = cheerio.load(html);
$("div > div > div > a").each((i, elem) => {
data.push({
link: $(elem).attr("href"),
image: $(elem)
.find("div > div > div > span > div > div > img")
.attr("src"),
name: $(elem)
.find("div > div > div > span > div > div > div")
.text(),
alt: $(elem)
.find("div > div > div > span > div > div > p")
.text()
});
});
for (let i = 0; i < 3; i++) {
const clubEmbed = new discord.RichEmbed()
.setColor("0099ff")
.setTitle(data[i].name)
.setURL(process.env.CAMPUSLABS_URL + data[i].link)
.setDescription(data[i].alt)
.setImage(data[i].image)
.setTimestamp();
message.channel.send(clubEmbed);
}
await browser.close();
};
}
};
|
webpackHotUpdate(0,{
/***/ "./src/Posters/Posters.js":
/*!********************************!*\
!*** ./src/Posters/Posters.js ***!
\********************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, __webpack_exports__) {
"use strict";
throw new Error("Module build failed: SyntaxError: C:/StarterProject/MoviePosterArena/StarterProject/MovieArtArena.Web/app/public/src/Posters/Posters.js: Unexpected token (35:16)\n\n\u001b[0m \u001b[90m 33 | \u001b[39m {props\u001b[33m.\u001b[39mmovies\u001b[33m.\u001b[39mmap((movie) \u001b[33m=>\u001b[39m \n \u001b[90m 34 | \u001b[39m \n\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 35 | \u001b[39m )} \n \u001b[90m | \u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\n \u001b[90m 36 | \u001b[39m \u001b[33m<\u001b[39m\u001b[33m/\u001b[39m\u001b[33mdiv\u001b[39m\u001b[33m>\u001b[39m\n \u001b[90m 37 | \u001b[39m )\u001b[33m;\u001b[39m\n \u001b[90m 38 | \u001b[39m}\u001b[0m\n");
/***/ })
})
//# sourceMappingURL=0.ebb7b90204e69c9e5cf9.hot-update.js.map
|
/* http://keith-wood.name/localisation.html
Localisation assistance for jQuery v1.0.4.
Written by Keith Wood (kbwood{at}iinet.com.au) June 2007.
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
Please attribute the author if you use it. */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.m=7(c,d,e,f,g){4(8 d!=\'E\'&&8 d!=\'r\'){g=f;f=e;e=d;d=\'\'}4(8 e!=\'F\'){g=f;f=e;e=x}4(8 f!=\'r\'&&!n(f)){g=f;f=[\'\',\'\']}o h={s:$.y.s,9:$.y.9};d=(8 d!=\'r\'?d||{}:{t:d,z:e,6:f,9:g});o j=(!d.6?[\'\',\'\']:(n(d.6)?d.6:[d.6,d.6]));$.A({s:x,9:(d.9||G)});o k=7(a,b){4(d.z){$.u(j[0]+a+\'.v\')}4(b.p>=2){$.u(j[1]+a+\'-\'+b.q(0,2)+\'.v\')}4(b.p>=5){$.u(j[1]+a+\'-\'+b.q(0,5)+\'.v\')}};o l=w(d.t||$.m.B);c=(n(c)?c:[c]);H(i=0;i<c.p;i++){k(c[i],l)}$.A(h)};$.I=$.m;$.m.B=w(C.t||C.J);7 w(a){a=a.K(/L/,\'-\').M();4(a.p>3){a=a.q(0,3)+a.q(3).N()}D a}7 n(a){D(a&&a.O==P)}})(Q);',53,53,'||||if||path|function|typeof|timeout|||||||||||||localise|isArray|var|length|substring|string|async|language|getScript|js|normaliseLang|false|ajaxSettings|loadBase|ajaxSetup|defaultLanguage|navigator|return|object|boolean|500|for|localize|userLanguage|replace|_|toLowerCase|toUpperCase|constructor|Array|jQuery'.split('|'),0,{}))
|
/**
* SEO component that queries for data with
* Gatsby's useStaticQuery React hook
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from "react";
import PropTypes from "prop-types";
import Helmet from "react-helmet";
import { useStaticQuery, graphql } from "gatsby";
function SEO({ description, lang, meta, title }) {
const { site } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
title
description
author
}
}
}
`
);
const metaDescription = description || site.siteMetadata.description;
return (
<Helmet
htmlAttributes={{
lang,
}}
title={title}
titleTemplate={` ${site.siteMetadata.title} | %s `}
meta={[
{
name: `description`,
content: metaDescription,
},
{
property: `og:title`,
content: title,
},
{
property: `og:description`,
content: metaDescription,
},
{
property: `og:type`,
content: `website`,
},
{
name: `twitter:card`,
content: `summary`,
},
{
name: `twitter:creator`,
content: site.siteMetadata.author,
},
{
name: `twitter:title`,
content: title,
},
{
name: `twitter:description`,
content: metaDescription,
},
].concat(meta)}
/>
);
}
SEO.defaultProps = {
lang: `en`,
meta: [],
description: ``,
};
SEO.propTypes = {
description: PropTypes.string,
lang: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
title: PropTypes.string.isRequired,
};
export default SEO;
|
const data = [
{
user: 'tom',
score: 31,
},
{
user: 'bra',
score: 30,
},
{
user: 'joe',
score: 27,
},
{
user: 'gra',
score: 24,
},
{
user: 'but',
score: 21,
},
{
user: 'bom',
score: 19,
},
{
user: 'age',
score: 16,
},
{
user: 'ruf',
score: 10,
},
{
user: 'ni',
score: 5,
},
];
export default data;
|
import {createRouter, createWebHashHistory} from 'vue-router'
import {defineAsyncComponent} from 'vue'
const Home = {template: '<p>Home</p>'}
const router = createRouter({
history: createWebHashHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory
routes: [
{
path: '/',
redirect: '/introduce'
},
{
path: '/login',
name: 'login',
component: defineAsyncComponent(() => import("router-remote/Login"))
},
{
path: '/shopping',
name: 'shopping',
component: () => import(/* webpackChunkName: "shopping" */ '../views/Shopping.vue')
}
,
{
path: '/account',
name: 'account',
component: () => import(/* webpackChunkName: "account" */ '../views/Account.vue')
}
]
})
export default router
|
import { defaultAction } from '../actions';
import { DEFAULT_ACTION } from '../constants';
describe('DocumentTypeFields actions', () => {
describe('Default Action', () => {
it('has a type of DEFAULT_ACTION', () => {
const expected = {
type: DEFAULT_ACTION,
};
expect(defaultAction()).toEqual(expected);
});
});
});
|
/**
* Use this file to configure your truffle project. It's seeded with some
* common settings for different networks and features like migrations,
* compilation and testing. Uncomment the ones you need or modify
* them to suit your project as necessary.
*
* More information about configuration can be found at:
*
* truffleframework.com/docs/advanced/configuration
*
* To deploy via Infura you'll need a wallet provider (like @truffle/hdwallet-provider)
* to sign your transactions before they're sent to a remote public node. Infura accounts
* are available for free at: infura.io/register.
*
* You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
* public/private key pairs. If you're publishing your code to GitHub make sure you load this
* phrase from a file you've .gitignored so it doesn't accidentally become public.
*
*/
// const HDWalletProvider = require('@truffle/hdwallet-provider');
// const infuraKey = "fj4jll3k.....";
//
// const fs = require('fs');
// const mnemonic = fs.readFileSync(".secret").toString().trim();
module.exports = {
/**
* Networks define how you connect to your ethereum client and let you set the
* defaults web3 uses to send transactions. If you don't specify one truffle
* will spin up a development blockchain for you on port 9545 when you
* run `develop` or `test`. You can ask a truffle command to use a specific
* network from the command line, e.g
*
* $ truffle test --network <network-name>
*/
networks: {
// Useful for testing. The `development` name is special - truffle uses it by default
// if it's defined here and no other network is specified at the command line.
// You should run a client (like ganache-cli, geth or parity) in a separate terminal
// tab if you use this network and you must also set the `host`, `port` and `network_id`
// options below to some value.
//
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "5474343", // Any network (default: none)
},
// Another network with more advanced options...
// advanced: {
// port: 8777, // Custom port
// network_id: 1342, // Custom network
// gas: 8500000, // Gas sent with each transaction (default: ~6700000)
// gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
// from: <address>, // Account to send txs from (default: accounts[0])
// websockets: true // Enable EventEmitter interface for web3 (default: false)
// },
// Useful for deploying to a public network.
// NB: It's important to wrap the provider as a function.
// ropsten: {
// provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
// network_id: 3, // Ropsten's id
// gas: 5500000, // Ropsten has a lower block limit than mainnet
// confirmations: 2, // # of confs to wait between deployments. (default: 0)
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
// skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
// },
// Useful for private networks
// private: {
// provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
// network_id: 2111, // This network is yours, in the cloud.
// production: true // Treats this network as if it was a public net. (default: false)
// }
},
// Set default mocha options here, use special reporters etc.
mocha: {
// timeout: 100000
},
// Configure your compilers
compilers: {
solc: {
// version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 200
},
// evmVersion: "byzantium"
}
}
}
}
|
// 近似相等
const approximatelyEqual = (v1, v2, epsilon = 0.001) =>
Math.abs(v1 - v2) < epsilon
// 生成 和 设置 transform
function trans(el, transObj) {
if (!arguments.length) return
if (!transObj) {
let style = getComputedStyle(el)
let t = style.transform
if (t === 'none') {
return {
translate: [0, 0],
rotate: 0,
scale: [1, 1],
skewX: 0,
}
} else {
return matrix2transform(trans2matrix(t))
}
} else {
if (transObj && typeof transObj === 'object') {
if (el instanceof HTMLElement) {
el.style.transform = trans2string(transObj)
} else if (el instanceof SVGElement) {
el.setAttribute('transform', trans2string(transObj, 'svg'))
}
}
}
function trans2matrix(tran) {
let arr = tran.slice(7, -1).split(',')
return {
a: parseFloat(arr[0]),
b: parseFloat(arr[1]),
c: parseFloat(arr[2]),
d: parseFloat(arr[3]),
e: parseFloat(arr[4]),
f: parseFloat(arr[5]),
}
}
// 求点积
function transDot(a, b) {
return a[0] * b[0] + a[1] * b[1]
}
// normalize 化
function transNormalize(a) {
let k = Math.sqrt(transDot(a, a))
a[0] /= k
a[1] /= k
return k
}
function transCombine(a, b, k) {
a[0] += k * b[0]
a[1] += k * b[1]
return a
}
function matrix2transform(m) {
const degrees = 180 / Math.PI
let r0 = [m.a, m.b],
r1 = [m.c, m.d],
kx = transNormalize(r0)
kz = transDot(r0, r1)
ky = transNormalize(transCombine(r1, r0, -kz))
return {
translate: [m.e, m.f],
rotate: Math.atan2(m.b, m.a) * degrees,
scale: [kx, ky],
skewX: (kz / ky) * degrees,
}
}
function trans2string(transObj, type) {
let transform = ''
if (type === 'svg') {
// 不带 单位
for (let k in transObj) {
if (k === 'translate') {
transform += `translate(${
transObj[k][0] === 0 ? 0 : transObj[k][0]
},${transObj[k][1] === 0 ? 0 : transObj[k][1]}) `
} else if (k === 'rotate' || k === 'skewX') {
transform += `${k}(${transObj[k]}) `
} else if (k === 'scale') {
transform += `${k}(${transObj[k]}) `
}
}
} else {
for (let k in transObj) {
if (k === 'translate') {
transform += `translate(${
transObj[k][0] === 0 ? 0 : transObj[k][0] + 'px'
},${transObj[k][1] === 0 ? 0 : transObj[k][1] + 'px'}) `
} else if (k === 'rotate' || k === 'skewX') {
transform += `${k}(${transObj[k]}deg) `
} else if (k === 'scale') {
transform += `${k}(${transObj[k]}) `
}
}
}
return transform.trim()
}
}
// 创建 dom
function createDom({
styles,
className,
id,
text,
html,
tagName = 'div',
parent,
attrs,
} = {}) {
const el = document.createElement(tagName)
if (isString(id)) el.id = id
// className 方式是 'abc bc cc'
if (isString(className)) el.className = className
// styles格式,就是css的写法格式
// width:100px;height:100px;position:absolute;
if (isString(styles)) el.style.cssText = styles
if (isString(text)) el.innerText = text
if (isString(html)) el.innerHTML = html
if (isObject(attrs)) {
for (let attr in attrs) {
el.setAttribute(attr, attrs[attr])
}
}
if (isElement(parent)) parent.appendChild(el)
return el
}
// 判断函数
function isElement(el) {
return el && /Element$/.test(Object.prototype.toString.call(el).slice(8, -1))
}
function isString(str) {
return str && typeof str === 'string'
}
function isObject(obj) {
return Object.prototype.toString.call(obj).slice(8, -1) === 'Object'
}
// 这里我们不收集 body, html , Window , 因为这三个对于我们没啥用
function getElPath(el) {
let arr = [el]
while (el.parentElement && el !== document.body) {
arr.push(el)
el = parentElement
}
return arr
}
// 从 parent 中找符合要求的 元素 , 没有就返回 false
function findTargetFromParent(target, condition) {
while (target !== document.body) {
if (condition(target)) {
return target
}
target = target.parentElement
}
return false
}
// solo
function soleElement({ elements, condition, matchfn, unMatchfn }) {
for (let i = 0, l = elements.length; i < l; i++) {
let el = elements[i]
if (condition(el)) {
console.log('matched', el)
matchfn(el)
} else {
console.log('unmatched', el)
unMatchfn(el)
}
}
}
// muti
function mutiElement(elements, condition, matchfn) {
for (let i = 0, l = elements.length; i < l; i++) {
let el = elements[i]
if (condition(el)) {
matchfn(el)
}
}
}
// cancel select
function onOff(flag) {
// 设置初始状态
return function (onfn, offfn) {
// 开关的状态设置为 关
// 后续效果就是 关灯效果 , off
flag = !flag
if (flag) {
offfn()
} else {
onfn()
}
}
}
function dragInRange(rect, range) {
let { x, y, width, height } = rect
let lx, ly
if (x < range.x) {
lx = range.x
} else if (x + width > range.x + range.width) {
lx = range.x + range.width - width
} else {
lx = x
}
if (y < range.y) {
ly = range.y
} else if (y + height > range.y + range.height) {
ly = range.y + range.height - height
} else {
ly = y
}
return [lx, ly]
}
// 我们知道nodelist 没法使用 forEach ,我们就自己写一个 forEach 吧
function forEach(nodelist, fn) {
if (nodelist.length) {
for (let i = 0, l = nodelist.length; i < l; i++) {
fn(nodelist[i], i)
}
}
}
|
/**
* Copyright 2015 Telerik AD
*
* 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.
*/
!function(e,define){define([],e)}(function(){return function(e){var t=e.kendo||(e.kendo={cultures:{}});t.cultures["se-FI"]={name:"se-FI",numberFormat:{pattern:["-n"],decimals:2,",":" ",".":",",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":" ",".":",",groupSize:[3],symbol:"%"},currency:{pattern:["-n $","n $"],decimals:2,",":" ",".":",",groupSize:[3],symbol:"€"}},calendars:{standard:{days:{names:["sotnabeaivi","vuossárga","maŋŋebárga","gaskavahkku","duorastat","bearjadat","lávvardat"],namesAbbr:["sotn","vuos","maŋ","gask","duor","bear","láv"],namesShort:["s","v","m","g","d","b","l"]},months:{names:["ođđajagemánu","guovvamánnu","njukčamánnu","cuoŋománnu","miessemánnu","geassemánnu","suoidnemánnu","borgemánnu","čakčamánnu","golggotmánnu","skábmamánnu","juovlamánnu"],namesAbbr:["ođđj","guov","njuk","cuoŋ","mies","geas","suoi","borg","čakč","golg","skáb","juov"]},AM:[""],PM:[""],patterns:{d:"d.M.yyyy",D:"dddd', 'MMMM d'. b. 'yyyy",F:"dddd', 'MMMM d'. b. 'yyyy H:mm:ss",g:"d.M.yyyy H:mm",G:"d.M.yyyy H:mm:ss",m:"MMMM d'. b.'",M:"MMMM d'. b.'",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"H:mm",T:"H:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM yyyy",Y:"MMMM yyyy"},"/":".",":":":",firstDay:1}}}}(this),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});
|
import React from 'react'
import ReactDOM from 'react-dom'
import App from '../dist/components/App.jsx'
ReactDOM.render(<App/>, document.getElementById("app"))
|
const Joi = require('@hapi/joi');
const joiValidateMiddleware = require('../lib');
const schema = {
params: {
id: Joi.number().required(),
},
body: {
content: Joi.string().required(),
}
};
const validate = joiValidateMiddleware.create(schema);
const successRequest = {
params: {
id: 1,
},
body: {
content: 'test',
}
};
validate(successRequest);
console.log('success');
const errorRequest = {
params: {
id: 'other',
},
};
try {
validate(errorRequest);
console.log('fail');
} catch (e) {
console.log('success');
}
|
var class_transaction_table_priv =
[
[ "TransactionTablePriv", "class_transaction_table_priv.html#a9108e7397a5cb05f024481d581cce2fa", null ],
[ "describe", "class_transaction_table_priv.html#ab08d44e16bf6dd95b5b83959b3013780", null ],
[ "getTxHex", "class_transaction_table_priv.html#a68d059eac0b96f449465f81a2043802a", null ],
[ "index", "class_transaction_table_priv.html#ac692aa6aa7820e80accc971c70e0fae5", null ],
[ "refreshWallet", "class_transaction_table_priv.html#a1f81da5d7cfb2aac03a5e18e6bc91792", null ],
[ "size", "class_transaction_table_priv.html#acc5c85ae550eca3a35b7b4d68d0994bf", null ],
[ "updateAddressBook", "class_transaction_table_priv.html#a64b4af9c63dd61cffc2dac39b933449d", null ],
[ "updateWallet", "class_transaction_table_priv.html#a5a8454ce91251c4d9eb927bf2850745c", null ],
[ "cachedWallet", "class_transaction_table_priv.html#a410380e0d05152cf1d121f0ba0727ea8", null ],
[ "parent", "class_transaction_table_priv.html#a358d460cf7c3074fba12d03cdc5f638d", null ],
[ "wallet", "class_transaction_table_priv.html#a01cb7d238e5dea44b9f7f1ee75d5849d", null ]
];
|
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
var code_frame_1 = require("@babel/code-frame");
var fs_1 = require("fs");
var path_1 = __importDefault(require("path"));
var source_map_1 = require("source-map");
var url_1 = __importDefault(require("url"));
// eslint-disable-next-line import/no-extraneous-dependencies
// @ts-ignore
var webpack_1 = __importDefault(require("webpack"));
var getRawSourceMap_1 = require("./internal/helpers/getRawSourceMap");
var launchEditor_1 = require("./internal/helpers/launchEditor");
var isWebpack5 = parseInt(webpack_1["default"].version) === 5;
function getModuleId(compilation, module) {
if (isWebpack5) {
return compilation.chunkGraph.getModuleId(module);
}
return module.id;
}
function getModuleSource(compilation, module) {
var _a, _b, _c;
if (isWebpack5) {
return ((_b = (module && ((_a = compilation.codeGenerationResults
.get(module)) === null || _a === void 0 ? void 0 : _a.sources.get('javascript')))) !== null && _b !== void 0 ? _b : null);
}
return ((_c = module === null || module === void 0 ? void 0 : module.source(compilation.dependencyTemplates, compilation.runtimeTemplate)) !== null && _c !== void 0 ? _c : null);
}
function getSourcePath(source) {
// Webpack prefixes certain source paths with this path
if (source.startsWith('webpack:///')) {
return source.substring(11);
}
// Make sure library name is filtered out as well
if (source.startsWith('webpack://_N_E/')) {
return source.substring(15);
}
if (source.startsWith('webpack://')) {
return source.substring(10);
}
return source;
}
function findOriginalSourcePositionAndContent(webpackSource, position) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var consumer, sourcePosition, sourceContent;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, new source_map_1.SourceMapConsumer(webpackSource.map())];
case 1:
consumer = _c.sent();
try {
sourcePosition = consumer.originalPositionFor({
line: position.line,
column: (_a = position.column) !== null && _a !== void 0 ? _a : 0
});
if (!sourcePosition.source) {
return [2 /*return*/, null];
}
sourceContent = (_b = consumer.sourceContentFor(sourcePosition.source,
/* returnNullOnMissing */ true)) !== null && _b !== void 0 ? _b : null;
return [2 /*return*/, {
sourcePosition: sourcePosition,
sourceContent: sourceContent
}];
}
finally {
consumer.destroy();
}
return [2 /*return*/];
}
});
});
}
function createOriginalStackFrame(_a) {
var line = _a.line, column = _a.column, source = _a.source, rootDirectory = _a.rootDirectory, frame = _a.frame;
var _b, _c, _d;
return __awaiter(this, void 0, void 0, function () {
var result, sourcePosition, sourceContent, filePath, originalFrame, originalCodeFrame;
return __generator(this, function (_e) {
switch (_e.label) {
case 0: return [4 /*yield*/, findOriginalSourcePositionAndContent(source, {
line: line,
column: column
})];
case 1:
result = _e.sent();
if (result === null) {
return [2 /*return*/, null];
}
sourcePosition = result.sourcePosition, sourceContent = result.sourceContent;
if (!sourcePosition.source) {
return [2 /*return*/, null];
}
filePath = path_1["default"].resolve(rootDirectory, getSourcePath(sourcePosition.source));
originalFrame = {
file: sourceContent
? path_1["default"].relative(rootDirectory, filePath)
: sourcePosition.source,
lineNumber: sourcePosition.line,
column: sourcePosition.column,
methodName: frame.methodName,
arguments: []
};
originalCodeFrame = !((_c = (_b = originalFrame.file) === null || _b === void 0 ? void 0 : _b.includes('node_modules')) !== null && _c !== void 0 ? _c : true) &&
sourceContent &&
sourcePosition.line
? code_frame_1.codeFrameColumns(sourceContent, {
start: {
line: sourcePosition.line,
column: (_d = sourcePosition.column) !== null && _d !== void 0 ? _d : 0
}
}, { forceColor: true })
: null;
return [2 /*return*/, {
originalStackFrame: originalFrame,
originalCodeFrame: originalCodeFrame
}];
}
});
});
}
exports.createOriginalStackFrame = createOriginalStackFrame;
function getOverlayMiddleware(options) {
function getSourceById(isServerSide, isFile, id) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var fileContent, map_1, compilation_1, module_1;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
if (!isFile) return [3 /*break*/, 2];
return [4 /*yield*/, fs_1.promises
.readFile(id, 'utf-8')["catch"](function () { return null; })];
case 1:
fileContent = _c.sent();
if (fileContent == null) {
return [2 /*return*/, null];
}
map_1 = getRawSourceMap_1.getRawSourceMap(fileContent);
if (map_1 == null) {
return [2 /*return*/, null];
}
return [2 /*return*/, {
map: function () {
return map_1;
}
}];
case 2:
try {
compilation_1 = isServerSide
? (_a = options.serverStats()) === null || _a === void 0 ? void 0 : _a.compilation : (_b = options.stats()) === null || _b === void 0 ? void 0 : _b.compilation;
if (compilation_1 == null) {
return [2 /*return*/, null];
}
module_1 = __spread(compilation_1.modules).find(function (searchModule) { return getModuleId(compilation_1, searchModule) === id; });
return [2 /*return*/, getModuleSource(compilation_1, module_1)];
}
catch (err) {
console.error("Failed to lookup module by ID (\"" + id + "\"):", err);
return [2 /*return*/, null];
}
return [2 /*return*/];
}
});
});
}
return function (req, res, next) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
return __awaiter(this, void 0, void 0, function () {
var _p, pathname, query, frame, isServerSide, moduleId, source, err_1, frameLine, frameColumn, originalStackFrameResponse, err_2, frame, frameFile, filePath, fileExists, frameLine, frameColumn, err_3;
return __generator(this, function (_q) {
switch (_q.label) {
case 0:
_p = url_1["default"].parse(req.url, true), pathname = _p.pathname, query = _p.query;
if (!(pathname === '/__nextjs_original-stack-frame')) return [3 /*break*/, 9];
frame = query;
if (!((((_a = frame.file) === null || _a === void 0 ? void 0 : _a.startsWith('webpack-internal:///')) || ((_b = frame.file) === null || _b === void 0 ? void 0 : _b.startsWith('file://'))) &&
Boolean(parseInt((_d = (_c = frame.lineNumber) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '', 10)))) {
res.statusCode = 400;
res.write('Bad Request');
return [2 /*return*/, res.end()];
}
isServerSide = frame.isServerSide === 'true';
moduleId = frame.file.replace(/^(webpack-internal:\/\/\/|file:\/\/)/, '');
source = void 0;
_q.label = 1;
case 1:
_q.trys.push([1, 3, , 4]);
return [4 /*yield*/, getSourceById(isServerSide, frame.file.startsWith('file:'), moduleId)];
case 2:
source = _q.sent();
return [3 /*break*/, 4];
case 3:
err_1 = _q.sent();
console.log('Failed to get source map:', err_1);
res.statusCode = 500;
res.write('Internal Server Error');
return [2 /*return*/, res.end()];
case 4:
if (source == null) {
res.statusCode = 204;
res.write('No Content');
return [2 /*return*/, res.end()];
}
frameLine = parseInt((_f = (_e = frame.lineNumber) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : '', 10);
frameColumn = parseInt((_h = (_g = frame.column) === null || _g === void 0 ? void 0 : _g.toString()) !== null && _h !== void 0 ? _h : '', 10);
if (!frameColumn) {
frameColumn = null;
}
_q.label = 5;
case 5:
_q.trys.push([5, 7, , 8]);
return [4 /*yield*/, createOriginalStackFrame({
line: frameLine,
column: frameColumn,
source: source,
frame: frame,
rootDirectory: options.rootDirectory
})];
case 6:
originalStackFrameResponse = _q.sent();
if (originalStackFrameResponse === null) {
res.statusCode = 204;
res.write('No Content');
return [2 /*return*/, res.end()];
}
res.statusCode = 200;
res.setHeader('Content-Type', 'application/json');
res.write(Buffer.from(JSON.stringify(originalStackFrameResponse)));
return [2 /*return*/, res.end()];
case 7:
err_2 = _q.sent();
console.log('Failed to parse source map:', err_2);
res.statusCode = 500;
res.write('Internal Server Error');
return [2 /*return*/, res.end()];
case 8: return [3 /*break*/, 15];
case 9:
if (!(pathname === '/__nextjs_launch-editor')) return [3 /*break*/, 15];
frame = query;
frameFile = ((_j = frame.file) === null || _j === void 0 ? void 0 : _j.toString()) || null;
if (frameFile == null) {
res.statusCode = 400;
res.write('Bad Request');
return [2 /*return*/, res.end()];
}
filePath = path_1["default"].resolve(options.rootDirectory, frameFile);
return [4 /*yield*/, fs_1.promises.access(filePath, fs_1.constants.F_OK).then(function () { return true; }, function () { return false; })];
case 10:
fileExists = _q.sent();
if (!fileExists) {
res.statusCode = 204;
res.write('No Content');
return [2 /*return*/, res.end()];
}
frameLine = parseInt((_l = (_k = frame.lineNumber) === null || _k === void 0 ? void 0 : _k.toString()) !== null && _l !== void 0 ? _l : '', 10) || 1;
frameColumn = parseInt((_o = (_m = frame.column) === null || _m === void 0 ? void 0 : _m.toString()) !== null && _o !== void 0 ? _o : '', 10) || 1;
_q.label = 11;
case 11:
_q.trys.push([11, 13, , 14]);
return [4 /*yield*/, launchEditor_1.launchEditor(filePath, frameLine, frameColumn)];
case 12:
_q.sent();
return [3 /*break*/, 14];
case 13:
err_3 = _q.sent();
console.log('Failed to launch editor:', err_3);
res.statusCode = 500;
res.write('Internal Server Error');
return [2 /*return*/, res.end()];
case 14:
res.statusCode = 204;
return [2 /*return*/, res.end()];
case 15: return [2 /*return*/, next()];
}
});
});
};
}
exports.getOverlayMiddleware = getOverlayMiddleware;
//# sourceMappingURL=middleware.js.map
|
// Smart container component
import React, { Component } from 'react';
import { Image } from 'react-native';
import { NoHeaderLayout } from '../components/NoHeaderLayout';
import { connect } from 'react-redux';
import { DrawerTitle } from '../components/DrawerTitle';
// imports all action functions as an acitons object
import * as actions from '../actions/drawer';
// responsible for the drawer view
class DrawerContainer extends Component {
constructor(props) {
super(props);
}
render() {
return (
<NoHeaderLayout>
{/*
loginStatus needs to be passed to the title to determine whether the sign in button should be displayed or not.
If the user has logged in then their first name will be displayed instead of the sign in option
*/}
<DrawerTitle loginStatus = {this.props.loginStatus}/>
</NoHeaderLayout>
);
}
}
// returns an object
const mapStateToProps = (appState, navigationState) => ({
navigation: navigationState.navigation,
screenProps: navigationState.screenProps,
navigatorStack: appState.navigatorStack,
// DrawerContainer container component needs to have access to the loginStatus attribute
// of the store so that it can display the Sign in option depending only on whether the user has logged in or not
loginStatus: appState.loginStatus
});
// returns an object
const mapDispatchToProps = dispatch => ({
});
export default connect(mapStateToProps, null)(DrawerContainer);
|
function randDate() {
return new Date(Date.now() - Math.floor(Math.random() * 3600000));
}
// Seed data to cloud-recipes (make sure MONGO_INITDB_DATABASE is set to cloud-recipes).
db.users.drop();
db.users.insertMany([
{
username: 'admin',
email: 'superuser@example.com',
age: 40,
createdAt: randDate(),
},
{
username: 'chan',
email: 'michael.chan@example.com',
age: 24,
createdAt: randDate(),
},
{
username: 'john',
email: 'jonny@example.com',
age: 31,
createdAt: randDate(),
},
]);
// Create index on username.
db.users.createIndex({
username: 1,
}, null);
|
(function () {
angular.module('app')
.controller('homeController', ['$scope', 'scenes', homeController]);
function homeController($scope, scenes) {
var vm = $scope;
vm.scenes = scenes;
}
})()
|
import { AppRegistry } from 'react-native';
import bg from './bg'; // <-- Import the file you created in (2)
import App from './App';
AppRegistry.registerComponent('notification', () => App);
AppRegistry.registerHeadlessTask('RNFirebaseBackgroundMessage', () => bg);
|
/* eslint-disable import/prefer-default-export */
// eslint-disable-next-line import/no-cycle
import { Card } from './card';
// eslint-disable-next-line import/no-cycle
import { api2 } from '../index';
export class CardList {
constructor(container) {
this.container = container;
}
get asElement() {
return this.container;
}
addCard = (name, link) => {
const card = new Card(name, link);
card.renderCard();
this.container.appendChild(card.asElement);
}
render = () => {
api2
.getInitialCards()
.then((res) => {
// eslint-disable-next-line no-shadow
res.forEach((res) => {
this.addCard(res.name, res.link);
});
})
.catch((err) => {
// eslint-disable-next-line no-console
console.log(err);
});
}
}
|
/*
* Copyright 2017 ThoughtWorks, 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.
*/
// This is the starting point for booting up jasmine
function importAll(r) {
r.keys().forEach(r);
}
// ensure that helpers are loaded before anything else
importAll(require.context('./helpers', true, /\.js$/));
importAll(require.context('./lib', true, /\.js$/));
importAll(require.context('./models', true, /\.js$/));
importAll(require.context('./views', true, /\.js$/));
|
/**
* This class has been deprecated. Use `Ext.data.schema.Schema` instead.
*/
Ext.define('Ext.data.ModelManager', {
alternateClassName: 'Ext.ModelMgr',
requires: [
'Ext.data.schema.Schema'
],
singleton: true,
deprecated: {
5: {
methods: {
clear: null,
create: function (data, name, id) {
var T = name;
if (!T.isEntity) {
T = this.getModel(name || data.name);
}
return T.createWithId(id, data);
},
each: function(fn, scope) {
Ext.data.Model.schema.eachEntity(fn, scope);
},
get: function(name) {
return this.getModel(name);
},
getCount: function() {
return Ext.data.Model.schema.entityCount;
},
/**
* @method getModel
* Returns the {@link Ext.data.Model} class for a given model name
* @param {String/Object} id The classname of the model or the model class itself.
* @return {Ext.data.Model} a model class.
* @deprecated 5.0 Use {@link Ext.data.schema.Schema#lookupEntity} instead.
*/
getModel: function (id) {
return Ext.data.schema.Schema.lookupEntity(id);
},
isRegistered: function(name) {
return !!this.getModel(name);
}
}
}
}
});
|
var PSocket = require('./socket');
/*
* Layer a PSocket on top of a net.Socket
*/
exports.toPSocket = function(socket) {
return new PSocket(socket);
}
/*
* Attaches events to bubble up to a PSocket
*/
exports.attachEvents = function(socket) {
socket.on('error', function(e) {
if (this._psocket) this._psocket.emit('error', e);
});
socket.on('close', function() {
if (this._psocket) this._psocket.emit('close');
});
socket.on('timeout', function() {
if (this._psocket) this._psocket.emit('timeout')
});
socket.on('end', function() {
if (this._psocket) this._psocket.emit('end');
});
socket.on('data', function(data) {
if (this._psocket) this._psocket.emit('data', data);
});
}
/*
* Randomly generate ID, and ensures unique
*/
exports.generateId = function(dest) {
var id = Math.random().toString(16).substr(2);
if (dest[id]) return generateId(dest);
return id;
}
/*
* Remove current events from the socket
*/
exports.removeEvents = function(socket) {
if (socket && socket.removeAllListeners) {
socket.removeAllListeners();
return true;
}
return false;
}
/*
* Calculates which servers to avoid
* Returns back an array of server tags
*/
exports.calcAvoidServers = function(serverObjs) {
var servertags = Object.keys(serverObjs);
if (!servertags.length) return [];
var results = servertags.filter(function(ele, idx, arr) {
var lastTime = serverObjs[ele][0];
var timeoutLen = serverObjs[ele][1];
var timeElapsed = (Date.now() - lastTime) / 1000 / 60;
if (timeElapsed >= timeoutLen) {
return false;
} else {
return ele;
}
});
return results;
}
/*
* Calculate avoid server times
* Expects and returns [Time Last Checked, Time out length]
*/
exports.calcServerTimeout = function(arr) {
if (arr && arr.length) {
var lastTime = arr[0];
var timeoutLen = arr[1];
var timeElapsed = (Date.now() - lastTime) / 1000 / 60;
// time has passed, double timeout
if (timeElapsed >= timeoutLen) {
timeoutLen = timeoutLen * 2;
if (timeoutLen >= 128) timeoutLen = 128;
return [Date.now(), timeoutLen];
} else {
// elapsed time hasn't passed to do anything
return arr;
}
} else {
// new timeout
return [Date.now(), 2];
}
}
/*
* Example:
* [1,2,3] - [2] = [1,3]
*/
exports.arrayDiff = function(arr, arr2) {
return arr.filter(function(ele, idx, a) {
return (arr2.every(function(ele2, idx2, a2) {
return (ele2 !== ele);
}));
});
}
/*
* Backwards compat setImmediate
*/
var delayFn;
if (typeof setImmediate !== 'undefined') {
delayFn = setImmediate;
} else {
delayFn = function(fn, arg) {
setTimeout(function() {
fn(arg);
}, 0);
}
}
exports.delayCall = function(fn, arg) {
delayFn(fn, arg);
}
|
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'clipboard', 'sr', {
copy: 'Копирај',
copyError: 'Сигурносна подешавања Вашег претраживача не дозвољавају операције аутоматског копирања текста. Молимо Вас да користите пречицу са тастатуре (Ctrl/Cmd+C).',
cut: 'Исеци',
cutError: 'Сигурносна подешавања Вашег претраживача не дозвољавају операције аутоматског исецања текста. Молимо Вас да користите пречицу са тастатуре (Ctrl/Cmd+X).',
paste: 'Залепи',
pasteArea: 'Paste Area', // MISSING
pasteMsg: 'Молимо Вас да залепите унутар доње површине користећи тастатурну пречицу (<STRONG>Ctrl/Cmd+V</STRONG>) и да притиснете <STRONG>OK</STRONG>.',
securityMsg: 'Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.', // MISSING
title: 'Залепи'
});
|
/**
* The copyright in this software is being made available under the BSD License,
* included below. This software may be subject to other third party and contributor
* rights, including patent rights, and no such rights are granted under this license.
*
* Copyright (c) 2013, Dash Industry Forum.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* * Neither the name of Dash Industry Forum nor the names of its
* contributors may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _voKeyPair = require('../vo/KeyPair');
var _voKeyPair2 = _interopRequireDefault(_voKeyPair);
var _voClearKeyKeySet = require('../vo/ClearKeyKeySet');
var _voClearKeyKeySet2 = _interopRequireDefault(_voClearKeyKeySet);
var _CommonEncryption = require('../CommonEncryption');
var _CommonEncryption2 = _interopRequireDefault(_CommonEncryption);
var _coreFactoryMaker = require('../../../core/FactoryMaker');
var _coreFactoryMaker2 = _interopRequireDefault(_coreFactoryMaker);
var uuid = '1077efec-c0b2-4d02-ace3-3c1e52e2fb4b';
var systemString = 'org.w3.clearkey';
var schemeIdURI = 'urn:uuid:' + uuid;
function KeySystemClearKey() {
var instance = undefined;
/**
* Returns desired clearkeys (as specified in the CDM message) from protection data
*
* @param {ProtectionData} protectionData the protection data
* @param {ArrayBuffer} message the ClearKey CDM message
* @returns {ClearKeyKeySet} the key set or null if none found
* @throws {Error} if a keyID specified in the CDM message was not found in the
* protection data
* @memberof KeySystemClearKey
*/
function getClearKeysFromProtectionData(protectionData, message) {
var clearkeySet = null;
if (protectionData) {
// ClearKey is the only system that does not require a license server URL, so we
// handle it here when keys are specified in protection data
var jsonMsg = JSON.parse(String.fromCharCode.apply(null, new Uint8Array(message)));
var keyPairs = [];
for (var i = 0; i < jsonMsg.kids.length; i++) {
var clearkeyID = jsonMsg.kids[i];
var clearkey = protectionData.clearkeys.hasOwnProperty(clearkeyID) ? protectionData.clearkeys[clearkeyID] : null;
if (!clearkey) {
throw new Error('DRM: ClearKey keyID (' + clearkeyID + ') is not known!');
}
// KeyIDs from CDM are not base64 padded. Keys may or may not be padded
keyPairs.push(new _voKeyPair2['default'](clearkeyID, clearkey));
}
clearkeySet = new _voClearKeyKeySet2['default'](keyPairs);
}
return clearkeySet;
}
function getInitData(cp) {
return _CommonEncryption2['default'].parseInitDataFromContentProtection(cp);
}
function getRequestHeadersFromMessage() /*message*/{
return null;
}
function getLicenseRequestFromMessage(message) {
return new Uint8Array(message);
}
function getLicenseServerURLFromInitData() /*initData*/{
return null;
}
instance = {
uuid: uuid,
schemeIdURI: schemeIdURI,
systemString: systemString,
getInitData: getInitData,
getRequestHeadersFromMessage: getRequestHeadersFromMessage,
getLicenseRequestFromMessage: getLicenseRequestFromMessage,
getLicenseServerURLFromInitData: getLicenseServerURLFromInitData,
getClearKeysFromProtectionData: getClearKeysFromProtectionData
};
return instance;
}
KeySystemClearKey.__dashjs_factory_name = 'KeySystemClearKey';
exports['default'] = _coreFactoryMaker2['default'].getSingletonFactory(KeySystemClearKey);
module.exports = exports['default'];
//# sourceMappingURL=KeySystemClearKey.js.map
|
/*
Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'forms', 'hu', {
button: {
title: 'Gomb tulajdonságai',
text: 'Szöveg (Érték)',
type: 'Típus',
typeBtn: 'Gomb',
typeSbm: 'Küldés',
typeRst: 'Alaphelyzet'
},
checkboxAndRadio: {
checkboxTitle: 'Jelölőnégyzet tulajdonságai',
radioTitle: 'Választógomb tulajdonságai',
value: 'Érték',
selected: 'Kiválasztott',
required: 'Kötelező'
},
form: {
title: 'Űrlap tulajdonságai',
menu: 'Űrlap tulajdonságai',
action: 'Adatfeldolgozást végző hivatkozás',
method: 'Adatküldés módja',
encoding: 'Kódolás'
},
hidden: {
title: 'Rejtett mező tulajdonságai',
name: 'Név',
value: 'Érték'
},
select: {
title: 'Legördülő lista tulajdonságai',
selectInfo: 'Alaptulajdonságok',
opAvail: 'Elérhető opciók',
value: 'Érték',
size: 'Méret',
lines: 'sor',
chkMulti: 'több sor is kiválasztható',
required: 'Kötelező',
opText: 'Szöveg',
opValue: 'Érték',
btnAdd: 'Hozzáad',
btnModify: 'Módosít',
btnUp: 'Fel',
btnDown: 'Le',
btnSetValue: 'Legyen az alapértelmezett érték',
btnDelete: 'Töröl'
},
textarea: {
title: 'Szövegterület tulajdonságai',
cols: 'Karakterek száma egy sorban',
rows: 'Sorok száma'
},
textfield: {
title: 'Szövegmező tulajdonságai',
name: 'Név',
value: 'Érték',
charWidth: 'Megjelenített karakterek száma',
maxChars: 'Maximális karakterszám',
required: 'Kötelező',
type: 'Típus',
typeText: 'Szöveg',
typePass: 'Jelszó',
typeEmail: 'Ímél',
typeSearch: 'Keresés',
typeTel: 'Telefonszám',
typeUrl: 'URL'
}
} );
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"0c171786d2509afad68a":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123");e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},"1753bbe43245bae19898":function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},"19425ead75bba88da318":function(e,t,n){"use strict";var r=n("ff2e668c0c59935e30de");e.exports=function(e,t,n){var o=n.config.validateStatus;!o||o(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},"289c96ed03271763a3a9":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123"),o=n("443f930b60798cfedf71"),a=n("5dfc216e0b9559a5e74b"),i=n("44c1fc35bd273cc4f7a9");function s(e){var t=new a(e),n=o(a.prototype.request,t);return r.extend(n,a.prototype,t),r.extend(n,t),n}var c=s(n("764eabf2370962c4cad0"));c.Axios=a,c.create=function(e){return s(i(c.defaults,e))},c.Cancel=n("f3f9cf0ae64305a42cd6"),c.CancelToken=n("efd0adb76568cdad4116"),c.isCancel=n("b8e7bb6f2e080f7f5d1b"),c.all=function(e){return Promise.all(e)},c.spread=n("8bd221e6c52c12f3bc2c"),e.exports=c,e.exports.default=c},"3541244d5a4ffc714985":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123"),o=n("0c171786d2509afad68a"),a=n("b8e7bb6f2e080f7f5d1b"),i=n("764eabf2370962c4cad0");function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||i.adapter)(e).then(function(t){return s(e),t.data=o(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(s(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},"443f930b60798cfedf71":function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},"44c1fc35bd273cc4f7a9":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123");e.exports=function(e,t){t=t||{};var n={},o=["url","method","params","data"],a=["headers","auth","proxy"],i=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,function(e){"undefined"!==typeof t[e]&&(n[e]=t[e])}),r.forEach(a,function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!==typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!==typeof e[o]&&(n[o]=e[o])}),r.forEach(i,function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])});var s=o.concat(a).concat(i),c=Object.keys(t).filter(function(e){return-1===s.indexOf(e)});return r.forEach(c,function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])}),n}},"48e5915ed6b2de40fdd7":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123");function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},"4f99c0c326ebbe735716":function(e,t,n){"use strict";var r=n("a79cb4368efe9573d743"),o=n("e97ff122bd8cd321b17e");e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},"5dfc216e0b9559a5e74b":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123"),o=n("9c18c4e613628d1ec624"),a=n("48e5915ed6b2de40fdd7"),i=n("3541244d5a4ffc714985"),s=n("44c1fc35bd273cc4f7a9");function c(e){this.defaults=e,this.interceptors={request:new a,response:new a}}c.prototype.request=function(e){"string"===typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},c.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(e){c.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}}),r.forEach(["post","put","patch"],function(e){c.prototype[e]=function(t,n,o){return this.request(r.merge(o||{},{method:e,url:t,data:n}))}}),e.exports=c},"655bf49f5cf2372da693":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123"),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,a,i={};return e?(r.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=r.trim(e.substr(0,a)).toLowerCase(),n=r.trim(e.substr(a+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}}),i):i}},"660d4b2f7a764f4f02a4":function(e,t,n){"use strict";e.exports=function(e){return/(\b)(on\w+)=|javascript|(<\s*)(\/*)script/gi.test(e)}},"764eabf2370962c4cad0":function(e,t,n){"use strict";(function(t){var r=n("d691ab6a01eacf6bd123"),o=n("f0fa722f89afc6c5f151"),a={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,c={adapter:("undefined"!==typeof XMLHttpRequest?s=n("8c7aae232bd71b30a8a9"):"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t)&&(s=n("8c7aae232bd71b30a8a9")),s),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(i(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(e){c.headers[e]={}}),r.forEach(["post","put","patch"],function(e){c.headers[e]=r.merge(a)}),e.exports=c}).call(this,n("26d59f808dff3e83c741"))},"8bd221e6c52c12f3bc2c":function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"8c7aae232bd71b30a8a9":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123"),o=n("19425ead75bba88da318"),a=n("9c18c4e613628d1ec624"),i=n("4f99c0c326ebbe735716"),s=n("655bf49f5cf2372da693"),c=n("f1c2ad17bf5891207603"),f=n("ff2e668c0c59935e30de");e.exports=function(e){return new Promise(function(t,u){var d=e.data,p=e.headers;r.isFormData(d)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",b=e.auth.password||"";p.Authorization="Basic "+btoa(h+":"+b)}var m=i(e.baseURL,e.url);if(l.open(e.method.toUpperCase(),a(m,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?s(l.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l};o(t,u,r),l=null}},l.onabort=function(){l&&(u(f("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){u(f("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),u(f(t,e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var y=n("bbf908b1cf347edcd951"),g=(e.withCredentials||c(m))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;g&&(p[e.xsrfHeaderName]=g)}if("setRequestHeader"in l&&r.forEach(p,function(e,t){"undefined"===typeof d&&"content-type"===t.toLowerCase()?delete p[t]:l.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"===typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),u(e),l=null)}),void 0===d&&(d=null),l.send(d)})}},"9c18c4e613628d1ec624":function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123");function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var a;if(n)a=n(t);else if(r.isURLSearchParams(t))a=t.toString();else{var i=[];r.forEach(t,function(e,t){null!==e&&"undefined"!==typeof e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),i.push(o(t)+"="+o(e))}))}),a=i.join("&")}if(a){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},a79cb4368efe9573d743:function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},b8e7bb6f2e080f7f5d1b:function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},bbf908b1cf347edcd951:function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123");e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,a,i){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(a)&&s.push("domain="+a),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},bd183afcc37eabd79225:function(e,t,n){e.exports=n("289c96ed03271763a3a9")},d691ab6a01eacf6bd123:function(e,t,n){"use strict";var r=n("443f930b60798cfedf71"),o=Object.prototype.toString;function a(e){return"[object Array]"===o.call(e)}function i(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!i(e)&&null!==e.constructor&&!i(e.constructor)&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!==typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"===typeof e},isNumber:function(e){return"number"===typeof e},isObject:s,isUndefined:i,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return s(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!==typeof window&&"undefined"!==typeof document},forEach:f,merge:function e(){var t={};function n(n,r){"object"===typeof t[r]&&"object"===typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,o=arguments.length;r<o;r++)f(arguments[r],n);return t},deepMerge:function e(){var t={};function n(n,r){"object"===typeof t[r]&&"object"===typeof n?t[r]=e(t[r],n):t[r]="object"===typeof n?e({},n):n}for(var r=0,o=arguments.length;r<o;r++)f(arguments[r],n);return t},extend:function(e,t,n){return f(t,function(t,o){e[o]=n&&"function"===typeof t?r(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},e97ff122bd8cd321b17e:function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},efd0adb76568cdad4116:function(e,t,n){"use strict";var r=n("f3f9cf0ae64305a42cd6");function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},f0fa722f89afc6c5f151:function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123");e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},f1c2ad17bf5891207603:function(e,t,n){"use strict";var r=n("d691ab6a01eacf6bd123"),o=n("660d4b2f7a764f4f02a4");e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function a(e){var r=e;if(o(e))throw new Error("URL contains XSS injection attempt");return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=a(window.location.href),function(t){var n=r.isString(t)?a(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},f3f9cf0ae64305a42cd6:function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},ff2e668c0c59935e30de:function(e,t,n){"use strict";var r=n("1753bbe43245bae19898");e.exports=function(e,t,n,o,a){var i=new Error(e);return r(i,t,n,o,a)}}}]);
|
/*
* Backpack - Skyscanner's Design System
*
* Copyright 2016-2020 Skyscanner Ltd
*
* 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.
*/
/* @flow */
import { Platform, View } from 'react-native';
import React from 'react';
import {
spacingMd,
spacingBase,
lineColor,
} from 'bpk-tokens/tokens/base.react.native';
import {
BpkDynamicStyleSheet,
useBpkDynamicStyleSheet,
} from '../../bpk-appearance';
const dynamicStyles = BpkDynamicStyleSheet.create({
separator: {
flex: 1,
height: 1, // eslint-disable-line backpack/use-tokens
backgroundColor: lineColor,
...Platform.select({
ios: {
marginLeft: spacingBase,
},
android: {
marginHorizontal: spacingMd,
},
}),
},
});
const BpkFlatListItemSeparator = () => {
const styles = useBpkDynamicStyleSheet(dynamicStyles);
return <View style={styles.separator} />;
};
export default BpkFlatListItemSeparator;
|
const mongoose = require("mongoose");
let userSchema = new mongoose.Schema(
{
username: { type: String, required: true },
email: { type: String, required: true },
passphrase: { type: String, required: true },
token: { type: String, required: true },
},
{ timestamps: true, strict: true }
);
let User = mongoose.model("User", userSchema);
module.exports = User;
|
define({
certainly: 'OK',
autoEnabledTip: 'Automaattinen asettelu on käytössä. Pienoisohjelmat synkronoidaan kohteessa {label} olevien kanssa ja järjestetään automaattisesti.',
autoDisabledTip: 'Ota automaattinen asettelu käyttöön napsauttamalla.',
/* eslint-disable-next-line */
customEnabledTip: 'Mukautettu asettelu on käytössä. Muissa laitetiloissa lisättyjä pienoisohjelmia ei lisätä automaattisesti tänne. Voit vaihtoehtoisesti lisätä ne manuaalisesti Lisää-ruudun odottavien kohteiden luettelosta.',
customDisabledTip: 'Ota mukautettu asettelu käyttöön napsauttamalla.',
confirm: 'Vahvista',
enableConfirm: 'Haluatko varmasti ottaa sen käyttöön?',
autoConfirmMsg:'Kun {auto} otetaan käyttöön, pienoisohjelmat synkronoidaan kohteessa {label} olevien widgetien kanssa ja järjestetään automaattisesti.',
customConfirmMsg1: 'Jos {custom} otetaan käyttöön, voit järjestää pienoisohjelmia manuaalisesti tässä laitteen tilassa.',
/* eslint-disable-next-line */
customConfirmMsg2: 'Muissa laitetiloissa lisättyjä pienoisohjelmia ei kuitenkaan lisätä automaattisesti tänne. Voit vaihtoehtoisesti lisätä ne manuaalisesti Lisää-ruudun odottavien kohteiden luettelosta.',
dragToResize: 'Muuta kokoa vetämällä',
largeScreen: 'Suurinäyttöinen laite',
mediumScreen: 'Laite, jossa on keskikokoinen näyttö',
smallScreen: 'Pieninäyttöinen laite',
deleteWarning: 'Pienoisohjelman poistaminen poistaa sen kaikkien laitteiden näkymistä. Poista se nykyisen laitteen näkymästä ja säilytä se muissa valitsemalla Siirrä odottavien luetteloon -painike.',
confirmDelete: 'Haluatko varmasti poistaa tämän pienoisohjelman kaikista laitteista?',
});
|
'use strict';
var DateUnits = require('../var/DateUnits'),
DateUnitIndexes = require('../var/DateUnitIndexes'),
isUndefined = require('../../common/internal/isUndefined');
var YEAR_INDEX = DateUnitIndexes.YEAR_INDEX;
function iterateOverDateUnits(fn, startIndex, endIndex) {
endIndex = endIndex || 0;
if (isUndefined(startIndex)) {
startIndex = YEAR_INDEX;
}
for (var index = startIndex; index >= endIndex; index--) {
if (fn(DateUnits[index], index) === false) {
break;
}
}
}
module.exports = iterateOverDateUnits;
|
// load environment properties from a .env file for local development
require('dotenv').load({ silent: true });
const app = require('./app.js');
const port = process.env.PORT || process.env.VCAP_APP_PORT || 5000;
// Deployment tracking
require('cf-deployment-tracker-client').track();
app.listen(port);
console.log('listening at:', port); // eslint-disable-line
|
const express = require('express')
const axios = require('axios')
const router = express.Router()
module.exports = router
router.get('/_healthcheck', (req, res) => {
const graphqlUrl = req.query.graphql || process.env.GRAPHQL_URL
axios
.post(graphqlUrl, {
query: `
query HEALTHCHECK_QUERY {
__schema {
types {
name
}
}
}
`
})
.then(() => {
res.json({ health: 'OK' })
})
.catch(err => {
res.status(500).send(err.message)
})
})
|
sap.ui.define(["sap/ui/test/Opa5",
"sap/suite/ui/generic/template/integration/SalesOrderItemAggregation/pages/Common",
"sap/suite/ui/generic/template/integration/SalesOrderItemAggregation/pages/actions/ObjectPageActions",
"sap/suite/ui/generic/template/integration/SalesOrderItemAggregation/pages/assertions/ObjectPageAssertions",
"sap/suite/ui/generic/template/integration/ManageProducts_new/utils/OpaModel"],
function(Opa5, Common, ObjectPageActions, ObjectPageAssertions, OpaModel) {
"use strict";
var VIEWNAME = "Details";
var VIEWNAMESPACE = "sap.suite.ui.generic.template.ObjectPage.view.";
var PREFIX_ID = "SOITMAGGR::sap.suite.ui.generic.template.ObjectPage.view.Details::STTA_C_SO_ItemAggr--";
var SALESORDER_ENTITY_TYPE = "STTA_SALES_ORDER_ITEM_AGGR_SRV.STTA_C_SO_ItemAggrType";
var SALESORDER_ENTITY_SET = "STTA_C_SO_ItemAggr";
console.log ( "OPA5::ObjectPage::CONSTANTS "
+ " VIEWNAME: " + VIEWNAME
+ " VIEWNAMESPACE: " + VIEWNAMESPACE
+ " OP_PREFIX_ID: " + PREFIX_ID
+ " SALESORDER_ENTITY_TYPE: " + SALESORDER_ENTITY_TYPE
+ " SALESORDER_ENTITY_SET: " + SALESORDER_ENTITY_SET
);
var oPromise = new Promise(function(resolve){
OpaModel.metaModel.loaded().then(function(){
var oEntityType = OpaModel.getEntityType(SALESORDER_ENTITY_TYPE);
var oEntitySet = OpaModel.getEntitySet(SALESORDER_ENTITY_SET);
Opa5.createPageObjects({
onTheObjectPage: {
baseClass: Common,
actions: ObjectPageActions(PREFIX_ID, VIEWNAME, VIEWNAMESPACE),
assertions: ObjectPageAssertions(PREFIX_ID, VIEWNAME, VIEWNAMESPACE, oEntityType, oEntitySet)
}
});
resolve();
});
});
return {
CreatePageObjectPromise: oPromise
};
}
);
|
import request from '@/utils/request';
import { _baseApi } from '@/defaultSettings';
// 列表
export async function fetchList(params) {
return request(`${_baseApi}/article/listForOfficial`, {
method: 'POST',
body: params,
});
}
// 删除
export async function deleteList(params) {
return request(_baseApi + '/article/delete', {
method: 'POST',
body: params,
});
}
|
import Switch from './switch.vue';
export default Switch;
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* Asserts that a given argument's value is undefined.
* @param {object} a The argument to check.
*/
function assertUndefined(a) {
if (a !== undefined) {
throw new Error('Assertion failed: expected undefined');
}
}
/**
* Asserts that a given argument's value is null or undefined.
* @param {object} obj The argument to check.
* @param {string=} opt_message Error message if the condition is not met.
*/
function assertNullOrUndefined(obj, opt_message) {
if (obj !== undefined && obj !== null) {
throw new Error(
'Must be null or undefined: ' + (opt_message || '') + '\n' +
'Actual: ' + obj);
}
}
/**
* Asserts that the argument is neither null nor undefined.
* @param {object} obj The argument to check.
* @param {string=} opt_message Error message if the condition is not met.
*/
function assertNotNullNorUndefined(obj, opt_message) {
if (obj === undefined || obj === null) {
throw new Error(
'Can\'t be null or undefined: ' + (opt_message || '') + '\n' +
'Actual: ' + obj);
}
}
/**
* Asserts that a given function call throws an exception.
* @param {string} msg Message to print if exception not thrown.
* @param {Function} fn The function to call.
* @param {string} error The name of the exception we expect {@code fn} to
* throw.
*/
function assertException(msg, fn, error) {
try {
fn();
} catch (e) {
if (error && e.name !== error) {
throw new Error(
'Expected to throw ' + error + ' but threw ' + e.name + ' - ' + msg);
}
return;
}
throw new Error('Expected to throw exception ' + error + ' - ' + msg);
}
/**
* Asserts that two arrays of strings are equal.
* @param {Array<string>} array1 The expected array.
* @param {Array<string>} array2 The test array.
*/
function assertEqualStringArrays(array1, array2) {
let same = true;
if (array1.length !== array2.length) {
same = false;
}
for (let i = 0; i < Math.min(array1.length, array2.length); i++) {
if (array1[i].trim() !== array2[i].trim()) {
same = false;
}
}
if (!same) {
throw new Error(
'Expected ' + JSON.stringify(array1) + ', got ' +
JSON.stringify(array2));
}
}
/**
* Asserts that two objects have the same JSON serialization.
* @param {Object} expected The expected object.
* @param {Object} actual The actual object.
* @param {string=} opt_message Message used for errors.
*/
function assertEqualsJSON(expected, actual, opt_message) {
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
throw new Error(
(opt_message ? opt_message + '\n' : '') + 'Expected ' +
JSON.stringify(expected) + '\n' +
'Got ' + JSON.stringify(actual));
}
}
/**
* Asserts that two ArrayBuffers have the same content.
* @param {ArrayBuffer} arrayBufA The expected ArrayBuffer.
* @param {ArrayBuffer} arrayBufB The test ArrayBuffer.
*/
function assertArrayBuffersEquals(arrayBufA, arrayBufB) {
const view1 = new Uint8Array(arrayBufA);
const view2 = new Uint8Array(arrayBufB);
assertEquals(JSON.stringify(view1), JSON.stringify(view2));
}
/**
* Asserts that two Arrays have the same content.
* @param {ArrayBuffer} arrayA The expected array.
* @param {ArrayBuffer} arrayB The test array.
*/
function assertArraysEquals(arrayA, arrayB) {
assertEquals(JSON.stringify(arrayA), JSON.stringify(arrayB));
}
/**
* Asserts and fails immediately once called.
* @param {string=} opt_msg
*/
function assertNotReached(opt_msg) {
assertFalse(true, opt_msg);
}
/**
* Asserts an actual DOM equals an expected stringified DOM.
* @param {string} expected
* @param {Node} actual
*/
function assertEqualsDOM(expected, actual) {
expected = expected.replace(/>\s+</gm, '><').trim(/\s/gm);
let actualStr = actual.outerHTML;
actualStr = actualStr.replace(/>\s+</gm, '><').trim(/\s/gm);
for (let i = 0; i < expected.length; i++) {
assertEquals(
expected[i], actualStr[i],
'Mismatch at index ' + i + ' in expected:\n' + expected +
'\nactual:\n' + actualStr + '\n');
}
}
assertSame = assertEquals;
assertNotSame = assertNotEquals;
|
#!/usr/bin/env node
/* eslint-disable no-console */
/* eslint-disable camelcase */ // github API convention
/* eslint-env node */
const exitWithError = err => {
console.error('Error', err.stack);
if (err.data) {
console.error(err.data);
}
process.exit(1);
},
{
GITHUB_SHA, GITHUB_EVENT_PATH, GITHUB_TOKEN, GITHUB_WORKSPACE
} = process.env;
if (GITHUB_TOKEN == null) {
exitWithError(new Error('Missing Github token'));
}
if (GITHUB_EVENT_PATH == null) {
exitWithError(new Error('Can not find GITHUB_EVENT_PATH - is this run in Github Actions?'));
}
const https = require('https'),
request = (url, options) =>
new Promise((resolve, reject) => {
const req = https
.request(url, options, res => {
let data = '';
res.on('data', chunk => {
data += chunk;
});
res.on('end', () => {
if (res.statusCode >= 400) {
const err = new Error(`Received status code ${ res.statusCode }`);
err.response = res;
err.data = data;
reject(err);
} else {
resolve({
res,
data: JSON.parse(data)
});
}
});
})
.on('error', reject);
if (options.body) {
req.end(JSON.stringify(options.body));
} else {
req.end();
}
}),
event = require(GITHUB_EVENT_PATH),
{
repository: {
name: repo,
owner: {
login: owner
}
}
} = event,
checkName = 'ESLint check';
let checkSha = GITHUB_SHA;
if (event.pull_request) {
checkSha = event.pull_request.head.sha;
}
const headers = {
'Content-Type': 'application/json',
Accept: 'application/vnd.github.antiope-preview+json',
Authorization: `Bearer ${ GITHUB_TOKEN }`,
'User-Agent': 'eslint-action'
},
createCheck = async () => {
const { data } = await request(`https://api.github.com/repos/${ owner }/${ repo }/check-runs`, {
method: 'POST',
headers,
body: {
name: checkName,
head_sha: checkSha,
status: 'in_progress',
started_at: (new Date()).toISOString()
}
});
return data.id;
},
getChangedFiles = async targetBranch => {
const util = require('util'),
exec = util.promisify(require('child_process').exec),
{ stdout } = await exec(
`git diff origin/${targetBranch}... --name-only --diff-filter=d`
);
return stdout.trim().split('\n');
},
eslint = async () => {
const partialLinting = process.env.PARTIAL_LINTING; //false
let files = ['.'];
if (partialLinting && event.pull_request) {
const branch = event.pull_request.base.ref;
files = await getChangedFiles(branch);
}
const eslint = require('eslint'),
cli = new eslint.CLIEngine(),
report = cli.executeOnFiles(files),
// fixableErrorCount, fixableWarningCount are available too
levels = ['notice', 'warning', 'failure'];
const annotations = report.results.reduce((annoList, result) => {
const path = result.filePath.substring(GITHUB_WORKSPACE.length + 1);
return annoList.concat(result.messages.map(m => {
const singleLine = m.line === m.endLine || m.endLine === undefined;
return {
path,
start_column: singleLine ? m.column : undefined,
end_column: singleLine ? m.endColumn || m.column : undefined,
start_line: m.line,
end_line: m.endLine || m.line,
annotation_level: levels[m.severity],
// title: `${ path }#L${ m.line }`,
// raw_details: 'Nothing much',
message: `${ m.ruleId }: ${ m.message }`
};
}));
}, []),
{
errorCount, warningCount
} = report;
return {
annotations,
errorCount,
warningCount
};
},
updateCheck = async (id, opts = {}) =>
await request(`https://api.github.com/repos/${ owner }/${ repo }/check-runs/${ id }`, {
method: 'PATCH',
headers,
body: {
name: checkName,
head_sha: checkSha,
...opts
}
}),
updateChecks = async (id, {
errorCount, warningCount, annotations
}) => {
const chunkSize = 50,
chunksLength = Math.ceil(annotations.length / chunkSize);
await Promise.all(new Array(chunksLength).fill().map((_, i) => updateCheck(id, {
status: 'in_progress',
output: {
title: checkName,
summary: `${ errorCount } error(s), ${ warningCount } warning(s) found`,
annotations: annotations.slice(i * chunkSize, (i + 1) * chunkSize)
}
})));
await updateCheck(id, {
status: 'completed',
completed_at: (new Date()).toISOString(),
conclusion: errorCount > 0 ? 'failure' : warningCount > 0 && 'neutral' || 'success',
output: {
title: checkName,
summary: `${ errorCount } error(s), ${ warningCount } warning(s) found`
}
});
},
run = async () => {
const id = await createCheck();
try {
await updateChecks(id, await eslint());
} catch (err) {
await updateCheck(id, {
conclusion: 'failure',
status: 'completed',
completed_at: (new Date()).toISOString(),
output: {
title: checkName,
summary: `Error while performing the check: ${err.message}`
}
});
exitWithError(err);
}
};
run().catch(exitWithError);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.